diff --git a/seller_1/.vscode/extensions.json b/seller_1/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/seller_1/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/seller_1/dist/assets/BookManagement-C7U8yzN6.css b/seller_1/dist/assets/BookManagement-C7U8yzN6.css new file mode 100644 index 0000000..8b9e7be --- /dev/null +++ b/seller_1/dist/assets/BookManagement-C7U8yzN6.css @@ -0,0 +1 @@ +.book-management[data-v-b1cb9b1b]{max-width:1000px;margin:0 auto;padding:20px}.header[data-v-b1cb9b1b]{text-align:center;margin-bottom:20px}.header h2[data-v-b1cb9b1b]{font-size:2rem;margin:0}.book-list[data-v-b1cb9b1b]{display:flex;flex-wrap:wrap;gap:20px}.book-card[data-v-b1cb9b1b]{background-color:#fff;border-radius:8px;box-shadow:0 4px 8px #0000001a;padding:20px;width:240px;transition:transform .3s,box-shadow .3s;cursor:pointer}.book-card[data-v-b1cb9b1b]:hover{transform:translateY(-5px);box-shadow:0 6px 12px #0000001a}.book-details h3[data-v-b1cb9b1b]{font-size:1.2rem;margin:0}.card-actions button[data-v-b1cb9b1b]{margin-right:10px}.form-modal[data-v-b1cb9b1b]{background-color:#fff;border-radius:10px;padding:20px;width:400px;box-shadow:0 4px 8px #0000001a}.form-modal input[data-v-b1cb9b1b]{width:100%;padding:10px 0 10px 10px;margin-bottom:15px;border:1px solid #ccc;border-radius:5px}.form-buttons[data-v-b1cb9b1b]{display:flex;justify-content:space-between}.btn[data-v-b1cb9b1b]{padding:10px 20px;font-size:1rem;border-radius:5px;cursor:pointer;transition:background-color .3s}.add-btn[data-v-b1cb9b1b]{background-color:#1abc9c;color:#fff}.edit-btn[data-v-b1cb9b1b]{background-color:#3498db;color:#fff}.delete-btn[data-v-b1cb9b1b]{background-color:#e74c3c;color:#fff}.confirm-btn[data-v-b1cb9b1b]{background-color:#27ae60;color:#fff}.cancel-btn[data-v-b1cb9b1b]{background-color:#95a5a6;color:#fff}.btn[data-v-b1cb9b1b]:hover{opacity:.9}.modal-overlay[data-v-b1cb9b1b]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:999} diff --git a/seller_1/dist/assets/BookManagement-CoVkzWCf.js b/seller_1/dist/assets/BookManagement-CoVkzWCf.js new file mode 100644 index 0000000..e1019a1 --- /dev/null +++ b/seller_1/dist/assets/BookManagement-CoVkzWCf.js @@ -0,0 +1 @@ +import{_,r,c as d,a as t,t as i,w as h,b as v,v as b,d as q,F as x,e as B,o as p}from"./index-DnP9UZOY.js";const C={class:"book-management"},V={class:"header"},g={key:0,class:"modal-overlay"},w={class:"form-modal"},F={class:"form-buttons"},M={type:"submit",class:"btn confirm-btn"},U={class:"book-list"},A={class:"book-details"},D={class:"card-actions"},S=["onClick"],T=["onClick"],$={__name:"BookManagement",setup(I){const a=r([{id:1,title:"Vue.js 实战",author:"李白",price:59,quantity:100},{id:2,title:"React 快速入门",author:"张三",price:45,quantity:200}]),s=r(!1),u=r(!1),o=r({title:"",author:"",price:0,quantity:0}),c=()=>{s.value=!1,o.value={title:"",author:"",price:0,quantity:0},u.value=!1},m=()=>{if(u.value){const n=a.value.findIndex(e=>e.id===o.value.id);a.value[n]={...o.value}}else a.value.push({id:Date.now(),title:o.value.title,author:o.value.author,price:o.value.price,quantity:o.value.quantity});c()},k=n=>{o.value={...n},u.value=!0,s.value=!0},f=n=>{a.value=a.value.filter(e=>e.id!==n)};return(n,e)=>(p(),d("div",C,[t("header",V,[e[5]||(e[5]=t("h2",null,"图书管理",-1)),t("button",{onClick:e[0]||(e[0]=l=>s.value=!0),class:"btn add-btn"},"添加图书")]),s.value?(p(),d("div",g,[t("div",w,[t("h3",null,i(u.value?"编辑图书":"添加图书"),1),t("form",{onSubmit:h(m,["prevent"])},[e[6]||(e[6]=t("label",{for:"bookTitle"},"图书标题",-1)),v(t("input",{id:"bookTitle","onUpdate:modelValue":e[1]||(e[1]=l=>o.value.title=l),type:"text",required:""},null,512),[[b,o.value.title]]),e[7]||(e[7]=t("label",{for:"bookAuthor"},"作者",-1)),v(t("input",{id:"bookAuthor","onUpdate:modelValue":e[2]||(e[2]=l=>o.value.author=l),type:"text",required:""},null,512),[[b,o.value.author]]),e[8]||(e[8]=t("label",{for:"bookPrice"},"价格",-1)),v(t("input",{id:"bookPrice","onUpdate:modelValue":e[3]||(e[3]=l=>o.value.price=l),type:"number",required:""},null,512),[[b,o.value.price]]),e[9]||(e[9]=t("label",{for:"bookQuantity"},"库存",-1)),v(t("input",{id:"bookQuantity","onUpdate:modelValue":e[4]||(e[4]=l=>o.value.quantity=l),type:"number",required:""},null,512),[[b,o.value.quantity]]),t("div",F,[t("button",M,i(u.value?"确认修改":"确认添加"),1),t("button",{type:"button",class:"btn cancel-btn",onClick:c},"取消")])],32)])])):q("",!0),t("div",U,[(p(!0),d(x,null,B(a.value,l=>(p(),d("div",{class:"book-card",key:l.id},[t("div",A,[t("h3",null,i(l.title),1),t("p",null,"作者: "+i(l.author),1),t("p",null,"价格: ¥"+i(l.price),1),t("p",null,"库存: "+i(l.quantity),1)]),t("div",D,[t("button",{onClick:y=>k(l),class:"btn edit-btn"},"编辑",8,S),t("button",{onClick:y=>f(l.id),class:"btn delete-btn"},"删除",8,T)])]))),128))])]))}},P=_($,[["__scopeId","data-v-b1cb9b1b"]]);export{P as default}; diff --git a/seller_1/dist/assets/CustomerFeedback-Cylv7Fl9.css b/seller_1/dist/assets/CustomerFeedback-Cylv7Fl9.css new file mode 100644 index 0000000..4d84073 --- /dev/null +++ b/seller_1/dist/assets/CustomerFeedback-Cylv7Fl9.css @@ -0,0 +1 @@ +body[data-v-754545e9]{font-family:Roboto,Arial,sans-serif;background:linear-gradient(135deg,#f0f8ff,#e0f7fa);margin:0;color:#333}.customer-feedback[data-v-754545e9]{padding:20px;max-width:900px;margin:40px auto;background:#fff;border-radius:15px;box-shadow:0 10px 20px #00000026}.header[data-v-754545e9]{text-align:center;margin-bottom:30px}.header h1[data-v-754545e9]{font-size:2.5rem;color:#007bff;margin-bottom:10px;letter-spacing:1px}.header p[data-v-754545e9]{font-size:1rem;color:#6c757d}.toolbar[data-v-754545e9]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;gap:10px}.search-bar[data-v-754545e9]{flex:1;padding:10px 15px;font-size:1rem;border:1px solid #ddd;border-radius:30px;box-shadow:0 2px 4px #0000001a;transition:box-shadow .3s ease}.search-bar[data-v-754545e9]:focus{box-shadow:0 4px 8px #007bff4d;border-color:#007bff;outline:none}.btn[data-v-754545e9]{padding:10px 20px;border:none;border-radius:30px;font-size:1rem;cursor:pointer;transition:background-color .3s ease,box-shadow .3s ease}.feedback-list[data-v-754545e9]{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}.feedback-card[data-v-754545e9]{background:#fff;border-radius:15px;padding:20px;box-shadow:0 4px 8px #0000001a;transition:transform .3s ease,box-shadow .3s ease}.feedback-card[data-v-754545e9]:hover{transform:translateY(-5px);box-shadow:0 6px 12px #00000026}.feedback-info h3[data-v-754545e9]{margin:0 0 10px;font-size:1.2rem;color:#343a40}.feedback-info p[data-v-754545e9]{margin:0;color:#6c757d}.card-actions[data-v-754545e9]{margin-top:15px;display:flex;justify-content:flex-end}.delete-btn[data-v-754545e9]{background-color:#e74c3c;color:#fff;font-weight:700}.delete-btn[data-v-754545e9]:hover{background-color:#c0392b;box-shadow:0 4px 8px #e74c3c33}.empty-state[data-v-754545e9]{text-align:center;color:#6c757d;font-size:1.2rem;margin-top:30px} diff --git a/seller_1/dist/assets/CustomerFeedback-DYz7shaJ.js b/seller_1/dist/assets/CustomerFeedback-DYz7shaJ.js new file mode 100644 index 0000000..817f4f5 --- /dev/null +++ b/seller_1/dist/assets/CustomerFeedback-DYz7shaJ.js @@ -0,0 +1 @@ +import{_,r,h as p,i as m,c as o,a as e,b as k,v as b,F as h,e as f,o as n,t as i}from"./index-DnP9UZOY.js";const C={class:"customer-feedback"},y={class:"toolbar"},F={key:0,class:"feedback-list"},w={class:"feedback-info"},x={class:"card-actions"},L=["onClick"],g={key:1,class:"empty-state"},B={__name:"CustomerFeedback",setup(D){const l=r([]),c=r(""),u=()=>{l.value=[{id:1,name:"张三",content:"非常满意!服务很周到。"},{id:2,name:"李四",content:"产品质量不错,但物流有点慢。"},{id:3,name:"王五",content:"客服态度很好,问题解决得很快。"}]},d=p(()=>l.value.filter(a=>a.name.toLowerCase().includes(c.value.toLowerCase())||a.content.toLowerCase().includes(c.value.toLowerCase()))),v=a=>{l.value=l.value.filter(t=>t.id!==a)};return m(()=>{u()}),(a,t)=>(n(),o("div",C,[t[2]||(t[2]=e("header",{class:"header"},[e("h1",null,"客户反馈"),e("p",null,"查看客户的反馈内容并及时处理。")],-1)),e("div",y,[k(e("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=s=>c.value=s),class:"search-bar",placeholder:"搜索反馈..."},null,512),[[b,c.value]])]),d.value.length>0?(n(),o("div",F,[(n(!0),o(h,null,f(d.value,s=>(n(),o("div",{class:"feedback-card",key:s.id},[e("div",w,[e("h3",null,"反馈人: "+i(s.name),1),e("p",null,"反馈内容: "+i(s.content),1)]),e("div",x,[e("button",{class:"btn delete-btn",onClick:M=>v(s.id)},"删除",8,L)])]))),128))])):(n(),o("div",g,t[1]||(t[1]=[e("p",null,"没有找到匹配的反馈。",-1)])))]))}},E=_(B,[["__scopeId","data-v-754545e9"]]);export{E as default}; diff --git a/seller_1/dist/assets/DataAnalytics-CUsP9EzR.js b/seller_1/dist/assets/DataAnalytics-CUsP9EzR.js new file mode 100644 index 0000000..ae65d7b --- /dev/null +++ b/seller_1/dist/assets/DataAnalytics-CUsP9EzR.js @@ -0,0 +1,16 @@ +var gi=Object.defineProperty;var pi=(s,t,e)=>t in s?gi(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var y=(s,t,e)=>pi(s,typeof t!="symbol"?t+"":t,e);import{_ as mi,r as _i,h as jt,i as bi,c as pe,a as O,t as Bt,F as xi,e as yi,o as me}from"./index-DnP9UZOY.js";/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function Tt(s){return s+.5|0}const G=(s,t,e)=>Math.max(Math.min(s,e),t);function wt(s){return G(Tt(s*2.55),0,255)}function Q(s){return G(Tt(s*255),0,255)}function K(s){return G(Tt(s/2.55)/100,0,1)}function We(s){return G(Tt(s*100),0,100)}const N={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Oe=[..."0123456789ABCDEF"],vi=s=>Oe[s&15],wi=s=>Oe[(s&240)>>4]+Oe[s&15],Ht=s=>(s&240)>>4===(s&15),ki=s=>Ht(s.r)&&Ht(s.g)&&Ht(s.b)&&Ht(s.a);function Si(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&N[s[1]]*17,g:255&N[s[2]]*17,b:255&N[s[3]]*17,a:t===5?N[s[4]]*17:255}:(t===7||t===9)&&(e={r:N[s[1]]<<4|N[s[2]],g:N[s[3]]<<4|N[s[4]],b:N[s[5]]<<4|N[s[6]],a:t===9?N[s[7]]<<4|N[s[8]]:255})),e}const Mi=(s,t)=>s<255?t(s):"";function Oi(s){var t=ki(s)?vi:wi;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Mi(s.a,t):void 0}const Di=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vs(s,t,e){const i=t*Math.min(e,1-e),n=(o,r=(o+s/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Pi(s,t,e){const i=(n,o=(n+s/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Ii(s,t,e){const i=Vs(s,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Ci(s,t,e,i,n){return s===n?(t-e)/i+(t.5?h/(2-o-r):h/(o+r),c=Ci(e,i,n,h,o),c=c*60+.5),[c|0,l||0,a]}function Ae(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Q)}function Le(s,t,e){return Ae(Vs,s,t,e)}function Ei(s,t,e){return Ae(Ii,s,t,e)}function Ti(s,t,e){return Ae(Pi,s,t,e)}function Ws(s){return(s%360+360)%360}function Ai(s){const t=Di.exec(s);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?wt(+t[5]):Q(+t[5]));const n=Ws(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Ei(n,o,r):t[1]==="hsv"?i=Ti(n,o,r):i=Le(n,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function Li(s,t){var e=Te(s);e[0]=Ws(e[0]+t),e=Le(e),s.r=e[0],s.g=e[1],s.b=e[2]}function zi(s){if(!s)return;const t=Te(s),e=t[0],i=We(t[1]),n=We(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${K(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const $e={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ye={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Fi(){const s={},t=Object.keys(Ye),e=Object.keys($e);let i,n,o,r,a;for(i=0;i>16&255,o>>8&255,o&255]}return s}let Nt;function Ri(s){Nt||(Nt=Fi(),Nt.transparent=[0,0,0,0]);const t=Nt[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ji=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Bi(s){const t=ji.exec(s);let e=255,i,n,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?wt(r):G(r*255,0,255)}return i=+t[1],n=+t[3],o=+t[5],i=255&(t[2]?wt(i):G(i,0,255)),n=255&(t[4]?wt(n):G(n,0,255)),o=255&(t[6]?wt(o):G(o,0,255)),{r:i,g:n,b:o,a:e}}}function Hi(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${K(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const _e=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,dt=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function Ni(s,t,e){const i=dt(K(s.r)),n=dt(K(s.g)),o=dt(K(s.b));return{r:Q(_e(i+e*(dt(K(t.r))-i))),g:Q(_e(n+e*(dt(K(t.g))-n))),b:Q(_e(o+e*(dt(K(t.b))-o))),a:s.a+e*(t.a-s.a)}}function Vt(s,t,e){if(s){let i=Te(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Le(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function $s(s,t){return s&&Object.assign(t||{},s)}function Ue(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Q(s[3]))):(t=$s(s,{r:0,g:0,b:0,a:1}),t.a=Q(t.a)),t}function Vi(s){return s.charAt(0)==="r"?Bi(s):Ai(s)}class Pt{constructor(t){if(t instanceof Pt)return t;const e=typeof t;let i;e==="object"?i=Ue(t):e==="string"&&(i=Si(t)||Ri(t)||Vi(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$s(this._rgb);return t&&(t.a=K(t.a)),t}set rgb(t){this._rgb=Ue(t)}rgbString(){return this._valid?Hi(this._rgb):void 0}hexString(){return this._valid?Oi(this._rgb):void 0}hslString(){return this._valid?zi(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,c=i.a-n.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,i.r=255&l*i.r+o*n.r+.5,i.g=255&l*i.g+o*n.g+.5,i.b=255&l*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Ni(this._rgb,t._rgb,e)),this}clone(){return new Pt(this.rgb)}alpha(t){return this._rgb.a=Q(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Tt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Vt(this._rgb,2,t),this}darken(t){return Vt(this._rgb,2,-t),this}saturate(t){return Vt(this._rgb,1,t),this}desaturate(t){return Vt(this._rgb,1,-t),this}rotate(t){return Li(this._rgb,t),this}}/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */const Wi=(()=>{let s=0;return()=>s++})();function j(s){return s==null}function A(s){if(Array.isArray&&Array.isArray(s))return!0;const t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function x(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function X(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function $(s,t){return X(s)?s:t}function k(s,t){return typeof s>"u"?t:s}const $i=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function w(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function T(s,t,e,i){let n,o,r;if(A(s))for(o=s.length,n=0;ns,x:s=>s.x,y:s=>s.y};function Ki(s){const t=s.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Xi(s){const t=Ki(s);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ie(s,t){return(Xe[t]||(Xe[t]=Xi(t)))(s)}function ze(s){return s.charAt(0).toUpperCase()+s.slice(1)}const ne=s=>typeof s<"u",J=s=>typeof s=="function",qe=(s,t)=>{if(s.size!==t.size)return!1;for(const e of s)if(!t.has(e))return!1;return!0};function qi(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const gt=Math.PI,ft=2*gt,oe=Number.POSITIVE_INFINITY,re=gt/2,Ze=Math.log10,Ge=Math.sign;function Zi(s){const t=[],e=Math.sqrt(s);let i;for(i=1;in-o).pop(),t}function ae(s){return!isNaN(parseFloat(s))&&isFinite(s)}function kt(s){return s*(gt/180)}function Gi(s){return s*(180/gt)}function Qi(s,t){const e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*gt&&(o+=ft),{angle:o,distance:n}}function st(s){return(s%ft+ft)%ft}function Ji(s,t,e,i){const n=st(s),o=st(t),r=st(e),a=st(o-n),c=st(r-n),l=st(n-o),h=st(n-r);return n===o||n===r||i&&o===r||a>c&&ls[r]1;)o=n+i>>1,e(o)?n=o:i=o;return{lo:n,hi:i}}const De=(s,t,e,i)=>Fe(s,e,i?n=>{const o=s[n][t];return os[n][t]Fe(s,e,i=>s[i][t]>=e);function sn(s,t,e){let i=0,n=s.length;for(;ii&&s[n-1]>e;)n--;return i>0||n{const i="_onData"+ze(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Qe(s,t){const e=s._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Us.forEach(o=>{delete s[o]}),delete s._chartjs)}function on(s){const t=new Set(s);return t.size===s.length?s:Array.from(t)}const Ks=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function Xs(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,Ks.call(window,()=>{i=!1,s.apply(t,e)}))}}function rn(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}const an=s=>s==="start"?"left":s==="end"?"right":"center",Je=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Wt=s=>s===0||s===1,ts=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*ft/e)),es=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*ft/e)+1,Ot={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*re)+1,easeOutSine:s=>Math.sin(s*re),easeInOutSine:s=>-.5*(Math.cos(gt*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>Wt(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>Wt(s)?s:ts(s,.075,.3),easeOutElastic:s=>Wt(s)?s:es(s,.075,.3),easeInOutElastic(s){return Wt(s)?s:s<.5?.5*ts(s*2,.1125,.45):.5+.5*es(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-Ot.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?Ot.easeInBounce(s*2)*.5:Ot.easeOutBounce(s*2-1)*.5+.5};function qs(s){if(s&&typeof s=="object"){const t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ss(s){return qs(s)?s:new Pt(s)}function be(s){return qs(s)?s:new Pt(s).saturate(.5).darken(.1).hexString()}const cn=["x","y","borderWidth","radius","tension"],ln=["color","borderColor","backgroundColor"];function hn(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:ln},numbers:{type:"number",properties:cn}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function dn(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const is=new Map;function fn(s,t){t=t||{};const e=s+JSON.stringify(t);let i=is.get(e);return i||(i=new Intl.NumberFormat(s,t),is.set(e,i)),i}function un(s,t,e){return fn(t,e).format(s)}const Zs={values(s){return A(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;if(e.length>1){const l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(n="scientific"),o=gn(s,e)}const r=Ze(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),un(s,i,c)},logarithmic(s,t,e){if(s===0)return"0";const i=e[t].significand||s/Math.pow(10,Math.floor(Ze(s)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Zs.numeric.call(this,s,t,e):""}};function gn(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var pn={formatters:Zs};function mn(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ct=Object.create(null),Pe=Object.create(null);function Dt(s,t){if(!t)return s;const e=t.split(".");for(let i=0,n=e.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>be(n.backgroundColor),this.hoverBorderColor=(i,n)=>be(n.borderColor),this.hoverColor=(i,n)=>be(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return xe(this,t,e)}get(t){return Dt(this,t)}describe(t,e){return xe(Pe,t,e)}override(t,e){return xe(ct,t,e)}route(t,e,i,n){const o=Dt(this,t),r=Dt(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[a],l=r[n];return x(c)?Object.assign({},l,c):k(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(e=>e(this))}}var S=new _n({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hn,dn,mn]);function bn(s){return!s||j(s.size)||j(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function ns(s,t,e,i,n){let o=t[n];return o||(o=t[n]=s.measureText(n).width,e.push(n)),o>i&&(i=o),i}function it(s,t,e){const i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function os(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Gs(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.xt.top-e&&s.y0&&o.strokeColor!=="";let c,l;for(s.save(),s.font=n.string,xn(s,o),c=0;c+s||0;function On(s,t){const e={},i=x(t),n=i?Object.keys(t):t,o=x(s)?i?r=>k(s[r],s[t[r]]):r=>s[r]:()=>s;for(const r of n)e[r]=Mn(o(r));return e}function Dn(s){return On(s,{top:"y",right:"x",bottom:"y",left:"x"})}function Ct(s){const t=Dn(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ie(s,t){s=s||{},t=t||S.font;let e=k(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=k(s.style,t.style);i&&!(""+i).match(kn)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:k(s.family,t.family),lineHeight:Sn(k(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:k(s.weight,t.weight),string:""};return n.string=bn(n),n}function $t(s,t,e,i){let n,o,r;for(n=0,o=s.length;ne&&a===0?0:a+c;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function At(s,t){return Object.assign(Object.create(s),t)}function Re(s,t=[""],e,i,n=()=>s[0]){const o=e||s;typeof i>"u"&&(i=ii("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>Re([a,...s],t,o,i)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete s[0][c],!0},get(a,c){return ei(a,c,()=>Fn(c,t,s,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,c){return cs(a).includes(c)},ownKeys(a){return cs(a)},set(a,c,l){const h=a._storage||(a._storage=n());return a[c]=h[c]=l,delete a._keys,!0}})}function ut(s,t,e,i){const n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:ti(s,i),setContext:o=>ut(s,o,e,i),override:o=>ut(s.override(o),t,e,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return ei(o,r,()=>Cn(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function ti(s,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:J(e)?e:()=>e,isIndexable:J(i)?i:()=>i}}const In=(s,t)=>s?s+ze(t):t,je=(s,t)=>x(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ei(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];const i=e();return s[t]=i,i}function Cn(s,t,e){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[t];return J(a)&&r.isScriptable(t)&&(a=En(t,a,s,e)),A(a)&&a.length&&(a=Tn(t,a,s,r.isIndexable)),je(t,a)&&(a=ut(a,n,o&&o[t],r)),a}function En(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let c=t(o,r||i);return a.delete(s),je(s,c)&&(c=Be(n._scopes,n,s,c)),c}function Tn(s,t,e,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(s))return t[o.index%t.length];if(x(t[0])){const c=t,l=n._scopes.filter(h=>h!==c);t=[];for(const h of c){const d=Be(l,n,s,h);t.push(ut(d,o,r&&r[s],a))}}return t}function si(s,t,e){return J(s)?s(t,e):s}const An=(s,t)=>s===!0?t:typeof s=="string"?ie(t,s):void 0;function Ln(s,t,e,i,n){for(const o of t){const r=An(e,o);if(r){s.add(r);const a=si(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Be(s,t,e,i){const n=t._rootScopes,o=si(t._fallback,e,i),r=[...s,...n],a=new Set;a.add(i);let c=as(a,r,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=as(a,r,o,c,i),c===null)?!1:Re(Array.from(a),[""],n,o,()=>zn(t,e,i))}function as(s,t,e,i,n){for(;e;)e=Ln(s,t,e,i,n);return e}function zn(s,t,e){const i=s._getTarget();t in i||(i[t]={});const n=i[t];return A(n)&&x(e)?e:n||{}}function Fn(s,t,e,i){let n;for(const o of t)if(n=ii(In(o,s),e),typeof n<"u")return je(s,n)?Be(e,i,s,n):n}function ii(s,t){for(const e of t){if(!e)continue;const i=e[s];if(typeof i<"u")return i}}function cs(s){let t=s._keys;return t||(t=s._keys=Rn(s._scopes)),t}function Rn(s){const t=new Set;for(const e of s)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function He(){return typeof window<"u"&&typeof document<"u"}function Ne(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ce(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}const fe=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function jn(s,t){return fe(s).getPropertyValue(t)}const Bn=["top","right","bottom","left"];function at(s,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Bn[n];i[o]=parseFloat(s[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Hn=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function Nn(s,t){const e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,c;if(Hn(n,o,s.target))a=n,c=o;else{const l=t.getBoundingClientRect();a=i.clientX-l.left,c=i.clientY-l.top,r=!0}return{x:a,y:c,box:r}}function ot(s,t){if("native"in s)return s;const{canvas:e,currentDevicePixelRatio:i}=t,n=fe(e),o=n.boxSizing==="border-box",r=at(n,"padding"),a=at(n,"border","width"),{x:c,y:l,box:h}=Nn(s,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:g}=t;return o&&(u-=r.width+a.width,g-=r.height+a.height),{x:Math.round((c-d)/u*e.width/i),y:Math.round((l-f)/g*e.height/i)}}function Vn(s,t,e){let i,n;if(t===void 0||e===void 0){const o=s&&Ne(s);if(!o)t=s.clientWidth,e=s.clientHeight;else{const r=o.getBoundingClientRect(),a=fe(o),c=at(a,"border","width"),l=at(a,"padding");t=r.width-l.width-c.width,e=r.height-l.height-c.height,i=ce(a.maxWidth,o,"clientWidth"),n=ce(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||oe,maxHeight:n||oe}}const Yt=s=>Math.round(s*10)/10;function Wn(s,t,e,i){const n=fe(s),o=at(n,"margin"),r=ce(n.maxWidth,s,"clientWidth")||oe,a=ce(n.maxHeight,s,"clientHeight")||oe,c=Vn(s,t,e);let{width:l,height:h}=c;if(n.boxSizing==="content-box"){const f=at(n,"border","width"),u=at(n,"padding");l-=u.width+f.width,h-=u.height+f.height}return l=Math.max(0,l-o.width),h=Math.max(0,i?l/i:h-o.height),l=Yt(Math.min(l,r,c.maxWidth)),h=Yt(Math.min(h,a,c.maxHeight)),l&&!h&&(h=Yt(l/2)),(t!==void 0||e!==void 0)&&i&&c.height&&h>c.height&&(h=c.height,l=Yt(Math.floor(h*i))),{width:l,height:h}}function ls(s,t,e){const i=t||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $n=function(){let s=!1;try{const t={get passive(){return s=!0,!1}};He()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s}();function hs(s,t){const e=jn(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */class Yn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ks.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var U=new Yn;const ds="transparent",Un={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=ss(s||ds),n=i.valid&&ss(t||ds);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class Kn{constructor(t,e,i,n){const o=e[i];n=$t([t.to,n,o,t.from]);const r=$t([t.from,o,n]);this._active=!0,this._fn=t.fn||Un[t.type||typeof r],this._easing=Ot[t.easing]||Ot.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=$t([t.to,e,n,t.from]),this._from=$t([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let c;if(this._active=o!==a&&(r||e1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[n]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n{const o=t[n];if(!x(o))return;const r={};for(const a of e)r[a]=o[a];(A(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=Zn(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&qn(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const l=r[c];if(l.charAt(0)==="$")continue;if(l==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[l];let d=o[l];const f=i.get(l);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[l]=h;continue}o[l]=d=new Kn(f,t,l,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return U.add(this._chart,i),!0}}function qn(s,t){const e=[],i=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function ps(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,c=o.axis,l=r.axis,h=to(o,r,i),d=t.length;let f;for(let u=0;ue[i].axis===t).shift()}function io(s,t){return At(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function no(s,t,e){return At(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function _t(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const we=s=>s==="reset"||s==="none",ms=(s,t)=>t?s:Object.assign({},s),oo=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:ni(e,!0),values:null};class Jt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ye(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_t(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,f,u,g)=>d==="x"?f:d==="r"?g:u,o=e.xAxisID=k(i.xAxisID,ve(t,"x")),r=e.yAxisID=k(i.yAxisID,ve(t,"y")),a=e.rAxisID=k(i.rAxisID,ve(t,"r")),c=e.indexAxis,l=e.iAxisID=n(c,o,r,a),h=e.vAxisID=n(c,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Qe(this._data,this),t._stacked&&_t(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(x(e)){const n=this._cachedMeta;this._data=Jn(e,n)}else if(i!==e){if(i){Qe(i,this);const n=this._cachedMeta;_t(n),n._parsed=[]}e&&Object.isExtensible(e)&&nn(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=ye(e.vScale,e),e.stack!==i.stack&&(n=!0,_t(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&(ps(this,e._parsed),e._stacked=ye(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let c=t===0&&e===n.length?!0:i._sorted,l=t>0&&i._parsed[t-1],h,d,f;if(this._parsing===!1)i._parsed=n,i._sorted=!0,f=n;else{A(n[t])?f=this.parseArrayData(i,n,t,e):x(n[t])?f=this.parseObjectData(i,n,t,e):f=this.parsePrimitiveData(i,n,t,e);const u=()=>d[a]===null||l&&d[a]m||d=0;--f)if(!g()){this.updateRangeFromParsed(l,t,u,c);break}}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(i,n,e),m=l.resolveNamedOptions(f,u,g,d);return m.$shared&&(m.$shared=c,o[r]=Object.freeze(ms(m,c))),m}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let c;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);c=h.createResolver(f,this.getContext(t,i,e))}const l=new Xn(n,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||we(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){we(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!we(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(l.length+=e,a=l.length-1;a>=r;a--)l[a]=l[a-e]};for(c(o),a=t;a{c[r]&&c[r](t[e],n)&&(o.push({element:c,datasetIndex:l,index:h}),a=a||c.inRange(t.x,t.y,n))}),i&&!a?[]:o}var fo={evaluateInteractionItems:Lt,modes:{index(s,t,e,i){const n=ot(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ke(s,n,o,i,r):Se(s,n,o,!1,i,r),c=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(l=>{const h=a[0].index,d=l.data[h];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:h})}),c):[]},dataset(s,t,e,i){const n=ot(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?ke(s,n,o,i,r):Se(s,n,o,!1,i,r);if(a.length>0){const c=a[0].datasetIndex,l=s.getDatasetMeta(c).data;a=[];for(let h=0;he.pos===t)}function bs(s,t){return s.filter(e=>oi.indexOf(e.pos)===-1&&e.box.axis===t)}function xt(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function uo(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;el.box.fullSize),!0),i=xt(bt(t,"left"),!0),n=xt(bt(t,"right")),o=xt(bt(t,"top"),!0),r=xt(bt(t,"bottom")),a=bs(t,"x"),c=bs(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(c).concat(r).concat(a),chartArea:bt(t,"chartArea"),vertical:i.concat(n).concat(c),horizontal:o.concat(r).concat(a)}}function xs(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function ri(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function _o(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!x(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&ri(r,o.getPadding());const a=Math.max(0,t.outerWidth-xs(r,s,"left","right")),c=Math.max(0,t.outerHeight-xs(r,s,"top","bottom")),l=a!==s.w,h=c!==s.h;return s.w=a,s.h=c,e.horizontal?{same:l,other:h}:{same:h,other:l}}function bo(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function xo(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(s?["left","right"]:["top","bottom"])}function St(s,t,e,i){const n=[];let o,r,a,c,l,h;for(o=0,r=s.length,l=0;o{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=c.reduce((m,_)=>_.box.options&&_.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);ri(f,Ct(i));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),g=po(c.concat(l),d);St(a.fullSize,u,d,g),St(c,u,d,g),St(l,u,d,g)&&St(c,u,d,g),bo(u),ys(a.leftAndTop,u,d,g),u.x+=u.w,u.y+=u.h,ys(a.rightAndBottom,u,d,g),s.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},T(a.chartArea,m=>{const _=m.box;Object.assign(_,s.chartArea),_.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class ai{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class yo extends ai{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const te="$chartjs",vo={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vs=s=>s===null||s==="";function wo(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[te]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vs(n)){const o=hs(s,"width");o!==void 0&&(s.width=o)}if(vs(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=hs(s,"height");o!==void 0&&(s.height=o)}return s}const ci=$n?{passive:!0}:!1;function ko(s,t,e){s&&s.addEventListener(t,e,ci)}function So(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,ci)}function Mo(s,t){const e=vo[s.type]||s.type,{x:i,y:n}=ot(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function le(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Oo(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||le(a.addedNodes,i),r=r&&!le(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Do(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||le(a.removedNodes,i),r=r&&!le(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Et=new Map;let ws=0;function li(){const s=window.devicePixelRatio;s!==ws&&(ws=s,Et.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Po(s,t){Et.size||window.addEventListener("resize",li),Et.set(s,t)}function Io(s){Et.delete(s),Et.size||window.removeEventListener("resize",li)}function Co(s,t,e){const i=s.canvas,n=i&&Ne(i);if(!n)return;const o=Xs((a,c)=>{const l=n.clientWidth;e(a,c),l{const c=a[0],l=c.contentRect.width,h=c.contentRect.height;l===0&&h===0||o(l,h)});return r.observe(n),Po(s,o),r}function Me(s,t,e){e&&e.disconnect(),t==="resize"&&Io(s)}function Eo(s,t,e){const i=s.canvas,n=Xs(o=>{s.ctx!==null&&e(Mo(o,s))},s);return ko(i,t,n),n}class To extends ai{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(wo(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[te])return!1;const i=e[te].initial;["height","width"].forEach(o=>{const r=i[o];j(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[te],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Oo,detach:Do,resize:Co}[e]||Eo;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Me,detach:Me,resize:Me}[e]||So)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Wn(t,e,i,n)}isAttached(t){const e=t&&Ne(t);return!!(e&&e.isConnected)}}function Ao(s){return!He()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?yo:To}class he{constructor(){y(this,"x");y(this,"y");y(this,"active",!1);y(this,"options");y(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ae(this.x)&&ae(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}y(he,"defaults",{}),y(he,"defaultRoutes");function Lo(s,t){const e=s.options.ticks,i=zo(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Ro(t):[],r=o.length,a=o[0],c=o[r-1],l=[];if(r>n)return jo(t,l,o,r/n),l;const h=Fo(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((c-a)/(r-1)):null;for(Xt(t,l,h,j(u)?0:a-u,a),d=0,f=r-1;dn)return c}return Math.max(n,1)}function Ro(s){const t=[];let e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,ks=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ss=(s,t)=>Math.min(t||s,s);function Ms(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;or+a)))return c}function Vo(s,t){T(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;oi?i:e,i=n&&e>i?e:i,{min:$(e,$(i,e)),max:$(i,$(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pn(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=rt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:u/(i-1),d+6>a&&(a=u/(i-(t.offset?.5:1)),c=this.maxHeight-yt(t.grid)-e.padding-Os(t.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),r=Gi(Math.min(Math.asin(rt((h.highest.height+6)/a,-1,1)),Math.asin(rt(c/l,-1,1))-Math.asin(rt(f/l,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=Os(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=yt(o)+c):(t.height=this.maxHeight,t.width=yt(o)+c),i.display&&this.ticks.length){const{first:l,last:h,widest:d,highest:f}=this._getLabelSizes(),u=i.padding*2,g=kt(this.labelRotation),m=Math.cos(g),_=Math.sin(g);if(a){const p=i.mirror?0:_*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+p+u)}else{const p=i.mirror?0:m*d.width+_*f.height;t.width=Math.min(this.maxWidth,t.width+p+u)}this._calculatePadding(l,h,_,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:r},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;c?l?(f=n*t.width,u=i*e.height):(f=i*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:r[B]||0,height:a[B]||0});return{first:F(0),last:F(e-1),widest:F(L),highest:F(M),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return tn(this._alignToPixels?it(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/i:c/n:c*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=yt(o),u=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,_=m/2,p=function(P){return it(i,P,m)};let b,I,z,C,L,M,F,B,D,V,E,W;if(r==="top")b=p(this.bottom),M=this.bottom-f,B=b-_,V=p(t.top)+_,W=t.bottom;else if(r==="bottom")b=p(this.top),V=t.top,W=p(t.bottom)-_,M=b+_,B=this.top+f;else if(r==="left")b=p(this.right),L=this.right-f,F=b-_,D=p(t.left)+_,E=t.right;else if(r==="right")b=p(this.left),D=t.left,E=p(t.right)-_,L=b+_,F=this.left+f;else if(e==="x"){if(r==="center")b=p((t.top+t.bottom)/2+.5);else if(x(r)){const P=Object.keys(r)[0],H=r[P];b=p(this.chart.scales[P].getPixelForValue(H))}V=t.top,W=t.bottom,M=b+_,B=M+f}else if(e==="y"){if(r==="center")b=p((t.left+t.right)/2);else if(x(r)){const P=Object.keys(r)[0],H=r[P];b=p(this.chart.scales[P].getPixelForValue(H))}L=b-_,F=L-f,D=t.left,E=t.right}const q=k(n.ticks.maxTicksLimit,d),v=Math.max(1,Math.ceil(d/q));for(I=0;I0&&(et-=tt/2);break}Rt={left:et,top:mt,width:tt+ht.width,height:pt+ht.height,color:v.backdropColor}}_.push({label:z,font:B,textOffset:E,options:{rotation:m,color:H,strokeColor:zt,strokeWidth:Ft,textAlign:lt,textBaseline:W,translation:[C,L],backdrop:Rt}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-kt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,c=r.widest.width;let l,h;return e==="left"?n?(h=this.right+o,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h+=c)):(h=this.right-a,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h-=c)):(h=this.left+a,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(c,l,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),c=r.join(".");S.route(o,n,c,a)})}function qo(s){return"id"in s&&"defaults"in s}class Zo{constructor(){this.controllers=new qt(Jt,"datasets",!0),this.elements=new qt(he,"elements"),this.plugins=new qt(Object,"plugins"),this.scales=new qt(ue,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):T(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=ze(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Qo(s){const t={},e=[],i=Object.keys(Y.plugins.items);for(let o=0;o1&&Ds(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function Ps(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function or(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return Ps(s,"x",e[0])||Ps(s,"y",e[0])}return{}}function rr(s,t){const e=ct[s.type]||{scales:{}},i=t.scales||{},n=Ce(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!x(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Ee(r,a,or(r,s),S.scales[a.type]),l=ir(c,n),h=e.scales||{};o[r]=Mt(Object.create(null),[{axis:c},a,h[c],h[l]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,c=r.indexAxis||Ce(a,t),h=(ct[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=sr(d,c),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Mt(o[u],[{axis:f},i[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Mt(a,[S.scales[a.type],S.scale])}),o}function hi(s){const t=s.options||(s.options={});t.plugins=k(t.plugins,{}),t.scales=rr(s,t)}function di(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function ar(s){return s=s||{},s.data=di(s.data),hi(s),s}const Is=new Map,fi=new Set;function Zt(s,t){let e=Is.get(s);return e||(e=t(),Is.set(s,e),fi.add(e)),e}const vt=(s,t,e)=>{const i=ie(t,e);i!==void 0&&s.add(i)};class cr{constructor(t){this._config=ar(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=di(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),hi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zt(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Zt(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Zt(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Zt(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(d=>vt(c,t,d))),h.forEach(d=>vt(c,n,d)),h.forEach(d=>vt(c,ct[o]||{},d)),h.forEach(d=>vt(c,S,d)),h.forEach(d=>vt(c,Pe,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),fi.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ct[e]||{},S.datasets[e]||{},{type:e},S,Pe]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Cs(this._resolverCache,t,n);let c=r;if(hr(r,e)){o.$shared=!1,i=J(i)?i():i;const l=this.createResolver(t,i,a);c=ut(r,i,l)}for(const l of e)o[l]=c[l];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Cs(this._resolverCache,t,i);return x(e)?ut(o,e,void 0,n):o}}function Cs(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:Re(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const lr=s=>x(s)&&Object.getOwnPropertyNames(s).some(t=>J(s[t]));function hr(s,t){const{isScriptable:e,isIndexable:i}=ti(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(J(a)||lr(a))||r&&A(a))return!0}return!1}var dr="4.4.7";const fr=["top","bottom","left","right","chartArea"];function Es(s,t){return s==="top"||s==="bottom"||fr.indexOf(s)===-1&&t==="x"}function Ts(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function As(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),w(e&&e.onComplete,[s],t)}function ur(s){const t=s.chart,e=t.options.animation;w(e&&e.onProgress,[s],t)}function ui(s){return He()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const ee={},Ls=s=>{const t=ui(s);return Object.values(ee).filter(e=>e.canvas===t).pop()};function gr(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function pr(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function Gt(s,t,e){return s.options.clip?s[e]:t[e]}function mr(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:Gt(e,t,"left"),right:Gt(e,t,"right"),top:Gt(i,t,"top"),bottom:Gt(i,t,"bottom")}:t}class Z{static register(...t){Y.add(...t),zs()}static unregister(...t){Y.remove(...t),zs()}constructor(t,e){const i=this.config=new cr(e),n=ui(t),o=Ls(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ao(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),c=a&&a.canvas,l=c&&c.height,h=c&&c.width;if(this.id=Wi(),this.ctx=a,this.canvas=c,this.width=h,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Go,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=rn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ee[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}U.listen(this,"complete",As),U.listen(this,"progress",ur),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return j(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Y}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ls(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return os(this.canvas,this.ctx),this}stop(){return U.stop(this),this}resize(t,e){U.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ls(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};T(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],c=Ee(r,a),l=c==="r",h=c==="x";return{options:a,dposition:l?"chartArea":h?"bottom":"left",dtype:l?"radialLinear":h?"category":"linear"}}))),T(o,r=>{const a=r.options,c=a.id,l=Ee(c,a),h=k(a.type,r.dtype);(a.position===void 0||Es(a.position,l)!==Es(r.dposition))&&(a.position=r.dposition),n[c]=!0;let d=null;if(c in i&&i[c].type===h)d=i[c];else{const f=Y.getScale(h);d=new f({id:c,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),T(n,(r,a)=>{r||delete i[a]}),T(i,r=>{Kt.configure(this,r,r.options),Kt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,h=this.data.datasets.length;l{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ts("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){T(this.scales,t=>{Kt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!qe(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;gr(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Kt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],T(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=mr(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Qs(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Js(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Gs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=fo.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=At(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ne(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),U.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};T(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(c,l)=>{e.addEventListener(this,c,l),t[c]=l},n=(c,l)=>{t[c]&&(e.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){T(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},T(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,a,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,c=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ke(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(c,l)=>c.filter(h=>!l.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),c=qi(t),l=pr(t,this._lastEvent,i,c);i&&(this._lastEvent=null,w(o.onHover,[t,a,this],this),c&&w(o.onClick,[t,a,this],this));const h=!Ke(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}y(Z,"defaults",S),y(Z,"instances",ee),y(Z,"overrides",ct),y(Z,"registry",Y),y(Z,"version",dr),y(Z,"getChart",Ls);function zs(){return T(Z.instances,s=>s._plugins.invalidate())}const ge={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},R=Object.keys(ge);function Fs(s,t){return s-t}function Rs(s,t){if(j(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),X(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(ae(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function js(s,t,e,i){const n=R.length;for(let o=R.indexOf(s);o=R.indexOf(e);o--){const r=R[o];if(ge[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return R[e?R.indexOf(e):0]}function br(s){for(let t=R.indexOf(s)+1,e=R.length;t=t?e[i]:e[n];s[o]=!0}}function xr(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,c;for(a=o;a<=r;a=+n.add(a,1,i))c=e[a],c>=0&&(t[c].major=!0);return t}function Hs(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=rt(e,0,r),i=rt(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||js(o.minUnit,e,i,this._getLabelCapacity(e)),a=k(n.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,l=ae(c)||c===!0,h={};let d=e,f,u;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return w(r,[t,e,i],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,h=c&&a[c],d=l&&a[l],f=i[e],u=l&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=De(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:c}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=De(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:c}=s[n]);const l=r-o;return l?a+(c-a)*(t-o)/l:a}class Ns extends de{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Qt(e,this.min),this._tableRange=Qt(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,c,l,h;for(r=0,a=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Qt(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Qt(this._table,i*this._tableRange+this._minPos,!0)}}y(Ns,"id","timeseries"),y(Ns,"defaults",de.defaults);const yr={class:"data-analytics"},vr={class:"analytics-summary"},wr={class:"summary-card"},kr={class:"value"},Sr={class:"summary-card"},Mr={class:"value"},Or={class:"order-status"},Dr={class:"status-cards"},Pr={class:"status-name"},Ir={class:"status-count"},Cr={__name:"DataAnalytics",setup(s){const t=_i([{id:1,status:"待发货",totalPrice:150,date:"2024-01-01"},{id:2,status:"已发货",totalPrice:300,date:"2024-01-02"},{id:3,status:"待发货",totalPrice:450,date:"2024-01-03"},{id:4,status:"已完成",totalPrice:200,date:"2024-01-04"},{id:5,status:"已发货",totalPrice:350,date:"2024-01-05"},{id:6,status:"已取消",totalPrice:100,date:"2024-01-06"}]),e=jt(()=>t.value.length),i=jt(()=>t.value.reduce((r,a)=>r+a.totalPrice,0)),n=jt(()=>t.value.reduce((r,a)=>(r[a.status]=(r[a.status]||0)+1,r),{})),o=jt(()=>{const r=t.value.map(c=>c.date),a=t.value.map(c=>c.totalPrice);return{labels:r,data:a}});return bi(()=>{const r=document.getElementById("orderTrendsChart").getContext("2d");new Z(r,{type:"line",data:{labels:o.value.labels,datasets:[{label:"订单总金额",data:o.value.data,borderColor:"#27ae60",backgroundColor:"rgba(39, 174, 96, 0.2)",fill:!0,tension:.3}]},options:{responsive:!0,scales:{x:{title:{display:!0,text:"日期"}},y:{title:{display:!0,text:"金额 (¥)"},beginAtZero:!0}}}})}),(r,a)=>(me(),pe("div",yr,[a[3]||(a[3]=O("header",{class:"header"},[O("h2",null,"数据分析"),O("p",null,"实时监控订单概况,帮助商家做出明智决策")],-1)),O("div",vr,[O("div",wr,[a[0]||(a[0]=O("h3",null,"订单总数",-1)),O("p",kr,Bt(e.value),1)]),O("div",Sr,[a[1]||(a[1]=O("h3",null,"订单总金额",-1)),O("p",Mr,"¥"+Bt(i.value.toFixed(2)),1)])]),O("div",Or,[a[2]||(a[2]=O("h3",null,"订单状态分布",-1)),O("div",Dr,[(me(!0),pe(xi,null,yi(n.value,(c,l)=>(me(),pe("div",{key:l,class:"status-card"},[O("div",Pr,Bt(l),1),O("div",Ir,Bt(c),1)]))),128))])]),a[4]||(a[4]=O("div",{class:"order-trends"},[O("h3",null,"订单趋势"),O("canvas",{id:"orderTrendsChart",width:"400",height:"200"})],-1))]))}},Ar=mi(Cr,[["__scopeId","data-v-f16db87f"]]);export{Ar as default}; diff --git a/seller_1/dist/assets/DataAnalytics-SrfXo49y.css b/seller_1/dist/assets/DataAnalytics-SrfXo49y.css new file mode 100644 index 0000000..f14a065 --- /dev/null +++ b/seller_1/dist/assets/DataAnalytics-SrfXo49y.css @@ -0,0 +1 @@ +.data-analytics[data-v-f16db87f]{max-width:1000px;margin:0 auto;padding:20px;font-family:Arial,sans-serif}.header[data-v-f16db87f]{text-align:center;margin-bottom:40px}.header h2[data-v-f16db87f]{font-size:2rem;color:#2c3e50;margin:0}.header p[data-v-f16db87f]{font-size:1rem;color:#7f8c8d;margin-top:10px}.analytics-summary[data-v-f16db87f]{display:flex;justify-content:space-between;margin-bottom:40px}.summary-card[data-v-f16db87f]{background-color:#fff;border-radius:8px;padding:20px;width:45%;box-shadow:0 4px 10px #0000001a;text-align:center}.summary-card h3[data-v-f16db87f]{font-size:1.2rem;color:#34495e;margin-bottom:10px}.summary-card .value[data-v-f16db87f]{font-size:2rem;color:#27ae60}.order-status[data-v-f16db87f]{margin-bottom:40px}.order-status h3[data-v-f16db87f]{font-size:1.5rem;color:#34495e;margin-bottom:20px}.status-cards[data-v-f16db87f]{display:flex;justify-content:space-between;gap:20px}.status-card[data-v-f16db87f]{background-color:#fff;border-radius:8px;padding:15px;width:20%;box-shadow:0 4px 10px #0000001a;text-align:center}.status-name[data-v-f16db87f]{font-size:1.1rem;color:#34495e;margin-bottom:10px}.status-count[data-v-f16db87f]{font-size:1.5rem;color:#2980b9}.order-trends[data-v-f16db87f]{margin-top:40px}.order-trends h3[data-v-f16db87f]{font-size:1.5rem;color:#34495e;margin-bottom:20px}canvas[data-v-f16db87f]{width:100%;height:300px;max-width:800px;margin:0 auto;border-radius:8px} diff --git a/seller_1/dist/assets/MerchantInfo-Dzo0Kjyy.css b/seller_1/dist/assets/MerchantInfo-Dzo0Kjyy.css new file mode 100644 index 0000000..7252142 --- /dev/null +++ b/seller_1/dist/assets/MerchantInfo-Dzo0Kjyy.css @@ -0,0 +1 @@ +#app[data-v-87aebea8]{font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;background:linear-gradient(135deg,#1abc9c,#fff);min-height:100vh;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding:40px 20px}.merchant-info[data-v-87aebea8]{padding:40px;background-color:#fff;border-radius:15px;box-shadow:0 8px 15px #0000001a;width:450px;text-align:left;margin-top:50px;transition:transform .3s ease,box-shadow .3s ease}.merchant-info[data-v-87aebea8]:hover{transform:translateY(-5px);box-shadow:0 12px 20px #00000026}.merchant-info h1[data-v-87aebea8]{color:#2c3e50;font-size:30px;margin-bottom:20px;text-align:center}.info-item[data-v-87aebea8]{font-size:18px;margin:10px 0;color:#34495e}.update-button[data-v-87aebea8]{margin-top:20px;padding:14px 25px;background-color:#1abc9c;color:#fff;border:none;border-radius:8px;font-size:18px;cursor:pointer;transition:background-color .3s ease,transform .2s}.update-button[data-v-87aebea8]:hover{background-color:#16a085}.update-button[data-v-87aebea8]:active{transform:scale(.95)}.modal-overlay[data-v-87aebea8]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center}.update-form-modal[data-v-87aebea8]{background-color:#fff;padding:40px;border-radius:12px;width:480px;box-shadow:0 4px 20px #0000001a}.update-form-modal label[data-v-87aebea8]{font-size:16px;color:#2c3e50;margin-bottom:5px;display:block}.update-form-modal input[data-v-87aebea8]{width:100%;padding:12px;margin-bottom:15px;border:1px solid #ccc;border-radius:8px;font-size:16px;transition:border-color .3s ease}.update-form-modal input[data-v-87aebea8]:focus{border-color:#1abc9c;outline:none}.form-buttons[data-v-87aebea8]{display:flex;justify-content:space-between}.confirm-btn[data-v-87aebea8]{padding:12px 25px;background-color:#1abc9c;color:#fff;border:none;border-radius:8px;font-size:16px;cursor:pointer;transition:background-color .3s ease,transform .2s}.confirm-btn[data-v-87aebea8]:hover{background-color:#16a085}.confirm-btn[data-v-87aebea8]:active{transform:scale(.95)}.cancel-btn[data-v-87aebea8]{padding:12px 25px;background-color:#e74c3c;color:#fff;border:none;border-radius:8px;font-size:16px;cursor:pointer;transition:background-color .3s ease,transform .2s}.cancel-btn[data-v-87aebea8]:hover{background-color:#c0392b}.cancel-btn[data-v-87aebea8]:active{transform:scale(.95)} diff --git a/seller_1/dist/assets/MerchantInfo-xeSUcGPv.js b/seller_1/dist/assets/MerchantInfo-xeSUcGPv.js new file mode 100644 index 0000000..d4519fd --- /dev/null +++ b/seller_1/dist/assets/MerchantInfo-xeSUcGPv.js @@ -0,0 +1 @@ +import{_ as b,r,h as x,c as p,a as t,g as n,t as d,w as y,b as u,v as i,d as V,o as m}from"./index-DnP9UZOY.js";const g={id:"app"},k={class:"merchant-info"},I={class:"info-item"},M={class:"info-item"},U={class:"info-item"},h={class:"info-item"},q={key:0,class:"modal-overlay"},w={class:"update-form-modal"},B={class:"form-buttons"},C=["disabled"],F={__name:"MerchantInfo",setup(N){const a=r({name:"商家001",address:"福建省福州市",phone:"123-45678901",email:"example@example.com"}),s=r(!1),l=r({name:a.value.name,address:a.value.address,phone:a.value.phone,email:a.value.email}),v=x(()=>l.value.name&&l.value.address&&l.value.phone&&l.value.email),f=()=>{a.value={...l.value},s.value=!1};return(_,e)=>(m(),p("div",g,[t("div",k,[e[14]||(e[14]=t("h1",null,"商家信息",-1)),t("p",I,[e[6]||(e[6]=t("strong",null,"名称:",-1)),n(" "+d(a.value.name),1)]),t("p",M,[e[7]||(e[7]=t("strong",null,"地址:",-1)),n(" "+d(a.value.address),1)]),t("p",U,[e[8]||(e[8]=t("strong",null,"电话:",-1)),n(" "+d(a.value.phone),1)]),t("p",h,[e[9]||(e[9]=t("strong",null,"邮箱:",-1)),n(" "+d(a.value.email),1)]),t("button",{onClick:e[0]||(e[0]=o=>s.value=!0),class:"update-button"},"更新您的信息"),s.value?(m(),p("div",q,[t("div",w,[t("form",{onSubmit:y(f,["prevent"])},[e[10]||(e[10]=t("label",{for:"name"},"名称:",-1)),u(t("input",{id:"name","onUpdate:modelValue":e[1]||(e[1]=o=>l.value.name=o),type:"text",required:"",placeholder:"请输入商家名称"},null,512),[[i,l.value.name]]),e[11]||(e[11]=t("label",{for:"address"},"地址:",-1)),u(t("input",{id:"address","onUpdate:modelValue":e[2]||(e[2]=o=>l.value.address=o),type:"text",required:"",placeholder:"请输入商家地址"},null,512),[[i,l.value.address]]),e[12]||(e[12]=t("label",{for:"phone"},"电话:",-1)),u(t("input",{id:"phone","onUpdate:modelValue":e[3]||(e[3]=o=>l.value.phone=o),type:"text",required:"",placeholder:"请输入商家电话",pattern:"^[0-9]{3}-[0-9]{8}$"},null,512),[[i,l.value.phone]]),e[13]||(e[13]=t("label",{for:"email"},"邮箱:",-1)),u(t("input",{id:"email","onUpdate:modelValue":e[4]||(e[4]=o=>l.value.email=o),type:"email",required:"",placeholder:"请输入商家邮箱"},null,512),[[i,l.value.email]]),t("div",B,[t("button",{type:"submit",disabled:!v.value,class:"confirm-btn"},"确认更新",8,C),t("button",{type:"button",onClick:e[5]||(e[5]=o=>s.value=!1),class:"cancel-btn"},"取消")])],32)])])):V("",!0)])]))}},D=b(F,[["__scopeId","data-v-87aebea8"]]);export{D as default}; diff --git a/seller_1/dist/assets/OrderManagement-Df9Ifuu7.css b/seller_1/dist/assets/OrderManagement-Df9Ifuu7.css new file mode 100644 index 0000000..cf96483 --- /dev/null +++ b/seller_1/dist/assets/OrderManagement-Df9Ifuu7.css @@ -0,0 +1 @@ +.order-management[data-v-866b45ae]{max-width:1100px;margin:0 auto;padding:20px;font-family:Roboto,sans-serif}header[data-v-866b45ae]{text-align:center;margin-bottom:20px;font-size:1.8rem;font-weight:700;color:#34495e}.order-list[data-v-866b45ae]{display:flex;flex-wrap:wrap;gap:30px;justify-content:center}.order-card[data-v-866b45ae]{background-color:#fff;border-radius:12px;box-shadow:0 8px 20px #0000001a;padding:20px;width:280px;transition:transform .3s,box-shadow .3s;cursor:pointer}.order-card[data-v-866b45ae]:hover{transform:translateY(-8px);box-shadow:0 15px 25px #0003}.order-details h3[data-v-866b45ae]{font-size:1.4rem;font-weight:600;color:#2c3e50;margin-bottom:10px}.order-details p[data-v-866b45ae]{color:#7f8c8d;font-size:1rem;line-height:1.5}.card-actions[data-v-866b45ae]{margin-top:20px;display:flex;justify-content:space-between}.card-actions .btn[data-v-866b45ae]{padding:12px 20px;font-size:1.1rem;border-radius:8px;cursor:pointer;transition:background-color .3s ease,transform .3s ease;width:48%;box-sizing:border-box}.edit-btn[data-v-866b45ae]{background:linear-gradient(135deg,#3498db,#2980b9);color:#fff}.delete-btn[data-v-866b45ae]{background:linear-gradient(135deg,#e74c3c,#c0392b);color:#fff}.card-actions .btn[data-v-866b45ae]:hover{transform:translateY(-2px)}.card-actions .btn[data-v-866b45ae]:active{transform:translateY(0)}.modal-overlay[data-v-866b45ae]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:999;opacity:0;animation:fadeIn-866b45ae .3s forwards}.modal-content[data-v-866b45ae]{background-color:#fff;border-radius:12px;padding:30px;width:450px;max-width:80%;box-shadow:0 10px 30px #0000001a}.modal-content h3[data-v-866b45ae]{color:#34495e;font-size:1.5rem;font-weight:700;margin-bottom:20px}input[data-v-866b45ae],select[data-v-866b45ae]{width:100%;padding:12px;margin:12px 0;border:1px solid #ccc;border-radius:8px;font-size:1rem}.modal-buttons[data-v-866b45ae]{margin-top:20px;display:flex;justify-content:space-between}.save-btn[data-v-866b45ae]{background:linear-gradient(135deg,#27ae60,#2ecc71);color:#fff;border-radius:8px;padding:12px 20px;font-size:1.1rem;transition:transform .3s ease,background-color .3s ease}.cancel-btn[data-v-866b45ae]{background:linear-gradient(135deg,#e74c3c,#c0392b);color:#fff;border-radius:8px;padding:12px 20px;font-size:1.1rem;transition:transform .3s ease,background-color .3s ease}.modal-buttons .btn[data-v-866b45ae]:hover{transform:translateY(-2px)}.modal-buttons .btn[data-v-866b45ae]:active{transform:translateY(0)}@keyframes fadeIn-866b45ae{0%{opacity:0}to{opacity:1}} diff --git a/seller_1/dist/assets/OrderManagement-DyeEhSXZ.js b/seller_1/dist/assets/OrderManagement-DyeEhSXZ.js new file mode 100644 index 0000000..0f00faa --- /dev/null +++ b/seller_1/dist/assets/OrderManagement-DyeEhSXZ.js @@ -0,0 +1 @@ +import{_ as P,r as m,c as i,a as s,F as g,e as b,t as l,b as u,v as p,f as y,d as A,o as r,g as o}from"./index-DnP9UZOY.js";const C={class:"order-management"},V={class:"order-list"},O={class:"order-details"},M={class:"card-actions"},U=["onClick"],B=["onClick"],D={key:0,class:"modal-overlay"},I={class:"modal-content"},S=["value"],h={__name:"OrderManagement",setup(E){const f=["待发货","已发货","已完成","已取消"],a=m([{id:1,customerName:"张三",totalPrice:150,senderName:"李四",senderPhone:"13800000001",shippingAddress:"北京市朝阳区",status:"待发货"},{id:2,customerName:"王五",totalPrice:300,senderName:"赵六",senderPhone:"13900000002",shippingAddress:"上海市浦东新区",status:"已发货"}]),n=m(null),N=d=>{n.value={...d}},k=()=>{const d=a.value.findIndex(e=>e.id===n.value.id);d!==-1&&(a.value[d]={...n.value}),v()},v=()=>{n.value=null},c=d=>{a.value=a.value.filter(e=>e.id!==d)};return(d,e)=>(r(),i("div",C,[e[14]||(e[14]=s("header",null,[s("h2",null,"订单管理")],-1)),s("div",V,[(r(!0),i(g,null,b(a.value,t=>(r(),i("div",{class:"order-card",key:t.id},[s("div",O,[s("h3",null,"订单ID: "+l(t.id),1),s("p",null,[e[4]||(e[4]=s("strong",null,"客户:",-1)),o(" "+l(t.customerName),1)]),s("p",null,[e[5]||(e[5]=s("strong",null,"总价:",-1)),o(" ¥"+l(t.totalPrice),1)]),s("p",null,[e[6]||(e[6]=s("strong",null,"发货人:",-1)),o(" "+l(t.senderName),1)]),s("p",null,[e[7]||(e[7]=s("strong",null,"发货人电话:",-1)),o(" "+l(t.senderPhone),1)]),s("p",null,[e[8]||(e[8]=s("strong",null,"发货地址:",-1)),o(" "+l(t.shippingAddress),1)]),s("p",null,[e[9]||(e[9]=s("strong",null,"订单状态:",-1)),o(" "+l(t.status),1)])]),s("div",M,[s("button",{onClick:x=>N(t),class:"btn edit-btn"},"编辑",8,U),s("button",{onClick:x=>c(t.id),class:"btn delete-btn"},"删除",8,B)])]))),128))]),n.value?(r(),i("div",D,[s("div",I,[s("h3",null,"编辑订单 "+l(n.value.id),1),e[10]||(e[10]=s("label",{for:"senderName"},"发货人",-1)),u(s("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>n.value.senderName=t),type:"text",id:"senderName",placeholder:"发货人姓名"},null,512),[[p,n.value.senderName]]),e[11]||(e[11]=s("label",{for:"senderPhone"},"发货人电话",-1)),u(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>n.value.senderPhone=t),type:"text",id:"senderPhone",placeholder:"发货人电话"},null,512),[[p,n.value.senderPhone]]),e[12]||(e[12]=s("label",{for:"shippingAddress"},"发货地址",-1)),u(s("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>n.value.shippingAddress=t),type:"text",id:"shippingAddress",placeholder:"发货地址"},null,512),[[p,n.value.shippingAddress]]),e[13]||(e[13]=s("label",{for:"status"},"订单状态",-1)),u(s("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>n.value.status=t),id:"status"},[(r(),i(g,null,b(f,t=>s("option",{key:t,value:t},l(t),9,S)),64))],512),[[y,n.value.status]]),s("div",{class:"modal-buttons"},[s("button",{onClick:k,class:"btn save-btn"},"保存"),s("button",{onClick:v,class:"btn cancel-btn"},"取消")])])])):A("",!0)]))}},T=P(h,[["__scopeId","data-v-866b45ae"]]);export{T as default}; diff --git a/seller_1/dist/assets/PromotionManagement-CMGhqNeA.css b/seller_1/dist/assets/PromotionManagement-CMGhqNeA.css new file mode 100644 index 0000000..08a8ace --- /dev/null +++ b/seller_1/dist/assets/PromotionManagement-CMGhqNeA.css @@ -0,0 +1 @@ +.promotion-management[data-v-6f5ba095]{max-width:1200px;margin:0 auto;padding:20px;font-family:Arial,sans-serif}.header[data-v-6f5ba095]{text-align:center;margin-bottom:30px}.header h1[data-v-6f5ba095]{font-size:2rem;margin-bottom:10px;color:#2c3e50}.header p[data-v-6f5ba095]{font-size:1rem;color:#7f8c8d}.toolbar[data-v-6f5ba095]{text-align:center;margin-bottom:20px}.btn[data-v-6f5ba095]{padding:10px 20px;border-radius:5px;cursor:pointer;font-size:1rem;margin:5px;transition:background-color .3s ease}.add-btn[data-v-6f5ba095]{background-color:#1abc9c;color:#fff}.edit-btn[data-v-6f5ba095]{background-color:#3498db;color:#fff}.delete-btn[data-v-6f5ba095]{background-color:#e74c3c;color:#fff}.confirm-btn[data-v-6f5ba095]{background-color:#27ae60;color:#fff}.cancel-btn[data-v-6f5ba095]{background-color:#95a5a6;color:#fff}.btn[data-v-6f5ba095]:hover{opacity:.9}.promotion-list[data-v-6f5ba095]{display:flex;flex-wrap:wrap;gap:20px}.promotion-card[data-v-6f5ba095]{background:#fff;border-radius:10px;box-shadow:0 4px 8px #0000001a;padding:20px;flex:1 1 calc(33.333% - 20px)}.promo-details h3[data-v-6f5ba095]{margin:0 0 10px;color:#34495e}.modal-overlay[data-v-6f5ba095]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:999}.form-modal[data-v-6f5ba095],.confirm-modal[data-v-6f5ba095]{background-color:#fff;border-radius:10px;padding:20px;width:400px;box-shadow:0 4px 8px #0000001a}form label[data-v-6f5ba095]{display:block;margin-bottom:5px;color:#2c3e50}form input[data-v-6f5ba095]{width:100%;padding:10px;margin-bottom:20px;border:1px solid #ccc;border-radius:5px} diff --git a/seller_1/dist/assets/PromotionManagement-CZ6ytFC-.js b/seller_1/dist/assets/PromotionManagement-CZ6ytFC-.js new file mode 100644 index 0000000..dd76f43 --- /dev/null +++ b/seller_1/dist/assets/PromotionManagement-CZ6ytFC-.js @@ -0,0 +1 @@ +import{_ as T,r as u,c as a,a as o,w as k,b,v as f,d as p,F as V,e as $,g as c,t as y,o as r}from"./index-DnP9UZOY.js";const S={class:"promotion-management"},q={class:"toolbar"},F={key:0,class:"modal-overlay"},M={class:"form-modal"},U={class:"form-buttons"},B={class:"promotion-list"},E={class:"promo-details"},N={class:"card-actions"},_=["onClick"],I=["onClick"],A={key:1,class:"modal-overlay"},L={class:"form-modal"},j={class:"form-buttons"},z={key:2,class:"modal-overlay"},G={class:"confirm-modal"},H={class:"form-buttons"},J={__name:"PromotionManagement",setup(K){const s=u([{id:1,title:"双十一促销",discount:50},{id:2,title:"年终特惠",discount:30}]),v=u(!1),i=u({title:"",discount:0}),m=u(!1),n=u({title:"",discount:0}),d=u(!1),x=()=>{s.value.push({id:Date.now(),title:i.value.title,discount:i.value.discount}),i.value={title:"",discount:0},v.value=!1},C=l=>{n.value={...l},m.value=!0},g=()=>{const l=s.value.findIndex(t=>t.id===n.value.id);s.value[l]={...n.value},n.value={title:"",discount:0},m.value=!1},D=l=>{s.value=s.value.filter(t=>t.id!==l),d.value=!1},P=l=>{const t=s.value.find(e=>e.id===l);return t?t.title:""};return(l,t)=>(r(),a("div",S,[t[20]||(t[20]=o("header",{class:"header"},[o("h1",null,"促销活动管理"),o("p",null,"管理您的促销活动,添加、编辑或删除促销信息。")],-1)),o("div",q,[o("button",{onClick:t[0]||(t[0]=e=>v.value=!0),class:"btn add-btn"},"添加促销活动")]),v.value?(r(),a("div",F,[o("div",M,[t[12]||(t[12]=o("h2",null,"添加促销活动",-1)),o("form",{onSubmit:k(x,["prevent"])},[t[10]||(t[10]=o("label",{for:"addTitle"},"促销标题",-1)),b(o("input",{id:"addTitle","onUpdate:modelValue":t[1]||(t[1]=e=>i.value.title=e),type:"text",required:""},null,512),[[f,i.value.title]]),t[11]||(t[11]=o("label",{for:"addDiscount"},"折扣 (%)",-1)),b(o("input",{id:"addDiscount","onUpdate:modelValue":t[2]||(t[2]=e=>i.value.discount=e),type:"number",min:"0",max:"100",required:""},null,512),[[f,i.value.discount]]),o("div",U,[t[9]||(t[9]=o("button",{type:"submit",class:"btn confirm-btn"},"确认添加",-1)),o("button",{type:"button",class:"btn cancel-btn",onClick:t[3]||(t[3]=e=>v.value=!1)},"取消")])],32)])])):p("",!0),o("div",B,[(r(!0),a(V,null,$(s.value,e=>(r(),a("div",{class:"promotion-card",key:e.id},[o("div",E,[o("h3",null,y(e.title),1),o("p",null,[t[13]||(t[13]=c("折扣: ")),o("strong",null,y(e.discount)+"%",1)])]),o("div",N,[o("button",{onClick:w=>C(e),class:"btn edit-btn"},"编辑",8,_),o("button",{onClick:w=>d.value=e.id,class:"btn delete-btn"},"删除",8,I)])]))),128))]),m.value?(r(),a("div",A,[o("div",L,[t[17]||(t[17]=o("h2",null,"编辑促销活动",-1)),o("form",{onSubmit:k(g,["prevent"])},[t[15]||(t[15]=o("label",{for:"editTitle"},"促销标题",-1)),b(o("input",{id:"editTitle","onUpdate:modelValue":t[4]||(t[4]=e=>n.value.title=e),type:"text",required:""},null,512),[[f,n.value.title]]),t[16]||(t[16]=o("label",{for:"editDiscount"},"折扣 (%)",-1)),b(o("input",{id:"editDiscount","onUpdate:modelValue":t[5]||(t[5]=e=>n.value.discount=e),type:"number",min:"0",max:"100",required:""},null,512),[[f,n.value.discount]]),o("div",j,[t[14]||(t[14]=o("button",{type:"submit",class:"btn confirm-btn"},"确认修改",-1)),o("button",{type:"button",class:"btn cancel-btn",onClick:t[6]||(t[6]=e=>m.value=!1)},"取消")])],32)])])):p("",!0),d.value?(r(),a("div",z,[o("div",G,[o("p",null,[t[18]||(t[18]=c('确定要删除促销活动 "')),o("strong",null,y(P(d.value)),1),t[19]||(t[19]=c('" 吗?'))]),o("div",H,[o("button",{onClick:t[7]||(t[7]=e=>D(d.value)),class:"btn confirm-btn"},"确定"),o("button",{onClick:t[8]||(t[8]=e=>d.value=!1),class:"btn cancel-btn"},"取消")])])])):p("",!0)]))}},Q=T(J,[["__scopeId","data-v-6f5ba095"]]);export{Q as default}; diff --git a/seller_1/dist/assets/index-Bn5NcyEt.css b/seller_1/dist/assets/index-Bn5NcyEt.css new file mode 100644 index 0000000..341a229 --- /dev/null +++ b/seller_1/dist/assets/index-Bn5NcyEt.css @@ -0,0 +1 @@ +.header[data-v-bf014e38]{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background-color:#1abc9c;color:#fff}.logo h1[data-v-bf014e38]{margin:0}.nav-links[data-v-bf014e38]{list-style-type:none;margin:0;padding:0;display:flex}.nav-links li[data-v-bf014e38]{margin:0 10px}.nav-links li a[data-v-bf014e38]{text-decoration:none;color:#fff;font-size:16px}.nav-links li a[data-v-bf014e38]:hover{color:#333}.footer[data-v-298a861b]{background-color:#1abc9c;color:#fff;text-align:center;padding:10px 0;position:absolute;bottom:0;width:100%}#app[data-v-db0e5e56]{display:flex;flex-direction:column;min-height:100vh}.content[data-v-db0e5e56]{flex:1;padding:20px;overflow-y:auto}footer[data-v-db0e5e56]{background-color:#f8f9fa;padding:20px;text-align:center}body[data-v-2b8f233f]{margin:0;font-family:Arial,sans-serif;color:#333}.dashboard-header[data-v-2b8f233f]{text-align:center;padding:20px;background-color:#2c3e50;color:#fff;border-bottom:5px solid #1abc9c}.dashboard-header h1[data-v-2b8f233f]{font-size:2.5rem;margin:0}.dashboard-header p[data-v-2b8f233f]{font-size:1.2rem;margin:10px 0 0}.quick-access[data-v-2b8f233f]{text-align:center;margin:30px auto}.quick-access h2[data-v-2b8f233f]{font-size:1.8rem;margin-bottom:20px;color:#34495e}.card-container[data-v-2b8f233f]{display:flex;flex-wrap:wrap;justify-content:center;gap:20px;padding:0 20px}.card[data-v-2b8f233f]{width:200px;background:#fff;border-radius:10px;box-shadow:0 4px 8px #0000001a;transition:transform .3s,box-shadow .3s;cursor:pointer;padding:20px;text-align:center}.card[data-v-2b8f233f]:hover{transform:translateY(-5px);box-shadow:0 6px 12px #0003}.card-icon img[data-v-2b8f233f]{width:60px;height:60px;margin-bottom:15px}.card-content h3[data-v-2b8f233f]{font-size:1.2rem;color:#2c3e50}.card-content p[data-v-2b8f233f]{font-size:.9rem;color:#7f8c8d} diff --git a/seller_1/dist/assets/index-DnP9UZOY.js b/seller_1/dist/assets/index-DnP9UZOY.js new file mode 100644 index 0000000..f6ac465 --- /dev/null +++ b/seller_1/dist/assets/index-DnP9UZOY.js @@ -0,0 +1,26 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BookManagement-CoVkzWCf.js","assets/BookManagement-C7U8yzN6.css","assets/OrderManagement-DyeEhSXZ.js","assets/OrderManagement-Df9Ifuu7.css","assets/CustomerFeedback-DYz7shaJ.js","assets/CustomerFeedback-Cylv7Fl9.css","assets/PromotionManagement-CZ6ytFC-.js","assets/PromotionManagement-CMGhqNeA.css","assets/DataAnalytics-CUsP9EzR.js","assets/DataAnalytics-SrfXo49y.css","assets/MerchantInfo-xeSUcGPv.js","assets/MerchantInfo-Dzo0Kjyy.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function _s(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const J={},St=[],je=()=>{},ri=()=>!1,Pn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ys=e=>e.startsWith("onUpdate:"),ie=Object.assign,vs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},oi=Object.prototype.hasOwnProperty,W=(e,t)=>oi.call(e,t),N=Array.isArray,Rt=e=>sn(e)==="[object Map]",Cn=e=>sn(e)==="[object Set]",Vs=e=>sn(e)==="[object Date]",j=e=>typeof e=="function",re=e=>typeof e=="string",Be=e=>typeof e=="symbol",ee=e=>e!==null&&typeof e=="object",Dr=e=>(ee(e)||j(e))&&j(e.then)&&j(e.catch),Nr=Object.prototype.toString,sn=e=>Nr.call(e),ii=e=>sn(e).slice(8,-1),Hr=e=>sn(e)==="[object Object]",bs=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Bt=_s(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),On=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},li=/-(\w)/g,Re=On(e=>e.replace(li,(t,n)=>n?n.toUpperCase():"")),ci=/\B([A-Z])/g,mt=On(e=>e.replace(ci,"-$1").toLowerCase()),An=On(e=>e.charAt(0).toUpperCase()+e.slice(1)),Kn=On(e=>e?`on${An(e)}`:""),ot=(e,t)=>!Object.is(e,t),an=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},mn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Bs;const Tn=()=>Bs||(Bs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function xs(e){if(N(e)){const t={};for(let n=0;n{if(n){const s=n.split(ui);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Es(e){let t="";if(re(e))t=e;else if(N(e))for(let n=0;nIn(n,t))}const Br=e=>!!(e&&e.__v_isRef===!0),ns=e=>re(e)?e:e==null?"":N(e)||ee(e)&&(e.toString===Nr||!j(e.toString))?Br(e)?ns(e.value):JSON.stringify(e,Kr,2):String(e),Kr=(e,t)=>Br(t)?Kr(e,t.value):Rt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Un(s,o)+" =>"]=r,n),{})}:Cn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Un(n))}:Be(t)?Un(t):ee(t)&&!N(t)&&!Hr(t)?String(t):t,Un=(e,t="")=>{var n;return Be(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let be;class Ur{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=be,!t&&be&&(this.index=(be.scopes||(be.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0)return;if(Ut){let t=Ut;for(Ut=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Kt;){let t=Kt;for(Kt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Gr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function zr(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Rs(s),vi(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function ss(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Qr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Qr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Qt))return;e.globalVersion=Qt;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ss(e)){e.flags&=-3;return}const n=Z,s=Oe;Z=e,Oe=!0;try{Gr(e);const r=e.fn(e._value);(t.version===0||ot(r,e._value))&&(e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Z=n,Oe=s,zr(e),e.flags&=-3}}function Rs(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Rs(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function vi(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Oe=!0;const Yr=[];function it(){Yr.push(Oe),Oe=!1}function lt(){const e=Yr.pop();Oe=e===void 0?!0:e}function Ks(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Z;Z=void 0;try{t()}finally{Z=n}}}let Qt=0;class bi{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ps{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Z||!Oe||Z===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Z)n=this.activeLink=new bi(Z,this),Z.deps?(n.prevDep=Z.depsTail,Z.depsTail.nextDep=n,Z.depsTail=n):Z.deps=Z.depsTail=n,Jr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Z.depsTail,n.nextDep=void 0,Z.depsTail.nextDep=n,Z.depsTail=n,Z.deps===n&&(Z.deps=s)}return n}trigger(t){this.version++,Qt++,this.notify(t)}notify(t){ws();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ss()}}}function Jr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Jr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const rs=new WeakMap,ht=Symbol(""),os=Symbol(""),Yt=Symbol("");function fe(e,t,n){if(Oe&&Z){let s=rs.get(e);s||rs.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ps),r.map=s,r.key=n),r.track()}}function Ge(e,t,n,s,r,o){const i=rs.get(e);if(!i){Qt++;return}const l=c=>{c&&c.trigger()};if(ws(),t==="clear")i.forEach(l);else{const c=N(e),d=c&&bs(n);if(c&&n==="length"){const a=Number(s);i.forEach((h,p)=>{(p==="length"||p===Yt||!Be(p)&&p>=a)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Yt)),t){case"add":c?d&&l(i.get("length")):(l(i.get(ht)),Rt(e)&&l(i.get(os)));break;case"delete":c||(l(i.get(ht)),Rt(e)&&l(i.get(os)));break;case"set":Rt(e)&&l(i.get(ht));break}}Ss()}function bt(e){const t=k(e);return t===e?t:(fe(t,"iterate",Yt),Se(e)?t:t.map(ue))}function Mn(e){return fe(e=k(e),"iterate",Yt),e}const xi={__proto__:null,[Symbol.iterator](){return Wn(this,Symbol.iterator,ue)},concat(...e){return bt(this).concat(...e.map(t=>N(t)?bt(t):t))},entries(){return Wn(this,"entries",e=>(e[1]=ue(e[1]),e))},every(e,t){return ke(this,"every",e,t,void 0,arguments)},filter(e,t){return ke(this,"filter",e,t,n=>n.map(ue),arguments)},find(e,t){return ke(this,"find",e,t,ue,arguments)},findIndex(e,t){return ke(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ke(this,"findLast",e,t,ue,arguments)},findLastIndex(e,t){return ke(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ke(this,"forEach",e,t,void 0,arguments)},includes(...e){return qn(this,"includes",e)},indexOf(...e){return qn(this,"indexOf",e)},join(e){return bt(this).join(e)},lastIndexOf(...e){return qn(this,"lastIndexOf",e)},map(e,t){return ke(this,"map",e,t,void 0,arguments)},pop(){return Nt(this,"pop")},push(...e){return Nt(this,"push",e)},reduce(e,...t){return Us(this,"reduce",e,t)},reduceRight(e,...t){return Us(this,"reduceRight",e,t)},shift(){return Nt(this,"shift")},some(e,t){return ke(this,"some",e,t,void 0,arguments)},splice(...e){return Nt(this,"splice",e)},toReversed(){return bt(this).toReversed()},toSorted(e){return bt(this).toSorted(e)},toSpliced(...e){return bt(this).toSpliced(...e)},unshift(...e){return Nt(this,"unshift",e)},values(){return Wn(this,"values",ue)}};function Wn(e,t,n){const s=Mn(e),r=s[t]();return s!==e&&!Se(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.value&&(o.value=n(o.value)),o}),r}const Ei=Array.prototype;function ke(e,t,n,s,r,o){const i=Mn(e),l=i!==e&&!Se(e),c=i[t];if(c!==Ei[t]){const h=c.apply(e,o);return l?ue(h):h}let d=n;i!==e&&(l?d=function(h,p){return n.call(this,ue(h),p,e)}:n.length>2&&(d=function(h,p){return n.call(this,h,p,e)}));const a=c.call(i,d,s);return l&&r?r(a):a}function Us(e,t,n,s){const r=Mn(e);let o=n;return r!==e&&(Se(e)?n.length>3&&(o=function(i,l,c){return n.call(this,i,l,c,e)}):o=function(i,l,c){return n.call(this,i,ue(l),c,e)}),r[t](o,...s)}function qn(e,t,n){const s=k(e);fe(s,"iterate",Yt);const r=s[t](...n);return(r===-1||r===!1)&&As(n[0])?(n[0]=k(n[0]),s[t](...n)):r}function Nt(e,t,n=[]){it(),ws();const s=k(e)[t].apply(e,n);return Ss(),lt(),s}const wi=_s("__proto__,__v_isRef,__isVue"),Xr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Be));function Si(e){Be(e)||(e=String(e));const t=k(this);return fe(t,"has",e),t.hasOwnProperty(e)}class Zr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Fi:so:o?no:to).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=N(t);if(!r){let c;if(i&&(c=xi[n]))return c;if(n==="hasOwnProperty")return Si}const l=Reflect.get(t,n,de(t)?t:s);return(Be(n)?Xr.has(n):wi(n))||(r||fe(t,"get",n),o)?l:de(l)?i&&bs(n)?l:l.value:ee(l)?r?oo(l):$n(l):l}}class eo extends Zr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];if(!this._isShallow){const c=pt(o);if(!Se(s)&&!pt(s)&&(o=k(o),s=k(s)),!N(t)&&de(o)&&!de(s))return c?!1:(o.value=s,!0)}const i=N(t)&&bs(n)?Number(n)e,cn=e=>Reflect.getPrototypeOf(e);function Ai(e,t,n){return function(...s){const r=this.__v_raw,o=k(r),i=Rt(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,d=r[e](...s),a=n?is:t?ls:ue;return!t&&fe(o,"iterate",c?os:ht),{next(){const{value:h,done:p}=d.next();return p?{value:h,done:p}:{value:l?[a(h[0]),a(h[1])]:a(h),done:p}},[Symbol.iterator](){return this}}}}function fn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ti(e,t){const n={get(r){const o=this.__v_raw,i=k(o),l=k(r);e||(ot(r,l)&&fe(i,"get",r),fe(i,"get",l));const{has:c}=cn(i),d=t?is:e?ls:ue;if(c.call(i,r))return d(o.get(r));if(c.call(i,l))return d(o.get(l));o!==i&&o.get(r)},get size(){const r=this.__v_raw;return!e&&fe(k(r),"iterate",ht),Reflect.get(r,"size",r)},has(r){const o=this.__v_raw,i=k(o),l=k(r);return e||(ot(r,l)&&fe(i,"has",r),fe(i,"has",l)),r===l?o.has(r):o.has(r)||o.has(l)},forEach(r,o){const i=this,l=i.__v_raw,c=k(l),d=t?is:e?ls:ue;return!e&&fe(c,"iterate",ht),l.forEach((a,h)=>r.call(o,d(a),d(h),i))}};return ie(n,e?{add:fn("add"),set:fn("set"),delete:fn("delete"),clear:fn("clear")}:{add(r){!t&&!Se(r)&&!pt(r)&&(r=k(r));const o=k(this);return cn(o).has.call(o,r)||(o.add(r),Ge(o,"add",r,r)),this},set(r,o){!t&&!Se(o)&&!pt(o)&&(o=k(o));const i=k(this),{has:l,get:c}=cn(i);let d=l.call(i,r);d||(r=k(r),d=l.call(i,r));const a=c.call(i,r);return i.set(r,o),d?ot(o,a)&&Ge(i,"set",r,o):Ge(i,"add",r,o),this},delete(r){const o=k(this),{has:i,get:l}=cn(o);let c=i.call(o,r);c||(r=k(r),c=i.call(o,r)),l&&l.call(o,r);const d=o.delete(r);return c&&Ge(o,"delete",r,void 0),d},clear(){const r=k(this),o=r.size!==0,i=r.clear();return o&&Ge(r,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Ai(r,e,t)}),n}function Cs(e,t){const n=Ti(e,t);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(W(n,r)&&r in s?n:s,r,o)}const Ii={get:Cs(!1,!1)},Mi={get:Cs(!1,!0)},$i={get:Cs(!0,!1)};const to=new WeakMap,no=new WeakMap,so=new WeakMap,Fi=new WeakMap;function Li(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Di(e){return e.__v_skip||!Object.isExtensible(e)?0:Li(ii(e))}function $n(e){return pt(e)?e:Os(e,!1,Pi,Ii,to)}function ro(e){return Os(e,!1,Oi,Mi,no)}function oo(e){return Os(e,!0,Ci,$i,so)}function Os(e,t,n,s,r){if(!ee(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r.get(e);if(o)return o;const i=Di(e);if(i===0)return e;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function Pt(e){return pt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function pt(e){return!!(e&&e.__v_isReadonly)}function Se(e){return!!(e&&e.__v_isShallow)}function As(e){return e?!!e.__v_raw:!1}function k(e){const t=e&&e.__v_raw;return t?k(t):e}function io(e){return!W(e,"__v_skip")&&Object.isExtensible(e)&&jr(e,"__v_skip",!0),e}const ue=e=>ee(e)?$n(e):e,ls=e=>ee(e)?oo(e):e;function de(e){return e?e.__v_isRef===!0:!1}function lo(e){return co(e,!1)}function Ni(e){return co(e,!0)}function co(e,t){return de(e)?e:new Hi(e,t)}class Hi{constructor(t,n){this.dep=new Ps,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:k(t),this._value=n?t:ue(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Se(t)||pt(t);t=s?t:k(t),ot(t,n)&&(this._rawValue=t,this._value=s?t:ue(t),this.dep.trigger())}}function Ct(e){return de(e)?e.value:e}const ji={get:(e,t,n)=>t==="__v_raw"?e:Ct(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return de(r)&&!de(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function fo(e){return Pt(e)?e:new Proxy(e,ji)}class Vi{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ps(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Z!==this)return qr(this,!0),!0}get value(){const t=this.dep.track();return Qr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Bi(e,t,n=!1){let s,r;return j(e)?s=e:(s=e.get,r=e.set),new Vi(s,r,n)}const un={},_n=new WeakMap;let at;function Ki(e,t=!1,n=at){if(n){let s=_n.get(n);s||_n.set(n,s=[]),s.push(e)}}function Ui(e,t,n=J){const{immediate:s,deep:r,once:o,scheduler:i,augmentJob:l,call:c}=n,d=T=>r?T:Se(T)||r===!1||r===0?ze(T,1):ze(T);let a,h,p,m,O=!1,A=!1;if(de(e)?(h=()=>e.value,O=Se(e)):Pt(e)?(h=()=>d(e),O=!0):N(e)?(A=!0,O=e.some(T=>Pt(T)||Se(T)),h=()=>e.map(T=>{if(de(T))return T.value;if(Pt(T))return d(T);if(j(T))return c?c(T,2):T()})):j(e)?t?h=c?()=>c(e,2):e:h=()=>{if(p){it();try{p()}finally{lt()}}const T=at;at=a;try{return c?c(e,3,[m]):e(m)}finally{at=T}}:h=je,t&&r){const T=h,Q=r===!0?1/0:r;h=()=>ze(T(),Q)}const V=yi(),F=()=>{a.stop(),V&&V.active&&vs(V.effects,a)};if(o&&t){const T=t;t=(...Q)=>{T(...Q),F()}}let M=A?new Array(e.length).fill(un):un;const L=T=>{if(!(!(a.flags&1)||!a.dirty&&!T))if(t){const Q=a.run();if(r||O||(A?Q.some((le,te)=>ot(le,M[te])):ot(Q,M))){p&&p();const le=at;at=a;try{const te=[Q,M===un?void 0:A&&M[0]===un?[]:M,m];c?c(t,3,te):t(...te),M=Q}finally{at=le}}}else a.run()};return l&&l(L),a=new kr(h),a.scheduler=i?()=>i(L,!1):L,m=T=>Ki(T,!1,a),p=a.onStop=()=>{const T=_n.get(a);if(T){if(c)c(T,4);else for(const Q of T)Q();_n.delete(a)}},t?s?L(!0):M=a.run():i?i(L.bind(null,!0),!0):a.run(),F.pause=a.pause.bind(a),F.resume=a.resume.bind(a),F.stop=F,F}function ze(e,t=1/0,n){if(t<=0||!ee(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,de(e))ze(e.value,t,n);else if(N(e))for(let s=0;s{ze(s,t,n)});else if(Hr(e)){for(const s in e)ze(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&ze(e[s],t,n)}return e}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function rn(e,t,n,s){try{return s?e(...s):e()}catch(r){Fn(r,t,n)}}function Ke(e,t,n,s){if(j(e)){const r=rn(e,t,n,s);return r&&Dr(r)&&r.catch(o=>{Fn(o,t,n)}),r}if(N(e)){const r=[];for(let o=0;o>>1,r=pe[s],o=Jt(r);o=Jt(n)?pe.push(e):pe.splice(Wi(t),0,e),e.flags|=1,ao()}}function ao(){yn||(yn=uo.then(po))}function qi(e){N(e)?Ot.push(...e):nt&&e.id===-1?nt.splice(Et+1,0,e):e.flags&1||(Ot.push(e),e.flags|=1),ao()}function ks(e,t,n=De+1){for(;nJt(n)-Jt(s));if(Ot.length=0,nt){nt.push(...t);return}for(nt=t,Et=0;Ete.id==null?e.flags&2?-1:1/0:e.id;function po(e){try{for(De=0;De{s._d&&Zs(-1);const o=vn(t);let i;try{i=e(...r)}finally{vn(o),s._d&&Zs(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function iu(e,t){if(xe===null)return e;const n=Hn(xe),s=e.dirs||(e.dirs=[]);for(let r=0;re.__isTeleport;function Ms(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ms(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function mo(e,t){return j(e)?ie({name:e.name},t,{setup:e}):e}function _o(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function bn(e,t,n,s,r=!1){if(N(e)){e.forEach((O,A)=>bn(O,t&&(N(t)?t[A]:t),n,s,r));return}if(kt(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&bn(e,t,n,s.component.subTree);return}const o=s.shapeFlag&4?Hn(s.component):s.el,i=r?null:o,{i:l,r:c}=e,d=t&&t.r,a=l.refs===J?l.refs={}:l.refs,h=l.setupState,p=k(h),m=h===J?()=>!1:O=>W(p,O);if(d!=null&&d!==c&&(re(d)?(a[d]=null,m(d)&&(h[d]=null)):de(d)&&(d.value=null)),j(c))rn(c,l,12,[i,a]);else{const O=re(c),A=de(c);if(O||A){const V=()=>{if(e.f){const F=O?m(c)?h[c]:a[c]:c.value;r?N(F)&&vs(F,o):N(F)?F.includes(o)||F.push(o):O?(a[c]=[o],m(c)&&(h[c]=a[c])):(c.value=[o],e.k&&(a[e.k]=c.value))}else O?(a[c]=i,m(c)&&(h[c]=i)):A&&(c.value=i,e.k&&(a[e.k]=i))};i?(V.id=-1,ve(V,n)):V()}}}Tn().requestIdleCallback;Tn().cancelIdleCallback;const kt=e=>!!e.type.__asyncLoader,yo=e=>e.type.__isKeepAlive;function Qi(e,t){vo(e,"a",t)}function Yi(e,t){vo(e,"da",t)}function vo(e,t,n=ae){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Ln(t,s,n),n){let r=n.parent;for(;r&&r.parent;)yo(r.parent.vnode)&&Ji(s,t,n,r),r=r.parent}}function Ji(e,t,n,s){const r=Ln(t,e,s,!0);bo(()=>{vs(s[t],r)},n)}function Ln(e,t,n=ae,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{it();const l=on(n),c=Ke(t,n,e,i);return l(),lt(),c});return s?r.unshift(o):r.push(o),o}}const Qe=e=>(t,n=ae)=>{(!en||e==="sp")&&Ln(e,(...s)=>t(...s),n)},Xi=Qe("bm"),Zi=Qe("m"),el=Qe("bu"),tl=Qe("u"),nl=Qe("bum"),bo=Qe("um"),sl=Qe("sp"),rl=Qe("rtg"),ol=Qe("rtc");function il(e,t=ae){Ln("ec",e,t)}const ll="components";function xo(e,t){return fl(ll,e,!0,t)||e}const cl=Symbol.for("v-ndc");function fl(e,t,n=!0,s=!1){const r=xe||ae;if(r){const o=r.type;{const l=Jl(o,!1);if(l&&(l===t||l===Re(t)||l===An(Re(t))))return o}const i=Ws(r[e]||o[e],t)||Ws(r.appContext[e],t);return!i&&s?o:i}}function Ws(e,t){return e&&(e[t]||e[Re(t)]||e[An(Re(t))])}function ul(e,t,n,s){let r;const o=n,i=N(e);if(i||re(e)){const l=i&&Pt(e);let c=!1;l&&(c=!Se(e),e=Mn(e)),r=new Array(e.length);for(let d=0,a=e.length;dt(l,c,void 0,o));else{const l=Object.keys(e);r=new Array(l.length);for(let c=0,d=l.length;ce?Bo(e)?Hn(e):cs(e.parent):null,Wt=ie(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>cs(e.parent),$root:e=>cs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$s(e),$forceUpdate:e=>e.f||(e.f=()=>{Is(e.update)}),$nextTick:e=>e.n||(e.n=Ts.bind(e.proxy)),$watch:e=>Il.bind(e)}),Gn=(e,t)=>e!==J&&!e.__isScriptSetup&&W(e,t),al={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:l,appContext:c}=e;let d;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(Gn(s,t))return i[t]=1,s[t];if(r!==J&&W(r,t))return i[t]=2,r[t];if((d=e.propsOptions[0])&&W(d,t))return i[t]=3,o[t];if(n!==J&&W(n,t))return i[t]=4,n[t];fs&&(i[t]=0)}}const a=Wt[t];let h,p;if(a)return t==="$attrs"&&fe(e.attrs,"get",""),a(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==J&&W(n,t))return i[t]=4,n[t];if(p=c.config.globalProperties,W(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return Gn(r,t)?(r[t]=n,!0):s!==J&&W(s,t)?(s[t]=n,!0):W(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:o}},i){let l;return!!n[i]||e!==J&&W(e,i)||Gn(t,i)||(l=o[0])&&W(l,i)||W(s,i)||W(Wt,i)||W(r.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:W(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function qs(e){return N(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let fs=!0;function dl(e){const t=$s(e),n=e.proxy,s=e.ctx;fs=!1,t.beforeCreate&&Gs(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:l,provide:c,inject:d,created:a,beforeMount:h,mounted:p,beforeUpdate:m,updated:O,activated:A,deactivated:V,beforeDestroy:F,beforeUnmount:M,destroyed:L,unmounted:T,render:Q,renderTracked:le,renderTriggered:te,errorCaptured:Te,serverPrefetch:Ye,expose:Ie,inheritAttrs:Je,components:ct,directives:Me,filters:Lt}=t;if(d&&hl(d,s,null),i)for(const z in i){const K=i[z];j(K)&&(s[z]=K.bind(n))}if(r){const z=r.call(n,n);ee(z)&&(e.data=$n(z))}if(fs=!0,o)for(const z in o){const K=o[z],Ue=j(K)?K.bind(n,n):j(K.get)?K.get.bind(n,n):je,Xe=!j(K)&&j(K.set)?K.set.bind(n):je,$e=Ce({get:Ue,set:Xe});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ge=>$e.value=ge})}if(l)for(const z in l)Eo(l[z],s,n,z);if(c){const z=j(c)?c.call(n):c;Reflect.ownKeys(z).forEach(K=>{dn(K,z[K])})}a&&Gs(a,e,"c");function oe(z,K){N(K)?K.forEach(Ue=>z(Ue.bind(n))):K&&z(K.bind(n))}if(oe(Xi,h),oe(Zi,p),oe(el,m),oe(tl,O),oe(Qi,A),oe(Yi,V),oe(il,Te),oe(ol,le),oe(rl,te),oe(nl,M),oe(bo,T),oe(sl,Ye),N(Ie))if(Ie.length){const z=e.exposed||(e.exposed={});Ie.forEach(K=>{Object.defineProperty(z,K,{get:()=>n[K],set:Ue=>n[K]=Ue})})}else e.exposed||(e.exposed={});Q&&e.render===je&&(e.render=Q),Je!=null&&(e.inheritAttrs=Je),ct&&(e.components=ct),Me&&(e.directives=Me),Ye&&_o(e)}function hl(e,t,n=je){N(e)&&(e=us(e));for(const s in e){const r=e[s];let o;ee(r)?"default"in r?o=Ve(r.from||s,r.default,!0):o=Ve(r.from||s):o=Ve(r),de(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[s]=o}}function Gs(e,t,n){Ke(N(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Eo(e,t,n,s){let r=s.includes(".")?Do(n,s):()=>n[s];if(re(e)){const o=t[e];j(o)&&hn(r,o)}else if(j(e))hn(r,e.bind(n));else if(ee(e))if(N(e))e.forEach(o=>Eo(o,t,n,s));else{const o=j(e.handler)?e.handler.bind(n):t[e.handler];j(o)&&hn(r,o,e)}}function $s(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(d=>xn(c,d,i,!0)),xn(c,t,i)),ee(t)&&o.set(t,c),c}function xn(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&xn(e,o,n,!0),r&&r.forEach(i=>xn(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=pl[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const pl={data:zs,props:Qs,emits:Qs,methods:Vt,computed:Vt,beforeCreate:he,created:he,beforeMount:he,mounted:he,beforeUpdate:he,updated:he,beforeDestroy:he,beforeUnmount:he,destroyed:he,unmounted:he,activated:he,deactivated:he,errorCaptured:he,serverPrefetch:he,components:Vt,directives:Vt,watch:ml,provide:zs,inject:gl};function zs(e,t){return t?e?function(){return ie(j(e)?e.call(this,this):e,j(t)?t.call(this,this):t)}:t:e}function gl(e,t){return Vt(us(e),us(t))}function us(e){if(N(e)){const t={};for(let n=0;n1)return n&&j(t)?t.call(s&&s.proxy):t}}const So={},Ro=()=>Object.create(So),Po=e=>Object.getPrototypeOf(e)===So;function vl(e,t,n,s=!1){const r={},o=Ro();e.propsDefaults=Object.create(null),Co(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:ro(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function bl(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,l=k(r),[c]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const a=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[p,m]=Oo(h,t,!0);ie(i,p),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!o&&!c)return ee(e)&&s.set(e,St),St;if(N(o))for(let a=0;ae[0]==="_"||e==="$stable",Fs=e=>N(e)?e.map(He):[He(e)],El=(e,t,n)=>{if(t._n)return t;const s=et((...r)=>Fs(t(...r)),n);return s._c=!1,s},To=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Ao(r))continue;const o=e[r];if(j(o))t[r]=El(r,o,s);else if(o!=null){const i=Fs(o);t[r]=()=>i}}},Io=(e,t)=>{const n=Fs(t);e.slots.default=()=>n},Mo=(e,t,n)=>{for(const s in t)(n||s!=="_")&&(e[s]=t[s])},wl=(e,t,n)=>{const s=e.slots=Ro();if(e.vnode.shapeFlag&32){const r=t._;r?(Mo(s,t,n),n&&jr(s,"_",r,!0)):To(t,s)}else t&&Io(e,t)},Sl=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=J;if(s.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:Mo(r,t,n):(o=!t.$stable,To(t,r)),i=t}else t&&(Io(e,t),i={default:1});if(o)for(const l in r)!Ao(l)&&i[l]==null&&delete r[l]},ve=Hl;function Rl(e){return Pl(e)}function Pl(e,t){const n=Tn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:l,createComment:c,setText:d,setElementText:a,parentNode:h,nextSibling:p,setScopeId:m=je,insertStaticContent:O}=e,A=(f,u,g,v=null,_=null,b=null,S=void 0,w=null,E=!!u.dynamicChildren)=>{if(f===u)return;f&&!Ht(f,u)&&(v=y(f),ge(f,_,b,!0),f=null),u.patchFlag===-2&&(E=!1,u.dynamicChildren=null);const{type:x,ref:D,shapeFlag:P}=u;switch(x){case Nn:V(f,u,g,v);break;case gt:F(f,u,g,v);break;case Yn:f==null&&M(u,g,v,S);break;case Ne:ct(f,u,g,v,_,b,S,w,E);break;default:P&1?Q(f,u,g,v,_,b,S,w,E):P&6?Me(f,u,g,v,_,b,S,w,E):(P&64||P&128)&&x.process(f,u,g,v,_,b,S,w,E,I)}D!=null&&_&&bn(D,f&&f.ref,b,u||f,!u)},V=(f,u,g,v)=>{if(f==null)s(u.el=l(u.children),g,v);else{const _=u.el=f.el;u.children!==f.children&&d(_,u.children)}},F=(f,u,g,v)=>{f==null?s(u.el=c(u.children||""),g,v):u.el=f.el},M=(f,u,g,v)=>{[f.el,f.anchor]=O(f.children,u,g,v,f.el,f.anchor)},L=({el:f,anchor:u},g,v)=>{let _;for(;f&&f!==u;)_=p(f),s(f,g,v),f=_;s(u,g,v)},T=({el:f,anchor:u})=>{let g;for(;f&&f!==u;)g=p(f),r(f),f=g;r(u)},Q=(f,u,g,v,_,b,S,w,E)=>{u.type==="svg"?S="svg":u.type==="math"&&(S="mathml"),f==null?le(u,g,v,_,b,S,w,E):Ye(f,u,_,b,S,w,E)},le=(f,u,g,v,_,b,S,w)=>{let E,x;const{props:D,shapeFlag:P,transition:$,dirs:H}=f;if(E=f.el=i(f.type,b,D&&D.is,D),P&8?a(E,f.children):P&16&&Te(f.children,E,null,v,_,zn(f,b),S,w),H&&ft(f,null,v,"created"),te(E,f,f.scopeId,S,v),D){for(const X in D)X!=="value"&&!Bt(X)&&o(E,X,null,D[X],b,v);"value"in D&&o(E,"value",null,D.value,b),(x=D.onVnodeBeforeMount)&&Le(x,v,f)}H&&ft(f,null,v,"beforeMount");const B=Cl(_,$);B&&$.beforeEnter(E),s(E,u,g),((x=D&&D.onVnodeMounted)||B||H)&&ve(()=>{x&&Le(x,v,f),B&&$.enter(E),H&&ft(f,null,v,"mounted")},_)},te=(f,u,g,v,_)=>{if(g&&m(f,g),v)for(let b=0;b{for(let x=E;x{const w=u.el=f.el;let{patchFlag:E,dynamicChildren:x,dirs:D}=u;E|=f.patchFlag&16;const P=f.props||J,$=u.props||J;let H;if(g&&ut(g,!1),(H=$.onVnodeBeforeUpdate)&&Le(H,g,u,f),D&&ft(u,f,g,"beforeUpdate"),g&&ut(g,!0),(P.innerHTML&&$.innerHTML==null||P.textContent&&$.textContent==null)&&a(w,""),x?Ie(f.dynamicChildren,x,w,g,v,zn(u,_),b):S||K(f,u,w,null,g,v,zn(u,_),b,!1),E>0){if(E&16)Je(w,P,$,g,_);else if(E&2&&P.class!==$.class&&o(w,"class",null,$.class,_),E&4&&o(w,"style",P.style,$.style,_),E&8){const B=u.dynamicProps;for(let X=0;X{H&&Le(H,g,u,f),D&&ft(u,f,g,"updated")},v)},Ie=(f,u,g,v,_,b,S)=>{for(let w=0;w{if(u!==g){if(u!==J)for(const b in u)!Bt(b)&&!(b in g)&&o(f,b,u[b],null,_,v);for(const b in g){if(Bt(b))continue;const S=g[b],w=u[b];S!==w&&b!=="value"&&o(f,b,w,S,_,v)}"value"in g&&o(f,"value",u.value,g.value,_)}},ct=(f,u,g,v,_,b,S,w,E)=>{const x=u.el=f?f.el:l(""),D=u.anchor=f?f.anchor:l("");let{patchFlag:P,dynamicChildren:$,slotScopeIds:H}=u;H&&(w=w?w.concat(H):H),f==null?(s(x,g,v),s(D,g,v),Te(u.children||[],g,D,_,b,S,w,E)):P>0&&P&64&&$&&f.dynamicChildren?(Ie(f.dynamicChildren,$,g,_,b,S,w),(u.key!=null||_&&u===_.subTree)&&$o(f,u,!0)):K(f,u,g,D,_,b,S,w,E)},Me=(f,u,g,v,_,b,S,w,E)=>{u.slotScopeIds=w,f==null?u.shapeFlag&512?_.ctx.activate(u,g,v,S,E):Lt(u,g,v,_,b,S,E):_t(f,u,E)},Lt=(f,u,g,v,_,b,S)=>{const w=f.component=ql(f,v,_);if(yo(f)&&(w.ctx.renderer=I),Gl(w,!1,S),w.asyncDep){if(_&&_.registerDep(w,oe,S),!f.el){const E=w.subTree=se(gt);F(null,E,u,g)}}else oe(w,f,u,g,_,b,S)},_t=(f,u,g)=>{const v=u.component=f.component;if(Dl(f,u,g))if(v.asyncDep&&!v.asyncResolved){z(v,u,g);return}else v.next=u,v.update();else u.el=f.el,v.vnode=u},oe=(f,u,g,v,_,b,S)=>{const w=()=>{if(f.isMounted){let{next:P,bu:$,u:H,parent:B,vnode:X}=f;{const _e=Fo(f);if(_e){P&&(P.el=X.el,z(f,P,S)),_e.asyncDep.then(()=>{f.isUnmounted||w()});return}}let G=P,me;ut(f,!1),P?(P.el=X.el,z(f,P,S)):P=X,$&&an($),(me=P.props&&P.props.onVnodeBeforeUpdate)&&Le(me,B,P,X),ut(f,!0);const ce=Qn(f),Pe=f.subTree;f.subTree=ce,A(Pe,ce,h(Pe.el),y(Pe),f,_,b),P.el=ce.el,G===null&&Nl(f,ce.el),H&&ve(H,_),(me=P.props&&P.props.onVnodeUpdated)&&ve(()=>Le(me,B,P,X),_)}else{let P;const{el:$,props:H}=u,{bm:B,m:X,parent:G,root:me,type:ce}=f,Pe=kt(u);if(ut(f,!1),B&&an(B),!Pe&&(P=H&&H.onVnodeBeforeMount)&&Le(P,G,u),ut(f,!0),$&&ne){const _e=()=>{f.subTree=Qn(f),ne($,f.subTree,f,_,null)};Pe&&ce.__asyncHydrate?ce.__asyncHydrate($,f,_e):_e()}else{me.ce&&me.ce._injectChildStyle(ce);const _e=f.subTree=Qn(f);A(null,_e,g,v,f,_,b),u.el=_e.el}if(X&&ve(X,_),!Pe&&(P=H&&H.onVnodeMounted)){const _e=u;ve(()=>Le(P,G,_e),_)}(u.shapeFlag&256||G&&kt(G.vnode)&&G.vnode.shapeFlag&256)&&f.a&&ve(f.a,_),f.isMounted=!0,u=g=v=null}};f.scope.on();const E=f.effect=new kr(w);f.scope.off();const x=f.update=E.run.bind(E),D=f.job=E.runIfDirty.bind(E);D.i=f,D.id=f.uid,E.scheduler=()=>Is(D),ut(f,!0),x()},z=(f,u,g)=>{u.component=f;const v=f.vnode.props;f.vnode=u,f.next=null,bl(f,u.props,v,g),Sl(f,u.children,g),it(),ks(f),lt()},K=(f,u,g,v,_,b,S,w,E=!1)=>{const x=f&&f.children,D=f?f.shapeFlag:0,P=u.children,{patchFlag:$,shapeFlag:H}=u;if($>0){if($&128){Xe(x,P,g,v,_,b,S,w,E);return}else if($&256){Ue(x,P,g,v,_,b,S,w,E);return}}H&8?(D&16&&we(x,_,b),P!==x&&a(g,P)):D&16?H&16?Xe(x,P,g,v,_,b,S,w,E):we(x,_,b,!0):(D&8&&a(g,""),H&16&&Te(P,g,v,_,b,S,w,E))},Ue=(f,u,g,v,_,b,S,w,E)=>{f=f||St,u=u||St;const x=f.length,D=u.length,P=Math.min(x,D);let $;for($=0;$D?we(f,_,b,!0,!1,P):Te(u,g,v,_,b,S,w,E,P)},Xe=(f,u,g,v,_,b,S,w,E)=>{let x=0;const D=u.length;let P=f.length-1,$=D-1;for(;x<=P&&x<=$;){const H=f[x],B=u[x]=E?st(u[x]):He(u[x]);if(Ht(H,B))A(H,B,g,null,_,b,S,w,E);else break;x++}for(;x<=P&&x<=$;){const H=f[P],B=u[$]=E?st(u[$]):He(u[$]);if(Ht(H,B))A(H,B,g,null,_,b,S,w,E);else break;P--,$--}if(x>P){if(x<=$){const H=$+1,B=H$)for(;x<=P;)ge(f[x],_,b,!0),x++;else{const H=x,B=x,X=new Map;for(x=B;x<=$;x++){const ye=u[x]=E?st(u[x]):He(u[x]);ye.key!=null&&X.set(ye.key,x)}let G,me=0;const ce=$-B+1;let Pe=!1,_e=0;const Dt=new Array(ce);for(x=0;x=ce){ge(ye,_,b,!0);continue}let Fe;if(ye.key!=null)Fe=X.get(ye.key);else for(G=B;G<=$;G++)if(Dt[G-B]===0&&Ht(ye,u[G])){Fe=G;break}Fe===void 0?ge(ye,_,b,!0):(Dt[Fe-B]=x+1,Fe>=_e?_e=Fe:Pe=!0,A(ye,u[Fe],g,null,_,b,S,w,E),me++)}const Hs=Pe?Ol(Dt):St;for(G=Hs.length-1,x=ce-1;x>=0;x--){const ye=B+x,Fe=u[ye],js=ye+1{const{el:b,type:S,transition:w,children:E,shapeFlag:x}=f;if(x&6){$e(f.component.subTree,u,g,v);return}if(x&128){f.suspense.move(u,g,v);return}if(x&64){S.move(f,u,g,I);return}if(S===Ne){s(b,u,g);for(let P=0;Pw.enter(b),_);else{const{leave:P,delayLeave:$,afterLeave:H}=w,B=()=>s(b,u,g),X=()=>{P(b,()=>{B(),H&&H()})};$?$(b,B,X):X()}else s(b,u,g)},ge=(f,u,g,v=!1,_=!1)=>{const{type:b,props:S,ref:w,children:E,dynamicChildren:x,shapeFlag:D,patchFlag:P,dirs:$,cacheIndex:H}=f;if(P===-2&&(_=!1),w!=null&&bn(w,null,g,f,!0),H!=null&&(u.renderCache[H]=void 0),D&256){u.ctx.deactivate(f);return}const B=D&1&&$,X=!kt(f);let G;if(X&&(G=S&&S.onVnodeBeforeUnmount)&&Le(G,u,f),D&6)ln(f.component,g,v);else{if(D&128){f.suspense.unmount(g,v);return}B&&ft(f,null,u,"beforeUnmount"),D&64?f.type.remove(f,u,g,I,v):x&&!x.hasOnce&&(b!==Ne||P>0&&P&64)?we(x,u,g,!1,!0):(b===Ne&&P&384||!_&&D&16)&&we(E,u,g),v&&yt(f)}(X&&(G=S&&S.onVnodeUnmounted)||B)&&ve(()=>{G&&Le(G,u,f),B&&ft(f,null,u,"unmounted")},g)},yt=f=>{const{type:u,el:g,anchor:v,transition:_}=f;if(u===Ne){vt(g,v);return}if(u===Yn){T(f);return}const b=()=>{r(g),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(f.shapeFlag&1&&_&&!_.persisted){const{leave:S,delayLeave:w}=_,E=()=>S(g,b);w?w(f.el,b,E):E()}else b()},vt=(f,u)=>{let g;for(;f!==u;)g=p(f),r(f),f=g;r(u)},ln=(f,u,g)=>{const{bum:v,scope:_,job:b,subTree:S,um:w,m:E,a:x}=f;Js(E),Js(x),v&&an(v),_.stop(),b&&(b.flags|=8,ge(S,f,u,g)),w&&ve(w,u),ve(()=>{f.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&f.asyncDep&&!f.asyncResolved&&f.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},we=(f,u,g,v=!1,_=!1,b=0)=>{for(let S=b;S{if(f.shapeFlag&6)return y(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const u=p(f.anchor||f.el),g=u&&u[Gi];return g?p(g):u};let C=!1;const R=(f,u,g)=>{f==null?u._vnode&&ge(u._vnode,null,null,!0):A(u._vnode||null,f,u,null,null,null,g),u._vnode=f,C||(C=!0,ks(),ho(),C=!1)},I={p:A,um:ge,m:$e,r:yt,mt:Lt,mc:Te,pc:K,pbc:Ie,n:y,o:e};let q,ne;return{render:R,hydrate:q,createApp:yl(R,q)}}function zn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ut({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Cl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function $o(e,t,n=!1){const s=e.children,r=t.children;if(N(s)&&N(r))for(let o=0;o>1,e[n[l]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function Fo(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Fo(t)}function Js(e){if(e)for(let t=0;tVe(Al);function hn(e,t,n){return Lo(e,t,n)}function Lo(e,t,n=J){const{immediate:s,deep:r,flush:o,once:i}=n,l=ie({},n),c=t&&s||!t&&o!=="post";let d;if(en){if(o==="sync"){const m=Tl();d=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=je,m.resume=je,m.pause=je,m}}const a=ae;l.call=(m,O,A)=>Ke(m,a,O,A);let h=!1;o==="post"?l.scheduler=m=>{ve(m,a&&a.suspense)}:o!=="sync"&&(h=!0,l.scheduler=(m,O)=>{O?m():Is(m)}),l.augmentJob=m=>{t&&(m.flags|=4),h&&(m.flags|=2,a&&(m.id=a.uid,m.i=a))};const p=Ui(e,t,l);return en&&(d?d.push(p):c&&p()),p}function Il(e,t,n){const s=this.proxy,r=re(e)?e.includes(".")?Do(s,e):()=>s[e]:e.bind(s,s);let o;j(t)?o=t:(o=t.handler,n=t);const i=on(this),l=Lo(r,o.bind(s),n);return i(),l}function Do(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;rt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${mt(t)}Modifiers`];function $l(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||J;let r=n;const o=t.startsWith("update:"),i=o&&Ml(s,t.slice(7));i&&(i.trim&&(r=n.map(a=>re(a)?a.trim():a)),i.number&&(r=n.map(mn)));let l,c=s[l=Kn(t)]||s[l=Kn(Re(t))];!c&&o&&(c=s[l=Kn(mt(t))]),c&&Ke(c,e,6,r);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ke(d,e,6,r)}}function No(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},l=!1;if(!j(e)){const c=d=>{const a=No(d,t,!0);a&&(l=!0,ie(i,a))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(ee(e)&&s.set(e,null),null):(N(o)?o.forEach(c=>i[c]=null):ie(i,o),ee(e)&&s.set(e,i),i)}function Dn(e,t){return!e||!Pn(t)?!1:(t=t.slice(2).replace(/Once$/,""),W(e,t[0].toLowerCase()+t.slice(1))||W(e,mt(t))||W(e,t))}function Qn(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:i,attrs:l,emit:c,render:d,renderCache:a,props:h,data:p,setupState:m,ctx:O,inheritAttrs:A}=e,V=vn(e);let F,M;try{if(n.shapeFlag&4){const T=r||s,Q=T;F=He(d.call(Q,T,a,h,m,p,O)),M=l}else{const T=t;F=He(T.length>1?T(h,{attrs:l,slots:i,emit:c}):T(h,null)),M=t.props?l:Fl(l)}}catch(T){qt.length=0,Fn(T,e,1),F=se(gt)}let L=F;if(M&&A!==!1){const T=Object.keys(M),{shapeFlag:Q}=L;T.length&&Q&7&&(o&&T.some(ys)&&(M=Ll(M,o)),L=Mt(L,M,!1,!0))}return n.dirs&&(L=Mt(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition&&Ms(L,n.transition),F=L,vn(V),F}const Fl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Pn(n))&&((t||(t={}))[n]=e[n]);return t},Ll=(e,t)=>{const n={};for(const s in e)(!ys(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Dl(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:l,patchFlag:c}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Xs(s,i,d):!!i;if(c&8){const a=t.dynamicProps;for(let h=0;he.__isSuspense;function Hl(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):qi(e)}const Ne=Symbol.for("v-fgt"),Nn=Symbol.for("v-txt"),gt=Symbol.for("v-cmt"),Yn=Symbol.for("v-stc"),qt=[];let Ee=null;function It(e=!1){qt.push(Ee=e?null:[])}function jl(){qt.pop(),Ee=qt[qt.length-1]||null}let Xt=1;function Zs(e,t=!1){Xt+=e,e<0&&Ee&&t&&(Ee.hasOnce=!0)}function jo(e){return e.dynamicChildren=Xt>0?Ee||St:null,jl(),Xt>0&&Ee&&Ee.push(e),e}function Zt(e,t,n,s,r,o){return jo(Y(e,t,n,s,r,o,!0))}function Vl(e,t,n,s,r){return jo(se(e,t,n,s,r,!0))}function En(e){return e?e.__v_isVNode===!0:!1}function Ht(e,t){return e.type===t.type&&e.key===t.key}const Vo=({key:e})=>e??null,pn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?re(e)||de(e)||j(e)?{i:xe,r:e,k:t,f:!!n}:e:null);function Y(e,t=null,n=null,s=0,r=null,o=e===Ne?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vo(t),ref:t&&pn(t),scopeId:go,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:xe};return l?(Ls(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=re(n)?8:16),Xt>0&&!i&&Ee&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&Ee.push(c),c}const se=Bl;function Bl(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===cl)&&(e=gt),En(e)){const l=Mt(e,t,!0);return n&&Ls(l,n),Xt>0&&!o&&Ee&&(l.shapeFlag&6?Ee[Ee.indexOf(e)]=l:Ee.push(l)),l.patchFlag=-2,l}if(Xl(e)&&(e=e.__vccOpts),t){t=Kl(t);let{class:l,style:c}=t;l&&!re(l)&&(t.class=Es(l)),ee(c)&&(As(c)&&!N(c)&&(c=ie({},c)),t.style=xs(c))}const i=re(e)?1:Ho(e)?128:zi(e)?64:ee(e)?4:j(e)?2:0;return Y(e,t,n,s,r,i,o,!0)}function Kl(e){return e?As(e)||Po(e)?ie({},e):e:null}function Mt(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:i,children:l,transition:c}=e,d=t?Ul(r||{},t):r,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Vo(d),ref:t&&t.ref?n&&o?N(o)?o.concat(pn(t)):[o,pn(t)]:pn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ne?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Mt(e.ssContent),ssFallback:e.ssFallback&&Mt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Ms(a,c.clone(a)),a}function tt(e=" ",t=0){return se(Nn,null,e,t)}function lu(e="",t=!1){return t?(It(),Vl(gt,null,e)):se(gt,null,e)}function He(e){return e==null||typeof e=="boolean"?se(gt):N(e)?se(Ne,null,e.slice()):En(e)?st(e):se(Nn,null,String(e))}function st(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Mt(e)}function Ls(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(N(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Ls(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Po(t)?t._ctx=xe:r===3&&xe&&(xe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else j(t)?(t={default:t,_ctx:xe},n=32):(t=String(t),s&64?(n=16,t=[tt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ul(...e){const t={};for(let n=0;n{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};wn=t("__VUE_INSTANCE_SETTERS__",n=>ae=n),ds=t("__VUE_SSR_SETTERS__",n=>en=n)}const on=e=>{const t=ae;return wn(e),e.scope.on(),()=>{e.scope.off(),wn(t)}},er=()=>{ae&&ae.scope.off(),wn(null)};function Bo(e){return e.vnode.shapeFlag&4}let en=!1;function Gl(e,t=!1,n=!1){t&&ds(t);const{props:s,children:r}=e.vnode,o=Bo(e);vl(e,s,o,t),wl(e,r,n);const i=o?zl(e,t):void 0;return t&&ds(!1),i}function zl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,al);const{setup:s}=n;if(s){it();const r=e.setupContext=s.length>1?Yl(e):null,o=on(e),i=rn(s,e,0,[e.props,r]),l=Dr(i);if(lt(),o(),(l||e.sp)&&!kt(e)&&_o(e),l){if(i.then(er,er),t)return i.then(c=>{tr(e,c,t)}).catch(c=>{Fn(c,e,0)});e.asyncDep=i}else tr(e,i,t)}else Ko(e,t)}function tr(e,t,n){j(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ee(t)&&(e.setupState=fo(t)),Ko(e,n)}let nr;function Ko(e,t,n){const s=e.type;if(!e.render){if(!t&&nr&&!s.render){const r=s.template||$s(e).template;if(r){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,d=ie(ie({isCustomElement:o,delimiters:l},i),c);s.render=nr(r,d)}}e.render=s.render||je}{const r=on(e);it();try{dl(e)}finally{lt(),r()}}}const Ql={get(e,t){return fe(e,"get",""),e[t]}};function Yl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ql),slots:e.slots,emit:e.emit,expose:t}}function Hn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(fo(io(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Wt)return Wt[n](e)},has(t,n){return n in t||n in Wt}})):e.proxy}function Jl(e,t=!0){return j(e)?e.displayName||e.name:e.name||t&&e.__name}function Xl(e){return j(e)&&"__vccOpts"in e}const Ce=(e,t)=>Bi(e,t,en);function Uo(e,t,n){const s=arguments.length;return s===2?ee(t)&&!N(t)?En(t)?se(e,null,[t]):se(e,t):se(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&En(n)&&(n=[n]),se(e,t,n))}const Zl="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let hs;const sr=typeof window<"u"&&window.trustedTypes;if(sr)try{hs=sr.createPolicy("vue",{createHTML:e=>e})}catch{}const ko=hs?e=>hs.createHTML(e):e=>e,ec="http://www.w3.org/2000/svg",tc="http://www.w3.org/1998/Math/MathML",qe=typeof document<"u"?document:null,rr=qe&&qe.createElement("template"),nc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?qe.createElementNS(ec,e):t==="mathml"?qe.createElementNS(tc,e):n?qe.createElement(e,{is:n}):qe.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>qe.createTextNode(e),createComment:e=>qe.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qe.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{rr.innerHTML=ko(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const l=rr.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},sc=Symbol("_vtc");function rc(e,t,n){const s=e[sc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const or=Symbol("_vod"),oc=Symbol("_vsh"),ic=Symbol(""),lc=/(^|;)\s*display\s*:/;function cc(e,t,n){const s=e.style,r=re(n);let o=!1;if(n&&!r){if(t)if(re(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&gn(s,l,"")}else for(const i in t)n[i]==null&&gn(s,i,"");for(const i in n)i==="display"&&(o=!0),gn(s,i,n[i])}else if(r){if(t!==n){const i=s[ic];i&&(n+=";"+i),s.cssText=n,o=lc.test(n)}}else t&&e.removeAttribute("style");or in e&&(e[or]=o?s.display:"",e[oc]&&(s.display="none"))}const ir=/\s*!important$/;function gn(e,t,n){if(N(n))n.forEach(s=>gn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=fc(e,t);ir.test(n)?e.setProperty(mt(s),n.replace(ir,""),"important"):e[s]=n}}const lr=["Webkit","Moz","ms"],Jn={};function fc(e,t){const n=Jn[t];if(n)return n;let s=Re(t);if(s!=="filter"&&s in e)return Jn[t]=s;s=An(s);for(let r=0;rXn||(hc.then(()=>Xn=0),Xn=Date.now());function gc(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Ke(mc(s,n.value),t,5,[s])};return n.value=e,n.attached=pc(),n}function mc(e,t){if(N(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const hr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_c=(e,t,n,s,r,o)=>{const i=r==="svg";t==="class"?rc(e,s,i):t==="style"?cc(e,n,s):Pn(t)?ys(t)||ac(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):yc(e,t,s,i))?(ur(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&fr(e,t,s,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!re(s))?ur(e,Re(t),s,o,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),fr(e,t,s,i))};function yc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&hr(t)&&j(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return hr(t)&&re(n)?!1:t in e}const Sn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return N(t)?n=>an(t,n):t};function vc(e){e.target.composing=!0}function pr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Tt=Symbol("_assign"),cu={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Tt]=Sn(r);const o=s||r.props&&r.props.type==="number";dt(e,t?"change":"input",i=>{if(i.target.composing)return;let l=e.value;n&&(l=l.trim()),o&&(l=mn(l)),e[Tt](l)}),n&&dt(e,"change",()=>{e.value=e.value.trim()}),t||(dt(e,"compositionstart",vc),dt(e,"compositionend",pr),dt(e,"change",pr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:o}},i){if(e[Tt]=Sn(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?mn(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c))}},fu={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=Cn(t);dt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?mn(Rn(i)):Rn(i));e[Tt](e.multiple?r?new Set(o):o:o[0]),e._assigning=!0,Ts(()=>{e._assigning=!1})}),e[Tt]=Sn(s)},mounted(e,{value:t}){gr(e,t)},beforeUpdate(e,t,n){e[Tt]=Sn(n)},updated(e,{value:t}){e._assigning||gr(e,t)}};function gr(e,t){const n=e.multiple,s=N(t);if(!(n&&!s&&!Cn(t))){for(let r=0,o=e.options.length;rString(d)===String(l)):i.selected=mi(t,l)>-1}else i.selected=t.has(l);else if(In(Rn(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Rn(e){return"_value"in e?e._value:e.value}const bc=["ctrl","shift","alt","meta"],xc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>bc.some(n=>e[`${n}Key`]&&!t.includes(n))},uu=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...o)=>{for(let i=0;i{const t=wc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Pc(s);if(!r)return;const o=t._component;!j(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const i=n(r,!1,Rc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function Rc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Pc(e){return re(e)?document.querySelector(e):e}var Cc=!1;/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const Oc=Symbol();var _r;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(_r||(_r={}));function Ac(){const e=_i(!0),t=e.run(()=>lo({}));let n=[],s=[];const r=io({install(o){r._a=o,o.provide(Oc,r),o.config.globalProperties.$pinia=r,s.forEach(i=>n.push(i)),s=[]},use(o){return!this._a&&!Cc?s.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const jn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Tc={class:"header"},Ic={class:"nav-links"},Mc={__name:"Header",setup(e){return(t,n)=>{const s=xo("router-link");return It(),Zt("header",Tc,[n[7]||(n[7]=Y("div",{class:"logo"},[Y("h1",null,"商家管理系统")],-1)),Y("nav",null,[Y("ul",Ic,[Y("li",null,[se(s,{to:"/"},{default:et(()=>n[0]||(n[0]=[tt("首页")])),_:1})]),Y("li",null,[se(s,{to:"/book-management"},{default:et(()=>n[1]||(n[1]=[tt("图书管理")])),_:1})]),Y("li",null,[se(s,{to:"/order-management"},{default:et(()=>n[2]||(n[2]=[tt("订单管理")])),_:1})]),Y("li",null,[se(s,{to:"/promotion-management"},{default:et(()=>n[3]||(n[3]=[tt("促销活动")])),_:1})]),Y("li",null,[se(s,{to:"/customer-feedback"},{default:et(()=>n[4]||(n[4]=[tt("客户反馈")])),_:1})]),Y("li",null,[se(s,{to:"/data-analytics"},{default:et(()=>n[5]||(n[5]=[tt("数据分析")])),_:1})]),Y("li",null,[se(s,{to:"/merchant-info"},{default:et(()=>n[6]||(n[6]=[tt("商家信息")])),_:1})])])])])}}},$c=jn(Mc,[["__scopeId","data-v-bf014e38"]]),Fc={},Lc={class:"footer"};function Dc(e,t){return It(),Zt("footer",Lc,t[0]||(t[0]=[Y("p",null,"©2024 商家模块",-1)]))}const Nc=jn(Fc,[["render",Dc],["__scopeId","data-v-298a861b"]]),Hc={id:"app"},jc={class:"content"},Vc={__name:"App",setup(e){return(t,n)=>{const s=xo("router-view");return It(),Zt("div",Hc,[se($c),Y("div",jc,[se(s)]),se(Nc)])}}},Bc=jn(Vc,[["__scopeId","data-v-db0e5e56"]]),Kc="modulepreload",Uc=function(e){return"/"+e},yr={},xt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Uc(c),c in yr)return;yr[c]=!0;const d=c.endsWith(".css"),a=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Kc,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};/*! + * vue-router v4.5.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const wt=typeof document<"u";function Wo(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function kc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Wo(e.default)}const U=Object.assign;function Zn(e,t){const n={};for(const s in t){const r=t[s];n[s]=Ae(r)?r.map(e):e(r)}return n}const Gt=()=>{},Ae=Array.isArray,qo=/#/g,Wc=/&/g,qc=/\//g,Gc=/=/g,zc=/\?/g,Go=/\+/g,Qc=/%5B/g,Yc=/%5D/g,zo=/%5E/g,Jc=/%60/g,Qo=/%7B/g,Xc=/%7C/g,Yo=/%7D/g,Zc=/%20/g;function Ds(e){return encodeURI(""+e).replace(Xc,"|").replace(Qc,"[").replace(Yc,"]")}function ef(e){return Ds(e).replace(Qo,"{").replace(Yo,"}").replace(zo,"^")}function ps(e){return Ds(e).replace(Go,"%2B").replace(Zc,"+").replace(qo,"%23").replace(Wc,"%26").replace(Jc,"`").replace(Qo,"{").replace(Yo,"}").replace(zo,"^")}function tf(e){return ps(e).replace(Gc,"%3D")}function nf(e){return Ds(e).replace(qo,"%23").replace(zc,"%3F")}function sf(e){return e==null?"":nf(e).replace(qc,"%2F")}function tn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const rf=/\/$/,of=e=>e.replace(rf,"");function es(e,t,n="/"){let s,r={},o="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return l=0&&(c=-1),c>-1&&(s=t.slice(0,c),o=t.slice(c+1,l>-1?l:t.length),r=e(o)),l>-1&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=uf(s??t,n),{fullPath:s+(o&&"?")+o+i,path:s,query:r,hash:tn(i)}}function lf(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function vr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function cf(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&$t(t.matched[s],n.matched[r])&&Jo(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function $t(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Jo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ff(e[n],t[n]))return!1;return!0}function ff(e,t){return Ae(e)?br(e,t):Ae(t)?br(t,e):e===t}function br(e,t){return Ae(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function uf(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,l;for(i=0;i1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(i).join("/")}const Ze={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var nn;(function(e){e.pop="pop",e.push="push"})(nn||(nn={}));var zt;(function(e){e.back="back",e.forward="forward",e.unknown=""})(zt||(zt={}));function af(e){if(!e)if(wt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),of(e)}const df=/^[^#]+#/;function hf(e,t){return e.replace(df,"#")+t}function pf(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Vn=()=>({left:window.scrollX,top:window.scrollY});function gf(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=pf(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function xr(e,t){return(history.state?history.state.position-t:-1)+e}const gs=new Map;function mf(e,t){gs.set(e,t)}function _f(e){const t=gs.get(e);return gs.delete(e),t}let yf=()=>location.protocol+"//"+location.host;function Xo(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let l=r.includes(e.slice(o))?e.slice(o).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),vr(c,"")}return vr(n,e)+s+r}function vf(e,t,n,s){let r=[],o=[],i=null;const l=({state:p})=>{const m=Xo(e,location),O=n.value,A=t.value;let V=0;if(p){if(n.value=m,t.value=p,i&&i===O){i=null;return}V=A?p.position-A.position:0}else s(m);r.forEach(F=>{F(n.value,O,{delta:V,type:nn.pop,direction:V?V>0?zt.forward:zt.back:zt.unknown})})};function c(){i=n.value}function d(p){r.push(p);const m=()=>{const O=r.indexOf(p);O>-1&&r.splice(O,1)};return o.push(m),m}function a(){const{history:p}=window;p.state&&p.replaceState(U({},p.state,{scroll:Vn()}),"")}function h(){for(const p of o)p();o=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",a)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",a,{passive:!0}),{pauseListeners:c,listen:d,destroy:h}}function Er(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Vn():null}}function bf(e){const{history:t,location:n}=window,s={value:Xo(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,d,a){const h=e.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+c:yf()+e+c;try{t[a?"replaceState":"pushState"](d,"",p),r.value=d}catch(m){console.error(m),n[a?"replace":"assign"](p)}}function i(c,d){const a=U({},t.state,Er(r.value.back,c,r.value.forward,!0),d,{position:r.value.position});o(c,a,!0),s.value=c}function l(c,d){const a=U({},r.value,t.state,{forward:c,scroll:Vn()});o(a.current,a,!0);const h=U({},Er(s.value,c,null),{position:a.position+1},d);o(c,h,!1),s.value=c}return{location:s,state:r,push:l,replace:i}}function xf(e){e=af(e);const t=bf(e),n=vf(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=U({location:"",base:e,go:s,createHref:hf.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Ef(e){return typeof e=="string"||e&&typeof e=="object"}function Zo(e){return typeof e=="string"||typeof e=="symbol"}const ei=Symbol("");var wr;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(wr||(wr={}));function Ft(e,t){return U(new Error,{type:e,[ei]:!0},t)}function We(e,t){return e instanceof Error&&ei in e&&(t==null||!!(e.type&t))}const Sr="[^/]+?",wf={sensitive:!1,strict:!1,start:!0,end:!0},Sf=/[.+*?^${}()[\]/\\]/g;function Rf(e,t){const n=U({},wf,t),s=[];let r=n.start?"^":"";const o=[];for(const d of e){const a=d.length?[]:[90];n.strict&&!d.length&&(r+="/");for(let h=0;ht.length?t.length===1&&t[0]===80?1:-1:0}function ti(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Cf={type:0,value:""},Of=/[a-zA-Z0-9_]/;function Af(e){if(!e)return[[]];if(e==="/")return[[Cf]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${d}": ${m}`)}let n=0,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let l=0,c,d="",a="";function h(){d&&(n===0?o.push({type:0,value:d}):n===1||n===2||n===3?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:d,regexp:a,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),d="")}function p(){d+=c}for(;l{i(L)}:Gt}function i(h){if(Zo(h)){const p=s.get(h);p&&(s.delete(h),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(h);p>-1&&(n.splice(p,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function c(h){const p=Ff(h,n);n.splice(p,0,h),h.record.name&&!Or(h)&&s.set(h.record.name,h)}function d(h,p){let m,O={},A,V;if("name"in h&&h.name){if(m=s.get(h.name),!m)throw Ft(1,{location:h});V=m.record.name,O=U(Pr(p.params,m.keys.filter(L=>!L.optional).concat(m.parent?m.parent.keys.filter(L=>L.optional):[]).map(L=>L.name)),h.params&&Pr(h.params,m.keys.map(L=>L.name))),A=m.stringify(O)}else if(h.path!=null)A=h.path,m=n.find(L=>L.re.test(A)),m&&(O=m.parse(A),V=m.record.name);else{if(m=p.name?s.get(p.name):n.find(L=>L.re.test(p.path)),!m)throw Ft(1,{location:h,currentLocation:p});V=m.record.name,O=U({},p.params,h.params),A=m.stringify(O)}const F=[];let M=m;for(;M;)F.unshift(M.record),M=M.parent;return{name:V,path:A,params:O,matched:F,meta:$f(F)}}e.forEach(h=>o(h));function a(){n.length=0,s.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:a,getRoutes:l,getRecordMatcher:r}}function Pr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Cr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Mf(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Mf(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Or(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function $f(e){return e.reduce((t,n)=>U(t,n.meta),{})}function Ar(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function Ff(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;ti(e,t[o])<0?s=o:n=o+1}const r=Lf(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Lf(e){let t=e;for(;t=t.parent;)if(ni(t)&&ti(e,t)===0)return t}function ni({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Df(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ro&&ps(o)):[s&&ps(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Nf(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Ae(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Hf=Symbol(""),Ir=Symbol(""),Bn=Symbol(""),si=Symbol(""),ms=Symbol("");function jt(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function rt(e,t,n,s,r,o=i=>i()){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((l,c)=>{const d=p=>{p===!1?c(Ft(4,{from:n,to:t})):p instanceof Error?c(p):Ef(p)?c(Ft(2,{from:t,to:p})):(i&&s.enterCallbacks[r]===i&&typeof p=="function"&&i.push(p),l())},a=o(()=>e.call(s&&s.instances[r],t,n,d));let h=Promise.resolve(a);e.length<3&&(h=h.then(d)),h.catch(p=>c(p))})}function ts(e,t,n,s,r=o=>o()){const o=[];for(const i of e)for(const l in i.components){let c=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(Wo(c)){const a=(c.__vccOpts||c)[t];a&&o.push(rt(a,n,s,i,l,r))}else{let d=c();o.push(()=>d.then(a=>{if(!a)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=kc(a)?a.default:a;i.mods[l]=a,i.components[l]=h;const m=(h.__vccOpts||h)[t];return m&&rt(m,n,s,i,l,r)()}))}}return o}function Mr(e){const t=Ve(Bn),n=Ve(si),s=Ce(()=>{const c=Ct(e.to);return t.resolve(c)}),r=Ce(()=>{const{matched:c}=s.value,{length:d}=c,a=c[d-1],h=n.matched;if(!a||!h.length)return-1;const p=h.findIndex($t.bind(null,a));if(p>-1)return p;const m=$r(c[d-2]);return d>1&&$r(a)===m&&h[h.length-1].path!==m?h.findIndex($t.bind(null,c[d-2])):p}),o=Ce(()=>r.value>-1&&Uf(n.params,s.value.params)),i=Ce(()=>r.value>-1&&r.value===n.matched.length-1&&Jo(n.params,s.value.params));function l(c={}){if(Kf(c)){const d=t[Ct(e.replace)?"replace":"push"](Ct(e.to)).catch(Gt);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:Ce(()=>s.value.href),isActive:o,isExactActive:i,navigate:l}}function jf(e){return e.length===1?e[0]:e}const Vf=mo({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Mr,setup(e,{slots:t}){const n=$n(Mr(e)),{options:s}=Ve(Bn),r=Ce(()=>({[Fr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Fr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&jf(t.default(n));return e.custom?o:Uo("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),Bf=Vf;function Kf(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Uf(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Ae(r)||r.length!==s.length||s.some((o,i)=>o!==r[i]))return!1}return!0}function $r(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Fr=(e,t,n)=>e??t??n,kf=mo({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ve(ms),r=Ce(()=>e.route||s.value),o=Ve(Ir,0),i=Ce(()=>{let d=Ct(o);const{matched:a}=r.value;let h;for(;(h=a[d])&&!h.components;)d++;return d}),l=Ce(()=>r.value.matched[i.value]);dn(Ir,Ce(()=>i.value+1)),dn(Hf,l),dn(ms,r);const c=lo();return hn(()=>[c.value,l.value,e.name],([d,a,h],[p,m,O])=>{a&&(a.instances[h]=d,m&&m!==a&&d&&d===p&&(a.leaveGuards.size||(a.leaveGuards=m.leaveGuards),a.updateGuards.size||(a.updateGuards=m.updateGuards))),d&&a&&(!m||!$t(a,m)||!p)&&(a.enterCallbacks[h]||[]).forEach(A=>A(d))},{flush:"post"}),()=>{const d=r.value,a=e.name,h=l.value,p=h&&h.components[a];if(!p)return Lr(n.default,{Component:p,route:d});const m=h.props[a],O=m?m===!0?d.params:typeof m=="function"?m(d):m:null,V=Uo(p,U({},O,t,{onVnodeUnmounted:F=>{F.component.isUnmounted&&(h.instances[a]=null)},ref:c}));return Lr(n.default,{Component:V,route:d})||V}}});function Lr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Wf=kf;function qf(e){const t=If(e.routes,e),n=e.parseQuery||Df,s=e.stringifyQuery||Tr,r=e.history,o=jt(),i=jt(),l=jt(),c=Ni(Ze);let d=Ze;wt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const a=Zn.bind(null,y=>""+y),h=Zn.bind(null,sf),p=Zn.bind(null,tn);function m(y,C){let R,I;return Zo(y)?(R=t.getRecordMatcher(y),I=C):I=y,t.addRoute(I,R)}function O(y){const C=t.getRecordMatcher(y);C&&t.removeRoute(C)}function A(){return t.getRoutes().map(y=>y.record)}function V(y){return!!t.getRecordMatcher(y)}function F(y,C){if(C=U({},C||c.value),typeof y=="string"){const u=es(n,y,C.path),g=t.resolve({path:u.path},C),v=r.createHref(u.fullPath);return U(u,g,{params:p(g.params),hash:tn(u.hash),redirectedFrom:void 0,href:v})}let R;if(y.path!=null)R=U({},y,{path:es(n,y.path,C.path).path});else{const u=U({},y.params);for(const g in u)u[g]==null&&delete u[g];R=U({},y,{params:h(u)}),C.params=h(C.params)}const I=t.resolve(R,C),q=y.hash||"";I.params=a(p(I.params));const ne=lf(s,U({},y,{hash:ef(q),path:I.path})),f=r.createHref(ne);return U({fullPath:ne,hash:q,query:s===Tr?Nf(y.query):y.query||{}},I,{redirectedFrom:void 0,href:f})}function M(y){return typeof y=="string"?es(n,y,c.value.path):U({},y)}function L(y,C){if(d!==y)return Ft(8,{from:C,to:y})}function T(y){return te(y)}function Q(y){return T(U(M(y),{replace:!0}))}function le(y){const C=y.matched[y.matched.length-1];if(C&&C.redirect){const{redirect:R}=C;let I=typeof R=="function"?R(y):R;return typeof I=="string"&&(I=I.includes("?")||I.includes("#")?I=M(I):{path:I},I.params={}),U({query:y.query,hash:y.hash,params:I.path!=null?{}:y.params},I)}}function te(y,C){const R=d=F(y),I=c.value,q=y.state,ne=y.force,f=y.replace===!0,u=le(R);if(u)return te(U(M(u),{state:typeof u=="object"?U({},q,u.state):q,force:ne,replace:f}),C||R);const g=R;g.redirectedFrom=C;let v;return!ne&&cf(s,I,R)&&(v=Ft(16,{to:g,from:I}),$e(I,I,!0,!1)),(v?Promise.resolve(v):Ie(g,I)).catch(_=>We(_)?We(_,2)?_:Xe(_):K(_,g,I)).then(_=>{if(_){if(We(_,2))return te(U({replace:f},M(_.to),{state:typeof _.to=="object"?U({},q,_.to.state):q,force:ne}),C||g)}else _=ct(g,I,!0,f,q);return Je(g,I,_),_})}function Te(y,C){const R=L(y,C);return R?Promise.reject(R):Promise.resolve()}function Ye(y){const C=vt.values().next().value;return C&&typeof C.runWithContext=="function"?C.runWithContext(y):y()}function Ie(y,C){let R;const[I,q,ne]=Gf(y,C);R=ts(I.reverse(),"beforeRouteLeave",y,C);for(const u of I)u.leaveGuards.forEach(g=>{R.push(rt(g,y,C))});const f=Te.bind(null,y,C);return R.push(f),we(R).then(()=>{R=[];for(const u of o.list())R.push(rt(u,y,C));return R.push(f),we(R)}).then(()=>{R=ts(q,"beforeRouteUpdate",y,C);for(const u of q)u.updateGuards.forEach(g=>{R.push(rt(g,y,C))});return R.push(f),we(R)}).then(()=>{R=[];for(const u of ne)if(u.beforeEnter)if(Ae(u.beforeEnter))for(const g of u.beforeEnter)R.push(rt(g,y,C));else R.push(rt(u.beforeEnter,y,C));return R.push(f),we(R)}).then(()=>(y.matched.forEach(u=>u.enterCallbacks={}),R=ts(ne,"beforeRouteEnter",y,C,Ye),R.push(f),we(R))).then(()=>{R=[];for(const u of i.list())R.push(rt(u,y,C));return R.push(f),we(R)}).catch(u=>We(u,8)?u:Promise.reject(u))}function Je(y,C,R){l.list().forEach(I=>Ye(()=>I(y,C,R)))}function ct(y,C,R,I,q){const ne=L(y,C);if(ne)return ne;const f=C===Ze,u=wt?history.state:{};R&&(I||f?r.replace(y.fullPath,U({scroll:f&&u&&u.scroll},q)):r.push(y.fullPath,q)),c.value=y,$e(y,C,R,f),Xe()}let Me;function Lt(){Me||(Me=r.listen((y,C,R)=>{if(!ln.listening)return;const I=F(y),q=le(I);if(q){te(U(q,{replace:!0,force:!0}),I).catch(Gt);return}d=I;const ne=c.value;wt&&mf(xr(ne.fullPath,R.delta),Vn()),Ie(I,ne).catch(f=>We(f,12)?f:We(f,2)?(te(U(M(f.to),{force:!0}),I).then(u=>{We(u,20)&&!R.delta&&R.type===nn.pop&&r.go(-1,!1)}).catch(Gt),Promise.reject()):(R.delta&&r.go(-R.delta,!1),K(f,I,ne))).then(f=>{f=f||ct(I,ne,!1),f&&(R.delta&&!We(f,8)?r.go(-R.delta,!1):R.type===nn.pop&&We(f,20)&&r.go(-1,!1)),Je(I,ne,f)}).catch(Gt)}))}let _t=jt(),oe=jt(),z;function K(y,C,R){Xe(y);const I=oe.list();return I.length?I.forEach(q=>q(y,C,R)):console.error(y),Promise.reject(y)}function Ue(){return z&&c.value!==Ze?Promise.resolve():new Promise((y,C)=>{_t.add([y,C])})}function Xe(y){return z||(z=!y,Lt(),_t.list().forEach(([C,R])=>y?R(y):C()),_t.reset()),y}function $e(y,C,R,I){const{scrollBehavior:q}=e;if(!wt||!q)return Promise.resolve();const ne=!R&&_f(xr(y.fullPath,0))||(I||!R)&&history.state&&history.state.scroll||null;return Ts().then(()=>q(y,C,ne)).then(f=>f&&gf(f)).catch(f=>K(f,y,C))}const ge=y=>r.go(y);let yt;const vt=new Set,ln={currentRoute:c,listening:!0,addRoute:m,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:V,getRoutes:A,resolve:F,options:e,push:T,replace:Q,go:ge,back:()=>ge(-1),forward:()=>ge(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:oe.add,isReady:Ue,install(y){const C=this;y.component("RouterLink",Bf),y.component("RouterView",Wf),y.config.globalProperties.$router=C,Object.defineProperty(y.config.globalProperties,"$route",{enumerable:!0,get:()=>Ct(c)}),wt&&!yt&&c.value===Ze&&(yt=!0,T(r.location).catch(q=>{}));const R={};for(const q in Ze)Object.defineProperty(R,q,{get:()=>c.value[q],enumerable:!0});y.provide(Bn,C),y.provide(si,ro(R)),y.provide(ms,c);const I=y.unmount;vt.add(y),y.unmount=function(){vt.delete(y),vt.size<1&&(d=Ze,Me&&Me(),Me=null,c.value=Ze,yt=!1,z=!1),I()}}};function we(y){return y.reduce((C,R)=>C.then(()=>Ye(R)),Promise.resolve())}return ln}function Gf(e,t){const n=[],s=[],r=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i$t(d,l))?s.push(l):n.push(l));const c=e.matched[i];c&&(t.matched.find(d=>$t(d,c))||r.push(c))}return[n,s,r]}function zf(){return Ve(Bn)}const Qf={class:"dashboard"},Yf={class:"quick-access"},Jf={class:"card-container"},Xf=["onClick"],Zf={class:"card-icon"},eu=["src","alt"],tu={class:"card-content"},nu={__name:"index",setup(e){const t=zf(),n=[{name:"图书管理",path:"/book-management",description:"管理商店的图书库存",icon:"/icons/book.png"},{name:"订单管理",path:"/order-management",description:"查看和处理订单",icon:"/icons/order.png"},{name:"促销活动",path:"/promotion-management",description:"策划并管理促销活动",icon:"/icons/promotion.png"},{name:"客户关系",path:"/customer-management",description:"维护客户关系,提高满意度",icon:"/icons/customer.png"},{name:"数据分析",path:"/data-analytics",description:"分析数据以驱动决策",icon:"/icons/analytics.png"},{name:"商家信息",path:"/merchant-info",description:"管理您的商家信息",icon:"/icons/merchant.png"}],s=r=>{t.push(r)};return(r,o)=>(It(),Zt("div",Qf,[o[1]||(o[1]=Y("header",{class:"dashboard-header"},[Y("h1",null,"欢迎商家!"),Y("p",null,"高效管理您的商家业务,从这里开始!")],-1)),Y("main",Yf,[o[0]||(o[0]=Y("h2",null,"快速访问功能",-1)),Y("div",Jf,[(It(),Zt(Ne,null,ul(n,i=>Y("div",{class:"card",key:i.name,onClick:l=>s(i.path)},[Y("div",Zf,[Y("img",{src:i.icon,alt:i.name},null,8,eu)]),Y("div",tu,[Y("h3",null,ns(i.name),1),Y("p",null,ns(i.description),1)])],8,Xf)),64))])])]))}},su=jn(nu,[["__scopeId","data-v-2b8f233f"]]),ru=[{path:"/",name:"Home",component:su},{path:"/book-management",name:"BookManagement",component:()=>xt(()=>import("./BookManagement-CoVkzWCf.js"),__vite__mapDeps([0,1]))},{path:"/order-management",name:"OrderManagement",component:()=>xt(()=>import("./OrderManagement-DyeEhSXZ.js"),__vite__mapDeps([2,3]))},{path:"/customer-feedback",name:"CustomerFeedback",component:()=>xt(()=>import("./CustomerFeedback-DYz7shaJ.js"),__vite__mapDeps([4,5]))},{path:"/promotion-management",name:"PromotionManagement",component:()=>xt(()=>import("./PromotionManagement-CZ6ytFC-.js"),__vite__mapDeps([6,7]))},{path:"/data-analytics",name:"DataAnalytics",component:()=>xt(()=>import("./DataAnalytics-CUsP9EzR.js"),__vite__mapDeps([8,9]))},{path:"/merchant-info",name:"MerchantInfo",component:()=>xt(()=>import("./MerchantInfo-xeSUcGPv.js"),__vite__mapDeps([10,11]))}],ou=qf({history:xf(),routes:ru}),Ns=Sc(Bc);Ns.use(ou);Ns.use(Ac());Ns.mount("#app");export{Ne as F,jn as _,Y as a,iu as b,Zt as c,lu as d,ul as e,fu as f,tt as g,Ce as h,Zi as i,It as o,lo as r,ns as t,cu as v,uu as w}; diff --git a/seller_1/dist/homeBG.jpg b/seller_1/dist/homeBG.jpg new file mode 100644 index 0000000..3f166b4 Binary files /dev/null and b/seller_1/dist/homeBG.jpg differ diff --git a/seller_1/dist/index.html b/seller_1/dist/index.html new file mode 100644 index 0000000..34127a0 --- /dev/null +++ b/seller_1/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite + Vue + + + + +
+ + diff --git a/seller_1/dist/vite.svg b/seller_1/dist/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/seller_1/dist/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/seller_1/index.html b/seller_1/index.html new file mode 100644 index 0000000..8388c4b --- /dev/null +++ b/seller_1/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite + Vue + + +
+ + + diff --git a/seller_1/node_modules/.bin/esbuild b/seller_1/node_modules/.bin/esbuild new file mode 100644 index 0000000..63bb6d4 --- /dev/null +++ b/seller_1/node_modules/.bin/esbuild @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esbuild/bin/esbuild" "$@" +else + exec node "$basedir/../esbuild/bin/esbuild" "$@" +fi diff --git a/seller_1/node_modules/.bin/esbuild.cmd b/seller_1/node_modules/.bin/esbuild.cmd new file mode 100644 index 0000000..cc920c5 --- /dev/null +++ b/seller_1/node_modules/.bin/esbuild.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esbuild\bin\esbuild" %* diff --git a/seller_1/node_modules/.bin/esbuild.ps1 b/seller_1/node_modules/.bin/esbuild.ps1 new file mode 100644 index 0000000..81ffbf9 --- /dev/null +++ b/seller_1/node_modules/.bin/esbuild.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args + } else { + & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esbuild/bin/esbuild" $args + } else { + & "node$exe" "$basedir/../esbuild/bin/esbuild" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/nanoid b/seller_1/node_modules/.bin/nanoid new file mode 100644 index 0000000..46220bd --- /dev/null +++ b/seller_1/node_modules/.bin/nanoid @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@" +else + exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@" +fi diff --git a/seller_1/node_modules/.bin/nanoid.cmd b/seller_1/node_modules/.bin/nanoid.cmd new file mode 100644 index 0000000..9c40107 --- /dev/null +++ b/seller_1/node_modules/.bin/nanoid.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %* diff --git a/seller_1/node_modules/.bin/nanoid.ps1 b/seller_1/node_modules/.bin/nanoid.ps1 new file mode 100644 index 0000000..d8a4d7a --- /dev/null +++ b/seller_1/node_modules/.bin/nanoid.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } else { + & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } else { + & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/parser b/seller_1/node_modules/.bin/parser new file mode 100644 index 0000000..7696ad4 --- /dev/null +++ b/seller_1/node_modules/.bin/parser @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +else + exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +fi diff --git a/seller_1/node_modules/.bin/parser.cmd b/seller_1/node_modules/.bin/parser.cmd new file mode 100644 index 0000000..1ad5c81 --- /dev/null +++ b/seller_1/node_modules/.bin/parser.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %* diff --git a/seller_1/node_modules/.bin/parser.ps1 b/seller_1/node_modules/.bin/parser.ps1 new file mode 100644 index 0000000..8926517 --- /dev/null +++ b/seller_1/node_modules/.bin/parser.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/rollup b/seller_1/node_modules/.bin/rollup new file mode 100644 index 0000000..998fc16 --- /dev/null +++ b/seller_1/node_modules/.bin/rollup @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../rollup/dist/bin/rollup" "$@" +else + exec node "$basedir/../rollup/dist/bin/rollup" "$@" +fi diff --git a/seller_1/node_modules/.bin/rollup.cmd b/seller_1/node_modules/.bin/rollup.cmd new file mode 100644 index 0000000..b3f110b --- /dev/null +++ b/seller_1/node_modules/.bin/rollup.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rollup\dist\bin\rollup" %* diff --git a/seller_1/node_modules/.bin/rollup.ps1 b/seller_1/node_modules/.bin/rollup.ps1 new file mode 100644 index 0000000..10f657d --- /dev/null +++ b/seller_1/node_modules/.bin/rollup.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args + } else { + & "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../rollup/dist/bin/rollup" $args + } else { + & "node$exe" "$basedir/../rollup/dist/bin/rollup" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/vite b/seller_1/node_modules/.bin/vite new file mode 100644 index 0000000..014463f --- /dev/null +++ b/seller_1/node_modules/.bin/vite @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@" +else + exec node "$basedir/../vite/bin/vite.js" "$@" +fi diff --git a/seller_1/node_modules/.bin/vite.cmd b/seller_1/node_modules/.bin/vite.cmd new file mode 100644 index 0000000..f62e966 --- /dev/null +++ b/seller_1/node_modules/.bin/vite.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vite\bin\vite.js" %* diff --git a/seller_1/node_modules/.bin/vite.ps1 b/seller_1/node_modules/.bin/vite.ps1 new file mode 100644 index 0000000..a7759bc --- /dev/null +++ b/seller_1/node_modules/.bin/vite.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args + } else { + & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../vite/bin/vite.js" $args + } else { + & "node$exe" "$basedir/../vite/bin/vite.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/vue-demi-fix b/seller_1/node_modules/.bin/vue-demi-fix new file mode 100644 index 0000000..a4fe91d --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-fix @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@" +else + exec node "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@" +fi diff --git a/seller_1/node_modules/.bin/vue-demi-fix.cmd b/seller_1/node_modules/.bin/vue-demi-fix.cmd new file mode 100644 index 0000000..cb05986 --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-fix.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-fix.js" %* diff --git a/seller_1/node_modules/.bin/vue-demi-fix.ps1 b/seller_1/node_modules/.bin/vue-demi-fix.ps1 new file mode 100644 index 0000000..adecc34 --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-fix.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args + } else { + & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args + } else { + & "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.bin/vue-demi-switch b/seller_1/node_modules/.bin/vue-demi-switch new file mode 100644 index 0000000..2bcb66e --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-switch @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@" +else + exec node "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@" +fi diff --git a/seller_1/node_modules/.bin/vue-demi-switch.cmd b/seller_1/node_modules/.bin/vue-demi-switch.cmd new file mode 100644 index 0000000..a685a41 --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-switch.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-switch.js" %* diff --git a/seller_1/node_modules/.bin/vue-demi-switch.ps1 b/seller_1/node_modules/.bin/vue-demi-switch.ps1 new file mode 100644 index 0000000..fbb4d69 --- /dev/null +++ b/seller_1/node_modules/.bin/vue-demi-switch.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args + } else { + & "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args + } else { + & "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/seller_1/node_modules/.package-lock.json b/seller_1/node_modules/.package-lock.json new file mode 100644 index 0000000..3b56a11 --- /dev/null +++ b/seller_1/node_modules/.package-lock.json @@ -0,0 +1,523 @@ +{ + "name": "seller", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.3", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dependencies": { + "@babel/types": "^7.26.3" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.3", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + }, + "node_modules/@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmmirror.com/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==" + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.28.1", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz", + "integrity": "sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz", + "integrity": "sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==" + }, + "node_modules/@vue/reactivity": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz", + "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "dependencies": { + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz", + "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", + "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/shared": "3.5.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz", + "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "dependencies": { + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "vue": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==" + }, + "node_modules/chart.js": { + "version": "4.4.7", + "resolved": "https://registry.npmmirror.com/chart.js/-/chart.js-4.4.7.tgz", + "integrity": "sha512-pwkcKfdzTMAU/+jNosKhNL2bHtJc/sSmYgVbuGTEDhzkrhmyihmP7vUc/5ZK9WopidMDHNe3Wm7jOd/WhuHWuw==", + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=8" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/magic-string": { + "version": "0.30.15", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.15.tgz", + "integrity": "sha512-zXeaYRgZ6ldS1RJJUrMrYgNJ4fdwnyI6tVqoiIhyCyv5IVTK9BU8Ic2l253GGETQHxI4HNUwhJ3fjDhKqEoaAw==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/pinia": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.3.0.tgz", + "integrity": "sha512-ohZj3jla0LL0OH5PlLTDMzqKiVw2XARmC1XYLdLWIPBMdhDW/123ZWr4zVAhtJm+aoSkFa13pYXskAvAscIkhQ==", + "dependencies": { + "@vue/devtools-api": "^6.6.3", + "vue-demi": "^0.14.10" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/postcss": { + "version": "8.4.49", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.28.1", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.28.1.tgz", + "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.28.1", + "@rollup/rollup-android-arm64": "4.28.1", + "@rollup/rollup-darwin-arm64": "4.28.1", + "@rollup/rollup-darwin-x64": "4.28.1", + "@rollup/rollup-freebsd-arm64": "4.28.1", + "@rollup/rollup-freebsd-x64": "4.28.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.28.1", + "@rollup/rollup-linux-arm-musleabihf": "4.28.1", + "@rollup/rollup-linux-arm64-gnu": "4.28.1", + "@rollup/rollup-linux-arm64-musl": "4.28.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.28.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1", + "@rollup/rollup-linux-riscv64-gnu": "4.28.1", + "@rollup/rollup-linux-s390x-gnu": "4.28.1", + "@rollup/rollup-linux-x64-gnu": "4.28.1", + "@rollup/rollup-linux-x64-musl": "4.28.1", + "@rollup/rollup-win32-arm64-msvc": "4.28.1", + "@rollup/rollup-win32-ia32-msvc": "4.28.1", + "@rollup/rollup-win32-x64-msvc": "4.28.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "6.0.3", + "resolved": "https://registry.npmmirror.com/vite/-/vite-6.0.3.tgz", + "integrity": "sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==", + "dependencies": { + "esbuild": "^0.24.0", + "postcss": "^8.4.49", + "rollup": "^4.23.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", + "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-sfc": "3.5.13", + "@vue/runtime-dom": "3.5.13", + "@vue/server-renderer": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.0.tgz", + "integrity": "sha512-HDuk+PuH5monfNuY+ct49mNmkCRK4xJAV9Ts4z9UFc4rzdDnxQLyCMGGc8pKhZhHTVzfanpNwB/lwqevcBwI4w==", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + } + } +} diff --git a/seller_1/node_modules/@babel/helper-string-parser/LICENSE b/seller_1/node_modules/@babel/helper-string-parser/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/seller_1/node_modules/@babel/helper-string-parser/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/@babel/helper-string-parser/README.md b/seller_1/node_modules/@babel/helper-string-parser/README.md new file mode 100644 index 0000000..771b470 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-string-parser/README.md @@ -0,0 +1,19 @@ +# @babel/helper-string-parser + +> A utility package to parse strings + +See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-string-parser +``` + +or using yarn: + +```sh +yarn add @babel/helper-string-parser +``` diff --git a/seller_1/node_modules/@babel/helper-string-parser/lib/index.js b/seller_1/node_modules/@babel/helper-string-parser/lib/index.js new file mode 100644 index 0000000..2d94115 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-string-parser/lib/index.js @@ -0,0 +1,295 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.readCodePoint = readCodePoint; +exports.readInt = readInt; +exports.readStringContents = readStringContents; +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; +const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) +}; +const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 +}; +function readStringContents(type, input, pos, lineStart, curLine, errors) { + const initialPos = pos; + const initialLineStart = lineStart; + const initialCurLine = curLine; + let out = ""; + let firstInvalidLoc = null; + let chunkStart = pos; + const { + length + } = input; + for (;;) { + if (pos >= length) { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + out += input.slice(chunkStart, pos); + break; + } + const ch = input.charCodeAt(pos); + if (isStringEnd(type, ch, input, pos)) { + out += input.slice(chunkStart, pos); + break; + } + if (ch === 92) { + out += input.slice(chunkStart, pos); + const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); + if (res.ch === null && !firstInvalidLoc) { + firstInvalidLoc = { + pos, + lineStart, + curLine + }; + } else { + out += res.ch; + } + ({ + pos, + lineStart, + curLine + } = res); + chunkStart = pos; + } else if (ch === 8232 || ch === 8233) { + ++pos; + ++curLine; + lineStart = pos; + } else if (ch === 10 || ch === 13) { + if (type === "template") { + out += input.slice(chunkStart, pos) + "\n"; + ++pos; + if (ch === 13 && input.charCodeAt(pos) === 10) { + ++pos; + } + ++curLine; + chunkStart = lineStart = pos; + } else { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + } + } else { + ++pos; + } + } + return { + pos, + str: out, + firstInvalidLoc, + lineStart, + curLine, + containsInvalid: !!firstInvalidLoc + }; +} +function isStringEnd(type, ch, input, pos) { + if (type === "template") { + return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; + } + return ch === (type === "double" ? 34 : 39); +} +function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { + const throwOnInvalid = !inTemplate; + pos++; + const res = ch => ({ + pos, + ch, + lineStart, + curLine + }); + const ch = input.charCodeAt(pos++); + switch (ch) { + case 110: + return res("\n"); + case 114: + return res("\r"); + case 120: + { + let code; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCharCode(code)); + } + case 117: + { + let code; + ({ + code, + pos + } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCodePoint(code)); + } + case 116: + return res("\t"); + case 98: + return res("\b"); + case 118: + return res("\u000b"); + case 102: + return res("\f"); + case 13: + if (input.charCodeAt(pos) === 10) { + ++pos; + } + case 10: + lineStart = pos; + ++curLine; + case 8232: + case 8233: + return res(""); + case 56: + case 57: + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(pos - 1, lineStart, curLine); + } + default: + if (ch >= 48 && ch <= 55) { + const startPos = pos - 1; + const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + pos += octalStr.length - 1; + const next = input.charCodeAt(pos); + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(startPos, lineStart, curLine); + } + } + return res(String.fromCharCode(octal)); + } + return res(String.fromCharCode(ch)); + } +} +function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { + const initialPos = pos; + let n; + ({ + n, + pos + } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); + if (n === null) { + if (throwOnInvalid) { + errors.invalidEscapeSequence(initialPos, lineStart, curLine); + } else { + pos = initialPos - 1; + } + } + return { + code: n, + pos + }; +} +function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { + const start = pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = input.charCodeAt(pos); + let val; + if (code === 95 && allowNumSeparator !== "bail") { + const prev = input.charCodeAt(pos - 1); + const next = input.charCodeAt(pos + 1); + if (!allowNumSeparator) { + if (bailOnError) return { + n: null, + pos + }; + errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + if (bailOnError) return { + n: null, + pos + }; + errors.unexpectedNumericSeparator(pos, lineStart, curLine); + } + ++pos; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + if (val <= 9 && bailOnError) { + return { + n: null, + pos + }; + } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { + val = 0; + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + ++pos; + total = total * radix + val; + } + if (pos === start || len != null && pos - start !== len || invalid) { + return { + n: null, + pos + }; + } + return { + n: total, + pos + }; +} +function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { + const ch = input.charCodeAt(pos); + let code; + if (ch === 123) { + ++pos; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); + ++pos; + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + errors.invalidCodePoint(pos, lineStart, curLine); + } else { + return { + code: null, + pos + }; + } + } + } else { + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); + } + return { + code, + pos + }; +} + +//# sourceMappingURL=index.js.map diff --git a/seller_1/node_modules/@babel/helper-string-parser/lib/index.js.map b/seller_1/node_modules/@babel/helper-string-parser/lib/index.js.map new file mode 100644 index 0000000..cd50797 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-string-parser/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isDigit","code","forbiddenNumericSeparatorSiblings","decBinOct","Set","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","type","input","pos","lineStart","curLine","errors","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","length","unterminated","slice","charCodeAt","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","String","fromCharCode","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","exec","octalStr","octal","parseInt","next","len","forceLen","n","readInt","invalidEscapeSequence","radix","allowNumSeparator","bailOnError","start","forbiddenSiblings","isAllowedSibling","invalid","total","i","e","Infinity","val","prev","numericSeparatorInEscapeSequence","Number","isNaN","has","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint"],"sources":["../src/index.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(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CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,CAAC,EACD,KAAK,EACLkB,cAAc,EACdjB,MACF,CAAC;EACH;EACA,OAAO;IAAEhB,IAAI;IAAEa;EAAI,CAAC;AACtB","ignoreList":[]} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/helper-string-parser/package.json b/seller_1/node_modules/@babel/helper-string-parser/package.json new file mode 100644 index 0000000..0d0a31a --- /dev/null +++ b/seller_1/node_modules/@babel/helper-string-parser/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helper-string-parser", + "version": "7.25.9", + "description": "A utility package to parse strings", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-string-parser" + }, + "homepage": "https://babel.dev/docs/en/next/babel-helper-string-parser", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "devDependencies": { + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/LICENSE b/seller_1/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/README.md b/seller_1/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 0000000..05c19e6 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-validator-identifier +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-identifier +``` diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 0000000..fdb9aec --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +exports.isIdentifierStart = isIdentifierStart; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\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\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\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\u0af9\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-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\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-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\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\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; +} + +//# sourceMappingURL=identifier.js.map diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map new file mode 100644 index 0000000..ecf0952 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\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\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\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\\u0af9\\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-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\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-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\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\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\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\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7cd\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7dc\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n"],"mappings":";;;;;;;;AAaA,IAAIA,4BAA4B,GAAG,8qIAA8qI;AAEjtI,IAAIC,uBAAuB,GAAG,+kFAA+kF;AAE7mF,MAAMC,uBAAuB,GAAG,IAAIC,MAAM,CACxC,GAAG,GAAGH,4BAA4B,GAAG,GACvC,CAAC;AACD,MAAMI,kBAAkB,GAAG,IAAID,MAAM,CACnC,GAAG,GAAGH,4BAA4B,GAAGC,uBAAuB,GAAG,GACjE,CAAC;AAEDD,4BAA4B,GAAGC,uBAAuB,GAAG,IAAI;AAQ7D,MAAMI,0BAA0B,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,CA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,kBAAkB,CAACU,IAAI,CAACC,MAAM,CAACC,YAAY,CAACR,IAAI,CAAC,CAAC;EAC3E;EACA,OACED,aAAa,CAACC,IAAI,EAAEH,0BAA0B,CAAC,IAC/CE,aAAa,CAACC,IAAI,EAAEF,qBAAqB,CAAC;AAE9C;AAIO,SAASY,gBAAgBA,CAACC,IAAY,EAAW;EACtD,IAAIC,OAAO,GAAG,IAAI;EAClB,KAAK,IAAIT,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAED,CAAC,EAAE,EAAE;IAKpC,IAAIU,EAAE,GAAGF,IAAI,CAACG,UAAU,CAACX,CAAC,CAAC;IAC3B,IAAI,CAACU,EAAE,GAAG,MAAM,MAAM,MAAM,IAAIV,CAAC,GAAG,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAE;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAU,CAAC,EAAEX,CAAC,CAAC;MAClC,IAAI,CAACY,KAAK,GAAG,MAAM,MAAM,MAAM,EAAE;QAC/BF,EAAE,GAAG,OAAO,IAAI,CAACA,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,IAAIE,KAAK,GAAG,KAAK,CAAC;MACvD;IACF;IACA,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,IAAI,CAACP,iBAAiB,CAACQ,EAAE,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF,CAAC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,EAAE,CAAC,EAAE;MAChC,OAAO,KAAK;IACd;EACF;EACA,OAAO,CAACD,OAAO;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js b/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 0000000..76b2282 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +}); +Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +}); +Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +}); +Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +}); +Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +}); +Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +}); +var _identifier = require("./identifier.js"); +var _keyword = require("./keyword.js"); + +//# sourceMappingURL=index.js.map diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js.map new file mode 100644 index 0000000..d985f3b --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 0000000..054cf84 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isKeyword = isKeyword; +exports.isReservedWord = isReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} + +//# sourceMappingURL=keyword.js.map diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map new file mode 100644 index 0000000..3471f78 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"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;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B","ignoreList":[]} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/helper-validator-identifier/package.json b/seller_1/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 0000000..0147740 --- /dev/null +++ b/seller_1/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helper-validator-identifier", + "version": "7.25.9", + "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "devDependencies": { + "@unicode/unicode-16.0.0": "^1.0.0", + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/seller_1/node_modules/@babel/parser/CHANGELOG.md b/seller_1/node_modules/@babel/parser/CHANGELOG.md new file mode 100644 index 0000000..b3840ac --- /dev/null +++ b/seller_1/node_modules/@babel/parser/CHANGELOG.md @@ -0,0 +1,1073 @@ +# Changelog + +> **Tags:** +> - :boom: [Breaking Change] +> - :eyeglasses: [Spec Compliance] +> - :rocket: [New Feature] +> - :bug: [Bug Fix] +> - :memo: [Documentation] +> - :house: [Internal] +> - :nail_care: [Polish] + +> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver + +_Note: Gaps between patch versions are faulty, broken or test releases._ + +See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. + +## 6.17.1 (2017-05-10) + +### :bug: Bug Fix + * Fix typo in flow spread operator error (Brian Ng) + * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) + * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) + * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) + * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) + * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) + * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) + +## 6.17.0 (2017-04-20) + +### :bug: Bug Fix + * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) + * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) + * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) + * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) + * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) + * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) + +## 7.0.0-beta.8 (2017-04-04) + +### New Feature +* Add support for flow type spread (#418) (Conrad Buck) +* Allow statics in flow interfaces (#427) (Brian Ng) + +### Bug Fix +* Fix predicate attachment to match flow parser (#428) (Brian Ng) +* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) +* Fix rest parameters with array and objects (#424) (Brian Ng) +* Fix number parser (#433) (Alex Kuzmenko) + +### Docs +* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) + +### Internal +* Use babel-register script when running babel smoke tests (#442) (Brian Ng) + +## 7.0.0-beta.7 (2017-03-22) + +### Spec Compliance +* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) + +### Bug Fix + +* Fix push-pop logic in flow (#405) (Daniel Tschinder) + +## 7.0.0-beta.6 (2017-03-21) + +### New Feature +* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) + +### Polish +* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) + +### Docs + +* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) + +## 7.0.0-beta.5 (2017-03-21) + +### Bug Fix +* Throw error if new.target is used outside of a function (#402) (Brian Ng) +* Fix parsing of class properties (#351) (Kevin Gibbons) + +### Other + * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) + * Optimize travis builds (#419) (Daniel Tschinder) + * Update codecov to 2.0 (#412) (Daniel Tschinder) + * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) + * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) + * Upgrade flow to 0.41 (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * Update yarn lock (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) + * Add estree test for correct order of directives (Daniel Tschinder) + * Add DoExpression to spec (#364) (Alex Kuzmenko) + * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) + * Explain how to run only one test (#389) [skip ci] (Aaron Ang) + + ## 7.0.0-beta.4 (2017-03-01) + +* Don't consume async when checking for async func decl (#377) (Brian Ng) +* add `ranges` option [skip ci] (Henry Zhu) +* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) + +## 7.0.0-beta.3 (2017-02-28) + +- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) +- Merge changes from 6.x + +## 7.0.0-beta.2 (2017-02-20) + +- estree: correctly change literals in all cases (#368) (Daniel Tschinder) + +## 7.0.0-beta.1 (2017-02-20) + +- Fix negative number literal typeannotations (#366) (Daniel Tschinder) +- Update contributing with more test info [skip ci] (#355) (Brian Ng) + +## 7.0.0-beta.0 (2017-02-15) + +- Reintroduce Variance node (#333) (Daniel Tschinder) +- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) +- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) +- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) +- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) +- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) +- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) +- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) +- Remove classConstructorCall plugin (#291) (Brian Ng) +- Update yarn.lock (Daniel Tschinder) +- Update cross-env to 3.x (Daniel Tschinder) +- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) +- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) + +## 6.16.1 (2017-02-23) + +### :bug: Regression + +- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) + +Need to modify Babel for this AST node change, so moving to 7.0. + +- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) + +[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. + +## 6.16.0 (2017-02-23) + +### :rocket: New Feature + +***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) + +We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) + +We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. + +To enable `estree` mode simply add the plugin in the config: +```json +{ + "plugins": [ "estree" ] +} +``` + +If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. + +Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) + +Babylon exports a new function to parse a single expression + +```js +import { parseExpression } from 'babylon'; + +const ast = parseExpression('x || y && z', options); +``` + +The returned AST will only consist of the expression. The options are the same as for `parse()` + +Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) + +A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. +Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... + +Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) + +Added support for function predicates which flow introduced in version 0.33.0 + +```js +declare function is_number(x: mixed): boolean %checks(typeof x === "number"); +``` + +Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) + +Added support for imports within module declarations which flow introduced in version 0.37.0 + +```js +declare module "C" { + import type { DT } from "D"; + declare export type CT = { D: DT }; +} +``` + +### :eyeglasses: Spec Compliance + +Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) + +This example now correctly throws an error when there is a semicolon after the decorator: + +```js +class A { +@a; +foo(){} +} +``` + +Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) + +Using keywords in imports is not allowed anymore: + +```js +import { default } from "foo"; +import { a as debugger } from "foo"; +``` + +Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) + +In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. + +Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) + +The following code now correctly throws an error + +```js +import type { type a } from "foo"; +``` + +Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) + +Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. + +If you enable the flow plugin you can only define the type of the class properties, but not initialize them. + +Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) + +Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. + +```js +export default async function bar() {}; +``` + +### :nail_care: Polish + +Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) + +### :bug: Bug Fix + +Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) + +Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) + +ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) + +Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) + +Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) + +Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) + +Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) + +Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) + + +### :house: Internal + +Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) + +Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) + +Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) + +chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) + +Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) + +Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) + +Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) + +devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) + +Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) + +Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) + +### :memo: Documentation + +Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) + +Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) + +Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) + +AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) + +## 6.15.0 (2017-01-10) + +### :eyeglasses: Spec Compliance + +Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) + +This change implements flows new shorthand import syntax +and where previously you had to write this code: + +```js +import {someValue} from "blah"; +import type {someType} from "blah"; +import typeof {someOtherValue} from "blah"; +``` + +you can now write it like this: + +```js +import { + someValue, + type someType, + typeof someOtherValue, +} from "blah"; +``` + +For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. + +flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) + +This change now allows a leading pipe everywhere types can be used: +```js +var f = (x): | 1 | 2 => 1; +``` + +Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) + +Previously babylon parsed the following exports, although they are not valid: +```js +export typeof foo; +export new Foo(); +export function() {}; +export for (;;); +export while(foo); +``` + +### :bug: Bug Fix + +Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) + +This fixes parsing of this case: + +```js +const map = { + [age <= 17] : 'Too young' +}; +``` + +Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) + +The following case produced an invalid AST +```js +
{/* foo */}
+``` + +Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) + +When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. + +Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) + +Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) + +### :house: Internal + +User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) + +Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) + +Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) + +Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) + +Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) + +Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) + +Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) + +chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) + +chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) + +## 6.14.1 (2016-11-17) + +### :bug: Bug Fix + +Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) + +```js +{ + "plugins": ["*"] +} +``` + +Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. + +## 6.14.0 (2016-11-16) + +### :eyeglasses: Spec Compliance + +Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) + +[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) + +Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). + +``` +class enum {} // throws +class await {} // throws in strict mode (module) +``` + +Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) + +So where you used to have to write + +```js +type A = (x: string, y: boolean) => number; +type B = (z: string) => number; +type C = { [key: string]: number }; +``` + +you can now write (with flow 0.34.0) + +```js +type A = (string, boolean) => number; +type B = string => number; +type C = { [string]: number }; +``` + +Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) + +Supports these form now of specifying array types: + +```js +var a: number[][][][]; +var b: string[][]; +``` + +### :bug: Bug Fix + +Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) + +``` +declare module "foo" { declare module.exports: number } +declare module "foo" { declare module.exports: number; } // also allowed now +``` + +### :house: Internal + + * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) + * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) + * Add node 7 (Daniel Tschinder) + * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) + +## v6.13.1 (2016-10-26) + +### :nail_care: Polish + +- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) + +```js +const babylon = require('babylon'); +const ast = babylon.parse('var foo = "lol";'); +``` + +With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. + +**Without bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) + +**With bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) + +- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) +- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) + +## v6.13.0 (2016-10-21) + +### :eyeglasses: Spec Compliance + +Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) + +> See https://flowtype.org/docs/variance.html for more information + +```js +type T = { +p: T }; +interface T { -p: T }; +declare class T { +[k:K]: V }; +class T { -[k:K]: V }; +class C2 { +p: T = e }; +``` + +Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) + +```js +({ __proto__: 1, __proto__: 2 }) // Throws an error now +``` + +### :bug: Bug Fix + +Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) + +```js +declare class A { + static: T; +} +``` + +Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) + +```js +var foo = { async, bar }; +``` + +### :nail_care: Polish + +Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) + +> This improves the performance slightly (because of hidden classes) + +### :house: Internal + +Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) + +Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) + +Readd missin .eslinignore for IDEs (Daniel Tschinder) + +Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) + +Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) + +Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) + +## v6.12.0 (2016-10-14) + +### :eyeglasses: Spec Compliance + +Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) + +#### Dynamic Import + +- Proposal Repo: https://github.com/domenic/proposal-dynamic-import +- Championed by [@domenic](https://github.com/domenic) +- stage-2 +- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) + +> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript + +```js +import(`./section-modules/${link.dataset.entryModule}.js`) +.then(module => { + module.loadPageInto(main); +}) +``` + +Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) + +#### EmptyTypeAnnotation + +Just wasn't covered before. + +```js +type T = empty; +``` + +### :bug: Bug Fix + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing due to sparse array +export const { foo: [ ,, qux7 ] } = bar; +``` + +Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) + +```js +declare class X { + foobar(): void; + static foobar(): void; +} +``` + +Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) + +```js +class Foo { + delete(item: T): T { + return item; + } +} +``` + +Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) + +```js +function *foo() { + const x = (yield 5: any); +} +``` + +### :nail_care: Polish + +Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) + +```js +// Unexpected token, expected ; (1:6) +{ set 1 } +``` + +### :house: Internal + +Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) + +Also run flow, linting, babel tests on separate instances (add back node 0.10) + +## v6.11.6 (2016-10-12) + +### :bug: Bug Fix/Regression + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing with `Cannot read property 'type' of null` because of null identifiers +export const { foo: [ ,, qux7 ] } = bar; +``` + +## v6.11.5 (2016-10-12) + +### :eyeglasses: Spec Compliance + +Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:20) +export function foo() {}; +export const { a: [{foo}] } = bar; +``` + +Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:22) +export const foo = 1; +export const [bar, ...foo] = baz; +``` + +### :bug: Bug Fix + +Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) + +```js +// this is ok now +const test = ({async = true}) => {}; +``` + +### :nail_care: Polish + +Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) + +```bash +# So in the case of a missing ending curly (`}`) +Module build failed: SyntaxError: Unexpected token, expected } (30:0) + 28 | } + 29 | +> 30 | + | ^ +``` + +## v6.11.4 (2016-10-03) + +Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) + +## v6.11.3 (2016-10-01) + +### :eyeglasses: Spec Compliance + +Add static errors for object rest (#149) ([@danez](https://github.com/danez)) + +> https://github.com/sebmarkbage/ecmascript-rest-spread + +Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. + +```js +let { x, y, ...z } = { x: 1, y: 2, z: 3 }; +// x = 1 +// y = 2 +// z = { z: 3 } +``` + +#### New Syntax Errors: + +**SyntaxError**: The rest element has to be the last element when destructuring (1:10) +```bash +> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = { x: 1, y: 2, z: 3 } +# y = 2 +# z = 3 +``` + +Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. + +**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) + +```bash +> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = 1 +# y = { y: 2, z: 3 } +# z = { y: 2, z: 3 } +``` + +Before y and z would just be the same value anyway so there is no reason to need to have both. + +**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) + +```js +let { x, y, ...z, } = obj; +``` + +The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. + +--- + +get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) + +```js +// valid +function something({ set = null, get = null }) {} +``` + +## v6.11.2 (2016-09-23) + +### Bug Fix + +- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo + +```js +// regression with duplicate export check +SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) + 20 | + 21 | export const { rhythm } = typography; +> 22 | export const { TypographyStyle } = typography +``` + +Bail out for now, and make a change to account for destructuring in the next release. + +## 6.11.1 (2016-09-22) + +### Bug Fix +- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez + +```javascript +export toString from './toString'; +``` + +```bash +`toString` has already been exported. Exported identifiers must be unique. (1:7) +> 1 | export toString from './toString'; + | ^ + 2 | +``` + +## 6.11.0 (2016-09-22) + +### Spec Compliance (will break CI) + +- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo + +```js +// Only one default export allowed per module. (2:9) +export default function() {}; +export { foo as default }; + +// Only one default export allowed per module. (2:0) +export default {}; +export default function() {}; + +// `Foo` has already been exported. Exported identifiers must be unique. (2:0) +export { Foo }; +export class Foo {}; +``` + +### New Feature (Syntax) + +- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 + +```js +// AST +interface ClassProperty <: Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + computed: boolean; // added +} +``` + +```js +// with "plugins": ["classProperties"] +class Foo { + [x] + ['y'] +} + +class Bar { + [p] + [m] () {} +} + ``` + +### Bug Fix + +- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper + +```js +declare class X { + a: number; + static b: number; // static + c: number; // this was being marked as static in the AST as well +} +``` + +### Polish + +- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 + +```js +// Used to error with: +// SyntaxError: Assigning to rvalue (1:0) + +// Now: +// Invalid left-hand side in assignment expression (1:0) +3 = 4 + +// Invalid left-hand side in for-in statement (1:5) +for (+i in {}); +``` + +### Internal + +- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez +- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo + +## 6.10.0 (2016-09-19) + +> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. + +### Spec Compliance + +* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) + +> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors + +More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) + +For example: + +```js +// this errors because it uses destructuring and default parameters +// in a function with a "use strict" directive +function a([ option1, option2 ] = []) { + "use strict"; +} + ``` + +The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. + +### New Feature + +* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) + +Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 + +Looks like: + +```js +var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; +``` + +### Bug Fixes + +* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) +* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) +* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) + +### Misc + +* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) +* Fix Contributing guidelines [skip ci] (Daniel Tschinder) + +## 6.9.2 (2016-09-09) + +The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. + +## 6.9.1 (2016-08-23) + +This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. + +### Bug Fixes + +- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez +- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez +- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper +- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez +- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez + +## 6.9.0 (2016-08-16) + +### New syntax support + +- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer + +(Be aware that React is not going to support this syntax) + +```js +
+ {...todos.map(todo => )} +
+``` + +- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez + +```js +declare module "foo" { + declare module.exports: {} +} +``` + +### New Features + +- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain +- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens + +### Bug Fixes + +- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez +- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez +- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi +- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez +- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi +- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez +- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez + +### Internal + +- Add codecoverage to tests @danez +- Fix tests to not save expected output if we expect the test to fail @danez +- Make a shallow clone of babel for testing @danez +- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot +- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot +- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot +- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot + +## 6.8.4 (2016-07-06) + +### Bug Fixes + +- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez + +## 6.8.3 (2016-07-02) + +### Bug Fixes + +- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez + +## 6.8.2 (2016-06-24) + +### Bug Fixes + +- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal +- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez +- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez +- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez +- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez +- Support negative numeric type literals @kittens +- Remove line terminator restriction after await keyword @kittens +- Remove grouped type arrow restriction as it seems flow no longer has it @kittens +- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin +- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi + +### Documentation + +- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene +- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo + +### Internal + +- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez +- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez +- Upgrade test runner ava @kittens +- Add missing generate-identifier-regex script @kittens +- Rename parser context types @kittens +- Add node v6 to travis testing @hzoo +- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens + +## 6.8.1 (2016-06-06) + +### New Feature + +- Parse type parameter declarations with defaults like `type Foo = T` + +### Bug Fixes +- Type parameter declarations need 1 or more type parameters. +- The existential type `*` is not a valid type parameter. +- The existential type `*` is a primary type + +### Spec Compliance +- The param list for type parameter declarations now consists of `TypeParameter` nodes +- New `TypeParameter` AST Node (replaces using the `Identifier` node before) + +``` +interface TypeParameter <: Node { + bound: TypeAnnotation; + default: TypeAnnotation; + name: string; + variance: "plus" | "minus"; +} +``` + +## 6.8.0 (2016-05-02) + +#### New Feature + +##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) + +> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). + +Examples: + +```js +class Foo { + constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} +} + +export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} + +var obj = { + method(@foo() x, @bar({ a: 123 }) @baz() y) {} +}; +``` + +##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) + +There is also a new node type, `ForAwaitStatement`. + +> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). + +Example: + +```js +async function f() { + for await (let x of y); +} +``` diff --git a/seller_1/node_modules/@babel/parser/LICENSE b/seller_1/node_modules/@babel/parser/LICENSE new file mode 100644 index 0000000..d4c7fc5 --- /dev/null +++ b/seller_1/node_modules/@babel/parser/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@babel/parser/README.md b/seller_1/node_modules/@babel/parser/README.md new file mode 100644 index 0000000..a9463e8 --- /dev/null +++ b/seller_1/node_modules/@babel/parser/README.md @@ -0,0 +1,19 @@ +# @babel/parser + +> A JavaScript parser + +See our website [@babel/parser](https://babeljs.io/docs/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/parser +``` + +or using yarn: + +```sh +yarn add @babel/parser --dev +``` diff --git a/seller_1/node_modules/@babel/parser/bin/babel-parser.js b/seller_1/node_modules/@babel/parser/bin/babel-parser.js new file mode 100644 index 0000000..3aca314 --- /dev/null +++ b/seller_1/node_modules/@babel/parser/bin/babel-parser.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +/* eslint no-var: 0 */ + +var parser = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); +} else { + var file = fs.readFileSync(filename, "utf8"); + var ast = parser.parse(file); + + console.log(JSON.stringify(ast, null, " ")); +} diff --git a/seller_1/node_modules/@babel/parser/index.cjs b/seller_1/node_modules/@babel/parser/index.cjs new file mode 100644 index 0000000..89863a9 --- /dev/null +++ b/seller_1/node_modules/@babel/parser/index.cjs @@ -0,0 +1,5 @@ +try { + module.exports = require("./lib/index.cjs"); +} catch { + module.exports = require("./lib/index.js"); +} diff --git a/seller_1/node_modules/@babel/parser/lib/index.js b/seller_1/node_modules/@babel/parser/lib/index.js new file mode 100644 index 0000000..23d07ff --- /dev/null +++ b/seller_1/node_modules/@babel/parser/lib/index.js @@ -0,0 +1,14027 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; +} +class Position { + constructor(line, col, index) { + this.line = void 0; + this.column = void 0; + this.index = void 0; + this.line = line; + this.column = col; + this.index = index; + } +} +class SourceLocation { + constructor(start, end) { + this.start = void 0; + this.end = void 0; + this.filename = void 0; + this.identifierName = void 0; + this.start = start; + this.end = end; + } +} +function createPositionWithColumnOffset(position, columnOffset) { + const { + line, + column, + index + } = position; + return new Position(line, column + columnOffset, index + columnOffset); +} +const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; +var ModuleErrors = { + ImportMetaOutsideModule: { + message: `import.meta may appear only with 'sourceType: "module"'`, + code + }, + ImportOutsideModule: { + message: `'import' and 'export' may appear only with 'sourceType: "module"'`, + code + } +}; +const NodeDescriptions = { + ArrayPattern: "array destructuring pattern", + AssignmentExpression: "assignment expression", + AssignmentPattern: "assignment expression", + ArrowFunctionExpression: "arrow function expression", + ConditionalExpression: "conditional expression", + CatchClause: "catch clause", + ForOfStatement: "for-of statement", + ForInStatement: "for-in statement", + ForStatement: "for-loop", + FormalParameters: "function parameter list", + Identifier: "identifier", + ImportSpecifier: "import specifier", + ImportDefaultSpecifier: "import default specifier", + ImportNamespaceSpecifier: "import namespace specifier", + ObjectPattern: "object destructuring pattern", + ParenthesizedExpression: "parenthesized expression", + RestElement: "rest element", + UpdateExpression: { + true: "prefix operation", + false: "postfix operation" + }, + VariableDeclarator: "variable declaration", + YieldExpression: "yield expression" +}; +const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type]; +var StandardErrors = { + AccessorIsGenerator: ({ + kind + }) => `A ${kind}ter cannot be a generator.`, + ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", + AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", + AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", + AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", + AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", + AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", + BadGetterArity: "A 'get' accessor must not have any formal parameters.", + BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", + BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", + ConstructorClassField: "Classes may not have a field named 'constructor'.", + ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", + ConstructorIsAccessor: "Class constructor may not be an accessor.", + ConstructorIsAsync: "Constructor can't be an async function.", + ConstructorIsGenerator: "Constructor can't be a generator.", + DeclarationMissingInitializer: ({ + kind + }) => `Missing initializer in ${kind} declaration.`, + DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", + DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", + DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", + DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", + DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", + DecoratorSemicolon: "Decorators must not be followed by a semicolon.", + DecoratorStaticBlock: "Decorators can't be used with a static block.", + DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', + DeletePrivateField: "Deleting a private field is not allowed.", + DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + DuplicateConstructor: "Duplicate constructor in the same class.", + DuplicateDefaultExport: "Only one default export allowed per module.", + DuplicateExport: ({ + exportName + }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, + DuplicateProto: "Redefinition of __proto__ property.", + DuplicateRegExpFlags: "Duplicate regular expression flag.", + DynamicImportPhaseRequiresImportExpressions: ({ + phase + }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, + ElementAfterRest: "Rest element must be last element.", + EscapedCharNotAnIdentifier: "Invalid Unicode escape.", + ExportBindingIsString: ({ + localName, + exportName + }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, + ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", + ForInOfLoopInitializer: ({ + type + }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, + ForInUsing: "For-in loop may not start with 'using' declaration.", + ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", + ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", + GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", + IllegalBreakContinue: ({ + type + }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, + IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", + IllegalReturn: "'return' outside of function.", + ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", + ImportBindingIsString: ({ + importName + }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, + ImportCallArity: `\`import()\` requires exactly one or two arguments.`, + ImportCallNotNewExpression: "Cannot use new with import(...).", + ImportCallSpreadArgument: "`...` is not allowed in `import()`.", + ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", + ImportReflectionHasAssertion: "`import module x` cannot have assertions.", + ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', + IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", + InvalidBigIntLiteral: "Invalid BigIntLiteral.", + InvalidCodePoint: "Code point out of bounds.", + InvalidCoverInitializedName: "Invalid shorthand property initializer.", + InvalidDecimal: "Invalid decimal.", + InvalidDigit: ({ + radix + }) => `Expected number in radix ${radix}.`, + InvalidEscapeSequence: "Bad character escape sequence.", + InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", + InvalidEscapedReservedWord: ({ + reservedWord + }) => `Escape sequence in keyword ${reservedWord}.`, + InvalidIdentifier: ({ + identifierName + }) => `Invalid identifier ${identifierName}.`, + InvalidLhs: ({ + ancestor + }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsBinding: ({ + ancestor + }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsOptionalChaining: ({ + ancestor + }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, + InvalidNumber: "Invalid number.", + InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", + InvalidOrUnexpectedToken: ({ + unexpected + }) => `Unexpected character '${unexpected}'.`, + InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", + InvalidPrivateFieldResolution: ({ + identifierName + }) => `Private name #${identifierName} is not defined.`, + InvalidPropertyBindingPattern: "Binding member expression.", + InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", + InvalidRestAssignmentPattern: "Invalid rest operator's argument.", + LabelRedeclaration: ({ + labelName + }) => `Label '${labelName}' is already declared.`, + LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", + LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", + MalformedRegExpFlags: "Invalid regular expression flag.", + MissingClassName: "A class name is required.", + MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", + MissingSemicolon: "Missing semicolon.", + MissingPlugin: ({ + missingPlugin + }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingOneOfPlugins: ({ + missingPlugin + }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", + MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", + ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", + ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", + ModuleAttributesWithDuplicateKeys: ({ + key + }) => `Duplicate key "${key}" is not allowed in module attributes.`, + ModuleExportNameHasLoneSurrogate: ({ + surrogateCharCode + }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, + ModuleExportUndefined: ({ + localName + }) => `Export '${localName}' is not defined.`, + MultipleDefaultsInSwitch: "Multiple default clauses.", + NewlineAfterThrow: "Illegal newline after throw.", + NoCatchOrFinally: "Missing catch or finally clause.", + NumberIdentifier: "Identifier directly after number.", + NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", + ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", + OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", + OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", + OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", + ParamDupe: "Argument name clash.", + PatternHasAccessor: "Object pattern can't contain getter or setter.", + PatternHasMethod: "Object pattern can't contain methods.", + PrivateInExpectedIn: ({ + identifierName + }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, + PrivateNameRedeclaration: ({ + identifierName + }) => `Duplicate private name #${identifierName}.`, + RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + RecordNoProto: "'__proto__' is not allowed in Record expressions.", + RestTrailingComma: "Unexpected trailing comma after rest element.", + SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", + SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", + SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', + StaticPrototype: "Classes may not have static property named prototype.", + SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", + SuperPrivateField: "Private fields can't be accessed on super.", + TrailingDecorator: "Decorators must be attached to a class element.", + TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", + UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', + UnexpectedDigitAfterHash: "Unexpected digit after hash token.", + UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", + UnexpectedKeyword: ({ + keyword + }) => `Unexpected keyword '${keyword}'.`, + UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", + UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", + UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", + UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", + UnexpectedPrivateField: "Unexpected private name.", + UnexpectedReservedWord: ({ + reservedWord + }) => `Unexpected reserved word '${reservedWord}'.`, + UnexpectedSuper: "'super' is only allowed in object methods and classes.", + UnexpectedToken: ({ + expected, + unexpected + }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, + UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", + UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", + UnsupportedBind: "Binding should be performed on object property.", + UnsupportedDecoratorExport: "A decorated export must export a class declaration.", + UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", + UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", + UnsupportedMetaProperty: ({ + target, + onlyValidPropertyName + }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, + UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", + UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", + UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", + UnterminatedComment: "Unterminated comment.", + UnterminatedRegExp: "Unterminated regular expression.", + UnterminatedString: "Unterminated string constant.", + UnterminatedTemplate: "Unterminated template.", + UsingDeclarationExport: "Using declaration cannot be exported.", + UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", + VarRedeclaration: ({ + identifierName + }) => `Identifier '${identifierName}' has already been declared.`, + YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", + YieldInParameter: "Yield expression is not allowed in formal parameters.", + ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." +}; +var StrictModeErrors = { + StrictDelete: "Deleting local variable in strict mode.", + StrictEvalArguments: ({ + referenceName + }) => `Assigning to '${referenceName}' in strict mode.`, + StrictEvalArgumentsBinding: ({ + bindingName + }) => `Binding '${bindingName}' in strict mode.`, + StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", + StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", + StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", + StrictWith: "'with' in strict mode." +}; +const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); +var PipelineOperatorErrors = { + PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", + PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', + PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", + PipeTopicUnconfiguredToken: ({ + token + }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, + PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", + PipeUnparenthesizedBody: ({ + type + }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ + type + })}; please wrap it in parentheses.`, + PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', + PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", + PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", + PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", + PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", + PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' +}; +const _excluded = ["message"]; +function defineHidden(obj, key, value) { + Object.defineProperty(obj, key, { + enumerable: false, + configurable: true, + value + }); +} +function toParseErrorConstructor({ + toMessage, + code, + reasonCode, + syntaxPlugin +}) { + const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; + { + const oldReasonCodes = { + AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter", + AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters", + ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference", + SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter", + SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter", + SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType" + }; + if (oldReasonCodes[reasonCode]) { + reasonCode = oldReasonCodes[reasonCode]; + } + } + return function constructor(loc, details) { + const error = new SyntaxError(); + error.code = code; + error.reasonCode = reasonCode; + error.loc = loc; + error.pos = loc.index; + error.syntaxPlugin = syntaxPlugin; + if (hasMissingPlugin) { + error.missingPlugin = details.missingPlugin; + } + defineHidden(error, "clone", function clone(overrides = {}) { + var _overrides$loc; + const { + line, + column, + index + } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; + return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); + }); + defineHidden(error, "details", details); + Object.defineProperty(error, "message", { + configurable: true, + get() { + const message = `${toMessage(details)} (${loc.line}:${loc.column})`; + this.message = message; + return message; + }, + set(value) { + Object.defineProperty(this, "message", { + value, + writable: true + }); + } + }); + return error; + }; +} +function ParseErrorEnum(argument, syntaxPlugin) { + if (Array.isArray(argument)) { + return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); + } + const ParseErrorConstructors = {}; + for (const reasonCode of Object.keys(argument)) { + const template = argument[reasonCode]; + const _ref = typeof template === "string" ? { + message: () => template + } : typeof template === "function" ? { + message: template + } : template, + { + message + } = _ref, + rest = _objectWithoutPropertiesLoose(_ref, _excluded); + const toMessage = typeof message === "string" ? () => message : message; + ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ + code: "BABEL_PARSER_SYNTAX_ERROR", + reasonCode, + toMessage + }, syntaxPlugin ? { + syntaxPlugin + } : {}, rest)); + } + return ParseErrorConstructors; +} +const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); +const { + defineProperty +} = Object; +const toUnenumerable = (object, key) => { + if (object) { + defineProperty(object, key, { + enumerable: false, + value: object[key] + }); + } +}; +function toESTreeLocation(node) { + toUnenumerable(node.loc.start, "index"); + toUnenumerable(node.loc.end, "index"); + return node; +} +var estree = superClass => class ESTreeParserMixin extends superClass { + parse() { + const file = toESTreeLocation(super.parse()); + if (this.options.tokens) { + file.tokens = file.tokens.map(toESTreeLocation); + } + return file; + } + parseRegExpLiteral({ + pattern, + flags + }) { + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (_) {} + const node = this.estreeParseLiteral(regex); + node.regex = { + pattern, + flags + }; + return node; + } + parseBigIntLiteral(value) { + let bigInt; + try { + bigInt = BigInt(value); + } catch (_unused) { + bigInt = null; + } + const node = this.estreeParseLiteral(bigInt); + node.bigint = String(node.value || value); + return node; + } + parseDecimalLiteral(value) { + const decimal = null; + const node = this.estreeParseLiteral(decimal); + node.decimal = String(node.value || value); + return node; + } + estreeParseLiteral(value) { + return this.parseLiteral(value, "Literal"); + } + parseStringLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNumericLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNullLiteral() { + return this.estreeParseLiteral(null); + } + parseBooleanLiteral(value) { + return this.estreeParseLiteral(value); + } + directiveToStmt(directive) { + const expression = directive.value; + delete directive.value; + expression.type = "Literal"; + expression.raw = expression.extra.raw; + expression.value = expression.extra.expressionValue; + const stmt = directive; + stmt.type = "ExpressionStatement"; + stmt.expression = expression; + stmt.directive = expression.extra.rawValue; + delete expression.extra; + return stmt; + } + initFunction(node, isAsync) { + super.initFunction(node, isAsync); + node.expression = false; + } + checkDeclaration(node) { + if (node != null && this.isObjectProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + getObjectOrClassMethodParams(method) { + return method.value.params; + } + isValidDirective(stmt) { + var _stmt$expression$extr; + return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); + const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); + delete node.directives; + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); + if (method.typeParameters) { + method.value.typeParameters = method.typeParameters; + delete method.typeParameters; + } + classBody.body.push(method); + } + parsePrivateName() { + const node = super.parsePrivateName(); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return node; + } + } + return this.convertPrivateNameToPrivateIdentifier(node); + } + convertPrivateNameToPrivateIdentifier(node) { + const name = super.getPrivateNameSV(node); + node = node; + delete node.id; + node.name = name; + node.type = "PrivateIdentifier"; + return node; + } + isPrivateName(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.isPrivateName(node); + } + } + return node.type === "PrivateIdentifier"; + } + getPrivateNameSV(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.getPrivateNameSV(node); + } + } + return node.name; + } + parseLiteral(value, type) { + const node = super.parseLiteral(value, type); + node.raw = node.extra.raw; + delete node.extra; + return node; + } + parseFunctionBody(node, allowExpression, isMethod = false) { + super.parseFunctionBody(node, allowExpression, isMethod); + node.expression = node.body.type !== "BlockStatement"; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + let funcNode = this.startNode(); + funcNode.kind = node.kind; + funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + funcNode.type = "FunctionExpression"; + delete funcNode.kind; + node.value = funcNode; + if (type === "ClassPrivateMethod") { + node.computed = false; + } + return this.finishNode(node, "MethodDefinition"); + } + nameIsConstructor(key) { + if (key.type === "Literal") return key.value === "constructor"; + return super.nameIsConstructor(key); + } + parseClassProperty(...args) { + const propertyNode = super.parseClassProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + return propertyNode; + } + parseClassPrivateProperty(...args) { + const propertyNode = super.parseClassPrivateProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + propertyNode.computed = false; + return propertyNode; + } + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); + if (node) { + node.type = "Property"; + if (node.kind === "method") { + node.kind = "init"; + } + node.shorthand = false; + } + return node; + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (node) { + node.kind = "init"; + node.type = "Property"; + } + return node; + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); + } + isAssignable(node, isBinding) { + if (node != null && this.isObjectProperty(node)) { + return this.isAssignable(node.value, isBinding); + } + return super.isAssignable(node, isBinding); + } + toAssignable(node, isLHS = false) { + if (node != null && this.isObjectProperty(node)) { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + } else { + super.toAssignable(node, isLHS); + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) { + this.raise(Errors.PatternHasAccessor, prop.key); + } else if (prop.type === "Property" && prop.method) { + this.raise(Errors.PatternHasMethod, prop.key); + } else { + super.toAssignableObjectExpressionProp(prop, isLast, isLHS); + } + } + finishCallExpression(unfinished, optional) { + const node = super.finishCallExpression(unfinished, optional); + if (node.callee.type === "Import") { + var _ref, _ref2; + node.type = "ImportExpression"; + node.source = node.arguments[0]; + node.options = (_ref = node.arguments[1]) != null ? _ref : null; + node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; + delete node.arguments; + delete node.callee; + } + return node; + } + toReferencedArguments(node) { + if (node.type === "ImportExpression") { + return; + } + super.toReferencedArguments(node); + } + parseExport(unfinished, decorators) { + const exportStartLoc = this.state.lastTokStartLoc; + const node = super.parseExport(unfinished, decorators); + switch (node.type) { + case "ExportAllDeclaration": + node.exported = null; + break; + case "ExportNamedDeclaration": + if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { + node.type = "ExportAllDeclaration"; + node.exported = node.specifiers[0].exported; + delete node.specifiers; + } + case "ExportDefaultDeclaration": + { + var _declaration$decorato; + const { + declaration + } = node; + if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { + this.resetStartLocation(node, exportStartLoc); + } + } + break; + } + return node; + } + parseSubscript(base, startLoc, noCalls, state) { + const node = super.parseSubscript(base, startLoc, noCalls, state); + if (state.optionalChainMember) { + if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { + node.type = node.type.substring(8); + } + if (state.stop) { + const chain = this.startNodeAtNode(node); + chain.expression = node; + return this.finishNode(chain, "ChainExpression"); + } + } else if (node.type === "MemberExpression" || node.type === "CallExpression") { + node.optional = false; + } + return node; + } + isOptionalMemberExpression(node) { + if (node.type === "ChainExpression") { + return node.expression.type === "MemberExpression"; + } + return super.isOptionalMemberExpression(node); + } + hasPropertyAsPrivateName(node) { + if (node.type === "ChainExpression") { + node = node.expression; + } + return super.hasPropertyAsPrivateName(node); + } + isObjectProperty(node) { + return node.type === "Property" && node.kind === "init" && !node.method; + } + isObjectMethod(node) { + return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); + } + finishNodeAt(node, type, endLoc) { + return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); + } + resetStartLocation(node, startLoc) { + super.resetStartLocation(node, startLoc); + toESTreeLocation(node); + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + super.resetEndLocation(node, endLoc); + toESTreeLocation(node); + } +}; +class TokContext { + constructor(token, preserveSpace) { + this.token = void 0; + this.preserveSpace = void 0; + this.token = token; + this.preserveSpace = !!preserveSpace; + } +} +const types = { + brace: new TokContext("{"), + j_oTag: new TokContext("...", true) +}; +{ + types.template = new TokContext("`", true); +} +const beforeExpr = true; +const startsExpr = true; +const isLoop = true; +const isAssign = true; +const prefix = true; +const postfix = true; +class ExportedTokenType { + constructor(label, conf = {}) { + this.label = void 0; + this.keyword = void 0; + this.beforeExpr = void 0; + this.startsExpr = void 0; + this.rightAssociative = void 0; + this.isLoop = void 0; + this.isAssign = void 0; + this.prefix = void 0; + this.postfix = void 0; + this.binop = void 0; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop != null ? conf.binop : null; + { + this.updateContext = null; + } + } +} +const keywords$1 = new Map(); +function createKeyword(name, options = {}) { + options.keyword = name; + const token = createToken(name, options); + keywords$1.set(name, token); + return token; +} +function createBinop(name, binop) { + return createToken(name, { + beforeExpr, + binop + }); +} +let tokenTypeCounter = -1; +const tokenTypes = []; +const tokenLabels = []; +const tokenBinops = []; +const tokenBeforeExprs = []; +const tokenStartsExprs = []; +const tokenPrefixes = []; +function createToken(name, options = {}) { + var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; + ++tokenTypeCounter; + tokenLabels.push(name); + tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); + tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); + tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); + tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); + tokenTypes.push(new ExportedTokenType(name, options)); + return tokenTypeCounter; +} +function createKeywordLike(name, options = {}) { + var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; + ++tokenTypeCounter; + keywords$1.set(name, tokenTypeCounter); + tokenLabels.push(name); + tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); + tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); + tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); + tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); + tokenTypes.push(new ExportedTokenType("name", options)); + return tokenTypeCounter; +} +const tt = { + bracketL: createToken("[", { + beforeExpr, + startsExpr + }), + bracketHashL: createToken("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: createToken("[|", { + beforeExpr, + startsExpr + }), + bracketR: createToken("]"), + bracketBarR: createToken("|]"), + braceL: createToken("{", { + beforeExpr, + startsExpr + }), + braceBarL: createToken("{|", { + beforeExpr, + startsExpr + }), + braceHashL: createToken("#{", { + beforeExpr, + startsExpr + }), + braceR: createToken("}"), + braceBarR: createToken("|}"), + parenL: createToken("(", { + beforeExpr, + startsExpr + }), + parenR: createToken(")"), + comma: createToken(",", { + beforeExpr + }), + semi: createToken(";", { + beforeExpr + }), + colon: createToken(":", { + beforeExpr + }), + doubleColon: createToken("::", { + beforeExpr + }), + dot: createToken("."), + question: createToken("?", { + beforeExpr + }), + questionDot: createToken("?."), + arrow: createToken("=>", { + beforeExpr + }), + template: createToken("template"), + ellipsis: createToken("...", { + beforeExpr + }), + backQuote: createToken("`", { + startsExpr + }), + dollarBraceL: createToken("${", { + beforeExpr, + startsExpr + }), + templateTail: createToken("...`", { + startsExpr + }), + templateNonTail: createToken("...${", { + beforeExpr, + startsExpr + }), + at: createToken("@"), + hash: createToken("#", { + startsExpr + }), + interpreterDirective: createToken("#!..."), + eq: createToken("=", { + beforeExpr, + isAssign + }), + assign: createToken("_=", { + beforeExpr, + isAssign + }), + slashAssign: createToken("_=", { + beforeExpr, + isAssign + }), + xorAssign: createToken("_=", { + beforeExpr, + isAssign + }), + moduloAssign: createToken("_=", { + beforeExpr, + isAssign + }), + incDec: createToken("++/--", { + prefix, + postfix, + startsExpr + }), + bang: createToken("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: createToken("~", { + beforeExpr, + prefix, + startsExpr + }), + doubleCaret: createToken("^^", { + startsExpr + }), + doubleAt: createToken("@@", { + startsExpr + }), + pipeline: createBinop("|>", 0), + nullishCoalescing: createBinop("??", 1), + logicalOR: createBinop("||", 1), + logicalAND: createBinop("&&", 2), + bitwiseOR: createBinop("|", 3), + bitwiseXOR: createBinop("^", 4), + bitwiseAND: createBinop("&", 5), + equality: createBinop("==/!=/===/!==", 6), + lt: createBinop("/<=/>=", 7), + gt: createBinop("/<=/>=", 7), + relational: createBinop("/<=/>=", 7), + bitShift: createBinop("<>/>>>", 8), + bitShiftL: createBinop("<>/>>>", 8), + bitShiftR: createBinop("<>/>>>", 8), + plusMin: createToken("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: createToken("%", { + binop: 10, + startsExpr + }), + star: createToken("*", { + binop: 10 + }), + slash: createBinop("/", 10), + exponent: createToken("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }), + _in: createKeyword("in", { + beforeExpr, + binop: 7 + }), + _instanceof: createKeyword("instanceof", { + beforeExpr, + binop: 7 + }), + _break: createKeyword("break"), + _case: createKeyword("case", { + beforeExpr + }), + _catch: createKeyword("catch"), + _continue: createKeyword("continue"), + _debugger: createKeyword("debugger"), + _default: createKeyword("default", { + beforeExpr + }), + _else: createKeyword("else", { + beforeExpr + }), + _finally: createKeyword("finally"), + _function: createKeyword("function", { + startsExpr + }), + _if: createKeyword("if"), + _return: createKeyword("return", { + beforeExpr + }), + _switch: createKeyword("switch"), + _throw: createKeyword("throw", { + beforeExpr, + prefix, + startsExpr + }), + _try: createKeyword("try"), + _var: createKeyword("var"), + _const: createKeyword("const"), + _with: createKeyword("with"), + _new: createKeyword("new", { + beforeExpr, + startsExpr + }), + _this: createKeyword("this", { + startsExpr + }), + _super: createKeyword("super", { + startsExpr + }), + _class: createKeyword("class", { + startsExpr + }), + _extends: createKeyword("extends", { + beforeExpr + }), + _export: createKeyword("export"), + _import: createKeyword("import", { + startsExpr + }), + _null: createKeyword("null", { + startsExpr + }), + _true: createKeyword("true", { + startsExpr + }), + _false: createKeyword("false", { + startsExpr + }), + _typeof: createKeyword("typeof", { + beforeExpr, + prefix, + startsExpr + }), + _void: createKeyword("void", { + beforeExpr, + prefix, + startsExpr + }), + _delete: createKeyword("delete", { + beforeExpr, + prefix, + startsExpr + }), + _do: createKeyword("do", { + isLoop, + beforeExpr + }), + _for: createKeyword("for", { + isLoop + }), + _while: createKeyword("while", { + isLoop + }), + _as: createKeywordLike("as", { + startsExpr + }), + _assert: createKeywordLike("assert", { + startsExpr + }), + _async: createKeywordLike("async", { + startsExpr + }), + _await: createKeywordLike("await", { + startsExpr + }), + _defer: createKeywordLike("defer", { + startsExpr + }), + _from: createKeywordLike("from", { + startsExpr + }), + _get: createKeywordLike("get", { + startsExpr + }), + _let: createKeywordLike("let", { + startsExpr + }), + _meta: createKeywordLike("meta", { + startsExpr + }), + _of: createKeywordLike("of", { + startsExpr + }), + _sent: createKeywordLike("sent", { + startsExpr + }), + _set: createKeywordLike("set", { + startsExpr + }), + _source: createKeywordLike("source", { + startsExpr + }), + _static: createKeywordLike("static", { + startsExpr + }), + _using: createKeywordLike("using", { + startsExpr + }), + _yield: createKeywordLike("yield", { + startsExpr + }), + _asserts: createKeywordLike("asserts", { + startsExpr + }), + _checks: createKeywordLike("checks", { + startsExpr + }), + _exports: createKeywordLike("exports", { + startsExpr + }), + _global: createKeywordLike("global", { + startsExpr + }), + _implements: createKeywordLike("implements", { + startsExpr + }), + _intrinsic: createKeywordLike("intrinsic", { + startsExpr + }), + _infer: createKeywordLike("infer", { + startsExpr + }), + _is: createKeywordLike("is", { + startsExpr + }), + _mixins: createKeywordLike("mixins", { + startsExpr + }), + _proto: createKeywordLike("proto", { + startsExpr + }), + _require: createKeywordLike("require", { + startsExpr + }), + _satisfies: createKeywordLike("satisfies", { + startsExpr + }), + _keyof: createKeywordLike("keyof", { + startsExpr + }), + _readonly: createKeywordLike("readonly", { + startsExpr + }), + _unique: createKeywordLike("unique", { + startsExpr + }), + _abstract: createKeywordLike("abstract", { + startsExpr + }), + _declare: createKeywordLike("declare", { + startsExpr + }), + _enum: createKeywordLike("enum", { + startsExpr + }), + _module: createKeywordLike("module", { + startsExpr + }), + _namespace: createKeywordLike("namespace", { + startsExpr + }), + _interface: createKeywordLike("interface", { + startsExpr + }), + _type: createKeywordLike("type", { + startsExpr + }), + _opaque: createKeywordLike("opaque", { + startsExpr + }), + name: createToken("name", { + startsExpr + }), + placeholder: createToken("%%", { + startsExpr: true + }), + string: createToken("string", { + startsExpr + }), + num: createToken("num", { + startsExpr + }), + bigint: createToken("bigint", { + startsExpr + }), + decimal: createToken("decimal", { + startsExpr + }), + regexp: createToken("regexp", { + startsExpr + }), + privateName: createToken("#name", { + startsExpr + }), + eof: createToken("eof"), + jsxName: createToken("jsxName"), + jsxText: createToken("jsxText", { + beforeExpr: true + }), + jsxTagStart: createToken("jsxTagStart", { + startsExpr: true + }), + jsxTagEnd: createToken("jsxTagEnd") +}; +function tokenIsIdentifier(token) { + return token >= 93 && token <= 133; +} +function tokenKeywordOrIdentifierIsKeyword(token) { + return token <= 92; +} +function tokenIsKeywordOrIdentifier(token) { + return token >= 58 && token <= 133; +} +function tokenIsLiteralPropertyName(token) { + return token >= 58 && token <= 137; +} +function tokenComesBeforeExpression(token) { + return tokenBeforeExprs[token]; +} +function tokenCanStartExpression(token) { + return tokenStartsExprs[token]; +} +function tokenIsAssignment(token) { + return token >= 29 && token <= 33; +} +function tokenIsFlowInterfaceOrTypeOrOpaque(token) { + return token >= 129 && token <= 131; +} +function tokenIsLoop(token) { + return token >= 90 && token <= 92; +} +function tokenIsKeyword(token) { + return token >= 58 && token <= 92; +} +function tokenIsOperator(token) { + return token >= 39 && token <= 59; +} +function tokenIsPostfix(token) { + return token === 34; +} +function tokenIsPrefix(token) { + return tokenPrefixes[token]; +} +function tokenIsTSTypeOperator(token) { + return token >= 121 && token <= 123; +} +function tokenIsTSDeclarationStart(token) { + return token >= 124 && token <= 130; +} +function tokenLabelName(token) { + return tokenLabels[token]; +} +function tokenOperatorPrecedence(token) { + return tokenBinops[token]; +} +function tokenIsRightAssociative(token) { + return token === 57; +} +function tokenIsTemplate(token) { + return token >= 24 && token <= 25; +} +function getExportedToken(token) { + return tokenTypes[token]; +} +{ + tokenTypes[8].updateContext = context => { + context.pop(); + }; + tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { + context.push(types.brace); + }; + tokenTypes[22].updateContext = context => { + if (context[context.length - 1] === types.template) { + context.pop(); + } else { + context.push(types.template); + } + }; + tokenTypes[143].updateContext = context => { + context.push(types.j_expr, types.j_oTag); + }; +} +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\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\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\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\u0af9\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-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\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-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\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\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} +function isIteratorStart(current, next, next2) { + return current === 64 && next === 64 && isIdentifierStart(next2); +} +const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); +function canBeReservedWord(word) { + return reservedWordLikeSet.has(word); +} +class Scope { + constructor(flags) { + this.flags = 0; + this.names = new Map(); + this.firstLexicalName = ""; + this.flags = flags; + } +} +class ScopeHandler { + constructor(parser, inModule) { + this.parser = void 0; + this.scopeStack = []; + this.inModule = void 0; + this.undefinedExports = new Map(); + this.parser = parser; + this.inModule = inModule; + } + get inTopLevel() { + return (this.currentScope().flags & 1) > 0; + } + get inFunction() { + return (this.currentVarScopeFlags() & 2) > 0; + } + get allowSuper() { + return (this.currentThisScopeFlags() & 16) > 0; + } + get allowDirectSuper() { + return (this.currentThisScopeFlags() & 32) > 0; + } + get inClass() { + return (this.currentThisScopeFlags() & 64) > 0; + } + get inClassAndNotInNonArrowFunction() { + const flags = this.currentThisScopeFlags(); + return (flags & 64) > 0 && (flags & 2) === 0; + } + get inStaticBlock() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 128) { + return true; + } + if (flags & (387 | 64)) { + return false; + } + } + } + get inNonArrowFunction() { + return (this.currentThisScopeFlags() & 2) > 0; + } + get treatFunctionsAsVar() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + } + createScope(flags) { + return new Scope(flags); + } + enter(flags) { + this.scopeStack.push(this.createScope(flags)); + } + exit() { + const scope = this.scopeStack.pop(); + return scope.flags; + } + treatFunctionsAsVarInScope(scope) { + return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); + } + declareName(name, bindingType, loc) { + let scope = this.currentScope(); + if (bindingType & 8 || bindingType & 16) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + let type = scope.names.get(name) || 0; + if (bindingType & 16) { + type = type | 4; + } else { + if (!scope.firstLexicalName) { + scope.firstLexicalName = name; + } + type = type | 2; + } + scope.names.set(name, type); + if (bindingType & 8) { + this.maybeExportDefined(scope, name); + } + } else if (bindingType & 4) { + for (let i = this.scopeStack.length - 1; i >= 0; --i) { + scope = this.scopeStack[i]; + this.checkRedeclarationInScope(scope, name, bindingType, loc); + scope.names.set(name, (scope.names.get(name) || 0) | 1); + this.maybeExportDefined(scope, name); + if (scope.flags & 387) break; + } + } + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + maybeExportDefined(scope, name) { + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + checkRedeclarationInScope(scope, name, bindingType, loc) { + if (this.isRedeclaredInScope(scope, name, bindingType)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + } + isRedeclaredInScope(scope, name, bindingType) { + if (!(bindingType & 1)) return false; + if (bindingType & 8) { + return scope.names.has(name); + } + const type = scope.names.get(name); + if (bindingType & 16) { + return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; + } + return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; + } + checkLocalExport(id) { + const { + name + } = id; + const topLevelScope = this.scopeStack[0]; + if (!topLevelScope.names.has(name)) { + this.undefinedExports.set(name, id.loc.start); + } + } + currentScope() { + return this.scopeStack[this.scopeStack.length - 1]; + } + currentVarScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 387) { + return flags; + } + } + } + currentThisScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & (387 | 64) && !(flags & 4)) { + return flags; + } + } + } +} +class FlowScope extends Scope { + constructor(...args) { + super(...args); + this.declareFunctions = new Set(); + } +} +class FlowScopeHandler extends ScopeHandler { + createScope(flags) { + return new FlowScope(flags); + } + declareName(name, bindingType, loc) { + const scope = this.currentScope(); + if (bindingType & 2048) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + scope.declareFunctions.add(name); + return; + } + super.declareName(name, bindingType, loc); + } + isRedeclaredInScope(scope, name, bindingType) { + if (super.isRedeclaredInScope(scope, name, bindingType)) return true; + if (bindingType & 2048 && !scope.declareFunctions.has(name)) { + const type = scope.names.get(name); + return (type & 4) > 0 || (type & 2) > 0; + } + return false; + } + checkLocalExport(id) { + if (!this.scopeStack[0].declareFunctions.has(id.name)) { + super.checkLocalExport(id); + } + } +} +class BaseParser { + constructor() { + this.sawUnambiguousESM = false; + this.ambiguousScriptDifferentAst = false; + } + sourceToOffsetPos(sourcePos) { + return sourcePos + this.startIndex; + } + offsetToSourcePos(offsetPos) { + return offsetPos - this.startIndex; + } + hasPlugin(pluginConfig) { + if (typeof pluginConfig === "string") { + return this.plugins.has(pluginConfig); + } else { + const [pluginName, pluginOptions] = pluginConfig; + if (!this.hasPlugin(pluginName)) { + return false; + } + const actualOptions = this.plugins.get(pluginName); + for (const key of Object.keys(pluginOptions)) { + if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { + return false; + } + } + return true; + } + } + getPluginOption(plugin, name) { + var _this$plugins$get; + return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; + } +} +function setTrailingComments(node, comments) { + if (node.trailingComments === undefined) { + node.trailingComments = comments; + } else { + node.trailingComments.unshift(...comments); + } +} +function setLeadingComments(node, comments) { + if (node.leadingComments === undefined) { + node.leadingComments = comments; + } else { + node.leadingComments.unshift(...comments); + } +} +function setInnerComments(node, comments) { + if (node.innerComments === undefined) { + node.innerComments = comments; + } else { + node.innerComments.unshift(...comments); + } +} +function adjustInnerComments(node, elements, commentWS) { + let lastElement = null; + let i = elements.length; + while (lastElement === null && i > 0) { + lastElement = elements[--i]; + } + if (lastElement === null || lastElement.start > commentWS.start) { + setInnerComments(node, commentWS.comments); + } else { + setTrailingComments(lastElement, commentWS.comments); + } +} +class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + const { + commentsLen + } = this.state; + if (this.comments.length !== commentsLen) { + this.comments.length = commentsLen; + } + this.comments.push(comment); + this.state.commentsLen++; + } + processComment(node) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + const lastCommentWS = commentStack[i]; + if (lastCommentWS.start === node.end) { + lastCommentWS.leadingNode = node; + i--; + } + const { + start: nodeStart + } = node; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + if (commentEnd > nodeStart) { + commentWS.containingNode = node; + this.finalizeComment(commentWS); + commentStack.splice(i, 1); + } else { + if (commentEnd === nodeStart) { + commentWS.trailingNode = node; + } + break; + } + } + } + finalizeComment(commentWS) { + const { + comments + } = commentWS; + if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { + if (commentWS.leadingNode !== null) { + setTrailingComments(commentWS.leadingNode, comments); + } + if (commentWS.trailingNode !== null) { + setLeadingComments(commentWS.trailingNode, comments); + } + } else { + const { + containingNode: node, + start: commentStart + } = commentWS; + if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + case "RecordExpression": + adjustInnerComments(node, node.properties, commentWS); + break; + case "CallExpression": + case "OptionalCallExpression": + adjustInnerComments(node, node.arguments, commentWS); + break; + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ObjectMethod": + case "ClassMethod": + case "ClassPrivateMethod": + adjustInnerComments(node, node.params, commentWS); + break; + case "ArrayExpression": + case "ArrayPattern": + case "TupleExpression": + adjustInnerComments(node, node.elements, commentWS); + break; + case "ExportNamedDeclaration": + case "ImportDeclaration": + adjustInnerComments(node, node.specifiers, commentWS); + break; + default: + { + setInnerComments(node, comments); + } + } + } else { + setInnerComments(node, comments); + } + } + } + finalizeRemainingComments() { + const { + commentStack + } = this.state; + for (let i = commentStack.length - 1; i >= 0; i--) { + this.finalizeComment(commentStack[i]); + } + this.state.commentStack = []; + } + resetPreviousNodeTrailingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + const commentWS = commentStack[length - 1]; + if (commentWS.leadingNode === node) { + commentWS.leadingNode = null; + } + } + resetPreviousIdentifierLeadingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + if (commentStack[length - 1].trailingNode === node) { + commentStack[length - 1].trailingNode = null; + } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { + commentStack[length - 2].trailingNode = null; + } + } + takeSurroundingComments(node, start, end) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + const commentStart = commentWS.start; + if (commentStart === end) { + commentWS.leadingNode = node; + } else if (commentEnd === start) { + commentWS.trailingNode = node; + } else if (commentEnd < start) { + break; + } + } + } +} +const lineBreak = /\r\n|[\r\n\u2028\u2029]/; +const lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + switch (code) { + case 10: + case 13: + case 8232: + case 8233: + return true; + default: + return false; + } +} +function hasNewLine(input, start, end) { + for (let i = start; i < end; i++) { + if (isNewLine(input.charCodeAt(i))) { + return true; + } + } + return false; +} +const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; +function isWhitespace(code) { + switch (code) { + case 0x0009: + case 0x000b: + case 0x000c: + case 32: + case 160: + case 5760: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: + case 0x3000: + case 0xfeff: + return true; + default: + return false; + } +} +class State { + constructor() { + this.flags = 1024; + this.startIndex = void 0; + this.curLine = void 0; + this.lineStart = void 0; + this.startLoc = void 0; + this.endLoc = void 0; + this.errors = []; + this.potentialArrowAt = -1; + this.noArrowAt = []; + this.noArrowParamsConversionAt = []; + this.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + this.labels = []; + this.commentsLen = 0; + this.commentStack = []; + this.pos = 0; + this.type = 140; + this.value = null; + this.start = 0; + this.end = 0; + this.lastTokEndLoc = null; + this.lastTokStartLoc = null; + this.context = [types.brace]; + this.firstInvalidTemplateEscapePos = null; + this.strictErrors = new Map(); + this.tokensLength = 0; + } + get strict() { + return (this.flags & 1) > 0; + } + set strict(v) { + if (v) this.flags |= 1;else this.flags &= -2; + } + init({ + strictMode, + sourceType, + startIndex, + startLine, + startColumn + }) { + this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; + this.startIndex = startIndex; + this.curLine = startLine; + this.lineStart = -startColumn; + this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex); + } + get maybeInArrowParameters() { + return (this.flags & 2) > 0; + } + set maybeInArrowParameters(v) { + if (v) this.flags |= 2;else this.flags &= -3; + } + get inType() { + return (this.flags & 4) > 0; + } + set inType(v) { + if (v) this.flags |= 4;else this.flags &= -5; + } + get noAnonFunctionType() { + return (this.flags & 8) > 0; + } + set noAnonFunctionType(v) { + if (v) this.flags |= 8;else this.flags &= -9; + } + get hasFlowComment() { + return (this.flags & 16) > 0; + } + set hasFlowComment(v) { + if (v) this.flags |= 16;else this.flags &= -17; + } + get isAmbientContext() { + return (this.flags & 32) > 0; + } + set isAmbientContext(v) { + if (v) this.flags |= 32;else this.flags &= -33; + } + get inAbstractClass() { + return (this.flags & 64) > 0; + } + set inAbstractClass(v) { + if (v) this.flags |= 64;else this.flags &= -65; + } + get inDisallowConditionalTypesContext() { + return (this.flags & 128) > 0; + } + set inDisallowConditionalTypesContext(v) { + if (v) this.flags |= 128;else this.flags &= -129; + } + get soloAwait() { + return (this.flags & 256) > 0; + } + set soloAwait(v) { + if (v) this.flags |= 256;else this.flags &= -257; + } + get inFSharpPipelineDirectBody() { + return (this.flags & 512) > 0; + } + set inFSharpPipelineDirectBody(v) { + if (v) this.flags |= 512;else this.flags &= -513; + } + get canStartJSXElement() { + return (this.flags & 1024) > 0; + } + set canStartJSXElement(v) { + if (v) this.flags |= 1024;else this.flags &= -1025; + } + get containsEsc() { + return (this.flags & 2048) > 0; + } + set containsEsc(v) { + if (v) this.flags |= 2048;else this.flags &= -2049; + } + get hasTopLevelAwait() { + return (this.flags & 4096) > 0; + } + set hasTopLevelAwait(v) { + if (v) this.flags |= 4096;else this.flags &= -4097; + } + curPosition() { + return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex); + } + clone() { + const state = new State(); + state.flags = this.flags; + state.startIndex = this.startIndex; + state.curLine = this.curLine; + state.lineStart = this.lineStart; + state.startLoc = this.startLoc; + state.endLoc = this.endLoc; + state.errors = this.errors.slice(); + state.potentialArrowAt = this.potentialArrowAt; + state.noArrowAt = this.noArrowAt.slice(); + state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); + state.topicContext = this.topicContext; + state.labels = this.labels.slice(); + state.commentsLen = this.commentsLen; + state.commentStack = this.commentStack.slice(); + state.pos = this.pos; + state.type = this.type; + state.value = this.value; + state.start = this.start; + state.end = this.end; + state.lastTokEndLoc = this.lastTokEndLoc; + state.lastTokStartLoc = this.lastTokStartLoc; + state.context = this.context.slice(); + state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; + state.strictErrors = this.strictErrors; + state.tokensLength = this.tokensLength; + return state; + } +} +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; +const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) +}; +const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 +}; +function readStringContents(type, input, pos, lineStart, curLine, errors) { + const initialPos = pos; + const initialLineStart = lineStart; + const initialCurLine = curLine; + let out = ""; + let firstInvalidLoc = null; + let chunkStart = pos; + const { + length + } = input; + for (;;) { + if (pos >= length) { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + out += input.slice(chunkStart, pos); + break; + } + const ch = input.charCodeAt(pos); + if (isStringEnd(type, ch, input, pos)) { + out += input.slice(chunkStart, pos); + break; + } + if (ch === 92) { + out += input.slice(chunkStart, pos); + const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); + if (res.ch === null && !firstInvalidLoc) { + firstInvalidLoc = { + pos, + lineStart, + curLine + }; + } else { + out += res.ch; + } + ({ + pos, + lineStart, + curLine + } = res); + chunkStart = pos; + } else if (ch === 8232 || ch === 8233) { + ++pos; + ++curLine; + lineStart = pos; + } else if (ch === 10 || ch === 13) { + if (type === "template") { + out += input.slice(chunkStart, pos) + "\n"; + ++pos; + if (ch === 13 && input.charCodeAt(pos) === 10) { + ++pos; + } + ++curLine; + chunkStart = lineStart = pos; + } else { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + } + } else { + ++pos; + } + } + return { + pos, + str: out, + firstInvalidLoc, + lineStart, + curLine, + containsInvalid: !!firstInvalidLoc + }; +} +function isStringEnd(type, ch, input, pos) { + if (type === "template") { + return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; + } + return ch === (type === "double" ? 34 : 39); +} +function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { + const throwOnInvalid = !inTemplate; + pos++; + const res = ch => ({ + pos, + ch, + lineStart, + curLine + }); + const ch = input.charCodeAt(pos++); + switch (ch) { + case 110: + return res("\n"); + case 114: + return res("\r"); + case 120: + { + let code; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCharCode(code)); + } + case 117: + { + let code; + ({ + code, + pos + } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCodePoint(code)); + } + case 116: + return res("\t"); + case 98: + return res("\b"); + case 118: + return res("\u000b"); + case 102: + return res("\f"); + case 13: + if (input.charCodeAt(pos) === 10) { + ++pos; + } + case 10: + lineStart = pos; + ++curLine; + case 8232: + case 8233: + return res(""); + case 56: + case 57: + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(pos - 1, lineStart, curLine); + } + default: + if (ch >= 48 && ch <= 55) { + const startPos = pos - 1; + const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + pos += octalStr.length - 1; + const next = input.charCodeAt(pos); + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(startPos, lineStart, curLine); + } + } + return res(String.fromCharCode(octal)); + } + return res(String.fromCharCode(ch)); + } +} +function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { + const initialPos = pos; + let n; + ({ + n, + pos + } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); + if (n === null) { + if (throwOnInvalid) { + errors.invalidEscapeSequence(initialPos, lineStart, curLine); + } else { + pos = initialPos - 1; + } + } + return { + code: n, + pos + }; +} +function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { + const start = pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = input.charCodeAt(pos); + let val; + if (code === 95 && allowNumSeparator !== "bail") { + const prev = input.charCodeAt(pos - 1); + const next = input.charCodeAt(pos + 1); + if (!allowNumSeparator) { + if (bailOnError) return { + n: null, + pos + }; + errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + if (bailOnError) return { + n: null, + pos + }; + errors.unexpectedNumericSeparator(pos, lineStart, curLine); + } + ++pos; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + if (val <= 9 && bailOnError) { + return { + n: null, + pos + }; + } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { + val = 0; + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + ++pos; + total = total * radix + val; + } + if (pos === start || len != null && pos - start !== len || invalid) { + return { + n: null, + pos + }; + } + return { + n: total, + pos + }; +} +function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { + const ch = input.charCodeAt(pos); + let code; + if (ch === 123) { + ++pos; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); + ++pos; + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + errors.invalidCodePoint(pos, lineStart, curLine); + } else { + return { + code: null, + pos + }; + } + } + } else { + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); + } + return { + code, + pos + }; +} +function buildPosition(pos, lineStart, curLine) { + return new Position(curLine, pos - lineStart, pos); +} +const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); +class Token { + constructor(state) { + const startIndex = state.startIndex || 0; + this.type = state.type; + this.value = state.value; + this.start = startIndex + state.start; + this.end = startIndex + state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); + } +} +class Tokenizer extends CommentsParser { + constructor(options, input) { + super(); + this.isLookahead = void 0; + this.tokens = []; + this.errorHandlers_readInt = { + invalidDigit: (pos, lineStart, curLine, radix) => { + if (!this.options.errorRecovery) return false; + this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { + radix + }); + return true; + }, + numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), + unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) + }; + this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { + invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), + invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) + }); + this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: (pos, lineStart, curLine) => { + this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); + }, + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); + } + }); + this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); + } + }); + this.state = new State(); + this.state.init(options); + this.input = input; + this.length = input.length; + this.comments = []; + this.isLookahead = false; + } + pushToken(token) { + this.tokens.length = this.state.tokensLength; + this.tokens.push(token); + ++this.state.tokensLength; + } + next() { + this.checkKeywordEscapes(); + if (this.options.tokens) { + this.pushToken(new Token(this.state)); + } + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + } + eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + } + match(type) { + return this.state.type === type; + } + createLookaheadState(state) { + return { + pos: state.pos, + value: null, + type: state.type, + start: state.start, + end: state.end, + context: [this.curContext()], + inType: state.inType, + startLoc: state.startLoc, + lastTokEndLoc: state.lastTokEndLoc, + curLine: state.curLine, + lineStart: state.lineStart, + curPosition: state.curPosition + }; + } + lookahead() { + const old = this.state; + this.state = this.createLookaheadState(old); + this.isLookahead = true; + this.nextToken(); + this.isLookahead = false; + const curr = this.state; + this.state = old; + return curr; + } + nextTokenStart() { + return this.nextTokenStartSince(this.state.pos); + } + nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; + } + lookaheadCharCode() { + return this.input.charCodeAt(this.nextTokenStart()); + } + nextTokenInLineStart() { + return this.nextTokenInLineStartSince(this.state.pos); + } + nextTokenInLineStartSince(pos) { + skipWhiteSpaceInLine.lastIndex = pos; + return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; + } + lookaheadInLineCharCode() { + return this.input.charCodeAt(this.nextTokenInLineStart()); + } + codePointAtPos(pos) { + let cp = this.input.charCodeAt(pos); + if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { + const trail = this.input.charCodeAt(pos); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + return cp; + } + setStrict(strict) { + this.state.strict = strict; + if (strict) { + this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); + this.state.strictErrors.clear(); + } + } + curContext() { + return this.state.context[this.state.context.length - 1]; + } + nextToken() { + this.skipSpace(); + this.state.start = this.state.pos; + if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.length) { + this.finishToken(140); + return; + } + this.getTokenFromCode(this.codePointAtPos(this.state.pos)); + } + skipBlockComment(commentEnd) { + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + const start = this.state.pos; + const end = this.input.indexOf(commentEnd, start + 2); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + this.state.pos = end + commentEnd.length; + lineBreakG.lastIndex = start + 2; + while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { + ++this.state.curLine; + this.state.lineStart = lineBreakG.lastIndex; + } + if (this.isLookahead) return; + const comment = { + type: "CommentBlock", + value: this.input.slice(start + 2, end), + start: this.sourceToOffsetPos(start), + end: this.sourceToOffsetPos(end + commentEnd.length), + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + skipLineComment(startSkip) { + const start = this.state.pos; + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + let ch = this.input.charCodeAt(this.state.pos += startSkip); + if (this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + } + if (this.isLookahead) return; + const end = this.state.pos; + const value = this.input.slice(start + startSkip, end); + const comment = { + type: "CommentLine", + value, + start: this.sourceToOffsetPos(start), + end: this.sourceToOffsetPos(end), + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + skipSpace() { + const spaceStart = this.state.pos; + const comments = []; + loop: while (this.state.pos < this.length) { + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 32: + case 160: + case 9: + ++this.state.pos; + break; + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + case 47: + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + { + const comment = this.skipBlockComment("*/"); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + break; + } + case 47: + { + const comment = this.skipLineComment(2); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + break; + } + default: + break loop; + } + break; + default: + if (isWhitespace(ch)) { + ++this.state.pos; + } else if (ch === 45 && !this.inModule && this.options.annexB) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { + const comment = this.skipLineComment(3); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else if (ch === 60 && !this.inModule && this.options.annexB) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { + const comment = this.skipLineComment(4); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else { + break loop; + } + } + } + if (comments.length > 0) { + const end = this.state.pos; + const commentWhitespace = { + start: this.sourceToOffsetPos(spaceStart), + end: this.sourceToOffsetPos(end), + comments, + leadingNode: null, + trailingNode: null, + containingNode: null + }; + this.state.commentStack.push(commentWhitespace); + } + } + finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + const prevType = this.state.type; + this.state.type = type; + this.state.value = val; + if (!this.isLookahead) { + this.updateContext(prevType); + } + } + replaceToken(type) { + this.state.type = type; + this.updateContext(); + } + readToken_numberSign() { + if (this.state.pos === 0 && this.readToken_interpreter()) { + return; + } + const nextPos = this.state.pos + 1; + const next = this.codePointAtPos(nextPos); + if (next >= 48 && next <= 57) { + throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); + } + if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { + this.expectPlugin("recordAndTuple"); + if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { + throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + if (next === 123) { + this.finishToken(7); + } else { + this.finishToken(1); + } + } else if (isIdentifierStart(next)) { + ++this.state.pos; + this.finishToken(139, this.readWord1(next)); + } else if (next === 92) { + ++this.state.pos; + this.finishToken(139, this.readWord1()); + } else { + this.finishOp(27, 1); + } + } + readToken_dot() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next >= 48 && next <= 57) { + this.readNumber(true); + return; + } + if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { + this.state.pos += 3; + this.finishToken(21); + } else { + ++this.state.pos; + this.finishToken(16); + } + } + readToken_slash() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(31, 2); + } else { + this.finishOp(56, 1); + } + } + readToken_interpreter() { + if (this.state.pos !== 0 || this.length < 2) return false; + let ch = this.input.charCodeAt(this.state.pos + 1); + if (ch !== 33) return false; + const start = this.state.pos; + this.state.pos += 1; + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + const value = this.input.slice(start + 2, this.state.pos); + this.finishToken(28, value); + return true; + } + readToken_mult_modulo(code) { + let type = code === 42 ? 55 : 54; + let width = 1; + let next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 42) { + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = 57; + } + if (next === 61 && !this.state.inType) { + width++; + type = code === 37 ? 33 : 30; + } + this.finishOp(type, width); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + if (this.input.charCodeAt(this.state.pos + 2) === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(code === 124 ? 41 : 42, 2); + } + return; + } + if (code === 124) { + if (next === 62) { + this.finishOp(39, 2); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 125) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(9); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 93) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(4); + return; + } + } + if (next === 61) { + this.finishOp(30, 2); + return; + } + this.finishOp(code === 124 ? 43 : 45, 1); + } + readToken_caret() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61 && !this.state.inType) { + this.finishOp(32, 2); + } else if (next === 94 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "^^" + }])) { + this.finishOp(37, 2); + const lookaheadCh = this.input.codePointAt(this.state.pos); + if (lookaheadCh === 94) { + this.unexpected(); + } + } else { + this.finishOp(44, 1); + } + } + readToken_atSign() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 64 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "@@" + }])) { + this.finishOp(38, 2); + } else { + this.finishOp(26, 1); + } + } + readToken_plus_min(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + this.finishOp(34, 2); + return; + } + if (next === 61) { + this.finishOp(30, 2); + } else { + this.finishOp(53, 1); + } + } + readToken_lt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 60) { + if (this.input.charCodeAt(pos + 2) === 61) { + this.finishOp(30, 3); + return; + } + this.finishOp(51, 2); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(47, 1); + } + readToken_gt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 62) { + const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(pos + size) === 61) { + this.finishOp(30, size + 1); + return; + } + this.finishOp(52, size); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(48, 1); + } + readToken_eq_excl(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); + return; + } + if (code === 61 && next === 62) { + this.state.pos += 2; + this.finishToken(19); + return; + } + this.finishOp(code === 61 ? 29 : 35, 1); + } + readToken_question() { + const next = this.input.charCodeAt(this.state.pos + 1); + const next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 63) { + if (next2 === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(40, 2); + } + } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { + this.state.pos += 2; + this.finishToken(18); + } else { + ++this.state.pos; + this.finishToken(17); + } + } + getTokenFromCode(code) { + switch (code) { + case 46: + this.readToken_dot(); + return; + case 40: + ++this.state.pos; + this.finishToken(10); + return; + case 41: + ++this.state.pos; + this.finishToken(11); + return; + case 59: + ++this.state.pos; + this.finishToken(13); + return; + case 44: + ++this.state.pos; + this.finishToken(12); + return; + case 91: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(2); + } else { + ++this.state.pos; + this.finishToken(0); + } + return; + case 93: + ++this.state.pos; + this.finishToken(3); + return; + case 123: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(6); + } else { + ++this.state.pos; + this.finishToken(5); + } + return; + case 125: + ++this.state.pos; + this.finishToken(8); + return; + case 58: + if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { + this.finishOp(15, 2); + } else { + ++this.state.pos; + this.finishToken(14); + } + return; + case 63: + this.readToken_question(); + return; + case 96: + this.readTemplateToken(); + return; + case 48: + { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 120 || next === 88) { + this.readRadixNumber(16); + return; + } + if (next === 111 || next === 79) { + this.readRadixNumber(8); + return; + } + if (next === 98 || next === 66) { + this.readRadixNumber(2); + return; + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + this.readNumber(false); + return; + case 34: + case 39: + this.readString(code); + return; + case 47: + this.readToken_slash(); + return; + case 37: + case 42: + this.readToken_mult_modulo(code); + return; + case 124: + case 38: + this.readToken_pipe_amp(code); + return; + case 94: + this.readToken_caret(); + return; + case 43: + case 45: + this.readToken_plus_min(code); + return; + case 60: + this.readToken_lt(); + return; + case 62: + this.readToken_gt(); + return; + case 61: + case 33: + this.readToken_eq_excl(code); + return; + case 126: + this.finishOp(36, 1); + return; + case 64: + this.readToken_atSign(); + return; + case 35: + this.readToken_numberSign(); + return; + case 92: + this.readWord(); + return; + default: + if (isIdentifierStart(code)) { + this.readWord(code); + return; + } + } + throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { + unexpected: String.fromCodePoint(code) + }); + } + finishOp(type, size) { + const str = this.input.slice(this.state.pos, this.state.pos + size); + this.state.pos += size; + this.finishToken(type, str); + } + readRegexp() { + const startLoc = this.state.startLoc; + const start = this.state.start + 1; + let escaped, inClass; + let { + pos + } = this.state; + for (;; ++pos) { + if (pos >= this.length) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + const ch = this.input.charCodeAt(pos); + if (isNewLine(ch)) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + if (escaped) { + escaped = false; + } else { + if (ch === 91) { + inClass = true; + } else if (ch === 93 && inClass) { + inClass = false; + } else if (ch === 47 && !inClass) { + break; + } + escaped = ch === 92; + } + } + const content = this.input.slice(start, pos); + ++pos; + let mods = ""; + const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); + while (pos < this.length) { + const cp = this.codePointAtPos(pos); + const char = String.fromCharCode(cp); + if (VALID_REGEX_FLAGS.has(cp)) { + if (cp === 118) { + if (mods.includes("u")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } else if (cp === 117) { + if (mods.includes("v")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } + if (mods.includes(char)) { + this.raise(Errors.DuplicateRegExpFlags, nextPos()); + } + } else if (isIdentifierChar(cp) || cp === 92) { + this.raise(Errors.MalformedRegExpFlags, nextPos()); + } else { + break; + } + ++pos; + mods += char; + } + this.state.pos = pos; + this.finishToken(138, { + pattern: content, + flags: mods + }); + } + readInt(radix, len, forceLen = false, allowNumSeparator = true) { + const { + n, + pos + } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); + this.state.pos = pos; + return n; + } + readRadixNumber(radix) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isBigInt = false; + this.state.pos += 2; + const val = this.readInt(radix); + if (val == null) { + this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { + radix + }); + } + const next = this.input.charCodeAt(this.state.pos); + if (next === 110) { + ++this.state.pos; + isBigInt = true; + } else if (next === 109) { + throw this.raise(Errors.InvalidDecimal, startLoc); + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + if (isBigInt) { + const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); + this.finishToken(136, str); + return; + } + this.finishToken(135, val); + } + readNumber(startsWithDot) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isFloat = false; + let isBigInt = false; + let hasExponent = false; + let isOctal = false; + if (!startsWithDot && this.readInt(10) === null) { + this.raise(Errors.InvalidNumber, this.state.curPosition()); + } + const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (hasLeadingZero) { + const integer = this.input.slice(start, this.state.pos); + this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); + if (!this.state.strict) { + const underscorePos = integer.indexOf("_"); + if (underscorePos > 0) { + this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); + } + } + isOctal = hasLeadingZero && !/[89]/.test(integer); + } + let next = this.input.charCodeAt(this.state.pos); + if (next === 46 && !isOctal) { + ++this.state.pos; + this.readInt(10); + isFloat = true; + next = this.input.charCodeAt(this.state.pos); + } + if ((next === 69 || next === 101) && !isOctal) { + next = this.input.charCodeAt(++this.state.pos); + if (next === 43 || next === 45) { + ++this.state.pos; + } + if (this.readInt(10) === null) { + this.raise(Errors.InvalidOrMissingExponent, startLoc); + } + isFloat = true; + hasExponent = true; + next = this.input.charCodeAt(this.state.pos); + } + if (next === 110) { + if (isFloat || hasLeadingZero) { + this.raise(Errors.InvalidBigIntLiteral, startLoc); + } + ++this.state.pos; + isBigInt = true; + } + if (next === 109) { + this.expectPlugin("decimal", this.state.curPosition()); + if (hasExponent || hasLeadingZero) { + this.raise(Errors.InvalidDecimal, startLoc); + } + ++this.state.pos; + var isDecimal = true; + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); + if (isBigInt) { + this.finishToken(136, str); + return; + } + if (isDecimal) { + this.finishToken(137, str); + return; + } + const val = isOctal ? parseInt(str, 8) : parseFloat(str); + this.finishToken(135, val); + } + readCodePoint(throwOnInvalid) { + const { + code, + pos + } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); + this.state.pos = pos; + return code; + } + readString(quote) { + const { + str, + pos, + curLine, + lineStart + } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + this.finishToken(134, str); + } + readTemplateContinuation() { + if (!this.match(8)) { + this.unexpected(null, 8); + } + this.state.pos--; + this.readTemplateToken(); + } + readTemplateToken() { + const opening = this.input[this.state.pos]; + const { + str, + firstInvalidLoc, + pos, + curLine, + lineStart + } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + if (firstInvalidLoc) { + this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos)); + } + if (this.input.codePointAt(pos) === 96) { + this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); + } else { + this.state.pos++; + this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); + } + } + recordStrictModeErrors(toParseError, at) { + const index = at.index; + if (this.state.strict && !this.state.strictErrors.has(index)) { + this.raise(toParseError, at); + } else { + this.state.strictErrors.set(index, [toParseError, at]); + } + } + readWord1(firstCode) { + this.state.containsEsc = false; + let word = ""; + const start = this.state.pos; + let chunkStart = this.state.pos; + if (firstCode !== undefined) { + this.state.pos += firstCode <= 0xffff ? 1 : 2; + } + while (this.state.pos < this.length) { + const ch = this.codePointAtPos(this.state.pos); + if (isIdentifierChar(ch)) { + this.state.pos += ch <= 0xffff ? 1 : 2; + } else if (ch === 92) { + this.state.containsEsc = true; + word += this.input.slice(chunkStart, this.state.pos); + const escStart = this.state.curPosition(); + const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; + if (this.input.charCodeAt(++this.state.pos) !== 117) { + this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); + chunkStart = this.state.pos - 1; + continue; + } + ++this.state.pos; + const esc = this.readCodePoint(true); + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(Errors.EscapedCharNotAnIdentifier, escStart); + } + word += String.fromCodePoint(esc); + } + chunkStart = this.state.pos; + } else { + break; + } + } + return word + this.input.slice(chunkStart, this.state.pos); + } + readWord(firstCode) { + const word = this.readWord1(firstCode); + const type = keywords$1.get(word); + if (type !== undefined) { + this.finishToken(type, tokenLabelName(type)); + } else { + this.finishToken(132, word); + } + } + checkKeywordEscapes() { + const { + type + } = this.state; + if (tokenIsKeyword(type) && this.state.containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { + reservedWord: tokenLabelName(type) + }); + } + } + raise(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const error = toParseError(loc, details); + if (!this.options.errorRecovery) throw error; + if (!this.isLookahead) this.state.errors.push(error); + return error; + } + raiseOverwrite(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const pos = loc.index; + const errors = this.state.errors; + for (let i = errors.length - 1; i >= 0; i--) { + const error = errors[i]; + if (error.loc.index === pos) { + return errors[i] = toParseError(loc, details); + } + if (error.loc.index < pos) break; + } + return this.raise(toParseError, at, details); + } + updateContext(prevType) {} + unexpected(loc, type) { + throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { + expected: type ? tokenLabelName(type) : null + }); + } + expectPlugin(pluginName, loc) { + if (this.hasPlugin(pluginName)) { + return true; + } + throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { + missingPlugin: [pluginName] + }); + } + expectOnePlugin(pluginNames) { + if (!pluginNames.some(name => this.hasPlugin(name))) { + throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { + missingPlugin: pluginNames + }); + } + } + errorBuilder(error) { + return (pos, lineStart, curLine) => { + this.raise(error, buildPosition(pos, lineStart, curLine)); + }; + } +} +class ClassScope { + constructor() { + this.privateNames = new Set(); + this.loneAccessors = new Map(); + this.undefinedPrivateNames = new Map(); + } +} +class ClassScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = []; + this.undefinedPrivateNames = new Map(); + this.parser = parser; + } + current() { + return this.stack[this.stack.length - 1]; + } + enter() { + this.stack.push(new ClassScope()); + } + exit() { + const oldClassScope = this.stack.pop(); + const current = this.current(); + for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { + if (current) { + if (!current.undefinedPrivateNames.has(name)) { + current.undefinedPrivateNames.set(name, loc); + } + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } + } + declarePrivateName(name, elementType, loc) { + const { + privateNames, + loneAccessors, + undefinedPrivateNames + } = this.current(); + let redefined = privateNames.has(name); + if (elementType & 3) { + const accessor = redefined && loneAccessors.get(name); + if (accessor) { + const oldStatic = accessor & 4; + const newStatic = elementType & 4; + const oldKind = accessor & 3; + const newKind = elementType & 3; + redefined = oldKind === newKind || oldStatic !== newStatic; + if (!redefined) loneAccessors.delete(name); + } else if (!redefined) { + loneAccessors.set(name, elementType); + } + } + if (redefined) { + this.parser.raise(Errors.PrivateNameRedeclaration, loc, { + identifierName: name + }); + } + privateNames.add(name); + undefinedPrivateNames.delete(name); + } + usePrivateName(name, loc) { + let classScope; + for (classScope of this.stack) { + if (classScope.privateNames.has(name)) return; + } + if (classScope) { + classScope.undefinedPrivateNames.set(name, loc); + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } +} +class ExpressionScope { + constructor(type = 0) { + this.type = type; + } + canBeArrowParameterDeclaration() { + return this.type === 2 || this.type === 1; + } + isCertainlyParameterDeclaration() { + return this.type === 3; + } +} +class ArrowHeadParsingScope extends ExpressionScope { + constructor(type) { + super(type); + this.declarationErrors = new Map(); + } + recordDeclarationError(ParsingErrorClass, at) { + const index = at.index; + this.declarationErrors.set(index, [ParsingErrorClass, at]); + } + clearDeclarationError(index) { + this.declarationErrors.delete(index); + } + iterateErrors(iterator) { + this.declarationErrors.forEach(iterator); + } +} +class ExpressionScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = [new ExpressionScope()]; + this.parser = parser; + } + enter(scope) { + this.stack.push(scope); + } + exit() { + this.stack.pop(); + } + recordParameterInitializerError(toParseError, node) { + const origin = node.loc.start; + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (!scope.isCertainlyParameterDeclaration()) { + if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(toParseError, origin); + } else { + return; + } + scope = stack[--i]; + } + this.parser.raise(toParseError, origin); + } + recordArrowParameterBindingError(error, node) { + const { + stack + } = this; + const scope = stack[stack.length - 1]; + const origin = node.loc.start; + if (scope.isCertainlyParameterDeclaration()) { + this.parser.raise(error, origin); + } else if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(error, origin); + } else { + return; + } + } + recordAsyncArrowParametersError(at) { + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + if (scope.type === 2) { + scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); + } + scope = stack[--i]; + } + } + validateAsPattern() { + const { + stack + } = this; + const currentScope = stack[stack.length - 1]; + if (!currentScope.canBeArrowParameterDeclaration()) return; + currentScope.iterateErrors(([toParseError, loc]) => { + this.parser.raise(toParseError, loc); + let i = stack.length - 2; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + scope.clearDeclarationError(loc.index); + scope = stack[--i]; + } + }); + } +} +function newParameterDeclarationScope() { + return new ExpressionScope(3); +} +function newArrowHeadScope() { + return new ArrowHeadParsingScope(1); +} +function newAsyncArrowScope() { + return new ArrowHeadParsingScope(2); +} +function newExpressionScope() { + return new ExpressionScope(); +} +class ProductionParameterHandler { + constructor() { + this.stacks = []; + } + enter(flags) { + this.stacks.push(flags); + } + exit() { + this.stacks.pop(); + } + currentFlags() { + return this.stacks[this.stacks.length - 1]; + } + get hasAwait() { + return (this.currentFlags() & 2) > 0; + } + get hasYield() { + return (this.currentFlags() & 1) > 0; + } + get hasReturn() { + return (this.currentFlags() & 4) > 0; + } + get hasIn() { + return (this.currentFlags() & 8) > 0; + } +} +function functionFlags(isAsync, isGenerator) { + return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); +} +class UtilParser extends Tokenizer { + addExtra(node, key, value, enumerable = true) { + if (!node) return; + let { + extra + } = node; + if (extra == null) { + extra = {}; + node.extra = extra; + } + if (enumerable) { + extra[key] = value; + } else { + Object.defineProperty(extra, key, { + enumerable, + value + }); + } + } + isContextual(token) { + return this.state.type === token && !this.state.containsEsc; + } + isUnparsedContextual(nameStart, name) { + const nameEnd = nameStart + name.length; + if (this.input.slice(nameStart, nameEnd) === name) { + const nextCh = this.input.charCodeAt(nameEnd); + return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); + } + return false; + } + isLookaheadContextual(name) { + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); + } + eatContextual(token) { + if (this.isContextual(token)) { + this.next(); + return true; + } + return false; + } + expectContextual(token, toParseError) { + if (!this.eatContextual(token)) { + if (toParseError != null) { + throw this.raise(toParseError, this.state.startLoc); + } + this.unexpected(null, token); + } + } + canInsertSemicolon() { + return this.match(140) || this.match(8) || this.hasPrecedingLineBreak(); + } + hasPrecedingLineBreak() { + return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start); + } + hasFollowingLineBreak() { + return hasNewLine(this.input, this.state.end, this.nextTokenStart()); + } + isLineTerminator() { + return this.eat(13) || this.canInsertSemicolon(); + } + semicolon(allowAsi = true) { + if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; + this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); + } + expect(type, loc) { + if (!this.eat(type)) { + this.unexpected(loc, type); + } + } + tryParse(fn, oldState = this.state.clone()) { + const abortSignal = { + node: null + }; + try { + const node = fn((node = null) => { + abortSignal.node = node; + throw abortSignal; + }); + if (this.state.errors.length > oldState.errors.length) { + const failState = this.state; + this.state = oldState; + this.state.tokensLength = failState.tokensLength; + return { + node, + error: failState.errors[oldState.errors.length], + thrown: false, + aborted: false, + failState + }; + } + return { + node, + error: null, + thrown: false, + aborted: false, + failState: null + }; + } catch (error) { + const failState = this.state; + this.state = oldState; + if (error instanceof SyntaxError) { + return { + node: null, + error, + thrown: true, + aborted: false, + failState + }; + } + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + throw error; + } + } + checkExpressionErrors(refExpressionErrors, andThrow) { + if (!refExpressionErrors) return false; + const { + shorthandAssignLoc, + doubleProtoLoc, + privateKeyLoc, + optionalParametersLoc + } = refExpressionErrors; + const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; + if (!andThrow) { + return hasErrors; + } + if (shorthandAssignLoc != null) { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + if (doubleProtoLoc != null) { + this.raise(Errors.DuplicateProto, doubleProtoLoc); + } + if (privateKeyLoc != null) { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + if (optionalParametersLoc != null) { + this.unexpected(optionalParametersLoc); + } + } + isLiteralPropertyName() { + return tokenIsLiteralPropertyName(this.state.type); + } + isPrivateName(node) { + return node.type === "PrivateName"; + } + getPrivateNameSV(node) { + return node.id.name; + } + hasPropertyAsPrivateName(node) { + return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); + } + isObjectProperty(node) { + return node.type === "ObjectProperty"; + } + isObjectMethod(node) { + return node.type === "ObjectMethod"; + } + initializeScopes(inModule = this.options.sourceType === "module") { + const oldLabels = this.state.labels; + this.state.labels = []; + const oldExportedIdentifiers = this.exportedIdentifiers; + this.exportedIdentifiers = new Set(); + const oldInModule = this.inModule; + this.inModule = inModule; + const oldScope = this.scope; + const ScopeHandler = this.getScopeHandler(); + this.scope = new ScopeHandler(this, inModule); + const oldProdParam = this.prodParam; + this.prodParam = new ProductionParameterHandler(); + const oldClassScope = this.classScope; + this.classScope = new ClassScopeHandler(this); + const oldExpressionScope = this.expressionScope; + this.expressionScope = new ExpressionScopeHandler(this); + return () => { + this.state.labels = oldLabels; + this.exportedIdentifiers = oldExportedIdentifiers; + this.inModule = oldInModule; + this.scope = oldScope; + this.prodParam = oldProdParam; + this.classScope = oldClassScope; + this.expressionScope = oldExpressionScope; + }; + } + enterInitialScopes() { + let paramFlags = 0; + if (this.inModule) { + paramFlags |= 2; + } + this.scope.enter(1); + this.prodParam.enter(paramFlags); + } + checkDestructuringPrivate(refExpressionErrors) { + const { + privateKeyLoc + } = refExpressionErrors; + if (privateKeyLoc !== null) { + this.expectPlugin("destructuringPrivate", privateKeyLoc); + } + } +} +class ExpressionErrors { + constructor() { + this.shorthandAssignLoc = null; + this.doubleProtoLoc = null; + this.privateKeyLoc = null; + this.optionalParametersLoc = null; + } +} +class Node { + constructor(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + this.loc = new SourceLocation(loc); + if (parser != null && parser.options.ranges) this.range = [pos, 0]; + if (parser != null && parser.filename) this.loc.filename = parser.filename; + } +} +const NodePrototype = Node.prototype; +{ + NodePrototype.__clone = function () { + const newNode = new Node(undefined, this.start, this.loc.start); + const keys = Object.keys(this); + for (let i = 0, length = keys.length; i < length; i++) { + const key = keys[i]; + if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { + newNode[key] = this[key]; + } + } + return newNode; + }; +} +function clonePlaceholder(node) { + return cloneIdentifier(node); +} +function cloneIdentifier(node) { + const { + type, + start, + end, + loc, + range, + extra, + name + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.extra = extra; + cloned.name = name; + if (type === "Placeholder") { + cloned.expectedNode = node.expectedNode; + } + return cloned; +} +function cloneStringLiteral(node) { + const { + type, + start, + end, + loc, + range, + extra + } = node; + if (type === "Placeholder") { + return clonePlaceholder(node); + } + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + if (node.raw !== undefined) { + cloned.raw = node.raw; + } else { + cloned.extra = extra; + } + cloned.value = node.value; + return cloned; +} +class NodeUtils extends UtilParser { + startNode() { + const loc = this.state.startLoc; + return new Node(this, loc.index, loc); + } + startNodeAt(loc) { + return new Node(this, loc.index, loc); + } + startNodeAtNode(type) { + return this.startNodeAt(type.loc.start); + } + finishNode(node, type) { + return this.finishNodeAt(node, type, this.state.lastTokEndLoc); + } + finishNodeAt(node, type, endLoc) { + node.type = type; + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + if (this.options.attachComment) this.processComment(node); + return node; + } + resetStartLocation(node, startLoc) { + node.start = startLoc.index; + node.loc.start = startLoc; + if (this.options.ranges) node.range[0] = startLoc.index; + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + } + resetStartLocationFromNode(node, locationNode) { + this.resetStartLocation(node, locationNode.loc.start); + } +} +const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); +const FlowErrors = ParseErrorEnum`flow`({ + AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", + AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", + AssignReservedType: ({ + reservedType + }) => `Cannot overwrite reserved type ${reservedType}.`, + DeclareClassElement: "The `declare` modifier can only appear on class fields.", + DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", + DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", + EnumBooleanMemberNotInitialized: ({ + memberName, + enumName + }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, + EnumDuplicateMemberName: ({ + memberName, + enumName + }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, + EnumInconsistentMemberValues: ({ + enumName + }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, + EnumInvalidExplicitType: ({ + invalidEnumType, + enumName + }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidExplicitTypeUnknownSupplied: ({ + enumName + }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerPrimaryType: ({ + enumName, + memberName, + explicitType + }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, + EnumInvalidMemberInitializerSymbolType: ({ + enumName, + memberName + }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerUnknownType: ({ + enumName, + memberName + }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, + EnumInvalidMemberName: ({ + enumName, + memberName, + suggestion + }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, + EnumNumberMemberNotInitialized: ({ + enumName, + memberName + }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, + EnumStringMemberInconsistentlyInitialized: ({ + enumName + }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, + GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", + ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", + InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", + InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", + InexactVariance: "Explicit inexact syntax cannot have variance.", + InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", + MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", + NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", + NestedFlowComment: "Cannot have a flow comment inside another flow comment.", + PatternIsOptional: Object.assign({ + message: "A binding pattern parameter cannot be optional in an implementation signature." + }, { + reasonCode: "OptionalBindingPattern" + }), + SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", + SpreadVariance: "Spread properties cannot have variance.", + ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", + ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", + ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", + ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", + ThisParamNoDefault: "The `this` parameter may not have a default value.", + TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", + UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", + UnexpectedReservedType: ({ + reservedType + }) => `Unexpected reserved type ${reservedType}.`, + UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", + UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", + UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", + UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', + UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", + UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", + UnsupportedDeclareExportKind: ({ + unsupportedExportKind, + suggestion + }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, + UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", + UnterminatedFlowComment: "Unterminated flow-comment." +}); +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); +} +function hasTypeImportKind(node) { + return node.importKind === "type" || node.importKind === "typeof"; +} +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface" +}; +function partition(list, test) { + const list1 = []; + const list2 = []; + for (let i = 0; i < list.length; i++) { + (test(list[i], i, list) ? list1 : list2).push(list[i]); + } + return [list1, list2]; +} +const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; +var flow = superClass => class FlowParserMixin extends superClass { + constructor(...args) { + super(...args); + this.flowPragma = undefined; + } + getScopeHandler() { + return FlowScopeHandler; + } + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } + finishToken(type, val) { + if (type !== 134 && type !== 13 && type !== 28) { + if (this.flowPragma === undefined) { + this.flowPragma = null; + } + } + super.finishToken(type, val); + } + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + if (!matches) ;else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; + } else { + throw new Error("Unexpected flow pragma"); + } + } + super.addComment(comment); + } + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || 14); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + this.next(); + this.expectContextual(110); + if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); + } + if (this.eat(10)) { + node.value = super.parseExpression(); + this.expect(11); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(14); + let type = null; + let predicate = null; + if (this.match(54)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + if (this.match(54)) { + predicate = this.flowParsePredicate(); + } + } + return [type, predicate]; + } + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + if (this.match(47)) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + this.expect(10); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + typeNode.this = tmp._this; + this.expect(11); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + this.scope.declareName(node.id.name, 2048, node.id.loc.start); + return this.finishNode(node, "DeclareFunction"); + } + flowParseDeclare(node, insideModule) { + if (this.match(80)) { + return this.flowParseDeclareClass(node); + } else if (this.match(68)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(74)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual(127)) { + if (this.match(16)) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) { + this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); + } + return this.flowParseDeclareModule(node); + } + } else if (this.isContextual(130)) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual(131)) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual(129)) { + return this.flowParseDeclareInterface(node); + } else if (this.match(82)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } else { + this.unexpected(); + } + } + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, 5, node.id.loc.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + flowParseDeclareModule(node) { + this.scope.enter(0); + if (this.match(134)) { + node.id = super.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(5); + while (!this.match(8)) { + let bodyNode = this.startNode(); + if (this.match(83)) { + this.next(); + if (!this.isContextual(130) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); + } + super.parseImport(bodyNode); + } else { + this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); + bodyNode = this.flowParseDeclare(bodyNode, true); + } + body.push(bodyNode); + } + this.scope.exit(); + this.expect(8); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); + } + if (kind === "ES") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(82); + if (this.eat(65)) { + if (this.match(68) || this.match(80)) { + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { + const label = this.state.value; + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { + unsupportedExportKind: label, + suggestion: exportSuggestions[label] + }); + } + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { + node = this.parseExport(node, null); + if (node.type === "ExportNamedDeclaration") { + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } + node.type = "Declare" + node.type; + return node; + } + } + this.unexpected(); + } + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual(111); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + flowParseDeclareTypeAlias(node) { + this.next(); + const finished = this.flowParseTypeAlias(node); + finished.type = "DeclareTypeAlias"; + return finished; + } + flowParseDeclareOpaqueType(node) { + this.next(); + const finished = this.flowParseOpaqueType(node, true); + finished.type = "DeclareOpaqueType"; + return finished; + } + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "DeclareInterface"); + } + flowParseInterfaceish(node, isClass) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(12)); + } + if (isClass) { + node.implements = []; + node.mixins = []; + if (this.eatContextual(117)) { + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + if (this.eatContextual(113)) { + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + } + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + return this.finishNode(node, "InterfaceExtends"); + } + flowParseInterface(node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); + } + checkNotUnderscore(word) { + if (word === "_") { + this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); + } + } + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { + reservedType: word + }); + } + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.startLoc, declaration); + return this.parseIdentifier(liberal); + } + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.right = this.flowParseTypeInitialiser(29); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } + flowParseOpaqueType(node, declare) { + this.expectContextual(130); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.supertype = null; + if (this.match(14)) { + node.supertype = this.flowParseTypeInitialiser(14); + } + node.impltype = null; + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(29); + } + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + flowParseTypeParameter(requireDefault = false) { + const nodeStartLoc = this.state.startLoc; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + if (this.match(29)) { + this.eat(29); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); + } + } + return this.finishNode(node, "TypeParameter"); + } + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + if (this.match(47) || this.match(143)) { + this.next(); + } else { + this.unexpected(); + } + let defaultRequired = false; + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + if (typeParameter.default) { + defaultRequired = true; + } + if (!this.match(48)) { + this.expect(12); + } + } while (!this.match(48)); + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; + while (!this.match(48)) { + node.params.push(this.flowParseType()); + if (!this.match(48)) { + this.expect(12); + } + } + this.state.noAnonFunctionType = oldNoAnonFunctionType; + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseTypeParameterInstantiationCallOrNew() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + while (!this.match(48)) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + if (!this.match(48)) { + this.expect(12); + } + } + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual(129); + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + flowParseObjectPropertyKey() { + return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); + } + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + if (this.lookahead().type === 14) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + this.expect(3); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(3); + this.expect(3); + if (this.match(47) || this.match(10)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + } else { + node.method = false; + if (this.eat(17)) { + node.optional = true; + } + node.value = this.flowParseTypeInitialiser(); + } + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + node.this = null; + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + this.expect(10); + if (this.match(78)) { + node.this = this.flowParseFunctionTypeParam(true); + node.this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + node.params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + node.rest = this.flowParseFunctionTypeParam(false); + } + this.expect(11); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + if (allowExact && this.match(6)) { + this.expect(6); + endDelim = 9; + exact = true; + } else { + this.expect(5); + endDelim = 8; + exact = false; + } + nodeStart.exact = exact; + while (!this.match(endDelim)) { + let isStatic = false; + let protoStartLoc = null; + let inexactStartLoc = null; + const node = this.startNode(); + if (allowProto && this.isContextual(118)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + protoStartLoc = this.state.startLoc; + allowStatic = false; + } + } + if (allowStatic && this.isContextual(106)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + isStatic = true; + } + } + const variance = this.flowParseVariance(); + if (this.eat(0)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (this.eat(0)) { + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); + } else { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(10) || this.match(47)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + if (this.isContextual(99) || this.isContextual(104)) { + const lookahead = this.lookahead(); + if (tokenIsLiteralPropertyName(lookahead.type)) { + kind = this.state.value; + this.next(); + } + } + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + if (propOrInexact === null) { + inexact = true; + inexactStartLoc = this.state.lastTokStartLoc; + } else { + nodeStart.properties.push(propOrInexact); + } + } + this.flowObjectTypeSemicolon(); + if (inexactStartLoc && !this.match(8) && !this.match(9)) { + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); + } + } + this.expect(endDelim); + if (allowSpread) { + nodeStart.inexact = inexact; + } + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } + flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { + if (this.eat(21)) { + const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); + if (isInexactToken) { + if (!allowSpread) { + this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); + } else if (!allowInexact) { + this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); + } + if (variance) { + this.raise(FlowErrors.InexactVariance, variance); + } + return null; + } + if (!allowSpread) { + this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); + } + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.raise(FlowErrors.SpreadVariance, variance); + } + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStartLoc != null; + node.kind = kind; + let optional = false; + if (this.match(47) || this.match(10)) { + node.method = true; + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } + if (!allowSpread && node.key.name === "constructor" && node.value.this) { + this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); + } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; + if (this.eat(17)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + } + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } + } + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + if (property.value.this) { + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); + } + if (length !== paramCount) { + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); + } + if (property.kind === "set" && property.value.rest) { + this.raise(Errors.BadSetterRestParameter, property); + } + } + flowObjectTypeSemicolon() { + if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { + this.unexpected(); + } + } + flowParseQualifiedTypeIdentifier(startLoc, id) { + var _startLoc; + (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + while (this.eat(16)) { + const node2 = this.startNodeAt(startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + return node; + } + flowParseGenericType(startLoc, id) { + const node = this.startNodeAt(startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + return this.finishNode(node, "GenericTypeAnnotation"); + } + flowParseTypeofType() { + const node = this.startNode(); + this.expect(87); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(0); + while (this.state.pos < this.length && !this.match(3)) { + node.types.push(this.flowParseType()); + if (this.match(3)) break; + this.expect(12); + } + this.expect(3); + return this.finishNode(node, "TupleTypeAnnotation"); + } + flowParseFunctionTypeParam(first) { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + const isThis = this.state.type === 78; + if (lh.type === 14 || lh.type === 17) { + if (isThis && !first) { + this.raise(FlowErrors.ThisParamMustBeFirst, node); + } + name = this.parseIdentifier(isThis); + if (this.eat(17)) { + optional = true; + if (isThis) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, node); + } + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + flowParseFunctionTypeParams(params = []) { + let rest = null; + let _this = null; + if (this.match(78)) { + _this = this.flowParseFunctionTypeParam(true); + _this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + rest = this.flowParseFunctionTypeParam(false); + } + return { + params, + rest, + _this + }; + } + flowIdentToTypeAnnotation(startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startLoc, id); + } + } + flowParsePrimaryType() { + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + switch (this.state.type) { + case 5: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); + case 6: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); + case 0: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + case 47: + { + const node = this.startNode(); + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(10); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 10: + { + const node = this.startNode(); + this.next(); + if (!this.match(11) && !this.match(21)) { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + const token = this.lookahead().type; + isGroupedType = token !== 17 && token !== 14; + } else { + isGroupedType = true; + } + } + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { + this.expect(11); + return type; + } else { + this.eat(12); + } + } + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 134: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case 85: + case 86: + node.value = this.match(85); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case 53: + if (this.state.value === "-") { + this.next(); + if (this.match(135)) { + return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); + } + if (this.match(136)) { + return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); + } + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); + } + this.unexpected(); + return; + case 135: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case 136: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + case 88: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); + case 84: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + case 78: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + case 55: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + case 87: + return this.flowParseTypeofType(); + default: + if (tokenIsKeyword(this.state.type)) { + const label = tokenLabelName(this.state.type); + this.next(); + return super.createIdentifier(node, label); + } else if (tokenIsIdentifier(this.state.type)) { + if (this.isContextual(129)) { + return this.flowParseInterfaceType(); + } + return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); + } + } + this.unexpected(); + } + flowParsePostfixType() { + const startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + let seenOptionalIndexedAccess = false; + while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + const optional = this.eat(18); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; + this.expect(0); + if (!optional && this.match(3)) { + node.elementType = type; + this.next(); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(3); + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode(node, "OptionalIndexedAccessType"); + } else { + type = this.finishNode(node, "IndexedAccessType"); + } + } + } + return type; + } + flowParsePrefixType() { + const node = this.startNode(); + if (this.eat(17)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + if (!this.state.noAnonFunctionType && this.eat(19)) { + const node = this.startNodeAt(param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.this = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + return param; + } + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(45); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + while (this.eat(45)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + flowParseUnionType() { + const node = this.startNode(); + this.eat(43); + const type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(43)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === 132 && this.state.value === "_") { + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startLoc, node); + } else { + return this.flowParseType(); + } + } + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + if (this.match(14)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + return ident; + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + flowParseVariance() { + let variance = null; + if (this.match(53)) { + variance = this.startNode(); + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + this.next(); + return this.finishNode(variance, "Variance"); + } + return variance; + } + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + return; + } + super.parseFunctionBody(node, false, isMethod); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + parseStatementLike(flags) { + if (this.state.strict && this.isContextual(129)) { + const lookahead = this.lookahead(); + if (tokenIsKeywordOrIdentifier(lookahead.type)) { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } + } else if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + const stmt = super.parseStatementLike(flags); + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } + return stmt; + } + parseExpressionStatement(node, expr, decorators) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { + return this.flowParseDeclare(node); + } + } else if (tokenIsIdentifier(this.state.type)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); + } + } + } + return super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return !this.state.containsEsc; + } + return super.shouldParseExportDeclaration(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return this.state.containsEsc; + } + return super.isExportDefaultSpecifier(); + } + parseExportDefaultExpression() { + if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + return super.parseExportDefaultExpression(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + this.expect(17); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } + if (failed && valid.length > 1) { + this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); + } + if (failed && valid.length === 1) { + this.state = state; + noArrowAt.push(valid[0].start); + this.state.noArrowAt = noArrowAt; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } + } + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(14); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(14); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + while (stack.length !== 0) { + const node = stack.pop(); + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + finishArrowValidation(node) { + var _node$extra; + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); + this.scope.enter(2 | 4); + super.checkParams(node, false, true); + this.scope.exit(); + } + forwardNoArrowParamsConversionAt(node, parse) { + let result; + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + return result; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = newNode; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + return newNode; + } + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + super.assertModuleNodeAllowed(node); + } + parseExportDeclaration(node) { + if (this.isContextual(130)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + if (this.match(5)) { + node.specifiers = this.parseExportSpecifiers(true); + super.parseExportFrom(node); + return null; + } else { + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual(131)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual(129)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.isContextual(126)) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + eatExportStar(node) { + if (super.eatExportStar(node)) return true; + if (this.isContextual(130) && this.lookahead().type === 55) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + const { + startLoc + } = this.state; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + if (hasNamespace && node.exportKind === "type") { + this.unexpected(startLoc); + } + return hasNamespace; + } + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } + parseClassMember(classBody, member, state) { + const { + startLoc + } = this.state; + if (this.isContextual(125)) { + if (super.parseClassMemberFromModifier(classBody, member)) { + return; + } + member.declare = true; + } + super.parseClassMember(classBody, member, state); + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { + this.raise(FlowErrors.DeclareClassElement, startLoc); + } else if (member.value) { + this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); + } + } + } + isIterator(word) { + return word === "iterator" || word === "asyncIterator"; + } + readIterator() { + const word = super.readWord1(); + const fullWord = "@@" + word; + if (!this.isIterator(word) || !this.state.inType) { + this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { + identifierName: fullWord + }); + } + this.finishToken(132, fullWord); + } + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 123 && next === 124) { + this.finishOp(6, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + this.finishOp(code === 62 ? 48 : 47, 1); + } else if (this.state.inType && code === 63) { + if (next === 46) { + this.finishOp(18, 2); + } else { + this.finishOp(17, 1); + } + } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { + this.state.pos += 2; + this.readIterator(); + } else { + super.getTokenFromCode(code); + } + } + isAssignable(node, isBinding) { + if (node.type === "TypeCastExpression") { + return this.isAssignable(node.expression, isBinding); + } else { + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + super.toAssignable(node, isLHS); + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); + } + } + return exprList; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + return node; + } + isValidLVal(type, isParenthesized, binding) { + return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); + } + parseClassProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassPrivateProperty(node); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(14) || super.isClassProperty(); + } + isNonstaticConstructor(method) { + return !this.match(14) && super.isNonstaticConstructor(method); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + if (method.params && isConstructor) { + const params = method.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { + const params = method.value.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && this.match(47)) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + if (this.isContextual(113)) { + this.next(); + const implemented = node.implements = []; + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(12)); + } + } + checkGetterSetterParams(method) { + super.checkGetterSetterParams(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length > 0) { + const param = params[0]; + if (this.isThisParam(param) && method.kind === "get") { + this.raise(FlowErrors.GetterMayNotHaveThisParam, param); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.SetterMayNotHaveThisParam, param); + } + } + } + parsePropertyNamePrefixOperator(node) { + node.variance = this.flowParseVariance(); + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.loc.start); + } + delete prop.variance; + let typeParameters; + if (this.match(47) && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(10)) this.unexpected(); + } + const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + if (typeParameters) { + (result.value || result).typeParameters = typeParameters; + } + return result; + } + parseFunctionParamType(param) { + if (this.eat(17)) { + if (param.type !== "Identifier") { + this.raise(FlowErrors.PatternIsOptional, param); + } + if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, param); + } + param.optional = true; + } + if (this.match(14)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamAnnotationRequired, param); + } + if (this.match(29) && this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamNoDefault, param); + } + this.resetEndLocation(param); + return param; + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); + } + return node; + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + if (!isExport) return true; + const ch = this.lookaheadCharCode(); + return ch === 123 || ch === 42; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + if (!phase && this.match(65)) { + return; + } + node.exportKind = phase === "type" ? phase : "value"; + } else { + if (phase === "type" && this.match(55)) this.unexpected(); + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + const firstIdent = specifier.imported; + let specifierTypeKind = null; + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } + let isBinding = false; + if (this.isContextual(93) && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = cloneIdentifier(as_ident); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else { + if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + } else { + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: firstIdent.value + }); + } + specifier.imported = firstIdent; + specifier.importKind = null; + } + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = cloneIdentifier(specifier.imported); + } + } + const specifierIsTypeImport = hasTypeImportKind(specifier); + if (isInTypeOnlyImport && specifierIsTypeImport) { + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); + } + if (isInTypeOnlyImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); + } + if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); + } + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + default: + return super.parseBindingAtom(); + } + } + parseFunctionParams(node, isConstructor) { + const kind = node.kind; + if (kind !== "get" && kind !== "set" && this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (this.match(14)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx; + let state = null; + let jsx; + if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { + var _jsx2, _jsx3; + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + if (expr.type !== "ArrowFunctionExpression") abort(); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); + } + return arrow.node; + } + arrowExpression = arrow.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); + } + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(19)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } + return super.parseArrow(node); + } + shouldParseArrow(params) { + return this.match(14) || super.shouldParseArrow(params); + } + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + return; + } + for (let i = 0; i < node.params.length; i++) { + if (this.isThisParam(node.params[i]) && i > 0) { + this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); + } + } + super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); + } + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); + } + parseSubscripts(base, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = super.parseCallExpressionArguments(11); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + if (result.node) { + this.state = result.failState; + return result.node; + } + throw arrow.error || result.error; + } + return super.parseSubscripts(base, startLoc, noCalls); + } + parseSubscript(base, startLoc, noCalls, subscriptState) { + if (this.match(18) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + if (noCalls) { + subscriptState.stop = true; + return base; + } + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiation(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(11); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { + const node = this.startNodeAt(startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + this.expect(10); + node.arguments = super.parseCallExpressionArguments(11); + if (subscriptState.optionalChainMember) { + node.optional = false; + } + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; + } + } + return super.parseSubscript(base, startLoc, noCalls, subscriptState); + } + parseNewCallee(node) { + super.parseNewCallee(node); + let targs = null; + if (this.shouldParseTypes() && this.match(47)) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; + } + node.typeArguments = targs; + } + parseAsyncArrowWithTypeParameters(startLoc) { + const node = this.startNodeAt(startLoc); + this.parseFunctionParams(node, false); + if (!this.parseArrow(node)) return; + return super.parseArrowExpression(node, undefined, true); + } + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } + super.readToken_mult_modulo(code); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 124 && next === 125) { + this.finishOp(9, 2); + return; + } + super.readToken_pipe_amp(code); + } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); + if (this.state.hasFlowComment) { + this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); + } + return fileNode; + } + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); + } + this.hasFlowCommentCompletion(); + const commentSkip = this.skipFlowComment(); + if (commentSkip) { + this.state.pos += commentSkip; + this.state.hasFlowComment = true; + } + return; + } + return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); + } + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; + } + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + return false; + } + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + } + flowEnumErrorBooleanMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { + memberName, + enumName + }); + } + flowEnumErrorInvalidMemberInitializer(loc, enumContext) { + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); + } + flowEnumErrorNumberMemberNotInitialized(loc, details) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); + } + flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); + } + flowEnumMemberInit() { + const startLoc = this.state.startLoc; + const endOfInit = () => this.match(12) || this.match(8); + switch (this.state.type) { + case 135: + { + const literal = this.parseNumericLiteral(this.state.value); + if (endOfInit()) { + return { + type: "number", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 134: + { + const literal = this.parseStringLiteral(this.state.value); + if (endOfInit()) { + return { + type: "string", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 85: + case 86: + { + const literal = this.parseBooleanLiteral(this.match(85)); + if (endOfInit()) { + return { + type: "boolean", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + default: + return { + type: "invalid", + loc: startLoc + }; + } + } + flowEnumMemberRaw() { + const loc = this.state.startLoc; + const id = this.parseIdentifier(true); + const init = this.eat(29) ? this.flowEnumMemberInit() : { + type: "none", + loc + }; + return { + id, + init + }; + } + flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { + const { + explicitType + } = context; + if (explicitType === null) { + return; + } + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(loc, context); + } + } + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + let hasUnknownMembers = false; + while (!this.match(8)) { + if (this.eat(21)) { + hasUnknownMembers = true; + break; + } + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; + if (memberName === "") { + continue; + } + if (/^[a-z]/.test(memberName)) { + this.raise(FlowErrors.EnumInvalidMemberName, id, { + memberName, + suggestion: memberName[0].toUpperCase() + memberName.slice(1), + enumName + }); + } + if (seenNames.has(memberName)) { + this.raise(FlowErrors.EnumDuplicateMemberName, id, { + memberName, + enumName + }); + } + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); + } + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); + break; + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); + break; + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } + } + if (!this.match(8)) { + this.expect(12); + } + } + return { + members, + hasUnknownMembers + }; + } + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (const member of initializedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return defaultedMembers; + } else { + for (const member of defaultedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return initializedMembers; + } + } + flowEnumParseExplicitType({ + enumName + }) { + if (!this.eatContextual(102)) return null; + if (!tokenIsIdentifier(this.state.type)) { + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { + enumName + }); + } + const { + value + } = this.state; + this.next(); + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { + enumName, + invalidEnumType: value + }); + } + return value; + } + flowEnumBody(node, id) { + const enumName = id.name; + const nameLoc = id.loc.start; + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(5); + const { + members, + hasUnknownMembers + } = this.flowEnumMembers({ + enumName, + explicitType + }); + node.hasUnknownMembers = hasUnknownMembers; + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + case "symbol": + node.members = members.defaultedMembers; + this.expect(8); + return this.finishNode(node, "EnumSymbolBody"); + default: + { + const empty = () => { + node.members = []; + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + }; + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { + enumName + }); + return empty(); + } + } + } + } + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), id); + return this.finishNode(node, "EnumDeclaration"); + } + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } + return false; + } + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } +}; +const entities = { + __proto__: null, + quot: "\u0022", + amp: "&", + apos: "\u0027", + lt: "<", + gt: ">", + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" +}; +const JsxErrors = ParseErrorEnum`jsx`({ + AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", + MissingClosingTagElement: ({ + openingTagName + }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", + UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", + UnexpectedToken: ({ + unexpected, + HTMLEntity + }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, + UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", + UnterminatedJsxContent: "Unterminated JSX contents.", + UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" +}); +function isFragment(object) { + return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; +} +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + throw new Error("Node had unexpected type: " + object.type); +} +var jsx = superClass => class JSXParserMixin extends superClass { + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 60: + case 123: + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.canStartJSXElement) { + ++this.state.pos; + this.finishToken(143); + } else { + super.getTokenFromCode(ch); + } + return; + } + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(142, out); + return; + case 38: + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + case 62: + case 125: + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } + } + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; + ++this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; + return out; + } + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + out += this.input.slice(chunkStart, this.state.pos++); + this.finishToken(134, out); + } + jsxReadEntity() { + const startPos = ++this.state.pos; + if (this.codePointAtPos(this.state.pos) === 35) { + ++this.state.pos; + let radix = 10; + if (this.codePointAtPos(this.state.pos) === 120) { + radix = 16; + ++this.state.pos; + } + const codePoint = this.readInt(radix, undefined, false, "bail"); + if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { + ++this.state.pos; + return String.fromCodePoint(codePoint); + } + } else { + let count = 0; + let semi = false; + while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { + ++this.state.pos; + } + if (semi) { + const desc = this.input.slice(startPos, this.state.pos); + const entity = entities[desc]; + ++this.state.pos; + if (entity) { + return entity; + } + } + } + this.state.pos = startPos; + return "&"; + } + jsxReadWord() { + let ch; + const start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); + this.finishToken(141, this.input.slice(start, this.state.pos)); + } + jsxParseIdentifier() { + const node = this.startNode(); + if (this.match(141)) { + node.name = this.state.value; + } else if (tokenIsKeyword(this.state.type)) { + node.name = tokenLabelName(this.state.type); + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsxParseNamespacedName() { + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(14)) return name; + const node = this.startNodeAt(startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsxParseElementName() { + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + if (node.type === "JSXNamespacedName") { + return node; + } + while (this.eat(16)) { + const newNode = this.startNodeAt(startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsxParseAttributeValue() { + let node; + switch (this.state.type) { + case 5: + node = this.startNode(); + this.setContext(types.brace); + this.next(); + node = this.jsxParseExpressionContainer(node, types.j_oTag); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(JsxErrors.AttributeIsEmpty, node); + } + return node; + case 143: + case 134: + return this.parseExprAtom(); + default: + throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); + } + } + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); + } + jsxParseSpreadChild(node) { + this.next(); + node.expression = this.parseExpression(); + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadChild"); + } + jsxParseExpressionContainer(node, previousContext) { + if (this.match(8)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + const expression = this.parseExpression(); + node.expression = expression; + } + this.setContext(previousContext); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsxParseAttribute() { + const node = this.startNode(); + if (this.match(5)) { + this.setContext(types.brace); + this.next(); + this.expect(21); + node.argument = this.parseMaybeAssignAllowIn(); + this.setContext(types.j_oTag); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsxParseOpeningElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXOpeningFragment"); + } + node.name = this.jsxParseElementName(); + return this.jsxParseOpeningElementAfterName(node); + } + jsxParseOpeningElementAfterName(node) { + const attributes = []; + while (!this.match(56) && !this.match(144)) { + attributes.push(this.jsxParseAttribute()); + } + node.attributes = attributes; + node.selfClosing = this.eat(56); + this.expect(144); + return this.finishNode(node, "JSXOpeningElement"); + } + jsxParseClosingElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXClosingFragment"); + } + node.name = this.jsxParseElementName(); + this.expect(144); + return this.finishNode(node, "JSXClosingElement"); + } + jsxParseElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + const children = []; + const openingElement = this.jsxParseOpeningElementAt(startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: for (;;) { + switch (this.state.type) { + case 143: + startLoc = this.state.startLoc; + this.next(); + if (this.eat(56)) { + closingElement = this.jsxParseClosingElementAt(startLoc); + break contents; + } + children.push(this.jsxParseElementAt(startLoc)); + break; + case 142: + children.push(this.parseLiteral(this.state.value, "JSXText")); + break; + case 5: + { + const node = this.startNode(); + this.setContext(types.brace); + this.next(); + if (this.match(21)) { + children.push(this.jsxParseSpreadChild(node)); + } else { + children.push(this.jsxParseExpressionContainer(node, types.j_expr)); + } + break; + } + default: + this.unexpected(); + } + } + if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { + this.raise(JsxErrors.MissingClosingTagFragment, closingElement); + } else if (!isFragment(openingElement) && isFragment(closingElement)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } else if (!isFragment(openingElement) && !isFragment(closingElement)) { + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } + } + } + if (isFragment(openingElement)) { + node.openingFragment = openingElement; + node.closingFragment = closingElement; + } else { + node.openingElement = openingElement; + node.closingElement = closingElement; + } + node.children = children; + if (this.match(47)) { + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); + } + return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); + } + jsxParseElement() { + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startLoc); + } + setContext(newContext) { + const { + context + } = this.state; + context[context.length - 1] = newContext; + } + parseExprAtom(refExpressionErrors) { + if (this.match(143)) { + return this.jsxParseElement(); + } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { + this.replaceToken(143); + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refExpressionErrors); + } + } + skipSpace() { + const curContext = this.curContext(); + if (!curContext.preserveSpace) super.skipSpace(); + } + getTokenFromCode(code) { + const context = this.curContext(); + if (context === types.j_expr) { + this.jsxReadToken(); + return; + } + if (context === types.j_oTag || context === types.j_cTag) { + if (isIdentifierStart(code)) { + this.jsxReadWord(); + return; + } + if (code === 62) { + ++this.state.pos; + this.finishToken(144); + return; + } + if ((code === 34 || code === 39) && context === types.j_oTag) { + this.jsxReadString(code); + return; + } + } + if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { + ++this.state.pos; + this.finishToken(143); + return; + } + super.getTokenFromCode(code); + } + updateContext(prevType) { + const { + context, + type + } = this.state; + if (type === 56 && prevType === 143) { + context.splice(-2, 2, types.j_cTag); + this.state.canStartJSXElement = false; + } else if (type === 143) { + context.push(types.j_oTag); + } else if (type === 144) { + const out = context[context.length - 1]; + if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { + context.pop(); + this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; + } else { + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + } + } else { + this.state.canStartJSXElement = tokenComesBeforeExpression(type); + } + } +}; +class TypeScriptScope extends Scope { + constructor(...args) { + super(...args); + this.tsNames = new Map(); + } +} +class TypeScriptScopeHandler extends ScopeHandler { + constructor(...args) { + super(...args); + this.importsStack = []; + } + createScope(flags) { + this.importsStack.push(new Set()); + return new TypeScriptScope(flags); + } + enter(flags) { + if (flags === 256) { + this.importsStack.push(new Set()); + } + super.enter(flags); + } + exit() { + const flags = super.exit(); + if (flags === 256) { + this.importsStack.pop(); + } + return flags; + } + hasImport(name, allowShadow) { + const len = this.importsStack.length; + if (this.importsStack[len - 1].has(name)) { + return true; + } + if (!allowShadow && len > 1) { + for (let i = 0; i < len - 1; i++) { + if (this.importsStack[i].has(name)) return true; + } + } + return false; + } + declareName(name, bindingType, loc) { + if (bindingType & 4096) { + if (this.hasImport(name, true)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + this.importsStack[this.importsStack.length - 1].add(name); + return; + } + const scope = this.currentScope(); + let type = scope.tsNames.get(name) || 0; + if (bindingType & 1024) { + this.maybeExportDefined(scope, name); + scope.tsNames.set(name, type | 16); + return; + } + super.declareName(name, bindingType, loc); + if (bindingType & 2) { + if (!(bindingType & 1)) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + } + type = type | 1; + } + if (bindingType & 256) { + type = type | 2; + } + if (bindingType & 512) { + type = type | 4; + } + if (bindingType & 128) { + type = type | 8; + } + if (type) scope.tsNames.set(name, type); + } + isRedeclaredInScope(scope, name, bindingType) { + const type = scope.tsNames.get(name); + if ((type & 2) > 0) { + if (bindingType & 256) { + const isConst = !!(bindingType & 512); + const wasConst = (type & 4) > 0; + return isConst !== wasConst; + } + return true; + } + if (bindingType & 128 && (type & 8) > 0) { + if (scope.names.get(name) & 2) { + return !!(bindingType & 1); + } else { + return false; + } + } + if (bindingType & 2 && (type & 1) > 0) { + return true; + } + return super.isRedeclaredInScope(scope, name, bindingType); + } + checkLocalExport(id) { + const { + name + } = id; + if (this.hasImport(name)) return; + const len = this.scopeStack.length; + for (let i = len - 1; i >= 0; i--) { + const scope = this.scopeStack[i]; + const type = scope.tsNames.get(name); + if ((type & 1) > 0 || (type & 16) > 0) { + return; + } + } + super.checkLocalExport(id); + } +} +const unwrapParenthesizedExpression = node => { + return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; +}; +class LValParser extends NodeUtils { + toAssignable(node, isLHS = false) { + var _node$extra, _node$extra3; + let parenthesized = undefined; + if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { + parenthesized = unwrapParenthesizedExpression(node); + if (isLHS) { + if (parenthesized.type === "Identifier") { + this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); + } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } else { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { + var _node$extra2; + const prop = node.properties[i]; + const isLast = i === last; + this.toAssignableObjectExpressionProp(prop, isLast, isLHS); + if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); + } + } + break; + case "ObjectProperty": + { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + break; + } + case "SpreadElement": + { + throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); + } + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(Errors.MissingEqInAssignment, node.left.loc.end); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isLHS); + break; + case "ParenthesizedExpression": + this.toAssignable(parenthesized, isLHS); + break; + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "ObjectMethod") { + this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); + } else if (prop.type === "SpreadElement") { + prop.type = "RestElement"; + const arg = prop.argument; + this.checkToRestConversion(arg, false); + this.toAssignable(arg, isLHS); + if (!isLast) { + this.raise(Errors.RestTrailingComma, prop); + } + } else { + this.toAssignable(prop, isLHS); + } + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + const end = exprList.length - 1; + for (let i = 0; i <= end; i++) { + const elt = exprList[i]; + if (!elt) continue; + if (elt.type === "SpreadElement") { + elt.type = "RestElement"; + const arg = elt.argument; + this.checkToRestConversion(arg, true); + this.toAssignable(arg, isLHS); + } else { + this.toAssignable(elt, isLHS); + } + if (elt.type === "RestElement") { + if (i < end) { + this.raise(Errors.RestTrailingComma, elt); + } else if (trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, trailingCommaLoc); + } + } + } + } + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + return true; + case "ObjectExpression": + { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); + }); + } + case "ObjectProperty": + return this.isAssignable(node.value); + case "SpreadElement": + return this.isAssignable(node.argument); + case "ArrayExpression": + return node.elements.every(element => element === null || this.isAssignable(element)); + case "AssignmentExpression": + return node.operator === "="; + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + default: + return false; + } + } + toReferencedList(exprList, isParenthesizedExpr) { + return exprList; + } + toReferencedListDeep(exprList, isParenthesizedExpr) { + this.toReferencedList(exprList, isParenthesizedExpr); + for (const expr of exprList) { + if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { + this.toReferencedListDeep(expr.elements); + } + } + } + parseSpread(refExpressionErrors) { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); + return this.finishNode(node, "SpreadElement"); + } + parseRestBinding() { + const node = this.startNode(); + this.next(); + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + } + parseBindingAtom() { + switch (this.state.type) { + case 0: + { + const node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(3, 93, 1); + return this.finishNode(node, "ArrayPattern"); + } + case 5: + return this.parseObjectLike(8, true); + } + return this.parseIdentifier(); + } + parseBindingList(close, closeCharCode, flags) { + const allowEmpty = flags & 1; + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + } + if (allowEmpty && this.match(12)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(21)) { + let rest = this.parseRestBinding(); + if (this.hasPlugin("flow") || flags & 2) { + rest = this.parseFunctionParamType(rest); + } + elts.push(rest); + if (!this.checkCommaAfterRest(closeCharCode)) { + this.expect(close); + break; + } + } else { + const decorators = []; + if (this.match(26) && this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + elts.push(this.parseAssignableListItem(flags, decorators)); + } + } + return elts; + } + parseBindingRestProperty(prop) { + this.next(); + prop.argument = this.parseIdentifier(); + this.checkCommaAfterRest(125); + return this.finishNode(prop, "RestElement"); + } + parseBindingProperty() { + const { + type, + startLoc + } = this.state; + if (type === 21) { + return this.parseBindingRestProperty(this.startNode()); + } + const prop = this.startNode(); + if (type === 139) { + this.expectPlugin("destructuringPrivate", startLoc); + this.classScope.usePrivateName(this.state.value, startLoc); + prop.key = this.parsePrivateName(); + } else { + this.parsePropertyName(prop); + } + prop.method = false; + return this.parseObjPropValue(prop, startLoc, false, false, true, false); + } + parseAssignableListItem(flags, decorators) { + const left = this.parseMaybeDefault(); + if (this.hasPlugin("flow") || flags & 2) { + this.parseFunctionParamType(left); + } + const elt = this.parseMaybeDefault(left.loc.start, left); + if (decorators.length) { + left.decorators = decorators; + } + return elt; + } + parseFunctionParamType(param) { + return param; + } + parseMaybeDefault(startLoc, left) { + var _startLoc, _left; + (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; + left = (_left = left) != null ? _left : this.parseBindingAtom(); + if (!this.eat(29)) return left; + const node = this.startNodeAt(startLoc); + node.left = left; + node.right = this.parseMaybeAssignAllowIn(); + return this.finishNode(node, "AssignmentPattern"); + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + switch (type) { + case "AssignmentPattern": + return "left"; + case "RestElement": + return "argument"; + case "ObjectProperty": + return "value"; + case "ParenthesizedExpression": + return "expression"; + case "ArrayPattern": + return "elements"; + case "ObjectPattern": + return "properties"; + } + return false; + } + isOptionalMemberExpression(expression) { + return expression.type === "OptionalMemberExpression"; + } + checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) { + var _expression$extra; + const type = expression.type; + if (this.isObjectMethod(expression)) return; + const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); + if (isOptionalMemberExpression || type === "MemberExpression") { + if (isOptionalMemberExpression) { + this.expectPlugin("optionalChainingAssign", expression.loc.start); + if (ancestor.type !== "AssignmentExpression") { + this.raise(Errors.InvalidLhsOptionalChaining, expression, { + ancestor + }); + } + } + if (binding !== 64) { + this.raise(Errors.InvalidPropertyBindingPattern, expression); + } + return; + } + if (type === "Identifier") { + this.checkIdentifier(expression, binding, strictModeChanged); + const { + name + } = expression; + if (checkClashes) { + if (checkClashes.has(name)) { + this.raise(Errors.ParamDupe, expression); + } else { + checkClashes.add(name); + } + } + return; + } + const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); + if (validity === true) return; + if (validity === false) { + const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; + this.raise(ParseErrorClass, expression, { + ancestor + }); + return; + } + let key, isParenthesizedExpression; + if (typeof validity === "string") { + key = validity; + isParenthesizedExpression = type === "ParenthesizedExpression"; + } else { + [key, isParenthesizedExpression] = validity; + } + const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { + type + } : ancestor; + const val = expression[key]; + if (Array.isArray(val)) { + for (const child of val) { + if (child) { + this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); + } + } + } else if (val) { + this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); + } + } + checkIdentifier(at, bindingType, strictModeChanged = false) { + if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { + if (bindingType === 64) { + this.raise(Errors.StrictEvalArguments, at, { + referenceName: at.name + }); + } else { + this.raise(Errors.StrictEvalArgumentsBinding, at, { + bindingName: at.name + }); + } + } + if (bindingType & 8192 && at.name === "let") { + this.raise(Errors.LetInLexicalBinding, at); + } + if (!(bindingType & 64)) { + this.declareNameFromIdentifier(at, bindingType); + } + } + declareNameFromIdentifier(identifier, binding) { + this.scope.declareName(identifier.name, binding, identifier.loc.start); + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "ParenthesizedExpression": + this.checkToRestConversion(node.expression, allowPattern); + break; + case "Identifier": + case "MemberExpression": + break; + case "ArrayExpression": + case "ObjectExpression": + if (allowPattern) break; + default: + this.raise(Errors.InvalidRestAssignmentPattern, node); + } + } + checkCommaAfterRest(close) { + if (!this.match(12)) { + return false; + } + this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); + return true; + } +} +function nonNull(x) { + if (x == null) { + throw new Error(`Unexpected ${x} value.`); + } + return x; +} +function assert(x) { + if (!x) { + throw new Error("Assert fail"); + } +} +const TSErrors = ParseErrorEnum`typescript`({ + AbstractMethodHasImplementation: ({ + methodName + }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, + AbstractPropertyHasInitializer: ({ + propertyName + }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, + AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", + AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", + AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.", + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", + ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", + ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", + ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", + DeclareAccessor: ({ + kind + }) => `'declare' is not allowed in ${kind}ters.`, + DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", + DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", + DuplicateAccessibilityModifier: ({ + modifier + }) => `Accessibility modifier already seen.`, + DuplicateModifier: ({ + modifier + }) => `Duplicate modifier: '${modifier}'.`, + EmptyHeritageClauseType: ({ + token + }) => `'${token}' list cannot be empty.`, + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", + ImportAliasHasImportType: "An import alias can not use 'import type'.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", + IncompatibleModifiers: ({ + modifiers + }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, + IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", + IndexSignatureHasAccessibility: ({ + modifier + }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, + IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", + IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", + IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", + InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", + InvalidModifierOnTypeMember: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type member.`, + InvalidModifierOnTypeParameter: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type parameter.`, + InvalidModifierOnTypeParameterPositions: ({ + modifier + }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + InvalidModifiersOrder: ({ + orderedModifiers + }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, + InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", + InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", + MissingInterfaceName: "'interface' declarations must be followed by an identifier.", + NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", + NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", + OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", + OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", + PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", + PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", + PrivateElementHasAccessibility: ({ + modifier + }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, + ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", + ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", + ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", + SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", + SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", + SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", + SingleTypeParameterWithoutTrailingComma: ({ + typeParameterName + }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, + StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", + TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", + TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", + TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", + TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", + UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", + UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", + UnexpectedTypeAnnotation: "Did not expect a type annotation here.", + UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", + UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", + UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", + UnsupportedSignatureParameterKind: ({ + type + }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` +}); +function keywordTypeFromName(value) { + switch (value) { + case "any": + return "TSAnyKeyword"; + case "boolean": + return "TSBooleanKeyword"; + case "bigint": + return "TSBigIntKeyword"; + case "never": + return "TSNeverKeyword"; + case "number": + return "TSNumberKeyword"; + case "object": + return "TSObjectKeyword"; + case "string": + return "TSStringKeyword"; + case "symbol": + return "TSSymbolKeyword"; + case "undefined": + return "TSUndefinedKeyword"; + case "unknown": + return "TSUnknownKeyword"; + default: + return undefined; + } +} +function tsIsAccessModifier(modifier) { + return modifier === "private" || modifier === "public" || modifier === "protected"; +} +function tsIsVarianceAnnotations(modifier) { + return modifier === "in" || modifier === "out"; +} +var typescript = superClass => class TypeScriptParserMixin extends superClass { + constructor(...args) { + super(...args); + this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out"], + disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + this.tsParseConstModifier = this.tsParseModifiers.bind(this, { + allowedModifiers: ["const"], + disallowedModifiers: ["in", "out"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }); + this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out", "const"], + disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + } + getScopeHandler() { + return TypeScriptScopeHandler; + } + tsIsIdentifier() { + return tokenIsIdentifier(this.state.type); + } + tsTokenCanFollowModifier() { + return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName(); + } + tsNextTokenOnSameLineAndCanFollowModifier() { + this.next(); + if (this.hasPrecedingLineBreak()) { + return false; + } + return this.tsTokenCanFollowModifier(); + } + tsNextTokenCanFollowModifier() { + if (this.match(106)) { + this.next(); + return this.tsTokenCanFollowModifier(); + } + return this.tsNextTokenOnSameLineAndCanFollowModifier(); + } + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { + if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { + return undefined; + } + const modifier = this.state.value; + if (allowedModifiers.includes(modifier)) { + if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { + return undefined; + } + if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { + return modifier; + } + } + return undefined; + } + tsParseModifiers({ + allowedModifiers, + disallowedModifiers, + stopOnStartOfClassStaticBlock, + errorTemplate = TSErrors.InvalidModifierOnTypeMember + }, modified) { + const enforceOrder = (loc, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise(TSErrors.InvalidModifiersOrder, loc, { + orderedModifiers: [before, after] + }); + } + }; + const incompatible = (loc, modifier, mod1, mod2) => { + if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { + this.raise(TSErrors.IncompatibleModifiers, loc, { + modifiers: [mod1, mod2] + }); + } + }; + for (;;) { + const { + startLoc + } = this.state; + const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); + if (!modifier) break; + if (tsIsAccessModifier(modifier)) { + if (modified.accessibility) { + this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, modifier, "override"); + enforceOrder(startLoc, modifier, modifier, "static"); + enforceOrder(startLoc, modifier, modifier, "readonly"); + modified.accessibility = modifier; + } + } else if (tsIsVarianceAnnotations(modifier)) { + if (modified[modifier]) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } + modified[modifier] = true; + enforceOrder(startLoc, modifier, "in", "out"); + } else { + if (hasOwnProperty.call(modified, modifier)) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, "static", "readonly"); + enforceOrder(startLoc, modifier, "static", "override"); + enforceOrder(startLoc, modifier, "override", "readonly"); + enforceOrder(startLoc, modifier, "abstract", "override"); + incompatible(startLoc, modifier, "declare", "override"); + incompatible(startLoc, modifier, "static", "abstract"); + } + modified[modifier] = true; + } + if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { + this.raise(errorTemplate, startLoc, { + modifier + }); + } + } + } + tsIsListTerminator(kind) { + switch (kind) { + case "EnumMembers": + case "TypeMembers": + return this.match(8); + case "HeritageClauseElement": + return this.match(5); + case "TupleElementTypes": + return this.match(3); + case "TypeParametersOrArguments": + return this.match(48); + } + } + tsParseList(kind, parseElement) { + const result = []; + while (!this.tsIsListTerminator(kind)) { + result.push(parseElement()); + } + return result; + } + tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { + return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); + } + tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { + const result = []; + let trailingCommaPos = -1; + for (;;) { + if (this.tsIsListTerminator(kind)) { + break; + } + trailingCommaPos = -1; + const element = parseElement(); + if (element == null) { + return undefined; + } + result.push(element); + if (this.eat(12)) { + trailingCommaPos = this.state.lastTokStartLoc.index; + continue; + } + if (this.tsIsListTerminator(kind)) { + break; + } + if (expectSuccess) { + this.expect(12); + } + return undefined; + } + if (refTrailingCommaPos) { + refTrailingCommaPos.value = trailingCommaPos; + } + return result; + } + tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { + if (!skipFirstToken) { + if (bracket) { + this.expect(0); + } else { + this.expect(47); + } + } + const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); + if (bracket) { + this.expect(3); + } else { + this.expect(48); + } + return result; + } + tsParseImportType() { + const node = this.startNode(); + this.expect(83); + this.expect(10); + if (!this.match(134)) { + this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); + } + node.argument = super.parseExprAtom(); + if (this.eat(12) && !this.match(11)) { + node.options = super.parseMaybeAssignAllowIn(); + this.eat(12); + } else { + node.options = null; + } + this.expect(11); + if (this.eat(16)) { + node.qualifier = this.tsParseEntityName(); + } + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSImportType"); + } + tsParseEntityName(allowReservedWords = true) { + let entity = this.parseIdentifier(allowReservedWords); + while (this.eat(16)) { + const node = this.startNodeAtNode(entity); + node.left = entity; + node.right = this.parseIdentifier(allowReservedWords); + entity = this.finishNode(node, "TSQualifiedName"); + } + return entity; + } + tsParseTypeReference() { + const node = this.startNode(); + node.typeName = this.tsParseEntityName(); + if (!this.hasPrecedingLineBreak() && this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeReference"); + } + tsParseThisTypePredicate(lhs) { + this.next(); + const node = this.startNodeAtNode(lhs); + node.parameterName = lhs; + node.typeAnnotation = this.tsParseTypeAnnotation(false); + node.asserts = false; + return this.finishNode(node, "TSTypePredicate"); + } + tsParseThisTypeNode() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSThisType"); + } + tsParseTypeQuery() { + const node = this.startNode(); + this.expect(87); + if (this.match(83)) { + node.exprName = this.tsParseImportType(); + } else { + node.exprName = this.tsParseEntityName(); + } + if (!this.hasPrecedingLineBreak() && this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeQuery"); + } + tsParseTypeParameter(parseModifiers) { + const node = this.startNode(); + parseModifiers(node); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsEatThenParseType(81); + node.default = this.tsEatThenParseType(29); + return this.finishNode(node, "TSTypeParameter"); + } + tsTryParseTypeParameters(parseModifiers) { + if (this.match(47)) { + return this.tsParseTypeParameters(parseModifiers); + } + } + tsParseTypeParameters(parseModifiers) { + const node = this.startNode(); + if (this.match(47) || this.match(143)) { + this.next(); + } else { + this.unexpected(); + } + const refTrailingCommaPos = { + value: -1 + }; + node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeParameters, node); + } + if (refTrailingCommaPos.value !== -1) { + this.addExtra(node, "trailingComma", refTrailingCommaPos.value); + } + return this.finishNode(node, "TSTypeParameterDeclaration"); + } + tsFillSignature(returnToken, signature) { + const returnTokenRequired = returnToken === 19; + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + this.expect(10); + signature[paramsKey] = this.tsParseBindingListForSignature(); + if (returnTokenRequired) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (this.match(returnToken)) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } + } + tsParseBindingListForSignature() { + const list = super.parseBindingList(11, 41, 2); + for (const pattern of list) { + const { + type + } = pattern; + if (type === "AssignmentPattern" || type === "TSParameterProperty") { + this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { + type + }); + } + } + return list; + } + tsParseTypeMemberSemicolon() { + if (!this.eat(12) && !this.isLineTerminator()) { + this.expect(13); + } + } + tsParseSignatureMember(kind, node) { + this.tsFillSignature(14, node); + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, kind); + } + tsIsUnambiguouslyIndexSignature() { + this.next(); + if (tokenIsIdentifier(this.state.type)) { + this.next(); + return this.match(14); + } + return false; + } + tsTryParseIndexSignature(node) { + if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { + return; + } + this.expect(0); + const id = this.parseIdentifier(); + id.typeAnnotation = this.tsParseTypeAnnotation(); + this.resetEndLocation(id); + this.expect(3); + node.parameters = [id]; + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, "TSIndexSignature"); + } + tsParsePropertyOrMethodSignature(node, readonly) { + if (this.eat(17)) node.optional = true; + const nodeAny = node; + if (this.match(10) || this.match(47)) { + if (readonly) { + this.raise(TSErrors.ReadonlyForMethodSignature, node); + } + const method = nodeAny; + if (method.kind && this.match(47)) { + this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); + } + this.tsFillSignature(14, method); + this.tsParseTypeMemberSemicolon(); + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + if (method.kind === "get") { + if (method[paramsKey].length > 0) { + this.raise(Errors.BadGetterArity, this.state.curPosition()); + if (this.isThisParam(method[paramsKey][0])) { + this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); + } + } + } else if (method.kind === "set") { + if (method[paramsKey].length !== 1) { + this.raise(Errors.BadSetterArity, this.state.curPosition()); + } else { + const firstParameter = method[paramsKey][0]; + if (this.isThisParam(firstParameter)) { + this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); + } + if (firstParameter.type === "Identifier" && firstParameter.optional) { + this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()); + } + if (firstParameter.type === "RestElement") { + this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition()); + } + } + if (method[returnTypeKey]) { + this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]); + } + } else { + method.kind = "method"; + } + return this.finishNode(method, "TSMethodSignature"); + } else { + const property = nodeAny; + if (readonly) property.readonly = true; + const type = this.tsTryParseTypeAnnotation(); + if (type) property.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(property, "TSPropertySignature"); + } + } + tsParseTypeMember() { + const node = this.startNode(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); + } + if (this.match(77)) { + const id = this.startNode(); + this.next(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); + } else { + node.key = this.createIdentifier(id, "new"); + return this.tsParsePropertyOrMethodSignature(node, false); + } + } + this.tsParseModifiers({ + allowedModifiers: ["readonly"], + disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] + }, node); + const idx = this.tsTryParseIndexSignature(node); + if (idx) { + return idx; + } + super.parsePropertyName(node); + if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { + node.kind = node.key.name; + super.parsePropertyName(node); + } + return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); + } + tsParseTypeLiteral() { + const node = this.startNode(); + node.members = this.tsParseObjectTypeMembers(); + return this.finishNode(node, "TSTypeLiteral"); + } + tsParseObjectTypeMembers() { + this.expect(5); + const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.expect(8); + return members; + } + tsIsStartOfMappedType() { + this.next(); + if (this.eat(53)) { + return this.isContextual(122); + } + if (this.isContextual(122)) { + this.next(); + } + if (!this.match(0)) { + return false; + } + this.next(); + if (!this.tsIsIdentifier()) { + return false; + } + this.next(); + return this.match(58); + } + tsParseMappedType() { + const node = this.startNode(); + this.expect(5); + if (this.match(53)) { + node.readonly = this.state.value; + this.next(); + this.expectContextual(122); + } else if (this.eatContextual(122)) { + node.readonly = true; + } + this.expect(0); + { + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsExpectThenParseType(58); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + } + node.nameType = this.eatContextual(93) ? this.tsParseType() : null; + this.expect(3); + if (this.match(53)) { + node.optional = this.state.value; + this.next(); + this.expect(17); + } else if (this.eat(17)) { + node.optional = true; + } + node.typeAnnotation = this.tsTryParseType(); + this.semicolon(); + this.expect(8); + return this.finishNode(node, "TSMappedType"); + } + tsParseTupleType() { + const node = this.startNode(); + node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); + let seenOptionalElement = false; + node.elementTypes.forEach(elementNode => { + const { + type + } = elementNode; + if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { + this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); + } + seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); + }); + return this.finishNode(node, "TSTupleType"); + } + tsParseTupleElementType() { + const { + startLoc + } = this.state; + const rest = this.eat(21); + let labeled; + let label; + let optional; + let type; + const isWord = tokenIsKeywordOrIdentifier(this.state.type); + const chAfterWord = isWord ? this.lookaheadCharCode() : null; + if (chAfterWord === 58) { + labeled = true; + optional = false; + label = this.parseIdentifier(true); + this.expect(14); + type = this.tsParseType(); + } else if (chAfterWord === 63) { + optional = true; + const startLoc = this.state.startLoc; + const wordName = this.state.value; + const typeOrLabel = this.tsParseNonArrayType(); + if (this.lookaheadCharCode() === 58) { + labeled = true; + label = this.createIdentifier(this.startNodeAt(startLoc), wordName); + this.expect(17); + this.expect(14); + type = this.tsParseType(); + } else { + labeled = false; + type = typeOrLabel; + this.expect(17); + } + } else { + type = this.tsParseType(); + optional = this.eat(17); + labeled = this.eat(14); + } + if (labeled) { + let labeledNode; + if (label) { + labeledNode = this.startNodeAtNode(label); + labeledNode.optional = optional; + labeledNode.label = label; + labeledNode.elementType = type; + if (this.eat(17)) { + labeledNode.optional = true; + this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); + } + } else { + labeledNode = this.startNodeAtNode(type); + labeledNode.optional = optional; + this.raise(TSErrors.InvalidTupleMemberLabel, type); + labeledNode.label = type; + labeledNode.elementType = this.tsParseType(); + } + type = this.finishNode(labeledNode, "TSNamedTupleMember"); + } else if (optional) { + const optionalTypeNode = this.startNodeAtNode(type); + optionalTypeNode.typeAnnotation = type; + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + if (rest) { + const restNode = this.startNodeAt(startLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); + } + return type; + } + tsParseParenthesizedType() { + const node = this.startNode(); + this.expect(10); + node.typeAnnotation = this.tsParseType(); + this.expect(11); + return this.finishNode(node, "TSParenthesizedType"); + } + tsParseFunctionOrConstructorType(type, abstract) { + const node = this.startNode(); + if (type === "TSConstructorType") { + node.abstract = !!abstract; + if (abstract) this.next(); + this.next(); + } + this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); + return this.finishNode(node, type); + } + tsParseLiteralTypeNode() { + const node = this.startNode(); + switch (this.state.type) { + case 135: + case 136: + case 134: + case 85: + case 86: + node.literal = super.parseExprAtom(); + break; + default: + this.unexpected(); + } + return this.finishNode(node, "TSLiteralType"); + } + tsParseTemplateLiteralType() { + const node = this.startNode(); + node.literal = super.parseTemplate(false); + return this.finishNode(node, "TSLiteralType"); + } + parseTemplateSubstitution() { + if (this.state.inType) return this.tsParseType(); + return super.parseTemplateSubstitution(); + } + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + tsParseNonArrayType() { + switch (this.state.type) { + case 134: + case 135: + case 136: + case 85: + case 86: + return this.tsParseLiteralTypeNode(); + case 53: + if (this.state.value === "-") { + const node = this.startNode(); + const nextToken = this.lookahead(); + if (nextToken.type !== 135 && nextToken.type !== 136) { + this.unexpected(); + } + node.literal = this.parseMaybeUnary(); + return this.finishNode(node, "TSLiteralType"); + } + break; + case 78: + return this.tsParseThisTypeOrThisTypePredicate(); + case 87: + return this.tsParseTypeQuery(); + case 83: + return this.tsParseImportType(); + case 5: + return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); + case 0: + return this.tsParseTupleType(); + case 10: + return this.tsParseParenthesizedType(); + case 25: + case 24: + return this.tsParseTemplateLiteralType(); + default: + { + const { + type + } = this.state; + if (tokenIsIdentifier(type) || type === 88 || type === 84) { + const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); + if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, nodeType); + } + return this.tsParseTypeReference(); + } + } + } + this.unexpected(); + } + tsParseArrayTypeOrHigher() { + let type = this.tsParseNonArrayType(); + while (!this.hasPrecedingLineBreak() && this.eat(0)) { + if (this.match(3)) { + const node = this.startNodeAtNode(type); + node.elementType = type; + this.expect(3); + type = this.finishNode(node, "TSArrayType"); + } else { + const node = this.startNodeAtNode(type); + node.objectType = type; + node.indexType = this.tsParseType(); + this.expect(3); + type = this.finishNode(node, "TSIndexedAccessType"); + } + } + return type; + } + tsParseTypeOperator() { + const node = this.startNode(); + const operator = this.state.value; + this.next(); + node.operator = operator; + node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); + if (operator === "readonly") { + this.tsCheckTypeAnnotationForReadOnly(node); + } + return this.finishNode(node, "TSTypeOperator"); + } + tsCheckTypeAnnotationForReadOnly(node) { + switch (node.typeAnnotation.type) { + case "TSTupleType": + case "TSArrayType": + return; + default: + this.raise(TSErrors.UnexpectedReadonly, node); + } + } + tsParseInferType() { + const node = this.startNode(); + this.expectContextual(115); + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + return this.finishNode(node, "TSInferType"); + } + tsParseConstraintForInferType() { + if (this.eat(81)) { + const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); + if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { + return constraint; + } + } + } + tsParseTypeOperatorOrHigher() { + const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); + } + tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { + const node = this.startNode(); + const hasLeadingOperator = this.eat(operator); + const types = []; + do { + types.push(parseConstituentType()); + } while (this.eat(operator)); + if (types.length === 1 && !hasLeadingOperator) { + return types[0]; + } + node.types = types; + return this.finishNode(node, kind); + } + tsParseIntersectionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); + } + tsParseUnionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); + } + tsIsStartOfFunctionType() { + if (this.match(47)) { + return true; + } + return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); + } + tsSkipParameterStart() { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + this.next(); + return true; + } + if (this.match(5)) { + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + this.parseObjectLike(8, true); + return errors.length === previousErrorCount; + } catch (_unused) { + return false; + } + } + if (this.match(0)) { + this.next(); + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + super.parseBindingList(3, 93, 1); + return errors.length === previousErrorCount; + } catch (_unused2) { + return false; + } + } + return false; + } + tsIsUnambiguouslyStartOfFunctionType() { + this.next(); + if (this.match(11) || this.match(21)) { + return true; + } + if (this.tsSkipParameterStart()) { + if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { + return true; + } + if (this.match(11)) { + this.next(); + if (this.match(19)) { + return true; + } + } + } + return false; + } + tsParseTypeOrTypePredicateAnnotation(returnToken) { + return this.tsInType(() => { + const t = this.startNode(); + this.expect(returnToken); + const node = this.startNode(); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + if (asserts && this.match(78)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + if (thisTypePredicate.type === "TSThisType") { + node.parameterName = thisTypePredicate; + node.asserts = true; + node.typeAnnotation = null; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + this.resetStartLocationFromNode(thisTypePredicate, node); + thisTypePredicate.asserts = true; + } + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); + if (!typePredicateVariable) { + if (!asserts) { + return this.tsParseTypeAnnotation(false, t); + } + node.parameterName = this.parseIdentifier(); + node.asserts = asserts; + node.typeAnnotation = null; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + } + const type = this.tsParseTypeAnnotation(false); + node.parameterName = typePredicateVariable; + node.typeAnnotation = type; + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + }); + } + tsTryParseTypeOrTypePredicateAnnotation() { + if (this.match(14)) { + return this.tsParseTypeOrTypePredicateAnnotation(14); + } + } + tsTryParseTypeAnnotation() { + if (this.match(14)) { + return this.tsParseTypeAnnotation(); + } + } + tsTryParseType() { + return this.tsEatThenParseType(14); + } + tsParseTypePredicatePrefix() { + const id = this.parseIdentifier(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + this.next(); + return id; + } + } + tsParseTypePredicateAsserts() { + if (this.state.type !== 109) { + return false; + } + const containsEsc = this.state.containsEsc; + this.next(); + if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { + return false; + } + if (containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { + reservedWord: "asserts" + }); + } + return true; + } + tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { + this.tsInType(() => { + if (eatColon) this.expect(14); + t.typeAnnotation = this.tsParseType(); + }); + return this.finishNode(t, "TSTypeAnnotation"); + } + tsParseType() { + assert(this.state.inType); + const type = this.tsParseNonConditionalType(); + if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { + return type; + } + const node = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); + this.expect(17); + node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + this.expect(14); + node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + return this.finishNode(node, "TSConditionalType"); + } + isAbstractConstructorSignature() { + return this.isContextual(124) && this.lookahead().type === 77; + } + tsParseNonConditionalType() { + if (this.tsIsStartOfFunctionType()) { + return this.tsParseFunctionOrConstructorType("TSFunctionType"); + } + if (this.match(77)) { + return this.tsParseFunctionOrConstructorType("TSConstructorType"); + } else if (this.isAbstractConstructorSignature()) { + return this.tsParseFunctionOrConstructorType("TSConstructorType", true); + } + return this.tsParseUnionTypeOrHigher(); + } + tsParseTypeAssertion() { + if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); + } + const node = this.startNode(); + node.typeAnnotation = this.tsInType(() => { + this.next(); + return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); + }); + this.expect(48); + node.expression = this.parseMaybeUnary(); + return this.finishNode(node, "TSTypeAssertion"); + } + tsParseHeritageClause(token) { + const originalStartLoc = this.state.startLoc; + const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { + const node = this.startNode(); + node.expression = this.tsParseEntityName(); + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSExpressionWithTypeArguments"); + }); + if (!delimitedList.length) { + this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { + token + }); + } + return delimitedList; + } + tsParseInterfaceDeclaration(node, properties = {}) { + if (this.hasFollowingLineBreak()) return null; + this.expectContextual(129); + if (properties.declare) node.declare = true; + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 130); + } else { + node.id = null; + this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); + } + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (this.eat(81)) { + node.extends = this.tsParseHeritageClause("extends"); + } + const body = this.startNode(); + body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); + node.body = this.finishNode(body, "TSInterfaceBody"); + return this.finishNode(node, "TSInterfaceDeclaration"); + } + tsParseTypeAliasDeclaration(node) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 2); + node.typeAnnotation = this.tsInType(() => { + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); + this.expect(29); + if (this.isContextual(114) && this.lookahead().type !== 16) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSIntrinsicKeyword"); + } + return this.tsParseType(); + }); + this.semicolon(); + return this.finishNode(node, "TSTypeAliasDeclaration"); + } + tsInNoContext(cb) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } + tsInType(cb) { + const oldInType = this.state.inType; + this.state.inType = true; + try { + return cb(); + } finally { + this.state.inType = oldInType; + } + } + tsInDisallowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = true; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsInAllowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = false; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsEatThenParseType(token) { + if (this.match(token)) { + return this.tsNextThenParseType(); + } + } + tsExpectThenParseType(token) { + return this.tsInType(() => { + this.expect(token); + return this.tsParseType(); + }); + } + tsNextThenParseType() { + return this.tsInType(() => { + this.next(); + return this.tsParseType(); + }); + } + tsParseEnumMember() { + const node = this.startNode(); + node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); + if (this.eat(29)) { + node.initializer = super.parseMaybeAssignAllowIn(); + } + return this.finishNode(node, "TSEnumMember"); + } + tsParseEnumDeclaration(node, properties = {}) { + if (properties.const) node.const = true; + if (properties.declare) node.declare = true; + this.expectContextual(126); + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, node.const ? 8971 : 8459); + this.expect(5); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(8); + return this.finishNode(node, "TSEnumDeclaration"); + } + tsParseModuleBlock() { + const node = this.startNode(); + this.scope.enter(0); + this.expect(5); + super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); + this.scope.exit(); + return this.finishNode(node, "TSModuleBlock"); + } + tsParseModuleOrNamespaceDeclaration(node, nested = false) { + node.id = this.parseIdentifier(); + if (!nested) { + this.checkIdentifier(node.id, 1024); + } + if (this.eat(16)) { + const inner = this.startNode(); + this.tsParseModuleOrNamespaceDeclaration(inner, true); + node.body = inner; + } else { + this.scope.enter(256); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseAmbientExternalModuleDeclaration(node) { + if (this.isContextual(112)) { + node.kind = "global"; + { + node.global = true; + } + node.id = this.parseIdentifier(); + } else if (this.match(134)) { + node.kind = "module"; + node.id = super.parseStringLiteral(this.state.value); + } else { + this.unexpected(); + } + if (this.match(5)) { + this.scope.enter(256); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } else { + this.semicolon(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { + node.isExport = isExport || false; + node.id = maybeDefaultIdentifier || this.parseIdentifier(); + this.checkIdentifier(node.id, 4096); + this.expect(29); + const moduleReference = this.tsParseModuleReference(); + if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { + this.raise(TSErrors.ImportAliasHasImportType, moduleReference); + } + node.moduleReference = moduleReference; + this.semicolon(); + return this.finishNode(node, "TSImportEqualsDeclaration"); + } + tsIsExternalModuleReference() { + return this.isContextual(119) && this.lookaheadCharCode() === 40; + } + tsParseModuleReference() { + return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); + } + tsParseExternalModuleReference() { + const node = this.startNode(); + this.expectContextual(119); + this.expect(10); + if (!this.match(134)) { + this.unexpected(); + } + node.expression = super.parseExprAtom(); + this.expect(11); + this.sawUnambiguousESM = true; + return this.finishNode(node, "TSExternalModuleReference"); + } + tsLookAhead(f) { + const state = this.state.clone(); + const res = f(); + this.state = state; + return res; + } + tsTryParseAndCatch(f) { + const result = this.tryParse(abort => f() || abort()); + if (result.aborted || !result.node) return; + if (result.error) this.state = result.failState; + return result.node; + } + tsTryParse(f) { + const state = this.state.clone(); + const result = f(); + if (result !== undefined && result !== false) { + return result; + } + this.state = state; + } + tsTryParseDeclare(nany) { + if (this.isLineTerminator()) { + return; + } + let startType = this.state.type; + let kind; + if (this.isContextual(100)) { + startType = 74; + kind = "let"; + } + return this.tsInAmbientContext(() => { + switch (startType) { + case 68: + nany.declare = true; + return super.parseFunctionStatement(nany, false, false); + case 80: + nany.declare = true; + return this.parseClass(nany, true, false); + case 126: + return this.tsParseEnumDeclaration(nany, { + declare: true + }); + case 112: + return this.tsParseAmbientExternalModuleDeclaration(nany); + case 75: + case 74: + if (!this.match(75) || !this.isLookaheadContextual("enum")) { + nany.declare = true; + return this.parseVarStatement(nany, kind || this.state.value, true); + } + this.expect(75); + return this.tsParseEnumDeclaration(nany, { + const: true, + declare: true + }); + case 129: + { + const result = this.tsParseInterfaceDeclaration(nany, { + declare: true + }); + if (result) return result; + } + default: + if (tokenIsIdentifier(startType)) { + return this.tsParseDeclaration(nany, this.state.value, true, null); + } + } + }); + } + tsTryParseExportDeclaration() { + return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); + } + tsParseExpressionStatement(node, expr, decorators) { + switch (expr.name) { + case "declare": + { + const declaration = this.tsTryParseDeclare(node); + if (declaration) { + declaration.declare = true; + } + return declaration; + } + case "global": + if (this.match(5)) { + this.scope.enter(256); + this.prodParam.enter(0); + const mod = node; + mod.kind = "global"; + { + node.global = true; + } + mod.id = expr; + mod.body = this.tsParseModuleBlock(); + this.scope.exit(); + this.prodParam.exit(); + return this.finishNode(mod, "TSModuleDeclaration"); + } + break; + default: + return this.tsParseDeclaration(node, expr.name, false, decorators); + } + } + tsParseDeclaration(node, value, next, decorators) { + switch (value) { + case "abstract": + if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { + return this.tsParseAbstractDeclaration(node, decorators); + } + break; + case "module": + if (this.tsCheckLineTerminator(next)) { + if (this.match(134)) { + return this.tsParseAmbientExternalModuleDeclaration(node); + } else if (tokenIsIdentifier(this.state.type)) { + node.kind = "module"; + return this.tsParseModuleOrNamespaceDeclaration(node); + } + } + break; + case "namespace": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + node.kind = "namespace"; + return this.tsParseModuleOrNamespaceDeclaration(node); + } + break; + case "type": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseTypeAliasDeclaration(node); + } + break; + } + } + tsCheckLineTerminator(next) { + if (next) { + if (this.hasFollowingLineBreak()) return false; + this.next(); + return true; + } + return !this.isLineTerminator(); + } + tsTryParseGenericAsyncArrowFunction(startLoc) { + if (!this.match(47)) return; + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = true; + const res = this.tsTryParseAndCatch(() => { + const node = this.startNodeAt(startLoc); + node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + super.parseFunctionParams(node); + node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); + this.expect(19); + return node; + }); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + if (!res) return; + return super.parseArrowExpression(res, null, true); + } + tsParseTypeArgumentsInExpression() { + if (this.reScan_lt() !== 47) return; + return this.tsParseTypeArguments(); + } + tsParseTypeArguments() { + const node = this.startNode(); + node.params = this.tsInType(() => this.tsInNoContext(() => { + this.expect(47); + return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); + })); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeArguments, node); + } else if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); + } + this.expect(48); + return this.finishNode(node, "TSTypeParameterInstantiation"); + } + tsIsDeclarationStart() { + return tokenIsTSDeclarationStart(this.state.type); + } + isExportDefaultSpecifier() { + if (this.tsIsDeclarationStart()) return false; + return super.isExportDefaultSpecifier(); + } + parseAssignableListItem(flags, decorators) { + const startLoc = this.state.startLoc; + const modified = {}; + this.tsParseModifiers({ + allowedModifiers: ["public", "private", "protected", "override", "readonly"] + }, modified); + const accessibility = modified.accessibility; + const override = modified.override; + const readonly = modified.readonly; + if (!(flags & 4) && (accessibility || readonly || override)) { + this.raise(TSErrors.UnexpectedParameterModifier, startLoc); + } + const left = this.parseMaybeDefault(); + if (flags & 2) { + this.parseFunctionParamType(left); + } + const elt = this.parseMaybeDefault(left.loc.start, left); + if (accessibility || readonly || override) { + const pp = this.startNodeAt(startLoc); + if (decorators.length) { + pp.decorators = decorators; + } + if (accessibility) pp.accessibility = accessibility; + if (readonly) pp.readonly = readonly; + if (override) pp.override = override; + if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { + this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); + } + pp.parameter = elt; + return this.finishNode(pp, "TSParameterProperty"); + } + if (decorators.length) { + left.decorators = decorators; + } + return elt; + } + isSimpleParameter(node) { + return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); + } + tsDisallowOptionalPattern(node) { + for (const param of node.params) { + if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { + this.raise(TSErrors.PatternIsOptional, param); + } + } + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + super.setArrowFunctionParameters(node, params, trailingCommaLoc); + this.tsDisallowOptionalPattern(node); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + } + const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; + if (bodilessType && !this.match(5) && this.isLineTerminator()) { + return this.finishNode(node, bodilessType); + } + if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { + this.raise(TSErrors.DeclareFunctionHasImplementation, node); + if (node.declare) { + return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); + } + } + this.tsDisallowOptionalPattern(node); + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + registerFunctionStatementId(node) { + if (!node.body && node.id) { + this.checkIdentifier(node.id, 1024); + } else { + super.registerFunctionStatementId(node); + } + } + tsCheckForInvalidTypeCasts(items) { + items.forEach(node => { + if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { + this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); + } + }); + } + toReferencedList(exprList, isInParens) { + this.tsCheckForInvalidTypeCasts(exprList); + return exprList; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + if (node.type === "ArrayExpression") { + this.tsCheckForInvalidTypeCasts(node.elements); + } + return node; + } + parseSubscript(base, startLoc, noCalls, state) { + if (!this.hasPrecedingLineBreak() && this.match(35)) { + this.state.canStartJSXElement = false; + this.next(); + const nonNullExpression = this.startNodeAt(startLoc); + nonNullExpression.expression = base; + return this.finishNode(nonNullExpression, "TSNonNullExpression"); + } + let isOptionalCall = false; + if (this.match(18) && this.lookaheadCharCode() === 60) { + if (noCalls) { + state.stop = true; + return base; + } + state.optionalChainMember = isOptionalCall = true; + this.next(); + } + if (this.match(47) || this.match(51)) { + let missingParenErrorLoc; + const result = this.tsTryParseAndCatch(() => { + if (!noCalls && this.atPossibleAsyncArrow(base)) { + const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); + if (asyncArrowFn) { + return asyncArrowFn; + } + } + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (!typeArguments) return; + if (isOptionalCall && !this.match(10)) { + missingParenErrorLoc = this.state.curPosition(); + return; + } + if (tokenIsTemplate(this.state.type)) { + const result = super.parseTaggedTemplateExpression(base, startLoc, state); + result.typeParameters = typeArguments; + return result; + } + if (!noCalls && this.eat(10)) { + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(11); + this.tsCheckForInvalidTypeCasts(node.arguments); + node.typeParameters = typeArguments; + if (state.optionalChainMember) { + node.optional = isOptionalCall; + } + return this.finishCallExpression(node, state.optionalChainMember); + } + const tokenType = this.state.type; + if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { + return; + } + const node = this.startNodeAt(startLoc); + node.expression = base; + node.typeParameters = typeArguments; + return this.finishNode(node, "TSInstantiationExpression"); + }); + if (missingParenErrorLoc) { + this.unexpected(missingParenErrorLoc, 10); + } + if (result) { + if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { + this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); + } + return result; + } + } + return super.parseSubscript(base, startLoc, noCalls, state); + } + parseNewCallee(node) { + var _callee$extra; + super.parseNewCallee(node); + const { + callee + } = node; + if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { + node.typeParameters = callee.typeParameters; + node.callee = callee.expression; + } + } + parseExprOp(left, leftStartLoc, minPrec) { + let isSatisfies; + if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { + const node = this.startNodeAt(leftStartLoc); + node.expression = left; + node.typeAnnotation = this.tsInType(() => { + this.next(); + if (this.match(75)) { + if (isSatisfies) { + this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { + keyword: "const" + }); + } + return this.tsParseTypeReference(); + } + return this.tsParseType(); + }); + this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartLoc, minPrec); + } + return super.parseExprOp(left, leftStartLoc, minPrec); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (!this.state.isAmbientContext) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + checkDuplicateExports() {} + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + const ch = this.lookaheadCharCode(); + return isExport ? ch === 123 || ch === 42 : ch !== 61; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + node.exportKind = phase === "type" ? "type" : "value"; + } else { + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImport(node) { + if (this.match(134)) { + node.importKind = "value"; + return super.parseImport(node); + } + let importNode; + if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { + node.importKind = "value"; + return this.tsParseImportEqualsDeclaration(node); + } else if (this.isContextual(130)) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); + if (this.lookaheadCharCode() === 61) { + return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); + } else { + importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); + } + } else { + importNode = super.parseImport(node); + } + if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { + this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); + } + return importNode; + } + parseExport(node, decorators) { + if (this.match(83)) { + this.next(); + const nodeImportEquals = node; + let maybeDefaultIdentifier = null; + if (this.isContextual(130) && this.isPotentialImportPhase(false)) { + maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false); + } else { + nodeImportEquals.importKind = "value"; + } + return this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true); + } else if (this.eat(29)) { + const assign = node; + assign.expression = super.parseExpression(); + this.semicolon(); + this.sawUnambiguousESM = true; + return this.finishNode(assign, "TSExportAssignment"); + } else if (this.eatContextual(93)) { + const decl = node; + this.expectContextual(128); + decl.id = this.parseIdentifier(); + this.semicolon(); + return this.finishNode(decl, "TSNamespaceExportDeclaration"); + } else { + return super.parseExport(node, decorators); + } + } + isAbstractClass() { + return this.isContextual(124) && this.lookahead().type === 80; + } + parseExportDefaultExpression() { + if (this.isAbstractClass()) { + const cls = this.startNode(); + this.next(); + cls.abstract = true; + return this.parseClass(cls, true, true); + } + if (this.match(129)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseExportDefaultExpression(); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + const { + isAmbientContext + } = this.state; + const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); + if (!isAmbientContext) return declaration; + for (const { + id, + init + } of declaration.declarations) { + if (!init) continue; + if (kind !== "const" || !!id.typeAnnotation) { + this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); + } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { + this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); + } + } + return declaration; + } + parseStatementContent(flags, decorators) { + if (this.match(75) && this.isLookaheadContextual("enum")) { + const node = this.startNode(); + this.expect(75); + return this.tsParseEnumDeclaration(node, { + const: true + }); + } + if (this.isContextual(126)) { + return this.tsParseEnumDeclaration(this.startNode()); + } + if (this.isContextual(129)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseStatementContent(flags, decorators); + } + parseAccessModifier() { + return this.tsParseModifier(["public", "protected", "private"]); + } + tsHasSomeModifiers(member, modifiers) { + return modifiers.some(modifier => { + if (tsIsAccessModifier(modifier)) { + return member.accessibility === modifier; + } + return !!member[modifier]; + }); + } + tsIsStartOfStaticBlocks() { + return this.isContextual(106) && this.lookaheadCharCode() === 123; + } + parseClassMember(classBody, member, state) { + const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; + this.tsParseModifiers({ + allowedModifiers: modifiers, + disallowedModifiers: ["in", "out"], + stopOnStartOfClassStaticBlock: true, + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }, member); + const callParseClassMemberWithIsStatic = () => { + if (this.tsIsStartOfStaticBlocks()) { + this.next(); + this.next(); + if (this.tsHasSomeModifiers(member, modifiers)) { + this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); + } + super.parseClassStaticBlock(classBody, member); + } else { + this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); + } + }; + if (member.declare) { + this.tsInAmbientContext(callParseClassMemberWithIsStatic); + } else { + callParseClassMemberWithIsStatic(); + } + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const idx = this.tsTryParseIndexSignature(member); + if (idx) { + classBody.body.push(idx); + if (member.abstract) { + this.raise(TSErrors.IndexSignatureHasAbstract, member); + } + if (member.accessibility) { + this.raise(TSErrors.IndexSignatureHasAccessibility, member, { + modifier: member.accessibility + }); + } + if (member.declare) { + this.raise(TSErrors.IndexSignatureHasDeclare, member); + } + if (member.override) { + this.raise(TSErrors.IndexSignatureHasOverride, member); + } + return; + } + if (!this.state.inAbstractClass && member.abstract) { + this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); + } + if (member.override) { + if (!state.hadSuperClass) { + this.raise(TSErrors.OverrideNotInSubClass, member); + } + } + super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parsePostMemberNameModifiers(methodOrProp) { + const optional = this.eat(17); + if (optional) methodOrProp.optional = true; + if (methodOrProp.readonly && this.match(10)) { + this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); + } + if (methodOrProp.declare && this.match(10)) { + this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); + } + } + parseExpressionStatement(node, expr, decorators) { + const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; + return decl || super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + if (this.tsIsDeclarationStart()) return true; + return super.shouldParseExportDeclaration(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.state.maybeInArrowParameters || !this.match(17)) { + return super.parseConditional(expr, startLoc, refExpressionErrors); + } + const result = this.tryParse(() => super.parseConditional(expr, startLoc)); + if (!result.node) { + if (result.error) { + super.setOptionalParametersError(refExpressionErrors, result.error); + } + return expr; + } + if (result.error) this.state = result.failState; + return result.node; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); + } + return node; + } + parseExportDeclaration(node) { + if (!this.state.isAmbientContext && this.isContextual(125)) { + return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); + } + const startLoc = this.state.startLoc; + const isDeclare = this.eatContextual(125); + if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { + throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); + } + const isIdentifier = tokenIsIdentifier(this.state.type); + const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); + if (!declaration) return null; + if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { + node.exportKind = "type"; + } + if (isDeclare) { + this.resetStartLocation(declaration, startLoc); + declaration.declare = true; + } + return declaration; + } + parseClassId(node, isStatement, optionalId, bindingType) { + if ((!isStatement || optionalId) && this.isContextual(113)) { + return; + } + super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); + const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (typeParameters) node.typeParameters = typeParameters; + } + parseClassPropertyAnnotation(node) { + if (!node.optional) { + if (this.eat(35)) { + node.definite = true; + } else if (this.eat(17)) { + node.optional = true; + } + } + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + } + parseClassProperty(node) { + this.parseClassPropertyAnnotation(node); + if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { + this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); + } + if (node.abstract && this.match(29)) { + const { + key + } = node; + this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { + propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` + }); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (node.abstract) { + this.raise(TSErrors.PrivateElementHasAbstract, node); + } + if (node.accessibility) { + this.raise(TSErrors.PrivateElementHasAccessibility, node, { + modifier: node.accessibility + }); + } + this.parseClassPropertyAnnotation(node); + return super.parseClassPrivateProperty(node); + } + parseClassAccessorProperty(node) { + this.parseClassPropertyAnnotation(node); + if (node.optional) { + this.raise(TSErrors.AccessorCannotBeOptional, node); + } + return super.parseClassAccessorProperty(node); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters && isConstructor) { + this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); + } + const { + declare = false, + kind + } = method; + if (declare && (kind === "get" || kind === "set")) { + this.raise(TSErrors.DeclareAccessor, method, { + kind + }); + } + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + declareClassPrivateMethodInScope(node, kind) { + if (node.type === "TSDeclareMethod") return; + if (node.type === "MethodDefinition" && !hasOwnProperty.call(node.value, "body")) { + return; + } + super.declareClassPrivateMethodInScope(node, kind); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.match(47) || this.match(51))) { + node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); + } + if (this.eatContextual(113)) { + node.implements = this.tsParseHeritageClause("implements"); + } + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) prop.typeParameters = typeParameters; + return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + } + parseFunctionParams(node, isConstructor) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) node.typeParameters = typeParameters; + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { + decl.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) { + decl.id.typeAnnotation = type; + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + node.returnType = this.tsParseTypeAnnotation(); + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; + let state; + let jsx; + let typeCast; + if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + if (!state || state === this.state) state = this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _expr$extra, _typeParameters; + typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + abort(); + } + if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); + } + expr.typeParameters = typeParameters; + return expr; + }, state); + if (!arrow.error && !arrow.aborted) { + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if (!jsx) { + assert(!this.hasPlugin("jsx")); + typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!typeCast.error) return typeCast.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrow.node) { + this.state = arrow.failState; + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if ((_typeCast = typeCast) != null && _typeCast.node) { + this.state = typeCast.failState; + return typeCast.node; + } + throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); + } + reportReservedArrowTypeParam(node) { + var _node$extra; + if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedArrowTypeParam, node); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + if (!this.hasPlugin("jsx") && this.match(47)) { + return this.tsParseTypeAssertion(); + } + return super.parseMaybeUnary(refExpressionErrors, sawUnary); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(abort => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + if (this.canInsertSemicolon() || !this.match(19)) abort(); + return returnType; + }); + if (result.aborted) return; + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; + } + } + return super.parseArrow(node); + } + parseFunctionParamType(param) { + if (this.eat(17)) { + param.optional = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) param.typeAnnotation = type; + this.resetEndLocation(param); + return param; + } + isAssignable(node, isBinding) { + switch (node.type) { + case "TSTypeCastExpression": + return this.isAssignable(node.expression, isBinding); + case "TSParameterProperty": + return true; + default: + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + switch (node.type) { + case "ParenthesizedExpression": + this.toAssignableParenthesizedExpression(node, isLHS); + break; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + if (isLHS) { + this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); + } else { + this.raise(TSErrors.UnexpectedTypeCastInParameter, node); + } + this.toAssignable(node.expression, isLHS); + break; + case "AssignmentExpression": + if (!isLHS && node.left.type === "TSTypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + default: + super.toAssignable(node, isLHS); + } + } + toAssignableParenthesizedExpression(node, isLHS) { + switch (node.expression.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + case "ParenthesizedExpression": + this.toAssignable(node.expression, isLHS); + break; + default: + super.toAssignable(node, isLHS); + } + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + this.checkToRestConversion(node.expression, false); + break; + default: + super.checkToRestConversion(node, allowPattern); + } + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + switch (type) { + case "TSTypeCastExpression": + return true; + case "TSParameterProperty": + return "parameter"; + case "TSNonNullExpression": + case "TSInstantiationExpression": + return "expression"; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true]; + default: + return super.isValidLVal(type, isUnparenthesizedInAssign, binding); + } + } + parseBindingAtom() { + if (this.state.type === 78) { + return this.parseIdentifier(true); + } + return super.parseBindingAtom(); + } + parseMaybeDecoratorArguments(expr) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (this.match(10)) { + const call = super.parseMaybeDecoratorArguments(expr); + call.typeParameters = typeArguments; + return call; + } + this.unexpected(null, 10); + } + return super.parseMaybeDecoratorArguments(expr); + } + checkCommaAfterRest(close) { + if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { + this.next(); + return false; + } + return super.checkCommaAfterRest(close); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(35) || this.match(14) || super.isClassProperty(); + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); + } + return node; + } + getTokenFromCode(code) { + if (this.state.inType) { + if (code === 62) { + this.finishOp(48, 1); + return; + } + if (code === 60) { + this.finishOp(47, 1); + return; + } + } + super.getTokenFromCode(code); + } + reScan_lt_gt() { + const { + type + } = this.state; + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + reScan_lt() { + const { + type + } = this.state; + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + return type; + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + shouldParseArrow(params) { + if (this.match(14)) { + return params.every(expr => this.isAssignable(expr, true)); + } + return super.shouldParseArrow(params); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + canHaveLeadingDecorator() { + return super.canHaveLeadingDecorator() || this.isAbstractClass(); + } + jsxParseOpeningElementAfterName(node) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); + if (typeArguments) node.typeParameters = typeArguments; + } + return super.jsxParseOpeningElementAfterName(node); + } + getGetterSetterExpectedParamCount(method) { + const baseCount = super.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + const firstParam = params[0]; + const hasContextParam = firstParam && this.isThisParam(firstParam); + return hasContextParam ? baseCount + 1 : baseCount; + } + parseCatchClauseParam() { + const param = super.parseCatchClauseParam(); + const type = this.tsTryParseTypeAnnotation(); + if (type) { + param.typeAnnotation = type; + this.resetEndLocation(param); + } + return param; + } + tsInAmbientContext(cb) { + const { + isAmbientContext: oldIsAmbientContext, + strict: oldStrict + } = this.state; + this.state.isAmbientContext = true; + this.state.strict = false; + try { + return cb(); + } finally { + this.state.isAmbientContext = oldIsAmbientContext; + this.state.strict = oldStrict; + } + } + parseClass(node, isStatement, optionalId) { + const oldInAbstractClass = this.state.inAbstractClass; + this.state.inAbstractClass = !!node.abstract; + try { + return super.parseClass(node, isStatement, optionalId); + } finally { + this.state.inAbstractClass = oldInAbstractClass; + } + } + tsParseAbstractDeclaration(node, decorators) { + if (this.match(80)) { + node.abstract = true; + return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); + } else if (this.isContextual(129)) { + if (!this.hasFollowingLineBreak()) { + node.abstract = true; + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node); + return this.tsParseInterfaceDeclaration(node); + } + } else { + this.unexpected(null, 80); + } + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { + const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + if (method.abstract) { + const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; + if (hasBody) { + const { + key + } = method; + this.raise(TSErrors.AbstractMethodHasImplementation, method, { + methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` + }); + } + } + return method; + } + tsParseTypeParameterName() { + const typeName = this.parseIdentifier(); + return typeName.name; + } + shouldParseAsAmbientContext() { + return !!this.getPluginOption("typescript", "dts"); + } + parse() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.parse(); + } + getExpression() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.getExpression(); + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (!isString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); + return this.finishNode(node, "ExportSpecifier"); + } + node.exportKind = "value"; + return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (!importedIsString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); + return this.finishNode(specifier, "ImportSpecifier"); + } + specifier.importKind = "value"; + return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); + } + parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { + const leftOfAsKey = isImport ? "imported" : "local"; + const rightOfAsKey = isImport ? "local" : "exported"; + let leftOfAs = node[leftOfAsKey]; + let rightOfAs; + let hasTypeSpecifier = false; + let canParseAsKeyword = true; + const loc = leftOfAs.loc.start; + if (this.isContextual(93)) { + const firstAs = this.parseIdentifier(); + if (this.isContextual(93)) { + const secondAs = this.parseIdentifier(); + if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + leftOfAs = firstAs; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + canParseAsKeyword = false; + } else { + rightOfAs = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + canParseAsKeyword = false; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } else { + hasTypeSpecifier = true; + leftOfAs = firstAs; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + if (isImport) { + leftOfAs = this.parseIdentifier(true); + if (!this.isContextual(93)) { + this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); + } + } else { + leftOfAs = this.parseModuleExportName(); + } + } + if (hasTypeSpecifier && isInTypeOnlyImportExport) { + this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); + } + node[leftOfAsKey] = leftOfAs; + node[rightOfAsKey] = rightOfAs; + const kindKey = isImport ? "importKind" : "exportKind"; + node[kindKey] = hasTypeSpecifier ? "type" : "value"; + if (canParseAsKeyword && this.eatContextual(93)) { + node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } + if (!node[rightOfAsKey]) { + node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); + } + if (isImport) { + this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); + } + } +}; +function isPossiblyLiteralEnum(expression) { + if (expression.type !== "MemberExpression") return false; + const { + computed, + property + } = expression; + if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); +} +function isValidAmbientConstInitializer(expression, estree) { + var _expression$extra; + const { + type + } = expression; + if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { + return false; + } + if (estree) { + if (type === "Literal") { + const { + value + } = expression; + if (typeof value === "string" || typeof value === "boolean") { + return true; + } + } + } else { + if (type === "StringLiteral" || type === "BooleanLiteral") { + return true; + } + } + if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { + return true; + } + if (type === "TemplateLiteral" && expression.expressions.length === 0) { + return true; + } + if (isPossiblyLiteralEnum(expression)) { + return true; + } + return false; +} +function isNumber(expression, estree) { + if (estree) { + return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); + } + return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; +} +function isNegativeNumber(expression, estree) { + if (expression.type === "UnaryExpression") { + const { + operator, + argument + } = expression; + if (operator === "-" && isNumber(argument, estree)) { + return true; + } + } + return false; +} +function isUncomputedMemberExpressionChain(expression) { + if (expression.type === "Identifier") return true; + if (expression.type !== "MemberExpression" || expression.computed) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); +} +const PlaceholderErrors = ParseErrorEnum`placeholders`({ + ClassNameIsRequired: "A class name is required.", + UnexpectedSpace: "Unexpected space in placeholder." +}); +var placeholders = superClass => class PlaceholdersParserMixin extends superClass { + parsePlaceholder(expectedNode) { + if (this.match(133)) { + const node = this.startNode(); + this.next(); + this.assertNoSpace(); + node.name = super.parseIdentifier(true); + this.assertNoSpace(); + this.expect(133); + return this.finishPlaceholder(node, expectedNode); + } + } + finishPlaceholder(node, expectedNode) { + let placeholder = node; + if (!placeholder.expectedNode || !placeholder.type) { + placeholder = this.finishNode(placeholder, "Placeholder"); + } + placeholder.expectedNode = expectedNode; + return placeholder; + } + getTokenFromCode(code) { + if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { + this.finishOp(133, 2); + } else { + super.getTokenFromCode(code); + } + } + parseExprAtom(refExpressionErrors) { + return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); + } + parseIdentifier(liberal) { + return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word !== undefined) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + parseBindingAtom() { + return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); + } + isValidLVal(type, isParenthesized, binding) { + return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); + } + toAssignable(node, isLHS) { + if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { + node.expectedNode = "Pattern"; + } else { + super.toAssignable(node, isLHS); + } + } + chStartsBindingIdentifier(ch, pos) { + if (super.chStartsBindingIdentifier(ch, pos)) { + return true; + } + const nextToken = this.lookahead(); + if (nextToken.type === 133) { + return true; + } + return false; + } + verifyBreakContinue(node, isBreak) { + if (node.label && node.label.type === "Placeholder") return; + super.verifyBreakContinue(node, isBreak); + } + parseExpressionStatement(node, expr) { + var _expr$extra; + if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + return super.parseExpressionStatement(node, expr); + } + if (this.match(14)) { + const stmt = node; + stmt.label = this.finishPlaceholder(expr, "Identifier"); + this.next(); + stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); + return this.finishNode(stmt, "LabeledStatement"); + } + this.semicolon(); + const stmtPlaceholder = node; + stmtPlaceholder.name = expr.name; + return this.finishPlaceholder(stmtPlaceholder, "Statement"); + } + parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { + return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); + } + parseFunctionId(requireId) { + return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); + } + parseClass(node, isStatement, optionalId) { + const type = isStatement ? "ClassDeclaration" : "ClassExpression"; + this.next(); + const oldStrict = this.state.strict; + const placeholder = this.parsePlaceholder("Identifier"); + if (placeholder) { + if (this.match(81) || this.match(133) || this.match(5)) { + node.id = placeholder; + } else if (optionalId || !isStatement) { + node.id = null; + node.body = this.finishPlaceholder(placeholder, "ClassBody"); + return this.finishNode(node, type); + } else { + throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); + } + } else { + this.parseClassId(node, isStatement, optionalId); + } + super.parseClassSuper(node); + node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, type); + } + parseExport(node, decorators) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseExport(node, decorators); + const node2 = node; + if (!this.isContextual(98) && !this.match(12)) { + node2.specifiers = []; + node2.source = null; + node2.declaration = this.finishPlaceholder(placeholder, "Declaration"); + return this.finishNode(node2, "ExportNamedDeclaration"); + } + this.expectPlugin("exportDefaultFrom"); + const specifier = this.startNode(); + specifier.exported = placeholder; + node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return super.parseExport(node2, decorators); + } + isExportDefaultSpecifier() { + if (this.match(65)) { + const next = this.nextTokenStart(); + if (this.isUnparsedContextual(next, "from")) { + if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) { + return true; + } + } + } + return super.isExportDefaultSpecifier(); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + var _specifiers; + if ((_specifiers = node.specifiers) != null && _specifiers.length) { + return true; + } + return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + } + checkExport(node) { + const { + specifiers + } = node; + if (specifiers != null && specifiers.length) { + node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); + } + super.checkExport(node); + node.specifiers = specifiers; + } + parseImport(node) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseImport(node); + node.specifiers = []; + if (!this.isContextual(98) && !this.match(12)) { + node.source = this.finishPlaceholder(placeholder, "StringLiteral"); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + const specifier = this.startNodeAtNode(placeholder); + specifier.local = placeholder; + node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); + if (this.eat(12)) { + const hasStarImport = this.maybeParseStarImportSpecifier(node); + if (!hasStarImport) this.parseNamedImportSpecifiers(node); + } + this.expectContextual(98); + node.source = this.parseImportSource(); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); + } + assertNoSpace() { + if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) { + this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); + } + } +}; +var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { + parseV8Intrinsic() { + if (this.match(54)) { + const v8IntrinsicStartLoc = this.state.startLoc; + const node = this.startNode(); + this.next(); + if (tokenIsIdentifier(this.state.type)) { + const name = this.parseIdentifierName(); + const identifier = this.createIdentifier(node, name); + identifier.type = "V8IntrinsicIdentifier"; + if (this.match(10)) { + return identifier; + } + } + this.unexpected(v8IntrinsicStartLoc); + } + } + parseExprAtom(refExpressionErrors) { + return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); + } +}; +const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; +const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; +function validatePlugins(pluginsMap) { + if (pluginsMap.has("decorators")) { + if (pluginsMap.has("decorators-legacy")) { + throw new Error("Cannot use the decorators and decorators-legacy plugin together"); + } + const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport; + if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { + throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); + } + const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized; + if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { + throw new Error("'allowCallParenthesized' must be a boolean."); + } + } + if (pluginsMap.has("flow") && pluginsMap.has("typescript")) { + throw new Error("Cannot combine flow and typescript plugins."); + } + if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); + } + if (pluginsMap.has("pipelineOperator")) { + var _pluginsMap$get; + const proposal = pluginsMap.get("pipelineOperator").proposal; + if (!PIPELINE_PROPOSALS.includes(proposal)) { + const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); + throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); + } + const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash"; + if (proposal === "hack") { + if (pluginsMap.has("placeholders")) { + throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); + } + if (pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); + } + const topicToken = pluginsMap.get("pipelineOperator").topicToken; + if (!TOPIC_TOKENS.includes(topicToken)) { + const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); + throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); + } + if (topicToken === "#" && tupleSyntaxIsHash) { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } else if (proposal === "smart" && tupleSyntaxIsHash) { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } + if (pluginsMap.has("moduleAttributes")) { + { + if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) { + throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins."); + } + const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; + if (moduleAttributesVersionPluginOption !== "may-2020") { + throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); + } + } + } + if (pluginsMap.has("importAssertions")) { + if (pluginsMap.has("deprecatedImportAssert")) { + throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins."); + } + } + if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) { + { + pluginsMap.set("deprecatedImportAssert", {}); + } + } + if (pluginsMap.has("recordAndTuple")) { + const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; + if (syntaxType != null) { + { + const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; + if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { + throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); + } + } + } + } + if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) { + const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); + error.missingPlugins = "doExpressions"; + throw error; + } + if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { + throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); + } +} +const mixinPlugins = { + estree, + jsx, + flow, + typescript, + v8intrinsic, + placeholders +}; +const mixinPluginNames = Object.keys(mixinPlugins); +function createDefaultOptions() { + return { + sourceType: "script", + sourceFilename: undefined, + startIndex: 0, + startColumn: 0, + startLine: 1, + allowAwaitOutsideFunction: false, + allowReturnOutsideFunction: false, + allowNewTargetOutsideFunction: false, + allowImportExportEverywhere: false, + allowSuperOutsideMethod: false, + allowUndeclaredExports: false, + plugins: [], + strictMode: null, + ranges: false, + tokens: false, + createImportExpressions: false, + createParenthesizedExpressions: false, + errorRecovery: false, + attachComment: true, + annexB: true + }; +} +function getOptions(opts) { + const options = createDefaultOptions(); + if (opts == null) { + return options; + } + if (opts.annexB != null && opts.annexB !== false) { + throw new Error("The `annexB` option can only be set to `false`."); + } + for (const key of Object.keys(options)) { + if (opts[key] != null) options[key] = opts[key]; + } + if (options.startLine === 1) { + if (opts.startIndex == null && options.startColumn > 0) { + options.startIndex = options.startColumn; + } else if (opts.startColumn == null && options.startIndex > 0) { + options.startColumn = options.startIndex; + } + } else if (opts.startColumn == null || opts.startIndex == null) { + if (opts.startIndex != null) { + throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); + } + } + return options; +} +class ExpressionParser extends LValParser { + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { + return; + } + const key = prop.key; + const name = key.type === "Identifier" ? key.name : key.value; + if (name === "__proto__") { + if (isRecord) { + this.raise(Errors.RecordNoProto, key); + return; + } + if (protoRef.used) { + if (refExpressionErrors) { + if (refExpressionErrors.doubleProtoLoc === null) { + refExpressionErrors.doubleProtoLoc = key.loc.start; + } + } else { + this.raise(Errors.DuplicateProto, key); + } + } + protoRef.used = true; + } + } + shouldExitDescending(expr, potentialArrowAt) { + return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt; + } + getExpression() { + this.enterInitialScopes(); + this.nextToken(); + const expr = this.parseExpression(); + if (!this.match(140)) { + this.unexpected(); + } + this.finalizeRemainingComments(); + expr.comments = this.comments; + expr.errors = this.state.errors; + if (this.options.tokens) { + expr.tokens = this.tokens; + } + return expr; + } + parseExpression(disallowIn, refExpressionErrors) { + if (disallowIn) { + return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + parseExpressionBase(refExpressionErrors) { + const startLoc = this.state.startLoc; + const expr = this.parseMaybeAssign(refExpressionErrors); + if (this.match(12)) { + const node = this.startNodeAt(startLoc); + node.expressions = [expr]; + while (this.eat(12)) { + node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); + } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); + } + return expr; + } + parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { + return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { + return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + setOptionalParametersError(refExpressionErrors, resultError) { + var _resultError$loc; + refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + const startLoc = this.state.startLoc; + if (this.isContextual(108)) { + if (this.prodParam.hasYield) { + let left = this.parseYield(); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + return left; + } + } + let ownExpressionErrors; + if (refExpressionErrors) { + ownExpressionErrors = false; + } else { + refExpressionErrors = new ExpressionErrors(); + ownExpressionErrors = true; + } + const { + type + } = this.state; + if (type === 10 || tokenIsIdentifier(type)) { + this.state.potentialArrowAt = this.state.start; + } + let left = this.parseMaybeConditional(refExpressionErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + if (tokenIsAssignment(this.state.type)) { + const node = this.startNodeAt(startLoc); + const operator = this.state.value; + node.operator = operator; + if (this.match(29)) { + this.toAssignable(left, true); + node.left = left; + const startIndex = startLoc.index; + if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { + refExpressionErrors.doubleProtoLoc = null; + } + if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { + refExpressionErrors.shorthandAssignLoc = null; + } + if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { + this.checkDestructuringPrivate(refExpressionErrors); + refExpressionErrors.privateKeyLoc = null; + } + } else { + node.left = left; + } + this.next(); + node.right = this.parseMaybeAssign(); + this.checkLVal(left, this.finishNode(node, "AssignmentExpression")); + return node; + } else if (ownExpressionErrors) { + this.checkExpressionErrors(refExpressionErrors, true); + } + return left; + } + parseMaybeConditional(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprOps(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseConditional(expr, startLoc, refExpressionErrors); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (this.eat(17)) { + const node = this.startNodeAt(startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssignAllowIn(); + this.expect(14); + node.alternate = this.parseMaybeAssign(); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + } + parseMaybeUnaryOrPrivate(refExpressionErrors) { + return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); + } + parseExprOps(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseExprOp(expr, startLoc, -1); + } + parseExprOp(left, leftStartLoc, minPrec) { + if (this.isPrivateName(left)) { + const value = this.getPrivateNameSV(left); + if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { + this.raise(Errors.PrivateInExpectedIn, left, { + identifierName: value + }); + } + this.classScope.usePrivateName(value, left.loc.start); + } + const op = this.state.type; + if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { + let prec = tokenOperatorPrecedence(op); + if (prec > minPrec) { + if (op === 39) { + this.expectPlugin("pipelineOperator"); + if (this.state.inFSharpPipelineDirectBody) { + return left; + } + this.checkPipelineAtInfixOperator(left, leftStartLoc); + } + const node = this.startNodeAt(leftStartLoc); + node.left = left; + node.operator = this.state.value; + const logical = op === 41 || op === 42; + const coalesce = op === 40; + if (coalesce) { + prec = tokenOperatorPrecedence(42); + } + this.next(); + if (op === 39 && this.hasPlugin(["pipelineOperator", { + proposal: "minimal" + }])) { + if (this.state.type === 96 && this.prodParam.hasAwait) { + throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); + } + } + node.right = this.parseExprOpRightExpr(op, prec); + const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); + const nextOp = this.state.type; + if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { + throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); + } + return this.parseExprOp(finishedNode, leftStartLoc, minPrec); + } + } + return left; + } + parseExprOpRightExpr(op, prec) { + const startLoc = this.state.startLoc; + switch (op) { + case 39: + switch (this.getPluginOption("pipelineOperator", "proposal")) { + case "hack": + return this.withTopicBindingContext(() => { + return this.parseHackPipeBody(); + }); + case "smart": + return this.withTopicBindingContext(() => { + if (this.prodParam.hasYield && this.isContextual(108)) { + throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); + } + return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); + }); + case "fsharp": + return this.withSoloAwaitPermittingContext(() => { + return this.parseFSharpPipelineBody(prec); + }); + } + default: + return this.parseExprOpBaseRightExpr(op, prec); + } + } + parseExprOpBaseRightExpr(op, prec) { + const startLoc = this.state.startLoc; + return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); + } + parseHackPipeBody() { + var _body$extra; + const { + startLoc + } = this.state; + const body = this.parseMaybeAssign(); + const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); + if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { + this.raise(Errors.PipeUnparenthesizedBody, startLoc, { + type: body.type + }); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipeTopicUnused, startLoc); + } + return body; + } + checkExponentialAfterUnary(node) { + if (this.match(57)) { + this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + const startLoc = this.state.startLoc; + const isAwait = this.isContextual(96); + if (isAwait && this.recordAwaitIfAllowed()) { + this.next(); + const expr = this.parseAwait(startLoc); + if (!sawUnary) this.checkExponentialAfterUnary(expr); + return expr; + } + const update = this.match(34); + const node = this.startNode(); + if (tokenIsPrefix(this.state.type)) { + node.operator = this.state.value; + node.prefix = true; + if (this.match(72)) { + this.expectPlugin("throwExpressions"); + } + const isDelete = this.match(89); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refExpressionErrors, true); + if (this.state.strict && isDelete) { + const arg = node.argument; + if (arg.type === "Identifier") { + this.raise(Errors.StrictDelete, node); + } else if (this.hasPropertyAsPrivateName(arg)) { + this.raise(Errors.DeletePrivateField, node); + } + } + if (!update) { + if (!sawUnary) { + this.checkExponentialAfterUnary(node); + } + return this.finishNode(node, "UnaryExpression"); + } + } + const expr = this.parseUpdate(node, update, refExpressionErrors); + if (isAwait) { + const { + type + } = this.state; + const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); + if (startsExpr && !this.isAmbiguousAwait()) { + this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); + return this.parseAwait(startLoc); + } + } + return expr; + } + parseUpdate(node, update, refExpressionErrors) { + if (update) { + const updateExpressionNode = node; + this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression")); + return node; + } + const startLoc = this.state.startLoc; + let expr = this.parseExprSubscripts(refExpressionErrors); + if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; + while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.next(); + this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression")); + } + return expr; + } + parseExprSubscripts(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprAtom(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseSubscripts(expr, startLoc); + } + parseSubscripts(base, startLoc, noCalls) { + const state = { + optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsyncArrow(base), + stop: false + }; + do { + base = this.parseSubscript(base, startLoc, noCalls, state); + state.maybeAsyncArrow = false; + } while (!state.stop); + return base; + } + parseSubscript(base, startLoc, noCalls, state) { + const { + type + } = this.state; + if (!noCalls && type === 15) { + return this.parseBind(base, startLoc, noCalls, state); + } else if (tokenIsTemplate(type)) { + return this.parseTaggedTemplateExpression(base, startLoc, state); + } + let optional = false; + if (type === 18) { + if (noCalls) { + this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); + if (this.lookaheadCharCode() === 40) { + state.stop = true; + return base; + } + } + state.optionalChainMember = optional = true; + this.next(); + } + if (!noCalls && this.match(10)) { + return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); + } else { + const computed = this.eat(0); + if (computed || optional || this.eat(16)) { + return this.parseMember(base, startLoc, state, computed, optional); + } else { + state.stop = true; + return base; + } + } + } + parseMember(base, startLoc, state, computed, optional) { + const node = this.startNodeAt(startLoc); + node.object = base; + node.computed = computed; + if (computed) { + node.property = this.parseExpression(); + this.expect(3); + } else if (this.match(139)) { + if (base.type === "Super") { + this.raise(Errors.SuperPrivateField, startLoc); + } + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + if (state.optionalChainMember) { + node.optional = optional; + return this.finishNode(node, "OptionalMemberExpression"); + } else { + return this.finishNode(node, "MemberExpression"); + } + } + parseBind(base, startLoc, noCalls, state) { + const node = this.startNodeAt(startLoc); + node.object = base; + this.next(); + node.callee = this.parseNoCallExpr(); + state.stop = true; + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); + } + parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + let refExpressionErrors = null; + this.state.maybeInArrowParameters = true; + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + const { + maybeAsyncArrow, + optionalChainMember + } = state; + if (maybeAsyncArrow) { + this.expressionScope.enter(newAsyncArrowScope()); + refExpressionErrors = new ExpressionErrors(); + } + if (optionalChainMember) { + node.optional = optional; + } + if (optional) { + node.arguments = this.parseCallExpressionArguments(11); + } else { + node.arguments = this.parseCallExpressionArguments(11, base.type !== "Super", node, refExpressionErrors); + } + let finishedNode = this.finishCallExpression(node, optionalChainMember); + if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { + state.stop = true; + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); + } else { + if (maybeAsyncArrow) { + this.checkExpressionErrors(refExpressionErrors, true); + this.expressionScope.exit(); + } + this.toReferencedArguments(finishedNode); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return finishedNode; + } + toReferencedArguments(node, isParenthesizedExpr) { + this.toReferencedListDeep(node.arguments, isParenthesizedExpr); + } + parseTaggedTemplateExpression(base, startLoc, state) { + const node = this.startNodeAt(startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + if (state.optionalChainMember) { + this.raise(Errors.OptionalChainingNoTemplate, startLoc); + } + return this.finishNode(node, "TaggedTemplateExpression"); + } + atPossibleAsyncArrow(base) { + return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt; + } + finishCallExpression(node, optional) { + if (node.callee.type === "Import") { + if (node.arguments.length === 0 || node.arguments.length > 2) { + this.raise(Errors.ImportCallArity, node); + } else { + for (const arg of node.arguments) { + if (arg.type === "SpreadElement") { + this.raise(Errors.ImportCallSpreadArgument, arg); + } + } + } + } + return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); + } + parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) { + const elts = []; + let first = true; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); + } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return elts; + } + shouldParseAsyncArrow() { + return this.match(19) && !this.canInsertSemicolon(); + } + parseAsyncArrowFromCallExpression(node, call) { + var _call$extra; + this.resetPreviousNodeTrailingComments(call); + this.expect(19); + this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); + if (call.innerComments) { + setInnerComments(node, call.innerComments); + } + if (call.callee.trailingComments) { + setInnerComments(node, call.callee.trailingComments); + } + return node; + } + parseNoCallExpr() { + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startLoc, true); + } + parseExprAtom(refExpressionErrors) { + let node; + let decorators = null; + const { + type + } = this.state; + switch (type) { + case 79: + return this.parseSuper(); + case 83: + node = this.startNode(); + this.next(); + if (this.match(16)) { + return this.parseImportMetaProperty(node); + } + if (this.match(10)) { + if (this.options.createImportExpressions) { + return this.parseImportCall(node); + } else { + return this.finishNode(node, "Import"); + } + } else { + this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); + return this.finishNode(node, "Import"); + } + case 78: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case 90: + { + return this.parseDo(this.startNode(), false); + } + case 56: + case 31: + { + this.readRegexp(); + return this.parseRegExpLiteral(this.state.value); + } + case 135: + return this.parseNumericLiteral(this.state.value); + case 136: + return this.parseBigIntLiteral(this.state.value); + case 134: + return this.parseStringLiteral(this.state.value); + case 84: + return this.parseNullLiteral(); + case 85: + return this.parseBooleanLiteral(true); + case 86: + return this.parseBooleanLiteral(false); + case 10: + { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + return this.parseParenAndDistinguishExpression(canBeArrow); + } + case 2: + case 1: + { + return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); + } + case 0: + { + return this.parseArrayLike(3, true, false, refExpressionErrors); + } + case 6: + case 7: + { + return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); + } + case 5: + { + return this.parseObjectLike(8, false, false, refExpressionErrors); + } + case 68: + return this.parseFunctionOrFunctionSent(); + case 26: + decorators = this.parseDecorators(); + case 80: + return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); + case 77: + return this.parseNewOrNewTarget(); + case 25: + case 24: + return this.parseTemplate(false); + case 15: + { + node = this.startNode(); + this.next(); + node.object = null; + const callee = node.callee = this.parseNoCallExpr(); + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + throw this.raise(Errors.UnsupportedBind, callee); + } + } + case 139: + { + this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { + identifierName: this.state.value + }); + return this.parsePrivateName(); + } + case 33: + { + return this.parseTopicReferenceThenEqualsSign(54, "%"); + } + case 32: + { + return this.parseTopicReferenceThenEqualsSign(44, "^"); + } + case 37: + case 38: + { + return this.parseTopicReference("hack"); + } + case 44: + case 54: + case 27: + { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + return this.parseTopicReference(pipeProposal); + } + this.unexpected(); + break; + } + case 47: + { + const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); + if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { + this.expectOnePlugin(["jsx", "flow", "typescript"]); + } else { + this.unexpected(); + } + break; + } + default: + if (type === 137) { + return this.parseDecimalLiteral(this.state.value); + } + if (tokenIsIdentifier(type)) { + if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { + return this.parseModuleExpression(); + } + const canBeArrow = this.state.potentialArrowAt === this.state.start; + const containsEsc = this.state.containsEsc; + const id = this.parseIdentifier(); + if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { + const { + type + } = this.state; + if (type === 68) { + this.resetPreviousNodeTrailingComments(id); + this.next(); + return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); + } else if (tokenIsIdentifier(type)) { + if (this.lookaheadCharCode() === 61) { + return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); + } else { + return id; + } + } else if (type === 90) { + this.resetPreviousNodeTrailingComments(id); + return this.parseDo(this.startNodeAtNode(id), true); + } + } + if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { + this.next(); + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); + } + return id; + } else { + this.unexpected(); + } + } + } + parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + this.state.type = topicTokenType; + this.state.value = topicTokenValue; + this.state.pos--; + this.state.end--; + this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); + return this.parseTopicReference(pipeProposal); + } else { + this.unexpected(); + } + } + parseTopicReference(pipeProposal) { + const node = this.startNode(); + const startLoc = this.state.startLoc; + const tokenType = this.state.type; + this.next(); + return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); + } + finishTopicReference(node, startLoc, pipeProposal, tokenType) { + if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { + const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc); + } + this.registerTopicReference(); + return this.finishNode(node, nodeType); + } else { + throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { + token: tokenLabelName(tokenType) + }); + } + } + testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { + switch (pipeProposal) { + case "hack": + { + return this.hasPlugin(["pipelineOperator", { + topicToken: tokenLabelName(tokenType) + }]); + } + case "smart": + return tokenType === 27; + default: + throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); + } + } + parseAsyncArrowUnaryFunction(node) { + this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); + const params = [this.parseIdentifier()]; + this.prodParam.exit(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); + } + this.expect(19); + return this.parseArrowExpression(node, params, true); + } + parseDo(node, isAsync) { + this.expectPlugin("doExpressions"); + if (isAsync) { + this.expectPlugin("asyncDoExpressions"); + } + node.async = isAsync; + this.next(); + const oldLabels = this.state.labels; + this.state.labels = []; + if (isAsync) { + this.prodParam.enter(2); + node.body = this.parseBlock(); + this.prodParam.exit(); + } else { + node.body = this.parseBlock(); + } + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } + parseSuper() { + const node = this.startNode(); + this.next(); + if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.SuperNotAllowed, node); + } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.UnexpectedSuper, node); + } + if (!this.match(10) && !this.match(0) && !this.match(16)) { + this.raise(Errors.UnsupportedSuper, node); + } + return this.finishNode(node, "Super"); + } + parsePrivateName() { + const node = this.startNode(); + const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); + const name = this.state.value; + this.next(); + node.id = this.createIdentifier(id, name); + return this.finishNode(node, "PrivateName"); + } + parseFunctionOrFunctionSent() { + const node = this.startNode(); + this.next(); + if (this.prodParam.hasYield && this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); + this.next(); + if (this.match(103)) { + this.expectPlugin("functionSent"); + } else if (!this.hasPlugin("functionSent")) { + this.unexpected(); + } + return this.parseMetaProperty(node, meta, "sent"); + } + return this.parseFunction(node); + } + parseMetaProperty(node, meta, propertyName) { + node.meta = meta; + const containsEsc = this.state.containsEsc; + node.property = this.parseIdentifier(true); + if (node.property.name !== propertyName || containsEsc) { + this.raise(Errors.UnsupportedMetaProperty, node.property, { + target: meta.name, + onlyValidPropertyName: propertyName + }); + } + return this.finishNode(node, "MetaProperty"); + } + parseImportMetaProperty(node) { + const id = this.createIdentifier(this.startNodeAtNode(node), "import"); + this.next(); + if (this.isContextual(101)) { + if (!this.inModule) { + this.raise(Errors.ImportMetaOutsideModule, id); + } + this.sawUnambiguousESM = true; + } else if (this.isContextual(105) || this.isContextual(97)) { + const isSource = this.isContextual(105); + if (!isSource) this.unexpected(); + this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); + if (!this.options.createImportExpressions) { + throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, { + phase: this.state.value + }); + } + this.next(); + node.phase = isSource ? "source" : "defer"; + return this.parseImportCall(node); + } + return this.parseMetaProperty(node, id, "meta"); + } + parseLiteralAtNode(value, type, node) { + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); + node.value = value; + this.next(); + return this.finishNode(node, type); + } + parseLiteral(value, type) { + const node = this.startNode(); + return this.parseLiteralAtNode(value, type, node); + } + parseStringLiteral(value) { + return this.parseLiteral(value, "StringLiteral"); + } + parseNumericLiteral(value) { + return this.parseLiteral(value, "NumericLiteral"); + } + parseBigIntLiteral(value) { + return this.parseLiteral(value, "BigIntLiteral"); + } + parseDecimalLiteral(value) { + return this.parseLiteral(value, "DecimalLiteral"); + } + parseRegExpLiteral(value) { + const node = this.startNode(); + this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); + node.pattern = value.pattern; + node.flags = value.flags; + this.next(); + return this.finishNode(node, "RegExpLiteral"); + } + parseBooleanLiteral(value) { + const node = this.startNode(); + node.value = value; + this.next(); + return this.finishNode(node, "BooleanLiteral"); + } + parseNullLiteral() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "NullLiteral"); + } + parseParenAndDistinguishExpression(canBeArrow) { + const startLoc = this.state.startLoc; + let val; + this.next(); + this.expressionScope.enter(newArrowHeadScope()); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.maybeInArrowParameters = true; + this.state.inFSharpPipelineDirectBody = false; + const innerStartLoc = this.state.startLoc; + const exprList = []; + const refExpressionErrors = new ExpressionErrors(); + let first = true; + let spreadStartLoc; + let optionalCommaStartLoc; + while (!this.match(11)) { + if (first) { + first = false; + } else { + this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); + if (this.match(11)) { + optionalCommaStartLoc = this.state.startLoc; + break; + } + } + if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + spreadStartLoc = this.state.startLoc; + exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); + if (!this.checkCommaAfterRest(41)) { + break; + } + } else { + exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); + } + } + const innerEndLoc = this.state.lastTokEndLoc; + this.expect(11); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let arrowNode = this.startNodeAt(startLoc); + if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + this.parseArrowExpression(arrowNode, exprList, false); + return arrowNode; + } + this.expressionScope.exit(); + if (!exprList.length) { + this.unexpected(this.state.lastTokStartLoc); + } + if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); + if (spreadStartLoc) this.unexpected(spreadStartLoc); + this.checkExpressionErrors(refExpressionErrors, true); + this.toReferencedListDeep(exprList, true); + if (exprList.length > 1) { + val = this.startNodeAt(innerStartLoc); + val.expressions = exprList; + this.finishNode(val, "SequenceExpression"); + this.resetEndLocation(val, innerEndLoc); + } else { + val = exprList[0]; + } + return this.wrapParenthesis(startLoc, val); + } + wrapParenthesis(startLoc, expression) { + if (!this.options.createParenthesizedExpressions) { + this.addExtra(expression, "parenthesized", true); + this.addExtra(expression, "parenStart", startLoc.index); + this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); + return expression; + } + const parenExpression = this.startNodeAt(startLoc); + parenExpression.expression = expression; + return this.finishNode(parenExpression, "ParenthesizedExpression"); + } + shouldParseArrow(params) { + return !this.canInsertSemicolon(); + } + parseArrow(node) { + if (this.eat(19)) { + return node; + } + } + parseParenItem(node, startLoc) { + return node; + } + parseNewOrNewTarget() { + const node = this.startNode(); + this.next(); + if (this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); + this.next(); + const metaProp = this.parseMetaProperty(node, meta, "target"); + if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { + this.raise(Errors.UnexpectedNewTarget, metaProp); + } + return metaProp; + } + return this.parseNew(node); + } + parseNew(node) { + this.parseNewCallee(node); + if (this.eat(10)) { + const args = this.parseExprList(11); + this.toReferencedList(args); + node.arguments = args; + } else { + node.arguments = []; + } + return this.finishNode(node, "NewExpression"); + } + parseNewCallee(node) { + const isImport = this.match(83); + const callee = this.parseNoCallExpr(); + node.callee = callee; + if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { + this.raise(Errors.ImportCallNotNewExpression, callee); + } + } + parseTemplateElement(isTagged) { + const { + start, + startLoc, + end, + value + } = this.state; + const elemStart = start + 1; + const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); + if (value === null) { + if (!isTagged) { + this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); + } + } + const isTail = this.match(24); + const endOffset = isTail ? -1 : -2; + const elemEnd = end + endOffset; + elem.value = { + raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), + cooked: value === null ? null : value.slice(1, endOffset) + }; + elem.tail = isTail; + this.next(); + const finishedNode = this.finishNode(elem, "TemplateElement"); + this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); + return finishedNode; + } + parseTemplate(isTagged) { + const node = this.startNode(); + let curElt = this.parseTemplateElement(isTagged); + const quasis = [curElt]; + const substitutions = []; + while (!curElt.tail) { + substitutions.push(this.parseTemplateSubstitution()); + this.readTemplateContinuation(); + quasis.push(curElt = this.parseTemplateElement(isTagged)); + } + node.expressions = substitutions; + node.quasis = quasis; + return this.finishNode(node, "TemplateLiteral"); + } + parseTemplateSubstitution() { + return this.parseExpression(); + } + parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { + if (isRecord) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const propHash = Object.create(null); + let first = true; + const node = this.startNode(); + node.properties = []; + this.next(); + while (!this.match(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + this.addTrailingCommaExtraToNode(node); + break; + } + } + let prop; + if (isPattern) { + prop = this.parseBindingProperty(); + } else { + prop = this.parsePropertyDefinition(refExpressionErrors); + this.checkProto(prop, isRecord, propHash, refExpressionErrors); + } + if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { + this.raise(Errors.InvalidRecordProperty, prop); + } + { + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } + } + node.properties.push(prop); + } + this.next(); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let type = "ObjectExpression"; + if (isPattern) { + type = "ObjectPattern"; + } else if (isRecord) { + type = "RecordExpression"; + } + return this.finishNode(node, type); + } + addTrailingCommaExtraToNode(node) { + this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); + this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); + } + maybeAsyncOrAccessorProp(prop) { + return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); + } + parsePropertyDefinition(refExpressionErrors) { + let decorators = []; + if (this.match(26)) { + if (this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + } + const prop = this.startNode(); + let isAsync = false; + let isAccessor = false; + let startLoc; + if (this.match(21)) { + if (decorators.length) this.unexpected(); + return this.parseSpread(); + } + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } + prop.method = false; + if (refExpressionErrors) { + startLoc = this.state.startLoc; + } + let isGenerator = this.eat(55); + this.parsePropertyNamePrefixOperator(prop); + const containsEsc = this.state.containsEsc; + this.parsePropertyName(prop, refExpressionErrors); + if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { + const { + key + } = prop; + const keyName = key.name; + if (keyName === "async" && !this.hasPrecedingLineBreak()) { + isAsync = true; + this.resetPreviousNodeTrailingComments(key); + isGenerator = this.eat(55); + this.parsePropertyName(prop); + } + if (keyName === "get" || keyName === "set") { + isAccessor = true; + this.resetPreviousNodeTrailingComments(key); + prop.kind = keyName; + if (this.match(55)) { + isGenerator = true; + this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { + kind: keyName + }); + this.next(); + } + this.parsePropertyName(prop); + } + } + return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); + } + getGetterSetterExpectedParamCount(method) { + return method.kind === "get" ? 0 : 1; + } + getObjectOrClassMethodParams(method) { + return method.params; + } + checkGetterSetterParams(method) { + var _params; + const paramCount = this.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length !== paramCount) { + this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); + } + if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { + this.raise(Errors.BadSetterRestParameter, method); + } + } + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + if (isAccessor) { + const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); + this.checkGetterSetterParams(finishedProp); + return finishedProp; + } + if (isAsync || isGenerator || this.match(10)) { + if (isPattern) this.unexpected(); + prop.kind = "method"; + prop.method = true; + return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); + } + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + prop.shorthand = false; + if (this.eat(14)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); + return this.finishNode(prop, "ObjectProperty"); + } + if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); + if (isPattern) { + prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + } else if (this.match(29)) { + const shorthandAssignLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.shorthandAssignLoc === null) { + refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; + } + } else { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + } else { + prop.value = cloneIdentifier(prop.key); + } + prop.shorthand = true; + return this.finishNode(prop, "ObjectProperty"); + } + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (!node) this.unexpected(); + return node; + } + parsePropertyName(prop, refExpressionErrors) { + if (this.eat(0)) { + prop.computed = true; + prop.key = this.parseMaybeAssignAllowIn(); + this.expect(3); + } else { + const { + type, + value + } = this.state; + let key; + if (tokenIsKeywordOrIdentifier(type)) { + key = this.parseIdentifier(true); + } else { + switch (type) { + case 135: + key = this.parseNumericLiteral(value); + break; + case 134: + key = this.parseStringLiteral(value); + break; + case 136: + key = this.parseBigIntLiteral(value); + break; + case 139: + { + const privateKeyLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.privateKeyLoc === null) { + refExpressionErrors.privateKeyLoc = privateKeyLoc; + } + } else { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + key = this.parsePrivateName(); + break; + } + default: + if (type === 137) { + key = this.parseDecimalLiteral(value); + break; + } + this.unexpected(); + } + } + prop.key = key; + if (type !== 139) { + prop.computed = false; + } + } + } + initFunction(node, isAsync) { + node.id = null; + node.generator = false; + node.async = isAsync; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + this.initFunction(node, isAsync); + node.generator = isGenerator; + this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + this.parseFunctionParams(node, isConstructor); + const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); + this.prodParam.exit(); + this.scope.exit(); + return finishedNode; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + if (isTuple) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const node = this.startNode(); + this.next(); + node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); + } + parseArrowExpression(node, params, isAsync, trailingCommaLoc) { + this.scope.enter(2 | 4); + let flags = functionFlags(isAsync, false); + if (!this.match(5) && this.prodParam.hasIn) { + flags |= 8; + } + this.prodParam.enter(flags); + this.initFunction(node, isAsync); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + if (params) { + this.state.maybeInArrowParameters = true; + this.setArrowFunctionParameters(node, params, trailingCommaLoc); + } + this.state.maybeInArrowParameters = false; + this.parseFunctionBody(node, true); + this.prodParam.exit(); + this.scope.exit(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, "ArrowFunctionExpression"); + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + this.toAssignableList(params, trailingCommaLoc, false); + node.params = params; + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + this.parseFunctionBody(node, false, isMethod); + return this.finishNode(node, type); + } + parseFunctionBody(node, allowExpression, isMethod = false) { + const isExpression = allowExpression && !this.match(5); + this.expressionScope.enter(newExpressionScope()); + if (isExpression) { + node.body = this.parseMaybeAssign(); + this.checkParams(node, false, allowExpression, false); + } else { + const oldStrict = this.state.strict; + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(this.prodParam.currentFlags() | 4); + node.body = this.parseBlock(true, false, hasStrictModeDirective => { + const nonSimple = !this.isSimpleParamList(node.params); + if (hasStrictModeDirective && nonSimple) { + this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); + } + const strictModeChanged = !oldStrict && this.state.strict; + this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); + if (this.state.strict && node.id) { + this.checkIdentifier(node.id, 65, strictModeChanged); + } + }); + this.prodParam.exit(); + this.state.labels = oldLabels; + } + this.expressionScope.exit(); + } + isSimpleParameter(node) { + return node.type === "Identifier"; + } + isSimpleParamList(params) { + for (let i = 0, len = params.length; i < len; i++) { + if (!this.isSimpleParameter(params[i])) return false; + } + return true; + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + const checkClashes = !allowDuplicates && new Set(); + const formalParameters = { + type: "FormalParameters" + }; + for (const param of node.params) { + this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged); + } + } + parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); + } + return elts; + } + parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { + let elt; + if (this.match(12)) { + if (!allowEmpty) { + this.raise(Errors.UnexpectedToken, this.state.curPosition(), { + unexpected: "," + }); + } + elt = null; + } else if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); + } else if (this.match(17)) { + this.expectPlugin("partialApplication"); + if (!allowPlaceholder) { + this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); + } + const node = this.startNode(); + this.next(); + elt = this.finishNode(node, "ArgumentPlaceholder"); + } else { + elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); + } + return elt; + } + parseIdentifier(liberal) { + const node = this.startNode(); + const name = this.parseIdentifierName(liberal); + return this.createIdentifier(node, name); + } + createIdentifier(node, name) { + node.name = name; + node.loc.identifierName = name; + return this.finishNode(node, "Identifier"); + } + parseIdentifierName(liberal) { + let name; + const { + startLoc, + type + } = this.state; + if (tokenIsKeywordOrIdentifier(type)) { + name = this.state.value; + } else { + this.unexpected(); + } + const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); + if (liberal) { + if (tokenIsKeyword) { + this.replaceToken(132); + } + } else { + this.checkReservedWord(name, startLoc, tokenIsKeyword, false); + } + this.next(); + return name; + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word.length > 10) { + return; + } + if (!canBeReservedWord(word)) { + return; + } + if (checkKeywords && isKeyword(word)) { + this.raise(Errors.UnexpectedKeyword, startLoc, { + keyword: word + }); + return; + } + const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; + if (reservedTest(word, this.inModule)) { + this.raise(Errors.UnexpectedReservedWord, startLoc, { + reservedWord: word + }); + return; + } else if (word === "yield") { + if (this.prodParam.hasYield) { + this.raise(Errors.YieldBindingIdentifier, startLoc); + return; + } + } else if (word === "await") { + if (this.prodParam.hasAwait) { + this.raise(Errors.AwaitBindingIdentifier, startLoc); + return; + } + if (this.scope.inStaticBlock) { + this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); + return; + } + this.expressionScope.recordAsyncArrowParametersError(startLoc); + } else if (word === "arguments") { + if (this.scope.inClassAndNotInNonArrowFunction) { + this.raise(Errors.ArgumentsInClass, startLoc); + return; + } + } + } + recordAwaitIfAllowed() { + const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction; + if (isAwaitAllowed && !this.scope.inFunction) { + this.state.hasTopLevelAwait = true; + } + return isAwaitAllowed; + } + parseAwait(startLoc) { + const node = this.startNodeAt(startLoc); + this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); + if (this.eat(55)) { + this.raise(Errors.ObsoleteAwaitStar, node); + } + if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { + if (this.isAmbiguousAwait()) { + this.ambiguousScriptDifferentAst = true; + } else { + this.sawUnambiguousESM = true; + } + } + if (!this.state.soloAwait) { + node.argument = this.parseMaybeUnary(null, true); + } + return this.finishNode(node, "AwaitExpression"); + } + isAmbiguousAwait() { + if (this.hasPrecedingLineBreak()) return true; + const { + type + } = this.state; + return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; + } + parseYield() { + const node = this.startNode(); + this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); + this.next(); + let delegating = false; + let argument = null; + if (!this.hasPrecedingLineBreak()) { + delegating = this.eat(55); + switch (this.state.type) { + case 13: + case 140: + case 8: + case 11: + case 3: + case 9: + case 14: + case 12: + if (!delegating) break; + default: + argument = this.parseMaybeAssign(); + } + } + node.delegate = delegating; + node.argument = argument; + return this.finishNode(node, "YieldExpression"); + } + parseImportCall(node) { + this.next(); + node.source = this.parseMaybeAssignAllowIn(); + node.options = null; + if (this.eat(12)) { + if (!this.match(11)) { + node.options = this.parseMaybeAssignAllowIn(); + if (this.eat(12) && !this.match(11)) { + do { + this.parseMaybeAssignAllowIn(); + } while (this.eat(12) && !this.match(11)); + this.raise(Errors.ImportCallArity, node); + } + } + } + this.expect(11); + return this.finishNode(node, "ImportExpression"); + } + checkPipelineAtInfixOperator(left, leftStartLoc) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + if (left.type === "SequenceExpression") { + this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); + } + } + } + parseSmartPipelineBodyInStyle(childExpr, startLoc) { + if (this.isSimpleReference(childExpr)) { + const bodyNode = this.startNodeAt(startLoc); + bodyNode.callee = childExpr; + return this.finishNode(bodyNode, "PipelineBareFunction"); + } else { + const bodyNode = this.startNodeAt(startLoc); + this.checkSmartPipeTopicBodyEarlyErrors(startLoc); + bodyNode.expression = childExpr; + return this.finishNode(bodyNode, "PipelineTopicExpression"); + } + } + isSimpleReference(expression) { + switch (expression.type) { + case "MemberExpression": + return !expression.computed && this.isSimpleReference(expression.object); + case "Identifier": + return true; + default: + return false; + } + } + checkSmartPipeTopicBodyEarlyErrors(startLoc) { + if (this.match(19)) { + throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipelineTopicUnused, startLoc); + } + } + withTopicBindingContext(callback) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 1, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } + withSmartMixTopicForbiddingContext(callback) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } else { + return callback(); + } + } + withSoloAwaitPermittingContext(callback) { + const outerContextSoloAwaitState = this.state.soloAwait; + this.state.soloAwait = true; + try { + return callback(); + } finally { + this.state.soloAwait = outerContextSoloAwaitState; + } + } + allowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToSet = 8 & ~flags; + if (prodParamToSet) { + this.prodParam.enter(flags | 8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + disallowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToClear = 8 & flags; + if (prodParamToClear) { + this.prodParam.enter(flags & ~8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + registerTopicReference() { + this.state.topicContext.maxTopicIndex = 0; + } + topicReferenceIsAllowedInCurrentContext() { + return this.state.topicContext.maxNumOfResolvableTopics >= 1; + } + topicReferenceWasUsedInCurrentContext() { + return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; + } + parseFSharpPipelineBody(prec) { + const startLoc = this.state.startLoc; + this.state.potentialArrowAt = this.state.start; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = true; + const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } + parseModuleExpression() { + this.expectPlugin("moduleBlocks"); + const node = this.startNode(); + this.next(); + if (!this.match(5)) { + this.unexpected(null, 5); + } + const program = this.startNodeAt(this.state.endLoc); + this.next(); + const revertScopes = this.initializeScopes(true); + this.enterInitialScopes(); + try { + node.body = this.parseProgram(program, 8, "module"); + } finally { + revertScopes(); + } + return this.finishNode(node, "ModuleExpression"); + } + parsePropertyNamePrefixOperator(prop) {} +} +const loopLabel = { + kind: 1 + }, + switchLabel = { + kind: 2 + }; +const loneSurrogate = /[\uD800-\uDFFF]/u; +const keywordRelationalOperator = /in(?:stanceof)?/y; +function babel7CompatTokens(tokens, input, startIndex) { + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const { + type + } = token; + if (typeof type === "number") { + { + if (type === 139) { + const { + loc, + start, + value, + end + } = token; + const hashEndPos = start + 1; + const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); + tokens.splice(i, 1, new Token({ + type: getExportedToken(27), + value: "#", + start: start, + end: hashEndPos, + startLoc: loc.start, + endLoc: hashEndLoc + }), new Token({ + type: getExportedToken(132), + value: value, + start: hashEndPos, + end: end, + startLoc: hashEndLoc, + endLoc: loc.end + })); + i++; + continue; + } + if (tokenIsTemplate(type)) { + const { + loc, + start, + value, + end + } = token; + const backquoteEnd = start + 1; + const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); + let startToken; + if (input.charCodeAt(start - startIndex) === 96) { + startToken = new Token({ + type: getExportedToken(22), + value: "`", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } else { + startToken = new Token({ + type: getExportedToken(8), + value: "}", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } + let templateValue, templateElementEnd, templateElementEndLoc, endToken; + if (type === 24) { + templateElementEnd = end - 1; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); + templateValue = value === null ? null : value.slice(1, -1); + endToken = new Token({ + type: getExportedToken(22), + value: "`", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } else { + templateElementEnd = end - 2; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); + templateValue = value === null ? null : value.slice(1, -2); + endToken = new Token({ + type: getExportedToken(23), + value: "${", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } + tokens.splice(i, 1, startToken, new Token({ + type: getExportedToken(20), + value: templateValue, + start: backquoteEnd, + end: templateElementEnd, + startLoc: backquoteEndLoc, + endLoc: templateElementEndLoc + }), endToken); + i += 2; + continue; + } + } + token.type = getExportedToken(type); + } + } + return tokens; +} +class StatementParser extends ExpressionParser { + parseTopLevel(file, program) { + file.program = this.parseProgram(program); + file.comments = this.comments; + if (this.options.tokens) { + file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); + } + return this.finishNode(file, "File"); + } + parseProgram(program, end = 140, sourceType = this.options.sourceType) { + program.sourceType = sourceType; + program.interpreter = this.parseInterpreterDirective(); + this.parseBlockBody(program, true, true, end); + if (this.inModule) { + if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { + for (const [localName, at] of Array.from(this.scope.undefinedExports)) { + this.raise(Errors.ModuleExportUndefined, at, { + localName + }); + } + } + this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait); + } + let finishedProgram; + if (end === 140) { + finishedProgram = this.finishNode(program, "Program"); + } else { + finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); + } + return finishedProgram; + } + stmtToDirective(stmt) { + const directive = stmt; + directive.type = "Directive"; + directive.value = directive.expression; + delete directive.expression; + const directiveLiteral = directive.value; + const expressionValue = directiveLiteral.value; + const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); + const val = directiveLiteral.value = raw.slice(1, -1); + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); + this.addExtra(directiveLiteral, "expressionValue", expressionValue); + directiveLiteral.type = "DirectiveLiteral"; + return directive; + } + parseInterpreterDirective() { + if (!this.match(28)) { + return null; + } + const node = this.startNode(); + node.value = this.state.value; + this.next(); + return this.finishNode(node, "InterpreterDirective"); + } + isLet() { + if (!this.isContextual(100)) { + return false; + } + return this.hasFollowingBindingAtom(); + } + chStartsBindingIdentifier(ch, pos) { + if (isIdentifierStart(ch)) { + keywordRelationalOperator.lastIndex = pos; + if (keywordRelationalOperator.test(this.input)) { + const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); + if (!isIdentifierChar(endCh) && endCh !== 92) { + return false; + } + } + return true; + } else if (ch === 92) { + return true; + } else { + return false; + } + } + chStartsBindingPattern(ch) { + return ch === 91 || ch === 123; + } + hasFollowingBindingAtom() { + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); + } + hasInLineFollowingBindingIdentifierOrBrace() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); + } + startsUsingForOf() { + const { + type, + containsEsc + } = this.lookahead(); + if (type === 102 && !containsEsc) { + return false; + } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { + this.expectPlugin("explicitResourceManagement"); + return true; + } + } + startsAwaitUsing() { + let next = this.nextTokenInLineStart(); + if (this.isUnparsedContextual(next, "using")) { + next = this.nextTokenInLineStartSince(next + 5); + const nextCh = this.codePointAtPos(next); + if (this.chStartsBindingIdentifier(nextCh, next)) { + this.expectPlugin("explicitResourceManagement"); + return true; + } + } + return false; + } + parseModuleItem() { + return this.parseStatementLike(1 | 2 | 4 | 8); + } + parseStatementListItem() { + return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); + } + parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { + let flags = 0; + if (this.options.annexB && !this.state.strict) { + flags |= 4; + if (allowLabeledFunction) { + flags |= 8; + } + } + return this.parseStatementLike(flags); + } + parseStatement() { + return this.parseStatementLike(0); + } + parseStatementLike(flags) { + let decorators = null; + if (this.match(26)) { + decorators = this.parseDecorators(true); + } + return this.parseStatementContent(flags, decorators); + } + parseStatementContent(flags, decorators) { + const startType = this.state.type; + const node = this.startNode(); + const allowDeclaration = !!(flags & 2); + const allowFunctionDeclaration = !!(flags & 4); + const topLevel = flags & 1; + switch (startType) { + case 60: + return this.parseBreakContinueStatement(node, true); + case 63: + return this.parseBreakContinueStatement(node, false); + case 64: + return this.parseDebuggerStatement(node); + case 90: + return this.parseDoWhileStatement(node); + case 91: + return this.parseForStatement(node); + case 68: + if (this.lookaheadCharCode() === 46) break; + if (!allowFunctionDeclaration) { + this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); + } + return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); + case 80: + if (!allowDeclaration) this.unexpected(); + return this.parseClass(this.maybeTakeDecorators(decorators, node), true); + case 69: + return this.parseIfStatement(node); + case 70: + return this.parseReturnStatement(node); + case 71: + return this.parseSwitchStatement(node); + case 72: + return this.parseThrowStatement(node); + case 73: + return this.parseTryStatement(node); + case 96: + if (!this.state.containsEsc && this.startsAwaitUsing()) { + if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, node); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, node); + } + this.next(); + return this.parseVarStatement(node, "await using"); + } + break; + case 107: + if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { + break; + } + this.expectPlugin("explicitResourceManagement"); + if (!this.scope.inModule && this.scope.inTopLevel) { + this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + return this.parseVarStatement(node, "using"); + case 100: + { + if (this.state.containsEsc) { + break; + } + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + if (nextCh !== 91) { + if (!allowDeclaration && this.hasFollowingLineBreak()) break; + if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { + break; + } + } + } + case 75: + { + if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + } + case 74: + { + const kind = this.state.value; + return this.parseVarStatement(node, kind); + } + case 92: + return this.parseWhileStatement(node); + case 76: + return this.parseWithStatement(node); + case 5: + return this.parseBlock(); + case 13: + return this.parseEmptyStatement(node); + case 83: + { + const nextTokenCharCode = this.lookaheadCharCode(); + if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { + break; + } + } + case 82: + { + if (!this.options.allowImportExportEverywhere && !topLevel) { + this.raise(Errors.UnexpectedImportExport, this.state.startLoc); + } + this.next(); + let result; + if (startType === 83) { + result = this.parseImport(node); + if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { + this.sawUnambiguousESM = true; + } + } else { + result = this.parseExport(node, decorators); + if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { + this.sawUnambiguousESM = true; + } + } + this.assertModuleNodeAllowed(result); + return result; + } + default: + { + if (this.isAsyncFunction()) { + if (!allowDeclaration) { + this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); + } + this.next(); + return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); + } + } + } + const maybeName = this.state.value; + const expr = this.parseExpression(); + if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) { + return this.parseLabeledStatement(node, maybeName, expr, flags); + } else { + return this.parseExpressionStatement(node, expr, decorators); + } + } + assertModuleNodeAllowed(node) { + if (!this.options.allowImportExportEverywhere && !this.inModule) { + this.raise(Errors.ImportOutsideModule, node); + } + } + decoratorsEnabledBeforeExport() { + if (this.hasPlugin("decorators-legacy")) return true; + return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; + } + maybeTakeDecorators(maybeDecorators, classNode, exportNode) { + if (maybeDecorators) { + if (classNode.decorators && classNode.decorators.length > 0) { + if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { + this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); + } + classNode.decorators.unshift(...maybeDecorators); + } else { + classNode.decorators = maybeDecorators; + } + this.resetStartLocationFromNode(classNode, maybeDecorators[0]); + if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); + } + return classNode; + } + canHaveLeadingDecorator() { + return this.match(80); + } + parseDecorators(allowExport) { + const decorators = []; + do { + decorators.push(this.parseDecorator()); + } while (this.match(26)); + if (this.match(82)) { + if (!allowExport) { + this.unexpected(); + } + if (!this.decoratorsEnabledBeforeExport()) { + this.raise(Errors.DecoratorExportClass, this.state.startLoc); + } + } else if (!this.canHaveLeadingDecorator()) { + throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); + } + return decorators; + } + parseDecorator() { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + const node = this.startNode(); + this.next(); + if (this.hasPlugin("decorators")) { + const startLoc = this.state.startLoc; + let expr; + if (this.match(10)) { + const startLoc = this.state.startLoc; + this.next(); + expr = this.parseExpression(); + this.expect(11); + expr = this.wrapParenthesis(startLoc, expr); + const paramsStartLoc = this.state.startLoc; + node.expression = this.parseMaybeDecoratorArguments(expr); + if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { + this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); + } + } else { + expr = this.parseIdentifier(false); + while (this.eat(16)) { + const node = this.startNodeAt(startLoc); + node.object = expr; + if (this.match(139)) { + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + node.computed = false; + expr = this.finishNode(node, "MemberExpression"); + } + node.expression = this.parseMaybeDecoratorArguments(expr); + } + } else { + node.expression = this.parseExprSubscripts(); + } + return this.finishNode(node, "Decorator"); + } + parseMaybeDecoratorArguments(expr) { + if (this.eat(10)) { + const node = this.startNodeAtNode(expr); + node.callee = expr; + node.arguments = this.parseCallExpressionArguments(11); + this.toReferencedList(node.arguments); + return this.finishNode(node, "CallExpression"); + } + return expr; + } + parseBreakContinueStatement(node, isBreak) { + this.next(); + if (this.isLineTerminator()) { + node.label = null; + } else { + node.label = this.parseIdentifier(); + this.semicolon(); + } + this.verifyBreakContinue(node, isBreak); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + } + verifyBreakContinue(node, isBreak) { + let i; + for (i = 0; i < this.state.labels.length; ++i) { + const lab = this.state.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === 1)) { + break; + } + if (node.label && isBreak) break; + } + } + if (i === this.state.labels.length) { + const type = isBreak ? "BreakStatement" : "ContinueStatement"; + this.raise(Errors.IllegalBreakContinue, node, { + type + }); + } + } + parseDebuggerStatement(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + } + parseHeaderExpression() { + this.expect(10); + const val = this.parseExpression(); + this.expect(11); + return val; + } + parseDoWhileStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + this.expect(92); + node.test = this.parseHeaderExpression(); + this.eat(13); + return this.finishNode(node, "DoWhileStatement"); + } + parseForStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + let awaitAt = null; + if (this.isContextual(96) && this.recordAwaitIfAllowed()) { + awaitAt = this.state.startLoc; + this.next(); + } + this.scope.enter(0); + this.expect(10); + if (this.match(13)) { + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + const startsWithLet = this.isContextual(100); + { + const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); + const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf(); + const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; + if (this.match(74) || this.match(75) || isLetOrUsing) { + const initNode = this.startNode(); + let kind; + if (startsWithAwaitUsing) { + kind = "await using"; + if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); + } + this.next(); + } else { + kind = this.state.value; + } + this.next(); + this.parseVar(initNode, true, kind); + const init = this.finishNode(initNode, "VariableDeclaration"); + const isForIn = this.match(58); + if (isForIn && starsWithUsingDeclaration) { + this.raise(Errors.ForInUsing, init); + } + if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { + return this.parseForIn(node, init, awaitAt); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + } + const startsWithAsync = this.isContextual(95); + const refExpressionErrors = new ExpressionErrors(); + const init = this.parseExpression(true, refExpressionErrors); + const isForOf = this.isContextual(102); + if (isForOf) { + if (startsWithLet) { + this.raise(Errors.ForOfLet, init); + } + if (awaitAt === null && startsWithAsync && init.type === "Identifier") { + this.raise(Errors.ForOfAsync, init); + } + } + if (isForOf || this.match(58)) { + this.checkDestructuringPrivate(refExpressionErrors); + this.toAssignable(init, true); + const type = isForOf ? "ForOfStatement" : "ForInStatement"; + this.checkLVal(init, { + type + }); + return this.parseForIn(node, init, awaitAt); + } else { + this.checkExpressionErrors(refExpressionErrors, true); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + parseFunctionStatement(node, isAsync, isHangingDeclaration) { + this.next(); + return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); + } + parseIfStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); + node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; + return this.finishNode(node, "IfStatement"); + } + parseReturnStatement(node) { + if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { + this.raise(Errors.IllegalReturn, this.state.startLoc); + } + this.next(); + if (this.isLineTerminator()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + } + parseSwitchStatement(node) { + this.next(); + node.discriminant = this.parseHeaderExpression(); + const cases = node.cases = []; + this.expect(5); + this.state.labels.push(switchLabel); + this.scope.enter(0); + let cur; + for (let sawDefault; !this.match(8);) { + if (this.match(61) || this.match(65)) { + const isCase = this.match(61); + if (cur) this.finishNode(cur, "SwitchCase"); + cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); + } + sawDefault = true; + cur.test = null; + } + this.expect(14); + } else { + if (cur) { + cur.consequent.push(this.parseStatementListItem()); + } else { + this.unexpected(); + } + } + } + this.scope.exit(); + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + } + parseThrowStatement(node) { + this.next(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + } + parseCatchClauseParam() { + const param = this.parseBindingAtom(); + this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); + this.checkLVal(param, { + type: "CatchClause" + }, 9); + return param; + } + parseTryStatement(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.match(62)) { + const clause = this.startNode(); + this.next(); + if (this.match(10)) { + this.expect(10); + clause.param = this.parseCatchClauseParam(); + this.expect(11); + } else { + clause.param = null; + this.scope.enter(0); + } + clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); + this.scope.exit(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(67) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(Errors.NoCatchOrFinally, node); + } + return this.finishNode(node, "TryStatement"); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + this.next(); + this.parseVar(node, false, kind, allowMissingInitializer); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } + parseWhileStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); + } + parseWithStatement(node) { + if (this.state.strict) { + this.raise(Errors.StrictWith, this.state.startLoc); + } + this.next(); + node.object = this.parseHeaderExpression(); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + return this.finishNode(node, "WithStatement"); + } + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + } + parseLabeledStatement(node, maybeName, expr, flags) { + for (const label of this.state.labels) { + if (label.name === maybeName) { + this.raise(Errors.LabelRedeclaration, expr, { + labelName: maybeName + }); + } + } + const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; + for (let i = this.state.labels.length - 1; i >= 0; i--) { + const label = this.state.labels[i]; + if (label.statementStart === node.start) { + label.statementStart = this.sourceToOffsetPos(this.state.start); + label.kind = kind; + } else { + break; + } + } + this.state.labels.push({ + name: maybeName, + kind: kind, + statementStart: this.sourceToOffsetPos(this.state.start) + }); + node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + } + parseExpressionStatement(node, expr, decorators) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + } + parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { + const node = this.startNode(); + if (allowDirectives) { + this.state.strictErrors.clear(); + } + this.expect(5); + if (createNewLexicalScope) { + this.scope.enter(0); + } + this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); + if (createNewLexicalScope) { + this.scope.exit(); + } + return this.finishNode(node, "BlockStatement"); + } + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + const body = node.body = []; + const directives = node.directives = []; + this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); + } + parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const oldStrict = this.state.strict; + let hasStrictModeDirective = false; + let parsedNonDirective = false; + while (!this.match(end)) { + const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); + if (directives && !parsedNonDirective) { + if (this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + directives.push(directive); + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; + this.setStrict(true); + } + continue; + } + parsedNonDirective = true; + this.state.strictErrors.clear(); + } + body.push(stmt); + } + afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); + if (!oldStrict) { + this.setStrict(false); + } + this.next(); + } + parseFor(node, init) { + node.init = init; + this.semicolon(false); + node.test = this.match(13) ? null : this.parseExpression(); + this.semicolon(false); + node.update = this.match(11) ? null : this.parseExpression(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); + } + parseForIn(node, init, awaitAt) { + const isForIn = this.match(58); + this.next(); + if (isForIn) { + if (awaitAt !== null) this.unexpected(awaitAt); + } else { + node.await = awaitAt !== null; + } + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise(Errors.ForInOfLoopInitializer, init, { + type: isForIn ? "ForInStatement" : "ForOfStatement" + }); + } + if (init.type === "AssignmentPattern") { + this.raise(Errors.InvalidLhs, init, { + ancestor: { + type: "ForStatement" + } + }); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + } + parseVar(node, isFor, kind, allowMissingInitializer = false) { + const declarations = node.declarations = []; + node.kind = kind; + for (;;) { + const decl = this.startNode(); + this.parseVarId(decl, kind); + decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); + if (decl.init === null && !allowMissingInitializer) { + if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind: "destructuring" + }); + } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind + }); + } + } + declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(12)) break; + } + return node; + } + parseVarId(decl, kind) { + const id = this.parseBindingAtom(); + if (kind === "using" || kind === "await using") { + if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { + this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); + } + } + this.checkLVal(id, { + type: "VariableDeclarator" + }, kind === "var" ? 5 : 8201); + decl.id = id; + } + parseAsyncFunctionExpression(node) { + return this.parseFunction(node, 8); + } + parseFunction(node, flags = 0) { + const hangingDeclaration = flags & 2; + const isDeclaration = !!(flags & 1); + const requireId = isDeclaration && !(flags & 4); + const isAsync = !!(flags & 8); + this.initFunction(node, isAsync); + if (this.match(55)) { + if (hangingDeclaration) { + this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); + } + this.next(); + node.generator = true; + } + if (isDeclaration) { + node.id = this.parseFunctionId(requireId); + } + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = false; + this.scope.enter(2); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + if (!isDeclaration) { + node.id = this.parseFunctionId(); + } + this.parseFunctionParams(node, false); + this.withSmartMixTopicForbiddingContext(() => { + this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); + }); + this.prodParam.exit(); + this.scope.exit(); + if (isDeclaration && !hangingDeclaration) { + this.registerFunctionStatementId(node); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return node; + } + parseFunctionId(requireId) { + return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; + } + parseFunctionParams(node, isConstructor) { + this.expect(10); + this.expressionScope.enter(newParameterDeclarationScope()); + node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); + this.expressionScope.exit(); + } + registerFunctionStatementId(node) { + if (!node.id) return; + this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); + } + parseClass(node, isStatement, optionalId) { + this.next(); + const oldStrict = this.state.strict; + this.state.strict = true; + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + node.body = this.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } + isClassProperty() { + return this.match(29) || this.match(13) || this.match(8); + } + isClassMethod() { + return this.match(10); + } + nameIsConstructor(key) { + return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor"; + } + isNonstaticConstructor(method) { + return !method.computed && !method.static && this.nameIsConstructor(method.key); + } + parseClassBody(hadSuperClass, oldStrict) { + this.classScope.enter(); + const state = { + hadConstructor: false, + hadSuperClass + }; + let decorators = []; + const classBody = this.startNode(); + classBody.body = []; + this.expect(5); + this.withSmartMixTopicForbiddingContext(() => { + while (!this.match(8)) { + if (this.eat(13)) { + if (decorators.length > 0) { + throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); + } + continue; + } + if (this.match(26)) { + decorators.push(this.parseDecorator()); + continue; + } + const member = this.startNode(); + if (decorators.length) { + member.decorators = decorators; + this.resetStartLocationFromNode(member, decorators[0]); + decorators = []; + } + this.parseClassMember(classBody, member, state); + if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { + this.raise(Errors.DecoratorConstructor, member); + } + } + }); + this.state.strict = oldStrict; + this.next(); + if (decorators.length) { + throw this.raise(Errors.TrailingDecorator, this.state.startLoc); + } + this.classScope.exit(); + return this.finishNode(classBody, "ClassBody"); + } + parseClassMemberFromModifier(classBody, member) { + const key = this.parseIdentifier(true); + if (this.isClassMethod()) { + const method = member; + method.kind = "method"; + method.computed = false; + method.key = key; + method.static = false; + this.pushClassMethod(classBody, method, false, false, false, false); + return true; + } else if (this.isClassProperty()) { + const prop = member; + prop.computed = false; + prop.key = key; + prop.static = false; + classBody.body.push(this.parseClassProperty(prop)); + return true; + } + this.resetPreviousNodeTrailingComments(key); + return false; + } + parseClassMember(classBody, member, state) { + const isStatic = this.isContextual(106); + if (isStatic) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } + if (this.eat(5)) { + this.parseClassStaticBlock(classBody, member); + return; + } + } + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const publicMethod = member; + const privateMethod = member; + const publicProp = member; + const privateProp = member; + const accessorProp = member; + const method = publicMethod; + const publicMember = publicMethod; + member.static = isStatic; + this.parsePropertyNamePrefixOperator(member); + if (this.eat(55)) { + method.kind = "method"; + const isPrivateName = this.match(139); + this.parseClassElementName(method); + if (isPrivateName) { + this.pushClassPrivateMethod(classBody, privateMethod, true, false); + return; + } + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsGenerator, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, true, false, false, false); + return; + } + const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type); + const key = this.parseClassElementName(member); + const maybeContextualKw = isContextual ? key.name : null; + const isPrivate = this.isPrivateName(key); + const maybeQuestionTokenStartLoc = this.state.startLoc; + this.parsePostMemberNameModifiers(publicMember); + if (this.isClassMethod()) { + method.kind = "method"; + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + return; + } + const isConstructor = this.isNonstaticConstructor(publicMethod); + let allowsDirectSuper = false; + if (isConstructor) { + publicMethod.kind = "constructor"; + if (state.hadConstructor && !this.hasPlugin("typescript")) { + this.raise(Errors.DuplicateConstructor, key); + } + if (isConstructor && this.hasPlugin("typescript") && member.override) { + this.raise(Errors.OverrideOnConstructor, key); + } + state.hadConstructor = true; + allowsDirectSuper = state.hadSuperClass; + } + this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); + } else if (this.isClassProperty()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else if (maybeContextualKw === "async" && !this.isLineTerminator()) { + this.resetPreviousNodeTrailingComments(key); + const isGenerator = this.eat(55); + if (publicMember.optional) { + this.unexpected(maybeQuestionTokenStartLoc); + } + method.kind = "method"; + const isPrivate = this.match(139); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(publicMember); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAsync, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); + } + } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) { + this.resetPreviousNodeTrailingComments(key); + method.kind = maybeContextualKw; + const isPrivate = this.match(139); + this.parseClassElementName(publicMethod); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAccessor, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, false, false, false, false); + } + this.checkGetterSetterParams(publicMethod); + } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) { + this.expectPlugin("decoratorAutoAccessors"); + this.resetPreviousNodeTrailingComments(key); + const isPrivate = this.match(139); + this.parseClassElementName(publicProp); + this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); + } else if (this.isLineTerminator()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else { + this.unexpected(); + } + } + parseClassElementName(member) { + const { + type, + value + } = this.state; + if ((type === 132 || type === 134) && member.static && value === "prototype") { + this.raise(Errors.StaticPrototype, this.state.startLoc); + } + if (type === 139) { + if (value === "constructor") { + this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); + } + const key = this.parsePrivateName(); + member.key = key; + return key; + } + this.parsePropertyName(member); + return member.key; + } + parseClassStaticBlock(classBody, member) { + var _member$decorators; + this.scope.enter(64 | 128 | 16); + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(0); + const body = member.body = []; + this.parseBlockOrModuleBlockBody(body, undefined, false, 8); + this.prodParam.exit(); + this.scope.exit(); + this.state.labels = oldLabels; + classBody.body.push(this.finishNode(member, "StaticBlock")); + if ((_member$decorators = member.decorators) != null && _member$decorators.length) { + this.raise(Errors.DecoratorStaticBlock, member); + } + } + pushClassProperty(classBody, prop) { + if (!prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + classBody.body.push(this.parseClassProperty(prop)); + } + pushClassPrivateProperty(classBody, prop) { + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + pushClassAccessorProperty(classBody, prop, isPrivate) { + if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + const node = this.parseClassAccessorProperty(prop); + classBody.body.push(node); + if (isPrivate) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); + classBody.body.push(node); + const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; + this.declareClassPrivateMethodInScope(node, kind); + } + declareClassPrivateMethodInScope(node, kind) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); + } + parsePostMemberNameModifiers(methodOrProp) {} + parseClassPrivateProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassPrivateProperty"); + } + parseClassProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassProperty"); + } + parseClassAccessorProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassAccessorProperty"); + } + parseInitializer(node) { + this.scope.enter(64 | 16); + this.expressionScope.enter(newExpressionScope()); + this.prodParam.enter(0); + node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; + this.expressionScope.exit(); + this.prodParam.exit(); + this.scope.exit(); + } + parseClassId(node, isStatement, optionalId, bindingType = 8331) { + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + if (isStatement) { + this.declareNameFromIdentifier(node.id, bindingType); + } + } else { + if (optionalId || !isStatement) { + node.id = null; + } else { + throw this.raise(Errors.MissingClassName, this.state.startLoc); + } + } + } + parseClassSuper(node) { + node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; + } + parseExport(node, decorators) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); + const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + const parseAfterDefault = !hasDefault || this.eat(12); + const hasStar = parseAfterDefault && this.eatExportStar(node); + const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); + const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); + const isFromRequired = hasDefault || hasStar; + if (hasStar && !hasNamespace) { + if (hasDefault) this.unexpected(); + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, true); + return this.finishNode(node, "ExportAllDeclaration"); + } + const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); + if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { + this.unexpected(null, 5); + } + if (hasNamespace && parseAfterNamespace) { + this.unexpected(null, 98); + } + let hasDeclaration; + if (isFromRequired || hasSpecifiers) { + hasDeclaration = false; + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, isFromRequired); + } else { + hasDeclaration = this.maybeParseExportDeclaration(node); + } + if (isFromRequired || hasSpecifiers || hasDeclaration) { + var _node2$declaration; + const node2 = node; + this.checkExport(node2, true, false, !!node2.source); + if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, node2.declaration, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + return this.finishNode(node2, "ExportNamedDeclaration"); + } + if (this.eat(65)) { + const node2 = node; + const decl = this.parseExportDefaultExpression(); + node2.declaration = decl; + if (decl.type === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, decl, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.checkExport(node2, true, true); + return this.finishNode(node2, "ExportDefaultDeclaration"); + } + this.unexpected(null, 5); + } + eatExportStar(node) { + return this.eat(55); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { + this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); + const id = maybeDefaultIdentifier || this.parseIdentifier(true); + const specifier = this.startNodeAtNode(id); + specifier.exported = id; + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + if (this.isContextual(93)) { + var _ref, _ref$specifiers; + (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = []; + const specifier = this.startNodeAt(this.state.lastTokStartLoc); + this.next(); + specifier.exported = this.parseModuleExportName(); + node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); + return true; + } + return false; + } + maybeParseExportNamedSpecifiers(node) { + if (this.match(5)) { + const node2 = node; + if (!node2.specifiers) node2.specifiers = []; + const isTypeExport = node2.exportKind === "type"; + node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); + node2.source = null; + node2.declaration = null; + if (this.hasPlugin("importAssertions")) { + node2.assertions = []; + } + return true; + } + return false; + } + maybeParseExportDeclaration(node) { + if (this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + if (this.hasPlugin("importAssertions")) { + node.assertions = []; + } + node.declaration = this.parseExportDeclaration(node); + return true; + } + return false; + } + isAsyncFunction() { + if (!this.isContextual(95)) return false; + const next = this.nextTokenInLineStart(); + return this.isUnparsedContextual(next, "function"); + } + parseExportDefaultExpression() { + const expr = this.startNode(); + if (this.match(68)) { + this.next(); + return this.parseFunction(expr, 1 | 4); + } else if (this.isAsyncFunction()) { + this.next(); + this.next(); + return this.parseFunction(expr, 1 | 4 | 8); + } + if (this.match(80)) { + return this.parseClass(expr, true, true); + } + if (this.match(26)) { + if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); + } + if (this.match(75) || this.match(74) || this.isLet()) { + throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); + } + const res = this.parseMaybeAssignAllowIn(); + this.semicolon(); + return res; + } + parseExportDeclaration(node) { + if (this.match(80)) { + const node = this.parseClass(this.startNode(), true, false); + return node; + } + return this.parseStatementListItem(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (tokenIsIdentifier(type)) { + if (type === 95 && !this.state.containsEsc || type === 100) { + return false; + } + if ((type === 130 || type === 129) && !this.state.containsEsc) { + const { + type: nextType + } = this.lookahead(); + if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) { + this.expectOnePlugin(["flow", "typescript"]); + return false; + } + } + } else if (!this.match(65)) { + return false; + } + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { + return true; + } + if (this.match(65) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + return false; + } + parseExportFrom(node, expect) { + if (this.eatContextual(98)) { + node.source = this.parseImportSource(); + this.checkExport(node); + this.maybeParseImportAttributes(node); + this.checkJSONModuleImport(node); + } else if (expect) { + this.unexpected(); + } + this.semicolon(); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 26) { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + if (this.hasPlugin("decorators")) { + if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return true; + } + } + if (this.isContextual(107)) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + if (this.isContextual(96) && this.startsAwaitUsing()) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); + } + checkExport(node, checkNames, isDefault, isFrom) { + if (checkNames) { + var _node$specifiers; + if (isDefault) { + this.checkDuplicateExports(node, "default"); + if (this.hasPlugin("exportDefaultFrom")) { + var _declaration$extra; + const declaration = node.declaration; + if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { + this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); + } + } + } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { + for (const specifier of node.specifiers) { + const { + exported + } = specifier; + const exportName = exported.type === "Identifier" ? exported.name : exported.value; + this.checkDuplicateExports(specifier, exportName); + if (!isFrom && specifier.local) { + const { + local + } = specifier; + if (local.type !== "Identifier") { + this.raise(Errors.ExportBindingIsString, specifier, { + localName: local.value, + exportName + }); + } else { + this.checkReservedWord(local.name, local.loc.start, true, false); + this.scope.checkLocalExport(local); + } + } + } + } else if (node.declaration) { + const decl = node.declaration; + if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") { + const { + id + } = decl; + if (!id) throw new Error("Assertion failure"); + this.checkDuplicateExports(node, id.name); + } else if (decl.type === "VariableDeclaration") { + for (const declaration of decl.declarations) { + this.checkDeclaration(declaration.id); + } + } + } + } + } + checkDeclaration(node) { + if (node.type === "Identifier") { + this.checkDuplicateExports(node, node.name); + } else if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); + } + } else if (node.type === "ArrayPattern") { + for (const elem of node.elements) { + if (elem) { + this.checkDeclaration(elem); + } + } + } else if (node.type === "ObjectProperty") { + this.checkDeclaration(node.value); + } else if (node.type === "RestElement") { + this.checkDeclaration(node.argument); + } else if (node.type === "AssignmentPattern") { + this.checkDeclaration(node.left); + } + } + checkDuplicateExports(node, exportName) { + if (this.exportedIdentifiers.has(exportName)) { + if (exportName === "default") { + this.raise(Errors.DuplicateDefaultExport, node); + } else { + this.raise(Errors.DuplicateExport, node, { + exportName + }); + } + } + this.exportedIdentifiers.add(exportName); + } + parseExportSpecifiers(isInTypeExport) { + const nodes = []; + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.eat(8)) break; + } + const isMaybeTypeOnly = this.isContextual(130); + const isString = this.match(134); + const node = this.startNode(); + node.local = this.parseModuleExportName(); + nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); + } + return nodes; + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (this.eatContextual(93)) { + node.exported = this.parseModuleExportName(); + } else if (isString) { + node.exported = cloneStringLiteral(node.local); + } else if (!node.exported) { + node.exported = cloneIdentifier(node.local); + } + return this.finishNode(node, "ExportSpecifier"); + } + parseModuleExportName() { + if (this.match(134)) { + const result = this.parseStringLiteral(this.state.value); + const surrogate = loneSurrogate.exec(result.value); + if (surrogate) { + this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { + surrogateCharCode: surrogate[0].charCodeAt(0) + }); + } + return result; + } + return this.parseIdentifier(true); + } + isJSONModuleImport(node) { + if (node.assertions != null) { + return node.assertions.some(({ + key, + value + }) => { + return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); + }); + } + return false; + } + checkImportReflection(node) { + const { + specifiers + } = node; + const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; + if (node.phase === "source") { + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); + } + } else if (node.phase === "defer") { + if (singleBindingType !== "ImportNamespaceSpecifier") { + this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); + } + } else if (node.module) { + var _node$assertions; + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); + } + if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { + this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); + } + } + } + checkJSONModuleImport(node) { + if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { + const { + specifiers + } = node; + if (specifiers != null) { + const nonDefaultNamedSpecifier = specifiers.find(specifier => { + let imported; + if (specifier.type === "ExportSpecifier") { + imported = specifier.local; + } else if (specifier.type === "ImportSpecifier") { + imported = specifier.imported; + } + if (imported !== undefined) { + return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; + } + }); + if (nonDefaultNamedSpecifier !== undefined) { + this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); + } + } + } + } + isPotentialImportPhase(isExport) { + if (isExport) return false; + return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); + } + applyImportPhase(node, isExport, phase, loc) { + if (isExport) { + return; + } + if (phase === "module") { + this.expectPlugin("importReflection", loc); + node.module = true; + } else if (this.hasPlugin("importReflection")) { + node.module = false; + } + if (phase === "source") { + this.expectPlugin("sourcePhaseImports", loc); + node.phase = "source"; + } else if (phase === "defer") { + this.expectPlugin("deferredImportEvaluation", loc); + node.phase = "defer"; + } else if (this.hasPlugin("sourcePhaseImports")) { + node.phase = null; + } + } + parseMaybeImportPhase(node, isExport) { + if (!this.isPotentialImportPhase(isExport)) { + this.applyImportPhase(node, isExport, null); + return null; + } + const phaseIdentifier = this.parseIdentifier(true); + const { + type + } = this.state; + const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + if (isImportPhase) { + this.resetPreviousIdentifierLeadingComments(phaseIdentifier); + this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); + return null; + } else { + this.applyImportPhase(node, isExport, null); + return phaseIdentifier; + } + } + isPrecedingIdImportPhase(phase) { + const { + type + } = this.state; + return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + } + parseImport(node) { + if (this.match(134)) { + return this.parseImportSourceAndAttributes(node); + } + return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); + } + parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { + node.specifiers = []; + const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); + const parseNext = !hasDefault || this.eat(12); + const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); + if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); + this.expectContextual(98); + return this.parseImportSourceAndAttributes(node); + } + parseImportSourceAndAttributes(node) { + var _node$specifiers2; + (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; + node.source = this.parseImportSource(); + this.maybeParseImportAttributes(node); + this.checkImportReflection(node); + this.checkJSONModuleImport(node); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + if (!this.match(134)) this.unexpected(); + return this.parseExprAtom(); + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + finishImportSpecifier(specifier, type, bindingType = 8201) { + this.checkLVal(specifier.local, { + type + }, bindingType); + return this.finishNode(specifier, type); + } + parseImportAttributes() { + this.expect(5); + const attrs = []; + const attrNames = new Set(); + do { + if (this.match(8)) { + break; + } + const node = this.startNode(); + const keyName = this.state.value; + if (attrNames.has(keyName)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { + key: keyName + }); + } + attrNames.add(keyName); + if (this.match(134)) { + node.key = this.parseStringLiteral(keyName); + } else { + node.key = this.parseIdentifier(true); + } + this.expect(14); + if (!this.match(134)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + this.expect(8); + return attrs; + } + parseModuleAttributes() { + const attrs = []; + const attributes = new Set(); + do { + const node = this.startNode(); + node.key = this.parseIdentifier(true); + if (node.key.name !== "type") { + this.raise(Errors.ModuleAttributeDifferentFromType, node.key); + } + if (attributes.has(node.key.name)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { + key: node.key.name + }); + } + attributes.add(node.key.name); + this.expect(14); + if (!this.match(134)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + return attrs; + } + maybeParseImportAttributes(node) { + let attributes; + { + var useWith = false; + } + if (this.match(76)) { + if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { + return; + } + this.next(); + if (this.hasPlugin("moduleAttributes")) { + attributes = this.parseModuleAttributes(); + } else { + attributes = this.parseImportAttributes(); + } + { + useWith = true; + } + } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { + if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) { + this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); + } + if (!this.hasPlugin("importAssertions")) { + this.addExtra(node, "deprecatedAssertSyntax", true); + } + this.next(); + attributes = this.parseImportAttributes(); + } else { + attributes = []; + } + if (!useWith && this.hasPlugin("importAssertions")) { + node.assertions = attributes; + } else { + node.attributes = attributes; + } + } + maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier) { + const specifier = this.startNodeAtNode(maybeDefaultIdentifier); + specifier.local = maybeDefaultIdentifier; + node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); + return true; + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); + return true; + } + return false; + } + maybeParseStarImportSpecifier(node) { + if (this.match(55)) { + const specifier = this.startNode(); + this.next(); + this.expectContextual(93); + this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); + return true; + } + return false; + } + parseNamedImportSpecifiers(node) { + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + if (this.eat(14)) { + throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); + } + this.expect(12); + if (this.eat(8)) break; + } + const specifier = this.startNode(); + const importedIsString = this.match(134); + const isMaybeTypeOnly = this.isContextual(130); + specifier.imported = this.parseModuleExportName(); + const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); + node.specifiers.push(importSpecifier); + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + const { + imported + } = specifier; + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: imported.value + }); + } + this.checkReservedWord(imported.name, specifier.loc.start, true, true); + if (!specifier.local) { + specifier.local = cloneIdentifier(imported); + } + } + return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); + } + isThisParam(param) { + return param.type === "Identifier" && param.name === "this"; + } +} +class Parser extends StatementParser { + constructor(options, input, pluginsMap) { + options = getOptions(options); + super(options, input); + this.options = options; + this.initializeScopes(); + this.plugins = pluginsMap; + this.filename = options.sourceFilename; + this.startIndex = options.startIndex; + } + getScopeHandler() { + return ScopeHandler; + } + parse() { + this.enterInitialScopes(); + const file = this.startNode(); + const program = this.startNode(); + this.nextToken(); + file.errors = null; + this.parseTopLevel(file, program); + file.errors = this.state.errors; + file.comments.length = this.state.commentsLen; + return file; + } +} +function parse(input, options) { + var _options; + if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { + options = Object.assign({}, options); + try { + options.sourceType = "module"; + const parser = getParser(options, input); + const ast = parser.parse(); + if (parser.sawUnambiguousESM) { + return ast; + } + if (parser.ambiguousScriptDifferentAst) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused) {} + } else { + ast.program.sourceType = "script"; + } + return ast; + } catch (moduleError) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused2) {} + throw moduleError; + } + } else { + return getParser(options, input).parse(); + } +} +function parseExpression(input, options) { + const parser = getParser(options, input); + if (parser.options.strictMode) { + parser.state.strict = true; + } + return parser.getExpression(); +} +function generateExportedTokenTypes(internalTokenTypes) { + const tokenTypes = {}; + for (const typeName of Object.keys(internalTokenTypes)) { + tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); + } + return tokenTypes; +} +const tokTypes = generateExportedTokenTypes(tt); +function getParser(options, input) { + let cls = Parser; + const pluginsMap = new Map(); + if (options != null && options.plugins) { + for (const plugin of options.plugins) { + let name, opts; + if (typeof plugin === "string") { + name = plugin; + } else { + [name, opts] = plugin; + } + if (!pluginsMap.has(name)) { + pluginsMap.set(name, opts || {}); + } + } + validatePlugins(pluginsMap); + cls = getParserClass(pluginsMap); + } + return new cls(options, input, pluginsMap); +} +const parserClassCache = new Map(); +function getParserClass(pluginsMap) { + const pluginList = []; + for (const name of mixinPluginNames) { + if (pluginsMap.has(name)) { + pluginList.push(name); + } + } + const key = pluginList.join("|"); + let cls = parserClassCache.get(key); + if (!cls) { + cls = Parser; + for (const plugin of pluginList) { + cls = mixinPlugins[plugin](cls); + } + parserClassCache.set(key, cls); + } + return cls; +} +exports.parse = parse; +exports.parseExpression = parseExpression; +exports.tokTypes = tokTypes; +//# sourceMappingURL=index.js.map diff --git a/seller_1/node_modules/@babel/parser/lib/index.js.map b/seller_1/node_modules/@babel/parser/lib/index.js.map new file mode 100644 index 0000000..5fe8c1b --- /dev/null +++ b/seller_1/node_modules/@babel/parser/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/options.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\nconst toNodeDescription = (node: NodeWithDescription) =>\n node.type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[`${node.prefix}`]\n : NodeDescriptions[node.type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"await using\" | \"const\" | \"destructuring\" | \"using\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeferImportRequiresNamespace:\n 'Only `import defer * as x from \"./module\"` is valid.',\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n DynamicImportPhaseRequiresImportExpressions: ({ phase }: { phase: string }) =>\n `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArity: `\\`import()\\` requires exactly one or two arguments.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsOptionalChaining: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid optional chaining in the left-hand side of ${toNodeDescription(\n ancestor,\n )}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is disallowed as a lexically bound name.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n SourcePhaseImportRequiresDefault:\n 'Only `import source x from \"./module\"` is valid.',\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationExport: \"Using declaration cannot be exported.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error\";\n\nexport default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> =\n T extends Set ? M : unknown;\n\nexport type UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n} satisfies ParseErrorTemplates;\n","import { Position } from \"./util/location.ts\";\n\ntype SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\ntype ParseErrorCode =\n | \"BABEL_PARSER_SYNTAX_ERROR\"\n | \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (\n loc: Position,\n details: ErrorDetails,\n) => ParseError;\n\ntype ToMessage = (self: ErrorDetails) => string;\n\ntype ParseErrorCredentials = {\n code: string;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nfunction defineHidden(obj: object, key: string, value: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n configurable: true,\n value,\n });\n}\n\nfunction toParseErrorConstructor({\n toMessage,\n code,\n reasonCode,\n syntaxPlugin,\n}: ParseErrorCredentials): ParseErrorConstructor {\n const hasMissingPlugin =\n reasonCode === \"MissingPlugin\" || reasonCode === \"MissingOneOfPlugins\";\n\n if (!process.env.BABEL_8_BREAKING) {\n const oldReasonCodes: Record = {\n AccessorCannotDeclareThisParameter: \"AccesorCannotDeclareThisParameter\",\n AccessorCannotHaveTypeParameters: \"AccesorCannotHaveTypeParameters\",\n ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference\",\n SetAccessorCannotHaveOptionalParameter:\n \"SetAccesorCannotHaveOptionalParameter\",\n SetAccessorCannotHaveRestParameter: \"SetAccesorCannotHaveRestParameter\",\n SetAccessorCannotHaveReturnType: \"SetAccesorCannotHaveReturnType\",\n };\n if (oldReasonCodes[reasonCode]) {\n reasonCode = oldReasonCodes[reasonCode];\n }\n }\n\n return function constructor(loc: Position, details: ErrorDetails) {\n const error: ParseError = new SyntaxError() as any;\n\n error.code = code as ParseErrorCode;\n error.reasonCode = reasonCode;\n error.loc = loc;\n error.pos = loc.index;\n\n error.syntaxPlugin = syntaxPlugin;\n if (hasMissingPlugin) {\n error.missingPlugin = (details as any).missingPlugin;\n }\n\n type Overrides = {\n loc?: Position;\n details?: ErrorDetails;\n };\n defineHidden(error, \"clone\", function clone(overrides: Overrides = {}) {\n const { line, column, index } = overrides.loc ?? loc;\n return constructor(new Position(line, column, index), {\n ...details,\n ...overrides.details,\n });\n });\n\n defineHidden(error, \"details\", details);\n\n Object.defineProperty(error, \"message\", {\n configurable: true,\n get(this: ParseError): string {\n const message = `${toMessage(details)} (${loc.line}:${loc.column})`;\n this.message = message;\n return message;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value, writable: true });\n },\n });\n\n return error;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage; code?: ParseErrorCode };\n\nexport type ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: \"AN_ERROR_CODE\",\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: \"BABEL_PARSER_SYNTAX_ERROR\",\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nimport ModuleErrors from \"./parse-error/module-errors.ts\";\nimport StandardErrors from \"./parse-error/standard-errors.ts\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors.ts\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors.ts\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors.ts\";\n","import type { TokenType } from \"../tokenizer/types.ts\";\nimport type Parser from \"../parser/index.ts\";\nimport type { ExpressionErrors } from \"../parser/util.ts\";\nimport type * as N from \"../types.ts\";\nimport type { Node as NodeType, NodeBase, File } from \"../types.ts\";\nimport type { Position } from \"../util/location.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { BindingFlag } from \"../util/scopeflags.ts\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) => {\n if (object) {\n defineProperty(object, key, { enumerable: false, value: object[key] });\n }\n};\n\nfunction toESTreeLocation(node: any) {\n toUnenumerable(node.loc.start, \"index\");\n toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (_) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: bigint | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n // @ts-expect-error ESTree plugin changes node types\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as unknown as N.EstreeMethodDefinition).value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error mutate AST types\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isPrivateName(node: N.Node): node is N.EstreePrivateIdentifier {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n // @ts-expect-error ESTree plugin changes node types\n getPrivateNameSV(node: N.EstreePrivateIdentifier): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node as unknown as N.PrivateName);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n\n nameIsConstructor(key: N.Expression | N.PrivateName): boolean {\n if (key.type === \"Literal\") return key.value === \"constructor\";\n return super.nameIsConstructor(key);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingFlag,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (\n prop.type === \"Property\" &&\n (prop.kind === \"get\" || prop.kind === \"set\")\n ) {\n this.raise(Errors.PatternHasAccessor, prop.key);\n } else if (prop.type === \"Property\" && prop.method) {\n this.raise(Errors.PatternHasMethod, prop.key);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node\n .arguments[0] as N.Expression;\n (node as N.Node as N.EstreeImportExpression).options =\n (node.arguments[1] as N.Expression) ?? null;\n // compatibility with previous ESTree AST\n // TODO(Babel 8): Remove this\n (node as N.Node as N.EstreeImportExpression).attributes =\n (node.arguments[1] as N.Expression) ?? null;\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n // strip Optional prefix\n (node as unknown as N.CallExpression | N.MemberExpression).type =\n node.type.substring(8) as \"CallExpression\" | \"MemberExpression\";\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n // @ts-expect-error not in the type definitions\n node.optional = false;\n }\n\n return node;\n }\n\n isOptionalMemberExpression(node: N.Node) {\n if (node.type === \"ChainExpression\") {\n return node.expression.type === \"MemberExpression\";\n }\n return super.isOptionalMemberExpression(node);\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectProperty(node: N.Node): node is N.EstreeProperty {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectMethod(node: N.Node): node is N.EstreeProperty {\n return (\n node.type === \"Property\" &&\n (node.method || node.kind === \"get\" || node.kind === \"set\")\n );\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context.ts\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"/<=/>=\", 7),\n gt: createBinop(\"/<=/>=\", 7),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n bitShiftL: createBinop(\"<>/>>>\", 8),\n bitShiftR: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _defer: createKeywordLike(\"defer\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _source: createKeywordLike(\"source\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n // TODO: Remove this in Babel 8\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.placeholder;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.placeholder;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\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\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d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e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\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-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\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\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\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\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7cd\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7dc\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","import * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","import { ScopeFlag, BindingFlag } from \"./scopeflags.ts\";\nimport type { Position } from \"./location.ts\";\nimport type * as N from \"../types.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type Tokenizer from \"../tokenizer/index.ts\";\n\nexport const enum NameType {\n // var-declared names in the current lexical scope\n Var = 1 << 0,\n // lexically-declared names in the current lexical scope\n Lexical = 1 << 1,\n // lexically-declared FunctionDeclaration names in the current lexical scope\n Function = 1 << 2,\n}\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlag = 0;\n names: Map = new Map();\n firstLexicalName = \"\";\n\n constructor(flags: ScopeFlag) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n parser: Tokenizer;\n scopeStack: Array = [];\n inModule: boolean;\n undefinedExports: Map = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & ScopeFlag.PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & ScopeFlag.CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & ScopeFlag.CLASS) > 0 && (flags & ScopeFlag.FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.STATIC_BLOCK) {\n return true;\n }\n if (flags & (ScopeFlag.VAR | ScopeFlag.CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlag): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlag) {\n /*:: +createScope: (flags:ScopeFlag) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlag {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (ScopeFlag.FUNCTION | ScopeFlag.STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & ScopeFlag.PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n let scope = this.currentScope();\n if (\n bindingType & BindingFlag.SCOPE_LEXICAL ||\n bindingType & BindingFlag.SCOPE_FUNCTION\n ) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n let type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n type = type | NameType.Function;\n } else {\n if (!scope.firstLexicalName) {\n scope.firstLexicalName = name;\n }\n type = type | NameType.Lexical;\n }\n\n scope.names.set(name, type);\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BindingFlag.SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.names.set(name, (scope.names.get(name) || 0) | NameType.Var);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & ScopeFlag.VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (!(bindingType & BindingFlag.KIND_VALUE)) return false;\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n return scope.names.has(name);\n }\n\n const type = scope.names.get(name);\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n return (\n (type & NameType.Lexical) > 0 ||\n (!this.treatFunctionsAsVarInScope(scope) && (type & NameType.Var) > 0)\n );\n }\n\n return (\n ((type & NameType.Lexical) > 0 &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & ScopeFlag.SIMPLE_CATCH &&\n scope.firstLexicalName === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n (type & NameType.Function) > 0)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.names.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (\n flags & (ScopeFlag.VAR | ScopeFlag.CLASS) &&\n !(flags & ScopeFlag.ARROW)\n ) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, type ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (\n bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN &&\n !scope.declareFunctions.has(name)\n ) {\n const type = scope.names.get(name);\n return (type & NameType.Function) > 0 || (type & NameType.Lexical) > 0;\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n declare startIndex: number;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n sourceToOffsetPos(sourcePos: number) {\n return sourcePos + this.startIndex;\n }\n\n offsetToSourcePos(offsetPos: number) {\n return offsetPos - this.startIndex;\n }\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node, Identifier } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length !== commentsLen) {\n this.comments.length = commentsLen;\n }\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (\n this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) ===\n charCodes.comma\n ) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 *​/ function f() {}\n * ```\n * the comment whitespace `/* 1 *​/` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 *​/` as\n * inner comments. So `/* 1 *​/` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 *​/ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 *​/` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 *​/` as\n * inner comments of the ImportDeclaration. So `/* 1 *​/` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n|[\\r\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function hasNewLine(input: string, start: number, end: number): boolean {\n for (let i = start; i < end; i++) {\n if (isNewLine(input.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nexport default class State {\n @bit.storage flags: number;\n\n @bit accessor strict = false;\n\n startIndex: number;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({\n strictMode,\n sourceType,\n startIndex,\n startLine,\n startColumn,\n }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.startIndex = startIndex;\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(\n startLine,\n startColumn,\n startIndex,\n );\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n @bit accessor maybeInArrowParameters = false;\n @bit accessor inType = false;\n @bit accessor noAnonFunctionType = false;\n @bit accessor hasFlowComment = false;\n @bit accessor isAmbientContext = false;\n @bit accessor inAbstractClass = false;\n @bit accessor inDisallowConditionalTypesContext = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n @bit accessor soloAwait = false;\n @bit accessor inFSharpPipelineDirectBody = false;\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n\n // Used to track whether a JSX element is allowed to form\n @bit accessor canStartJSXElement = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n @bit accessor containsEsc = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n @bit accessor hasTopLevelAwait = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(\n this.curLine,\n this.pos - this.lineStart,\n this.pos + this.startIndex,\n );\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.startIndex = this.startIndex;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: State[\"curPosition\"];\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { Options } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n const startIndex = state.startIndex || 0;\n this.type = state.type;\n this.value = state.value;\n this.start = startIndex + state.start;\n this.end = startIndex + state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end + commentEnd.length),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // ` this.emitCodePoint(cp, consumed) + ); + } + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 34 || c === 39 || c === 60) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || false) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } else if (c === 38) { + this.startEntity(); + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else if (c === 38) { + this.startEntity(); + } + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + { + this.baseState = this.state; + this.state = 33; + this.entityStart = this.index; + this.entityDecoder.startEntity( + this.baseState === 1 || this.baseState === 32 ? decode_js.DecodingMode.Legacy : decode_js.DecodingMode.Attribute + ); + } + } + stateInEntity() { + { + const length = this.entityDecoder.write(this.buffer, this.index); + if (length >= 0) { + this.state = this.baseState; + if (length === 0) { + this.index = this.entityStart; + } + } else { + this.index = this.buffer.length - 1; + } + } + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + if (this.state === 33) { + this.entityDecoder.end(); + this.state = this.baseState; + } + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + { + if (this.baseState !== 1 && this.baseState !== 32) { + if (this.sectionStart < this.entityStart) { + this.cbs.onattribdata(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.onattribentity( + decode_js.fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } else { + if (this.sectionStart < this.entityStart) { + this.cbs.ontext(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.ontextentity( + decode_js.fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } + } + } +} + +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; +const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } +}; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } +} +function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; +} +function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + if (enabled) { + warnDeprecation(key, context, loc, ...args); + } + return enabled; +} +function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); +} + +function defaultOnError(error) { + throw error; +} +function defaultOnWarn(msg) { + console.warn(`[Vue warn] ${msg.message}`); +} +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; +} +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" +}; +const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` +}; + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root; + estreeWalker.walk(root, { + enter(node, parent) { + parent && parentStack.push(parent); + if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) { + return this.skip(); + } + if (node.type === "Identifier") { + const isLocal = !!knownIds[node.name]; + const isRefed = isReferencedIdentifier(node, parent, parentStack); + if (includeAll || isRefed && !isLocal) { + onIdentifier(node, parent, parentStack, isRefed, isLocal); + } + } else if (node.type === "ObjectProperty" && // eslint-disable-next-line no-restricted-syntax + (parent == null ? void 0 : parent.type) === "ObjectPattern") { + node.inPattern = true; + } else if (isFunctionType(node)) { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkFunctionParams( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "BlockStatement") { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkBlockDeclarations( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "CatchClause" && node.param) { + for (const id of extractIdentifiers(node.param)) { + markScopeIdentifier(node, id, knownIds); + } + } else if (isForStatement(node)) { + walkForStatement( + node, + false, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + }, + leave(node, parent) { + parent && parentStack.pop(); + if (node !== rootExp && node.scopeIds) { + for (const id of node.scopeIds) { + knownIds[id]--; + if (knownIds[id] === 0) { + delete knownIds[id]; + } + } + } + } + }); +} +function isReferencedIdentifier(id, parent, parentStack) { + if (!parent) { + return true; + } + if (id.name === "arguments") { + return false; + } + if (isReferenced(id, parent)) { + return true; + } + switch (parent.type) { + case "AssignmentExpression": + case "AssignmentPattern": + return true; + case "ObjectPattern": + case "ArrayPattern": + return isInDestructureAssignment(parent, parentStack); + } + return false; +} +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; +} +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; +} +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); + } + } +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } +} +function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; +} +function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } +} +function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; + } + return nodes; +} +function markKnownIds(name, knownIds) { + if (name in knownIds) { + knownIds[name]++; + } else { + knownIds[name] = 1; + } +} +function markScopeIdentifier(node, child, knownIds) { + const { name } = child; + if (node.scopeIds && node.scopeIds.has(name)) { + return; + } + markKnownIds(name, knownIds); + (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name); +} +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +function isReferenced(node, parent, grandparent) { + switch (parent.type) { + // yes: PARENT[NODE] + // yes: NODE.child + // no: parent.NODE + case "MemberExpression": + case "OptionalMemberExpression": + if (parent.property === node) { + return !!parent.computed; + } + return parent.object === node; + case "JSXMemberExpression": + return parent.object === node; + // no: let NODE = init; + // yes: let id = NODE; + case "VariableDeclarator": + return parent.init === node; + // yes: () => NODE + // no: (NODE) => {} + case "ArrowFunctionExpression": + return parent.body === node; + // no: class { #NODE; } + // no: class { get #NODE() {} } + // no: class { #NODE() {} } + // no: class { fn() { return this.#NODE; } } + case "PrivateName": + return false; + // no: class { NODE() {} } + // yes: class { [NODE]() {} } + // no: class { foo(NODE) {} } + case "ClassMethod": + case "ClassPrivateMethod": + case "ObjectMethod": + if (parent.key === node) { + return !!parent.computed; + } + return false; + // yes: { [NODE]: "" } + // no: { NODE: "" } + // depends: { NODE } + // depends: { key: NODE } + case "ObjectProperty": + if (parent.key === node) { + return !!parent.computed; + } + return !grandparent; + // no: class { NODE = value; } + // yes: class { [NODE] = value; } + // yes: class { key = NODE; } + case "ClassProperty": + if (parent.key === node) { + return !!parent.computed; + } + return true; + case "ClassPrivateProperty": + return parent.key !== node; + // no: class NODE {} + // yes: class Foo extends NODE {} + case "ClassDeclaration": + case "ClassExpression": + return parent.superClass === node; + // yes: left = NODE; + // no: NODE = right; + case "AssignmentExpression": + return parent.right === node; + // no: [NODE = foo] = []; + // yes: [foo = NODE] = []; + case "AssignmentPattern": + return parent.right === node; + // no: NODE: for (;;) {} + case "LabeledStatement": + return false; + // no: try {} catch (NODE) {} + case "CatchClause": + return false; + // no: function foo(...NODE) {} + case "RestElement": + return false; + case "BreakStatement": + case "ContinueStatement": + return false; + // no: function NODE() {} + // no: function foo(NODE) {} + case "FunctionDeclaration": + case "FunctionExpression": + return false; + // no: export NODE from "foo"; + // no: export * as NODE from "foo"; + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + // no: export { foo as NODE }; + // yes: export { NODE as foo }; + // no: export { NODE as foo } from "foo"; + case "ExportSpecifier": + return parent.local === node; + // no: import NODE from "foo"; + // no: import * as NODE from "foo"; + // no: import { NODE as foo } from "foo"; + // no: import { foo as NODE } from "foo"; + // no: import NODE from "bar"; + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + // no: import "foo" assert { NODE: "json" } + case "ImportAttribute": + return false; + // no: <div NODE="foo" /> + case "JSXAttribute": + return false; + // no: [NODE] = []; + // no: ({ NODE }) = []; + case "ObjectPattern": + case "ArrayPattern": + return false; + // no: new.NODE + // no: NODE.target + case "MetaProperty": + return false; + // yes: type X = { someProperty: NODE } + // no: type X = { NODE: OtherType } + case "ObjectTypeProperty": + return parent.key !== node; + // yes: enum X { Foo = NODE } + // no: enum X { NODE } + case "TSEnumMember": + return parent.id !== node; + // yes: { [NODE]: value } + // no: { NODE: value } + case "TSPropertySignature": + if (parent.key === node) { + return !!parent.computed; + } + return true; + } + return true; +} +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } +} + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } +} +const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; +const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = (exp, context) => { + try { + let ret = exp.ast || parser.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + ret = unwrapTSNode(ret); + return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined"; + } catch (e) { + return false; + } +}; +const isMemberExpression = isMemberExpressionNode; +const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); +const isFnExpressionNode = (exp, context) => { + try { + let ret = exp.ast || parser.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + if (ret.type === "Program") { + ret = ret.body[0]; + if (ret.type === "ExpressionStatement") { + ret = ret.expression; + } + } + ret = unwrapTSNode(ret); + return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression"; + } catch (e) { + return false; + } +}; +const isFnExpression = isFnExpressionNode; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); +} +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; +} +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } +} +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) { + return p; + } + } +} +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } +} +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); +} +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); +} +function isText$1(node) { + return node.type === 5 || node.type === 2; +} +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !shared.isString(props) && props.type === 14) { + const callee = props.callee; + if (!shared.isString(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !shared.isString(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || shared.isString(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!shared.isString(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; +} +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => shared.isObject(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: shared.NO, + isPreTag: shared.NO, + isIgnoreNewlineTag: shared.NO, + isCustomElement: shared.NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: true, + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = decode_js.decodeHTML(exp); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + { + if (currentProp.name === "for") { + expParseMode = 3 /* Skip */; + } else if (currentProp.name === "slot") { + expParseMode = 1 /* Params */; + } else if (currentProp.name === "on" && currentAttrValue.includes(";")) { + expParseMode = 2 /* Statements */; + } + } + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( + (mod) => mod.content === "sync" + )) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; +} +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; +} +function onText(content, start, end) { + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } +} +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = shared.extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if (isCompatEnabled( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions + )) { + let hasIf = false; + let hasFor = false; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 7) { + if (p.name === "if") { + hasIf = true; + } else if (p.name === "for") { + hasFor = true; + } + } + if (hasIf && hasFor) { + warnDeprecation( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions, + el.loc + ); + break; + } + } + } + if (!tokenizer.inSFCRoot && isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + warnDeprecation( + "COMPILER_NATIVE_TEMPLATE", + currentOptions, + el.loc + ); + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } + } +} +function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; +} +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; +} +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; +} +function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + return false; +} +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; +} +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; +} +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; +} +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; +} +function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); +} +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; +} +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) { + if (isSimpleIdentifier(content)) { + exp.ast = null; + return exp; + } + try { + const plugins = currentOptions.expressionPlugins; + const options = { + plugins: plugins ? [...plugins, "typescript"] : ["typescript"] + }; + if (parseMode === 2 /* Statements */) { + exp.ast = parser.parse(` ${content} `, options).program; + } else if (parseMode === 1 /* Params */) { + exp.ast = parser.parseExpression(`(${content})=>{}`, options); + } else { + exp.ast = parser.parseExpression(`(${content})`, options); + } + } catch (e) { + exp.ast = false; + emitError(45, loc.start.offset, e.message); + } + } + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = shared.extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + { + if (currentOptions.decodeEntities) { + console.warn( + `[@vue/compiler-core] decodeEntities option is passed but will be ignored in non-browser builds.` + ); + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function cacheStatic(root, context) { + walk( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !shared.isArray(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } +} +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (shared.isString(child) || shared.isSymbol(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + return 0; + } +} +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !shared.isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; +} +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; +} +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } +} + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = shared.NOOP, + isCustomElement = shared.NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = shared.EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && shared.capitalize(shared.camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if (!context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: shared.NOOP, + addIdentifiers(exp) { + { + if (shared.isString(exp)) { + addId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(addId); + } else if (exp.type === 4) { + addId(exp.content); + } + } + }, + removeIdentifiers(exp) { + { + if (shared.isString(exp)) { + removeId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(removeId); + } else if (exp.type === 4) { + removeId(exp.content); + } + } + }, + hoist(exp) { + if (shared.isString(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + { + context.filters = /* @__PURE__ */ new Set(); + } + function addId(id) { + const { identifiers } = context; + if (identifiers[id] === void 0) { + identifiers[id] = 0; + } + identifiers[id]++; + } + function removeId(id) { + context.identifiers[id]--; + } + return context; +} +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; + } +} +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + if (children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; +} +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (shared.isString(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (shared.isArray(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } +} +function createStructuralDirectiveTransform(name, fn) { + const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; +} + +const PURE_ANNOTATION = `/*@__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + if (context.map) { + if (node) { + let name; + if (node.type === 4 && !node.isStatic) { + const content = node.content.replace(/^_ctx\./, ""); + if (content !== node.content && isSimpleIdentifier(content)) { + name = content; + } + } + addMapping(node.loc.start, name); + } + if (newlineIndex === -3 /* Unknown */) { + advancePositionWithMutation(context, code); + } else { + context.offset += code.length; + if (newlineIndex === -2 /* None */) { + context.column += code.length; + } else { + if (newlineIndex === -1 /* End */) { + newlineIndex = code.length - 1; + } + context.line++; + context.column = code.length - newlineIndex; + } + } + if (node && node.loc !== locStub) { + addMapping(node.loc.end); + } + } + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + function addMapping(loc, name = null) { + const { _names, _mappings } = context.map; + if (name !== null && !_names.has(name)) _names.add(name); + _mappings.add({ + originalLine: loc.line, + originalColumn: loc.column - 1, + // source-map column is 0 based + generatedLine: context.line, + generatedColumn: context.column - 1, + source: filename, + name + }); + } + if (sourceMap) { + context.map = new sourceMapJs.SourceMapGenerator(); + context.map.setSourceContent(filename, context.source); + context.map._sources.add(filename); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const genScopeId = scopeId != null && mode === "module"; + const isSetupInlined = !!options.inline; + const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; + if (mode === "module") { + genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined); + } else { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + if (options.bindingMetadata && !options.inline) { + args.push("$props", "$setup", "$data", "$options"); + } + const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(",") : args.join(", "); + if (isSetupInlined) { + push(`(${signature}) => {`); + } else { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { + newline(); + genAssets(ast.filters, "filter", context); + newline(); + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: isSetupInlined ? preambleContext.code : ``, + map: context.map ? context.map.toJSON() : void 0 + }; +} +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + if (prefixIdentifiers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = ${VueBinding} +`, + -1 /* End */ + ); + } else { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `const { ${ast.ssrHelpers.map(aliasHelper).join(", ")} } = require("${ssrRuntimeModuleName}") +`, + -1 /* End */ + ); + } + genHoists(ast.hoists, context); + newline(); + push(`return `); +} +function genModulePreamble(ast, context, genScopeId, inline) { + const { + push, + newline, + optimizeImports, + runtimeModuleName, + ssrRuntimeModuleName + } = context; + if (ast.helpers.size) { + const helpers = Array.from(ast.helpers); + if (optimizeImports) { + push( + `import { ${helpers.map((s) => helperNameMap[s]).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + push( + ` +// Binding optimization for webpack code-split +const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(", ")} +`, + -1 /* End */ + ); + } else { + push( + `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from "${ssrRuntimeModuleName}" +`, + -1 /* End */ + ); + } + if (ast.imports.length) { + genImports(ast.imports, context); + newline(); + } + genHoists(ast.hoists, context); + newline(); + if (!inline) { + push(`export `); + } +} +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } +} +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; +} +function genImports(importsOptions, context) { + if (!importsOptions.length) { + return; + } + importsOptions.forEach((imports) => { + context.push(`import `); + genNode(imports.exp, context); + context.push(` from '${imports.path}'`); + context.newline(); + }); +} +function isText(n) { + return shared.isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || nodes.some((n) => shared.isArray(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (shared.isString(node)) { + push(node, -3 /* Unknown */); + } else if (shared.isArray(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } +} +function genNode(node, context) { + if (shared.isString(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (shared.isSymbol(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + genTemplateLiteral(node, context); + break; + case 23: + genIfStatement(node, context); + break; + case 24: + genAssignmentExpression(node, context); + break; + case 25: + genSequenceExpression(node, context); + break; + case 26: + genReturnStatement(node, context); + break; + /* v8 ignore start */ + case 10: + break; + default: + { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; + } + } +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (shared.isString(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } +} +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } +} +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + { + if (patchFlag < 0) { + patchFlagString = patchFlag + ` /* ${shared.PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(shared.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => shared.PatchFlagNames[n]).join(`, `); + patchFlagString = patchFlag + ` /* ${flagNames} */`; + } + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } +} +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); +} +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = shared.isString(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); +} +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); +} +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); +} +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (shared.isArray(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (shared.isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); + } + push(`)`); + } +} +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); +} +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } +} +function genTemplateLiteral(node, context) { + const { push, indent, deindent } = context; + push("`"); + const l = node.elements.length; + const multilines = l > 3; + for (let i = 0; i < l; i++) { + const e = node.elements[i]; + if (shared.isString(e)) { + push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */); + } else { + push("${"); + if (multilines) indent(); + genNode(e, context); + if (multilines) deindent(); + push("}"); + } + } + push("`"); +} +function genIfStatement(node, context) { + const { push, indent, deindent } = context; + const { test, consequent, alternate } = node; + push(`if (`); + genNode(test, context); + push(`) {`); + indent(); + genNode(consequent, context); + deindent(); + push(`}`); + if (alternate) { + push(` else `); + if (alternate.type === 23) { + genIfStatement(alternate, context); + } else { + push(`{`); + indent(); + genNode(alternate, context); + deindent(); + push(`}`); + } + } +} +function genAssignmentExpression(node, context) { + genNode(node.left, context); + context.push(` = `); + genNode(node.right, context); +} +function genSequenceExpression(node, context) { + context.push(`(`); + genNodeList(node.expressions, context); + context.push(`)`); +} +function genReturnStatement({ returns }, context) { + context.push(`return `); + if (shared.isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } +} + +const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this"); +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + if (!context.prefixIdentifiers || !node.content.trim()) { + return node; + } + const { inline, bindingMetadata } = context; + const rewriteIdentifier = (raw, parent, id) => { + const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw]; + if (inline) { + const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id; + const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id; + const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack); + const isNewExpression = parent && isInNewExpression(parentStack); + const wrapWithUnref = (raw2) => { + const wrapped = `${context.helperString(UNREF)}(${raw2})`; + return isNewExpression ? `(${wrapped})` : wrapped; + }; + if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) { + return raw; + } else if (type === "setup-ref") { + return `${raw}.value`; + } else if (type === "setup-maybe-ref") { + return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw); + } else if (type === "setup-let") { + if (isAssignmentLVal) { + const { right: rVal, operator } = parent; + const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1); + const rExpString = stringifyExpression( + processExpression( + createSimpleExpression(rExp, false), + context, + false, + false, + knownIds + ) + ); + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`; + } else if (isUpdateArg) { + id.start = parent.start; + id.end = parent.end; + const { prefix: isPrefix, operator } = parent; + const prefix = isPrefix ? operator : ``; + const postfix = isPrefix ? `` : operator; + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`; + } else if (isDestructureAssignment) { + return raw; + } else { + return wrapWithUnref(raw); + } + } else if (type === "props") { + return shared.genPropsAccessExp(raw); + } else if (type === "props-aliased") { + return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]); + } + } else { + if (type && type.startsWith("setup") || type === "literal-const") { + return `$setup.${raw}`; + } else if (type === "props-aliased") { + return `$props['${bindingMetadata.__propsAliases[raw]}']`; + } else if (type) { + return `$${type}.${raw}`; + } + } + return `_ctx.${raw}`; + }; + const rawExp = node.content; + let ast = node.ast; + if (ast === false) { + return node; + } + if (ast === null || !ast && isSimpleIdentifier(rawExp)) { + const isScopeVarReference = context.identifiers[rawExp]; + const isAllowedGlobal = shared.isGloballyAllowed(rawExp); + const isLiteral = isLiteralWhitelisted(rawExp); + if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) { + if (isConst(bindingMetadata[rawExp])) { + node.constType = 1; + } + node.content = rewriteIdentifier(rawExp); + } else if (!isScopeVarReference) { + if (isLiteral) { + node.constType = 3; + } else { + node.constType = 2; + } + } + return node; + } + if (!ast) { + const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`; + try { + ast = parser.parseExpression(source, { + sourceType: "module", + plugins: context.expressionPlugins + }); + } catch (e) { + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + e.message + ) + ); + return node; + } + } + const ids = []; + const parentStack = []; + const knownIds = Object.create(context.identifiers); + walkIdentifiers( + ast, + (node2, parent, _, isReferenced, isLocal) => { + if (isStaticPropertyKey(node2, parent)) { + return; + } + if (node2.name.startsWith("_filter_")) { + return; + } + const needPrefix = isReferenced && canPrefix(node2); + if (needPrefix && !isLocal) { + if (isStaticProperty(parent) && parent.shorthand) { + node2.prefix = `${node2.name}: `; + } + node2.name = rewriteIdentifier(node2.name, parent, node2); + ids.push(node2); + } else { + if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) { + node2.isConstant = true; + } + ids.push(node2); + } + }, + true, + // invoke on ALL identifiers + parentStack, + knownIds + ); + const children = []; + ids.sort((a, b) => a.start - b.start); + ids.forEach((id, i) => { + const start = id.start - 1; + const end = id.end - 1; + const last = ids[i - 1]; + const leadingText = rawExp.slice(last ? last.end - 1 : 0, start); + if (leadingText.length || id.prefix) { + children.push(leadingText + (id.prefix || ``)); + } + const source = rawExp.slice(start, end); + children.push( + createSimpleExpression( + id.name, + false, + { + start: advancePositionWithClone(node.loc.start, source, start), + end: advancePositionWithClone(node.loc.start, source, end), + source + }, + id.isConstant ? 3 : 0 + ) + ); + if (i === ids.length - 1 && end < rawExp.length) { + children.push(rawExp.slice(end)); + } + }); + let ret; + if (children.length) { + ret = createCompoundExpression(children, node.loc); + ret.ast = ast; + } else { + ret = node; + ret.constType = 3; + } + ret.identifiers = Object.keys(knownIds); + return ret; +} +function canPrefix(id) { + if (shared.isGloballyAllowed(id.name)) { + return false; + } + if (id.name === "require") { + return false; + } + return true; +} +function stringifyExpression(exp) { + if (shared.isString(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} +function isConst(type) { + return type === "setup-const" || type === "literal-const"; +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (context.prefixIdentifiers && dir.exp) { + dir.exp = processExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + comments.unshift(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; + } + { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; +} +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + '"v-if"' , + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } +} +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } +} +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + context.onError( + createCompilerError(34, loc) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir, context); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = shared.camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = shared.camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); + { + dir.exp = processExpression(dir.exp, context); + } +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } +}; + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp, context); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + if (memo && keyExp && isDirKey) { + { + keyProp.exp = keyExp = processExpression( + keyExp, + context + ); + } + } + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + if (isTemplate) { + if (memo) { + memo.exp = processExpression( + memo.exp, + context + ); + } + if (keyProperty && keyProp.type !== 6) { + keyProperty.value = processExpression( + keyProperty.value, + context + ); + } + } + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if (isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + if (context.prefixIdentifiers) { + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + } + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (context.prefixIdentifiers) { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + } + if (onExit) onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) return; + if (context.prefixIdentifiers) { + result.source = processExpression( + result.source, + context + ); + if (result.key) { + result.key = processExpression( + result.key, + context, + true + ); + } + if (result.index) { + result.index = processExpression( + result.index, + context, + true + ); + } + if (result.value) { + result.value = processExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); +} + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + const slotProps = vSlot.exp; + if (context.prefixIdentifiers) { + slotProps && context.addIdentifiers(slotProps); + } + context.scopes.vSlot++; + return () => { + if (context.prefixIdentifiers) { + slotProps && context.removeIdentifiers(slotProps); + } + context.scopes.vSlot--; + }; + } + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + if (!context.ssr && context.prefixIdentifiers) { + hasDynamicSlots = hasScopeRef(node, context.identifiers); + } + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (` /* ${shared.slotFlagsText[slotFlag]} */` ), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; +} +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); +} + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if (node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; +}; +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + { + exp = isProp.exp = processExpression(exp, context); + } + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + { + const fromSetup = resolveSetupReference(tag, context); + if (fromSetup) { + return fromSetup; + } + const dotIndex = tag.indexOf("."); + if (dotIndex > 0) { + const ns = resolveSetupReference(tag.slice(0, dotIndex), context); + if (ns) { + return ns + tag.slice(dotIndex); + } + } + } + if (context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) { + context.helper(RESOLVE_COMPONENT); + context.components.add(tag + `__self`); + return toValidAssetId(tag, `component`); + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function resolveSetupReference(name, context) { + const bindings = context.bindingMetadata; + if (!bindings || bindings.__isScriptSetup === false) { + return; + } + const camelName = shared.camelize(name); + const PascalName = shared.capitalize(camelName); + const checkType = (type) => { + if (bindings[name] === type) { + return name; + } + if (bindings[camelName] === type) { + return camelName; + } + if (bindings[PascalName] === type) { + return PascalName; + } + }; + const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const"); + if (fromConst) { + return context.inline ? ( + // in inline mode, const setup bindings (e.g. imports) can be used as-is + fromConst + ) : `$setup[${JSON.stringify(fromConst)}]`; + } + const fromMaybeRef = checkType("setup-let") || checkType("setup-ref") || checkType("setup-maybe-ref"); + if (fromMaybeRef) { + return context.inline ? ( + // setup scope bindings that may be refs need to be unrefed + `${context.helperString(UNREF)}(${fromMaybeRef})` + ) : `$setup[${JSON.stringify(fromMaybeRef)}]`; + } + const fromProps = checkType("props"); + if (fromProps) { + return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`; + } +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = shared.isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !shared.isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && shared.isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + if (value && context.inline) { + const binding = context.bindingMetadata[value.content]; + if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") { + isStatic = false; + properties.push( + createObjectProperty( + createSimpleExpression("ref_key", true), + createSimpleExpression(value.content, true, value.loc) + ) + ); + } + } + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + { + { + const hasOverridableKeys = mergeArgs.some((arg2) => { + if (arg2.type === 15) { + return arg2.properties.some(({ key }) => { + if (key.type !== 4 || !key.isStatic) { + return true; + } + return key.content !== "class" && key.content !== "style" && !shared.isOn(key.content); + }); + } else { + return true; + } + }); + if (hasOverridableKeys) { + checkCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context, + loc + ); + } + } + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; + } + } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (shared.isSymbol(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!shared.isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || shared.isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; +} +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + const fromSetup = resolveSetupReference("v-" + dir.name, context); + if (fromSetup) { + dirArgs.push(fromSetup); + } else { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); +} +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = shared.camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = shared.camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + { + slotName = p.exp = processExpression(p.exp, context); + } + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = shared.camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; +} + +const transformOn = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + shared.toHandlerKey(shared.camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp, context); + const isInlineStatement = !(isMemberExp || isFnExpression(exp, context)); + const hasMultipleStatements = exp.content.includes(`;`); + if (context.prefixIdentifiers) { + isInlineStatement && context.addIdentifiers(`$event`); + exp = dir.exp = processExpression( + exp, + context, + false, + hasMultipleStatements + ); + isInlineStatement && context.removeIdentifiers(`$event`); + shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once + !context.inVOnce && // runtime constants don't need to be cached + // (this is analyzed by compileScript in SFC <script setup>) + !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component - + // we need to use the original function to preserve arity, + // e.g. <transition> relies on checking cb.length to determine + // transition end handling. Inline function is ok since its arity + // is preserved even when cached. + !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot) + // it must be passed fresh to avoid stale values. + !hasScopeRef(exp, context.identifiers); + if (shouldCache && isMemberExp) { + if (exp.type === 4) { + exp.content = `${exp.content} && ${exp.content}(...args)`; + } else { + exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`]; + } + } + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? ` +//@ts-ignore +` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (` /* ${shared.PatchFlagNames[1]} */` ) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; + +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } +}; + +const transformModel = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref"); + if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) { + context.onError( + createCompilerError(43, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${shared.camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + if (maybeRef) { + if (bindingType === "setup-ref") { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event)` + ]); + } else { + const altAssignment = bindingType === "setup-let" ? `${rawExp} = $event` : `null`; + assignmentExp = createCompoundExpression([ + `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event : ${altAssignment})` + ]); + } + } else { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) { + props[1].value = context.cache(props[1].value); + } + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); +}; +function createTransformProps(props = []) { + return { props }; +} + +const validDivisionCharRE = /[\w).+\-_$\]]/; +const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } else if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); + } + }); + } +}; +function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } +} +function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + // " + case 39: + inSingle = true; + break; + // ' + case 96: + inTemplateString = true; + break; + // ` + case 40: + paren++; + break; + // ( + case 41: + paren--; + break; + // ) + case 91: + square++; + break; + // [ + case 93: + square--; + break; + // ] + case 123: + curly++; + break; + // { + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + if (filters.length) { + warnDeprecation( + "COMPILER_FILTERS", + context, + node.loc + ); + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; + node.ast = void 0; + } +} +function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + } +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } +}; + +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ...prefixIdentifiers ? [ + // order is important + trackVForSlotScopes, + transformExpression + ] : [], + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn, + bind: transformBind, + model: transformModel + } + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode; + if (!prefixIdentifiers && options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = shared.extend({}, options, { + prefixIdentifiers + }); + const ast = shared.isString(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers); + if (options.isTS) { + const { expressionPlugins } = options; + if (!expressionPlugins || !expressionPlugins.includes("typescript")) { + options.expressionPlugins = [...expressionPlugins || [], "typescript"]; + } + } + transform( + ast, + shared.extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: shared.extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); +} + +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" +}; + +const noopDirectiveTransform = () => ({ props: [] }); + +exports.generateCodeFrame = shared.generateCodeFrame; +exports.BASE_TRANSITION = BASE_TRANSITION; +exports.BindingTypes = BindingTypes; +exports.CAMELIZE = CAMELIZE; +exports.CAPITALIZE = CAPITALIZE; +exports.CREATE_BLOCK = CREATE_BLOCK; +exports.CREATE_COMMENT = CREATE_COMMENT; +exports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK; +exports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE; +exports.CREATE_SLOTS = CREATE_SLOTS; +exports.CREATE_STATIC = CREATE_STATIC; +exports.CREATE_TEXT = CREATE_TEXT; +exports.CREATE_VNODE = CREATE_VNODE; +exports.CompilerDeprecationTypes = CompilerDeprecationTypes; +exports.ConstantTypes = ConstantTypes; +exports.ElementTypes = ElementTypes; +exports.ErrorCodes = ErrorCodes; +exports.FRAGMENT = FRAGMENT; +exports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS; +exports.IS_MEMO_SAME = IS_MEMO_SAME; +exports.IS_REF = IS_REF; +exports.KEEP_ALIVE = KEEP_ALIVE; +exports.MERGE_PROPS = MERGE_PROPS; +exports.NORMALIZE_CLASS = NORMALIZE_CLASS; +exports.NORMALIZE_PROPS = NORMALIZE_PROPS; +exports.NORMALIZE_STYLE = NORMALIZE_STYLE; +exports.Namespaces = Namespaces; +exports.NodeTypes = NodeTypes; +exports.OPEN_BLOCK = OPEN_BLOCK; +exports.POP_SCOPE_ID = POP_SCOPE_ID; +exports.PUSH_SCOPE_ID = PUSH_SCOPE_ID; +exports.RENDER_LIST = RENDER_LIST; +exports.RENDER_SLOT = RENDER_SLOT; +exports.RESOLVE_COMPONENT = RESOLVE_COMPONENT; +exports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE; +exports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT; +exports.RESOLVE_FILTER = RESOLVE_FILTER; +exports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING; +exports.SUSPENSE = SUSPENSE; +exports.TELEPORT = TELEPORT; +exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING; +exports.TO_HANDLERS = TO_HANDLERS; +exports.TO_HANDLER_KEY = TO_HANDLER_KEY; +exports.TS_NODE_TYPES = TS_NODE_TYPES; +exports.UNREF = UNREF; +exports.WITH_CTX = WITH_CTX; +exports.WITH_DIRECTIVES = WITH_DIRECTIVES; +exports.WITH_MEMO = WITH_MEMO; +exports.advancePositionWithClone = advancePositionWithClone; +exports.advancePositionWithMutation = advancePositionWithMutation; +exports.assert = assert; +exports.baseCompile = baseCompile; +exports.baseParse = baseParse; +exports.buildDirectiveArgs = buildDirectiveArgs; +exports.buildProps = buildProps; +exports.buildSlots = buildSlots; +exports.checkCompatEnabled = checkCompatEnabled; +exports.convertToBlock = convertToBlock; +exports.createArrayExpression = createArrayExpression; +exports.createAssignmentExpression = createAssignmentExpression; +exports.createBlockStatement = createBlockStatement; +exports.createCacheExpression = createCacheExpression; +exports.createCallExpression = createCallExpression; +exports.createCompilerError = createCompilerError; +exports.createCompoundExpression = createCompoundExpression; +exports.createConditionalExpression = createConditionalExpression; +exports.createForLoopParams = createForLoopParams; +exports.createFunctionExpression = createFunctionExpression; +exports.createIfStatement = createIfStatement; +exports.createInterpolation = createInterpolation; +exports.createObjectExpression = createObjectExpression; +exports.createObjectProperty = createObjectProperty; +exports.createReturnStatement = createReturnStatement; +exports.createRoot = createRoot; +exports.createSequenceExpression = createSequenceExpression; +exports.createSimpleExpression = createSimpleExpression; +exports.createStructuralDirectiveTransform = createStructuralDirectiveTransform; +exports.createTemplateLiteral = createTemplateLiteral; +exports.createTransformContext = createTransformContext; +exports.createVNodeCall = createVNodeCall; +exports.errorMessages = errorMessages; +exports.extractIdentifiers = extractIdentifiers; +exports.findDir = findDir; +exports.findProp = findProp; +exports.forAliasRE = forAliasRE; +exports.generate = generate; +exports.getBaseTransformPreset = getBaseTransformPreset; +exports.getConstantType = getConstantType; +exports.getMemoedVNodeCall = getMemoedVNodeCall; +exports.getVNodeBlockHelper = getVNodeBlockHelper; +exports.getVNodeHelper = getVNodeHelper; +exports.hasDynamicKeyVBind = hasDynamicKeyVBind; +exports.hasScopeRef = hasScopeRef; +exports.helperNameMap = helperNameMap; +exports.injectProp = injectProp; +exports.isCoreComponent = isCoreComponent; +exports.isFnExpression = isFnExpression; +exports.isFnExpressionBrowser = isFnExpressionBrowser; +exports.isFnExpressionNode = isFnExpressionNode; +exports.isFunctionType = isFunctionType; +exports.isInDestructureAssignment = isInDestructureAssignment; +exports.isInNewExpression = isInNewExpression; +exports.isMemberExpression = isMemberExpression; +exports.isMemberExpressionBrowser = isMemberExpressionBrowser; +exports.isMemberExpressionNode = isMemberExpressionNode; +exports.isReferencedIdentifier = isReferencedIdentifier; +exports.isSimpleIdentifier = isSimpleIdentifier; +exports.isSlotOutlet = isSlotOutlet; +exports.isStaticArgOf = isStaticArgOf; +exports.isStaticExp = isStaticExp; +exports.isStaticProperty = isStaticProperty; +exports.isStaticPropertyKey = isStaticPropertyKey; +exports.isTemplateNode = isTemplateNode; +exports.isText = isText$1; +exports.isVSlot = isVSlot; +exports.locStub = locStub; +exports.noopDirectiveTransform = noopDirectiveTransform; +exports.processExpression = processExpression; +exports.processFor = processFor; +exports.processIf = processIf; +exports.processSlotOutlet = processSlotOutlet; +exports.registerRuntimeHelpers = registerRuntimeHelpers; +exports.resolveComponentType = resolveComponentType; +exports.stringifyExpression = stringifyExpression; +exports.toValidAssetId = toValidAssetId; +exports.trackSlotScopes = trackSlotScopes; +exports.trackVForSlotScopes = trackVForSlotScopes; +exports.transform = transform; +exports.transformBind = transformBind; +exports.transformElement = transformElement; +exports.transformExpression = transformExpression; +exports.transformModel = transformModel; +exports.transformOn = transformOn; +exports.traverseNode = traverseNode; +exports.unwrapTSNode = unwrapTSNode; +exports.walkBlockDeclarations = walkBlockDeclarations; +exports.walkFunctionParams = walkFunctionParams; +exports.walkIdentifiers = walkIdentifiers; +exports.warnDeprecation = warnDeprecation; diff --git a/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js new file mode 100644 index 0000000..7792261 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js @@ -0,0 +1,6690 @@ +/** +* @vue/compiler-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var shared = require('@vue/shared'); +var decode_js = require('entities/lib/decode.js'); +var parser = require('@babel/parser'); +var estreeWalker = require('estree-walker'); +var sourceMapJs = require('source-map-js'); + +const FRAGMENT = Symbol(``); +const TELEPORT = Symbol(``); +const SUSPENSE = Symbol(``); +const KEEP_ALIVE = Symbol(``); +const BASE_TRANSITION = Symbol( + `` +); +const OPEN_BLOCK = Symbol(``); +const CREATE_BLOCK = Symbol(``); +const CREATE_ELEMENT_BLOCK = Symbol( + `` +); +const CREATE_VNODE = Symbol(``); +const CREATE_ELEMENT_VNODE = Symbol( + `` +); +const CREATE_COMMENT = Symbol( + `` +); +const CREATE_TEXT = Symbol( + `` +); +const CREATE_STATIC = Symbol( + `` +); +const RESOLVE_COMPONENT = Symbol( + `` +); +const RESOLVE_DYNAMIC_COMPONENT = Symbol( + `` +); +const RESOLVE_DIRECTIVE = Symbol( + `` +); +const RESOLVE_FILTER = Symbol( + `` +); +const WITH_DIRECTIVES = Symbol( + `` +); +const RENDER_LIST = Symbol(``); +const RENDER_SLOT = Symbol(``); +const CREATE_SLOTS = Symbol(``); +const TO_DISPLAY_STRING = Symbol( + `` +); +const MERGE_PROPS = Symbol(``); +const NORMALIZE_CLASS = Symbol( + `` +); +const NORMALIZE_STYLE = Symbol( + `` +); +const NORMALIZE_PROPS = Symbol( + `` +); +const GUARD_REACTIVE_PROPS = Symbol( + `` +); +const TO_HANDLERS = Symbol(``); +const CAMELIZE = Symbol(``); +const CAPITALIZE = Symbol(``); +const TO_HANDLER_KEY = Symbol( + `` +); +const SET_BLOCK_TRACKING = Symbol( + `` +); +const PUSH_SCOPE_ID = Symbol(``); +const POP_SCOPE_ID = Symbol(``); +const WITH_CTX = Symbol(``); +const UNREF = Symbol(``); +const IS_REF = Symbol(``); +const WITH_MEMO = Symbol(``); +const IS_MEMO_SAME = Symbol(``); +const helperNameMap = { + [FRAGMENT]: `Fragment`, + [TELEPORT]: `Teleport`, + [SUSPENSE]: `Suspense`, + [KEEP_ALIVE]: `KeepAlive`, + [BASE_TRANSITION]: `BaseTransition`, + [OPEN_BLOCK]: `openBlock`, + [CREATE_BLOCK]: `createBlock`, + [CREATE_ELEMENT_BLOCK]: `createElementBlock`, + [CREATE_VNODE]: `createVNode`, + [CREATE_ELEMENT_VNODE]: `createElementVNode`, + [CREATE_COMMENT]: `createCommentVNode`, + [CREATE_TEXT]: `createTextVNode`, + [CREATE_STATIC]: `createStaticVNode`, + [RESOLVE_COMPONENT]: `resolveComponent`, + [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, + [RESOLVE_DIRECTIVE]: `resolveDirective`, + [RESOLVE_FILTER]: `resolveFilter`, + [WITH_DIRECTIVES]: `withDirectives`, + [RENDER_LIST]: `renderList`, + [RENDER_SLOT]: `renderSlot`, + [CREATE_SLOTS]: `createSlots`, + [TO_DISPLAY_STRING]: `toDisplayString`, + [MERGE_PROPS]: `mergeProps`, + [NORMALIZE_CLASS]: `normalizeClass`, + [NORMALIZE_STYLE]: `normalizeStyle`, + [NORMALIZE_PROPS]: `normalizeProps`, + [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, + [TO_HANDLERS]: `toHandlers`, + [CAMELIZE]: `camelize`, + [CAPITALIZE]: `capitalize`, + [TO_HANDLER_KEY]: `toHandlerKey`, + [SET_BLOCK_TRACKING]: `setBlockTracking`, + [PUSH_SCOPE_ID]: `pushScopeId`, + [POP_SCOPE_ID]: `popScopeId`, + [WITH_CTX]: `withCtx`, + [UNREF]: `unref`, + [IS_REF]: `isRef`, + [WITH_MEMO]: `withMemo`, + [IS_MEMO_SAME]: `isMemoSame` +}; +function registerRuntimeHelpers(helpers) { + Object.getOwnPropertySymbols(helpers).forEach((s) => { + helperNameMap[s] = helpers[s]; + }); +} + +const Namespaces = { + "HTML": 0, + "0": "HTML", + "SVG": 1, + "1": "SVG", + "MATH_ML": 2, + "2": "MATH_ML" +}; +const NodeTypes = { + "ROOT": 0, + "0": "ROOT", + "ELEMENT": 1, + "1": "ELEMENT", + "TEXT": 2, + "2": "TEXT", + "COMMENT": 3, + "3": "COMMENT", + "SIMPLE_EXPRESSION": 4, + "4": "SIMPLE_EXPRESSION", + "INTERPOLATION": 5, + "5": "INTERPOLATION", + "ATTRIBUTE": 6, + "6": "ATTRIBUTE", + "DIRECTIVE": 7, + "7": "DIRECTIVE", + "COMPOUND_EXPRESSION": 8, + "8": "COMPOUND_EXPRESSION", + "IF": 9, + "9": "IF", + "IF_BRANCH": 10, + "10": "IF_BRANCH", + "FOR": 11, + "11": "FOR", + "TEXT_CALL": 12, + "12": "TEXT_CALL", + "VNODE_CALL": 13, + "13": "VNODE_CALL", + "JS_CALL_EXPRESSION": 14, + "14": "JS_CALL_EXPRESSION", + "JS_OBJECT_EXPRESSION": 15, + "15": "JS_OBJECT_EXPRESSION", + "JS_PROPERTY": 16, + "16": "JS_PROPERTY", + "JS_ARRAY_EXPRESSION": 17, + "17": "JS_ARRAY_EXPRESSION", + "JS_FUNCTION_EXPRESSION": 18, + "18": "JS_FUNCTION_EXPRESSION", + "JS_CONDITIONAL_EXPRESSION": 19, + "19": "JS_CONDITIONAL_EXPRESSION", + "JS_CACHE_EXPRESSION": 20, + "20": "JS_CACHE_EXPRESSION", + "JS_BLOCK_STATEMENT": 21, + "21": "JS_BLOCK_STATEMENT", + "JS_TEMPLATE_LITERAL": 22, + "22": "JS_TEMPLATE_LITERAL", + "JS_IF_STATEMENT": 23, + "23": "JS_IF_STATEMENT", + "JS_ASSIGNMENT_EXPRESSION": 24, + "24": "JS_ASSIGNMENT_EXPRESSION", + "JS_SEQUENCE_EXPRESSION": 25, + "25": "JS_SEQUENCE_EXPRESSION", + "JS_RETURN_STATEMENT": 26, + "26": "JS_RETURN_STATEMENT" +}; +const ElementTypes = { + "ELEMENT": 0, + "0": "ELEMENT", + "COMPONENT": 1, + "1": "COMPONENT", + "SLOT": 2, + "2": "SLOT", + "TEMPLATE": 3, + "3": "TEMPLATE" +}; +const ConstantTypes = { + "NOT_CONSTANT": 0, + "0": "NOT_CONSTANT", + "CAN_SKIP_PATCH": 1, + "1": "CAN_SKIP_PATCH", + "CAN_CACHE": 2, + "2": "CAN_CACHE", + "CAN_STRINGIFY": 3, + "3": "CAN_STRINGIFY" +}; +const locStub = { + start: { line: 1, column: 1, offset: 0 }, + end: { line: 1, column: 1, offset: 0 }, + source: "" +}; +function createRoot(children, source = "") { + return { + type: 0, + source, + children, + helpers: /* @__PURE__ */ new Set(), + components: [], + directives: [], + hoists: [], + imports: [], + cached: [], + temps: 0, + codegenNode: void 0, + loc: locStub + }; +} +function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { + if (context) { + if (isBlock) { + context.helper(OPEN_BLOCK); + context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); + } else { + context.helper(getVNodeHelper(context.inSSR, isComponent)); + } + if (directives) { + context.helper(WITH_DIRECTIVES); + } + } + return { + type: 13, + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent, + loc + }; +} +function createArrayExpression(elements, loc = locStub) { + return { + type: 17, + loc, + elements + }; +} +function createObjectExpression(properties, loc = locStub) { + return { + type: 15, + loc, + properties + }; +} +function createObjectProperty(key, value) { + return { + type: 16, + loc: locStub, + key: shared.isString(key) ? createSimpleExpression(key, true) : key, + value + }; +} +function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { + return { + type: 4, + loc, + content, + isStatic, + constType: isStatic ? 3 : constType + }; +} +function createInterpolation(content, loc) { + return { + type: 5, + loc, + content: shared.isString(content) ? createSimpleExpression(content, false, loc) : content + }; +} +function createCompoundExpression(children, loc = locStub) { + return { + type: 8, + loc, + children + }; +} +function createCallExpression(callee, args = [], loc = locStub) { + return { + type: 14, + loc, + callee, + arguments: args + }; +} +function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { + return { + type: 18, + params, + returns, + newline, + isSlot, + loc + }; +} +function createConditionalExpression(test, consequent, alternate, newline = true) { + return { + type: 19, + test, + consequent, + alternate, + newline, + loc: locStub + }; +} +function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { + return { + type: 20, + index, + value, + needPauseTracking, + inVOnce, + needArraySpread: false, + loc: locStub + }; +} +function createBlockStatement(body) { + return { + type: 21, + body, + loc: locStub + }; +} +function createTemplateLiteral(elements) { + return { + type: 22, + elements, + loc: locStub + }; +} +function createIfStatement(test, consequent, alternate) { + return { + type: 23, + test, + consequent, + alternate, + loc: locStub + }; +} +function createAssignmentExpression(left, right) { + return { + type: 24, + left, + right, + loc: locStub + }; +} +function createSequenceExpression(expressions) { + return { + type: 25, + expressions, + loc: locStub + }; +} +function createReturnStatement(returns) { + return { + type: 26, + returns, + loc: locStub + }; +} +function getVNodeHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; +} +function getVNodeBlockHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; +} +function convertToBlock(node, { helper, removeHelper, inSSR }) { + if (!node.isBlock) { + node.isBlock = true; + removeHelper(getVNodeHelper(inSSR, node.isComponent)); + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(inSSR, node.isComponent)); + } +} + +const defaultDelimitersOpen = new Uint8Array([123, 123]); +const defaultDelimitersClose = new Uint8Array([125, 125]); +function isTagStartChar(c) { + return c >= 97 && c <= 122 || c >= 65 && c <= 90; +} +function isWhitespace(c) { + return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; +} +function isEndOfTagSection(c) { + return c === 47 || c === 62 || isWhitespace(c); +} +function toCharCodes(str) { + const ret = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + ret[i] = str.charCodeAt(i); + } + return ret; +} +const Sequences = { + Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), + // CDATA[ + CdataEnd: new Uint8Array([93, 93, 62]), + // ]]> + CommentEnd: new Uint8Array([45, 45, 62]), + // `-->` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `</style` + TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), + // `</title` + TextareaEnd: new Uint8Array([ + 60, + 47, + 116, + 101, + 120, + 116, + 97, + 114, + 101, + 97 + ]) + // `</textarea +}; +class Tokenizer { + constructor(stack, cbs) { + this.stack = stack; + this.cbs = cbs; + /** The current state the tokenizer is in. */ + this.state = 1; + /** The read buffer. */ + this.buffer = ""; + /** The beginning of the section that is currently being read. */ + this.sectionStart = 0; + /** The index within the buffer that we are currently looking at. */ + this.index = 0; + /** The start of the last entity. */ + this.entityStart = 0; + /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ + this.baseState = 1; + /** For special parsing behavior inside of script and style tags. */ + this.inRCDATA = false; + /** For disabling RCDATA tags handling */ + this.inXML = false; + /** For disabling interpolation parsing in v-pre */ + this.inVPre = false; + /** Record newline positions for fast line / column calculation */ + this.newlines = []; + this.mode = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + this.delimiterIndex = -1; + this.currentSequence = void 0; + this.sequenceIndex = 0; + { + this.entityDecoder = new decode_js.EntityDecoder( + decode_js.htmlDecodeTree, + (cp, consumed) => this.emitCodePoint(cp, consumed) + ); + } + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For <title> and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 34 || c === 39 || c === 60) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || false) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } else if (c === 38) { + this.startEntity(); + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else if (c === 38) { + this.startEntity(); + } + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + { + this.baseState = this.state; + this.state = 33; + this.entityStart = this.index; + this.entityDecoder.startEntity( + this.baseState === 1 || this.baseState === 32 ? decode_js.DecodingMode.Legacy : decode_js.DecodingMode.Attribute + ); + } + } + stateInEntity() { + { + const length = this.entityDecoder.write(this.buffer, this.index); + if (length >= 0) { + this.state = this.baseState; + if (length === 0) { + this.index = this.entityStart; + } + } else { + this.index = this.buffer.length - 1; + } + } + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + if (this.state === 33) { + this.entityDecoder.end(); + this.state = this.baseState; + } + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + { + if (this.baseState !== 1 && this.baseState !== 32) { + if (this.sectionStart < this.entityStart) { + this.cbs.onattribdata(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.onattribentity( + decode_js.fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } else { + if (this.sectionStart < this.entityStart) { + this.cbs.ontext(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.ontextentity( + decode_js.fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } + } + } +} + +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; +const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } +}; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } +} +function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; +} +function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + return enabled; +} +function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); +} + +function defaultOnError(error) { + throw error; +} +function defaultOnWarn(msg) { +} +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; +} +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" +}; +const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` +}; + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root; + estreeWalker.walk(root, { + enter(node, parent) { + parent && parentStack.push(parent); + if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) { + return this.skip(); + } + if (node.type === "Identifier") { + const isLocal = !!knownIds[node.name]; + const isRefed = isReferencedIdentifier(node, parent, parentStack); + if (includeAll || isRefed && !isLocal) { + onIdentifier(node, parent, parentStack, isRefed, isLocal); + } + } else if (node.type === "ObjectProperty" && // eslint-disable-next-line no-restricted-syntax + (parent == null ? void 0 : parent.type) === "ObjectPattern") { + node.inPattern = true; + } else if (isFunctionType(node)) { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkFunctionParams( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "BlockStatement") { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkBlockDeclarations( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "CatchClause" && node.param) { + for (const id of extractIdentifiers(node.param)) { + markScopeIdentifier(node, id, knownIds); + } + } else if (isForStatement(node)) { + walkForStatement( + node, + false, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + }, + leave(node, parent) { + parent && parentStack.pop(); + if (node !== rootExp && node.scopeIds) { + for (const id of node.scopeIds) { + knownIds[id]--; + if (knownIds[id] === 0) { + delete knownIds[id]; + } + } + } + } + }); +} +function isReferencedIdentifier(id, parent, parentStack) { + if (!parent) { + return true; + } + if (id.name === "arguments") { + return false; + } + if (isReferenced(id, parent)) { + return true; + } + switch (parent.type) { + case "AssignmentExpression": + case "AssignmentPattern": + return true; + case "ObjectPattern": + case "ArrayPattern": + return isInDestructureAssignment(parent, parentStack); + } + return false; +} +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; +} +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; +} +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); + } + } +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } +} +function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; +} +function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } +} +function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; + } + return nodes; +} +function markKnownIds(name, knownIds) { + if (name in knownIds) { + knownIds[name]++; + } else { + knownIds[name] = 1; + } +} +function markScopeIdentifier(node, child, knownIds) { + const { name } = child; + if (node.scopeIds && node.scopeIds.has(name)) { + return; + } + markKnownIds(name, knownIds); + (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name); +} +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +function isReferenced(node, parent, grandparent) { + switch (parent.type) { + // yes: PARENT[NODE] + // yes: NODE.child + // no: parent.NODE + case "MemberExpression": + case "OptionalMemberExpression": + if (parent.property === node) { + return !!parent.computed; + } + return parent.object === node; + case "JSXMemberExpression": + return parent.object === node; + // no: let NODE = init; + // yes: let id = NODE; + case "VariableDeclarator": + return parent.init === node; + // yes: () => NODE + // no: (NODE) => {} + case "ArrowFunctionExpression": + return parent.body === node; + // no: class { #NODE; } + // no: class { get #NODE() {} } + // no: class { #NODE() {} } + // no: class { fn() { return this.#NODE; } } + case "PrivateName": + return false; + // no: class { NODE() {} } + // yes: class { [NODE]() {} } + // no: class { foo(NODE) {} } + case "ClassMethod": + case "ClassPrivateMethod": + case "ObjectMethod": + if (parent.key === node) { + return !!parent.computed; + } + return false; + // yes: { [NODE]: "" } + // no: { NODE: "" } + // depends: { NODE } + // depends: { key: NODE } + case "ObjectProperty": + if (parent.key === node) { + return !!parent.computed; + } + return !grandparent; + // no: class { NODE = value; } + // yes: class { [NODE] = value; } + // yes: class { key = NODE; } + case "ClassProperty": + if (parent.key === node) { + return !!parent.computed; + } + return true; + case "ClassPrivateProperty": + return parent.key !== node; + // no: class NODE {} + // yes: class Foo extends NODE {} + case "ClassDeclaration": + case "ClassExpression": + return parent.superClass === node; + // yes: left = NODE; + // no: NODE = right; + case "AssignmentExpression": + return parent.right === node; + // no: [NODE = foo] = []; + // yes: [foo = NODE] = []; + case "AssignmentPattern": + return parent.right === node; + // no: NODE: for (;;) {} + case "LabeledStatement": + return false; + // no: try {} catch (NODE) {} + case "CatchClause": + return false; + // no: function foo(...NODE) {} + case "RestElement": + return false; + case "BreakStatement": + case "ContinueStatement": + return false; + // no: function NODE() {} + // no: function foo(NODE) {} + case "FunctionDeclaration": + case "FunctionExpression": + return false; + // no: export NODE from "foo"; + // no: export * as NODE from "foo"; + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + // no: export { foo as NODE }; + // yes: export { NODE as foo }; + // no: export { NODE as foo } from "foo"; + case "ExportSpecifier": + return parent.local === node; + // no: import NODE from "foo"; + // no: import * as NODE from "foo"; + // no: import { NODE as foo } from "foo"; + // no: import { foo as NODE } from "foo"; + // no: import NODE from "bar"; + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + // no: import "foo" assert { NODE: "json" } + case "ImportAttribute": + return false; + // no: <div NODE="foo" /> + case "JSXAttribute": + return false; + // no: [NODE] = []; + // no: ({ NODE }) = []; + case "ObjectPattern": + case "ArrayPattern": + return false; + // no: new.NODE + // no: NODE.target + case "MetaProperty": + return false; + // yes: type X = { someProperty: NODE } + // no: type X = { NODE: OtherType } + case "ObjectTypeProperty": + return parent.key !== node; + // yes: enum X { Foo = NODE } + // no: enum X { NODE } + case "TSEnumMember": + return parent.id !== node; + // yes: { [NODE]: value } + // no: { NODE: value } + case "TSPropertySignature": + if (parent.key === node) { + return !!parent.computed; + } + return true; + } + return true; +} +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } +} + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } +} +const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; +const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = (exp, context) => { + try { + let ret = exp.ast || parser.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + ret = unwrapTSNode(ret); + return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined"; + } catch (e) { + return false; + } +}; +const isMemberExpression = isMemberExpressionNode; +const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); +const isFnExpressionNode = (exp, context) => { + try { + let ret = exp.ast || parser.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + if (ret.type === "Program") { + ret = ret.body[0]; + if (ret.type === "ExpressionStatement") { + ret = ret.expression; + } + } + ret = unwrapTSNode(ret); + return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression"; + } catch (e) { + return false; + } +}; +const isFnExpression = isFnExpressionNode; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); +} +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; +} +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } +} +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) { + return p; + } + } +} +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } +} +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); +} +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); +} +function isText$1(node) { + return node.type === 5 || node.type === 2; +} +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !shared.isString(props) && props.type === 14) { + const callee = props.callee; + if (!shared.isString(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !shared.isString(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || shared.isString(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!shared.isString(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; +} +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => shared.isObject(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: shared.NO, + isPreTag: shared.NO, + isIgnoreNewlineTag: shared.NO, + isCustomElement: shared.NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: false, + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = decode_js.decodeHTML(exp); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + { + if (currentProp.name === "for") { + expParseMode = 3 /* Skip */; + } else if (currentProp.name === "slot") { + expParseMode = 1 /* Params */; + } else if (currentProp.name === "on" && currentAttrValue.includes(";")) { + expParseMode = 2 /* Statements */; + } + } + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( + (mod) => mod.content === "sync" + )) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; +} +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; +} +function onText(content, start, end) { + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } +} +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = shared.extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if (!tokenizer.inSFCRoot && isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } + } +} +function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; +} +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; +} +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; +} +function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + return false; +} +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; +} +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; +} +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; +} +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; +} +function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); +} +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; +} +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) { + if (isSimpleIdentifier(content)) { + exp.ast = null; + return exp; + } + try { + const plugins = currentOptions.expressionPlugins; + const options = { + plugins: plugins ? [...plugins, "typescript"] : ["typescript"] + }; + if (parseMode === 2 /* Statements */) { + exp.ast = parser.parse(` ${content} `, options).program; + } else if (parseMode === 1 /* Params */) { + exp.ast = parser.parseExpression(`(${content})=>{}`, options); + } else { + exp.ast = parser.parseExpression(`(${content})`, options); + } + } catch (e) { + exp.ast = false; + emitError(45, loc.start.offset, e.message); + } + } + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = shared.extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function cacheStatic(root, context) { + walk( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !shared.isArray(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } +} +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (shared.isString(child) || shared.isSymbol(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + return 0; + } +} +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !shared.isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; +} +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; +} +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } +} + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = shared.NOOP, + isCustomElement = shared.NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = shared.EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && shared.capitalize(shared.camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: shared.NOOP, + addIdentifiers(exp) { + { + if (shared.isString(exp)) { + addId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(addId); + } else if (exp.type === 4) { + addId(exp.content); + } + } + }, + removeIdentifiers(exp) { + { + if (shared.isString(exp)) { + removeId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(removeId); + } else if (exp.type === 4) { + removeId(exp.content); + } + } + }, + hoist(exp) { + if (shared.isString(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + { + context.filters = /* @__PURE__ */ new Set(); + } + function addId(id) { + const { identifiers } = context; + if (identifiers[id] === void 0) { + identifiers[id] = 0; + } + identifiers[id]++; + } + function removeId(id) { + context.identifiers[id]--; + } + return context; +} +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; + } +} +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; +} +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (shared.isString(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (shared.isArray(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } +} +function createStructuralDirectiveTransform(name, fn) { + const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; +} + +const PURE_ANNOTATION = `/*@__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + if (context.map) { + if (node) { + let name; + if (node.type === 4 && !node.isStatic) { + const content = node.content.replace(/^_ctx\./, ""); + if (content !== node.content && isSimpleIdentifier(content)) { + name = content; + } + } + addMapping(node.loc.start, name); + } + if (newlineIndex === -3 /* Unknown */) { + advancePositionWithMutation(context, code); + } else { + context.offset += code.length; + if (newlineIndex === -2 /* None */) { + context.column += code.length; + } else { + if (newlineIndex === -1 /* End */) { + newlineIndex = code.length - 1; + } + context.line++; + context.column = code.length - newlineIndex; + } + } + if (node && node.loc !== locStub) { + addMapping(node.loc.end); + } + } + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + function addMapping(loc, name = null) { + const { _names, _mappings } = context.map; + if (name !== null && !_names.has(name)) _names.add(name); + _mappings.add({ + originalLine: loc.line, + originalColumn: loc.column - 1, + // source-map column is 0 based + generatedLine: context.line, + generatedColumn: context.column - 1, + source: filename, + name + }); + } + if (sourceMap) { + context.map = new sourceMapJs.SourceMapGenerator(); + context.map.setSourceContent(filename, context.source); + context.map._sources.add(filename); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const genScopeId = scopeId != null && mode === "module"; + const isSetupInlined = !!options.inline; + const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; + if (mode === "module") { + genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined); + } else { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + if (options.bindingMetadata && !options.inline) { + args.push("$props", "$setup", "$data", "$options"); + } + const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(",") : args.join(", "); + if (isSetupInlined) { + push(`(${signature}) => {`); + } else { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { + newline(); + genAssets(ast.filters, "filter", context); + newline(); + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: isSetupInlined ? preambleContext.code : ``, + map: context.map ? context.map.toJSON() : void 0 + }; +} +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + if (prefixIdentifiers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = ${VueBinding} +`, + -1 /* End */ + ); + } else { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `const { ${ast.ssrHelpers.map(aliasHelper).join(", ")} } = require("${ssrRuntimeModuleName}") +`, + -1 /* End */ + ); + } + genHoists(ast.hoists, context); + newline(); + push(`return `); +} +function genModulePreamble(ast, context, genScopeId, inline) { + const { + push, + newline, + optimizeImports, + runtimeModuleName, + ssrRuntimeModuleName + } = context; + if (ast.helpers.size) { + const helpers = Array.from(ast.helpers); + if (optimizeImports) { + push( + `import { ${helpers.map((s) => helperNameMap[s]).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + push( + ` +// Binding optimization for webpack code-split +const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(", ")} +`, + -1 /* End */ + ); + } else { + push( + `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from "${ssrRuntimeModuleName}" +`, + -1 /* End */ + ); + } + if (ast.imports.length) { + genImports(ast.imports, context); + newline(); + } + genHoists(ast.hoists, context); + newline(); + if (!inline) { + push(`export `); + } +} +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } +} +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; +} +function genImports(importsOptions, context) { + if (!importsOptions.length) { + return; + } + importsOptions.forEach((imports) => { + context.push(`import `); + genNode(imports.exp, context); + context.push(` from '${imports.path}'`); + context.newline(); + }); +} +function isText(n) { + return shared.isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || nodes.some((n) => shared.isArray(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (shared.isString(node)) { + push(node, -3 /* Unknown */); + } else if (shared.isArray(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } +} +function genNode(node, context) { + if (shared.isString(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (shared.isSymbol(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + genTemplateLiteral(node, context); + break; + case 23: + genIfStatement(node, context); + break; + case 24: + genAssignmentExpression(node, context); + break; + case 25: + genSequenceExpression(node, context); + break; + case 26: + genReturnStatement(node, context); + break; + } +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (shared.isString(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } +} +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } +} +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + { + patchFlagString = String(patchFlag); + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } +} +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); +} +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = shared.isString(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); +} +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); +} +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); +} +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (shared.isArray(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (shared.isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); + } + push(`)`); + } +} +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); +} +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } +} +function genTemplateLiteral(node, context) { + const { push, indent, deindent } = context; + push("`"); + const l = node.elements.length; + const multilines = l > 3; + for (let i = 0; i < l; i++) { + const e = node.elements[i]; + if (shared.isString(e)) { + push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */); + } else { + push("${"); + if (multilines) indent(); + genNode(e, context); + if (multilines) deindent(); + push("}"); + } + } + push("`"); +} +function genIfStatement(node, context) { + const { push, indent, deindent } = context; + const { test, consequent, alternate } = node; + push(`if (`); + genNode(test, context); + push(`) {`); + indent(); + genNode(consequent, context); + deindent(); + push(`}`); + if (alternate) { + push(` else `); + if (alternate.type === 23) { + genIfStatement(alternate, context); + } else { + push(`{`); + indent(); + genNode(alternate, context); + deindent(); + push(`}`); + } + } +} +function genAssignmentExpression(node, context) { + genNode(node.left, context); + context.push(` = `); + genNode(node.right, context); +} +function genSequenceExpression(node, context) { + context.push(`(`); + genNodeList(node.expressions, context); + context.push(`)`); +} +function genReturnStatement({ returns }, context) { + context.push(`return `); + if (shared.isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } +} + +const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this"); +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + if (!context.prefixIdentifiers || !node.content.trim()) { + return node; + } + const { inline, bindingMetadata } = context; + const rewriteIdentifier = (raw, parent, id) => { + const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw]; + if (inline) { + const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id; + const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id; + const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack); + const isNewExpression = parent && isInNewExpression(parentStack); + const wrapWithUnref = (raw2) => { + const wrapped = `${context.helperString(UNREF)}(${raw2})`; + return isNewExpression ? `(${wrapped})` : wrapped; + }; + if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) { + return raw; + } else if (type === "setup-ref") { + return `${raw}.value`; + } else if (type === "setup-maybe-ref") { + return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw); + } else if (type === "setup-let") { + if (isAssignmentLVal) { + const { right: rVal, operator } = parent; + const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1); + const rExpString = stringifyExpression( + processExpression( + createSimpleExpression(rExp, false), + context, + false, + false, + knownIds + ) + ); + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`; + } else if (isUpdateArg) { + id.start = parent.start; + id.end = parent.end; + const { prefix: isPrefix, operator } = parent; + const prefix = isPrefix ? operator : ``; + const postfix = isPrefix ? `` : operator; + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`; + } else if (isDestructureAssignment) { + return raw; + } else { + return wrapWithUnref(raw); + } + } else if (type === "props") { + return shared.genPropsAccessExp(raw); + } else if (type === "props-aliased") { + return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]); + } + } else { + if (type && type.startsWith("setup") || type === "literal-const") { + return `$setup.${raw}`; + } else if (type === "props-aliased") { + return `$props['${bindingMetadata.__propsAliases[raw]}']`; + } else if (type) { + return `$${type}.${raw}`; + } + } + return `_ctx.${raw}`; + }; + const rawExp = node.content; + let ast = node.ast; + if (ast === false) { + return node; + } + if (ast === null || !ast && isSimpleIdentifier(rawExp)) { + const isScopeVarReference = context.identifiers[rawExp]; + const isAllowedGlobal = shared.isGloballyAllowed(rawExp); + const isLiteral = isLiteralWhitelisted(rawExp); + if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) { + if (isConst(bindingMetadata[rawExp])) { + node.constType = 1; + } + node.content = rewriteIdentifier(rawExp); + } else if (!isScopeVarReference) { + if (isLiteral) { + node.constType = 3; + } else { + node.constType = 2; + } + } + return node; + } + if (!ast) { + const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`; + try { + ast = parser.parseExpression(source, { + sourceType: "module", + plugins: context.expressionPlugins + }); + } catch (e) { + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + e.message + ) + ); + return node; + } + } + const ids = []; + const parentStack = []; + const knownIds = Object.create(context.identifiers); + walkIdentifiers( + ast, + (node2, parent, _, isReferenced, isLocal) => { + if (isStaticPropertyKey(node2, parent)) { + return; + } + if (node2.name.startsWith("_filter_")) { + return; + } + const needPrefix = isReferenced && canPrefix(node2); + if (needPrefix && !isLocal) { + if (isStaticProperty(parent) && parent.shorthand) { + node2.prefix = `${node2.name}: `; + } + node2.name = rewriteIdentifier(node2.name, parent, node2); + ids.push(node2); + } else { + if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) { + node2.isConstant = true; + } + ids.push(node2); + } + }, + true, + // invoke on ALL identifiers + parentStack, + knownIds + ); + const children = []; + ids.sort((a, b) => a.start - b.start); + ids.forEach((id, i) => { + const start = id.start - 1; + const end = id.end - 1; + const last = ids[i - 1]; + const leadingText = rawExp.slice(last ? last.end - 1 : 0, start); + if (leadingText.length || id.prefix) { + children.push(leadingText + (id.prefix || ``)); + } + const source = rawExp.slice(start, end); + children.push( + createSimpleExpression( + id.name, + false, + { + start: advancePositionWithClone(node.loc.start, source, start), + end: advancePositionWithClone(node.loc.start, source, end), + source + }, + id.isConstant ? 3 : 0 + ) + ); + if (i === ids.length - 1 && end < rawExp.length) { + children.push(rawExp.slice(end)); + } + }); + let ret; + if (children.length) { + ret = createCompoundExpression(children, node.loc); + ret.ast = ast; + } else { + ret = node; + ret.constType = 3; + } + ret.identifiers = Object.keys(knownIds); + return ret; +} +function canPrefix(id) { + if (shared.isGloballyAllowed(id.name)) { + return false; + } + if (id.name === "require") { + return false; + } + return true; +} +function stringifyExpression(exp) { + if (shared.isString(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} +function isConst(type) { + return type === "setup-const" || type === "literal-const"; +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (context.prefixIdentifiers && dir.exp) { + dir.exp = processExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; +} +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + '""', + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } +} +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } +} +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + context.onError( + createCompilerError(34, loc) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir, context); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = shared.camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = shared.camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); + { + dir.exp = processExpression(dir.exp, context); + } +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } +}; + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp, context); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + if (memo && keyExp && isDirKey) { + { + keyProp.exp = keyExp = processExpression( + keyExp, + context + ); + } + } + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + if (isTemplate) { + if (memo) { + memo.exp = processExpression( + memo.exp, + context + ); + } + if (keyProperty && keyProp.type !== 6) { + keyProperty.value = processExpression( + keyProperty.value, + context + ); + } + } + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if (isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + if (context.prefixIdentifiers) { + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + } + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (context.prefixIdentifiers) { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + } + if (onExit) onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) return; + if (context.prefixIdentifiers) { + result.source = processExpression( + result.source, + context + ); + if (result.key) { + result.key = processExpression( + result.key, + context, + true + ); + } + if (result.index) { + result.index = processExpression( + result.index, + context, + true + ); + } + if (result.value) { + result.value = processExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); +} + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + const slotProps = vSlot.exp; + if (context.prefixIdentifiers) { + slotProps && context.addIdentifiers(slotProps); + } + context.scopes.vSlot++; + return () => { + if (context.prefixIdentifiers) { + slotProps && context.removeIdentifiers(slotProps); + } + context.scopes.vSlot--; + }; + } + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + if (!context.ssr && context.prefixIdentifiers) { + hasDynamicSlots = hasScopeRef(node, context.identifiers); + } + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (``), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; +} +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); +} + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; +}; +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + { + exp = isProp.exp = processExpression(exp, context); + } + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + { + const fromSetup = resolveSetupReference(tag, context); + if (fromSetup) { + return fromSetup; + } + const dotIndex = tag.indexOf("."); + if (dotIndex > 0) { + const ns = resolveSetupReference(tag.slice(0, dotIndex), context); + if (ns) { + return ns + tag.slice(dotIndex); + } + } + } + if (context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) { + context.helper(RESOLVE_COMPONENT); + context.components.add(tag + `__self`); + return toValidAssetId(tag, `component`); + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function resolveSetupReference(name, context) { + const bindings = context.bindingMetadata; + if (!bindings || bindings.__isScriptSetup === false) { + return; + } + const camelName = shared.camelize(name); + const PascalName = shared.capitalize(camelName); + const checkType = (type) => { + if (bindings[name] === type) { + return name; + } + if (bindings[camelName] === type) { + return camelName; + } + if (bindings[PascalName] === type) { + return PascalName; + } + }; + const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const"); + if (fromConst) { + return context.inline ? ( + // in inline mode, const setup bindings (e.g. imports) can be used as-is + fromConst + ) : `$setup[${JSON.stringify(fromConst)}]`; + } + const fromMaybeRef = checkType("setup-let") || checkType("setup-ref") || checkType("setup-maybe-ref"); + if (fromMaybeRef) { + return context.inline ? ( + // setup scope bindings that may be refs need to be unrefed + `${context.helperString(UNREF)}(${fromMaybeRef})` + ) : `$setup[${JSON.stringify(fromMaybeRef)}]`; + } + const fromProps = checkType("props"); + if (fromProps) { + return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`; + } +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = shared.isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !shared.isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && shared.isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + if (value && context.inline) { + const binding = context.bindingMetadata[value.content]; + if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") { + isStatic = false; + properties.push( + createObjectProperty( + createSimpleExpression("ref_key", true), + createSimpleExpression(value.content, true, value.loc) + ) + ); + } + } + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + { + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; + } + } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (shared.isSymbol(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!shared.isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || shared.isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; +} +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + const fromSetup = resolveSetupReference("v-" + dir.name, context); + if (fromSetup) { + dirArgs.push(fromSetup); + } else { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); +} +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = shared.camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = shared.camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + { + slotName = p.exp = processExpression(p.exp, context); + } + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = shared.camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; +} + +const transformOn = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + shared.toHandlerKey(shared.camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp, context); + const isInlineStatement = !(isMemberExp || isFnExpression(exp, context)); + const hasMultipleStatements = exp.content.includes(`;`); + if (context.prefixIdentifiers) { + isInlineStatement && context.addIdentifiers(`$event`); + exp = dir.exp = processExpression( + exp, + context, + false, + hasMultipleStatements + ); + isInlineStatement && context.removeIdentifiers(`$event`); + shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once + !context.inVOnce && // runtime constants don't need to be cached + // (this is analyzed by compileScript in SFC <script setup>) + !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component - + // we need to use the original function to preserve arity, + // e.g. <transition> relies on checking cb.length to determine + // transition end handling. Inline function is ok since its arity + // is preserved even when cached. + !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot) + // it must be passed fresh to avoid stale values. + !hasScopeRef(exp, context.identifiers); + if (shouldCache && isMemberExp) { + if (exp.type === 4) { + exp.content = `${exp.content} && ${exp.content}(...args)`; + } else { + exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`]; + } + } + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? ` +//@ts-ignore +` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (``) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; + +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } +}; + +const transformModel = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref"); + if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) { + context.onError( + createCompilerError(43, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${shared.camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + if (maybeRef) { + if (bindingType === "setup-ref") { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event)` + ]); + } else { + const altAssignment = bindingType === "setup-let" ? `${rawExp} = $event` : `null`; + assignmentExp = createCompoundExpression([ + `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event : ${altAssignment})` + ]); + } + } else { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) { + props[1].value = context.cache(props[1].value); + } + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); +}; +function createTransformProps(props = []) { + return { props }; +} + +const validDivisionCharRE = /[\w).+\-_$\]]/; +const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } else if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); + } + }); + } +}; +function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } +} +function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + // " + case 39: + inSingle = true; + break; + // ' + case 96: + inTemplateString = true; + break; + // ` + case 40: + paren++; + break; + // ( + case 41: + paren--; + break; + // ) + case 91: + square++; + break; + // [ + case 93: + square--; + break; + // ] + case 123: + curly++; + break; + // { + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + if (filters.length) { + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; + node.ast = void 0; + } +} +function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + } +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } +}; + +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ...prefixIdentifiers ? [ + // order is important + trackVForSlotScopes, + transformExpression + ] : [], + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn, + bind: transformBind, + model: transformModel + } + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode; + if (!prefixIdentifiers && options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = shared.extend({}, options, { + prefixIdentifiers + }); + const ast = shared.isString(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers); + if (options.isTS) { + const { expressionPlugins } = options; + if (!expressionPlugins || !expressionPlugins.includes("typescript")) { + options.expressionPlugins = [...expressionPlugins || [], "typescript"]; + } + } + transform( + ast, + shared.extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: shared.extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); +} + +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" +}; + +const noopDirectiveTransform = () => ({ props: [] }); + +exports.generateCodeFrame = shared.generateCodeFrame; +exports.BASE_TRANSITION = BASE_TRANSITION; +exports.BindingTypes = BindingTypes; +exports.CAMELIZE = CAMELIZE; +exports.CAPITALIZE = CAPITALIZE; +exports.CREATE_BLOCK = CREATE_BLOCK; +exports.CREATE_COMMENT = CREATE_COMMENT; +exports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK; +exports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE; +exports.CREATE_SLOTS = CREATE_SLOTS; +exports.CREATE_STATIC = CREATE_STATIC; +exports.CREATE_TEXT = CREATE_TEXT; +exports.CREATE_VNODE = CREATE_VNODE; +exports.CompilerDeprecationTypes = CompilerDeprecationTypes; +exports.ConstantTypes = ConstantTypes; +exports.ElementTypes = ElementTypes; +exports.ErrorCodes = ErrorCodes; +exports.FRAGMENT = FRAGMENT; +exports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS; +exports.IS_MEMO_SAME = IS_MEMO_SAME; +exports.IS_REF = IS_REF; +exports.KEEP_ALIVE = KEEP_ALIVE; +exports.MERGE_PROPS = MERGE_PROPS; +exports.NORMALIZE_CLASS = NORMALIZE_CLASS; +exports.NORMALIZE_PROPS = NORMALIZE_PROPS; +exports.NORMALIZE_STYLE = NORMALIZE_STYLE; +exports.Namespaces = Namespaces; +exports.NodeTypes = NodeTypes; +exports.OPEN_BLOCK = OPEN_BLOCK; +exports.POP_SCOPE_ID = POP_SCOPE_ID; +exports.PUSH_SCOPE_ID = PUSH_SCOPE_ID; +exports.RENDER_LIST = RENDER_LIST; +exports.RENDER_SLOT = RENDER_SLOT; +exports.RESOLVE_COMPONENT = RESOLVE_COMPONENT; +exports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE; +exports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT; +exports.RESOLVE_FILTER = RESOLVE_FILTER; +exports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING; +exports.SUSPENSE = SUSPENSE; +exports.TELEPORT = TELEPORT; +exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING; +exports.TO_HANDLERS = TO_HANDLERS; +exports.TO_HANDLER_KEY = TO_HANDLER_KEY; +exports.TS_NODE_TYPES = TS_NODE_TYPES; +exports.UNREF = UNREF; +exports.WITH_CTX = WITH_CTX; +exports.WITH_DIRECTIVES = WITH_DIRECTIVES; +exports.WITH_MEMO = WITH_MEMO; +exports.advancePositionWithClone = advancePositionWithClone; +exports.advancePositionWithMutation = advancePositionWithMutation; +exports.assert = assert; +exports.baseCompile = baseCompile; +exports.baseParse = baseParse; +exports.buildDirectiveArgs = buildDirectiveArgs; +exports.buildProps = buildProps; +exports.buildSlots = buildSlots; +exports.checkCompatEnabled = checkCompatEnabled; +exports.convertToBlock = convertToBlock; +exports.createArrayExpression = createArrayExpression; +exports.createAssignmentExpression = createAssignmentExpression; +exports.createBlockStatement = createBlockStatement; +exports.createCacheExpression = createCacheExpression; +exports.createCallExpression = createCallExpression; +exports.createCompilerError = createCompilerError; +exports.createCompoundExpression = createCompoundExpression; +exports.createConditionalExpression = createConditionalExpression; +exports.createForLoopParams = createForLoopParams; +exports.createFunctionExpression = createFunctionExpression; +exports.createIfStatement = createIfStatement; +exports.createInterpolation = createInterpolation; +exports.createObjectExpression = createObjectExpression; +exports.createObjectProperty = createObjectProperty; +exports.createReturnStatement = createReturnStatement; +exports.createRoot = createRoot; +exports.createSequenceExpression = createSequenceExpression; +exports.createSimpleExpression = createSimpleExpression; +exports.createStructuralDirectiveTransform = createStructuralDirectiveTransform; +exports.createTemplateLiteral = createTemplateLiteral; +exports.createTransformContext = createTransformContext; +exports.createVNodeCall = createVNodeCall; +exports.errorMessages = errorMessages; +exports.extractIdentifiers = extractIdentifiers; +exports.findDir = findDir; +exports.findProp = findProp; +exports.forAliasRE = forAliasRE; +exports.generate = generate; +exports.getBaseTransformPreset = getBaseTransformPreset; +exports.getConstantType = getConstantType; +exports.getMemoedVNodeCall = getMemoedVNodeCall; +exports.getVNodeBlockHelper = getVNodeBlockHelper; +exports.getVNodeHelper = getVNodeHelper; +exports.hasDynamicKeyVBind = hasDynamicKeyVBind; +exports.hasScopeRef = hasScopeRef; +exports.helperNameMap = helperNameMap; +exports.injectProp = injectProp; +exports.isCoreComponent = isCoreComponent; +exports.isFnExpression = isFnExpression; +exports.isFnExpressionBrowser = isFnExpressionBrowser; +exports.isFnExpressionNode = isFnExpressionNode; +exports.isFunctionType = isFunctionType; +exports.isInDestructureAssignment = isInDestructureAssignment; +exports.isInNewExpression = isInNewExpression; +exports.isMemberExpression = isMemberExpression; +exports.isMemberExpressionBrowser = isMemberExpressionBrowser; +exports.isMemberExpressionNode = isMemberExpressionNode; +exports.isReferencedIdentifier = isReferencedIdentifier; +exports.isSimpleIdentifier = isSimpleIdentifier; +exports.isSlotOutlet = isSlotOutlet; +exports.isStaticArgOf = isStaticArgOf; +exports.isStaticExp = isStaticExp; +exports.isStaticProperty = isStaticProperty; +exports.isStaticPropertyKey = isStaticPropertyKey; +exports.isTemplateNode = isTemplateNode; +exports.isText = isText$1; +exports.isVSlot = isVSlot; +exports.locStub = locStub; +exports.noopDirectiveTransform = noopDirectiveTransform; +exports.processExpression = processExpression; +exports.processFor = processFor; +exports.processIf = processIf; +exports.processSlotOutlet = processSlotOutlet; +exports.registerRuntimeHelpers = registerRuntimeHelpers; +exports.resolveComponentType = resolveComponentType; +exports.stringifyExpression = stringifyExpression; +exports.toValidAssetId = toValidAssetId; +exports.trackSlotScopes = trackSlotScopes; +exports.trackVForSlotScopes = trackVForSlotScopes; +exports.transform = transform; +exports.transformBind = transformBind; +exports.transformElement = transformElement; +exports.transformExpression = transformExpression; +exports.transformModel = transformModel; +exports.transformOn = transformOn; +exports.traverseNode = traverseNode; +exports.unwrapTSNode = unwrapTSNode; +exports.walkBlockDeclarations = walkBlockDeclarations; +exports.walkFunctionParams = walkFunctionParams; +exports.walkIdentifiers = walkIdentifiers; +exports.warnDeprecation = warnDeprecation; diff --git a/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.d.ts b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.d.ts new file mode 100644 index 0000000..9795cad --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.d.ts @@ -0,0 +1,1091 @@ +import { PatchFlags } from '@vue/shared'; +export { generateCodeFrame } from '@vue/shared'; +import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types'; +import { ParserPlugin } from '@babel/parser'; + +export declare const FRAGMENT: unique symbol; +export declare const TELEPORT: unique symbol; +export declare const SUSPENSE: unique symbol; +export declare const KEEP_ALIVE: unique symbol; +export declare const BASE_TRANSITION: unique symbol; +export declare const OPEN_BLOCK: unique symbol; +export declare const CREATE_BLOCK: unique symbol; +export declare const CREATE_ELEMENT_BLOCK: unique symbol; +export declare const CREATE_VNODE: unique symbol; +export declare const CREATE_ELEMENT_VNODE: unique symbol; +export declare const CREATE_COMMENT: unique symbol; +export declare const CREATE_TEXT: unique symbol; +export declare const CREATE_STATIC: unique symbol; +export declare const RESOLVE_COMPONENT: unique symbol; +export declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol; +export declare const RESOLVE_DIRECTIVE: unique symbol; +export declare const RESOLVE_FILTER: unique symbol; +export declare const WITH_DIRECTIVES: unique symbol; +export declare const RENDER_LIST: unique symbol; +export declare const RENDER_SLOT: unique symbol; +export declare const CREATE_SLOTS: unique symbol; +export declare const TO_DISPLAY_STRING: unique symbol; +export declare const MERGE_PROPS: unique symbol; +export declare const NORMALIZE_CLASS: unique symbol; +export declare const NORMALIZE_STYLE: unique symbol; +export declare const NORMALIZE_PROPS: unique symbol; +export declare const GUARD_REACTIVE_PROPS: unique symbol; +export declare const TO_HANDLERS: unique symbol; +export declare const CAMELIZE: unique symbol; +export declare const CAPITALIZE: unique symbol; +export declare const TO_HANDLER_KEY: unique symbol; +export declare const SET_BLOCK_TRACKING: unique symbol; +/** + * @deprecated no longer needed in 3.5+ because we no longer hoist element nodes + * but kept for backwards compat + */ +export declare const PUSH_SCOPE_ID: unique symbol; +/** + * @deprecated kept for backwards compat + */ +export declare const POP_SCOPE_ID: unique symbol; +export declare const WITH_CTX: unique symbol; +export declare const UNREF: unique symbol; +export declare const IS_REF: unique symbol; +export declare const WITH_MEMO: unique symbol; +export declare const IS_MEMO_SAME: unique symbol; +export declare const helperNameMap: Record<symbol, string>; +export declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void; + +type OptionalOptions = 'decodeEntities' | 'whitespace' | 'isNativeTag' | 'isBuiltInComponent' | 'expressionPlugins' | keyof CompilerCompatOptions; +type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> & Pick<ParserOptions, OptionalOptions>; +export declare function baseParse(input: string, options?: ParserOptions): RootNode; + +type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | 'suppress-warning'>> & { + MODE?: 2 | 3; +}; +interface CompilerCompatOptions { + compatConfig?: CompilerCompatConfig; +} +export declare enum CompilerDeprecationTypes { + COMPILER_IS_ON_ELEMENT = "COMPILER_IS_ON_ELEMENT", + COMPILER_V_BIND_SYNC = "COMPILER_V_BIND_SYNC", + COMPILER_V_BIND_OBJECT_ORDER = "COMPILER_V_BIND_OBJECT_ORDER", + COMPILER_V_ON_NATIVE = "COMPILER_V_ON_NATIVE", + COMPILER_V_IF_V_FOR_PRECEDENCE = "COMPILER_V_IF_V_FOR_PRECEDENCE", + COMPILER_NATIVE_TEMPLATE = "COMPILER_NATIVE_TEMPLATE", + COMPILER_INLINE_TEMPLATE = "COMPILER_INLINE_TEMPLATE", + COMPILER_FILTERS = "COMPILER_FILTERS" +} +export declare function checkCompatEnabled(key: CompilerDeprecationTypes, context: MergedParserOptions | TransformContext, loc: SourceLocation | null, ...args: any[]): boolean; +export declare function warnDeprecation(key: CompilerDeprecationTypes, context: MergedParserOptions | TransformContext, loc: SourceLocation | null, ...args: any[]): void; + +export type NodeTransform = (node: RootNode | TemplateChildNode, context: TransformContext) => void | (() => void) | (() => void)[]; +export type DirectiveTransform = (dir: DirectiveNode, node: ElementNode, context: TransformContext, augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult) => DirectiveTransformResult; +interface DirectiveTransformResult { + props: Property[]; + needRuntime?: boolean | symbol; + ssrTagParts?: TemplateLiteral['elements']; +} +export type StructuralDirectiveTransform = (node: ElementNode, dir: DirectiveNode, context: TransformContext) => void | (() => void); +interface ImportItem { + exp: string | ExpressionNode; + path: string; +} +export interface TransformContext extends Required<Omit<TransformOptions, keyof CompilerCompatOptions>>, CompilerCompatOptions { + selfName: string | null; + root: RootNode; + helpers: Map<symbol, number>; + components: Set<string>; + directives: Set<string>; + hoists: (JSChildNode | null)[]; + imports: ImportItem[]; + temps: number; + cached: (CacheExpression | null)[]; + identifiers: { + [name: string]: number | undefined; + }; + scopes: { + vFor: number; + vSlot: number; + vPre: number; + vOnce: number; + }; + parent: ParentNode | null; + grandParent: ParentNode | null; + childIndex: number; + currentNode: RootNode | TemplateChildNode | null; + inVOnce: boolean; + helper<T extends symbol>(name: T): T; + removeHelper<T extends symbol>(name: T): void; + helperString(name: symbol): string; + replaceNode(node: TemplateChildNode): void; + removeNode(node?: TemplateChildNode): void; + onNodeRemoved(): void; + addIdentifiers(exp: ExpressionNode | string): void; + removeIdentifiers(exp: ExpressionNode | string): void; + hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode; + cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression; + constantCache: WeakMap<TemplateChildNode, ConstantTypes>; + filters?: Set<string>; +} +export declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, hmr, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig, }: TransformOptions): TransformContext; +export declare function transform(root: RootNode, options: TransformOptions): void; +export declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void; +export declare function createStructuralDirectiveTransform(name: string | RegExp, fn: StructuralDirectiveTransform): NodeTransform; + +export declare const transformElement: NodeTransform; +export declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression; +export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode; +export declare function buildProps(node: ElementNode, context: TransformContext, props: ElementNode['props'] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): { + props: PropsExpression | undefined; + directives: DirectiveNode[]; + patchFlag: number; + dynamicPropNames: string[]; + shouldUseBlock: boolean; +}; +export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression; + +export type Namespace = number; +export declare enum Namespaces { + HTML = 0, + SVG = 1, + MATH_ML = 2 +} +export declare enum NodeTypes { + ROOT = 0, + ELEMENT = 1, + TEXT = 2, + COMMENT = 3, + SIMPLE_EXPRESSION = 4, + INTERPOLATION = 5, + ATTRIBUTE = 6, + DIRECTIVE = 7, + COMPOUND_EXPRESSION = 8, + IF = 9, + IF_BRANCH = 10, + FOR = 11, + TEXT_CALL = 12, + VNODE_CALL = 13, + JS_CALL_EXPRESSION = 14, + JS_OBJECT_EXPRESSION = 15, + JS_PROPERTY = 16, + JS_ARRAY_EXPRESSION = 17, + JS_FUNCTION_EXPRESSION = 18, + JS_CONDITIONAL_EXPRESSION = 19, + JS_CACHE_EXPRESSION = 20, + JS_BLOCK_STATEMENT = 21, + JS_TEMPLATE_LITERAL = 22, + JS_IF_STATEMENT = 23, + JS_ASSIGNMENT_EXPRESSION = 24, + JS_SEQUENCE_EXPRESSION = 25, + JS_RETURN_STATEMENT = 26 +} +export declare enum ElementTypes { + ELEMENT = 0, + COMPONENT = 1, + SLOT = 2, + TEMPLATE = 3 +} +export interface Node { + type: NodeTypes; + loc: SourceLocation; +} +export interface SourceLocation { + start: Position; + end: Position; + source: string; +} +export interface Position { + offset: number; + line: number; + column: number; +} +export type ParentNode = RootNode | ElementNode | IfBranchNode | ForNode; +export type ExpressionNode = SimpleExpressionNode | CompoundExpressionNode; +export type TemplateChildNode = ElementNode | InterpolationNode | CompoundExpressionNode | TextNode | CommentNode | IfNode | IfBranchNode | ForNode | TextCallNode; +export interface RootNode extends Node { + type: NodeTypes.ROOT; + source: string; + children: TemplateChildNode[]; + helpers: Set<symbol>; + components: string[]; + directives: string[]; + hoists: (JSChildNode | null)[]; + imports: ImportItem[]; + cached: (CacheExpression | null)[]; + temps: number; + ssrHelpers?: symbol[]; + codegenNode?: TemplateChildNode | JSChildNode | BlockStatement; + transformed?: boolean; + filters?: string[]; +} +export type ElementNode = PlainElementNode | ComponentNode | SlotOutletNode | TemplateNode; +export interface BaseElementNode extends Node { + type: NodeTypes.ELEMENT; + ns: Namespace; + tag: string; + tagType: ElementTypes; + props: Array<AttributeNode | DirectiveNode>; + children: TemplateChildNode[]; + isSelfClosing?: boolean; + innerLoc?: SourceLocation; +} +export interface PlainElementNode extends BaseElementNode { + tagType: ElementTypes.ELEMENT; + codegenNode: VNodeCall | SimpleExpressionNode | CacheExpression | MemoExpression | undefined; + ssrCodegenNode?: TemplateLiteral; +} +export interface ComponentNode extends BaseElementNode { + tagType: ElementTypes.COMPONENT; + codegenNode: VNodeCall | CacheExpression | MemoExpression | undefined; + ssrCodegenNode?: CallExpression; +} +export interface SlotOutletNode extends BaseElementNode { + tagType: ElementTypes.SLOT; + codegenNode: RenderSlotCall | CacheExpression | undefined; + ssrCodegenNode?: CallExpression; +} +export interface TemplateNode extends BaseElementNode { + tagType: ElementTypes.TEMPLATE; + codegenNode: undefined; +} +export interface TextNode extends Node { + type: NodeTypes.TEXT; + content: string; +} +export interface CommentNode extends Node { + type: NodeTypes.COMMENT; + content: string; +} +export interface AttributeNode extends Node { + type: NodeTypes.ATTRIBUTE; + name: string; + nameLoc: SourceLocation; + value: TextNode | undefined; +} +export interface DirectiveNode extends Node { + type: NodeTypes.DIRECTIVE; + /** + * the normalized name without prefix or shorthands, e.g. "bind", "on" + */ + name: string; + /** + * the raw attribute name, preserving shorthand, and including arg & modifiers + * this is only used during parse. + */ + rawName?: string; + exp: ExpressionNode | undefined; + arg: ExpressionNode | undefined; + modifiers: SimpleExpressionNode[]; + /** + * optional property to cache the expression parse result for v-for + */ + forParseResult?: ForParseResult; +} +/** + * Static types have several levels. + * Higher levels implies lower levels. e.g. a node that can be stringified + * can always be hoisted and skipped for patch. + */ +export declare enum ConstantTypes { + NOT_CONSTANT = 0, + CAN_SKIP_PATCH = 1, + CAN_CACHE = 2, + CAN_STRINGIFY = 3 +} +export interface SimpleExpressionNode extends Node { + type: NodeTypes.SIMPLE_EXPRESSION; + content: string; + isStatic: boolean; + constType: ConstantTypes; + /** + * - `null` means the expression is a simple identifier that doesn't need + * parsing + * - `false` means there was a parsing error + */ + ast?: Node$1 | null | false; + /** + * Indicates this is an identifier for a hoist vnode call and points to the + * hoisted node. + */ + hoisted?: JSChildNode; + /** + * an expression parsed as the params of a function will track + * the identifiers declared inside the function body. + */ + identifiers?: string[]; + isHandlerKey?: boolean; +} +export interface InterpolationNode extends Node { + type: NodeTypes.INTERPOLATION; + content: ExpressionNode; +} +export interface CompoundExpressionNode extends Node { + type: NodeTypes.COMPOUND_EXPRESSION; + /** + * - `null` means the expression is a simple identifier that doesn't need + * parsing + * - `false` means there was a parsing error + */ + ast?: Node$1 | null | false; + children: (SimpleExpressionNode | CompoundExpressionNode | InterpolationNode | TextNode | string | symbol)[]; + /** + * an expression parsed as the params of a function will track + * the identifiers declared inside the function body. + */ + identifiers?: string[]; + isHandlerKey?: boolean; +} +export interface IfNode extends Node { + type: NodeTypes.IF; + branches: IfBranchNode[]; + codegenNode?: IfConditionalExpression | CacheExpression; +} +export interface IfBranchNode extends Node { + type: NodeTypes.IF_BRANCH; + condition: ExpressionNode | undefined; + children: TemplateChildNode[]; + userKey?: AttributeNode | DirectiveNode; + isTemplateIf?: boolean; +} +export interface ForNode extends Node { + type: NodeTypes.FOR; + source: ExpressionNode; + valueAlias: ExpressionNode | undefined; + keyAlias: ExpressionNode | undefined; + objectIndexAlias: ExpressionNode | undefined; + parseResult: ForParseResult; + children: TemplateChildNode[]; + codegenNode?: ForCodegenNode; +} +export interface ForParseResult { + source: ExpressionNode; + value: ExpressionNode | undefined; + key: ExpressionNode | undefined; + index: ExpressionNode | undefined; + finalized: boolean; +} +export interface TextCallNode extends Node { + type: NodeTypes.TEXT_CALL; + content: TextNode | InterpolationNode | CompoundExpressionNode; + codegenNode: CallExpression | SimpleExpressionNode; +} +export type TemplateTextChildNode = TextNode | InterpolationNode | CompoundExpressionNode; +export interface VNodeCall extends Node { + type: NodeTypes.VNODE_CALL; + tag: string | symbol | CallExpression; + props: PropsExpression | undefined; + children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | CacheExpression | undefined; + patchFlag: PatchFlags | undefined; + dynamicProps: string | SimpleExpressionNode | undefined; + directives: DirectiveArguments | undefined; + isBlock: boolean; + disableTracking: boolean; + isComponent: boolean; +} +export type JSChildNode = VNodeCall | CallExpression | ObjectExpression | ArrayExpression | ExpressionNode | FunctionExpression | ConditionalExpression | CacheExpression | AssignmentExpression | SequenceExpression; +export interface CallExpression extends Node { + type: NodeTypes.JS_CALL_EXPRESSION; + callee: string | symbol; + arguments: (string | symbol | JSChildNode | SSRCodegenNode | TemplateChildNode | TemplateChildNode[])[]; +} +export interface ObjectExpression extends Node { + type: NodeTypes.JS_OBJECT_EXPRESSION; + properties: Array<Property>; +} +export interface Property extends Node { + type: NodeTypes.JS_PROPERTY; + key: ExpressionNode; + value: JSChildNode; +} +export interface ArrayExpression extends Node { + type: NodeTypes.JS_ARRAY_EXPRESSION; + elements: Array<string | Node>; +} +export interface FunctionExpression extends Node { + type: NodeTypes.JS_FUNCTION_EXPRESSION; + params: ExpressionNode | string | (ExpressionNode | string)[] | undefined; + returns?: TemplateChildNode | TemplateChildNode[] | JSChildNode; + body?: BlockStatement | IfStatement; + newline: boolean; + /** + * This flag is for codegen to determine whether it needs to generate the + * withScopeId() wrapper + */ + isSlot: boolean; + /** + * __COMPAT__ only, indicates a slot function that should be excluded from + * the legacy $scopedSlots instance property. + */ + isNonScopedSlot?: boolean; +} +export interface ConditionalExpression extends Node { + type: NodeTypes.JS_CONDITIONAL_EXPRESSION; + test: JSChildNode; + consequent: JSChildNode; + alternate: JSChildNode; + newline: boolean; +} +export interface CacheExpression extends Node { + type: NodeTypes.JS_CACHE_EXPRESSION; + index: number; + value: JSChildNode; + needPauseTracking: boolean; + inVOnce: boolean; + needArraySpread: boolean; +} +export interface MemoExpression extends CallExpression { + callee: typeof WITH_MEMO; + arguments: [ExpressionNode, MemoFactory, string, string]; +} +interface MemoFactory extends FunctionExpression { + returns: BlockCodegenNode; +} +export type SSRCodegenNode = BlockStatement | TemplateLiteral | IfStatement | AssignmentExpression | ReturnStatement | SequenceExpression; +export interface BlockStatement extends Node { + type: NodeTypes.JS_BLOCK_STATEMENT; + body: (JSChildNode | IfStatement)[]; +} +export interface TemplateLiteral extends Node { + type: NodeTypes.JS_TEMPLATE_LITERAL; + elements: (string | JSChildNode)[]; +} +export interface IfStatement extends Node { + type: NodeTypes.JS_IF_STATEMENT; + test: ExpressionNode; + consequent: BlockStatement; + alternate: IfStatement | BlockStatement | ReturnStatement | undefined; +} +export interface AssignmentExpression extends Node { + type: NodeTypes.JS_ASSIGNMENT_EXPRESSION; + left: SimpleExpressionNode; + right: JSChildNode; +} +export interface SequenceExpression extends Node { + type: NodeTypes.JS_SEQUENCE_EXPRESSION; + expressions: JSChildNode[]; +} +export interface ReturnStatement extends Node { + type: NodeTypes.JS_RETURN_STATEMENT; + returns: TemplateChildNode | TemplateChildNode[] | JSChildNode; +} +export interface DirectiveArguments extends ArrayExpression { + elements: DirectiveArgumentNode[]; +} +export interface DirectiveArgumentNode extends ArrayExpression { + elements: [string] | [string, ExpressionNode] | [string, ExpressionNode, ExpressionNode] | [string, ExpressionNode, ExpressionNode, ObjectExpression]; +} +export interface RenderSlotCall extends CallExpression { + callee: typeof RENDER_SLOT; + arguments: [string, string | ExpressionNode] | [string, string | ExpressionNode, PropsExpression] | [ + string, + string | ExpressionNode, + PropsExpression | '{}', + TemplateChildNode[] + ]; +} +export type SlotsExpression = SlotsObjectExpression | DynamicSlotsExpression; +export interface SlotsObjectExpression extends ObjectExpression { + properties: SlotsObjectProperty[]; +} +export interface SlotsObjectProperty extends Property { + value: SlotFunctionExpression; +} +export interface SlotFunctionExpression extends FunctionExpression { + returns: TemplateChildNode[] | CacheExpression; +} +export interface DynamicSlotsExpression extends CallExpression { + callee: typeof CREATE_SLOTS; + arguments: [SlotsObjectExpression, DynamicSlotEntries]; +} +export interface DynamicSlotEntries extends ArrayExpression { + elements: (ConditionalDynamicSlotNode | ListDynamicSlotNode)[]; +} +export interface ConditionalDynamicSlotNode extends ConditionalExpression { + consequent: DynamicSlotNode; + alternate: DynamicSlotNode | SimpleExpressionNode; +} +export interface ListDynamicSlotNode extends CallExpression { + callee: typeof RENDER_LIST; + arguments: [ExpressionNode, ListDynamicSlotIterator]; +} +export interface ListDynamicSlotIterator extends FunctionExpression { + returns: DynamicSlotNode; +} +export interface DynamicSlotNode extends ObjectExpression { + properties: [Property, DynamicSlotFnProperty]; +} +export interface DynamicSlotFnProperty extends Property { + value: SlotFunctionExpression; +} +export type BlockCodegenNode = VNodeCall | RenderSlotCall; +export interface IfConditionalExpression extends ConditionalExpression { + consequent: BlockCodegenNode | MemoExpression; + alternate: BlockCodegenNode | IfConditionalExpression | MemoExpression; +} +export interface ForCodegenNode extends VNodeCall { + isBlock: true; + tag: typeof FRAGMENT; + props: undefined; + children: ForRenderListExpression; + patchFlag: PatchFlags; + disableTracking: boolean; +} +export interface ForRenderListExpression extends CallExpression { + callee: typeof RENDER_LIST; + arguments: [ExpressionNode, ForIteratorExpression]; +} +export interface ForIteratorExpression extends FunctionExpression { + returns?: BlockCodegenNode; +} +export declare const locStub: SourceLocation; +export declare function createRoot(children: TemplateChildNode[], source?: string): RootNode; +export declare function createVNodeCall(context: TransformContext | null, tag: VNodeCall['tag'], props?: VNodeCall['props'], children?: VNodeCall['children'], patchFlag?: VNodeCall['patchFlag'], dynamicProps?: VNodeCall['dynamicProps'], directives?: VNodeCall['directives'], isBlock?: VNodeCall['isBlock'], disableTracking?: VNodeCall['disableTracking'], isComponent?: VNodeCall['isComponent'], loc?: SourceLocation): VNodeCall; +export declare function createArrayExpression(elements: ArrayExpression['elements'], loc?: SourceLocation): ArrayExpression; +export declare function createObjectExpression(properties: ObjectExpression['properties'], loc?: SourceLocation): ObjectExpression; +export declare function createObjectProperty(key: Property['key'] | string, value: Property['value']): Property; +export declare function createSimpleExpression(content: SimpleExpressionNode['content'], isStatic?: SimpleExpressionNode['isStatic'], loc?: SourceLocation, constType?: ConstantTypes): SimpleExpressionNode; +export declare function createInterpolation(content: InterpolationNode['content'] | string, loc: SourceLocation): InterpolationNode; +export declare function createCompoundExpression(children: CompoundExpressionNode['children'], loc?: SourceLocation): CompoundExpressionNode; +type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : CallExpression; +export declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>; +export declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression; +export declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression; +export declare function createCacheExpression(index: number, value: JSChildNode, needPauseTracking?: boolean, inVOnce?: boolean): CacheExpression; +export declare function createBlockStatement(body: BlockStatement['body']): BlockStatement; +export declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral; +export declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement; +export declare function createAssignmentExpression(left: AssignmentExpression['left'], right: AssignmentExpression['right']): AssignmentExpression; +export declare function createSequenceExpression(expressions: SequenceExpression['expressions']): SequenceExpression; +export declare function createReturnStatement(returns: ReturnStatement['returns']): ReturnStatement; +export declare function getVNodeHelper(ssr: boolean, isComponent: boolean): typeof CREATE_VNODE | typeof CREATE_ELEMENT_VNODE; +export declare function getVNodeBlockHelper(ssr: boolean, isComponent: boolean): typeof CREATE_BLOCK | typeof CREATE_ELEMENT_BLOCK; +export declare function convertToBlock(node: VNodeCall, { helper, removeHelper, inSSR }: TransformContext): void; + +export interface CompilerError extends SyntaxError { + code: number | string; + loc?: SourceLocation; +} +export interface CoreCompilerError extends CompilerError { + code: ErrorCodes; +} +type InferCompilerError<T> = T extends ErrorCodes ? CoreCompilerError : CompilerError; +export declare function createCompilerError<T extends number>(code: T, loc?: SourceLocation, messages?: { + [code: number]: string; +}, additionalMessage?: string): InferCompilerError<T>; +export declare enum ErrorCodes { + ABRUPT_CLOSING_OF_EMPTY_COMMENT = 0, + CDATA_IN_HTML_CONTENT = 1, + DUPLICATE_ATTRIBUTE = 2, + END_TAG_WITH_ATTRIBUTES = 3, + END_TAG_WITH_TRAILING_SOLIDUS = 4, + EOF_BEFORE_TAG_NAME = 5, + EOF_IN_CDATA = 6, + EOF_IN_COMMENT = 7, + EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT = 8, + EOF_IN_TAG = 9, + INCORRECTLY_CLOSED_COMMENT = 10, + INCORRECTLY_OPENED_COMMENT = 11, + INVALID_FIRST_CHARACTER_OF_TAG_NAME = 12, + MISSING_ATTRIBUTE_VALUE = 13, + MISSING_END_TAG_NAME = 14, + MISSING_WHITESPACE_BETWEEN_ATTRIBUTES = 15, + NESTED_COMMENT = 16, + UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME = 17, + UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE = 18, + UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME = 19, + UNEXPECTED_NULL_CHARACTER = 20, + UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME = 21, + UNEXPECTED_SOLIDUS_IN_TAG = 22, + X_INVALID_END_TAG = 23, + X_MISSING_END_TAG = 24, + X_MISSING_INTERPOLATION_END = 25, + X_MISSING_DIRECTIVE_NAME = 26, + X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END = 27, + X_V_IF_NO_EXPRESSION = 28, + X_V_IF_SAME_KEY = 29, + X_V_ELSE_NO_ADJACENT_IF = 30, + X_V_FOR_NO_EXPRESSION = 31, + X_V_FOR_MALFORMED_EXPRESSION = 32, + X_V_FOR_TEMPLATE_KEY_PLACEMENT = 33, + X_V_BIND_NO_EXPRESSION = 34, + X_V_ON_NO_EXPRESSION = 35, + X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET = 36, + X_V_SLOT_MIXED_SLOT_USAGE = 37, + X_V_SLOT_DUPLICATE_SLOT_NAMES = 38, + X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN = 39, + X_V_SLOT_MISPLACED = 40, + X_V_MODEL_NO_EXPRESSION = 41, + X_V_MODEL_MALFORMED_EXPRESSION = 42, + X_V_MODEL_ON_SCOPE_VARIABLE = 43, + X_V_MODEL_ON_PROPS = 44, + X_INVALID_EXPRESSION = 45, + X_KEEP_ALIVE_INVALID_CHILDREN = 46, + X_PREFIX_ID_NOT_SUPPORTED = 47, + X_MODULE_MODE_NOT_SUPPORTED = 48, + X_CACHE_HANDLER_NOT_SUPPORTED = 49, + X_SCOPE_ID_NOT_SUPPORTED = 50, + X_VNODE_HOOKS = 51, + X_V_BIND_INVALID_SAME_NAME_ARGUMENT = 52, + __EXTEND_POINT__ = 53 +} +export declare const errorMessages: Record<ErrorCodes, string>; + +interface ErrorHandlingOptions { + onWarn?: (warning: CompilerError) => void; + onError?: (error: CompilerError) => void; +} +export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptions { + /** + * Base mode is platform agnostic and only parses HTML-like template syntax, + * treating all tags the same way. Specific tag parsing behavior can be + * configured by higher-level compilers. + * + * HTML mode adds additional logic for handling special parsing behavior in + * `<script>`, `<style>`,`<title>` and `<textarea>`. + * The logic is handled inside compiler-core for efficiency. + * + * SFC mode treats content of all root-level tags except `<template>` as plain + * text. + */ + parseMode?: 'base' | 'html' | 'sfc'; + /** + * Specify the root namespace to use when parsing a template. + * Defaults to `Namespaces.HTML` (0). + */ + ns?: Namespaces; + /** + * e.g. platform native elements, e.g. `<div>` for browsers + */ + isNativeTag?: (tag: string) => boolean; + /** + * e.g. native elements that can self-close, e.g. `<img>`, `<br>`, `<hr>` + */ + isVoidTag?: (tag: string) => boolean; + /** + * e.g. elements that should preserve whitespace inside, e.g. `<pre>` + */ + isPreTag?: (tag: string) => boolean; + /** + * Elements that should ignore the first newline token per parinsg spec + * e.g. `<textarea>` and `<pre>` + */ + isIgnoreNewlineTag?: (tag: string) => boolean; + /** + * Platform-specific built-in components e.g. `<Transition>` + */ + isBuiltInComponent?: (tag: string) => symbol | void; + /** + * Separate option for end users to extend the native elements list + */ + isCustomElement?: (tag: string) => boolean | void; + /** + * Get tag namespace + */ + getNamespace?: (tag: string, parent: ElementNode | undefined, rootNamespace: Namespace) => Namespace; + /** + * @default ['{{', '}}'] + */ + delimiters?: [string, string]; + /** + * Whitespace handling strategy + * @default 'condense' + */ + whitespace?: 'preserve' | 'condense'; + /** + * Only used for DOM compilers that runs in the browser. + * In non-browser builds, this option is ignored. + */ + decodeEntities?: (rawText: string, asAttr: boolean) => string; + /** + * Whether to keep comments in the templates AST. + * This defaults to `true` in development and `false` in production builds. + */ + comments?: boolean; + /** + * Parse JavaScript expressions with Babel. + * @default false + */ + prefixIdentifiers?: boolean; + /** + * A list of parser plugins to enable for `@babel/parser`, which is used to + * parse expressions in bindings and interpolations. + * https://babeljs.io/docs/en/next/babel-parser#plugins + */ + expressionPlugins?: ParserPlugin[]; +} +export type HoistTransform = (children: TemplateChildNode[], context: TransformContext, parent: ParentNode) => void; +export declare enum BindingTypes { + /** + * returned from data() + */ + DATA = "data", + /** + * declared as a prop + */ + PROPS = "props", + /** + * a local alias of a `<script setup>` destructured prop. + * the original is stored in __propsAliases of the bindingMetadata object. + */ + PROPS_ALIASED = "props-aliased", + /** + * a let binding (may or may not be a ref) + */ + SETUP_LET = "setup-let", + /** + * a const binding that can never be a ref. + * these bindings don't need `unref()` calls when processed in inlined + * template expressions. + */ + SETUP_CONST = "setup-const", + /** + * a const binding that does not need `unref()`, but may be mutated. + */ + SETUP_REACTIVE_CONST = "setup-reactive-const", + /** + * a const binding that may be a ref. + */ + SETUP_MAYBE_REF = "setup-maybe-ref", + /** + * bindings that are guaranteed to be refs + */ + SETUP_REF = "setup-ref", + /** + * declared by other options, e.g. computed, inject + */ + OPTIONS = "options", + /** + * a literal constant, e.g. 'foo', 1, true + */ + LITERAL_CONST = "literal-const" +} +export type BindingMetadata = { + [key: string]: BindingTypes | undefined; +} & { + __isScriptSetup?: boolean; + __propsAliases?: Record<string, string>; +}; +interface SharedTransformCodegenOptions { + /** + * Transform expressions like {{ foo }} to `_ctx.foo`. + * If this option is false, the generated code will be wrapped in a + * `with (this) { ... }` block. + * - This is force-enabled in module mode, since modules are by default strict + * and cannot use `with` + * @default mode === 'module' + */ + prefixIdentifiers?: boolean; + /** + * Control whether generate SSR-optimized render functions instead. + * The resulting function must be attached to the component via the + * `ssrRender` option instead of `render`. + * + * When compiler generates code for SSR's fallback branch, we need to set it to false: + * - context.ssr = false + * + * see `subTransform` in `ssrTransformComponent.ts` + */ + ssr?: boolean; + /** + * Indicates whether the compiler generates code for SSR, + * it is always true when generating code for SSR, + * regardless of whether we are generating code for SSR's fallback branch, + * this means that when the compiler generates code for SSR's fallback branch: + * - context.ssr = false + * - context.inSSR = true + */ + inSSR?: boolean; + /** + * Optional binding metadata analyzed from script - used to optimize + * binding access when `prefixIdentifiers` is enabled. + */ + bindingMetadata?: BindingMetadata; + /** + * Compile the function for inlining inside setup(). + * This allows the function to directly access setup() local bindings. + */ + inline?: boolean; + /** + * Indicates that transforms and codegen should try to output valid TS code + */ + isTS?: boolean; + /** + * Filename for source map generation. + * Also used for self-recursive reference in templates + * @default 'template.vue.html' + */ + filename?: string; +} +export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHandlingOptions, CompilerCompatOptions { + /** + * An array of node transforms to be applied to every AST node. + */ + nodeTransforms?: NodeTransform[]; + /** + * An object of { name: transform } to be applied to every directive attribute + * node found on element nodes. + */ + directiveTransforms?: Record<string, DirectiveTransform | undefined>; + /** + * An optional hook to transform a node being hoisted. + * used by compiler-dom to turn hoisted nodes into stringified HTML vnodes. + * @default null + */ + transformHoist?: HoistTransform | null; + /** + * If the pairing runtime provides additional built-in elements, use this to + * mark them as built-in so the compiler will generate component vnodes + * for them. + */ + isBuiltInComponent?: (tag: string) => symbol | void; + /** + * Used by some transforms that expects only native elements + */ + isCustomElement?: (tag: string) => boolean | void; + /** + * Transform expressions like {{ foo }} to `_ctx.foo`. + * If this option is false, the generated code will be wrapped in a + * `with (this) { ... }` block. + * - This is force-enabled in module mode, since modules are by default strict + * and cannot use `with` + * @default mode === 'module' + */ + prefixIdentifiers?: boolean; + /** + * Cache static VNodes and props objects to `_hoisted_x` constants + * @default false + */ + hoistStatic?: boolean; + /** + * Cache v-on handlers to avoid creating new inline functions on each render, + * also avoids the need for dynamically patching the handlers by wrapping it. + * e.g `@click="foo"` by default is compiled to `{ onClick: foo }`. With this + * option it's compiled to: + * ```js + * { onClick: _cache[0] || (_cache[0] = e => _ctx.foo(e)) } + * ``` + * - Requires "prefixIdentifiers" to be enabled because it relies on scope + * analysis to determine if a handler is safe to cache. + * @default false + */ + cacheHandlers?: boolean; + /** + * A list of parser plugins to enable for `@babel/parser`, which is used to + * parse expressions in bindings and interpolations. + * https://babeljs.io/docs/en/next/babel-parser#plugins + */ + expressionPlugins?: ParserPlugin[]; + /** + * SFC scoped styles ID + */ + scopeId?: string | null; + /** + * Indicates this SFC template has used :slotted in its styles + * Defaults to `true` for backwards compatibility - SFC tooling should set it + * to `false` if no `:slotted` usage is detected in `<style>` + */ + slotted?: boolean; + /** + * SFC `<style vars>` injection string + * Should already be an object expression, e.g. `{ 'xxxx-color': color }` + * needed to render inline CSS variables on component root + */ + ssrCssVars?: string; + /** + * Whether to compile the template assuming it needs to handle HMR. + * Some edge cases may need to generate different code for HMR to work + * correctly, e.g. #6938, #7138 + */ + hmr?: boolean; +} +export interface CodegenOptions extends SharedTransformCodegenOptions { + /** + * - `module` mode will generate ES module import statements for helpers + * and export the render function as the default export. + * - `function` mode will generate a single `const { helpers... } = Vue` + * statement and return the render function. It expects `Vue` to be globally + * available (or passed by wrapping the code with an IIFE). It is meant to be + * used with `new Function(code)()` to generate a render function at runtime. + * @default 'function' + */ + mode?: 'module' | 'function'; + /** + * Generate source map? + * @default false + */ + sourceMap?: boolean; + /** + * SFC scoped styles ID + */ + scopeId?: string | null; + /** + * Option to optimize helper import bindings via variable assignment + * (only used for webpack code-split) + * @default false + */ + optimizeImports?: boolean; + /** + * Customize where to import runtime helpers from. + * @default 'vue' + */ + runtimeModuleName?: string; + /** + * Customize where to import ssr runtime helpers from/** + * @default 'vue/server-renderer' + */ + ssrRuntimeModuleName?: string; + /** + * Customize the global variable name of `Vue` to get helpers from + * in function mode + * @default 'Vue' + */ + runtimeGlobalName?: string; +} +export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions; + +/** + * The `SourceMapGenerator` type from `source-map-js` is a bit incomplete as it + * misses `toJSON()`. We also need to add types for internal properties which we + * need to access for better performance. + * + * Since TS 5.3, dts generation starts to strangely include broken triple slash + * references for source-map-js, so we are inlining all source map related types + * here to to workaround that. + */ +export interface CodegenSourceMapGenerator { + setSourceContent(sourceFile: string, sourceContent: string): void; + toJSON(): RawSourceMap; + _sources: Set<string>; + _names: Set<string>; + _mappings: { + add(mapping: MappingItem): void; + }; +} +export interface RawSourceMap { + file?: string; + sourceRoot?: string; + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; +} +interface MappingItem { + source: string; + generatedLine: number; + generatedColumn: number; + originalLine: number; + originalColumn: number; + name: string | null; +} +type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode; +export interface CodegenResult { + code: string; + preamble: string; + ast: RootNode; + map?: RawSourceMap; +} +export interface CodegenContext extends Omit<Required<CodegenOptions>, 'bindingMetadata' | 'inline'> { + source: string; + code: string; + line: number; + column: number; + offset: number; + indentLevel: number; + pure: boolean; + map?: CodegenSourceMapGenerator; + helper(key: symbol): string; + push(code: string, newlineIndex?: number, node?: CodegenNode): void; + indent(): void; + deindent(withoutNewLine?: boolean): void; + newline(): void; +} +export declare function generate(ast: RootNode, options?: CodegenOptions & { + onContextCreated?: (context: CodegenContext) => void; +}): CodegenResult; + +export type TransformPreset = [ + NodeTransform[], + Record<string, DirectiveTransform> +]; +export declare function getBaseTransformPreset(prefixIdentifiers?: boolean): TransformPreset; +export declare function baseCompile(source: string | RootNode, options?: CompilerOptions): CodegenResult; + +export declare const isStaticExp: (p: JSChildNode) => p is SimpleExpressionNode; +export declare function isCoreComponent(tag: string): symbol | void; +export declare const isSimpleIdentifier: (name: string) => boolean; +/** + * Simple lexer to check if an expression is a member expression. This is + * lax and only checks validity at the root level (i.e. does not validate exps + * inside square brackets), but it's ok since these are only used on template + * expressions and false positives are invalid expressions in the first place. + */ +export declare const isMemberExpressionBrowser: (exp: ExpressionNode) => boolean; +export declare const isMemberExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean; +export declare const isMemberExpression: (exp: ExpressionNode, context: TransformContext) => boolean; +export declare const isFnExpressionBrowser: (exp: ExpressionNode) => boolean; +export declare const isFnExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean; +export declare const isFnExpression: (exp: ExpressionNode, context: TransformContext) => boolean; +export declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position; +export declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position; +export declare function assert(condition: boolean, msg?: string): void; +export declare function findDir(node: ElementNode, name: string | RegExp, allowEmpty?: boolean): DirectiveNode | undefined; +export declare function findProp(node: ElementNode, name: string, dynamicOnly?: boolean, allowEmpty?: boolean): ElementNode['props'][0] | undefined; +export declare function isStaticArgOf(arg: DirectiveNode['arg'], name: string): boolean; +export declare function hasDynamicKeyVBind(node: ElementNode): boolean; +export declare function isText(node: TemplateChildNode): node is TextNode | InterpolationNode; +export declare function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode; +export declare function isTemplateNode(node: RootNode | TemplateChildNode): node is TemplateNode; +export declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode; +export declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void; +export declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string; +export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | CacheExpression | undefined, ids: TransformContext['identifiers']): boolean; +export declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall; +export declare const forAliasRE: RegExp; + +/** + * Return value indicates whether the AST walked can be a constant + */ +export declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1 | null, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void; +export declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean; +export declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean; +export declare function isInNewExpression(parentStack: Node$1[]): boolean; +export declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void; +export declare function walkBlockDeclarations(block: BlockStatement$1 | Program, onIdent: (node: Identifier) => void): void; +export declare function extractIdentifiers(param: Node$1, nodes?: Identifier[]): Identifier[]; +export declare const isFunctionType: (node: Node$1) => node is Function; +export declare const isStaticProperty: (node: Node$1) => node is ObjectProperty; +export declare const isStaticPropertyKey: (node: Node$1, parent: Node$1) => boolean; +export declare const TS_NODE_TYPES: string[]; +export declare function unwrapTSNode(node: Node$1): Node$1; + +export declare const transformModel: DirectiveTransform; + +export declare const transformOn: DirectiveTransform; + +export declare const transformBind: DirectiveTransform; + +export declare const noopDirectiveTransform: DirectiveTransform; + +export declare function processIf(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (node: IfNode, branch: IfBranchNode, isRoot: boolean) => (() => void) | undefined): (() => void) | undefined; + +export declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined; +export declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[]; + +export declare const transformExpression: NodeTransform; +export declare function processExpression(node: SimpleExpressionNode, context: TransformContext, asParams?: boolean, asRawStatements?: boolean, localVars?: Record<string, number>): ExpressionNode; +export declare function stringifyExpression(exp: ExpressionNode | string): string; + +export declare const trackSlotScopes: NodeTransform; +export declare const trackVForSlotScopes: NodeTransform; +export type SlotFnBuilder = (slotProps: ExpressionNode | undefined, vFor: DirectiveNode | undefined, slotChildren: TemplateChildNode[], loc: SourceLocation) => FunctionExpression; +export declare function buildSlots(node: ElementNode, context: TransformContext, buildSlotFn?: SlotFnBuilder): { + slots: SlotsExpression; + hasDynamicSlots: boolean; +}; + +interface SlotOutletProcessResult { + slotName: string | ExpressionNode; + slotProps: PropsExpression | undefined; +} +export declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult; + +export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode | CacheExpression, context: TransformContext): ConstantTypes; + diff --git a/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js new file mode 100644 index 0000000..8da200e --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js @@ -0,0 +1,5790 @@ +/** +* @vue/compiler-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { isString, NOOP, isObject, NO, extend, isSymbol, isArray, capitalize, camelize, EMPTY_OBJ, PatchFlagNames, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared'; +export { generateCodeFrame } from '@vue/shared'; + +const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``); +const TELEPORT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Teleport` : ``); +const SUSPENSE = Symbol(!!(process.env.NODE_ENV !== "production") ? `Suspense` : ``); +const KEEP_ALIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `KeepAlive` : ``); +const BASE_TRANSITION = Symbol( + !!(process.env.NODE_ENV !== "production") ? `BaseTransition` : `` +); +const OPEN_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `openBlock` : ``); +const CREATE_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createBlock` : ``); +const CREATE_ELEMENT_BLOCK = Symbol( + !!(process.env.NODE_ENV !== "production") ? `createElementBlock` : `` +); +const CREATE_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createVNode` : ``); +const CREATE_ELEMENT_VNODE = Symbol( + !!(process.env.NODE_ENV !== "production") ? `createElementVNode` : `` +); +const CREATE_COMMENT = Symbol( + !!(process.env.NODE_ENV !== "production") ? `createCommentVNode` : `` +); +const CREATE_TEXT = Symbol( + !!(process.env.NODE_ENV !== "production") ? `createTextVNode` : `` +); +const CREATE_STATIC = Symbol( + !!(process.env.NODE_ENV !== "production") ? `createStaticVNode` : `` +); +const RESOLVE_COMPONENT = Symbol( + !!(process.env.NODE_ENV !== "production") ? `resolveComponent` : `` +); +const RESOLVE_DYNAMIC_COMPONENT = Symbol( + !!(process.env.NODE_ENV !== "production") ? `resolveDynamicComponent` : `` +); +const RESOLVE_DIRECTIVE = Symbol( + !!(process.env.NODE_ENV !== "production") ? `resolveDirective` : `` +); +const RESOLVE_FILTER = Symbol( + !!(process.env.NODE_ENV !== "production") ? `resolveFilter` : `` +); +const WITH_DIRECTIVES = Symbol( + !!(process.env.NODE_ENV !== "production") ? `withDirectives` : `` +); +const RENDER_LIST = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderList` : ``); +const RENDER_SLOT = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderSlot` : ``); +const CREATE_SLOTS = Symbol(!!(process.env.NODE_ENV !== "production") ? `createSlots` : ``); +const TO_DISPLAY_STRING = Symbol( + !!(process.env.NODE_ENV !== "production") ? `toDisplayString` : `` +); +const MERGE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `mergeProps` : ``); +const NORMALIZE_CLASS = Symbol( + !!(process.env.NODE_ENV !== "production") ? `normalizeClass` : `` +); +const NORMALIZE_STYLE = Symbol( + !!(process.env.NODE_ENV !== "production") ? `normalizeStyle` : `` +); +const NORMALIZE_PROPS = Symbol( + !!(process.env.NODE_ENV !== "production") ? `normalizeProps` : `` +); +const GUARD_REACTIVE_PROPS = Symbol( + !!(process.env.NODE_ENV !== "production") ? `guardReactiveProps` : `` +); +const TO_HANDLERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlers` : ``); +const CAMELIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `camelize` : ``); +const CAPITALIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `capitalize` : ``); +const TO_HANDLER_KEY = Symbol( + !!(process.env.NODE_ENV !== "production") ? `toHandlerKey` : `` +); +const SET_BLOCK_TRACKING = Symbol( + !!(process.env.NODE_ENV !== "production") ? `setBlockTracking` : `` +); +const PUSH_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `pushScopeId` : ``); +const POP_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `popScopeId` : ``); +const WITH_CTX = Symbol(!!(process.env.NODE_ENV !== "production") ? `withCtx` : ``); +const UNREF = Symbol(!!(process.env.NODE_ENV !== "production") ? `unref` : ``); +const IS_REF = Symbol(!!(process.env.NODE_ENV !== "production") ? `isRef` : ``); +const WITH_MEMO = Symbol(!!(process.env.NODE_ENV !== "production") ? `withMemo` : ``); +const IS_MEMO_SAME = Symbol(!!(process.env.NODE_ENV !== "production") ? `isMemoSame` : ``); +const helperNameMap = { + [FRAGMENT]: `Fragment`, + [TELEPORT]: `Teleport`, + [SUSPENSE]: `Suspense`, + [KEEP_ALIVE]: `KeepAlive`, + [BASE_TRANSITION]: `BaseTransition`, + [OPEN_BLOCK]: `openBlock`, + [CREATE_BLOCK]: `createBlock`, + [CREATE_ELEMENT_BLOCK]: `createElementBlock`, + [CREATE_VNODE]: `createVNode`, + [CREATE_ELEMENT_VNODE]: `createElementVNode`, + [CREATE_COMMENT]: `createCommentVNode`, + [CREATE_TEXT]: `createTextVNode`, + [CREATE_STATIC]: `createStaticVNode`, + [RESOLVE_COMPONENT]: `resolveComponent`, + [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, + [RESOLVE_DIRECTIVE]: `resolveDirective`, + [RESOLVE_FILTER]: `resolveFilter`, + [WITH_DIRECTIVES]: `withDirectives`, + [RENDER_LIST]: `renderList`, + [RENDER_SLOT]: `renderSlot`, + [CREATE_SLOTS]: `createSlots`, + [TO_DISPLAY_STRING]: `toDisplayString`, + [MERGE_PROPS]: `mergeProps`, + [NORMALIZE_CLASS]: `normalizeClass`, + [NORMALIZE_STYLE]: `normalizeStyle`, + [NORMALIZE_PROPS]: `normalizeProps`, + [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, + [TO_HANDLERS]: `toHandlers`, + [CAMELIZE]: `camelize`, + [CAPITALIZE]: `capitalize`, + [TO_HANDLER_KEY]: `toHandlerKey`, + [SET_BLOCK_TRACKING]: `setBlockTracking`, + [PUSH_SCOPE_ID]: `pushScopeId`, + [POP_SCOPE_ID]: `popScopeId`, + [WITH_CTX]: `withCtx`, + [UNREF]: `unref`, + [IS_REF]: `isRef`, + [WITH_MEMO]: `withMemo`, + [IS_MEMO_SAME]: `isMemoSame` +}; +function registerRuntimeHelpers(helpers) { + Object.getOwnPropertySymbols(helpers).forEach((s) => { + helperNameMap[s] = helpers[s]; + }); +} + +const Namespaces = { + "HTML": 0, + "0": "HTML", + "SVG": 1, + "1": "SVG", + "MATH_ML": 2, + "2": "MATH_ML" +}; +const NodeTypes = { + "ROOT": 0, + "0": "ROOT", + "ELEMENT": 1, + "1": "ELEMENT", + "TEXT": 2, + "2": "TEXT", + "COMMENT": 3, + "3": "COMMENT", + "SIMPLE_EXPRESSION": 4, + "4": "SIMPLE_EXPRESSION", + "INTERPOLATION": 5, + "5": "INTERPOLATION", + "ATTRIBUTE": 6, + "6": "ATTRIBUTE", + "DIRECTIVE": 7, + "7": "DIRECTIVE", + "COMPOUND_EXPRESSION": 8, + "8": "COMPOUND_EXPRESSION", + "IF": 9, + "9": "IF", + "IF_BRANCH": 10, + "10": "IF_BRANCH", + "FOR": 11, + "11": "FOR", + "TEXT_CALL": 12, + "12": "TEXT_CALL", + "VNODE_CALL": 13, + "13": "VNODE_CALL", + "JS_CALL_EXPRESSION": 14, + "14": "JS_CALL_EXPRESSION", + "JS_OBJECT_EXPRESSION": 15, + "15": "JS_OBJECT_EXPRESSION", + "JS_PROPERTY": 16, + "16": "JS_PROPERTY", + "JS_ARRAY_EXPRESSION": 17, + "17": "JS_ARRAY_EXPRESSION", + "JS_FUNCTION_EXPRESSION": 18, + "18": "JS_FUNCTION_EXPRESSION", + "JS_CONDITIONAL_EXPRESSION": 19, + "19": "JS_CONDITIONAL_EXPRESSION", + "JS_CACHE_EXPRESSION": 20, + "20": "JS_CACHE_EXPRESSION", + "JS_BLOCK_STATEMENT": 21, + "21": "JS_BLOCK_STATEMENT", + "JS_TEMPLATE_LITERAL": 22, + "22": "JS_TEMPLATE_LITERAL", + "JS_IF_STATEMENT": 23, + "23": "JS_IF_STATEMENT", + "JS_ASSIGNMENT_EXPRESSION": 24, + "24": "JS_ASSIGNMENT_EXPRESSION", + "JS_SEQUENCE_EXPRESSION": 25, + "25": "JS_SEQUENCE_EXPRESSION", + "JS_RETURN_STATEMENT": 26, + "26": "JS_RETURN_STATEMENT" +}; +const ElementTypes = { + "ELEMENT": 0, + "0": "ELEMENT", + "COMPONENT": 1, + "1": "COMPONENT", + "SLOT": 2, + "2": "SLOT", + "TEMPLATE": 3, + "3": "TEMPLATE" +}; +const ConstantTypes = { + "NOT_CONSTANT": 0, + "0": "NOT_CONSTANT", + "CAN_SKIP_PATCH": 1, + "1": "CAN_SKIP_PATCH", + "CAN_CACHE": 2, + "2": "CAN_CACHE", + "CAN_STRINGIFY": 3, + "3": "CAN_STRINGIFY" +}; +const locStub = { + start: { line: 1, column: 1, offset: 0 }, + end: { line: 1, column: 1, offset: 0 }, + source: "" +}; +function createRoot(children, source = "") { + return { + type: 0, + source, + children, + helpers: /* @__PURE__ */ new Set(), + components: [], + directives: [], + hoists: [], + imports: [], + cached: [], + temps: 0, + codegenNode: void 0, + loc: locStub + }; +} +function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { + if (context) { + if (isBlock) { + context.helper(OPEN_BLOCK); + context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); + } else { + context.helper(getVNodeHelper(context.inSSR, isComponent)); + } + if (directives) { + context.helper(WITH_DIRECTIVES); + } + } + return { + type: 13, + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent, + loc + }; +} +function createArrayExpression(elements, loc = locStub) { + return { + type: 17, + loc, + elements + }; +} +function createObjectExpression(properties, loc = locStub) { + return { + type: 15, + loc, + properties + }; +} +function createObjectProperty(key, value) { + return { + type: 16, + loc: locStub, + key: isString(key) ? createSimpleExpression(key, true) : key, + value + }; +} +function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { + return { + type: 4, + loc, + content, + isStatic, + constType: isStatic ? 3 : constType + }; +} +function createInterpolation(content, loc) { + return { + type: 5, + loc, + content: isString(content) ? createSimpleExpression(content, false, loc) : content + }; +} +function createCompoundExpression(children, loc = locStub) { + return { + type: 8, + loc, + children + }; +} +function createCallExpression(callee, args = [], loc = locStub) { + return { + type: 14, + loc, + callee, + arguments: args + }; +} +function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { + return { + type: 18, + params, + returns, + newline, + isSlot, + loc + }; +} +function createConditionalExpression(test, consequent, alternate, newline = true) { + return { + type: 19, + test, + consequent, + alternate, + newline, + loc: locStub + }; +} +function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { + return { + type: 20, + index, + value, + needPauseTracking, + inVOnce, + needArraySpread: false, + loc: locStub + }; +} +function createBlockStatement(body) { + return { + type: 21, + body, + loc: locStub + }; +} +function createTemplateLiteral(elements) { + return { + type: 22, + elements, + loc: locStub + }; +} +function createIfStatement(test, consequent, alternate) { + return { + type: 23, + test, + consequent, + alternate, + loc: locStub + }; +} +function createAssignmentExpression(left, right) { + return { + type: 24, + left, + right, + loc: locStub + }; +} +function createSequenceExpression(expressions) { + return { + type: 25, + expressions, + loc: locStub + }; +} +function createReturnStatement(returns) { + return { + type: 26, + returns, + loc: locStub + }; +} +function getVNodeHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; +} +function getVNodeBlockHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; +} +function convertToBlock(node, { helper, removeHelper, inSSR }) { + if (!node.isBlock) { + node.isBlock = true; + removeHelper(getVNodeHelper(inSSR, node.isComponent)); + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(inSSR, node.isComponent)); + } +} + +const defaultDelimitersOpen = new Uint8Array([123, 123]); +const defaultDelimitersClose = new Uint8Array([125, 125]); +function isTagStartChar(c) { + return c >= 97 && c <= 122 || c >= 65 && c <= 90; +} +function isWhitespace(c) { + return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; +} +function isEndOfTagSection(c) { + return c === 47 || c === 62 || isWhitespace(c); +} +function toCharCodes(str) { + const ret = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + ret[i] = str.charCodeAt(i); + } + return ret; +} +const Sequences = { + Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), + // CDATA[ + CdataEnd: new Uint8Array([93, 93, 62]), + // ]]> + CommentEnd: new Uint8Array([45, 45, 62]), + // `-->` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `</style` + TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), + // `</title` + TextareaEnd: new Uint8Array([ + 60, + 47, + 116, + 101, + 120, + 116, + 97, + 114, + 101, + 97 + ]) + // `</textarea +}; +class Tokenizer { + constructor(stack, cbs) { + this.stack = stack; + this.cbs = cbs; + /** The current state the tokenizer is in. */ + this.state = 1; + /** The read buffer. */ + this.buffer = ""; + /** The beginning of the section that is currently being read. */ + this.sectionStart = 0; + /** The index within the buffer that we are currently looking at. */ + this.index = 0; + /** The start of the last entity. */ + this.entityStart = 0; + /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ + this.baseState = 1; + /** For special parsing behavior inside of script and style tags. */ + this.inRCDATA = false; + /** For disabling RCDATA tags handling */ + this.inXML = false; + /** For disabling interpolation parsing in v-pre */ + this.inVPre = false; + /** Record newline positions for fast line / column calculation */ + this.newlines = []; + this.mode = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + this.delimiterIndex = -1; + this.currentSequence = void 0; + this.sequenceIndex = 0; + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For <title> and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + if (!!(process.env.NODE_ENV !== "production") || false) { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if ((!!(process.env.NODE_ENV !== "production") || false) && this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if ((!!(process.env.NODE_ENV !== "production") || false) && c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if ((!!(process.env.NODE_ENV !== "production") || false) && (c === 34 || c === 39 || c === 60)) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + if (!!(process.env.NODE_ENV !== "production") || false) { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || this.fastForwardTo(quote)) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if ((!!(process.env.NODE_ENV !== "production") || false) && c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else ; + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + } + stateInEntity() { + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + } +} + +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; +const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } +}; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } +} +function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; +} +function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + if (!!(process.env.NODE_ENV !== "production") && enabled) { + warnDeprecation(key, context, loc, ...args); + } + return enabled; +} +function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); +} + +function defaultOnError(error) { + throw error; +} +function defaultOnWarn(msg) { + !!(process.env.NODE_ENV !== "production") && console.warn(`[Vue warn] ${msg.message}`); +} +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = !!(process.env.NODE_ENV !== "production") || false ? (messages || errorMessages)[code] + (additionalMessage || ``) : `https://vuejs.org/error-reference/#compiler-${code}`; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; +} +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" +}; +const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` +}; + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + { + return; + } +} +function isReferencedIdentifier(id, parent, parentStack) { + { + return false; + } +} +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; +} +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; +} +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); + } + } +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } +} +function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; +} +function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } +} +function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; + } + return nodes; +} +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } +} + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } +} +const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; +const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = NOOP ; +const isMemberExpression = isMemberExpressionBrowser ; +const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); +const isFnExpressionNode = NOOP ; +const isFnExpression = isFnExpressionBrowser ; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); +} +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; +} +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } +} +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) { + return p; + } + } +} +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } +} +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); +} +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); +} +function isText$1(node) { + return node.type === 5 || node.type === 2; +} +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !isString(props) && props.type === 14) { + const callee = props.callee; + if (!isString(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !isString(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || isString(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!isString(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; +} +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => isObject(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + if (!!(process.env.NODE_ENV !== "production")) ; + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: NO, + isPreTag: NO, + isIgnoreNewlineTag: NO, + isCustomElement: NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: !!(process.env.NODE_ENV !== "production"), + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = currentOptions.decodeEntities(exp, false); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentAttrValue.includes("&")) { + currentAttrValue = currentOptions.decodeEntities( + currentAttrValue, + true + ); + } + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( + (mod) => mod.content === "sync" + )) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if ((!!(process.env.NODE_ENV !== "production") || false) && tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; +} +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; +} +function onText(content, start, end) { + { + const tag = stack[0] && stack[0].tag; + if (tag !== "script" && tag !== "style" && content.includes("&")) { + content = currentOptions.decodeEntities(content, false); + } + } + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } +} +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if (!!(process.env.NODE_ENV !== "production") && isCompatEnabled( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions + )) { + let hasIf = false; + let hasFor = false; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 7) { + if (p.name === "if") { + hasIf = true; + } else if (p.name === "for") { + hasFor = true; + } + } + if (hasIf && hasFor) { + warnDeprecation( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions, + el.loc + ); + break; + } + } + } + if (!tokenizer.inSFCRoot && isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + !!(process.env.NODE_ENV !== "production") && warnDeprecation( + "COMPILER_NATIVE_TEMPLATE", + currentOptions, + el.loc + ); + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } + } +} +function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; +} +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; +} +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; +} +function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + return false; +} +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; +} +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; +} +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; +} +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; +} +function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); +} +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; +} +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + if (!!(process.env.NODE_ENV !== "production")) { + if (!currentOptions.decodeEntities) { + throw new Error( + `[@vue/compiler-core] decodeEntities option is required in browser builds.` + ); + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function cacheStatic(root, context) { + walk( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !isArray(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } +} +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child) || isSymbol(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + if (!!(process.env.NODE_ENV !== "production")) ; + return 0; + } +} +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; +} +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; +} +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } +} + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = NOOP, + isCustomElement = NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && capitalize(camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + if (!!(process.env.NODE_ENV !== "production")) { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if (!!(process.env.NODE_ENV !== "production") && !context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (!!(process.env.NODE_ENV !== "production") && removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: NOOP, + addIdentifiers(exp) { + }, + removeIdentifiers(exp) { + }, + hoist(exp) { + if (isString(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + { + context.filters = /* @__PURE__ */ new Set(); + } + return context; +} +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; + } +} +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + if (!!(process.env.NODE_ENV !== "production") && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; +} +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (isString(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (isArray(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } +} +function createStructuralDirectiveTransform(name, fn) { + const matches = isString(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; +} + +const PURE_ANNOTATION = `/*@__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const preambleContext = context; + { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + const signature = args.join(", "); + { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { + newline(); + genAssets(ast.filters, "filter", context); + newline(); + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: ``, + map: context.map ? context.map.toJSON() : void 0 + }; +} +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + genHoists(ast.hoists, context); + newline(); + push(`return `); +} +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } +} +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; +} +function isText(n) { + return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || !!(process.env.NODE_ENV !== "production") && nodes.some((n) => isArray(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (isString(node)) { + push(node, -3 /* Unknown */); + } else if (isArray(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } +} +function genNode(node, context) { + if (isString(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (isSymbol(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + !!(process.env.NODE_ENV !== "production") && assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + break; + case 23: + break; + case 24: + break; + case 25: + break; + case 26: + break; + /* v8 ignore start */ + case 10: + break; + default: + if (!!(process.env.NODE_ENV !== "production")) { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; + } + } +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } +} +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } +} +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + if (!!(process.env.NODE_ENV !== "production")) { + if (patchFlag < 0) { + patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `); + patchFlagString = patchFlag + ` /* ${flagNames} */`; + } + } else { + patchFlagString = String(patchFlag); + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } +} +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); +} +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = isString(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); +} +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || !!(process.env.NODE_ENV !== "production") && properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); +} +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); +} +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (isArray(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); + } + push(`)`); + } +} +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); +} +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } +} + +const prohibitedKeywordRE = new RegExp( + "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" +); +const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; +function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { + const exp = node.content; + if (!exp.trim()) { + return; + } + try { + new Function( + asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` + ); + } catch (e) { + let message = e.message; + const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); + if (keywordMatch) { + message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; + } + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + message + ) + ); + } +} + +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + { + if (!!(process.env.NODE_ENV !== "production")) { + validateBrowserExpression(node, context, asParams, asRawStatements); + } + return node; + } +} +function stringifyExpression(exp) { + if (isString(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (!!(process.env.NODE_ENV !== "production") && true && dir.exp) { + validateBrowserExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + !!(process.env.NODE_ENV !== "production") && comments.unshift(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + if (!!(process.env.NODE_ENV !== "production") && comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; + } + if (!!(process.env.NODE_ENV !== "production") || false) { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; +} +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + !!(process.env.NODE_ENV !== "production") ? '"v-if"' : '""', + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } +} +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + if (!!(process.env.NODE_ENV !== "production") && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } +} +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + exp = void 0; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } +}; + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if ((!!(process.env.NODE_ENV !== "production") || false) && isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (onExit) onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) return; + if (!!(process.env.NODE_ENV !== "production") && true) { + validateBrowserExpression(result.source, context); + if (result.key) { + validateBrowserExpression( + result.key, + context, + true + ); + } + if (result.index) { + validateBrowserExpression( + result.index, + context, + true + ); + } + if (result.value) { + validateBrowserExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); +} + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + vSlot.exp; + context.scopes.vSlot++; + return () => { + context.scopes.vSlot--; + }; + } + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (!!(process.env.NODE_ENV !== "production") ? ` /* ${slotFlagsText[slotFlag]} */` : ``), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; +} +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); +} + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if (!!(process.env.NODE_ENV !== "production") && node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; +}; +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + { + if (!!(process.env.NODE_ENV !== "production")) { + const hasOverridableKeys = mergeArgs.some((arg2) => { + if (arg2.type === 15) { + return arg2.properties.some(({ key }) => { + if (key.type !== 4 || !key.isStatic) { + return true; + } + return key.content !== "class" && key.content !== "style" && !isOn(key.content); + }); + } else { + return true; + } + }); + if (hasOverridableKeys) { + checkCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context, + loc + ); + } + } + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; + } + } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (isSymbol(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; +} +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); +} +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; +} + +const transformOn = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (!!(process.env.NODE_ENV !== "production") && rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + toHandlerKey(camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp); + const isInlineStatement = !(isMemberExp || isFnExpression(exp)); + const hasMultipleStatements = exp.content.includes(`;`); + if (!!(process.env.NODE_ENV !== "production") && true) { + validateBrowserExpression( + exp, + context, + false, + hasMultipleStatements + ); + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (!!(process.env.NODE_ENV !== "production") ? ` /* ${PatchFlagNames[1]} */` : ``) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; + +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } +}; + +const transformModel = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = false; + if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); +}; +function createTransformProps(props = []) { + return { props }; +} + +const validDivisionCharRE = /[\w).+\-_$\]]/; +const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } else if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); + } + }); + } +}; +function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } +} +function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + // " + case 39: + inSingle = true; + break; + // ' + case 96: + inTemplateString = true; + break; + // ` + case 40: + paren++; + break; + // ( + case 41: + paren--; + break; + // ) + case 91: + square++; + break; + // [ + case 93: + square--; + break; + // ] + case 123: + curly++; + break; + // { + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + if (filters.length) { + !!(process.env.NODE_ENV !== "production") && warnDeprecation( + "COMPILER_FILTERS", + context, + node.loc + ); + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; + node.ast = void 0; + } +} +function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + } +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } +}; + +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ...!!(process.env.NODE_ENV !== "production") ? [transformExpression] : [], + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn, + bind: transformBind, + model: transformModel + } + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + { + if (options.prefixIdentifiers === true) { + onError(createCompilerError(47)); + } else if (isModuleMode) { + onError(createCompilerError(48)); + } + } + const prefixIdentifiers = false; + if (options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = extend({}, options, { + prefixIdentifiers + }); + const ast = isString(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); + transform( + ast, + extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); +} + +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" +}; + +const noopDirectiveTransform = () => ({ props: [] }); + +export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation }; diff --git a/seller_1/node_modules/@vue/compiler-core/index.js b/seller_1/node_modules/@vue/compiler-core/index.js new file mode 100644 index 0000000..d3fc54f --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-core/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/compiler-core.cjs.prod.js') +} else { + module.exports = require('./dist/compiler-core.cjs.js') +} diff --git a/seller_1/node_modules/@vue/compiler-core/package.json b/seller_1/node_modules/@vue/compiler-core/package.json new file mode 100644 index 0000000..fb27b07 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-core/package.json @@ -0,0 +1,58 @@ +{ + "name": "@vue/compiler-core", + "version": "3.5.13", + "description": "@vue/compiler-core", + "main": "index.js", + "module": "dist/compiler-core.esm-bundler.js", + "types": "dist/compiler-core.d.ts", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/compiler-core.d.ts", + "node": { + "production": "./dist/compiler-core.cjs.prod.js", + "development": "./dist/compiler-core.cjs.js", + "default": "./index.js" + }, + "module": "./dist/compiler-core.esm-bundler.js", + "import": "./dist/compiler-core.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "buildOptions": { + "name": "VueCompilerCore", + "compat": true, + "formats": [ + "esm-bundler", + "cjs" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/compiler-core" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme", + "dependencies": { + "@babel/parser": "^7.25.3", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0", + "@vue/shared": "3.5.13" + }, + "devDependencies": { + "@babel/types": "^7.25.2" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/compiler-dom/LICENSE b/seller_1/node_modules/@vue/compiler-dom/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/compiler-dom/README.md b/seller_1/node_modules/@vue/compiler-dom/README.md new file mode 100644 index 0000000..57748e6 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/README.md @@ -0,0 +1 @@ +# @vue/compiler-dom diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js new file mode 100644 index 0000000..dc802dd --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js @@ -0,0 +1,928 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var compilerCore = require('@vue/compiler-core'); +var shared = require('@vue/shared'); + +const V_MODEL_RADIO = Symbol(`vModelRadio` ); +const V_MODEL_CHECKBOX = Symbol( + `vModelCheckbox` +); +const V_MODEL_TEXT = Symbol(`vModelText` ); +const V_MODEL_SELECT = Symbol( + `vModelSelect` +); +const V_MODEL_DYNAMIC = Symbol( + `vModelDynamic` +); +const V_ON_WITH_MODIFIERS = Symbol( + `vOnModifiersGuard` +); +const V_ON_WITH_KEYS = Symbol( + `vOnKeysGuard` +); +const V_SHOW = Symbol(`vShow` ); +const TRANSITION = Symbol(`Transition` ); +const TRANSITION_GROUP = Symbol( + `TransitionGroup` +); +compilerCore.registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +const parserOptions = { + parseMode: "html", + isVoidTag: shared.isVoidTag, + isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: void 0, + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: compilerCore.createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = shared.parseStringStyle(cssText); + return compilerCore.createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return compilerCore.createCompilerError( + code, + loc, + DOMErrorMessages + ); +} +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + compilerCore.createObjectProperty( + compilerCore.createSimpleExpression(`innerHTML`, true, loc), + exp || compilerCore.createSimpleExpression("", true) + ) + ] + }; +}; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + compilerCore.createObjectProperty( + compilerCore.createSimpleExpression(`textContent`, true), + exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression( + context.helperString(compilerCore.TO_DISPLAY_STRING), + [exp], + loc + ) : compilerCore.createSimpleExpression("", true) + ) + ] + }; +}; + +const transformModel = (dir, node, context) => { + const baseResult = compilerCore.transformModel(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + function checkDuplicatedValue() { + const value = compilerCore.findDir(node, "bind"); + if (value && compilerCore.isStaticArgOf(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = compilerCore.findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + break; + } + } + } else if (compilerCore.hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + checkDuplicatedValue(); + } + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ shared.makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right"); +const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(`onkeyup,onkeydown,onkeypress`); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (modifier === "native" && compilerCore.checkCompatEnabled( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (compilerCore.isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return compilerCore.transformOn(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join(""); + key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [compilerCore.createObjectProperty(key, handlerExp)] + }; + }); +}; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; +}; + +const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; + } + } +}; +function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); +} + +const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g; +const stringifyStatic = (children, context, parent) => { + if (context.scopes.vSlot > 0) { + return; + } + const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20; + let nc = 0; + let ec = 0; + const currentChunk = []; + const stringifyCurrentChunk = (currentIndex) => { + if (nc >= 20 || ec >= 5) { + const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [ + JSON.stringify( + currentChunk.map((node) => stringifyNode(node, context)).join("") + ).replace(expReplaceRE, `" + $1 + "`), + // the 2nd argument indicates the number of DOM nodes this static vnode + // will insert / hydrate + String(currentChunk.length) + ]); + const deleteCount = currentChunk.length - 1; + if (isParentCached) { + children.splice( + currentIndex - currentChunk.length, + currentChunk.length, + // @ts-expect-error + staticCall + ); + } else { + currentChunk[0].codegenNode.value = staticCall; + if (currentChunk.length > 1) { + children.splice(currentIndex - currentChunk.length + 1, deleteCount); + const cacheIndex = context.cached.indexOf( + currentChunk[currentChunk.length - 1].codegenNode + ); + if (cacheIndex > -1) { + for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { + const c = context.cached[i2]; + if (c) c.index -= deleteCount; + } + context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); + } + } + } + return deleteCount; + } + return 0; + }; + let i = 0; + for (; i < children.length; i++) { + const child = children[i]; + const isCached = isParentCached || getCachedNode(child); + if (isCached) { + const result = analyzeNode(child); + if (result) { + nc += result[0]; + ec += result[1]; + currentChunk.push(child); + continue; + } + } + i -= stringifyCurrentChunk(i); + nc = 0; + ec = 0; + currentChunk.length = 0; + } + stringifyCurrentChunk(i); +}; +const getCachedNode = (node) => { + if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { + return node.codegenNode; + } +}; +const dataAriaRE = /^(data|aria)-/; +const isStringifiableAttr = (name, ns) => { + return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name); +}; +const isNonStringifiable = /* @__PURE__ */ shared.makeMap( + `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` +); +function analyzeNode(node) { + if (node.type === 1 && isNonStringifiable(node.tag)) { + return false; + } + if (node.type === 12) { + return [1, 0]; + } + let nc = 1; + let ec = node.props.length > 0 ? 1 : 0; + let bailed = false; + const bail = () => { + bailed = true; + return false; + }; + function walk(node2) { + const isOptionTag = node2.tag === "option" && node2.ns === 0; + for (let i = 0; i < node2.props.length; i++) { + const p = node2.props[i]; + if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) { + return bail(); + } + if (p.type === 7 && p.name === "bind") { + if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) { + return bail(); + } + if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) { + return bail(); + } + if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) { + return bail(); + } + } + } + for (let i = 0; i < node2.children.length; i++) { + nc++; + const child = node2.children[i]; + if (child.type === 1) { + if (child.props.length > 0) { + ec++; + } + walk(child); + if (bailed) { + return false; + } + } + } + return true; + } + return walk(node) ? [nc, ec] : false; +} +function stringifyNode(node, context) { + if (shared.isString(node)) { + return node; + } + if (shared.isSymbol(node)) { + return ``; + } + switch (node.type) { + case 1: + return stringifyElement(node, context); + case 2: + return shared.escapeHtml(node.content); + case 3: + return `<!--${shared.escapeHtml(node.content)}-->`; + case 5: + return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content))); + case 8: + return shared.escapeHtml(evaluateConstant(node)); + case 12: + return stringifyNode(node.content, context); + default: + return ""; + } +} +function stringifyElement(node, context) { + let res = `<${node.tag}`; + let innerHTML = ""; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + res += ` ${p.name}`; + if (p.value) { + res += `="${shared.escapeHtml(p.value.content)}"`; + } + } else if (p.type === 7) { + if (p.name === "bind") { + const exp = p.exp; + if (exp.content[0] === "_") { + res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`; + continue; + } + if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") { + continue; + } + let evaluated = evaluateConstant(exp); + if (evaluated != null) { + const arg = p.arg && p.arg.content; + if (arg === "class") { + evaluated = shared.normalizeClass(evaluated); + } else if (arg === "style") { + evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated)); + } + res += ` ${p.arg.content}="${shared.escapeHtml( + evaluated + )}"`; + } + } else if (p.name === "html") { + innerHTML = evaluateConstant(p.exp); + } else if (p.name === "text") { + innerHTML = shared.escapeHtml( + shared.toDisplayString(evaluateConstant(p.exp)) + ); + } + } + } + if (context.scopeId) { + res += ` ${context.scopeId}`; + } + res += `>`; + if (innerHTML) { + res += innerHTML; + } else { + for (let i = 0; i < node.children.length; i++) { + res += stringifyNode(node.children[i], context); + } + } + if (!shared.isVoidTag(node.tag)) { + res += `</${node.tag}>`; + } + return res; +} +function evaluateConstant(exp) { + if (exp.type === 4) { + return new Function(`return (${exp.content})`)(); + } else { + let res = ``; + exp.children.forEach((c) => { + if (shared.isString(c) || shared.isSymbol(c)) { + return; + } + if (c.type === 2) { + res += c.content; + } else if (c.type === 5) { + res += shared.toDisplayString(evaluateConstant(c.content)); + } else { + res += evaluateConstant(c); + } + }); + return res; + } +} + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); + } +}; + +function isValidHTMLNesting(parent, child) { + if (parent in onlyValidChildren) { + return onlyValidChildren[parent].has(child); + } + if (child in onlyValidParents) { + return onlyValidParents[child].has(parent); + } + if (parent in knownInvalidChildren) { + if (knownInvalidChildren[parent].has(child)) return false; + } + if (child in knownInvalidParents) { + if (knownInvalidParents[child].has(parent)) return false; + } + return true; +} +const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); +const emptySet = /* @__PURE__ */ new Set([]); +const onlyValidChildren = { + head: /* @__PURE__ */ new Set([ + "base", + "basefront", + "bgsound", + "link", + "meta", + "title", + "noscript", + "noframes", + "style", + "script", + "template" + ]), + optgroup: /* @__PURE__ */ new Set(["option"]), + select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), + // table + table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), + tr: /* @__PURE__ */ new Set(["td", "th"]), + colgroup: /* @__PURE__ */ new Set(["col"]), + tbody: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["tr"]), + tfoot: /* @__PURE__ */ new Set(["tr"]), + // these elements can not have any children elements + script: emptySet, + iframe: emptySet, + option: emptySet, + textarea: emptySet, + style: emptySet, + title: emptySet +}; +const onlyValidParents = { + // sections + html: emptySet, + body: /* @__PURE__ */ new Set(["html"]), + head: /* @__PURE__ */ new Set(["html"]), + // table + td: /* @__PURE__ */ new Set(["tr"]), + colgroup: /* @__PURE__ */ new Set(["table"]), + caption: /* @__PURE__ */ new Set(["table"]), + tbody: /* @__PURE__ */ new Set(["table"]), + tfoot: /* @__PURE__ */ new Set(["table"]), + col: /* @__PURE__ */ new Set(["colgroup"]), + th: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["table"]), + tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), + // data list + dd: /* @__PURE__ */ new Set(["dl", "div"]), + dt: /* @__PURE__ */ new Set(["dl", "div"]), + // other + figcaption: /* @__PURE__ */ new Set(["figure"]), + // li: new Set(["ul", "ol"]), + summary: /* @__PURE__ */ new Set(["details"]), + area: /* @__PURE__ */ new Set(["map"]) +}; +const knownInvalidChildren = { + p: /* @__PURE__ */ new Set([ + "address", + "article", + "aside", + "blockquote", + "center", + "details", + "dialog", + "dir", + "div", + "dl", + "fieldset", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "li", + "main", + "nav", + "menu", + "ol", + "p", + "pre", + "section", + "table", + "ul" + ]), + svg: /* @__PURE__ */ new Set([ + "b", + "blockquote", + "br", + "code", + "dd", + "div", + "dl", + "dt", + "em", + "embed", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "li", + "menu", + "meta", + "ol", + "p", + "pre", + "ruby", + "s", + "small", + "span", + "strong", + "sub", + "sup", + "table", + "u", + "ul", + "var" + ]) +}; +const knownInvalidParents = { + a: /* @__PURE__ */ new Set(["a"]), + button: /* @__PURE__ */ new Set(["button"]), + dd: /* @__PURE__ */ new Set(["dd", "dt"]), + dt: /* @__PURE__ */ new Set(["dd", "dt"]), + form: /* @__PURE__ */ new Set(["form"]), + li: /* @__PURE__ */ new Set(["li"]), + h1: headings, + h2: headings, + h3: headings, + h4: headings, + h5: headings, + h6: headings +}; + +const validateHtmlNesting = (node, context) => { + if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { + const error = new SyntaxError( + `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` + ); + error.loc = node.loc; + context.onWarn(error); + } +}; + +const DOMNodeTransforms = [ + transformStyle, + ...[transformTransition, validateHtmlNesting] +]; +const DOMDirectiveTransforms = { + cloak: compilerCore.noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile(src, options = {}) { + return compilerCore.baseCompile( + src, + shared.extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: shared.extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: stringifyStatic + }) + ); +} +function parse(template, options = {}) { + return compilerCore.baseParse(template, shared.extend({}, parserOptions, options)); +} + +exports.DOMDirectiveTransforms = DOMDirectiveTransforms; +exports.DOMErrorCodes = DOMErrorCodes; +exports.DOMErrorMessages = DOMErrorMessages; +exports.DOMNodeTransforms = DOMNodeTransforms; +exports.TRANSITION = TRANSITION; +exports.TRANSITION_GROUP = TRANSITION_GROUP; +exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX; +exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC; +exports.V_MODEL_RADIO = V_MODEL_RADIO; +exports.V_MODEL_SELECT = V_MODEL_SELECT; +exports.V_MODEL_TEXT = V_MODEL_TEXT; +exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS; +exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS; +exports.V_SHOW = V_SHOW; +exports.compile = compile; +exports.createDOMCompilerError = createDOMCompilerError; +exports.parse = parse; +exports.parserOptions = parserOptions; +exports.transformStyle = transformStyle; +Object.keys(compilerCore).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k]; +}); diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js new file mode 100644 index 0000000..94b29b7 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js @@ -0,0 +1,686 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var compilerCore = require('@vue/compiler-core'); +var shared = require('@vue/shared'); + +const V_MODEL_RADIO = Symbol(``); +const V_MODEL_CHECKBOX = Symbol( + `` +); +const V_MODEL_TEXT = Symbol(``); +const V_MODEL_SELECT = Symbol( + `` +); +const V_MODEL_DYNAMIC = Symbol( + `` +); +const V_ON_WITH_MODIFIERS = Symbol( + `` +); +const V_ON_WITH_KEYS = Symbol( + `` +); +const V_SHOW = Symbol(``); +const TRANSITION = Symbol(``); +const TRANSITION_GROUP = Symbol( + `` +); +compilerCore.registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +const parserOptions = { + parseMode: "html", + isVoidTag: shared.isVoidTag, + isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: void 0, + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: compilerCore.createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = shared.parseStringStyle(cssText); + return compilerCore.createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return compilerCore.createCompilerError( + code, + loc, + DOMErrorMessages + ); +} +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + compilerCore.createObjectProperty( + compilerCore.createSimpleExpression(`innerHTML`, true, loc), + exp || compilerCore.createSimpleExpression("", true) + ) + ] + }; +}; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + compilerCore.createObjectProperty( + compilerCore.createSimpleExpression(`textContent`, true), + exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression( + context.helperString(compilerCore.TO_DISPLAY_STRING), + [exp], + loc + ) : compilerCore.createSimpleExpression("", true) + ) + ] + }; +}; + +const transformModel = (dir, node, context) => { + const baseResult = compilerCore.transformModel(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = compilerCore.findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + } + } + } else if (compilerCore.hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else ; + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else ; + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ shared.makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right"); +const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(`onkeyup,onkeydown,onkeypress`); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (modifier === "native" && compilerCore.checkCompatEnabled( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (compilerCore.isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return compilerCore.transformOn(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join(""); + key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [compilerCore.createObjectProperty(key, handlerExp)] + }; + }); +}; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; +}; + +const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g; +const stringifyStatic = (children, context, parent) => { + if (context.scopes.vSlot > 0) { + return; + } + const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20; + let nc = 0; + let ec = 0; + const currentChunk = []; + const stringifyCurrentChunk = (currentIndex) => { + if (nc >= 20 || ec >= 5) { + const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [ + JSON.stringify( + currentChunk.map((node) => stringifyNode(node, context)).join("") + ).replace(expReplaceRE, `" + $1 + "`), + // the 2nd argument indicates the number of DOM nodes this static vnode + // will insert / hydrate + String(currentChunk.length) + ]); + const deleteCount = currentChunk.length - 1; + if (isParentCached) { + children.splice( + currentIndex - currentChunk.length, + currentChunk.length, + // @ts-expect-error + staticCall + ); + } else { + currentChunk[0].codegenNode.value = staticCall; + if (currentChunk.length > 1) { + children.splice(currentIndex - currentChunk.length + 1, deleteCount); + const cacheIndex = context.cached.indexOf( + currentChunk[currentChunk.length - 1].codegenNode + ); + if (cacheIndex > -1) { + for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { + const c = context.cached[i2]; + if (c) c.index -= deleteCount; + } + context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); + } + } + } + return deleteCount; + } + return 0; + }; + let i = 0; + for (; i < children.length; i++) { + const child = children[i]; + const isCached = isParentCached || getCachedNode(child); + if (isCached) { + const result = analyzeNode(child); + if (result) { + nc += result[0]; + ec += result[1]; + currentChunk.push(child); + continue; + } + } + i -= stringifyCurrentChunk(i); + nc = 0; + ec = 0; + currentChunk.length = 0; + } + stringifyCurrentChunk(i); +}; +const getCachedNode = (node) => { + if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { + return node.codegenNode; + } +}; +const dataAriaRE = /^(data|aria)-/; +const isStringifiableAttr = (name, ns) => { + return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name); +}; +const isNonStringifiable = /* @__PURE__ */ shared.makeMap( + `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` +); +function analyzeNode(node) { + if (node.type === 1 && isNonStringifiable(node.tag)) { + return false; + } + if (node.type === 12) { + return [1, 0]; + } + let nc = 1; + let ec = node.props.length > 0 ? 1 : 0; + let bailed = false; + const bail = () => { + bailed = true; + return false; + }; + function walk(node2) { + const isOptionTag = node2.tag === "option" && node2.ns === 0; + for (let i = 0; i < node2.props.length; i++) { + const p = node2.props[i]; + if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) { + return bail(); + } + if (p.type === 7 && p.name === "bind") { + if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) { + return bail(); + } + if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) { + return bail(); + } + if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) { + return bail(); + } + } + } + for (let i = 0; i < node2.children.length; i++) { + nc++; + const child = node2.children[i]; + if (child.type === 1) { + if (child.props.length > 0) { + ec++; + } + walk(child); + if (bailed) { + return false; + } + } + } + return true; + } + return walk(node) ? [nc, ec] : false; +} +function stringifyNode(node, context) { + if (shared.isString(node)) { + return node; + } + if (shared.isSymbol(node)) { + return ``; + } + switch (node.type) { + case 1: + return stringifyElement(node, context); + case 2: + return shared.escapeHtml(node.content); + case 3: + return `<!--${shared.escapeHtml(node.content)}-->`; + case 5: + return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content))); + case 8: + return shared.escapeHtml(evaluateConstant(node)); + case 12: + return stringifyNode(node.content, context); + default: + return ""; + } +} +function stringifyElement(node, context) { + let res = `<${node.tag}`; + let innerHTML = ""; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + res += ` ${p.name}`; + if (p.value) { + res += `="${shared.escapeHtml(p.value.content)}"`; + } + } else if (p.type === 7) { + if (p.name === "bind") { + const exp = p.exp; + if (exp.content[0] === "_") { + res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`; + continue; + } + if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") { + continue; + } + let evaluated = evaluateConstant(exp); + if (evaluated != null) { + const arg = p.arg && p.arg.content; + if (arg === "class") { + evaluated = shared.normalizeClass(evaluated); + } else if (arg === "style") { + evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated)); + } + res += ` ${p.arg.content}="${shared.escapeHtml( + evaluated + )}"`; + } + } else if (p.name === "html") { + innerHTML = evaluateConstant(p.exp); + } else if (p.name === "text") { + innerHTML = shared.escapeHtml( + shared.toDisplayString(evaluateConstant(p.exp)) + ); + } + } + } + if (context.scopeId) { + res += ` ${context.scopeId}`; + } + res += `>`; + if (innerHTML) { + res += innerHTML; + } else { + for (let i = 0; i < node.children.length; i++) { + res += stringifyNode(node.children[i], context); + } + } + if (!shared.isVoidTag(node.tag)) { + res += `</${node.tag}>`; + } + return res; +} +function evaluateConstant(exp) { + if (exp.type === 4) { + return new Function(`return (${exp.content})`)(); + } else { + let res = ``; + exp.children.forEach((c) => { + if (shared.isString(c) || shared.isSymbol(c)) { + return; + } + if (c.type === 2) { + res += c.content; + } else if (c.type === 5) { + res += shared.toDisplayString(evaluateConstant(c.content)); + } else { + res += evaluateConstant(c); + } + }); + return res; + } +} + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + context.removeNode(); + } +}; + +const DOMNodeTransforms = [ + transformStyle, + ...[] +]; +const DOMDirectiveTransforms = { + cloak: compilerCore.noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile(src, options = {}) { + return compilerCore.baseCompile( + src, + shared.extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: shared.extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: stringifyStatic + }) + ); +} +function parse(template, options = {}) { + return compilerCore.baseParse(template, shared.extend({}, parserOptions, options)); +} + +exports.DOMDirectiveTransforms = DOMDirectiveTransforms; +exports.DOMErrorCodes = DOMErrorCodes; +exports.DOMErrorMessages = DOMErrorMessages; +exports.DOMNodeTransforms = DOMNodeTransforms; +exports.TRANSITION = TRANSITION; +exports.TRANSITION_GROUP = TRANSITION_GROUP; +exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX; +exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC; +exports.V_MODEL_RADIO = V_MODEL_RADIO; +exports.V_MODEL_SELECT = V_MODEL_SELECT; +exports.V_MODEL_TEXT = V_MODEL_TEXT; +exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS; +exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS; +exports.V_SHOW = V_SHOW; +exports.compile = compile; +exports.createDOMCompilerError = createDOMCompilerError; +exports.parse = parse; +exports.parserOptions = parserOptions; +exports.transformStyle = transformStyle; +Object.keys(compilerCore).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k]; +}); diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts new file mode 100644 index 0000000..b631ed8 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts @@ -0,0 +1,45 @@ +import { ParserOptions, NodeTransform, SourceLocation, CompilerError, DirectiveTransform, RootNode, CompilerOptions, CodegenResult } from '@vue/compiler-core'; +export * from '@vue/compiler-core'; + +export declare const parserOptions: ParserOptions; + +export declare const V_MODEL_RADIO: unique symbol; +export declare const V_MODEL_CHECKBOX: unique symbol; +export declare const V_MODEL_TEXT: unique symbol; +export declare const V_MODEL_SELECT: unique symbol; +export declare const V_MODEL_DYNAMIC: unique symbol; +export declare const V_ON_WITH_MODIFIERS: unique symbol; +export declare const V_ON_WITH_KEYS: unique symbol; +export declare const V_SHOW: unique symbol; +export declare const TRANSITION: unique symbol; +export declare const TRANSITION_GROUP: unique symbol; + +export declare const transformStyle: NodeTransform; + +interface DOMCompilerError extends CompilerError { + code: DOMErrorCodes; +} +export declare function createDOMCompilerError(code: DOMErrorCodes, loc?: SourceLocation): DOMCompilerError; +export declare enum DOMErrorCodes { + X_V_HTML_NO_EXPRESSION = 53, + X_V_HTML_WITH_CHILDREN = 54, + X_V_TEXT_NO_EXPRESSION = 55, + X_V_TEXT_WITH_CHILDREN = 56, + X_V_MODEL_ON_INVALID_ELEMENT = 57, + X_V_MODEL_ARG_ON_ELEMENT = 58, + X_V_MODEL_ON_FILE_INPUT_ELEMENT = 59, + X_V_MODEL_UNNECESSARY_VALUE = 60, + X_V_SHOW_NO_EXPRESSION = 61, + X_TRANSITION_INVALID_CHILDREN = 62, + X_IGNORED_SIDE_EFFECT_TAG = 63, + __EXTEND_POINT__ = 64 +} +export declare const DOMErrorMessages: { + [code: number]: string; +}; + +export declare const DOMNodeTransforms: NodeTransform[]; +export declare const DOMDirectiveTransforms: Record<string, DirectiveTransform>; +export declare function compile(src: string | RootNode, options?: CompilerOptions): CodegenResult; +export declare function parse(template: string, options?: ParserOptions): RootNode; + diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js new file mode 100644 index 0000000..bd01668 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js @@ -0,0 +1,6597 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const extend = Object.assign; +const isArray = Array.isArray; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); + +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const FRAGMENT = Symbol(`Fragment` ); +const TELEPORT = Symbol(`Teleport` ); +const SUSPENSE = Symbol(`Suspense` ); +const KEEP_ALIVE = Symbol(`KeepAlive` ); +const BASE_TRANSITION = Symbol( + `BaseTransition` +); +const OPEN_BLOCK = Symbol(`openBlock` ); +const CREATE_BLOCK = Symbol(`createBlock` ); +const CREATE_ELEMENT_BLOCK = Symbol( + `createElementBlock` +); +const CREATE_VNODE = Symbol(`createVNode` ); +const CREATE_ELEMENT_VNODE = Symbol( + `createElementVNode` +); +const CREATE_COMMENT = Symbol( + `createCommentVNode` +); +const CREATE_TEXT = Symbol( + `createTextVNode` +); +const CREATE_STATIC = Symbol( + `createStaticVNode` +); +const RESOLVE_COMPONENT = Symbol( + `resolveComponent` +); +const RESOLVE_DYNAMIC_COMPONENT = Symbol( + `resolveDynamicComponent` +); +const RESOLVE_DIRECTIVE = Symbol( + `resolveDirective` +); +const RESOLVE_FILTER = Symbol( + `resolveFilter` +); +const WITH_DIRECTIVES = Symbol( + `withDirectives` +); +const RENDER_LIST = Symbol(`renderList` ); +const RENDER_SLOT = Symbol(`renderSlot` ); +const CREATE_SLOTS = Symbol(`createSlots` ); +const TO_DISPLAY_STRING = Symbol( + `toDisplayString` +); +const MERGE_PROPS = Symbol(`mergeProps` ); +const NORMALIZE_CLASS = Symbol( + `normalizeClass` +); +const NORMALIZE_STYLE = Symbol( + `normalizeStyle` +); +const NORMALIZE_PROPS = Symbol( + `normalizeProps` +); +const GUARD_REACTIVE_PROPS = Symbol( + `guardReactiveProps` +); +const TO_HANDLERS = Symbol(`toHandlers` ); +const CAMELIZE = Symbol(`camelize` ); +const CAPITALIZE = Symbol(`capitalize` ); +const TO_HANDLER_KEY = Symbol( + `toHandlerKey` +); +const SET_BLOCK_TRACKING = Symbol( + `setBlockTracking` +); +const PUSH_SCOPE_ID = Symbol(`pushScopeId` ); +const POP_SCOPE_ID = Symbol(`popScopeId` ); +const WITH_CTX = Symbol(`withCtx` ); +const UNREF = Symbol(`unref` ); +const IS_REF = Symbol(`isRef` ); +const WITH_MEMO = Symbol(`withMemo` ); +const IS_MEMO_SAME = Symbol(`isMemoSame` ); +const helperNameMap = { + [FRAGMENT]: `Fragment`, + [TELEPORT]: `Teleport`, + [SUSPENSE]: `Suspense`, + [KEEP_ALIVE]: `KeepAlive`, + [BASE_TRANSITION]: `BaseTransition`, + [OPEN_BLOCK]: `openBlock`, + [CREATE_BLOCK]: `createBlock`, + [CREATE_ELEMENT_BLOCK]: `createElementBlock`, + [CREATE_VNODE]: `createVNode`, + [CREATE_ELEMENT_VNODE]: `createElementVNode`, + [CREATE_COMMENT]: `createCommentVNode`, + [CREATE_TEXT]: `createTextVNode`, + [CREATE_STATIC]: `createStaticVNode`, + [RESOLVE_COMPONENT]: `resolveComponent`, + [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, + [RESOLVE_DIRECTIVE]: `resolveDirective`, + [RESOLVE_FILTER]: `resolveFilter`, + [WITH_DIRECTIVES]: `withDirectives`, + [RENDER_LIST]: `renderList`, + [RENDER_SLOT]: `renderSlot`, + [CREATE_SLOTS]: `createSlots`, + [TO_DISPLAY_STRING]: `toDisplayString`, + [MERGE_PROPS]: `mergeProps`, + [NORMALIZE_CLASS]: `normalizeClass`, + [NORMALIZE_STYLE]: `normalizeStyle`, + [NORMALIZE_PROPS]: `normalizeProps`, + [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, + [TO_HANDLERS]: `toHandlers`, + [CAMELIZE]: `camelize`, + [CAPITALIZE]: `capitalize`, + [TO_HANDLER_KEY]: `toHandlerKey`, + [SET_BLOCK_TRACKING]: `setBlockTracking`, + [PUSH_SCOPE_ID]: `pushScopeId`, + [POP_SCOPE_ID]: `popScopeId`, + [WITH_CTX]: `withCtx`, + [UNREF]: `unref`, + [IS_REF]: `isRef`, + [WITH_MEMO]: `withMemo`, + [IS_MEMO_SAME]: `isMemoSame` +}; +function registerRuntimeHelpers(helpers) { + Object.getOwnPropertySymbols(helpers).forEach((s) => { + helperNameMap[s] = helpers[s]; + }); +} + +const Namespaces = { + "HTML": 0, + "0": "HTML", + "SVG": 1, + "1": "SVG", + "MATH_ML": 2, + "2": "MATH_ML" +}; +const NodeTypes = { + "ROOT": 0, + "0": "ROOT", + "ELEMENT": 1, + "1": "ELEMENT", + "TEXT": 2, + "2": "TEXT", + "COMMENT": 3, + "3": "COMMENT", + "SIMPLE_EXPRESSION": 4, + "4": "SIMPLE_EXPRESSION", + "INTERPOLATION": 5, + "5": "INTERPOLATION", + "ATTRIBUTE": 6, + "6": "ATTRIBUTE", + "DIRECTIVE": 7, + "7": "DIRECTIVE", + "COMPOUND_EXPRESSION": 8, + "8": "COMPOUND_EXPRESSION", + "IF": 9, + "9": "IF", + "IF_BRANCH": 10, + "10": "IF_BRANCH", + "FOR": 11, + "11": "FOR", + "TEXT_CALL": 12, + "12": "TEXT_CALL", + "VNODE_CALL": 13, + "13": "VNODE_CALL", + "JS_CALL_EXPRESSION": 14, + "14": "JS_CALL_EXPRESSION", + "JS_OBJECT_EXPRESSION": 15, + "15": "JS_OBJECT_EXPRESSION", + "JS_PROPERTY": 16, + "16": "JS_PROPERTY", + "JS_ARRAY_EXPRESSION": 17, + "17": "JS_ARRAY_EXPRESSION", + "JS_FUNCTION_EXPRESSION": 18, + "18": "JS_FUNCTION_EXPRESSION", + "JS_CONDITIONAL_EXPRESSION": 19, + "19": "JS_CONDITIONAL_EXPRESSION", + "JS_CACHE_EXPRESSION": 20, + "20": "JS_CACHE_EXPRESSION", + "JS_BLOCK_STATEMENT": 21, + "21": "JS_BLOCK_STATEMENT", + "JS_TEMPLATE_LITERAL": 22, + "22": "JS_TEMPLATE_LITERAL", + "JS_IF_STATEMENT": 23, + "23": "JS_IF_STATEMENT", + "JS_ASSIGNMENT_EXPRESSION": 24, + "24": "JS_ASSIGNMENT_EXPRESSION", + "JS_SEQUENCE_EXPRESSION": 25, + "25": "JS_SEQUENCE_EXPRESSION", + "JS_RETURN_STATEMENT": 26, + "26": "JS_RETURN_STATEMENT" +}; +const ElementTypes = { + "ELEMENT": 0, + "0": "ELEMENT", + "COMPONENT": 1, + "1": "COMPONENT", + "SLOT": 2, + "2": "SLOT", + "TEMPLATE": 3, + "3": "TEMPLATE" +}; +const ConstantTypes = { + "NOT_CONSTANT": 0, + "0": "NOT_CONSTANT", + "CAN_SKIP_PATCH": 1, + "1": "CAN_SKIP_PATCH", + "CAN_CACHE": 2, + "2": "CAN_CACHE", + "CAN_STRINGIFY": 3, + "3": "CAN_STRINGIFY" +}; +const locStub = { + start: { line: 1, column: 1, offset: 0 }, + end: { line: 1, column: 1, offset: 0 }, + source: "" +}; +function createRoot(children, source = "") { + return { + type: 0, + source, + children, + helpers: /* @__PURE__ */ new Set(), + components: [], + directives: [], + hoists: [], + imports: [], + cached: [], + temps: 0, + codegenNode: void 0, + loc: locStub + }; +} +function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { + if (context) { + if (isBlock) { + context.helper(OPEN_BLOCK); + context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); + } else { + context.helper(getVNodeHelper(context.inSSR, isComponent)); + } + if (directives) { + context.helper(WITH_DIRECTIVES); + } + } + return { + type: 13, + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent, + loc + }; +} +function createArrayExpression(elements, loc = locStub) { + return { + type: 17, + loc, + elements + }; +} +function createObjectExpression(properties, loc = locStub) { + return { + type: 15, + loc, + properties + }; +} +function createObjectProperty(key, value) { + return { + type: 16, + loc: locStub, + key: isString(key) ? createSimpleExpression(key, true) : key, + value + }; +} +function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { + return { + type: 4, + loc, + content, + isStatic, + constType: isStatic ? 3 : constType + }; +} +function createInterpolation(content, loc) { + return { + type: 5, + loc, + content: isString(content) ? createSimpleExpression(content, false, loc) : content + }; +} +function createCompoundExpression(children, loc = locStub) { + return { + type: 8, + loc, + children + }; +} +function createCallExpression(callee, args = [], loc = locStub) { + return { + type: 14, + loc, + callee, + arguments: args + }; +} +function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { + return { + type: 18, + params, + returns, + newline, + isSlot, + loc + }; +} +function createConditionalExpression(test, consequent, alternate, newline = true) { + return { + type: 19, + test, + consequent, + alternate, + newline, + loc: locStub + }; +} +function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { + return { + type: 20, + index, + value, + needPauseTracking, + inVOnce, + needArraySpread: false, + loc: locStub + }; +} +function createBlockStatement(body) { + return { + type: 21, + body, + loc: locStub + }; +} +function createTemplateLiteral(elements) { + return { + type: 22, + elements, + loc: locStub + }; +} +function createIfStatement(test, consequent, alternate) { + return { + type: 23, + test, + consequent, + alternate, + loc: locStub + }; +} +function createAssignmentExpression(left, right) { + return { + type: 24, + left, + right, + loc: locStub + }; +} +function createSequenceExpression(expressions) { + return { + type: 25, + expressions, + loc: locStub + }; +} +function createReturnStatement(returns) { + return { + type: 26, + returns, + loc: locStub + }; +} +function getVNodeHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; +} +function getVNodeBlockHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; +} +function convertToBlock(node, { helper, removeHelper, inSSR }) { + if (!node.isBlock) { + node.isBlock = true; + removeHelper(getVNodeHelper(inSSR, node.isComponent)); + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(inSSR, node.isComponent)); + } +} + +const defaultDelimitersOpen = new Uint8Array([123, 123]); +const defaultDelimitersClose = new Uint8Array([125, 125]); +function isTagStartChar(c) { + return c >= 97 && c <= 122 || c >= 65 && c <= 90; +} +function isWhitespace(c) { + return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; +} +function isEndOfTagSection(c) { + return c === 47 || c === 62 || isWhitespace(c); +} +function toCharCodes(str) { + const ret = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + ret[i] = str.charCodeAt(i); + } + return ret; +} +const Sequences = { + Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), + // CDATA[ + CdataEnd: new Uint8Array([93, 93, 62]), + // ]]> + CommentEnd: new Uint8Array([45, 45, 62]), + // `-->` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `</style` + TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), + // `</title` + TextareaEnd: new Uint8Array([ + 60, + 47, + 116, + 101, + 120, + 116, + 97, + 114, + 101, + 97 + ]) + // `</textarea +}; +class Tokenizer { + constructor(stack, cbs) { + this.stack = stack; + this.cbs = cbs; + /** The current state the tokenizer is in. */ + this.state = 1; + /** The read buffer. */ + this.buffer = ""; + /** The beginning of the section that is currently being read. */ + this.sectionStart = 0; + /** The index within the buffer that we are currently looking at. */ + this.index = 0; + /** The start of the last entity. */ + this.entityStart = 0; + /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ + this.baseState = 1; + /** For special parsing behavior inside of script and style tags. */ + this.inRCDATA = false; + /** For disabling RCDATA tags handling */ + this.inXML = false; + /** For disabling interpolation parsing in v-pre */ + this.inVPre = false; + /** Record newline positions for fast line / column calculation */ + this.newlines = []; + this.mode = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + this.delimiterIndex = -1; + this.currentSequence = void 0; + this.sequenceIndex = 0; + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For <title> and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 34 || c === 39 || c === 60) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || this.fastForwardTo(quote)) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else ; + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + } + stateInEntity() { + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + } +} + +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; +const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } +}; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } +} +function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; +} +function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + if (enabled) { + warnDeprecation(key, context, loc, ...args); + } + return enabled; +} +function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); +} + +function defaultOnError(error) { + throw error; +} +function defaultOnWarn(msg) { + console.warn(`[Vue warn] ${msg.message}`); +} +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; +} +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" +}; +const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` +}; + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + { + return; + } +} +function isReferencedIdentifier(id, parent, parentStack) { + { + return false; + } +} +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; +} +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; +} +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); + } + } +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } +} +function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; +} +function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } +} +function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; + } + return nodes; +} +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } +} + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } +} +const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; +const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = NOOP ; +const isMemberExpression = isMemberExpressionBrowser ; +const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); +const isFnExpressionNode = NOOP ; +const isFnExpression = isFnExpressionBrowser ; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); +} +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; +} +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } +} +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) { + return p; + } + } +} +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } +} +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); +} +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); +} +function isText$1(node) { + return node.type === 5 || node.type === 2; +} +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !isString(props) && props.type === 14) { + const callee = props.callee; + if (!isString(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !isString(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || isString(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!isString(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; +} +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => isObject(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: NO, + isPreTag: NO, + isIgnoreNewlineTag: NO, + isCustomElement: NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: true, + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = currentOptions.decodeEntities(exp, false); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentAttrValue.includes("&")) { + currentAttrValue = currentOptions.decodeEntities( + currentAttrValue, + true + ); + } + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( + (mod) => mod.content === "sync" + )) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; +} +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; +} +function onText(content, start, end) { + { + const tag = stack[0] && stack[0].tag; + if (tag !== "script" && tag !== "style" && content.includes("&")) { + content = currentOptions.decodeEntities(content, false); + } + } + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } +} +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if (isCompatEnabled( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions + )) { + let hasIf = false; + let hasFor = false; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 7) { + if (p.name === "if") { + hasIf = true; + } else if (p.name === "for") { + hasFor = true; + } + } + if (hasIf && hasFor) { + warnDeprecation( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions, + el.loc + ); + break; + } + } + } + if (!tokenizer.inSFCRoot && isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + warnDeprecation( + "COMPILER_NATIVE_TEMPLATE", + currentOptions, + el.loc + ); + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } + } +} +function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; +} +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; +} +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; +} +function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + return false; +} +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; +} +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; +} +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; +} +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; +} +function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); +} +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; +} +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + { + if (!currentOptions.decodeEntities) { + throw new Error( + `[@vue/compiler-core] decodeEntities option is required in browser builds.` + ); + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function cacheStatic(root, context) { + walk( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !isArray(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } +} +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child) || isSymbol(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + return 0; + } +} +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; +} +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; +} +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } +} + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = NOOP, + isCustomElement = NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && capitalize(camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if (!context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: NOOP, + addIdentifiers(exp) { + }, + removeIdentifiers(exp) { + }, + hoist(exp) { + if (isString(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + { + context.filters = /* @__PURE__ */ new Set(); + } + return context; +} +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; + } +} +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + if (children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; +} +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (isString(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (isArray(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } +} +function createStructuralDirectiveTransform(name, fn) { + const matches = isString(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; +} + +const PURE_ANNOTATION = `/*@__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const preambleContext = context; + { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + const signature = args.join(", "); + { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { + newline(); + genAssets(ast.filters, "filter", context); + newline(); + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: ``, + map: context.map ? context.map.toJSON() : void 0 + }; +} +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + genHoists(ast.hoists, context); + newline(); + push(`return `); +} +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } +} +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; +} +function isText(n) { + return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (isString(node)) { + push(node, -3 /* Unknown */); + } else if (isArray(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } +} +function genNode(node, context) { + if (isString(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (isSymbol(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + break; + case 23: + break; + case 24: + break; + case 25: + break; + case 26: + break; + /* v8 ignore start */ + case 10: + break; + default: + { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; + } + } +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } +} +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } +} +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + { + if (patchFlag < 0) { + patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `); + patchFlagString = patchFlag + ` /* ${flagNames} */`; + } + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } +} +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); +} +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = isString(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); +} +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); +} +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); +} +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (isArray(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); + } + push(`)`); + } +} +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); +} +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } +} + +const prohibitedKeywordRE = new RegExp( + "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" +); +const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; +function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { + const exp = node.content; + if (!exp.trim()) { + return; + } + try { + new Function( + asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` + ); + } catch (e) { + let message = e.message; + const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); + if (keywordMatch) { + message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; + } + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + message + ) + ); + } +} + +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + { + { + validateBrowserExpression(node, context, asParams, asRawStatements); + } + return node; + } +} +function stringifyExpression(exp) { + if (isString(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (dir.exp) { + validateBrowserExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + comments.unshift(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; + } + { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; +} +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + '"v-if"' , + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } +} +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } +} +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + exp = void 0; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } +}; + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if (isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (onExit) onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) return; + { + validateBrowserExpression(result.source, context); + if (result.key) { + validateBrowserExpression( + result.key, + context, + true + ); + } + if (result.index) { + validateBrowserExpression( + result.index, + context, + true + ); + } + if (result.value) { + validateBrowserExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); +} + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + vSlot.exp; + context.scopes.vSlot++; + return () => { + context.scopes.vSlot--; + }; + } + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; +} +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); +} + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if (node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; +}; +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + { + { + const hasOverridableKeys = mergeArgs.some((arg2) => { + if (arg2.type === 15) { + return arg2.properties.some(({ key }) => { + if (key.type !== 4 || !key.isStatic) { + return true; + } + return key.content !== "class" && key.content !== "style" && !isOn(key.content); + }); + } else { + return true; + } + }); + if (hasOverridableKeys) { + checkCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context, + loc + ); + } + } + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; + } + } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (isSymbol(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; +} +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); +} +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; +} + +const transformOn$1 = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + toHandlerKey(camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp); + const isInlineStatement = !(isMemberExp || isFnExpression(exp)); + const hasMultipleStatements = exp.content.includes(`;`); + { + validateBrowserExpression( + exp, + context, + false, + hasMultipleStatements + ); + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (` /* ${PatchFlagNames[1]} */` ) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; + +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } +}; + +const transformModel$1 = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = false; + if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); +}; +function createTransformProps(props = []) { + return { props }; +} + +const validDivisionCharRE = /[\w).+\-_$\]]/; +const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } else if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); + } + }); + } +}; +function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } +} +function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + // " + case 39: + inSingle = true; + break; + // ' + case 96: + inTemplateString = true; + break; + // ` + case 40: + paren++; + break; + // ( + case 41: + paren--; + break; + // ) + case 91: + square++; + break; + // [ + case 93: + square--; + break; + // ] + case 123: + curly++; + break; + // { + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + if (filters.length) { + warnDeprecation( + "COMPILER_FILTERS", + context, + node.loc + ); + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; + node.ast = void 0; + } +} +function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + } +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } +}; + +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ...[transformExpression] , + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn$1, + bind: transformBind, + model: transformModel$1 + } + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + { + if (options.prefixIdentifiers === true) { + onError(createCompilerError(47)); + } else if (isModuleMode) { + onError(createCompilerError(48)); + } + } + const prefixIdentifiers = false; + if (options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = extend({}, options, { + prefixIdentifiers + }); + const ast = isString(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); + transform( + ast, + extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); +} + +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" +}; + +const noopDirectiveTransform = () => ({ props: [] }); + +const V_MODEL_RADIO = Symbol(`vModelRadio` ); +const V_MODEL_CHECKBOX = Symbol( + `vModelCheckbox` +); +const V_MODEL_TEXT = Symbol(`vModelText` ); +const V_MODEL_SELECT = Symbol( + `vModelSelect` +); +const V_MODEL_DYNAMIC = Symbol( + `vModelDynamic` +); +const V_ON_WITH_MODIFIERS = Symbol( + `vOnModifiersGuard` +); +const V_ON_WITH_KEYS = Symbol( + `vOnKeysGuard` +); +const V_SHOW = Symbol(`vShow` ); +const TRANSITION = Symbol(`Transition` ); +const TRANSITION_GROUP = Symbol( + `TransitionGroup` +); +registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +let decoder; +function decodeHtmlBrowser(raw, asAttr = false) { + if (!decoder) { + decoder = document.createElement("div"); + } + if (asAttr) { + decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; + return decoder.children[0].getAttribute("foo"); + } else { + decoder.innerHTML = raw; + return decoder.textContent; + } +} + +const parserOptions = { + parseMode: "html", + isVoidTag, + isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: decodeHtmlBrowser , + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = parseStringStyle(cssText); + return createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return createCompilerError( + code, + loc, + DOMErrorMessages + ); +} +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`innerHTML`, true, loc), + exp || createSimpleExpression("", true) + ) + ] + }; +}; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`textContent`, true), + exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression( + context.helperString(TO_DISPLAY_STRING), + [exp], + loc + ) : createSimpleExpression("", true) + ) + ] + }; +}; + +const transformModel = (dir, node, context) => { + const baseResult = transformModel$1(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + function checkDuplicatedValue() { + const value = findDir(node, "bind"); + if (value && isStaticArgOf(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + break; + } + } + } else if (hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + checkDuplicatedValue(); + } + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right"); +const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (modifier === "native" && checkCompatEnabled( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return transformOn$1(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(capitalize).join(""); + key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [createObjectProperty(key, handlerExp)] + }; + }); +}; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; +}; + +const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; + } + } +}; +function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); +} + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); + } +}; + +function isValidHTMLNesting(parent, child) { + if (parent in onlyValidChildren) { + return onlyValidChildren[parent].has(child); + } + if (child in onlyValidParents) { + return onlyValidParents[child].has(parent); + } + if (parent in knownInvalidChildren) { + if (knownInvalidChildren[parent].has(child)) return false; + } + if (child in knownInvalidParents) { + if (knownInvalidParents[child].has(parent)) return false; + } + return true; +} +const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); +const emptySet = /* @__PURE__ */ new Set([]); +const onlyValidChildren = { + head: /* @__PURE__ */ new Set([ + "base", + "basefront", + "bgsound", + "link", + "meta", + "title", + "noscript", + "noframes", + "style", + "script", + "template" + ]), + optgroup: /* @__PURE__ */ new Set(["option"]), + select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), + // table + table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), + tr: /* @__PURE__ */ new Set(["td", "th"]), + colgroup: /* @__PURE__ */ new Set(["col"]), + tbody: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["tr"]), + tfoot: /* @__PURE__ */ new Set(["tr"]), + // these elements can not have any children elements + script: emptySet, + iframe: emptySet, + option: emptySet, + textarea: emptySet, + style: emptySet, + title: emptySet +}; +const onlyValidParents = { + // sections + html: emptySet, + body: /* @__PURE__ */ new Set(["html"]), + head: /* @__PURE__ */ new Set(["html"]), + // table + td: /* @__PURE__ */ new Set(["tr"]), + colgroup: /* @__PURE__ */ new Set(["table"]), + caption: /* @__PURE__ */ new Set(["table"]), + tbody: /* @__PURE__ */ new Set(["table"]), + tfoot: /* @__PURE__ */ new Set(["table"]), + col: /* @__PURE__ */ new Set(["colgroup"]), + th: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["table"]), + tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), + // data list + dd: /* @__PURE__ */ new Set(["dl", "div"]), + dt: /* @__PURE__ */ new Set(["dl", "div"]), + // other + figcaption: /* @__PURE__ */ new Set(["figure"]), + // li: new Set(["ul", "ol"]), + summary: /* @__PURE__ */ new Set(["details"]), + area: /* @__PURE__ */ new Set(["map"]) +}; +const knownInvalidChildren = { + p: /* @__PURE__ */ new Set([ + "address", + "article", + "aside", + "blockquote", + "center", + "details", + "dialog", + "dir", + "div", + "dl", + "fieldset", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "li", + "main", + "nav", + "menu", + "ol", + "p", + "pre", + "section", + "table", + "ul" + ]), + svg: /* @__PURE__ */ new Set([ + "b", + "blockquote", + "br", + "code", + "dd", + "div", + "dl", + "dt", + "em", + "embed", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "li", + "menu", + "meta", + "ol", + "p", + "pre", + "ruby", + "s", + "small", + "span", + "strong", + "sub", + "sup", + "table", + "u", + "ul", + "var" + ]) +}; +const knownInvalidParents = { + a: /* @__PURE__ */ new Set(["a"]), + button: /* @__PURE__ */ new Set(["button"]), + dd: /* @__PURE__ */ new Set(["dd", "dt"]), + dt: /* @__PURE__ */ new Set(["dd", "dt"]), + form: /* @__PURE__ */ new Set(["form"]), + li: /* @__PURE__ */ new Set(["li"]), + h1: headings, + h2: headings, + h3: headings, + h4: headings, + h5: headings, + h6: headings +}; + +const validateHtmlNesting = (node, context) => { + if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { + const error = new SyntaxError( + `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` + ); + error.loc = node.loc; + context.onWarn(error); + } +}; + +const DOMNodeTransforms = [ + transformStyle, + ...[transformTransition, validateHtmlNesting] +]; +const DOMDirectiveTransforms = { + cloak: noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile(src, options = {}) { + return baseCompile( + src, + extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: null + }) + ); +} +function parse(template, options = {}) { + return baseParse(template, extend({}, parserOptions, options)); +} + +export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, DOMDirectiveTransforms, DOMErrorCodes, DOMErrorMessages, DOMNodeTransforms, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TRANSITION, TRANSITION_GROUP, TS_NODE_TYPES, UNREF, V_MODEL_CHECKBOX, V_MODEL_DYNAMIC, V_MODEL_RADIO, V_MODEL_SELECT, V_MODEL_TEXT, V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS, V_SHOW, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, compile, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createDOMCompilerError, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, generateCodeFrame, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, parse, parserOptions, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel$1 as transformModel, transformOn$1 as transformOn, transformStyle, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation }; diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js new file mode 100644 index 0000000..f473ca6 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js @@ -0,0 +1,11 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let e;function t(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let n={},i=()=>{},s=()=>!1,r=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),o=Object.assign,a=Array.isArray,l=e=>"string"==typeof e,c=e=>"symbol"==typeof e,h=e=>null!==e&&"object"==typeof e,p=t(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),d=t("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),u=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},f=/-(\w)/g,E=u(e=>e.replace(f,(e,t)=>t?t.toUpperCase():"")),_=u(e=>e.charAt(0).toUpperCase()+e.slice(1)),m=u(e=>e?`on${_(e)}`:"");function S(e,t=0,n=e.length){if((t=Math.max(0,Math.min(t,e.length)))>(n=Math.max(0,Math.min(n,e.length))))return"";let i=e.split(/(\r?\n)/),s=i.filter((e,t)=>t%2==1);i=i.filter((e,t)=>t%2==0);let r=0,o=[];for(let e=0;e<i.length;e++)if((r+=i[e].length+(s[e]&&s[e].length||0))>=t){for(let a=e-2;a<=e+2||n>r;a++){if(a<0||a>=i.length)continue;let l=a+1;o.push(`${l}${" ".repeat(Math.max(3-String(l).length,0))}| ${i[a]}`);let c=i[a].length,h=s[a]&&s[a].length||0;if(a===e){let e=t-(r-(c+h)),i=Math.max(1,n>r?c-e:n-t);o.push(" | "+" ".repeat(e)+"^".repeat(i))}else if(a>e){if(n>r){let e=Math.max(Math.min(n-r,c),1);o.push(" | "+"^".repeat(e))}r+=c+h}}break}return o.join("\n")}let g=/;(?![^(]*\))/g,T=/:([^]+)/,N=/\/\*[^]*?\*\//g,I=t("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),y=t("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),O=t("annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"),A=t("area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"),C=Symbol(""),b=Symbol(""),R=Symbol(""),v=Symbol(""),x=Symbol(""),L=Symbol(""),M=Symbol(""),P=Symbol(""),D=Symbol(""),V=Symbol(""),k=Symbol(""),X=Symbol(""),w=Symbol(""),U=Symbol(""),F=Symbol(""),B=Symbol(""),$=Symbol(""),H=Symbol(""),G=Symbol(""),q=Symbol(""),J=Symbol(""),j=Symbol(""),W=Symbol(""),K=Symbol(""),Y=Symbol(""),Q=Symbol(""),z=Symbol(""),Z=Symbol(""),ee=Symbol(""),et=Symbol(""),en=Symbol(""),ei=Symbol(""),es=Symbol(""),er=Symbol(""),eo=Symbol(""),ea=Symbol(""),el=Symbol(""),ec=Symbol(""),eh=Symbol(""),ep={[C]:"Fragment",[b]:"Teleport",[R]:"Suspense",[v]:"KeepAlive",[x]:"BaseTransition",[L]:"openBlock",[M]:"createBlock",[P]:"createElementBlock",[D]:"createVNode",[V]:"createElementVNode",[k]:"createCommentVNode",[X]:"createTextVNode",[w]:"createStaticVNode",[U]:"resolveComponent",[F]:"resolveDynamicComponent",[B]:"resolveDirective",[$]:"resolveFilter",[H]:"withDirectives",[G]:"renderList",[q]:"renderSlot",[J]:"createSlots",[j]:"toDisplayString",[W]:"mergeProps",[K]:"normalizeClass",[Y]:"normalizeStyle",[Q]:"normalizeProps",[z]:"guardReactiveProps",[Z]:"toHandlers",[ee]:"camelize",[et]:"capitalize",[en]:"toHandlerKey",[ei]:"setBlockTracking",[es]:"pushScopeId",[er]:"popScopeId",[eo]:"withCtx",[ea]:"unref",[el]:"isRef",[ec]:"withMemo",[eh]:"isMemoSame"};function ed(e){Object.getOwnPropertySymbols(e).forEach(t=>{ep[t]=e[t]})}let eu={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},ef={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},eE={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},e_={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},em={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function eS(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:em}}function eg(e,t,n,i,s,r,o,a=!1,l=!1,c=!1,h=em){return e&&(a?(e.helper(L),e.helper(eX(e.inSSR,c))):e.helper(ek(e.inSSR,c)),o&&e.helper(H)),{type:13,tag:t,props:n,children:i,patchFlag:s,dynamicProps:r,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:h}}function eT(e,t=em){return{type:17,loc:t,elements:e}}function eN(e,t=em){return{type:15,loc:t,properties:e}}function eI(e,t){return{type:16,loc:em,key:l(e)?ey(e,!0):e,value:t}}function ey(e,t=!1,n=em,i=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:i}}function eO(e,t){return{type:5,loc:t,content:l(e)?ey(e,!1,t):e}}function eA(e,t=em){return{type:8,loc:t,children:e}}function eC(e,t=[],n=em){return{type:14,loc:n,callee:e,arguments:t}}function eb(e,t,n=!1,i=!1,s=em){return{type:18,params:e,returns:t,newline:n,isSlot:i,loc:s}}function eR(e,t,n,i=!0){return{type:19,test:e,consequent:t,alternate:n,newline:i,loc:em}}function ev(e,t,n=!1,i=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:i,needArraySpread:!1,loc:em}}function ex(e){return{type:21,body:e,loc:em}}function eL(e){return{type:22,elements:e,loc:em}}function eM(e,t,n){return{type:23,test:e,consequent:t,alternate:n,loc:em}}function eP(e,t){return{type:24,left:e,right:t,loc:em}}function eD(e){return{type:25,expressions:e,loc:em}}function eV(e){return{type:26,returns:e,loc:em}}function ek(e,t){return e||t?D:V}function eX(e,t){return e||t?M:P}function ew(e,{helper:t,removeHelper:n,inSSR:i}){e.isBlock||(e.isBlock=!0,n(ek(i,e.isComponent)),t(L),t(eX(i,e.isComponent)))}let eU=new Uint8Array([123,123]),eF=new Uint8Array([125,125]);function eB(e){return e>=97&&e<=122||e>=65&&e<=90}function e$(e){return 32===e||10===e||9===e||12===e||13===e}function eH(e){return 47===e||62===e||e$(e)}function eG(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}let eq={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])},eJ={COMPILER_IS_ON_ELEMENT:"COMPILER_IS_ON_ELEMENT",COMPILER_V_BIND_SYNC:"COMPILER_V_BIND_SYNC",COMPILER_V_BIND_OBJECT_ORDER:"COMPILER_V_BIND_OBJECT_ORDER",COMPILER_V_ON_NATIVE:"COMPILER_V_ON_NATIVE",COMPILER_V_IF_V_FOR_PRECEDENCE:"COMPILER_V_IF_V_FOR_PRECEDENCE",COMPILER_NATIVE_TEMPLATE:"COMPILER_NATIVE_TEMPLATE",COMPILER_INLINE_TEMPLATE:"COMPILER_INLINE_TEMPLATE",COMPILER_FILTERS:"COMPILER_FILTERS"},ej={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function eW(e,{compatConfig:t}){let n=t&&t[e];return"MODE"===e?n||3:n}function eK(e,t){let n=eW("MODE",t),i=eW(e,t);return 3===n?!0===i:!1!==i}function eY(e,t,n,...i){return eK(e,t)}function eQ(e,t,n,...i){if("suppress-warning"===eW(e,t))return;let{message:s,link:r}=ej[e],o=SyntaxError(`(deprecation ${e}) ${"function"==typeof s?s(...i):s}${r?` + Details: ${r}`:""}`);o.code=e,n&&(o.loc=n),t.onWarn(o)}function ez(e){throw e}function eZ(e){}function e1(e,t,n,i){let s=SyntaxError(String(`https://vuejs.org/error-reference/#compiler-${e}`));return s.code=e,s.loc=t,s}let e0={ABRUPT_CLOSING_OF_EMPTY_COMMENT:0,0:"ABRUPT_CLOSING_OF_EMPTY_COMMENT",CDATA_IN_HTML_CONTENT:1,1:"CDATA_IN_HTML_CONTENT",DUPLICATE_ATTRIBUTE:2,2:"DUPLICATE_ATTRIBUTE",END_TAG_WITH_ATTRIBUTES:3,3:"END_TAG_WITH_ATTRIBUTES",END_TAG_WITH_TRAILING_SOLIDUS:4,4:"END_TAG_WITH_TRAILING_SOLIDUS",EOF_BEFORE_TAG_NAME:5,5:"EOF_BEFORE_TAG_NAME",EOF_IN_CDATA:6,6:"EOF_IN_CDATA",EOF_IN_COMMENT:7,7:"EOF_IN_COMMENT",EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT:8,8:"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",EOF_IN_TAG:9,9:"EOF_IN_TAG",INCORRECTLY_CLOSED_COMMENT:10,10:"INCORRECTLY_CLOSED_COMMENT",INCORRECTLY_OPENED_COMMENT:11,11:"INCORRECTLY_OPENED_COMMENT",INVALID_FIRST_CHARACTER_OF_TAG_NAME:12,12:"INVALID_FIRST_CHARACTER_OF_TAG_NAME",MISSING_ATTRIBUTE_VALUE:13,13:"MISSING_ATTRIBUTE_VALUE",MISSING_END_TAG_NAME:14,14:"MISSING_END_TAG_NAME",MISSING_WHITESPACE_BETWEEN_ATTRIBUTES:15,15:"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",NESTED_COMMENT:16,16:"NESTED_COMMENT",UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME:17,17:"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE:18,18:"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME:19,19:"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",UNEXPECTED_NULL_CHARACTER:20,20:"UNEXPECTED_NULL_CHARACTER",UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME:21,21:"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",UNEXPECTED_SOLIDUS_IN_TAG:22,22:"UNEXPECTED_SOLIDUS_IN_TAG",X_INVALID_END_TAG:23,23:"X_INVALID_END_TAG",X_MISSING_END_TAG:24,24:"X_MISSING_END_TAG",X_MISSING_INTERPOLATION_END:25,25:"X_MISSING_INTERPOLATION_END",X_MISSING_DIRECTIVE_NAME:26,26:"X_MISSING_DIRECTIVE_NAME",X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END:27,27:"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",X_V_IF_NO_EXPRESSION:28,28:"X_V_IF_NO_EXPRESSION",X_V_IF_SAME_KEY:29,29:"X_V_IF_SAME_KEY",X_V_ELSE_NO_ADJACENT_IF:30,30:"X_V_ELSE_NO_ADJACENT_IF",X_V_FOR_NO_EXPRESSION:31,31:"X_V_FOR_NO_EXPRESSION",X_V_FOR_MALFORMED_EXPRESSION:32,32:"X_V_FOR_MALFORMED_EXPRESSION",X_V_FOR_TEMPLATE_KEY_PLACEMENT:33,33:"X_V_FOR_TEMPLATE_KEY_PLACEMENT",X_V_BIND_NO_EXPRESSION:34,34:"X_V_BIND_NO_EXPRESSION",X_V_ON_NO_EXPRESSION:35,35:"X_V_ON_NO_EXPRESSION",X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET:36,36:"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",X_V_SLOT_MIXED_SLOT_USAGE:37,37:"X_V_SLOT_MIXED_SLOT_USAGE",X_V_SLOT_DUPLICATE_SLOT_NAMES:38,38:"X_V_SLOT_DUPLICATE_SLOT_NAMES",X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN:39,39:"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",X_V_SLOT_MISPLACED:40,40:"X_V_SLOT_MISPLACED",X_V_MODEL_NO_EXPRESSION:41,41:"X_V_MODEL_NO_EXPRESSION",X_V_MODEL_MALFORMED_EXPRESSION:42,42:"X_V_MODEL_MALFORMED_EXPRESSION",X_V_MODEL_ON_SCOPE_VARIABLE:43,43:"X_V_MODEL_ON_SCOPE_VARIABLE",X_V_MODEL_ON_PROPS:44,44:"X_V_MODEL_ON_PROPS",X_INVALID_EXPRESSION:45,45:"X_INVALID_EXPRESSION",X_KEEP_ALIVE_INVALID_CHILDREN:46,46:"X_KEEP_ALIVE_INVALID_CHILDREN",X_PREFIX_ID_NOT_SUPPORTED:47,47:"X_PREFIX_ID_NOT_SUPPORTED",X_MODULE_MODE_NOT_SUPPORTED:48,48:"X_MODULE_MODE_NOT_SUPPORTED",X_CACHE_HANDLER_NOT_SUPPORTED:49,49:"X_CACHE_HANDLER_NOT_SUPPORTED",X_SCOPE_ID_NOT_SUPPORTED:50,50:"X_SCOPE_ID_NOT_SUPPORTED",X_VNODE_HOOKS:51,51:"X_VNODE_HOOKS",X_V_BIND_INVALID_SAME_NAME_ARGUMENT:52,52:"X_V_BIND_INVALID_SAME_NAME_ARGUMENT",__EXTEND_POINT__:53,53:"__EXTEND_POINT__"},e2={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '<' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:"Attribute name cannot contain U+0022 (\"), U+0027 ('), and U+003C (<).",18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",52:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""};function e3(e,t,n=!1,i=[],s=Object.create(null)){}function e4(e,t,n){return!1}function e6(e,t){if(e&&("ObjectProperty"===e.type||"ArrayPattern"===e.type)){let e=t.length;for(;e--;){let n=t[e];if("AssignmentExpression"===n.type)return!0;if("ObjectProperty"!==n.type&&!n.type.endsWith("Pattern"))break}}return!1}function e5(e){let t=e.length;for(;t--;){let n=e[t];if("NewExpression"===n.type)return!0;if("MemberExpression"!==n.type)break}return!1}function e9(e,t){for(let n of e.params)for(let e of e8(n))t(e)}function e7(e,t){for(let n of e.body)if("VariableDeclaration"===n.type){if(n.declare)continue;for(let e of n.declarations)for(let n of e8(e.id))t(n)}else if("FunctionDeclaration"===n.type||"ClassDeclaration"===n.type){if(n.declare||!n.id)continue;t(n.id)}else("ForOfStatement"===n.type||"ForInStatement"===n.type||"ForStatement"===n.type)&&function(e,t,n){let i="ForStatement"===e.type?e.init:e.left;if(i&&"VariableDeclaration"===i.type&&("var"===i.kind?t:!t))for(let e of i.declarations)for(let t of e8(e.id))n(t)}(n,!0,t)}function e8(e,t=[]){switch(e.type){case"Identifier":t.push(e);break;case"MemberExpression":let n=e;for(;"MemberExpression"===n.type;)n=n.object;t.push(n);break;case"ObjectPattern":for(let n of e.properties)"RestElement"===n.type?e8(n.argument,t):e8(n.value,t);break;case"ArrayPattern":e.elements.forEach(e=>{e&&e8(e,t)});break;case"RestElement":e8(e.argument,t);break;case"AssignmentPattern":e8(e.left,t)}return t}let te=e=>/Function(?:Expression|Declaration)$|Method$/.test(e.type),tt=e=>e&&("ObjectProperty"===e.type||"ObjectMethod"===e.type)&&!e.computed,tn=(e,t)=>tt(t)&&t.key===e,ti=["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"];function ts(e){return ti.includes(e.type)?ts(e.expression):e}let tr=e=>4===e.type&&e.isStatic;function to(e){switch(e){case"Teleport":case"teleport":return b;case"Suspense":case"suspense":return R;case"KeepAlive":case"keep-alive":return v;case"BaseTransition":case"base-transition":return x}}let ta=/^\d|[^\$\w\xA0-\uFFFF]/,tl=e=>!ta.test(e),tc=/[A-Za-z_$\xA0-\uFFFF]/,th=/[\.\?\w$\xA0-\uFFFF]/,tp=/\s+[.[]\s*|\s*[.[]\s+/g,td=e=>4===e.type?e.content:e.loc.source,tu=e=>{let t=td(e).trim().replace(tp,e=>e.trim()),n=0,i=[],s=0,r=0,o=null;for(let e=0;e<t.length;e++){let a=t.charAt(e);switch(n){case 0:if("["===a)i.push(n),n=1,s++;else if("("===a)i.push(n),n=2,r++;else if(!(0===e?tc:th).test(a))return!1;break;case 1:"'"===a||'"'===a||"`"===a?(i.push(n),n=3,o=a):"["===a?s++:"]"!==a||--s||(n=i.pop());break;case 2:if("'"===a||'"'===a||"`"===a)i.push(n),n=3,o=a;else if("("===a)r++;else if(")"===a){if(e===t.length-1)return!1;--r||(n=i.pop())}break;case 3:a===o&&(n=i.pop(),o=null)}}return!s&&!r},tf=i,tE=tu,t_=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,tm=e=>t_.test(td(e)),tS=i,tg=tm;function tT(e,t,n=t.length){return tN({offset:e.offset,line:e.line,column:e.column},t,n)}function tN(e,t,n=t.length){let i=0,s=-1;for(let e=0;e<n;e++)10===t.charCodeAt(e)&&(i++,s=e);return e.offset+=n,e.line+=i,e.column=-1===s?e.column+n:n-s,e}function tI(e,t){if(!e)throw Error(t||"unexpected compiler condition")}function ty(e,t,n=!1){for(let i=0;i<e.props.length;i++){let s=e.props[i];if(7===s.type&&(n||s.exp)&&(l(t)?s.name===t:t.test(s.name)))return s}}function tO(e,t,n=!1,i=!1){for(let s=0;s<e.props.length;s++){let r=e.props[s];if(6===r.type){if(n)continue;if(r.name===t&&(r.value||i))return r}else if("bind"===r.name&&(r.exp||i)&&tA(r.arg,t))return r}}function tA(e,t){return!!(e&&tr(e)&&e.content===t)}function tC(e){return e.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))}function tb(e){return 5===e.type||2===e.type}function tR(e){return 7===e.type&&"slot"===e.name}function tv(e){return 1===e.type&&3===e.tagType}function tx(e){return 1===e.type&&2===e.tagType}let tL=new Set([Q,z]);function tM(e,t,n){let i,s;let r=13===e.type?e.props:e.arguments[2],o=[];if(r&&!l(r)&&14===r.type){let e=function e(t,n=[]){if(t&&!l(t)&&14===t.type){let i=t.callee;if(!l(i)&&tL.has(i))return e(t.arguments[0],n.concat(t))}return[t,n]}(r);r=e[0],s=(o=e[1])[o.length-1]}if(null==r||l(r))i=eN([t]);else if(14===r.type){let e=r.arguments[0];l(e)||15!==e.type?r.callee===Z?i=eC(n.helper(W),[eN([t]),r]):r.arguments.unshift(eN([t])):tP(t,e)||e.properties.unshift(t),i||(i=r)}else 15===r.type?(tP(t,r)||r.properties.unshift(t),i=r):(i=eC(n.helper(W),[eN([t]),r]),s&&s.callee===z&&(s=o[o.length-2]));13===e.type?s?s.arguments[0]=i:e.props=i:s?s.arguments[0]=i:e.arguments[2]=i}function tP(e,t){let n=!1;if(4===e.key.type){let i=e.key.content;n=t.properties.some(e=>4===e.key.type&&e.key.content===i)}return n}function tD(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}function tV(e,t){if(!e||0===Object.keys(t).length)return!1;switch(e.type){case 1:for(let n=0;n<e.props.length;n++){let i=e.props[n];if(7===i.type&&(tV(i.arg,t)||tV(i.exp,t)))return!0}return e.children.some(e=>tV(e,t));case 11:if(tV(e.source,t))return!0;return e.children.some(e=>tV(e,t));case 9:return e.branches.some(e=>tV(e,t));case 10:if(tV(e.condition,t))return!0;return e.children.some(e=>tV(e,t));case 4:return!e.isStatic&&tl(e.content)&&!!t[e.content];case 8:return e.children.some(e=>h(e)&&tV(e,t));case 5:case 12:return tV(e.content,t);default:return!1}}function tk(e){return 14===e.type&&e.callee===ec?e.arguments[1].returns:e}let tX=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,tw={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:s,isPreTag:s,isIgnoreNewlineTag:s,isCustomElement:s,onError:ez,onWarn:eZ,comments:!1,prefixIdentifiers:!1},tU=tw,tF=null,tB="",t$=null,tH=null,tG="",tq=-1,tJ=-1,tj=0,tW=!1,tK=null,tY=[],tQ=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=eU,this.delimiterClose=eF,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=eU,this.delimiterClose=eF}getPos(e){let t=1,n=e+1;for(let i=this.newlines.length-1;i>=0;i--){let s=this.newlines[i];if(e>s){t=i+2,n=e-s;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex]){if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++}else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?eH(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t){this.sequenceIndex++;return}}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||e$(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.sectionStart=t+2,this.stateInClosingTagName(e),this.inRCDATA=!1;return}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence!==eq.TitleEnd&&(this.currentSequence!==eq.TextareaEnd||this.inSFCRoot)?this.fastForwardTo(60)&&(this.sequenceIndex=1):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e)):this.sequenceIndex=Number(60===e)}stateCDATASequence(e){e===eq.Cdata[this.sequenceIndex]?++this.sequenceIndex===eq.Cdata.length&&(this.state=28,this.currentSequence=eq.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length;){let t=this.buffer.charCodeAt(this.index);if(10===t&&this.newlines.push(this.index),t===e)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===eq.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(e,t){this.enterRCDATA(e,t),this.state=31}enterRCDATA(e,t){this.inRCDATA=!0,this.currentSequence=e,this.sequenceIndex=t}stateBeforeTagName(e){33===e?(this.state=22,this.sectionStart=this.index+1):63===e?(this.state=24,this.sectionStart=this.index+1):eB(e)?(this.sectionStart=this.index,0===this.mode?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:116===e?this.state=30:this.state=115===e?29:6):47===e?this.state=8:(this.state=1,this.stateText(e))}stateInTagName(e){eH(e)&&this.handleTagName(e)}stateInSFCRootTagName(e){if(eH(e)){let t=this.buffer.slice(this.sectionStart,this.index);"template"!==t&&this.enterRCDATA(eG("</"+t),0),this.handleTagName(e)}}handleTagName(e){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)}stateBeforeClosingTagName(e){e$(e)||(62===e?(this.state=1,this.sectionStart=this.index+1):(this.state=eB(e)?9:27,this.sectionStart=this.index))}stateInClosingTagName(e){(62===e||e$(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){62===e&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(e){62===e?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):47===e?this.state=7:60===e&&47===this.peek()?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):e$(e)||this.handleAttrStart(e)}handleAttrStart(e){118===e&&45===this.peek()?(this.state=13,this.sectionStart=this.index):46===e||58===e||64===e||35===e?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(e){62===e?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):e$(e)||(this.state=11,this.stateBeforeAttrName(e))}stateInAttrName(e){(61===e||eH(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(e))}stateInDirName(e){61===e||eH(e)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(e)):58===e?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):46===e&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(e){61===e||eH(e)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(e)):91===e?this.state=15:46===e&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(e){93===e?this.state=14:(61===e||eH(e))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(e))}stateInDirModifier(e){61===e||eH(e)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(e)):46===e&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(e){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(e)}stateAfterAttrName(e){61===e?this.state=18:47===e||62===e?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)):e$(e)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(e))}stateBeforeAttrValue(e){34===e?(this.state=19,this.sectionStart=this.index+1):39===e?(this.state=20,this.sectionStart=this.index+1):e$(e)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(e))}handleInAttrValue(e,t){(e===t||this.fastForwardTo(t))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(34===t?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(e){this.handleInAttrValue(e,34)}stateInAttrValueSingleQuotes(e){this.handleInAttrValue(e,39)}stateInAttrValueNoQuotes(e){e$(e)||62===e?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(e)):(39===e||60===e||61===e||96===e)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(e){91===e?(this.state=26,this.sequenceIndex=0):this.state=45===e?25:23}stateInDeclaration(e){(62===e||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(62===e||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(e){45===e?(this.state=28,this.currentSequence=eq.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(e){(62===e||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){e===eq.ScriptEnd[3]?this.startSpecial(eq.ScriptEnd,4):e===eq.StyleEnd[3]?this.startSpecial(eq.StyleEnd,4):(this.state=6,this.stateInTagName(e))}stateBeforeSpecialT(e){e===eq.TitleEnd[3]?this.startSpecial(eq.TitleEnd,4):e===eq.TextareaEnd[3]?this.startSpecial(eq.TextareaEnd,4):(this.state=6,this.stateInTagName(e))}startEntity(){}stateInEntity(){}parse(e){for(this.buffer=e;this.index<this.buffer.length;){let e=this.buffer.charCodeAt(this.index);switch(10===e&&this.newlines.push(this.index),this.state){case 1:this.stateText(e);break;case 2:this.stateInterpolationOpen(e);break;case 3:this.stateInterpolation(e);break;case 4:this.stateInterpolationClose(e);break;case 31:this.stateSpecialStartSequence(e);break;case 32:this.stateInRCDATA(e);break;case 26:this.stateCDATASequence(e);break;case 19:this.stateInAttrValueDoubleQuotes(e);break;case 12:this.stateInAttrName(e);break;case 13:this.stateInDirName(e);break;case 14:this.stateInDirArg(e);break;case 15:this.stateInDynamicDirArg(e);break;case 16:this.stateInDirModifier(e);break;case 28:this.stateInCommentLike(e);break;case 27:this.stateInSpecialComment(e);break;case 11:this.stateBeforeAttrName(e);break;case 6:this.stateInTagName(e);break;case 34:this.stateInSFCRootTagName(e);break;case 9:this.stateInClosingTagName(e);break;case 5:this.stateBeforeTagName(e);break;case 17:this.stateAfterAttrName(e);break;case 20:this.stateInAttrValueSingleQuotes(e);break;case 18:this.stateBeforeAttrValue(e);break;case 8:this.stateBeforeClosingTagName(e);break;case 10:this.stateAfterClosingTagName(e);break;case 29:this.stateBeforeSpecialS(e);break;case 30:this.stateBeforeSpecialT(e);break;case 21:this.stateInAttrValueNoQuotes(e);break;case 7:this.stateInSelfClosingTag(e);break;case 23:this.stateInDeclaration(e);break;case 22:this.stateBeforeDeclaration(e);break;case 25:this.stateBeforeComment(e);break;case 24:this.stateInProcessingInstruction(e);break;case 33:this.stateInEntity()}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(1===this.state||32===this.state&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(19===this.state||20===this.state||21===this.state)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let e=this.buffer.length;this.sectionStart>=e||(28===this.state?this.currentSequence===eq.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(tY,{onerr:ns,ontext(e,t){t2(t1(e,t),e,t)},ontextentity(e,t,n){t2(e,t,n)},oninterpolation(e,t){if(tW)return t2(t1(e,t),e,t);let n=e+tQ.delimiterOpen.length,i=t-tQ.delimiterClose.length;for(;e$(tB.charCodeAt(n));)n++;for(;e$(tB.charCodeAt(i-1));)i--;let s=t1(n,i);s.includes("&")&&(s=tU.decodeEntities(s,!1)),ne({type:5,content:ni(s,!1,nt(n,i)),loc:nt(e,t)})},onopentagname(e,t){let n=t1(e,t);t$={type:1,tag:n,ns:tU.getNamespace(n,tY[0],tU.ns),tagType:0,props:[],children:[],loc:nt(e-1,t),codegenNode:void 0}},onopentagend(e){t0(e)},onclosetag(e,t){let n=t1(e,t);if(!tU.isVoidTag(n)){let i=!1;for(let e=0;e<tY.length;e++)if(tY[e].tag.toLowerCase()===n.toLowerCase()){i=!0,e>0&&tY[0].loc.start.offset;for(let n=0;n<=e;n++)t3(tY.shift(),t,n<e);break}i||t4(e,60)}},onselfclosingtag(e){let t=t$.tag;t$.isSelfClosing=!0,t0(e),tY[0]&&tY[0].tag===t&&t3(tY.shift(),e)},onattribname(e,t){tH={type:6,name:t1(e,t),nameLoc:nt(e,t),value:void 0,loc:nt(e)}},ondirname(e,t){let n=t1(e,t),i="."===n||":"===n?"bind":"@"===n?"on":"#"===n?"slot":n.slice(2);if(tW||""===i)tH={type:6,name:n,nameLoc:nt(e,t),value:void 0,loc:nt(e)};else if(tH={type:7,name:i,rawName:n,exp:void 0,arg:void 0,modifiers:"."===n?[ey("prop")]:[],loc:nt(e)},"pre"===i){tW=tQ.inVPre=!0,tK=t$;let e=t$.props;for(let t=0;t<e.length;t++)7===e[t].type&&(e[t]=function(e){let t={type:6,name:e.rawName,nameLoc:nt(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){let n=e.exp.loc;n.end.offset<e.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:e.exp.content,loc:n}}return t}(e[t]))}},ondirarg(e,t){if(e===t)return;let n=t1(e,t);if(tW)tH.name+=n,nn(tH.nameLoc,t);else{let i="["!==n[0];tH.arg=ni(i?n:n.slice(1,-1),i,nt(e,t),i?3:0)}},ondirmodifier(e,t){let n=t1(e,t);if(tW)tH.name+="."+n,nn(tH.nameLoc,t);else if("slot"===tH.name){let e=tH.arg;e&&(e.content+="."+n,nn(e.loc,t))}else{let i=ey(n,!0,nt(e,t));tH.modifiers.push(i)}},onattribdata(e,t){tG+=t1(e,t),tq<0&&(tq=e),tJ=t},onattribentity(e,t,n){tG+=e,tq<0&&(tq=t),tJ=n},onattribnameend(e){let t=t1(tH.loc.start.offset,e);7===tH.type&&(tH.rawName=t),t$.props.some(e=>(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){if(t$&&tH){if(nn(tH.loc,t),0!==e){if(tG.includes("&")&&(tG=tU.decodeEntities(tG,!0)),6===tH.type)"class"===tH.name&&(tG=t8(tG).trim()),tH.value={type:2,content:tG,loc:1===e?nt(tq,tJ):nt(tq-1,tJ+1)},tQ.inSFCRoot&&"template"===t$.tag&&"lang"===tH.name&&tG&&"html"!==tG&&tQ.enterRCDATA(eG("</template"),0);else{tH.exp=ni(tG,!1,nt(tq,tJ),0,0),"for"===tH.name&&(tH.forParseResult=function(e){let t=e.loc,n=e.content,i=n.match(tX);if(!i)return;let[,s,r]=i,o=(e,n,i=!1)=>{let s=t.start.offset+n,r=s+e.length;return ni(e,!1,nt(s,r),0,i?1:0)},a={source:o(r.trim(),n.indexOf(r,s.length)),value:void 0,key:void 0,index:void 0,finalized:!1},l=s.trim().replace(tZ,"").trim(),c=s.indexOf(l),h=l.match(tz);if(h){let e;l=l.replace(tz,"").trim();let t=h[1].trim();if(t&&(e=n.indexOf(t,c+l.length),a.key=o(t,e,!0)),h[2]){let i=h[2].trim();i&&(a.index=o(i,n.indexOf(i,a.key?e+t.length:c+l.length),!0))}}return l&&(a.value=o(l,c,!0)),a}(tH.exp));let e=-1;"bind"===tH.name&&(e=tH.modifiers.findIndex(e=>"sync"===e.content))>-1&&eY("COMPILER_V_BIND_SYNC",tU,tH.loc,tH.rawName)&&(tH.name="model",tH.modifiers.splice(e,1))}}(7!==tH.type||"pre"!==tH.name)&&t$.props.push(tH)}tG="",tq=tJ=-1},oncomment(e,t){tU.comments&&ne({type:3,content:t1(e,t),loc:nt(e-4,t+3)})},onend(){let e=tB.length;for(let t=0;t<tY.length;t++)t3(tY[t],e-1),tY[t].loc.start.offset},oncdata(e,t){0!==tY[0].ns&&t2(t1(e,t),e,t)},onprocessinginstruction(e){(tY[0]?tY[0].ns:tU.ns)===0&&ns(21,e-1)}}),tz=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,tZ=/^\(|\)$/g;function t1(e,t){return tB.slice(e,t)}function t0(e){tQ.inSFCRoot&&(t$.innerLoc=nt(e+1,e+1)),ne(t$);let{tag:t,ns:n}=t$;0===n&&tU.isPreTag(t)&&tj++,tU.isVoidTag(t)?t3(t$,e):(tY.unshift(t$),(1===n||2===n)&&(tQ.inXML=!0)),t$=null}function t2(e,t,n){{let t=tY[0]&&tY[0].tag;"script"!==t&&"style"!==t&&e.includes("&")&&(e=tU.decodeEntities(e,!1))}let i=tY[0]||tF,s=i.children[i.children.length-1];s&&2===s.type?(s.content+=e,nn(s.loc,n)):i.children.push({type:2,content:e,loc:nt(t,n)})}function t3(e,t,n=!1){n?nn(e.loc,t4(t,60)):nn(e.loc,function(e,t){let n=e;for(;62!==tB.charCodeAt(n)&&n<tB.length-1;)n++;return n}(t,0)+1),tQ.inSFCRoot&&(e.children.length?e.innerLoc.end=o({},e.children[e.children.length-1].loc.end):e.innerLoc.end=o({},e.innerLoc.start),e.innerLoc.source=t1(e.innerLoc.start.offset,e.innerLoc.end.offset));let{tag:i,ns:s,children:r}=e;if(!tW&&("slot"===i?e.tagType=2:t5(e)?e.tagType=3:function({tag:e,props:t}){var n;if(tU.isCustomElement(e))return!1;if("component"===e||(n=e.charCodeAt(0))>64&&n<91||to(e)||tU.isBuiltInComponent&&tU.isBuiltInComponent(e)||tU.isNativeTag&&!tU.isNativeTag(e))return!0;for(let e=0;e<t.length;e++){let n=t[e];if(6===n.type){if("is"===n.name&&n.value&&(n.value.content.startsWith("vue:")||eY("COMPILER_IS_ON_ELEMENT",tU,n.loc)))return!0}else if("bind"===n.name&&tA(n.arg,"is")&&eY("COMPILER_IS_ON_ELEMENT",tU,n.loc))return!0}return!1}(e)&&(e.tagType=1)),tQ.inRCDATA||(e.children=t7(r)),0===s&&tU.isIgnoreNewlineTag(i)){let e=r[0];e&&2===e.type&&(e.content=e.content.replace(/^\r?\n/,""))}0===s&&tU.isPreTag(i)&&tj--,tK===e&&(tW=tQ.inVPre=!1,tK=null),tQ.inXML&&(tY[0]?tY[0].ns:tU.ns)===0&&(tQ.inXML=!1);{let t=e.props;if(!tQ.inSFCRoot&&eK("COMPILER_NATIVE_TEMPLATE",tU)&&"template"===e.tag&&!t5(e)){let t=tY[0]||tF,n=t.children.indexOf(e);t.children.splice(n,1,...e.children)}let n=t.find(e=>6===e.type&&"inline-template"===e.name);n&&eY("COMPILER_INLINE_TEMPLATE",tU,n.loc)&&e.children.length&&(n.value={type:2,content:t1(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function t4(e,t){let n=e;for(;tB.charCodeAt(n)!==t&&n>=0;)n--;return n}let t6=new Set(["if","else","else-if","for","slot"]);function t5({tag:e,props:t}){if("template"===e){for(let e=0;e<t.length;e++)if(7===t[e].type&&t6.has(t[e].name))return!0}return!1}let t9=/\r\n/g;function t7(e,t){let n="preserve"!==tU.whitespace,i=!1;for(let t=0;t<e.length;t++){let s=e[t];if(2===s.type){if(tj)s.content=s.content.replace(t9,"\n");else if(function(e){for(let t=0;t<e.length;t++)if(!e$(e.charCodeAt(t)))return!1;return!0}(s.content)){let r=e[t-1]&&e[t-1].type,o=e[t+1]&&e[t+1].type;!r||!o||n&&(3===r&&(3===o||1===o)||1===r&&(3===o||1===o&&function(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(10===n||13===n)return!0}return!1}(s.content)))?(i=!0,e[t]=null):s.content=" "}else n&&(s.content=t8(s.content))}}return i?e.filter(Boolean):e}function t8(e){let t="",n=!1;for(let i=0;i<e.length;i++)e$(e.charCodeAt(i))?n||(t+=" ",n=!0):(t+=e[i],n=!1);return t}function ne(e){(tY[0]||tF).children.push(e)}function nt(e,t){return{start:tQ.getPos(e),end:null==t?t:tQ.getPos(t),source:null==t?t:t1(e,t)}}function nn(e,t){e.end=tQ.getPos(t),e.source=t1(e.start.offset,t)}function ni(e,t=!1,n,i=0,s=0){return ey(e,t,n,i)}function ns(e,t,n){tU.onError(e1(e,nt(t,t)))}function nr(e,t){if(tQ.reset(),t$=null,tH=null,tG="",tq=-1,tJ=-1,tY.length=0,tB=e,tU=o({},tw),t){let e;for(e in t)null!=t[e]&&(tU[e]=t[e])}tQ.mode="html"===tU.parseMode?1:"sfc"===tU.parseMode?2:0,tQ.inXML=1===tU.ns||2===tU.ns;let n=t&&t.delimiters;n&&(tQ.delimiterOpen=eG(n[0]),tQ.delimiterClose=eG(n[1]));let i=tF=eS([],e);return tQ.parse(tB),i.loc=nt(0,e.length),i.children=t7(i.children),tF=null,i}function no(e,t){let{children:n}=e;return 1===n.length&&1===t.type&&!tx(t)}function na(e,t){let{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;let i=n.get(e);if(void 0!==i)return i;let s=e.codegenNode;if(13!==s.type||s.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0!==s.patchFlag)return n.set(e,0),0;{let i=3,r=nc(e,t);if(0===r)return n.set(e,0),0;r<i&&(i=r);for(let s=0;s<e.children.length;s++){let r=na(e.children[s],t);if(0===r)return n.set(e,0),0;r<i&&(i=r)}if(i>1)for(let s=0;s<e.props.length;s++){let r=e.props[s];if(7===r.type&&"bind"===r.name&&r.exp){let s=na(r.exp,t);if(0===s)return n.set(e,0),0;s<i&&(i=s)}}if(s.isBlock){for(let t=0;t<e.props.length;t++)if(7===e.props[t].type)return n.set(e,0),0;t.removeHelper(L),t.removeHelper(eX(t.inSSR,s.isComponent)),s.isBlock=!1,t.helper(ek(t.inSSR,s.isComponent))}return n.set(e,i),i}case 2:case 3:return 3;case 9:case 11:case 10:default:return 0;case 5:case 12:return na(e.content,t);case 4:return e.constType;case 8:let r=3;for(let n=0;n<e.children.length;n++){let i=e.children[n];if(l(i)||c(i))continue;let s=na(i,t);if(0===s)return 0;s<r&&(r=s)}return r;case 20:return 2}}let nl=new Set([K,Y,Q,z]);function nc(e,t){let n=3,i=nh(e);if(i&&15===i.type){let{properties:e}=i;for(let i=0;i<e.length;i++){let s;let{key:r,value:o}=e[i],a=na(r,t);if(0===a)return a;if(a<n&&(n=a),0===(s=4===o.type?na(o,t):14===o.type?function e(t,n){if(14===t.type&&!l(t.callee)&&nl.has(t.callee)){let i=t.arguments[0];if(4===i.type)return na(i,n);if(14===i.type)return e(i,n)}return 0}(o,t):0))return s;s<n&&(n=s)}}return n}function nh(e){let t=e.codegenNode;if(13===t.type)return t.props}function np(e,{filename:t="",prefixIdentifiers:s=!1,hoistStatic:r=!1,hmr:o=!1,cacheHandlers:a=!1,nodeTransforms:c=[],directiveTransforms:h={},transformHoist:p=null,isBuiltInComponent:d=i,isCustomElement:u=i,expressionPlugins:f=[],scopeId:m=null,slotted:S=!0,ssr:g=!1,inSSR:T=!1,ssrCssVars:N="",bindingMetadata:I=n,inline:y=!1,isTS:O=!1,onError:A=ez,onWarn:C=eZ,compatConfig:b}){let R=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),v={filename:t,selfName:R&&_(E(R[1])),prefixIdentifiers:s,hoistStatic:r,hmr:o,cacheHandlers:a,nodeTransforms:c,directiveTransforms:h,transformHoist:p,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:f,scopeId:m,slotted:S,ssr:g,inSSR:T,ssrCssVars:N,bindingMetadata:I,inline:y,isTS:O,onError:A,onWarn:C,compatConfig:b,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=v.helpers.get(e)||0;return v.helpers.set(e,t+1),e},removeHelper(e){let t=v.helpers.get(e);if(t){let n=t-1;n?v.helpers.set(e,n):v.helpers.delete(e)}},helperString:e=>`_${ep[v.helper(e)]}`,replaceNode(e){v.parent.children[v.childIndex]=v.currentNode=e},removeNode(e){let t=v.parent.children,n=e?t.indexOf(e):v.currentNode?v.childIndex:-1;e&&e!==v.currentNode?v.childIndex>n&&(v.childIndex--,v.onNodeRemoved()):(v.currentNode=null,v.onNodeRemoved()),v.parent.children.splice(n,1)},onNodeRemoved:i,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){l(e)&&(e=ey(e)),v.hoists.push(e);let t=ey(`_hoisted_${v.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let i=ev(v.cached.length,e,t,n);return v.cached.push(i),i}};return v.filters=new Set,v}function nd(e,t){let n=np(e,t);nu(e,n),t.hoistStatic&&!function e(t,n,i,s=!1,r=!1){let{children:o}=t,l=[];for(let n=0;n<o.length;n++){let a=o[n];if(1===a.type&&0===a.tagType){let e=s?0:na(a,i);if(e>0){if(e>=2){a.codegenNode.patchFlag=-1,l.push(a);continue}}else{let e=a.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&nc(a,i)>=2){let t=nh(a);t&&(e.props=i.hoist(t))}e.dynamicProps&&(e.dynamicProps=i.hoist(e.dynamicProps))}}}else if(12===a.type&&(s?0:na(a,i))>=2){l.push(a);continue}if(1===a.type){let n=1===a.tagType;n&&i.scopes.vSlot++,e(a,t,i,!1,r),n&&i.scopes.vSlot--}else if(11===a.type)e(a,t,i,1===a.children.length,!0);else if(9===a.type)for(let n=0;n<a.branches.length;n++)e(a.branches[n],t,i,1===a.branches[n].children.length,r)}let c=!1;if(l.length===o.length&&1===t.type){if(0===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&a(t.codegenNode.children))t.codegenNode.children=h(eT(t.codegenNode.children)),c=!0;else if(1===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&t.codegenNode.children&&!a(t.codegenNode.children)&&15===t.codegenNode.children.type){let e=p(t.codegenNode,"default");e&&(e.returns=h(eT(e.returns)),c=!0)}else if(3===t.tagType&&n&&1===n.type&&1===n.tagType&&n.codegenNode&&13===n.codegenNode.type&&n.codegenNode.children&&!a(n.codegenNode.children)&&15===n.codegenNode.children.type){let e=ty(t,"slot",!0),i=e&&e.arg&&p(n.codegenNode,e.arg);i&&(i.returns=h(eT(i.returns)),c=!0)}}if(!c)for(let e of l)e.codegenNode=i.cache(e.codegenNode);function h(e){let t=i.cache(e);return r&&i.hmr&&(t.needArraySpread=!0),t}function p(e,t){if(e.children&&!a(e.children)&&15===e.children.type){let n=e.children.properties.find(e=>e.key===t||e.key.content===t);return n&&n.value}}l.length&&i.transformHoist&&i.transformHoist(o,i,t)}(e,void 0,n,no(e,e.children[0])),t.ssr||function(e,t){let{helper:n}=t,{children:i}=e;if(1===i.length){let n=i[0];if(no(e,n)&&n.codegenNode){let i=n.codegenNode;13===i.type&&ew(i,t),e.codegenNode=i}else e.codegenNode=n}else i.length>1&&(e.codegenNode=eg(t,n(C),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function nu(e,t){t.currentNode=e;let{nodeTransforms:n}=t,i=[];for(let s=0;s<n.length;s++){let r=n[s](e,t);if(r&&(a(r)?i.push(...r):i.push(r)),!t.currentNode)return;e=t.currentNode}switch(e.type){case 3:t.ssr||t.helper(k);break;case 5:t.ssr||t.helper(j);break;case 9:for(let n=0;n<e.branches.length;n++)nu(e.branches[n],t);break;case 10:case 11:case 1:case 0:!function(e,t){let n=0,i=()=>{n--};for(;n<e.children.length;n++){let s=e.children[n];l(s)||(t.grandParent=t.parent,t.parent=e,t.childIndex=n,t.onNodeRemoved=i,nu(s,t))}}(e,t)}t.currentNode=e;let s=i.length;for(;s--;)i[s]()}function nf(e,t){let n=l(e)?t=>t===e:t=>e.test(t);return(e,i)=>{if(1===e.type){let{props:s}=e;if(3===e.tagType&&s.some(tR))return;let r=[];for(let o=0;o<s.length;o++){let a=s[o];if(7===a.type&&n(a.name)){s.splice(o,1),o--;let n=t(e,a,i);n&&r.push(n)}}return r}}}let nE="/*@__PURE__*/",n_=e=>`${ep[e]}: _${ep[e]}`;function nm(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:i=!1,filename:s="template.vue.html",scopeId:r=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:h=!1,isTS:p=!1,inSSR:d=!1}){let u={mode:t,prefixIdentifiers:n,sourceMap:i,filename:s,scopeId:r,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:c,ssr:h,isTS:p,inSSR:d,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${ep[e]}`,push(e,t=-2,n){u.code+=e},indent(){f(++u.indentLevel)},deindent(e=!1){e?--u.indentLevel:f(--u.indentLevel)},newline(){f(u.indentLevel)}};function f(e){u.push("\n"+" ".repeat(e),0)}return u}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:i,push:s,prefixIdentifiers:r,indent:o,deindent:a,newline:l,scopeId:c,ssr:h}=n,p=Array.from(e.helpers),d=p.length>0,u=!r&&"module"!==i;!function(e,t){let{ssr:n,prefixIdentifiers:i,push:s,newline:r,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=t,c=Array.from(e.helpers);if(c.length>0&&(s(`const _Vue = ${a} +`,-1),e.hoists.length)){let e=[D,V,k,X,w].filter(e=>c.includes(e)).map(n_).join(", ");s(`const { ${e} } = _Vue +`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:i}=t;i();for(let s=0;s<e.length;s++){let r=e[s];r&&(n(`const _hoisted_${s+1} = `),nN(r,t),i())}t.pure=!1})(e.hoists,t),r(),s("return ")}(e,n);let f=(h?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(s(`function ${h?"ssrRender":"render"}(${f}) {`),o(),u&&(s("with (_ctx) {"),o(),d&&(s(`const { ${p.map(n_).join(", ")} } = _Vue +`,-1),l())),e.components.length&&(nS(e.components,"component",n),(e.directives.length||e.temps>0)&&l()),e.directives.length&&(nS(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),nS(e.filters,"filter",n),l()),e.temps>0){s("let ");for(let t=0;t<e.temps;t++)s(`${t>0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(s(` +`,0),l()),h||s("return "),e.codegenNode?nN(e.codegenNode,n):s("null"),u&&(a(),s("}")),a(),s("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function nS(e,t,{helper:n,push:i,newline:s,isTS:r}){let o=n("filter"===t?$:"component"===t?U:B);for(let n=0;n<e.length;n++){let a=e[n],l=a.endsWith("__self");l&&(a=a.slice(0,-6)),i(`const ${tD(a,t)} = ${o}(${JSON.stringify(a)}${l?", true":""})${r?"!":""}`),n<e.length-1&&s()}}function ng(e,t){let n=e.length>3;t.push("["),n&&t.indent(),nT(e,t,n),n&&t.deindent(),t.push("]")}function nT(e,t,n=!1,i=!0){let{push:s,newline:r}=t;for(let o=0;o<e.length;o++){let c=e[o];l(c)?s(c,-3):a(c)?ng(c,t):nN(c,t),o<e.length-1&&(n?(i&&s(","),r()):i&&s(", "))}}function nN(e,t){if(l(e)){t.push(e,-3);return}if(c(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:case 12:nN(e.codegenNode,t);break;case 2:!function(e,t){t.push(JSON.stringify(e.content),-3,e)}(e,t);break;case 4:nI(e,t);break;case 5:!function(e,t){let{push:n,helper:i,pure:s}=t;s&&n(nE),n(`${i(j)}(`),nN(e.content,t),n(")")}(e,t);break;case 8:ny(e,t);break;case 3:!function(e,t){let{push:n,helper:i,pure:s}=t;s&&n(nE),n(`${i(k)}(${JSON.stringify(e.content)})`,-3,e)}(e,t);break;case 13:!function(e,t){let n;let{push:i,helper:s,pure:r}=t,{tag:o,props:a,children:l,patchFlag:c,dynamicProps:h,directives:p,isBlock:d,disableTracking:u,isComponent:f}=e;c&&(n=String(c)),p&&i(s(H)+"("),d&&i(`(${s(L)}(${u?"true":""}), `),r&&i(nE),i(s(d?eX(t.inSSR,f):ek(t.inSSR,f))+"(",-2,e),nT(function(e){let t=e.length;for(;t--&&null==e[t];);return e.slice(0,t+1).map(e=>e||"null")}([o,a,l,n,h]),t),i(")"),d&&i(")"),p&&(i(", "),nN(p,t),i(")"))}(e,t);break;case 14:!function(e,t){let{push:n,helper:i,pure:s}=t,r=l(e.callee)?e.callee:i(e.callee);s&&n(nE),n(r+"(",-2,e),nT(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){let{push:n,indent:i,deindent:s,newline:r}=t,{properties:o}=e;if(!o.length){n("{}",-2,e);return}let a=o.length>1;n(a?"{":"{ "),a&&i();for(let e=0;e<o.length;e++){let{key:i,value:s}=o[e];!function(e,t){let{push:n}=t;8===e.type?(n("["),ny(e,t),n("]")):e.isStatic?n(tl(e.content)?e.content:JSON.stringify(e.content),-2,e):n(`[${e.content}]`,-3,e)}(i,t),n(": "),nN(s,t),e<o.length-1&&(n(","),r())}a&&s(),n(a?"}":" }")}(e,t);break;case 17:ng(e.elements,t);break;case 18:!function(e,t){let{push:n,indent:i,deindent:s}=t,{params:r,returns:o,body:l,newline:c,isSlot:h}=e;h&&n(`_${ep[eo]}(`),n("(",-2,e),a(r)?nT(r,t):r&&nN(r,t),n(") => "),(c||l)&&(n("{"),i()),o?(c&&n("return "),a(o)?ng(o,t):nN(o,t)):l&&nN(l,t),(c||l)&&(s(),n("}")),h&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){let{test:n,consequent:i,alternate:s,newline:r}=e,{push:o,indent:a,deindent:l,newline:c}=t;if(4===n.type){let e=!tl(n.content);e&&o("("),nI(n,t),e&&o(")")}else o("("),nN(n,t),o(")");r&&a(),t.indentLevel++,r||o(" "),o("? "),nN(i,t),t.indentLevel--,r&&c(),r||o(" "),o(": ");let h=19===s.type;!h&&t.indentLevel++,nN(s,t),!h&&t.indentLevel--,r&&l(!0)}(e,t);break;case 20:!function(e,t){let{push:n,helper:i,indent:s,deindent:r,newline:o}=t,{needPauseTracking:a,needArraySpread:l}=e;l&&n("[...("),n(`_cache[${e.index}] || (`),a&&(s(),n(`${i(ei)}(-1`),e.inVOnce&&n(", true"),n("),"),o(),n("(")),n(`_cache[${e.index}] = `),nN(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),o(),n(`${i(ei)}(1),`),o(),n(`_cache[${e.index}]`),r()),n(")"),l&&n(")]")}(e,t);break;case 21:nT(e.body,t,!0,!1)}}function nI(e,t){let{content:n,isStatic:i}=e;t.push(i?JSON.stringify(n):n,-3,e)}function ny(e,t){for(let n=0;n<e.children.length;n++){let i=e.children[n];l(i)?t.push(i,-3):nN(i,t)}}let nO=(e,t)=>{if(5===e.type)e.content=nA(e.content,t);else if(1===e.type){let n=ty(e,"memo");for(let i=0;i<e.props.length;i++){let s=e.props[i];if(7===s.type&&"for"!==s.name){let e=s.exp,i=s.arg;!e||4!==e.type||"on"===s.name&&i||n&&i&&4===i.type&&"key"===i.content||(s.exp=nA(e,t,"slot"===s.name)),i&&4===i.type&&!i.isStatic&&(s.arg=nA(i,t))}}}};function nA(e,t,n=!1,i=!1,s=Object.create(t.identifiers)){return e}function nC(e){return l(e)?e:4===e.type?e.content:e.children.map(nC).join("")}let nb=nf(/^(if|else|else-if)$/,(e,t,n)=>nR(e,t,n,(e,t,i)=>{let s=n.parent.children,r=s.indexOf(e),o=0;for(;r-- >=0;){let e=s[r];e&&9===e.type&&(o+=e.branches.length)}return()=>{i?e.codegenNode=nx(t,o,n):function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=nx(t,o+e.branches.length-1,n)}}));function nR(e,t,n,i){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let i=t.exp?t.exp.loc:e.loc;n.onError(e1(28,t.loc)),t.exp=ey("true",!1,i)}if("if"===t.name){var s;let r=nv(e,t),o={type:9,loc:nt((s=e.loc).start.offset,s.end.offset),branches:[r]};if(n.replaceNode(o),i)return i(o,r,!0)}else{let s=n.parent.children,r=s.indexOf(e);for(;r-- >=-1;){let o=s[r];if(o&&3===o.type||o&&2===o.type&&!o.content.trim().length){n.removeNode(o);continue}if(o&&9===o.type){"else-if"===t.name&&void 0===o.branches[o.branches.length-1].condition&&n.onError(e1(30,e.loc)),n.removeNode();let s=nv(e,t);o.branches.push(s);let r=i&&i(o,s,!1);nu(s,n),r&&r(),n.currentNode=null}else n.onError(e1(30,e.loc));break}}}function nv(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ty(e,"for")?e.children:[e],userKey:tO(e,"key"),isTemplateIf:n}}function nx(e,t,n){return e.condition?eR(e.condition,nL(e,t,n),eC(n.helper(k),['""',"true"])):nL(e,t,n)}function nL(e,t,n){let{helper:i}=n,s=eI("key",ey(`${t}`,!1,em,2)),{children:r}=e,o=r[0];if(1!==r.length||1!==o.type){if(1!==r.length||11!==o.type)return eg(n,i(C),eN([s]),r,64,void 0,void 0,!0,!1,!1,e.loc);{let e=o.codegenNode;return tM(e,s,n),e}}{let e=o.codegenNode,t=tk(e);return 13===t.type&&ew(t,n),tM(t,s,n),e}}let nM=(e,t,n)=>{let{modifiers:i,loc:s}=e,r=e.arg,{exp:o}=e;if(o&&4===o.type&&!o.content.trim()&&(o=void 0),!o){if(4!==r.type||!r.isStatic)return n.onError(e1(52,r.loc)),{props:[eI(r,ey("",!0,s))]};nP(e),o=e.exp}return 4!==r.type?(r.children.unshift("("),r.children.push(') || ""')):r.isStatic||(r.content=`${r.content} || ""`),i.some(e=>"camel"===e.content)&&(4===r.type?r.isStatic?r.content=E(r.content):r.content=`${n.helperString(ee)}(${r.content})`:(r.children.unshift(`${n.helperString(ee)}(`),r.children.push(")"))),!n.inSSR&&(i.some(e=>"prop"===e.content)&&nD(r,"."),i.some(e=>"attr"===e.content)&&nD(r,"^")),{props:[eI(r,o)]}},nP=(e,t)=>{let n=e.arg,i=E(n.content);e.exp=ey(i,!1,n.loc)},nD=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},nV=nf("for",(e,t,n)=>{let{helper:i,removeHelper:s}=n;return nk(e,t,n,t=>{let r=eC(i(G),[t.source]),o=tv(e),a=ty(e,"memo"),l=tO(e,"key",!1,!0);l&&7===l.type&&!l.exp&&nP(l);let c=l&&(6===l.type?l.value?ey(l.value.content,!0):void 0:l.exp),h=l&&c?eI("key",c):null,p=4===t.source.type&&t.source.constType>0,d=p?64:l?128:256;return t.codegenNode=eg(n,i(C),void 0,r,d,void 0,void 0,!0,!p,!1,e.loc),()=>{let l;let{children:d}=t,u=1!==d.length||1!==d[0].type,f=tx(e)?e:o&&1===e.children.length&&tx(e.children[0])?e.children[0]:null;if(f?(l=f.codegenNode,o&&h&&tM(l,h,n)):u?l=eg(n,i(C),h?eN([h]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(l=d[0].codegenNode,o&&h&&tM(l,h,n),!p!==l.isBlock&&(l.isBlock?(s(L),s(eX(n.inSSR,l.isComponent))):s(ek(n.inSSR,l.isComponent))),l.isBlock=!p,l.isBlock?(i(L),i(eX(n.inSSR,l.isComponent))):i(ek(n.inSSR,l.isComponent))),a){let e=eb(nw(t.parseResult,[ey("_cached")]));e.body=ex([eA(["const _memo = (",a.exp,")"]),eA(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(eh)}(_cached, _memo)) return _cached`]),eA(["const _item = ",l]),ey("_item.memo = _memo"),ey("return _item")]),r.arguments.push(e,ey("_cache"),ey(String(n.cached.length))),n.cached.push(null)}else r.arguments.push(eb(nw(t.parseResult),l,!0))}})});function nk(e,t,n,i){if(!t.exp){n.onError(e1(31,t.loc));return}let s=t.forParseResult;if(!s){n.onError(e1(32,t.loc));return}nX(s);let{addIdentifiers:r,removeIdentifiers:o,scopes:a}=n,{source:l,value:c,key:h,index:p}=s,d={type:11,loc:t.loc,source:l,valueAlias:c,keyAlias:h,objectIndexAlias:p,parseResult:s,children:tv(e)?e.children:[e]};n.replaceNode(d),a.vFor++;let u=i&&i(d);return()=>{a.vFor--,u&&u()}}function nX(e,t){e.finalized||(e.finalized=!0)}function nw({value:e,key:t,index:n},i=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||ey("_".repeat(t+1),!1))}([e,t,n,...i])}let nU=ey("undefined",!1),nF=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=ty(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},nB=(e,t)=>{let n;if(tv(e)&&e.props.some(tR)&&(n=ty(e,"for"))){let e=n.forParseResult;if(e){nX(e);let{value:n,key:i,index:s}=e,{addIdentifiers:r,removeIdentifiers:o}=t;return n&&r(n),i&&r(i),s&&r(s),()=>{n&&o(n),i&&o(i),s&&o(s)}}}},n$=(e,t,n,i)=>eb(e,n,!1,!0,n.length?n[0].loc:i);function nH(e,t,n=n$){t.helper(eo);let{children:i,loc:s}=e,r=[],o=[],a=t.scopes.vSlot>0||t.scopes.vFor>0,l=ty(e,"slot",!0);if(l){let{arg:e,exp:t}=l;e&&!tr(e)&&(a=!0),r.push(eI(e||ey("default",!0),n(t,void 0,i,s)))}let c=!1,h=!1,p=[],d=new Set,u=0;for(let e=0;e<i.length;e++){let s,f,E,_;let m=i[e];if(!tv(m)||!(s=ty(m,"slot",!0))){3!==m.type&&p.push(m);continue}if(l){t.onError(e1(37,s.loc));break}c=!0;let{children:S,loc:g}=m,{arg:T=ey("default",!0),exp:N,loc:I}=s;tr(T)?f=T?T.content:"default":a=!0;let y=ty(m,"for"),O=n(N,y,S,g);if(E=ty(m,"if"))a=!0,o.push(eR(E.exp,nG(T,O,u++),nU));else if(_=ty(m,/^else(-if)?$/,!0)){let n,s=e;for(;s--&&3===(n=i[s]).type;);if(n&&tv(n)&&ty(n,/^(else-)?if$/)){let e=o[o.length-1];for(;19===e.alternate.type;)e=e.alternate;e.alternate=_.exp?eR(_.exp,nG(T,O,u++),nU):nG(T,O,u++)}else t.onError(e1(30,_.loc))}else if(y){a=!0;let e=y.forParseResult;e?(nX(e),o.push(eC(t.helper(G),[e.source,eb(nw(e),nG(T,O),!0)]))):t.onError(e1(32,y.loc))}else{if(f){if(d.has(f)){t.onError(e1(38,I));continue}d.add(f),"default"===f&&(h=!0)}r.push(eI(T,O))}}if(!l){let e=(e,i)=>{let r=n(e,void 0,i,s);return t.compatConfig&&(r.isNonScopedSlot=!0),eI("default",r)};c?p.length&&p.some(e=>(function e(t){return 2!==t.type&&12!==t.type||(2===t.type?!!t.content.trim():e(t.content))})(e))&&(h?t.onError(e1(39,p[0].loc)):r.push(e(void 0,p))):r.push(e(void 0,i))}let f=a?2:!function e(t){for(let n=0;n<t.length;n++){let i=t[n];switch(i.type){case 1:if(2===i.tagType||e(i.children))return!0;break;case 9:if(e(i.branches))return!0;break;case 10:case 11:if(e(i.children))return!0}}return!1}(e.children)?1:3,E=eN(r.concat(eI("_",ey(f+"",!1))),s);return o.length&&(E=eC(t.helper(J),[E,eT(o)])),{slots:E,hasDynamicSlots:a}}function nG(e,t,n){let i=[eI("name",e),eI("fn",t)];return null!=n&&i.push(eI("key",ey(String(n),!0))),eN(i)}let nq=new WeakMap,nJ=(e,t)=>function(){let n,i,s,r,o;if(!(1===(e=t.currentNode).type&&(0===e.tagType||1===e.tagType)))return;let{tag:a,props:l}=e,c=1===e.tagType,p=c?nj(e,t):`"${a}"`,d=h(p)&&p.callee===F,u=0,f=d||p===b||p===R||!c&&("svg"===a||"foreignObject"===a||"math"===a);if(l.length>0){let i=nW(e,t,void 0,c,d);n=i.props,u=i.patchFlag,r=i.dynamicPropNames;let s=i.directives;o=s&&s.length?eT(s.map(e=>nY(e,t))):void 0,i.shouldUseBlock&&(f=!0)}if(e.children.length>0){if(p===v&&(f=!0,u|=1024),c&&p!==b&&p!==v){let{slots:n,hasDynamicSlots:s}=nH(e,t);i=n,s&&(u|=1024)}else if(1===e.children.length&&p!==b){let n=e.children[0],s=n.type,r=5===s||8===s;r&&0===na(n,t)&&(u|=1),i=r||2===s?n:e.children}else i=e.children}r&&r.length&&(s=function(e){let t="[";for(let n=0,i=e.length;n<i;n++)t+=JSON.stringify(e[n]),n<i-1&&(t+=", ");return t+"]"}(r)),e.codegenNode=eg(t,p,n,i,0===u?void 0:u,s,o,!!f,!1,c,e.loc)};function nj(e,t,n=!1){let{tag:i}=e,s=nQ(i),r=tO(e,"is",!1,!0);if(r){if(s||eK("COMPILER_IS_ON_ELEMENT",t)){let e;if(6===r.type?e=r.value&&ey(r.value.content,!0):(e=r.exp)||(e=ey("is",!1,r.arg.loc)),e)return eC(t.helper(F),[e])}else 6===r.type&&r.value.content.startsWith("vue:")&&(i=r.value.content.slice(4))}let o=to(i)||t.isBuiltInComponent(i);return o?(n||t.helper(o),o):(t.helper(U),t.components.add(i),tD(i,"component"))}function nW(e,t,n=e.props,i,s,o=!1){let a;let{tag:l,loc:h,children:u}=e,f=[],E=[],_=[],m=u.length>0,S=!1,g=0,T=!1,N=!1,I=!1,y=!1,O=!1,A=!1,C=[],b=e=>{f.length&&(E.push(eN(nK(f),h)),f=[]),e&&E.push(e)},R=()=>{t.scopes.vFor>0&&f.push(eI(ey("ref_for",!0),ey("true")))},v=({key:e,value:n})=>{if(tr(e)){let o=e.content,a=r(o);a&&(!i||s)&&"onclick"!==o.toLowerCase()&&"onUpdate:modelValue"!==o&&!p(o)&&(y=!0),a&&p(o)&&(A=!0),a&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&na(n,t)>0||("ref"===o?T=!0:"class"===o?N=!0:"style"===o?I=!0:"key"===o||C.includes(o)||C.push(o),i&&("class"===o||"style"===o)&&!C.includes(o)&&C.push(o))}else O=!0};for(let s=0;s<n.length;s++){let r=n[s];if(6===r.type){let{loc:e,name:n,nameLoc:i,value:s}=r;if("ref"===n&&(T=!0,R()),"is"===n&&(nQ(l)||s&&s.content.startsWith("vue:")||eK("COMPILER_IS_ON_ELEMENT",t)))continue;f.push(eI(ey(n,!0,i),ey(s?s.content:"",!0,s?s.loc:e)))}else{let{name:n,arg:s,exp:a,loc:p,modifiers:u}=r,T="bind"===n,N="on"===n;if("slot"===n){i||t.onError(e1(40,p));continue}if("once"===n||"memo"===n||"is"===n||T&&tA(s,"is")&&(nQ(l)||eK("COMPILER_IS_ON_ELEMENT",t))||N&&o)continue;if((T&&tA(s,"key")||N&&m&&tA(s,"vue:before-update"))&&(S=!0),T&&tA(s,"ref")&&R(),!s&&(T||N)){if(O=!0,a){if(T){if(R(),b(),eK("COMPILER_V_BIND_OBJECT_ORDER",t)){E.unshift(a);continue}E.push(a)}else b({type:14,loc:p,callee:t.helper(Z),arguments:i?[a]:[a,"true"]})}else t.onError(e1(T?34:35,p));continue}T&&u.some(e=>"prop"===e.content)&&(g|=32);let I=t.directiveTransforms[n];if(I){let{props:n,needRuntime:i}=I(r,e,t);o||n.forEach(v),N&&s&&!tr(s)?b(eN(n,h)):f.push(...n),i&&(_.push(r),c(i)&&nq.set(r,i))}else!d(n)&&(_.push(r),m&&(S=!0))}}if(E.length?(b(),a=E.length>1?eC(t.helper(W),E,h):E[0]):f.length&&(a=eN(nK(f),h)),O?g|=16:(N&&!i&&(g|=2),I&&!i&&(g|=4),C.length&&(g|=8),y&&(g|=32)),!S&&(0===g||32===g)&&(T||A||_.length>0)&&(g|=512),!t.inSSR&&a)switch(a.type){case 15:let x=-1,L=-1,M=!1;for(let e=0;e<a.properties.length;e++){let t=a.properties[e].key;tr(t)?"class"===t.content?x=e:"style"===t.content&&(L=e):t.isHandlerKey||(M=!0)}let P=a.properties[x],D=a.properties[L];M?a=eC(t.helper(Q),[a]):(P&&!tr(P.value)&&(P.value=eC(t.helper(K),[P.value])),D&&(I||4===D.value.type&&"["===D.value.content.trim()[0]||17===D.value.type)&&(D.value=eC(t.helper(Y),[D.value])));break;case 14:break;default:a=eC(t.helper(Q),[eC(t.helper(z),[a])])}return{props:a,directives:_,patchFlag:g,dynamicPropNames:C,shouldUseBlock:S}}function nK(e){let t=new Map,n=[];for(let i=0;i<e.length;i++){let s=e[i];if(8===s.key.type||!s.key.isStatic){n.push(s);continue}let o=s.key.content,a=t.get(o);a?("style"===o||"class"===o||r(o))&&(17===a.value.type?a.value.elements.push(s.value):a.value=eT([a.value,s.value],a.loc)):(t.set(o,s),n.push(s))}return n}function nY(e,t){let n=[],i=nq.get(e);i?n.push(t.helperString(i)):(t.helper(B),t.directives.add(e.name),n.push(tD(e.name,"directive")));let{loc:s}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=ey("true",!1,s);n.push(eN(e.modifiers.map(e=>eI(e,t)),s))}return eT(n,e.loc)}function nQ(e){return"component"===e||"Component"===e}let nz=(e,t)=>{if(tx(e)){let{children:n,loc:i}=e,{slotName:s,slotProps:r}=nZ(e,t),o=[t.prefixIdentifiers?"_ctx.$slots":"$slots",s,"{}","undefined","true"],a=2;r&&(o[2]=r,a=3),n.length&&(o[3]=eb([],n,!1,!1,i),a=4),t.scopeId&&!t.slotted&&(a=5),o.splice(a),e.codegenNode=eC(t.helper(q),o,i)}};function nZ(e,t){let n,i='"default"',s=[];for(let t=0;t<e.props.length;t++){let n=e.props[t];if(6===n.type)n.value&&("name"===n.name?i=JSON.stringify(n.value.content):(n.name=E(n.name),s.push(n)));else if("bind"===n.name&&tA(n.arg,"name")){if(n.exp)i=n.exp;else if(n.arg&&4===n.arg.type){let e=E(n.arg.content);i=n.exp=ey(e,!1,n.arg.loc)}}else"bind"===n.name&&n.arg&&tr(n.arg)&&(n.arg.content=E(n.arg.content)),s.push(n)}if(s.length>0){let{props:i,directives:r}=nW(e,t,s,!1,!1);n=i,r.length&&t.onError(e1(36,r[0].loc))}return{slotName:i,slotProps:n}}let n1=(e,t,n,i)=>{let s;let{loc:r,modifiers:o,arg:a}=e;if(e.exp||o.length,4===a.type){if(a.isStatic){let e=a.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),s=ey(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?m(E(e)):`on:${e}`,!0,a.loc)}else s=eA([`${n.helperString(en)}(`,a,")"])}else(s=a).children.unshift(`${n.helperString(en)}(`),s.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let c=n.cacheHandlers&&!l&&!n.inVOnce;if(l){let e=tE(l),t=!(e||tg(l)),n=l.content.includes(";");(t||c&&e)&&(l=eA([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let h={props:[eI(s,l||ey("() => {}",!1,r))]};return i&&(h=i(h)),c&&(h.props[0].value=n.cache(h.props[0].value)),h.props.forEach(e=>e.key.isHandlerKey=!0),h},n0=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n;let i=e.children,s=!1;for(let e=0;e<i.length;e++){let t=i[e];if(tb(t)){s=!0;for(let s=e+1;s<i.length;s++){let r=i[s];if(tb(r))n||(n=i[e]=eA([t],t.loc)),n.children.push(" + ",r),i.splice(s,1),s--;else{n=void 0;break}}}}if(s&&(1!==i.length||0!==e.type&&(1!==e.type||0!==e.tagType||e.props.find(e=>7===e.type&&!t.directiveTransforms[e.name])||"template"===e.tag)))for(let e=0;e<i.length;e++){let n=i[e];if(tb(n)||8===n.type){let s=[];(2!==n.type||" "!==n.content)&&s.push(n),t.ssr||0!==na(n,t)||s.push("1"),i[e]={type:12,content:n,loc:n.loc,codegenNode:eC(t.helper(X),s)}}}}},n2=new WeakSet,n3=(e,t)=>{if(1===e.type&&ty(e,"once",!0)&&!n2.has(e)&&!t.inVOnce&&!t.inSSR)return n2.add(e),t.inVOnce=!0,t.helper(ei),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},n4=(e,t,n)=>{let i;let{exp:s,arg:r}=e;if(!s)return n.onError(e1(41,e.loc)),n6();let o=s.loc.source.trim(),a=4===s.type?s.content:o,l=n.bindingMetadata[o];if("props"===l||"props-aliased"===l)return s.loc,n6();if(!a.trim()||!tE(s))return n.onError(e1(42,s.loc)),n6();let c=r||ey("modelValue",!0),h=r?tr(r)?`onUpdate:${E(r.content)}`:eA(['"onUpdate:" + ',r]):"onUpdate:modelValue",p=n.isTS?"($event: any)":"$event";i=eA([`${p} => ((`,s,") = $event)"]);let d=[eI(c,e.exp),eI(h,i)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(tl(e)?e:JSON.stringify(e))+": true").join(", "),n=r?tr(r)?`${r.content}Modifiers`:eA([r,' + "Modifiers"']):"modelModifiers";d.push(eI(n,ey(`{ ${t} }`,!1,e.loc,2)))}return n6(d)};function n6(e=[]){return{props:e}}let n5=/[\w).+\-_$\]]/,n9=(e,t)=>{eK("COMPILER_FILTERS",t)&&(5===e.type?n7(e.content,t):1===e.type&&e.props.forEach(e=>{7===e.type&&"for"!==e.name&&e.exp&&n7(e.exp,t)}))};function n7(e,t){if(4===e.type)n8(e,t);else for(let n=0;n<e.children.length;n++){let i=e.children[n];"object"==typeof i&&(4===i.type?n8(i,t):8===i.type?n7(e,t):5===i.type&&n7(i.content,t))}}function n8(e,t){let n=e.content,i=!1,s=!1,r=!1,o=!1,a=0,l=0,c=0,h=0,p,d,u,f,E=[];for(u=0;u<n.length;u++)if(d=p,p=n.charCodeAt(u),i)39===p&&92!==d&&(i=!1);else if(s)34===p&&92!==d&&(s=!1);else if(r)96===p&&92!==d&&(r=!1);else if(o)47===p&&92!==d&&(o=!1);else if(124!==p||124===n.charCodeAt(u+1)||124===n.charCodeAt(u-1)||a||l||c){switch(p){case 34:s=!0;break;case 39:i=!0;break;case 96:r=!0;break;case 40:c++;break;case 41:c--;break;case 91:l++;break;case 93:l--;break;case 123:a++;break;case 125:a--}if(47===p){let e,t=u-1;for(;t>=0&&" "===(e=n.charAt(t));t--);e&&n5.test(e)||(o=!0)}}else void 0===f?(h=u+1,f=n.slice(0,u).trim()):_();function _(){E.push(n.slice(h,u).trim()),h=u+1}if(void 0===f?f=n.slice(0,u).trim():0!==h&&_(),E.length){for(u=0;u<E.length;u++)f=function(e,t,n){n.helper($);let i=t.indexOf("(");if(i<0)return n.filters.add(t),`${tD(t,"filter")}(${e})`;{let s=t.slice(0,i),r=t.slice(i+1);return n.filters.add(s),`${tD(s,"filter")}(${e}${")"!==r?","+r:r}`}}(f,E[u],t);e.content=f,e.ast=void 0}}let ie=new WeakSet,it=(e,t)=>{if(1===e.type){let n=ty(e,"memo");if(!(!n||ie.has(e)))return ie.add(e),()=>{let i=e.codegenNode||t.currentNode.codegenNode;i&&13===i.type&&(1!==e.tagType&&ew(i,t),e.codegenNode=eC(t.helper(ec),[n.exp,eb(void 0,i),"_cache",String(t.cached.length)]),t.cached.push(null))}}};function ii(e){return[[n3,nb,it,nV,n9,nz,nJ,nF,n0],{on:n1,bind:nM,model:n4}]}function is(e,t={}){let n=t.onError||ez,i="module"===t.mode;!0===t.prefixIdentifiers?n(e1(47)):i&&n(e1(48)),t.cacheHandlers&&n(e1(49)),t.scopeId&&!i&&n(e1(50));let s=o({},t,{prefixIdentifiers:!1}),r=l(e)?nr(e,s):e,[a,c]=ii();return nd(r,o({},s,{nodeTransforms:[...a,...t.nodeTransforms||[]],directiveTransforms:o({},c,t.directiveTransforms||{})})),nm(r,s)}let ir={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},io=()=>({props:[]}),ia=Symbol(""),il=Symbol(""),ic=Symbol(""),ih=Symbol(""),ip=Symbol(""),id=Symbol(""),iu=Symbol(""),iE=Symbol(""),i_=Symbol(""),im=Symbol("");ed({[ia]:"vModelRadio",[il]:"vModelCheckbox",[ic]:"vModelText",[ih]:"vModelSelect",[ip]:"vModelDynamic",[id]:"withModifiers",[iu]:"withKeys",[iE]:"vShow",[i_]:"Transition",[im]:"TransitionGroup"});let iS={parseMode:"html",isVoidTag:A,isNativeTag:e=>I(e)||y(e)||O(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(t,n=!1){return(e||(e=document.createElement("div")),n)?(e.innerHTML=`<div foo="${t.replace(/"/g,""")}">`,e.children[0].getAttribute("foo")):(e.innerHTML=t,e.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?i_:"TransitionGroup"===e||"transition-group"===e?im:void 0,getNamespace(e,t,n){let i=t?t.ns:n;if(t&&2===i){if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(i=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(i=0)}else t&&1===i&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(i=0);if(0===i){if("svg"===e)return 1;if("math"===e)return 2}return i}},ig=e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:ey("style",!0,t.loc),exp:iT(t.value.content,t.loc),modifiers:[],loc:t.loc})})},iT=(e,t)=>ey(JSON.stringify(function(e){let t={};return e.replace(N,"").split(g).forEach(e=>{if(e){let n=e.split(T);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(e)),!1,t,3);function iN(e,t){return e1(e,t)}let iI={X_V_HTML_NO_EXPRESSION:53,53:"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:54,54:"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:55,55:"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:56,56:"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:57,57:"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:58,58:"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:59,59:"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:60,60:"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:61,61:"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:62,62:"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:63,63:"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:64,64:"__EXTEND_POINT__"},iy={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},iO=t("passive,once,capture"),iA=t("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),iC=t("left,right"),ib=t("onkeyup,onkeydown,onkeypress"),iR=(e,t,n,i)=>{let s=[],r=[],o=[];for(let i=0;i<t.length;i++){let a=t[i].content;"native"===a&&eY("COMPILER_V_ON_NATIVE",n)?o.push(a):iO(a)?o.push(a):iC(a)?tr(e)?ib(e.content.toLowerCase())?s.push(a):r.push(a):(s.push(a),r.push(a)):iA(a)?r.push(a):s.push(a)}return{keyModifiers:s,nonKeyModifiers:r,eventOptionModifiers:o}},iv=(e,t)=>tr(e)&&"onclick"===e.content.toLowerCase()?ey(t,!0):4!==e.type?eA(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,ix=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},iL=[ig],iM={cloak:io,html:(e,t,n)=>{let{exp:i,loc:s}=e;return i||n.onError(iN(53,s)),t.children.length&&(n.onError(iN(54,s)),t.children.length=0),{props:[eI(ey("innerHTML",!0,s),i||ey("",!0))]}},text:(e,t,n)=>{let{exp:i,loc:s}=e;return i||n.onError(iN(55,s)),t.children.length&&(n.onError(iN(56,s)),t.children.length=0),{props:[eI(ey("textContent",!0),i?na(i,n)>0?i:eC(n.helperString(j),[i],s):ey("",!0))]}},model:(e,t,n)=>{let i=n4(e,t,n);if(!i.props.length||1===t.tagType)return i;e.arg&&n.onError(iN(58,e.arg.loc));let{tag:s}=t,r=n.isCustomElement(s);if("input"===s||"textarea"===s||"select"===s||r){let o=ic,a=!1;if("input"===s||r){let i=tO(t,"type");if(i){if(7===i.type)o=ip;else if(i.value)switch(i.value.content){case"radio":o=ia;break;case"checkbox":o=il;break;case"file":a=!0,n.onError(iN(59,e.loc))}}else tC(t)&&(o=ip)}else"select"===s&&(o=ih);a||(i.needRuntime=n.helper(o))}else n.onError(iN(57,e.loc));return i.props=i.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),i},on:(e,t,n)=>n1(e,t,n,t=>{let{modifiers:i}=e;if(!i.length)return t;let{key:s,value:r}=t.props[0],{keyModifiers:o,nonKeyModifiers:a,eventOptionModifiers:l}=iR(s,i,n,e.loc);if(a.includes("right")&&(s=iv(s,"onContextmenu")),a.includes("middle")&&(s=iv(s,"onMouseup")),a.length&&(r=eC(n.helper(id),[r,JSON.stringify(a)])),o.length&&(!tr(s)||ib(s.content.toLowerCase()))&&(r=eC(n.helper(iu),[r,JSON.stringify(o)])),l.length){let e=l.map(_).join("");s=tr(s)?ey(`${s.content}${e}`,!0):eA(["(",s,`) + "${e}"`])}return{props:[eI(s,r)]}}),show:(e,t,n)=>{let{exp:i,loc:s}=e;return i||n.onError(iN(61,s)),{props:[],needRuntime:n.helper(iE)}}};function iP(e,t={}){return is(e,o({},iS,t,{nodeTransforms:[ix,...iL,...t.nodeTransforms||[]],directiveTransforms:o({},iM,t.directiveTransforms||{}),transformHoist:null}))}function iD(e,t={}){return nr(e,o({},iS,t))}export{x as BASE_TRANSITION,ir as BindingTypes,ee as CAMELIZE,et as CAPITALIZE,M as CREATE_BLOCK,k as CREATE_COMMENT,P as CREATE_ELEMENT_BLOCK,V as CREATE_ELEMENT_VNODE,J as CREATE_SLOTS,w as CREATE_STATIC,X as CREATE_TEXT,D as CREATE_VNODE,eJ as CompilerDeprecationTypes,e_ as ConstantTypes,iM as DOMDirectiveTransforms,iI as DOMErrorCodes,iy as DOMErrorMessages,iL as DOMNodeTransforms,eE as ElementTypes,e0 as ErrorCodes,C as FRAGMENT,z as GUARD_REACTIVE_PROPS,eh as IS_MEMO_SAME,el as IS_REF,v as KEEP_ALIVE,W as MERGE_PROPS,K as NORMALIZE_CLASS,Q as NORMALIZE_PROPS,Y as NORMALIZE_STYLE,eu as Namespaces,ef as NodeTypes,L as OPEN_BLOCK,er as POP_SCOPE_ID,es as PUSH_SCOPE_ID,G as RENDER_LIST,q as RENDER_SLOT,U as RESOLVE_COMPONENT,B as RESOLVE_DIRECTIVE,F as RESOLVE_DYNAMIC_COMPONENT,$ as RESOLVE_FILTER,ei as SET_BLOCK_TRACKING,R as SUSPENSE,b as TELEPORT,j as TO_DISPLAY_STRING,Z as TO_HANDLERS,en as TO_HANDLER_KEY,i_ as TRANSITION,im as TRANSITION_GROUP,ti as TS_NODE_TYPES,ea as UNREF,il as V_MODEL_CHECKBOX,ip as V_MODEL_DYNAMIC,ia as V_MODEL_RADIO,ih as V_MODEL_SELECT,ic as V_MODEL_TEXT,iu as V_ON_WITH_KEYS,id as V_ON_WITH_MODIFIERS,iE as V_SHOW,eo as WITH_CTX,H as WITH_DIRECTIVES,ec as WITH_MEMO,tT as advancePositionWithClone,tN as advancePositionWithMutation,tI as assert,is as baseCompile,nr as baseParse,nY as buildDirectiveArgs,nW as buildProps,nH as buildSlots,eY as checkCompatEnabled,iP as compile,ew as convertToBlock,eT as createArrayExpression,eP as createAssignmentExpression,ex as createBlockStatement,ev as createCacheExpression,eC as createCallExpression,e1 as createCompilerError,eA as createCompoundExpression,eR as createConditionalExpression,iN as createDOMCompilerError,nw as createForLoopParams,eb as createFunctionExpression,eM as createIfStatement,eO as createInterpolation,eN as createObjectExpression,eI as createObjectProperty,eV as createReturnStatement,eS as createRoot,eD as createSequenceExpression,ey as createSimpleExpression,nf as createStructuralDirectiveTransform,eL as createTemplateLiteral,np as createTransformContext,eg as createVNodeCall,e2 as errorMessages,e8 as extractIdentifiers,ty as findDir,tO as findProp,tX as forAliasRE,nm as generate,S as generateCodeFrame,ii as getBaseTransformPreset,na as getConstantType,tk as getMemoedVNodeCall,eX as getVNodeBlockHelper,ek as getVNodeHelper,tC as hasDynamicKeyVBind,tV as hasScopeRef,ep as helperNameMap,tM as injectProp,to as isCoreComponent,tg as isFnExpression,tm as isFnExpressionBrowser,tS as isFnExpressionNode,te as isFunctionType,e6 as isInDestructureAssignment,e5 as isInNewExpression,tE as isMemberExpression,tu as isMemberExpressionBrowser,tf as isMemberExpressionNode,e4 as isReferencedIdentifier,tl as isSimpleIdentifier,tx as isSlotOutlet,tA as isStaticArgOf,tr as isStaticExp,tt as isStaticProperty,tn as isStaticPropertyKey,tv as isTemplateNode,tb as isText,tR as isVSlot,em as locStub,io as noopDirectiveTransform,iD as parse,iS as parserOptions,nA as processExpression,nk as processFor,nR as processIf,nZ as processSlotOutlet,ed as registerRuntimeHelpers,nj as resolveComponentType,nC as stringifyExpression,tD as toValidAssetId,nF as trackSlotScopes,nB as trackVForSlotScopes,nd as transform,nM as transformBind,nJ as transformElement,nO as transformExpression,n4 as transformModel,n1 as transformOn,ig as transformStyle,nu as traverseNode,ts as unwrapTSNode,e7 as walkBlockDeclarations,e9 as walkFunctionParams,e3 as walkIdentifiers,eQ as warnDeprecation}; diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js new file mode 100644 index 0000000..a6fe625 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js @@ -0,0 +1,687 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { registerRuntimeHelpers, createSimpleExpression, createCompilerError, createObjectProperty, getConstantType, createCallExpression, TO_DISPLAY_STRING, transformModel as transformModel$1, findProp, hasDynamicKeyVBind, findDir, isStaticArgOf, transformOn as transformOn$1, isStaticExp, createCompoundExpression, checkCompatEnabled, noopDirectiveTransform, baseCompile, baseParse } from '@vue/compiler-core'; +export * from '@vue/compiler-core'; +import { isVoidTag, isHTMLTag, isSVGTag, isMathMLTag, parseStringStyle, capitalize, makeMap, extend } from '@vue/shared'; + +const V_MODEL_RADIO = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelRadio` : ``); +const V_MODEL_CHECKBOX = Symbol( + !!(process.env.NODE_ENV !== "production") ? `vModelCheckbox` : `` +); +const V_MODEL_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelText` : ``); +const V_MODEL_SELECT = Symbol( + !!(process.env.NODE_ENV !== "production") ? `vModelSelect` : `` +); +const V_MODEL_DYNAMIC = Symbol( + !!(process.env.NODE_ENV !== "production") ? `vModelDynamic` : `` +); +const V_ON_WITH_MODIFIERS = Symbol( + !!(process.env.NODE_ENV !== "production") ? `vOnModifiersGuard` : `` +); +const V_ON_WITH_KEYS = Symbol( + !!(process.env.NODE_ENV !== "production") ? `vOnKeysGuard` : `` +); +const V_SHOW = Symbol(!!(process.env.NODE_ENV !== "production") ? `vShow` : ``); +const TRANSITION = Symbol(!!(process.env.NODE_ENV !== "production") ? `Transition` : ``); +const TRANSITION_GROUP = Symbol( + !!(process.env.NODE_ENV !== "production") ? `TransitionGroup` : `` +); +registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +let decoder; +function decodeHtmlBrowser(raw, asAttr = false) { + if (!decoder) { + decoder = document.createElement("div"); + } + if (asAttr) { + decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; + return decoder.children[0].getAttribute("foo"); + } else { + decoder.innerHTML = raw; + return decoder.textContent; + } +} + +const parserOptions = { + parseMode: "html", + isVoidTag, + isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: decodeHtmlBrowser , + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = parseStringStyle(cssText); + return createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return createCompilerError( + code, + loc, + !!(process.env.NODE_ENV !== "production") || false ? DOMErrorMessages : void 0 + ); +} +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`innerHTML`, true, loc), + exp || createSimpleExpression("", true) + ) + ] + }; +}; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`textContent`, true), + exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression( + context.helperString(TO_DISPLAY_STRING), + [exp], + loc + ) : createSimpleExpression("", true) + ) + ] + }; +}; + +const transformModel = (dir, node, context) => { + const baseResult = transformModel$1(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + function checkDuplicatedValue() { + const value = findDir(node, "bind"); + if (value && isStaticArgOf(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue(); + break; + } + } + } else if (hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + !!(process.env.NODE_ENV !== "production") && checkDuplicatedValue(); + } + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right"); +const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (modifier === "native" && checkCompatEnabled( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return transformOn$1(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(capitalize).join(""); + key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [createObjectProperty(key, handlerExp)] + }; + }); +}; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; +}; + +const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; + } + } +}; +function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); +} + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + !!(process.env.NODE_ENV !== "production") && context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); + } +}; + +function isValidHTMLNesting(parent, child) { + if (parent in onlyValidChildren) { + return onlyValidChildren[parent].has(child); + } + if (child in onlyValidParents) { + return onlyValidParents[child].has(parent); + } + if (parent in knownInvalidChildren) { + if (knownInvalidChildren[parent].has(child)) return false; + } + if (child in knownInvalidParents) { + if (knownInvalidParents[child].has(parent)) return false; + } + return true; +} +const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); +const emptySet = /* @__PURE__ */ new Set([]); +const onlyValidChildren = { + head: /* @__PURE__ */ new Set([ + "base", + "basefront", + "bgsound", + "link", + "meta", + "title", + "noscript", + "noframes", + "style", + "script", + "template" + ]), + optgroup: /* @__PURE__ */ new Set(["option"]), + select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), + // table + table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), + tr: /* @__PURE__ */ new Set(["td", "th"]), + colgroup: /* @__PURE__ */ new Set(["col"]), + tbody: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["tr"]), + tfoot: /* @__PURE__ */ new Set(["tr"]), + // these elements can not have any children elements + script: emptySet, + iframe: emptySet, + option: emptySet, + textarea: emptySet, + style: emptySet, + title: emptySet +}; +const onlyValidParents = { + // sections + html: emptySet, + body: /* @__PURE__ */ new Set(["html"]), + head: /* @__PURE__ */ new Set(["html"]), + // table + td: /* @__PURE__ */ new Set(["tr"]), + colgroup: /* @__PURE__ */ new Set(["table"]), + caption: /* @__PURE__ */ new Set(["table"]), + tbody: /* @__PURE__ */ new Set(["table"]), + tfoot: /* @__PURE__ */ new Set(["table"]), + col: /* @__PURE__ */ new Set(["colgroup"]), + th: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["table"]), + tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), + // data list + dd: /* @__PURE__ */ new Set(["dl", "div"]), + dt: /* @__PURE__ */ new Set(["dl", "div"]), + // other + figcaption: /* @__PURE__ */ new Set(["figure"]), + // li: new Set(["ul", "ol"]), + summary: /* @__PURE__ */ new Set(["details"]), + area: /* @__PURE__ */ new Set(["map"]) +}; +const knownInvalidChildren = { + p: /* @__PURE__ */ new Set([ + "address", + "article", + "aside", + "blockquote", + "center", + "details", + "dialog", + "dir", + "div", + "dl", + "fieldset", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "li", + "main", + "nav", + "menu", + "ol", + "p", + "pre", + "section", + "table", + "ul" + ]), + svg: /* @__PURE__ */ new Set([ + "b", + "blockquote", + "br", + "code", + "dd", + "div", + "dl", + "dt", + "em", + "embed", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "li", + "menu", + "meta", + "ol", + "p", + "pre", + "ruby", + "s", + "small", + "span", + "strong", + "sub", + "sup", + "table", + "u", + "ul", + "var" + ]) +}; +const knownInvalidParents = { + a: /* @__PURE__ */ new Set(["a"]), + button: /* @__PURE__ */ new Set(["button"]), + dd: /* @__PURE__ */ new Set(["dd", "dt"]), + dt: /* @__PURE__ */ new Set(["dd", "dt"]), + form: /* @__PURE__ */ new Set(["form"]), + li: /* @__PURE__ */ new Set(["li"]), + h1: headings, + h2: headings, + h3: headings, + h4: headings, + h5: headings, + h6: headings +}; + +const validateHtmlNesting = (node, context) => { + if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { + const error = new SyntaxError( + `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` + ); + error.loc = node.loc; + context.onWarn(error); + } +}; + +const DOMNodeTransforms = [ + transformStyle, + ...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : [] +]; +const DOMDirectiveTransforms = { + cloak: noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile(src, options = {}) { + return baseCompile( + src, + extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: null + }) + ); +} +function parse(template, options = {}) { + return baseParse(template, extend({}, parserOptions, options)); +} + +export { DOMDirectiveTransforms, DOMErrorCodes, DOMErrorMessages, DOMNodeTransforms, TRANSITION, TRANSITION_GROUP, V_MODEL_CHECKBOX, V_MODEL_DYNAMIC, V_MODEL_RADIO, V_MODEL_SELECT, V_MODEL_TEXT, V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS, V_SHOW, compile, createDOMCompilerError, parse, parserOptions, transformStyle }; diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js new file mode 100644 index 0000000..8537569 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js @@ -0,0 +1,6761 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +var VueCompilerDOM = (function (exports) { + 'use strict'; + + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; + } + + const EMPTY_OBJ = Object.freeze({}) ; + const NOOP = () => { + }; + const NO = () => false; + const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter + (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); + const extend = Object.assign; + const isArray = Array.isArray; + const isString = (val) => typeof val === "string"; + const isSymbol = (val) => typeof val === "symbol"; + const isObject = (val) => val !== null && typeof val === "object"; + const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" + ); + const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" + ); + const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; + }; + const camelizeRE = /-(\w)/g; + const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } + ); + const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); + }); + const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } + ); + + const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` + }; + + const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" + }; + + const range = 2; + function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); + } + + const listDelimiterRE = /;(?![^(]*\))/g; + const propertyDelimiterRE = /:([^]+)/; + const styleCommentRE = /\/\*[^]*?\*\//g; + function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; + } + + const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; + const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; + const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; + const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; + const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); + const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); + const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); + const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + + const FRAGMENT = Symbol(`Fragment` ); + const TELEPORT = Symbol(`Teleport` ); + const SUSPENSE = Symbol(`Suspense` ); + const KEEP_ALIVE = Symbol(`KeepAlive` ); + const BASE_TRANSITION = Symbol( + `BaseTransition` + ); + const OPEN_BLOCK = Symbol(`openBlock` ); + const CREATE_BLOCK = Symbol(`createBlock` ); + const CREATE_ELEMENT_BLOCK = Symbol( + `createElementBlock` + ); + const CREATE_VNODE = Symbol(`createVNode` ); + const CREATE_ELEMENT_VNODE = Symbol( + `createElementVNode` + ); + const CREATE_COMMENT = Symbol( + `createCommentVNode` + ); + const CREATE_TEXT = Symbol( + `createTextVNode` + ); + const CREATE_STATIC = Symbol( + `createStaticVNode` + ); + const RESOLVE_COMPONENT = Symbol( + `resolveComponent` + ); + const RESOLVE_DYNAMIC_COMPONENT = Symbol( + `resolveDynamicComponent` + ); + const RESOLVE_DIRECTIVE = Symbol( + `resolveDirective` + ); + const RESOLVE_FILTER = Symbol( + `resolveFilter` + ); + const WITH_DIRECTIVES = Symbol( + `withDirectives` + ); + const RENDER_LIST = Symbol(`renderList` ); + const RENDER_SLOT = Symbol(`renderSlot` ); + const CREATE_SLOTS = Symbol(`createSlots` ); + const TO_DISPLAY_STRING = Symbol( + `toDisplayString` + ); + const MERGE_PROPS = Symbol(`mergeProps` ); + const NORMALIZE_CLASS = Symbol( + `normalizeClass` + ); + const NORMALIZE_STYLE = Symbol( + `normalizeStyle` + ); + const NORMALIZE_PROPS = Symbol( + `normalizeProps` + ); + const GUARD_REACTIVE_PROPS = Symbol( + `guardReactiveProps` + ); + const TO_HANDLERS = Symbol(`toHandlers` ); + const CAMELIZE = Symbol(`camelize` ); + const CAPITALIZE = Symbol(`capitalize` ); + const TO_HANDLER_KEY = Symbol( + `toHandlerKey` + ); + const SET_BLOCK_TRACKING = Symbol( + `setBlockTracking` + ); + const PUSH_SCOPE_ID = Symbol(`pushScopeId` ); + const POP_SCOPE_ID = Symbol(`popScopeId` ); + const WITH_CTX = Symbol(`withCtx` ); + const UNREF = Symbol(`unref` ); + const IS_REF = Symbol(`isRef` ); + const WITH_MEMO = Symbol(`withMemo` ); + const IS_MEMO_SAME = Symbol(`isMemoSame` ); + const helperNameMap = { + [FRAGMENT]: `Fragment`, + [TELEPORT]: `Teleport`, + [SUSPENSE]: `Suspense`, + [KEEP_ALIVE]: `KeepAlive`, + [BASE_TRANSITION]: `BaseTransition`, + [OPEN_BLOCK]: `openBlock`, + [CREATE_BLOCK]: `createBlock`, + [CREATE_ELEMENT_BLOCK]: `createElementBlock`, + [CREATE_VNODE]: `createVNode`, + [CREATE_ELEMENT_VNODE]: `createElementVNode`, + [CREATE_COMMENT]: `createCommentVNode`, + [CREATE_TEXT]: `createTextVNode`, + [CREATE_STATIC]: `createStaticVNode`, + [RESOLVE_COMPONENT]: `resolveComponent`, + [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, + [RESOLVE_DIRECTIVE]: `resolveDirective`, + [RESOLVE_FILTER]: `resolveFilter`, + [WITH_DIRECTIVES]: `withDirectives`, + [RENDER_LIST]: `renderList`, + [RENDER_SLOT]: `renderSlot`, + [CREATE_SLOTS]: `createSlots`, + [TO_DISPLAY_STRING]: `toDisplayString`, + [MERGE_PROPS]: `mergeProps`, + [NORMALIZE_CLASS]: `normalizeClass`, + [NORMALIZE_STYLE]: `normalizeStyle`, + [NORMALIZE_PROPS]: `normalizeProps`, + [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, + [TO_HANDLERS]: `toHandlers`, + [CAMELIZE]: `camelize`, + [CAPITALIZE]: `capitalize`, + [TO_HANDLER_KEY]: `toHandlerKey`, + [SET_BLOCK_TRACKING]: `setBlockTracking`, + [PUSH_SCOPE_ID]: `pushScopeId`, + [POP_SCOPE_ID]: `popScopeId`, + [WITH_CTX]: `withCtx`, + [UNREF]: `unref`, + [IS_REF]: `isRef`, + [WITH_MEMO]: `withMemo`, + [IS_MEMO_SAME]: `isMemoSame` + }; + function registerRuntimeHelpers(helpers) { + Object.getOwnPropertySymbols(helpers).forEach((s) => { + helperNameMap[s] = helpers[s]; + }); + } + + const Namespaces = { + "HTML": 0, + "0": "HTML", + "SVG": 1, + "1": "SVG", + "MATH_ML": 2, + "2": "MATH_ML" + }; + const NodeTypes = { + "ROOT": 0, + "0": "ROOT", + "ELEMENT": 1, + "1": "ELEMENT", + "TEXT": 2, + "2": "TEXT", + "COMMENT": 3, + "3": "COMMENT", + "SIMPLE_EXPRESSION": 4, + "4": "SIMPLE_EXPRESSION", + "INTERPOLATION": 5, + "5": "INTERPOLATION", + "ATTRIBUTE": 6, + "6": "ATTRIBUTE", + "DIRECTIVE": 7, + "7": "DIRECTIVE", + "COMPOUND_EXPRESSION": 8, + "8": "COMPOUND_EXPRESSION", + "IF": 9, + "9": "IF", + "IF_BRANCH": 10, + "10": "IF_BRANCH", + "FOR": 11, + "11": "FOR", + "TEXT_CALL": 12, + "12": "TEXT_CALL", + "VNODE_CALL": 13, + "13": "VNODE_CALL", + "JS_CALL_EXPRESSION": 14, + "14": "JS_CALL_EXPRESSION", + "JS_OBJECT_EXPRESSION": 15, + "15": "JS_OBJECT_EXPRESSION", + "JS_PROPERTY": 16, + "16": "JS_PROPERTY", + "JS_ARRAY_EXPRESSION": 17, + "17": "JS_ARRAY_EXPRESSION", + "JS_FUNCTION_EXPRESSION": 18, + "18": "JS_FUNCTION_EXPRESSION", + "JS_CONDITIONAL_EXPRESSION": 19, + "19": "JS_CONDITIONAL_EXPRESSION", + "JS_CACHE_EXPRESSION": 20, + "20": "JS_CACHE_EXPRESSION", + "JS_BLOCK_STATEMENT": 21, + "21": "JS_BLOCK_STATEMENT", + "JS_TEMPLATE_LITERAL": 22, + "22": "JS_TEMPLATE_LITERAL", + "JS_IF_STATEMENT": 23, + "23": "JS_IF_STATEMENT", + "JS_ASSIGNMENT_EXPRESSION": 24, + "24": "JS_ASSIGNMENT_EXPRESSION", + "JS_SEQUENCE_EXPRESSION": 25, + "25": "JS_SEQUENCE_EXPRESSION", + "JS_RETURN_STATEMENT": 26, + "26": "JS_RETURN_STATEMENT" + }; + const ElementTypes = { + "ELEMENT": 0, + "0": "ELEMENT", + "COMPONENT": 1, + "1": "COMPONENT", + "SLOT": 2, + "2": "SLOT", + "TEMPLATE": 3, + "3": "TEMPLATE" + }; + const ConstantTypes = { + "NOT_CONSTANT": 0, + "0": "NOT_CONSTANT", + "CAN_SKIP_PATCH": 1, + "1": "CAN_SKIP_PATCH", + "CAN_CACHE": 2, + "2": "CAN_CACHE", + "CAN_STRINGIFY": 3, + "3": "CAN_STRINGIFY" + }; + const locStub = { + start: { line: 1, column: 1, offset: 0 }, + end: { line: 1, column: 1, offset: 0 }, + source: "" + }; + function createRoot(children, source = "") { + return { + type: 0, + source, + children, + helpers: /* @__PURE__ */ new Set(), + components: [], + directives: [], + hoists: [], + imports: [], + cached: [], + temps: 0, + codegenNode: void 0, + loc: locStub + }; + } + function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { + if (context) { + if (isBlock) { + context.helper(OPEN_BLOCK); + context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); + } else { + context.helper(getVNodeHelper(context.inSSR, isComponent)); + } + if (directives) { + context.helper(WITH_DIRECTIVES); + } + } + return { + type: 13, + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent, + loc + }; + } + function createArrayExpression(elements, loc = locStub) { + return { + type: 17, + loc, + elements + }; + } + function createObjectExpression(properties, loc = locStub) { + return { + type: 15, + loc, + properties + }; + } + function createObjectProperty(key, value) { + return { + type: 16, + loc: locStub, + key: isString(key) ? createSimpleExpression(key, true) : key, + value + }; + } + function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { + return { + type: 4, + loc, + content, + isStatic, + constType: isStatic ? 3 : constType + }; + } + function createInterpolation(content, loc) { + return { + type: 5, + loc, + content: isString(content) ? createSimpleExpression(content, false, loc) : content + }; + } + function createCompoundExpression(children, loc = locStub) { + return { + type: 8, + loc, + children + }; + } + function createCallExpression(callee, args = [], loc = locStub) { + return { + type: 14, + loc, + callee, + arguments: args + }; + } + function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { + return { + type: 18, + params, + returns, + newline, + isSlot, + loc + }; + } + function createConditionalExpression(test, consequent, alternate, newline = true) { + return { + type: 19, + test, + consequent, + alternate, + newline, + loc: locStub + }; + } + function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { + return { + type: 20, + index, + value, + needPauseTracking, + inVOnce, + needArraySpread: false, + loc: locStub + }; + } + function createBlockStatement(body) { + return { + type: 21, + body, + loc: locStub + }; + } + function createTemplateLiteral(elements) { + return { + type: 22, + elements, + loc: locStub + }; + } + function createIfStatement(test, consequent, alternate) { + return { + type: 23, + test, + consequent, + alternate, + loc: locStub + }; + } + function createAssignmentExpression(left, right) { + return { + type: 24, + left, + right, + loc: locStub + }; + } + function createSequenceExpression(expressions) { + return { + type: 25, + expressions, + loc: locStub + }; + } + function createReturnStatement(returns) { + return { + type: 26, + returns, + loc: locStub + }; + } + function getVNodeHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; + } + function getVNodeBlockHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; + } + function convertToBlock(node, { helper, removeHelper, inSSR }) { + if (!node.isBlock) { + node.isBlock = true; + removeHelper(getVNodeHelper(inSSR, node.isComponent)); + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(inSSR, node.isComponent)); + } + } + + const defaultDelimitersOpen = new Uint8Array([123, 123]); + const defaultDelimitersClose = new Uint8Array([125, 125]); + function isTagStartChar(c) { + return c >= 97 && c <= 122 || c >= 65 && c <= 90; + } + function isWhitespace(c) { + return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; + } + function isEndOfTagSection(c) { + return c === 47 || c === 62 || isWhitespace(c); + } + function toCharCodes(str) { + const ret = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + ret[i] = str.charCodeAt(i); + } + return ret; + } + const Sequences = { + Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), + // CDATA[ + CdataEnd: new Uint8Array([93, 93, 62]), + // ]]> + CommentEnd: new Uint8Array([45, 45, 62]), + // `-->` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `</style` + TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), + // `</title` + TextareaEnd: new Uint8Array([ + 60, + 47, + 116, + 101, + 120, + 116, + 97, + 114, + 101, + 97 + ]) + // `</textarea + }; + class Tokenizer { + constructor(stack, cbs) { + this.stack = stack; + this.cbs = cbs; + /** The current state the tokenizer is in. */ + this.state = 1; + /** The read buffer. */ + this.buffer = ""; + /** The beginning of the section that is currently being read. */ + this.sectionStart = 0; + /** The index within the buffer that we are currently looking at. */ + this.index = 0; + /** The start of the last entity. */ + this.entityStart = 0; + /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ + this.baseState = 1; + /** For special parsing behavior inside of script and style tags. */ + this.inRCDATA = false; + /** For disabling RCDATA tags handling */ + this.inXML = false; + /** For disabling interpolation parsing in v-pre */ + this.inVPre = false; + /** Record newline positions for fast line / column calculation */ + this.newlines = []; + this.mode = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + this.delimiterIndex = -1; + this.currentSequence = void 0; + this.sequenceIndex = 0; + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For <title> and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 34 || c === 39 || c === 60) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || this.fastForwardTo(quote)) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else ; + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + } + stateInEntity() { + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + } + } + + const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" + }; + const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } + }; + function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } + } + function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; + } + function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + if (enabled) { + warnDeprecation(key, context, loc, ...args); + } + return enabled; + } + function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); + } + + function defaultOnError(error) { + throw error; + } + function defaultOnWarn(msg) { + console.warn(`[Vue warn] ${msg.message}`); + } + function createCompilerError(code, loc, messages, additionalMessage) { + const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; + } + const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" + }; + const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` + }; + + function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + { + return; + } + } + function isReferencedIdentifier(id, parent, parentStack) { + { + return false; + } + } + function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; + } + function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; + } + function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); + } + } + } + function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } + } + function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; + } + function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } + } + } + function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; + } + return nodes; + } + const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); + }; + const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; + const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; + const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T + ]; + function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } + } + + const isStaticExp = (p) => p.type === 4 && p.isStatic; + function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } + } + const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; + const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); + const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; + const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; + const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; + const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; + const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; + }; + const isMemberExpressionNode = NOOP ; + const isMemberExpression = isMemberExpressionBrowser ; + const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; + const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); + const isFnExpressionNode = NOOP ; + const isFnExpression = isFnExpressionBrowser ; + function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); + } + function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; + } + function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } + } + function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) { + return p; + } + } + } + function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } + } + function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); + } + function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); + } + function isText$1(node) { + return node.type === 5 || node.type === 2; + } + function isVSlot(p) { + return p.type === 7 && p.name === "slot"; + } + function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; + } + function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; + } + const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); + function getUnnormalizedProps(props, callPath = []) { + if (props && !isString(props) && props.type === 14) { + const callee = props.callee; + if (!isString(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; + } + function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !isString(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || isString(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!isString(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } + } + function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; + } + function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; + } + function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => isObject(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + return false; + } + } + function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } + } + const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + + const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: NO, + isPreTag: NO, + isIgnoreNewlineTag: NO, + isCustomElement: NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: true, + prefixIdentifiers: false + }; + let currentOptions = defaultParserOptions; + let currentRoot = null; + let currentInput = ""; + let currentOpenTag = null; + let currentProp = null; + let currentAttrValue = ""; + let currentAttrStartIndex = -1; + let currentAttrEndIndex = -1; + let inPre = 0; + let inVPre = false; + let currentVPreBoundary = null; + const stack = []; + const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = currentOptions.decodeEntities(exp, false); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentAttrValue.includes("&")) { + currentAttrValue = currentOptions.decodeEntities( + currentAttrValue, + true + ); + } + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( + (mod) => mod.content === "sync" + )) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } + }); + const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; + const stripParensRE = /^\(|\)$/g; + function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; + } + function getSlice(start, end) { + return currentInput.slice(start, end); + } + function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; + } + function onText(content, start, end) { + { + const tag = stack[0] && stack[0].tag; + if (tag !== "script" && tag !== "style" && content.includes("&")) { + content = currentOptions.decodeEntities(content, false); + } + } + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } + } + function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if (isCompatEnabled( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions + )) { + let hasIf = false; + let hasFor = false; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 7) { + if (p.name === "if") { + hasIf = true; + } else if (p.name === "for") { + hasFor = true; + } + } + if (hasIf && hasFor) { + warnDeprecation( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions, + el.loc + ); + break; + } + } + } + if (!tokenizer.inSFCRoot && isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + warnDeprecation( + "COMPILER_NATIVE_TEMPLATE", + currentOptions, + el.loc + ); + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } + } + } + function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; + } + function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; + } + const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); + function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; + } + function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + return false; + } + function isUpperCase(c) { + return c > 64 && c < 91; + } + const windowsNewlineRE = /\r\n/g; + function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; + } + function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; + } + function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; + } + function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; + } + function addNode(node) { + (stack[0] || currentRoot).children.push(node); + } + function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; + } + function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); + } + function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); + } + function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; + } + function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + return exp; + } + function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); + } + function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; + } + function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + { + if (!currentOptions.decodeEntities) { + throw new Error( + `[@vue/compiler-core] decodeEntities option is required in browser builds.` + ); + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; + } + + function cacheStatic(root, context) { + walk( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); + } + function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); + } + function walk(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !isArray(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } + } + function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child) || isSymbol(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + return 0; + } + } + const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS + ]); + function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; + } + function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; + } + function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } + } + + function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = NOOP, + isCustomElement = NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig + }) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && capitalize(camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if (!context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: NOOP, + addIdentifiers(exp) { + }, + removeIdentifiers(exp) { + }, + hoist(exp) { + if (isString(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + { + context.filters = /* @__PURE__ */ new Set(); + } + return context; + } + function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; + } + } + function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + if (children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; + } + function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (isString(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } + } + function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (isArray(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } + } + function createStructuralDirectiveTransform(name, fn) { + const matches = isString(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; + } + + const PURE_ANNOTATION = `/*@__PURE__*/`; + const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; + function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false + }) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + return context; + } + function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const preambleContext = context; + { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + const signature = args.join(", "); + { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { + newline(); + genAssets(ast.filters, "filter", context); + newline(); + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: ``, + map: context.map ? context.map.toJSON() : void 0 + }; + } + function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + genHoists(ast.hoists, context); + newline(); + push(`return `); + } + function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } + } + function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; + } + function isText(n) { + return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; + } + function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); + } + function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (isString(node)) { + push(node, -3 /* Unknown */); + } else if (isArray(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } + } + function genNode(node, context) { + if (isString(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (isSymbol(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + break; + case 23: + break; + case 24: + break; + case 25: + break; + case 26: + break; + /* v8 ignore start */ + case 10: + break; + default: + { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; + } + } + } + function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); + } + function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); + } + function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); + } + function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } + } + function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } + } + function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); + } + function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + { + if (patchFlag < 0) { + patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `); + patchFlagString = patchFlag + ` /* ${flagNames} */`; + } + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } + } + function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); + } + function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = isString(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); + } + function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); + } + function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); + } + function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (isArray(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (isArray(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); + } + push(`)`); + } + } + function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); + } + function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } + } + + const prohibitedKeywordRE = new RegExp( + "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" + ); + const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; + function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { + const exp = node.content; + if (!exp.trim()) { + return; + } + try { + new Function( + asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` + ); + } catch (e) { + let message = e.message; + const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); + if (keywordMatch) { + message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; + } + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + message + ) + ); + } + } + + const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } + }; + function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + { + { + validateBrowserExpression(node, context, asParams, asRawStatements); + } + return node; + } + } + function stringifyExpression(exp) { + if (isString(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } + } + + const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } + ); + function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (dir.exp) { + validateBrowserExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + comments.unshift(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; + } + { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } + } + function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; + } + function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + '"v-if"' , + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } + } + function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } + } + function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; + } + function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } + } + + const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + exp = void 0; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; + }; + const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); + }; + const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } + }; + + const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if (isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } + ); + function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (onExit) onExit(); + }; + } + function finalizeForParseResult(result, context) { + if (result.finalized) return; + { + validateBrowserExpression(result.source, context); + if (result.key) { + validateBrowserExpression( + result.key, + context, + true + ); + } + if (result.index) { + validateBrowserExpression( + result.index, + context, + true + ); + } + if (result.value) { + validateBrowserExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; + } + function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); + } + function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); + } + + const defaultFallback = createSimpleExpression(`undefined`, false); + const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + vSlot.exp; + context.scopes.vSlot++; + return () => { + context.scopes.vSlot--; + }; + } + } + }; + const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } + }; + const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc + ); + function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; + } + function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); + } + function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; + } + function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); + } + + const directiveImportMap = /* @__PURE__ */ new WeakMap(); + const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if (node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; + }; + function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); + } + function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + { + { + const hasOverridableKeys = mergeArgs.some((arg2) => { + if (arg2.type === 15) { + return arg2.properties.some(({ key }) => { + if (key.type !== 4 || !key.isStatic) { + return true; + } + return key.content !== "class" && key.content !== "style" && !isOn(key.content); + }); + } else { + return true; + } + }); + if (hasOverridableKeys) { + checkCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context, + loc + ); + } + } + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; + } + } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (isSymbol(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; + } + function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; + } + function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } + } + function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); + } + function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; + } + function isComponentTag(tag) { + return tag === "component" || tag === "Component"; + } + + const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } + }; + function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; + } + + const transformOn$1 = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + toHandlerKey(camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp); + const isInlineStatement = !(isMemberExp || isFnExpression(exp)); + const hasMultipleStatements = exp.content.includes(`;`); + { + validateBrowserExpression( + exp, + context, + false, + hasMultipleStatements + ); + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; + }; + + const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (` /* ${PatchFlagNames[1]} */` ) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } + }; + + const seen$1 = /* @__PURE__ */ new WeakSet(); + const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } + }; + + const transformModel$1 = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = false; + if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); + }; + function createTransformProps(props = []) { + return { props }; + } + + const validDivisionCharRE = /[\w).+\-_$\]]/; + const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } else if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); + } + }); + } + }; + function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } + } + function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + // " + case 39: + inSingle = true; + break; + // ' + case 96: + inTemplateString = true; + break; + // ` + case 40: + paren++; + break; + // ( + case 41: + paren--; + break; + // ) + case 91: + square++; + break; + // [ + case 93: + square--; + break; + // ] + case 123: + curly++; + break; + // { + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + if (filters.length) { + warnDeprecation( + "COMPILER_FILTERS", + context, + node.loc + ); + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; + node.ast = void 0; + } + } + function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + } + } + + const seen = /* @__PURE__ */ new WeakSet(); + const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } + }; + + function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ...[transformExpression] , + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn$1, + bind: transformBind, + model: transformModel$1 + } + ]; + } + function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + { + if (options.prefixIdentifiers === true) { + onError(createCompilerError(47)); + } else if (isModuleMode) { + onError(createCompilerError(48)); + } + } + const prefixIdentifiers = false; + if (options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = extend({}, options, { + prefixIdentifiers + }); + const ast = isString(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); + transform( + ast, + extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); + } + + const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" + }; + + const noopDirectiveTransform = () => ({ props: [] }); + + const V_MODEL_RADIO = Symbol(`vModelRadio` ); + const V_MODEL_CHECKBOX = Symbol( + `vModelCheckbox` + ); + const V_MODEL_TEXT = Symbol(`vModelText` ); + const V_MODEL_SELECT = Symbol( + `vModelSelect` + ); + const V_MODEL_DYNAMIC = Symbol( + `vModelDynamic` + ); + const V_ON_WITH_MODIFIERS = Symbol( + `vOnModifiersGuard` + ); + const V_ON_WITH_KEYS = Symbol( + `vOnKeysGuard` + ); + const V_SHOW = Symbol(`vShow` ); + const TRANSITION = Symbol(`Transition` ); + const TRANSITION_GROUP = Symbol( + `TransitionGroup` + ); + registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` + }); + + let decoder; + function decodeHtmlBrowser(raw, asAttr = false) { + if (!decoder) { + decoder = document.createElement("div"); + } + if (asAttr) { + decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; + return decoder.children[0].getAttribute("foo"); + } else { + decoder.innerHTML = raw; + return decoder.textContent; + } + } + + const parserOptions = { + parseMode: "html", + isVoidTag, + isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: decodeHtmlBrowser , + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } + }; + + const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } + }; + const parseInlineCSS = (cssText, loc) => { + const normalized = parseStringStyle(cssText); + return createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); + }; + + function createDOMCompilerError(code, loc) { + return createCompilerError( + code, + loc, + DOMErrorMessages + ); + } + const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" + }; + const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` + }; + + const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`innerHTML`, true, loc), + exp || createSimpleExpression("", true) + ) + ] + }; + }; + + const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`textContent`, true), + exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression( + context.helperString(TO_DISPLAY_STRING), + [exp], + loc + ) : createSimpleExpression("", true) + ) + ] + }; + }; + + const transformModel = (dir, node, context) => { + const baseResult = transformModel$1(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + function checkDuplicatedValue() { + const value = findDir(node, "bind"); + if (value && isStaticArgOf(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + break; + } + } + } else if (hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + checkDuplicatedValue(); + } + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; + }; + + const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`); + const isNonKeyModifier = /* @__PURE__ */ makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` + ); + const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right"); + const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`); + const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (modifier === "native" && checkCompatEnabled( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; + }; + const transformClick = (key, event) => { + const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; + }; + const transformOn = (dir, node, context) => { + return transformOn$1(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(capitalize).join(""); + key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [createObjectProperty(key, handlerExp)] + }; + }); + }; + + const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; + }; + + const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; + } + } + }; + function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); + } + + const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); + } + }; + + function isValidHTMLNesting(parent, child) { + if (parent in onlyValidChildren) { + return onlyValidChildren[parent].has(child); + } + if (child in onlyValidParents) { + return onlyValidParents[child].has(parent); + } + if (parent in knownInvalidChildren) { + if (knownInvalidChildren[parent].has(child)) return false; + } + if (child in knownInvalidParents) { + if (knownInvalidParents[child].has(parent)) return false; + } + return true; + } + const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); + const emptySet = /* @__PURE__ */ new Set([]); + const onlyValidChildren = { + head: /* @__PURE__ */ new Set([ + "base", + "basefront", + "bgsound", + "link", + "meta", + "title", + "noscript", + "noframes", + "style", + "script", + "template" + ]), + optgroup: /* @__PURE__ */ new Set(["option"]), + select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), + // table + table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), + tr: /* @__PURE__ */ new Set(["td", "th"]), + colgroup: /* @__PURE__ */ new Set(["col"]), + tbody: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["tr"]), + tfoot: /* @__PURE__ */ new Set(["tr"]), + // these elements can not have any children elements + script: emptySet, + iframe: emptySet, + option: emptySet, + textarea: emptySet, + style: emptySet, + title: emptySet + }; + const onlyValidParents = { + // sections + html: emptySet, + body: /* @__PURE__ */ new Set(["html"]), + head: /* @__PURE__ */ new Set(["html"]), + // table + td: /* @__PURE__ */ new Set(["tr"]), + colgroup: /* @__PURE__ */ new Set(["table"]), + caption: /* @__PURE__ */ new Set(["table"]), + tbody: /* @__PURE__ */ new Set(["table"]), + tfoot: /* @__PURE__ */ new Set(["table"]), + col: /* @__PURE__ */ new Set(["colgroup"]), + th: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["table"]), + tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), + // data list + dd: /* @__PURE__ */ new Set(["dl", "div"]), + dt: /* @__PURE__ */ new Set(["dl", "div"]), + // other + figcaption: /* @__PURE__ */ new Set(["figure"]), + // li: new Set(["ul", "ol"]), + summary: /* @__PURE__ */ new Set(["details"]), + area: /* @__PURE__ */ new Set(["map"]) + }; + const knownInvalidChildren = { + p: /* @__PURE__ */ new Set([ + "address", + "article", + "aside", + "blockquote", + "center", + "details", + "dialog", + "dir", + "div", + "dl", + "fieldset", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "li", + "main", + "nav", + "menu", + "ol", + "p", + "pre", + "section", + "table", + "ul" + ]), + svg: /* @__PURE__ */ new Set([ + "b", + "blockquote", + "br", + "code", + "dd", + "div", + "dl", + "dt", + "em", + "embed", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "li", + "menu", + "meta", + "ol", + "p", + "pre", + "ruby", + "s", + "small", + "span", + "strong", + "sub", + "sup", + "table", + "u", + "ul", + "var" + ]) + }; + const knownInvalidParents = { + a: /* @__PURE__ */ new Set(["a"]), + button: /* @__PURE__ */ new Set(["button"]), + dd: /* @__PURE__ */ new Set(["dd", "dt"]), + dt: /* @__PURE__ */ new Set(["dd", "dt"]), + form: /* @__PURE__ */ new Set(["form"]), + li: /* @__PURE__ */ new Set(["li"]), + h1: headings, + h2: headings, + h3: headings, + h4: headings, + h5: headings, + h6: headings + }; + + const validateHtmlNesting = (node, context) => { + if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { + const error = new SyntaxError( + `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` + ); + error.loc = node.loc; + context.onWarn(error); + } + }; + + const DOMNodeTransforms = [ + transformStyle, + ...[transformTransition, validateHtmlNesting] + ]; + const DOMDirectiveTransforms = { + cloak: noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow + }; + function compile(src, options = {}) { + return baseCompile( + src, + extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: null + }) + ); + } + function parse(template, options = {}) { + return baseParse(template, extend({}, parserOptions, options)); + } + + exports.BASE_TRANSITION = BASE_TRANSITION; + exports.BindingTypes = BindingTypes; + exports.CAMELIZE = CAMELIZE; + exports.CAPITALIZE = CAPITALIZE; + exports.CREATE_BLOCK = CREATE_BLOCK; + exports.CREATE_COMMENT = CREATE_COMMENT; + exports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK; + exports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE; + exports.CREATE_SLOTS = CREATE_SLOTS; + exports.CREATE_STATIC = CREATE_STATIC; + exports.CREATE_TEXT = CREATE_TEXT; + exports.CREATE_VNODE = CREATE_VNODE; + exports.CompilerDeprecationTypes = CompilerDeprecationTypes; + exports.ConstantTypes = ConstantTypes; + exports.DOMDirectiveTransforms = DOMDirectiveTransforms; + exports.DOMErrorCodes = DOMErrorCodes; + exports.DOMErrorMessages = DOMErrorMessages; + exports.DOMNodeTransforms = DOMNodeTransforms; + exports.ElementTypes = ElementTypes; + exports.ErrorCodes = ErrorCodes; + exports.FRAGMENT = FRAGMENT; + exports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS; + exports.IS_MEMO_SAME = IS_MEMO_SAME; + exports.IS_REF = IS_REF; + exports.KEEP_ALIVE = KEEP_ALIVE; + exports.MERGE_PROPS = MERGE_PROPS; + exports.NORMALIZE_CLASS = NORMALIZE_CLASS; + exports.NORMALIZE_PROPS = NORMALIZE_PROPS; + exports.NORMALIZE_STYLE = NORMALIZE_STYLE; + exports.Namespaces = Namespaces; + exports.NodeTypes = NodeTypes; + exports.OPEN_BLOCK = OPEN_BLOCK; + exports.POP_SCOPE_ID = POP_SCOPE_ID; + exports.PUSH_SCOPE_ID = PUSH_SCOPE_ID; + exports.RENDER_LIST = RENDER_LIST; + exports.RENDER_SLOT = RENDER_SLOT; + exports.RESOLVE_COMPONENT = RESOLVE_COMPONENT; + exports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE; + exports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT; + exports.RESOLVE_FILTER = RESOLVE_FILTER; + exports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING; + exports.SUSPENSE = SUSPENSE; + exports.TELEPORT = TELEPORT; + exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING; + exports.TO_HANDLERS = TO_HANDLERS; + exports.TO_HANDLER_KEY = TO_HANDLER_KEY; + exports.TRANSITION = TRANSITION; + exports.TRANSITION_GROUP = TRANSITION_GROUP; + exports.TS_NODE_TYPES = TS_NODE_TYPES; + exports.UNREF = UNREF; + exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX; + exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC; + exports.V_MODEL_RADIO = V_MODEL_RADIO; + exports.V_MODEL_SELECT = V_MODEL_SELECT; + exports.V_MODEL_TEXT = V_MODEL_TEXT; + exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS; + exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS; + exports.V_SHOW = V_SHOW; + exports.WITH_CTX = WITH_CTX; + exports.WITH_DIRECTIVES = WITH_DIRECTIVES; + exports.WITH_MEMO = WITH_MEMO; + exports.advancePositionWithClone = advancePositionWithClone; + exports.advancePositionWithMutation = advancePositionWithMutation; + exports.assert = assert; + exports.baseCompile = baseCompile; + exports.baseParse = baseParse; + exports.buildDirectiveArgs = buildDirectiveArgs; + exports.buildProps = buildProps; + exports.buildSlots = buildSlots; + exports.checkCompatEnabled = checkCompatEnabled; + exports.compile = compile; + exports.convertToBlock = convertToBlock; + exports.createArrayExpression = createArrayExpression; + exports.createAssignmentExpression = createAssignmentExpression; + exports.createBlockStatement = createBlockStatement; + exports.createCacheExpression = createCacheExpression; + exports.createCallExpression = createCallExpression; + exports.createCompilerError = createCompilerError; + exports.createCompoundExpression = createCompoundExpression; + exports.createConditionalExpression = createConditionalExpression; + exports.createDOMCompilerError = createDOMCompilerError; + exports.createForLoopParams = createForLoopParams; + exports.createFunctionExpression = createFunctionExpression; + exports.createIfStatement = createIfStatement; + exports.createInterpolation = createInterpolation; + exports.createObjectExpression = createObjectExpression; + exports.createObjectProperty = createObjectProperty; + exports.createReturnStatement = createReturnStatement; + exports.createRoot = createRoot; + exports.createSequenceExpression = createSequenceExpression; + exports.createSimpleExpression = createSimpleExpression; + exports.createStructuralDirectiveTransform = createStructuralDirectiveTransform; + exports.createTemplateLiteral = createTemplateLiteral; + exports.createTransformContext = createTransformContext; + exports.createVNodeCall = createVNodeCall; + exports.errorMessages = errorMessages; + exports.extractIdentifiers = extractIdentifiers; + exports.findDir = findDir; + exports.findProp = findProp; + exports.forAliasRE = forAliasRE; + exports.generate = generate; + exports.generateCodeFrame = generateCodeFrame; + exports.getBaseTransformPreset = getBaseTransformPreset; + exports.getConstantType = getConstantType; + exports.getMemoedVNodeCall = getMemoedVNodeCall; + exports.getVNodeBlockHelper = getVNodeBlockHelper; + exports.getVNodeHelper = getVNodeHelper; + exports.hasDynamicKeyVBind = hasDynamicKeyVBind; + exports.hasScopeRef = hasScopeRef; + exports.helperNameMap = helperNameMap; + exports.injectProp = injectProp; + exports.isCoreComponent = isCoreComponent; + exports.isFnExpression = isFnExpression; + exports.isFnExpressionBrowser = isFnExpressionBrowser; + exports.isFnExpressionNode = isFnExpressionNode; + exports.isFunctionType = isFunctionType; + exports.isInDestructureAssignment = isInDestructureAssignment; + exports.isInNewExpression = isInNewExpression; + exports.isMemberExpression = isMemberExpression; + exports.isMemberExpressionBrowser = isMemberExpressionBrowser; + exports.isMemberExpressionNode = isMemberExpressionNode; + exports.isReferencedIdentifier = isReferencedIdentifier; + exports.isSimpleIdentifier = isSimpleIdentifier; + exports.isSlotOutlet = isSlotOutlet; + exports.isStaticArgOf = isStaticArgOf; + exports.isStaticExp = isStaticExp; + exports.isStaticProperty = isStaticProperty; + exports.isStaticPropertyKey = isStaticPropertyKey; + exports.isTemplateNode = isTemplateNode; + exports.isText = isText$1; + exports.isVSlot = isVSlot; + exports.locStub = locStub; + exports.noopDirectiveTransform = noopDirectiveTransform; + exports.parse = parse; + exports.parserOptions = parserOptions; + exports.processExpression = processExpression; + exports.processFor = processFor; + exports.processIf = processIf; + exports.processSlotOutlet = processSlotOutlet; + exports.registerRuntimeHelpers = registerRuntimeHelpers; + exports.resolveComponentType = resolveComponentType; + exports.stringifyExpression = stringifyExpression; + exports.toValidAssetId = toValidAssetId; + exports.trackSlotScopes = trackSlotScopes; + exports.trackVForSlotScopes = trackVForSlotScopes; + exports.transform = transform; + exports.transformBind = transformBind; + exports.transformElement = transformElement; + exports.transformExpression = transformExpression; + exports.transformModel = transformModel$1; + exports.transformOn = transformOn$1; + exports.transformStyle = transformStyle; + exports.traverseNode = traverseNode; + exports.unwrapTSNode = unwrapTSNode; + exports.walkBlockDeclarations = walkBlockDeclarations; + exports.walkFunctionParams = walkFunctionParams; + exports.walkIdentifiers = walkIdentifiers; + exports.warnDeprecation = warnDeprecation; + + return exports; + +})({}); diff --git a/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js new file mode 100644 index 0000000..6386167 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js @@ -0,0 +1,11 @@ +/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/var VueCompilerDOM=function(e){"use strict";let t;function n(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let i={},s=()=>{},r=()=>!1,o=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),a=Object.assign,l=Array.isArray,c=e=>"string"==typeof e,h=e=>"symbol"==typeof e,p=e=>null!==e&&"object"==typeof e,d=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),u=n("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),f=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},E=/-(\w)/g,_=f(e=>e.replace(E,(e,t)=>t?t.toUpperCase():"")),m=f(e=>e.charAt(0).toUpperCase()+e.slice(1)),S=f(e=>e?`on${m(e)}`:""),g=/;(?![^(]*\))/g,T=/:([^]+)/,N=/\/\*[^]*?\*\//g,I=n("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),y=n("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),O=n("annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"),A=n("area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"),C=Symbol(""),b=Symbol(""),R=Symbol(""),v=Symbol(""),x=Symbol(""),L=Symbol(""),M=Symbol(""),D=Symbol(""),P=Symbol(""),V=Symbol(""),k=Symbol(""),X=Symbol(""),w=Symbol(""),U=Symbol(""),F=Symbol(""),B=Symbol(""),$=Symbol(""),H=Symbol(""),G=Symbol(""),q=Symbol(""),J=Symbol(""),j=Symbol(""),W=Symbol(""),K=Symbol(""),Y=Symbol(""),Q=Symbol(""),z=Symbol(""),Z=Symbol(""),ee=Symbol(""),et=Symbol(""),en=Symbol(""),ei=Symbol(""),es=Symbol(""),er=Symbol(""),eo=Symbol(""),ea=Symbol(""),el=Symbol(""),ec=Symbol(""),eh=Symbol(""),ep={[C]:"Fragment",[b]:"Teleport",[R]:"Suspense",[v]:"KeepAlive",[x]:"BaseTransition",[L]:"openBlock",[M]:"createBlock",[D]:"createElementBlock",[P]:"createVNode",[V]:"createElementVNode",[k]:"createCommentVNode",[X]:"createTextVNode",[w]:"createStaticVNode",[U]:"resolveComponent",[F]:"resolveDynamicComponent",[B]:"resolveDirective",[$]:"resolveFilter",[H]:"withDirectives",[G]:"renderList",[q]:"renderSlot",[J]:"createSlots",[j]:"toDisplayString",[W]:"mergeProps",[K]:"normalizeClass",[Y]:"normalizeStyle",[Q]:"normalizeProps",[z]:"guardReactiveProps",[Z]:"toHandlers",[ee]:"camelize",[et]:"capitalize",[en]:"toHandlerKey",[ei]:"setBlockTracking",[es]:"pushScopeId",[er]:"popScopeId",[eo]:"withCtx",[ea]:"unref",[el]:"isRef",[ec]:"withMemo",[eh]:"isMemoSame"};function ed(e){Object.getOwnPropertySymbols(e).forEach(t=>{ep[t]=e[t]})}let eu={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function ef(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:eu}}function eE(e,t,n,i,s,r,o,a=!1,l=!1,c=!1,h=eu){return e&&(a?(e.helper(L),e.helper(eb(e.inSSR,c))):e.helper(eC(e.inSSR,c)),o&&e.helper(H)),{type:13,tag:t,props:n,children:i,patchFlag:s,dynamicProps:r,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:h}}function e_(e,t=eu){return{type:17,loc:t,elements:e}}function em(e,t=eu){return{type:15,loc:t,properties:e}}function eS(e,t){return{type:16,loc:eu,key:c(e)?eg(e,!0):e,value:t}}function eg(e,t=!1,n=eu,i=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:i}}function eT(e,t=eu){return{type:8,loc:t,children:e}}function eN(e,t=[],n=eu){return{type:14,loc:n,callee:e,arguments:t}}function eI(e,t,n=!1,i=!1,s=eu){return{type:18,params:e,returns:t,newline:n,isSlot:i,loc:s}}function ey(e,t,n,i=!0){return{type:19,test:e,consequent:t,alternate:n,newline:i,loc:eu}}function eO(e,t,n=!1,i=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:i,needArraySpread:!1,loc:eu}}function eA(e){return{type:21,body:e,loc:eu}}function eC(e,t){return e||t?P:V}function eb(e,t){return e||t?M:D}function eR(e,{helper:t,removeHelper:n,inSSR:i}){e.isBlock||(e.isBlock=!0,n(eC(i,e.isComponent)),t(L),t(eb(i,e.isComponent)))}let ev=new Uint8Array([123,123]),ex=new Uint8Array([125,125]);function eL(e){return e>=97&&e<=122||e>=65&&e<=90}function eM(e){return 32===e||10===e||9===e||12===e||13===e}function eD(e){return 47===e||62===e||eM(e)}function eP(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}let eV={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])},ek={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function eX(e,{compatConfig:t}){let n=t&&t[e];return"MODE"===e?n||3:n}function ew(e,t){let n=eX("MODE",t),i=eX(e,t);return 3===n?!0===i:!1!==i}function eU(e,t,n,...i){return ew(e,t)}function eF(e){throw e}function eB(e){}function e$(e,t,n,i){let s=SyntaxError(String(`https://vuejs.org/error-reference/#compiler-${e}`));return s.code=e,s.loc=t,s}let eH={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '<' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:"Attribute name cannot contain U+0022 (\"), U+0027 ('), and U+003C (<).",18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",52:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""};function eG(e,t=[]){switch(e.type){case"Identifier":t.push(e);break;case"MemberExpression":let n=e;for(;"MemberExpression"===n.type;)n=n.object;t.push(n);break;case"ObjectPattern":for(let n of e.properties)"RestElement"===n.type?eG(n.argument,t):eG(n.value,t);break;case"ArrayPattern":e.elements.forEach(e=>{e&&eG(e,t)});break;case"RestElement":eG(e.argument,t);break;case"AssignmentPattern":eG(e.left,t)}return t}let eq=e=>e&&("ObjectProperty"===e.type||"ObjectMethod"===e.type)&&!e.computed,eJ=["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"],ej=e=>4===e.type&&e.isStatic;function eW(e){switch(e){case"Teleport":case"teleport":return b;case"Suspense":case"suspense":return R;case"KeepAlive":case"keep-alive":return v;case"BaseTransition":case"base-transition":return x}}let eK=/^\d|[^\$\w\xA0-\uFFFF]/,eY=e=>!eK.test(e),eQ=/[A-Za-z_$\xA0-\uFFFF]/,ez=/[\.\?\w$\xA0-\uFFFF]/,eZ=/\s+[.[]\s*|\s*[.[]\s+/g,e1=e=>4===e.type?e.content:e.loc.source,e0=e=>{let t=e1(e).trim().replace(eZ,e=>e.trim()),n=0,i=[],s=0,r=0,o=null;for(let e=0;e<t.length;e++){let a=t.charAt(e);switch(n){case 0:if("["===a)i.push(n),n=1,s++;else if("("===a)i.push(n),n=2,r++;else if(!(0===e?eQ:ez).test(a))return!1;break;case 1:"'"===a||'"'===a||"`"===a?(i.push(n),n=3,o=a):"["===a?s++:"]"!==a||--s||(n=i.pop());break;case 2:if("'"===a||'"'===a||"`"===a)i.push(n),n=3,o=a;else if("("===a)r++;else if(")"===a){if(e===t.length-1)return!1;--r||(n=i.pop())}break;case 3:a===o&&(n=i.pop(),o=null)}}return!s&&!r},e2=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,e3=e=>e2.test(e1(e));function e4(e,t,n=t.length){let i=0,s=-1;for(let e=0;e<n;e++)10===t.charCodeAt(e)&&(i++,s=e);return e.offset+=n,e.line+=i,e.column=-1===s?e.column+n:n-s,e}function e6(e,t,n=!1){for(let i=0;i<e.props.length;i++){let s=e.props[i];if(7===s.type&&(n||s.exp)&&(c(t)?s.name===t:t.test(s.name)))return s}}function e5(e,t,n=!1,i=!1){for(let s=0;s<e.props.length;s++){let r=e.props[s];if(6===r.type){if(n)continue;if(r.name===t&&(r.value||i))return r}else if("bind"===r.name&&(r.exp||i)&&e9(r.arg,t))return r}}function e9(e,t){return!!(e&&ej(e)&&e.content===t)}function e7(e){return e.props.some(e=>7===e.type&&"bind"===e.name&&(!e.arg||4!==e.arg.type||!e.arg.isStatic))}function e8(e){return 5===e.type||2===e.type}function te(e){return 7===e.type&&"slot"===e.name}function tt(e){return 1===e.type&&3===e.tagType}function tn(e){return 1===e.type&&2===e.tagType}let ti=new Set([Q,z]);function ts(e,t,n){let i,s;let r=13===e.type?e.props:e.arguments[2],o=[];if(r&&!c(r)&&14===r.type){let e=function e(t,n=[]){if(t&&!c(t)&&14===t.type){let i=t.callee;if(!c(i)&&ti.has(i))return e(t.arguments[0],n.concat(t))}return[t,n]}(r);r=e[0],s=(o=e[1])[o.length-1]}if(null==r||c(r))i=em([t]);else if(14===r.type){let e=r.arguments[0];c(e)||15!==e.type?r.callee===Z?i=eN(n.helper(W),[em([t]),r]):r.arguments.unshift(em([t])):tr(t,e)||e.properties.unshift(t),i||(i=r)}else 15===r.type?(tr(t,r)||r.properties.unshift(t),i=r):(i=eN(n.helper(W),[em([t]),r]),s&&s.callee===z&&(s=o[o.length-2]));13===e.type?s?s.arguments[0]=i:e.props=i:s?s.arguments[0]=i:e.arguments[2]=i}function tr(e,t){let n=!1;if(4===e.key.type){let i=e.key.content;n=t.properties.some(e=>4===e.key.type&&e.key.content===i)}return n}function to(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}function ta(e){return 14===e.type&&e.callee===ec?e.arguments[1].returns:e}let tl=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,tc={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:r,isPreTag:r,isIgnoreNewlineTag:r,isCustomElement:r,onError:eF,onWarn:eB,comments:!1,prefixIdentifiers:!1},th=tc,tp=null,td="",tu=null,tf=null,tE="",t_=-1,tm=-1,tS=0,tg=!1,tT=null,tN=[],tI=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=ev,this.delimiterClose=ex,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=ev,this.delimiterClose=ex}getPos(e){let t=1,n=e+1;for(let i=this.newlines.length-1;i>=0;i--){let s=this.newlines[i];if(e>s){t=i+2,n=e-s;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex]){if(this.delimiterIndex===this.delimiterOpen.length-1){let e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++}else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(t?eD(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t){this.sequenceIndex++;return}}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||eM(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.sectionStart=t+2,this.stateInClosingTagName(e),this.inRCDATA=!1;return}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence!==eV.TitleEnd&&(this.currentSequence!==eV.TextareaEnd||this.inSFCRoot)?this.fastForwardTo(60)&&(this.sequenceIndex=1):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e)):this.sequenceIndex=Number(60===e)}stateCDATASequence(e){e===eV.Cdata[this.sequenceIndex]?++this.sequenceIndex===eV.Cdata.length&&(this.state=28,this.currentSequence=eV.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length;){let t=this.buffer.charCodeAt(this.index);if(10===t&&this.newlines.push(this.index),t===e)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===eV.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(e,t){this.enterRCDATA(e,t),this.state=31}enterRCDATA(e,t){this.inRCDATA=!0,this.currentSequence=e,this.sequenceIndex=t}stateBeforeTagName(e){33===e?(this.state=22,this.sectionStart=this.index+1):63===e?(this.state=24,this.sectionStart=this.index+1):eL(e)?(this.sectionStart=this.index,0===this.mode?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:116===e?this.state=30:this.state=115===e?29:6):47===e?this.state=8:(this.state=1,this.stateText(e))}stateInTagName(e){eD(e)&&this.handleTagName(e)}stateInSFCRootTagName(e){if(eD(e)){let t=this.buffer.slice(this.sectionStart,this.index);"template"!==t&&this.enterRCDATA(eP("</"+t),0),this.handleTagName(e)}}handleTagName(e){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)}stateBeforeClosingTagName(e){eM(e)||(62===e?(this.state=1,this.sectionStart=this.index+1):(this.state=eL(e)?9:27,this.sectionStart=this.index))}stateInClosingTagName(e){(62===e||eM(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){62===e&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(e){62===e?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):47===e?this.state=7:60===e&&47===this.peek()?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):eM(e)||this.handleAttrStart(e)}handleAttrStart(e){118===e&&45===this.peek()?(this.state=13,this.sectionStart=this.index):46===e||58===e||64===e||35===e?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(e){62===e?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):eM(e)||(this.state=11,this.stateBeforeAttrName(e))}stateInAttrName(e){(61===e||eD(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(e))}stateInDirName(e){61===e||eD(e)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(e)):58===e?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):46===e&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(e){61===e||eD(e)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(e)):91===e?this.state=15:46===e&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(e){93===e?this.state=14:(61===e||eD(e))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(e))}stateInDirModifier(e){61===e||eD(e)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(e)):46===e&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(e){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(e)}stateAfterAttrName(e){61===e?this.state=18:47===e||62===e?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)):eM(e)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(e))}stateBeforeAttrValue(e){34===e?(this.state=19,this.sectionStart=this.index+1):39===e?(this.state=20,this.sectionStart=this.index+1):eM(e)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(e))}handleInAttrValue(e,t){(e===t||this.fastForwardTo(t))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(34===t?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(e){this.handleInAttrValue(e,34)}stateInAttrValueSingleQuotes(e){this.handleInAttrValue(e,39)}stateInAttrValueNoQuotes(e){eM(e)||62===e?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(e)):(39===e||60===e||61===e||96===e)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(e){91===e?(this.state=26,this.sequenceIndex=0):this.state=45===e?25:23}stateInDeclaration(e){(62===e||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(62===e||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(e){45===e?(this.state=28,this.currentSequence=eV.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(e){(62===e||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){e===eV.ScriptEnd[3]?this.startSpecial(eV.ScriptEnd,4):e===eV.StyleEnd[3]?this.startSpecial(eV.StyleEnd,4):(this.state=6,this.stateInTagName(e))}stateBeforeSpecialT(e){e===eV.TitleEnd[3]?this.startSpecial(eV.TitleEnd,4):e===eV.TextareaEnd[3]?this.startSpecial(eV.TextareaEnd,4):(this.state=6,this.stateInTagName(e))}startEntity(){}stateInEntity(){}parse(e){for(this.buffer=e;this.index<this.buffer.length;){let e=this.buffer.charCodeAt(this.index);switch(10===e&&this.newlines.push(this.index),this.state){case 1:this.stateText(e);break;case 2:this.stateInterpolationOpen(e);break;case 3:this.stateInterpolation(e);break;case 4:this.stateInterpolationClose(e);break;case 31:this.stateSpecialStartSequence(e);break;case 32:this.stateInRCDATA(e);break;case 26:this.stateCDATASequence(e);break;case 19:this.stateInAttrValueDoubleQuotes(e);break;case 12:this.stateInAttrName(e);break;case 13:this.stateInDirName(e);break;case 14:this.stateInDirArg(e);break;case 15:this.stateInDynamicDirArg(e);break;case 16:this.stateInDirModifier(e);break;case 28:this.stateInCommentLike(e);break;case 27:this.stateInSpecialComment(e);break;case 11:this.stateBeforeAttrName(e);break;case 6:this.stateInTagName(e);break;case 34:this.stateInSFCRootTagName(e);break;case 9:this.stateInClosingTagName(e);break;case 5:this.stateBeforeTagName(e);break;case 17:this.stateAfterAttrName(e);break;case 20:this.stateInAttrValueSingleQuotes(e);break;case 18:this.stateBeforeAttrValue(e);break;case 8:this.stateBeforeClosingTagName(e);break;case 10:this.stateAfterClosingTagName(e);break;case 29:this.stateBeforeSpecialS(e);break;case 30:this.stateBeforeSpecialT(e);break;case 21:this.stateInAttrValueNoQuotes(e);break;case 7:this.stateInSelfClosingTag(e);break;case 23:this.stateInDeclaration(e);break;case 22:this.stateBeforeDeclaration(e);break;case 25:this.stateBeforeComment(e);break;case 24:this.stateInProcessingInstruction(e);break;case 33:this.stateInEntity()}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(1===this.state||32===this.state&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(19===this.state||20===this.state||21===this.state)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let e=this.buffer.length;this.sectionStart>=e||(28===this.state?this.currentSequence===eV.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(tN,{onerr:tU,ontext(e,t){tb(tA(e,t),e,t)},ontextentity(e,t,n){tb(e,t,n)},oninterpolation(e,t){if(tg)return tb(tA(e,t),e,t);let n=e+tI.delimiterOpen.length,i=t-tI.delimiterClose.length;for(;eM(td.charCodeAt(n));)n++;for(;eM(td.charCodeAt(i-1));)i--;let s=tA(n,i);s.includes("&")&&(s=th.decodeEntities(s,!1)),tV({type:5,content:tw(s,!1,tk(n,i)),loc:tk(e,t)})},onopentagname(e,t){let n=tA(e,t);tu={type:1,tag:n,ns:th.getNamespace(n,tN[0],th.ns),tagType:0,props:[],children:[],loc:tk(e-1,t),codegenNode:void 0}},onopentagend(e){tC(e)},onclosetag(e,t){let n=tA(e,t);if(!th.isVoidTag(n)){let i=!1;for(let e=0;e<tN.length;e++)if(tN[e].tag.toLowerCase()===n.toLowerCase()){i=!0,e>0&&tN[0].loc.start.offset;for(let n=0;n<=e;n++)tR(tN.shift(),t,n<e);break}i||tv(e,60)}},onselfclosingtag(e){let t=tu.tag;tu.isSelfClosing=!0,tC(e),tN[0]&&tN[0].tag===t&&tR(tN.shift(),e)},onattribname(e,t){tf={type:6,name:tA(e,t),nameLoc:tk(e,t),value:void 0,loc:tk(e)}},ondirname(e,t){let n=tA(e,t),i="."===n||":"===n?"bind":"@"===n?"on":"#"===n?"slot":n.slice(2);if(tg||""===i)tf={type:6,name:n,nameLoc:tk(e,t),value:void 0,loc:tk(e)};else if(tf={type:7,name:i,rawName:n,exp:void 0,arg:void 0,modifiers:"."===n?[eg("prop")]:[],loc:tk(e)},"pre"===i){tg=tI.inVPre=!0,tT=tu;let e=tu.props;for(let t=0;t<e.length;t++)7===e[t].type&&(e[t]=function(e){let t={type:6,name:e.rawName,nameLoc:tk(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){let n=e.exp.loc;n.end.offset<e.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:e.exp.content,loc:n}}return t}(e[t]))}},ondirarg(e,t){if(e===t)return;let n=tA(e,t);if(tg)tf.name+=n,tX(tf.nameLoc,t);else{let i="["!==n[0];tf.arg=tw(i?n:n.slice(1,-1),i,tk(e,t),i?3:0)}},ondirmodifier(e,t){let n=tA(e,t);if(tg)tf.name+="."+n,tX(tf.nameLoc,t);else if("slot"===tf.name){let e=tf.arg;e&&(e.content+="."+n,tX(e.loc,t))}else{let i=eg(n,!0,tk(e,t));tf.modifiers.push(i)}},onattribdata(e,t){tE+=tA(e,t),t_<0&&(t_=e),tm=t},onattribentity(e,t,n){tE+=e,t_<0&&(t_=t),tm=n},onattribnameend(e){let t=tA(tf.loc.start.offset,e);7===tf.type&&(tf.rawName=t),tu.props.some(e=>(7===e.type?e.rawName:e.name)===t)},onattribend(e,t){if(tu&&tf){if(tX(tf.loc,t),0!==e){if(tE.includes("&")&&(tE=th.decodeEntities(tE,!0)),6===tf.type)"class"===tf.name&&(tE=tP(tE).trim()),tf.value={type:2,content:tE,loc:1===e?tk(t_,tm):tk(t_-1,tm+1)},tI.inSFCRoot&&"template"===tu.tag&&"lang"===tf.name&&tE&&"html"!==tE&&tI.enterRCDATA(eP("</template"),0);else{tf.exp=tw(tE,!1,tk(t_,tm),0,0),"for"===tf.name&&(tf.forParseResult=function(e){let t=e.loc,n=e.content,i=n.match(tl);if(!i)return;let[,s,r]=i,o=(e,n,i=!1)=>{let s=t.start.offset+n,r=s+e.length;return tw(e,!1,tk(s,r),0,i?1:0)},a={source:o(r.trim(),n.indexOf(r,s.length)),value:void 0,key:void 0,index:void 0,finalized:!1},l=s.trim().replace(tO,"").trim(),c=s.indexOf(l),h=l.match(ty);if(h){let e;l=l.replace(ty,"").trim();let t=h[1].trim();if(t&&(e=n.indexOf(t,c+l.length),a.key=o(t,e,!0)),h[2]){let i=h[2].trim();i&&(a.index=o(i,n.indexOf(i,a.key?e+t.length:c+l.length),!0))}}return l&&(a.value=o(l,c,!0)),a}(tf.exp));let e=-1;"bind"===tf.name&&(e=tf.modifiers.findIndex(e=>"sync"===e.content))>-1&&eU("COMPILER_V_BIND_SYNC",th,tf.loc,tf.rawName)&&(tf.name="model",tf.modifiers.splice(e,1))}}(7!==tf.type||"pre"!==tf.name)&&tu.props.push(tf)}tE="",t_=tm=-1},oncomment(e,t){th.comments&&tV({type:3,content:tA(e,t),loc:tk(e-4,t+3)})},onend(){let e=td.length;for(let t=0;t<tN.length;t++)tR(tN[t],e-1),tN[t].loc.start.offset},oncdata(e,t){0!==tN[0].ns&&tb(tA(e,t),e,t)},onprocessinginstruction(e){(tN[0]?tN[0].ns:th.ns)===0&&tU(21,e-1)}}),ty=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,tO=/^\(|\)$/g;function tA(e,t){return td.slice(e,t)}function tC(e){tI.inSFCRoot&&(tu.innerLoc=tk(e+1,e+1)),tV(tu);let{tag:t,ns:n}=tu;0===n&&th.isPreTag(t)&&tS++,th.isVoidTag(t)?tR(tu,e):(tN.unshift(tu),(1===n||2===n)&&(tI.inXML=!0)),tu=null}function tb(e,t,n){{let t=tN[0]&&tN[0].tag;"script"!==t&&"style"!==t&&e.includes("&")&&(e=th.decodeEntities(e,!1))}let i=tN[0]||tp,s=i.children[i.children.length-1];s&&2===s.type?(s.content+=e,tX(s.loc,n)):i.children.push({type:2,content:e,loc:tk(t,n)})}function tR(e,t,n=!1){n?tX(e.loc,tv(t,60)):tX(e.loc,function(e,t){let n=e;for(;62!==td.charCodeAt(n)&&n<td.length-1;)n++;return n}(t,0)+1),tI.inSFCRoot&&(e.children.length?e.innerLoc.end=a({},e.children[e.children.length-1].loc.end):e.innerLoc.end=a({},e.innerLoc.start),e.innerLoc.source=tA(e.innerLoc.start.offset,e.innerLoc.end.offset));let{tag:i,ns:s,children:r}=e;if(!tg&&("slot"===i?e.tagType=2:tL(e)?e.tagType=3:function({tag:e,props:t}){var n;if(th.isCustomElement(e))return!1;if("component"===e||(n=e.charCodeAt(0))>64&&n<91||eW(e)||th.isBuiltInComponent&&th.isBuiltInComponent(e)||th.isNativeTag&&!th.isNativeTag(e))return!0;for(let e=0;e<t.length;e++){let n=t[e];if(6===n.type){if("is"===n.name&&n.value&&(n.value.content.startsWith("vue:")||eU("COMPILER_IS_ON_ELEMENT",th,n.loc)))return!0}else if("bind"===n.name&&e9(n.arg,"is")&&eU("COMPILER_IS_ON_ELEMENT",th,n.loc))return!0}return!1}(e)&&(e.tagType=1)),tI.inRCDATA||(e.children=tD(r)),0===s&&th.isIgnoreNewlineTag(i)){let e=r[0];e&&2===e.type&&(e.content=e.content.replace(/^\r?\n/,""))}0===s&&th.isPreTag(i)&&tS--,tT===e&&(tg=tI.inVPre=!1,tT=null),tI.inXML&&(tN[0]?tN[0].ns:th.ns)===0&&(tI.inXML=!1);{let t=e.props;if(!tI.inSFCRoot&&ew("COMPILER_NATIVE_TEMPLATE",th)&&"template"===e.tag&&!tL(e)){let t=tN[0]||tp,n=t.children.indexOf(e);t.children.splice(n,1,...e.children)}let n=t.find(e=>6===e.type&&"inline-template"===e.name);n&&eU("COMPILER_INLINE_TEMPLATE",th,n.loc)&&e.children.length&&(n.value={type:2,content:tA(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function tv(e,t){let n=e;for(;td.charCodeAt(n)!==t&&n>=0;)n--;return n}let tx=new Set(["if","else","else-if","for","slot"]);function tL({tag:e,props:t}){if("template"===e){for(let e=0;e<t.length;e++)if(7===t[e].type&&tx.has(t[e].name))return!0}return!1}let tM=/\r\n/g;function tD(e,t){let n="preserve"!==th.whitespace,i=!1;for(let t=0;t<e.length;t++){let s=e[t];if(2===s.type){if(tS)s.content=s.content.replace(tM,"\n");else if(function(e){for(let t=0;t<e.length;t++)if(!eM(e.charCodeAt(t)))return!1;return!0}(s.content)){let r=e[t-1]&&e[t-1].type,o=e[t+1]&&e[t+1].type;!r||!o||n&&(3===r&&(3===o||1===o)||1===r&&(3===o||1===o&&function(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(10===n||13===n)return!0}return!1}(s.content)))?(i=!0,e[t]=null):s.content=" "}else n&&(s.content=tP(s.content))}}return i?e.filter(Boolean):e}function tP(e){let t="",n=!1;for(let i=0;i<e.length;i++)eM(e.charCodeAt(i))?n||(t+=" ",n=!0):(t+=e[i],n=!1);return t}function tV(e){(tN[0]||tp).children.push(e)}function tk(e,t){return{start:tI.getPos(e),end:null==t?t:tI.getPos(t),source:null==t?t:tA(e,t)}}function tX(e,t){e.end=tI.getPos(t),e.source=tA(e.start.offset,t)}function tw(e,t=!1,n,i=0,s=0){return eg(e,t,n,i)}function tU(e,t,n){th.onError(e$(e,tk(t,t)))}function tF(e,t){if(tI.reset(),tu=null,tf=null,tE="",t_=-1,tm=-1,tN.length=0,td=e,th=a({},tc),t){let e;for(e in t)null!=t[e]&&(th[e]=t[e])}tI.mode="html"===th.parseMode?1:"sfc"===th.parseMode?2:0,tI.inXML=1===th.ns||2===th.ns;let n=t&&t.delimiters;n&&(tI.delimiterOpen=eP(n[0]),tI.delimiterClose=eP(n[1]));let i=tp=ef([],e);return tI.parse(td),i.loc=tk(0,e.length),i.children=tD(i.children),tp=null,i}function tB(e,t){let{children:n}=e;return 1===n.length&&1===t.type&&!tn(t)}function t$(e,t){let{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;let i=n.get(e);if(void 0!==i)return i;let s=e.codegenNode;if(13!==s.type||s.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0!==s.patchFlag)return n.set(e,0),0;{let i=3,r=tG(e,t);if(0===r)return n.set(e,0),0;r<i&&(i=r);for(let s=0;s<e.children.length;s++){let r=t$(e.children[s],t);if(0===r)return n.set(e,0),0;r<i&&(i=r)}if(i>1)for(let s=0;s<e.props.length;s++){let r=e.props[s];if(7===r.type&&"bind"===r.name&&r.exp){let s=t$(r.exp,t);if(0===s)return n.set(e,0),0;s<i&&(i=s)}}if(s.isBlock){for(let t=0;t<e.props.length;t++)if(7===e.props[t].type)return n.set(e,0),0;t.removeHelper(L),t.removeHelper(eb(t.inSSR,s.isComponent)),s.isBlock=!1,t.helper(eC(t.inSSR,s.isComponent))}return n.set(e,i),i}case 2:case 3:return 3;case 9:case 11:case 10:default:return 0;case 5:case 12:return t$(e.content,t);case 4:return e.constType;case 8:let r=3;for(let n=0;n<e.children.length;n++){let i=e.children[n];if(c(i)||h(i))continue;let s=t$(i,t);if(0===s)return 0;s<r&&(r=s)}return r;case 20:return 2}}let tH=new Set([K,Y,Q,z]);function tG(e,t){let n=3,i=tq(e);if(i&&15===i.type){let{properties:e}=i;for(let i=0;i<e.length;i++){let s;let{key:r,value:o}=e[i],a=t$(r,t);if(0===a)return a;if(a<n&&(n=a),0===(s=4===o.type?t$(o,t):14===o.type?function e(t,n){if(14===t.type&&!c(t.callee)&&tH.has(t.callee)){let i=t.arguments[0];if(4===i.type)return t$(i,n);if(14===i.type)return e(i,n)}return 0}(o,t):0))return s;s<n&&(n=s)}}return n}function tq(e){let t=e.codegenNode;if(13===t.type)return t.props}function tJ(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:r=!1,hmr:o=!1,cacheHandlers:a=!1,nodeTransforms:l=[],directiveTransforms:h={},transformHoist:p=null,isBuiltInComponent:d=s,isCustomElement:u=s,expressionPlugins:f=[],scopeId:E=null,slotted:S=!0,ssr:g=!1,inSSR:T=!1,ssrCssVars:N="",bindingMetadata:I=i,inline:y=!1,isTS:O=!1,onError:A=eF,onWarn:C=eB,compatConfig:b}){let R=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),v={filename:t,selfName:R&&m(_(R[1])),prefixIdentifiers:n,hoistStatic:r,hmr:o,cacheHandlers:a,nodeTransforms:l,directiveTransforms:h,transformHoist:p,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:f,scopeId:E,slotted:S,ssr:g,inSSR:T,ssrCssVars:N,bindingMetadata:I,inline:y,isTS:O,onError:A,onWarn:C,compatConfig:b,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){let t=v.helpers.get(e)||0;return v.helpers.set(e,t+1),e},removeHelper(e){let t=v.helpers.get(e);if(t){let n=t-1;n?v.helpers.set(e,n):v.helpers.delete(e)}},helperString:e=>`_${ep[v.helper(e)]}`,replaceNode(e){v.parent.children[v.childIndex]=v.currentNode=e},removeNode(e){let t=v.parent.children,n=e?t.indexOf(e):v.currentNode?v.childIndex:-1;e&&e!==v.currentNode?v.childIndex>n&&(v.childIndex--,v.onNodeRemoved()):(v.currentNode=null,v.onNodeRemoved()),v.parent.children.splice(n,1)},onNodeRemoved:s,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){c(e)&&(e=eg(e)),v.hoists.push(e);let t=eg(`_hoisted_${v.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){let i=eO(v.cached.length,e,t,n);return v.cached.push(i),i}};return v.filters=new Set,v}function tj(e,t){let n=tJ(e,t);tW(e,n),t.hoistStatic&&!function e(t,n,i,s=!1,r=!1){let{children:o}=t,a=[];for(let n=0;n<o.length;n++){let l=o[n];if(1===l.type&&0===l.tagType){let e=s?0:t$(l,i);if(e>0){if(e>=2){l.codegenNode.patchFlag=-1,a.push(l);continue}}else{let e=l.codegenNode;if(13===e.type){let t=e.patchFlag;if((void 0===t||512===t||1===t)&&tG(l,i)>=2){let t=tq(l);t&&(e.props=i.hoist(t))}e.dynamicProps&&(e.dynamicProps=i.hoist(e.dynamicProps))}}}else if(12===l.type&&(s?0:t$(l,i))>=2){a.push(l);continue}if(1===l.type){let n=1===l.tagType;n&&i.scopes.vSlot++,e(l,t,i,!1,r),n&&i.scopes.vSlot--}else if(11===l.type)e(l,t,i,1===l.children.length,!0);else if(9===l.type)for(let n=0;n<l.branches.length;n++)e(l.branches[n],t,i,1===l.branches[n].children.length,r)}let c=!1;if(a.length===o.length&&1===t.type){if(0===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&l(t.codegenNode.children))t.codegenNode.children=h(e_(t.codegenNode.children)),c=!0;else if(1===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&t.codegenNode.children&&!l(t.codegenNode.children)&&15===t.codegenNode.children.type){let e=p(t.codegenNode,"default");e&&(e.returns=h(e_(e.returns)),c=!0)}else if(3===t.tagType&&n&&1===n.type&&1===n.tagType&&n.codegenNode&&13===n.codegenNode.type&&n.codegenNode.children&&!l(n.codegenNode.children)&&15===n.codegenNode.children.type){let e=e6(t,"slot",!0),i=e&&e.arg&&p(n.codegenNode,e.arg);i&&(i.returns=h(e_(i.returns)),c=!0)}}if(!c)for(let e of a)e.codegenNode=i.cache(e.codegenNode);function h(e){let t=i.cache(e);return r&&i.hmr&&(t.needArraySpread=!0),t}function p(e,t){if(e.children&&!l(e.children)&&15===e.children.type){let n=e.children.properties.find(e=>e.key===t||e.key.content===t);return n&&n.value}}a.length&&i.transformHoist&&i.transformHoist(o,i,t)}(e,void 0,n,tB(e,e.children[0])),t.ssr||function(e,t){let{helper:n}=t,{children:i}=e;if(1===i.length){let n=i[0];if(tB(e,n)&&n.codegenNode){let i=n.codegenNode;13===i.type&&eR(i,t),e.codegenNode=i}else e.codegenNode=n}else i.length>1&&(e.codegenNode=eE(t,n(C),void 0,e.children,64,void 0,void 0,!0,void 0,!1))}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function tW(e,t){t.currentNode=e;let{nodeTransforms:n}=t,i=[];for(let s=0;s<n.length;s++){let r=n[s](e,t);if(r&&(l(r)?i.push(...r):i.push(r)),!t.currentNode)return;e=t.currentNode}switch(e.type){case 3:t.ssr||t.helper(k);break;case 5:t.ssr||t.helper(j);break;case 9:for(let n=0;n<e.branches.length;n++)tW(e.branches[n],t);break;case 10:case 11:case 1:case 0:!function(e,t){let n=0,i=()=>{n--};for(;n<e.children.length;n++){let s=e.children[n];c(s)||(t.grandParent=t.parent,t.parent=e,t.childIndex=n,t.onNodeRemoved=i,tW(s,t))}}(e,t)}t.currentNode=e;let s=i.length;for(;s--;)i[s]()}function tK(e,t){let n=c(e)?t=>t===e:t=>e.test(t);return(e,i)=>{if(1===e.type){let{props:s}=e;if(3===e.tagType&&s.some(te))return;let r=[];for(let o=0;o<s.length;o++){let a=s[o];if(7===a.type&&n(a.name)){s.splice(o,1),o--;let n=t(e,a,i);n&&r.push(n)}}return r}}}let tY="/*@__PURE__*/",tQ=e=>`${ep[e]}: _${ep[e]}`;function tz(e,t={}){let n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:i=!1,filename:s="template.vue.html",scopeId:r=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:h=!1,isTS:p=!1,inSSR:d=!1}){let u={mode:t,prefixIdentifiers:n,sourceMap:i,filename:s,scopeId:r,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:c,ssr:h,isTS:p,inSSR:d,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${ep[e]}`,push(e,t=-2,n){u.code+=e},indent(){f(++u.indentLevel)},deindent(e=!1){e?--u.indentLevel:f(--u.indentLevel)},newline(){f(u.indentLevel)}};function f(e){u.push("\n"+" ".repeat(e),0)}return u}(e,t);t.onContextCreated&&t.onContextCreated(n);let{mode:i,push:s,prefixIdentifiers:r,indent:o,deindent:a,newline:l,scopeId:c,ssr:h}=n,p=Array.from(e.helpers),d=p.length>0,u=!r&&"module"!==i;!function(e,t){let{ssr:n,prefixIdentifiers:i,push:s,newline:r,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=t,c=Array.from(e.helpers);if(c.length>0&&(s(`const _Vue = ${a} +`,-1),e.hoists.length)){let e=[P,V,k,X,w].filter(e=>c.includes(e)).map(tQ).join(", ");s(`const { ${e} } = _Vue +`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;let{push:n,newline:i}=t;i();for(let s=0;s<e.length;s++){let r=e[s];r&&(n(`const _hoisted_${s+1} = `),t2(r,t),i())}t.pure=!1})(e.hoists,t),r(),s("return ")}(e,n);let f=(h?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(s(`function ${h?"ssrRender":"render"}(${f}) {`),o(),u&&(s("with (_ctx) {"),o(),d&&(s(`const { ${p.map(tQ).join(", ")} } = _Vue +`,-1),l())),e.components.length&&(tZ(e.components,"component",n),(e.directives.length||e.temps>0)&&l()),e.directives.length&&(tZ(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),tZ(e.filters,"filter",n),l()),e.temps>0){s("let ");for(let t=0;t<e.temps;t++)s(`${t>0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(s(` +`,0),l()),h||s("return "),e.codegenNode?t2(e.codegenNode,n):s("null"),u&&(a(),s("}")),a(),s("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function tZ(e,t,{helper:n,push:i,newline:s,isTS:r}){let o=n("filter"===t?$:"component"===t?U:B);for(let n=0;n<e.length;n++){let a=e[n],l=a.endsWith("__self");l&&(a=a.slice(0,-6)),i(`const ${to(a,t)} = ${o}(${JSON.stringify(a)}${l?", true":""})${r?"!":""}`),n<e.length-1&&s()}}function t1(e,t){let n=e.length>3;t.push("["),n&&t.indent(),t0(e,t,n),n&&t.deindent(),t.push("]")}function t0(e,t,n=!1,i=!0){let{push:s,newline:r}=t;for(let o=0;o<e.length;o++){let a=e[o];c(a)?s(a,-3):l(a)?t1(a,t):t2(a,t),o<e.length-1&&(n?(i&&s(","),r()):i&&s(", "))}}function t2(e,t){if(c(e)){t.push(e,-3);return}if(h(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:case 12:t2(e.codegenNode,t);break;case 2:!function(e,t){t.push(JSON.stringify(e.content),-3,e)}(e,t);break;case 4:t3(e,t);break;case 5:!function(e,t){let{push:n,helper:i,pure:s}=t;s&&n(tY),n(`${i(j)}(`),t2(e.content,t),n(")")}(e,t);break;case 8:t4(e,t);break;case 3:!function(e,t){let{push:n,helper:i,pure:s}=t;s&&n(tY),n(`${i(k)}(${JSON.stringify(e.content)})`,-3,e)}(e,t);break;case 13:!function(e,t){let n;let{push:i,helper:s,pure:r}=t,{tag:o,props:a,children:l,patchFlag:c,dynamicProps:h,directives:p,isBlock:d,disableTracking:u,isComponent:f}=e;c&&(n=String(c)),p&&i(s(H)+"("),d&&i(`(${s(L)}(${u?"true":""}), `),r&&i(tY),i(s(d?eb(t.inSSR,f):eC(t.inSSR,f))+"(",-2,e),t0(function(e){let t=e.length;for(;t--&&null==e[t];);return e.slice(0,t+1).map(e=>e||"null")}([o,a,l,n,h]),t),i(")"),d&&i(")"),p&&(i(", "),t2(p,t),i(")"))}(e,t);break;case 14:!function(e,t){let{push:n,helper:i,pure:s}=t,r=c(e.callee)?e.callee:i(e.callee);s&&n(tY),n(r+"(",-2,e),t0(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){let{push:n,indent:i,deindent:s,newline:r}=t,{properties:o}=e;if(!o.length){n("{}",-2,e);return}let a=o.length>1;n(a?"{":"{ "),a&&i();for(let e=0;e<o.length;e++){let{key:i,value:s}=o[e];!function(e,t){let{push:n}=t;8===e.type?(n("["),t4(e,t),n("]")):e.isStatic?n(eY(e.content)?e.content:JSON.stringify(e.content),-2,e):n(`[${e.content}]`,-3,e)}(i,t),n(": "),t2(s,t),e<o.length-1&&(n(","),r())}a&&s(),n(a?"}":" }")}(e,t);break;case 17:t1(e.elements,t);break;case 18:!function(e,t){let{push:n,indent:i,deindent:s}=t,{params:r,returns:o,body:a,newline:c,isSlot:h}=e;h&&n(`_${ep[eo]}(`),n("(",-2,e),l(r)?t0(r,t):r&&t2(r,t),n(") => "),(c||a)&&(n("{"),i()),o?(c&&n("return "),l(o)?t1(o,t):t2(o,t)):a&&t2(a,t),(c||a)&&(s(),n("}")),h&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){let{test:n,consequent:i,alternate:s,newline:r}=e,{push:o,indent:a,deindent:l,newline:c}=t;if(4===n.type){let e=!eY(n.content);e&&o("("),t3(n,t),e&&o(")")}else o("("),t2(n,t),o(")");r&&a(),t.indentLevel++,r||o(" "),o("? "),t2(i,t),t.indentLevel--,r&&c(),r||o(" "),o(": ");let h=19===s.type;!h&&t.indentLevel++,t2(s,t),!h&&t.indentLevel--,r&&l(!0)}(e,t);break;case 20:!function(e,t){let{push:n,helper:i,indent:s,deindent:r,newline:o}=t,{needPauseTracking:a,needArraySpread:l}=e;l&&n("[...("),n(`_cache[${e.index}] || (`),a&&(s(),n(`${i(ei)}(-1`),e.inVOnce&&n(", true"),n("),"),o(),n("(")),n(`_cache[${e.index}] = `),t2(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),o(),n(`${i(ei)}(1),`),o(),n(`_cache[${e.index}]`),r()),n(")"),l&&n(")]")}(e,t);break;case 21:t0(e.body,t,!0,!1)}}function t3(e,t){let{content:n,isStatic:i}=e;t.push(i?JSON.stringify(n):n,-3,e)}function t4(e,t){for(let n=0;n<e.children.length;n++){let i=e.children[n];c(i)?t.push(i,-3):t2(i,t)}}function t6(e,t,n=!1,i=!1,s=Object.create(t.identifiers)){return e}let t5=tK(/^(if|else|else-if)$/,(e,t,n)=>t9(e,t,n,(e,t,i)=>{let s=n.parent.children,r=s.indexOf(e),o=0;for(;r-- >=0;){let e=s[r];e&&9===e.type&&(o+=e.branches.length)}return()=>{i?e.codegenNode=t8(t,o,n):function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode).alternate=t8(t,o+e.branches.length-1,n)}}));function t9(e,t,n,i){if("else"!==t.name&&(!t.exp||!t.exp.content.trim())){let i=t.exp?t.exp.loc:e.loc;n.onError(e$(28,t.loc)),t.exp=eg("true",!1,i)}if("if"===t.name){var s;let r=t7(e,t),o={type:9,loc:tk((s=e.loc).start.offset,s.end.offset),branches:[r]};if(n.replaceNode(o),i)return i(o,r,!0)}else{let s=n.parent.children,r=s.indexOf(e);for(;r-- >=-1;){let o=s[r];if(o&&3===o.type||o&&2===o.type&&!o.content.trim().length){n.removeNode(o);continue}if(o&&9===o.type){"else-if"===t.name&&void 0===o.branches[o.branches.length-1].condition&&n.onError(e$(30,e.loc)),n.removeNode();let s=t7(e,t);o.branches.push(s);let r=i&&i(o,s,!1);tW(s,n),r&&r(),n.currentNode=null}else n.onError(e$(30,e.loc));break}}}function t7(e,t){let n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!e6(e,"for")?e.children:[e],userKey:e5(e,"key"),isTemplateIf:n}}function t8(e,t,n){return e.condition?ey(e.condition,ne(e,t,n),eN(n.helper(k),['""',"true"])):ne(e,t,n)}function ne(e,t,n){let{helper:i}=n,s=eS("key",eg(`${t}`,!1,eu,2)),{children:r}=e,o=r[0];if(1!==r.length||1!==o.type){if(1!==r.length||11!==o.type)return eE(n,i(C),em([s]),r,64,void 0,void 0,!0,!1,!1,e.loc);{let e=o.codegenNode;return ts(e,s,n),e}}{let e=o.codegenNode,t=ta(e);return 13===t.type&&eR(t,n),ts(t,s,n),e}}let nt=(e,t,n)=>{let{modifiers:i,loc:s}=e,r=e.arg,{exp:o}=e;if(o&&4===o.type&&!o.content.trim()&&(o=void 0),!o){if(4!==r.type||!r.isStatic)return n.onError(e$(52,r.loc)),{props:[eS(r,eg("",!0,s))]};nn(e),o=e.exp}return 4!==r.type?(r.children.unshift("("),r.children.push(') || ""')):r.isStatic||(r.content=`${r.content} || ""`),i.some(e=>"camel"===e.content)&&(4===r.type?r.isStatic?r.content=_(r.content):r.content=`${n.helperString(ee)}(${r.content})`:(r.children.unshift(`${n.helperString(ee)}(`),r.children.push(")"))),!n.inSSR&&(i.some(e=>"prop"===e.content)&&ni(r,"."),i.some(e=>"attr"===e.content)&&ni(r,"^")),{props:[eS(r,o)]}},nn=(e,t)=>{let n=e.arg,i=_(n.content);e.exp=eg(i,!1,n.loc)},ni=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},ns=tK("for",(e,t,n)=>{let{helper:i,removeHelper:s}=n;return nr(e,t,n,t=>{let r=eN(i(G),[t.source]),o=tt(e),a=e6(e,"memo"),l=e5(e,"key",!1,!0);l&&7===l.type&&!l.exp&&nn(l);let c=l&&(6===l.type?l.value?eg(l.value.content,!0):void 0:l.exp),h=l&&c?eS("key",c):null,p=4===t.source.type&&t.source.constType>0,d=p?64:l?128:256;return t.codegenNode=eE(n,i(C),void 0,r,d,void 0,void 0,!0,!p,!1,e.loc),()=>{let l;let{children:d}=t,u=1!==d.length||1!==d[0].type,f=tn(e)?e:o&&1===e.children.length&&tn(e.children[0])?e.children[0]:null;if(f?(l=f.codegenNode,o&&h&&ts(l,h,n)):u?l=eE(n,i(C),h?em([h]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(l=d[0].codegenNode,o&&h&&ts(l,h,n),!p!==l.isBlock&&(l.isBlock?(s(L),s(eb(n.inSSR,l.isComponent))):s(eC(n.inSSR,l.isComponent))),l.isBlock=!p,l.isBlock?(i(L),i(eb(n.inSSR,l.isComponent))):i(eC(n.inSSR,l.isComponent))),a){let e=eI(na(t.parseResult,[eg("_cached")]));e.body=eA([eT(["const _memo = (",a.exp,")"]),eT(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${n.helperString(eh)}(_cached, _memo)) return _cached`]),eT(["const _item = ",l]),eg("_item.memo = _memo"),eg("return _item")]),r.arguments.push(e,eg("_cache"),eg(String(n.cached.length))),n.cached.push(null)}else r.arguments.push(eI(na(t.parseResult),l,!0))}})});function nr(e,t,n,i){if(!t.exp){n.onError(e$(31,t.loc));return}let s=t.forParseResult;if(!s){n.onError(e$(32,t.loc));return}no(s);let{addIdentifiers:r,removeIdentifiers:o,scopes:a}=n,{source:l,value:c,key:h,index:p}=s,d={type:11,loc:t.loc,source:l,valueAlias:c,keyAlias:h,objectIndexAlias:p,parseResult:s,children:tt(e)?e.children:[e]};n.replaceNode(d),a.vFor++;let u=i&&i(d);return()=>{a.vFor--,u&&u()}}function no(e,t){e.finalized||(e.finalized=!0)}function na({value:e,key:t,index:n},i=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||eg("_".repeat(t+1),!1))}([e,t,n,...i])}let nl=eg("undefined",!1),nc=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){let n=e6(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},nh=(e,t,n,i)=>eI(e,n,!1,!0,n.length?n[0].loc:i);function np(e,t,n=nh){t.helper(eo);let{children:i,loc:s}=e,r=[],o=[],a=t.scopes.vSlot>0||t.scopes.vFor>0,l=e6(e,"slot",!0);if(l){let{arg:e,exp:t}=l;e&&!ej(e)&&(a=!0),r.push(eS(e||eg("default",!0),n(t,void 0,i,s)))}let c=!1,h=!1,p=[],d=new Set,u=0;for(let e=0;e<i.length;e++){let s,f,E,_;let m=i[e];if(!tt(m)||!(s=e6(m,"slot",!0))){3!==m.type&&p.push(m);continue}if(l){t.onError(e$(37,s.loc));break}c=!0;let{children:S,loc:g}=m,{arg:T=eg("default",!0),exp:N,loc:I}=s;ej(T)?f=T?T.content:"default":a=!0;let y=e6(m,"for"),O=n(N,y,S,g);if(E=e6(m,"if"))a=!0,o.push(ey(E.exp,nd(T,O,u++),nl));else if(_=e6(m,/^else(-if)?$/,!0)){let n,s=e;for(;s--&&3===(n=i[s]).type;);if(n&&tt(n)&&e6(n,/^(else-)?if$/)){let e=o[o.length-1];for(;19===e.alternate.type;)e=e.alternate;e.alternate=_.exp?ey(_.exp,nd(T,O,u++),nl):nd(T,O,u++)}else t.onError(e$(30,_.loc))}else if(y){a=!0;let e=y.forParseResult;e?(no(e),o.push(eN(t.helper(G),[e.source,eI(na(e),nd(T,O),!0)]))):t.onError(e$(32,y.loc))}else{if(f){if(d.has(f)){t.onError(e$(38,I));continue}d.add(f),"default"===f&&(h=!0)}r.push(eS(T,O))}}if(!l){let e=(e,i)=>{let r=n(e,void 0,i,s);return t.compatConfig&&(r.isNonScopedSlot=!0),eS("default",r)};c?p.length&&p.some(e=>(function e(t){return 2!==t.type&&12!==t.type||(2===t.type?!!t.content.trim():e(t.content))})(e))&&(h?t.onError(e$(39,p[0].loc)):r.push(e(void 0,p))):r.push(e(void 0,i))}let f=a?2:!function e(t){for(let n=0;n<t.length;n++){let i=t[n];switch(i.type){case 1:if(2===i.tagType||e(i.children))return!0;break;case 9:if(e(i.branches))return!0;break;case 10:case 11:if(e(i.children))return!0}}return!1}(e.children)?1:3,E=em(r.concat(eS("_",eg(f+"",!1))),s);return o.length&&(E=eN(t.helper(J),[E,e_(o)])),{slots:E,hasDynamicSlots:a}}function nd(e,t,n){let i=[eS("name",e),eS("fn",t)];return null!=n&&i.push(eS("key",eg(String(n),!0))),em(i)}let nu=new WeakMap,nf=(e,t)=>function(){let n,i,s,r,o;if(!(1===(e=t.currentNode).type&&(0===e.tagType||1===e.tagType)))return;let{tag:a,props:l}=e,c=1===e.tagType,h=c?nE(e,t):`"${a}"`,d=p(h)&&h.callee===F,u=0,f=d||h===b||h===R||!c&&("svg"===a||"foreignObject"===a||"math"===a);if(l.length>0){let i=n_(e,t,void 0,c,d);n=i.props,u=i.patchFlag,r=i.dynamicPropNames;let s=i.directives;o=s&&s.length?e_(s.map(e=>nS(e,t))):void 0,i.shouldUseBlock&&(f=!0)}if(e.children.length>0){if(h===v&&(f=!0,u|=1024),c&&h!==b&&h!==v){let{slots:n,hasDynamicSlots:s}=np(e,t);i=n,s&&(u|=1024)}else if(1===e.children.length&&h!==b){let n=e.children[0],s=n.type,r=5===s||8===s;r&&0===t$(n,t)&&(u|=1),i=r||2===s?n:e.children}else i=e.children}r&&r.length&&(s=function(e){let t="[";for(let n=0,i=e.length;n<i;n++)t+=JSON.stringify(e[n]),n<i-1&&(t+=", ");return t+"]"}(r)),e.codegenNode=eE(t,h,n,i,0===u?void 0:u,s,o,!!f,!1,c,e.loc)};function nE(e,t,n=!1){let{tag:i}=e,s=ng(i),r=e5(e,"is",!1,!0);if(r){if(s||ew("COMPILER_IS_ON_ELEMENT",t)){let e;if(6===r.type?e=r.value&&eg(r.value.content,!0):(e=r.exp)||(e=eg("is",!1,r.arg.loc)),e)return eN(t.helper(F),[e])}else 6===r.type&&r.value.content.startsWith("vue:")&&(i=r.value.content.slice(4))}let o=eW(i)||t.isBuiltInComponent(i);return o?(n||t.helper(o),o):(t.helper(U),t.components.add(i),to(i,"component"))}function n_(e,t,n=e.props,i,s,r=!1){let a;let{tag:l,loc:c,children:p}=e,f=[],E=[],_=[],m=p.length>0,S=!1,g=0,T=!1,N=!1,I=!1,y=!1,O=!1,A=!1,C=[],b=e=>{f.length&&(E.push(em(nm(f),c)),f=[]),e&&E.push(e)},R=()=>{t.scopes.vFor>0&&f.push(eS(eg("ref_for",!0),eg("true")))},v=({key:e,value:n})=>{if(ej(e)){let r=e.content,a=o(r);a&&(!i||s)&&"onclick"!==r.toLowerCase()&&"onUpdate:modelValue"!==r&&!d(r)&&(y=!0),a&&d(r)&&(A=!0),a&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&t$(n,t)>0||("ref"===r?T=!0:"class"===r?N=!0:"style"===r?I=!0:"key"===r||C.includes(r)||C.push(r),i&&("class"===r||"style"===r)&&!C.includes(r)&&C.push(r))}else O=!0};for(let s=0;s<n.length;s++){let o=n[s];if(6===o.type){let{loc:e,name:n,nameLoc:i,value:s}=o;if("ref"===n&&(T=!0,R()),"is"===n&&(ng(l)||s&&s.content.startsWith("vue:")||ew("COMPILER_IS_ON_ELEMENT",t)))continue;f.push(eS(eg(n,!0,i),eg(s?s.content:"",!0,s?s.loc:e)))}else{let{name:n,arg:s,exp:a,loc:p,modifiers:d}=o,T="bind"===n,N="on"===n;if("slot"===n){i||t.onError(e$(40,p));continue}if("once"===n||"memo"===n||"is"===n||T&&e9(s,"is")&&(ng(l)||ew("COMPILER_IS_ON_ELEMENT",t))||N&&r)continue;if((T&&e9(s,"key")||N&&m&&e9(s,"vue:before-update"))&&(S=!0),T&&e9(s,"ref")&&R(),!s&&(T||N)){if(O=!0,a){if(T){if(R(),b(),ew("COMPILER_V_BIND_OBJECT_ORDER",t)){E.unshift(a);continue}E.push(a)}else b({type:14,loc:p,callee:t.helper(Z),arguments:i?[a]:[a,"true"]})}else t.onError(e$(T?34:35,p));continue}T&&d.some(e=>"prop"===e.content)&&(g|=32);let I=t.directiveTransforms[n];if(I){let{props:n,needRuntime:i}=I(o,e,t);r||n.forEach(v),N&&s&&!ej(s)?b(em(n,c)):f.push(...n),i&&(_.push(o),h(i)&&nu.set(o,i))}else!u(n)&&(_.push(o),m&&(S=!0))}}if(E.length?(b(),a=E.length>1?eN(t.helper(W),E,c):E[0]):f.length&&(a=em(nm(f),c)),O?g|=16:(N&&!i&&(g|=2),I&&!i&&(g|=4),C.length&&(g|=8),y&&(g|=32)),!S&&(0===g||32===g)&&(T||A||_.length>0)&&(g|=512),!t.inSSR&&a)switch(a.type){case 15:let x=-1,L=-1,M=!1;for(let e=0;e<a.properties.length;e++){let t=a.properties[e].key;ej(t)?"class"===t.content?x=e:"style"===t.content&&(L=e):t.isHandlerKey||(M=!0)}let D=a.properties[x],P=a.properties[L];M?a=eN(t.helper(Q),[a]):(D&&!ej(D.value)&&(D.value=eN(t.helper(K),[D.value])),P&&(I||4===P.value.type&&"["===P.value.content.trim()[0]||17===P.value.type)&&(P.value=eN(t.helper(Y),[P.value])));break;case 14:break;default:a=eN(t.helper(Q),[eN(t.helper(z),[a])])}return{props:a,directives:_,patchFlag:g,dynamicPropNames:C,shouldUseBlock:S}}function nm(e){let t=new Map,n=[];for(let i=0;i<e.length;i++){let s=e[i];if(8===s.key.type||!s.key.isStatic){n.push(s);continue}let r=s.key.content,a=t.get(r);a?("style"===r||"class"===r||o(r))&&(17===a.value.type?a.value.elements.push(s.value):a.value=e_([a.value,s.value],a.loc)):(t.set(r,s),n.push(s))}return n}function nS(e,t){let n=[],i=nu.get(e);i?n.push(t.helperString(i)):(t.helper(B),t.directives.add(e.name),n.push(to(e.name,"directive")));let{loc:s}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));let t=eg("true",!1,s);n.push(em(e.modifiers.map(e=>eS(e,t)),s))}return e_(n,e.loc)}function ng(e){return"component"===e||"Component"===e}let nT=(e,t)=>{if(tn(e)){let{children:n,loc:i}=e,{slotName:s,slotProps:r}=nN(e,t),o=[t.prefixIdentifiers?"_ctx.$slots":"$slots",s,"{}","undefined","true"],a=2;r&&(o[2]=r,a=3),n.length&&(o[3]=eI([],n,!1,!1,i),a=4),t.scopeId&&!t.slotted&&(a=5),o.splice(a),e.codegenNode=eN(t.helper(q),o,i)}};function nN(e,t){let n,i='"default"',s=[];for(let t=0;t<e.props.length;t++){let n=e.props[t];if(6===n.type)n.value&&("name"===n.name?i=JSON.stringify(n.value.content):(n.name=_(n.name),s.push(n)));else if("bind"===n.name&&e9(n.arg,"name")){if(n.exp)i=n.exp;else if(n.arg&&4===n.arg.type){let e=_(n.arg.content);i=n.exp=eg(e,!1,n.arg.loc)}}else"bind"===n.name&&n.arg&&ej(n.arg)&&(n.arg.content=_(n.arg.content)),s.push(n)}if(s.length>0){let{props:i,directives:r}=n_(e,t,s,!1,!1);n=i,r.length&&t.onError(e$(36,r[0].loc))}return{slotName:i,slotProps:n}}let nI=(e,t,n,i)=>{let s;let{loc:r,modifiers:o,arg:a}=e;if(e.exp||o.length,4===a.type){if(a.isStatic){let e=a.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),s=eg(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?S(_(e)):`on:${e}`,!0,a.loc)}else s=eT([`${n.helperString(en)}(`,a,")"])}else(s=a).children.unshift(`${n.helperString(en)}(`),s.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let c=n.cacheHandlers&&!l&&!n.inVOnce;if(l){let e=e0(l),t=!(e||e3(l)),n=l.content.includes(";");(t||c&&e)&&(l=eT([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let h={props:[eS(s,l||eg("() => {}",!1,r))]};return i&&(h=i(h)),c&&(h.props[0].value=n.cache(h.props[0].value)),h.props.forEach(e=>e.key.isHandlerKey=!0),h},ny=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{let n;let i=e.children,s=!1;for(let e=0;e<i.length;e++){let t=i[e];if(e8(t)){s=!0;for(let s=e+1;s<i.length;s++){let r=i[s];if(e8(r))n||(n=i[e]=eT([t],t.loc)),n.children.push(" + ",r),i.splice(s,1),s--;else{n=void 0;break}}}}if(s&&(1!==i.length||0!==e.type&&(1!==e.type||0!==e.tagType||e.props.find(e=>7===e.type&&!t.directiveTransforms[e.name])||"template"===e.tag)))for(let e=0;e<i.length;e++){let n=i[e];if(e8(n)||8===n.type){let s=[];(2!==n.type||" "!==n.content)&&s.push(n),t.ssr||0!==t$(n,t)||s.push("1"),i[e]={type:12,content:n,loc:n.loc,codegenNode:eN(t.helper(X),s)}}}}},nO=new WeakSet,nA=(e,t)=>{if(1===e.type&&e6(e,"once",!0)&&!nO.has(e)&&!t.inVOnce&&!t.inSSR)return nO.add(e),t.inVOnce=!0,t.helper(ei),()=>{t.inVOnce=!1;let e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}},nC=(e,t,n)=>{let i;let{exp:s,arg:r}=e;if(!s)return n.onError(e$(41,e.loc)),nb();let o=s.loc.source.trim(),a=4===s.type?s.content:o,l=n.bindingMetadata[o];if("props"===l||"props-aliased"===l)return s.loc,nb();if(!a.trim()||!e0(s))return n.onError(e$(42,s.loc)),nb();let c=r||eg("modelValue",!0),h=r?ej(r)?`onUpdate:${_(r.content)}`:eT(['"onUpdate:" + ',r]):"onUpdate:modelValue",p=n.isTS?"($event: any)":"$event";i=eT([`${p} => ((`,s,") = $event)"]);let d=[eS(c,e.exp),eS(h,i)];if(e.modifiers.length&&1===t.tagType){let t=e.modifiers.map(e=>e.content).map(e=>(eY(e)?e:JSON.stringify(e))+": true").join(", "),n=r?ej(r)?`${r.content}Modifiers`:eT([r,' + "Modifiers"']):"modelModifiers";d.push(eS(n,eg(`{ ${t} }`,!1,e.loc,2)))}return nb(d)};function nb(e=[]){return{props:e}}let nR=/[\w).+\-_$\]]/,nv=(e,t)=>{ew("COMPILER_FILTERS",t)&&(5===e.type?nx(e.content,t):1===e.type&&e.props.forEach(e=>{7===e.type&&"for"!==e.name&&e.exp&&nx(e.exp,t)}))};function nx(e,t){if(4===e.type)nL(e,t);else for(let n=0;n<e.children.length;n++){let i=e.children[n];"object"==typeof i&&(4===i.type?nL(i,t):8===i.type?nx(e,t):5===i.type&&nx(i.content,t))}}function nL(e,t){let n=e.content,i=!1,s=!1,r=!1,o=!1,a=0,l=0,c=0,h=0,p,d,u,f,E=[];for(u=0;u<n.length;u++)if(d=p,p=n.charCodeAt(u),i)39===p&&92!==d&&(i=!1);else if(s)34===p&&92!==d&&(s=!1);else if(r)96===p&&92!==d&&(r=!1);else if(o)47===p&&92!==d&&(o=!1);else if(124!==p||124===n.charCodeAt(u+1)||124===n.charCodeAt(u-1)||a||l||c){switch(p){case 34:s=!0;break;case 39:i=!0;break;case 96:r=!0;break;case 40:c++;break;case 41:c--;break;case 91:l++;break;case 93:l--;break;case 123:a++;break;case 125:a--}if(47===p){let e,t=u-1;for(;t>=0&&" "===(e=n.charAt(t));t--);e&&nR.test(e)||(o=!0)}}else void 0===f?(h=u+1,f=n.slice(0,u).trim()):_();function _(){E.push(n.slice(h,u).trim()),h=u+1}if(void 0===f?f=n.slice(0,u).trim():0!==h&&_(),E.length){for(u=0;u<E.length;u++)f=function(e,t,n){n.helper($);let i=t.indexOf("(");if(i<0)return n.filters.add(t),`${to(t,"filter")}(${e})`;{let s=t.slice(0,i),r=t.slice(i+1);return n.filters.add(s),`${to(s,"filter")}(${e}${")"!==r?","+r:r}`}}(f,E[u],t);e.content=f,e.ast=void 0}}let nM=new WeakSet,nD=(e,t)=>{if(1===e.type){let n=e6(e,"memo");if(!(!n||nM.has(e)))return nM.add(e),()=>{let i=e.codegenNode||t.currentNode.codegenNode;i&&13===i.type&&(1!==e.tagType&&eR(i,t),e.codegenNode=eN(t.helper(ec),[n.exp,eI(void 0,i),"_cache",String(t.cached.length)]),t.cached.push(null))}}};function nP(e){return[[nA,t5,nD,ns,nv,nT,nf,nc,ny],{on:nI,bind:nt,model:nC}]}function nV(e,t={}){let n=t.onError||eF,i="module"===t.mode;!0===t.prefixIdentifiers?n(e$(47)):i&&n(e$(48)),t.cacheHandlers&&n(e$(49)),t.scopeId&&!i&&n(e$(50));let s=a({},t,{prefixIdentifiers:!1}),r=c(e)?tF(e,s):e,[o,l]=nP();return tj(r,a({},s,{nodeTransforms:[...o,...t.nodeTransforms||[]],directiveTransforms:a({},l,t.directiveTransforms||{})})),tz(r,s)}let nk=()=>({props:[]}),nX=Symbol(""),nw=Symbol(""),nU=Symbol(""),nF=Symbol(""),nB=Symbol(""),n$=Symbol(""),nH=Symbol(""),nG=Symbol(""),nq=Symbol(""),nJ=Symbol("");ed({[nX]:"vModelRadio",[nw]:"vModelCheckbox",[nU]:"vModelText",[nF]:"vModelSelect",[nB]:"vModelDynamic",[n$]:"withModifiers",[nH]:"withKeys",[nG]:"vShow",[nq]:"Transition",[nJ]:"TransitionGroup"});let nj={parseMode:"html",isVoidTag:A,isNativeTag:e=>I(e)||y(e)||O(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,n=!1){return(t||(t=document.createElement("div")),n)?(t.innerHTML=`<div foo="${e.replace(/"/g,""")}">`,t.children[0].getAttribute("foo")):(t.innerHTML=e,t.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?nq:"TransitionGroup"===e||"transition-group"===e?nJ:void 0,getNamespace(e,t,n){let i=t?t.ns:n;if(t&&2===i){if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(i=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(i=0)}else t&&1===i&&("foreignObject"===t.tag||"desc"===t.tag||"title"===t.tag)&&(i=0);if(0===i){if("svg"===e)return 1;if("math"===e)return 2}return i}},nW=e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:eg("style",!0,t.loc),exp:nK(t.value.content,t.loc),modifiers:[],loc:t.loc})})},nK=(e,t)=>eg(JSON.stringify(function(e){let t={};return e.replace(N,"").split(g).forEach(e=>{if(e){let n=e.split(T);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(e)),!1,t,3),nY=n("passive,once,capture"),nQ=n("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),nz=n("left,right"),nZ=n("onkeyup,onkeydown,onkeypress"),n1=(e,t,n,i)=>{let s=[],r=[],o=[];for(let i=0;i<t.length;i++){let a=t[i].content;"native"===a&&eU("COMPILER_V_ON_NATIVE",n)?o.push(a):nY(a)?o.push(a):nz(a)?ej(e)?nZ(e.content.toLowerCase())?s.push(a):r.push(a):(s.push(a),r.push(a)):nQ(a)?r.push(a):s.push(a)}return{keyModifiers:s,nonKeyModifiers:r,eventOptionModifiers:o}},n0=(e,t)=>ej(e)&&"onclick"===e.content.toLowerCase()?eg(t,!0):4!==e.type?eT(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,n2=(e,t)=>{1===e.type&&0===e.tagType&&("script"===e.tag||"style"===e.tag)&&t.removeNode()},n3=[nW],n4={cloak:nk,html:(e,t,n)=>{let{exp:i,loc:s}=e;return i||n.onError(e$(53,s)),t.children.length&&(n.onError(e$(54,s)),t.children.length=0),{props:[eS(eg("innerHTML",!0,s),i||eg("",!0))]}},text:(e,t,n)=>{let{exp:i,loc:s}=e;return i||n.onError(e$(55,s)),t.children.length&&(n.onError(e$(56,s)),t.children.length=0),{props:[eS(eg("textContent",!0),i?t$(i,n)>0?i:eN(n.helperString(j),[i],s):eg("",!0))]}},model:(e,t,n)=>{let i=nC(e,t,n);if(!i.props.length||1===t.tagType)return i;e.arg&&n.onError(e$(58,e.arg.loc));let{tag:s}=t,r=n.isCustomElement(s);if("input"===s||"textarea"===s||"select"===s||r){let o=nU,a=!1;if("input"===s||r){let i=e5(t,"type");if(i){if(7===i.type)o=nB;else if(i.value)switch(i.value.content){case"radio":o=nX;break;case"checkbox":o=nw;break;case"file":a=!0,n.onError(e$(59,e.loc))}}else e7(t)&&(o=nB)}else"select"===s&&(o=nF);a||(i.needRuntime=n.helper(o))}else n.onError(e$(57,e.loc));return i.props=i.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),i},on:(e,t,n)=>nI(e,t,n,t=>{let{modifiers:i}=e;if(!i.length)return t;let{key:s,value:r}=t.props[0],{keyModifiers:o,nonKeyModifiers:a,eventOptionModifiers:l}=n1(s,i,n,e.loc);if(a.includes("right")&&(s=n0(s,"onContextmenu")),a.includes("middle")&&(s=n0(s,"onMouseup")),a.length&&(r=eN(n.helper(n$),[r,JSON.stringify(a)])),o.length&&(!ej(s)||nZ(s.content.toLowerCase()))&&(r=eN(n.helper(nH),[r,JSON.stringify(o)])),l.length){let e=l.map(m).join("");s=ej(s)?eg(`${s.content}${e}`,!0):eT(["(",s,`) + "${e}"`])}return{props:[eS(s,r)]}}),show:(e,t,n)=>{let{exp:i,loc:s}=e;return!i&&n.onError(e$(61,s)),{props:[],needRuntime:n.helper(nG)}}};return e.BASE_TRANSITION=x,e.BindingTypes={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},e.CAMELIZE=ee,e.CAPITALIZE=et,e.CREATE_BLOCK=M,e.CREATE_COMMENT=k,e.CREATE_ELEMENT_BLOCK=D,e.CREATE_ELEMENT_VNODE=V,e.CREATE_SLOTS=J,e.CREATE_STATIC=w,e.CREATE_TEXT=X,e.CREATE_VNODE=P,e.CompilerDeprecationTypes={COMPILER_IS_ON_ELEMENT:"COMPILER_IS_ON_ELEMENT",COMPILER_V_BIND_SYNC:"COMPILER_V_BIND_SYNC",COMPILER_V_BIND_OBJECT_ORDER:"COMPILER_V_BIND_OBJECT_ORDER",COMPILER_V_ON_NATIVE:"COMPILER_V_ON_NATIVE",COMPILER_V_IF_V_FOR_PRECEDENCE:"COMPILER_V_IF_V_FOR_PRECEDENCE",COMPILER_NATIVE_TEMPLATE:"COMPILER_NATIVE_TEMPLATE",COMPILER_INLINE_TEMPLATE:"COMPILER_INLINE_TEMPLATE",COMPILER_FILTERS:"COMPILER_FILTERS"},e.ConstantTypes={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},e.DOMDirectiveTransforms=n4,e.DOMErrorCodes={X_V_HTML_NO_EXPRESSION:53,53:"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:54,54:"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:55,55:"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:56,56:"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:57,57:"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:58,58:"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:59,59:"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:60,60:"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:61,61:"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:62,62:"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:63,63:"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:64,64:"__EXTEND_POINT__"},e.DOMErrorMessages={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},e.DOMNodeTransforms=n3,e.ElementTypes={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},e.ErrorCodes={ABRUPT_CLOSING_OF_EMPTY_COMMENT:0,0:"ABRUPT_CLOSING_OF_EMPTY_COMMENT",CDATA_IN_HTML_CONTENT:1,1:"CDATA_IN_HTML_CONTENT",DUPLICATE_ATTRIBUTE:2,2:"DUPLICATE_ATTRIBUTE",END_TAG_WITH_ATTRIBUTES:3,3:"END_TAG_WITH_ATTRIBUTES",END_TAG_WITH_TRAILING_SOLIDUS:4,4:"END_TAG_WITH_TRAILING_SOLIDUS",EOF_BEFORE_TAG_NAME:5,5:"EOF_BEFORE_TAG_NAME",EOF_IN_CDATA:6,6:"EOF_IN_CDATA",EOF_IN_COMMENT:7,7:"EOF_IN_COMMENT",EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT:8,8:"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",EOF_IN_TAG:9,9:"EOF_IN_TAG",INCORRECTLY_CLOSED_COMMENT:10,10:"INCORRECTLY_CLOSED_COMMENT",INCORRECTLY_OPENED_COMMENT:11,11:"INCORRECTLY_OPENED_COMMENT",INVALID_FIRST_CHARACTER_OF_TAG_NAME:12,12:"INVALID_FIRST_CHARACTER_OF_TAG_NAME",MISSING_ATTRIBUTE_VALUE:13,13:"MISSING_ATTRIBUTE_VALUE",MISSING_END_TAG_NAME:14,14:"MISSING_END_TAG_NAME",MISSING_WHITESPACE_BETWEEN_ATTRIBUTES:15,15:"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",NESTED_COMMENT:16,16:"NESTED_COMMENT",UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME:17,17:"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE:18,18:"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME:19,19:"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",UNEXPECTED_NULL_CHARACTER:20,20:"UNEXPECTED_NULL_CHARACTER",UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME:21,21:"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",UNEXPECTED_SOLIDUS_IN_TAG:22,22:"UNEXPECTED_SOLIDUS_IN_TAG",X_INVALID_END_TAG:23,23:"X_INVALID_END_TAG",X_MISSING_END_TAG:24,24:"X_MISSING_END_TAG",X_MISSING_INTERPOLATION_END:25,25:"X_MISSING_INTERPOLATION_END",X_MISSING_DIRECTIVE_NAME:26,26:"X_MISSING_DIRECTIVE_NAME",X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END:27,27:"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",X_V_IF_NO_EXPRESSION:28,28:"X_V_IF_NO_EXPRESSION",X_V_IF_SAME_KEY:29,29:"X_V_IF_SAME_KEY",X_V_ELSE_NO_ADJACENT_IF:30,30:"X_V_ELSE_NO_ADJACENT_IF",X_V_FOR_NO_EXPRESSION:31,31:"X_V_FOR_NO_EXPRESSION",X_V_FOR_MALFORMED_EXPRESSION:32,32:"X_V_FOR_MALFORMED_EXPRESSION",X_V_FOR_TEMPLATE_KEY_PLACEMENT:33,33:"X_V_FOR_TEMPLATE_KEY_PLACEMENT",X_V_BIND_NO_EXPRESSION:34,34:"X_V_BIND_NO_EXPRESSION",X_V_ON_NO_EXPRESSION:35,35:"X_V_ON_NO_EXPRESSION",X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET:36,36:"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",X_V_SLOT_MIXED_SLOT_USAGE:37,37:"X_V_SLOT_MIXED_SLOT_USAGE",X_V_SLOT_DUPLICATE_SLOT_NAMES:38,38:"X_V_SLOT_DUPLICATE_SLOT_NAMES",X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN:39,39:"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",X_V_SLOT_MISPLACED:40,40:"X_V_SLOT_MISPLACED",X_V_MODEL_NO_EXPRESSION:41,41:"X_V_MODEL_NO_EXPRESSION",X_V_MODEL_MALFORMED_EXPRESSION:42,42:"X_V_MODEL_MALFORMED_EXPRESSION",X_V_MODEL_ON_SCOPE_VARIABLE:43,43:"X_V_MODEL_ON_SCOPE_VARIABLE",X_V_MODEL_ON_PROPS:44,44:"X_V_MODEL_ON_PROPS",X_INVALID_EXPRESSION:45,45:"X_INVALID_EXPRESSION",X_KEEP_ALIVE_INVALID_CHILDREN:46,46:"X_KEEP_ALIVE_INVALID_CHILDREN",X_PREFIX_ID_NOT_SUPPORTED:47,47:"X_PREFIX_ID_NOT_SUPPORTED",X_MODULE_MODE_NOT_SUPPORTED:48,48:"X_MODULE_MODE_NOT_SUPPORTED",X_CACHE_HANDLER_NOT_SUPPORTED:49,49:"X_CACHE_HANDLER_NOT_SUPPORTED",X_SCOPE_ID_NOT_SUPPORTED:50,50:"X_SCOPE_ID_NOT_SUPPORTED",X_VNODE_HOOKS:51,51:"X_VNODE_HOOKS",X_V_BIND_INVALID_SAME_NAME_ARGUMENT:52,52:"X_V_BIND_INVALID_SAME_NAME_ARGUMENT",__EXTEND_POINT__:53,53:"__EXTEND_POINT__"},e.FRAGMENT=C,e.GUARD_REACTIVE_PROPS=z,e.IS_MEMO_SAME=eh,e.IS_REF=el,e.KEEP_ALIVE=v,e.MERGE_PROPS=W,e.NORMALIZE_CLASS=K,e.NORMALIZE_PROPS=Q,e.NORMALIZE_STYLE=Y,e.Namespaces={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},e.NodeTypes={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},e.OPEN_BLOCK=L,e.POP_SCOPE_ID=er,e.PUSH_SCOPE_ID=es,e.RENDER_LIST=G,e.RENDER_SLOT=q,e.RESOLVE_COMPONENT=U,e.RESOLVE_DIRECTIVE=B,e.RESOLVE_DYNAMIC_COMPONENT=F,e.RESOLVE_FILTER=$,e.SET_BLOCK_TRACKING=ei,e.SUSPENSE=R,e.TELEPORT=b,e.TO_DISPLAY_STRING=j,e.TO_HANDLERS=Z,e.TO_HANDLER_KEY=en,e.TRANSITION=nq,e.TRANSITION_GROUP=nJ,e.TS_NODE_TYPES=eJ,e.UNREF=ea,e.V_MODEL_CHECKBOX=nw,e.V_MODEL_DYNAMIC=nB,e.V_MODEL_RADIO=nX,e.V_MODEL_SELECT=nF,e.V_MODEL_TEXT=nU,e.V_ON_WITH_KEYS=nH,e.V_ON_WITH_MODIFIERS=n$,e.V_SHOW=nG,e.WITH_CTX=eo,e.WITH_DIRECTIVES=H,e.WITH_MEMO=ec,e.advancePositionWithClone=function(e,t,n=t.length){return e4({offset:e.offset,line:e.line,column:e.column},t,n)},e.advancePositionWithMutation=e4,e.assert=function(e,t){if(!e)throw Error(t||"unexpected compiler condition")},e.baseCompile=nV,e.baseParse=tF,e.buildDirectiveArgs=nS,e.buildProps=n_,e.buildSlots=np,e.checkCompatEnabled=eU,e.compile=function(e,t={}){return nV(e,a({},nj,t,{nodeTransforms:[n2,...n3,...t.nodeTransforms||[]],directiveTransforms:a({},n4,t.directiveTransforms||{}),transformHoist:null}))},e.convertToBlock=eR,e.createArrayExpression=e_,e.createAssignmentExpression=function(e,t){return{type:24,left:e,right:t,loc:eu}},e.createBlockStatement=eA,e.createCacheExpression=eO,e.createCallExpression=eN,e.createCompilerError=e$,e.createCompoundExpression=eT,e.createConditionalExpression=ey,e.createDOMCompilerError=function(e,t){return e$(e,t)},e.createForLoopParams=na,e.createFunctionExpression=eI,e.createIfStatement=function(e,t,n){return{type:23,test:e,consequent:t,alternate:n,loc:eu}},e.createInterpolation=function(e,t){return{type:5,loc:t,content:c(e)?eg(e,!1,t):e}},e.createObjectExpression=em,e.createObjectProperty=eS,e.createReturnStatement=function(e){return{type:26,returns:e,loc:eu}},e.createRoot=ef,e.createSequenceExpression=function(e){return{type:25,expressions:e,loc:eu}},e.createSimpleExpression=eg,e.createStructuralDirectiveTransform=tK,e.createTemplateLiteral=function(e){return{type:22,elements:e,loc:eu}},e.createTransformContext=tJ,e.createVNodeCall=eE,e.errorMessages=eH,e.extractIdentifiers=eG,e.findDir=e6,e.findProp=e5,e.forAliasRE=tl,e.generate=tz,e.generateCodeFrame=function(e,t=0,n=e.length){if((t=Math.max(0,Math.min(t,e.length)))>(n=Math.max(0,Math.min(n,e.length))))return"";let i=e.split(/(\r?\n)/),s=i.filter((e,t)=>t%2==1);i=i.filter((e,t)=>t%2==0);let r=0,o=[];for(let e=0;e<i.length;e++)if((r+=i[e].length+(s[e]&&s[e].length||0))>=t){for(let a=e-2;a<=e+2||n>r;a++){if(a<0||a>=i.length)continue;let l=a+1;o.push(`${l}${" ".repeat(Math.max(3-String(l).length,0))}| ${i[a]}`);let c=i[a].length,h=s[a]&&s[a].length||0;if(a===e){let e=t-(r-(c+h)),i=Math.max(1,n>r?c-e:n-t);o.push(" | "+" ".repeat(e)+"^".repeat(i))}else if(a>e){if(n>r){let e=Math.max(Math.min(n-r,c),1);o.push(" | "+"^".repeat(e))}r+=c+h}}break}return o.join("\n")},e.getBaseTransformPreset=nP,e.getConstantType=t$,e.getMemoedVNodeCall=ta,e.getVNodeBlockHelper=eb,e.getVNodeHelper=eC,e.hasDynamicKeyVBind=e7,e.hasScopeRef=function e(t,n){if(!t||0===Object.keys(n).length)return!1;switch(t.type){case 1:for(let i=0;i<t.props.length;i++){let s=t.props[i];if(7===s.type&&(e(s.arg,n)||e(s.exp,n)))return!0}return t.children.some(t=>e(t,n));case 11:if(e(t.source,n))return!0;return t.children.some(t=>e(t,n));case 9:return t.branches.some(t=>e(t,n));case 10:if(e(t.condition,n))return!0;return t.children.some(t=>e(t,n));case 4:return!t.isStatic&&eY(t.content)&&!!n[t.content];case 8:return t.children.some(t=>p(t)&&e(t,n));case 5:case 12:return e(t.content,n);default:return!1}},e.helperNameMap=ep,e.injectProp=ts,e.isCoreComponent=eW,e.isFnExpression=e3,e.isFnExpressionBrowser=e3,e.isFnExpressionNode=s,e.isFunctionType=e=>/Function(?:Expression|Declaration)$|Method$/.test(e.type),e.isInDestructureAssignment=function(e,t){if(e&&("ObjectProperty"===e.type||"ArrayPattern"===e.type)){let e=t.length;for(;e--;){let n=t[e];if("AssignmentExpression"===n.type)return!0;if("ObjectProperty"!==n.type&&!n.type.endsWith("Pattern"))break}}return!1},e.isInNewExpression=function(e){let t=e.length;for(;t--;){let n=e[t];if("NewExpression"===n.type)return!0;if("MemberExpression"!==n.type)break}return!1},e.isMemberExpression=e0,e.isMemberExpressionBrowser=e0,e.isMemberExpressionNode=s,e.isReferencedIdentifier=function(e,t,n){return!1},e.isSimpleIdentifier=eY,e.isSlotOutlet=tn,e.isStaticArgOf=e9,e.isStaticExp=ej,e.isStaticProperty=eq,e.isStaticPropertyKey=(e,t)=>eq(t)&&t.key===e,e.isTemplateNode=tt,e.isText=e8,e.isVSlot=te,e.locStub=eu,e.noopDirectiveTransform=nk,e.parse=function(e,t={}){return tF(e,a({},nj,t))},e.parserOptions=nj,e.processExpression=t6,e.processFor=nr,e.processIf=t9,e.processSlotOutlet=nN,e.registerRuntimeHelpers=ed,e.resolveComponentType=nE,e.stringifyExpression=function e(t){return c(t)?t:4===t.type?t.content:t.children.map(e).join("")},e.toValidAssetId=to,e.trackSlotScopes=nc,e.trackVForSlotScopes=(e,t)=>{let n;if(tt(e)&&e.props.some(te)&&(n=e6(e,"for"))){let e=n.forParseResult;if(e){no(e);let{value:n,key:i,index:s}=e,{addIdentifiers:r,removeIdentifiers:o}=t;return n&&r(n),i&&r(i),s&&r(s),()=>{n&&o(n),i&&o(i),s&&o(s)}}}},e.transform=tj,e.transformBind=nt,e.transformElement=nf,e.transformExpression=(e,t)=>{if(5===e.type)e.content=t6(e.content,t);else if(1===e.type){let n=e6(e,"memo");for(let i=0;i<e.props.length;i++){let s=e.props[i];if(7===s.type&&"for"!==s.name){let e=s.exp,i=s.arg;!e||4!==e.type||"on"===s.name&&i||n&&i&&4===i.type&&"key"===i.content||(s.exp=t6(e,t,"slot"===s.name)),i&&4===i.type&&!i.isStatic&&(s.arg=t6(i,t))}}}},e.transformModel=nC,e.transformOn=nI,e.transformStyle=nW,e.traverseNode=tW,e.unwrapTSNode=function e(t){return eJ.includes(t.type)?e(t.expression):t},e.walkBlockDeclarations=function(e,t){for(let n of e.body)if("VariableDeclaration"===n.type){if(n.declare)continue;for(let e of n.declarations)for(let n of eG(e.id))t(n)}else if("FunctionDeclaration"===n.type||"ClassDeclaration"===n.type){if(n.declare||!n.id)continue;t(n.id)}else("ForOfStatement"===n.type||"ForInStatement"===n.type||"ForStatement"===n.type)&&function(e,t,n){let i="ForStatement"===e.type?e.init:e.left;if(i&&"VariableDeclaration"===i.type&&("var"===i.kind?t:!t))for(let e of i.declarations)for(let t of eG(e.id))n(t)}(n,!0,t)},e.walkFunctionParams=function(e,t){for(let n of e.params)for(let e of eG(n))t(e)},e.walkIdentifiers=function(e,t,n=!1,i=[],s=Object.create(null)){},e.warnDeprecation=function(e,t,n,...i){if("suppress-warning"===eX(e,t))return;let{message:s,link:r}=ek[e],o=SyntaxError(`(deprecation ${e}) ${"function"==typeof s?s(...i):s}${r?` + Details: ${r}`:""}`);o.code=e,n&&(o.loc=n),t.onWarn(o)},e}({}); diff --git a/seller_1/node_modules/@vue/compiler-dom/index.js b/seller_1/node_modules/@vue/compiler-dom/index.js new file mode 100644 index 0000000..b5f7a05 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/compiler-dom.cjs.prod.js') +} else { + module.exports = require('./dist/compiler-dom.cjs.js') +} diff --git a/seller_1/node_modules/@vue/compiler-dom/package.json b/seller_1/node_modules/@vue/compiler-dom/package.json new file mode 100644 index 0000000..f494774 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-dom/package.json @@ -0,0 +1,57 @@ +{ + "name": "@vue/compiler-dom", + "version": "3.5.13", + "description": "@vue/compiler-dom", + "main": "index.js", + "module": "dist/compiler-dom.esm-bundler.js", + "types": "dist/compiler-dom.d.ts", + "unpkg": "dist/compiler-dom.global.js", + "jsdelivr": "dist/compiler-dom.global.js", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/compiler-dom.d.ts", + "node": { + "production": "./dist/compiler-dom.cjs.prod.js", + "development": "./dist/compiler-dom.cjs.js", + "default": "./index.js" + }, + "module": "./dist/compiler-dom.esm-bundler.js", + "import": "./dist/compiler-dom.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "sideEffects": false, + "buildOptions": { + "name": "VueCompilerDOM", + "compat": true, + "formats": [ + "esm-bundler", + "esm-browser", + "cjs", + "global" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/compiler-dom" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme", + "dependencies": { + "@vue/shared": "3.5.13", + "@vue/compiler-core": "3.5.13" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/compiler-sfc/LICENSE b/seller_1/node_modules/@vue/compiler-sfc/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/compiler-sfc/README.md b/seller_1/node_modules/@vue/compiler-sfc/README.md new file mode 100644 index 0000000..4f8ff3a --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/README.md @@ -0,0 +1,80 @@ +# @vue/compiler-sfc + +> Lower level utilities for compiling Vue Single File Components + +**Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/compiler-sfc`. This means you no longer need to explicitly install this package and ensure its version match that of `vue`'s. Just use the main `vue/compiler-sfc` deep import instead.** + +This package contains lower level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue Single File Components (SFCs) into JavaScript. It is used in [vue-loader](https://github.com/vuejs/vue-loader) and [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue). + +## API + +The API is intentionally low-level due to the various considerations when integrating Vue SFCs in a build system: + +- Separate hot-module replacement (HMR) for script, template and styles + + - template updates should not reset component state + - style updates should be performed without component re-render + +- Leveraging the tool's plugin system for pre-processor handling. e.g. `<style lang="scss">` should be processed by the corresponding webpack loader. + +- In some cases, transformers of each block in an SFC do not share the same execution context. For example, when used with `thread-loader` or other parallelized configurations, the template sub-loader in `vue-loader` may not have access to the full SFC and its descriptor. + +The general idea is to generate a facade module that imports the individual blocks of the component. The trick is the module imports itself with different query strings so that the build system can handle each request as "virtual" modules: + +``` + +--------------------+ + | | + | script transform | + +----->+ | + | +--------------------+ + | ++--------------------+ | +--------------------+ +| | | | | +| facade transform +----------->+ template transform | +| | | | | ++--------------------+ | +--------------------+ + | + | +--------------------+ + +----->+ | + | style transform | + | | + +--------------------+ +``` + +Where the facade module looks like this: + +```js +// main script +import script from '/project/foo.vue?vue&type=script' +// template compiled to render function +import { render } from '/project/foo.vue?vue&type=template&id=xxxxxx' +// css +import '/project/foo.vue?vue&type=style&index=0&id=xxxxxx' + +// attach render function to script +script.render = render + +// attach additional metadata +// some of these should be dev only +script.__file = 'example.vue' +script.__scopeId = 'xxxxxx' + +// additional tooling-specific HMR handling code +// using __VUE_HMR_API__ global + +export default script +``` + +### High Level Workflow + +1. In facade transform, parse the source into descriptor with the `parse` API and generate the above facade module code based on the descriptor; + +2. In script transform, use `compileScript` to process the script. This handles features like `<script setup>` and CSS variable injection. Alternatively, this can be done directly in the facade module (with the code inlined instead of imported), but it will require rewriting `export default` to a temp variable (a `rewriteDefault` convenience API is provided for this purpose) so additional options can be attached to the exported object. + +3. In template transform, use `compileTemplate` to compile the raw template into render function code. + +4. In style transform, use `compileStyle` to compile raw CSS to handle `<style scoped>`, `<style module>` and CSS variable injection. + +Options needed for these APIs can be passed via the query string. + +For detailed API references and options, check out the source type definitions. For actual usage of these APIs, check out [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue) or [vue-loader](https://github.com/vuejs/vue-loader/tree/next). diff --git a/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js new file mode 100644 index 0000000..dc6a170 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js @@ -0,0 +1,24970 @@ +/** +* @vue/compiler-sfc v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var compilerCore = require('@vue/compiler-core'); +var CompilerDOM = require('@vue/compiler-dom'); +var sourceMapJs = require('source-map-js'); +var shared = require('@vue/shared'); +var path$1 = require('path'); +var url = require('url'); +var CompilerSSR = require('@vue/compiler-ssr'); +var require$$2 = require('util'); +var require$$0 = require('fs'); +var require$$0$1 = require('postcss'); +var estreeWalker = require('estree-walker'); +var MagicString = require('magic-string'); +var parser$2 = require('@babel/parser'); +var process$1 = require('process'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + for (var k in e) { + n[k] = e[k]; + } + } + n.default = e; + return Object.freeze(n); +} + +var CompilerDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(CompilerDOM); +var CompilerSSR__namespace = /*#__PURE__*/_interopNamespaceDefault(CompilerSSR); +var process__namespace = /*#__PURE__*/_interopNamespaceDefault(process$1); + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var hashSum; +var hasRequiredHashSum; + +function requireHashSum () { + if (hasRequiredHashSum) return hashSum; + hasRequiredHashSum = 1; + + function pad (hash, len) { + while (hash.length < len) { + hash = '0' + hash; + } + return hash; + } + + function fold (hash, text) { + var i; + var chr; + var len; + if (text.length === 0) { + return hash; + } + for (i = 0, len = text.length; i < len; i++) { + chr = text.charCodeAt(i); + hash = ((hash << 5) - hash) + chr; + hash |= 0; + } + return hash < 0 ? hash * -2 : hash; + } + + function foldObject (hash, o, seen) { + return Object.keys(o).sort().reduce(foldKey, hash); + function foldKey (hash, key) { + return foldValue(hash, o[key], key, seen); + } + } + + function foldValue (input, value, key, seen) { + var hash = fold(fold(fold(input, key), toString(value)), typeof value); + if (value === null) { + return fold(hash, 'null'); + } + if (value === undefined) { + return fold(hash, 'undefined'); + } + if (typeof value === 'object' || typeof value === 'function') { + if (seen.indexOf(value) !== -1) { + return fold(hash, '[Circular]' + key); + } + seen.push(value); + + var objHash = foldObject(hash, value, seen); + + if (!('valueOf' in value) || typeof value.valueOf !== 'function') { + return objHash; + } + + try { + return fold(objHash, String(value.valueOf())) + } catch (err) { + return fold(objHash, '[valueOf exception]' + (err.stack || err.message)) + } + } + return fold(hash, value.toString()); + } + + function toString (o) { + return Object.prototype.toString.call(o); + } + + function sum (o) { + return pad(foldValue(0, o, '', []).toString(16), 8); + } + + hashSum = sum; + return hashSum; +} + +var hashSumExports = /*@__PURE__*/ requireHashSum(); +var hash = /*@__PURE__*/getDefaultExportFromCjs(hashSumExports); + +const CSS_VARS_HELPER = `useCssVars`; +function genCssVarsFromList(vars, id, isProd, isSSR = false) { + return `{ + ${vars.map( + (key) => `"${isSSR ? `--` : ``}${genVarName(id, key, isProd, isSSR)}": (${key})` + ).join(",\n ")} +}`; +} +function genVarName(id, raw, isProd, isSSR = false) { + if (isProd) { + return hash(id + raw); + } else { + return `${id}-${shared.getEscapedCssVarName(raw, isSSR)}`; + } +} +function normalizeExpression(exp) { + exp = exp.trim(); + if (exp[0] === `'` && exp[exp.length - 1] === `'` || exp[0] === `"` && exp[exp.length - 1] === `"`) { + return exp.slice(1, -1); + } + return exp; +} +const vBindRE = /v-bind\s*\(/g; +function parseCssVars(sfc) { + const vars = []; + sfc.styles.forEach((style) => { + let match; + const content = style.content.replace(/\/\*([\s\S]*?)\*\/|\/\/.*/g, ""); + while (match = vBindRE.exec(content)) { + const start = match.index + match[0].length; + const end = lexBinding(content, start); + if (end !== null) { + const variable = normalizeExpression(content.slice(start, end)); + if (!vars.includes(variable)) { + vars.push(variable); + } + } + } + }); + return vars; +} +function lexBinding(content, start) { + let state = 0 /* inParens */; + let parenDepth = 0; + for (let i = start; i < content.length; i++) { + const char = content.charAt(i); + switch (state) { + case 0 /* inParens */: + if (char === `'`) { + state = 1 /* inSingleQuoteString */; + } else if (char === `"`) { + state = 2 /* inDoubleQuoteString */; + } else if (char === `(`) { + parenDepth++; + } else if (char === `)`) { + if (parenDepth > 0) { + parenDepth--; + } else { + return i; + } + } + break; + case 1 /* inSingleQuoteString */: + if (char === `'`) { + state = 0 /* inParens */; + } + break; + case 2 /* inDoubleQuoteString */: + if (char === `"`) { + state = 0 /* inParens */; + } + break; + } + } + return null; +} +const cssVarsPlugin = (opts) => { + const { id, isProd } = opts; + return { + postcssPlugin: "vue-sfc-vars", + Declaration(decl) { + const value = decl.value; + if (vBindRE.test(value)) { + vBindRE.lastIndex = 0; + let transformed = ""; + let lastIndex = 0; + let match; + while (match = vBindRE.exec(value)) { + const start = match.index + match[0].length; + const end = lexBinding(value, start); + if (end !== null) { + const variable = normalizeExpression(value.slice(start, end)); + transformed += value.slice(lastIndex, match.index) + `var(--${genVarName(id, variable, isProd)})`; + lastIndex = end + 1; + } + } + decl.value = transformed + value.slice(lastIndex); + } + } + }; +}; +cssVarsPlugin.postcss = true; +function genCssVarsCode(vars, bindings, id, isProd) { + const varsExp = genCssVarsFromList(vars, id, isProd); + const exp = CompilerDOM.createSimpleExpression(varsExp, false); + const context = CompilerDOM.createTransformContext(CompilerDOM.createRoot([]), { + prefixIdentifiers: true, + inline: true, + bindingMetadata: bindings.__isScriptSetup === false ? void 0 : bindings + }); + const transformed = CompilerDOM.processExpression(exp, context); + const transformedString = transformed.type === 4 ? transformed.content : transformed.children.map((c) => { + return typeof c === "string" ? c : c.content; + }).join(""); + return `_${CSS_VARS_HELPER}(_ctx => (${transformedString}))`; +} +function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd, defaultVar) { + return ` +import { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue' +const __injectCSSVars__ = () => { +${genCssVarsCode( + cssVars, + bindings, + id, + isProd + )}} +const __setup__ = ${defaultVar}.setup +${defaultVar}.setup = __setup__ + ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) } + : __injectCSSVars__ +`; +} + +/** + * @module LRUCache + */ +const perf = typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? process : {}); +/* c8 ignore start */ +const emitWarning = (msg, type, code, fn) => { + typeof PROCESS.emitWarning === 'function' + ? PROCESS.emitWarning(msg, type, code, fn) + : console.error(`[${code}] ${type}: ${msg}`); +}; +let AC = globalThis.AbortController; +let AS = globalThis.AbortSignal; +/* c8 ignore start */ +if (typeof AC === 'undefined') { + //@ts-ignore + AS = class AbortSignal { + onabort; + _onabort = []; + reason; + aborted = false; + addEventListener(_, fn) { + this._onabort.push(fn); + } + }; + //@ts-ignore + AC = class AbortController { + constructor() { + warnACPolyfill(); + } + signal = new AS(); + abort(reason) { + if (this.signal.aborted) + return; + //@ts-ignore + this.signal.reason = reason; + //@ts-ignore + this.signal.aborted = true; + //@ts-ignore + for (const fn of this.signal._onabort) { + fn(reason); + } + this.signal.onabort?.(reason); + } + }; + let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'; + const warnACPolyfill = () => { + if (!printACPolyfillWarning) + return; + printACPolyfillWarning = false; + emitWarning('AbortController is not defined. If using lru-cache in ' + + 'node 14, load an AbortController polyfill from the ' + + '`node-abort-controller` package. A minimal polyfill is ' + + 'provided for use by LRUCache.fetch(), but it should not be ' + + 'relied upon in other contexts (eg, passing it to other APIs that ' + + 'use AbortController/AbortSignal might have undesirable effects). ' + + 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill); + }; +} +/* c8 ignore stop */ +const shouldWarn = (code) => !warned.has(code); +const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); +/* c8 ignore start */ +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +const getUintArray = (max) => !isPosInt(max) + ? null + : max <= Math.pow(2, 8) + ? Uint8Array + : max <= Math.pow(2, 16) + ? Uint16Array + : max <= Math.pow(2, 32) + ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER + ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + heap; + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * All properties from the options object (with the exception of + * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as + * normal public members. (`max` and `maxBase` are read-only getters.) + * Changing any of these will alter the defaults for subsequent method calls, + * but is otherwise safe. + */ +class LRUCache { + // properties coming in from the options of these, only max and maxSize + // really *need* to be protected. The rest can be modified, as they just + // set defaults for various methods. + #max; + #maxSize; + #dispose; + #disposeAfter; + #fetchMethod; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (fetchMethod !== undefined && + typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = new Array(max).fill(undefined); + this.#valList = new Array(max).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the remaining TTL time for a given entry key + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + this.#setItemTTL = (index, ttl, start = perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.delete(this.#keyList[index]); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? perf.now() : 0; + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + return 0; + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to Array.find(). fn is called as fn(value, key, cache). + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from + * most recently used to least recently used. fn is called as + * fn(value, key, cache). Does not update age or recenty of use. + * Does not iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.delete(this.#keyList[i]); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a + * single key. Always returns stale values, if their info is found in the + * cache, so be sure to check for expired TTLs if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to cache.load() + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * Note that the shape of the resulting cache may be different if the + * same options are not used in both caches. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = perf.now() - age; + } + this.set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + */ + set(k, v, setOptions = {}) { + if (v === undefined) { + this.delete(k); + return this; + } + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + // have to delete, in case something is there already. + this.delete(k); + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 + ? this.#tail + : this.#free.length !== 0 + ? this.#free.pop() + : this.#size === this.#max + ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + } + else { + // update + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')); + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && !noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else if (!noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (status) { + status.set = 'replace'; + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + } + else if (status) { + status.set = 'update'; + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, 'evict']); + } + } + this.#removeItemSize(head); + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; + } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AC(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + if (this.#valList[index] === p) { + if (v === undefined) { + if (bf.__staleWhileFetching) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.delete(k); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.set(k, v, fetchOpts.options); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + return fetchFail(er); + }; + const fetchFail = (er) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || bf.__staleWhileFetching === undefined; + if (del) { + this.delete(k); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || + options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AC); + } + async fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + if (status) + status.get = 'stale'; + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.delete(k); + } + if (status && allowStale) + status.returnedStale = true; + return allowStale ? value : undefined; + } + else { + if (status && + allowStale && + value.__staleWhileFetching !== undefined) { + status.returnedStale = true; + } + return allowStale ? value.__staleWhileFetching : undefined; + } + } + else { + if (status) + status.get = 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching; + } + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return value; + } + } + else if (status) { + status.get = 'miss'; + } + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + deleted = true; + if (this.#size === 1) { + this.clear(); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, 'delete'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, 'delete']); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, 'delete'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, 'delete']); + } + } + } + this.#keyMap.clear(); + this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} + +function createCache(max = 500) { + return new LRUCache({ max }); +} + +function isImportUsed(local, sfc) { + return resolveTemplateUsedIdentifiers(sfc).has(local); +} +const templateUsageCheckCache = createCache(); +function resolveTemplateUsedIdentifiers(sfc) { + const { content, ast } = sfc.template; + const cached = templateUsageCheckCache.get(content); + if (cached) { + return cached; + } + const ids = /* @__PURE__ */ new Set(); + ast.children.forEach(walk); + function walk(node) { + var _a; + switch (node.type) { + case 1: + let tag = node.tag; + if (tag.includes(".")) tag = tag.split(".")[0].trim(); + if (!CompilerDOM.parserOptions.isNativeTag(tag) && !CompilerDOM.parserOptions.isBuiltInComponent(tag)) { + ids.add(shared.camelize(tag)); + ids.add(shared.capitalize(shared.camelize(tag))); + } + for (let i = 0; i < node.props.length; i++) { + const prop = node.props[i]; + if (prop.type === 7) { + if (!shared.isBuiltInDirective(prop.name)) { + ids.add(`v${shared.capitalize(shared.camelize(prop.name))}`); + } + if (prop.arg && !prop.arg.isStatic) { + extractIdentifiers(ids, prop.arg); + } + if (prop.name === "for") { + extractIdentifiers(ids, prop.forParseResult.source); + } else if (prop.exp) { + extractIdentifiers(ids, prop.exp); + } else if (prop.name === "bind" && !prop.exp) { + ids.add(shared.camelize(prop.arg.content)); + } + } + if (prop.type === 6 && prop.name === "ref" && ((_a = prop.value) == null ? void 0 : _a.content)) { + ids.add(prop.value.content); + } + } + node.children.forEach(walk); + break; + case 5: + extractIdentifiers(ids, node.content); + break; + } + } + templateUsageCheckCache.set(content, ids); + return ids; +} +function extractIdentifiers(ids, node) { + if (node.ast) { + CompilerDOM.walkIdentifiers(node.ast, (n) => ids.add(n.name)); + } else if (node.ast === null) { + ids.add(node.content); + } +} + +const DEFAULT_FILENAME = "anonymous.vue"; +const parseCache$1 = createCache(); +function parse$1(source, options = {}) { + var _a; + const sourceKey = shared.genCacheKey(source, { + ...options, + compiler: { parse: (_a = options.compiler) == null ? void 0 : _a.parse } + }); + const cache = parseCache$1.get(sourceKey); + if (cache) { + return cache; + } + const { + sourceMap = true, + filename = DEFAULT_FILENAME, + sourceRoot = "", + pad = false, + ignoreEmpty = true, + compiler = CompilerDOM__namespace, + templateParseOptions = {} + } = options; + const descriptor = { + filename, + source, + template: null, + script: null, + scriptSetup: null, + styles: [], + customBlocks: [], + cssVars: [], + slotted: false, + shouldForceReload: (prevImports) => hmrShouldReload(prevImports, descriptor) + }; + const errors = []; + const ast = compiler.parse(source, { + parseMode: "sfc", + prefixIdentifiers: true, + ...templateParseOptions, + onError: (e) => { + errors.push(e); + } + }); + ast.children.forEach((node) => { + if (node.type !== 1) { + return; + } + if (ignoreEmpty && node.tag !== "template" && isEmpty(node) && !hasSrc(node)) { + return; + } + switch (node.tag) { + case "template": + if (!descriptor.template) { + const templateBlock = descriptor.template = createBlock( + node, + source, + false + ); + if (!templateBlock.attrs.src) { + templateBlock.ast = compilerCore.createRoot(node.children, source); + } + if (templateBlock.attrs.functional) { + const err = new SyntaxError( + `<template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.` + ); + err.loc = node.props.find( + (p) => p.type === 6 && p.name === "functional" + ).loc; + errors.push(err); + } + } else { + errors.push(createDuplicateBlockError(node)); + } + break; + case "script": + const scriptBlock = createBlock(node, source, pad); + const isSetup = !!scriptBlock.attrs.setup; + if (isSetup && !descriptor.scriptSetup) { + descriptor.scriptSetup = scriptBlock; + break; + } + if (!isSetup && !descriptor.script) { + descriptor.script = scriptBlock; + break; + } + errors.push(createDuplicateBlockError(node, isSetup)); + break; + case "style": + const styleBlock = createBlock(node, source, pad); + if (styleBlock.attrs.vars) { + errors.push( + new SyntaxError( + `<style vars> has been replaced by a new proposal: https://github.com/vuejs/rfcs/pull/231` + ) + ); + } + descriptor.styles.push(styleBlock); + break; + default: + descriptor.customBlocks.push(createBlock(node, source, pad)); + break; + } + }); + if (!descriptor.template && !descriptor.script && !descriptor.scriptSetup) { + errors.push( + new SyntaxError( + `At least one <template> or <script> is required in a single file component. ${descriptor.filename}` + ) + ); + } + if (descriptor.scriptSetup) { + if (descriptor.scriptSetup.src) { + errors.push( + new SyntaxError( + `<script setup> cannot use the "src" attribute because its syntax will be ambiguous outside of the component.` + ) + ); + descriptor.scriptSetup = null; + } + if (descriptor.script && descriptor.script.src) { + errors.push( + new SyntaxError( + `<script> cannot use the "src" attribute when <script setup> is also present because they must be processed together.` + ) + ); + descriptor.script = null; + } + } + let templateColumnOffset = 0; + if (descriptor.template && (descriptor.template.lang === "pug" || descriptor.template.lang === "jade")) { + [descriptor.template.content, templateColumnOffset] = dedent( + descriptor.template.content + ); + } + if (sourceMap) { + const genMap = (block, columnOffset = 0) => { + if (block && !block.src) { + block.map = generateSourceMap( + filename, + source, + block.content, + sourceRoot, + !pad || block.type === "template" ? block.loc.start.line - 1 : 0, + columnOffset + ); + } + }; + genMap(descriptor.template, templateColumnOffset); + genMap(descriptor.script); + descriptor.styles.forEach((s) => genMap(s)); + descriptor.customBlocks.forEach((s) => genMap(s)); + } + descriptor.cssVars = parseCssVars(descriptor); + const slottedRE = /(?:::v-|:)slotted\(/; + descriptor.slotted = descriptor.styles.some( + (s) => s.scoped && slottedRE.test(s.content) + ); + const result = { + descriptor, + errors + }; + parseCache$1.set(sourceKey, result); + return result; +} +function createDuplicateBlockError(node, isScriptSetup = false) { + const err = new SyntaxError( + `Single file component can contain only one <${node.tag}${isScriptSetup ? ` setup` : ``}> element` + ); + err.loc = node.loc; + return err; +} +function createBlock(node, source, pad) { + const type = node.tag; + const loc = node.innerLoc; + const attrs = {}; + const block = { + type, + content: source.slice(loc.start.offset, loc.end.offset), + loc, + attrs + }; + if (pad) { + block.content = padContent(source, block, pad) + block.content; + } + node.props.forEach((p) => { + if (p.type === 6) { + const name = p.name; + attrs[name] = p.value ? p.value.content || true : true; + if (name === "lang") { + block.lang = p.value && p.value.content; + } else if (name === "src") { + block.src = p.value && p.value.content; + } else if (type === "style") { + if (name === "scoped") { + block.scoped = true; + } else if (name === "module") { + block.module = attrs[name]; + } + } else if (type === "script" && name === "setup") { + block.setup = attrs.setup; + } + } + }); + return block; +} +const splitRE = /\r?\n/g; +const emptyRE = /^(?:\/\/)?\s*$/; +const replaceRE = /./g; +function generateSourceMap(filename, source, generated, sourceRoot, lineOffset, columnOffset) { + const map = new sourceMapJs.SourceMapGenerator({ + file: filename.replace(/\\/g, "/"), + sourceRoot: sourceRoot.replace(/\\/g, "/") + }); + map.setSourceContent(filename, source); + map._sources.add(filename); + generated.split(splitRE).forEach((line, index) => { + if (!emptyRE.test(line)) { + const originalLine = index + 1 + lineOffset; + const generatedLine = index + 1; + for (let i = 0; i < line.length; i++) { + if (!/\s/.test(line[i])) { + map._mappings.add({ + originalLine, + originalColumn: i + columnOffset, + generatedLine, + generatedColumn: i, + source: filename, + name: null + }); + } + } + } + }); + return map.toJSON(); +} +function padContent(content, block, pad) { + content = content.slice(0, block.loc.start.offset); + if (pad === "space") { + return content.replace(replaceRE, " "); + } else { + const offset = content.split(splitRE).length; + const padChar = block.type === "script" && !block.lang ? "//\n" : "\n"; + return Array(offset).join(padChar); + } +} +function hasSrc(node) { + return node.props.some((p) => { + if (p.type !== 6) { + return false; + } + return p.name === "src"; + }); +} +function isEmpty(node) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (child.type !== 2 || child.content.trim() !== "") { + return false; + } + } + return true; +} +function hmrShouldReload(prevImports, next) { + if (!next.scriptSetup || next.scriptSetup.lang !== "ts" && next.scriptSetup.lang !== "tsx") { + return false; + } + for (const key in prevImports) { + if (!prevImports[key].isUsedInTemplate && isImportUsed(key, next)) { + return true; + } + } + return false; +} +function dedent(s) { + const lines = s.split("\n"); + const minIndent = lines.reduce(function(minIndent2, line) { + var _a, _b; + if (line.trim() === "") { + return minIndent2; + } + const indent = ((_b = (_a = line.match(/^\s*/)) == null ? void 0 : _a[0]) == null ? void 0 : _b.length) || 0; + return Math.min(indent, minIndent2); + }, Infinity); + if (minIndent === 0) { + return [s, minIndent]; + } + return [ + lines.map(function(line) { + return line.slice(minIndent); + }).join("\n"), + minIndent + ]; +} + +function isRelativeUrl(url) { + const firstChar = url.charAt(0); + return firstChar === "." || firstChar === "~" || firstChar === "@"; +} +const externalRE = /^(https?:)?\/\//; +function isExternalUrl(url) { + return externalRE.test(url); +} +const dataUrlRE = /^\s*data:/i; +function isDataUrl(url) { + return dataUrlRE.test(url); +} +function parseUrl(url) { + const firstChar = url.charAt(0); + if (firstChar === "~") { + const secondChar = url.charAt(1); + url = url.slice(secondChar === "/" ? 2 : 1); + } + return parseUriParts(url); +} +function parseUriParts(urlString) { + return url.parse(shared.isString(urlString) ? urlString : "", false, true); +} + +const defaultAssetUrlOptions = { + base: null, + includeAbsolute: false, + tags: { + video: ["src", "poster"], + source: ["src"], + img: ["src"], + image: ["xlink:href", "href"], + use: ["xlink:href", "href"] + } +}; +const normalizeOptions = (options) => { + if (Object.keys(options).some((key) => shared.isArray(options[key]))) { + return { + ...defaultAssetUrlOptions, + tags: options + }; + } + return { + ...defaultAssetUrlOptions, + ...options + }; +}; +const createAssetUrlTransformWithOptions = (options) => { + return (node, context) => transformAssetUrl(node, context, options); +}; +const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => { + if (node.type === 1) { + if (!node.props.length) { + return; + } + const tags = options.tags || defaultAssetUrlOptions.tags; + const attrs = tags[node.tag]; + const wildCardAttrs = tags["*"]; + if (!attrs && !wildCardAttrs) { + return; + } + const assetAttrs = (attrs || []).concat(wildCardAttrs || []); + node.props.forEach((attr, index) => { + if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value || isExternalUrl(attr.value.content) || isDataUrl(attr.value.content) || attr.value.content[0] === "#" || !options.includeAbsolute && !isRelativeUrl(attr.value.content)) { + return; + } + const url = parseUrl(attr.value.content); + if (options.base && attr.value.content[0] === ".") { + const base = parseUrl(options.base); + const protocol = base.protocol || ""; + const host = base.host ? protocol + "//" + base.host : ""; + const basePath = base.path || "/"; + attr.value.content = host + (path$1.posix || path$1).join(basePath, url.path + (url.hash || "")); + return; + } + const exp = getImportsExpressionExp(url.path, url.hash, attr.loc, context); + node.props[index] = { + type: 7, + name: "bind", + arg: compilerCore.createSimpleExpression(attr.name, true, attr.loc), + exp, + modifiers: [], + loc: attr.loc + }; + }); + } +}; +function getImportsExpressionExp(path2, hash, loc, context) { + if (path2) { + let name; + let exp; + const existingIndex = context.imports.findIndex((i) => i.path === path2); + if (existingIndex > -1) { + name = `_imports_${existingIndex}`; + exp = context.imports[existingIndex].exp; + } else { + name = `_imports_${context.imports.length}`; + exp = compilerCore.createSimpleExpression( + name, + false, + loc, + 3 + ); + context.imports.push({ + exp, + path: decodeURIComponent(path2) + }); + } + if (!hash) { + return exp; + } + const hashExp = `${name} + '${hash}'`; + const finalExp = compilerCore.createSimpleExpression( + hashExp, + false, + loc, + 3 + ); + if (!context.hoistStatic) { + return finalExp; + } + const existingHoistIndex = context.hoists.findIndex((h) => { + return h && h.type === 4 && !h.isStatic && h.content === hashExp; + }); + if (existingHoistIndex > -1) { + return compilerCore.createSimpleExpression( + `_hoisted_${existingHoistIndex + 1}`, + false, + loc, + 3 + ); + } + return context.hoist(finalExp); + } else { + return compilerCore.createSimpleExpression(`''`, false, loc, 3); + } +} + +const srcsetTags = ["img", "source"]; +const escapedSpaceCharacters = /( |\\t|\\n|\\f|\\r)+/g; +const createSrcsetTransformWithOptions = (options) => { + return (node, context) => transformSrcset(node, context, options); +}; +const transformSrcset = (node, context, options = defaultAssetUrlOptions) => { + if (node.type === 1) { + if (srcsetTags.includes(node.tag) && node.props.length) { + node.props.forEach((attr, index) => { + if (attr.name === "srcset" && attr.type === 6) { + if (!attr.value) return; + const value = attr.value.content; + if (!value) return; + const imageCandidates = value.split(",").map((s) => { + const [url, descriptor] = s.replace(escapedSpaceCharacters, " ").trim().split(" ", 2); + return { url, descriptor }; + }); + for (let i = 0; i < imageCandidates.length; i++) { + const { url } = imageCandidates[i]; + if (isDataUrl(url)) { + imageCandidates[i + 1].url = url + "," + imageCandidates[i + 1].url; + imageCandidates.splice(i, 1); + } + } + const shouldProcessUrl = (url) => { + return !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url)); + }; + if (!imageCandidates.some(({ url }) => shouldProcessUrl(url))) { + return; + } + if (options.base) { + const base = options.base; + const set = []; + let needImportTransform = false; + imageCandidates.forEach((candidate) => { + let { url, descriptor } = candidate; + descriptor = descriptor ? ` ${descriptor}` : ``; + if (url[0] === ".") { + candidate.url = (path$1.posix || path$1).join(base, url); + set.push(candidate.url + descriptor); + } else if (shouldProcessUrl(url)) { + needImportTransform = true; + } else { + set.push(url + descriptor); + } + }); + if (!needImportTransform) { + attr.value.content = set.join(", "); + return; + } + } + const compoundExpression = compilerCore.createCompoundExpression([], attr.loc); + imageCandidates.forEach(({ url, descriptor }, index2) => { + if (shouldProcessUrl(url)) { + const { path: path2 } = parseUrl(url); + let exp2; + if (path2) { + const existingImportsIndex = context.imports.findIndex( + (i) => i.path === path2 + ); + if (existingImportsIndex > -1) { + exp2 = compilerCore.createSimpleExpression( + `_imports_${existingImportsIndex}`, + false, + attr.loc, + 3 + ); + } else { + exp2 = compilerCore.createSimpleExpression( + `_imports_${context.imports.length}`, + false, + attr.loc, + 3 + ); + context.imports.push({ exp: exp2, path: path2 }); + } + compoundExpression.children.push(exp2); + } + } else { + const exp2 = compilerCore.createSimpleExpression( + `"${url}"`, + false, + attr.loc, + 3 + ); + compoundExpression.children.push(exp2); + } + const isNotLast = imageCandidates.length - 1 > index2; + if (descriptor && isNotLast) { + compoundExpression.children.push(` + ' ${descriptor}, ' + `); + } else if (descriptor) { + compoundExpression.children.push(` + ' ${descriptor}'`); + } else if (isNotLast) { + compoundExpression.children.push(` + ', ' + `); + } + }); + let exp = compoundExpression; + if (context.hoistStatic) { + exp = context.hoist(compoundExpression); + exp.constType = 3; + } + node.props[index] = { + type: 7, + name: "bind", + arg: compilerCore.createSimpleExpression("srcset", true, attr.loc), + exp, + modifiers: [], + loc: attr.loc + }; + } + }); + } + } +}; + +function commonjsRequire(path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); +} + +var consolidate$2 = {exports: {}}; + +var hasRequiredConsolidate$1; + +function requireConsolidate$1 () { + if (hasRequiredConsolidate$1) return consolidate$2.exports; + hasRequiredConsolidate$1 = 1; + (function (module, exports) { + /* + * Engines which do not support caching of their file contents + * should use the `read()` function defined in consolidate.js + * On top of this, when an engine compiles to a `Function`, + * these functions should either be cached within consolidate.js + * or the engine itself via `options.cache`. This will allow + * users and frameworks to pass `options.cache = true` for + * `NODE_ENV=production`, however edit the file(s) without + * re-loading the application in development. + */ + + /** + * Module dependencies. + */ + + var fs = require$$0; + var path = path$1; + var util = require$$2; + + var join = path.join; + var resolve = path.resolve; + var extname = path.extname; + var dirname = path.dirname; + var isAbsolute = path.isAbsolute; + + var readCache = {}; + + /** + * Require cache. + */ + + var cacheStore = {}; + + /** + * Require cache. + */ + + var requires = {}; + + /** + * Clear the cache. + * + * @api public + */ + + exports.clearCache = function() { + readCache = {}; + cacheStore = {}; + }; + + /** + * Conditionally cache `compiled` template based + * on the `options` filename and `.cache` boolean. + * + * @param {Object} options + * @param {Function} compiled + * @return {Function} + * @api private + */ + + function cache(options, compiled) { + // cachable + if (compiled && options.filename && options.cache) { + delete readCache[options.filename]; + cacheStore[options.filename] = compiled; + return compiled; + } + + // check cache + if (options.filename && options.cache) { + return cacheStore[options.filename]; + } + + return compiled; + } + + /** + * Read `path` with `options` with + * callback `(err, str)`. When `options.cache` + * is true the template string will be cached. + * + * @param {String} options + * @param {Function} cb + * @api private + */ + + function read(path, options, cb) { + var str = readCache[path]; + var cached = options.cache && str && typeof str === 'string'; + + // cached (only if cached is a string and not a compiled template function) + if (cached) return cb(null, str); + + // read + fs.readFile(path, 'utf8', function(err, str) { + if (err) return cb(err); + // remove extraneous utf8 BOM marker + str = str.replace(/^\uFEFF/, ''); + if (options.cache) readCache[path] = str; + cb(null, str); + }); + } + + /** + * Read `path` with `options` with + * callback `(err, str)`. When `options.cache` + * is true the partial string will be cached. + * + * @param {String} options + * @param {Function} fn + * @api private + */ + + function readPartials(path, options, cb) { + if (!options.partials) return cb(); + var keys = Object.keys(options.partials); + var partials = {}; + + function next(index) { + if (index === keys.length) return cb(null, partials); + var key = keys[index]; + var partialPath = options.partials[key]; + + if (partialPath === undefined || partialPath === null || partialPath === false) { + return next(++index); + } + + var file; + if (isAbsolute(partialPath)) { + if (extname(partialPath) !== '') { + file = partialPath; + } else { + file = join(partialPath + extname(path)); + } + } else { + file = join(dirname(path), partialPath + extname(path)); + } + + read(file, options, function(err, str) { + if (err) return cb(err); + partials[key] = str; + next(++index); + }); + } + + next(0); + } + + /** + * promisify + */ + function promisify(cb, fn) { + return new Promise(function(resolve, reject) { + cb = cb || function(err, html) { + if (err) { + return reject(err); + } + resolve(html); + }; + fn(cb); + }); + } + + /** + * fromStringRenderer + */ + + function fromStringRenderer(name) { + return function(path, options, cb) { + options.filename = path; + + return promisify(cb, function(cb) { + readPartials(path, options, function(err, partials) { + var extend = (requires.extend || (requires.extend = require$$2._extend)); + var opts = extend({}, options); + opts.partials = partials; + if (err) return cb(err); + if (cache(opts)) { + exports[name].render('', opts, cb); + } else { + read(path, opts, function(err, str) { + if (err) return cb(err); + exports[name].render(str, opts, cb); + }); + } + }); + }); + }; + } + + /** + * velocity support. + */ + + exports.velocityjs = fromStringRenderer('velocityjs'); + + /** + * velocity string support. + */ + + exports.velocityjs.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs')); + try { + options.locals = options; + cb(null, engine.render(str, options).trimLeft()); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Liquid support. + */ + + exports.liquid = fromStringRenderer('liquid'); + + /** + * Liquid string support. + */ + + /** + * Note that in order to get filters and custom tags we've had to push + * all user-defined locals down into @locals. However, just to make things + * backwards-compatible, any property of `options` that is left after + * processing and removing `locals`, `meta`, `filters`, `customTags` and + * `includeDir` will also become a local. + */ + + function _renderTinyliquid(engine, str, options, cb) { + var context = engine.newContext(); + var k; + + /** + * Note that there's a bug in the library that doesn't allow us to pass + * the locals to newContext(), hence looping through the keys: + */ + + if (options.locals) { + for (k in options.locals) { + context.setLocals(k, options.locals[k]); + } + delete options.locals; + } + + if (options.meta) { + context.setLocals('page', options.meta); + delete options.meta; + } + + /** + * Add any defined filters: + */ + + if (options.filters) { + for (k in options.filters) { + context.setFilter(k, options.filters[k]); + } + delete options.filters; + } + + /** + * Set up a callback for the include directory: + */ + + var includeDir = options.includeDir || process.cwd(); + + context.onInclude(function(name, callback) { + var extname = path.extname(name) ? '' : '.liquid'; + var filename = path.resolve(includeDir, name + extname); + + fs.readFile(filename, {encoding: 'utf8'}, function(err, data) { + if (err) return callback(err); + callback(null, engine.parse(data)); + }); + }); + delete options.includeDir; + + /** + * The custom tag functions need to have their results pushed back + * through the parser, so set up a shim before calling the provided + * callback: + */ + + var compileOptions = { + customTags: {} + }; + + if (options.customTags) { + var tagFunctions = options.customTags; + + for (k in options.customTags) { + /*Tell jshint there's no problem with having this function in the loop */ + /*jshint -W083 */ + compileOptions.customTags[k] = function(context, name, body) { + var tpl = tagFunctions[name](body.trim()); + context.astStack.push(engine.parse(tpl)); + }; + /*jshint +W083 */ + } + delete options.customTags; + } + + /** + * Now anything left in `options` becomes a local: + */ + + for (k in options) { + context.setLocals(k, options[k]); + } + + /** + * Finally, execute the template: + */ + + var tmpl = cache(context) || cache(context, engine.compile(str, compileOptions)); + tmpl(context, cb); + } + + exports.liquid.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.liquid; + var Liquid; + + try { + // set up tinyliquid engine + engine = requires.liquid = require('tinyliquid'); + + // use tinyliquid engine + _renderTinyliquid(engine, str, options, cb); + + return; + + } catch (err) { + + // set up liquid-node engine + try { + Liquid = requires.liquid = require('liquid-node'); + engine = new Liquid.Engine(); + } catch (err) { + throw err; + } + + } + + // use liquid-node engine + try { + var locals = options.locals || {}; + + if (options.meta) { + locals.pages = options.meta; + delete options.meta; + } + + /** + * Add any defined filters: + */ + + if (options.filters) { + engine.registerFilters(options.filters); + delete options.filters; + } + + /** + * Set up a callback for the include directory: + */ + + var includeDir = options.includeDir || process.cwd(); + engine.fileSystem = new Liquid.LocalFileSystem(includeDir, 'liquid'); + delete options.includeDir; + + /** + * The custom tag functions need to have their results pushed back + * through the parser, so set up a shim before calling the provided + * callback: + */ + + if (options.customTags) { + var tagFunctions = options.customTags; + + for (k in options.customTags) { + engine.registerTag(k, tagFunctions[k]); + } + delete options.customTags; + } + + /** + * Now anything left in `options` becomes a local: + */ + + for (var k in options) { + locals[k] = options[k]; + } + + /** + * Finally, execute the template: + */ + + return engine + .parseAndRender(str, locals) + .nodeify(function(err, result) { + if (err) { + throw new Error(err); + } else { + return cb(null, result); + } + }); + + } catch (err) { + cb(err); + } + }); + }; + + /** + * Jade support. + */ + + exports.jade = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.jade; + if (!engine) { + try { + engine = requires.jade = require('jade'); + } catch (err) { + try { + engine = requires.jade = require('then-jade'); + } catch (otherError) { + throw err; + } + } + } + + try { + var tmpl = cache(options) || cache(options, engine.compileFile(path, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Jade string support. + */ + + exports.jade.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.jade; + if (!engine) { + try { + engine = requires.jade = require('jade'); + } catch (err) { + try { + engine = requires.jade = require('then-jade'); + } catch (otherError) { + throw err; + } + } + } + + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Dust support. + */ + + exports.dust = fromStringRenderer('dust'); + + /** + * Dust string support. + */ + + exports.dust.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.dust; + if (!engine) { + try { + engine = requires.dust = require('dust'); + } catch (err) { + try { + engine = requires.dust = require('dustjs-helpers'); + } catch (err) { + engine = requires.dust = require('dustjs-linkedin'); + } + } + } + + var ext = 'dust'; + var views = '.'; + + if (options) { + if (options.ext) ext = options.ext; + if (options.views) views = options.views; + if (options.settings && options.settings.views) views = options.settings.views; + } + if (!options || (options && !options.cache)) engine.cache = {}; + + engine.onLoad = function(path, callback) { + if (extname(path) === '') path += '.' + ext; + if (path[0] !== '/') path = views + '/' + path; + read(path, options, callback); + }; + + try { + var templateName; + if (options.filename) { + templateName = options.filename.replace(new RegExp('^' + views + '/'), '').replace(new RegExp('\\.' + ext), ''); + } + + var tmpl = cache(options) || cache(options, engine.compileFn(str, templateName)); + tmpl(options, cb); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Swig support. + */ + + exports.swig = fromStringRenderer('swig'); + + /** + * Swig string support. + */ + + exports.swig.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.swig; + if (!engine) { + try { + engine = requires.swig = require('swig'); + } catch (err) { + try { + engine = requires.swig = require('swig-templates'); + } catch (otherError) { + throw err; + } + } + } + + try { + if (options.cache === true) options.cache = 'memory'; + engine.setDefaults({ cache: options.cache }); + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Razor support. + */ + + exports.razor = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.razor; + if (!engine) { + try { + engine = requires.razor = require('razor-tmpl'); + + } catch (err) { + + throw err; + + } + } + try { + + var tmpl = cache(options) || cache(options, (locals) => { + console.log('Rendering razor file', path); + return engine.renderFileSync(path, locals); + }); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * razor string support. + */ + + exports.razor.render = function(str, options, cb) { + return promisify(cb, function(cb) { + + try { + var engine = requires.razor = require('razor-tmpl'); + } catch (err) { + throw err; + } + + try { + var tf = engine.compile(str); + var tmpl = cache(options) || cache(options, tf); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Atpl support. + */ + + exports.atpl = fromStringRenderer('atpl'); + + /** + * Atpl string support. + */ + + exports.atpl.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.atpl || (requires.atpl = require('atpl')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Liquor support, + */ + + exports.liquor = fromStringRenderer('liquor'); + + /** + * Liquor string support. + */ + + exports.liquor.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.liquor || (requires.liquor = require('liquor')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Twig support. + */ + + exports.twig = fromStringRenderer('twig'); + + /** + * Twig string support. + */ + + exports.twig.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.twig || (requires.twig = require('twig').twig); + var templateData = { + data: str, + allowInlineIncludes: options.allowInlineIncludes, + namespaces: options.namespaces, + path: options.path + }; + try { + var tmpl = cache(templateData) || cache(templateData, engine(templateData)); + cb(null, tmpl.render(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * EJS support. + */ + + exports.ejs = fromStringRenderer('ejs'); + + /** + * EJS string support. + */ + + exports.ejs.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.ejs || (requires.ejs = require('ejs')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Eco support. + */ + + exports.eco = fromStringRenderer('eco'); + + /** + * Eco string support. + */ + + exports.eco.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.eco || (requires.eco = require('eco')); + try { + cb(null, engine.render(str, options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Jazz support. + */ + + exports.jazz = fromStringRenderer('jazz'); + + /** + * Jazz string support. + */ + + exports.jazz.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.jazz || (requires.jazz = require('jazz')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + tmpl.eval(options, function(str) { + cb(null, str); + }); + } catch (err) { + cb(err); + } + }); + }; + + /** + * JQTPL support. + */ + + exports.jqtpl = fromStringRenderer('jqtpl'); + + /** + * JQTPL string support. + */ + + exports.jqtpl.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.jqtpl || (requires.jqtpl = require('jqtpl')); + try { + engine.template(str, str); + cb(null, engine.tmpl(str, options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Haml support. + */ + + exports.haml = fromStringRenderer('haml'); + + /** + * Haml string support. + */ + + exports.haml.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.haml || (requires.haml = require('hamljs')); + try { + options.locals = options; + cb(null, engine.render(str, options).trimLeft()); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Hamlet support. + */ + + exports.hamlet = fromStringRenderer('hamlet'); + + /** + * Hamlet string support. + */ + + exports.hamlet.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.hamlet || (requires.hamlet = require('hamlet')); + try { + options.locals = options; + cb(null, engine.render(str, options).trimLeft()); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Whiskers support. + */ + + exports.whiskers = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.whiskers || (requires.whiskers = require('whiskers')); + engine.__express(path, options, cb); + }); + }; + + /** + * Whiskers string support. + */ + + exports.whiskers.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.whiskers || (requires.whiskers = require('whiskers')); + try { + cb(null, engine.render(str, options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Coffee-HAML support. + */ + + exports['haml-coffee'] = fromStringRenderer('haml-coffee'); + + /** + * Coffee-HAML string support. + */ + + exports['haml-coffee'].render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires['haml-coffee'] || (requires['haml-coffee'] = require('haml-coffee')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Hogan support. + */ + + exports.hogan = fromStringRenderer('hogan'); + + /** + * Hogan string support. + */ + + exports.hogan.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.hogan || (requires.hogan = require('hogan.js')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl.render(options, options.partials)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * templayed.js support. + */ + + exports.templayed = fromStringRenderer('templayed'); + + /** + * templayed.js string support. + */ + + exports.templayed.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.templayed || (requires.templayed = require('templayed')); + try { + var tmpl = cache(options) || cache(options, engine(str)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Handlebars support. + */ + + exports.handlebars = fromStringRenderer('handlebars'); + + /** + * Handlebars string support. + */ + + exports.handlebars.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.handlebars || (requires.handlebars = require('handlebars')); + try { + for (var partial in options.partials) { + engine.registerPartial(partial, options.partials[partial]); + } + for (var helper in options.helpers) { + engine.registerHelper(helper, options.helpers[helper]); + } + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Underscore support. + */ + + exports.underscore = fromStringRenderer('underscore'); + + /** + * Underscore string support. + */ + + exports.underscore.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.underscore || (requires.underscore = require('underscore')); + try { + const partials = {}; + for (var partial in options.partials) { + partials[partial] = engine.template(options.partials[partial]); + } + options.partials = partials; + var tmpl = cache(options) || cache(options, engine.template(str, null, options)); + cb(null, tmpl(options).replace(/\n$/, '')); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Lodash support. + */ + + exports.lodash = fromStringRenderer('lodash'); + + /** + * Lodash string support. + */ + + exports.lodash.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.lodash || (requires.lodash = require('lodash')); + try { + var tmpl = cache(options) || cache(options, engine.template(str, options)); + cb(null, tmpl(options).replace(/\n$/, '')); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Pug support. (formerly Jade) + */ + + exports.pug = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.pug; + if (!engine) { + try { + engine = requires.pug = require('pug'); + } catch (err) { + try { + engine = requires.pug = require('then-pug'); + } catch (otherError) { + throw err; + } + } + } + + try { + var tmpl = cache(options) || cache(options, engine.compileFile(path, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Pug string support. + */ + + exports.pug.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.pug; + if (!engine) { + try { + engine = requires.pug = require('pug'); + } catch (err) { + try { + engine = requires.pug = require('then-pug'); + } catch (otherError) { + throw err; + } + } + } + + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * QEJS support. + */ + + exports.qejs = fromStringRenderer('qejs'); + + /** + * QEJS string support. + */ + + exports.qejs.render = function(str, options, cb) { + return promisify(cb, function(cb) { + try { + var engine = requires.qejs || (requires.qejs = require('qejs')); + engine.render(str, options).then(function(result) { + cb(null, result); + }, function(err) { + cb(err); + }).done(); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Walrus support. + */ + + exports.walrus = fromStringRenderer('walrus'); + + /** + * Walrus string support. + */ + + exports.walrus.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.walrus || (requires.walrus = require('walrus')); + try { + var tmpl = cache(options) || cache(options, engine.parse(str)); + cb(null, tmpl.compile(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Mustache support. + */ + + exports.mustache = fromStringRenderer('mustache'); + + /** + * Mustache string support. + */ + + exports.mustache.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.mustache || (requires.mustache = require('mustache')); + try { + cb(null, engine.render(str, options, options.partials)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Just support. + */ + + exports.just = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.just; + if (!engine) { + var JUST = require('just'); + engine = requires.just = new JUST(); + } + engine.configure({ useCache: options.cache }); + engine.render(path, options, cb); + }); + }; + + /** + * Just string support. + */ + + exports.just.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var JUST = require('just'); + var engine = new JUST({ root: { page: str }}); + engine.render('page', options, cb); + }); + }; + + /** + * ECT support. + */ + + exports.ect = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.ect; + if (!engine) { + var ECT = require('ect'); + engine = requires.ect = new ECT(options); + } + engine.configure({ cache: options.cache }); + engine.render(path, options, cb); + }); + }; + + /** + * ECT string support. + */ + + exports.ect.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var ECT = require('ect'); + var engine = new ECT({ root: { page: str }}); + engine.render('page', options, cb); + }); + }; + + /** + * mote support. + */ + + exports.mote = fromStringRenderer('mote'); + + /** + * mote string support. + */ + + exports.mote.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.mote || (requires.mote = require('mote')); + try { + var tmpl = cache(options) || cache(options, engine.compile(str)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Toffee support. + */ + + exports.toffee = function(path, options, cb) { + return promisify(cb, function(cb) { + var toffee = requires.toffee || (requires.toffee = require('toffee')); + toffee.__consolidate_engine_render(path, options, cb); + }); + }; + + /** + * Toffee string support. + */ + + exports.toffee.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.toffee || (requires.toffee = require('toffee')); + try { + engine.str_render(str, options, cb); + } catch (err) { + cb(err); + } + }); + }; + + /** + * doT support. + */ + + exports.dot = fromStringRenderer('dot'); + + /** + * doT string support. + */ + + exports.dot.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.dot || (requires.dot = require('dot')); + var extend = (requires.extend || (requires.extend = require$$2._extend)); + try { + var settings = {}; + settings = extend(settings, engine.templateSettings); + settings = extend(settings, options ? options.dot : {}); + var tmpl = cache(options) || cache(options, engine.template(str, settings, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * bracket support. + */ + + exports.bracket = fromStringRenderer('bracket'); + + /** + * bracket string support. + */ + + exports.bracket.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.bracket || (requires.bracket = require('bracket-template')); + try { + var tmpl = cache(options) || cache(options, engine.default.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Ractive support. + */ + + exports.ractive = fromStringRenderer('ractive'); + + /** + * Ractive string support. + */ + + exports.ractive.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var Engine = requires.ractive || (requires.ractive = require('ractive')); + + var template = cache(options) || cache(options, Engine.parse(str)); + options.template = template; + + if (options.data === null || options.data === undefined) { + var extend = (requires.extend || (requires.extend = require$$2._extend)); + + // Shallow clone the options object + options.data = extend({}, options); + + // Remove consolidate-specific properties from the clone + var i; + var length; + var properties = ['template', 'filename', 'cache', 'partials']; + for (i = 0, length = properties.length; i < length; i++) { + var property = properties[i]; + delete options.data[property]; + } + } + + try { + cb(null, new Engine(options).toHTML()); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Nunjucks support. + */ + + exports.nunjucks = fromStringRenderer('nunjucks'); + + /** + * Nunjucks string support. + */ + + exports.nunjucks.render = function(str, options, cb) { + return promisify(cb, function(cb) { + + try { + + var engine = options.nunjucksEnv || requires.nunjucks || (requires.nunjucks = require('nunjucks')); + + var env = engine; + + // deprecated fallback support for express + // <https://github.com/tj/consolidate.js/pull/152> + // <https://github.com/tj/consolidate.js/pull/224> + if (options.settings && options.settings.views) { + env = engine.configure(options.settings.views); + } else if (options.nunjucks && options.nunjucks.configure) { + env = engine.configure.apply(engine, options.nunjucks.configure); + } + + // + // because `renderString` does not initiate loaders + // we must manually create a loader for it based off + // either `options.settings.views` or `options.nunjucks` or `options.nunjucks.root` + // + // <https://github.com/mozilla/nunjucks/issues/730> + // <https://github.com/crocodilejs/node-email-templates/issues/182> + // + + // so instead we simply check if we passed a custom loader + // otherwise we create a simple file based loader + if (options.loader) { + env = new engine.Environment(options.loader); + } else if (options.settings && options.settings.views) { + env = new engine.Environment( + new engine.FileSystemLoader(options.settings.views) + ); + } else if (options.nunjucks && options.nunjucks.loader) { + if (typeof options.nunjucks.loader === 'string') { + env = new engine.Environment(new engine.FileSystemLoader(options.nunjucks.loader)); + } else { + env = new engine.Environment( + new engine.FileSystemLoader( + options.nunjucks.loader[0], + options.nunjucks.loader[1] + ) + ); + } + } + + env.renderString(str, options, cb); + } catch (err) { + throw cb(err); + } + }); + }; + + /** + * HTMLing support. + */ + + exports.htmling = fromStringRenderer('htmling'); + + /** + * HTMLing string support. + */ + + exports.htmling.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.htmling || (requires.htmling = require('htmling')); + try { + var tmpl = cache(options) || cache(options, engine.string(str)); + cb(null, tmpl.render(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Rendering function + */ + function requireReact(module, filename) { + var babel = requires.babel || (requires.babel = require('babel-core')); + + var compiled = babel.transformFileSync(filename, { presets: [ 'react' ] }).code; + + return module._compile(compiled, filename); + } + + exports.requireReact = requireReact; + + /** + * Converting a string into a node module. + */ + function requireReactString(src, filename) { + var babel = requires.babel || (requires.babel = require('babel-core')); + + if (!filename) filename = ''; + var m = new module.constructor(); + filename = filename || ''; + + // Compile Using React + var compiled = babel.transform(src, { presets: [ 'react' ] }).code; + + // Compile as a module + m.paths = module.paths; + m._compile(compiled, filename); + + return m.exports; + } + + /** + * A naive helper to replace {{tags}} with options.tags content + */ + function reactBaseTmpl(data, options) { + + var exp; + var regex; + + // Iterates through the keys in file object + // and interpolate / replace {{key}} with it's value + for (var k in options) { + if (options.hasOwnProperty(k)) { + exp = '{{' + k + '}}'; + regex = new RegExp(exp, 'g'); + if (data.match(regex)) { + data = data.replace(regex, options[k]); + } + } + } + + return data; + } + + /** + * Plates Support. + */ + + exports.plates = fromStringRenderer('plates'); + + /** + * Plates string support. + */ + + exports.plates.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.plates || (requires.plates = require('plates')); + var map = options.map || undefined; + try { + var tmpl = engine.bind(str, options, map); + cb(null, tmpl); + } catch (err) { + cb(err); + } + }); + }; + + /** + * The main render parser for React bsaed templates + */ + function reactRenderer(type) { + + if (commonjsRequire.extensions) { + + // Ensure JSX is transformed on require + if (!commonjsRequire.extensions['.jsx']) { + commonjsRequire.extensions['.jsx'] = requireReact; + } + + // Supporting .react extension as well as test cases + // Using .react extension is not recommended. + if (!commonjsRequire.extensions['.react']) { + commonjsRequire.extensions['.react'] = requireReact; + } + + } + + // Return rendering fx + return function(str, options, cb) { + return promisify(cb, function(cb) { + // React Import + var ReactDOM = requires.ReactDOM || (requires.ReactDOM = require('react-dom/server')); + var react = requires.react || (requires.react = require('react')); + + // Assign HTML Base + var base = options.base; + delete options.base; + + var enableCache = options.cache; + delete options.cache; + + var isNonStatic = options.isNonStatic; + delete options.isNonStatic; + + // Start Conversion + try { + + var Code; + var Factory; + + var baseStr; + var content; + var parsed; + + if (!cache(options)) { + // Parsing + if (type === 'path') { + var path = resolve(str); + delete require.cache[path]; + Code = commonjsRequire(path); + } else { + Code = requireReactString(str); + } + Factory = cache(options, react.createFactory(Code)); + + } else { + Factory = cache(options); + } + + parsed = new Factory(options); + content = (isNonStatic) ? ReactDOM.renderToString(parsed) : ReactDOM.renderToStaticMarkup(parsed); + + if (base) { + baseStr = readCache[str] || fs.readFileSync(resolve(base), 'utf8'); + + if (enableCache) { + readCache[str] = baseStr; + } + + options.content = content; + content = reactBaseTmpl(baseStr, options); + } + + cb(null, content); + + } catch (err) { + cb(err); + } + }); + }; + } + + /** + * React JS Support + */ + exports.react = reactRenderer('path'); + + /** + * React JS string support. + */ + exports.react.render = reactRenderer('string'); + + /** + * ARC-templates support. + */ + + exports['arc-templates'] = fromStringRenderer('arc-templates'); + + /** + * ARC-templates string support. + */ + + exports['arc-templates'].render = function(str, options, cb) { + var readFileWithOptions = util.promisify(read); + var consolidateFileSystem = {}; + consolidateFileSystem.readFile = function(path) { + return readFileWithOptions(path, options); + }; + + return promisify(cb, function(cb) { + try { + var engine = requires['arc-templates']; + if (!engine) { + var Engine = require('arc-templates/dist/es5'); + engine = requires['arc-templates'] = new Engine({ filesystem: consolidateFileSystem }); + } + + var compiler = cache(options) || cache(options, engine.compileString(str, options.filename)); + compiler.then(function(func) { return func(options); }) + .then(function(result) { cb(null, result.content); }) + .catch(cb); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Vash support + */ + exports.vash = fromStringRenderer('vash'); + + /** + * Vash string support + */ + exports.vash.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.vash || (requires.vash = require('vash')); + + try { + // helper system : https://github.com/kirbysayshi/vash#helper-system + if (options.helpers) { + for (var key in options.helpers) { + if (!options.helpers.hasOwnProperty(key) || typeof options.helpers[key] !== 'function') { + continue; + } + engine.helpers[key] = options.helpers[key]; + } + } + + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + tmpl(options, function sealLayout(err, ctx) { + if (err) cb(err); + ctx.finishLayout(); + cb(null, ctx.toString().replace(/\n$/, '')); + }); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Slm support. + */ + + exports.slm = fromStringRenderer('slm'); + + /** + * Slm string support. + */ + + exports.slm.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.slm || (requires.slm = require('slm')); + + try { + var tmpl = cache(options) || cache(options, engine.compile(str, options)); + cb(null, tmpl(options)); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Marko support. + */ + + exports.marko = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.marko || (requires.marko = require('marko')); + options.writeToDisk = !!options.cache; + + try { + var tmpl = cache(options) || cache(options, engine.load(path, options)); + tmpl.renderToString(options, cb); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Marko string support. + */ + + exports.marko.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.marko || (requires.marko = require('marko')); + options.writeToDisk = !!options.cache; + options.filename = options.filename || 'string.marko'; + + try { + var tmpl = cache(options) || cache(options, engine.load(options.filename, str, options)); + tmpl.renderToString(options, cb); + } catch (err) { + cb(err); + } + }); + }; + + /** + * Teacup support. + */ + exports.teacup = function(path, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.teacup || (requires.teacup = require('teacup/lib/express')); + commonjsRequire.extensions['.teacup'] = commonjsRequire.extensions['.coffee']; + if (path[0] !== '/') { + path = join(process.cwd(), path); + } + if (!options.cache) { + var callback = cb; + cb = function() { + delete require.cache[path]; + callback.apply(this, arguments); + }; + } + engine.renderFile(path, options, cb); + }); + }; + + /** + * Teacup string support. + */ + exports.teacup.render = function(str, options, cb) { + var coffee = require('coffee-script'); + var vm = require('vm'); + var sandbox = { + module: {exports: {}}, + require: commonjsRequire + }; + return promisify(cb, function(cb) { + vm.runInNewContext(coffee.compile(str), sandbox); + var tmpl = sandbox.module.exports; + cb(null, tmpl(options)); + }); + }; + + /** + * Squirrelly support. + */ + + exports.squirrelly = fromStringRenderer('squirrelly'); + + /** + * Squirrelly string support. + */ + + exports.squirrelly.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.squirrelly || (requires.squirrelly = require('squirrelly')); + try { + for (var partial in options.partials) { + engine.definePartial(partial, options.partials[partial]); + } + for (var helper in options.helpers) { + engine.defineHelper(helper, options.helpers[helper]); + } + var tmpl = cache(options) || cache(options, engine.Compile(str, options)); + cb(null, tmpl(options, engine)); + } catch (err) { + cb(err); + } + }); + }; + /** + * Twing support. + */ + + exports.twing = fromStringRenderer('twing'); + + /** + * Twing string support. + */ + + exports.twing.render = function(str, options, cb) { + return promisify(cb, function(cb) { + var engine = requires.twing || (requires.twing = require('twing')); + try { + new engine.TwingEnvironment(new engine.TwingLoaderNull()).createTemplate(str).then((twingTemplate) => { + twingTemplate.render(options).then((rendTmpl) => { + var tmpl = cache(options) || cache(options, rendTmpl); + cb(null, tmpl); + }); + }); + } catch (err) { + cb(err); + } + }); + }; + /** + * expose the instance of the engine + */ + exports.requires = requires; + } (consolidate$2, consolidate$2.exports)); + return consolidate$2.exports; +} + +var consolidate$1; +var hasRequiredConsolidate; + +function requireConsolidate () { + if (hasRequiredConsolidate) return consolidate$1; + hasRequiredConsolidate = 1; + consolidate$1 = /*@__PURE__*/ requireConsolidate$1(); + return consolidate$1; +} + +var consolidateExports = /*@__PURE__*/ requireConsolidate(); +var consolidate = /*@__PURE__*/getDefaultExportFromCjs(consolidateExports); + +const hasWarned = {}; +function warnOnce(msg) { + const isNodeProd = typeof process !== "undefined" && process.env.NODE_ENV === "production"; + if (!isNodeProd && true && !hasWarned[msg]) { + hasWarned[msg] = true; + warn(msg); + } +} +function warn(msg) { + console.warn( + `\x1B[1m\x1B[33m[@vue/compiler-sfc]\x1B[0m\x1B[33m ${msg}\x1B[0m +` + ); +} + +function preprocess$1({ source, filename, preprocessOptions }, preprocessor) { + let res = ""; + let err = null; + preprocessor.render( + source, + { filename, ...preprocessOptions }, + (_err, _res) => { + if (_err) err = _err; + res = _res; + } + ); + if (err) throw err; + return res; +} +function compileTemplate(options) { + const { preprocessLang, preprocessCustomRequire } = options; + const preprocessor = preprocessLang ? preprocessCustomRequire ? preprocessCustomRequire(preprocessLang) : consolidate[preprocessLang] : false; + if (preprocessor) { + try { + return doCompileTemplate({ + ...options, + source: preprocess$1(options, preprocessor), + ast: void 0 + // invalidate AST if template goes through preprocessor + }); + } catch (e) { + return { + code: `export default function render() {}`, + source: options.source, + tips: [], + errors: [e] + }; + } + } else if (preprocessLang) { + return { + code: `export default function render() {}`, + source: options.source, + tips: [ + `Component ${options.filename} uses lang ${preprocessLang} for template. Please install the language preprocessor.` + ], + errors: [ + `Component ${options.filename} uses lang ${preprocessLang} for template, however it is not installed.` + ] + }; + } else { + return doCompileTemplate(options); + } +} +function doCompileTemplate({ + filename, + id, + scoped, + slotted, + inMap, + source, + ast: inAST, + ssr = false, + ssrCssVars, + isProd = false, + compiler, + compilerOptions = {}, + transformAssetUrls +}) { + const errors = []; + const warnings = []; + let nodeTransforms = []; + if (shared.isObject(transformAssetUrls)) { + const assetOptions = normalizeOptions(transformAssetUrls); + nodeTransforms = [ + createAssetUrlTransformWithOptions(assetOptions), + createSrcsetTransformWithOptions(assetOptions) + ]; + } else if (transformAssetUrls !== false) { + nodeTransforms = [transformAssetUrl, transformSrcset]; + } + if (ssr && !ssrCssVars) { + warnOnce( + `compileTemplate is called with \`ssr: true\` but no corresponding \`cssVars\` option.` + ); + } + if (!id) { + warnOnce(`compileTemplate now requires the \`id\` option.`); + id = ""; + } + const shortId = id.replace(/^data-v-/, ""); + const longId = `data-v-${shortId}`; + const defaultCompiler = ssr ? CompilerSSR__namespace : CompilerDOM__namespace; + compiler = compiler || defaultCompiler; + if (compiler !== defaultCompiler) { + inAST = void 0; + } + if (inAST == null ? void 0 : inAST.transformed) { + const newAST = (ssr ? CompilerDOM__namespace : compiler).parse(inAST.source, { + prefixIdentifiers: true, + ...compilerOptions, + parseMode: "sfc", + onError: (e) => errors.push(e) + }); + const template = newAST.children.find( + (node) => node.type === 1 && node.tag === "template" + ); + inAST = compilerCore.createRoot(template.children, inAST.source); + } + let { code, ast, preamble, map } = compiler.compile(inAST || source, { + mode: "module", + prefixIdentifiers: true, + hoistStatic: true, + cacheHandlers: true, + ssrCssVars: ssr && ssrCssVars && ssrCssVars.length ? genCssVarsFromList(ssrCssVars, shortId, isProd, true) : "", + scopeId: scoped ? longId : void 0, + slotted, + sourceMap: true, + ...compilerOptions, + hmr: !isProd, + nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []), + filename, + onError: (e) => errors.push(e), + onWarn: (w) => warnings.push(w) + }); + if (inMap && !inAST) { + if (map) { + map = mapLines(inMap, map); + } + if (errors.length) { + patchErrors(errors, source, inMap); + } + } + const tips = warnings.map((w) => { + let msg = w.message; + if (w.loc) { + msg += ` +${shared.generateCodeFrame( + (inAST == null ? void 0 : inAST.source) || source, + w.loc.start.offset, + w.loc.end.offset + )}`; + } + return msg; + }); + return { code, ast, preamble, source, errors, tips, map }; +} +function mapLines(oldMap, newMap) { + if (!oldMap) return newMap; + if (!newMap) return oldMap; + const oldMapConsumer = new sourceMapJs.SourceMapConsumer(oldMap); + const newMapConsumer = new sourceMapJs.SourceMapConsumer(newMap); + const mergedMapGenerator = new sourceMapJs.SourceMapGenerator(); + newMapConsumer.eachMapping((m) => { + if (m.originalLine == null) { + return; + } + const origPosInOldMap = oldMapConsumer.originalPositionFor({ + line: m.originalLine, + column: m.originalColumn + }); + if (origPosInOldMap.source == null) { + return; + } + mergedMapGenerator.addMapping({ + generated: { + line: m.generatedLine, + column: m.generatedColumn + }, + original: { + line: origPosInOldMap.line, + // map line + // use current column, since the oldMap produced by @vue/compiler-sfc + // does not + column: m.originalColumn + }, + source: origPosInOldMap.source, + name: origPosInOldMap.name + }); + }); + const generator = mergedMapGenerator; + oldMapConsumer.sources.forEach((sourceFile) => { + generator._sources.add(sourceFile); + const sourceContent = oldMapConsumer.sourceContentFor(sourceFile); + if (sourceContent != null) { + mergedMapGenerator.setSourceContent(sourceFile, sourceContent); + } + }); + generator._sourceRoot = oldMap.sourceRoot; + generator._file = oldMap.file; + return generator.toJSON(); +} +function patchErrors(errors, source, inMap) { + const originalSource = inMap.sourcesContent[0]; + const offset = originalSource.indexOf(source); + const lineOffset = originalSource.slice(0, offset).split(/\r?\n/).length - 1; + errors.forEach((err) => { + if (err.loc) { + err.loc.start.line += lineOffset; + err.loc.start.offset += offset; + if (err.loc.end !== err.loc.start) { + err.loc.end.line += lineOffset; + err.loc.end.offset += offset; + } + } + }); +} + +const trimPlugin = () => { + return { + postcssPlugin: "vue-sfc-trim", + Once(root) { + root.walk(({ type, raws }) => { + if (type === "rule" || type === "atrule") { + if (raws.before) raws.before = "\n"; + if ("after" in raws && raws.after) raws.after = "\n"; + } + }); + } + }; +}; +trimPlugin.postcss = true; + +var dist$1 = {exports: {}}; + +var processor$1 = {exports: {}}; + +var parser$1 = {exports: {}}; + +var root$1 = {exports: {}}; + +var container$1 = {exports: {}}; + +var node$2 = {exports: {}}; + +var util$2 = {}; + +var unesc$1 = {exports: {}}; + +var hasRequiredUnesc$1; + +function requireUnesc$1 () { + if (hasRequiredUnesc$1) return unesc$1.exports; + hasRequiredUnesc$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = unesc; + // Many thanks for this post which made this migration much easier. + // https://mathiasbynens.be/notes/css-escapes + + /** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ + function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); + // check to see if we are dealing with a valid hex char [a-f|0-9] + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + spaceTerminated = code === 32; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return undefined; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; + // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + + // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + + // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; + } + module.exports = exports.default; + } (unesc$1, unesc$1.exports)); + return unesc$1.exports; +} + +var getProp$1 = {exports: {}}; + +var hasRequiredGetProp$1; + +function requireGetProp$1 () { + if (hasRequiredGetProp$1) return getProp$1.exports; + hasRequiredGetProp$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = getProp; + function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return undefined; + } + obj = obj[prop]; + } + return obj; + } + module.exports = exports.default; + } (getProp$1, getProp$1.exports)); + return getProp$1.exports; +} + +var ensureObject$1 = {exports: {}}; + +var hasRequiredEnsureObject$1; + +function requireEnsureObject$1 () { + if (hasRequiredEnsureObject$1) return ensureObject$1.exports; + hasRequiredEnsureObject$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = ensureObject; + function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } + } + module.exports = exports.default; + } (ensureObject$1, ensureObject$1.exports)); + return ensureObject$1.exports; +} + +var stripComments$1 = {exports: {}}; + +var hasRequiredStripComments$1; + +function requireStripComments$1 () { + if (hasRequiredStripComments$1) return stripComments$1.exports; + hasRequiredStripComments$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = stripComments; + function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; + } + module.exports = exports.default; + } (stripComments$1, stripComments$1.exports)); + return stripComments$1.exports; +} + +var hasRequiredUtil$2; + +function requireUtil$2 () { + if (hasRequiredUtil$2) return util$2; + hasRequiredUtil$2 = 1; + + util$2.__esModule = true; + util$2.unesc = util$2.stripComments = util$2.getProp = util$2.ensureObject = void 0; + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc$1()); + util$2.unesc = _unesc["default"]; + var _getProp = _interopRequireDefault(/*@__PURE__*/ requireGetProp$1()); + util$2.getProp = _getProp["default"]; + var _ensureObject = _interopRequireDefault(/*@__PURE__*/ requireEnsureObject$1()); + util$2.ensureObject = _ensureObject["default"]; + var _stripComments = _interopRequireDefault(/*@__PURE__*/ requireStripComments$1()); + util$2.stripComments = _stripComments["default"]; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + return util$2; +} + +var hasRequiredNode$2; + +function requireNode$2 () { + if (hasRequiredNode$2) return node$2.exports; + hasRequiredNode$2 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _util = /*@__PURE__*/ requireUtil$2(); + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + return cloned; + }; + var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + var _proto = Node.prototype; + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + this.raws[name] = valueEscaped; + } + + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + if (this.raws) { + delete this.raws[name]; + } + } + + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return undefined; + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node; + }(); + exports["default"] = Node; + module.exports = exports.default; + } (node$2, node$2.exports)); + return node$2.exports; +} + +var types$2 = {}; + +var hasRequiredTypes$1; + +function requireTypes$1 () { + if (hasRequiredTypes$1) return types$2; + hasRequiredTypes$1 = 1; + + types$2.__esModule = true; + types$2.UNIVERSAL = types$2.TAG = types$2.STRING = types$2.SELECTOR = types$2.ROOT = types$2.PSEUDO = types$2.NESTING = types$2.ID = types$2.COMMENT = types$2.COMBINATOR = types$2.CLASS = types$2.ATTRIBUTE = void 0; + var TAG = 'tag'; + types$2.TAG = TAG; + var STRING = 'string'; + types$2.STRING = STRING; + var SELECTOR = 'selector'; + types$2.SELECTOR = SELECTOR; + var ROOT = 'root'; + types$2.ROOT = ROOT; + var PSEUDO = 'pseudo'; + types$2.PSEUDO = PSEUDO; + var NESTING = 'nesting'; + types$2.NESTING = NESTING; + var ID = 'id'; + types$2.ID = ID; + var COMMENT = 'comment'; + types$2.COMMENT = COMMENT; + var COMBINATOR = 'combinator'; + types$2.COMBINATOR = COMBINATOR; + var CLASS = 'class'; + types$2.CLASS = CLASS; + var ATTRIBUTE = 'attribute'; + types$2.ATTRIBUTE = ATTRIBUTE; + var UNIVERSAL = 'universal'; + types$2.UNIVERSAL = UNIVERSAL; + return types$2; +} + +var hasRequiredContainer$1; + +function requireContainer$1 () { + if (hasRequiredContainer$1) return container$1.exports; + hasRequiredContainer$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes$1()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + function Container(opts) { + var _this; + _this = _Node.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + var _proto = Container.prototype; + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + for (var id in this.indexes) { + this.indexes[id]++; + } + return this; + }; + _proto.at = function at(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex < index) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= oldIndex) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return undefined; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + if (result !== false && node.length) { + result = node.walk(callback); + } + if (result === false) { + return false; + } + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function (selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function (selector) { + if (selector.type === types.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function (selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function (selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function (selector) { + if (selector.type === types.ID) { + return callback.call(_this6, selector); + } + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function (selector) { + if (selector.type === types.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function (selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function (selector) { + if (selector.type === types.TAG) { + return callback.call(_this9, selector); + } + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function (selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString() { + return this.map(String).join(''); + }; + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + return Container; + }(_node["default"]); + exports["default"] = Container; + module.exports = exports.default; + } (container$1, container$1.exports)); + return container$1.exports; +} + +var hasRequiredRoot$1; + +function requireRoot$1 () { + if (hasRequiredRoot$1) return root$1.exports; + hasRequiredRoot$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + function Root(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + var _proto = Root.prototype; + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root; + }(_container["default"]); + exports["default"] = Root; + module.exports = exports.default; + } (root$1, root$1.exports)); + return root$1.exports; +} + +var selector$1 = {exports: {}}; + +var hasRequiredSelector$1; + +function requireSelector$1 () { + if (hasRequiredSelector$1) return selector$1.exports; + hasRequiredSelector$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + function Selector(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + return Selector; + }(_container["default"]); + exports["default"] = Selector; + module.exports = exports.default; + } (selector$1, selector$1.exports)); + return selector$1.exports; +} + +var className$1 = {exports: {}}; + +/*! https://mths.be/cssesc v3.0.0 by @mathias */ + +var cssesc_1; +var hasRequiredCssesc; + +function requireCssesc () { + if (hasRequiredCssesc) return cssesc_1; + hasRequiredCssesc = 1; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; + }; + + var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; + var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; + var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + + // https://mathiasbynens.be/notes/css-escapes#css + var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; + }; + + // Expose default options (so they can be overridden globally). + cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false + }; + + cssesc.version = '3.0.0'; + + cssesc_1 = cssesc; + return cssesc_1; +} + +var hasRequiredClassName$1; + +function requireClassName$1 () { + if (hasRequiredClassName$1) return className$1.exports; + hasRequiredClassName$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil$2(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + function ClassName(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName.prototype; + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v; + } + }]); + return ClassName; + }(_node["default"]); + exports["default"] = ClassName; + module.exports = exports.default; + } (className$1, className$1.exports)); + return className$1.exports; +} + +var comment$1 = {exports: {}}; + +var hasRequiredComment$1; + +function requireComment$1 () { + if (hasRequiredComment$1) return comment$1.exports; + hasRequiredComment$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + function Comment(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + return Comment; + }(_node["default"]); + exports["default"] = Comment; + module.exports = exports.default; + } (comment$1, comment$1.exports)); + return comment$1.exports; +} + +var id$1 = {exports: {}}; + +var hasRequiredId$1; + +function requireId$1 () { + if (hasRequiredId$1) return id$1.exports; + hasRequiredId$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + function ID(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + var _proto = ID.prototype; + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + return ID; + }(_node["default"]); + exports["default"] = ID; + module.exports = exports.default; + } (id$1, id$1.exports)); + return id$1.exports; +} + +var tag$1 = {exports: {}}; + +var namespace$1 = {exports: {}}; + +var hasRequiredNamespace$1; + +function requireNamespace$1 () { + if (hasRequiredNamespace$1) return namespace$1.exports; + hasRequiredNamespace$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil$2(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + function Namespace() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + return Namespace; + }(_node["default"]); + exports["default"] = Namespace; + module.exports = exports.default; + } (namespace$1, namespace$1.exports)); + return namespace$1.exports; +} + +var hasRequiredTag$1; + +function requireTag$1 () { + if (hasRequiredTag$1) return tag$1.exports; + hasRequiredTag$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + function Tag(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + return Tag; + }(_namespace["default"]); + exports["default"] = Tag; + module.exports = exports.default; + } (tag$1, tag$1.exports)); + return tag$1.exports; +} + +var string$1 = {exports: {}}; + +var hasRequiredString$1; + +function requireString$1 () { + if (hasRequiredString$1) return string$1.exports; + hasRequiredString$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + function String(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + return String; + }(_node["default"]); + exports["default"] = String; + module.exports = exports.default; + } (string$1, string$1.exports)); + return string$1.exports; +} + +var pseudo$1 = {exports: {}}; + +var hasRequiredPseudo$1; + +function requirePseudo$1 () { + if (hasRequiredPseudo$1) return pseudo$1.exports; + hasRequiredPseudo$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + function Pseudo(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + var _proto = Pseudo.prototype; + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + return Pseudo; + }(_container["default"]); + exports["default"] = Pseudo; + module.exports = exports.default; + } (pseudo$1, pseudo$1.exports)); + return pseudo$1.exports; +} + +var attribute$1 = {}; + +var node$1; +var hasRequiredNode$1; + +function requireNode$1 () { + if (hasRequiredNode$1) return node$1; + hasRequiredNode$1 = 1; + /** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + + node$1 = require$$2.deprecate; + return node$1; +} + +var hasRequiredAttribute$1; + +function requireAttribute$1 () { + if (hasRequiredAttribute$1) return attribute$1; + hasRequiredAttribute$1 = 1; + (function (exports) { + + exports.__esModule = true; + exports["default"] = void 0; + exports.unescapeValue = unescapeValue; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc$1()); + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + var _CSSESC_QUOTE_OPTIONS; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var deprecate = /*@__PURE__*/ requireNode$1(); + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + if (opts.value === undefined) { + return opts; + } + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + function Attribute(opts) { + var _this; + if (opts === void 0) { + opts = {}; + } + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */; + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + } + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + } + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + if (name === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + _proto.toString = function toString() { + var _this2 = this; + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "insensitive", + get: function get() { + return this._insensitive; + } + + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + + // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. + // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. + if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { + this.raws.insensitiveFlag = undefined; + } + } + this._insensitive = insensitive; + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + }]); + return Attribute; + }(_namespace["default"]); + exports["default"] = Attribute; + Attribute.NO_QUOTE = null; + Attribute.SINGLE_QUOTE = "'"; + Attribute.DOUBLE_QUOTE = '"'; + var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } + }, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true + }, _CSSESC_QUOTE_OPTIONS); + function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; + } + } (attribute$1)); + return attribute$1; +} + +var universal$1 = {exports: {}}; + +var hasRequiredUniversal$1; + +function requireUniversal$1 () { + if (hasRequiredUniversal$1) return universal$1.exports; + hasRequiredUniversal$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + function Universal(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + return Universal; + }(_namespace["default"]); + exports["default"] = Universal; + module.exports = exports.default; + } (universal$1, universal$1.exports)); + return universal$1.exports; +} + +var combinator$1 = {exports: {}}; + +var hasRequiredCombinator$1; + +function requireCombinator$1 () { + if (hasRequiredCombinator$1) return combinator$1.exports; + hasRequiredCombinator$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + function Combinator(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + return Combinator; + }(_node["default"]); + exports["default"] = Combinator; + module.exports = exports.default; + } (combinator$1, combinator$1.exports)); + return combinator$1.exports; +} + +var nesting$1 = {exports: {}}; + +var hasRequiredNesting$1; + +function requireNesting$1 () { + if (hasRequiredNesting$1) return nesting$1.exports; + hasRequiredNesting$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); + var _types = /*@__PURE__*/ requireTypes$1(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + function Nesting(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + return Nesting; + }(_node["default"]); + exports["default"] = Nesting; + module.exports = exports.default; + } (nesting$1, nesting$1.exports)); + return nesting$1.exports; +} + +var sortAscending$1 = {exports: {}}; + +var hasRequiredSortAscending$1; + +function requireSortAscending$1 () { + if (hasRequiredSortAscending$1) return sortAscending$1.exports; + hasRequiredSortAscending$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = sortAscending; + function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); + } + module.exports = exports.default; + } (sortAscending$1, sortAscending$1.exports)); + return sortAscending$1.exports; +} + +var tokenize$1 = {}; + +var tokenTypes$1 = {}; + +var hasRequiredTokenTypes$1; + +function requireTokenTypes$1 () { + if (hasRequiredTokenTypes$1) return tokenTypes$1; + hasRequiredTokenTypes$1 = 1; + + tokenTypes$1.__esModule = true; + tokenTypes$1.word = tokenTypes$1.tilde = tokenTypes$1.tab = tokenTypes$1.str = tokenTypes$1.space = tokenTypes$1.slash = tokenTypes$1.singleQuote = tokenTypes$1.semicolon = tokenTypes$1.plus = tokenTypes$1.pipe = tokenTypes$1.openSquare = tokenTypes$1.openParenthesis = tokenTypes$1.newline = tokenTypes$1.greaterThan = tokenTypes$1.feed = tokenTypes$1.equals = tokenTypes$1.doubleQuote = tokenTypes$1.dollar = tokenTypes$1.cr = tokenTypes$1.comment = tokenTypes$1.comma = tokenTypes$1.combinator = tokenTypes$1.colon = tokenTypes$1.closeSquare = tokenTypes$1.closeParenthesis = tokenTypes$1.caret = tokenTypes$1.bang = tokenTypes$1.backslash = tokenTypes$1.at = tokenTypes$1.asterisk = tokenTypes$1.ampersand = void 0; + var ampersand = 38; // `&`.charCodeAt(0); + tokenTypes$1.ampersand = ampersand; + var asterisk = 42; // `*`.charCodeAt(0); + tokenTypes$1.asterisk = asterisk; + var at = 64; // `@`.charCodeAt(0); + tokenTypes$1.at = at; + var comma = 44; // `,`.charCodeAt(0); + tokenTypes$1.comma = comma; + var colon = 58; // `:`.charCodeAt(0); + tokenTypes$1.colon = colon; + var semicolon = 59; // `;`.charCodeAt(0); + tokenTypes$1.semicolon = semicolon; + var openParenthesis = 40; // `(`.charCodeAt(0); + tokenTypes$1.openParenthesis = openParenthesis; + var closeParenthesis = 41; // `)`.charCodeAt(0); + tokenTypes$1.closeParenthesis = closeParenthesis; + var openSquare = 91; // `[`.charCodeAt(0); + tokenTypes$1.openSquare = openSquare; + var closeSquare = 93; // `]`.charCodeAt(0); + tokenTypes$1.closeSquare = closeSquare; + var dollar = 36; // `$`.charCodeAt(0); + tokenTypes$1.dollar = dollar; + var tilde = 126; // `~`.charCodeAt(0); + tokenTypes$1.tilde = tilde; + var caret = 94; // `^`.charCodeAt(0); + tokenTypes$1.caret = caret; + var plus = 43; // `+`.charCodeAt(0); + tokenTypes$1.plus = plus; + var equals = 61; // `=`.charCodeAt(0); + tokenTypes$1.equals = equals; + var pipe = 124; // `|`.charCodeAt(0); + tokenTypes$1.pipe = pipe; + var greaterThan = 62; // `>`.charCodeAt(0); + tokenTypes$1.greaterThan = greaterThan; + var space = 32; // ` `.charCodeAt(0); + tokenTypes$1.space = space; + var singleQuote = 39; // `'`.charCodeAt(0); + tokenTypes$1.singleQuote = singleQuote; + var doubleQuote = 34; // `"`.charCodeAt(0); + tokenTypes$1.doubleQuote = doubleQuote; + var slash = 47; // `/`.charCodeAt(0); + tokenTypes$1.slash = slash; + var bang = 33; // `!`.charCodeAt(0); + tokenTypes$1.bang = bang; + var backslash = 92; // '\\'.charCodeAt(0); + tokenTypes$1.backslash = backslash; + var cr = 13; // '\r'.charCodeAt(0); + tokenTypes$1.cr = cr; + var feed = 12; // '\f'.charCodeAt(0); + tokenTypes$1.feed = feed; + var newline = 10; // '\n'.charCodeAt(0); + tokenTypes$1.newline = newline; + var tab = 9; // '\t'.charCodeAt(0); + + // Expose aliases primarily for readability. + tokenTypes$1.tab = tab; + var str = singleQuote; + + // No good single character representation! + tokenTypes$1.str = str; + var comment = -1; + tokenTypes$1.comment = comment; + var word = -2; + tokenTypes$1.word = word; + var combinator = -3; + tokenTypes$1.combinator = combinator; + return tokenTypes$1; +} + +var hasRequiredTokenize$1; + +function requireTokenize$1 () { + if (hasRequiredTokenize$1) return tokenize$1; + hasRequiredTokenize$1 = 1; + (function (exports) { + + exports.__esModule = true; + exports.FIELDS = void 0; + exports["default"] = tokenize; + var t = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes$1()); + var _unescapable, _wordDelimiters; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); + var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; + } + + /** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + return next - 1; + } + + /** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) ; else if (hex[code]) { + var hexDigits = 0; + // consume up to 6 hex chars + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + // if fewer than 6 hex chars, a trailing space ends the escape + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + return next; + } + var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + exports.FIELDS = FIELDS; + function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed('quote', quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + if (next === 0) { + unclosed('comment', '*/'); + } + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + + // Ensure that the token structure remains consistent + tokens.push([tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end // [6] End position + ]); + + // Reset offset for the next token + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; + } + } (tokenize$1)); + return tokenize$1; +} + +var hasRequiredParser$2; + +function requireParser$2 () { + if (hasRequiredParser$2) return parser$1.exports; + hasRequiredParser$2 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot$1()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector$1()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName$1()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment$1()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId$1()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag$1()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString$1()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo$1()); + var _attribute = _interopRequireWildcard(/*@__PURE__*/ requireAttribute$1()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal$1()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator$1()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting$1()); + var _sortAscending = _interopRequireDefault(/*@__PURE__*/ requireSortAscending$1()); + var _tokenize = _interopRequireWildcard(/*@__PURE__*/ requireTokenize$1()); + var tokens = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes$1()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes$1()); + var _util = /*@__PURE__*/ requireUtil$2(); + var _WHITESPACE_TOKENS, _Object$assign; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); + var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; + } + function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); + } + function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + return node; + } + function indexesOf(array, item) { + var i = -1; + var indexes = []; + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; + } + function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); + } + var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + }, + sourceIndex: 0 + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + var _proto = Parser.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + if (rawValue) { + node.raws.namespace += content; + } + lastAdded = 'namespace'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && + // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + node.attribute = (node.attribute || "") + content; + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + if (_rawValue) { + node.raws.attribute += content; + } + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + lastAdded = 'insensitive'; + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + if (node.raws.value) { + node.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + return nodes; + } + + /** + * + * @param {*} nodes + */; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = undefined; + } + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + _proto.combinator = function combinator() { + var _this3 = this; + if (this.content() === '|') { + return this.namespace(); + } + // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node; + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + var spaces = {}; + var raws = { + spaces: {} + }; + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position]) + }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector); + this.current = selector; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.pseudo = function pseudo() { + var _this4 = this; + var pseudoStr = ''; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.space = function space() { + var content = this.content(); + // Handle space before and after the selector + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; + // Allow decimal numbers percent in @keyframes + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); + // Eliminate Sass interpolations from the list of id indexes + var interpolations = indexesOf(word, '#{'); + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + _this5.newNode(node, namespace); + // Ensure that the namespace is used only once + namespace = null; + }); + this.position++; + }; + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + } + + /** + * Helpers + */; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + return Parser; + }(); + exports["default"] = Parser; + module.exports = exports.default; + } (parser$1, parser$1.exports)); + return parser$1.exports; +} + +var hasRequiredProcessor$1; + +function requireProcessor$1 () { + if (hasRequiredProcessor$1) return processor$1.exports; + hasRequiredProcessor$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _parser = _interopRequireDefault(/*@__PURE__*/ requireParser$2()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + var root = this._root(rule, options); + var transform = this.func(root); + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string = undefined; + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + } + + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<parser.Root>} The AST of the selector after processing it. + */; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<any>} The value returned by the processor. + */; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor; + }(); + exports["default"] = Processor; + module.exports = exports.default; + } (processor$1, processor$1.exports)); + return processor$1.exports; +} + +var selectors$1 = {}; + +var constructors$1 = {}; + +var hasRequiredConstructors$1; + +function requireConstructors$1 () { + if (hasRequiredConstructors$1) return constructors$1; + hasRequiredConstructors$1 = 1; + + constructors$1.__esModule = true; + constructors$1.universal = constructors$1.tag = constructors$1.string = constructors$1.selector = constructors$1.root = constructors$1.pseudo = constructors$1.nesting = constructors$1.id = constructors$1.comment = constructors$1.combinator = constructors$1.className = constructors$1.attribute = void 0; + var _attribute = _interopRequireDefault(/*@__PURE__*/ requireAttribute$1()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName$1()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator$1()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment$1()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId$1()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting$1()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo$1()); + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot$1()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector$1()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString$1()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag$1()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal$1()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var attribute = function attribute(opts) { + return new _attribute["default"](opts); + }; + constructors$1.attribute = attribute; + var className = function className(opts) { + return new _className["default"](opts); + }; + constructors$1.className = className; + var combinator = function combinator(opts) { + return new _combinator["default"](opts); + }; + constructors$1.combinator = combinator; + var comment = function comment(opts) { + return new _comment["default"](opts); + }; + constructors$1.comment = comment; + var id = function id(opts) { + return new _id["default"](opts); + }; + constructors$1.id = id; + var nesting = function nesting(opts) { + return new _nesting["default"](opts); + }; + constructors$1.nesting = nesting; + var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); + }; + constructors$1.pseudo = pseudo; + var root = function root(opts) { + return new _root["default"](opts); + }; + constructors$1.root = root; + var selector = function selector(opts) { + return new _selector["default"](opts); + }; + constructors$1.selector = selector; + var string = function string(opts) { + return new _string["default"](opts); + }; + constructors$1.string = string; + var tag = function tag(opts) { + return new _tag["default"](opts); + }; + constructors$1.tag = tag; + var universal = function universal(opts) { + return new _universal["default"](opts); + }; + constructors$1.universal = universal; + return constructors$1; +} + +var guards$1 = {}; + +var hasRequiredGuards$1; + +function requireGuards$1 () { + if (hasRequiredGuards$1) return guards$1; + hasRequiredGuards$1 = 1; + + guards$1.__esModule = true; + guards$1.isComment = guards$1.isCombinator = guards$1.isClassName = guards$1.isAttribute = void 0; + guards$1.isContainer = isContainer; + guards$1.isIdentifier = void 0; + guards$1.isNamespace = isNamespace; + guards$1.isNesting = void 0; + guards$1.isNode = isNode; + guards$1.isPseudo = void 0; + guards$1.isPseudoClass = isPseudoClass; + guards$1.isPseudoElement = isPseudoElement; + guards$1.isUniversal = guards$1.isTag = guards$1.isString = guards$1.isSelector = guards$1.isRoot = void 0; + var _types = /*@__PURE__*/ requireTypes$1(); + var _IS_TYPE; + var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); + function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; + } + function isNodeType(type, node) { + return isNode(node) && node.type === type; + } + var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); + guards$1.isAttribute = isAttribute; + var isClassName = isNodeType.bind(null, _types.CLASS); + guards$1.isClassName = isClassName; + var isCombinator = isNodeType.bind(null, _types.COMBINATOR); + guards$1.isCombinator = isCombinator; + var isComment = isNodeType.bind(null, _types.COMMENT); + guards$1.isComment = isComment; + var isIdentifier = isNodeType.bind(null, _types.ID); + guards$1.isIdentifier = isIdentifier; + var isNesting = isNodeType.bind(null, _types.NESTING); + guards$1.isNesting = isNesting; + var isPseudo = isNodeType.bind(null, _types.PSEUDO); + guards$1.isPseudo = isPseudo; + var isRoot = isNodeType.bind(null, _types.ROOT); + guards$1.isRoot = isRoot; + var isSelector = isNodeType.bind(null, _types.SELECTOR); + guards$1.isSelector = isSelector; + var isString = isNodeType.bind(null, _types.STRING); + guards$1.isString = isString; + var isTag = isNodeType.bind(null, _types.TAG); + guards$1.isTag = isTag; + var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); + guards$1.isUniversal = isUniversal; + function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); + } + function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); + } + function isContainer(node) { + return !!(isNode(node) && node.walk); + } + function isNamespace(node) { + return isAttribute(node) || isTag(node); + } + return guards$1; +} + +var hasRequiredSelectors$1; + +function requireSelectors$1 () { + if (hasRequiredSelectors$1) return selectors$1; + hasRequiredSelectors$1 = 1; + (function (exports) { + + exports.__esModule = true; + var _types = /*@__PURE__*/ requireTypes$1(); + Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; + }); + var _constructors = /*@__PURE__*/ requireConstructors$1(); + Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; + }); + var _guards = /*@__PURE__*/ requireGuards$1(); + Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; + }); + } (selectors$1)); + return selectors$1; +} + +var hasRequiredDist$1; + +function requireDist$1 () { + if (hasRequiredDist$1) return dist$1.exports; + hasRequiredDist$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _processor = _interopRequireDefault(/*@__PURE__*/ requireProcessor$1()); + var selectors = _interopRequireWildcard(/*@__PURE__*/ requireSelectors$1()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var parser = function parser(processor) { + return new _processor["default"](processor); + }; + Object.assign(parser, selectors); + delete parser.__esModule; + var _default = parser; + exports["default"] = _default; + module.exports = exports.default; + } (dist$1, dist$1.exports)); + return dist$1.exports; +} + +var distExports = /*@__PURE__*/ requireDist$1(); +var selectorParser = /*@__PURE__*/getDefaultExportFromCjs(distExports); + +const animationNameRE = /^(-\w+-)?animation-name$/; +const animationRE = /^(-\w+-)?animation$/; +const scopedPlugin = (id = "") => { + const keyframes = /* @__PURE__ */ Object.create(null); + const shortId = id.replace(/^data-v-/, ""); + return { + postcssPlugin: "vue-sfc-scoped", + Rule(rule) { + processRule(id, rule); + }, + AtRule(node) { + if (/-?keyframes$/.test(node.name) && !node.params.endsWith(`-${shortId}`)) { + keyframes[node.params] = node.params = node.params + "-" + shortId; + } + }, + OnceExit(root) { + if (Object.keys(keyframes).length) { + root.walkDecls((decl) => { + if (animationNameRE.test(decl.prop)) { + decl.value = decl.value.split(",").map((v) => keyframes[v.trim()] || v.trim()).join(","); + } + if (animationRE.test(decl.prop)) { + decl.value = decl.value.split(",").map((v) => { + const vals = v.trim().split(/\s+/); + const i = vals.findIndex((val) => keyframes[val]); + if (i !== -1) { + vals.splice(i, 1, keyframes[vals[i]]); + return vals.join(" "); + } else { + return v; + } + }).join(","); + } + }); + } + } + }; +}; +const processedRules = /* @__PURE__ */ new WeakSet(); +function processRule(id, rule) { + if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" && /-?keyframes$/.test(rule.parent.name)) { + return; + } + processedRules.add(rule); + let deep = false; + let parent = rule.parent; + while (parent && parent.type !== "root") { + if (parent.__deep) { + deep = true; + break; + } + parent = parent.parent; + } + rule.selector = selectorParser((selectorRoot) => { + selectorRoot.each((selector) => { + rewriteSelector(id, rule, selector, selectorRoot, deep); + }); + }).processSync(rule.selector); +} +function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false) { + let node = null; + let shouldInject = !deep; + selector.each((n) => { + if (n.type === "combinator" && (n.value === ">>>" || n.value === "/deep/")) { + n.value = " "; + n.spaces.before = n.spaces.after = ""; + warn( + `the >>> and /deep/ combinators have been deprecated. Use :deep() instead.` + ); + return false; + } + if (n.type === "pseudo") { + const { value } = n; + if (value === ":deep" || value === "::v-deep") { + rule.__deep = true; + if (n.nodes.length) { + let last = n; + n.nodes[0].each((ss) => { + selector.insertAfter(last, ss); + last = ss; + }); + const prev = selector.at(selector.index(n) - 1); + if (!prev || !isSpaceCombinator(prev)) { + selector.insertAfter( + n, + selectorParser.combinator({ + value: " " + }) + ); + } + selector.removeChild(n); + } else { + warn( + `${value} usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead of ${value} <inner-selector>.` + ); + const prev = selector.at(selector.index(n) - 1); + if (prev && isSpaceCombinator(prev)) { + selector.removeChild(prev); + } + selector.removeChild(n); + } + return false; + } + if (value === ":slotted" || value === "::v-slotted") { + rewriteSelector( + id, + rule, + n.nodes[0], + selectorRoot, + deep, + true + ); + let last = n; + n.nodes[0].each((ss) => { + selector.insertAfter(last, ss); + last = ss; + }); + selector.removeChild(n); + shouldInject = false; + return false; + } + if (value === ":global" || value === "::v-global") { + selector.replaceWith(n.nodes[0]); + return false; + } + } + if (n.type === "universal") { + const prev = selector.at(selector.index(n) - 1); + const next = selector.at(selector.index(n) + 1); + if (!prev) { + if (next) { + if (next.type === "combinator" && next.value === " ") { + selector.removeChild(next); + } + selector.removeChild(n); + return; + } else { + node = selectorParser.combinator({ + value: "" + }); + selector.insertBefore(n, node); + selector.removeChild(n); + return false; + } + } + if (node) return; + } + if (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node) { + node = n; + } + }); + if (rule.nodes.some((node2) => node2.type === "rule")) { + const deep2 = rule.__deep; + if (!deep2) { + extractAndWrapNodes(rule); + const atruleNodes = rule.nodes.filter((node2) => node2.type === "atrule"); + for (const atnode of atruleNodes) { + extractAndWrapNodes(atnode); + } + } + shouldInject = deep2; + } + if (node) { + const { type, value } = node; + if (type === "pseudo" && (value === ":is" || value === ":where")) { + node.nodes.forEach( + (value2) => rewriteSelector(id, rule, value2, selectorRoot, deep, slotted) + ); + shouldInject = false; + } + } + if (node) { + node.spaces.after = ""; + } else { + selector.first.spaces.before = ""; + } + if (shouldInject) { + const idToAdd = slotted ? id + "-s" : id; + selector.insertAfter( + // If node is null it means we need to inject [id] at the start + // insertAfter can handle `null` here + node, + selectorParser.attribute({ + attribute: idToAdd, + value: idToAdd, + raws: {}, + quoteMark: `"` + }) + ); + } +} +function isSpaceCombinator(node) { + return node.type === "combinator" && /^\s+$/.test(node.value); +} +function extractAndWrapNodes(parentNode) { + if (!parentNode.nodes) return; + const nodes = parentNode.nodes.filter( + (node) => node.type === "decl" || node.type === "comment" + ); + if (nodes.length) { + for (const node of nodes) { + parentNode.removeChild(node); + } + const wrappedRule = new require$$0$1.Rule({ + nodes, + selector: "&" + }); + parentNode.prepend(wrappedRule); + } +} +scopedPlugin.postcss = true; + +var sourceMap = {}; + +var sourceMapGenerator = {}; + +var base64Vlq = {}; + +var base64 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64; + +function requireBase64 () { + if (hasRequiredBase64) return base64; + hasRequiredBase64 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + base64.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + base64.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + return base64; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64Vlq; + +function requireBase64Vlq () { + if (hasRequiredBase64Vlq) return base64Vlq; + hasRequiredBase64Vlq = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = /*@__PURE__*/ requireBase64(); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + base64Vlq.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + return base64Vlq; +} + +var util$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredUtil$1; + +function requireUtil$1 () { + if (hasRequiredUtil$1) return util$1; + hasRequiredUtil$1 = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '<dir>/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + } (util$1)); + return util$1; +} + +var arraySet = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredArraySet; + +function requireArraySet () { + if (hasRequiredArraySet) return arraySet; + hasRequiredArraySet = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$1(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + arraySet.ArraySet = ArraySet; + return arraySet; +} + +var mappingList = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredMappingList; + +function requireMappingList () { + if (hasRequiredMappingList) return mappingList; + hasRequiredMappingList = 1; + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$1(); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + mappingList.MappingList = MappingList; + return mappingList; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapGenerator; + +function requireSourceMapGenerator () { + if (hasRequiredSourceMapGenerator) return sourceMapGenerator; + hasRequiredSourceMapGenerator = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = /*@__PURE__*/ requireBase64Vlq(); + var util = /*@__PURE__*/ requireUtil$1(); + var ArraySet = /*@__PURE__*/ requireArraySet().ArraySet; + var MappingList = /*@__PURE__*/ requireMappingList().MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ''; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + sourceMapGenerator.SourceMapGenerator = SourceMapGenerator; + return sourceMapGenerator; +} + +var sourceMapConsumer = {}; + +var binarySearch = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBinarySearch; + +function requireBinarySearch () { + if (hasRequiredBinarySearch) return binarySearch; + hasRequiredBinarySearch = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + } (binarySearch)); + return binarySearch; +} + +var quickSort = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredQuickSort; + +function requireQuickSort () { + if (hasRequiredQuickSort) return quickSort; + hasRequiredQuickSort = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + quickSort.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + return quickSort; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapConsumer; + +function requireSourceMapConsumer () { + if (hasRequiredSourceMapConsumer) return sourceMapConsumer; + hasRequiredSourceMapConsumer = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$1(); + var binarySearch = /*@__PURE__*/ requireBinarySearch(); + var ArraySet = /*@__PURE__*/ requireArraySet().ArraySet; + var base64VLQ = /*@__PURE__*/ requireBase64Vlq(); + var quickSort = /*@__PURE__*/ requireQuickSort().quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + sourceMapConsumer.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + return sourceMapConsumer; +} + +var sourceNode = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceNode; + +function requireSourceNode () { + if (hasRequiredSourceNode) return sourceNode; + hasRequiredSourceNode = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator().SourceMapGenerator; + var util = /*@__PURE__*/ requireUtil$1(); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + sourceNode.SourceNode = SourceNode; + return sourceNode; +} + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var hasRequiredSourceMap; + +function requireSourceMap () { + if (hasRequiredSourceMap) return sourceMap; + hasRequiredSourceMap = 1; + sourceMap.SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator().SourceMapGenerator; + sourceMap.SourceMapConsumer = /*@__PURE__*/ requireSourceMapConsumer().SourceMapConsumer; + sourceMap.SourceNode = /*@__PURE__*/ requireSourceNode().SourceNode; + return sourceMap; +} + +var mergeSourceMap; +var hasRequiredMergeSourceMap; + +function requireMergeSourceMap () { + if (hasRequiredMergeSourceMap) return mergeSourceMap; + hasRequiredMergeSourceMap = 1; + var sourceMap = /*@__PURE__*/ requireSourceMap(); + var SourceMapConsumer = sourceMap.SourceMapConsumer; + var SourceMapGenerator = sourceMap.SourceMapGenerator; + + mergeSourceMap = merge; + + /** + * Merge old source map and new source map and return merged. + * If old or new source map value is falsy, return another one as it is. + * + * @param {object|string} [oldMap] old source map object + * @param {object|string} [newmap] new source map object + * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined + */ + function merge(oldMap, newMap) { + if (!oldMap) return newMap + if (!newMap) return oldMap + + var oldMapConsumer = new SourceMapConsumer(oldMap); + var newMapConsumer = new SourceMapConsumer(newMap); + var mergedMapGenerator = new SourceMapGenerator(); + + // iterate on new map and overwrite original position of new map with one of old map + newMapConsumer.eachMapping(function(m) { + // pass when `originalLine` is null. + // It occurs in case that the node does not have origin in original code. + if (m.originalLine == null) return + + var origPosInOldMap = oldMapConsumer.originalPositionFor({ + line: m.originalLine, + column: m.originalColumn + }); + + if (origPosInOldMap.source == null) return + + mergedMapGenerator.addMapping({ + original: { + line: origPosInOldMap.line, + column: origPosInOldMap.column + }, + generated: { + line: m.generatedLine, + column: m.generatedColumn + }, + source: origPosInOldMap.source, + name: origPosInOldMap.name + }); + }); + + var consumers = [oldMapConsumer, newMapConsumer]; + consumers.forEach(function(consumer) { + consumer.sources.forEach(function(sourceFile) { + mergedMapGenerator._sources.add(sourceFile); + var sourceContent = consumer.sourceContentFor(sourceFile); + if (sourceContent != null) { + mergedMapGenerator.setSourceContent(sourceFile, sourceContent); + } + }); + }); + + mergedMapGenerator._sourceRoot = oldMap.sourceRoot; + mergedMapGenerator._file = oldMap.file; + + return JSON.parse(mergedMapGenerator.toString()) + } + return mergeSourceMap; +} + +var mergeSourceMapExports = /*@__PURE__*/ requireMergeSourceMap(); +var merge = /*@__PURE__*/getDefaultExportFromCjs(mergeSourceMapExports); + +const scss = (source, map, options, load = require) => { + const nodeSass = load("sass"); + const { compileString, renderSync } = nodeSass; + const data = getSource(source, options.filename, options.additionalData); + let css; + let dependencies; + let sourceMap; + try { + if (compileString) { + const { pathToFileURL, fileURLToPath } = load("url"); + const result = compileString(data, { + ...options, + url: pathToFileURL(options.filename), + sourceMap: !!map + }); + css = result.css; + dependencies = result.loadedUrls.map((url) => fileURLToPath(url)); + sourceMap = map ? result.sourceMap : void 0; + } else { + const result = renderSync({ + ...options, + data, + file: options.filename, + outFile: options.filename, + sourceMap: !!map + }); + css = result.css.toString(); + dependencies = result.stats.includedFiles; + sourceMap = map ? JSON.parse(result.map.toString()) : void 0; + } + if (map) { + return { + code: css, + errors: [], + dependencies, + map: merge(map, sourceMap) + }; + } + return { code: css, errors: [], dependencies }; + } catch (e) { + return { code: "", errors: [e], dependencies: [] }; + } +}; +const sass = (source, map, options, load) => scss( + source, + map, + { + ...options, + indentedSyntax: true + }, + load +); +const less = (source, map, options, load = require) => { + const nodeLess = load("less"); + let result; + let error = null; + nodeLess.render( + getSource(source, options.filename, options.additionalData), + { ...options, syncImport: true }, + (err, output) => { + error = err; + result = output; + } + ); + if (error) return { code: "", errors: [error], dependencies: [] }; + const dependencies = result.imports; + if (map) { + return { + code: result.css.toString(), + map: merge(map, result.map), + errors: [], + dependencies + }; + } + return { + code: result.css.toString(), + errors: [], + dependencies + }; +}; +const styl = (source, map, options, load = require) => { + const nodeStylus = load("stylus"); + try { + const ref = nodeStylus(source, options); + if (map) ref.set("sourcemap", { inline: false, comment: false }); + const result = ref.render(); + const dependencies = ref.deps(); + if (map) { + return { + code: result, + map: merge(map, ref.sourcemap), + errors: [], + dependencies + }; + } + return { code: result, errors: [], dependencies }; + } catch (e) { + return { code: "", errors: [e], dependencies: [] }; + } +}; +function getSource(source, filename, additionalData) { + if (!additionalData) return source; + if (shared.isFunction(additionalData)) { + return additionalData(source, filename); + } + return additionalData + source; +} +const processors = { + less, + sass, + scss, + styl, + stylus: styl +}; + +var build = {exports: {}}; + +var fs = {}; + +var hasRequiredFs; + +function requireFs () { + if (hasRequiredFs) return fs; + hasRequiredFs = 1; + + Object.defineProperty(fs, "__esModule", { + value: true + }); + fs.getFileSystem = getFileSystem; + fs.setFileSystem = setFileSystem; + let fileSystem = { + readFile: () => { + throw Error("readFile not implemented"); + }, + writeFile: () => { + throw Error("writeFile not implemented"); + } + }; + + function setFileSystem(fs) { + fileSystem.readFile = fs.readFile; + fileSystem.writeFile = fs.writeFile; + } + + function getFileSystem() { + return fileSystem; + } + return fs; +} + +var pluginFactory = {}; + +var unquote = {}; + +var hasRequiredUnquote; + +function requireUnquote () { + if (hasRequiredUnquote) return unquote; + hasRequiredUnquote = 1; + + Object.defineProperty(unquote, "__esModule", { + value: true + }); + unquote.default = unquote$1; + // copied from https://github.com/lakenen/node-unquote + const reg = /['"]/; + + function unquote$1(str) { + if (!str) { + return ""; + } + + if (reg.test(str.charAt(0))) { + str = str.substr(1); + } + + if (reg.test(str.charAt(str.length - 1))) { + str = str.substr(0, str.length - 1); + } + + return str; + } + return unquote; +} + +var Parser = {}; + +var replaceValueSymbols_1; +var hasRequiredReplaceValueSymbols; + +function requireReplaceValueSymbols () { + if (hasRequiredReplaceValueSymbols) return replaceValueSymbols_1; + hasRequiredReplaceValueSymbols = 1; + const matchValueName = /[$]?[\w-]+/g; + + const replaceValueSymbols = (value, replacements) => { + let matches; + + while ((matches = matchValueName.exec(value))) { + const replacement = replacements[matches[0]]; + + if (replacement) { + value = + value.slice(0, matches.index) + + replacement + + value.slice(matchValueName.lastIndex); + + matchValueName.lastIndex -= matches[0].length - replacement.length; + } + } + + return value; + }; + + replaceValueSymbols_1 = replaceValueSymbols; + return replaceValueSymbols_1; +} + +var replaceSymbols_1; +var hasRequiredReplaceSymbols; + +function requireReplaceSymbols () { + if (hasRequiredReplaceSymbols) return replaceSymbols_1; + hasRequiredReplaceSymbols = 1; + const replaceValueSymbols = /*@__PURE__*/ requireReplaceValueSymbols(); + + const replaceSymbols = (css, replacements) => { + css.walk((node) => { + if (node.type === "decl" && node.value) { + node.value = replaceValueSymbols(node.value.toString(), replacements); + } else if (node.type === "rule" && node.selector) { + node.selector = replaceValueSymbols( + node.selector.toString(), + replacements + ); + } else if (node.type === "atrule" && node.params) { + node.params = replaceValueSymbols(node.params.toString(), replacements); + } + }); + }; + + replaceSymbols_1 = replaceSymbols; + return replaceSymbols_1; +} + +var extractICSS_1; +var hasRequiredExtractICSS; + +function requireExtractICSS () { + if (hasRequiredExtractICSS) return extractICSS_1; + hasRequiredExtractICSS = 1; + const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/; + const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/; + + const getDeclsObject = (rule) => { + const object = {}; + + rule.walkDecls((decl) => { + const before = decl.raws.before ? decl.raws.before.trim() : ""; + + object[before + decl.prop] = decl.value; + }); + + return object; + }; + /** + * + * @param {string} css + * @param {boolean} removeRules + * @param {'auto' | 'rule' | 'at-rule'} mode + */ + const extractICSS = (css, removeRules = true, mode = "auto") => { + const icssImports = {}; + const icssExports = {}; + + function addImports(node, path) { + const unquoted = path.replace(/'|"/g, ""); + icssImports[unquoted] = Object.assign( + icssImports[unquoted] || {}, + getDeclsObject(node) + ); + + if (removeRules) { + node.remove(); + } + } + + function addExports(node) { + Object.assign(icssExports, getDeclsObject(node)); + if (removeRules) { + node.remove(); + } + } + + css.each((node) => { + if (node.type === "rule" && mode !== "at-rule") { + if (node.selector.slice(0, 7) === ":import") { + const matches = importPattern.exec(node.selector); + + if (matches) { + addImports(node, matches[1]); + } + } + + if (node.selector === ":export") { + addExports(node); + } + } + + if (node.type === "atrule" && mode !== "rule") { + if (node.name === "icss-import") { + const matches = balancedQuotes.exec(node.params); + + if (matches) { + addImports(node, matches[1]); + } + } + if (node.name === "icss-export") { + addExports(node); + } + } + }); + + return { icssImports, icssExports }; + }; + + extractICSS_1 = extractICSS; + return extractICSS_1; +} + +var createICSSRules_1; +var hasRequiredCreateICSSRules; + +function requireCreateICSSRules () { + if (hasRequiredCreateICSSRules) return createICSSRules_1; + hasRequiredCreateICSSRules = 1; + const createImports = (imports, postcss, mode = "rule") => { + return Object.keys(imports).map((path) => { + const aliases = imports[path]; + const declarations = Object.keys(aliases).map((key) => + postcss.decl({ + prop: key, + value: aliases[key], + raws: { before: "\n " }, + }) + ); + + const hasDeclarations = declarations.length > 0; + + const rule = + mode === "rule" + ? postcss.rule({ + selector: `:import('${path}')`, + raws: { after: hasDeclarations ? "\n" : "" }, + }) + : postcss.atRule({ + name: "icss-import", + params: `'${path}'`, + raws: { after: hasDeclarations ? "\n" : "" }, + }); + + if (hasDeclarations) { + rule.append(declarations); + } + + return rule; + }); + }; + + const createExports = (exports, postcss, mode = "rule") => { + const declarations = Object.keys(exports).map((key) => + postcss.decl({ + prop: key, + value: exports[key], + raws: { before: "\n " }, + }) + ); + + if (declarations.length === 0) { + return []; + } + const rule = + mode === "rule" + ? postcss.rule({ + selector: `:export`, + raws: { after: "\n" }, + }) + : postcss.atRule({ + name: "icss-export", + raws: { after: "\n" }, + }); + + rule.append(declarations); + + return [rule]; + }; + + const createICSSRules = (imports, exports, postcss, mode) => [ + ...createImports(imports, postcss, mode), + ...createExports(exports, postcss, mode), + ]; + + createICSSRules_1 = createICSSRules; + return createICSSRules_1; +} + +var src$4; +var hasRequiredSrc$4; + +function requireSrc$4 () { + if (hasRequiredSrc$4) return src$4; + hasRequiredSrc$4 = 1; + const replaceValueSymbols = /*@__PURE__*/ requireReplaceValueSymbols(); + const replaceSymbols = /*@__PURE__*/ requireReplaceSymbols(); + const extractICSS = /*@__PURE__*/ requireExtractICSS(); + const createICSSRules = /*@__PURE__*/ requireCreateICSSRules(); + + src$4 = { + replaceValueSymbols, + replaceSymbols, + extractICSS, + createICSSRules, + }; + return src$4; +} + +var hasRequiredParser$1; + +function requireParser$1 () { + if (hasRequiredParser$1) return Parser; + hasRequiredParser$1 = 1; + + Object.defineProperty(Parser, "__esModule", { + value: true + }); + Parser.default = void 0; + + var _icssUtils = /*@__PURE__*/ requireSrc$4(); + + // Initially copied from https://github.com/css-modules/css-modules-loader-core + const importRegexp = /^:import\((.+)\)$/; + + let Parser$1 = class Parser { + constructor(pathFetcher, trace) { + this.pathFetcher = pathFetcher; + this.plugin = this.plugin.bind(this); + this.exportTokens = {}; + this.translations = {}; + this.trace = trace; + } + + plugin() { + const parser = this; + return { + postcssPlugin: "css-modules-parser", + + async OnceExit(css) { + await Promise.all(parser.fetchAllImports(css)); + parser.linkImportedSymbols(css); + return parser.extractExports(css); + } + + }; + } + + fetchAllImports(css) { + let imports = []; + css.each(node => { + if (node.type == "rule" && node.selector.match(importRegexp)) { + imports.push(this.fetchImport(node, css.source.input.from, imports.length)); + } + }); + return imports; + } + + linkImportedSymbols(css) { + (0, _icssUtils.replaceSymbols)(css, this.translations); + } + + extractExports(css) { + css.each(node => { + if (node.type == "rule" && node.selector == ":export") this.handleExport(node); + }); + } + + handleExport(exportNode) { + exportNode.each(decl => { + if (decl.type == "decl") { + Object.keys(this.translations).forEach(translation => { + decl.value = decl.value.replace(translation, this.translations[translation]); + }); + this.exportTokens[decl.prop] = decl.value; + } + }); + exportNode.remove(); + } + + async fetchImport(importNode, relativeTo, depNr) { + const file = importNode.selector.match(importRegexp)[1]; + const depTrace = this.trace + String.fromCharCode(depNr); + const exports = await this.pathFetcher(file, relativeTo, depTrace); + + try { + importNode.each(decl => { + if (decl.type == "decl") { + this.translations[decl.prop] = exports[decl.value]; + } + }); + importNode.remove(); + } catch (err) { + console.log(err); + } + } + + }; + + Parser.default = Parser$1; + return Parser; +} + +var saveJSON = {}; + +var hasRequiredSaveJSON; + +function requireSaveJSON () { + if (hasRequiredSaveJSON) return saveJSON; + hasRequiredSaveJSON = 1; + + Object.defineProperty(saveJSON, "__esModule", { + value: true + }); + saveJSON.default = saveJSON$1; + + var _fs = /*@__PURE__*/ requireFs(); + + function saveJSON$1(cssFile, json) { + return new Promise((resolve, reject) => { + const { + writeFile + } = (0, _fs.getFileSystem)(); + writeFile(`${cssFile}.json`, JSON.stringify(json), e => e ? reject(e) : resolve(json)); + }); + } + return saveJSON; +} + +var localsConvention = {}; + +/** + * lodash (Custom Build) <https://lodash.com/> + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors <https://jquery.org/> + * Released under MIT license <https://lodash.com/license> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +var lodash_camelcase; +var hasRequiredLodash_camelcase; + +function requireLodash_camelcase () { + if (hasRequiredLodash_camelcase) return lodash_camelcase; + hasRequiredLodash_camelcase = 1; + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, + rsUpper + '+' + rsOptUpperContr, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 'ss' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var Symbol = root.Symbol; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ + var upperFirst = createCaseFirst('toUpperCase'); + + /** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ + function words(string, pattern, guard) { + string = toString(string); + pattern = pattern; + + if (pattern === undefined) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; + } + + lodash_camelcase = camelCase; + return lodash_camelcase; +} + +var hasRequiredLocalsConvention; + +function requireLocalsConvention () { + if (hasRequiredLocalsConvention) return localsConvention; + hasRequiredLocalsConvention = 1; + + Object.defineProperty(localsConvention, "__esModule", { + value: true + }); + localsConvention.makeLocalsConventionReducer = makeLocalsConventionReducer; + + var _lodash = _interopRequireDefault(/*@__PURE__*/ requireLodash_camelcase()); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function dashesCamelCase(string) { + return string.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase()); + } + + function makeLocalsConventionReducer(localsConvention, inputFile) { + const isFunc = typeof localsConvention === "function"; + return (tokens, [className, value]) => { + if (isFunc) { + const convention = localsConvention(className, value, inputFile); + tokens[convention] = value; + return tokens; + } + + switch (localsConvention) { + case "camelCase": + tokens[className] = value; + tokens[(0, _lodash.default)(className)] = value; + break; + + case "camelCaseOnly": + tokens[(0, _lodash.default)(className)] = value; + break; + + case "dashes": + tokens[className] = value; + tokens[dashesCamelCase(className)] = value; + break; + + case "dashesOnly": + tokens[dashesCamelCase(className)] = value; + break; + } + + return tokens; + }; + } + return localsConvention; +} + +var FileSystemLoader = {}; + +var hasRequiredFileSystemLoader; + +function requireFileSystemLoader () { + if (hasRequiredFileSystemLoader) return FileSystemLoader; + hasRequiredFileSystemLoader = 1; + + Object.defineProperty(FileSystemLoader, "__esModule", { + value: true + }); + FileSystemLoader.default = void 0; + + var _postcss = _interopRequireDefault(require$$0$1); + + var _path = _interopRequireDefault(path$1); + + var _Parser = _interopRequireDefault(/*@__PURE__*/ requireParser$1()); + + var _fs = /*@__PURE__*/ requireFs(); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + // Initially copied from https://github.com/css-modules/css-modules-loader-core + class Core { + constructor(plugins) { + this.plugins = plugins || Core.defaultPlugins; + } + + async load(sourceString, sourcePath, trace, pathFetcher) { + const parser = new _Parser.default(pathFetcher, trace); + const plugins = this.plugins.concat([parser.plugin()]); + const result = await (0, _postcss.default)(plugins).process(sourceString, { + from: sourcePath + }); + return { + injectableSource: result.css, + exportTokens: parser.exportTokens + }; + } + + } // Sorts dependencies in the following way: + // AAA comes before AA and A + // AB comes after AA and before A + // All Bs come after all As + // This ensures that the files are always returned in the following order: + // - In the order they were required, except + // - After all their dependencies + + + const traceKeySorter = (a, b) => { + if (a.length < b.length) { + return a < b.substring(0, a.length) ? -1 : 1; + } + + if (a.length > b.length) { + return a.substring(0, b.length) <= b ? -1 : 1; + } + + return a < b ? -1 : 1; + }; + + let FileSystemLoader$1 = class FileSystemLoader { + constructor(root, plugins, fileResolve) { + if (root === "/" && process.platform === "win32") { + const cwdDrive = process.cwd().slice(0, 3); + + if (!/^[A-Za-z]:\\$/.test(cwdDrive)) { + throw new Error(`Failed to obtain root from "${process.cwd()}".`); + } + + root = cwdDrive; + } + + this.root = root; + this.fileResolve = fileResolve; + this.sources = {}; + this.traces = {}; + this.importNr = 0; + this.core = new Core(plugins); + this.tokensByFile = {}; + this.fs = (0, _fs.getFileSystem)(); + } + + async fetch(_newPath, relativeTo, _trace) { + const newPath = _newPath.replace(/^["']|["']$/g, ""); + + const trace = _trace || String.fromCharCode(this.importNr++); + + const useFileResolve = typeof this.fileResolve === "function"; + const fileResolvedPath = useFileResolve ? await this.fileResolve(newPath, relativeTo) : await Promise.resolve(); + + if (fileResolvedPath && !_path.default.isAbsolute(fileResolvedPath)) { + throw new Error('The returned path from the "fileResolve" option must be absolute.'); + } + + const relativeDir = _path.default.dirname(relativeTo); + + const rootRelativePath = fileResolvedPath || _path.default.resolve(relativeDir, newPath); + + let fileRelativePath = fileResolvedPath || _path.default.resolve(_path.default.resolve(this.root, relativeDir), newPath); // if the path is not relative or absolute, try to resolve it in node_modules + + + if (!useFileResolve && newPath[0] !== "." && !_path.default.isAbsolute(newPath)) { + try { + fileRelativePath = require.resolve(newPath); + } catch (e) {// noop + } + } + + const tokens = this.tokensByFile[fileRelativePath]; + if (tokens) return tokens; + return new Promise((resolve, reject) => { + this.fs.readFile(fileRelativePath, "utf-8", async (err, source) => { + if (err) reject(err); + const { + injectableSource, + exportTokens + } = await this.core.load(source, rootRelativePath, trace, this.fetch.bind(this)); + this.sources[fileRelativePath] = injectableSource; + this.traces[trace] = fileRelativePath; + this.tokensByFile[fileRelativePath] = exportTokens; + resolve(exportTokens); + }); + }); + } + + get finalSource() { + const traces = this.traces; + const sources = this.sources; + let written = new Set(); + return Object.keys(traces).sort(traceKeySorter).map(key => { + const filename = traces[key]; + + if (written.has(filename)) { + return null; + } + + written.add(filename); + return sources[filename]; + }).join(""); + } + + }; + + FileSystemLoader.default = FileSystemLoader$1; + return FileSystemLoader; +} + +var scoping = {}; + +var src$3 = {exports: {}}; + +var topologicalSort_1; +var hasRequiredTopologicalSort; + +function requireTopologicalSort () { + if (hasRequiredTopologicalSort) return topologicalSort_1; + hasRequiredTopologicalSort = 1; + const PERMANENT_MARKER = 2; + const TEMPORARY_MARKER = 1; + + function createError(node, graph) { + const er = new Error("Nondeterministic import's order"); + + const related = graph[node]; + const relatedNode = related.find( + (relatedNode) => graph[relatedNode].indexOf(node) > -1 + ); + + er.nodes = [node, relatedNode]; + + return er; + } + + function walkGraph(node, graph, state, result, strict) { + if (state[node] === PERMANENT_MARKER) { + return; + } + + if (state[node] === TEMPORARY_MARKER) { + if (strict) { + return createError(node, graph); + } + + return; + } + + state[node] = TEMPORARY_MARKER; + + const children = graph[node]; + const length = children.length; + + for (let i = 0; i < length; ++i) { + const error = walkGraph(children[i], graph, state, result, strict); + + if (error instanceof Error) { + return error; + } + } + + state[node] = PERMANENT_MARKER; + + result.push(node); + } + + function topologicalSort(graph, strict) { + const result = []; + const state = {}; + + const nodes = Object.keys(graph); + const length = nodes.length; + + for (let i = 0; i < length; ++i) { + const er = walkGraph(nodes[i], graph, state, result, strict); + + if (er instanceof Error) { + return er; + } + } + + return result; + } + + topologicalSort_1 = topologicalSort; + return topologicalSort_1; +} + +var hasRequiredSrc$3; + +function requireSrc$3 () { + if (hasRequiredSrc$3) return src$3.exports; + hasRequiredSrc$3 = 1; + const topologicalSort = /*@__PURE__*/ requireTopologicalSort(); + + const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/; + const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/; + + const VISITED_MARKER = 1; + + /** + * :import('G') {} + * + * Rule + * composes: ... from 'A' + * composes: ... from 'B' + + * Rule + * composes: ... from 'A' + * composes: ... from 'A' + * composes: ... from 'C' + * + * Results in: + * + * graph: { + * G: [], + * A: [], + * B: ['A'], + * C: ['A'], + * } + */ + function addImportToGraph(importId, parentId, graph, visited) { + const siblingsId = parentId + "_" + "siblings"; + const visitedId = parentId + "_" + importId; + + if (visited[visitedId] !== VISITED_MARKER) { + if (!Array.isArray(visited[siblingsId])) { + visited[siblingsId] = []; + } + + const siblings = visited[siblingsId]; + + if (Array.isArray(graph[importId])) { + graph[importId] = graph[importId].concat(siblings); + } else { + graph[importId] = siblings.slice(); + } + + visited[visitedId] = VISITED_MARKER; + + siblings.push(importId); + } + } + + src$3.exports = (options = {}) => { + let importIndex = 0; + const createImportedName = + typeof options.createImportedName !== "function" + ? (importName /*, path*/) => + `i__imported_${importName.replace(/\W/g, "_")}_${importIndex++}` + : options.createImportedName; + const failOnWrongOrder = options.failOnWrongOrder; + + return { + postcssPlugin: "postcss-modules-extract-imports", + prepare() { + const graph = {}; + const visited = {}; + const existingImports = {}; + const importDecls = {}; + const imports = {}; + + return { + Once(root, postcss) { + // Check the existing imports order and save refs + root.walkRules((rule) => { + const matches = icssImport.exec(rule.selector); + + if (matches) { + const [, /*match*/ doubleQuotePath, singleQuotePath] = matches; + const importPath = doubleQuotePath || singleQuotePath; + + addImportToGraph(importPath, "root", graph, visited); + + existingImports[importPath] = rule; + } + }); + + root.walkDecls(/^composes$/, (declaration) => { + const multiple = declaration.value.split(","); + const values = []; + + multiple.forEach((value) => { + const matches = value.trim().match(matchImports); + + if (!matches) { + values.push(value); + + return; + } + + let tmpSymbols; + let [ + , + /*match*/ symbols, + doubleQuotePath, + singleQuotePath, + global, + ] = matches; + + if (global) { + // Composing globals simply means changing these classes to wrap them in global(name) + tmpSymbols = symbols.split(/\s+/).map((s) => `global(${s})`); + } else { + const importPath = doubleQuotePath || singleQuotePath; + + let parent = declaration.parent; + let parentIndexes = ""; + + while (parent.type !== "root") { + parentIndexes = + parent.parent.index(parent) + "_" + parentIndexes; + parent = parent.parent; + } + + const { selector } = declaration.parent; + const parentRule = `_${parentIndexes}${selector}`; + + addImportToGraph(importPath, parentRule, graph, visited); + + importDecls[importPath] = declaration; + imports[importPath] = imports[importPath] || {}; + + tmpSymbols = symbols.split(/\s+/).map((s) => { + if (!imports[importPath][s]) { + imports[importPath][s] = createImportedName(s, importPath); + } + + return imports[importPath][s]; + }); + } + + values.push(tmpSymbols.join(" ")); + }); + + declaration.value = values.join(", "); + }); + + const importsOrder = topologicalSort(graph, failOnWrongOrder); + + if (importsOrder instanceof Error) { + const importPath = importsOrder.nodes.find((importPath) => + // eslint-disable-next-line no-prototype-builtins + importDecls.hasOwnProperty(importPath) + ); + const decl = importDecls[importPath]; + + throw decl.error( + "Failed to resolve order of composed modules " + + importsOrder.nodes + .map((importPath) => "`" + importPath + "`") + .join(", ") + + ".", + { + plugin: "postcss-modules-extract-imports", + word: "composes", + } + ); + } + + let lastImportRule; + + importsOrder.forEach((path) => { + const importedSymbols = imports[path]; + let rule = existingImports[path]; + + if (!rule && importedSymbols) { + rule = postcss.rule({ + selector: `:import("${path}")`, + raws: { after: "\n" }, + }); + + if (lastImportRule) { + root.insertAfter(lastImportRule, rule); + } else { + root.prepend(rule); + } + } + + lastImportRule = rule; + + if (!importedSymbols) { + return; + } + + Object.keys(importedSymbols).forEach((importedSymbol) => { + rule.append( + postcss.decl({ + value: importedSymbol, + prop: importedSymbols[importedSymbol], + raws: { before: "\n " }, + }) + ); + }); + }); + }, + }; + }, + }; + }; + + src$3.exports.postcss = true; + return src$3.exports; +} + +var wasmHash = {exports: {}}; + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var hasRequiredWasmHash; + +function requireWasmHash () { + if (hasRequiredWasmHash) return wasmHash.exports; + hasRequiredWasmHash = 1; + + // 65536 is the size of a wasm memory page + // 64 is the maximum chunk size for every possible wasm hash implementation + // 4 is the maximum number of bytes per char for string encoding (max is utf-8) + // ~3 makes sure that it's always a block of 4 chars, so avoid partially encoded bytes for base64 + const MAX_SHORT_STRING = Math.floor((65536 - 64) / 4) & ~3; + + class WasmHash { + /** + * @param {WebAssembly.Instance} instance wasm instance + * @param {WebAssembly.Instance[]} instancesPool pool of instances + * @param {number} chunkSize size of data chunks passed to wasm + * @param {number} digestSize size of digest returned by wasm + */ + constructor(instance, instancesPool, chunkSize, digestSize) { + const exports = /** @type {any} */ (instance.exports); + + exports.init(); + + this.exports = exports; + this.mem = Buffer.from(exports.memory.buffer, 0, 65536); + this.buffered = 0; + this.instancesPool = instancesPool; + this.chunkSize = chunkSize; + this.digestSize = digestSize; + } + + reset() { + this.buffered = 0; + this.exports.init(); + } + + /** + * @param {Buffer | string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {this} itself + */ + update(data, encoding) { + if (typeof data === "string") { + while (data.length > MAX_SHORT_STRING) { + this._updateWithShortString(data.slice(0, MAX_SHORT_STRING), encoding); + data = data.slice(MAX_SHORT_STRING); + } + + this._updateWithShortString(data, encoding); + + return this; + } + + this._updateWithBuffer(data); + + return this; + } + + /** + * @param {string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {void} + */ + _updateWithShortString(data, encoding) { + const { exports, buffered, mem, chunkSize } = this; + + let endPos; + + if (data.length < 70) { + if (!encoding || encoding === "utf-8" || encoding === "utf8") { + endPos = buffered; + for (let i = 0; i < data.length; i++) { + const cc = data.charCodeAt(i); + + if (cc < 0x80) { + mem[endPos++] = cc; + } else if (cc < 0x800) { + mem[endPos] = (cc >> 6) | 0xc0; + mem[endPos + 1] = (cc & 0x3f) | 0x80; + endPos += 2; + } else { + // bail-out for weird chars + endPos += mem.write(data.slice(i), endPos, encoding); + break; + } + } + } else if (encoding === "latin1") { + endPos = buffered; + + for (let i = 0; i < data.length; i++) { + const cc = data.charCodeAt(i); + + mem[endPos++] = cc; + } + } else { + endPos = buffered + mem.write(data, buffered, encoding); + } + } else { + endPos = buffered + mem.write(data, buffered, encoding); + } + + if (endPos < chunkSize) { + this.buffered = endPos; + } else { + const l = endPos & ~(this.chunkSize - 1); + + exports.update(l); + + const newBuffered = endPos - l; + + this.buffered = newBuffered; + + if (newBuffered > 0) { + mem.copyWithin(0, l, endPos); + } + } + } + + /** + * @param {Buffer} data data + * @returns {void} + */ + _updateWithBuffer(data) { + const { exports, buffered, mem } = this; + const length = data.length; + + if (buffered + length < this.chunkSize) { + data.copy(mem, buffered, 0, length); + + this.buffered += length; + } else { + const l = (buffered + length) & ~(this.chunkSize - 1); + + if (l > 65536) { + let i = 65536 - buffered; + + data.copy(mem, buffered, 0, i); + exports.update(65536); + + const stop = l - buffered - 65536; + + while (i < stop) { + data.copy(mem, 0, i, i + 65536); + exports.update(65536); + i += 65536; + } + + data.copy(mem, 0, i, l - buffered); + + exports.update(l - buffered - i); + } else { + data.copy(mem, buffered, 0, l - buffered); + + exports.update(l); + } + + const newBuffered = length + buffered - l; + + this.buffered = newBuffered; + + if (newBuffered > 0) { + data.copy(mem, 0, length - newBuffered, length); + } + } + } + + digest(type) { + const { exports, buffered, mem, digestSize } = this; + + exports.final(buffered); + + this.instancesPool.push(this); + + const hex = mem.toString("latin1", 0, digestSize); + + if (type === "hex") { + return hex; + } + + if (type === "binary" || !type) { + return Buffer.from(hex, "hex"); + } + + return Buffer.from(hex, "hex").toString(type); + } + } + + const create = (wasmModule, instancesPool, chunkSize, digestSize) => { + if (instancesPool.length > 0) { + const old = instancesPool.pop(); + + old.reset(); + + return old; + } else { + return new WasmHash( + new WebAssembly.Instance(wasmModule), + instancesPool, + chunkSize, + digestSize + ); + } + }; + + wasmHash.exports = create; + wasmHash.exports.MAX_SHORT_STRING = MAX_SHORT_STRING; + return wasmHash.exports; +} + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var xxhash64_1; +var hasRequiredXxhash64; + +function requireXxhash64 () { + if (hasRequiredXxhash64) return xxhash64_1; + hasRequiredXxhash64 = 1; + + const create = /*@__PURE__*/ requireWasmHash(); + + //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1 + const xxhash64 = new WebAssembly.Module( + Buffer.from( + // 1173 bytes + "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAiACQh2IhUL5893xmfaZqxZ+IgIgAkIgiIUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", + "base64" + ) + ); + //#endregion + + xxhash64_1 = create.bind(null, xxhash64, [], 32, 16); + return xxhash64_1; +} + +var BatchedHash_1; +var hasRequiredBatchedHash; + +function requireBatchedHash () { + if (hasRequiredBatchedHash) return BatchedHash_1; + hasRequiredBatchedHash = 1; + const MAX_SHORT_STRING = /*@__PURE__*/ requireWasmHash().MAX_SHORT_STRING; + + class BatchedHash { + constructor(hash) { + this.string = undefined; + this.encoding = undefined; + this.hash = hash; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if (this.string !== undefined) { + if ( + typeof data === "string" && + inputEncoding === this.encoding && + this.string.length + data.length < MAX_SHORT_STRING + ) { + this.string += data; + + return this; + } + + this.hash.update(this.string, this.encoding); + this.string = undefined; + } + + if (typeof data === "string") { + if ( + data.length < MAX_SHORT_STRING && + // base64 encoding is not valid since it may contain padding chars + (!inputEncoding || !inputEncoding.startsWith("ba")) + ) { + this.string = data; + this.encoding = inputEncoding; + } else { + this.hash.update(data, inputEncoding); + } + } else { + this.hash.update(data); + } + + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + if (this.string !== undefined) { + this.hash.update(this.string, this.encoding); + } + + return this.hash.digest(encoding); + } + } + + BatchedHash_1 = BatchedHash; + return BatchedHash_1; +} + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var md4_1; +var hasRequiredMd4; + +function requireMd4 () { + if (hasRequiredMd4) return md4_1; + hasRequiredMd4 = 1; + + const create = /*@__PURE__*/ requireWasmHash(); + + //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1 + const md4 = new WebAssembly.Module( + Buffer.from( + // 2150 bytes + "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqFEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2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ZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", + "base64" + ) + ); + //#endregion + + md4_1 = create.bind(null, md4, [], 64, 32); + return md4_1; +} + +var BulkUpdateDecorator_1; +var hasRequiredBulkUpdateDecorator; + +function requireBulkUpdateDecorator () { + if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1; + hasRequiredBulkUpdateDecorator = 1; + const BULK_SIZE = 2000; + + // We are using an object instead of a Map as this will stay static during the runtime + // so access to it can be optimized by v8 + const digestCaches = {}; + + class BulkUpdateDecorator { + /** + * @param {Hash | function(): Hash} hashOrFactory function to create a hash + * @param {string=} hashKey key for caching + */ + constructor(hashOrFactory, hashKey) { + this.hashKey = hashKey; + + if (typeof hashOrFactory === "function") { + this.hashFactory = hashOrFactory; + this.hash = undefined; + } else { + this.hashFactory = undefined; + this.hash = hashOrFactory; + } + + this.buffer = ""; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if ( + inputEncoding !== undefined || + typeof data !== "string" || + data.length > BULK_SIZE + ) { + if (this.hash === undefined) { + this.hash = this.hashFactory(); + } + + if (this.buffer.length > 0) { + this.hash.update(this.buffer); + this.buffer = ""; + } + + this.hash.update(data, inputEncoding); + } else { + this.buffer += data; + + if (this.buffer.length > BULK_SIZE) { + if (this.hash === undefined) { + this.hash = this.hashFactory(); + } + + this.hash.update(this.buffer); + this.buffer = ""; + } + } + + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + let digestCache; + + const buffer = this.buffer; + + if (this.hash === undefined) { + // short data for hash, we can use caching + const cacheKey = `${this.hashKey}-${encoding}`; + + digestCache = digestCaches[cacheKey]; + + if (digestCache === undefined) { + digestCache = digestCaches[cacheKey] = new Map(); + } + + const cacheEntry = digestCache.get(buffer); + + if (cacheEntry !== undefined) { + return cacheEntry; + } + + this.hash = this.hashFactory(); + } + + if (buffer.length > 0) { + this.hash.update(buffer); + } + + const digestResult = this.hash.digest(encoding); + + if (digestCache !== undefined) { + digestCache.set(buffer, digestResult); + } + + return digestResult; + } + } + + BulkUpdateDecorator_1 = BulkUpdateDecorator; + return BulkUpdateDecorator_1; +} + +var getHashDigest_1; +var hasRequiredGetHashDigest; + +function requireGetHashDigest () { + if (hasRequiredGetHashDigest) return getHashDigest_1; + hasRequiredGetHashDigest = 1; + + const baseEncodeTables = { + 26: "abcdefghijklmnopqrstuvwxyz", + 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio + 36: "0123456789abcdefghijklmnopqrstuvwxyz", + 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO + 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO + 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_", + }; + + /** + * @param {Uint32Array} uint32Array Treated as a long base-0x100000000 number, little endian + * @param {number} divisor The divisor + * @return {number} Modulo (remainder) of the division + */ + function divmod32(uint32Array, divisor) { + let carry = 0; + for (let i = uint32Array.length - 1; i >= 0; i--) { + const value = carry * 0x100000000 + uint32Array[i]; + carry = value % divisor; + uint32Array[i] = Math.floor(value / divisor); + } + return carry; + } + + function encodeBufferToBase(buffer, base, length) { + const encodeTable = baseEncodeTables[base]; + + if (!encodeTable) { + throw new Error("Unknown encoding base" + base); + } + + // Input bits are only enough to generate this many characters + const limit = Math.ceil((buffer.length * 8) / Math.log2(base)); + length = Math.min(length, limit); + + // Most of the crypto digests (if not all) has length a multiple of 4 bytes. + // Fewer numbers in the array means faster math. + const uint32Array = new Uint32Array(Math.ceil(buffer.length / 4)); + + // Make sure the input buffer data is copied and is not mutated by reference. + // divmod32() would corrupt the BulkUpdateDecorator cache otherwise. + buffer.copy(Buffer.from(uint32Array.buffer)); + + let output = ""; + + for (let i = 0; i < length; i++) { + output = encodeTable[divmod32(uint32Array, base)] + output; + } + + return output; + } + + let crypto = undefined; + let createXXHash64 = undefined; + let createMd4 = undefined; + let BatchedHash = undefined; + let BulkUpdateDecorator = undefined; + + function getHashDigest(buffer, algorithm, digestType, maxLength) { + algorithm = algorithm || "xxhash64"; + maxLength = maxLength || 9999; + + let hash; + + if (algorithm === "xxhash64") { + if (createXXHash64 === undefined) { + createXXHash64 = /*@__PURE__*/ requireXxhash64(); + + if (BatchedHash === undefined) { + BatchedHash = /*@__PURE__*/ requireBatchedHash(); + } + } + + hash = new BatchedHash(createXXHash64()); + } else if (algorithm === "md4") { + if (createMd4 === undefined) { + createMd4 = /*@__PURE__*/ requireMd4(); + + if (BatchedHash === undefined) { + BatchedHash = /*@__PURE__*/ requireBatchedHash(); + } + } + + hash = new BatchedHash(createMd4()); + } else if (algorithm === "native-md4") { + if (typeof crypto === "undefined") { + crypto = require("crypto"); + + if (BulkUpdateDecorator === undefined) { + BulkUpdateDecorator = /*@__PURE__*/ requireBulkUpdateDecorator(); + } + } + + hash = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4"); + } else { + if (typeof crypto === "undefined") { + crypto = require("crypto"); + + if (BulkUpdateDecorator === undefined) { + BulkUpdateDecorator = /*@__PURE__*/ requireBulkUpdateDecorator(); + } + } + + hash = new BulkUpdateDecorator( + () => crypto.createHash(algorithm), + algorithm + ); + } + + hash.update(buffer); + + if ( + digestType === "base26" || + digestType === "base32" || + digestType === "base36" || + digestType === "base49" || + digestType === "base52" || + digestType === "base58" || + digestType === "base62" || + digestType === "base64safe" + ) { + return encodeBufferToBase( + hash.digest(), + digestType === "base64safe" ? 64 : digestType.substr(4), + maxLength + ); + } + + return hash.digest(digestType || "hex").substr(0, maxLength); + } + + getHashDigest_1 = getHashDigest; + return getHashDigest_1; +} + +var interpolateName_1; +var hasRequiredInterpolateName; + +function requireInterpolateName () { + if (hasRequiredInterpolateName) return interpolateName_1; + hasRequiredInterpolateName = 1; + + const path = path$1; + const getHashDigest = /*@__PURE__*/ requireGetHashDigest(); + + function interpolateName(loaderContext, name, options = {}) { + let filename; + + const hasQuery = + loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1; + + if (typeof name === "function") { + filename = name( + loaderContext.resourcePath, + hasQuery ? loaderContext.resourceQuery : undefined + ); + } else { + filename = name || "[hash].[ext]"; + } + + const context = options.context; + const content = options.content; + const regExp = options.regExp; + + let ext = "bin"; + let basename = "file"; + let directory = ""; + let folder = ""; + let query = ""; + + if (loaderContext.resourcePath) { + const parsed = path.parse(loaderContext.resourcePath); + let resourcePath = loaderContext.resourcePath; + + if (parsed.ext) { + ext = parsed.ext.substr(1); + } + + if (parsed.dir) { + basename = parsed.name; + resourcePath = parsed.dir + path.sep; + } + + if (typeof context !== "undefined") { + directory = path + .relative(context, resourcePath + "_") + .replace(/\\/g, "/") + .replace(/\.\.(\/)?/g, "_$1"); + directory = directory.substr(0, directory.length - 1); + } else { + directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + } + + if (directory.length <= 1) { + directory = ""; + } else { + // directory.length > 1 + folder = path.basename(directory); + } + } + + if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) { + query = loaderContext.resourceQuery; + + const hashIdx = query.indexOf("#"); + + if (hashIdx >= 0) { + query = query.substr(0, hashIdx); + } + } + + let url = filename; + + if (content) { + // Match hash template + url = url + // `hash` and `contenthash` are same in `loader-utils` context + // let's keep `hash` for backward compatibility + .replace( + /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*(?:safe)?))?(?::(\d+))?\]/gi, + (all, hashType, digestType, maxLength) => + getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)) + ); + } + + url = url + .replace(/\[ext\]/gi, () => ext) + .replace(/\[name\]/gi, () => basename) + .replace(/\[path\]/gi, () => directory) + .replace(/\[folder\]/gi, () => folder) + .replace(/\[query\]/gi, () => query); + + if (regExp && loaderContext.resourcePath) { + const match = loaderContext.resourcePath.match(new RegExp(regExp)); + + match && + match.forEach((matched, i) => { + url = url.replace(new RegExp("\\[" + i + "\\]", "ig"), matched); + }); + } + + if ( + typeof loaderContext.options === "object" && + typeof loaderContext.options.customInterpolateName === "function" + ) { + url = loaderContext.options.customInterpolateName.call( + loaderContext, + url, + name, + options + ); + } + + return url; + } + + interpolateName_1 = interpolateName; + return interpolateName_1; +} + +var genericNames; +var hasRequiredGenericNames; + +function requireGenericNames () { + if (hasRequiredGenericNames) return genericNames; + hasRequiredGenericNames = 1; + + var interpolateName = /*@__PURE__*/ requireInterpolateName(); + var path = path$1; + + /** + * @param {string} pattern + * @param {object} options + * @param {string} options.context + * @param {string} options.hashPrefix + * @return {function} + */ + genericNames = function createGenerator(pattern, options) { + options = options || {}; + var context = + options && typeof options.context === "string" + ? options.context + : process.cwd(); + var hashPrefix = + options && typeof options.hashPrefix === "string" ? options.hashPrefix : ""; + + /** + * @param {string} localName Usually a class name + * @param {string} filepath Absolute path + * @return {string} + */ + return function generate(localName, filepath) { + var name = pattern.replace(/\[local\]/gi, localName); + var loaderContext = { + resourcePath: filepath, + }; + + var loaderOptions = { + content: + hashPrefix + + path.relative(context, filepath).replace(/\\/g, "/") + + "\x00" + + localName, + context: context, + }; + + var genericName = interpolateName(loaderContext, name, loaderOptions); + return genericName + .replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-") + .replace(/^((-?[0-9])|--)/, "_$1"); + }; + }; + return genericNames; +} + +var src$2 = {exports: {}}; + +var dist = {exports: {}}; + +var processor = {exports: {}}; + +var parser = {exports: {}}; + +var root = {exports: {}}; + +var container = {exports: {}}; + +var node = {exports: {}}; + +var util = {}; + +var unesc = {exports: {}}; + +var hasRequiredUnesc; + +function requireUnesc () { + if (hasRequiredUnesc) return unesc.exports; + hasRequiredUnesc = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = unesc; + // Many thanks for this post which made this migration much easier. + // https://mathiasbynens.be/notes/css-escapes + + /** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ + function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); + // check to see if we are dealing with a valid hex char [a-f|0-9] + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + spaceTerminated = code === 32; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return undefined; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; + // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + + // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + + // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; + } + module.exports = exports.default; + } (unesc, unesc.exports)); + return unesc.exports; +} + +var getProp = {exports: {}}; + +var hasRequiredGetProp; + +function requireGetProp () { + if (hasRequiredGetProp) return getProp.exports; + hasRequiredGetProp = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = getProp; + function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return undefined; + } + obj = obj[prop]; + } + return obj; + } + module.exports = exports.default; + } (getProp, getProp.exports)); + return getProp.exports; +} + +var ensureObject = {exports: {}}; + +var hasRequiredEnsureObject; + +function requireEnsureObject () { + if (hasRequiredEnsureObject) return ensureObject.exports; + hasRequiredEnsureObject = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = ensureObject; + function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } + } + module.exports = exports.default; + } (ensureObject, ensureObject.exports)); + return ensureObject.exports; +} + +var stripComments = {exports: {}}; + +var hasRequiredStripComments; + +function requireStripComments () { + if (hasRequiredStripComments) return stripComments.exports; + hasRequiredStripComments = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = stripComments; + function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; + } + module.exports = exports.default; + } (stripComments, stripComments.exports)); + return stripComments.exports; +} + +var hasRequiredUtil; + +function requireUtil () { + if (hasRequiredUtil) return util; + hasRequiredUtil = 1; + + util.__esModule = true; + util.unesc = util.stripComments = util.getProp = util.ensureObject = void 0; + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc()); + util.unesc = _unesc["default"]; + var _getProp = _interopRequireDefault(/*@__PURE__*/ requireGetProp()); + util.getProp = _getProp["default"]; + var _ensureObject = _interopRequireDefault(/*@__PURE__*/ requireEnsureObject()); + util.ensureObject = _ensureObject["default"]; + var _stripComments = _interopRequireDefault(/*@__PURE__*/ requireStripComments()); + util.stripComments = _stripComments["default"]; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + return util; +} + +var hasRequiredNode; + +function requireNode () { + if (hasRequiredNode) return node.exports; + hasRequiredNode = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _util = /*@__PURE__*/ requireUtil(); + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + return cloned; + }; + var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + var _proto = Node.prototype; + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + this.raws[name] = valueEscaped; + } + + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + if (this.raws) { + delete this.raws[name]; + } + } + + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return undefined; + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node; + }(); + exports["default"] = Node; + module.exports = exports.default; + } (node, node.exports)); + return node.exports; +} + +var types$1 = {}; + +var hasRequiredTypes; + +function requireTypes () { + if (hasRequiredTypes) return types$1; + hasRequiredTypes = 1; + + types$1.__esModule = true; + types$1.UNIVERSAL = types$1.TAG = types$1.STRING = types$1.SELECTOR = types$1.ROOT = types$1.PSEUDO = types$1.NESTING = types$1.ID = types$1.COMMENT = types$1.COMBINATOR = types$1.CLASS = types$1.ATTRIBUTE = void 0; + var TAG = 'tag'; + types$1.TAG = TAG; + var STRING = 'string'; + types$1.STRING = STRING; + var SELECTOR = 'selector'; + types$1.SELECTOR = SELECTOR; + var ROOT = 'root'; + types$1.ROOT = ROOT; + var PSEUDO = 'pseudo'; + types$1.PSEUDO = PSEUDO; + var NESTING = 'nesting'; + types$1.NESTING = NESTING; + var ID = 'id'; + types$1.ID = ID; + var COMMENT = 'comment'; + types$1.COMMENT = COMMENT; + var COMBINATOR = 'combinator'; + types$1.COMBINATOR = COMBINATOR; + var CLASS = 'class'; + types$1.CLASS = CLASS; + var ATTRIBUTE = 'attribute'; + types$1.ATTRIBUTE = ATTRIBUTE; + var UNIVERSAL = 'universal'; + types$1.UNIVERSAL = UNIVERSAL; + return types$1; +} + +var hasRequiredContainer; + +function requireContainer () { + if (hasRequiredContainer) return container.exports; + hasRequiredContainer = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + function Container(opts) { + var _this; + _this = _Node.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + var _proto = Container.prototype; + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + return this; + }; + _proto.at = function at(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex <= index) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index <= oldIndex) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return undefined; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + if (result !== false && node.length) { + result = node.walk(callback); + } + if (result === false) { + return false; + } + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function (selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function (selector) { + if (selector.type === types.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function (selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function (selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function (selector) { + if (selector.type === types.ID) { + return callback.call(_this6, selector); + } + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function (selector) { + if (selector.type === types.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function (selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function (selector) { + if (selector.type === types.TAG) { + return callback.call(_this9, selector); + } + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function (selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString() { + return this.map(String).join(''); + }; + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + return Container; + }(_node["default"]); + exports["default"] = Container; + module.exports = exports.default; + } (container, container.exports)); + return container.exports; +} + +var hasRequiredRoot; + +function requireRoot () { + if (hasRequiredRoot) return root.exports; + hasRequiredRoot = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + function Root(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + var _proto = Root.prototype; + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root; + }(_container["default"]); + exports["default"] = Root; + module.exports = exports.default; + } (root, root.exports)); + return root.exports; +} + +var selector = {exports: {}}; + +var hasRequiredSelector; + +function requireSelector () { + if (hasRequiredSelector) return selector.exports; + hasRequiredSelector = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + function Selector(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + return Selector; + }(_container["default"]); + exports["default"] = Selector; + module.exports = exports.default; + } (selector, selector.exports)); + return selector.exports; +} + +var className = {exports: {}}; + +var hasRequiredClassName; + +function requireClassName () { + if (hasRequiredClassName) return className.exports; + hasRequiredClassName = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + function ClassName(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName.prototype; + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v; + } + }]); + return ClassName; + }(_node["default"]); + exports["default"] = ClassName; + module.exports = exports.default; + } (className, className.exports)); + return className.exports; +} + +var comment = {exports: {}}; + +var hasRequiredComment; + +function requireComment () { + if (hasRequiredComment) return comment.exports; + hasRequiredComment = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + function Comment(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + return Comment; + }(_node["default"]); + exports["default"] = Comment; + module.exports = exports.default; + } (comment, comment.exports)); + return comment.exports; +} + +var id = {exports: {}}; + +var hasRequiredId; + +function requireId () { + if (hasRequiredId) return id.exports; + hasRequiredId = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + function ID(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + var _proto = ID.prototype; + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + return ID; + }(_node["default"]); + exports["default"] = ID; + module.exports = exports.default; + } (id, id.exports)); + return id.exports; +} + +var tag = {exports: {}}; + +var namespace = {exports: {}}; + +var hasRequiredNamespace; + +function requireNamespace () { + if (hasRequiredNamespace) return namespace.exports; + hasRequiredNamespace = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + function Namespace() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + return Namespace; + }(_node["default"]); + exports["default"] = Namespace; + module.exports = exports.default; + } (namespace, namespace.exports)); + return namespace.exports; +} + +var hasRequiredTag; + +function requireTag () { + if (hasRequiredTag) return tag.exports; + hasRequiredTag = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + function Tag(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + return Tag; + }(_namespace["default"]); + exports["default"] = Tag; + module.exports = exports.default; + } (tag, tag.exports)); + return tag.exports; +} + +var string = {exports: {}}; + +var hasRequiredString; + +function requireString () { + if (hasRequiredString) return string.exports; + hasRequiredString = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + function String(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + return String; + }(_node["default"]); + exports["default"] = String; + module.exports = exports.default; + } (string, string.exports)); + return string.exports; +} + +var pseudo = {exports: {}}; + +var hasRequiredPseudo; + +function requirePseudo () { + if (hasRequiredPseudo) return pseudo.exports; + hasRequiredPseudo = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + function Pseudo(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + var _proto = Pseudo.prototype; + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + return Pseudo; + }(_container["default"]); + exports["default"] = Pseudo; + module.exports = exports.default; + } (pseudo, pseudo.exports)); + return pseudo.exports; +} + +var attribute = {}; + +var hasRequiredAttribute; + +function requireAttribute () { + if (hasRequiredAttribute) return attribute; + hasRequiredAttribute = 1; + (function (exports) { + + exports.__esModule = true; + exports["default"] = void 0; + exports.unescapeValue = unescapeValue; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc()); + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + var _CSSESC_QUOTE_OPTIONS; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var deprecate = /*@__PURE__*/ requireNode$1(); + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + if (opts.value === undefined) { + return opts; + } + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + function Attribute(opts) { + var _this; + if (opts === void 0) { + opts = {}; + } + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */; + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + } + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + } + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + if (name === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + _proto.toString = function toString() { + var _this2 = this; + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "insensitive", + get: function get() { + return this._insensitive; + } + + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + + // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. + // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. + if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { + this.raws.insensitiveFlag = undefined; + } + } + this._insensitive = insensitive; + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + }]); + return Attribute; + }(_namespace["default"]); + exports["default"] = Attribute; + Attribute.NO_QUOTE = null; + Attribute.SINGLE_QUOTE = "'"; + Attribute.DOUBLE_QUOTE = '"'; + var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } + }, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true + }, _CSSESC_QUOTE_OPTIONS); + function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; + } + } (attribute)); + return attribute; +} + +var universal = {exports: {}}; + +var hasRequiredUniversal; + +function requireUniversal () { + if (hasRequiredUniversal) return universal.exports; + hasRequiredUniversal = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + function Universal(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + return Universal; + }(_namespace["default"]); + exports["default"] = Universal; + module.exports = exports.default; + } (universal, universal.exports)); + return universal.exports; +} + +var combinator = {exports: {}}; + +var hasRequiredCombinator; + +function requireCombinator () { + if (hasRequiredCombinator) return combinator.exports; + hasRequiredCombinator = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + function Combinator(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + return Combinator; + }(_node["default"]); + exports["default"] = Combinator; + module.exports = exports.default; + } (combinator, combinator.exports)); + return combinator.exports; +} + +var nesting = {exports: {}}; + +var hasRequiredNesting; + +function requireNesting () { + if (hasRequiredNesting) return nesting.exports; + hasRequiredNesting = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + function Nesting(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + return Nesting; + }(_node["default"]); + exports["default"] = Nesting; + module.exports = exports.default; + } (nesting, nesting.exports)); + return nesting.exports; +} + +var sortAscending = {exports: {}}; + +var hasRequiredSortAscending; + +function requireSortAscending () { + if (hasRequiredSortAscending) return sortAscending.exports; + hasRequiredSortAscending = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = sortAscending; + function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); + } + module.exports = exports.default; + } (sortAscending, sortAscending.exports)); + return sortAscending.exports; +} + +var tokenize = {}; + +var tokenTypes = {}; + +var hasRequiredTokenTypes; + +function requireTokenTypes () { + if (hasRequiredTokenTypes) return tokenTypes; + hasRequiredTokenTypes = 1; + + tokenTypes.__esModule = true; + tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0; + var ampersand = 38; // `&`.charCodeAt(0); + tokenTypes.ampersand = ampersand; + var asterisk = 42; // `*`.charCodeAt(0); + tokenTypes.asterisk = asterisk; + var at = 64; // `@`.charCodeAt(0); + tokenTypes.at = at; + var comma = 44; // `,`.charCodeAt(0); + tokenTypes.comma = comma; + var colon = 58; // `:`.charCodeAt(0); + tokenTypes.colon = colon; + var semicolon = 59; // `;`.charCodeAt(0); + tokenTypes.semicolon = semicolon; + var openParenthesis = 40; // `(`.charCodeAt(0); + tokenTypes.openParenthesis = openParenthesis; + var closeParenthesis = 41; // `)`.charCodeAt(0); + tokenTypes.closeParenthesis = closeParenthesis; + var openSquare = 91; // `[`.charCodeAt(0); + tokenTypes.openSquare = openSquare; + var closeSquare = 93; // `]`.charCodeAt(0); + tokenTypes.closeSquare = closeSquare; + var dollar = 36; // `$`.charCodeAt(0); + tokenTypes.dollar = dollar; + var tilde = 126; // `~`.charCodeAt(0); + tokenTypes.tilde = tilde; + var caret = 94; // `^`.charCodeAt(0); + tokenTypes.caret = caret; + var plus = 43; // `+`.charCodeAt(0); + tokenTypes.plus = plus; + var equals = 61; // `=`.charCodeAt(0); + tokenTypes.equals = equals; + var pipe = 124; // `|`.charCodeAt(0); + tokenTypes.pipe = pipe; + var greaterThan = 62; // `>`.charCodeAt(0); + tokenTypes.greaterThan = greaterThan; + var space = 32; // ` `.charCodeAt(0); + tokenTypes.space = space; + var singleQuote = 39; // `'`.charCodeAt(0); + tokenTypes.singleQuote = singleQuote; + var doubleQuote = 34; // `"`.charCodeAt(0); + tokenTypes.doubleQuote = doubleQuote; + var slash = 47; // `/`.charCodeAt(0); + tokenTypes.slash = slash; + var bang = 33; // `!`.charCodeAt(0); + tokenTypes.bang = bang; + var backslash = 92; // '\\'.charCodeAt(0); + tokenTypes.backslash = backslash; + var cr = 13; // '\r'.charCodeAt(0); + tokenTypes.cr = cr; + var feed = 12; // '\f'.charCodeAt(0); + tokenTypes.feed = feed; + var newline = 10; // '\n'.charCodeAt(0); + tokenTypes.newline = newline; + var tab = 9; // '\t'.charCodeAt(0); + + // Expose aliases primarily for readability. + tokenTypes.tab = tab; + var str = singleQuote; + + // No good single character representation! + tokenTypes.str = str; + var comment = -1; + tokenTypes.comment = comment; + var word = -2; + tokenTypes.word = word; + var combinator = -3; + tokenTypes.combinator = combinator; + return tokenTypes; +} + +var hasRequiredTokenize; + +function requireTokenize () { + if (hasRequiredTokenize) return tokenize; + hasRequiredTokenize = 1; + (function (exports) { + + exports.__esModule = true; + exports.FIELDS = void 0; + exports["default"] = tokenize; + var t = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes()); + var _unescapable, _wordDelimiters; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); + var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; + } + + /** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + return next - 1; + } + + /** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) ; else if (hex[code]) { + var hexDigits = 0; + // consume up to 6 hex chars + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + // if fewer than 6 hex chars, a trailing space ends the escape + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + return next; + } + var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + exports.FIELDS = FIELDS; + function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed('quote', quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + if (next === 0) { + unclosed('comment', '*/'); + } + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + + // Ensure that the token structure remains consistent + tokens.push([tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end // [6] End position + ]); + + // Reset offset for the next token + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; + } + } (tokenize)); + return tokenize; +} + +var hasRequiredParser; + +function requireParser () { + if (hasRequiredParser) return parser.exports; + hasRequiredParser = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo()); + var _attribute = _interopRequireWildcard(/*@__PURE__*/ requireAttribute()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting()); + var _sortAscending = _interopRequireDefault(/*@__PURE__*/ requireSortAscending()); + var _tokenize = _interopRequireWildcard(/*@__PURE__*/ requireTokenize()); + var tokens = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes()); + var _util = /*@__PURE__*/ requireUtil(); + var _WHITESPACE_TOKENS, _Object$assign; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); + var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; + } + function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); + } + function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + return node; + } + function indexesOf(array, item) { + var i = -1; + var indexes = []; + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; + } + function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); + } + var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + }, + sourceIndex: 0 + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + var _proto = Parser.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + if (rawValue) { + node.raws.namespace += content; + } + lastAdded = 'namespace'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && + // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + node.attribute = (node.attribute || "") + content; + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + if (_rawValue) { + node.raws.attribute += content; + } + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + lastAdded = 'insensitive'; + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + if (node.raws.value) { + node.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + return nodes; + } + + /** + * + * @param {*} nodes + */; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = undefined; + } + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + _proto.combinator = function combinator() { + var _this3 = this; + if (this.content() === '|') { + return this.namespace(); + } + // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node; + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + var spaces = {}; + var raws = { + spaces: {} + }; + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position]) + }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector); + this.current = selector; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.pseudo = function pseudo() { + var _this4 = this; + var pseudoStr = ''; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.space = function space() { + var content = this.content(); + // Handle space before and after the selector + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; + // Allow decimal numbers percent in @keyframes + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); + // Eliminate Sass interpolations from the list of id indexes + var interpolations = indexesOf(word, '#{'); + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + _this5.newNode(node, namespace); + // Ensure that the namespace is used only once + namespace = null; + }); + this.position++; + }; + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + } + + /** + * Helpers + */; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + return Parser; + }(); + exports["default"] = Parser; + module.exports = exports.default; + } (parser, parser.exports)); + return parser.exports; +} + +var hasRequiredProcessor; + +function requireProcessor () { + if (hasRequiredProcessor) return processor.exports; + hasRequiredProcessor = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _parser = _interopRequireDefault(/*@__PURE__*/ requireParser()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + var root = this._root(rule, options); + var transform = this.func(root); + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string = undefined; + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + } + + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<parser.Root>} The AST of the selector after processing it. + */; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<any>} The value returned by the processor. + */; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor; + }(); + exports["default"] = Processor; + module.exports = exports.default; + } (processor, processor.exports)); + return processor.exports; +} + +var selectors = {}; + +var constructors = {}; + +var hasRequiredConstructors; + +function requireConstructors () { + if (hasRequiredConstructors) return constructors; + hasRequiredConstructors = 1; + + constructors.__esModule = true; + constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0; + var _attribute = _interopRequireDefault(/*@__PURE__*/ requireAttribute()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo()); + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var attribute = function attribute(opts) { + return new _attribute["default"](opts); + }; + constructors.attribute = attribute; + var className = function className(opts) { + return new _className["default"](opts); + }; + constructors.className = className; + var combinator = function combinator(opts) { + return new _combinator["default"](opts); + }; + constructors.combinator = combinator; + var comment = function comment(opts) { + return new _comment["default"](opts); + }; + constructors.comment = comment; + var id = function id(opts) { + return new _id["default"](opts); + }; + constructors.id = id; + var nesting = function nesting(opts) { + return new _nesting["default"](opts); + }; + constructors.nesting = nesting; + var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); + }; + constructors.pseudo = pseudo; + var root = function root(opts) { + return new _root["default"](opts); + }; + constructors.root = root; + var selector = function selector(opts) { + return new _selector["default"](opts); + }; + constructors.selector = selector; + var string = function string(opts) { + return new _string["default"](opts); + }; + constructors.string = string; + var tag = function tag(opts) { + return new _tag["default"](opts); + }; + constructors.tag = tag; + var universal = function universal(opts) { + return new _universal["default"](opts); + }; + constructors.universal = universal; + return constructors; +} + +var guards = {}; + +var hasRequiredGuards; + +function requireGuards () { + if (hasRequiredGuards) return guards; + hasRequiredGuards = 1; + + guards.__esModule = true; + guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0; + guards.isContainer = isContainer; + guards.isIdentifier = void 0; + guards.isNamespace = isNamespace; + guards.isNesting = void 0; + guards.isNode = isNode; + guards.isPseudo = void 0; + guards.isPseudoClass = isPseudoClass; + guards.isPseudoElement = isPseudoElement; + guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0; + var _types = /*@__PURE__*/ requireTypes(); + var _IS_TYPE; + var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); + function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; + } + function isNodeType(type, node) { + return isNode(node) && node.type === type; + } + var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); + guards.isAttribute = isAttribute; + var isClassName = isNodeType.bind(null, _types.CLASS); + guards.isClassName = isClassName; + var isCombinator = isNodeType.bind(null, _types.COMBINATOR); + guards.isCombinator = isCombinator; + var isComment = isNodeType.bind(null, _types.COMMENT); + guards.isComment = isComment; + var isIdentifier = isNodeType.bind(null, _types.ID); + guards.isIdentifier = isIdentifier; + var isNesting = isNodeType.bind(null, _types.NESTING); + guards.isNesting = isNesting; + var isPseudo = isNodeType.bind(null, _types.PSEUDO); + guards.isPseudo = isPseudo; + var isRoot = isNodeType.bind(null, _types.ROOT); + guards.isRoot = isRoot; + var isSelector = isNodeType.bind(null, _types.SELECTOR); + guards.isSelector = isSelector; + var isString = isNodeType.bind(null, _types.STRING); + guards.isString = isString; + var isTag = isNodeType.bind(null, _types.TAG); + guards.isTag = isTag; + var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); + guards.isUniversal = isUniversal; + function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); + } + function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); + } + function isContainer(node) { + return !!(isNode(node) && node.walk); + } + function isNamespace(node) { + return isAttribute(node) || isTag(node); + } + return guards; +} + +var hasRequiredSelectors; + +function requireSelectors () { + if (hasRequiredSelectors) return selectors; + hasRequiredSelectors = 1; + (function (exports) { + + exports.__esModule = true; + var _types = /*@__PURE__*/ requireTypes(); + Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; + }); + var _constructors = /*@__PURE__*/ requireConstructors(); + Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; + }); + var _guards = /*@__PURE__*/ requireGuards(); + Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; + }); + } (selectors)); + return selectors; +} + +var hasRequiredDist; + +function requireDist () { + if (hasRequiredDist) return dist.exports; + hasRequiredDist = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _processor = _interopRequireDefault(/*@__PURE__*/ requireProcessor()); + var selectors = _interopRequireWildcard(/*@__PURE__*/ requireSelectors()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var parser = function parser(processor) { + return new _processor["default"](processor); + }; + Object.assign(parser, selectors); + delete parser.__esModule; + var _default = parser; + exports["default"] = _default; + module.exports = exports.default; + } (dist, dist.exports)); + return dist.exports; +} + +var parse; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse; + hasRequiredParse = 1; + var openParentheses = "(".charCodeAt(0); + var closeParentheses = ")".charCodeAt(0); + var singleQuote = "'".charCodeAt(0); + var doubleQuote = '"'.charCodeAt(0); + var backslash = "\\".charCodeAt(0); + var slash = "/".charCodeAt(0); + var comma = ",".charCodeAt(0); + var colon = ":".charCodeAt(0); + var star = "*".charCodeAt(0); + var uLower = "u".charCodeAt(0); + var uUpper = "U".charCodeAt(0); + var plus = "+".charCodeAt(0); + var isUnicodeRange = /^[a-f0-9?-]+$/i; + + parse = function(input) { + var tokens = []; + var value = input; + + var next, + quote, + prev, + token, + escape, + escapePos, + whitespacePos, + parenthesesOpenPos; + var pos = 0; + var code = value.charCodeAt(pos); + var max = value.length; + var stack = [{ nodes: tokens }]; + var balanced = 0; + var parent; + + var name = ""; + var before = ""; + var after = ""; + + while (pos < max) { + // Whitespaces + if (code <= 32) { + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + token = value.slice(pos, next); + + prev = tokens[tokens.length - 1]; + if (code === closeParentheses && balanced) { + after = token; + } else if (prev && prev.type === "div") { + prev.after = token; + prev.sourceEndIndex += token.length; + } else if ( + code === comma || + code === colon || + (code === slash && + value.charCodeAt(next + 1) !== star && + (!parent || + (parent && parent.type === "function" && parent.value !== "calc"))) + ) { + before = token; + } else { + tokens.push({ + type: "space", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + + // Quotes + } else if (code === singleQuote || code === doubleQuote) { + next = pos; + quote = code === singleQuote ? "'" : '"'; + token = { + type: "string", + sourceIndex: pos, + quote: quote + }; + do { + escape = false; + next = value.indexOf(quote, next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += quote; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + token.value = value.slice(pos + 1, next); + token.sourceEndIndex = token.unclosed ? next : next + 1; + tokens.push(token); + pos = next + 1; + code = value.charCodeAt(pos); + + // Comments + } else if (code === slash && value.charCodeAt(pos + 1) === star) { + next = value.indexOf("*/", pos); + + token = { + type: "comment", + sourceIndex: pos, + sourceEndIndex: next + 2 + }; + + if (next === -1) { + token.unclosed = true; + next = value.length; + token.sourceEndIndex = next; + } + + token.value = value.slice(pos + 2, next); + tokens.push(token); + + pos = next + 2; + code = value.charCodeAt(pos); + + // Operation within calc + } else if ( + (code === slash || code === star) && + parent && + parent.type === "function" && + parent.value === "calc" + ) { + token = value[pos]; + tokens.push({ + type: "word", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token + }); + pos += 1; + code = value.charCodeAt(pos); + + // Dividers + } else if (code === slash || code === comma || code === colon) { + token = value[pos]; + + tokens.push({ + type: "div", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token, + before: before, + after: "" + }); + before = ""; + + pos += 1; + code = value.charCodeAt(pos); + + // Open parentheses + } else if (openParentheses === code) { + // Whitespaces after open parentheses + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + parenthesesOpenPos = pos; + token = { + type: "function", + sourceIndex: pos - name.length, + value: name, + before: value.slice(parenthesesOpenPos + 1, next) + }; + pos = next; + + if (name === "url" && code !== singleQuote && code !== doubleQuote) { + next -= 1; + do { + escape = false; + next = value.indexOf(")", next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += ")"; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + // Whitespaces before closed + whitespacePos = next; + do { + whitespacePos -= 1; + code = value.charCodeAt(whitespacePos); + } while (code <= 32); + if (parenthesesOpenPos < whitespacePos) { + if (pos !== whitespacePos + 1) { + token.nodes = [ + { + type: "word", + sourceIndex: pos, + sourceEndIndex: whitespacePos + 1, + value: value.slice(pos, whitespacePos + 1) + } + ]; + } else { + token.nodes = []; + } + if (token.unclosed && whitespacePos + 1 !== next) { + token.after = ""; + token.nodes.push({ + type: "space", + sourceIndex: whitespacePos + 1, + sourceEndIndex: next, + value: value.slice(whitespacePos + 1, next) + }); + } else { + token.after = value.slice(whitespacePos + 1, next); + token.sourceEndIndex = next; + } + } else { + token.after = ""; + token.nodes = []; + } + pos = next + 1; + token.sourceEndIndex = token.unclosed ? next : pos; + code = value.charCodeAt(pos); + tokens.push(token); + } else { + balanced += 1; + token.after = ""; + token.sourceEndIndex = pos + 1; + tokens.push(token); + stack.push(token); + tokens = token.nodes = []; + parent = token; + } + name = ""; + + // Close parentheses + } else if (closeParentheses === code && balanced) { + pos += 1; + code = value.charCodeAt(pos); + + parent.after = after; + parent.sourceEndIndex += after.length; + after = ""; + balanced -= 1; + stack[stack.length - 1].sourceEndIndex = pos; + stack.pop(); + parent = stack[balanced]; + tokens = parent.nodes; + + // Words + } else { + next = pos; + do { + if (code === backslash) { + next += 1; + } + next += 1; + code = value.charCodeAt(next); + } while ( + next < max && + !( + code <= 32 || + code === singleQuote || + code === doubleQuote || + code === comma || + code === colon || + code === slash || + code === openParentheses || + (code === star && + parent && + parent.type === "function" && + parent.value === "calc") || + (code === slash && + parent.type === "function" && + parent.value === "calc") || + (code === closeParentheses && balanced) + ) + ); + token = value.slice(pos, next); + + if (openParentheses === code) { + name = token; + } else if ( + (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && + plus === token.charCodeAt(1) && + isUnicodeRange.test(token.slice(2)) + ) { + tokens.push({ + type: "unicode-range", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } else { + tokens.push({ + type: "word", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + } + } + + for (pos = stack.length - 1; pos; pos -= 1) { + stack[pos].unclosed = true; + stack[pos].sourceEndIndex = value.length; + } + + return stack[0].nodes; + }; + return parse; +} + +var walk$1; +var hasRequiredWalk; + +function requireWalk () { + if (hasRequiredWalk) return walk$1; + hasRequiredWalk = 1; + walk$1 = function walk(nodes, cb, bubble) { + var i, max, node, result; + + for (i = 0, max = nodes.length; i < max; i += 1) { + node = nodes[i]; + if (!bubble) { + result = cb(node, i, nodes); + } + + if ( + result !== false && + node.type === "function" && + Array.isArray(node.nodes) + ) { + walk(node.nodes, cb, bubble); + } + + if (bubble) { + cb(node, i, nodes); + } + } + }; + return walk$1; +} + +var stringify_1; +var hasRequiredStringify; + +function requireStringify () { + if (hasRequiredStringify) return stringify_1; + hasRequiredStringify = 1; + function stringifyNode(node, custom) { + var type = node.type; + var value = node.value; + var buf; + var customResult; + + if (custom && (customResult = custom(node)) !== undefined) { + return customResult; + } else if (type === "word" || type === "space") { + return value; + } else if (type === "string") { + buf = node.quote || ""; + return buf + value + (node.unclosed ? "" : buf); + } else if (type === "comment") { + return "/*" + value + (node.unclosed ? "" : "*/"); + } else if (type === "div") { + return (node.before || "") + value + (node.after || ""); + } else if (Array.isArray(node.nodes)) { + buf = stringify(node.nodes, custom); + if (type !== "function") { + return buf; + } + return ( + value + + "(" + + (node.before || "") + + buf + + (node.after || "") + + (node.unclosed ? "" : ")") + ); + } + return value; + } + + function stringify(nodes, custom) { + var result, i; + + if (Array.isArray(nodes)) { + result = ""; + for (i = nodes.length - 1; ~i; i -= 1) { + result = stringifyNode(nodes[i], custom) + result; + } + return result; + } + return stringifyNode(nodes, custom); + } + + stringify_1 = stringify; + return stringify_1; +} + +var unit; +var hasRequiredUnit; + +function requireUnit () { + if (hasRequiredUnit) return unit; + hasRequiredUnit = 1; + var minus = "-".charCodeAt(0); + var plus = "+".charCodeAt(0); + var dot = ".".charCodeAt(0); + var exp = "e".charCodeAt(0); + var EXP = "E".charCodeAt(0); + + // Check if three code points would start a number + // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number + function likeNumber(value) { + var code = value.charCodeAt(0); + var nextCode; + + if (code === plus || code === minus) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + var nextNextCode = value.charCodeAt(2); + + if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { + return true; + } + + return false; + } + + if (code === dot) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + return false; + } + + if (code >= 48 && code <= 57) { + return true; + } + + return false; + } + + // Consume a number + // https://www.w3.org/TR/css-syntax-3/#consume-number + unit = function(value) { + var pos = 0; + var length = value.length; + var code; + var nextCode; + var nextNextCode; + + if (length === 0 || !likeNumber(value)) { + return false; + } + + code = value.charCodeAt(pos); + + if (code === plus || code === minus) { + pos++; + } + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + + if (code === dot && nextCode >= 48 && nextCode <= 57) { + pos += 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + nextNextCode = value.charCodeAt(pos + 2); + + if ( + (code === exp || code === EXP) && + ((nextCode >= 48 && nextCode <= 57) || + ((nextCode === plus || nextCode === minus) && + nextNextCode >= 48 && + nextNextCode <= 57)) + ) { + pos += nextCode === plus || nextCode === minus ? 3 : 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + return { + number: value.slice(0, pos), + unit: value.slice(pos) + }; + }; + return unit; +} + +var lib; +var hasRequiredLib; + +function requireLib () { + if (hasRequiredLib) return lib; + hasRequiredLib = 1; + var parse = /*@__PURE__*/ requireParse(); + var walk = /*@__PURE__*/ requireWalk(); + var stringify = /*@__PURE__*/ requireStringify(); + + function ValueParser(value) { + if (this instanceof ValueParser) { + this.nodes = parse(value); + return this; + } + return new ValueParser(value); + } + + ValueParser.prototype.toString = function() { + return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; + }; + + ValueParser.prototype.walk = function(cb, bubble) { + walk(this.nodes, cb, bubble); + return this; + }; + + ValueParser.unit = /*@__PURE__*/ requireUnit(); + + ValueParser.walk = walk; + + ValueParser.stringify = stringify; + + lib = ValueParser; + return lib; +} + +var hasRequiredSrc$2; + +function requireSrc$2 () { + if (hasRequiredSrc$2) return src$2.exports; + hasRequiredSrc$2 = 1; + + const selectorParser = /*@__PURE__*/ requireDist(); + const valueParser = /*@__PURE__*/ requireLib(); + const { extractICSS } = /*@__PURE__*/ requireSrc$4(); + + const isSpacing = (node) => node.type === "combinator" && node.value === " "; + + function normalizeNodeArray(nodes) { + const array = []; + + nodes.forEach((x) => { + if (Array.isArray(x)) { + normalizeNodeArray(x).forEach((item) => { + array.push(item); + }); + } else if (x) { + array.push(x); + } + }); + + if (array.length > 0 && isSpacing(array[array.length - 1])) { + array.pop(); + } + return array; + } + + function localizeNode(rule, mode, localAliasMap) { + const transform = (node, context) => { + if (context.ignoreNextSpacing && !isSpacing(node)) { + throw new Error("Missing whitespace after " + context.ignoreNextSpacing); + } + + if (context.enforceNoSpacing && isSpacing(node)) { + throw new Error("Missing whitespace before " + context.enforceNoSpacing); + } + + let newNodes; + + switch (node.type) { + case "root": { + let resultingGlobal; + + context.hasPureGlobals = false; + + newNodes = node.nodes.map((n) => { + const nContext = { + global: context.global, + lastWasSpacing: true, + hasLocals: false, + explicit: false, + }; + + n = transform(n, nContext); + + if (typeof resultingGlobal === "undefined") { + resultingGlobal = nContext.global; + } else if (resultingGlobal !== nContext.global) { + throw new Error( + 'Inconsistent rule global/local result in rule "' + + node + + '" (multiple selectors must result in the same mode for the rule)' + ); + } + + if (!nContext.hasLocals) { + context.hasPureGlobals = true; + } + + return n; + }); + + context.global = resultingGlobal; + + node.nodes = normalizeNodeArray(newNodes); + break; + } + case "selector": { + newNodes = node.map((childNode) => transform(childNode, context)); + + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + break; + } + case "combinator": { + if (isSpacing(node)) { + if (context.ignoreNextSpacing) { + context.ignoreNextSpacing = false; + context.lastWasSpacing = false; + context.enforceNoSpacing = false; + return null; + } + context.lastWasSpacing = true; + return node; + } + break; + } + case "pseudo": { + let childContext; + const isNested = !!node.length; + const isScoped = node.value === ":local" || node.value === ":global"; + const isImportExport = + node.value === ":import" || node.value === ":export"; + + if (isImportExport) { + context.hasLocals = true; + // :local(.foo) + } else if (isNested) { + if (isScoped) { + if (node.nodes.length === 0) { + throw new Error(`${node.value}() can't be empty`); + } + + if (context.inside) { + throw new Error( + `A ${node.value} is not allowed inside of a ${context.inside}(...)` + ); + } + + childContext = { + global: node.value === ":global", + inside: node.value, + hasLocals: false, + explicit: true, + }; + + newNodes = node + .map((childNode) => transform(childNode, childContext)) + .reduce((acc, next) => acc.concat(next.nodes), []); + + if (newNodes.length) { + const { before, after } = node.spaces; + + const first = newNodes[0]; + const last = newNodes[newNodes.length - 1]; + + first.spaces = { before, after: first.spaces.after }; + last.spaces = { before: last.spaces.before, after }; + } + + node = newNodes; + + break; + } else { + childContext = { + global: context.global, + inside: context.inside, + lastWasSpacing: true, + hasLocals: false, + explicit: context.explicit, + }; + newNodes = node.map((childNode) => { + const newContext = { + ...childContext, + enforceNoSpacing: false, + }; + + const result = transform(childNode, newContext); + + childContext.global = newContext.global; + childContext.hasLocals = newContext.hasLocals; + + return result; + }); + + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + + if (childContext.hasLocals) { + context.hasLocals = true; + } + } + break; + + //:local .foo .bar + } else if (isScoped) { + if (context.inside) { + throw new Error( + `A ${node.value} is not allowed inside of a ${context.inside}(...)` + ); + } + + const addBackSpacing = !!node.spaces.before; + + context.ignoreNextSpacing = context.lastWasSpacing + ? node.value + : false; + + context.enforceNoSpacing = context.lastWasSpacing + ? false + : node.value; + + context.global = node.value === ":global"; + context.explicit = true; + + // because this node has spacing that is lost when we remove it + // we make up for it by adding an extra combinator in since adding + // spacing on the parent selector doesn't work + return addBackSpacing + ? selectorParser.combinator({ value: " " }) + : null; + } + break; + } + case "id": + case "class": { + if (!node.value) { + throw new Error("Invalid class or id selector syntax"); + } + + if (context.global) { + break; + } + + const isImportedValue = localAliasMap.has(node.value); + const isImportedWithExplicitScope = isImportedValue && context.explicit; + + if (!isImportedValue || isImportedWithExplicitScope) { + const innerNode = node.clone(); + innerNode.spaces = { before: "", after: "" }; + + node = selectorParser.pseudo({ + value: ":local", + nodes: [innerNode], + spaces: node.spaces, + }); + + context.hasLocals = true; + } + + break; + } + case "nesting": { + if (node.value === "&") { + context.hasLocals = true; + } + } + } + + context.lastWasSpacing = false; + context.ignoreNextSpacing = false; + context.enforceNoSpacing = false; + + return node; + }; + + const rootContext = { + global: mode === "global", + hasPureGlobals: false, + }; + + rootContext.selector = selectorParser((root) => { + transform(root, rootContext); + }).processSync(rule, { updateSelector: false, lossless: true }); + + return rootContext; + } + + function localizeDeclNode(node, context) { + switch (node.type) { + case "word": + if (context.localizeNextItem) { + if (!context.localAliasMap.has(node.value)) { + node.value = ":local(" + node.value + ")"; + context.localizeNextItem = false; + } + } + break; + + case "function": + if ( + context.options && + context.options.rewriteUrl && + node.value.toLowerCase() === "url" + ) { + node.nodes.map((nestedNode) => { + if (nestedNode.type !== "string" && nestedNode.type !== "word") { + return; + } + + let newUrl = context.options.rewriteUrl( + context.global, + nestedNode.value + ); + + switch (nestedNode.type) { + case "string": + if (nestedNode.quote === "'") { + newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'"); + } + + if (nestedNode.quote === '"') { + newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, '\\"'); + } + + break; + case "word": + newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1"); + break; + } + + nestedNode.value = newUrl; + }); + } + break; + } + return node; + } + + // `none` is special value, other is global values + const specialKeywords = [ + "none", + "inherit", + "initial", + "revert", + "revert-layer", + "unset", + ]; + + function localizeDeclarationValues(localize, declaration, context) { + const valueNodes = valueParser(declaration.value); + + valueNodes.walk((node, index, nodes) => { + if ( + node.type === "function" && + (node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env") + ) { + return false; + } + + if ( + node.type === "word" && + specialKeywords.includes(node.value.toLowerCase()) + ) { + return; + } + + const subContext = { + options: context.options, + global: context.global, + localizeNextItem: localize && !context.global, + localAliasMap: context.localAliasMap, + }; + nodes[index] = localizeDeclNode(node, subContext); + }); + + declaration.value = valueNodes.toString(); + } + + function localizeDeclaration(declaration, context) { + const isAnimation = /animation$/i.test(declaration.prop); + + if (isAnimation) { + // letter + // An uppercase letter or a lowercase letter. + // + // ident-start code point + // A letter, a non-ASCII code point, or U+005F LOW LINE (_). + // + // ident code point + // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-). + + // We don't validate `hex digits`, because we don't need it, it is work of linters. + const validIdent = + /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i; + + /* + The spec defines some keywords that you can use to describe properties such as the timing + function. These are still valid animation names, so as long as there is a property that accepts + a keyword, it is given priority. Only when all the properties that can take a keyword are + exhausted can the animation name be set to the keyword. I.e. + + animation: infinite infinite; + + The animation will repeat an infinite number of times from the first argument, and will have an + animation name of infinite from the second. + */ + const animationKeywords = { + // animation-direction + $normal: 1, + $reverse: 1, + $alternate: 1, + "$alternate-reverse": 1, + // animation-fill-mode + $forwards: 1, + $backwards: 1, + $both: 1, + // animation-iteration-count + $infinite: 1, + // animation-play-state + $paused: 1, + $running: 1, + // animation-timing-function + $ease: 1, + "$ease-in": 1, + "$ease-out": 1, + "$ease-in-out": 1, + $linear: 1, + "$step-end": 1, + "$step-start": 1, + // Special + $none: Infinity, // No matter how many times you write none, it will never be an animation name + // Global values + $initial: Infinity, + $inherit: Infinity, + $unset: Infinity, + $revert: Infinity, + "$revert-layer": Infinity, + }; + let parsedAnimationKeywords = {}; + const valueNodes = valueParser(declaration.value).walk((node) => { + // If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. + if (node.type === "div") { + parsedAnimationKeywords = {}; + + return; + } + // Do not handle nested functions + else if (node.type === "function") { + return false; + } + // Ignore all except word + else if (node.type !== "word") { + return; + } + + const value = node.type === "word" ? node.value.toLowerCase() : null; + + let shouldParseAnimationName = false; + + if (value && validIdent.test(value)) { + if ("$" + value in animationKeywords) { + parsedAnimationKeywords["$" + value] = + "$" + value in parsedAnimationKeywords + ? parsedAnimationKeywords["$" + value] + 1 + : 0; + + shouldParseAnimationName = + parsedAnimationKeywords["$" + value] >= + animationKeywords["$" + value]; + } else { + shouldParseAnimationName = true; + } + } + + const subContext = { + options: context.options, + global: context.global, + localizeNextItem: shouldParseAnimationName && !context.global, + localAliasMap: context.localAliasMap, + }; + + return localizeDeclNode(node, subContext); + }); + + declaration.value = valueNodes.toString(); + + return; + } + + const isAnimationName = /animation(-name)?$/i.test(declaration.prop); + + if (isAnimationName) { + return localizeDeclarationValues(true, declaration, context); + } + + const hasUrl = /url\(/i.test(declaration.value); + + if (hasUrl) { + return localizeDeclarationValues(false, declaration, context); + } + } + + src$2.exports = (options = {}) => { + if ( + options && + options.mode && + options.mode !== "global" && + options.mode !== "local" && + options.mode !== "pure" + ) { + throw new Error( + 'options.mode must be either "global", "local" or "pure" (default "local")' + ); + } + + const pureMode = options && options.mode === "pure"; + const globalMode = options && options.mode === "global"; + + return { + postcssPlugin: "postcss-modules-local-by-default", + prepare() { + const localAliasMap = new Map(); + + return { + Once(root) { + const { icssImports } = extractICSS(root, false); + + Object.keys(icssImports).forEach((key) => { + Object.keys(icssImports[key]).forEach((prop) => { + localAliasMap.set(prop, icssImports[key][prop]); + }); + }); + + root.walkAtRules((atRule) => { + if (/keyframes$/i.test(atRule.name)) { + const globalMatch = /^\s*:global\s*\((.+)\)\s*$/.exec( + atRule.params + ); + const localMatch = /^\s*:local\s*\((.+)\)\s*$/.exec( + atRule.params + ); + + let globalKeyframes = globalMode; + + if (globalMatch) { + if (pureMode) { + throw atRule.error( + "@keyframes :global(...) is not allowed in pure mode" + ); + } + atRule.params = globalMatch[1]; + globalKeyframes = true; + } else if (localMatch) { + atRule.params = localMatch[0]; + globalKeyframes = false; + } else if ( + atRule.params && + !globalMode && + !localAliasMap.has(atRule.params) + ) { + atRule.params = ":local(" + atRule.params + ")"; + } + + atRule.walkDecls((declaration) => { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalKeyframes, + }); + }); + } else if (/scope$/i.test(atRule.name)) { + if (atRule.params) { + atRule.params = atRule.params + .split("to") + .map((item) => { + const selector = item.trim().slice(1, -1).trim(); + const context = localizeNode( + selector, + options.mode, + localAliasMap + ); + + context.options = options; + context.localAliasMap = localAliasMap; + + if (pureMode && context.hasPureGlobals) { + throw atRule.error( + 'Selector in at-rule"' + + selector + + '" is not pure ' + + "(pure selectors must contain at least one local class or id)" + ); + } + + return `(${context.selector})`; + }) + .join(" to "); + } + + atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalMode, + }); + } + }); + } else if (atRule.nodes) { + atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalMode, + }); + } + }); + } + }); + + root.walkRules((rule) => { + if ( + rule.parent && + rule.parent.type === "atrule" && + /keyframes$/i.test(rule.parent.name) + ) { + // ignore keyframe rules + return; + } + + const context = localizeNode(rule, options.mode, localAliasMap); + + context.options = options; + context.localAliasMap = localAliasMap; + + if (pureMode && context.hasPureGlobals) { + throw rule.error( + 'Selector "' + + rule.selector + + '" is not pure ' + + "(pure selectors must contain at least one local class or id)" + ); + } + + rule.selector = context.selector; + + // Less-syntax mixins parse as rules with no nodes + if (rule.nodes) { + rule.nodes.forEach((declaration) => + localizeDeclaration(declaration, context) + ); + } + }); + }, + }; + }, + }; + }; + src$2.exports.postcss = true; + return src$2.exports; +} + +var src$1; +var hasRequiredSrc$1; + +function requireSrc$1 () { + if (hasRequiredSrc$1) return src$1; + hasRequiredSrc$1 = 1; + + const selectorParser = /*@__PURE__*/ requireDist(); + + const hasOwnProperty = Object.prototype.hasOwnProperty; + + function isNestedRule(rule) { + if (!rule.parent || rule.parent.type === "root") { + return false; + } + + if (rule.parent.type === "rule") { + return true; + } + + return isNestedRule(rule.parent); + } + + function getSingleLocalNamesForComposes(root, rule) { + if (isNestedRule(rule)) { + throw new Error(`composition is not allowed in nested rule \n\n${rule}`); + } + + return root.nodes.map((node) => { + if (node.type !== "selector" || node.nodes.length !== 1) { + throw new Error( + `composition is only allowed when selector is single :local class name not in "${root}"` + ); + } + + node = node.nodes[0]; + + if ( + node.type !== "pseudo" || + node.value !== ":local" || + node.nodes.length !== 1 + ) { + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + node = node.first; + + if (node.type !== "selector" || node.length !== 1) { + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + node = node.first; + + if (node.type !== "class") { + // 'id' is not possible, because you can't compose ids + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + return node.value; + }); + } + + const whitespace = "[\\x20\\t\\r\\n\\f]"; + const unescapeRegExp = new RegExp( + "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", + "ig" + ); + + function unescape(str) { + return str.replace(unescapeRegExp, (_, escaped, escapedWhitespace) => { + const high = "0x" + escaped - 0x10000; + + // NaN means non-codepoint + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace + ? escaped + : high < 0 + ? // BMP codepoint + String.fromCharCode(high + 0x10000) + : // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00); + }); + } + + const plugin = (options = {}) => { + const generateScopedName = + (options && options.generateScopedName) || plugin.generateScopedName; + const generateExportEntry = + (options && options.generateExportEntry) || plugin.generateExportEntry; + const exportGlobals = options && options.exportGlobals; + + return { + postcssPlugin: "postcss-modules-scope", + Once(root, { rule }) { + const exports = Object.create(null); + + function exportScopedName(name, rawName, node) { + const scopedName = generateScopedName( + rawName ? rawName : name, + root.source.input.from, + root.source.input.css, + node + ); + const exportEntry = generateExportEntry( + rawName ? rawName : name, + scopedName, + root.source.input.from, + root.source.input.css, + node + ); + const { key, value } = exportEntry; + + exports[key] = exports[key] || []; + + if (exports[key].indexOf(value) < 0) { + exports[key].push(value); + } + + return scopedName; + } + + function localizeNode(node) { + switch (node.type) { + case "selector": + node.nodes = node.map((item) => localizeNode(item)); + return node; + case "class": + return selectorParser.className({ + value: exportScopedName( + node.value, + node.raws && node.raws.value ? node.raws.value : null, + node + ), + }); + case "id": { + return selectorParser.id({ + value: exportScopedName( + node.value, + node.raws && node.raws.value ? node.raws.value : null, + node + ), + }); + } + case "attribute": { + if (node.attribute === "class" && node.operator === "=") { + return selectorParser.attribute({ + attribute: node.attribute, + operator: node.operator, + quoteMark: "'", + value: exportScopedName(node.value, null, null), + }); + } + } + } + + throw new Error( + `${node.type} ("${node}") is not allowed in a :local block` + ); + } + + function traverseNode(node) { + switch (node.type) { + case "pseudo": + if (node.value === ":local") { + if (node.nodes.length !== 1) { + throw new Error('Unexpected comma (",") in :local block'); + } + + const selector = localizeNode(node.first); + // move the spaces that were around the pseudo selector to the first + // non-container node + selector.first.spaces = node.spaces; + + const nextNode = node.next(); + + if ( + nextNode && + nextNode.type === "combinator" && + nextNode.value === " " && + /\\[A-F0-9]{1,6}$/.test(selector.last.value) + ) { + selector.last.spaces.after = " "; + } + + node.replaceWith(selector); + + return; + } + /* falls through */ + case "root": + case "selector": { + node.each((item) => traverseNode(item)); + break; + } + case "id": + case "class": + if (exportGlobals) { + exports[node.value] = [node.value]; + } + break; + } + return node; + } + + // Find any :import and remember imported names + const importedNames = {}; + + root.walkRules(/^:import\(.+\)$/, (rule) => { + rule.walkDecls((decl) => { + importedNames[decl.prop] = true; + }); + }); + + // Find any :local selectors + root.walkRules((rule) => { + let parsedSelector = selectorParser().astSync(rule); + + rule.selector = traverseNode(parsedSelector.clone()).toString(); + + rule.walkDecls(/^(composes|compose-with)$/i, (decl) => { + const localNames = getSingleLocalNamesForComposes( + parsedSelector, + decl.parent + ); + const multiple = decl.value.split(","); + + multiple.forEach((value) => { + const classes = value.trim().split(/\s+/); + + classes.forEach((className) => { + const global = /^global\(([^)]+)\)$/.exec(className); + + if (global) { + localNames.forEach((exportedName) => { + exports[exportedName].push(global[1]); + }); + } else if (hasOwnProperty.call(importedNames, className)) { + localNames.forEach((exportedName) => { + exports[exportedName].push(className); + }); + } else if (hasOwnProperty.call(exports, className)) { + localNames.forEach((exportedName) => { + exports[className].forEach((item) => { + exports[exportedName].push(item); + }); + }); + } else { + throw decl.error( + `referenced class name "${className}" in ${decl.prop} not found` + ); + } + }); + }); + + decl.remove(); + }); + + // Find any :local values + rule.walkDecls((decl) => { + if (!/:local\s*\((.+?)\)/.test(decl.value)) { + return; + } + + let tokens = decl.value.split(/(,|'[^']*'|"[^"]*")/); + + tokens = tokens.map((token, idx) => { + if (idx === 0 || tokens[idx - 1] === ",") { + let result = token; + + const localMatch = /:local\s*\((.+?)\)/.exec(token); + + if (localMatch) { + const input = localMatch.input; + const matchPattern = localMatch[0]; + const matchVal = localMatch[1]; + const newVal = exportScopedName(matchVal); + + result = input.replace(matchPattern, newVal); + } else { + return token; + } + + return result; + } else { + return token; + } + }); + + decl.value = tokens.join(""); + }); + }); + + // Find any :local keyframes + root.walkAtRules(/keyframes$/i, (atRule) => { + const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(atRule.params); + + if (!localMatch) { + return; + } + + atRule.params = exportScopedName(localMatch[1]); + }); + + root.walkAtRules(/scope$/i, (atRule) => { + if (atRule.params) { + atRule.params = atRule.params + .split("to") + .map((item) => { + const selector = item.trim().slice(1, -1).trim(); + + const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(selector); + + if (!localMatch) { + return `(${selector})`; + } + + let parsedSelector = selectorParser().astSync(selector); + + return `(${traverseNode(parsedSelector).toString()})`; + }) + .join(" to "); + } + }); + + // If we found any :locals, insert an :export rule + const exportedNames = Object.keys(exports); + + if (exportedNames.length > 0) { + const exportRule = rule({ selector: ":export" }); + + exportedNames.forEach((exportedName) => + exportRule.append({ + prop: exportedName, + value: exports[exportedName].join(" "), + raws: { before: "\n " }, + }) + ); + + root.append(exportRule); + } + }, + }; + }; + + plugin.postcss = true; + + plugin.generateScopedName = function (name, path) { + const sanitisedPath = path + .replace(/\.[^./\\]+$/, "") + .replace(/[\W_]+/g, "_") + .replace(/^_|_$/g, ""); + + return `_${sanitisedPath}__${name}`.trim(); + }; + + plugin.generateExportEntry = function (name, scopedName) { + return { + key: unescape(name), + value: unescape(scopedName), + }; + }; + + src$1 = plugin; + return src$1; +} + +var stringHash; +var hasRequiredStringHash; + +function requireStringHash () { + if (hasRequiredStringHash) return stringHash; + hasRequiredStringHash = 1; + + function hash(str) { + var hash = 5381, + i = str.length; + + while(i) { + hash = (hash * 33) ^ str.charCodeAt(--i); + } + + /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed + * integers. Since we want the results to be always positive, convert the + * signed int to an unsigned by doing an unsigned bitshift. */ + return hash >>> 0; + } + + stringHash = hash; + return stringHash; +} + +var src = {exports: {}}; + +var hasRequiredSrc; + +function requireSrc () { + if (hasRequiredSrc) return src.exports; + hasRequiredSrc = 1; + + const ICSSUtils = /*@__PURE__*/ requireSrc$4(); + + const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/; + const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/; + const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/; + + src.exports = (options) => { + let importIndex = 0; + const createImportedName = + (options && options.createImportedName) || + ((importName /*, path*/) => + `i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`); + + return { + postcssPlugin: "postcss-modules-values", + prepare(result) { + const importAliases = []; + const definitions = {}; + + return { + Once(root, postcss) { + root.walkAtRules(/value/i, (atRule) => { + const matches = atRule.params.match(matchImports); + + if (matches) { + let [, /*match*/ aliases, path] = matches; + + // We can use constants for path names + if (definitions[path]) { + path = definitions[path]; + } + + const imports = aliases + .replace(/^\(\s*([\s\S]+)\s*\)$/, "$1") + .split(/\s*,\s*/) + .map((alias) => { + const tokens = matchImport.exec(alias); + + if (tokens) { + const [, /*match*/ theirName, myName = theirName] = tokens; + const importedName = createImportedName(myName); + definitions[myName] = importedName; + return { theirName, importedName }; + } else { + throw new Error(`@import statement "${alias}" is invalid!`); + } + }); + + importAliases.push({ path, imports }); + + atRule.remove(); + + return; + } + + if (atRule.params.indexOf("@value") !== -1) { + result.warn("Invalid value definition: " + atRule.params); + } + + let [, key, value] = `${atRule.params}${atRule.raws.between}`.match( + matchValueDefinition + ); + + const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, ""); + + if (normalizedValue.length === 0) { + result.warn("Invalid value definition: " + atRule.params); + atRule.remove(); + + return; + } + + let isOnlySpace = /^\s+$/.test(normalizedValue); + + if (!isOnlySpace) { + value = value.trim(); + } + + // Add to the definitions, knowing that values can refer to each other + definitions[key] = ICSSUtils.replaceValueSymbols( + value, + definitions + ); + + atRule.remove(); + }); + + /* If we have no definitions, don't continue */ + if (!Object.keys(definitions).length) { + return; + } + + /* Perform replacements */ + ICSSUtils.replaceSymbols(root, definitions); + + /* We want to export anything defined by now, but don't add it to the CSS yet or it well get picked up by the replacement stuff */ + const exportDeclarations = Object.keys(definitions).map((key) => + postcss.decl({ + value: definitions[key], + prop: key, + raws: { before: "\n " }, + }) + ); + + /* Add export rules if any */ + if (exportDeclarations.length > 0) { + const exportRule = postcss.rule({ + selector: ":export", + raws: { after: "\n" }, + }); + + exportRule.append(exportDeclarations); + + root.prepend(exportRule); + } + + /* Add import rules */ + importAliases.reverse().forEach(({ path, imports }) => { + const importRule = postcss.rule({ + selector: `:import(${path})`, + raws: { after: "\n" }, + }); + + imports.forEach(({ theirName, importedName }) => { + importRule.append({ + value: theirName, + prop: importedName, + raws: { before: "\n " }, + }); + }); + + root.prepend(importRule); + }); + }, + }; + }, + }; + }; + + src.exports.postcss = true; + return src.exports; +} + +var hasRequiredScoping; + +function requireScoping () { + if (hasRequiredScoping) return scoping; + hasRequiredScoping = 1; + + Object.defineProperty(scoping, "__esModule", { + value: true + }); + scoping.behaviours = void 0; + scoping.getDefaultPlugins = getDefaultPlugins; + scoping.getDefaultScopeBehaviour = getDefaultScopeBehaviour; + scoping.getScopedNameGenerator = getScopedNameGenerator; + + var _postcssModulesExtractImports = _interopRequireDefault(/*@__PURE__*/ requireSrc$3()); + + var _genericNames = _interopRequireDefault(/*@__PURE__*/ requireGenericNames()); + + var _postcssModulesLocalByDefault = _interopRequireDefault(/*@__PURE__*/ requireSrc$2()); + + var _postcssModulesScope = _interopRequireDefault(/*@__PURE__*/ requireSrc$1()); + + var _stringHash = _interopRequireDefault(/*@__PURE__*/ requireStringHash()); + + var _postcssModulesValues = _interopRequireDefault(/*@__PURE__*/ requireSrc()); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + const behaviours = { + LOCAL: "local", + GLOBAL: "global" + }; + scoping.behaviours = behaviours; + + function getDefaultPlugins({ + behaviour, + generateScopedName, + exportGlobals + }) { + const scope = (0, _postcssModulesScope.default)({ + generateScopedName, + exportGlobals + }); + const plugins = { + [behaviours.LOCAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({ + mode: "local" + }), _postcssModulesExtractImports.default, scope], + [behaviours.GLOBAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({ + mode: "global" + }), _postcssModulesExtractImports.default, scope] + }; + return plugins[behaviour]; + } + + function isValidBehaviour(behaviour) { + return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1; + } + + function getDefaultScopeBehaviour(scopeBehaviour) { + return scopeBehaviour && isValidBehaviour(scopeBehaviour) ? scopeBehaviour : behaviours.LOCAL; + } + + function generateScopedNameDefault(name, filename, css) { + const i = css.indexOf(`.${name}`); + const lineNumber = css.substr(0, i).split(/[\r\n]/).length; + const hash = (0, _stringHash.default)(css).toString(36).substr(0, 5); + return `_${name}_${hash}_${lineNumber}`; + } + + function getScopedNameGenerator(generateScopedName, hashPrefix) { + const scopedNameGenerator = generateScopedName || generateScopedNameDefault; + + if (typeof scopedNameGenerator === "function") { + return scopedNameGenerator; + } + + return (0, _genericNames.default)(scopedNameGenerator, { + context: process.cwd(), + hashPrefix: hashPrefix + }); + } + return scoping; +} + +var hasRequiredPluginFactory; + +function requirePluginFactory () { + if (hasRequiredPluginFactory) return pluginFactory; + hasRequiredPluginFactory = 1; + + Object.defineProperty(pluginFactory, "__esModule", { + value: true + }); + pluginFactory.makePlugin = makePlugin; + + var _postcss = _interopRequireDefault(require$$0$1); + + var _unquote = _interopRequireDefault(/*@__PURE__*/ requireUnquote()); + + var _Parser = _interopRequireDefault(/*@__PURE__*/ requireParser$1()); + + var _saveJSON = _interopRequireDefault(/*@__PURE__*/ requireSaveJSON()); + + var _localsConvention = /*@__PURE__*/ requireLocalsConvention(); + + var _FileSystemLoader = _interopRequireDefault(/*@__PURE__*/ requireFileSystemLoader()); + + var _scoping = /*@__PURE__*/ requireScoping(); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + const PLUGIN_NAME = "postcss-modules"; + + function isGlobalModule(globalModules, inputFile) { + return globalModules.some(regex => inputFile.match(regex)); + } + + function getDefaultPluginsList(opts, inputFile) { + const globalModulesList = opts.globalModulePaths || null; + const exportGlobals = opts.exportGlobals || false; + const defaultBehaviour = (0, _scoping.getDefaultScopeBehaviour)(opts.scopeBehaviour); + const generateScopedName = (0, _scoping.getScopedNameGenerator)(opts.generateScopedName, opts.hashPrefix); + + if (globalModulesList && isGlobalModule(globalModulesList, inputFile)) { + return (0, _scoping.getDefaultPlugins)({ + behaviour: _scoping.behaviours.GLOBAL, + generateScopedName, + exportGlobals + }); + } + + return (0, _scoping.getDefaultPlugins)({ + behaviour: defaultBehaviour, + generateScopedName, + exportGlobals + }); + } + + function getLoader(opts, plugins) { + const root = typeof opts.root === "undefined" ? "/" : opts.root; + return typeof opts.Loader === "function" ? new opts.Loader(root, plugins, opts.resolve) : new _FileSystemLoader.default(root, plugins, opts.resolve); + } + + function isOurPlugin(plugin) { + return plugin.postcssPlugin === PLUGIN_NAME; + } + + function makePlugin(opts) { + return { + postcssPlugin: PLUGIN_NAME, + + async OnceExit(css, { + result + }) { + const getJSON = opts.getJSON || _saveJSON.default; + const inputFile = css.source.input.file; + const pluginList = getDefaultPluginsList(opts, inputFile); + const resultPluginIndex = result.processor.plugins.findIndex(plugin => isOurPlugin(plugin)); + + if (resultPluginIndex === -1) { + throw new Error("Plugin missing from options."); + } + + const earlierPlugins = result.processor.plugins.slice(0, resultPluginIndex); + const loaderPlugins = [...earlierPlugins, ...pluginList]; + const loader = getLoader(opts, loaderPlugins); + + const fetcher = async (file, relativeTo, depTrace) => { + const unquoteFile = (0, _unquote.default)(file); + return loader.fetch.call(loader, unquoteFile, relativeTo, depTrace); + }; + + const parser = new _Parser.default(fetcher); + await (0, _postcss.default)([...pluginList, parser.plugin()]).process(css, { + from: inputFile + }); + const out = loader.finalSource; + if (out) css.prepend(out); + + if (opts.localsConvention) { + const reducer = (0, _localsConvention.makeLocalsConventionReducer)(opts.localsConvention, inputFile); + parser.exportTokens = Object.entries(parser.exportTokens).reduce(reducer, {}); + } + + result.messages.push({ + type: "export", + plugin: "postcss-modules", + exportTokens: parser.exportTokens + }); // getJSON may return a promise + + return getJSON(css.source.input.file, parser.exportTokens, result.opts.to); + } + + }; + } + return pluginFactory; +} + +var hasRequiredBuild; + +function requireBuild () { + if (hasRequiredBuild) return build.exports; + hasRequiredBuild = 1; + + var _fs = require$$0; + + var _fs2 = /*@__PURE__*/ requireFs(); + + var _pluginFactory = /*@__PURE__*/ requirePluginFactory(); + + (0, _fs2.setFileSystem)({ + readFile: _fs.readFile, + writeFile: _fs.writeFile + }); + + build.exports = (opts = {}) => (0, _pluginFactory.makePlugin)(opts); + + build.exports.postcss = true; + return build.exports; +} + +var buildExports = /*@__PURE__*/ requireBuild(); +var postcssModules = /*@__PURE__*/getDefaultExportFromCjs(buildExports); + +function compileStyle(options) { + return doCompileStyle({ + ...options, + isAsync: false + }); +} +function compileStyleAsync(options) { + return doCompileStyle({ + ...options, + isAsync: true + }); +} +function doCompileStyle(options) { + const { + filename, + id, + scoped = false, + trim = true, + isProd = false, + modules = false, + modulesOptions = {}, + preprocessLang, + postcssOptions, + postcssPlugins + } = options; + const preprocessor = preprocessLang && processors[preprocessLang]; + const preProcessedSource = preprocessor && preprocess(options, preprocessor); + const map = preProcessedSource ? preProcessedSource.map : options.inMap || options.map; + const source = preProcessedSource ? preProcessedSource.code : options.source; + const shortId = id.replace(/^data-v-/, ""); + const longId = `data-v-${shortId}`; + const plugins = (postcssPlugins || []).slice(); + plugins.unshift(cssVarsPlugin({ id: shortId, isProd })); + if (trim) { + plugins.push(trimPlugin()); + } + if (scoped) { + plugins.push(scopedPlugin(longId)); + } + let cssModules; + if (modules) { + if (!options.isAsync) { + throw new Error( + "[@vue/compiler-sfc] `modules` option can only be used with compileStyleAsync()." + ); + } + plugins.push( + postcssModules({ + ...modulesOptions, + getJSON: (_cssFileName, json) => { + cssModules = json; + } + }) + ); + } + const postCSSOptions = { + ...postcssOptions, + to: filename, + from: filename + }; + if (map) { + postCSSOptions.map = { + inline: false, + annotation: false, + prev: map + }; + } + let result; + let code; + let outMap; + const dependencies = new Set( + preProcessedSource ? preProcessedSource.dependencies : [] + ); + dependencies.delete(filename); + const errors = []; + if (preProcessedSource && preProcessedSource.errors.length) { + errors.push(...preProcessedSource.errors); + } + const recordPlainCssDependencies = (messages) => { + messages.forEach((msg) => { + if (msg.type === "dependency") { + dependencies.add(msg.file); + } + }); + return dependencies; + }; + try { + result = require$$0$1(plugins).process(source, postCSSOptions); + if (options.isAsync) { + return result.then((result2) => ({ + code: result2.css || "", + map: result2.map && result2.map.toJSON(), + errors, + modules: cssModules, + rawResult: result2, + dependencies: recordPlainCssDependencies(result2.messages) + })).catch((error) => ({ + code: "", + map: void 0, + errors: [...errors, error], + rawResult: void 0, + dependencies + })); + } + recordPlainCssDependencies(result.messages); + code = result.css; + outMap = result.map; + } catch (e) { + errors.push(e); + } + return { + code: code || ``, + map: outMap && outMap.toJSON(), + errors, + rawResult: result, + dependencies + }; +} +function preprocess(options, preprocessor) { + return preprocessor( + options.source, + options.inMap || options.map, + { + filename: options.filename, + ...options.preprocessOptions + }, + options.preprocessCustomRequire + ); +} + +const UNKNOWN_TYPE = "Unknown"; +function resolveObjectKey(node, computed) { + switch (node.type) { + case "StringLiteral": + case "NumericLiteral": + return String(node.value); + case "Identifier": + if (!computed) return node.name; + } + return void 0; +} +function concatStrings(strs) { + return strs.filter((s) => !!s).join(", "); +} +function isLiteralNode(node) { + return node.type.endsWith("Literal"); +} +function isCallOf(node, test) { + return !!(node && test && node.type === "CallExpression" && node.callee.type === "Identifier" && (typeof test === "string" ? node.callee.name === test : test(node.callee.name))); +} +function toRuntimeTypeString(types) { + return types.length > 1 ? `[${types.join(", ")}]` : types[0]; +} +function getImportedName(specifier) { + if (specifier.type === "ImportSpecifier") + return specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value; + else if (specifier.type === "ImportNamespaceSpecifier") return "*"; + return "default"; +} +function getId(node) { + return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null; +} +const identity = (str) => str; +const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g; +const toLowerCase = (str) => str.toLowerCase(); +function toFileNameLowerCase(x) { + return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x; +} +function createGetCanonicalFileName(useCaseSensitiveFileNames) { + return useCaseSensitiveFileNames ? identity : toFileNameLowerCase; +} +const normalize = (path$1.posix || path$1).normalize; +const windowsSlashRE = /\\/g; +function normalizePath(p) { + return normalize(p.replace(windowsSlashRE, "/")); +} +const joinPaths = (path$1.posix || path$1).join; +const propNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~\-]/; +function getEscapedPropName(key) { + return propNameEscapeSymbolsRE.test(key) ? JSON.stringify(key) : key; +} + +function analyzeScriptBindings(ast) { + for (const node of ast) { + if (node.type === "ExportDefaultDeclaration" && node.declaration.type === "ObjectExpression") { + return analyzeBindingsFromOptions(node.declaration); + } + } + return {}; +} +function analyzeBindingsFromOptions(node) { + const bindings = {}; + Object.defineProperty(bindings, "__isScriptSetup", { + enumerable: false, + value: false + }); + for (const property of node.properties) { + if (property.type === "ObjectProperty" && !property.computed && property.key.type === "Identifier") { + if (property.key.name === "props") { + for (const key of getObjectOrArrayExpressionKeys(property.value)) { + bindings[key] = "props"; + } + } else if (property.key.name === "inject") { + for (const key of getObjectOrArrayExpressionKeys(property.value)) { + bindings[key] = "options"; + } + } else if (property.value.type === "ObjectExpression" && (property.key.name === "computed" || property.key.name === "methods")) { + for (const key of getObjectExpressionKeys(property.value)) { + bindings[key] = "options"; + } + } + } else if (property.type === "ObjectMethod" && property.key.type === "Identifier" && (property.key.name === "setup" || property.key.name === "data")) { + for (const bodyItem of property.body.body) { + if (bodyItem.type === "ReturnStatement" && bodyItem.argument && bodyItem.argument.type === "ObjectExpression") { + for (const key of getObjectExpressionKeys(bodyItem.argument)) { + bindings[key] = property.key.name === "setup" ? "setup-maybe-ref" : "data"; + } + } + } + } + } + return bindings; +} +function getObjectExpressionKeys(node) { + const keys = []; + for (const prop of node.properties) { + if (prop.type === "SpreadElement") continue; + const key = resolveObjectKey(prop.key, prop.computed); + if (key) keys.push(String(key)); + } + return keys; +} +function getArrayExpressionKeys(node) { + const keys = []; + for (const element of node.elements) { + if (element && element.type === "StringLiteral") { + keys.push(element.value); + } + } + return keys; +} +function getObjectOrArrayExpressionKeys(value) { + if (value.type === "ArrayExpression") { + return getArrayExpressionKeys(value); + } + if (value.type === "ObjectExpression") { + return getObjectExpressionKeys(value); + } + return []; +} + +var _a, _b; +class ScriptCompileContext { + constructor(descriptor, options) { + this.descriptor = descriptor; + this.options = options; + this.isCE = false; + this.source = this.descriptor.source; + this.filename = this.descriptor.filename; + this.s = new MagicString(this.source); + this.startOffset = (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset; + this.endOffset = (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset; + this.userImports = /* @__PURE__ */ Object.create(null); + // macros presence check + this.hasDefinePropsCall = false; + this.hasDefineEmitCall = false; + this.hasDefineExposeCall = false; + this.hasDefaultExportName = false; + this.hasDefaultExportRender = false; + this.hasDefineOptionsCall = false; + this.hasDefineSlotsCall = false; + this.hasDefineModelCall = false; + this.propsDestructuredBindings = /* @__PURE__ */ Object.create(null); + // defineModel + this.modelDecls = /* @__PURE__ */ Object.create(null); + // codegen + this.bindingMetadata = {}; + this.helperImports = /* @__PURE__ */ new Set(); + const { script, scriptSetup } = descriptor; + const scriptLang = script && script.lang; + const scriptSetupLang = scriptSetup && scriptSetup.lang; + this.isJS = scriptLang === "js" || scriptLang === "jsx" || scriptSetupLang === "js" || scriptSetupLang === "jsx"; + this.isTS = scriptLang === "ts" || scriptLang === "tsx" || scriptSetupLang === "ts" || scriptSetupLang === "tsx"; + const customElement = options.customElement; + const filename = this.descriptor.filename; + if (customElement) { + this.isCE = typeof customElement === "boolean" ? customElement : customElement(filename); + } + const plugins = resolveParserPlugins( + scriptLang || scriptSetupLang, + options.babelParserPlugins + ); + function parse(input, offset) { + try { + return parser$2.parse(input, { + plugins, + sourceType: "module" + }).program; + } catch (e) { + e.message = `[vue/compiler-sfc] ${e.message} + +${descriptor.filename} +${shared.generateCodeFrame( + descriptor.source, + e.pos + offset, + e.pos + offset + 1 + )}`; + throw e; + } + } + this.scriptAst = descriptor.script && parse(descriptor.script.content, descriptor.script.loc.start.offset); + this.scriptSetupAst = descriptor.scriptSetup && parse(descriptor.scriptSetup.content, this.startOffset); + } + helper(key) { + this.helperImports.add(key); + return `_${key}`; + } + getString(node, scriptSetup = true) { + const block = scriptSetup ? this.descriptor.scriptSetup : this.descriptor.script; + return block.content.slice(node.start, node.end); + } + warn(msg, node, scope) { + warn(generateError(msg, node, this, scope)); + } + error(msg, node, scope) { + throw new Error( + `[@vue/compiler-sfc] ${generateError(msg, node, this, scope)}` + ); + } +} +function generateError(msg, node, ctx, scope) { + const offset = scope ? scope.offset : ctx.startOffset; + return `${msg} + +${(scope || ctx.descriptor).filename} +${shared.generateCodeFrame( + (scope || ctx.descriptor).source, + node.start + offset, + node.end + offset + )}`; +} +function resolveParserPlugins(lang, userPlugins, dts = false) { + const plugins = []; + if (!userPlugins || !userPlugins.some( + (p) => p === "importAssertions" || p === "importAttributes" || shared.isArray(p) && p[0] === "importAttributes" + )) { + plugins.push("importAttributes"); + } + if (lang === "jsx" || lang === "tsx" || lang === "mtsx") { + plugins.push("jsx"); + } else if (userPlugins) { + userPlugins = userPlugins.filter((p) => p !== "jsx"); + } + if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "mtsx") { + plugins.push(["typescript", { dts }], "explicitResourceManagement"); + if (!userPlugins || !userPlugins.includes("decorators")) { + plugins.push("decorators-legacy"); + } + } + if (userPlugins) { + plugins.push(...userPlugins); + } + return plugins; +} + +function rewriteDefault(input, as, parserPlugins) { + const ast = parser$2.parse(input, { + sourceType: "module", + plugins: resolveParserPlugins("js", parserPlugins) + }).program.body; + const s = new MagicString(input); + rewriteDefaultAST(ast, s, as); + return s.toString(); +} +function rewriteDefaultAST(ast, s, as) { + if (!hasDefaultExport(ast)) { + s.append(` +const ${as} = {}`); + return; + } + ast.forEach((node) => { + if (node.type === "ExportDefaultDeclaration") { + if (node.declaration.type === "ClassDeclaration" && node.declaration.id) { + let start = node.declaration.decorators && node.declaration.decorators.length > 0 ? node.declaration.decorators[node.declaration.decorators.length - 1].end : node.start; + s.overwrite(start, node.declaration.id.start, ` class `); + s.append(` +const ${as} = ${node.declaration.id.name}`); + } else { + s.overwrite(node.start, node.declaration.start, `const ${as} = `); + } + } else if (node.type === "ExportNamedDeclaration") { + for (const specifier of node.specifiers) { + if (specifier.type === "ExportSpecifier" && specifier.exported.type === "Identifier" && specifier.exported.name === "default") { + if (node.source) { + if (specifier.local.name === "default") { + s.prepend( + `import { default as __VUE_DEFAULT__ } from '${node.source.value}' +` + ); + const end2 = specifierEnd(s, specifier.local.end, node.end); + s.remove(specifier.start, end2); + s.append(` +const ${as} = __VUE_DEFAULT__`); + continue; + } else { + s.prepend( + `import { ${s.slice( + specifier.local.start, + specifier.local.end + )} as __VUE_DEFAULT__ } from '${node.source.value}' +` + ); + const end2 = specifierEnd(s, specifier.exported.end, node.end); + s.remove(specifier.start, end2); + s.append(` +const ${as} = __VUE_DEFAULT__`); + continue; + } + } + const end = specifierEnd(s, specifier.end, node.end); + s.remove(specifier.start, end); + s.append(` +const ${as} = ${specifier.local.name}`); + } + } + } + }); +} +function hasDefaultExport(ast) { + for (const stmt of ast) { + if (stmt.type === "ExportDefaultDeclaration") { + return true; + } else if (stmt.type === "ExportNamedDeclaration" && stmt.specifiers.some( + (spec) => spec.exported.name === "default" + )) { + return true; + } + } + return false; +} +function specifierEnd(s, end, nodeEnd) { + let hasCommas = false; + let oldEnd = end; + while (end < nodeEnd) { + if (/\s/.test(s.slice(end, end + 1))) { + end++; + } else if (s.slice(end, end + 1) === ",") { + end++; + hasCommas = true; + break; + } else if (s.slice(end, end + 1) === "}") { + break; + } + } + return hasCommas ? end : oldEnd; +} + +const normalScriptDefaultVar = `__default__`; +function processNormalScript(ctx, scopeId) { + var _a; + const script = ctx.descriptor.script; + if (script.lang && !ctx.isJS && !ctx.isTS) { + return script; + } + try { + let content = script.content; + let map = script.map; + const scriptAst = ctx.scriptAst; + const bindings = analyzeScriptBindings(scriptAst.body); + const { cssVars } = ctx.descriptor; + const { genDefaultAs, isProd } = ctx.options; + if (cssVars.length || genDefaultAs) { + const defaultVar = genDefaultAs || normalScriptDefaultVar; + const s = new MagicString(content); + rewriteDefaultAST(scriptAst.body, s, defaultVar); + content = s.toString(); + if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) { + content += genNormalScriptCssVarsCode( + cssVars, + bindings, + scopeId, + !!isProd, + defaultVar + ); + } + if (!genDefaultAs) { + content += ` +export default ${defaultVar}`; + } + } + return { + ...script, + content, + map, + bindings, + scriptAst: scriptAst.body + }; + } catch (e) { + return script; + } +} + +var balancedMatch; +var hasRequiredBalancedMatch; + +function requireBalancedMatch () { + if (hasRequiredBalancedMatch) return balancedMatch; + hasRequiredBalancedMatch = 1; + balancedMatch = balanced; + function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; + } + + function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; + } + + balanced.range = range; + function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; + } + return balancedMatch; +} + +var braceExpansion; +var hasRequiredBraceExpansion; + +function requireBraceExpansion () { + if (hasRequiredBraceExpansion) return braceExpansion; + hasRequiredBraceExpansion = 1; + var balanced = /*@__PURE__*/ requireBalancedMatch(); + + braceExpansion = expandTop; + + var escSlash = '\0SLASH'+Math.random()+'\0'; + var escOpen = '\0OPEN'+Math.random()+'\0'; + var escClose = '\0CLOSE'+Math.random()+'\0'; + var escComma = '\0COMMA'+Math.random()+'\0'; + var escPeriod = '\0PERIOD'+Math.random()+'\0'; + + function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); + } + + function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); + } + + function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); + } + + + // Basically just str.split(","), but handling cases + // where we have nested braced sections, which should be + // treated as individual members, like {a,{b,c},d} + function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; + } + + function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); + } + + function embrace(str) { + return '{' + str + '}'; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + + function lte(i, y) { + return i <= y; + } + function gte(i, y) { + return i >= y; + } + + function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + + return expansions; + } + return braceExpansion; +} + +var braceExpansionExports = /*@__PURE__*/ requireBraceExpansion(); +var expand = /*@__PURE__*/getDefaultExportFromCjs(braceExpansionExports); + +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; + +// translate the various posix character classes into unicode properties +// this works across all unicode locales +// { <posix class>: [<translation>, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c<more...>] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; + +/** + * Un-escape a string that has been escaped with {@link escape}. + * + * If the {@link windowsPathsNoEscape} option is used, then square-brace + * escapes are removed, but not backslash escapes. For example, it will turn + * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, + * becuase `\` is a path separator in `windowsPathsNoEscape` mode. + * + * When `windowsPathsNoEscape` is not set, then both brace escapes and + * backslash escapes are removed. + * + * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped + * or unescaped. + */ +const unescape = (s, { windowsPathsNoEscape = false, } = {}) => { + return windowsPathsNoEscape + ? s.replace(/\[([^\/\\])\]/g, '$1') + : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); +}; + +// parse a single path portion +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape$1 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark$1 = '[^/]'; +// * => any number of characters +const star$1 = qmark$1 + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark$1 + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + if (this.#toString !== undefined) + return this.#toString; + if (!this.type) { + return (this.#toString = this.#parts.map(p => String(p)).join('')); + } + else { + return (this.#toString = + this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + } + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null + ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof AST && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new AST(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt) { + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { + ast.push(acc); + acc = ''; + const ext = new AST(c, ast); + i = AST.#parseAST(str, ext, i, opt); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new AST(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (isExtglobType(c) && str.charAt(i) === '(') { + part.push(acc); + acc = ''; + const ext = new AST(c, part); + part.push(ext); + i = AST.#parseAST(str, ext, i, opt); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new AST(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + static fromGlob(pattern, options = {}) { + const ast = new AST(null, undefined, options); + AST.#parseAST(pattern, ast, 0, options); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) + this.#fillNegs(); + if (!this.type) { + const noEmpty = this.isStart() && this.isEnd(); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' + ? AST.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + unescape(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + this.#parts = [s]; + this.type = null; + this.#hasMagic = undefined; + return [s, unescape(this.toString()), false, false]; + } + // XXX abstract out this map method + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot + ? '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' + ? // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star$1 + + ')' + : this.type === '@' + ? ')' + : this.type === '?' + ? ')?' + : this.type === '+' && bodyDotAllowed + ? ')' + : this.type === '*' && bodyDotAllowed + ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + unescape(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = parseClass(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '*') { + if (noEmpty && glob === '*') + re += starNoEmpty; + else + re += star$1; + hasMagic = true; + continue; + } + if (c === '?') { + re += qmark$1; + hasMagic = true; + continue; + } + re += regExpEscape$1(c); + } + return [re, unescape(glob), !!hasMagic, uflag]; + } +} + +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; + +const minimatch = (p, pattern, options = {}) => { + assertValidPattern(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process + ? (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +minimatch.sep = sep; +const GLOBSTAR = Symbol('globstar **'); +minimatch.GLOBSTAR = GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options); +minimatch.filter = filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch; + } + const orig = minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: GLOBSTAR, + }); +}; +minimatch.defaults = defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern); + // Thanks to Yeting Li <https://github.com/yetingli> for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return expand(pattern); +}; +minimatch.braceExpand = braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +minimatch.makeRe = makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +minimatch.match = match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + regexp; + constructor(pattern, options = {}) { + assertValidPattern(pattern); + options = options || {}; + this.options = options; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + // <pre>/<e>/<rest> -> <pre>/<rest> + if (!this.preserveMultipleSlashes) { + for (let i = 1; i < parts.length - 1; i++) { + const p = parts[i]; + // don't squeeze out UNC patterns + if (i === 1 && p === '' && parts[0] === '') + continue; + if (p === '.' || p === '') { + didSomething = true; + parts.splice(i, 1); + i--; + } + } + if (parts[0] === '.' && + parts.length === 2 && + (parts[1] === '.' || parts[1] === '')) { + didSomething = true; + parts.pop(); + } + } + // <pre>/<p>/../<rest> -> <pre>/<rest> + let dd = 0; + while (-1 !== (dd = parts.indexOf('..', dd + 1))) { + const p = parts[dd - 1]; + if (p && p !== '.' && p !== '..' && p !== '**') { + didSomething = true; + parts.splice(dd - 1, 2); + dd -= 2; + } + } + } while (didSomething); + return parts.length === 0 ? [''] : parts; + } + // First phase: single-pattern processing + // <pre> is 1 or more portions + // <rest> is 1 or more portions + // <p> is any portion other than ., .., '', or ** + // <e> is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>} + // <pre>/<e>/<rest> -> <pre>/<rest> + // <pre>/<p>/../<rest> -> <pre>/<rest> + // **/**/<rest> -> **/<rest> + // + // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow + // this WOULD be allowed if ** did follow symlinks, or * didn't + firstPhasePreProcess(globParts) { + let didSomething = false; + do { + didSomething = false; + // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + // <pre>/**/**/<rest> -> <pre>/**/<rest> + gss++; + } + // eg, if gs is 2 and gss is 4, that means we have 3 ** + // parts, and can remove 2 of them. + if (gss > gs) { + parts.splice(gs + 1, gss - gs); + } + let next = parts[gs + 1]; + const p = parts[gs + 2]; + const p2 = parts[gs + 3]; + if (next !== '..') + continue; + if (!p || + p === '.' || + p === '..' || + !p2 || + p2 === '.' || + p2 === '..') { + continue; + } + didSomething = true; + // edit parts in place, and push the new one + parts.splice(gs, 1); + const other = parts.slice(0); + other[gs] = '**'; + globParts.push(other); + gs--; + } + // <pre>/<e>/<rest> -> <pre>/<rest> + if (!this.preserveMultipleSlashes) { + for (let i = 1; i < parts.length - 1; i++) { + const p = parts[i]; + // don't squeeze out UNC patterns + if (i === 1 && p === '' && parts[0] === '') + continue; + if (p === '.' || p === '') { + didSomething = true; + parts.splice(i, 1); + i--; + } + } + if (parts[0] === '.' && + parts.length === 2 && + (parts[1] === '.' || parts[1] === '')) { + didSomething = true; + parts.pop(); + } + } + // <pre>/<p>/../<rest> -> <pre>/<rest> + let dd = 0; + while (-1 !== (dd = parts.indexOf('..', dd + 1))) { + const p = parts[dd - 1]; + if (p && p !== '.' && p !== '..' && p !== '**') { + didSomething = true; + const needDot = dd === 1 && parts[dd + 1] === '**'; + const splin = needDot ? ['.'] : []; + parts.splice(dd - 1, 2, ...splin); + if (parts.length === 0) + parts.push(''); + dd -= 2; + } + } + } + } while (didSomething); + return globParts; + } + // second phase: multi-pattern dedupes + // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest> + // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest> + // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest> + // + // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest> + // ^-- not valid because ** doens't follow symlinks + secondPhasePreProcess(globParts) { + for (let i = 0; i < globParts.length - 1; i++) { + for (let j = i + 1; j < globParts.length; j++) { + const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes); + if (matched) { + globParts[i] = []; + globParts[j] = matched; + break; + } + } + } + return globParts.filter(gs => gs.length); + } + partsMatch(a, b, emptyGSMatch = false) { + let ai = 0; + let bi = 0; + let result = []; + let which = ''; + while (ai < a.length && bi < b.length) { + if (a[ai] === b[bi]) { + result.push(which === 'b' ? b[bi] : a[ai]); + ai++; + bi++; + } + else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) { + result.push(a[ai]); + ai++; + } + else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) { + result.push(b[bi]); + bi++; + } + else if (a[ai] === '*' && + b[bi] && + (this.options.dot || !b[bi].startsWith('.')) && + b[bi] !== '**') { + if (which === 'b') + return false; + which = 'a'; + result.push(a[ai]); + ai++; + bi++; + } + else if (b[bi] === '*' && + a[ai] && + (this.options.dot || !a[ai].startsWith('.')) && + a[ai] !== '**') { + if (which === 'a') + return false; + which = 'b'; + result.push(b[bi]); + ai++; + bi++; + } + else { + return false; + } + } + // if we fall out of the loop, it means they two are identical + // as long as their lengths match + return a.length === b.length && result; + } + parseNegate() { + if (this.nonegate) + return; + const pattern = this.pattern; + let negate = false; + let negateOffset = 0; + for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) + this.pattern = pattern.slice(negateOffset); + this.negate = negate; + } + // set partial to true to test if, for example, + // "/a/b" matches the start of "/*/b/*/d" + // Partial means, if you run out of file before you run + // out of pattern, then that's fine, as long as all + // the parts match. + matchOne(file, pattern, partial = false) { + const options = this.options; + // UNC paths like //?/X:/... can match X:/... and vice versa + // Drive letters in absolute drive or unc paths are always compared + // case-insensitively. + if (this.isWindows) { + const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]); + const fileUNC = !fileDrive && + file[0] === '' && + file[1] === '' && + file[2] === '?' && + /^[a-z]:$/i.test(file[3]); + const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]); + const patternUNC = !patternDrive && + pattern[0] === '' && + pattern[1] === '' && + pattern[2] === '?' && + typeof pattern[3] === 'string' && + /^[a-z]:$/i.test(pattern[3]); + const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined; + const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined; + if (typeof fdi === 'number' && typeof pdi === 'number') { + const [fd, pd] = [file[fdi], pattern[pdi]]; + if (fd.toLowerCase() === pd.toLowerCase()) { + pattern[pdi] = fd; + if (pdi > fdi) { + pattern = pattern.slice(pdi); + } + else if (fdi > pdi) { + file = file.slice(fdi); + } + } + } + } + // resolve and reduce . and .. portions in the file as well. + // dont' need to do the second phase, because it's only one string[] + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + file = this.levelTwoFileOptimize(file); + } + this.debug('matchOne', this, { file, pattern }); + this.debug('matchOne', file.length, pattern.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug('matchOne loop'); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + // should be impossible. + // some invalid regexp stuff in the set. + /* c8 ignore start */ + if (p === false) { + return false; + } + /* c8 ignore stop */ + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]); + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug('** at the end'); + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || + file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) + return false; + } + return true; + } + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr]; + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee); + // found a match. + return true; + } + else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || + swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr); + break; + } + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue'); + fr++; + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + /* c8 ignore start */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr); + if (fr === fl) { + return true; + } + } + /* c8 ignore stop */ + return false; + } + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + let hit; + if (typeof p === 'string') { + hit = f === p; + this.debug('string match', p, f, hit); + } + else { + hit = p.test(f); + this.debug('pattern match', p, f, hit); + } + if (!hit) + return false; + } + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true; + } + else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial; + } + else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return fi === fl - 1 && file[fi] === ''; + /* c8 ignore start */ + } + else { + // should be unreachable. + throw new Error('wtf?'); + } + /* c8 ignore stop */ + } + braceExpand() { + return braceExpand(this.pattern, this.options); + } + parse(pattern) { + assertValidPattern(pattern); + const options = this.options; + // shortcuts + if (pattern === '**') + return GLOBSTAR; + if (pattern === '') + return ''; + // far and away, the most common glob pattern parts are + // *, *.*, and *.<ext> Add a fast check method for those. + let m; + let fastTest = null; + if ((m = pattern.match(starRE))) { + fastTest = options.dot ? starTestDot : starTest; + } + else if ((m = pattern.match(starDotExtRE))) { + fastTest = (options.nocase + ? options.dot + ? starDotExtTestNocaseDot + : starDotExtTestNocase + : options.dot + ? starDotExtTestDot + : starDotExtTest)(m[1]); + } + else if ((m = pattern.match(qmarksRE))) { + fastTest = (options.nocase + ? options.dot + ? qmarksTestNocaseDot + : qmarksTestNocase + : options.dot + ? qmarksTestDot + : qmarksTest)(m); + } + else if ((m = pattern.match(starDotStarRE))) { + fastTest = options.dot ? starDotStarTestDot : starDotStarTest; + } + else if ((m = pattern.match(dotStarRE))) { + fastTest = dotStarTest; + } + const re = AST.fromGlob(pattern, this.options).toMMPattern(); + if (fastTest && typeof re === 'object') { + // Avoids overriding in frozen environments + Reflect.defineProperty(re, 'test', { value: fastTest }); + } + return re; + } + makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + const set = this.set; + if (!set.length) { + this.regexp = false; + return this.regexp; + } + const options = this.options; + const twoStar = options.noglobstar + ? star + : options.dot + ? twoStarDot + : twoStarNoDot; + const flags = new Set(options.nocase ? ['i'] : []); + // regexpify non-globstar patterns + // if ** is only item, then we just do one twoStar + // if ** is first, and there are more, prepend (\/|twoStar\/)? to next + // if ** is last, append (\/twoStar|) to previous + // if ** is in the middle, append (\/|\/twoStar\/) to previous + // then filter out GLOBSTAR symbols + let re = set + .map(pattern => { + const pp = pattern.map(p => { + if (p instanceof RegExp) { + for (const f of p.flags.split('')) + flags.add(f); + } + return typeof p === 'string' + ? regExpEscape(p) + : p === GLOBSTAR + ? GLOBSTAR + : p._src; + }); + pp.forEach((p, i) => { + const next = pp[i + 1]; + const prev = pp[i - 1]; + if (p !== GLOBSTAR || prev === GLOBSTAR) { + return; + } + if (prev === undefined) { + if (next !== undefined && next !== GLOBSTAR) { + pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next; + } + else { + pp[i] = twoStar; + } + } + else if (next === undefined) { + pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?'; + } + else if (next !== GLOBSTAR) { + pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next; + pp[i + 1] = GLOBSTAR; + } + }); + return pp.filter(p => p !== GLOBSTAR).join('/'); + }) + .join('|'); + // need to wrap in parens if we had more than one thing with |, + // otherwise only the first will be anchored to ^ and the last to $ + const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']; + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^' + open + re + close + '$'; + // can match anything, as long as it's not this. + if (this.negate) + re = '^(?!' + re + ').+$'; + try { + this.regexp = new RegExp(re, [...flags].join('')); + /* c8 ignore start */ + } + catch (ex) { + // should be impossible + this.regexp = false; + } + /* c8 ignore stop */ + return this.regexp; + } + slashSplit(p) { + // if p starts with // on windows, we preserve that + // so that UNC paths aren't broken. Otherwise, any number of + // / characters are coalesced into one, unless + // preserveMultipleSlashes is set to true. + if (this.preserveMultipleSlashes) { + return p.split('/'); + } + else if (this.isWindows && /^\/\/[^\/]+/.test(p)) { + // add an extra '' for the one we lose + return ['', ...p.split(/\/+/)]; + } + else { + return p.split(/\/+/); + } + } + match(f, partial = this.partial) { + this.debug('match', f, this.pattern); + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) { + return false; + } + if (this.empty) { + return f === ''; + } + if (f === '/' && partial) { + return true; + } + const options = this.options; + // windows: need to use /, not \ + if (this.isWindows) { + f = f.split('\\').join('/'); + } + // treat the test path as a set of pathparts. + const ff = this.slashSplit(f); + this.debug(this.pattern, 'split', ff); + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + const set = this.set; + this.debug(this.pattern, 'set', set); + // Find the basename of the path by looking for the last non-empty segment + let filename = ff[ff.length - 1]; + if (!filename) { + for (let i = ff.length - 2; !filename && i >= 0; i--) { + filename = ff[i]; + } + } + for (let i = 0; i < set.length; i++) { + const pattern = set[i]; + let file = ff; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + const hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) { + return true; + } + return !this.negate; + } + } + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) { + return false; + } + return this.negate; + } + static defaults(def) { + return minimatch.defaults(def).Minimatch; + } +} +/* c8 ignore stop */ +minimatch.AST = AST; +minimatch.Minimatch = Minimatch; +minimatch.escape = escape; +minimatch.unescape = unescape; + +class TypeScope { + constructor(filename, source, offset = 0, imports = /* @__PURE__ */ Object.create(null), types = /* @__PURE__ */ Object.create(null), declares = /* @__PURE__ */ Object.create(null)) { + this.filename = filename; + this.source = source; + this.offset = offset; + this.imports = imports; + this.types = types; + this.declares = declares; + this.isGenericScope = false; + this.resolvedImportSources = /* @__PURE__ */ Object.create(null); + this.exportedTypes = /* @__PURE__ */ Object.create(null); + this.exportedDeclares = /* @__PURE__ */ Object.create(null); + } +} +function resolveTypeElements(ctx, node, scope, typeParameters) { + const canCache = !typeParameters; + if (canCache && node._resolvedElements) { + return node._resolvedElements; + } + const resolved = innerResolveTypeElements( + ctx, + node, + node._ownerScope || scope || ctxToScope(ctx), + typeParameters + ); + return canCache ? node._resolvedElements = resolved : resolved; +} +function innerResolveTypeElements(ctx, node, scope, typeParameters) { + var _a, _b; + if (node.leadingComments && node.leadingComments.some((c) => c.value.includes("@vue-ignore"))) { + return { props: {} }; + } + switch (node.type) { + case "TSTypeLiteral": + return typeElementsToMap(ctx, node.members, scope, typeParameters); + case "TSInterfaceDeclaration": + return resolveInterfaceMembers(ctx, node, scope, typeParameters); + case "TSTypeAliasDeclaration": + case "TSTypeAnnotation": + case "TSParenthesizedType": + return resolveTypeElements( + ctx, + node.typeAnnotation, + scope, + typeParameters + ); + case "TSFunctionType": { + return { props: {}, calls: [node] }; + } + case "TSUnionType": + case "TSIntersectionType": + return mergeElements( + node.types.map((t) => resolveTypeElements(ctx, t, scope, typeParameters)), + node.type + ); + case "TSMappedType": + return resolveMappedType(ctx, node, scope, typeParameters); + case "TSIndexedAccessType": { + const types = resolveIndexType(ctx, node, scope); + return mergeElements( + types.map((t) => resolveTypeElements(ctx, t, t._ownerScope)), + "TSUnionType" + ); + } + case "TSExpressionWithTypeArguments": + // referenced by interface extends + case "TSTypeReference": { + const typeName = getReferenceName(node); + if ((typeName === "ExtractPropTypes" || typeName === "ExtractPublicPropTypes") && node.typeParameters && ((_a = scope.imports[typeName]) == null ? void 0 : _a.source) === "vue") { + return resolveExtractPropTypes( + resolveTypeElements( + ctx, + node.typeParameters.params[0], + scope, + typeParameters + ), + scope + ); + } + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + let typeParams; + if ((resolved.type === "TSTypeAliasDeclaration" || resolved.type === "TSInterfaceDeclaration") && resolved.typeParameters && node.typeParameters) { + typeParams = /* @__PURE__ */ Object.create(null); + resolved.typeParameters.params.forEach((p, i) => { + let param = typeParameters && typeParameters[p.name]; + if (!param) param = node.typeParameters.params[i]; + typeParams[p.name] = param; + }); + } + return resolveTypeElements( + ctx, + resolved, + resolved._ownerScope, + typeParams + ); + } else { + if (typeof typeName === "string") { + if (typeParameters && typeParameters[typeName]) { + return resolveTypeElements( + ctx, + typeParameters[typeName], + scope, + typeParameters + ); + } + if ( + // @ts-expect-error + SupportedBuiltinsSet.has(typeName) + ) { + return resolveBuiltin( + ctx, + node, + typeName, + scope, + typeParameters + ); + } else if (typeName === "ReturnType" && node.typeParameters) { + const ret = resolveReturnType( + ctx, + node.typeParameters.params[0], + scope + ); + if (ret) { + return resolveTypeElements(ctx, ret, scope); + } + } + } + return ctx.error( + `Unresolvable type reference or unsupported built-in utility type`, + node, + scope + ); + } + } + case "TSImportType": { + if (getId(node.argument) === "vue" && ((_b = node.qualifier) == null ? void 0 : _b.type) === "Identifier" && node.qualifier.name === "ExtractPropTypes" && node.typeParameters) { + return resolveExtractPropTypes( + resolveTypeElements(ctx, node.typeParameters.params[0], scope), + scope + ); + } + const sourceScope = importSourceToScope( + ctx, + node.argument, + scope, + node.argument.value + ); + const resolved = resolveTypeReference(ctx, node, sourceScope); + if (resolved) { + return resolveTypeElements(ctx, resolved, resolved._ownerScope); + } + break; + } + case "TSTypeQuery": + { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveTypeElements(ctx, resolved, resolved._ownerScope); + } + } + break; + } + return ctx.error(`Unresolvable type: ${node.type}`, node, scope); +} +function typeElementsToMap(ctx, elements, scope = ctxToScope(ctx), typeParameters) { + const res = { props: {} }; + for (const e of elements) { + if (e.type === "TSPropertySignature" || e.type === "TSMethodSignature") { + if (typeParameters) { + scope = createChildScope(scope); + scope.isGenericScope = true; + Object.assign(scope.types, typeParameters); + } + e._ownerScope = scope; + const name = getId(e.key); + if (name && !e.computed) { + res.props[name] = e; + } else if (e.key.type === "TemplateLiteral") { + for (const key of resolveTemplateKeys(ctx, e.key, scope)) { + res.props[key] = e; + } + } else { + ctx.error( + `Unsupported computed key in type referenced by a macro`, + e.key, + scope + ); + } + } else if (e.type === "TSCallSignatureDeclaration") { + (res.calls || (res.calls = [])).push(e); + } + } + return res; +} +function mergeElements(maps, type) { + if (maps.length === 1) return maps[0]; + const res = { props: {} }; + const { props: baseProps } = res; + for (const { props, calls } of maps) { + for (const key in props) { + if (!shared.hasOwn(baseProps, key)) { + baseProps[key] = props[key]; + } else { + baseProps[key] = createProperty( + baseProps[key].key, + { + type, + // @ts-expect-error + types: [baseProps[key], props[key]] + }, + baseProps[key]._ownerScope, + baseProps[key].optional || props[key].optional + ); + } + } + if (calls) { + (res.calls || (res.calls = [])).push(...calls); + } + } + return res; +} +function createProperty(key, typeAnnotation, scope, optional) { + return { + type: "TSPropertySignature", + key, + kind: "get", + optional, + typeAnnotation: { + type: "TSTypeAnnotation", + typeAnnotation + }, + _ownerScope: scope + }; +} +function resolveInterfaceMembers(ctx, node, scope, typeParameters) { + const base = typeElementsToMap( + ctx, + node.body.body, + node._ownerScope, + typeParameters + ); + if (node.extends) { + for (const ext of node.extends) { + try { + const { props, calls } = resolveTypeElements(ctx, ext, scope); + for (const key in props) { + if (!shared.hasOwn(base.props, key)) { + base.props[key] = props[key]; + } + } + if (calls) { + ; + (base.calls || (base.calls = [])).push(...calls); + } + } catch (e) { + ctx.error( + `Failed to resolve extends base type. +If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example: + +interface Props extends /* @vue-ignore */ Base {} + +Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.`, + ext, + scope + ); + } + } + } + return base; +} +function resolveMappedType(ctx, node, scope, typeParameters) { + const res = { props: {} }; + let keys; + if (node.nameType) { + const { name, constraint } = node.typeParameter; + scope = createChildScope(scope); + Object.assign(scope.types, { ...typeParameters, [name]: constraint }); + keys = resolveStringType(ctx, node.nameType, scope); + } else { + keys = resolveStringType(ctx, node.typeParameter.constraint, scope); + } + for (const key of keys) { + res.props[key] = createProperty( + { + type: "Identifier", + name: key + }, + node.typeAnnotation, + scope, + !!node.optional + ); + } + return res; +} +function resolveIndexType(ctx, node, scope) { + var _a, _b; + if (node.indexType.type === "TSNumberKeyword") { + return resolveArrayElementType(ctx, node.objectType, scope); + } + const { indexType, objectType } = node; + const types = []; + let keys; + let resolved; + if (indexType.type === "TSStringKeyword") { + resolved = resolveTypeElements(ctx, objectType, scope); + keys = Object.keys(resolved.props); + } else { + keys = resolveStringType(ctx, indexType, scope); + resolved = resolveTypeElements(ctx, objectType, scope); + } + for (const key of keys) { + const targetType = (_b = (_a = resolved.props[key]) == null ? void 0 : _a.typeAnnotation) == null ? void 0 : _b.typeAnnotation; + if (targetType) { + targetType._ownerScope = resolved.props[key]._ownerScope; + types.push(targetType); + } + } + return types; +} +function resolveArrayElementType(ctx, node, scope) { + if (node.type === "TSArrayType") { + return [node.elementType]; + } + if (node.type === "TSTupleType") { + return node.elementTypes.map( + (t) => t.type === "TSNamedTupleMember" ? t.elementType : t + ); + } + if (node.type === "TSTypeReference") { + if (getReferenceName(node) === "Array" && node.typeParameters) { + return node.typeParameters.params; + } else { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveArrayElementType(ctx, resolved, scope); + } + } + } + return ctx.error( + "Failed to resolve element type from target type", + node, + scope + ); +} +function resolveStringType(ctx, node, scope) { + switch (node.type) { + case "StringLiteral": + return [node.value]; + case "TSLiteralType": + return resolveStringType(ctx, node.literal, scope); + case "TSUnionType": + return node.types.map((t) => resolveStringType(ctx, t, scope)).flat(); + case "TemplateLiteral": { + return resolveTemplateKeys(ctx, node, scope); + } + case "TSTypeReference": { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveStringType(ctx, resolved, scope); + } + if (node.typeName.type === "Identifier") { + const getParam = (index = 0) => resolveStringType(ctx, node.typeParameters.params[index], scope); + switch (node.typeName.name) { + case "Extract": + return getParam(1); + case "Exclude": { + const excluded = getParam(1); + return getParam().filter((s) => !excluded.includes(s)); + } + case "Uppercase": + return getParam().map((s) => s.toUpperCase()); + case "Lowercase": + return getParam().map((s) => s.toLowerCase()); + case "Capitalize": + return getParam().map(shared.capitalize); + case "Uncapitalize": + return getParam().map((s) => s[0].toLowerCase() + s.slice(1)); + default: + ctx.error( + "Unsupported type when resolving index type", + node.typeName, + scope + ); + } + } + } + } + return ctx.error("Failed to resolve index type into finite keys", node, scope); +} +function resolveTemplateKeys(ctx, node, scope) { + if (!node.expressions.length) { + return [node.quasis[0].value.raw]; + } + const res = []; + const e = node.expressions[0]; + const q = node.quasis[0]; + const leading = q ? q.value.raw : ``; + const resolved = resolveStringType(ctx, e, scope); + const restResolved = resolveTemplateKeys( + ctx, + { + ...node, + expressions: node.expressions.slice(1), + quasis: q ? node.quasis.slice(1) : node.quasis + }, + scope + ); + for (const r of resolved) { + for (const rr of restResolved) { + res.push(leading + r + rr); + } + } + return res; +} +const SupportedBuiltinsSet = /* @__PURE__ */ new Set([ + "Partial", + "Required", + "Readonly", + "Pick", + "Omit" +]); +function resolveBuiltin(ctx, node, name, scope, typeParameters) { + const t = resolveTypeElements( + ctx, + node.typeParameters.params[0], + scope, + typeParameters + ); + switch (name) { + case "Partial": { + const res2 = { props: {}, calls: t.calls }; + Object.keys(t.props).forEach((key) => { + res2.props[key] = { ...t.props[key], optional: true }; + }); + return res2; + } + case "Required": { + const res2 = { props: {}, calls: t.calls }; + Object.keys(t.props).forEach((key) => { + res2.props[key] = { ...t.props[key], optional: false }; + }); + return res2; + } + case "Readonly": + return t; + case "Pick": { + const picked = resolveStringType( + ctx, + node.typeParameters.params[1], + scope + ); + const res2 = { props: {}, calls: t.calls }; + for (const key of picked) { + res2.props[key] = t.props[key]; + } + return res2; + } + case "Omit": + const omitted = resolveStringType( + ctx, + node.typeParameters.params[1], + scope + ); + const res = { props: {}, calls: t.calls }; + for (const key in t.props) { + if (!omitted.includes(key)) { + res.props[key] = t.props[key]; + } + } + return res; + } +} +function resolveTypeReference(ctx, node, scope, name, onlyExported = false) { + const canCache = !(scope == null ? void 0 : scope.isGenericScope); + if (canCache && node._resolvedReference) { + return node._resolvedReference; + } + const resolved = innerResolveTypeReference( + ctx, + scope || ctxToScope(ctx), + name || getReferenceName(node), + node, + onlyExported + ); + return canCache ? node._resolvedReference = resolved : resolved; +} +function innerResolveTypeReference(ctx, scope, name, node, onlyExported) { + if (typeof name === "string") { + if (scope.imports[name]) { + return resolveTypeFromImport(ctx, node, name, scope); + } else { + const lookupSource = node.type === "TSTypeQuery" ? onlyExported ? scope.exportedDeclares : scope.declares : onlyExported ? scope.exportedTypes : scope.types; + if (lookupSource[name]) { + return lookupSource[name]; + } else { + const globalScopes = resolveGlobalScope(ctx); + if (globalScopes) { + for (const s of globalScopes) { + const src = node.type === "TSTypeQuery" ? s.declares : s.types; + if (src[name]) { + (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(s.filename); + return src[name]; + } + } + } + } + } + } else { + let ns = innerResolveTypeReference(ctx, scope, name[0], node, onlyExported); + if (ns) { + if (ns.type !== "TSModuleDeclaration") { + ns = ns._ns; + } + if (ns) { + const childScope = moduleDeclToScope(ctx, ns, ns._ownerScope || scope); + return innerResolveTypeReference( + ctx, + childScope, + name.length > 2 ? name.slice(1) : name[name.length - 1], + node, + !ns.declare + ); + } + } + } +} +function getReferenceName(node) { + const ref = node.type === "TSTypeReference" ? node.typeName : node.type === "TSExpressionWithTypeArguments" ? node.expression : node.type === "TSImportType" ? node.qualifier : node.exprName; + if ((ref == null ? void 0 : ref.type) === "Identifier") { + return ref.name; + } else if ((ref == null ? void 0 : ref.type) === "TSQualifiedName") { + return qualifiedNameToPath(ref); + } else { + return "default"; + } +} +function qualifiedNameToPath(node) { + if (node.type === "Identifier") { + return [node.name]; + } else { + return [...qualifiedNameToPath(node.left), node.right.name]; + } +} +function resolveGlobalScope(ctx) { + if (ctx.options.globalTypeFiles) { + const fs = resolveFS(ctx); + if (!fs) { + throw new Error("[vue/compiler-sfc] globalTypeFiles requires fs access."); + } + return ctx.options.globalTypeFiles.map( + (file) => fileToScope(ctx, normalizePath(file), true) + ); + } +} +let ts; +let loadTS; +function registerTS(_loadTS) { + loadTS = () => { + try { + return _loadTS(); + } catch (err) { + if (typeof err.message === "string" && err.message.includes("Cannot find module")) { + throw new Error( + 'Failed to load TypeScript, which is required for resolving imported types. Please make sure "typescript" is installed as a project dependency.' + ); + } else { + throw new Error( + "Failed to load TypeScript for resolving imported types." + ); + } + } + }; +} +function resolveFS(ctx) { + if (ctx.fs) { + return ctx.fs; + } + if (!ts && loadTS) { + ts = loadTS(); + } + const fs = ctx.options.fs || (ts == null ? void 0 : ts.sys); + if (!fs) { + return; + } + return ctx.fs = { + fileExists(file) { + if (file.endsWith(".vue.ts")) { + file = file.replace(/\.ts$/, ""); + } + return fs.fileExists(file); + }, + readFile(file) { + if (file.endsWith(".vue.ts")) { + file = file.replace(/\.ts$/, ""); + } + return fs.readFile(file); + }, + realpath: fs.realpath + }; +} +function resolveTypeFromImport(ctx, node, name, scope) { + const { source, imported } = scope.imports[name]; + const sourceScope = importSourceToScope(ctx, node, scope, source); + return resolveTypeReference(ctx, node, sourceScope, imported, true); +} +function importSourceToScope(ctx, node, scope, source) { + let fs; + try { + fs = resolveFS(ctx); + } catch (err) { + return ctx.error(err.message, node, scope); + } + if (!fs) { + return ctx.error( + `No fs option provided to \`compileScript\` in non-Node environment. File system access is required for resolving imported types.`, + node, + scope + ); + } + let resolved = scope.resolvedImportSources[source]; + if (!resolved) { + if (source.startsWith("..")) { + const osSpecificJoinFn = process__namespace.platform === "win32" ? path$1.join : joinPaths; + const filename = osSpecificJoinFn(path$1.dirname(scope.filename), source); + resolved = resolveExt(filename, fs); + } else if (source[0] === ".") { + const filename = joinPaths(path$1.dirname(scope.filename), source); + resolved = resolveExt(filename, fs); + } else { + if (!ts) { + if (loadTS) ts = loadTS(); + if (!ts) { + return ctx.error( + `Failed to resolve import source ${JSON.stringify(source)}. typescript is required as a peer dep for vue in order to support resolving types from module imports.`, + node, + scope + ); + } + } + resolved = resolveWithTS(scope.filename, source, ts, fs); + } + if (resolved) { + resolved = scope.resolvedImportSources[source] = normalizePath(resolved); + } + } + if (resolved) { + (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved); + return fileToScope(ctx, resolved); + } else { + return ctx.error( + `Failed to resolve import source ${JSON.stringify(source)}.`, + node, + scope + ); + } +} +function resolveExt(filename, fs) { + filename = filename.replace(/\.js$/, ""); + const tryResolve = (filename2) => { + if (fs.fileExists(filename2)) return filename2; + }; + return tryResolve(filename) || tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`)); +} +const tsConfigCache = createCache(); +const tsConfigRefMap = /* @__PURE__ */ new Map(); +function resolveWithTS(containingFile, source, ts2, fs) { + var _a, _b; + const configPath = ts2.findConfigFile(containingFile, fs.fileExists); + let tsCompilerOptions; + let tsResolveCache; + if (configPath) { + let configs; + const normalizedConfigPath = normalizePath(configPath); + const cached = tsConfigCache.get(normalizedConfigPath); + if (!cached) { + configs = loadTSConfig(configPath, ts2, fs).map((config) => ({ config })); + tsConfigCache.set(normalizedConfigPath, configs); + } else { + configs = cached; + } + let matchedConfig; + if (configs.length === 1) { + matchedConfig = configs[0]; + } else { + for (const c of configs) { + const base = normalizePath( + c.config.options.pathsBasePath || path$1.dirname(c.config.options.configFilePath) + ); + const included = (_a = c.config.raw) == null ? void 0 : _a.include; + const excluded = (_b = c.config.raw) == null ? void 0 : _b.exclude; + if (!included && (!base || containingFile.startsWith(base)) || (included == null ? void 0 : included.some((p) => minimatch(containingFile, joinPaths(base, p))))) { + if (excluded && excluded.some((p) => minimatch(containingFile, joinPaths(base, p)))) { + continue; + } + matchedConfig = c; + break; + } + } + if (!matchedConfig) { + matchedConfig = configs[configs.length - 1]; + } + } + tsCompilerOptions = matchedConfig.config.options; + tsResolveCache = matchedConfig.cache || (matchedConfig.cache = ts2.createModuleResolutionCache( + process__namespace.cwd(), + createGetCanonicalFileName(ts2.sys.useCaseSensitiveFileNames), + tsCompilerOptions + )); + } else { + tsCompilerOptions = {}; + } + const res = ts2.resolveModuleName( + source, + containingFile, + tsCompilerOptions, + fs, + tsResolveCache + ); + if (res.resolvedModule) { + let filename = res.resolvedModule.resolvedFileName; + if (filename.endsWith(".vue.ts")) { + filename = filename.replace(/\.ts$/, ""); + } + return fs.realpath ? fs.realpath(filename) : filename; + } +} +function loadTSConfig(configPath, ts2, fs, visited = /* @__PURE__ */ new Set()) { + const parseConfigHost = ts2.sys; + const config = ts2.parseJsonConfigFileContent( + ts2.readConfigFile(configPath, fs.readFile).config, + parseConfigHost, + path$1.dirname(configPath), + void 0, + configPath + ); + const res = [config]; + visited.add(configPath); + if (config.projectReferences) { + for (const ref of config.projectReferences) { + const refPath = ts2.resolveProjectReferencePath(ref); + if (visited.has(refPath) || !fs.fileExists(refPath)) { + continue; + } + tsConfigRefMap.set(refPath, configPath); + res.unshift(...loadTSConfig(refPath, ts2, fs, visited)); + } + } + return res; +} +const fileToScopeCache = createCache(); +function invalidateTypeCache(filename) { + filename = normalizePath(filename); + fileToScopeCache.delete(filename); + tsConfigCache.delete(filename); + const affectedConfig = tsConfigRefMap.get(filename); + if (affectedConfig) tsConfigCache.delete(affectedConfig); +} +function fileToScope(ctx, filename, asGlobal = false) { + const cached = fileToScopeCache.get(filename); + if (cached) { + return cached; + } + const fs = resolveFS(ctx); + const source = fs.readFile(filename) || ""; + const body = parseFile(filename, source, ctx.options.babelParserPlugins); + const scope = new TypeScope(filename, source, 0, recordImports(body)); + recordTypes(ctx, body, scope, asGlobal); + fileToScopeCache.set(filename, scope); + return scope; +} +function parseFile(filename, content, parserPlugins) { + const ext = path$1.extname(filename); + if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".mtsx") { + return parser$2.parse(content, { + plugins: resolveParserPlugins( + ext.slice(1), + parserPlugins, + /\.d\.m?ts$/.test(filename) + ), + sourceType: "module" + }).program.body; + } else if (ext === ".vue") { + const { + descriptor: { script, scriptSetup } + } = parse$1(content); + if (!script && !scriptSetup) { + return []; + } + const scriptOffset = script ? script.loc.start.offset : Infinity; + const scriptSetupOffset = scriptSetup ? scriptSetup.loc.start.offset : Infinity; + const firstBlock = scriptOffset < scriptSetupOffset ? script : scriptSetup; + const secondBlock = scriptOffset < scriptSetupOffset ? scriptSetup : script; + let scriptContent = " ".repeat(Math.min(scriptOffset, scriptSetupOffset)) + firstBlock.content; + if (secondBlock) { + scriptContent += " ".repeat(secondBlock.loc.start.offset - script.loc.end.offset) + secondBlock.content; + } + const lang = (script == null ? void 0 : script.lang) || (scriptSetup == null ? void 0 : scriptSetup.lang); + return parser$2.parse(scriptContent, { + plugins: resolveParserPlugins(lang, parserPlugins), + sourceType: "module" + }).program.body; + } + return []; +} +function ctxToScope(ctx) { + if (ctx.scope) { + return ctx.scope; + } + const body = "ast" in ctx ? ctx.ast : ctx.scriptAst ? [...ctx.scriptAst.body, ...ctx.scriptSetupAst.body] : ctx.scriptSetupAst.body; + const scope = new TypeScope( + ctx.filename, + ctx.source, + "startOffset" in ctx ? ctx.startOffset : 0, + "userImports" in ctx ? Object.create(ctx.userImports) : recordImports(body) + ); + recordTypes(ctx, body, scope); + return ctx.scope = scope; +} +function moduleDeclToScope(ctx, node, parentScope) { + if (node._resolvedChildScope) { + return node._resolvedChildScope; + } + const scope = createChildScope(parentScope); + if (node.body.type === "TSModuleDeclaration") { + const decl = node.body; + decl._ownerScope = scope; + const id = getId(decl.id); + scope.types[id] = scope.exportedTypes[id] = decl; + } else { + recordTypes(ctx, node.body.body, scope); + } + return node._resolvedChildScope = scope; +} +function createChildScope(parentScope) { + return new TypeScope( + parentScope.filename, + parentScope.source, + parentScope.offset, + Object.create(parentScope.imports), + Object.create(parentScope.types), + Object.create(parentScope.declares) + ); +} +const importExportRE = /^Import|^Export/; +function recordTypes(ctx, body, scope, asGlobal = false) { + const { types, declares, exportedTypes, exportedDeclares, imports } = scope; + const isAmbient = asGlobal ? !body.some((s) => importExportRE.test(s.type)) : false; + for (const stmt of body) { + if (asGlobal) { + if (isAmbient) { + if (stmt.declare) { + recordType(stmt, types, declares); + } + } else if (stmt.type === "TSModuleDeclaration" && stmt.global) { + for (const s of stmt.body.body) { + recordType(s, types, declares); + } + } + } else { + recordType(stmt, types, declares); + } + } + if (!asGlobal) { + for (const stmt of body) { + if (stmt.type === "ExportNamedDeclaration") { + if (stmt.declaration) { + recordType(stmt.declaration, types, declares); + recordType(stmt.declaration, exportedTypes, exportedDeclares); + } else { + for (const spec of stmt.specifiers) { + if (spec.type === "ExportSpecifier") { + const local = spec.local.name; + const exported = getId(spec.exported); + if (stmt.source) { + imports[exported] = { + source: stmt.source.value, + imported: local + }; + exportedTypes[exported] = { + type: "TSTypeReference", + typeName: { + type: "Identifier", + name: local + }, + _ownerScope: scope + }; + } else if (types[local]) { + exportedTypes[exported] = types[local]; + } + } + } + } + } else if (stmt.type === "ExportAllDeclaration") { + const sourceScope = importSourceToScope( + ctx, + stmt.source, + scope, + stmt.source.value + ); + Object.assign(scope.exportedTypes, sourceScope.exportedTypes); + } else if (stmt.type === "ExportDefaultDeclaration" && stmt.declaration) { + if (stmt.declaration.type !== "Identifier") { + recordType(stmt.declaration, types, declares, "default"); + recordType( + stmt.declaration, + exportedTypes, + exportedDeclares, + "default" + ); + } else if (types[stmt.declaration.name]) { + exportedTypes["default"] = types[stmt.declaration.name]; + } + } + } + } + for (const key of Object.keys(types)) { + const node = types[key]; + node._ownerScope = scope; + if (node._ns) node._ns._ownerScope = scope; + } + for (const key of Object.keys(declares)) { + declares[key]._ownerScope = scope; + } +} +function recordType(node, types, declares, overwriteId) { + switch (node.type) { + case "TSInterfaceDeclaration": + case "TSEnumDeclaration": + case "TSModuleDeclaration": { + const id = overwriteId || getId(node.id); + let existing = types[id]; + if (existing) { + if (node.type === "TSModuleDeclaration") { + if (existing.type === "TSModuleDeclaration") { + mergeNamespaces(existing, node); + } else { + attachNamespace(existing, node); + } + break; + } + if (existing.type === "TSModuleDeclaration") { + types[id] = node; + attachNamespace(node, existing); + break; + } + if (existing.type !== node.type) { + break; + } + if (node.type === "TSInterfaceDeclaration") { + existing.body.body.push(...node.body.body); + } else { + existing.members.push(...node.members); + } + } else { + types[id] = node; + } + break; + } + case "ClassDeclaration": + if (overwriteId || node.id) types[overwriteId || getId(node.id)] = node; + break; + case "TSTypeAliasDeclaration": + types[node.id.name] = node.typeParameters ? node : node.typeAnnotation; + break; + case "TSDeclareFunction": + if (node.id) declares[node.id.name] = node; + break; + case "VariableDeclaration": { + if (node.declare) { + for (const decl of node.declarations) { + if (decl.id.type === "Identifier" && decl.id.typeAnnotation) { + declares[decl.id.name] = decl.id.typeAnnotation.typeAnnotation; + } + } + } + break; + } + } +} +function mergeNamespaces(to, from) { + const toBody = to.body; + const fromBody = from.body; + if (toBody.type === "TSModuleDeclaration") { + if (fromBody.type === "TSModuleDeclaration") { + mergeNamespaces(toBody, fromBody); + } else { + fromBody.body.push({ + type: "ExportNamedDeclaration", + declaration: toBody, + exportKind: "type", + specifiers: [] + }); + } + } else if (fromBody.type === "TSModuleDeclaration") { + toBody.body.push({ + type: "ExportNamedDeclaration", + declaration: fromBody, + exportKind: "type", + specifiers: [] + }); + } else { + toBody.body.push(...fromBody.body); + } +} +function attachNamespace(to, ns) { + if (!to._ns) { + to._ns = ns; + } else { + mergeNamespaces(to._ns, ns); + } +} +function recordImports(body) { + const imports = /* @__PURE__ */ Object.create(null); + for (const s of body) { + recordImport(s, imports); + } + return imports; +} +function recordImport(node, imports) { + if (node.type !== "ImportDeclaration") { + return; + } + for (const s of node.specifiers) { + imports[s.local.name] = { + imported: getImportedName(s), + source: node.source.value + }; + } +} +function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx), isKeyOf = false) { + try { + switch (node.type) { + case "TSStringKeyword": + return ["String"]; + case "TSNumberKeyword": + return ["Number"]; + case "TSBooleanKeyword": + return ["Boolean"]; + case "TSObjectKeyword": + return ["Object"]; + case "TSNullKeyword": + return ["null"]; + case "TSTypeLiteral": + case "TSInterfaceDeclaration": { + const types = /* @__PURE__ */ new Set(); + const members = node.type === "TSTypeLiteral" ? node.members : node.body.body; + for (const m of members) { + if (isKeyOf) { + if (m.type === "TSPropertySignature" && m.key.type === "NumericLiteral") { + types.add("Number"); + } else if (m.type === "TSIndexSignature") { + const annotation = m.parameters[0].typeAnnotation; + if (annotation && annotation.type !== "Noop") { + const type = inferRuntimeType( + ctx, + annotation.typeAnnotation, + scope + )[0]; + if (type === UNKNOWN_TYPE) return [UNKNOWN_TYPE]; + types.add(type); + } + } else { + types.add("String"); + } + } else if (m.type === "TSCallSignatureDeclaration" || m.type === "TSConstructSignatureDeclaration") { + types.add("Function"); + } else { + types.add("Object"); + } + } + return types.size ? Array.from(types) : [isKeyOf ? UNKNOWN_TYPE : "Object"]; + } + case "TSPropertySignature": + if (node.typeAnnotation) { + return inferRuntimeType( + ctx, + node.typeAnnotation.typeAnnotation, + scope + ); + } + break; + case "TSMethodSignature": + case "TSFunctionType": + return ["Function"]; + case "TSArrayType": + case "TSTupleType": + return ["Array"]; + case "TSLiteralType": + switch (node.literal.type) { + case "StringLiteral": + return ["String"]; + case "BooleanLiteral": + return ["Boolean"]; + case "NumericLiteral": + case "BigIntLiteral": + return ["Number"]; + default: + return [UNKNOWN_TYPE]; + } + case "TSTypeReference": { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return inferRuntimeType(ctx, resolved, resolved._ownerScope, isKeyOf); + } + if (node.typeName.type === "Identifier") { + if (isKeyOf) { + switch (node.typeName.name) { + case "String": + case "Array": + case "ArrayLike": + case "Parameters": + case "ConstructorParameters": + case "ReadonlyArray": + return ["String", "Number"]; + // TS built-in utility types + case "Record": + case "Partial": + case "Required": + case "Readonly": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope, + true + ); + } + break; + case "Pick": + case "Extract": + if (node.typeParameters && node.typeParameters.params[1]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[1], + scope + ); + } + break; + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + case "Error": + case "Uppercase": + case "Lowercase": + case "Capitalize": + case "Uncapitalize": + case "ReadonlyMap": + case "ReadonlySet": + return ["String"]; + } + } else { + switch (node.typeName.name) { + case "Array": + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + case "Error": + return [node.typeName.name]; + // TS built-in utility types + // https://www.typescriptlang.org/docs/handbook/utility-types.html + case "Partial": + case "Required": + case "Readonly": + case "Record": + case "Pick": + case "Omit": + case "InstanceType": + return ["Object"]; + case "Uppercase": + case "Lowercase": + case "Capitalize": + case "Uncapitalize": + return ["String"]; + case "Parameters": + case "ConstructorParameters": + case "ReadonlyArray": + return ["Array"]; + case "ReadonlyMap": + return ["Map"]; + case "ReadonlySet": + return ["Set"]; + case "NonNullable": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope + ).filter((t) => t !== "null"); + } + break; + case "Extract": + if (node.typeParameters && node.typeParameters.params[1]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[1], + scope + ); + } + break; + case "Exclude": + case "OmitThisParameter": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope + ); + } + break; + } + } + } + break; + } + case "TSParenthesizedType": + return inferRuntimeType(ctx, node.typeAnnotation, scope); + case "TSUnionType": + return flattenTypes(ctx, node.types, scope, isKeyOf); + case "TSIntersectionType": { + return flattenTypes(ctx, node.types, scope, isKeyOf).filter( + (t) => t !== UNKNOWN_TYPE + ); + } + case "TSEnumDeclaration": + return inferEnumType(node); + case "TSSymbolKeyword": + return ["Symbol"]; + case "TSIndexedAccessType": { + const types = resolveIndexType(ctx, node, scope); + return flattenTypes(ctx, types, scope, isKeyOf); + } + case "ClassDeclaration": + return ["Object"]; + case "TSImportType": { + const sourceScope = importSourceToScope( + ctx, + node.argument, + scope, + node.argument.value + ); + const resolved = resolveTypeReference(ctx, node, sourceScope); + if (resolved) { + return inferRuntimeType(ctx, resolved, resolved._ownerScope); + } + break; + } + case "TSTypeQuery": { + const id = node.exprName; + if (id.type === "Identifier") { + const matched = scope.declares[id.name]; + if (matched) { + return inferRuntimeType(ctx, matched, matched._ownerScope, isKeyOf); + } + } + break; + } + // e.g. readonly + case "TSTypeOperator": { + return inferRuntimeType( + ctx, + node.typeAnnotation, + scope, + node.operator === "keyof" + ); + } + case "TSAnyKeyword": { + if (isKeyOf) { + return ["String", "Number", "Symbol"]; + } + break; + } + } + } catch (e) { + } + return [UNKNOWN_TYPE]; +} +function flattenTypes(ctx, types, scope, isKeyOf = false) { + if (types.length === 1) { + return inferRuntimeType(ctx, types[0], scope, isKeyOf); + } + return [ + ...new Set( + [].concat( + ...types.map((t) => inferRuntimeType(ctx, t, scope, isKeyOf)) + ) + ) + ]; +} +function inferEnumType(node) { + const types = /* @__PURE__ */ new Set(); + for (const m of node.members) { + if (m.initializer) { + switch (m.initializer.type) { + case "StringLiteral": + types.add("String"); + break; + case "NumericLiteral": + types.add("Number"); + break; + } + } + } + return types.size ? [...types] : ["Number"]; +} +function resolveExtractPropTypes({ props }, scope) { + const res = { props: {} }; + for (const key in props) { + const raw = props[key]; + res.props[key] = reverseInferType( + raw.key, + raw.typeAnnotation.typeAnnotation, + scope + ); + } + return res; +} +function reverseInferType(key, node, scope, optional = true, checkObjectSyntax = true) { + if (checkObjectSyntax && node.type === "TSTypeLiteral") { + const typeType = findStaticPropertyType(node, "type"); + if (typeType) { + const requiredType = findStaticPropertyType(node, "required"); + const optional2 = requiredType && requiredType.type === "TSLiteralType" && requiredType.literal.type === "BooleanLiteral" ? !requiredType.literal.value : true; + return reverseInferType(key, typeType, scope, optional2, false); + } + } else if (node.type === "TSTypeReference" && node.typeName.type === "Identifier") { + if (node.typeName.name.endsWith("Constructor")) { + return createProperty( + key, + ctorToType(node.typeName.name), + scope, + optional + ); + } else if (node.typeName.name === "PropType" && node.typeParameters) { + return createProperty(key, node.typeParameters.params[0], scope, optional); + } + } + if ((node.type === "TSTypeReference" || node.type === "TSImportType") && node.typeParameters) { + for (const t of node.typeParameters.params) { + const inferred = reverseInferType(key, t, scope, optional); + if (inferred) return inferred; + } + } + return createProperty(key, { type: `TSNullKeyword` }, scope, optional); +} +function ctorToType(ctorType) { + const ctor = ctorType.slice(0, -11); + switch (ctor) { + case "String": + case "Number": + case "Boolean": + return { type: `TS${ctor}Keyword` }; + case "Array": + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + return { + type: "TSTypeReference", + typeName: { type: "Identifier", name: ctor } + }; + } + return { type: `TSNullKeyword` }; +} +function findStaticPropertyType(node, key) { + const prop = node.members.find( + (m) => m.type === "TSPropertySignature" && !m.computed && getId(m.key) === key && m.typeAnnotation + ); + return prop && prop.typeAnnotation.typeAnnotation; +} +function resolveReturnType(ctx, arg, scope) { + var _a; + let resolved = arg; + if (arg.type === "TSTypeReference" || arg.type === "TSTypeQuery" || arg.type === "TSImportType") { + resolved = resolveTypeReference(ctx, arg, scope); + } + if (!resolved) return; + if (resolved.type === "TSFunctionType") { + return (_a = resolved.typeAnnotation) == null ? void 0 : _a.typeAnnotation; + } + if (resolved.type === "TSDeclareFunction") { + return resolved.returnType; + } +} +function resolveUnionType(ctx, node, scope) { + if (node.type === "TSTypeReference") { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) node = resolved; + } + let types; + if (node.type === "TSUnionType") { + types = node.types.flatMap((node2) => resolveUnionType(ctx, node2, scope)); + } else { + types = [node]; + } + return types; +} + +const DEFINE_MODEL = "defineModel"; +function processDefineModel(ctx, node, declId) { + if (!isCallOf(node, DEFINE_MODEL)) { + return false; + } + ctx.hasDefineModelCall = true; + const type = node.typeParameters && node.typeParameters.params[0] || void 0; + let modelName; + let options; + const arg0 = node.arguments[0] && CompilerDOM.unwrapTSNode(node.arguments[0]); + const hasName = arg0 && arg0.type === "StringLiteral"; + if (hasName) { + modelName = arg0.value; + options = node.arguments[1]; + } else { + modelName = "modelValue"; + options = arg0; + } + if (ctx.modelDecls[modelName]) { + ctx.error(`duplicate model name ${JSON.stringify(modelName)}`, node); + } + let optionsString = options && ctx.getString(options); + let optionsRemoved = !options; + const runtimeOptionNodes = []; + if (options && options.type === "ObjectExpression" && !options.properties.some((p) => p.type === "SpreadElement" || p.computed)) { + let removed = 0; + for (let i = options.properties.length - 1; i >= 0; i--) { + const p = options.properties[i]; + const next = options.properties[i + 1]; + const start = p.start; + const end = next ? next.start : options.end - 1; + if ((p.type === "ObjectProperty" || p.type === "ObjectMethod") && (p.key.type === "Identifier" && (p.key.name === "get" || p.key.name === "set") || p.key.type === "StringLiteral" && (p.key.value === "get" || p.key.value === "set"))) { + optionsString = optionsString.slice(0, start - options.start) + optionsString.slice(end - options.start); + } else { + removed++; + ctx.s.remove(ctx.startOffset + start, ctx.startOffset + end); + runtimeOptionNodes.push(p); + } + } + if (removed === options.properties.length) { + optionsRemoved = true; + ctx.s.remove( + ctx.startOffset + (hasName ? arg0.end : options.start), + ctx.startOffset + options.end + ); + } + } + ctx.modelDecls[modelName] = { + type, + options: optionsString, + runtimeOptionNodes, + identifier: declId && declId.type === "Identifier" ? declId.name : void 0 + }; + ctx.bindingMetadata[modelName] = "props"; + ctx.s.overwrite( + ctx.startOffset + node.callee.start, + ctx.startOffset + node.callee.end, + ctx.helper("useModel") + ); + ctx.s.appendLeft( + ctx.startOffset + (node.arguments.length ? node.arguments[0].start : node.end - 1), + `__props, ` + (hasName ? `` : `${JSON.stringify(modelName)}${optionsRemoved ? `` : `, `}`) + ); + return true; +} +function genModelProps(ctx) { + if (!ctx.hasDefineModelCall) return; + const isProd = !!ctx.options.isProd; + let modelPropsDecl = ""; + for (const [name, { type, options: runtimeOptions }] of Object.entries( + ctx.modelDecls + )) { + let skipCheck = false; + let codegenOptions = ``; + let runtimeTypes = type && inferRuntimeType(ctx, type); + if (runtimeTypes) { + const hasBoolean = runtimeTypes.includes("Boolean"); + const hasFunction = runtimeTypes.includes("Function"); + const hasUnknownType = runtimeTypes.includes(UNKNOWN_TYPE); + if (hasUnknownType) { + if (hasBoolean || hasFunction) { + runtimeTypes = runtimeTypes.filter((t) => t !== UNKNOWN_TYPE); + skipCheck = true; + } else { + runtimeTypes = ["null"]; + } + } + if (!isProd) { + codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}` + (skipCheck ? ", skipCheck: true" : ""); + } else if (hasBoolean || runtimeOptions && hasFunction) { + codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}`; + } else ; + } + let decl; + if (codegenOptions && runtimeOptions) { + decl = ctx.isTS ? `{ ${codegenOptions}, ...${runtimeOptions} }` : `Object.assign({ ${codegenOptions} }, ${runtimeOptions})`; + } else if (codegenOptions) { + decl = `{ ${codegenOptions} }`; + } else if (runtimeOptions) { + decl = runtimeOptions; + } else { + decl = `{}`; + } + modelPropsDecl += ` + ${JSON.stringify(name)}: ${decl},`; + const modifierPropName = JSON.stringify( + name === "modelValue" ? `modelModifiers` : `${name}Modifiers` + ); + modelPropsDecl += ` + ${modifierPropName}: {},`; + } + return `{${modelPropsDecl} + }`; +} + +const DEFINE_PROPS = "defineProps"; +const WITH_DEFAULTS = "withDefaults"; +function processDefineProps(ctx, node, declId, isWithDefaults = false) { + if (!isCallOf(node, DEFINE_PROPS)) { + return processWithDefaults(ctx, node, declId); + } + if (ctx.hasDefinePropsCall) { + ctx.error(`duplicate ${DEFINE_PROPS}() call`, node); + } + ctx.hasDefinePropsCall = true; + ctx.propsRuntimeDecl = node.arguments[0]; + if (ctx.propsRuntimeDecl) { + for (const key of getObjectOrArrayExpressionKeys(ctx.propsRuntimeDecl)) { + if (!(key in ctx.bindingMetadata)) { + ctx.bindingMetadata[key] = "props"; + } + } + } + if (node.typeParameters) { + if (ctx.propsRuntimeDecl) { + ctx.error( + `${DEFINE_PROPS}() cannot accept both type and non-type arguments at the same time. Use one or the other.`, + node + ); + } + ctx.propsTypeDecl = node.typeParameters.params[0]; + } + if (!isWithDefaults && declId && declId.type === "ObjectPattern") { + processPropsDestructure(ctx, declId); + } + ctx.propsCall = node; + ctx.propsDecl = declId; + return true; +} +function processWithDefaults(ctx, node, declId) { + if (!isCallOf(node, WITH_DEFAULTS)) { + return false; + } + if (!processDefineProps( + ctx, + node.arguments[0], + declId, + true + )) { + ctx.error( + `${WITH_DEFAULTS}' first argument must be a ${DEFINE_PROPS} call.`, + node.arguments[0] || node + ); + } + if (ctx.propsRuntimeDecl) { + ctx.error( + `${WITH_DEFAULTS} can only be used with type-based ${DEFINE_PROPS} declaration.`, + node + ); + } + if (declId && declId.type === "ObjectPattern") { + ctx.warn( + `${WITH_DEFAULTS}() is unnecessary when using destructure with ${DEFINE_PROPS}(). +Reactive destructure will be disabled when using withDefaults(). +Prefer using destructure default values, e.g. const { foo = 1 } = defineProps(...). `, + node.callee + ); + } + ctx.propsRuntimeDefaults = node.arguments[1]; + if (!ctx.propsRuntimeDefaults) { + ctx.error(`The 2nd argument of ${WITH_DEFAULTS} is required.`, node); + } + ctx.propsCall = node; + return true; +} +function genRuntimeProps(ctx) { + let propsDecls; + if (ctx.propsRuntimeDecl) { + propsDecls = ctx.getString(ctx.propsRuntimeDecl).trim(); + if (ctx.propsDestructureDecl) { + const defaults = []; + for (const key in ctx.propsDestructuredBindings) { + const d = genDestructuredDefaultValue(ctx, key); + const finalKey = getEscapedPropName(key); + if (d) + defaults.push( + `${finalKey}: ${d.valueString}${d.needSkipFactory ? `, __skip_${finalKey}: true` : ``}` + ); + } + if (defaults.length) { + propsDecls = `/*@__PURE__*/${ctx.helper( + `mergeDefaults` + )}(${propsDecls}, { + ${defaults.join(",\n ")} +})`; + } + } + } else if (ctx.propsTypeDecl) { + propsDecls = extractRuntimeProps(ctx); + } + const modelsDecls = genModelProps(ctx); + if (propsDecls && modelsDecls) { + return `/*@__PURE__*/${ctx.helper( + "mergeModels" + )}(${propsDecls}, ${modelsDecls})`; + } else { + return modelsDecls || propsDecls; + } +} +function extractRuntimeProps(ctx) { + const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl); + if (!props.length) { + return; + } + const propStrings = []; + const hasStaticDefaults = hasStaticWithDefaults(ctx); + for (const prop of props) { + propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults)); + if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) { + ctx.bindingMetadata[prop.key] = "props"; + } + } + let propsDecls = `{ + ${propStrings.join(",\n ")} + }`; + if (ctx.propsRuntimeDefaults && !hasStaticDefaults) { + propsDecls = `/*@__PURE__*/${ctx.helper( + "mergeDefaults" + )}(${propsDecls}, ${ctx.getString(ctx.propsRuntimeDefaults)})`; + } + return propsDecls; +} +function resolveRuntimePropsFromType(ctx, node) { + const props = []; + const elements = resolveTypeElements(ctx, node); + for (const key in elements.props) { + const e = elements.props[key]; + let type = inferRuntimeType(ctx, e); + let skipCheck = false; + if (type.includes(UNKNOWN_TYPE)) { + if (type.includes("Boolean") || type.includes("Function")) { + type = type.filter((t) => t !== UNKNOWN_TYPE); + skipCheck = true; + } else { + type = ["null"]; + } + } + props.push({ + key, + required: !e.optional, + type: type || [`null`], + skipCheck + }); + } + return props; +} +function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStaticDefaults) { + let defaultString; + const destructured = genDestructuredDefaultValue(ctx, key, type); + if (destructured) { + defaultString = `default: ${destructured.valueString}${destructured.needSkipFactory ? `, skipFactory: true` : ``}`; + } else if (hasStaticDefaults) { + const prop = ctx.propsRuntimeDefaults.properties.find( + (node) => { + if (node.type === "SpreadElement") return false; + return resolveObjectKey(node.key, node.computed) === key; + } + ); + if (prop) { + if (prop.type === "ObjectProperty") { + defaultString = `default: ${ctx.getString(prop.value)}`; + } else { + defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default() ${ctx.getString(prop.body)}`; + } + } + } + const finalKey = getEscapedPropName(key); + if (!ctx.options.isProd) { + return `${finalKey}: { ${concatStrings([ + `type: ${toRuntimeTypeString(type)}`, + `required: ${required}`, + skipCheck && "skipCheck: true", + defaultString + ])} }`; + } else if (type.some( + (el) => el === "Boolean" || (!hasStaticDefaults || defaultString) && el === "Function" + )) { + return `${finalKey}: { ${concatStrings([ + `type: ${toRuntimeTypeString(type)}`, + defaultString + ])} }`; + } else { + if (ctx.isCE) { + if (defaultString) { + return `${finalKey}: ${`{ ${defaultString}, type: ${toRuntimeTypeString( + type + )} }`}`; + } else { + return `${finalKey}: {type: ${toRuntimeTypeString(type)}}`; + } + } + return `${finalKey}: ${defaultString ? `{ ${defaultString} }` : `{}`}`; + } +} +function hasStaticWithDefaults(ctx) { + return !!(ctx.propsRuntimeDefaults && ctx.propsRuntimeDefaults.type === "ObjectExpression" && ctx.propsRuntimeDefaults.properties.every( + (node) => node.type !== "SpreadElement" && (!node.computed || node.key.type.endsWith("Literal")) + )); +} +function genDestructuredDefaultValue(ctx, key, inferredType) { + const destructured = ctx.propsDestructuredBindings[key]; + const defaultVal = destructured && destructured.default; + if (defaultVal) { + const value = ctx.getString(defaultVal); + const unwrapped = CompilerDOM.unwrapTSNode(defaultVal); + if (inferredType && inferredType.length && !inferredType.includes("null")) { + const valueType = inferValueType(unwrapped); + if (valueType && !inferredType.includes(valueType)) { + ctx.error( + `Default value of prop "${key}" does not match declared type.`, + unwrapped + ); + } + } + const needSkipFactory = !inferredType && (CompilerDOM.isFunctionType(unwrapped) || unwrapped.type === "Identifier"); + const needFactoryWrap = !needSkipFactory && !isLiteralNode(unwrapped) && !(inferredType == null ? void 0 : inferredType.includes("Function")); + return { + valueString: needFactoryWrap ? `() => (${value})` : value, + needSkipFactory + }; + } +} +function inferValueType(node) { + switch (node.type) { + case "StringLiteral": + return "String"; + case "NumericLiteral": + return "Number"; + case "BooleanLiteral": + return "Boolean"; + case "ObjectExpression": + return "Object"; + case "ArrayExpression": + return "Array"; + case "FunctionExpression": + case "ArrowFunctionExpression": + return "Function"; + } +} + +function processPropsDestructure(ctx, declId) { + if (ctx.options.propsDestructure === "error") { + ctx.error(`Props destructure is explicitly prohibited via config.`, declId); + } else if (ctx.options.propsDestructure === false) { + return; + } + ctx.propsDestructureDecl = declId; + const registerBinding = (key, local, defaultValue) => { + ctx.propsDestructuredBindings[key] = { local, default: defaultValue }; + if (local !== key) { + ctx.bindingMetadata[local] = "props-aliased"; + (ctx.bindingMetadata.__propsAliases || (ctx.bindingMetadata.__propsAliases = {}))[local] = key; + } + }; + for (const prop of declId.properties) { + if (prop.type === "ObjectProperty") { + const propKey = resolveObjectKey(prop.key, prop.computed); + if (!propKey) { + ctx.error( + `${DEFINE_PROPS}() destructure cannot use computed key.`, + prop.key + ); + } + if (prop.value.type === "AssignmentPattern") { + const { left, right } = prop.value; + if (left.type !== "Identifier") { + ctx.error( + `${DEFINE_PROPS}() destructure does not support nested patterns.`, + left + ); + } + registerBinding(propKey, left.name, right); + } else if (prop.value.type === "Identifier") { + registerBinding(propKey, prop.value.name); + } else { + ctx.error( + `${DEFINE_PROPS}() destructure does not support nested patterns.`, + prop.value + ); + } + } else { + ctx.propsDestructureRestId = prop.argument.name; + ctx.bindingMetadata[ctx.propsDestructureRestId] = "setup-reactive-const"; + } + } +} +function transformDestructuredProps(ctx, vueImportAliases) { + if (ctx.options.propsDestructure === false) { + return; + } + const rootScope = /* @__PURE__ */ Object.create(null); + const scopeStack = [rootScope]; + let currentScope = rootScope; + const excludedIds = /* @__PURE__ */ new WeakSet(); + const parentStack = []; + const propsLocalToPublicMap = /* @__PURE__ */ Object.create(null); + for (const key in ctx.propsDestructuredBindings) { + const { local } = ctx.propsDestructuredBindings[key]; + rootScope[local] = true; + propsLocalToPublicMap[local] = key; + } + function pushScope() { + scopeStack.push(currentScope = Object.create(currentScope)); + } + function popScope() { + scopeStack.pop(); + currentScope = scopeStack[scopeStack.length - 1] || null; + } + function registerLocalBinding(id) { + excludedIds.add(id); + if (currentScope) { + currentScope[id.name] = false; + } else { + ctx.error( + "registerBinding called without active scope, something is wrong.", + id + ); + } + } + function walkScope(node, isRoot = false) { + for (const stmt of node.body) { + if (stmt.type === "VariableDeclaration") { + walkVariableDeclaration(stmt, isRoot); + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + registerLocalBinding(stmt.id); + } else if ((stmt.type === "ForOfStatement" || stmt.type === "ForInStatement") && stmt.left.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.left); + } else if (stmt.type === "ExportNamedDeclaration" && stmt.declaration && stmt.declaration.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.declaration, isRoot); + } else if (stmt.type === "LabeledStatement" && stmt.body.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.body, isRoot); + } + } + } + function walkVariableDeclaration(stmt, isRoot = false) { + if (stmt.declare) { + return; + } + for (const decl of stmt.declarations) { + const isDefineProps = isRoot && decl.init && isCallOf(CompilerDOM.unwrapTSNode(decl.init), "defineProps"); + for (const id of CompilerDOM.extractIdentifiers(decl.id)) { + if (isDefineProps) { + excludedIds.add(id); + } else { + registerLocalBinding(id); + } + } + } + } + function rewriteId(id, parent, parentStack2) { + if (parent.type === "AssignmentExpression" && id === parent.left || parent.type === "UpdateExpression") { + ctx.error(`Cannot assign to destructured props as they are readonly.`, id); + } + if (CompilerDOM.isStaticProperty(parent) && parent.shorthand) { + if (!parent.inPattern || CompilerDOM.isInDestructureAssignment(parent, parentStack2)) { + ctx.s.appendLeft( + id.end + ctx.startOffset, + `: ${shared.genPropsAccessExp(propsLocalToPublicMap[id.name])}` + ); + } + } else { + ctx.s.overwrite( + id.start + ctx.startOffset, + id.end + ctx.startOffset, + shared.genPropsAccessExp(propsLocalToPublicMap[id.name]) + ); + } + } + function checkUsage(node, method, alias = method) { + if (isCallOf(node, alias)) { + const arg = CompilerDOM.unwrapTSNode(node.arguments[0]); + if (arg.type === "Identifier" && currentScope[arg.name]) { + ctx.error( + `"${arg.name}" is a destructured prop and should not be passed directly to ${method}(). Pass a getter () => ${arg.name} instead.`, + arg + ); + } + } + } + const ast = ctx.scriptSetupAst; + walkScope(ast, true); + estreeWalker.walk(ast, { + enter(node, parent) { + parent && parentStack.push(parent); + if (parent && parent.type.startsWith("TS") && !CompilerDOM.TS_NODE_TYPES.includes(parent.type)) { + return this.skip(); + } + checkUsage(node, "watch", vueImportAliases.watch); + checkUsage(node, "toRef", vueImportAliases.toRef); + if (CompilerDOM.isFunctionType(node)) { + pushScope(); + CompilerDOM.walkFunctionParams(node, registerLocalBinding); + if (node.body.type === "BlockStatement") { + walkScope(node.body); + } + return; + } + if (node.type === "CatchClause") { + pushScope(); + if (node.param && node.param.type === "Identifier") { + registerLocalBinding(node.param); + } + walkScope(node.body); + return; + } + if (node.type === "BlockStatement" && !CompilerDOM.isFunctionType(parent)) { + pushScope(); + walkScope(node); + return; + } + if (node.type === "Identifier") { + if (CompilerDOM.isReferencedIdentifier(node, parent, parentStack) && !excludedIds.has(node)) { + if (currentScope[node.name]) { + rewriteId(node, parent, parentStack); + } + } + } + }, + leave(node, parent) { + parent && parentStack.pop(); + if (node.type === "BlockStatement" && !CompilerDOM.isFunctionType(parent) || CompilerDOM.isFunctionType(node)) { + popScope(); + } + } + }); +} + +const DEFINE_EMITS = "defineEmits"; +function processDefineEmits(ctx, node, declId) { + if (!isCallOf(node, DEFINE_EMITS)) { + return false; + } + if (ctx.hasDefineEmitCall) { + ctx.error(`duplicate ${DEFINE_EMITS}() call`, node); + } + ctx.hasDefineEmitCall = true; + ctx.emitsRuntimeDecl = node.arguments[0]; + if (node.typeParameters) { + if (ctx.emitsRuntimeDecl) { + ctx.error( + `${DEFINE_EMITS}() cannot accept both type and non-type arguments at the same time. Use one or the other.`, + node + ); + } + ctx.emitsTypeDecl = node.typeParameters.params[0]; + } + ctx.emitDecl = declId; + return true; +} +function genRuntimeEmits(ctx) { + let emitsDecl = ""; + if (ctx.emitsRuntimeDecl) { + emitsDecl = ctx.getString(ctx.emitsRuntimeDecl).trim(); + } else if (ctx.emitsTypeDecl) { + const typeDeclaredEmits = extractRuntimeEmits(ctx); + emitsDecl = typeDeclaredEmits.size ? `[${Array.from(typeDeclaredEmits).map((k) => JSON.stringify(k)).join(", ")}]` : ``; + } + if (ctx.hasDefineModelCall) { + let modelEmitsDecl = `[${Object.keys(ctx.modelDecls).map((n) => JSON.stringify(`update:${n}`)).join(", ")}]`; + emitsDecl = emitsDecl ? `/*@__PURE__*/${ctx.helper( + "mergeModels" + )}(${emitsDecl}, ${modelEmitsDecl})` : modelEmitsDecl; + } + return emitsDecl; +} +function extractRuntimeEmits(ctx) { + const emits = /* @__PURE__ */ new Set(); + const node = ctx.emitsTypeDecl; + if (node.type === "TSFunctionType") { + extractEventNames(ctx, node.parameters[0], emits); + return emits; + } + const { props, calls } = resolveTypeElements(ctx, node); + let hasProperty = false; + for (const key in props) { + emits.add(key); + hasProperty = true; + } + if (calls) { + if (hasProperty) { + ctx.error( + `defineEmits() type cannot mixed call signature and property syntax.`, + node + ); + } + for (const call of calls) { + extractEventNames(ctx, call.parameters[0], emits); + } + } + return emits; +} +function extractEventNames(ctx, eventName, emits) { + if (eventName.type === "Identifier" && eventName.typeAnnotation && eventName.typeAnnotation.type === "TSTypeAnnotation") { + const types = resolveUnionType(ctx, eventName.typeAnnotation.typeAnnotation); + for (const type of types) { + if (type.type === "TSLiteralType") { + if (type.literal.type !== "UnaryExpression" && type.literal.type !== "TemplateLiteral") { + emits.add(String(type.literal.value)); + } + } + } + } +} + +const DEFINE_EXPOSE = "defineExpose"; +function processDefineExpose(ctx, node) { + if (isCallOf(node, DEFINE_EXPOSE)) { + if (ctx.hasDefineExposeCall) { + ctx.error(`duplicate ${DEFINE_EXPOSE}() call`, node); + } + ctx.hasDefineExposeCall = true; + return true; + } + return false; +} + +const DEFINE_SLOTS = "defineSlots"; +function processDefineSlots(ctx, node, declId) { + if (!isCallOf(node, DEFINE_SLOTS)) { + return false; + } + if (ctx.hasDefineSlotsCall) { + ctx.error(`duplicate ${DEFINE_SLOTS}() call`, node); + } + ctx.hasDefineSlotsCall = true; + if (node.arguments.length > 0) { + ctx.error(`${DEFINE_SLOTS}() cannot accept arguments`, node); + } + if (declId) { + ctx.s.overwrite( + ctx.startOffset + node.start, + ctx.startOffset + node.end, + `${ctx.helper("useSlots")}()` + ); + } + return true; +} + +const DEFINE_OPTIONS = "defineOptions"; +function processDefineOptions(ctx, node) { + if (!isCallOf(node, DEFINE_OPTIONS)) { + return false; + } + if (ctx.hasDefineOptionsCall) { + ctx.error(`duplicate ${DEFINE_OPTIONS}() call`, node); + } + if (node.typeParameters) { + ctx.error(`${DEFINE_OPTIONS}() cannot accept type arguments`, node); + } + if (!node.arguments[0]) return true; + ctx.hasDefineOptionsCall = true; + ctx.optionsRuntimeDecl = CompilerDOM.unwrapTSNode(node.arguments[0]); + let propsOption = void 0; + let emitsOption = void 0; + let exposeOption = void 0; + let slotsOption = void 0; + if (ctx.optionsRuntimeDecl.type === "ObjectExpression") { + for (const prop of ctx.optionsRuntimeDecl.properties) { + if ((prop.type === "ObjectProperty" || prop.type === "ObjectMethod") && prop.key.type === "Identifier") { + switch (prop.key.name) { + case "props": + propsOption = prop; + break; + case "emits": + emitsOption = prop; + break; + case "expose": + exposeOption = prop; + break; + case "slots": + slotsOption = prop; + break; + } + } + } + } + if (propsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare props. Use ${DEFINE_PROPS}() instead.`, + propsOption + ); + } + if (emitsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare emits. Use ${DEFINE_EMITS}() instead.`, + emitsOption + ); + } + if (exposeOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare expose. Use ${DEFINE_EXPOSE}() instead.`, + exposeOption + ); + } + if (slotsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare slots. Use ${DEFINE_SLOTS}() instead.`, + slotsOption + ); + } + return true; +} + +function processAwait(ctx, node, needSemi, isStatement) { + const argumentStart = node.argument.extra && node.argument.extra.parenthesized ? node.argument.extra.parenStart : node.argument.start; + const startOffset = ctx.startOffset; + const argumentStr = ctx.descriptor.source.slice( + argumentStart + startOffset, + node.argument.end + startOffset + ); + const containsNestedAwait = /\bawait\b/.test(argumentStr); + ctx.s.overwrite( + node.start + startOffset, + argumentStart + startOffset, + `${needSemi ? `;` : ``}( + ([__temp,__restore] = ${ctx.helper( + `withAsyncContext` + )}(${containsNestedAwait ? `async ` : ``}() => ` + ); + ctx.s.appendLeft( + node.end + startOffset, + `)), + ${isStatement ? `` : `__temp = `}await __temp, + __restore()${isStatement ? `` : `, + __temp`} +)` + ); +} + +const MACROS = [ + DEFINE_PROPS, + DEFINE_EMITS, + DEFINE_EXPOSE, + DEFINE_OPTIONS, + DEFINE_SLOTS, + DEFINE_MODEL, + WITH_DEFAULTS +]; +function compileScript(sfc, options) { + var _a, _b, _c; + if (!options.id) { + warnOnce( + `compileScript now requires passing the \`id\` option. +Upgrade your vite or vue-loader version for compatibility with the latest experimental proposals.` + ); + } + const ctx = new ScriptCompileContext(sfc, options); + const { script, scriptSetup, source, filename } = sfc; + const hoistStatic = options.hoistStatic !== false && !script; + const scopeId = options.id ? options.id.replace(/^data-v-/, "") : ""; + const scriptLang = script && script.lang; + const scriptSetupLang = scriptSetup && scriptSetup.lang; + if (!scriptSetup) { + if (!script) { + throw new Error(`[@vue/compiler-sfc] SFC contains no <script> tags.`); + } + return processNormalScript(ctx, scopeId); + } + if (script && scriptLang !== scriptSetupLang) { + throw new Error( + `[@vue/compiler-sfc] <script> and <script setup> must have the same language type.` + ); + } + if (scriptSetupLang && !ctx.isJS && !ctx.isTS) { + return scriptSetup; + } + const scriptBindings = /* @__PURE__ */ Object.create(null); + const setupBindings = /* @__PURE__ */ Object.create(null); + let defaultExport; + let hasAwait = false; + let hasInlinedSsrRenderFn = false; + const startOffset = ctx.startOffset; + const endOffset = ctx.endOffset; + const scriptStartOffset = script && script.loc.start.offset; + const scriptEndOffset = script && script.loc.end.offset; + function hoistNode(node) { + const start = node.start + startOffset; + let end = node.end + startOffset; + if (node.trailingComments && node.trailingComments.length > 0) { + const lastCommentNode = node.trailingComments[node.trailingComments.length - 1]; + end = lastCommentNode.end + startOffset; + } + while (end <= source.length) { + if (!/\s/.test(source.charAt(end))) { + break; + } + end++; + } + ctx.s.move(start, end, 0); + } + function registerUserImport(source2, local, imported, isType, isFromSetup, needTemplateUsageCheck) { + let isUsedInTemplate = needTemplateUsageCheck; + if (needTemplateUsageCheck && ctx.isTS && sfc.template && !sfc.template.src && !sfc.template.lang) { + isUsedInTemplate = isImportUsed(local, sfc); + } + ctx.userImports[local] = { + isType, + imported, + local, + source: source2, + isFromSetup, + isUsedInTemplate + }; + } + function checkInvalidScopeReference(node, method) { + if (!node) return; + CompilerDOM.walkIdentifiers(node, (id) => { + const binding = setupBindings[id.name]; + if (binding && binding !== "literal-const") { + ctx.error( + `\`${method}()\` in <script setup> cannot reference locally declared variables because it will be hoisted outside of the setup() function. If your component options require initialization in the module scope, use a separate normal <script> to export the options instead.`, + id + ); + } + }); + } + const scriptAst = ctx.scriptAst; + const scriptSetupAst = ctx.scriptSetupAst; + if (scriptAst) { + for (const node of scriptAst.body) { + if (node.type === "ImportDeclaration") { + for (const specifier of node.specifiers) { + const imported = getImportedName(specifier); + registerUserImport( + node.source.value, + specifier.local.name, + imported, + node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type", + false, + !options.inlineTemplate + ); + } + } + } + } + for (const node of scriptSetupAst.body) { + if (node.type === "ImportDeclaration") { + hoistNode(node); + let removed = 0; + const removeSpecifier = (i) => { + const removeLeft = i > removed; + removed++; + const current = node.specifiers[i]; + const next = node.specifiers[i + 1]; + ctx.s.remove( + removeLeft ? node.specifiers[i - 1].end + startOffset : current.start + startOffset, + next && !removeLeft ? next.start + startOffset : current.end + startOffset + ); + }; + for (let i = 0; i < node.specifiers.length; i++) { + const specifier = node.specifiers[i]; + const local = specifier.local.name; + const imported = getImportedName(specifier); + const source2 = node.source.value; + const existing = ctx.userImports[local]; + if (source2 === "vue" && MACROS.includes(imported)) { + if (local === imported) { + warnOnce( + `\`${imported}\` is a compiler macro and no longer needs to be imported.` + ); + } else { + ctx.error( + `\`${imported}\` is a compiler macro and cannot be aliased to a different name.`, + specifier + ); + } + removeSpecifier(i); + } else if (existing) { + if (existing.source === source2 && existing.imported === imported) { + removeSpecifier(i); + } else { + ctx.error( + `different imports aliased to same local name.`, + specifier + ); + } + } else { + registerUserImport( + source2, + local, + imported, + node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type", + true, + !options.inlineTemplate + ); + } + } + if (node.specifiers.length && removed === node.specifiers.length) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } + } + } + const vueImportAliases = {}; + for (const key in ctx.userImports) { + const { source: source2, imported, local } = ctx.userImports[key]; + if (source2 === "vue") vueImportAliases[imported] = local; + } + if (script && scriptAst) { + for (const node of scriptAst.body) { + if (node.type === "ExportDefaultDeclaration") { + defaultExport = node; + let optionProperties; + if (defaultExport.declaration.type === "ObjectExpression") { + optionProperties = defaultExport.declaration.properties; + } else if (defaultExport.declaration.type === "CallExpression" && defaultExport.declaration.arguments[0] && defaultExport.declaration.arguments[0].type === "ObjectExpression") { + optionProperties = defaultExport.declaration.arguments[0].properties; + } + if (optionProperties) { + for (const p of optionProperties) { + if (p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name") { + ctx.hasDefaultExportName = true; + } + if ((p.type === "ObjectMethod" || p.type === "ObjectProperty") && p.key.type === "Identifier" && p.key.name === "render") { + ctx.hasDefaultExportRender = true; + } + } + } + const start = node.start + scriptStartOffset; + const end = node.declaration.start + scriptStartOffset; + ctx.s.overwrite(start, end, `const ${normalScriptDefaultVar} = `); + } else if (node.type === "ExportNamedDeclaration") { + const defaultSpecifier = node.specifiers.find( + (s) => s.exported.type === "Identifier" && s.exported.name === "default" + ); + if (defaultSpecifier) { + defaultExport = node; + if (node.specifiers.length > 1) { + ctx.s.remove( + defaultSpecifier.start + scriptStartOffset, + defaultSpecifier.end + scriptStartOffset + ); + } else { + ctx.s.remove( + node.start + scriptStartOffset, + node.end + scriptStartOffset + ); + } + if (node.source) { + ctx.s.prepend( + `import { ${defaultSpecifier.local.name} as ${normalScriptDefaultVar} } from '${node.source.value}' +` + ); + } else { + ctx.s.appendLeft( + scriptEndOffset, + ` +const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name} +` + ); + } + } + if (node.declaration) { + walkDeclaration( + "script", + node.declaration, + scriptBindings, + vueImportAliases, + hoistStatic + ); + } + } else if ((node.type === "VariableDeclaration" || node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" || node.type === "TSEnumDeclaration") && !node.declare) { + walkDeclaration( + "script", + node, + scriptBindings, + vueImportAliases, + hoistStatic + ); + } + } + if (scriptStartOffset > startOffset) { + if (!/\n$/.test(script.content.trim())) { + ctx.s.appendLeft(scriptEndOffset, ` +`); + } + ctx.s.move(scriptStartOffset, scriptEndOffset, 0); + } + } + for (const node of scriptSetupAst.body) { + if (node.type === "ExpressionStatement") { + const expr = CompilerDOM.unwrapTSNode(node.expression); + if (processDefineProps(ctx, expr) || processDefineEmits(ctx, expr) || processDefineOptions(ctx, expr) || processDefineSlots(ctx, expr)) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } else if (processDefineExpose(ctx, expr)) { + const callee = expr.callee; + ctx.s.overwrite( + callee.start + startOffset, + callee.end + startOffset, + "__expose" + ); + } else { + processDefineModel(ctx, expr); + } + } + if (node.type === "VariableDeclaration" && !node.declare) { + const total = node.declarations.length; + let left = total; + let lastNonRemoved; + for (let i = 0; i < total; i++) { + const decl = node.declarations[i]; + const init = decl.init && CompilerDOM.unwrapTSNode(decl.init); + if (init) { + if (processDefineOptions(ctx, init)) { + ctx.error( + `${DEFINE_OPTIONS}() has no returning value, it cannot be assigned.`, + node + ); + } + const isDefineProps = processDefineProps(ctx, init, decl.id); + if (ctx.propsDestructureRestId) { + setupBindings[ctx.propsDestructureRestId] = "setup-reactive-const"; + } + const isDefineEmits = !isDefineProps && processDefineEmits(ctx, init, decl.id); + !isDefineEmits && (processDefineSlots(ctx, init, decl.id) || processDefineModel(ctx, init, decl.id)); + if (isDefineProps && !ctx.propsDestructureRestId && ctx.propsDestructureDecl) { + if (left === 1) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } else { + let start = decl.start + startOffset; + let end = decl.end + startOffset; + if (i === total - 1) { + start = node.declarations[lastNonRemoved].end + startOffset; + } else { + end = node.declarations[i + 1].start + startOffset; + } + ctx.s.remove(start, end); + left--; + } + } else if (isDefineEmits) { + ctx.s.overwrite( + startOffset + init.start, + startOffset + init.end, + "__emit" + ); + } else { + lastNonRemoved = i; + } + } + } + } + let isAllLiteral = false; + if ((node.type === "VariableDeclaration" || node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" || node.type === "TSEnumDeclaration") && !node.declare) { + isAllLiteral = walkDeclaration( + "scriptSetup", + node, + setupBindings, + vueImportAliases, + hoistStatic, + !!ctx.propsDestructureDecl + ); + } + if (hoistStatic && isAllLiteral) { + hoistNode(node); + } + if (node.type === "VariableDeclaration" && !node.declare || node.type.endsWith("Statement")) { + const scope = [scriptSetupAst.body]; + estreeWalker.walk(node, { + enter(child, parent) { + if (CompilerDOM.isFunctionType(child)) { + this.skip(); + } + if (child.type === "BlockStatement") { + scope.push(child.body); + } + if (child.type === "AwaitExpression") { + hasAwait = true; + const currentScope = scope[scope.length - 1]; + const needsSemi = currentScope.some((n, i) => { + return (scope.length === 1 || i > 0) && n.type === "ExpressionStatement" && n.start === child.start; + }); + processAwait( + ctx, + child, + needsSemi, + parent.type === "ExpressionStatement" + ); + } + }, + exit(node2) { + if (node2.type === "BlockStatement") scope.pop(); + } + }); + } + if (node.type === "ExportNamedDeclaration" && node.exportKind !== "type" || node.type === "ExportAllDeclaration" || node.type === "ExportDefaultDeclaration") { + ctx.error( + `<script setup> cannot contain ES module exports. If you are using a previous version of <script setup>, please consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.`, + node + ); + } + if (ctx.isTS) { + if (node.type.startsWith("TS") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "VariableDeclaration" && node.declare) { + if (node.type !== "TSEnumDeclaration") { + hoistNode(node); + } + } + } + } + if (ctx.propsDestructureDecl) { + transformDestructuredProps(ctx, vueImportAliases); + } + checkInvalidScopeReference(ctx.propsRuntimeDecl, DEFINE_PROPS); + checkInvalidScopeReference(ctx.propsRuntimeDefaults, DEFINE_PROPS); + checkInvalidScopeReference(ctx.propsDestructureDecl, DEFINE_PROPS); + checkInvalidScopeReference(ctx.emitsRuntimeDecl, DEFINE_EMITS); + checkInvalidScopeReference(ctx.optionsRuntimeDecl, DEFINE_OPTIONS); + for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) { + for (const node of runtimeOptionNodes) { + checkInvalidScopeReference(node, DEFINE_MODEL); + } + } + if (script) { + if (startOffset < scriptStartOffset) { + ctx.s.remove(0, startOffset); + ctx.s.remove(endOffset, scriptStartOffset); + ctx.s.remove(scriptEndOffset, source.length); + } else { + ctx.s.remove(0, scriptStartOffset); + ctx.s.remove(scriptEndOffset, startOffset); + ctx.s.remove(endOffset, source.length); + } + } else { + ctx.s.remove(0, startOffset); + ctx.s.remove(endOffset, source.length); + } + if (scriptAst) { + Object.assign(ctx.bindingMetadata, analyzeScriptBindings(scriptAst.body)); + } + for (const [key, { isType, imported, source: source2 }] of Object.entries( + ctx.userImports + )) { + if (isType) continue; + ctx.bindingMetadata[key] = imported === "*" || imported === "default" && source2.endsWith(".vue") || source2 === "vue" ? "setup-const" : "setup-maybe-ref"; + } + for (const key in scriptBindings) { + ctx.bindingMetadata[key] = scriptBindings[key]; + } + for (const key in setupBindings) { + ctx.bindingMetadata[key] = setupBindings[key]; + } + if (sfc.cssVars.length && // no need to do this when targeting SSR + !((_a = options.templateOptions) == null ? void 0 : _a.ssr)) { + ctx.helperImports.add(CSS_VARS_HELPER); + ctx.helperImports.add("unref"); + ctx.s.prependLeft( + startOffset, + ` +${genCssVarsCode( + sfc.cssVars, + ctx.bindingMetadata, + scopeId, + !!options.isProd + )} +` + ); + } + let args = `__props`; + if (ctx.propsTypeDecl) { + args += `: any`; + } + if (ctx.propsDecl) { + if (ctx.propsDestructureRestId) { + ctx.s.overwrite( + startOffset + ctx.propsCall.start, + startOffset + ctx.propsCall.end, + `${ctx.helper(`createPropsRestProxy`)}(__props, ${JSON.stringify( + Object.keys(ctx.propsDestructuredBindings) + )})` + ); + ctx.s.overwrite( + startOffset + ctx.propsDestructureDecl.start, + startOffset + ctx.propsDestructureDecl.end, + ctx.propsDestructureRestId + ); + } else if (!ctx.propsDestructureDecl) { + ctx.s.overwrite( + startOffset + ctx.propsCall.start, + startOffset + ctx.propsCall.end, + "__props" + ); + } + } + if (hasAwait) { + const any = ctx.isTS ? `: any` : ``; + ctx.s.prependLeft(startOffset, ` +let __temp${any}, __restore${any} +`); + } + const destructureElements = ctx.hasDefineExposeCall || !options.inlineTemplate ? [`expose: __expose`] : []; + if (ctx.emitDecl) { + destructureElements.push(`emit: __emit`); + } + if (destructureElements.length) { + args += `, { ${destructureElements.join(", ")} }`; + } + let returned; + if (!options.inlineTemplate || !sfc.template && ctx.hasDefaultExportRender) { + const allBindings = { + ...scriptBindings, + ...setupBindings + }; + for (const key in ctx.userImports) { + if (!ctx.userImports[key].isType && ctx.userImports[key].isUsedInTemplate) { + allBindings[key] = true; + } + } + returned = `{ `; + for (const key in allBindings) { + if (allBindings[key] === true && ctx.userImports[key].source !== "vue" && !ctx.userImports[key].source.endsWith(".vue")) { + returned += `get ${key}() { return ${key} }, `; + } else if (ctx.bindingMetadata[key] === "setup-let") { + const setArg = key === "v" ? `_v` : `v`; + returned += `get ${key}() { return ${key} }, set ${key}(${setArg}) { ${key} = ${setArg} }, `; + } else { + returned += `${key}, `; + } + } + returned = returned.replace(/, $/, "") + ` }`; + } else { + if (sfc.template && !sfc.template.src) { + if (options.templateOptions && options.templateOptions.ssr) { + hasInlinedSsrRenderFn = true; + } + const { code, ast, preamble, tips, errors } = compileTemplate({ + filename, + ast: sfc.template.ast, + source: sfc.template.content, + inMap: sfc.template.map, + ...options.templateOptions, + id: scopeId, + scoped: sfc.styles.some((s) => s.scoped), + isProd: options.isProd, + ssrCssVars: sfc.cssVars, + compilerOptions: { + ...options.templateOptions && options.templateOptions.compilerOptions, + inline: true, + isTS: ctx.isTS, + bindingMetadata: ctx.bindingMetadata + } + }); + if (tips.length) { + tips.forEach(warnOnce); + } + const err = errors[0]; + if (typeof err === "string") { + throw new Error(err); + } else if (err) { + if (err.loc) { + err.message += ` + +` + sfc.filename + "\n" + shared.generateCodeFrame( + source, + err.loc.start.offset, + err.loc.end.offset + ) + ` +`; + } + throw err; + } + if (preamble) { + ctx.s.prepend(preamble); + } + if (ast && ast.helpers.has(CompilerDOM.UNREF)) { + ctx.helperImports.delete("unref"); + } + returned = code; + } else { + returned = `() => {}`; + } + } + if (!options.inlineTemplate && true) { + ctx.s.appendRight( + endOffset, + ` +const __returned__ = ${returned} +Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true }) +return __returned__ +} + +` + ); + } else { + ctx.s.appendRight(endOffset, ` +return ${returned} +} + +`); + } + const genDefaultAs = options.genDefaultAs ? `const ${options.genDefaultAs} =` : `export default`; + let runtimeOptions = ``; + if (!ctx.hasDefaultExportName && filename && filename !== DEFAULT_FILENAME) { + const match = filename.match(/([^/\\]+)\.\w+$/); + if (match) { + runtimeOptions += ` + __name: '${match[1]}',`; + } + } + if (hasInlinedSsrRenderFn) { + runtimeOptions += ` + __ssrInlineRender: true,`; + } + const propsDecl = genRuntimeProps(ctx); + if (propsDecl) runtimeOptions += ` + props: ${propsDecl},`; + const emitsDecl = genRuntimeEmits(ctx); + if (emitsDecl) runtimeOptions += ` + emits: ${emitsDecl},`; + let definedOptions = ""; + if (ctx.optionsRuntimeDecl) { + definedOptions = scriptSetup.content.slice(ctx.optionsRuntimeDecl.start, ctx.optionsRuntimeDecl.end).trim(); + } + const exposeCall = ctx.hasDefineExposeCall || options.inlineTemplate ? `` : ` __expose(); +`; + if (ctx.isTS) { + const def = (defaultExport ? ` + ...${normalScriptDefaultVar},` : ``) + (definedOptions ? ` + ...${definedOptions},` : ""); + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} /*@__PURE__*/${ctx.helper( + `defineComponent` + )}({${def}${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `})`); + } else { + if (defaultExport || definedOptions) { + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} /*@__PURE__*/Object.assign(${defaultExport ? `${normalScriptDefaultVar}, ` : ""}${definedOptions ? `${definedOptions}, ` : ""}{${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `})`); + } else { + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} {${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `}`); + } + } + if (ctx.helperImports.size > 0) { + const runtimeModuleName = (_c = (_b = options.templateOptions) == null ? void 0 : _b.compilerOptions) == null ? void 0 : _c.runtimeModuleName; + const importSrc = runtimeModuleName ? JSON.stringify(runtimeModuleName) : `'vue'`; + ctx.s.prepend( + `import { ${[...ctx.helperImports].map((h) => `${h} as _${h}`).join(", ")} } from ${importSrc} +` + ); + } + return { + ...scriptSetup, + bindings: ctx.bindingMetadata, + imports: ctx.userImports, + content: ctx.s.toString(), + map: options.sourceMap !== false ? ctx.s.generateMap({ + source: filename, + hires: true, + includeContent: true + }) : void 0, + scriptAst: scriptAst == null ? void 0 : scriptAst.body, + scriptSetupAst: scriptSetupAst == null ? void 0 : scriptSetupAst.body, + deps: ctx.deps ? [...ctx.deps] : void 0 + }; +} +function registerBinding(bindings, node, type) { + bindings[node.name] = type; +} +function walkDeclaration(from, node, bindings, userImportAliases, hoistStatic, isPropsDestructureEnabled = false) { + let isAllLiteral = false; + if (node.type === "VariableDeclaration") { + const isConst = node.kind === "const"; + isAllLiteral = isConst && node.declarations.every( + (decl) => decl.id.type === "Identifier" && isStaticNode(decl.init) + ); + for (const { id, init: _init } of node.declarations) { + const init = _init && CompilerDOM.unwrapTSNode(_init); + const isConstMacroCall = isConst && isCallOf( + init, + (c) => c === DEFINE_PROPS || c === DEFINE_EMITS || c === WITH_DEFAULTS || c === DEFINE_SLOTS + ); + if (id.type === "Identifier") { + let bindingType; + const userReactiveBinding = userImportAliases["reactive"]; + if ((hoistStatic || from === "script") && (isAllLiteral || isConst && isStaticNode(init))) { + bindingType = "literal-const"; + } else if (isCallOf(init, userReactiveBinding)) { + bindingType = isConst ? "setup-reactive-const" : "setup-let"; + } else if ( + // if a declaration is a const literal, we can mark it so that + // the generated render fn code doesn't need to unref() it + isConstMacroCall || isConst && canNeverBeRef(init, userReactiveBinding) + ) { + bindingType = isCallOf(init, DEFINE_PROPS) ? "setup-reactive-const" : "setup-const"; + } else if (isConst) { + if (isCallOf( + init, + (m) => m === userImportAliases["ref"] || m === userImportAliases["computed"] || m === userImportAliases["shallowRef"] || m === userImportAliases["customRef"] || m === userImportAliases["toRef"] || m === DEFINE_MODEL + )) { + bindingType = "setup-ref"; + } else { + bindingType = "setup-maybe-ref"; + } + } else { + bindingType = "setup-let"; + } + registerBinding(bindings, id, bindingType); + } else { + if (isCallOf(init, DEFINE_PROPS) && isPropsDestructureEnabled) { + continue; + } + if (id.type === "ObjectPattern") { + walkObjectPattern(id, bindings, isConst, isConstMacroCall); + } else if (id.type === "ArrayPattern") { + walkArrayPattern(id, bindings, isConst, isConstMacroCall); + } + } + } + } else if (node.type === "TSEnumDeclaration") { + isAllLiteral = node.members.every( + (member) => !member.initializer || isStaticNode(member.initializer) + ); + bindings[node.id.name] = isAllLiteral ? "literal-const" : "setup-const"; + } else if (node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") { + bindings[node.id.name] = "setup-const"; + } + return isAllLiteral; +} +function walkObjectPattern(node, bindings, isConst, isDefineCall = false) { + for (const p of node.properties) { + if (p.type === "ObjectProperty") { + if (p.key.type === "Identifier" && p.key === p.value) { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, p.key, type); + } else { + walkPattern(p.value, bindings, isConst, isDefineCall); + } + } else { + const type = isConst ? "setup-const" : "setup-let"; + registerBinding(bindings, p.argument, type); + } + } +} +function walkArrayPattern(node, bindings, isConst, isDefineCall = false) { + for (const e of node.elements) { + e && walkPattern(e, bindings, isConst, isDefineCall); + } +} +function walkPattern(node, bindings, isConst, isDefineCall = false) { + if (node.type === "Identifier") { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, node, type); + } else if (node.type === "RestElement") { + const type = isConst ? "setup-const" : "setup-let"; + registerBinding(bindings, node.argument, type); + } else if (node.type === "ObjectPattern") { + walkObjectPattern(node, bindings, isConst); + } else if (node.type === "ArrayPattern") { + walkArrayPattern(node, bindings, isConst); + } else if (node.type === "AssignmentPattern") { + if (node.left.type === "Identifier") { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, node.left, type); + } else { + walkPattern(node.left, bindings, isConst); + } + } +} +function canNeverBeRef(node, userReactiveImport) { + if (isCallOf(node, userReactiveImport)) { + return true; + } + switch (node.type) { + case "UnaryExpression": + case "BinaryExpression": + case "ArrayExpression": + case "ObjectExpression": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "UpdateExpression": + case "ClassExpression": + case "TaggedTemplateExpression": + return true; + case "SequenceExpression": + return canNeverBeRef( + node.expressions[node.expressions.length - 1], + userReactiveImport + ); + default: + if (isLiteralNode(node)) { + return true; + } + return false; + } +} +function isStaticNode(node) { + node = CompilerDOM.unwrapTSNode(node); + switch (node.type) { + case "UnaryExpression": + return isStaticNode(node.argument); + case "LogicalExpression": + // 1 > 2 + case "BinaryExpression": + return isStaticNode(node.left) && isStaticNode(node.right); + case "ConditionalExpression": { + return isStaticNode(node.test) && isStaticNode(node.consequent) && isStaticNode(node.alternate); + } + case "SequenceExpression": + // (1, 2) + case "TemplateLiteral": + return node.expressions.every((expr) => isStaticNode(expr)); + case "ParenthesizedExpression": + return isStaticNode(node.expression); + case "StringLiteral": + case "NumericLiteral": + case "BooleanLiteral": + case "NullLiteral": + case "BigIntLiteral": + return true; + } + return false; +} + +const version = "3.5.13"; +const parseCache = parseCache$1; +const errorMessages = { + ...CompilerDOM.errorMessages, + ...CompilerDOM.DOMErrorMessages +}; +const walk = estreeWalker.walk; +const shouldTransformRef = () => false; + +exports.extractIdentifiers = compilerCore.extractIdentifiers; +exports.generateCodeFrame = compilerCore.generateCodeFrame; +exports.isInDestructureAssignment = compilerCore.isInDestructureAssignment; +exports.isStaticProperty = compilerCore.isStaticProperty; +exports.walkIdentifiers = compilerCore.walkIdentifiers; +exports.MagicString = MagicString; +exports.babelParse = parser$2.parse; +exports.compileScript = compileScript; +exports.compileStyle = compileStyle; +exports.compileStyleAsync = compileStyleAsync; +exports.compileTemplate = compileTemplate; +exports.errorMessages = errorMessages; +exports.extractRuntimeEmits = extractRuntimeEmits; +exports.extractRuntimeProps = extractRuntimeProps; +exports.inferRuntimeType = inferRuntimeType; +exports.invalidateTypeCache = invalidateTypeCache; +exports.parse = parse$1; +exports.parseCache = parseCache; +exports.registerTS = registerTS; +exports.resolveTypeElements = resolveTypeElements; +exports.rewriteDefault = rewriteDefault; +exports.rewriteDefaultAST = rewriteDefaultAST; +exports.shouldTransformRef = shouldTransformRef; +exports.version = version; +exports.walk = walk; diff --git a/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts new file mode 100644 index 0000000..3b9d50c --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts @@ -0,0 +1,484 @@ +import * as _babel_types from '@babel/types'; +import { Statement, Expression, TSType, Node, Program, CallExpression, ObjectPattern, TSModuleDeclaration, TSPropertySignature, TSMethodSignature, TSCallSignatureDeclaration, TSFunctionType } from '@babel/types'; +import { RootNode, CompilerOptions, CodegenResult, ParserOptions, CompilerError, RawSourceMap, SourceLocation, BindingMetadata as BindingMetadata$1 } from '@vue/compiler-core'; +export { BindingMetadata, CompilerError, CompilerOptions, extractIdentifiers, generateCodeFrame, isInDestructureAssignment, isStaticProperty, walkIdentifiers } from '@vue/compiler-core'; +import { ParserPlugin } from '@babel/parser'; +export { parse as babelParse } from '@babel/parser'; +import { Result, LazyResult } from 'postcss'; +import MagicString from 'magic-string'; +export { default as MagicString } from 'magic-string'; +import TS from 'typescript'; + +export interface AssetURLTagConfig { + [name: string]: string[]; +} +export interface AssetURLOptions { + /** + * If base is provided, instead of transforming relative asset urls into + * imports, they will be directly rewritten to absolute urls. + */ + base?: string | null; + /** + * If true, also processes absolute urls. + */ + includeAbsolute?: boolean; + tags?: AssetURLTagConfig; +} + +export interface TemplateCompiler { + compile(source: string | RootNode, options: CompilerOptions): CodegenResult; + parse(template: string, options: ParserOptions): RootNode; +} +export interface SFCTemplateCompileResults { + code: string; + ast?: RootNode; + preamble?: string; + source: string; + tips: string[]; + errors: (string | CompilerError)[]; + map?: RawSourceMap; +} +export interface SFCTemplateCompileOptions { + source: string; + ast?: RootNode; + filename: string; + id: string; + scoped?: boolean; + slotted?: boolean; + isProd?: boolean; + ssr?: boolean; + ssrCssVars?: string[]; + inMap?: RawSourceMap; + compiler?: TemplateCompiler; + compilerOptions?: CompilerOptions; + preprocessLang?: string; + preprocessOptions?: any; + /** + * In some cases, compiler-sfc may not be inside the project root (e.g. when + * linked or globally installed). In such cases a custom `require` can be + * passed to correctly resolve the preprocessors. + */ + preprocessCustomRequire?: (id: string) => any; + /** + * Configure what tags/attributes to transform into asset url imports, + * or disable the transform altogether with `false`. + */ + transformAssetUrls?: AssetURLOptions | AssetURLTagConfig | boolean; +} +export declare function compileTemplate(options: SFCTemplateCompileOptions): SFCTemplateCompileResults; + +export interface SFCScriptCompileOptions { + /** + * Scope ID for prefixing injected CSS variables. + * This must be consistent with the `id` passed to `compileStyle`. + */ + id: string; + /** + * Production mode. Used to determine whether to generate hashed CSS variables + */ + isProd?: boolean; + /** + * Enable/disable source map. Defaults to true. + */ + sourceMap?: boolean; + /** + * https://babeljs.io/docs/en/babel-parser#plugins + */ + babelParserPlugins?: ParserPlugin[]; + /** + * A list of files to parse for global types to be made available for type + * resolving in SFC macros. The list must be fully resolved file system paths. + */ + globalTypeFiles?: string[]; + /** + * Compile the template and inline the resulting render function + * directly inside setup(). + * - Only affects `<script setup>` + * - This should only be used in production because it prevents the template + * from being hot-reloaded separately from component state. + */ + inlineTemplate?: boolean; + /** + * Generate the final component as a variable instead of default export. + * This is useful in e.g. @vitejs/plugin-vue where the script needs to be + * placed inside the main module. + */ + genDefaultAs?: string; + /** + * Options for template compilation when inlining. Note these are options that + * would normally be passed to `compiler-sfc`'s own `compileTemplate()`, not + * options passed to `compiler-dom`. + */ + templateOptions?: Partial<SFCTemplateCompileOptions>; + /** + * Hoist <script setup> static constants. + * - Only enables when one `<script setup>` exists. + * @default true + */ + hoistStatic?: boolean; + /** + * Set to `false` to disable reactive destructure for `defineProps` (pre-3.5 + * behavior), or set to `'error'` to throw hard error on props destructures. + * @default true + */ + propsDestructure?: boolean | 'error'; + /** + * File system access methods to be used when resolving types + * imported in SFC macros. Defaults to ts.sys in Node.js, can be overwritten + * to use a virtual file system for use in browsers (e.g. in REPLs) + */ + fs?: { + fileExists(file: string): boolean; + readFile(file: string): string | undefined; + realpath?(file: string): string; + }; + /** + * Transform Vue SFCs into custom elements. + */ + customElement?: boolean | ((filename: string) => boolean); +} +interface ImportBinding { + isType: boolean; + imported: string; + local: string; + source: string; + isFromSetup: boolean; + isUsedInTemplate: boolean; +} +/** + * Compile `<script setup>` + * It requires the whole SFC descriptor because we need to handle and merge + * normal `<script>` + `<script setup>` if both are present. + */ +export declare function compileScript(sfc: SFCDescriptor, options: SFCScriptCompileOptions): SFCScriptBlock; + +export interface SFCParseOptions { + filename?: string; + sourceMap?: boolean; + sourceRoot?: string; + pad?: boolean | 'line' | 'space'; + ignoreEmpty?: boolean; + compiler?: TemplateCompiler; + templateParseOptions?: ParserOptions; +} +export interface SFCBlock { + type: string; + content: string; + attrs: Record<string, string | true>; + loc: SourceLocation; + map?: RawSourceMap; + lang?: string; + src?: string; +} +export interface SFCTemplateBlock extends SFCBlock { + type: 'template'; + ast?: RootNode; +} +export interface SFCScriptBlock extends SFCBlock { + type: 'script'; + setup?: string | boolean; + bindings?: BindingMetadata$1; + imports?: Record<string, ImportBinding>; + scriptAst?: _babel_types.Statement[]; + scriptSetupAst?: _babel_types.Statement[]; + warnings?: string[]; + /** + * Fully resolved dependency file paths (unix slashes) with imported types + * used in macros, used for HMR cache busting in @vitejs/plugin-vue and + * vue-loader. + */ + deps?: string[]; +} +export interface SFCStyleBlock extends SFCBlock { + type: 'style'; + scoped?: boolean; + module?: string | boolean; +} +export interface SFCDescriptor { + filename: string; + source: string; + template: SFCTemplateBlock | null; + script: SFCScriptBlock | null; + scriptSetup: SFCScriptBlock | null; + styles: SFCStyleBlock[]; + customBlocks: SFCBlock[]; + cssVars: string[]; + /** + * whether the SFC uses :slotted() modifier. + * this is used as a compiler optimization hint. + */ + slotted: boolean; + /** + * compare with an existing descriptor to determine whether HMR should perform + * a reload vs. re-render. + * + * Note: this comparison assumes the prev/next script are already identical, + * and only checks the special case where <script setup lang="ts"> unused import + * pruning result changes due to template changes. + */ + shouldForceReload: (prevImports: Record<string, ImportBinding>) => boolean; +} +export interface SFCParseResult { + descriptor: SFCDescriptor; + errors: (CompilerError | SyntaxError)[]; +} +export declare function parse(source: string, options?: SFCParseOptions): SFCParseResult; + +type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus'; + +export interface SFCStyleCompileOptions { + source: string; + filename: string; + id: string; + scoped?: boolean; + trim?: boolean; + isProd?: boolean; + inMap?: RawSourceMap; + preprocessLang?: PreprocessLang; + preprocessOptions?: any; + preprocessCustomRequire?: (id: string) => any; + postcssOptions?: any; + postcssPlugins?: any[]; + /** + * @deprecated use `inMap` instead. + */ + map?: RawSourceMap; +} +/** + * Aligns with postcss-modules + * https://github.com/css-modules/postcss-modules + */ +interface CSSModulesOptions { + scopeBehaviour?: 'global' | 'local'; + generateScopedName?: string | ((name: string, filename: string, css: string) => string); + hashPrefix?: string; + localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly'; + exportGlobals?: boolean; + globalModulePaths?: RegExp[]; +} +export interface SFCAsyncStyleCompileOptions extends SFCStyleCompileOptions { + isAsync?: boolean; + modules?: boolean; + modulesOptions?: CSSModulesOptions; +} +export interface SFCStyleCompileResults { + code: string; + map: RawSourceMap | undefined; + rawResult: Result | LazyResult | undefined; + errors: Error[]; + modules?: Record<string, string>; + dependencies: Set<string>; +} +export declare function compileStyle(options: SFCStyleCompileOptions): SFCStyleCompileResults; +export declare function compileStyleAsync(options: SFCAsyncStyleCompileOptions): Promise<SFCStyleCompileResults>; + +export declare function rewriteDefault(input: string, as: string, parserPlugins?: ParserPlugin[]): string; +/** + * Utility for rewriting `export default` in a script block into a variable + * declaration so that we can inject things into it + */ +export declare function rewriteDefaultAST(ast: Statement[], s: MagicString, as: string): void; + +type PropsDestructureBindings = Record<string, // public prop key +{ + local: string; + default?: Expression; +}>; +export declare function extractRuntimeProps(ctx: TypeResolveContext): string | undefined; + +interface ModelDecl { + type: TSType | undefined; + options: string | undefined; + identifier: string | undefined; + runtimeOptionNodes: Node[]; +} + +declare enum BindingTypes { + /** + * returned from data() + */ + DATA = "data", + /** + * declared as a prop + */ + PROPS = "props", + /** + * a local alias of a `<script setup>` destructured prop. + * the original is stored in __propsAliases of the bindingMetadata object. + */ + PROPS_ALIASED = "props-aliased", + /** + * a let binding (may or may not be a ref) + */ + SETUP_LET = "setup-let", + /** + * a const binding that can never be a ref. + * these bindings don't need `unref()` calls when processed in inlined + * template expressions. + */ + SETUP_CONST = "setup-const", + /** + * a const binding that does not need `unref()`, but may be mutated. + */ + SETUP_REACTIVE_CONST = "setup-reactive-const", + /** + * a const binding that may be a ref. + */ + SETUP_MAYBE_REF = "setup-maybe-ref", + /** + * bindings that are guaranteed to be refs + */ + SETUP_REF = "setup-ref", + /** + * declared by other options, e.g. computed, inject + */ + OPTIONS = "options", + /** + * a literal constant, e.g. 'foo', 1, true + */ + LITERAL_CONST = "literal-const" +} +type BindingMetadata = { + [key: string]: BindingTypes | undefined; +} & { + __isScriptSetup?: boolean; + __propsAliases?: Record<string, string>; +}; + +export declare class ScriptCompileContext { + descriptor: SFCDescriptor; + options: Partial<SFCScriptCompileOptions>; + isJS: boolean; + isTS: boolean; + isCE: boolean; + scriptAst: Program | null; + scriptSetupAst: Program | null; + source: string; + filename: string; + s: MagicString; + startOffset: number | undefined; + endOffset: number | undefined; + scope?: TypeScope; + globalScopes?: TypeScope[]; + userImports: Record<string, ImportBinding>; + hasDefinePropsCall: boolean; + hasDefineEmitCall: boolean; + hasDefineExposeCall: boolean; + hasDefaultExportName: boolean; + hasDefaultExportRender: boolean; + hasDefineOptionsCall: boolean; + hasDefineSlotsCall: boolean; + hasDefineModelCall: boolean; + propsCall: CallExpression | undefined; + propsDecl: Node | undefined; + propsRuntimeDecl: Node | undefined; + propsTypeDecl: Node | undefined; + propsDestructureDecl: ObjectPattern | undefined; + propsDestructuredBindings: PropsDestructureBindings; + propsDestructureRestId: string | undefined; + propsRuntimeDefaults: Node | undefined; + emitsRuntimeDecl: Node | undefined; + emitsTypeDecl: Node | undefined; + emitDecl: Node | undefined; + modelDecls: Record<string, ModelDecl>; + optionsRuntimeDecl: Node | undefined; + bindingMetadata: BindingMetadata; + helperImports: Set<string>; + helper(key: string): string; + /** + * to be exposed on compiled script block for HMR cache busting + */ + deps?: Set<string>; + /** + * cache for resolved fs + */ + fs?: NonNullable<SFCScriptCompileOptions['fs']>; + constructor(descriptor: SFCDescriptor, options: Partial<SFCScriptCompileOptions>); + getString(node: Node, scriptSetup?: boolean): string; + warn(msg: string, node: Node, scope?: TypeScope): void; + error(msg: string, node: Node, scope?: TypeScope): never; +} + +export type SimpleTypeResolveOptions = Partial<Pick<SFCScriptCompileOptions, 'globalTypeFiles' | 'fs' | 'babelParserPlugins' | 'isProd'>>; +/** + * TypeResolveContext is compatible with ScriptCompileContext + * but also allows a simpler version of it with minimal required properties + * when resolveType needs to be used in a non-SFC context, e.g. in a babel + * plugin. The simplest context can be just: + * ```ts + * const ctx: SimpleTypeResolveContext = { + * filename: '...', + * source: '...', + * options: {}, + * error() {}, + * ast: [] + * } + * ``` + */ +export type SimpleTypeResolveContext = Pick<ScriptCompileContext, 'source' | 'filename' | 'error' | 'helper' | 'getString' | 'propsTypeDecl' | 'propsRuntimeDefaults' | 'propsDestructuredBindings' | 'emitsTypeDecl' | 'isCE'> & Partial<Pick<ScriptCompileContext, 'scope' | 'globalScopes' | 'deps' | 'fs'>> & { + ast: Statement[]; + options: SimpleTypeResolveOptions; +}; +export type TypeResolveContext = ScriptCompileContext | SimpleTypeResolveContext; +type Import = Pick<ImportBinding, 'source' | 'imported'>; +interface WithScope { + _ownerScope: TypeScope; +} +type ScopeTypeNode = Node & WithScope & { + _ns?: TSModuleDeclaration & WithScope; +}; +declare class TypeScope { + filename: string; + source: string; + offset: number; + imports: Record<string, Import>; + types: Record<string, ScopeTypeNode>; + declares: Record<string, ScopeTypeNode>; + constructor(filename: string, source: string, offset?: number, imports?: Record<string, Import>, types?: Record<string, ScopeTypeNode>, declares?: Record<string, ScopeTypeNode>); + isGenericScope: boolean; + resolvedImportSources: Record<string, string>; + exportedTypes: Record<string, ScopeTypeNode>; + exportedDeclares: Record<string, ScopeTypeNode>; +} +interface MaybeWithScope { + _ownerScope?: TypeScope; +} +interface ResolvedElements { + props: Record<string, (TSPropertySignature | TSMethodSignature) & { + _ownerScope: TypeScope; + }>; + calls?: (TSCallSignatureDeclaration | TSFunctionType)[]; +} +/** + * Resolve arbitrary type node to a list of type elements that can be then + * mapped to runtime props or emits. + */ +export declare function resolveTypeElements(ctx: TypeResolveContext, node: Node & MaybeWithScope & { + _resolvedElements?: ResolvedElements; +}, scope?: TypeScope, typeParameters?: Record<string, Node>): ResolvedElements; +/** + * @private + */ +export declare function registerTS(_loadTS: () => typeof TS): void; +/** + * @private + */ +export declare function invalidateTypeCache(filename: string): void; +export declare function inferRuntimeType(ctx: TypeResolveContext, node: Node & MaybeWithScope, scope?: TypeScope, isKeyOf?: boolean): string[]; + +export declare function extractRuntimeEmits(ctx: TypeResolveContext): Set<string>; + +export declare const version: string; + +export declare const parseCache: Map<string, SFCParseResult>; +export declare const errorMessages: Record<number, string>; + +export declare const walk: any; + +/** + * @deprecated this is preserved to avoid breaking vite-plugin-vue < 5.0 + * with reactivityTransform: true. The desired behavior should be silently + * ignoring the option instead of breaking. + */ +export declare const shouldTransformRef: () => boolean; + diff --git a/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js new file mode 100644 index 0000000..a7cf8b0 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js @@ -0,0 +1,53043 @@ +/** +* @vue/compiler-sfc v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const extend = Object.assign; +const hasOwnProperty$3 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$3.call(val, key); +const isArray$3 = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isFunction$1 = (val) => typeof val === "function"; +const isString$1 = (val) => typeof val === "string"; +const isSymbol$1 = (val) => typeof val === "symbol"; +const isObject$2 = (val) => val !== null && typeof val === "object"; +const objectToString$1 = Object.prototype.toString; +const toTypeString = (value) => objectToString$1.call(value); +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name) { + return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; +} +function genCacheKey(source, options) { + return source + JSON.stringify( + options, + (_, val) => typeof val === "function" ? val.toString() : val + ); +} + +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +function normalizeStyle(value) { + if (isArray$3(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString$1(value) || isObject$2(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString$1(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString$1(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString$1(value)) { + res = value; + } else if (isArray$3(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject$2(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +const isKnownMathMLAttr = /* @__PURE__ */ makeMap( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.slice(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} + +const isRef = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString$1(val) ? val : val == null ? "" : isArray$3(val) || isObject$2(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol$1(val)) { + return stringifySymbol(val); + } else if (isObject$2(val) && !isArray$3(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol$1(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +const FRAGMENT = Symbol(`Fragment` ); +const TELEPORT = Symbol(`Teleport` ); +const SUSPENSE = Symbol(`Suspense` ); +const KEEP_ALIVE = Symbol(`KeepAlive` ); +const BASE_TRANSITION = Symbol( + `BaseTransition` +); +const OPEN_BLOCK = Symbol(`openBlock` ); +const CREATE_BLOCK = Symbol(`createBlock` ); +const CREATE_ELEMENT_BLOCK = Symbol( + `createElementBlock` +); +const CREATE_VNODE = Symbol(`createVNode` ); +const CREATE_ELEMENT_VNODE = Symbol( + `createElementVNode` +); +const CREATE_COMMENT = Symbol( + `createCommentVNode` +); +const CREATE_TEXT = Symbol( + `createTextVNode` +); +const CREATE_STATIC = Symbol( + `createStaticVNode` +); +const RESOLVE_COMPONENT = Symbol( + `resolveComponent` +); +const RESOLVE_DYNAMIC_COMPONENT = Symbol( + `resolveDynamicComponent` +); +const RESOLVE_DIRECTIVE = Symbol( + `resolveDirective` +); +const RESOLVE_FILTER = Symbol( + `resolveFilter` +); +const WITH_DIRECTIVES = Symbol( + `withDirectives` +); +const RENDER_LIST = Symbol(`renderList` ); +const RENDER_SLOT = Symbol(`renderSlot` ); +const CREATE_SLOTS = Symbol(`createSlots` ); +const TO_DISPLAY_STRING = Symbol( + `toDisplayString` +); +const MERGE_PROPS = Symbol(`mergeProps` ); +const NORMALIZE_CLASS = Symbol( + `normalizeClass` +); +const NORMALIZE_STYLE = Symbol( + `normalizeStyle` +); +const NORMALIZE_PROPS = Symbol( + `normalizeProps` +); +const GUARD_REACTIVE_PROPS = Symbol( + `guardReactiveProps` +); +const TO_HANDLERS = Symbol(`toHandlers` ); +const CAMELIZE = Symbol(`camelize` ); +const CAPITALIZE = Symbol(`capitalize` ); +const TO_HANDLER_KEY = Symbol( + `toHandlerKey` +); +const SET_BLOCK_TRACKING = Symbol( + `setBlockTracking` +); +const PUSH_SCOPE_ID = Symbol(`pushScopeId` ); +const POP_SCOPE_ID = Symbol(`popScopeId` ); +const WITH_CTX = Symbol(`withCtx` ); +const UNREF = Symbol(`unref` ); +const IS_REF = Symbol(`isRef` ); +const WITH_MEMO = Symbol(`withMemo` ); +const IS_MEMO_SAME = Symbol(`isMemoSame` ); +const helperNameMap = { + [FRAGMENT]: `Fragment`, + [TELEPORT]: `Teleport`, + [SUSPENSE]: `Suspense`, + [KEEP_ALIVE]: `KeepAlive`, + [BASE_TRANSITION]: `BaseTransition`, + [OPEN_BLOCK]: `openBlock`, + [CREATE_BLOCK]: `createBlock`, + [CREATE_ELEMENT_BLOCK]: `createElementBlock`, + [CREATE_VNODE]: `createVNode`, + [CREATE_ELEMENT_VNODE]: `createElementVNode`, + [CREATE_COMMENT]: `createCommentVNode`, + [CREATE_TEXT]: `createTextVNode`, + [CREATE_STATIC]: `createStaticVNode`, + [RESOLVE_COMPONENT]: `resolveComponent`, + [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, + [RESOLVE_DIRECTIVE]: `resolveDirective`, + [RESOLVE_FILTER]: `resolveFilter`, + [WITH_DIRECTIVES]: `withDirectives`, + [RENDER_LIST]: `renderList`, + [RENDER_SLOT]: `renderSlot`, + [CREATE_SLOTS]: `createSlots`, + [TO_DISPLAY_STRING]: `toDisplayString`, + [MERGE_PROPS]: `mergeProps`, + [NORMALIZE_CLASS]: `normalizeClass`, + [NORMALIZE_STYLE]: `normalizeStyle`, + [NORMALIZE_PROPS]: `normalizeProps`, + [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, + [TO_HANDLERS]: `toHandlers`, + [CAMELIZE]: `camelize`, + [CAPITALIZE]: `capitalize`, + [TO_HANDLER_KEY]: `toHandlerKey`, + [SET_BLOCK_TRACKING]: `setBlockTracking`, + [PUSH_SCOPE_ID]: `pushScopeId`, + [POP_SCOPE_ID]: `popScopeId`, + [WITH_CTX]: `withCtx`, + [UNREF]: `unref`, + [IS_REF]: `isRef`, + [WITH_MEMO]: `withMemo`, + [IS_MEMO_SAME]: `isMemoSame` +}; +function registerRuntimeHelpers(helpers) { + Object.getOwnPropertySymbols(helpers).forEach((s) => { + helperNameMap[s] = helpers[s]; + }); +} + +const Namespaces = { + "HTML": 0, + "0": "HTML", + "SVG": 1, + "1": "SVG", + "MATH_ML": 2, + "2": "MATH_ML" +}; +const NodeTypes = { + "ROOT": 0, + "0": "ROOT", + "ELEMENT": 1, + "1": "ELEMENT", + "TEXT": 2, + "2": "TEXT", + "COMMENT": 3, + "3": "COMMENT", + "SIMPLE_EXPRESSION": 4, + "4": "SIMPLE_EXPRESSION", + "INTERPOLATION": 5, + "5": "INTERPOLATION", + "ATTRIBUTE": 6, + "6": "ATTRIBUTE", + "DIRECTIVE": 7, + "7": "DIRECTIVE", + "COMPOUND_EXPRESSION": 8, + "8": "COMPOUND_EXPRESSION", + "IF": 9, + "9": "IF", + "IF_BRANCH": 10, + "10": "IF_BRANCH", + "FOR": 11, + "11": "FOR", + "TEXT_CALL": 12, + "12": "TEXT_CALL", + "VNODE_CALL": 13, + "13": "VNODE_CALL", + "JS_CALL_EXPRESSION": 14, + "14": "JS_CALL_EXPRESSION", + "JS_OBJECT_EXPRESSION": 15, + "15": "JS_OBJECT_EXPRESSION", + "JS_PROPERTY": 16, + "16": "JS_PROPERTY", + "JS_ARRAY_EXPRESSION": 17, + "17": "JS_ARRAY_EXPRESSION", + "JS_FUNCTION_EXPRESSION": 18, + "18": "JS_FUNCTION_EXPRESSION", + "JS_CONDITIONAL_EXPRESSION": 19, + "19": "JS_CONDITIONAL_EXPRESSION", + "JS_CACHE_EXPRESSION": 20, + "20": "JS_CACHE_EXPRESSION", + "JS_BLOCK_STATEMENT": 21, + "21": "JS_BLOCK_STATEMENT", + "JS_TEMPLATE_LITERAL": 22, + "22": "JS_TEMPLATE_LITERAL", + "JS_IF_STATEMENT": 23, + "23": "JS_IF_STATEMENT", + "JS_ASSIGNMENT_EXPRESSION": 24, + "24": "JS_ASSIGNMENT_EXPRESSION", + "JS_SEQUENCE_EXPRESSION": 25, + "25": "JS_SEQUENCE_EXPRESSION", + "JS_RETURN_STATEMENT": 26, + "26": "JS_RETURN_STATEMENT" +}; +const ElementTypes = { + "ELEMENT": 0, + "0": "ELEMENT", + "COMPONENT": 1, + "1": "COMPONENT", + "SLOT": 2, + "2": "SLOT", + "TEMPLATE": 3, + "3": "TEMPLATE" +}; +const ConstantTypes = { + "NOT_CONSTANT": 0, + "0": "NOT_CONSTANT", + "CAN_SKIP_PATCH": 1, + "1": "CAN_SKIP_PATCH", + "CAN_CACHE": 2, + "2": "CAN_CACHE", + "CAN_STRINGIFY": 3, + "3": "CAN_STRINGIFY" +}; +const locStub = { + start: { line: 1, column: 1, offset: 0 }, + end: { line: 1, column: 1, offset: 0 }, + source: "" +}; +function createRoot(children, source = "") { + return { + type: 0, + source, + children, + helpers: /* @__PURE__ */ new Set(), + components: [], + directives: [], + hoists: [], + imports: [], + cached: [], + temps: 0, + codegenNode: void 0, + loc: locStub + }; +} +function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { + if (context) { + if (isBlock) { + context.helper(OPEN_BLOCK); + context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); + } else { + context.helper(getVNodeHelper(context.inSSR, isComponent)); + } + if (directives) { + context.helper(WITH_DIRECTIVES); + } + } + return { + type: 13, + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent, + loc + }; +} +function createArrayExpression(elements, loc = locStub) { + return { + type: 17, + loc, + elements + }; +} +function createObjectExpression(properties, loc = locStub) { + return { + type: 15, + loc, + properties + }; +} +function createObjectProperty(key, value) { + return { + type: 16, + loc: locStub, + key: isString$1(key) ? createSimpleExpression(key, true) : key, + value + }; +} +function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { + return { + type: 4, + loc, + content, + isStatic, + constType: isStatic ? 3 : constType + }; +} +function createInterpolation(content, loc) { + return { + type: 5, + loc, + content: isString$1(content) ? createSimpleExpression(content, false, loc) : content + }; +} +function createCompoundExpression(children, loc = locStub) { + return { + type: 8, + loc, + children + }; +} +function createCallExpression(callee, args = [], loc = locStub) { + return { + type: 14, + loc, + callee, + arguments: args + }; +} +function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { + return { + type: 18, + params, + returns, + newline, + isSlot, + loc + }; +} +function createConditionalExpression(test, consequent, alternate, newline = true) { + return { + type: 19, + test, + consequent, + alternate, + newline, + loc: locStub + }; +} +function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { + return { + type: 20, + index, + value, + needPauseTracking, + inVOnce, + needArraySpread: false, + loc: locStub + }; +} +function createBlockStatement(body) { + return { + type: 21, + body, + loc: locStub + }; +} +function createTemplateLiteral(elements) { + return { + type: 22, + elements, + loc: locStub + }; +} +function createIfStatement(test, consequent, alternate) { + return { + type: 23, + test, + consequent, + alternate, + loc: locStub + }; +} +function createAssignmentExpression(left, right) { + return { + type: 24, + left, + right, + loc: locStub + }; +} +function createSequenceExpression(expressions) { + return { + type: 25, + expressions, + loc: locStub + }; +} +function createReturnStatement(returns) { + return { + type: 26, + returns, + loc: locStub + }; +} +function getVNodeHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; +} +function getVNodeBlockHelper(ssr, isComponent) { + return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; +} +function convertToBlock(node, { helper, removeHelper, inSSR }) { + if (!node.isBlock) { + node.isBlock = true; + removeHelper(getVNodeHelper(inSSR, node.isComponent)); + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(inSSR, node.isComponent)); + } +} + +// Generated using scripts/write-decode-map.ts +var htmlDecodeTree = new Uint16Array( +// prettier-ignore +"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c" + .split("") + .map((c) => c.charCodeAt(0))); + +// Generated using scripts/write-decode-map.ts +var xmlDecodeTree = new Uint16Array( +// prettier-ignore +"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" + .split("") + .map((c) => c.charCodeAt(0))); + +// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 +var _a$1; +const decodeMap = new Map([ + [0, 65533], + // C1 Unicode control character reference replacements + [128, 8364], + [130, 8218], + [131, 402], + [132, 8222], + [133, 8230], + [134, 8224], + [135, 8225], + [136, 710], + [137, 8240], + [138, 352], + [139, 8249], + [140, 338], + [142, 381], + [145, 8216], + [146, 8217], + [147, 8220], + [148, 8221], + [149, 8226], + [150, 8211], + [151, 8212], + [152, 732], + [153, 8482], + [154, 353], + [155, 8250], + [156, 339], + [158, 382], + [159, 376], +]); +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +const fromCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins +(_a$1 = String.fromCodePoint) !== null && _a$1 !== void 0 ? _a$1 : function (codePoint) { + let output = ""; + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); + codePoint = 0xdc00 | (codePoint & 0x3ff); + } + output += String.fromCharCode(codePoint); + return output; +}; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +function replaceCodePoint(codePoint) { + var _a; + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return 0xfffd; + } + return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; +} + +var CharCodes; +(function (CharCodes) { + CharCodes[CharCodes["NUM"] = 35] = "NUM"; + CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; + CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; + CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; + CharCodes[CharCodes["NINE"] = 57] = "NINE"; + CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; + CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; + CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; + CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; + CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; + CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; + CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; +})(CharCodes || (CharCodes = {})); +/** Bit that needs to be set to convert an upper case ASCII character to lower case */ +const TO_LOWER_BIT = 0b100000; +var BinTrieFlags; +(function (BinTrieFlags) { + BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; + BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; + BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; +})(BinTrieFlags || (BinTrieFlags = {})); +function isNumber$1(code) { + return code >= CharCodes.ZERO && code <= CharCodes.NINE; +} +function isHexadecimalCharacter(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); +} +function isAsciiAlphaNumeric(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || + isNumber$1(code)); +} +/** + * Checks if the given character is a valid end character for an entity in an attribute. + * + * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. + * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state + */ +function isEntityInAttributeInvalidEnd(code) { + return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); +} +var EntityDecoderState; +(function (EntityDecoderState) { + EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; + EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; + EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; + EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; + EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; +})(EntityDecoderState || (EntityDecoderState = {})); +var DecodingMode; +(function (DecodingMode) { + /** Entities in text nodes that can end with any character. */ + DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; + /** Only allow entities terminated with a semicolon. */ + DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; + /** Entities in attributes have limitations on ending characters. */ + DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; +})(DecodingMode || (DecodingMode = {})); +/** + * Token decoder with support of writing partial entities. + */ +class EntityDecoder { + constructor( + /** The tree used to decode entities. */ + decodeTree, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint, + /** An object that is used to produce errors. */ + errors) { + this.decodeTree = decodeTree; + this.emitCodePoint = emitCodePoint; + this.errors = errors; + /** The current state of the decoder. */ + this.state = EntityDecoderState.EntityStart; + /** Characters that were consumed while parsing an entity. */ + this.consumed = 1; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + this.result = 0; + /** The current index in the decode tree. */ + this.treeIndex = 0; + /** The number of characters that were consumed in excess. */ + this.excess = 1; + /** The mode in which the decoder is operating. */ + this.decodeMode = DecodingMode.Strict; + } + /** Resets the instance to make it reusable. */ + startEntity(decodeMode) { + this.decodeMode = decodeMode; + this.state = EntityDecoderState.EntityStart; + this.result = 0; + this.treeIndex = 0; + this.excess = 1; + this.consumed = 1; + } + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + write(str, offset) { + switch (this.state) { + case EntityDecoderState.EntityStart: { + if (str.charCodeAt(offset) === CharCodes.NUM) { + this.state = EntityDecoderState.NumericStart; + this.consumed += 1; + return this.stateNumericStart(str, offset + 1); + } + this.state = EntityDecoderState.NamedEntity; + return this.stateNamedEntity(str, offset); + } + case EntityDecoderState.NumericStart: { + return this.stateNumericStart(str, offset); + } + case EntityDecoderState.NumericDecimal: { + return this.stateNumericDecimal(str, offset); + } + case EntityDecoderState.NumericHex: { + return this.stateNumericHex(str, offset); + } + case EntityDecoderState.NamedEntity: { + return this.stateNamedEntity(str, offset); + } + } + } + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericStart(str, offset) { + if (offset >= str.length) { + return -1; + } + if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { + this.state = EntityDecoderState.NumericHex; + this.consumed += 1; + return this.stateNumericHex(str, offset + 1); + } + this.state = EntityDecoderState.NumericDecimal; + return this.stateNumericDecimal(str, offset); + } + addToNumericResult(str, start, end, base) { + if (start !== end) { + const digitCount = end - start; + this.result = + this.result * Math.pow(base, digitCount) + + parseInt(str.substr(start, digitCount), base); + this.consumed += digitCount; + } + } + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericHex(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber$1(char) || isHexadecimalCharacter(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 16); + return this.emitNumericEntity(char, 3); + } + } + this.addToNumericResult(str, startIdx, offset, 16); + return -1; + } + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericDecimal(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber$1(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 10); + return this.emitNumericEntity(char, 2); + } + } + this.addToNumericResult(str, startIdx, offset, 10); + return -1; + } + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + emitNumericEntity(lastCp, expectedLength) { + var _a; + // Ensure we consumed at least one digit. + if (this.consumed <= expectedLength) { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + // Figure out if this is a legit end of the entity + if (lastCp === CharCodes.SEMI) { + this.consumed += 1; + } + else if (this.decodeMode === DecodingMode.Strict) { + return 0; + } + this.emitCodePoint(replaceCodePoint(this.result), this.consumed); + if (this.errors) { + if (lastCp !== CharCodes.SEMI) { + this.errors.missingSemicolonAfterCharacterReference(); + } + this.errors.validateNumericCharacterReference(this.result); + } + return this.consumed; + } + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNamedEntity(str, offset) { + const { decodeTree } = this; + let current = decodeTree[this.treeIndex]; + // The mask is the number of bytes of the value, including the current byte. + let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + for (; offset < str.length; offset++, this.excess++) { + const char = str.charCodeAt(offset); + this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); + if (this.treeIndex < 0) { + return this.result === 0 || + // If we are parsing an attribute + (this.decodeMode === DecodingMode.Attribute && + // We shouldn't have consumed any characters after the entity, + (valueLength === 0 || + // And there should be no invalid characters. + isEntityInAttributeInvalidEnd(char))) + ? 0 + : this.emitNotTerminatedNamedEntity(); + } + current = decodeTree[this.treeIndex]; + valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + // If the branch is a value, store it and continue + if (valueLength !== 0) { + // If the entity is terminated by a semicolon, we are done. + if (char === CharCodes.SEMI) { + return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); + } + // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. + if (this.decodeMode !== DecodingMode.Strict) { + this.result = this.treeIndex; + this.consumed += this.excess; + this.excess = 0; + } + } + } + return -1; + } + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + emitNotTerminatedNamedEntity() { + var _a; + const { result, decodeTree } = this; + const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; + this.emitNamedEntityData(result, valueLength, this.consumed); + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); + return this.consumed; + } + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + emitNamedEntityData(result, valueLength, consumed) { + const { decodeTree } = this; + this.emitCodePoint(valueLength === 1 + ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH + : decodeTree[result + 1], consumed); + if (valueLength === 3) { + // For multi-byte values, we need to emit the second byte. + this.emitCodePoint(decodeTree[result + 2], consumed); + } + return consumed; + } + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + end() { + var _a; + switch (this.state) { + case EntityDecoderState.NamedEntity: { + // Emit a named entity if we have one. + return this.result !== 0 && + (this.decodeMode !== DecodingMode.Attribute || + this.result === this.treeIndex) + ? this.emitNotTerminatedNamedEntity() + : 0; + } + // Otherwise, emit a numeric entity if we have one. + case EntityDecoderState.NumericDecimal: { + return this.emitNumericEntity(0, 2); + } + case EntityDecoderState.NumericHex: { + return this.emitNumericEntity(0, 3); + } + case EntityDecoderState.NumericStart: { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + case EntityDecoderState.EntityStart: { + // Return 0 if we have no entity. + return 0; + } + } + } +} +/** + * Creates a function that decodes entities in a string. + * + * @param decodeTree The decode tree. + * @returns A function that decodes entities in a string. + */ +function getDecoder(decodeTree) { + let ret = ""; + const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str))); + return function decodeWithTrie(str, decodeMode) { + let lastIndex = 0; + let offset = 0; + while ((offset = str.indexOf("&", offset)) >= 0) { + ret += str.slice(lastIndex, offset); + decoder.startEntity(decodeMode); + const len = decoder.write(str, + // Skip the "&" + offset + 1); + if (len < 0) { + lastIndex = offset + decoder.end(); + break; + } + lastIndex = offset + len; + // If `len` is 0, skip the current `&` and continue. + offset = len === 0 ? lastIndex + 1 : lastIndex; + } + const result = ret + str.slice(lastIndex); + // Make sure we don't keep a reference to the final string. + ret = ""; + return result; + }; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +function determineBranch(decodeTree, current, nodeIdx, char) { + const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; + const jumpOffset = current & BinTrieFlags.JUMP_TABLE; + // Case 1: Single branch encoded in jump offset + if (branchCount === 0) { + return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + } + // Case 2: Multiple branches encoded in jump table + if (jumpOffset) { + const value = char - jumpOffset; + return value < 0 || value >= branchCount + ? -1 + : decodeTree[nodeIdx + value] - 1; + } + // Case 3: Multiple branches encoded in dictionary + // Binary search for the character. + let lo = nodeIdx; + let hi = lo + branchCount - 1; + while (lo <= hi) { + const mid = (lo + hi) >>> 1; + const midVal = decodeTree[mid]; + if (midVal < char) { + lo = mid + 1; + } + else if (midVal > char) { + hi = mid - 1; + } + else { + return decodeTree[mid + branchCount]; + } + } + return -1; +} +const htmlDecoder = getDecoder(htmlDecodeTree); +getDecoder(xmlDecodeTree); +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +function decodeHTML(str, mode = DecodingMode.Legacy) { + return htmlDecoder(str, mode); +} + +const defaultDelimitersOpen = new Uint8Array([123, 123]); +const defaultDelimitersClose = new Uint8Array([125, 125]); +function isTagStartChar(c) { + return c >= 97 && c <= 122 || c >= 65 && c <= 90; +} +function isWhitespace(c) { + return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; +} +function isEndOfTagSection(c) { + return c === 47 || c === 62 || isWhitespace(c); +} +function toCharCodes(str) { + const ret = new Uint8Array(str.length); + for (let i = 0; i < str.length; i++) { + ret[i] = str.charCodeAt(i); + } + return ret; +} +const Sequences = { + Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), + // CDATA[ + CdataEnd: new Uint8Array([93, 93, 62]), + // ]]> + CommentEnd: new Uint8Array([45, 45, 62]), + // `-->` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `</style` + TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]), + // `</title` + TextareaEnd: new Uint8Array([ + 60, + 47, + 116, + 101, + 120, + 116, + 97, + 114, + 101, + 97 + ]) + // `</textarea +}; +class Tokenizer { + constructor(stack, cbs) { + this.stack = stack; + this.cbs = cbs; + /** The current state the tokenizer is in. */ + this.state = 1; + /** The read buffer. */ + this.buffer = ""; + /** The beginning of the section that is currently being read. */ + this.sectionStart = 0; + /** The index within the buffer that we are currently looking at. */ + this.index = 0; + /** The start of the last entity. */ + this.entityStart = 0; + /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */ + this.baseState = 1; + /** For special parsing behavior inside of script and style tags. */ + this.inRCDATA = false; + /** For disabling RCDATA tags handling */ + this.inXML = false; + /** For disabling interpolation parsing in v-pre */ + this.inVPre = false; + /** Record newline positions for fast line / column calculation */ + this.newlines = []; + this.mode = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + this.delimiterIndex = -1; + this.currentSequence = void 0; + this.sequenceIndex = 0; + { + this.entityDecoder = new EntityDecoder( + htmlDecodeTree, + (cp, consumed) => this.emitCodePoint(cp, consumed) + ); + } + } + get inSFCRoot() { + return this.mode === 2 && this.stack.length === 0; + } + reset() { + this.state = 1; + this.mode = 0; + this.buffer = ""; + this.sectionStart = 0; + this.index = 0; + this.baseState = 1; + this.inRCDATA = false; + this.currentSequence = void 0; + this.newlines.length = 0; + this.delimiterOpen = defaultDelimitersOpen; + this.delimiterClose = defaultDelimitersClose; + } + /** + * Generate Position object with line / column information using recorded + * newline positions. We know the index is always going to be an already + * processed index, so all the newlines up to this index should have been + * recorded. + */ + getPos(index) { + let line = 1; + let column = index + 1; + for (let i = this.newlines.length - 1; i >= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; + break; + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); + } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For <title> and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (c === 38) { + this.startEntity(); + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); + } + } + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } + } + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } + } + this.index = this.buffer.length - 1; + return false; + } + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + if (c === 116) { + this.state = 30; + } else { + this.state = c === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } + } + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); + } + } + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); + } + this.handleTagName(c); + } + } + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; + } + } + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } + } + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (c === 61) { + this.cbs.onerr( + 19, + this.index + ); + } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; + } else { + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 34 || c === 39 || c === 60) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + { + this.cbs.onerr( + 27, + this.index + ); + } + } + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || false) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; + } else if (c === 38) { + this.startEntity(); + } + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else if (c === 38) { + this.startEntity(); + } + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; + } + } + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; + } else { + this.state = 23; + } + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + if (c === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (c === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + stateBeforeSpecialT(c) { + if (c === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (c === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } + } + startEntity() { + { + this.baseState = this.state; + this.state = 33; + this.entityStart = this.index; + this.entityDecoder.startEntity( + this.baseState === 1 || this.baseState === 32 ? DecodingMode.Legacy : DecodingMode.Attribute + ); + } + } + stateInEntity() { + { + const length = this.entityDecoder.write(this.buffer, this.index); + if (length >= 0) { + this.state = this.baseState; + if (length === 0) { + this.index = this.entityStart; + } + } else { + this.index = this.buffer.length - 1; + } + } + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; + } + } + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; + } + } + } + finish() { + if (this.state === 33) { + this.entityDecoder.end(); + this.state = this.baseState; + } + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); + } + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } + } + emitCodePoint(cp, consumed) { + { + if (this.baseState !== 1 && this.baseState !== 32) { + if (this.sectionStart < this.entityStart) { + this.cbs.onattribdata(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.onattribentity( + fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } else { + if (this.sectionStart < this.entityStart) { + this.cbs.ontext(this.sectionStart, this.entityStart); + } + this.sectionStart = this.entityStart + consumed; + this.index = this.sectionStart - 1; + this.cbs.ontextentity( + fromCodePoint(cp), + this.entityStart, + this.sectionStart + ); + } + } + } +} + +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; +const deprecationData = { + ["COMPILER_IS_ON_ELEMENT"]: { + message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, + link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` + }, + ["COMPILER_V_BIND_SYNC"]: { + message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` + }, + ["COMPILER_V_BIND_OBJECT_ORDER"]: { + message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` + }, + ["COMPILER_V_ON_NATIVE"]: { + message: `.native modifier for v-on has been removed as is no longer necessary.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` + }, + ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { + message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, + link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` + }, + ["COMPILER_NATIVE_TEMPLATE"]: { + message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` + }, + ["COMPILER_INLINE_TEMPLATE"]: { + message: `"inline-template" has been removed in Vue 3.`, + link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` + }, + ["COMPILER_FILTERS"]: { + message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, + link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` + } +}; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; + if (key === "MODE") { + return value || 3; + } else { + return value; + } +} +function isCompatEnabled(key, context) { + const mode = getCompatValue("MODE", context); + const value = getCompatValue(key, context); + return mode === 3 ? value === true : value !== false; +} +function checkCompatEnabled(key, context, loc, ...args) { + const enabled = isCompatEnabled(key, context); + if (enabled) { + warnDeprecation(key, context, loc, ...args); + } + return enabled; +} +function warnDeprecation(key, context, loc, ...args) { + const val = getCompatValue(key, context); + if (val === "suppress-warning") { + return; + } + const { message, link } = deprecationData[key]; + const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` + Details: ${link}` : ``}`; + const err = new SyntaxError(msg); + err.code = key; + if (loc) err.loc = loc; + context.onWarn(err); +} + +function defaultOnError(error) { + throw error; +} +function defaultOnWarn(msg) { + console.warn(`[Vue warn] ${msg.message}`); +} +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = (messages || errorMessages$1)[code] + (additionalMessage || ``) ; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; +} +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, + "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", + "__EXTEND_POINT__": 53, + "53": "__EXTEND_POINT__" +}; +const errorMessages$1 = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [52]: `v-bind with same-name shorthand only allows static argument.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [53]: `` +}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var lib = {}; + +var hasRequiredLib; + +function requireLib () { + if (hasRequiredLib) return lib; + hasRequiredLib = 1; + + Object.defineProperty(lib, '__esModule', { + value: true + }); + function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; + } + class Position { + constructor(line, col, index) { + this.line = void 0; + this.column = void 0; + this.index = void 0; + this.line = line; + this.column = col; + this.index = index; + } + } + class SourceLocation { + constructor(start, end) { + this.start = void 0; + this.end = void 0; + this.filename = void 0; + this.identifierName = void 0; + this.start = start; + this.end = end; + } + } + function createPositionWithColumnOffset(position, columnOffset) { + const { + line, + column, + index + } = position; + return new Position(line, column + columnOffset, index + columnOffset); + } + const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; + var ModuleErrors = { + ImportMetaOutsideModule: { + message: `import.meta may appear only with 'sourceType: "module"'`, + code + }, + ImportOutsideModule: { + message: `'import' and 'export' may appear only with 'sourceType: "module"'`, + code + } + }; + const NodeDescriptions = { + ArrayPattern: "array destructuring pattern", + AssignmentExpression: "assignment expression", + AssignmentPattern: "assignment expression", + ArrowFunctionExpression: "arrow function expression", + ConditionalExpression: "conditional expression", + CatchClause: "catch clause", + ForOfStatement: "for-of statement", + ForInStatement: "for-in statement", + ForStatement: "for-loop", + FormalParameters: "function parameter list", + Identifier: "identifier", + ImportSpecifier: "import specifier", + ImportDefaultSpecifier: "import default specifier", + ImportNamespaceSpecifier: "import namespace specifier", + ObjectPattern: "object destructuring pattern", + ParenthesizedExpression: "parenthesized expression", + RestElement: "rest element", + UpdateExpression: { + true: "prefix operation", + false: "postfix operation" + }, + VariableDeclarator: "variable declaration", + YieldExpression: "yield expression" + }; + const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type]; + var StandardErrors = { + AccessorIsGenerator: ({ + kind + }) => `A ${kind}ter cannot be a generator.`, + ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", + AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", + AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", + AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", + AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", + AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", + BadGetterArity: "A 'get' accessor must not have any formal parameters.", + BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", + BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", + ConstructorClassField: "Classes may not have a field named 'constructor'.", + ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", + ConstructorIsAccessor: "Class constructor may not be an accessor.", + ConstructorIsAsync: "Constructor can't be an async function.", + ConstructorIsGenerator: "Constructor can't be a generator.", + DeclarationMissingInitializer: ({ + kind + }) => `Missing initializer in ${kind} declaration.`, + DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", + DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", + DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", + DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", + DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", + DecoratorSemicolon: "Decorators must not be followed by a semicolon.", + DecoratorStaticBlock: "Decorators can't be used with a static block.", + DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', + DeletePrivateField: "Deleting a private field is not allowed.", + DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + DuplicateConstructor: "Duplicate constructor in the same class.", + DuplicateDefaultExport: "Only one default export allowed per module.", + DuplicateExport: ({ + exportName + }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, + DuplicateProto: "Redefinition of __proto__ property.", + DuplicateRegExpFlags: "Duplicate regular expression flag.", + DynamicImportPhaseRequiresImportExpressions: ({ + phase + }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, + ElementAfterRest: "Rest element must be last element.", + EscapedCharNotAnIdentifier: "Invalid Unicode escape.", + ExportBindingIsString: ({ + localName, + exportName + }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, + ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", + ForInOfLoopInitializer: ({ + type + }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, + ForInUsing: "For-in loop may not start with 'using' declaration.", + ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", + ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", + GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", + IllegalBreakContinue: ({ + type + }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, + IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", + IllegalReturn: "'return' outside of function.", + ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.", + ImportBindingIsString: ({ + importName + }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, + ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", + ImportCallArity: ({ + maxArgumentCount + }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`, + ImportCallNotNewExpression: "Cannot use new with import(...).", + ImportCallSpreadArgument: "`...` is not allowed in `import()`.", + ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", + ImportReflectionHasAssertion: "`import module x` cannot have assertions.", + ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', + IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", + InvalidBigIntLiteral: "Invalid BigIntLiteral.", + InvalidCodePoint: "Code point out of bounds.", + InvalidCoverInitializedName: "Invalid shorthand property initializer.", + InvalidDecimal: "Invalid decimal.", + InvalidDigit: ({ + radix + }) => `Expected number in radix ${radix}.`, + InvalidEscapeSequence: "Bad character escape sequence.", + InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", + InvalidEscapedReservedWord: ({ + reservedWord + }) => `Escape sequence in keyword ${reservedWord}.`, + InvalidIdentifier: ({ + identifierName + }) => `Invalid identifier ${identifierName}.`, + InvalidLhs: ({ + ancestor + }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsBinding: ({ + ancestor + }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsOptionalChaining: ({ + ancestor + }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, + InvalidNumber: "Invalid number.", + InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", + InvalidOrUnexpectedToken: ({ + unexpected + }) => `Unexpected character '${unexpected}'.`, + InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", + InvalidPrivateFieldResolution: ({ + identifierName + }) => `Private name #${identifierName} is not defined.`, + InvalidPropertyBindingPattern: "Binding member expression.", + InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", + InvalidRestAssignmentPattern: "Invalid rest operator's argument.", + LabelRedeclaration: ({ + labelName + }) => `Label '${labelName}' is already declared.`, + LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", + LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", + MalformedRegExpFlags: "Invalid regular expression flag.", + MissingClassName: "A class name is required.", + MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", + MissingSemicolon: "Missing semicolon.", + MissingPlugin: ({ + missingPlugin + }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingOneOfPlugins: ({ + missingPlugin + }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", + MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", + ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", + ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", + ModuleAttributesWithDuplicateKeys: ({ + key + }) => `Duplicate key "${key}" is not allowed in module attributes.`, + ModuleExportNameHasLoneSurrogate: ({ + surrogateCharCode + }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, + ModuleExportUndefined: ({ + localName + }) => `Export '${localName}' is not defined.`, + MultipleDefaultsInSwitch: "Multiple default clauses.", + NewlineAfterThrow: "Illegal newline after throw.", + NoCatchOrFinally: "Missing catch or finally clause.", + NumberIdentifier: "Identifier directly after number.", + NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", + ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", + OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", + OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", + OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", + ParamDupe: "Argument name clash.", + PatternHasAccessor: "Object pattern can't contain getter or setter.", + PatternHasMethod: "Object pattern can't contain methods.", + PrivateInExpectedIn: ({ + identifierName + }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, + PrivateNameRedeclaration: ({ + identifierName + }) => `Duplicate private name #${identifierName}.`, + RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + RecordNoProto: "'__proto__' is not allowed in Record expressions.", + RestTrailingComma: "Unexpected trailing comma after rest element.", + SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", + SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", + SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', + StaticPrototype: "Classes may not have static property named prototype.", + SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", + SuperPrivateField: "Private fields can't be accessed on super.", + TrailingDecorator: "Decorators must be attached to a class element.", + TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", + UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', + UnexpectedDigitAfterHash: "Unexpected digit after hash token.", + UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", + UnexpectedKeyword: ({ + keyword + }) => `Unexpected keyword '${keyword}'.`, + UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", + UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", + UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", + UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", + UnexpectedPrivateField: "Unexpected private name.", + UnexpectedReservedWord: ({ + reservedWord + }) => `Unexpected reserved word '${reservedWord}'.`, + UnexpectedSuper: "'super' is only allowed in object methods and classes.", + UnexpectedToken: ({ + expected, + unexpected + }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, + UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", + UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", + UnsupportedBind: "Binding should be performed on object property.", + UnsupportedDecoratorExport: "A decorated export must export a class declaration.", + UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", + UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", + UnsupportedMetaProperty: ({ + target, + onlyValidPropertyName + }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, + UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", + UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", + UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", + UnterminatedComment: "Unterminated comment.", + UnterminatedRegExp: "Unterminated regular expression.", + UnterminatedString: "Unterminated string constant.", + UnterminatedTemplate: "Unterminated template.", + UsingDeclarationExport: "Using declaration cannot be exported.", + UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", + VarRedeclaration: ({ + identifierName + }) => `Identifier '${identifierName}' has already been declared.`, + YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", + YieldInParameter: "Yield expression is not allowed in formal parameters.", + ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." + }; + var StrictModeErrors = { + StrictDelete: "Deleting local variable in strict mode.", + StrictEvalArguments: ({ + referenceName + }) => `Assigning to '${referenceName}' in strict mode.`, + StrictEvalArgumentsBinding: ({ + bindingName + }) => `Binding '${bindingName}' in strict mode.`, + StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", + StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", + StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", + StrictWith: "'with' in strict mode." + }; + const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); + var PipelineOperatorErrors = { + PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", + PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', + PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", + PipeTopicUnconfiguredToken: ({ + token + }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, + PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", + PipeUnparenthesizedBody: ({ + type + }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ + type + })}; please wrap it in parentheses.`, + PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', + PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", + PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", + PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", + PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", + PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' + }; + const _excluded = ["message"]; + function defineHidden(obj, key, value) { + Object.defineProperty(obj, key, { + enumerable: false, + configurable: true, + value + }); + } + function toParseErrorConstructor({ + toMessage, + code, + reasonCode, + syntaxPlugin + }) { + const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; + return function constructor(loc, details) { + const error = new SyntaxError(); + error.code = code; + error.reasonCode = reasonCode; + error.loc = loc; + error.pos = loc.index; + error.syntaxPlugin = syntaxPlugin; + if (hasMissingPlugin) { + error.missingPlugin = details.missingPlugin; + } + defineHidden(error, "clone", function clone(overrides = {}) { + var _overrides$loc; + const { + line, + column, + index + } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; + return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); + }); + defineHidden(error, "details", details); + Object.defineProperty(error, "message", { + configurable: true, + get() { + const message = `${toMessage(details)} (${loc.line}:${loc.column})`; + this.message = message; + return message; + }, + set(value) { + Object.defineProperty(this, "message", { + value, + writable: true + }); + } + }); + return error; + }; + } + function ParseErrorEnum(argument, syntaxPlugin) { + if (Array.isArray(argument)) { + return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); + } + const ParseErrorConstructors = {}; + for (const reasonCode of Object.keys(argument)) { + const template = argument[reasonCode]; + const _ref = typeof template === "string" ? { + message: () => template + } : typeof template === "function" ? { + message: template + } : template, + { + message + } = _ref, + rest = _objectWithoutPropertiesLoose(_ref, _excluded); + const toMessage = typeof message === "string" ? () => message : message; + ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ + code: "BABEL_PARSER_SYNTAX_ERROR", + reasonCode, + toMessage + }, syntaxPlugin ? { + syntaxPlugin + } : {}, rest)); + } + return ParseErrorConstructors; + } + const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); + const { + defineProperty + } = Object; + const toUnenumerable = (object, key) => { + if (object) { + defineProperty(object, key, { + enumerable: false, + value: object[key] + }); + } + }; + function toESTreeLocation(node) { + toUnenumerable(node.loc.start, "index"); + toUnenumerable(node.loc.end, "index"); + return node; + } + var estree = superClass => class ESTreeParserMixin extends superClass { + parse() { + const file = toESTreeLocation(super.parse()); + if (this.options.tokens) { + file.tokens = file.tokens.map(toESTreeLocation); + } + return file; + } + parseRegExpLiteral({ + pattern, + flags + }) { + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (_) {} + const node = this.estreeParseLiteral(regex); + node.regex = { + pattern, + flags + }; + return node; + } + parseBigIntLiteral(value) { + let bigInt; + try { + bigInt = BigInt(value); + } catch (_unused) { + bigInt = null; + } + const node = this.estreeParseLiteral(bigInt); + node.bigint = String(node.value || value); + return node; + } + parseDecimalLiteral(value) { + const decimal = null; + const node = this.estreeParseLiteral(decimal); + node.decimal = String(node.value || value); + return node; + } + estreeParseLiteral(value) { + return this.parseLiteral(value, "Literal"); + } + parseStringLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNumericLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNullLiteral() { + return this.estreeParseLiteral(null); + } + parseBooleanLiteral(value) { + return this.estreeParseLiteral(value); + } + directiveToStmt(directive) { + const expression = directive.value; + delete directive.value; + expression.type = "Literal"; + expression.raw = expression.extra.raw; + expression.value = expression.extra.expressionValue; + const stmt = directive; + stmt.type = "ExpressionStatement"; + stmt.expression = expression; + stmt.directive = expression.extra.rawValue; + delete expression.extra; + return stmt; + } + initFunction(node, isAsync) { + super.initFunction(node, isAsync); + node.expression = false; + } + checkDeclaration(node) { + if (node != null && this.isObjectProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + getObjectOrClassMethodParams(method) { + return method.value.params; + } + isValidDirective(stmt) { + var _stmt$expression$extr; + return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); + const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); + delete node.directives; + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); + if (method.typeParameters) { + method.value.typeParameters = method.typeParameters; + delete method.typeParameters; + } + classBody.body.push(method); + } + parsePrivateName() { + const node = super.parsePrivateName(); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return node; + } + } + return this.convertPrivateNameToPrivateIdentifier(node); + } + convertPrivateNameToPrivateIdentifier(node) { + const name = super.getPrivateNameSV(node); + node = node; + delete node.id; + node.name = name; + node.type = "PrivateIdentifier"; + return node; + } + isPrivateName(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.isPrivateName(node); + } + } + return node.type === "PrivateIdentifier"; + } + getPrivateNameSV(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.getPrivateNameSV(node); + } + } + return node.name; + } + parseLiteral(value, type) { + const node = super.parseLiteral(value, type); + node.raw = node.extra.raw; + delete node.extra; + return node; + } + parseFunctionBody(node, allowExpression, isMethod = false) { + super.parseFunctionBody(node, allowExpression, isMethod); + node.expression = node.body.type !== "BlockStatement"; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + let funcNode = this.startNode(); + funcNode.kind = node.kind; + funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + funcNode.type = "FunctionExpression"; + delete funcNode.kind; + node.value = funcNode; + if (type === "ClassPrivateMethod") { + node.computed = false; + } + return this.finishNode(node, "MethodDefinition"); + } + nameIsConstructor(key) { + if (key.type === "Literal") return key.value === "constructor"; + return super.nameIsConstructor(key); + } + parseClassProperty(...args) { + const propertyNode = super.parseClassProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + return propertyNode; + } + parseClassPrivateProperty(...args) { + const propertyNode = super.parseClassPrivateProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + propertyNode.computed = false; + return propertyNode; + } + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); + if (node) { + node.type = "Property"; + if (node.kind === "method") { + node.kind = "init"; + } + node.shorthand = false; + } + return node; + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (node) { + node.kind = "init"; + node.type = "Property"; + } + return node; + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); + } + isAssignable(node, isBinding) { + if (node != null && this.isObjectProperty(node)) { + return this.isAssignable(node.value, isBinding); + } + return super.isAssignable(node, isBinding); + } + toAssignable(node, isLHS = false) { + if (node != null && this.isObjectProperty(node)) { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + } else { + super.toAssignable(node, isLHS); + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) { + this.raise(Errors.PatternHasAccessor, prop.key); + } else if (prop.type === "Property" && prop.method) { + this.raise(Errors.PatternHasMethod, prop.key); + } else { + super.toAssignableObjectExpressionProp(prop, isLast, isLHS); + } + } + finishCallExpression(unfinished, optional) { + const node = super.finishCallExpression(unfinished, optional); + if (node.callee.type === "Import") { + node.type = "ImportExpression"; + node.source = node.arguments[0]; + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + var _ref, _ref2; + node.options = (_ref = node.arguments[1]) != null ? _ref : null; + node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; + } + delete node.arguments; + delete node.callee; + } + return node; + } + toReferencedArguments(node) { + if (node.type === "ImportExpression") { + return; + } + super.toReferencedArguments(node); + } + parseExport(unfinished, decorators) { + const exportStartLoc = this.state.lastTokStartLoc; + const node = super.parseExport(unfinished, decorators); + switch (node.type) { + case "ExportAllDeclaration": + node.exported = null; + break; + case "ExportNamedDeclaration": + if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { + node.type = "ExportAllDeclaration"; + node.exported = node.specifiers[0].exported; + delete node.specifiers; + } + case "ExportDefaultDeclaration": + { + var _declaration$decorato; + const { + declaration + } = node; + if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { + this.resetStartLocation(node, exportStartLoc); + } + } + break; + } + return node; + } + parseSubscript(base, startLoc, noCalls, state) { + const node = super.parseSubscript(base, startLoc, noCalls, state); + if (state.optionalChainMember) { + if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { + node.type = node.type.substring(8); + } + if (state.stop) { + const chain = this.startNodeAtNode(node); + chain.expression = node; + return this.finishNode(chain, "ChainExpression"); + } + } else if (node.type === "MemberExpression" || node.type === "CallExpression") { + node.optional = false; + } + return node; + } + isOptionalMemberExpression(node) { + if (node.type === "ChainExpression") { + return node.expression.type === "MemberExpression"; + } + return super.isOptionalMemberExpression(node); + } + hasPropertyAsPrivateName(node) { + if (node.type === "ChainExpression") { + node = node.expression; + } + return super.hasPropertyAsPrivateName(node); + } + isObjectProperty(node) { + return node.type === "Property" && node.kind === "init" && !node.method; + } + isObjectMethod(node) { + return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); + } + finishNodeAt(node, type, endLoc) { + return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); + } + resetStartLocation(node, startLoc) { + super.resetStartLocation(node, startLoc); + toESTreeLocation(node); + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + super.resetEndLocation(node, endLoc); + toESTreeLocation(node); + } + }; + class TokContext { + constructor(token, preserveSpace) { + this.token = void 0; + this.preserveSpace = void 0; + this.token = token; + this.preserveSpace = !!preserveSpace; + } + } + const types = { + brace: new TokContext("{"), + j_oTag: new TokContext("<tag"), + j_cTag: new TokContext("</tag"), + j_expr: new TokContext("<tag>...</tag>", true) + }; + { + types.template = new TokContext("`", true); + } + const beforeExpr = true; + const startsExpr = true; + const isLoop = true; + const isAssign = true; + const prefix = true; + const postfix = true; + class ExportedTokenType { + constructor(label, conf = {}) { + this.label = void 0; + this.keyword = void 0; + this.beforeExpr = void 0; + this.startsExpr = void 0; + this.rightAssociative = void 0; + this.isLoop = void 0; + this.isAssign = void 0; + this.prefix = void 0; + this.postfix = void 0; + this.binop = void 0; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop != null ? conf.binop : null; + { + this.updateContext = null; + } + } + } + const keywords$1 = new Map(); + function createKeyword(name, options = {}) { + options.keyword = name; + const token = createToken(name, options); + keywords$1.set(name, token); + return token; + } + function createBinop(name, binop) { + return createToken(name, { + beforeExpr, + binop + }); + } + let tokenTypeCounter = -1; + const tokenTypes = []; + const tokenLabels = []; + const tokenBinops = []; + const tokenBeforeExprs = []; + const tokenStartsExprs = []; + const tokenPrefixes = []; + function createToken(name, options = {}) { + var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; + ++tokenTypeCounter; + tokenLabels.push(name); + tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); + tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); + tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); + tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); + tokenTypes.push(new ExportedTokenType(name, options)); + return tokenTypeCounter; + } + function createKeywordLike(name, options = {}) { + var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; + ++tokenTypeCounter; + keywords$1.set(name, tokenTypeCounter); + tokenLabels.push(name); + tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); + tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); + tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); + tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); + tokenTypes.push(new ExportedTokenType("name", options)); + return tokenTypeCounter; + } + const tt = { + bracketL: createToken("[", { + beforeExpr, + startsExpr + }), + bracketHashL: createToken("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: createToken("[|", { + beforeExpr, + startsExpr + }), + bracketR: createToken("]"), + bracketBarR: createToken("|]"), + braceL: createToken("{", { + beforeExpr, + startsExpr + }), + braceBarL: createToken("{|", { + beforeExpr, + startsExpr + }), + braceHashL: createToken("#{", { + beforeExpr, + startsExpr + }), + braceR: createToken("}"), + braceBarR: createToken("|}"), + parenL: createToken("(", { + beforeExpr, + startsExpr + }), + parenR: createToken(")"), + comma: createToken(",", { + beforeExpr + }), + semi: createToken(";", { + beforeExpr + }), + colon: createToken(":", { + beforeExpr + }), + doubleColon: createToken("::", { + beforeExpr + }), + dot: createToken("."), + question: createToken("?", { + beforeExpr + }), + questionDot: createToken("?."), + arrow: createToken("=>", { + beforeExpr + }), + template: createToken("template"), + ellipsis: createToken("...", { + beforeExpr + }), + backQuote: createToken("`", { + startsExpr + }), + dollarBraceL: createToken("${", { + beforeExpr, + startsExpr + }), + templateTail: createToken("...`", { + startsExpr + }), + templateNonTail: createToken("...${", { + beforeExpr, + startsExpr + }), + at: createToken("@"), + hash: createToken("#", { + startsExpr + }), + interpreterDirective: createToken("#!..."), + eq: createToken("=", { + beforeExpr, + isAssign + }), + assign: createToken("_=", { + beforeExpr, + isAssign + }), + slashAssign: createToken("_=", { + beforeExpr, + isAssign + }), + xorAssign: createToken("_=", { + beforeExpr, + isAssign + }), + moduloAssign: createToken("_=", { + beforeExpr, + isAssign + }), + incDec: createToken("++/--", { + prefix, + postfix, + startsExpr + }), + bang: createToken("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: createToken("~", { + beforeExpr, + prefix, + startsExpr + }), + doubleCaret: createToken("^^", { + startsExpr + }), + doubleAt: createToken("@@", { + startsExpr + }), + pipeline: createBinop("|>", 0), + nullishCoalescing: createBinop("??", 1), + logicalOR: createBinop("||", 1), + logicalAND: createBinop("&&", 2), + bitwiseOR: createBinop("|", 3), + bitwiseXOR: createBinop("^", 4), + bitwiseAND: createBinop("&", 5), + equality: createBinop("==/!=/===/!==", 6), + lt: createBinop("</>/<=/>=", 7), + gt: createBinop("</>/<=/>=", 7), + relational: createBinop("</>/<=/>=", 7), + bitShift: createBinop("<</>>/>>>", 8), + bitShiftL: createBinop("<</>>/>>>", 8), + bitShiftR: createBinop("<</>>/>>>", 8), + plusMin: createToken("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: createToken("%", { + binop: 10, + startsExpr + }), + star: createToken("*", { + binop: 10 + }), + slash: createBinop("/", 10), + exponent: createToken("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }), + _in: createKeyword("in", { + beforeExpr, + binop: 7 + }), + _instanceof: createKeyword("instanceof", { + beforeExpr, + binop: 7 + }), + _break: createKeyword("break"), + _case: createKeyword("case", { + beforeExpr + }), + _catch: createKeyword("catch"), + _continue: createKeyword("continue"), + _debugger: createKeyword("debugger"), + _default: createKeyword("default", { + beforeExpr + }), + _else: createKeyword("else", { + beforeExpr + }), + _finally: createKeyword("finally"), + _function: createKeyword("function", { + startsExpr + }), + _if: createKeyword("if"), + _return: createKeyword("return", { + beforeExpr + }), + _switch: createKeyword("switch"), + _throw: createKeyword("throw", { + beforeExpr, + prefix, + startsExpr + }), + _try: createKeyword("try"), + _var: createKeyword("var"), + _const: createKeyword("const"), + _with: createKeyword("with"), + _new: createKeyword("new", { + beforeExpr, + startsExpr + }), + _this: createKeyword("this", { + startsExpr + }), + _super: createKeyword("super", { + startsExpr + }), + _class: createKeyword("class", { + startsExpr + }), + _extends: createKeyword("extends", { + beforeExpr + }), + _export: createKeyword("export"), + _import: createKeyword("import", { + startsExpr + }), + _null: createKeyword("null", { + startsExpr + }), + _true: createKeyword("true", { + startsExpr + }), + _false: createKeyword("false", { + startsExpr + }), + _typeof: createKeyword("typeof", { + beforeExpr, + prefix, + startsExpr + }), + _void: createKeyword("void", { + beforeExpr, + prefix, + startsExpr + }), + _delete: createKeyword("delete", { + beforeExpr, + prefix, + startsExpr + }), + _do: createKeyword("do", { + isLoop, + beforeExpr + }), + _for: createKeyword("for", { + isLoop + }), + _while: createKeyword("while", { + isLoop + }), + _as: createKeywordLike("as", { + startsExpr + }), + _assert: createKeywordLike("assert", { + startsExpr + }), + _async: createKeywordLike("async", { + startsExpr + }), + _await: createKeywordLike("await", { + startsExpr + }), + _defer: createKeywordLike("defer", { + startsExpr + }), + _from: createKeywordLike("from", { + startsExpr + }), + _get: createKeywordLike("get", { + startsExpr + }), + _let: createKeywordLike("let", { + startsExpr + }), + _meta: createKeywordLike("meta", { + startsExpr + }), + _of: createKeywordLike("of", { + startsExpr + }), + _sent: createKeywordLike("sent", { + startsExpr + }), + _set: createKeywordLike("set", { + startsExpr + }), + _source: createKeywordLike("source", { + startsExpr + }), + _static: createKeywordLike("static", { + startsExpr + }), + _using: createKeywordLike("using", { + startsExpr + }), + _yield: createKeywordLike("yield", { + startsExpr + }), + _asserts: createKeywordLike("asserts", { + startsExpr + }), + _checks: createKeywordLike("checks", { + startsExpr + }), + _exports: createKeywordLike("exports", { + startsExpr + }), + _global: createKeywordLike("global", { + startsExpr + }), + _implements: createKeywordLike("implements", { + startsExpr + }), + _intrinsic: createKeywordLike("intrinsic", { + startsExpr + }), + _infer: createKeywordLike("infer", { + startsExpr + }), + _is: createKeywordLike("is", { + startsExpr + }), + _mixins: createKeywordLike("mixins", { + startsExpr + }), + _proto: createKeywordLike("proto", { + startsExpr + }), + _require: createKeywordLike("require", { + startsExpr + }), + _satisfies: createKeywordLike("satisfies", { + startsExpr + }), + _keyof: createKeywordLike("keyof", { + startsExpr + }), + _readonly: createKeywordLike("readonly", { + startsExpr + }), + _unique: createKeywordLike("unique", { + startsExpr + }), + _abstract: createKeywordLike("abstract", { + startsExpr + }), + _declare: createKeywordLike("declare", { + startsExpr + }), + _enum: createKeywordLike("enum", { + startsExpr + }), + _module: createKeywordLike("module", { + startsExpr + }), + _namespace: createKeywordLike("namespace", { + startsExpr + }), + _interface: createKeywordLike("interface", { + startsExpr + }), + _type: createKeywordLike("type", { + startsExpr + }), + _opaque: createKeywordLike("opaque", { + startsExpr + }), + name: createToken("name", { + startsExpr + }), + string: createToken("string", { + startsExpr + }), + num: createToken("num", { + startsExpr + }), + bigint: createToken("bigint", { + startsExpr + }), + decimal: createToken("decimal", { + startsExpr + }), + regexp: createToken("regexp", { + startsExpr + }), + privateName: createToken("#name", { + startsExpr + }), + eof: createToken("eof"), + jsxName: createToken("jsxName"), + jsxText: createToken("jsxText", { + beforeExpr: true + }), + jsxTagStart: createToken("jsxTagStart", { + startsExpr: true + }), + jsxTagEnd: createToken("jsxTagEnd"), + placeholder: createToken("%%", { + startsExpr: true + }) + }; + function tokenIsIdentifier(token) { + return token >= 93 && token <= 132; + } + function tokenKeywordOrIdentifierIsKeyword(token) { + return token <= 92; + } + function tokenIsKeywordOrIdentifier(token) { + return token >= 58 && token <= 132; + } + function tokenIsLiteralPropertyName(token) { + return token >= 58 && token <= 136; + } + function tokenComesBeforeExpression(token) { + return tokenBeforeExprs[token]; + } + function tokenCanStartExpression(token) { + return tokenStartsExprs[token]; + } + function tokenIsAssignment(token) { + return token >= 29 && token <= 33; + } + function tokenIsFlowInterfaceOrTypeOrOpaque(token) { + return token >= 129 && token <= 131; + } + function tokenIsLoop(token) { + return token >= 90 && token <= 92; + } + function tokenIsKeyword(token) { + return token >= 58 && token <= 92; + } + function tokenIsOperator(token) { + return token >= 39 && token <= 59; + } + function tokenIsPostfix(token) { + return token === 34; + } + function tokenIsPrefix(token) { + return tokenPrefixes[token]; + } + function tokenIsTSTypeOperator(token) { + return token >= 121 && token <= 123; + } + function tokenIsTSDeclarationStart(token) { + return token >= 124 && token <= 130; + } + function tokenLabelName(token) { + return tokenLabels[token]; + } + function tokenOperatorPrecedence(token) { + return tokenBinops[token]; + } + function tokenIsRightAssociative(token) { + return token === 57; + } + function tokenIsTemplate(token) { + return token >= 24 && token <= 25; + } + function getExportedToken(token) { + return tokenTypes[token]; + } + { + tokenTypes[8].updateContext = context => { + context.pop(); + }; + tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { + context.push(types.brace); + }; + tokenTypes[22].updateContext = context => { + if (context[context.length - 1] === types.template) { + context.pop(); + } else { + context.push(types.template); + } + }; + tokenTypes[142].updateContext = context => { + context.push(types.j_expr, types.j_oTag); + }; + } + let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\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\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\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\u0af9\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-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\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-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\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\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; + const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; + const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; + } + function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); + } + function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); + } + const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] + }; + const keywords = new Set(reservedWords.keyword); + const reservedWordsStrictSet = new Set(reservedWords.strict); + const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; + } + function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); + } + function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); + } + function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); + } + function isKeyword(word) { + return keywords.has(word); + } + function isIteratorStart(current, next, next2) { + return current === 64 && next === 64 && isIdentifierStart(next2); + } + const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); + function canBeReservedWord(word) { + return reservedWordLikeSet.has(word); + } + class Scope { + constructor(flags) { + this.flags = 0; + this.names = new Map(); + this.firstLexicalName = ""; + this.flags = flags; + } + } + class ScopeHandler { + constructor(parser, inModule) { + this.parser = void 0; + this.scopeStack = []; + this.inModule = void 0; + this.undefinedExports = new Map(); + this.parser = parser; + this.inModule = inModule; + } + get inTopLevel() { + return (this.currentScope().flags & 1) > 0; + } + get inFunction() { + return (this.currentVarScopeFlags() & 2) > 0; + } + get allowSuper() { + return (this.currentThisScopeFlags() & 16) > 0; + } + get allowDirectSuper() { + return (this.currentThisScopeFlags() & 32) > 0; + } + get inClass() { + return (this.currentThisScopeFlags() & 64) > 0; + } + get inClassAndNotInNonArrowFunction() { + const flags = this.currentThisScopeFlags(); + return (flags & 64) > 0 && (flags & 2) === 0; + } + get inStaticBlock() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 128) { + return true; + } + if (flags & (387 | 64)) { + return false; + } + } + } + get inNonArrowFunction() { + return (this.currentThisScopeFlags() & 2) > 0; + } + get treatFunctionsAsVar() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + } + createScope(flags) { + return new Scope(flags); + } + enter(flags) { + this.scopeStack.push(this.createScope(flags)); + } + exit() { + const scope = this.scopeStack.pop(); + return scope.flags; + } + treatFunctionsAsVarInScope(scope) { + return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); + } + declareName(name, bindingType, loc) { + let scope = this.currentScope(); + if (bindingType & 8 || bindingType & 16) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + let type = scope.names.get(name) || 0; + if (bindingType & 16) { + type = type | 4; + } else { + if (!scope.firstLexicalName) { + scope.firstLexicalName = name; + } + type = type | 2; + } + scope.names.set(name, type); + if (bindingType & 8) { + this.maybeExportDefined(scope, name); + } + } else if (bindingType & 4) { + for (let i = this.scopeStack.length - 1; i >= 0; --i) { + scope = this.scopeStack[i]; + this.checkRedeclarationInScope(scope, name, bindingType, loc); + scope.names.set(name, (scope.names.get(name) || 0) | 1); + this.maybeExportDefined(scope, name); + if (scope.flags & 387) break; + } + } + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + maybeExportDefined(scope, name) { + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + checkRedeclarationInScope(scope, name, bindingType, loc) { + if (this.isRedeclaredInScope(scope, name, bindingType)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + } + isRedeclaredInScope(scope, name, bindingType) { + if (!(bindingType & 1)) return false; + if (bindingType & 8) { + return scope.names.has(name); + } + const type = scope.names.get(name); + if (bindingType & 16) { + return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; + } + return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; + } + checkLocalExport(id) { + const { + name + } = id; + const topLevelScope = this.scopeStack[0]; + if (!topLevelScope.names.has(name)) { + this.undefinedExports.set(name, id.loc.start); + } + } + currentScope() { + return this.scopeStack[this.scopeStack.length - 1]; + } + currentVarScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 387) { + return flags; + } + } + } + currentThisScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & (387 | 64) && !(flags & 4)) { + return flags; + } + } + } + } + class FlowScope extends Scope { + constructor(...args) { + super(...args); + this.declareFunctions = new Set(); + } + } + class FlowScopeHandler extends ScopeHandler { + createScope(flags) { + return new FlowScope(flags); + } + declareName(name, bindingType, loc) { + const scope = this.currentScope(); + if (bindingType & 2048) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + scope.declareFunctions.add(name); + return; + } + super.declareName(name, bindingType, loc); + } + isRedeclaredInScope(scope, name, bindingType) { + if (super.isRedeclaredInScope(scope, name, bindingType)) return true; + if (bindingType & 2048 && !scope.declareFunctions.has(name)) { + const type = scope.names.get(name); + return (type & 4) > 0 || (type & 2) > 0; + } + return false; + } + checkLocalExport(id) { + if (!this.scopeStack[0].declareFunctions.has(id.name)) { + super.checkLocalExport(id); + } + } + } + class BaseParser { + constructor() { + this.sawUnambiguousESM = false; + this.ambiguousScriptDifferentAst = false; + } + hasPlugin(pluginConfig) { + if (typeof pluginConfig === "string") { + return this.plugins.has(pluginConfig); + } else { + const [pluginName, pluginOptions] = pluginConfig; + if (!this.hasPlugin(pluginName)) { + return false; + } + const actualOptions = this.plugins.get(pluginName); + for (const key of Object.keys(pluginOptions)) { + if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { + return false; + } + } + return true; + } + } + getPluginOption(plugin, name) { + var _this$plugins$get; + return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; + } + } + function setTrailingComments(node, comments) { + if (node.trailingComments === undefined) { + node.trailingComments = comments; + } else { + node.trailingComments.unshift(...comments); + } + } + function setLeadingComments(node, comments) { + if (node.leadingComments === undefined) { + node.leadingComments = comments; + } else { + node.leadingComments.unshift(...comments); + } + } + function setInnerComments(node, comments) { + if (node.innerComments === undefined) { + node.innerComments = comments; + } else { + node.innerComments.unshift(...comments); + } + } + function adjustInnerComments(node, elements, commentWS) { + let lastElement = null; + let i = elements.length; + while (lastElement === null && i > 0) { + lastElement = elements[--i]; + } + if (lastElement === null || lastElement.start > commentWS.start) { + setInnerComments(node, commentWS.comments); + } else { + setTrailingComments(lastElement, commentWS.comments); + } + } + class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + const { + commentsLen + } = this.state; + if (this.comments.length !== commentsLen) { + this.comments.length = commentsLen; + } + this.comments.push(comment); + this.state.commentsLen++; + } + processComment(node) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + const lastCommentWS = commentStack[i]; + if (lastCommentWS.start === node.end) { + lastCommentWS.leadingNode = node; + i--; + } + const { + start: nodeStart + } = node; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + if (commentEnd > nodeStart) { + commentWS.containingNode = node; + this.finalizeComment(commentWS); + commentStack.splice(i, 1); + } else { + if (commentEnd === nodeStart) { + commentWS.trailingNode = node; + } + break; + } + } + } + finalizeComment(commentWS) { + const { + comments + } = commentWS; + if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { + if (commentWS.leadingNode !== null) { + setTrailingComments(commentWS.leadingNode, comments); + } + if (commentWS.trailingNode !== null) { + setLeadingComments(commentWS.trailingNode, comments); + } + } else { + const { + containingNode: node, + start: commentStart + } = commentWS; + if (this.input.charCodeAt(commentStart - 1) === 44) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + case "RecordExpression": + adjustInnerComments(node, node.properties, commentWS); + break; + case "CallExpression": + case "OptionalCallExpression": + adjustInnerComments(node, node.arguments, commentWS); + break; + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ObjectMethod": + case "ClassMethod": + case "ClassPrivateMethod": + adjustInnerComments(node, node.params, commentWS); + break; + case "ArrayExpression": + case "ArrayPattern": + case "TupleExpression": + adjustInnerComments(node, node.elements, commentWS); + break; + case "ExportNamedDeclaration": + case "ImportDeclaration": + adjustInnerComments(node, node.specifiers, commentWS); + break; + default: + { + setInnerComments(node, comments); + } + } + } else { + setInnerComments(node, comments); + } + } + } + finalizeRemainingComments() { + const { + commentStack + } = this.state; + for (let i = commentStack.length - 1; i >= 0; i--) { + this.finalizeComment(commentStack[i]); + } + this.state.commentStack = []; + } + resetPreviousNodeTrailingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + const commentWS = commentStack[length - 1]; + if (commentWS.leadingNode === node) { + commentWS.leadingNode = null; + } + } + resetPreviousIdentifierLeadingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + if (commentStack[length - 1].trailingNode === node) { + commentStack[length - 1].trailingNode = null; + } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { + commentStack[length - 2].trailingNode = null; + } + } + takeSurroundingComments(node, start, end) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + const commentStart = commentWS.start; + if (commentStart === end) { + commentWS.leadingNode = node; + } else if (commentEnd === start) { + commentWS.trailingNode = node; + } else if (commentEnd < start) { + break; + } + } + } + } + const lineBreak = /\r\n|[\r\n\u2028\u2029]/; + const lineBreakG = new RegExp(lineBreak.source, "g"); + function isNewLine(code) { + switch (code) { + case 10: + case 13: + case 8232: + case 8233: + return true; + default: + return false; + } + } + function hasNewLine(input, start, end) { + for (let i = start; i < end; i++) { + if (isNewLine(input.charCodeAt(i))) { + return true; + } + } + return false; + } + const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; + function isWhitespace(code) { + switch (code) { + case 0x0009: + case 0x000b: + case 0x000c: + case 32: + case 160: + case 5760: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: + case 0x3000: + case 0xfeff: + return true; + default: + return false; + } + } + class State { + constructor() { + this.flags = 1024; + this.curLine = void 0; + this.lineStart = void 0; + this.startLoc = void 0; + this.endLoc = void 0; + this.errors = []; + this.potentialArrowAt = -1; + this.noArrowAt = []; + this.noArrowParamsConversionAt = []; + this.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + this.labels = []; + this.commentsLen = 0; + this.commentStack = []; + this.pos = 0; + this.type = 139; + this.value = null; + this.start = 0; + this.end = 0; + this.lastTokEndLoc = null; + this.lastTokStartLoc = null; + this.context = [types.brace]; + this.firstInvalidTemplateEscapePos = null; + this.strictErrors = new Map(); + this.tokensLength = 0; + } + get strict() { + return (this.flags & 1) > 0; + } + set strict(v) { + if (v) this.flags |= 1;else this.flags &= -2; + } + init({ + strictMode, + sourceType, + startLine, + startColumn + }) { + this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; + this.curLine = startLine; + this.lineStart = -startColumn; + this.startLoc = this.endLoc = new Position(startLine, startColumn, 0); + } + get maybeInArrowParameters() { + return (this.flags & 2) > 0; + } + set maybeInArrowParameters(v) { + if (v) this.flags |= 2;else this.flags &= -3; + } + get inType() { + return (this.flags & 4) > 0; + } + set inType(v) { + if (v) this.flags |= 4;else this.flags &= -5; + } + get noAnonFunctionType() { + return (this.flags & 8) > 0; + } + set noAnonFunctionType(v) { + if (v) this.flags |= 8;else this.flags &= -9; + } + get hasFlowComment() { + return (this.flags & 16) > 0; + } + set hasFlowComment(v) { + if (v) this.flags |= 16;else this.flags &= -17; + } + get isAmbientContext() { + return (this.flags & 32) > 0; + } + set isAmbientContext(v) { + if (v) this.flags |= 32;else this.flags &= -33; + } + get inAbstractClass() { + return (this.flags & 64) > 0; + } + set inAbstractClass(v) { + if (v) this.flags |= 64;else this.flags &= -65; + } + get inDisallowConditionalTypesContext() { + return (this.flags & 128) > 0; + } + set inDisallowConditionalTypesContext(v) { + if (v) this.flags |= 128;else this.flags &= -129; + } + get soloAwait() { + return (this.flags & 256) > 0; + } + set soloAwait(v) { + if (v) this.flags |= 256;else this.flags &= -257; + } + get inFSharpPipelineDirectBody() { + return (this.flags & 512) > 0; + } + set inFSharpPipelineDirectBody(v) { + if (v) this.flags |= 512;else this.flags &= -513; + } + get canStartJSXElement() { + return (this.flags & 1024) > 0; + } + set canStartJSXElement(v) { + if (v) this.flags |= 1024;else this.flags &= -1025; + } + get containsEsc() { + return (this.flags & 2048) > 0; + } + set containsEsc(v) { + if (v) this.flags |= 2048;else this.flags &= -2049; + } + get hasTopLevelAwait() { + return (this.flags & 4096) > 0; + } + set hasTopLevelAwait(v) { + if (v) this.flags |= 4096;else this.flags &= -4097; + } + curPosition() { + return new Position(this.curLine, this.pos - this.lineStart, this.pos); + } + clone() { + const state = new State(); + state.flags = this.flags; + state.curLine = this.curLine; + state.lineStart = this.lineStart; + state.startLoc = this.startLoc; + state.endLoc = this.endLoc; + state.errors = this.errors.slice(); + state.potentialArrowAt = this.potentialArrowAt; + state.noArrowAt = this.noArrowAt.slice(); + state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); + state.topicContext = this.topicContext; + state.labels = this.labels.slice(); + state.commentsLen = this.commentsLen; + state.commentStack = this.commentStack.slice(); + state.pos = this.pos; + state.type = this.type; + state.value = this.value; + state.start = this.start; + state.end = this.end; + state.lastTokEndLoc = this.lastTokEndLoc; + state.lastTokStartLoc = this.lastTokStartLoc; + state.context = this.context.slice(); + state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; + state.strictErrors = this.strictErrors; + state.tokensLength = this.tokensLength; + return state; + } + } + var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; + }; + const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) + }; + const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 + }; + function readStringContents(type, input, pos, lineStart, curLine, errors) { + const initialPos = pos; + const initialLineStart = lineStart; + const initialCurLine = curLine; + let out = ""; + let firstInvalidLoc = null; + let chunkStart = pos; + const { + length + } = input; + for (;;) { + if (pos >= length) { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + out += input.slice(chunkStart, pos); + break; + } + const ch = input.charCodeAt(pos); + if (isStringEnd(type, ch, input, pos)) { + out += input.slice(chunkStart, pos); + break; + } + if (ch === 92) { + out += input.slice(chunkStart, pos); + const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); + if (res.ch === null && !firstInvalidLoc) { + firstInvalidLoc = { + pos, + lineStart, + curLine + }; + } else { + out += res.ch; + } + ({ + pos, + lineStart, + curLine + } = res); + chunkStart = pos; + } else if (ch === 8232 || ch === 8233) { + ++pos; + ++curLine; + lineStart = pos; + } else if (ch === 10 || ch === 13) { + if (type === "template") { + out += input.slice(chunkStart, pos) + "\n"; + ++pos; + if (ch === 13 && input.charCodeAt(pos) === 10) { + ++pos; + } + ++curLine; + chunkStart = lineStart = pos; + } else { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + } + } else { + ++pos; + } + } + return { + pos, + str: out, + firstInvalidLoc, + lineStart, + curLine, + containsInvalid: !!firstInvalidLoc + }; + } + function isStringEnd(type, ch, input, pos) { + if (type === "template") { + return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; + } + return ch === (type === "double" ? 34 : 39); + } + function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { + const throwOnInvalid = !inTemplate; + pos++; + const res = ch => ({ + pos, + ch, + lineStart, + curLine + }); + const ch = input.charCodeAt(pos++); + switch (ch) { + case 110: + return res("\n"); + case 114: + return res("\r"); + case 120: + { + let code; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCharCode(code)); + } + case 117: + { + let code; + ({ + code, + pos + } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCodePoint(code)); + } + case 116: + return res("\t"); + case 98: + return res("\b"); + case 118: + return res("\u000b"); + case 102: + return res("\f"); + case 13: + if (input.charCodeAt(pos) === 10) { + ++pos; + } + case 10: + lineStart = pos; + ++curLine; + case 8232: + case 8233: + return res(""); + case 56: + case 57: + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(pos - 1, lineStart, curLine); + } + default: + if (ch >= 48 && ch <= 55) { + const startPos = pos - 1; + const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + pos += octalStr.length - 1; + const next = input.charCodeAt(pos); + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(startPos, lineStart, curLine); + } + } + return res(String.fromCharCode(octal)); + } + return res(String.fromCharCode(ch)); + } + } + function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { + const initialPos = pos; + let n; + ({ + n, + pos + } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); + if (n === null) { + if (throwOnInvalid) { + errors.invalidEscapeSequence(initialPos, lineStart, curLine); + } else { + pos = initialPos - 1; + } + } + return { + code: n, + pos + }; + } + function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { + const start = pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = input.charCodeAt(pos); + let val; + if (code === 95 && allowNumSeparator !== "bail") { + const prev = input.charCodeAt(pos - 1); + const next = input.charCodeAt(pos + 1); + if (!allowNumSeparator) { + if (bailOnError) return { + n: null, + pos + }; + errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + if (bailOnError) return { + n: null, + pos + }; + errors.unexpectedNumericSeparator(pos, lineStart, curLine); + } + ++pos; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + if (val <= 9 && bailOnError) { + return { + n: null, + pos + }; + } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { + val = 0; + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + ++pos; + total = total * radix + val; + } + if (pos === start || len != null && pos - start !== len || invalid) { + return { + n: null, + pos + }; + } + return { + n: total, + pos + }; + } + function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { + const ch = input.charCodeAt(pos); + let code; + if (ch === 123) { + ++pos; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); + ++pos; + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + errors.invalidCodePoint(pos, lineStart, curLine); + } else { + return { + code: null, + pos + }; + } + } + } else { + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); + } + return { + code, + pos + }; + } + function buildPosition(pos, lineStart, curLine) { + return new Position(curLine, pos - lineStart, pos); + } + const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); + class Token { + constructor(state) { + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); + } + } + class Tokenizer extends CommentsParser { + constructor(options, input) { + super(); + this.isLookahead = void 0; + this.tokens = []; + this.errorHandlers_readInt = { + invalidDigit: (pos, lineStart, curLine, radix) => { + if (!this.options.errorRecovery) return false; + this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { + radix + }); + return true; + }, + numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), + unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) + }; + this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { + invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), + invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) + }); + this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: (pos, lineStart, curLine) => { + this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); + }, + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); + } + }); + this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); + } + }); + this.state = new State(); + this.state.init(options); + this.input = input; + this.length = input.length; + this.comments = []; + this.isLookahead = false; + } + pushToken(token) { + this.tokens.length = this.state.tokensLength; + this.tokens.push(token); + ++this.state.tokensLength; + } + next() { + this.checkKeywordEscapes(); + if (this.options.tokens) { + this.pushToken(new Token(this.state)); + } + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + } + eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + } + match(type) { + return this.state.type === type; + } + createLookaheadState(state) { + return { + pos: state.pos, + value: null, + type: state.type, + start: state.start, + end: state.end, + context: [this.curContext()], + inType: state.inType, + startLoc: state.startLoc, + lastTokEndLoc: state.lastTokEndLoc, + curLine: state.curLine, + lineStart: state.lineStart, + curPosition: state.curPosition + }; + } + lookahead() { + const old = this.state; + this.state = this.createLookaheadState(old); + this.isLookahead = true; + this.nextToken(); + this.isLookahead = false; + const curr = this.state; + this.state = old; + return curr; + } + nextTokenStart() { + return this.nextTokenStartSince(this.state.pos); + } + nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; + } + lookaheadCharCode() { + return this.input.charCodeAt(this.nextTokenStart()); + } + nextTokenInLineStart() { + return this.nextTokenInLineStartSince(this.state.pos); + } + nextTokenInLineStartSince(pos) { + skipWhiteSpaceInLine.lastIndex = pos; + return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; + } + lookaheadInLineCharCode() { + return this.input.charCodeAt(this.nextTokenInLineStart()); + } + codePointAtPos(pos) { + let cp = this.input.charCodeAt(pos); + if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { + const trail = this.input.charCodeAt(pos); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + return cp; + } + setStrict(strict) { + this.state.strict = strict; + if (strict) { + this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); + this.state.strictErrors.clear(); + } + } + curContext() { + return this.state.context[this.state.context.length - 1]; + } + nextToken() { + this.skipSpace(); + this.state.start = this.state.pos; + if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.length) { + this.finishToken(139); + return; + } + this.getTokenFromCode(this.codePointAtPos(this.state.pos)); + } + skipBlockComment(commentEnd) { + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + const start = this.state.pos; + const end = this.input.indexOf(commentEnd, start + 2); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + this.state.pos = end + commentEnd.length; + lineBreakG.lastIndex = start + 2; + while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { + ++this.state.curLine; + this.state.lineStart = lineBreakG.lastIndex; + } + if (this.isLookahead) return; + const comment = { + type: "CommentBlock", + value: this.input.slice(start + 2, end), + start, + end: end + commentEnd.length, + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + skipLineComment(startSkip) { + const start = this.state.pos; + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + let ch = this.input.charCodeAt(this.state.pos += startSkip); + if (this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + } + if (this.isLookahead) return; + const end = this.state.pos; + const value = this.input.slice(start + startSkip, end); + const comment = { + type: "CommentLine", + value, + start, + end, + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + skipSpace() { + const spaceStart = this.state.pos; + const comments = []; + loop: while (this.state.pos < this.length) { + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 32: + case 160: + case 9: + ++this.state.pos; + break; + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + case 47: + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + { + const comment = this.skipBlockComment("*/"); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + break; + } + case 47: + { + const comment = this.skipLineComment(2); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + break; + } + default: + break loop; + } + break; + default: + if (isWhitespace(ch)) { + ++this.state.pos; + } else if (ch === 45 && !this.inModule && this.options.annexB) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { + const comment = this.skipLineComment(3); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else if (ch === 60 && !this.inModule && this.options.annexB) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { + const comment = this.skipLineComment(4); + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else { + break loop; + } + } + } + if (comments.length > 0) { + const end = this.state.pos; + const commentWhitespace = { + start: spaceStart, + end, + comments, + leadingNode: null, + trailingNode: null, + containingNode: null + }; + this.state.commentStack.push(commentWhitespace); + } + } + finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + const prevType = this.state.type; + this.state.type = type; + this.state.value = val; + if (!this.isLookahead) { + this.updateContext(prevType); + } + } + replaceToken(type) { + this.state.type = type; + this.updateContext(); + } + readToken_numberSign() { + if (this.state.pos === 0 && this.readToken_interpreter()) { + return; + } + const nextPos = this.state.pos + 1; + const next = this.codePointAtPos(nextPos); + if (next >= 48 && next <= 57) { + throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); + } + if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { + this.expectPlugin("recordAndTuple"); + if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { + throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + if (next === 123) { + this.finishToken(7); + } else { + this.finishToken(1); + } + } else if (isIdentifierStart(next)) { + ++this.state.pos; + this.finishToken(138, this.readWord1(next)); + } else if (next === 92) { + ++this.state.pos; + this.finishToken(138, this.readWord1()); + } else { + this.finishOp(27, 1); + } + } + readToken_dot() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next >= 48 && next <= 57) { + this.readNumber(true); + return; + } + if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { + this.state.pos += 3; + this.finishToken(21); + } else { + ++this.state.pos; + this.finishToken(16); + } + } + readToken_slash() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(31, 2); + } else { + this.finishOp(56, 1); + } + } + readToken_interpreter() { + if (this.state.pos !== 0 || this.length < 2) return false; + let ch = this.input.charCodeAt(this.state.pos + 1); + if (ch !== 33) return false; + const start = this.state.pos; + this.state.pos += 1; + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + const value = this.input.slice(start + 2, this.state.pos); + this.finishToken(28, value); + return true; + } + readToken_mult_modulo(code) { + let type = code === 42 ? 55 : 54; + let width = 1; + let next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 42) { + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = 57; + } + if (next === 61 && !this.state.inType) { + width++; + type = code === 37 ? 33 : 30; + } + this.finishOp(type, width); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + if (this.input.charCodeAt(this.state.pos + 2) === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(code === 124 ? 41 : 42, 2); + } + return; + } + if (code === 124) { + if (next === 62) { + this.finishOp(39, 2); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 125) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(9); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 93) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(4); + return; + } + } + if (next === 61) { + this.finishOp(30, 2); + return; + } + this.finishOp(code === 124 ? 43 : 45, 1); + } + readToken_caret() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61 && !this.state.inType) { + this.finishOp(32, 2); + } else if (next === 94 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "^^" + }])) { + this.finishOp(37, 2); + const lookaheadCh = this.input.codePointAt(this.state.pos); + if (lookaheadCh === 94) { + this.unexpected(); + } + } else { + this.finishOp(44, 1); + } + } + readToken_atSign() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 64 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "@@" + }])) { + this.finishOp(38, 2); + } else { + this.finishOp(26, 1); + } + } + readToken_plus_min(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + this.finishOp(34, 2); + return; + } + if (next === 61) { + this.finishOp(30, 2); + } else { + this.finishOp(53, 1); + } + } + readToken_lt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 60) { + if (this.input.charCodeAt(pos + 2) === 61) { + this.finishOp(30, 3); + return; + } + this.finishOp(51, 2); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(47, 1); + } + readToken_gt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 62) { + const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(pos + size) === 61) { + this.finishOp(30, size + 1); + return; + } + this.finishOp(52, size); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(48, 1); + } + readToken_eq_excl(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); + return; + } + if (code === 61 && next === 62) { + this.state.pos += 2; + this.finishToken(19); + return; + } + this.finishOp(code === 61 ? 29 : 35, 1); + } + readToken_question() { + const next = this.input.charCodeAt(this.state.pos + 1); + const next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 63) { + if (next2 === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(40, 2); + } + } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { + this.state.pos += 2; + this.finishToken(18); + } else { + ++this.state.pos; + this.finishToken(17); + } + } + getTokenFromCode(code) { + switch (code) { + case 46: + this.readToken_dot(); + return; + case 40: + ++this.state.pos; + this.finishToken(10); + return; + case 41: + ++this.state.pos; + this.finishToken(11); + return; + case 59: + ++this.state.pos; + this.finishToken(13); + return; + case 44: + ++this.state.pos; + this.finishToken(12); + return; + case 91: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(2); + } else { + ++this.state.pos; + this.finishToken(0); + } + return; + case 93: + ++this.state.pos; + this.finishToken(3); + return; + case 123: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(6); + } else { + ++this.state.pos; + this.finishToken(5); + } + return; + case 125: + ++this.state.pos; + this.finishToken(8); + return; + case 58: + if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { + this.finishOp(15, 2); + } else { + ++this.state.pos; + this.finishToken(14); + } + return; + case 63: + this.readToken_question(); + return; + case 96: + this.readTemplateToken(); + return; + case 48: + { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 120 || next === 88) { + this.readRadixNumber(16); + return; + } + if (next === 111 || next === 79) { + this.readRadixNumber(8); + return; + } + if (next === 98 || next === 66) { + this.readRadixNumber(2); + return; + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + this.readNumber(false); + return; + case 34: + case 39: + this.readString(code); + return; + case 47: + this.readToken_slash(); + return; + case 37: + case 42: + this.readToken_mult_modulo(code); + return; + case 124: + case 38: + this.readToken_pipe_amp(code); + return; + case 94: + this.readToken_caret(); + return; + case 43: + case 45: + this.readToken_plus_min(code); + return; + case 60: + this.readToken_lt(); + return; + case 62: + this.readToken_gt(); + return; + case 61: + case 33: + this.readToken_eq_excl(code); + return; + case 126: + this.finishOp(36, 1); + return; + case 64: + this.readToken_atSign(); + return; + case 35: + this.readToken_numberSign(); + return; + case 92: + this.readWord(); + return; + default: + if (isIdentifierStart(code)) { + this.readWord(code); + return; + } + } + throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { + unexpected: String.fromCodePoint(code) + }); + } + finishOp(type, size) { + const str = this.input.slice(this.state.pos, this.state.pos + size); + this.state.pos += size; + this.finishToken(type, str); + } + readRegexp() { + const startLoc = this.state.startLoc; + const start = this.state.start + 1; + let escaped, inClass; + let { + pos + } = this.state; + for (;; ++pos) { + if (pos >= this.length) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + const ch = this.input.charCodeAt(pos); + if (isNewLine(ch)) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + if (escaped) { + escaped = false; + } else { + if (ch === 91) { + inClass = true; + } else if (ch === 93 && inClass) { + inClass = false; + } else if (ch === 47 && !inClass) { + break; + } + escaped = ch === 92; + } + } + const content = this.input.slice(start, pos); + ++pos; + let mods = ""; + const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); + while (pos < this.length) { + const cp = this.codePointAtPos(pos); + const char = String.fromCharCode(cp); + if (VALID_REGEX_FLAGS.has(cp)) { + if (cp === 118) { + if (mods.includes("u")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } else if (cp === 117) { + if (mods.includes("v")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } + if (mods.includes(char)) { + this.raise(Errors.DuplicateRegExpFlags, nextPos()); + } + } else if (isIdentifierChar(cp) || cp === 92) { + this.raise(Errors.MalformedRegExpFlags, nextPos()); + } else { + break; + } + ++pos; + mods += char; + } + this.state.pos = pos; + this.finishToken(137, { + pattern: content, + flags: mods + }); + } + readInt(radix, len, forceLen = false, allowNumSeparator = true) { + const { + n, + pos + } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); + this.state.pos = pos; + return n; + } + readRadixNumber(radix) { + const startLoc = this.state.curPosition(); + let isBigInt = false; + this.state.pos += 2; + const val = this.readInt(radix); + if (val == null) { + this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { + radix + }); + } + const next = this.input.charCodeAt(this.state.pos); + if (next === 110) { + ++this.state.pos; + isBigInt = true; + } else if (next === 109) { + throw this.raise(Errors.InvalidDecimal, startLoc); + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + if (isBigInt) { + const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); + this.finishToken(135, str); + return; + } + this.finishToken(134, val); + } + readNumber(startsWithDot) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isFloat = false; + let isBigInt = false; + let isDecimal = false; + let hasExponent = false; + let isOctal = false; + if (!startsWithDot && this.readInt(10) === null) { + this.raise(Errors.InvalidNumber, this.state.curPosition()); + } + const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (hasLeadingZero) { + const integer = this.input.slice(start, this.state.pos); + this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); + if (!this.state.strict) { + const underscorePos = integer.indexOf("_"); + if (underscorePos > 0) { + this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); + } + } + isOctal = hasLeadingZero && !/[89]/.test(integer); + } + let next = this.input.charCodeAt(this.state.pos); + if (next === 46 && !isOctal) { + ++this.state.pos; + this.readInt(10); + isFloat = true; + next = this.input.charCodeAt(this.state.pos); + } + if ((next === 69 || next === 101) && !isOctal) { + next = this.input.charCodeAt(++this.state.pos); + if (next === 43 || next === 45) { + ++this.state.pos; + } + if (this.readInt(10) === null) { + this.raise(Errors.InvalidOrMissingExponent, startLoc); + } + isFloat = true; + hasExponent = true; + next = this.input.charCodeAt(this.state.pos); + } + if (next === 110) { + if (isFloat || hasLeadingZero) { + this.raise(Errors.InvalidBigIntLiteral, startLoc); + } + ++this.state.pos; + isBigInt = true; + } + if (next === 109) { + this.expectPlugin("decimal", this.state.curPosition()); + if (hasExponent || hasLeadingZero) { + this.raise(Errors.InvalidDecimal, startLoc); + } + ++this.state.pos; + isDecimal = true; + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); + if (isBigInt) { + this.finishToken(135, str); + return; + } + if (isDecimal) { + this.finishToken(136, str); + return; + } + const val = isOctal ? parseInt(str, 8) : parseFloat(str); + this.finishToken(134, val); + } + readCodePoint(throwOnInvalid) { + const { + code, + pos + } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); + this.state.pos = pos; + return code; + } + readString(quote) { + const { + str, + pos, + curLine, + lineStart + } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + this.finishToken(133, str); + } + readTemplateContinuation() { + if (!this.match(8)) { + this.unexpected(null, 8); + } + this.state.pos--; + this.readTemplateToken(); + } + readTemplateToken() { + const opening = this.input[this.state.pos]; + const { + str, + firstInvalidLoc, + pos, + curLine, + lineStart + } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + if (firstInvalidLoc) { + this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos); + } + if (this.input.codePointAt(pos) === 96) { + this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); + } else { + this.state.pos++; + this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); + } + } + recordStrictModeErrors(toParseError, at) { + const index = at.index; + if (this.state.strict && !this.state.strictErrors.has(index)) { + this.raise(toParseError, at); + } else { + this.state.strictErrors.set(index, [toParseError, at]); + } + } + readWord1(firstCode) { + this.state.containsEsc = false; + let word = ""; + const start = this.state.pos; + let chunkStart = this.state.pos; + if (firstCode !== undefined) { + this.state.pos += firstCode <= 0xffff ? 1 : 2; + } + while (this.state.pos < this.length) { + const ch = this.codePointAtPos(this.state.pos); + if (isIdentifierChar(ch)) { + this.state.pos += ch <= 0xffff ? 1 : 2; + } else if (ch === 92) { + this.state.containsEsc = true; + word += this.input.slice(chunkStart, this.state.pos); + const escStart = this.state.curPosition(); + const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; + if (this.input.charCodeAt(++this.state.pos) !== 117) { + this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); + chunkStart = this.state.pos - 1; + continue; + } + ++this.state.pos; + const esc = this.readCodePoint(true); + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(Errors.EscapedCharNotAnIdentifier, escStart); + } + word += String.fromCodePoint(esc); + } + chunkStart = this.state.pos; + } else { + break; + } + } + return word + this.input.slice(chunkStart, this.state.pos); + } + readWord(firstCode) { + const word = this.readWord1(firstCode); + const type = keywords$1.get(word); + if (type !== undefined) { + this.finishToken(type, tokenLabelName(type)); + } else { + this.finishToken(132, word); + } + } + checkKeywordEscapes() { + const { + type + } = this.state; + if (tokenIsKeyword(type) && this.state.containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { + reservedWord: tokenLabelName(type) + }); + } + } + raise(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const error = toParseError(loc, details); + if (!this.options.errorRecovery) throw error; + if (!this.isLookahead) this.state.errors.push(error); + return error; + } + raiseOverwrite(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const pos = loc.index; + const errors = this.state.errors; + for (let i = errors.length - 1; i >= 0; i--) { + const error = errors[i]; + if (error.loc.index === pos) { + return errors[i] = toParseError(loc, details); + } + if (error.loc.index < pos) break; + } + return this.raise(toParseError, at, details); + } + updateContext(prevType) {} + unexpected(loc, type) { + throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { + expected: type ? tokenLabelName(type) : null + }); + } + expectPlugin(pluginName, loc) { + if (this.hasPlugin(pluginName)) { + return true; + } + throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { + missingPlugin: [pluginName] + }); + } + expectOnePlugin(pluginNames) { + if (!pluginNames.some(name => this.hasPlugin(name))) { + throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { + missingPlugin: pluginNames + }); + } + } + errorBuilder(error) { + return (pos, lineStart, curLine) => { + this.raise(error, buildPosition(pos, lineStart, curLine)); + }; + } + } + class ClassScope { + constructor() { + this.privateNames = new Set(); + this.loneAccessors = new Map(); + this.undefinedPrivateNames = new Map(); + } + } + class ClassScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = []; + this.undefinedPrivateNames = new Map(); + this.parser = parser; + } + current() { + return this.stack[this.stack.length - 1]; + } + enter() { + this.stack.push(new ClassScope()); + } + exit() { + const oldClassScope = this.stack.pop(); + const current = this.current(); + for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { + if (current) { + if (!current.undefinedPrivateNames.has(name)) { + current.undefinedPrivateNames.set(name, loc); + } + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } + } + declarePrivateName(name, elementType, loc) { + const { + privateNames, + loneAccessors, + undefinedPrivateNames + } = this.current(); + let redefined = privateNames.has(name); + if (elementType & 3) { + const accessor = redefined && loneAccessors.get(name); + if (accessor) { + const oldStatic = accessor & 4; + const newStatic = elementType & 4; + const oldKind = accessor & 3; + const newKind = elementType & 3; + redefined = oldKind === newKind || oldStatic !== newStatic; + if (!redefined) loneAccessors.delete(name); + } else if (!redefined) { + loneAccessors.set(name, elementType); + } + } + if (redefined) { + this.parser.raise(Errors.PrivateNameRedeclaration, loc, { + identifierName: name + }); + } + privateNames.add(name); + undefinedPrivateNames.delete(name); + } + usePrivateName(name, loc) { + let classScope; + for (classScope of this.stack) { + if (classScope.privateNames.has(name)) return; + } + if (classScope) { + classScope.undefinedPrivateNames.set(name, loc); + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } + } + class ExpressionScope { + constructor(type = 0) { + this.type = type; + } + canBeArrowParameterDeclaration() { + return this.type === 2 || this.type === 1; + } + isCertainlyParameterDeclaration() { + return this.type === 3; + } + } + class ArrowHeadParsingScope extends ExpressionScope { + constructor(type) { + super(type); + this.declarationErrors = new Map(); + } + recordDeclarationError(ParsingErrorClass, at) { + const index = at.index; + this.declarationErrors.set(index, [ParsingErrorClass, at]); + } + clearDeclarationError(index) { + this.declarationErrors.delete(index); + } + iterateErrors(iterator) { + this.declarationErrors.forEach(iterator); + } + } + class ExpressionScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = [new ExpressionScope()]; + this.parser = parser; + } + enter(scope) { + this.stack.push(scope); + } + exit() { + this.stack.pop(); + } + recordParameterInitializerError(toParseError, node) { + const origin = node.loc.start; + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (!scope.isCertainlyParameterDeclaration()) { + if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(toParseError, origin); + } else { + return; + } + scope = stack[--i]; + } + this.parser.raise(toParseError, origin); + } + recordArrowParameterBindingError(error, node) { + const { + stack + } = this; + const scope = stack[stack.length - 1]; + const origin = node.loc.start; + if (scope.isCertainlyParameterDeclaration()) { + this.parser.raise(error, origin); + } else if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(error, origin); + } else { + return; + } + } + recordAsyncArrowParametersError(at) { + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + if (scope.type === 2) { + scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); + } + scope = stack[--i]; + } + } + validateAsPattern() { + const { + stack + } = this; + const currentScope = stack[stack.length - 1]; + if (!currentScope.canBeArrowParameterDeclaration()) return; + currentScope.iterateErrors(([toParseError, loc]) => { + this.parser.raise(toParseError, loc); + let i = stack.length - 2; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + scope.clearDeclarationError(loc.index); + scope = stack[--i]; + } + }); + } + } + function newParameterDeclarationScope() { + return new ExpressionScope(3); + } + function newArrowHeadScope() { + return new ArrowHeadParsingScope(1); + } + function newAsyncArrowScope() { + return new ArrowHeadParsingScope(2); + } + function newExpressionScope() { + return new ExpressionScope(); + } + class ProductionParameterHandler { + constructor() { + this.stacks = []; + } + enter(flags) { + this.stacks.push(flags); + } + exit() { + this.stacks.pop(); + } + currentFlags() { + return this.stacks[this.stacks.length - 1]; + } + get hasAwait() { + return (this.currentFlags() & 2) > 0; + } + get hasYield() { + return (this.currentFlags() & 1) > 0; + } + get hasReturn() { + return (this.currentFlags() & 4) > 0; + } + get hasIn() { + return (this.currentFlags() & 8) > 0; + } + } + function functionFlags(isAsync, isGenerator) { + return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); + } + class UtilParser extends Tokenizer { + addExtra(node, key, value, enumerable = true) { + if (!node) return; + let { + extra + } = node; + if (extra == null) { + extra = {}; + node.extra = extra; + } + if (enumerable) { + extra[key] = value; + } else { + Object.defineProperty(extra, key, { + enumerable, + value + }); + } + } + isContextual(token) { + return this.state.type === token && !this.state.containsEsc; + } + isUnparsedContextual(nameStart, name) { + const nameEnd = nameStart + name.length; + if (this.input.slice(nameStart, nameEnd) === name) { + const nextCh = this.input.charCodeAt(nameEnd); + return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); + } + return false; + } + isLookaheadContextual(name) { + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); + } + eatContextual(token) { + if (this.isContextual(token)) { + this.next(); + return true; + } + return false; + } + expectContextual(token, toParseError) { + if (!this.eatContextual(token)) { + if (toParseError != null) { + throw this.raise(toParseError, this.state.startLoc); + } + this.unexpected(null, token); + } + } + canInsertSemicolon() { + return this.match(139) || this.match(8) || this.hasPrecedingLineBreak(); + } + hasPrecedingLineBreak() { + return hasNewLine(this.input, this.state.lastTokEndLoc.index, this.state.start); + } + hasFollowingLineBreak() { + return hasNewLine(this.input, this.state.end, this.nextTokenStart()); + } + isLineTerminator() { + return this.eat(13) || this.canInsertSemicolon(); + } + semicolon(allowAsi = true) { + if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; + this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); + } + expect(type, loc) { + if (!this.eat(type)) { + this.unexpected(loc, type); + } + } + tryParse(fn, oldState = this.state.clone()) { + const abortSignal = { + node: null + }; + try { + const node = fn((node = null) => { + abortSignal.node = node; + throw abortSignal; + }); + if (this.state.errors.length > oldState.errors.length) { + const failState = this.state; + this.state = oldState; + this.state.tokensLength = failState.tokensLength; + return { + node, + error: failState.errors[oldState.errors.length], + thrown: false, + aborted: false, + failState + }; + } + return { + node, + error: null, + thrown: false, + aborted: false, + failState: null + }; + } catch (error) { + const failState = this.state; + this.state = oldState; + if (error instanceof SyntaxError) { + return { + node: null, + error, + thrown: true, + aborted: false, + failState + }; + } + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + throw error; + } + } + checkExpressionErrors(refExpressionErrors, andThrow) { + if (!refExpressionErrors) return false; + const { + shorthandAssignLoc, + doubleProtoLoc, + privateKeyLoc, + optionalParametersLoc + } = refExpressionErrors; + const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; + if (!andThrow) { + return hasErrors; + } + if (shorthandAssignLoc != null) { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + if (doubleProtoLoc != null) { + this.raise(Errors.DuplicateProto, doubleProtoLoc); + } + if (privateKeyLoc != null) { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + if (optionalParametersLoc != null) { + this.unexpected(optionalParametersLoc); + } + } + isLiteralPropertyName() { + return tokenIsLiteralPropertyName(this.state.type); + } + isPrivateName(node) { + return node.type === "PrivateName"; + } + getPrivateNameSV(node) { + return node.id.name; + } + hasPropertyAsPrivateName(node) { + return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); + } + isObjectProperty(node) { + return node.type === "ObjectProperty"; + } + isObjectMethod(node) { + return node.type === "ObjectMethod"; + } + initializeScopes(inModule = this.options.sourceType === "module") { + const oldLabels = this.state.labels; + this.state.labels = []; + const oldExportedIdentifiers = this.exportedIdentifiers; + this.exportedIdentifiers = new Set(); + const oldInModule = this.inModule; + this.inModule = inModule; + const oldScope = this.scope; + const ScopeHandler = this.getScopeHandler(); + this.scope = new ScopeHandler(this, inModule); + const oldProdParam = this.prodParam; + this.prodParam = new ProductionParameterHandler(); + const oldClassScope = this.classScope; + this.classScope = new ClassScopeHandler(this); + const oldExpressionScope = this.expressionScope; + this.expressionScope = new ExpressionScopeHandler(this); + return () => { + this.state.labels = oldLabels; + this.exportedIdentifiers = oldExportedIdentifiers; + this.inModule = oldInModule; + this.scope = oldScope; + this.prodParam = oldProdParam; + this.classScope = oldClassScope; + this.expressionScope = oldExpressionScope; + }; + } + enterInitialScopes() { + let paramFlags = 0; + if (this.inModule) { + paramFlags |= 2; + } + this.scope.enter(1); + this.prodParam.enter(paramFlags); + } + checkDestructuringPrivate(refExpressionErrors) { + const { + privateKeyLoc + } = refExpressionErrors; + if (privateKeyLoc !== null) { + this.expectPlugin("destructuringPrivate", privateKeyLoc); + } + } + } + class ExpressionErrors { + constructor() { + this.shorthandAssignLoc = null; + this.doubleProtoLoc = null; + this.privateKeyLoc = null; + this.optionalParametersLoc = null; + } + } + class Node { + constructor(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + this.loc = new SourceLocation(loc); + if (parser != null && parser.options.ranges) this.range = [pos, 0]; + if (parser != null && parser.filename) this.loc.filename = parser.filename; + } + } + const NodePrototype = Node.prototype; + { + NodePrototype.__clone = function () { + const newNode = new Node(undefined, this.start, this.loc.start); + const keys = Object.keys(this); + for (let i = 0, length = keys.length; i < length; i++) { + const key = keys[i]; + if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { + newNode[key] = this[key]; + } + } + return newNode; + }; + } + function clonePlaceholder(node) { + return cloneIdentifier(node); + } + function cloneIdentifier(node) { + const { + type, + start, + end, + loc, + range, + extra, + name + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.extra = extra; + cloned.name = name; + if (type === "Placeholder") { + cloned.expectedNode = node.expectedNode; + } + return cloned; + } + function cloneStringLiteral(node) { + const { + type, + start, + end, + loc, + range, + extra + } = node; + if (type === "Placeholder") { + return clonePlaceholder(node); + } + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + if (node.raw !== undefined) { + cloned.raw = node.raw; + } else { + cloned.extra = extra; + } + cloned.value = node.value; + return cloned; + } + class NodeUtils extends UtilParser { + startNode() { + const loc = this.state.startLoc; + return new Node(this, loc.index, loc); + } + startNodeAt(loc) { + return new Node(this, loc.index, loc); + } + startNodeAtNode(type) { + return this.startNodeAt(type.loc.start); + } + finishNode(node, type) { + return this.finishNodeAt(node, type, this.state.lastTokEndLoc); + } + finishNodeAt(node, type, endLoc) { + node.type = type; + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + if (this.options.attachComment) this.processComment(node); + return node; + } + resetStartLocation(node, startLoc) { + node.start = startLoc.index; + node.loc.start = startLoc; + if (this.options.ranges) node.range[0] = startLoc.index; + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + } + resetStartLocationFromNode(node, locationNode) { + this.resetStartLocation(node, locationNode.loc.start); + } + } + const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); + const FlowErrors = ParseErrorEnum`flow`({ + AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", + AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", + AssignReservedType: ({ + reservedType + }) => `Cannot overwrite reserved type ${reservedType}.`, + DeclareClassElement: "The `declare` modifier can only appear on class fields.", + DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", + DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", + EnumBooleanMemberNotInitialized: ({ + memberName, + enumName + }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, + EnumDuplicateMemberName: ({ + memberName, + enumName + }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, + EnumInconsistentMemberValues: ({ + enumName + }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, + EnumInvalidExplicitType: ({ + invalidEnumType, + enumName + }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidExplicitTypeUnknownSupplied: ({ + enumName + }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerPrimaryType: ({ + enumName, + memberName, + explicitType + }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, + EnumInvalidMemberInitializerSymbolType: ({ + enumName, + memberName + }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerUnknownType: ({ + enumName, + memberName + }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, + EnumInvalidMemberName: ({ + enumName, + memberName, + suggestion + }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, + EnumNumberMemberNotInitialized: ({ + enumName, + memberName + }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, + EnumStringMemberInconsistentlyInitialized: ({ + enumName + }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, + GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", + ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", + InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", + InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", + InexactVariance: "Explicit inexact syntax cannot have variance.", + InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", + MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", + NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", + NestedFlowComment: "Cannot have a flow comment inside another flow comment.", + PatternIsOptional: Object.assign({ + message: "A binding pattern parameter cannot be optional in an implementation signature." + }, { + reasonCode: "OptionalBindingPattern" + }), + SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", + SpreadVariance: "Spread properties cannot have variance.", + ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", + ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", + ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", + ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", + ThisParamNoDefault: "The `this` parameter may not have a default value.", + TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", + UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", + UnexpectedReservedType: ({ + reservedType + }) => `Unexpected reserved type ${reservedType}.`, + UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", + UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", + UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", + UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', + UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", + UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.", + UnsupportedDeclareExportKind: ({ + unsupportedExportKind, + suggestion + }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, + UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", + UnterminatedFlowComment: "Unterminated flow-comment." + }); + function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); + } + function hasTypeImportKind(node) { + return node.importKind === "type" || node.importKind === "typeof"; + } + const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface" + }; + function partition(list, test) { + const list1 = []; + const list2 = []; + for (let i = 0; i < list.length; i++) { + (test(list[i], i, list) ? list1 : list2).push(list[i]); + } + return [list1, list2]; + } + const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; + var flow = superClass => class FlowParserMixin extends superClass { + constructor(...args) { + super(...args); + this.flowPragma = undefined; + } + getScopeHandler() { + return FlowScopeHandler; + } + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } + shouldParseEnums() { + return !!this.getPluginOption("flow", "enums"); + } + finishToken(type, val) { + if (type !== 133 && type !== 13 && type !== 28) { + if (this.flowPragma === undefined) { + this.flowPragma = null; + } + } + super.finishToken(type, val); + } + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + if (!matches) ;else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; + } else { + throw new Error("Unexpected flow pragma"); + } + } + super.addComment(comment); + } + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || 14); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + this.next(); + this.expectContextual(110); + if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); + } + if (this.eat(10)) { + node.value = super.parseExpression(); + this.expect(11); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(14); + let type = null; + let predicate = null; + if (this.match(54)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + if (this.match(54)) { + predicate = this.flowParsePredicate(); + } + } + return [type, predicate]; + } + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + if (this.match(47)) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + this.expect(10); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + typeNode.this = tmp._this; + this.expect(11); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + this.scope.declareName(node.id.name, 2048, node.id.loc.start); + return this.finishNode(node, "DeclareFunction"); + } + flowParseDeclare(node, insideModule) { + if (this.match(80)) { + return this.flowParseDeclareClass(node); + } else if (this.match(68)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(74)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual(127)) { + if (this.match(16)) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) { + this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); + } + return this.flowParseDeclareModule(node); + } + } else if (this.isContextual(130)) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual(131)) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual(129)) { + return this.flowParseDeclareInterface(node); + } else if (this.match(82)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } else { + this.unexpected(); + } + } + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, 5, node.id.loc.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + flowParseDeclareModule(node) { + this.scope.enter(0); + if (this.match(133)) { + node.id = super.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(5); + while (!this.match(8)) { + let bodyNode = this.startNode(); + if (this.match(83)) { + this.next(); + if (!this.isContextual(130) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); + } + super.parseImport(bodyNode); + } else { + this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); + bodyNode = this.flowParseDeclare(bodyNode, true); + } + body.push(bodyNode); + } + this.scope.exit(); + this.expect(8); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); + } + if (kind === "ES") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(82); + if (this.eat(65)) { + if (this.match(68) || this.match(80)) { + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { + const label = this.state.value; + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { + unsupportedExportKind: label, + suggestion: exportSuggestions[label] + }); + } + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { + node = this.parseExport(node, null); + if (node.type === "ExportNamedDeclaration") { + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } + node.type = "Declare" + node.type; + return node; + } + } + this.unexpected(); + } + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual(111); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + flowParseDeclareTypeAlias(node) { + this.next(); + const finished = this.flowParseTypeAlias(node); + finished.type = "DeclareTypeAlias"; + return finished; + } + flowParseDeclareOpaqueType(node) { + this.next(); + const finished = this.flowParseOpaqueType(node, true); + finished.type = "DeclareOpaqueType"; + return finished; + } + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "DeclareInterface"); + } + flowParseInterfaceish(node, isClass) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(12)); + } + if (isClass) { + node.implements = []; + node.mixins = []; + if (this.eatContextual(117)) { + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + if (this.eatContextual(113)) { + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + } + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + return this.finishNode(node, "InterfaceExtends"); + } + flowParseInterface(node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); + } + checkNotUnderscore(word) { + if (word === "_") { + this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); + } + } + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { + reservedType: word + }); + } + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.startLoc, declaration); + return this.parseIdentifier(liberal); + } + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.right = this.flowParseTypeInitialiser(29); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } + flowParseOpaqueType(node, declare) { + this.expectContextual(130); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.supertype = null; + if (this.match(14)) { + node.supertype = this.flowParseTypeInitialiser(14); + } + node.impltype = null; + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(29); + } + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + flowParseTypeParameter(requireDefault = false) { + const nodeStartLoc = this.state.startLoc; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + if (this.match(29)) { + this.eat(29); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); + } + } + return this.finishNode(node, "TypeParameter"); + } + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + if (this.match(47) || this.match(142)) { + this.next(); + } else { + this.unexpected(); + } + let defaultRequired = false; + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + if (typeParameter.default) { + defaultRequired = true; + } + if (!this.match(48)) { + this.expect(12); + } + } while (!this.match(48)); + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; + while (!this.match(48)) { + node.params.push(this.flowParseType()); + if (!this.match(48)) { + this.expect(12); + } + } + this.state.noAnonFunctionType = oldNoAnonFunctionType; + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseTypeParameterInstantiationCallOrNew() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + while (!this.match(48)) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + if (!this.match(48)) { + this.expect(12); + } + } + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual(129); + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + flowParseObjectPropertyKey() { + return this.match(134) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true); + } + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + if (this.lookahead().type === 14) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + this.expect(3); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(3); + this.expect(3); + if (this.match(47) || this.match(10)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + } else { + node.method = false; + if (this.eat(17)) { + node.optional = true; + } + node.value = this.flowParseTypeInitialiser(); + } + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + node.this = null; + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + this.expect(10); + if (this.match(78)) { + node.this = this.flowParseFunctionTypeParam(true); + node.this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + node.params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + node.rest = this.flowParseFunctionTypeParam(false); + } + this.expect(11); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + if (allowExact && this.match(6)) { + this.expect(6); + endDelim = 9; + exact = true; + } else { + this.expect(5); + endDelim = 8; + exact = false; + } + nodeStart.exact = exact; + while (!this.match(endDelim)) { + let isStatic = false; + let protoStartLoc = null; + let inexactStartLoc = null; + const node = this.startNode(); + if (allowProto && this.isContextual(118)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + protoStartLoc = this.state.startLoc; + allowStatic = false; + } + } + if (allowStatic && this.isContextual(106)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + isStatic = true; + } + } + const variance = this.flowParseVariance(); + if (this.eat(0)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (this.eat(0)) { + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); + } else { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(10) || this.match(47)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + if (this.isContextual(99) || this.isContextual(104)) { + const lookahead = this.lookahead(); + if (tokenIsLiteralPropertyName(lookahead.type)) { + kind = this.state.value; + this.next(); + } + } + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + if (propOrInexact === null) { + inexact = true; + inexactStartLoc = this.state.lastTokStartLoc; + } else { + nodeStart.properties.push(propOrInexact); + } + } + this.flowObjectTypeSemicolon(); + if (inexactStartLoc && !this.match(8) && !this.match(9)) { + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); + } + } + this.expect(endDelim); + if (allowSpread) { + nodeStart.inexact = inexact; + } + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } + flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { + if (this.eat(21)) { + const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); + if (isInexactToken) { + if (!allowSpread) { + this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); + } else if (!allowInexact) { + this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); + } + if (variance) { + this.raise(FlowErrors.InexactVariance, variance); + } + return null; + } + if (!allowSpread) { + this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); + } + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.raise(FlowErrors.SpreadVariance, variance); + } + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStartLoc != null; + node.kind = kind; + let optional = false; + if (this.match(47) || this.match(10)) { + node.method = true; + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } + if (!allowSpread && node.key.name === "constructor" && node.value.this) { + this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); + } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; + if (this.eat(17)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + } + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } + } + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + if (property.value.this) { + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); + } + if (length !== paramCount) { + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); + } + if (property.kind === "set" && property.value.rest) { + this.raise(Errors.BadSetterRestParameter, property); + } + } + flowObjectTypeSemicolon() { + if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { + this.unexpected(); + } + } + flowParseQualifiedTypeIdentifier(startLoc, id) { + var _startLoc; + (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + while (this.eat(16)) { + const node2 = this.startNodeAt(startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + return node; + } + flowParseGenericType(startLoc, id) { + const node = this.startNodeAt(startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + return this.finishNode(node, "GenericTypeAnnotation"); + } + flowParseTypeofType() { + const node = this.startNode(); + this.expect(87); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(0); + while (this.state.pos < this.length && !this.match(3)) { + node.types.push(this.flowParseType()); + if (this.match(3)) break; + this.expect(12); + } + this.expect(3); + return this.finishNode(node, "TupleTypeAnnotation"); + } + flowParseFunctionTypeParam(first) { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + const isThis = this.state.type === 78; + if (lh.type === 14 || lh.type === 17) { + if (isThis && !first) { + this.raise(FlowErrors.ThisParamMustBeFirst, node); + } + name = this.parseIdentifier(isThis); + if (this.eat(17)) { + optional = true; + if (isThis) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, node); + } + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + flowParseFunctionTypeParams(params = []) { + let rest = null; + let _this = null; + if (this.match(78)) { + _this = this.flowParseFunctionTypeParam(true); + _this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + rest = this.flowParseFunctionTypeParam(false); + } + return { + params, + rest, + _this + }; + } + flowIdentToTypeAnnotation(startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startLoc, id); + } + } + flowParsePrimaryType() { + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + switch (this.state.type) { + case 5: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); + case 6: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); + case 0: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + case 47: + { + const node = this.startNode(); + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(10); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 10: + { + const node = this.startNode(); + this.next(); + if (!this.match(11) && !this.match(21)) { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + const token = this.lookahead().type; + isGroupedType = token !== 17 && token !== 14; + } else { + isGroupedType = true; + } + } + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { + this.expect(11); + return type; + } else { + this.eat(12); + } + } + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 133: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case 85: + case 86: + node.value = this.match(85); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case 53: + if (this.state.value === "-") { + this.next(); + if (this.match(134)) { + return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); + } + if (this.match(135)) { + return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); + } + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); + } + this.unexpected(); + return; + case 134: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case 135: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + case 88: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); + case 84: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + case 78: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + case 55: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + case 87: + return this.flowParseTypeofType(); + default: + if (tokenIsKeyword(this.state.type)) { + const label = tokenLabelName(this.state.type); + this.next(); + return super.createIdentifier(node, label); + } else if (tokenIsIdentifier(this.state.type)) { + if (this.isContextual(129)) { + return this.flowParseInterfaceType(); + } + return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); + } + } + this.unexpected(); + } + flowParsePostfixType() { + const startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + let seenOptionalIndexedAccess = false; + while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + const optional = this.eat(18); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; + this.expect(0); + if (!optional && this.match(3)) { + node.elementType = type; + this.next(); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(3); + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode(node, "OptionalIndexedAccessType"); + } else { + type = this.finishNode(node, "IndexedAccessType"); + } + } + } + return type; + } + flowParsePrefixType() { + const node = this.startNode(); + if (this.eat(17)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + if (!this.state.noAnonFunctionType && this.eat(19)) { + const node = this.startNodeAt(param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.this = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + return param; + } + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(45); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + while (this.eat(45)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + flowParseUnionType() { + const node = this.startNode(); + this.eat(43); + const type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(43)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === 132 && this.state.value === "_") { + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startLoc, node); + } else { + return this.flowParseType(); + } + } + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + if (this.match(14)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + return ident; + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + flowParseVariance() { + let variance = null; + if (this.match(53)) { + variance = this.startNode(); + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + this.next(); + return this.finishNode(variance, "Variance"); + } + return variance; + } + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + return; + } + super.parseFunctionBody(node, false, isMethod); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + parseStatementLike(flags) { + if (this.state.strict && this.isContextual(129)) { + const lookahead = this.lookahead(); + if (tokenIsKeywordOrIdentifier(lookahead.type)) { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } + } else if (this.shouldParseEnums() && this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + const stmt = super.parseStatementLike(flags); + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } + return stmt; + } + parseExpressionStatement(node, expr, decorators) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { + return this.flowParseDeclare(node); + } + } else if (tokenIsIdentifier(this.state.type)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); + } + } + } + return super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) { + return !this.state.containsEsc; + } + return super.shouldParseExportDeclaration(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) { + return this.state.containsEsc; + } + return super.isExportDefaultSpecifier(); + } + parseExportDefaultExpression() { + if (this.shouldParseEnums() && this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + return super.parseExportDefaultExpression(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + this.expect(17); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } + if (failed && valid.length > 1) { + this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); + } + if (failed && valid.length === 1) { + this.state = state; + noArrowAt.push(valid[0].start); + this.state.noArrowAt = noArrowAt; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } + } + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(14); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(14); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + while (stack.length !== 0) { + const node = stack.pop(); + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + finishArrowValidation(node) { + var _node$extra; + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); + this.scope.enter(2 | 4); + super.checkParams(node, false, true); + this.scope.exit(); + } + forwardNoArrowParamsConversionAt(node, parse) { + let result; + if (this.state.noArrowParamsConversionAt.includes(node.start)) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + return result; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = newNode; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + return newNode; + } + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + super.assertModuleNodeAllowed(node); + } + parseExportDeclaration(node) { + if (this.isContextual(130)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + if (this.match(5)) { + node.specifiers = this.parseExportSpecifiers(true); + super.parseExportFrom(node); + return null; + } else { + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual(131)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual(129)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.shouldParseEnums() && this.isContextual(126)) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + eatExportStar(node) { + if (super.eatExportStar(node)) return true; + if (this.isContextual(130) && this.lookahead().type === 55) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + const { + startLoc + } = this.state; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + if (hasNamespace && node.exportKind === "type") { + this.unexpected(startLoc); + } + return hasNamespace; + } + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } + parseClassMember(classBody, member, state) { + const { + startLoc + } = this.state; + if (this.isContextual(125)) { + if (super.parseClassMemberFromModifier(classBody, member)) { + return; + } + member.declare = true; + } + super.parseClassMember(classBody, member, state); + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { + this.raise(FlowErrors.DeclareClassElement, startLoc); + } else if (member.value) { + this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); + } + } + } + isIterator(word) { + return word === "iterator" || word === "asyncIterator"; + } + readIterator() { + const word = super.readWord1(); + const fullWord = "@@" + word; + if (!this.isIterator(word) || !this.state.inType) { + this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { + identifierName: fullWord + }); + } + this.finishToken(132, fullWord); + } + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 123 && next === 124) { + this.finishOp(6, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + this.finishOp(code === 62 ? 48 : 47, 1); + } else if (this.state.inType && code === 63) { + if (next === 46) { + this.finishOp(18, 2); + } else { + this.finishOp(17, 1); + } + } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { + this.state.pos += 2; + this.readIterator(); + } else { + super.getTokenFromCode(code); + } + } + isAssignable(node, isBinding) { + if (node.type === "TypeCastExpression") { + return this.isAssignable(node.expression, isBinding); + } else { + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + super.toAssignable(node, isLHS); + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); + } + } + return exprList; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + return node; + } + isValidLVal(type, isParenthesized, binding) { + return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); + } + parseClassProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassPrivateProperty(node); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(14) || super.isClassProperty(); + } + isNonstaticConstructor(method) { + return !this.match(14) && super.isNonstaticConstructor(method); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + if (method.params && isConstructor) { + const params = method.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { + const params = method.value.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && this.match(47)) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + if (this.isContextual(113)) { + this.next(); + const implemented = node.implements = []; + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(12)); + } + } + checkGetterSetterParams(method) { + super.checkGetterSetterParams(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length > 0) { + const param = params[0]; + if (this.isThisParam(param) && method.kind === "get") { + this.raise(FlowErrors.GetterMayNotHaveThisParam, param); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.SetterMayNotHaveThisParam, param); + } + } + } + parsePropertyNamePrefixOperator(node) { + node.variance = this.flowParseVariance(); + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.loc.start); + } + delete prop.variance; + let typeParameters; + if (this.match(47) && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(10)) this.unexpected(); + } + const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + if (typeParameters) { + (result.value || result).typeParameters = typeParameters; + } + return result; + } + parseAssignableListItemTypes(param) { + if (this.eat(17)) { + if (param.type !== "Identifier") { + this.raise(FlowErrors.PatternIsOptional, param); + } + if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, param); + } + param.optional = true; + } + if (this.match(14)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamAnnotationRequired, param); + } + if (this.match(29) && this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamNoDefault, param); + } + this.resetEndLocation(param); + return param; + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); + } + return node; + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + if (!isExport) return true; + const ch = this.lookaheadCharCode(); + return ch === 123 || ch === 42; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + if (!phase && this.match(65)) { + return; + } + node.exportKind = phase === "type" ? phase : "value"; + } else { + if (phase === "type" && this.match(55)) this.unexpected(); + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + const firstIdent = specifier.imported; + let specifierTypeKind = null; + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } + let isBinding = false; + if (this.isContextual(93) && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = cloneIdentifier(as_ident); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else { + if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + } else { + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: firstIdent.value + }); + } + specifier.imported = firstIdent; + specifier.importKind = null; + } + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = cloneIdentifier(specifier.imported); + } + } + const specifierIsTypeImport = hasTypeImportKind(specifier); + if (isInTypeOnlyImport && specifierIsTypeImport) { + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); + } + if (isInTypeOnlyImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); + } + if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); + } + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + default: + return super.parseBindingAtom(); + } + } + parseFunctionParams(node, isConstructor) { + const kind = node.kind; + if (kind !== "get" && kind !== "set" && this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (this.match(14)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx; + let state = null; + let jsx; + if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { + var _jsx2, _jsx3; + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + if (expr.type !== "ArrowFunctionExpression") abort(); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); + } + return arrow.node; + } + arrowExpression = arrow.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); + } + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(19)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } + return super.parseArrow(node); + } + shouldParseArrow(params) { + return this.match(14) || super.shouldParseArrow(params); + } + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.includes(node.start)) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(node.start)) { + return; + } + for (let i = 0; i < node.params.length; i++) { + if (this.isThisParam(node.params[i]) && i > 0) { + this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); + } + } + super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); + } + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.state.start)); + } + parseSubscripts(base, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = super.parseCallExpressionArguments(11, false); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + if (result.node) { + this.state = result.failState; + return result.node; + } + throw arrow.error || result.error; + } + return super.parseSubscripts(base, startLoc, noCalls); + } + parseSubscript(base, startLoc, noCalls, subscriptState) { + if (this.match(18) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + if (noCalls) { + subscriptState.stop = true; + return base; + } + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiation(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(11, false); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { + const node = this.startNodeAt(startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + this.expect(10); + node.arguments = super.parseCallExpressionArguments(11, false); + if (subscriptState.optionalChainMember) { + node.optional = false; + } + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; + } + } + return super.parseSubscript(base, startLoc, noCalls, subscriptState); + } + parseNewCallee(node) { + super.parseNewCallee(node); + let targs = null; + if (this.shouldParseTypes() && this.match(47)) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; + } + node.typeArguments = targs; + } + parseAsyncArrowWithTypeParameters(startLoc) { + const node = this.startNodeAt(startLoc); + this.parseFunctionParams(node, false); + if (!this.parseArrow(node)) return; + return super.parseArrowExpression(node, undefined, true); + } + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } + super.readToken_mult_modulo(code); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 124 && next === 125) { + this.finishOp(9, 2); + return; + } + super.readToken_pipe_amp(code); + } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); + if (this.state.hasFlowComment) { + this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); + } + return fileNode; + } + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); + } + this.hasFlowCommentCompletion(); + const commentSkip = this.skipFlowComment(); + if (commentSkip) { + this.state.pos += commentSkip; + this.state.hasFlowComment = true; + } + return; + } + return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); + } + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; + } + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + return false; + } + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + } + flowEnumErrorBooleanMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { + memberName, + enumName + }); + } + flowEnumErrorInvalidMemberInitializer(loc, enumContext) { + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); + } + flowEnumErrorNumberMemberNotInitialized(loc, details) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); + } + flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); + } + flowEnumMemberInit() { + const startLoc = this.state.startLoc; + const endOfInit = () => this.match(12) || this.match(8); + switch (this.state.type) { + case 134: + { + const literal = this.parseNumericLiteral(this.state.value); + if (endOfInit()) { + return { + type: "number", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 133: + { + const literal = this.parseStringLiteral(this.state.value); + if (endOfInit()) { + return { + type: "string", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 85: + case 86: + { + const literal = this.parseBooleanLiteral(this.match(85)); + if (endOfInit()) { + return { + type: "boolean", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + default: + return { + type: "invalid", + loc: startLoc + }; + } + } + flowEnumMemberRaw() { + const loc = this.state.startLoc; + const id = this.parseIdentifier(true); + const init = this.eat(29) ? this.flowEnumMemberInit() : { + type: "none", + loc + }; + return { + id, + init + }; + } + flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { + const { + explicitType + } = context; + if (explicitType === null) { + return; + } + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(loc, context); + } + } + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + let hasUnknownMembers = false; + while (!this.match(8)) { + if (this.eat(21)) { + hasUnknownMembers = true; + break; + } + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; + if (memberName === "") { + continue; + } + if (/^[a-z]/.test(memberName)) { + this.raise(FlowErrors.EnumInvalidMemberName, id, { + memberName, + suggestion: memberName[0].toUpperCase() + memberName.slice(1), + enumName + }); + } + if (seenNames.has(memberName)) { + this.raise(FlowErrors.EnumDuplicateMemberName, id, { + memberName, + enumName + }); + } + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); + } + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); + break; + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); + break; + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } + } + if (!this.match(8)) { + this.expect(12); + } + } + return { + members, + hasUnknownMembers + }; + } + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (const member of initializedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return defaultedMembers; + } else { + for (const member of defaultedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return initializedMembers; + } + } + flowEnumParseExplicitType({ + enumName + }) { + if (!this.eatContextual(102)) return null; + if (!tokenIsIdentifier(this.state.type)) { + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { + enumName + }); + } + const { + value + } = this.state; + this.next(); + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { + enumName, + invalidEnumType: value + }); + } + return value; + } + flowEnumBody(node, id) { + const enumName = id.name; + const nameLoc = id.loc.start; + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(5); + const { + members, + hasUnknownMembers + } = this.flowEnumMembers({ + enumName, + explicitType + }); + node.hasUnknownMembers = hasUnknownMembers; + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + case "symbol": + node.members = members.defaultedMembers; + this.expect(8); + return this.finishNode(node, "EnumSymbolBody"); + default: + { + const empty = () => { + node.members = []; + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + }; + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { + enumName + }); + return empty(); + } + } + } + } + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), id); + return this.finishNode(node, "EnumDeclaration"); + } + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } + return false; + } + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } + }; + const entities = { + __proto__: null, + quot: "\u0022", + amp: "&", + apos: "\u0027", + lt: "<", + gt: ">", + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" + }; + const JsxErrors = ParseErrorEnum`jsx`({ + AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", + MissingClosingTagElement: ({ + openingTagName + }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", + UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", + UnexpectedToken: ({ + unexpected, + HTMLEntity + }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, + UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", + UnterminatedJsxContent: "Unterminated JSX contents.", + UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?" + }); + function isFragment(object) { + return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; + } + function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + throw new Error("Node had unexpected type: " + object.type); + } + var jsx = superClass => class JSXParserMixin extends superClass { + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 60: + case 123: + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.canStartJSXElement) { + ++this.state.pos; + this.finishToken(142); + } else { + super.getTokenFromCode(ch); + } + return; + } + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(141, out); + return; + case 38: + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + case 62: + case 125: + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } + } + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; + ++this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; + return out; + } + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + out += this.input.slice(chunkStart, this.state.pos++); + this.finishToken(133, out); + } + jsxReadEntity() { + const startPos = ++this.state.pos; + if (this.codePointAtPos(this.state.pos) === 35) { + ++this.state.pos; + let radix = 10; + if (this.codePointAtPos(this.state.pos) === 120) { + radix = 16; + ++this.state.pos; + } + const codePoint = this.readInt(radix, undefined, false, "bail"); + if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { + ++this.state.pos; + return String.fromCodePoint(codePoint); + } + } else { + let count = 0; + let semi = false; + while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { + ++this.state.pos; + } + if (semi) { + const desc = this.input.slice(startPos, this.state.pos); + const entity = entities[desc]; + ++this.state.pos; + if (entity) { + return entity; + } + } + } + this.state.pos = startPos; + return "&"; + } + jsxReadWord() { + let ch; + const start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); + this.finishToken(140, this.input.slice(start, this.state.pos)); + } + jsxParseIdentifier() { + const node = this.startNode(); + if (this.match(140)) { + node.name = this.state.value; + } else if (tokenIsKeyword(this.state.type)) { + node.name = tokenLabelName(this.state.type); + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsxParseNamespacedName() { + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(14)) return name; + const node = this.startNodeAt(startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsxParseElementName() { + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + if (node.type === "JSXNamespacedName") { + return node; + } + while (this.eat(16)) { + const newNode = this.startNodeAt(startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsxParseAttributeValue() { + let node; + switch (this.state.type) { + case 5: + node = this.startNode(); + this.setContext(types.brace); + this.next(); + node = this.jsxParseExpressionContainer(node, types.j_oTag); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(JsxErrors.AttributeIsEmpty, node); + } + return node; + case 142: + case 133: + return this.parseExprAtom(); + default: + throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); + } + } + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); + } + jsxParseSpreadChild(node) { + this.next(); + node.expression = this.parseExpression(); + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadChild"); + } + jsxParseExpressionContainer(node, previousContext) { + if (this.match(8)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + const expression = this.parseExpression(); + node.expression = expression; + } + this.setContext(previousContext); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsxParseAttribute() { + const node = this.startNode(); + if (this.match(5)) { + this.setContext(types.brace); + this.next(); + this.expect(21); + node.argument = this.parseMaybeAssignAllowIn(); + this.setContext(types.j_oTag); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsxParseOpeningElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(143)) { + return this.finishNode(node, "JSXOpeningFragment"); + } + node.name = this.jsxParseElementName(); + return this.jsxParseOpeningElementAfterName(node); + } + jsxParseOpeningElementAfterName(node) { + const attributes = []; + while (!this.match(56) && !this.match(143)) { + attributes.push(this.jsxParseAttribute()); + } + node.attributes = attributes; + node.selfClosing = this.eat(56); + this.expect(143); + return this.finishNode(node, "JSXOpeningElement"); + } + jsxParseClosingElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(143)) { + return this.finishNode(node, "JSXClosingFragment"); + } + node.name = this.jsxParseElementName(); + this.expect(143); + return this.finishNode(node, "JSXClosingElement"); + } + jsxParseElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + const children = []; + const openingElement = this.jsxParseOpeningElementAt(startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: for (;;) { + switch (this.state.type) { + case 142: + startLoc = this.state.startLoc; + this.next(); + if (this.eat(56)) { + closingElement = this.jsxParseClosingElementAt(startLoc); + break contents; + } + children.push(this.jsxParseElementAt(startLoc)); + break; + case 141: + children.push(this.parseLiteral(this.state.value, "JSXText")); + break; + case 5: + { + const node = this.startNode(); + this.setContext(types.brace); + this.next(); + if (this.match(21)) { + children.push(this.jsxParseSpreadChild(node)); + } else { + children.push(this.jsxParseExpressionContainer(node, types.j_expr)); + } + break; + } + default: + this.unexpected(); + } + } + if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { + this.raise(JsxErrors.MissingClosingTagFragment, closingElement); + } else if (!isFragment(openingElement) && isFragment(closingElement)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } else if (!isFragment(openingElement) && !isFragment(closingElement)) { + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } + } + } + if (isFragment(openingElement)) { + node.openingFragment = openingElement; + node.closingFragment = closingElement; + } else { + node.openingElement = openingElement; + node.closingElement = closingElement; + } + node.children = children; + if (this.match(47)) { + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); + } + return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); + } + jsxParseElement() { + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startLoc); + } + setContext(newContext) { + const { + context + } = this.state; + context[context.length - 1] = newContext; + } + parseExprAtom(refExpressionErrors) { + if (this.match(142)) { + return this.jsxParseElement(); + } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { + this.replaceToken(142); + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refExpressionErrors); + } + } + skipSpace() { + const curContext = this.curContext(); + if (!curContext.preserveSpace) super.skipSpace(); + } + getTokenFromCode(code) { + const context = this.curContext(); + if (context === types.j_expr) { + this.jsxReadToken(); + return; + } + if (context === types.j_oTag || context === types.j_cTag) { + if (isIdentifierStart(code)) { + this.jsxReadWord(); + return; + } + if (code === 62) { + ++this.state.pos; + this.finishToken(143); + return; + } + if ((code === 34 || code === 39) && context === types.j_oTag) { + this.jsxReadString(code); + return; + } + } + if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { + ++this.state.pos; + this.finishToken(142); + return; + } + super.getTokenFromCode(code); + } + updateContext(prevType) { + const { + context, + type + } = this.state; + if (type === 56 && prevType === 142) { + context.splice(-2, 2, types.j_cTag); + this.state.canStartJSXElement = false; + } else if (type === 142) { + context.push(types.j_oTag); + } else if (type === 143) { + const out = context[context.length - 1]; + if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { + context.pop(); + this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; + } else { + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + } + } else { + this.state.canStartJSXElement = tokenComesBeforeExpression(type); + } + } + }; + class TypeScriptScope extends Scope { + constructor(...args) { + super(...args); + this.tsNames = new Map(); + } + } + class TypeScriptScopeHandler extends ScopeHandler { + constructor(...args) { + super(...args); + this.importsStack = []; + } + createScope(flags) { + this.importsStack.push(new Set()); + return new TypeScriptScope(flags); + } + enter(flags) { + if (flags === 256) { + this.importsStack.push(new Set()); + } + super.enter(flags); + } + exit() { + const flags = super.exit(); + if (flags === 256) { + this.importsStack.pop(); + } + return flags; + } + hasImport(name, allowShadow) { + const len = this.importsStack.length; + if (this.importsStack[len - 1].has(name)) { + return true; + } + if (!allowShadow && len > 1) { + for (let i = 0; i < len - 1; i++) { + if (this.importsStack[i].has(name)) return true; + } + } + return false; + } + declareName(name, bindingType, loc) { + if (bindingType & 4096) { + if (this.hasImport(name, true)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + this.importsStack[this.importsStack.length - 1].add(name); + return; + } + const scope = this.currentScope(); + let type = scope.tsNames.get(name) || 0; + if (bindingType & 1024) { + this.maybeExportDefined(scope, name); + scope.tsNames.set(name, type | 16); + return; + } + super.declareName(name, bindingType, loc); + if (bindingType & 2) { + if (!(bindingType & 1)) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + } + type = type | 1; + } + if (bindingType & 256) { + type = type | 2; + } + if (bindingType & 512) { + type = type | 4; + } + if (bindingType & 128) { + type = type | 8; + } + if (type) scope.tsNames.set(name, type); + } + isRedeclaredInScope(scope, name, bindingType) { + const type = scope.tsNames.get(name); + if ((type & 2) > 0) { + if (bindingType & 256) { + const isConst = !!(bindingType & 512); + const wasConst = (type & 4) > 0; + return isConst !== wasConst; + } + return true; + } + if (bindingType & 128 && (type & 8) > 0) { + if (scope.names.get(name) & 2) { + return !!(bindingType & 1); + } else { + return false; + } + } + if (bindingType & 2 && (type & 1) > 0) { + return true; + } + return super.isRedeclaredInScope(scope, name, bindingType); + } + checkLocalExport(id) { + const { + name + } = id; + if (this.hasImport(name)) return; + const len = this.scopeStack.length; + for (let i = len - 1; i >= 0; i--) { + const scope = this.scopeStack[i]; + const type = scope.tsNames.get(name); + if ((type & 1) > 0 || (type & 16) > 0) { + return; + } + } + super.checkLocalExport(id); + } + } + const unwrapParenthesizedExpression = node => { + return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; + }; + class LValParser extends NodeUtils { + toAssignable(node, isLHS = false) { + var _node$extra, _node$extra3; + let parenthesized = undefined; + if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { + parenthesized = unwrapParenthesizedExpression(node); + if (isLHS) { + if (parenthesized.type === "Identifier") { + this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); + } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } else { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { + var _node$extra2; + const prop = node.properties[i]; + const isLast = i === last; + this.toAssignableObjectExpressionProp(prop, isLast, isLHS); + if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); + } + } + break; + case "ObjectProperty": + { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + break; + } + case "SpreadElement": + { + throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); + } + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(Errors.MissingEqInAssignment, node.left.loc.end); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isLHS); + break; + case "ParenthesizedExpression": + this.toAssignable(parenthesized, isLHS); + break; + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "ObjectMethod") { + this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); + } else if (prop.type === "SpreadElement") { + prop.type = "RestElement"; + const arg = prop.argument; + this.checkToRestConversion(arg, false); + this.toAssignable(arg, isLHS); + if (!isLast) { + this.raise(Errors.RestTrailingComma, prop); + } + } else { + this.toAssignable(prop, isLHS); + } + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + const end = exprList.length - 1; + for (let i = 0; i <= end; i++) { + const elt = exprList[i]; + if (!elt) continue; + if (elt.type === "SpreadElement") { + elt.type = "RestElement"; + const arg = elt.argument; + this.checkToRestConversion(arg, true); + this.toAssignable(arg, isLHS); + } else { + this.toAssignable(elt, isLHS); + } + if (elt.type === "RestElement") { + if (i < end) { + this.raise(Errors.RestTrailingComma, elt); + } else if (trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, trailingCommaLoc); + } + } + } + } + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + return true; + case "ObjectExpression": + { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); + }); + } + case "ObjectProperty": + return this.isAssignable(node.value); + case "SpreadElement": + return this.isAssignable(node.argument); + case "ArrayExpression": + return node.elements.every(element => element === null || this.isAssignable(element)); + case "AssignmentExpression": + return node.operator === "="; + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + default: + return false; + } + } + toReferencedList(exprList, isParenthesizedExpr) { + return exprList; + } + toReferencedListDeep(exprList, isParenthesizedExpr) { + this.toReferencedList(exprList, isParenthesizedExpr); + for (const expr of exprList) { + if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { + this.toReferencedListDeep(expr.elements); + } + } + } + parseSpread(refExpressionErrors) { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); + return this.finishNode(node, "SpreadElement"); + } + parseRestBinding() { + const node = this.startNode(); + this.next(); + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + } + parseBindingAtom() { + switch (this.state.type) { + case 0: + { + const node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(3, 93, 1); + return this.finishNode(node, "ArrayPattern"); + } + case 5: + return this.parseObjectLike(8, true); + } + return this.parseIdentifier(); + } + parseBindingList(close, closeCharCode, flags) { + const allowEmpty = flags & 1; + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + } + if (allowEmpty && this.match(12)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(21)) { + elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags)); + if (!this.checkCommaAfterRest(closeCharCode)) { + this.expect(close); + break; + } + } else { + const decorators = []; + if (this.match(26) && this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + elts.push(this.parseAssignableListItem(flags, decorators)); + } + } + return elts; + } + parseBindingRestProperty(prop) { + this.next(); + prop.argument = this.parseIdentifier(); + this.checkCommaAfterRest(125); + return this.finishNode(prop, "RestElement"); + } + parseBindingProperty() { + const { + type, + startLoc + } = this.state; + if (type === 21) { + return this.parseBindingRestProperty(this.startNode()); + } + const prop = this.startNode(); + if (type === 138) { + this.expectPlugin("destructuringPrivate", startLoc); + this.classScope.usePrivateName(this.state.value, startLoc); + prop.key = this.parsePrivateName(); + } else { + this.parsePropertyName(prop); + } + prop.method = false; + return this.parseObjPropValue(prop, startLoc, false, false, true, false); + } + parseAssignableListItem(flags, decorators) { + const left = this.parseMaybeDefault(); + this.parseAssignableListItemTypes(left, flags); + const elt = this.parseMaybeDefault(left.loc.start, left); + if (decorators.length) { + left.decorators = decorators; + } + return elt; + } + parseAssignableListItemTypes(param, flags) { + return param; + } + parseMaybeDefault(startLoc, left) { + var _startLoc, _left; + (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; + left = (_left = left) != null ? _left : this.parseBindingAtom(); + if (!this.eat(29)) return left; + const node = this.startNodeAt(startLoc); + node.left = left; + node.right = this.parseMaybeAssignAllowIn(); + return this.finishNode(node, "AssignmentPattern"); + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + switch (type) { + case "AssignmentPattern": + return "left"; + case "RestElement": + return "argument"; + case "ObjectProperty": + return "value"; + case "ParenthesizedExpression": + return "expression"; + case "ArrayPattern": + return "elements"; + case "ObjectPattern": + return "properties"; + } + return false; + } + isOptionalMemberExpression(expression) { + return expression.type === "OptionalMemberExpression"; + } + checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) { + var _expression$extra; + const type = expression.type; + if (this.isObjectMethod(expression)) return; + const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); + if (isOptionalMemberExpression || type === "MemberExpression") { + if (isOptionalMemberExpression) { + this.expectPlugin("optionalChainingAssign", expression.loc.start); + if (ancestor.type !== "AssignmentExpression") { + this.raise(Errors.InvalidLhsOptionalChaining, expression, { + ancestor + }); + } + } + if (binding !== 64) { + this.raise(Errors.InvalidPropertyBindingPattern, expression); + } + return; + } + if (type === "Identifier") { + this.checkIdentifier(expression, binding, strictModeChanged); + const { + name + } = expression; + if (checkClashes) { + if (checkClashes.has(name)) { + this.raise(Errors.ParamDupe, expression); + } else { + checkClashes.add(name); + } + } + return; + } + const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); + if (validity === true) return; + if (validity === false) { + const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; + this.raise(ParseErrorClass, expression, { + ancestor + }); + return; + } + let key, isParenthesizedExpression; + if (typeof validity === "string") { + key = validity; + isParenthesizedExpression = type === "ParenthesizedExpression"; + } else { + [key, isParenthesizedExpression] = validity; + } + const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { + type + } : ancestor; + const val = expression[key]; + if (Array.isArray(val)) { + for (const child of val) { + if (child) { + this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); + } + } + } else if (val) { + this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); + } + } + checkIdentifier(at, bindingType, strictModeChanged = false) { + if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { + if (bindingType === 64) { + this.raise(Errors.StrictEvalArguments, at, { + referenceName: at.name + }); + } else { + this.raise(Errors.StrictEvalArgumentsBinding, at, { + bindingName: at.name + }); + } + } + if (bindingType & 8192 && at.name === "let") { + this.raise(Errors.LetInLexicalBinding, at); + } + if (!(bindingType & 64)) { + this.declareNameFromIdentifier(at, bindingType); + } + } + declareNameFromIdentifier(identifier, binding) { + this.scope.declareName(identifier.name, binding, identifier.loc.start); + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "ParenthesizedExpression": + this.checkToRestConversion(node.expression, allowPattern); + break; + case "Identifier": + case "MemberExpression": + break; + case "ArrayExpression": + case "ObjectExpression": + if (allowPattern) break; + default: + this.raise(Errors.InvalidRestAssignmentPattern, node); + } + } + checkCommaAfterRest(close) { + if (!this.match(12)) { + return false; + } + this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); + return true; + } + } + function nonNull(x) { + if (x == null) { + throw new Error(`Unexpected ${x} value.`); + } + return x; + } + function assert(x) { + if (!x) { + throw new Error("Assert fail"); + } + } + const TSErrors = ParseErrorEnum`typescript`({ + AbstractMethodHasImplementation: ({ + methodName + }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, + AbstractPropertyHasInitializer: ({ + propertyName + }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, + AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", + AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", + AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", + ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", + ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", + ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", + DeclareAccessor: ({ + kind + }) => `'declare' is not allowed in ${kind}ters.`, + DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", + DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", + DuplicateAccessibilityModifier: ({ + modifier + }) => `Accessibility modifier already seen.`, + DuplicateModifier: ({ + modifier + }) => `Duplicate modifier: '${modifier}'.`, + EmptyHeritageClauseType: ({ + token + }) => `'${token}' list cannot be empty.`, + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", + ImportAliasHasImportType: "An import alias can not use 'import type'.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", + IncompatibleModifiers: ({ + modifiers + }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, + IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", + IndexSignatureHasAccessibility: ({ + modifier + }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, + IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", + IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", + IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", + InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", + InvalidModifierOnTypeMember: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type member.`, + InvalidModifierOnTypeParameter: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type parameter.`, + InvalidModifierOnTypeParameterPositions: ({ + modifier + }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + InvalidModifiersOrder: ({ + orderedModifiers + }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, + InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", + InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", + MissingInterfaceName: "'interface' declarations must be followed by an identifier.", + NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", + NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", + OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", + OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", + PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", + PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", + PrivateElementHasAccessibility: ({ + modifier + }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, + ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", + ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.", + ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", + SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", + SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", + SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", + SingleTypeParameterWithoutTrailingComma: ({ + typeParameterName + }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, + StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", + TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", + TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", + TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", + TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", + UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", + UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", + UnexpectedTypeAnnotation: "Did not expect a type annotation here.", + UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", + UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", + UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", + UnsupportedSignatureParameterKind: ({ + type + }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` + }); + function keywordTypeFromName(value) { + switch (value) { + case "any": + return "TSAnyKeyword"; + case "boolean": + return "TSBooleanKeyword"; + case "bigint": + return "TSBigIntKeyword"; + case "never": + return "TSNeverKeyword"; + case "number": + return "TSNumberKeyword"; + case "object": + return "TSObjectKeyword"; + case "string": + return "TSStringKeyword"; + case "symbol": + return "TSSymbolKeyword"; + case "undefined": + return "TSUndefinedKeyword"; + case "unknown": + return "TSUnknownKeyword"; + default: + return undefined; + } + } + function tsIsAccessModifier(modifier) { + return modifier === "private" || modifier === "public" || modifier === "protected"; + } + function tsIsVarianceAnnotations(modifier) { + return modifier === "in" || modifier === "out"; + } + var typescript = superClass => class TypeScriptParserMixin extends superClass { + constructor(...args) { + super(...args); + this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out"], + disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + this.tsParseConstModifier = this.tsParseModifiers.bind(this, { + allowedModifiers: ["const"], + disallowedModifiers: ["in", "out"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }); + this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out", "const"], + disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + } + getScopeHandler() { + return TypeScriptScopeHandler; + } + tsIsIdentifier() { + return tokenIsIdentifier(this.state.type); + } + tsTokenCanFollowModifier() { + return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); + } + tsNextTokenCanFollowModifier() { + this.next(); + return this.tsTokenCanFollowModifier(); + } + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { + if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { + return undefined; + } + const modifier = this.state.value; + if (allowedModifiers.includes(modifier)) { + if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { + return undefined; + } + if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { + return modifier; + } + } + return undefined; + } + tsParseModifiers({ + allowedModifiers, + disallowedModifiers, + stopOnStartOfClassStaticBlock, + errorTemplate = TSErrors.InvalidModifierOnTypeMember + }, modified) { + const enforceOrder = (loc, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise(TSErrors.InvalidModifiersOrder, loc, { + orderedModifiers: [before, after] + }); + } + }; + const incompatible = (loc, modifier, mod1, mod2) => { + if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { + this.raise(TSErrors.IncompatibleModifiers, loc, { + modifiers: [mod1, mod2] + }); + } + }; + for (;;) { + const { + startLoc + } = this.state; + const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); + if (!modifier) break; + if (tsIsAccessModifier(modifier)) { + if (modified.accessibility) { + this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, modifier, "override"); + enforceOrder(startLoc, modifier, modifier, "static"); + enforceOrder(startLoc, modifier, modifier, "readonly"); + modified.accessibility = modifier; + } + } else if (tsIsVarianceAnnotations(modifier)) { + if (modified[modifier]) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } + modified[modifier] = true; + enforceOrder(startLoc, modifier, "in", "out"); + } else { + if (hasOwnProperty.call(modified, modifier)) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, "static", "readonly"); + enforceOrder(startLoc, modifier, "static", "override"); + enforceOrder(startLoc, modifier, "override", "readonly"); + enforceOrder(startLoc, modifier, "abstract", "override"); + incompatible(startLoc, modifier, "declare", "override"); + incompatible(startLoc, modifier, "static", "abstract"); + } + modified[modifier] = true; + } + if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { + this.raise(errorTemplate, startLoc, { + modifier + }); + } + } + } + tsIsListTerminator(kind) { + switch (kind) { + case "EnumMembers": + case "TypeMembers": + return this.match(8); + case "HeritageClauseElement": + return this.match(5); + case "TupleElementTypes": + return this.match(3); + case "TypeParametersOrArguments": + return this.match(48); + } + } + tsParseList(kind, parseElement) { + const result = []; + while (!this.tsIsListTerminator(kind)) { + result.push(parseElement()); + } + return result; + } + tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { + return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); + } + tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { + const result = []; + let trailingCommaPos = -1; + for (;;) { + if (this.tsIsListTerminator(kind)) { + break; + } + trailingCommaPos = -1; + const element = parseElement(); + if (element == null) { + return undefined; + } + result.push(element); + if (this.eat(12)) { + trailingCommaPos = this.state.lastTokStartLoc.index; + continue; + } + if (this.tsIsListTerminator(kind)) { + break; + } + if (expectSuccess) { + this.expect(12); + } + return undefined; + } + if (refTrailingCommaPos) { + refTrailingCommaPos.value = trailingCommaPos; + } + return result; + } + tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { + if (!skipFirstToken) { + if (bracket) { + this.expect(0); + } else { + this.expect(47); + } + } + const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); + if (bracket) { + this.expect(3); + } else { + this.expect(48); + } + return result; + } + tsParseImportType() { + const node = this.startNode(); + this.expect(83); + this.expect(10); + if (!this.match(133)) { + this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); + } + node.argument = super.parseExprAtom(); + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + node.options = null; + } + if (this.eat(12)) { + this.expectImportAttributesPlugin(); + if (!this.match(11)) { + node.options = super.parseMaybeAssignAllowIn(); + this.eat(12); + } + } + this.expect(11); + if (this.eat(16)) { + node.qualifier = this.tsParseEntityName(); + } + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSImportType"); + } + tsParseEntityName(allowReservedWords = true) { + let entity = this.parseIdentifier(allowReservedWords); + while (this.eat(16)) { + const node = this.startNodeAtNode(entity); + node.left = entity; + node.right = this.parseIdentifier(allowReservedWords); + entity = this.finishNode(node, "TSQualifiedName"); + } + return entity; + } + tsParseTypeReference() { + const node = this.startNode(); + node.typeName = this.tsParseEntityName(); + if (!this.hasPrecedingLineBreak() && this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeReference"); + } + tsParseThisTypePredicate(lhs) { + this.next(); + const node = this.startNodeAtNode(lhs); + node.parameterName = lhs; + node.typeAnnotation = this.tsParseTypeAnnotation(false); + node.asserts = false; + return this.finishNode(node, "TSTypePredicate"); + } + tsParseThisTypeNode() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSThisType"); + } + tsParseTypeQuery() { + const node = this.startNode(); + this.expect(87); + if (this.match(83)) { + node.exprName = this.tsParseImportType(); + } else { + node.exprName = this.tsParseEntityName(); + } + if (!this.hasPrecedingLineBreak() && this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeQuery"); + } + tsParseTypeParameter(parseModifiers) { + const node = this.startNode(); + parseModifiers(node); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsEatThenParseType(81); + node.default = this.tsEatThenParseType(29); + return this.finishNode(node, "TSTypeParameter"); + } + tsTryParseTypeParameters(parseModifiers) { + if (this.match(47)) { + return this.tsParseTypeParameters(parseModifiers); + } + } + tsParseTypeParameters(parseModifiers) { + const node = this.startNode(); + if (this.match(47) || this.match(142)) { + this.next(); + } else { + this.unexpected(); + } + const refTrailingCommaPos = { + value: -1 + }; + node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeParameters, node); + } + if (refTrailingCommaPos.value !== -1) { + this.addExtra(node, "trailingComma", refTrailingCommaPos.value); + } + return this.finishNode(node, "TSTypeParameterDeclaration"); + } + tsFillSignature(returnToken, signature) { + const returnTokenRequired = returnToken === 19; + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + this.expect(10); + signature[paramsKey] = this.tsParseBindingListForSignature(); + if (returnTokenRequired) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (this.match(returnToken)) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } + } + tsParseBindingListForSignature() { + const list = super.parseBindingList(11, 41, 2); + for (const pattern of list) { + const { + type + } = pattern; + if (type === "AssignmentPattern" || type === "TSParameterProperty") { + this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { + type + }); + } + } + return list; + } + tsParseTypeMemberSemicolon() { + if (!this.eat(12) && !this.isLineTerminator()) { + this.expect(13); + } + } + tsParseSignatureMember(kind, node) { + this.tsFillSignature(14, node); + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, kind); + } + tsIsUnambiguouslyIndexSignature() { + this.next(); + if (tokenIsIdentifier(this.state.type)) { + this.next(); + return this.match(14); + } + return false; + } + tsTryParseIndexSignature(node) { + if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { + return; + } + this.expect(0); + const id = this.parseIdentifier(); + id.typeAnnotation = this.tsParseTypeAnnotation(); + this.resetEndLocation(id); + this.expect(3); + node.parameters = [id]; + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, "TSIndexSignature"); + } + tsParsePropertyOrMethodSignature(node, readonly) { + if (this.eat(17)) node.optional = true; + const nodeAny = node; + if (this.match(10) || this.match(47)) { + if (readonly) { + this.raise(TSErrors.ReadonlyForMethodSignature, node); + } + const method = nodeAny; + if (method.kind && this.match(47)) { + this.raise(TSErrors.AccesorCannotHaveTypeParameters, this.state.curPosition()); + } + this.tsFillSignature(14, method); + this.tsParseTypeMemberSemicolon(); + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + if (method.kind === "get") { + if (method[paramsKey].length > 0) { + this.raise(Errors.BadGetterArity, this.state.curPosition()); + if (this.isThisParam(method[paramsKey][0])) { + this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()); + } + } + } else if (method.kind === "set") { + if (method[paramsKey].length !== 1) { + this.raise(Errors.BadSetterArity, this.state.curPosition()); + } else { + const firstParameter = method[paramsKey][0]; + if (this.isThisParam(firstParameter)) { + this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()); + } + if (firstParameter.type === "Identifier" && firstParameter.optional) { + this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, this.state.curPosition()); + } + if (firstParameter.type === "RestElement") { + this.raise(TSErrors.SetAccesorCannotHaveRestParameter, this.state.curPosition()); + } + } + if (method[returnTypeKey]) { + this.raise(TSErrors.SetAccesorCannotHaveReturnType, method[returnTypeKey]); + } + } else { + method.kind = "method"; + } + return this.finishNode(method, "TSMethodSignature"); + } else { + const property = nodeAny; + if (readonly) property.readonly = true; + const type = this.tsTryParseTypeAnnotation(); + if (type) property.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(property, "TSPropertySignature"); + } + } + tsParseTypeMember() { + const node = this.startNode(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); + } + if (this.match(77)) { + const id = this.startNode(); + this.next(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); + } else { + node.key = this.createIdentifier(id, "new"); + return this.tsParsePropertyOrMethodSignature(node, false); + } + } + this.tsParseModifiers({ + allowedModifiers: ["readonly"], + disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] + }, node); + const idx = this.tsTryParseIndexSignature(node); + if (idx) { + return idx; + } + super.parsePropertyName(node); + if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { + node.kind = node.key.name; + super.parsePropertyName(node); + } + return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); + } + tsParseTypeLiteral() { + const node = this.startNode(); + node.members = this.tsParseObjectTypeMembers(); + return this.finishNode(node, "TSTypeLiteral"); + } + tsParseObjectTypeMembers() { + this.expect(5); + const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.expect(8); + return members; + } + tsIsStartOfMappedType() { + this.next(); + if (this.eat(53)) { + return this.isContextual(122); + } + if (this.isContextual(122)) { + this.next(); + } + if (!this.match(0)) { + return false; + } + this.next(); + if (!this.tsIsIdentifier()) { + return false; + } + this.next(); + return this.match(58); + } + tsParseMappedTypeParameter() { + const node = this.startNode(); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsExpectThenParseType(58); + return this.finishNode(node, "TSTypeParameter"); + } + tsParseMappedType() { + const node = this.startNode(); + this.expect(5); + if (this.match(53)) { + node.readonly = this.state.value; + this.next(); + this.expectContextual(122); + } else if (this.eatContextual(122)) { + node.readonly = true; + } + this.expect(0); + node.typeParameter = this.tsParseMappedTypeParameter(); + node.nameType = this.eatContextual(93) ? this.tsParseType() : null; + this.expect(3); + if (this.match(53)) { + node.optional = this.state.value; + this.next(); + this.expect(17); + } else if (this.eat(17)) { + node.optional = true; + } + node.typeAnnotation = this.tsTryParseType(); + this.semicolon(); + this.expect(8); + return this.finishNode(node, "TSMappedType"); + } + tsParseTupleType() { + const node = this.startNode(); + node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); + let seenOptionalElement = false; + node.elementTypes.forEach(elementNode => { + const { + type + } = elementNode; + if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { + this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); + } + seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); + }); + return this.finishNode(node, "TSTupleType"); + } + tsParseTupleElementType() { + const { + startLoc + } = this.state; + const rest = this.eat(21); + let labeled; + let label; + let optional; + let type; + const isWord = tokenIsKeywordOrIdentifier(this.state.type); + const chAfterWord = isWord ? this.lookaheadCharCode() : null; + if (chAfterWord === 58) { + labeled = true; + optional = false; + label = this.parseIdentifier(true); + this.expect(14); + type = this.tsParseType(); + } else if (chAfterWord === 63) { + optional = true; + const startLoc = this.state.startLoc; + const wordName = this.state.value; + const typeOrLabel = this.tsParseNonArrayType(); + if (this.lookaheadCharCode() === 58) { + labeled = true; + label = this.createIdentifier(this.startNodeAt(startLoc), wordName); + this.expect(17); + this.expect(14); + type = this.tsParseType(); + } else { + labeled = false; + type = typeOrLabel; + this.expect(17); + } + } else { + type = this.tsParseType(); + optional = this.eat(17); + labeled = this.eat(14); + } + if (labeled) { + let labeledNode; + if (label) { + labeledNode = this.startNodeAtNode(label); + labeledNode.optional = optional; + labeledNode.label = label; + labeledNode.elementType = type; + if (this.eat(17)) { + labeledNode.optional = true; + this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); + } + } else { + labeledNode = this.startNodeAtNode(type); + labeledNode.optional = optional; + this.raise(TSErrors.InvalidTupleMemberLabel, type); + labeledNode.label = type; + labeledNode.elementType = this.tsParseType(); + } + type = this.finishNode(labeledNode, "TSNamedTupleMember"); + } else if (optional) { + const optionalTypeNode = this.startNodeAtNode(type); + optionalTypeNode.typeAnnotation = type; + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + if (rest) { + const restNode = this.startNodeAt(startLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); + } + return type; + } + tsParseParenthesizedType() { + const node = this.startNode(); + this.expect(10); + node.typeAnnotation = this.tsParseType(); + this.expect(11); + return this.finishNode(node, "TSParenthesizedType"); + } + tsParseFunctionOrConstructorType(type, abstract) { + const node = this.startNode(); + if (type === "TSConstructorType") { + node.abstract = !!abstract; + if (abstract) this.next(); + this.next(); + } + this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); + return this.finishNode(node, type); + } + tsParseLiteralTypeNode() { + const node = this.startNode(); + switch (this.state.type) { + case 134: + case 135: + case 133: + case 85: + case 86: + node.literal = super.parseExprAtom(); + break; + default: + this.unexpected(); + } + return this.finishNode(node, "TSLiteralType"); + } + tsParseTemplateLiteralType() { + const node = this.startNode(); + node.literal = super.parseTemplate(false); + return this.finishNode(node, "TSLiteralType"); + } + parseTemplateSubstitution() { + if (this.state.inType) return this.tsParseType(); + return super.parseTemplateSubstitution(); + } + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + tsParseNonArrayType() { + switch (this.state.type) { + case 133: + case 134: + case 135: + case 85: + case 86: + return this.tsParseLiteralTypeNode(); + case 53: + if (this.state.value === "-") { + const node = this.startNode(); + const nextToken = this.lookahead(); + if (nextToken.type !== 134 && nextToken.type !== 135) { + this.unexpected(); + } + node.literal = this.parseMaybeUnary(); + return this.finishNode(node, "TSLiteralType"); + } + break; + case 78: + return this.tsParseThisTypeOrThisTypePredicate(); + case 87: + return this.tsParseTypeQuery(); + case 83: + return this.tsParseImportType(); + case 5: + return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); + case 0: + return this.tsParseTupleType(); + case 10: + return this.tsParseParenthesizedType(); + case 25: + case 24: + return this.tsParseTemplateLiteralType(); + default: + { + const { + type + } = this.state; + if (tokenIsIdentifier(type) || type === 88 || type === 84) { + const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); + if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, nodeType); + } + return this.tsParseTypeReference(); + } + } + } + this.unexpected(); + } + tsParseArrayTypeOrHigher() { + let type = this.tsParseNonArrayType(); + while (!this.hasPrecedingLineBreak() && this.eat(0)) { + if (this.match(3)) { + const node = this.startNodeAtNode(type); + node.elementType = type; + this.expect(3); + type = this.finishNode(node, "TSArrayType"); + } else { + const node = this.startNodeAtNode(type); + node.objectType = type; + node.indexType = this.tsParseType(); + this.expect(3); + type = this.finishNode(node, "TSIndexedAccessType"); + } + } + return type; + } + tsParseTypeOperator() { + const node = this.startNode(); + const operator = this.state.value; + this.next(); + node.operator = operator; + node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); + if (operator === "readonly") { + this.tsCheckTypeAnnotationForReadOnly(node); + } + return this.finishNode(node, "TSTypeOperator"); + } + tsCheckTypeAnnotationForReadOnly(node) { + switch (node.typeAnnotation.type) { + case "TSTupleType": + case "TSArrayType": + return; + default: + this.raise(TSErrors.UnexpectedReadonly, node); + } + } + tsParseInferType() { + const node = this.startNode(); + this.expectContextual(115); + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + return this.finishNode(node, "TSInferType"); + } + tsParseConstraintForInferType() { + if (this.eat(81)) { + const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); + if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { + return constraint; + } + } + } + tsParseTypeOperatorOrHigher() { + const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); + } + tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { + const node = this.startNode(); + const hasLeadingOperator = this.eat(operator); + const types = []; + do { + types.push(parseConstituentType()); + } while (this.eat(operator)); + if (types.length === 1 && !hasLeadingOperator) { + return types[0]; + } + node.types = types; + return this.finishNode(node, kind); + } + tsParseIntersectionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); + } + tsParseUnionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); + } + tsIsStartOfFunctionType() { + if (this.match(47)) { + return true; + } + return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); + } + tsSkipParameterStart() { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + this.next(); + return true; + } + if (this.match(5)) { + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + this.parseObjectLike(8, true); + return errors.length === previousErrorCount; + } catch (_unused) { + return false; + } + } + if (this.match(0)) { + this.next(); + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + super.parseBindingList(3, 93, 1); + return errors.length === previousErrorCount; + } catch (_unused2) { + return false; + } + } + return false; + } + tsIsUnambiguouslyStartOfFunctionType() { + this.next(); + if (this.match(11) || this.match(21)) { + return true; + } + if (this.tsSkipParameterStart()) { + if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { + return true; + } + if (this.match(11)) { + this.next(); + if (this.match(19)) { + return true; + } + } + } + return false; + } + tsParseTypeOrTypePredicateAnnotation(returnToken) { + return this.tsInType(() => { + const t = this.startNode(); + this.expect(returnToken); + const node = this.startNode(); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + if (asserts && this.match(78)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + if (thisTypePredicate.type === "TSThisType") { + node.parameterName = thisTypePredicate; + node.asserts = true; + node.typeAnnotation = null; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + this.resetStartLocationFromNode(thisTypePredicate, node); + thisTypePredicate.asserts = true; + } + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); + if (!typePredicateVariable) { + if (!asserts) { + return this.tsParseTypeAnnotation(false, t); + } + node.parameterName = this.parseIdentifier(); + node.asserts = asserts; + node.typeAnnotation = null; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + } + const type = this.tsParseTypeAnnotation(false); + node.parameterName = typePredicateVariable; + node.typeAnnotation = type; + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + }); + } + tsTryParseTypeOrTypePredicateAnnotation() { + if (this.match(14)) { + return this.tsParseTypeOrTypePredicateAnnotation(14); + } + } + tsTryParseTypeAnnotation() { + if (this.match(14)) { + return this.tsParseTypeAnnotation(); + } + } + tsTryParseType() { + return this.tsEatThenParseType(14); + } + tsParseTypePredicatePrefix() { + const id = this.parseIdentifier(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + this.next(); + return id; + } + } + tsParseTypePredicateAsserts() { + if (this.state.type !== 109) { + return false; + } + const containsEsc = this.state.containsEsc; + this.next(); + if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { + return false; + } + if (containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { + reservedWord: "asserts" + }); + } + return true; + } + tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { + this.tsInType(() => { + if (eatColon) this.expect(14); + t.typeAnnotation = this.tsParseType(); + }); + return this.finishNode(t, "TSTypeAnnotation"); + } + tsParseType() { + assert(this.state.inType); + const type = this.tsParseNonConditionalType(); + if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { + return type; + } + const node = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); + this.expect(17); + node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + this.expect(14); + node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + return this.finishNode(node, "TSConditionalType"); + } + isAbstractConstructorSignature() { + return this.isContextual(124) && this.lookahead().type === 77; + } + tsParseNonConditionalType() { + if (this.tsIsStartOfFunctionType()) { + return this.tsParseFunctionOrConstructorType("TSFunctionType"); + } + if (this.match(77)) { + return this.tsParseFunctionOrConstructorType("TSConstructorType"); + } else if (this.isAbstractConstructorSignature()) { + return this.tsParseFunctionOrConstructorType("TSConstructorType", true); + } + return this.tsParseUnionTypeOrHigher(); + } + tsParseTypeAssertion() { + if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); + } + const node = this.startNode(); + node.typeAnnotation = this.tsInType(() => { + this.next(); + return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); + }); + this.expect(48); + node.expression = this.parseMaybeUnary(); + return this.finishNode(node, "TSTypeAssertion"); + } + tsParseHeritageClause(token) { + const originalStartLoc = this.state.startLoc; + const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { + const node = this.startNode(); + node.expression = this.tsParseEntityName(); + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSExpressionWithTypeArguments"); + }); + if (!delimitedList.length) { + this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { + token + }); + } + return delimitedList; + } + tsParseInterfaceDeclaration(node, properties = {}) { + if (this.hasFollowingLineBreak()) return null; + this.expectContextual(129); + if (properties.declare) node.declare = true; + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 130); + } else { + node.id = null; + this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); + } + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (this.eat(81)) { + node.extends = this.tsParseHeritageClause("extends"); + } + const body = this.startNode(); + body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); + node.body = this.finishNode(body, "TSInterfaceBody"); + return this.finishNode(node, "TSInterfaceDeclaration"); + } + tsParseTypeAliasDeclaration(node) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 2); + node.typeAnnotation = this.tsInType(() => { + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); + this.expect(29); + if (this.isContextual(114) && this.lookahead().type !== 16) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSIntrinsicKeyword"); + } + return this.tsParseType(); + }); + this.semicolon(); + return this.finishNode(node, "TSTypeAliasDeclaration"); + } + tsInNoContext(cb) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } + tsInType(cb) { + const oldInType = this.state.inType; + this.state.inType = true; + try { + return cb(); + } finally { + this.state.inType = oldInType; + } + } + tsInDisallowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = true; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsInAllowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = false; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsEatThenParseType(token) { + if (this.match(token)) { + return this.tsNextThenParseType(); + } + } + tsExpectThenParseType(token) { + return this.tsInType(() => { + this.expect(token); + return this.tsParseType(); + }); + } + tsNextThenParseType() { + return this.tsInType(() => { + this.next(); + return this.tsParseType(); + }); + } + tsParseEnumMember() { + const node = this.startNode(); + node.id = this.match(133) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); + if (this.eat(29)) { + node.initializer = super.parseMaybeAssignAllowIn(); + } + return this.finishNode(node, "TSEnumMember"); + } + tsParseEnumDeclaration(node, properties = {}) { + if (properties.const) node.const = true; + if (properties.declare) node.declare = true; + this.expectContextual(126); + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, node.const ? 8971 : 8459); + this.expect(5); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(8); + return this.finishNode(node, "TSEnumDeclaration"); + } + tsParseModuleBlock() { + const node = this.startNode(); + this.scope.enter(0); + this.expect(5); + super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); + this.scope.exit(); + return this.finishNode(node, "TSModuleBlock"); + } + tsParseModuleOrNamespaceDeclaration(node, nested = false) { + node.id = this.parseIdentifier(); + if (!nested) { + this.checkIdentifier(node.id, 1024); + } + if (this.eat(16)) { + const inner = this.startNode(); + this.tsParseModuleOrNamespaceDeclaration(inner, true); + node.body = inner; + } else { + this.scope.enter(256); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseAmbientExternalModuleDeclaration(node) { + if (this.isContextual(112)) { + node.global = true; + node.id = this.parseIdentifier(); + } else if (this.match(133)) { + node.id = super.parseStringLiteral(this.state.value); + } else { + this.unexpected(); + } + if (this.match(5)) { + this.scope.enter(256); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } else { + this.semicolon(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { + node.isExport = isExport || false; + node.id = maybeDefaultIdentifier || this.parseIdentifier(); + this.checkIdentifier(node.id, 4096); + this.expect(29); + const moduleReference = this.tsParseModuleReference(); + if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { + this.raise(TSErrors.ImportAliasHasImportType, moduleReference); + } + node.moduleReference = moduleReference; + this.semicolon(); + return this.finishNode(node, "TSImportEqualsDeclaration"); + } + tsIsExternalModuleReference() { + return this.isContextual(119) && this.lookaheadCharCode() === 40; + } + tsParseModuleReference() { + return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); + } + tsParseExternalModuleReference() { + const node = this.startNode(); + this.expectContextual(119); + this.expect(10); + if (!this.match(133)) { + this.unexpected(); + } + node.expression = super.parseExprAtom(); + this.expect(11); + this.sawUnambiguousESM = true; + return this.finishNode(node, "TSExternalModuleReference"); + } + tsLookAhead(f) { + const state = this.state.clone(); + const res = f(); + this.state = state; + return res; + } + tsTryParseAndCatch(f) { + const result = this.tryParse(abort => f() || abort()); + if (result.aborted || !result.node) return; + if (result.error) this.state = result.failState; + return result.node; + } + tsTryParse(f) { + const state = this.state.clone(); + const result = f(); + if (result !== undefined && result !== false) { + return result; + } + this.state = state; + } + tsTryParseDeclare(nany) { + if (this.isLineTerminator()) { + return; + } + let startType = this.state.type; + let kind; + if (this.isContextual(100)) { + startType = 74; + kind = "let"; + } + return this.tsInAmbientContext(() => { + switch (startType) { + case 68: + nany.declare = true; + return super.parseFunctionStatement(nany, false, false); + case 80: + nany.declare = true; + return this.parseClass(nany, true, false); + case 126: + return this.tsParseEnumDeclaration(nany, { + declare: true + }); + case 112: + return this.tsParseAmbientExternalModuleDeclaration(nany); + case 75: + case 74: + if (!this.match(75) || !this.isLookaheadContextual("enum")) { + nany.declare = true; + return this.parseVarStatement(nany, kind || this.state.value, true); + } + this.expect(75); + return this.tsParseEnumDeclaration(nany, { + const: true, + declare: true + }); + case 129: + { + const result = this.tsParseInterfaceDeclaration(nany, { + declare: true + }); + if (result) return result; + } + default: + if (tokenIsIdentifier(startType)) { + return this.tsParseDeclaration(nany, this.state.value, true, null); + } + } + }); + } + tsTryParseExportDeclaration() { + return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); + } + tsParseExpressionStatement(node, expr, decorators) { + switch (expr.name) { + case "declare": + { + const declaration = this.tsTryParseDeclare(node); + if (declaration) { + declaration.declare = true; + } + return declaration; + } + case "global": + if (this.match(5)) { + this.scope.enter(256); + this.prodParam.enter(0); + const mod = node; + mod.global = true; + mod.id = expr; + mod.body = this.tsParseModuleBlock(); + this.scope.exit(); + this.prodParam.exit(); + return this.finishNode(mod, "TSModuleDeclaration"); + } + break; + default: + return this.tsParseDeclaration(node, expr.name, false, decorators); + } + } + tsParseDeclaration(node, value, next, decorators) { + switch (value) { + case "abstract": + if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { + return this.tsParseAbstractDeclaration(node, decorators); + } + break; + case "module": + if (this.tsCheckLineTerminator(next)) { + if (this.match(133)) { + return this.tsParseAmbientExternalModuleDeclaration(node); + } else if (tokenIsIdentifier(this.state.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + } + break; + case "namespace": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + break; + case "type": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseTypeAliasDeclaration(node); + } + break; + } + } + tsCheckLineTerminator(next) { + if (next) { + if (this.hasFollowingLineBreak()) return false; + this.next(); + return true; + } + return !this.isLineTerminator(); + } + tsTryParseGenericAsyncArrowFunction(startLoc) { + if (!this.match(47)) return; + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = true; + const res = this.tsTryParseAndCatch(() => { + const node = this.startNodeAt(startLoc); + node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + super.parseFunctionParams(node); + node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); + this.expect(19); + return node; + }); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + if (!res) return; + return super.parseArrowExpression(res, null, true); + } + tsParseTypeArgumentsInExpression() { + if (this.reScan_lt() !== 47) return; + return this.tsParseTypeArguments(); + } + tsParseTypeArguments() { + const node = this.startNode(); + node.params = this.tsInType(() => this.tsInNoContext(() => { + this.expect(47); + return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); + })); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeArguments, node); + } else if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); + } + this.expect(48); + return this.finishNode(node, "TSTypeParameterInstantiation"); + } + tsIsDeclarationStart() { + return tokenIsTSDeclarationStart(this.state.type); + } + isExportDefaultSpecifier() { + if (this.tsIsDeclarationStart()) return false; + return super.isExportDefaultSpecifier(); + } + parseAssignableListItem(flags, decorators) { + const startLoc = this.state.startLoc; + const modified = {}; + this.tsParseModifiers({ + allowedModifiers: ["public", "private", "protected", "override", "readonly"] + }, modified); + const accessibility = modified.accessibility; + const override = modified.override; + const readonly = modified.readonly; + if (!(flags & 4) && (accessibility || readonly || override)) { + this.raise(TSErrors.UnexpectedParameterModifier, startLoc); + } + const left = this.parseMaybeDefault(); + this.parseAssignableListItemTypes(left, flags); + const elt = this.parseMaybeDefault(left.loc.start, left); + if (accessibility || readonly || override) { + const pp = this.startNodeAt(startLoc); + if (decorators.length) { + pp.decorators = decorators; + } + if (accessibility) pp.accessibility = accessibility; + if (readonly) pp.readonly = readonly; + if (override) pp.override = override; + if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { + this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); + } + pp.parameter = elt; + return this.finishNode(pp, "TSParameterProperty"); + } + if (decorators.length) { + left.decorators = decorators; + } + return elt; + } + isSimpleParameter(node) { + return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); + } + tsDisallowOptionalPattern(node) { + for (const param of node.params) { + if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { + this.raise(TSErrors.PatternIsOptional, param); + } + } + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + super.setArrowFunctionParameters(node, params, trailingCommaLoc); + this.tsDisallowOptionalPattern(node); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + } + const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; + if (bodilessType && !this.match(5) && this.isLineTerminator()) { + return this.finishNode(node, bodilessType); + } + if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { + this.raise(TSErrors.DeclareFunctionHasImplementation, node); + if (node.declare) { + return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); + } + } + this.tsDisallowOptionalPattern(node); + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + registerFunctionStatementId(node) { + if (!node.body && node.id) { + this.checkIdentifier(node.id, 1024); + } else { + super.registerFunctionStatementId(node); + } + } + tsCheckForInvalidTypeCasts(items) { + items.forEach(node => { + if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { + this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); + } + }); + } + toReferencedList(exprList, isInParens) { + this.tsCheckForInvalidTypeCasts(exprList); + return exprList; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + if (node.type === "ArrayExpression") { + this.tsCheckForInvalidTypeCasts(node.elements); + } + return node; + } + parseSubscript(base, startLoc, noCalls, state) { + if (!this.hasPrecedingLineBreak() && this.match(35)) { + this.state.canStartJSXElement = false; + this.next(); + const nonNullExpression = this.startNodeAt(startLoc); + nonNullExpression.expression = base; + return this.finishNode(nonNullExpression, "TSNonNullExpression"); + } + let isOptionalCall = false; + if (this.match(18) && this.lookaheadCharCode() === 60) { + if (noCalls) { + state.stop = true; + return base; + } + state.optionalChainMember = isOptionalCall = true; + this.next(); + } + if (this.match(47) || this.match(51)) { + let missingParenErrorLoc; + const result = this.tsTryParseAndCatch(() => { + if (!noCalls && this.atPossibleAsyncArrow(base)) { + const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); + if (asyncArrowFn) { + return asyncArrowFn; + } + } + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (!typeArguments) return; + if (isOptionalCall && !this.match(10)) { + missingParenErrorLoc = this.state.curPosition(); + return; + } + if (tokenIsTemplate(this.state.type)) { + const result = super.parseTaggedTemplateExpression(base, startLoc, state); + result.typeParameters = typeArguments; + return result; + } + if (!noCalls && this.eat(10)) { + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(11, false); + this.tsCheckForInvalidTypeCasts(node.arguments); + node.typeParameters = typeArguments; + if (state.optionalChainMember) { + node.optional = isOptionalCall; + } + return this.finishCallExpression(node, state.optionalChainMember); + } + const tokenType = this.state.type; + if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { + return; + } + const node = this.startNodeAt(startLoc); + node.expression = base; + node.typeParameters = typeArguments; + return this.finishNode(node, "TSInstantiationExpression"); + }); + if (missingParenErrorLoc) { + this.unexpected(missingParenErrorLoc, 10); + } + if (result) { + if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { + this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); + } + return result; + } + } + return super.parseSubscript(base, startLoc, noCalls, state); + } + parseNewCallee(node) { + var _callee$extra; + super.parseNewCallee(node); + const { + callee + } = node; + if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { + node.typeParameters = callee.typeParameters; + node.callee = callee.expression; + } + } + parseExprOp(left, leftStartLoc, minPrec) { + let isSatisfies; + if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { + const node = this.startNodeAt(leftStartLoc); + node.expression = left; + node.typeAnnotation = this.tsInType(() => { + this.next(); + if (this.match(75)) { + if (isSatisfies) { + this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { + keyword: "const" + }); + } + return this.tsParseTypeReference(); + } + return this.tsParseType(); + }); + this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartLoc, minPrec); + } + return super.parseExprOp(left, leftStartLoc, minPrec); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (!this.state.isAmbientContext) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + checkDuplicateExports() {} + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + const ch = this.lookaheadCharCode(); + return isExport ? ch === 123 || ch === 42 : ch !== 61; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + node.exportKind = phase === "type" ? "type" : "value"; + } else { + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImport(node) { + if (this.match(133)) { + node.importKind = "value"; + return super.parseImport(node); + } + let importNode; + if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { + node.importKind = "value"; + return this.tsParseImportEqualsDeclaration(node); + } else if (this.isContextual(130)) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); + if (this.lookaheadCharCode() === 61) { + return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); + } else { + importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); + } + } else { + importNode = super.parseImport(node); + } + if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { + this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); + } + return importNode; + } + parseExport(node, decorators) { + if (this.match(83)) { + this.next(); + const nodeImportEquals = node; + let maybeDefaultIdentifier = null; + if (this.isContextual(130) && this.isPotentialImportPhase(false)) { + maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false); + } else { + nodeImportEquals.importKind = "value"; + } + return this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true); + } else if (this.eat(29)) { + const assign = node; + assign.expression = super.parseExpression(); + this.semicolon(); + this.sawUnambiguousESM = true; + return this.finishNode(assign, "TSExportAssignment"); + } else if (this.eatContextual(93)) { + const decl = node; + this.expectContextual(128); + decl.id = this.parseIdentifier(); + this.semicolon(); + return this.finishNode(decl, "TSNamespaceExportDeclaration"); + } else { + return super.parseExport(node, decorators); + } + } + isAbstractClass() { + return this.isContextual(124) && this.lookahead().type === 80; + } + parseExportDefaultExpression() { + if (this.isAbstractClass()) { + const cls = this.startNode(); + this.next(); + cls.abstract = true; + return this.parseClass(cls, true, true); + } + if (this.match(129)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseExportDefaultExpression(); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + const { + isAmbientContext + } = this.state; + const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); + if (!isAmbientContext) return declaration; + for (const { + id, + init + } of declaration.declarations) { + if (!init) continue; + if (kind !== "const" || !!id.typeAnnotation) { + this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); + } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { + this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); + } + } + return declaration; + } + parseStatementContent(flags, decorators) { + if (this.match(75) && this.isLookaheadContextual("enum")) { + const node = this.startNode(); + this.expect(75); + return this.tsParseEnumDeclaration(node, { + const: true + }); + } + if (this.isContextual(126)) { + return this.tsParseEnumDeclaration(this.startNode()); + } + if (this.isContextual(129)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseStatementContent(flags, decorators); + } + parseAccessModifier() { + return this.tsParseModifier(["public", "protected", "private"]); + } + tsHasSomeModifiers(member, modifiers) { + return modifiers.some(modifier => { + if (tsIsAccessModifier(modifier)) { + return member.accessibility === modifier; + } + return !!member[modifier]; + }); + } + tsIsStartOfStaticBlocks() { + return this.isContextual(106) && this.lookaheadCharCode() === 123; + } + parseClassMember(classBody, member, state) { + const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; + this.tsParseModifiers({ + allowedModifiers: modifiers, + disallowedModifiers: ["in", "out"], + stopOnStartOfClassStaticBlock: true, + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }, member); + const callParseClassMemberWithIsStatic = () => { + if (this.tsIsStartOfStaticBlocks()) { + this.next(); + this.next(); + if (this.tsHasSomeModifiers(member, modifiers)) { + this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); + } + super.parseClassStaticBlock(classBody, member); + } else { + this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); + } + }; + if (member.declare) { + this.tsInAmbientContext(callParseClassMemberWithIsStatic); + } else { + callParseClassMemberWithIsStatic(); + } + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const idx = this.tsTryParseIndexSignature(member); + if (idx) { + classBody.body.push(idx); + if (member.abstract) { + this.raise(TSErrors.IndexSignatureHasAbstract, member); + } + if (member.accessibility) { + this.raise(TSErrors.IndexSignatureHasAccessibility, member, { + modifier: member.accessibility + }); + } + if (member.declare) { + this.raise(TSErrors.IndexSignatureHasDeclare, member); + } + if (member.override) { + this.raise(TSErrors.IndexSignatureHasOverride, member); + } + return; + } + if (!this.state.inAbstractClass && member.abstract) { + this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); + } + if (member.override) { + if (!state.hadSuperClass) { + this.raise(TSErrors.OverrideNotInSubClass, member); + } + } + super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parsePostMemberNameModifiers(methodOrProp) { + const optional = this.eat(17); + if (optional) methodOrProp.optional = true; + if (methodOrProp.readonly && this.match(10)) { + this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); + } + if (methodOrProp.declare && this.match(10)) { + this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); + } + } + parseExpressionStatement(node, expr, decorators) { + const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; + return decl || super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + if (this.tsIsDeclarationStart()) return true; + return super.shouldParseExportDeclaration(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.state.maybeInArrowParameters || !this.match(17)) { + return super.parseConditional(expr, startLoc, refExpressionErrors); + } + const result = this.tryParse(() => super.parseConditional(expr, startLoc)); + if (!result.node) { + if (result.error) { + super.setOptionalParametersError(refExpressionErrors, result.error); + } + return expr; + } + if (result.error) this.state = result.failState; + return result.node; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); + } + return node; + } + parseExportDeclaration(node) { + if (!this.state.isAmbientContext && this.isContextual(125)) { + return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); + } + const startLoc = this.state.startLoc; + const isDeclare = this.eatContextual(125); + if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { + throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); + } + const isIdentifier = tokenIsIdentifier(this.state.type); + const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); + if (!declaration) return null; + if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { + node.exportKind = "type"; + } + if (isDeclare) { + this.resetStartLocation(declaration, startLoc); + declaration.declare = true; + } + return declaration; + } + parseClassId(node, isStatement, optionalId, bindingType) { + if ((!isStatement || optionalId) && this.isContextual(113)) { + return; + } + super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); + const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (typeParameters) node.typeParameters = typeParameters; + } + parseClassPropertyAnnotation(node) { + if (!node.optional) { + if (this.eat(35)) { + node.definite = true; + } else if (this.eat(17)) { + node.optional = true; + } + } + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + } + parseClassProperty(node) { + this.parseClassPropertyAnnotation(node); + if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { + this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); + } + if (node.abstract && this.match(29)) { + const { + key + } = node; + this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { + propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (node.abstract) { + this.raise(TSErrors.PrivateElementHasAbstract, node); + } + if (node.accessibility) { + this.raise(TSErrors.PrivateElementHasAccessibility, node, { + modifier: node.accessibility + }); + } + this.parseClassPropertyAnnotation(node); + return super.parseClassPrivateProperty(node); + } + parseClassAccessorProperty(node) { + this.parseClassPropertyAnnotation(node); + if (node.optional) { + this.raise(TSErrors.AccessorCannotBeOptional, node); + } + return super.parseClassAccessorProperty(node); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters && isConstructor) { + this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); + } + const { + declare = false, + kind + } = method; + if (declare && (kind === "get" || kind === "set")) { + this.raise(TSErrors.DeclareAccessor, method, { + kind + }); + } + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + declareClassPrivateMethodInScope(node, kind) { + if (node.type === "TSDeclareMethod") return; + if (node.type === "MethodDefinition" && !hasOwnProperty.call(node.value, "body")) { + return; + } + super.declareClassPrivateMethodInScope(node, kind); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.match(47) || this.match(51))) { + node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); + } + if (this.eatContextual(113)) { + node.implements = this.tsParseHeritageClause("implements"); + } + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) prop.typeParameters = typeParameters; + return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + } + parseFunctionParams(node, isConstructor) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) node.typeParameters = typeParameters; + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { + decl.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) { + decl.id.typeAnnotation = type; + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + node.returnType = this.tsParseTypeAnnotation(); + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; + let state; + let jsx; + let typeCast; + if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + if (!state || state === this.state) state = this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _expr$extra, _typeParameters; + typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + abort(); + } + if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); + } + expr.typeParameters = typeParameters; + return expr; + }, state); + if (!arrow.error && !arrow.aborted) { + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if (!jsx) { + assert(!this.hasPlugin("jsx")); + typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!typeCast.error) return typeCast.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrow.node) { + this.state = arrow.failState; + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if ((_typeCast = typeCast) != null && _typeCast.node) { + this.state = typeCast.failState; + return typeCast.node; + } + throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); + } + reportReservedArrowTypeParam(node) { + var _node$extra; + if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedArrowTypeParam, node); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + if (!this.hasPlugin("jsx") && this.match(47)) { + return this.tsParseTypeAssertion(); + } + return super.parseMaybeUnary(refExpressionErrors, sawUnary); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(abort => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + if (this.canInsertSemicolon() || !this.match(19)) abort(); + return returnType; + }); + if (result.aborted) return; + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; + } + } + return super.parseArrow(node); + } + parseAssignableListItemTypes(param, flags) { + if (!(flags & 2)) return param; + if (this.eat(17)) { + param.optional = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) param.typeAnnotation = type; + this.resetEndLocation(param); + return param; + } + isAssignable(node, isBinding) { + switch (node.type) { + case "TSTypeCastExpression": + return this.isAssignable(node.expression, isBinding); + case "TSParameterProperty": + return true; + default: + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + switch (node.type) { + case "ParenthesizedExpression": + this.toAssignableParenthesizedExpression(node, isLHS); + break; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + if (isLHS) { + this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); + } else { + this.raise(TSErrors.UnexpectedTypeCastInParameter, node); + } + this.toAssignable(node.expression, isLHS); + break; + case "AssignmentExpression": + if (!isLHS && node.left.type === "TSTypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + default: + super.toAssignable(node, isLHS); + } + } + toAssignableParenthesizedExpression(node, isLHS) { + switch (node.expression.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + case "ParenthesizedExpression": + this.toAssignable(node.expression, isLHS); + break; + default: + super.toAssignable(node, isLHS); + } + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + this.checkToRestConversion(node.expression, false); + break; + default: + super.checkToRestConversion(node, allowPattern); + } + } + isValidLVal(type, isUnparenthesizedInAssign, binding) { + switch (type) { + case "TSTypeCastExpression": + return true; + case "TSParameterProperty": + return "parameter"; + case "TSNonNullExpression": + case "TSInstantiationExpression": + return "expression"; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true]; + default: + return super.isValidLVal(type, isUnparenthesizedInAssign, binding); + } + } + parseBindingAtom() { + if (this.state.type === 78) { + return this.parseIdentifier(true); + } + return super.parseBindingAtom(); + } + parseMaybeDecoratorArguments(expr) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (this.match(10)) { + const call = super.parseMaybeDecoratorArguments(expr); + call.typeParameters = typeArguments; + return call; + } + this.unexpected(null, 10); + } + return super.parseMaybeDecoratorArguments(expr); + } + checkCommaAfterRest(close) { + if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { + this.next(); + return false; + } + return super.checkCommaAfterRest(close); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(35) || this.match(14) || super.isClassProperty(); + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); + } + return node; + } + getTokenFromCode(code) { + if (this.state.inType) { + if (code === 62) { + this.finishOp(48, 1); + return; + } + if (code === 60) { + this.finishOp(47, 1); + return; + } + } + super.getTokenFromCode(code); + } + reScan_lt_gt() { + const { + type + } = this.state; + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + reScan_lt() { + const { + type + } = this.state; + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + return type; + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + shouldParseArrow(params) { + if (this.match(14)) { + return params.every(expr => this.isAssignable(expr, true)); + } + return super.shouldParseArrow(params); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + canHaveLeadingDecorator() { + return super.canHaveLeadingDecorator() || this.isAbstractClass(); + } + jsxParseOpeningElementAfterName(node) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); + if (typeArguments) node.typeParameters = typeArguments; + } + return super.jsxParseOpeningElementAfterName(node); + } + getGetterSetterExpectedParamCount(method) { + const baseCount = super.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + const firstParam = params[0]; + const hasContextParam = firstParam && this.isThisParam(firstParam); + return hasContextParam ? baseCount + 1 : baseCount; + } + parseCatchClauseParam() { + const param = super.parseCatchClauseParam(); + const type = this.tsTryParseTypeAnnotation(); + if (type) { + param.typeAnnotation = type; + this.resetEndLocation(param); + } + return param; + } + tsInAmbientContext(cb) { + const { + isAmbientContext: oldIsAmbientContext, + strict: oldStrict + } = this.state; + this.state.isAmbientContext = true; + this.state.strict = false; + try { + return cb(); + } finally { + this.state.isAmbientContext = oldIsAmbientContext; + this.state.strict = oldStrict; + } + } + parseClass(node, isStatement, optionalId) { + const oldInAbstractClass = this.state.inAbstractClass; + this.state.inAbstractClass = !!node.abstract; + try { + return super.parseClass(node, isStatement, optionalId); + } finally { + this.state.inAbstractClass = oldInAbstractClass; + } + } + tsParseAbstractDeclaration(node, decorators) { + if (this.match(80)) { + node.abstract = true; + return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); + } else if (this.isContextual(129)) { + if (!this.hasFollowingLineBreak()) { + node.abstract = true; + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node); + return this.tsParseInterfaceDeclaration(node); + } + } else { + this.unexpected(null, 80); + } + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { + const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + if (method.abstract) { + const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; + if (hasBody) { + const { + key + } = method; + this.raise(TSErrors.AbstractMethodHasImplementation, method, { + methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }); + } + } + return method; + } + tsParseTypeParameterName() { + const typeName = this.parseIdentifier(); + return typeName.name; + } + shouldParseAsAmbientContext() { + return !!this.getPluginOption("typescript", "dts"); + } + parse() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.parse(); + } + getExpression() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.getExpression(); + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (!isString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); + return this.finishNode(node, "ExportSpecifier"); + } + node.exportKind = "value"; + return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (!importedIsString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); + return this.finishNode(specifier, "ImportSpecifier"); + } + specifier.importKind = "value"; + return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); + } + parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { + const leftOfAsKey = isImport ? "imported" : "local"; + const rightOfAsKey = isImport ? "local" : "exported"; + let leftOfAs = node[leftOfAsKey]; + let rightOfAs; + let hasTypeSpecifier = false; + let canParseAsKeyword = true; + const loc = leftOfAs.loc.start; + if (this.isContextual(93)) { + const firstAs = this.parseIdentifier(); + if (this.isContextual(93)) { + const secondAs = this.parseIdentifier(); + if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + leftOfAs = firstAs; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + canParseAsKeyword = false; + } else { + rightOfAs = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + canParseAsKeyword = false; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } else { + hasTypeSpecifier = true; + leftOfAs = firstAs; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + if (isImport) { + leftOfAs = this.parseIdentifier(true); + if (!this.isContextual(93)) { + this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); + } + } else { + leftOfAs = this.parseModuleExportName(); + } + } + if (hasTypeSpecifier && isInTypeOnlyImportExport) { + this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); + } + node[leftOfAsKey] = leftOfAs; + node[rightOfAsKey] = rightOfAs; + const kindKey = isImport ? "importKind" : "exportKind"; + node[kindKey] = hasTypeSpecifier ? "type" : "value"; + if (canParseAsKeyword && this.eatContextual(93)) { + node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } + if (!node[rightOfAsKey]) { + node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); + } + if (isImport) { + this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); + } + } + }; + function isPossiblyLiteralEnum(expression) { + if (expression.type !== "MemberExpression") return false; + const { + computed, + property + } = expression; + if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); + } + function isValidAmbientConstInitializer(expression, estree) { + var _expression$extra; + const { + type + } = expression; + if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { + return false; + } + if (estree) { + if (type === "Literal") { + const { + value + } = expression; + if (typeof value === "string" || typeof value === "boolean") { + return true; + } + } + } else { + if (type === "StringLiteral" || type === "BooleanLiteral") { + return true; + } + } + if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { + return true; + } + if (type === "TemplateLiteral" && expression.expressions.length === 0) { + return true; + } + if (isPossiblyLiteralEnum(expression)) { + return true; + } + return false; + } + function isNumber(expression, estree) { + if (estree) { + return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); + } + return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; + } + function isNegativeNumber(expression, estree) { + if (expression.type === "UnaryExpression") { + const { + operator, + argument + } = expression; + if (operator === "-" && isNumber(argument, estree)) { + return true; + } + } + return false; + } + function isUncomputedMemberExpressionChain(expression) { + if (expression.type === "Identifier") return true; + if (expression.type !== "MemberExpression" || expression.computed) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); + } + const PlaceholderErrors = ParseErrorEnum`placeholders`({ + ClassNameIsRequired: "A class name is required.", + UnexpectedSpace: "Unexpected space in placeholder." + }); + var placeholders = superClass => class PlaceholdersParserMixin extends superClass { + parsePlaceholder(expectedNode) { + if (this.match(144)) { + const node = this.startNode(); + this.next(); + this.assertNoSpace(); + node.name = super.parseIdentifier(true); + this.assertNoSpace(); + this.expect(144); + return this.finishPlaceholder(node, expectedNode); + } + } + finishPlaceholder(node, expectedNode) { + let placeholder = node; + if (!placeholder.expectedNode || !placeholder.type) { + placeholder = this.finishNode(placeholder, "Placeholder"); + } + placeholder.expectedNode = expectedNode; + return placeholder; + } + getTokenFromCode(code) { + if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { + this.finishOp(144, 2); + } else { + super.getTokenFromCode(code); + } + } + parseExprAtom(refExpressionErrors) { + return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); + } + parseIdentifier(liberal) { + return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word !== undefined) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + parseBindingAtom() { + return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); + } + isValidLVal(type, isParenthesized, binding) { + return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); + } + toAssignable(node, isLHS) { + if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { + node.expectedNode = "Pattern"; + } else { + super.toAssignable(node, isLHS); + } + } + chStartsBindingIdentifier(ch, pos) { + if (super.chStartsBindingIdentifier(ch, pos)) { + return true; + } + const nextToken = this.lookahead(); + if (nextToken.type === 144) { + return true; + } + return false; + } + verifyBreakContinue(node, isBreak) { + if (node.label && node.label.type === "Placeholder") return; + super.verifyBreakContinue(node, isBreak); + } + parseExpressionStatement(node, expr) { + var _expr$extra; + if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + return super.parseExpressionStatement(node, expr); + } + if (this.match(14)) { + const stmt = node; + stmt.label = this.finishPlaceholder(expr, "Identifier"); + this.next(); + stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); + return this.finishNode(stmt, "LabeledStatement"); + } + this.semicolon(); + const stmtPlaceholder = node; + stmtPlaceholder.name = expr.name; + return this.finishPlaceholder(stmtPlaceholder, "Statement"); + } + parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { + return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); + } + parseFunctionId(requireId) { + return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); + } + parseClass(node, isStatement, optionalId) { + const type = isStatement ? "ClassDeclaration" : "ClassExpression"; + this.next(); + const oldStrict = this.state.strict; + const placeholder = this.parsePlaceholder("Identifier"); + if (placeholder) { + if (this.match(81) || this.match(144) || this.match(5)) { + node.id = placeholder; + } else if (optionalId || !isStatement) { + node.id = null; + node.body = this.finishPlaceholder(placeholder, "ClassBody"); + return this.finishNode(node, type); + } else { + throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); + } + } else { + this.parseClassId(node, isStatement, optionalId); + } + super.parseClassSuper(node); + node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, type); + } + parseExport(node, decorators) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseExport(node, decorators); + const node2 = node; + if (!this.isContextual(98) && !this.match(12)) { + node2.specifiers = []; + node2.source = null; + node2.declaration = this.finishPlaceholder(placeholder, "Declaration"); + return this.finishNode(node2, "ExportNamedDeclaration"); + } + this.expectPlugin("exportDefaultFrom"); + const specifier = this.startNode(); + specifier.exported = placeholder; + node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return super.parseExport(node2, decorators); + } + isExportDefaultSpecifier() { + if (this.match(65)) { + const next = this.nextTokenStart(); + if (this.isUnparsedContextual(next, "from")) { + if (this.input.startsWith(tokenLabelName(144), this.nextTokenStartSince(next + 4))) { + return true; + } + } + } + return super.isExportDefaultSpecifier(); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + var _specifiers; + if ((_specifiers = node.specifiers) != null && _specifiers.length) { + return true; + } + return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + } + checkExport(node) { + const { + specifiers + } = node; + if (specifiers != null && specifiers.length) { + node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); + } + super.checkExport(node); + node.specifiers = specifiers; + } + parseImport(node) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseImport(node); + node.specifiers = []; + if (!this.isContextual(98) && !this.match(12)) { + node.source = this.finishPlaceholder(placeholder, "StringLiteral"); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + const specifier = this.startNodeAtNode(placeholder); + specifier.local = placeholder; + node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); + if (this.eat(12)) { + const hasStarImport = this.maybeParseStarImportSpecifier(node); + if (!hasStarImport) this.parseNamedImportSpecifiers(node); + } + this.expectContextual(98); + node.source = this.parseImportSource(); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); + } + assertNoSpace() { + if (this.state.start > this.state.lastTokEndLoc.index) { + this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); + } + } + }; + var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { + parseV8Intrinsic() { + if (this.match(54)) { + const v8IntrinsicStartLoc = this.state.startLoc; + const node = this.startNode(); + this.next(); + if (tokenIsIdentifier(this.state.type)) { + const name = this.parseIdentifierName(); + const identifier = this.createIdentifier(node, name); + identifier.type = "V8IntrinsicIdentifier"; + if (this.match(10)) { + return identifier; + } + } + this.unexpected(v8IntrinsicStartLoc); + } + } + parseExprAtom(refExpressionErrors) { + return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); + } + }; + const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; + const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; + function validatePlugins(pluginsMap) { + if (pluginsMap.has("decorators")) { + if (pluginsMap.has("decorators-legacy")) { + throw new Error("Cannot use the decorators and decorators-legacy plugin together"); + } + const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport; + if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { + throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); + } + const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized; + if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { + throw new Error("'allowCallParenthesized' must be a boolean."); + } + } + if (pluginsMap.has("flow") && pluginsMap.has("typescript")) { + throw new Error("Cannot combine flow and typescript plugins."); + } + if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); + } + if (pluginsMap.has("pipelineOperator")) { + var _pluginsMap$get; + const proposal = pluginsMap.get("pipelineOperator").proposal; + if (!PIPELINE_PROPOSALS.includes(proposal)) { + const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); + throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); + } + const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash"; + if (proposal === "hack") { + if (pluginsMap.has("placeholders")) { + throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); + } + if (pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); + } + const topicToken = pluginsMap.get("pipelineOperator").topicToken; + if (!TOPIC_TOKENS.includes(topicToken)) { + const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); + throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); + } + if (topicToken === "#" && tupleSyntaxIsHash) { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } else if (proposal === "smart" && tupleSyntaxIsHash) { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } + if (pluginsMap.has("moduleAttributes")) { + { + if (pluginsMap.has("importAttributes") || pluginsMap.has("importAssertions")) { + throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins."); + } + const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; + if (moduleAttributesVersionPluginOption !== "may-2020") { + throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); + } + } + } + if (pluginsMap.has("importAttributes") && pluginsMap.has("importAssertions")) { + throw new Error("Cannot combine importAssertions and importAttributes plugins."); + } + if (pluginsMap.has("recordAndTuple")) { + const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; + if (syntaxType != null) { + { + const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; + if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { + throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); + } + } + } + } + if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) { + const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); + error.missingPlugins = "doExpressions"; + throw error; + } + if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { + throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); + } + } + const mixinPlugins = { + estree, + jsx, + flow, + typescript, + v8intrinsic, + placeholders + }; + const mixinPluginNames = Object.keys(mixinPlugins); + const defaultOptions = { + sourceType: "script", + sourceFilename: undefined, + startColumn: 0, + startLine: 1, + allowAwaitOutsideFunction: false, + allowReturnOutsideFunction: false, + allowNewTargetOutsideFunction: false, + allowImportExportEverywhere: false, + allowSuperOutsideMethod: false, + allowUndeclaredExports: false, + plugins: [], + strictMode: null, + ranges: false, + tokens: false, + createImportExpressions: false, + createParenthesizedExpressions: false, + errorRecovery: false, + attachComment: true, + annexB: true + }; + function getOptions(opts) { + if (opts == null) { + return Object.assign({}, defaultOptions); + } + if (opts.annexB != null && opts.annexB !== false) { + throw new Error("The `annexB` option can only be set to `false`."); + } + const options = {}; + for (const key of Object.keys(defaultOptions)) { + var _opts$key; + options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key]; + } + return options; + } + class ExpressionParser extends LValParser { + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { + return; + } + const key = prop.key; + const name = key.type === "Identifier" ? key.name : key.value; + if (name === "__proto__") { + if (isRecord) { + this.raise(Errors.RecordNoProto, key); + return; + } + if (protoRef.used) { + if (refExpressionErrors) { + if (refExpressionErrors.doubleProtoLoc === null) { + refExpressionErrors.doubleProtoLoc = key.loc.start; + } + } else { + this.raise(Errors.DuplicateProto, key); + } + } + protoRef.used = true; + } + } + shouldExitDescending(expr, potentialArrowAt) { + return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; + } + getExpression() { + this.enterInitialScopes(); + this.nextToken(); + const expr = this.parseExpression(); + if (!this.match(139)) { + this.unexpected(); + } + this.finalizeRemainingComments(); + expr.comments = this.comments; + expr.errors = this.state.errors; + if (this.options.tokens) { + expr.tokens = this.tokens; + } + return expr; + } + parseExpression(disallowIn, refExpressionErrors) { + if (disallowIn) { + return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + parseExpressionBase(refExpressionErrors) { + const startLoc = this.state.startLoc; + const expr = this.parseMaybeAssign(refExpressionErrors); + if (this.match(12)) { + const node = this.startNodeAt(startLoc); + node.expressions = [expr]; + while (this.eat(12)) { + node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); + } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); + } + return expr; + } + parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { + return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { + return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + setOptionalParametersError(refExpressionErrors, resultError) { + var _resultError$loc; + refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + const startLoc = this.state.startLoc; + if (this.isContextual(108)) { + if (this.prodParam.hasYield) { + let left = this.parseYield(); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + return left; + } + } + let ownExpressionErrors; + if (refExpressionErrors) { + ownExpressionErrors = false; + } else { + refExpressionErrors = new ExpressionErrors(); + ownExpressionErrors = true; + } + const { + type + } = this.state; + if (type === 10 || tokenIsIdentifier(type)) { + this.state.potentialArrowAt = this.state.start; + } + let left = this.parseMaybeConditional(refExpressionErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + if (tokenIsAssignment(this.state.type)) { + const node = this.startNodeAt(startLoc); + const operator = this.state.value; + node.operator = operator; + if (this.match(29)) { + this.toAssignable(left, true); + node.left = left; + const startIndex = startLoc.index; + if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { + refExpressionErrors.doubleProtoLoc = null; + } + if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { + refExpressionErrors.shorthandAssignLoc = null; + } + if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { + this.checkDestructuringPrivate(refExpressionErrors); + refExpressionErrors.privateKeyLoc = null; + } + } else { + node.left = left; + } + this.next(); + node.right = this.parseMaybeAssign(); + this.checkLVal(left, this.finishNode(node, "AssignmentExpression")); + return node; + } else if (ownExpressionErrors) { + this.checkExpressionErrors(refExpressionErrors, true); + } + return left; + } + parseMaybeConditional(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprOps(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseConditional(expr, startLoc, refExpressionErrors); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (this.eat(17)) { + const node = this.startNodeAt(startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssignAllowIn(); + this.expect(14); + node.alternate = this.parseMaybeAssign(); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + } + parseMaybeUnaryOrPrivate(refExpressionErrors) { + return this.match(138) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); + } + parseExprOps(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseExprOp(expr, startLoc, -1); + } + parseExprOp(left, leftStartLoc, minPrec) { + if (this.isPrivateName(left)) { + const value = this.getPrivateNameSV(left); + if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { + this.raise(Errors.PrivateInExpectedIn, left, { + identifierName: value + }); + } + this.classScope.usePrivateName(value, left.loc.start); + } + const op = this.state.type; + if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { + let prec = tokenOperatorPrecedence(op); + if (prec > minPrec) { + if (op === 39) { + this.expectPlugin("pipelineOperator"); + if (this.state.inFSharpPipelineDirectBody) { + return left; + } + this.checkPipelineAtInfixOperator(left, leftStartLoc); + } + const node = this.startNodeAt(leftStartLoc); + node.left = left; + node.operator = this.state.value; + const logical = op === 41 || op === 42; + const coalesce = op === 40; + if (coalesce) { + prec = tokenOperatorPrecedence(42); + } + this.next(); + if (op === 39 && this.hasPlugin(["pipelineOperator", { + proposal: "minimal" + }])) { + if (this.state.type === 96 && this.prodParam.hasAwait) { + throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); + } + } + node.right = this.parseExprOpRightExpr(op, prec); + const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); + const nextOp = this.state.type; + if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { + throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); + } + return this.parseExprOp(finishedNode, leftStartLoc, minPrec); + } + } + return left; + } + parseExprOpRightExpr(op, prec) { + const startLoc = this.state.startLoc; + switch (op) { + case 39: + switch (this.getPluginOption("pipelineOperator", "proposal")) { + case "hack": + return this.withTopicBindingContext(() => { + return this.parseHackPipeBody(); + }); + case "smart": + return this.withTopicBindingContext(() => { + if (this.prodParam.hasYield && this.isContextual(108)) { + throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); + } + return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); + }); + case "fsharp": + return this.withSoloAwaitPermittingContext(() => { + return this.parseFSharpPipelineBody(prec); + }); + } + default: + return this.parseExprOpBaseRightExpr(op, prec); + } + } + parseExprOpBaseRightExpr(op, prec) { + const startLoc = this.state.startLoc; + return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); + } + parseHackPipeBody() { + var _body$extra; + const { + startLoc + } = this.state; + const body = this.parseMaybeAssign(); + const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); + if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { + this.raise(Errors.PipeUnparenthesizedBody, startLoc, { + type: body.type + }); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipeTopicUnused, startLoc); + } + return body; + } + checkExponentialAfterUnary(node) { + if (this.match(57)) { + this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + const startLoc = this.state.startLoc; + const isAwait = this.isContextual(96); + if (isAwait && this.recordAwaitIfAllowed()) { + this.next(); + const expr = this.parseAwait(startLoc); + if (!sawUnary) this.checkExponentialAfterUnary(expr); + return expr; + } + const update = this.match(34); + const node = this.startNode(); + if (tokenIsPrefix(this.state.type)) { + node.operator = this.state.value; + node.prefix = true; + if (this.match(72)) { + this.expectPlugin("throwExpressions"); + } + const isDelete = this.match(89); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refExpressionErrors, true); + if (this.state.strict && isDelete) { + const arg = node.argument; + if (arg.type === "Identifier") { + this.raise(Errors.StrictDelete, node); + } else if (this.hasPropertyAsPrivateName(arg)) { + this.raise(Errors.DeletePrivateField, node); + } + } + if (!update) { + if (!sawUnary) { + this.checkExponentialAfterUnary(node); + } + return this.finishNode(node, "UnaryExpression"); + } + } + const expr = this.parseUpdate(node, update, refExpressionErrors); + if (isAwait) { + const { + type + } = this.state; + const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); + if (startsExpr && !this.isAmbiguousAwait()) { + this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); + return this.parseAwait(startLoc); + } + } + return expr; + } + parseUpdate(node, update, refExpressionErrors) { + if (update) { + const updateExpressionNode = node; + this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression")); + return node; + } + const startLoc = this.state.startLoc; + let expr = this.parseExprSubscripts(refExpressionErrors); + if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; + while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.next(); + this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression")); + } + return expr; + } + parseExprSubscripts(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprAtom(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseSubscripts(expr, startLoc); + } + parseSubscripts(base, startLoc, noCalls) { + const state = { + optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsyncArrow(base), + stop: false + }; + do { + base = this.parseSubscript(base, startLoc, noCalls, state); + state.maybeAsyncArrow = false; + } while (!state.stop); + return base; + } + parseSubscript(base, startLoc, noCalls, state) { + const { + type + } = this.state; + if (!noCalls && type === 15) { + return this.parseBind(base, startLoc, noCalls, state); + } else if (tokenIsTemplate(type)) { + return this.parseTaggedTemplateExpression(base, startLoc, state); + } + let optional = false; + if (type === 18) { + if (noCalls) { + this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); + if (this.lookaheadCharCode() === 40) { + state.stop = true; + return base; + } + } + state.optionalChainMember = optional = true; + this.next(); + } + if (!noCalls && this.match(10)) { + return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); + } else { + const computed = this.eat(0); + if (computed || optional || this.eat(16)) { + return this.parseMember(base, startLoc, state, computed, optional); + } else { + state.stop = true; + return base; + } + } + } + parseMember(base, startLoc, state, computed, optional) { + const node = this.startNodeAt(startLoc); + node.object = base; + node.computed = computed; + if (computed) { + node.property = this.parseExpression(); + this.expect(3); + } else if (this.match(138)) { + if (base.type === "Super") { + this.raise(Errors.SuperPrivateField, startLoc); + } + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + if (state.optionalChainMember) { + node.optional = optional; + return this.finishNode(node, "OptionalMemberExpression"); + } else { + return this.finishNode(node, "MemberExpression"); + } + } + parseBind(base, startLoc, noCalls, state) { + const node = this.startNodeAt(startLoc); + node.object = base; + this.next(); + node.callee = this.parseNoCallExpr(); + state.stop = true; + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); + } + parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + let refExpressionErrors = null; + this.state.maybeInArrowParameters = true; + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + const { + maybeAsyncArrow, + optionalChainMember + } = state; + if (maybeAsyncArrow) { + this.expressionScope.enter(newAsyncArrowScope()); + refExpressionErrors = new ExpressionErrors(); + } + if (optionalChainMember) { + node.optional = optional; + } + if (optional) { + node.arguments = this.parseCallExpressionArguments(11); + } else { + node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors); + } + let finishedNode = this.finishCallExpression(node, optionalChainMember); + if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { + state.stop = true; + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); + } else { + if (maybeAsyncArrow) { + this.checkExpressionErrors(refExpressionErrors, true); + this.expressionScope.exit(); + } + this.toReferencedArguments(finishedNode); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return finishedNode; + } + toReferencedArguments(node, isParenthesizedExpr) { + this.toReferencedListDeep(node.arguments, isParenthesizedExpr); + } + parseTaggedTemplateExpression(base, startLoc, state) { + const node = this.startNodeAt(startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + if (state.optionalChainMember) { + this.raise(Errors.OptionalChainingNoTemplate, startLoc); + } + return this.finishNode(node, "TaggedTemplateExpression"); + } + atPossibleAsyncArrow(base) { + return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; + } + expectImportAttributesPlugin() { + if (!this.hasPlugin("importAssertions")) { + this.expectPlugin("importAttributes"); + } + } + finishCallExpression(node, optional) { + if (node.callee.type === "Import") { + if (node.arguments.length === 2) { + { + if (!this.hasPlugin("moduleAttributes")) { + this.expectImportAttributesPlugin(); + } + } + } + if (node.arguments.length === 0 || node.arguments.length > 2) { + this.raise(Errors.ImportCallArity, node, { + maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 + }); + } else { + for (const arg of node.arguments) { + if (arg.type === "SpreadElement") { + this.raise(Errors.ImportCallSpreadArgument, arg); + } + } + } + } + return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); + } + parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { + const elts = []; + let first = true; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { + this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc); + } + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); + } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return elts; + } + shouldParseAsyncArrow() { + return this.match(19) && !this.canInsertSemicolon(); + } + parseAsyncArrowFromCallExpression(node, call) { + var _call$extra; + this.resetPreviousNodeTrailingComments(call); + this.expect(19); + this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); + if (call.innerComments) { + setInnerComments(node, call.innerComments); + } + if (call.callee.trailingComments) { + setInnerComments(node, call.callee.trailingComments); + } + return node; + } + parseNoCallExpr() { + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startLoc, true); + } + parseExprAtom(refExpressionErrors) { + let node; + let decorators = null; + const { + type + } = this.state; + switch (type) { + case 79: + return this.parseSuper(); + case 83: + node = this.startNode(); + this.next(); + if (this.match(16)) { + return this.parseImportMetaProperty(node); + } + if (this.match(10)) { + if (this.options.createImportExpressions) { + return this.parseImportCall(node); + } else { + return this.finishNode(node, "Import"); + } + } else { + this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); + return this.finishNode(node, "Import"); + } + case 78: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case 90: + { + return this.parseDo(this.startNode(), false); + } + case 56: + case 31: + { + this.readRegexp(); + return this.parseRegExpLiteral(this.state.value); + } + case 134: + return this.parseNumericLiteral(this.state.value); + case 135: + return this.parseBigIntLiteral(this.state.value); + case 136: + return this.parseDecimalLiteral(this.state.value); + case 133: + return this.parseStringLiteral(this.state.value); + case 84: + return this.parseNullLiteral(); + case 85: + return this.parseBooleanLiteral(true); + case 86: + return this.parseBooleanLiteral(false); + case 10: + { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + return this.parseParenAndDistinguishExpression(canBeArrow); + } + case 2: + case 1: + { + return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); + } + case 0: + { + return this.parseArrayLike(3, true, false, refExpressionErrors); + } + case 6: + case 7: + { + return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); + } + case 5: + { + return this.parseObjectLike(8, false, false, refExpressionErrors); + } + case 68: + return this.parseFunctionOrFunctionSent(); + case 26: + decorators = this.parseDecorators(); + case 80: + return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); + case 77: + return this.parseNewOrNewTarget(); + case 25: + case 24: + return this.parseTemplate(false); + case 15: + { + node = this.startNode(); + this.next(); + node.object = null; + const callee = node.callee = this.parseNoCallExpr(); + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + throw this.raise(Errors.UnsupportedBind, callee); + } + } + case 138: + { + this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { + identifierName: this.state.value + }); + return this.parsePrivateName(); + } + case 33: + { + return this.parseTopicReferenceThenEqualsSign(54, "%"); + } + case 32: + { + return this.parseTopicReferenceThenEqualsSign(44, "^"); + } + case 37: + case 38: + { + return this.parseTopicReference("hack"); + } + case 44: + case 54: + case 27: + { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + return this.parseTopicReference(pipeProposal); + } + this.unexpected(); + break; + } + case 47: + { + const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); + if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { + this.expectOnePlugin(["jsx", "flow", "typescript"]); + } else { + this.unexpected(); + } + break; + } + default: + if (tokenIsIdentifier(type)) { + if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { + return this.parseModuleExpression(); + } + const canBeArrow = this.state.potentialArrowAt === this.state.start; + const containsEsc = this.state.containsEsc; + const id = this.parseIdentifier(); + if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { + const { + type + } = this.state; + if (type === 68) { + this.resetPreviousNodeTrailingComments(id); + this.next(); + return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); + } else if (tokenIsIdentifier(type)) { + if (this.lookaheadCharCode() === 61) { + return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); + } else { + return id; + } + } else if (type === 90) { + this.resetPreviousNodeTrailingComments(id); + return this.parseDo(this.startNodeAtNode(id), true); + } + } + if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { + this.next(); + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); + } + return id; + } else { + this.unexpected(); + } + } + } + parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + this.state.type = topicTokenType; + this.state.value = topicTokenValue; + this.state.pos--; + this.state.end--; + this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); + return this.parseTopicReference(pipeProposal); + } else { + this.unexpected(); + } + } + parseTopicReference(pipeProposal) { + const node = this.startNode(); + const startLoc = this.state.startLoc; + const tokenType = this.state.type; + this.next(); + return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); + } + finishTopicReference(node, startLoc, pipeProposal, tokenType) { + if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { + const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc); + } + this.registerTopicReference(); + return this.finishNode(node, nodeType); + } else { + throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { + token: tokenLabelName(tokenType) + }); + } + } + testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { + switch (pipeProposal) { + case "hack": + { + return this.hasPlugin(["pipelineOperator", { + topicToken: tokenLabelName(tokenType) + }]); + } + case "smart": + return tokenType === 27; + default: + throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); + } + } + parseAsyncArrowUnaryFunction(node) { + this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); + const params = [this.parseIdentifier()]; + this.prodParam.exit(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); + } + this.expect(19); + return this.parseArrowExpression(node, params, true); + } + parseDo(node, isAsync) { + this.expectPlugin("doExpressions"); + if (isAsync) { + this.expectPlugin("asyncDoExpressions"); + } + node.async = isAsync; + this.next(); + const oldLabels = this.state.labels; + this.state.labels = []; + if (isAsync) { + this.prodParam.enter(2); + node.body = this.parseBlock(); + this.prodParam.exit(); + } else { + node.body = this.parseBlock(); + } + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } + parseSuper() { + const node = this.startNode(); + this.next(); + if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.SuperNotAllowed, node); + } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.UnexpectedSuper, node); + } + if (!this.match(10) && !this.match(0) && !this.match(16)) { + this.raise(Errors.UnsupportedSuper, node); + } + return this.finishNode(node, "Super"); + } + parsePrivateName() { + const node = this.startNode(); + const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); + const name = this.state.value; + this.next(); + node.id = this.createIdentifier(id, name); + return this.finishNode(node, "PrivateName"); + } + parseFunctionOrFunctionSent() { + const node = this.startNode(); + this.next(); + if (this.prodParam.hasYield && this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); + this.next(); + if (this.match(103)) { + this.expectPlugin("functionSent"); + } else if (!this.hasPlugin("functionSent")) { + this.unexpected(); + } + return this.parseMetaProperty(node, meta, "sent"); + } + return this.parseFunction(node); + } + parseMetaProperty(node, meta, propertyName) { + node.meta = meta; + const containsEsc = this.state.containsEsc; + node.property = this.parseIdentifier(true); + if (node.property.name !== propertyName || containsEsc) { + this.raise(Errors.UnsupportedMetaProperty, node.property, { + target: meta.name, + onlyValidPropertyName: propertyName + }); + } + return this.finishNode(node, "MetaProperty"); + } + parseImportMetaProperty(node) { + const id = this.createIdentifier(this.startNodeAtNode(node), "import"); + this.next(); + if (this.isContextual(101)) { + if (!this.inModule) { + this.raise(Errors.ImportMetaOutsideModule, id); + } + this.sawUnambiguousESM = true; + } else if (this.isContextual(105) || this.isContextual(97)) { + const isSource = this.isContextual(105); + if (!isSource) this.unexpected(); + this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); + if (!this.options.createImportExpressions) { + throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, { + phase: this.state.value + }); + } + this.next(); + node.phase = isSource ? "source" : "defer"; + return this.parseImportCall(node); + } + return this.parseMetaProperty(node, id, "meta"); + } + parseLiteralAtNode(value, type, node) { + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); + node.value = value; + this.next(); + return this.finishNode(node, type); + } + parseLiteral(value, type) { + const node = this.startNode(); + return this.parseLiteralAtNode(value, type, node); + } + parseStringLiteral(value) { + return this.parseLiteral(value, "StringLiteral"); + } + parseNumericLiteral(value) { + return this.parseLiteral(value, "NumericLiteral"); + } + parseBigIntLiteral(value) { + return this.parseLiteral(value, "BigIntLiteral"); + } + parseDecimalLiteral(value) { + return this.parseLiteral(value, "DecimalLiteral"); + } + parseRegExpLiteral(value) { + const node = this.startNode(); + this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); + node.pattern = value.pattern; + node.flags = value.flags; + this.next(); + return this.finishNode(node, "RegExpLiteral"); + } + parseBooleanLiteral(value) { + const node = this.startNode(); + node.value = value; + this.next(); + return this.finishNode(node, "BooleanLiteral"); + } + parseNullLiteral() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "NullLiteral"); + } + parseParenAndDistinguishExpression(canBeArrow) { + const startLoc = this.state.startLoc; + let val; + this.next(); + this.expressionScope.enter(newArrowHeadScope()); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.maybeInArrowParameters = true; + this.state.inFSharpPipelineDirectBody = false; + const innerStartLoc = this.state.startLoc; + const exprList = []; + const refExpressionErrors = new ExpressionErrors(); + let first = true; + let spreadStartLoc; + let optionalCommaStartLoc; + while (!this.match(11)) { + if (first) { + first = false; + } else { + this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); + if (this.match(11)) { + optionalCommaStartLoc = this.state.startLoc; + break; + } + } + if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + spreadStartLoc = this.state.startLoc; + exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); + if (!this.checkCommaAfterRest(41)) { + break; + } + } else { + exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); + } + } + const innerEndLoc = this.state.lastTokEndLoc; + this.expect(11); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let arrowNode = this.startNodeAt(startLoc); + if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + this.parseArrowExpression(arrowNode, exprList, false); + return arrowNode; + } + this.expressionScope.exit(); + if (!exprList.length) { + this.unexpected(this.state.lastTokStartLoc); + } + if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); + if (spreadStartLoc) this.unexpected(spreadStartLoc); + this.checkExpressionErrors(refExpressionErrors, true); + this.toReferencedListDeep(exprList, true); + if (exprList.length > 1) { + val = this.startNodeAt(innerStartLoc); + val.expressions = exprList; + this.finishNode(val, "SequenceExpression"); + this.resetEndLocation(val, innerEndLoc); + } else { + val = exprList[0]; + } + return this.wrapParenthesis(startLoc, val); + } + wrapParenthesis(startLoc, expression) { + if (!this.options.createParenthesizedExpressions) { + this.addExtra(expression, "parenthesized", true); + this.addExtra(expression, "parenStart", startLoc.index); + this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); + return expression; + } + const parenExpression = this.startNodeAt(startLoc); + parenExpression.expression = expression; + return this.finishNode(parenExpression, "ParenthesizedExpression"); + } + shouldParseArrow(params) { + return !this.canInsertSemicolon(); + } + parseArrow(node) { + if (this.eat(19)) { + return node; + } + } + parseParenItem(node, startLoc) { + return node; + } + parseNewOrNewTarget() { + const node = this.startNode(); + this.next(); + if (this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); + this.next(); + const metaProp = this.parseMetaProperty(node, meta, "target"); + if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { + this.raise(Errors.UnexpectedNewTarget, metaProp); + } + return metaProp; + } + return this.parseNew(node); + } + parseNew(node) { + this.parseNewCallee(node); + if (this.eat(10)) { + const args = this.parseExprList(11); + this.toReferencedList(args); + node.arguments = args; + } else { + node.arguments = []; + } + return this.finishNode(node, "NewExpression"); + } + parseNewCallee(node) { + const isImport = this.match(83); + const callee = this.parseNoCallExpr(); + node.callee = callee; + if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { + this.raise(Errors.ImportCallNotNewExpression, callee); + } + } + parseTemplateElement(isTagged) { + const { + start, + startLoc, + end, + value + } = this.state; + const elemStart = start + 1; + const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); + if (value === null) { + if (!isTagged) { + this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); + } + } + const isTail = this.match(24); + const endOffset = isTail ? -1 : -2; + const elemEnd = end + endOffset; + elem.value = { + raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), + cooked: value === null ? null : value.slice(1, endOffset) + }; + elem.tail = isTail; + this.next(); + const finishedNode = this.finishNode(elem, "TemplateElement"); + this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); + return finishedNode; + } + parseTemplate(isTagged) { + const node = this.startNode(); + let curElt = this.parseTemplateElement(isTagged); + const quasis = [curElt]; + const substitutions = []; + while (!curElt.tail) { + substitutions.push(this.parseTemplateSubstitution()); + this.readTemplateContinuation(); + quasis.push(curElt = this.parseTemplateElement(isTagged)); + } + node.expressions = substitutions; + node.quasis = quasis; + return this.finishNode(node, "TemplateLiteral"); + } + parseTemplateSubstitution() { + return this.parseExpression(); + } + parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { + if (isRecord) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const propHash = Object.create(null); + let first = true; + const node = this.startNode(); + node.properties = []; + this.next(); + while (!this.match(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + this.addTrailingCommaExtraToNode(node); + break; + } + } + let prop; + if (isPattern) { + prop = this.parseBindingProperty(); + } else { + prop = this.parsePropertyDefinition(refExpressionErrors); + this.checkProto(prop, isRecord, propHash, refExpressionErrors); + } + if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { + this.raise(Errors.InvalidRecordProperty, prop); + } + { + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } + } + node.properties.push(prop); + } + this.next(); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let type = "ObjectExpression"; + if (isPattern) { + type = "ObjectPattern"; + } else if (isRecord) { + type = "RecordExpression"; + } + return this.finishNode(node, type); + } + addTrailingCommaExtraToNode(node) { + this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); + this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); + } + maybeAsyncOrAccessorProp(prop) { + return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); + } + parsePropertyDefinition(refExpressionErrors) { + let decorators = []; + if (this.match(26)) { + if (this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + } + const prop = this.startNode(); + let isAsync = false; + let isAccessor = false; + let startLoc; + if (this.match(21)) { + if (decorators.length) this.unexpected(); + return this.parseSpread(); + } + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } + prop.method = false; + if (refExpressionErrors) { + startLoc = this.state.startLoc; + } + let isGenerator = this.eat(55); + this.parsePropertyNamePrefixOperator(prop); + const containsEsc = this.state.containsEsc; + this.parsePropertyName(prop, refExpressionErrors); + if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { + const { + key + } = prop; + const keyName = key.name; + if (keyName === "async" && !this.hasPrecedingLineBreak()) { + isAsync = true; + this.resetPreviousNodeTrailingComments(key); + isGenerator = this.eat(55); + this.parsePropertyName(prop); + } + if (keyName === "get" || keyName === "set") { + isAccessor = true; + this.resetPreviousNodeTrailingComments(key); + prop.kind = keyName; + if (this.match(55)) { + isGenerator = true; + this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { + kind: keyName + }); + this.next(); + } + this.parsePropertyName(prop); + } + } + return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); + } + getGetterSetterExpectedParamCount(method) { + return method.kind === "get" ? 0 : 1; + } + getObjectOrClassMethodParams(method) { + return method.params; + } + checkGetterSetterParams(method) { + var _params; + const paramCount = this.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length !== paramCount) { + this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); + } + if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { + this.raise(Errors.BadSetterRestParameter, method); + } + } + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + if (isAccessor) { + const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); + this.checkGetterSetterParams(finishedProp); + return finishedProp; + } + if (isAsync || isGenerator || this.match(10)) { + if (isPattern) this.unexpected(); + prop.kind = "method"; + prop.method = true; + return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); + } + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + prop.shorthand = false; + if (this.eat(14)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); + return this.finishNode(prop, "ObjectProperty"); + } + if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); + if (isPattern) { + prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + } else if (this.match(29)) { + const shorthandAssignLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.shorthandAssignLoc === null) { + refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; + } + } else { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); + } else { + prop.value = cloneIdentifier(prop.key); + } + prop.shorthand = true; + return this.finishNode(prop, "ObjectProperty"); + } + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (!node) this.unexpected(); + return node; + } + parsePropertyName(prop, refExpressionErrors) { + if (this.eat(0)) { + prop.computed = true; + prop.key = this.parseMaybeAssignAllowIn(); + this.expect(3); + } else { + const { + type, + value + } = this.state; + let key; + if (tokenIsKeywordOrIdentifier(type)) { + key = this.parseIdentifier(true); + } else { + switch (type) { + case 134: + key = this.parseNumericLiteral(value); + break; + case 133: + key = this.parseStringLiteral(value); + break; + case 135: + key = this.parseBigIntLiteral(value); + break; + case 136: + key = this.parseDecimalLiteral(value); + break; + case 138: + { + const privateKeyLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.privateKeyLoc === null) { + refExpressionErrors.privateKeyLoc = privateKeyLoc; + } + } else { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + key = this.parsePrivateName(); + break; + } + default: + this.unexpected(); + } + } + prop.key = key; + if (type !== 138) { + prop.computed = false; + } + } + } + initFunction(node, isAsync) { + node.id = null; + node.generator = false; + node.async = isAsync; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + this.initFunction(node, isAsync); + node.generator = isGenerator; + this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + this.parseFunctionParams(node, isConstructor); + const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); + this.prodParam.exit(); + this.scope.exit(); + return finishedNode; + } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + if (isTuple) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const node = this.startNode(); + this.next(); + node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); + } + parseArrowExpression(node, params, isAsync, trailingCommaLoc) { + this.scope.enter(2 | 4); + let flags = functionFlags(isAsync, false); + if (!this.match(5) && this.prodParam.hasIn) { + flags |= 8; + } + this.prodParam.enter(flags); + this.initFunction(node, isAsync); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + if (params) { + this.state.maybeInArrowParameters = true; + this.setArrowFunctionParameters(node, params, trailingCommaLoc); + } + this.state.maybeInArrowParameters = false; + this.parseFunctionBody(node, true); + this.prodParam.exit(); + this.scope.exit(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, "ArrowFunctionExpression"); + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + this.toAssignableList(params, trailingCommaLoc, false); + node.params = params; + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + this.parseFunctionBody(node, false, isMethod); + return this.finishNode(node, type); + } + parseFunctionBody(node, allowExpression, isMethod = false) { + const isExpression = allowExpression && !this.match(5); + this.expressionScope.enter(newExpressionScope()); + if (isExpression) { + node.body = this.parseMaybeAssign(); + this.checkParams(node, false, allowExpression, false); + } else { + const oldStrict = this.state.strict; + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(this.prodParam.currentFlags() | 4); + node.body = this.parseBlock(true, false, hasStrictModeDirective => { + const nonSimple = !this.isSimpleParamList(node.params); + if (hasStrictModeDirective && nonSimple) { + this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); + } + const strictModeChanged = !oldStrict && this.state.strict; + this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); + if (this.state.strict && node.id) { + this.checkIdentifier(node.id, 65, strictModeChanged); + } + }); + this.prodParam.exit(); + this.state.labels = oldLabels; + } + this.expressionScope.exit(); + } + isSimpleParameter(node) { + return node.type === "Identifier"; + } + isSimpleParamList(params) { + for (let i = 0, len = params.length; i < len; i++) { + if (!this.isSimpleParameter(params[i])) return false; + } + return true; + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + const checkClashes = !allowDuplicates && new Set(); + const formalParameters = { + type: "FormalParameters" + }; + for (const param of node.params) { + this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged); + } + } + parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); + } + return elts; + } + parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { + let elt; + if (this.match(12)) { + if (!allowEmpty) { + this.raise(Errors.UnexpectedToken, this.state.curPosition(), { + unexpected: "," + }); + } + elt = null; + } else if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); + } else if (this.match(17)) { + this.expectPlugin("partialApplication"); + if (!allowPlaceholder) { + this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); + } + const node = this.startNode(); + this.next(); + elt = this.finishNode(node, "ArgumentPlaceholder"); + } else { + elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); + } + return elt; + } + parseIdentifier(liberal) { + const node = this.startNode(); + const name = this.parseIdentifierName(liberal); + return this.createIdentifier(node, name); + } + createIdentifier(node, name) { + node.name = name; + node.loc.identifierName = name; + return this.finishNode(node, "Identifier"); + } + parseIdentifierName(liberal) { + let name; + const { + startLoc, + type + } = this.state; + if (tokenIsKeywordOrIdentifier(type)) { + name = this.state.value; + } else { + this.unexpected(); + } + const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); + if (liberal) { + if (tokenIsKeyword) { + this.replaceToken(132); + } + } else { + this.checkReservedWord(name, startLoc, tokenIsKeyword, false); + } + this.next(); + return name; + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word.length > 10) { + return; + } + if (!canBeReservedWord(word)) { + return; + } + if (checkKeywords && isKeyword(word)) { + this.raise(Errors.UnexpectedKeyword, startLoc, { + keyword: word + }); + return; + } + const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; + if (reservedTest(word, this.inModule)) { + this.raise(Errors.UnexpectedReservedWord, startLoc, { + reservedWord: word + }); + return; + } else if (word === "yield") { + if (this.prodParam.hasYield) { + this.raise(Errors.YieldBindingIdentifier, startLoc); + return; + } + } else if (word === "await") { + if (this.prodParam.hasAwait) { + this.raise(Errors.AwaitBindingIdentifier, startLoc); + return; + } + if (this.scope.inStaticBlock) { + this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); + return; + } + this.expressionScope.recordAsyncArrowParametersError(startLoc); + } else if (word === "arguments") { + if (this.scope.inClassAndNotInNonArrowFunction) { + this.raise(Errors.ArgumentsInClass, startLoc); + return; + } + } + } + recordAwaitIfAllowed() { + const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction; + if (isAwaitAllowed && !this.scope.inFunction) { + this.state.hasTopLevelAwait = true; + } + return isAwaitAllowed; + } + parseAwait(startLoc) { + const node = this.startNodeAt(startLoc); + this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); + if (this.eat(55)) { + this.raise(Errors.ObsoleteAwaitStar, node); + } + if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { + if (this.isAmbiguousAwait()) { + this.ambiguousScriptDifferentAst = true; + } else { + this.sawUnambiguousESM = true; + } + } + if (!this.state.soloAwait) { + node.argument = this.parseMaybeUnary(null, true); + } + return this.finishNode(node, "AwaitExpression"); + } + isAmbiguousAwait() { + if (this.hasPrecedingLineBreak()) return true; + const { + type + } = this.state; + return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 137 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; + } + parseYield() { + const node = this.startNode(); + this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); + this.next(); + let delegating = false; + let argument = null; + if (!this.hasPrecedingLineBreak()) { + delegating = this.eat(55); + switch (this.state.type) { + case 13: + case 139: + case 8: + case 11: + case 3: + case 9: + case 14: + case 12: + if (!delegating) break; + default: + argument = this.parseMaybeAssign(); + } + } + node.delegate = delegating; + node.argument = argument; + return this.finishNode(node, "YieldExpression"); + } + parseImportCall(node) { + this.next(); + node.source = this.parseMaybeAssignAllowIn(); + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + node.options = null; + } + if (this.eat(12)) { + this.expectImportAttributesPlugin(); + if (!this.match(11)) { + node.options = this.parseMaybeAssignAllowIn(); + this.eat(12); + } + } + this.expect(11); + return this.finishNode(node, "ImportExpression"); + } + checkPipelineAtInfixOperator(left, leftStartLoc) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + if (left.type === "SequenceExpression") { + this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); + } + } + } + parseSmartPipelineBodyInStyle(childExpr, startLoc) { + if (this.isSimpleReference(childExpr)) { + const bodyNode = this.startNodeAt(startLoc); + bodyNode.callee = childExpr; + return this.finishNode(bodyNode, "PipelineBareFunction"); + } else { + const bodyNode = this.startNodeAt(startLoc); + this.checkSmartPipeTopicBodyEarlyErrors(startLoc); + bodyNode.expression = childExpr; + return this.finishNode(bodyNode, "PipelineTopicExpression"); + } + } + isSimpleReference(expression) { + switch (expression.type) { + case "MemberExpression": + return !expression.computed && this.isSimpleReference(expression.object); + case "Identifier": + return true; + default: + return false; + } + } + checkSmartPipeTopicBodyEarlyErrors(startLoc) { + if (this.match(19)) { + throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipelineTopicUnused, startLoc); + } + } + withTopicBindingContext(callback) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 1, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } + withSmartMixTopicForbiddingContext(callback) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } else { + return callback(); + } + } + withSoloAwaitPermittingContext(callback) { + const outerContextSoloAwaitState = this.state.soloAwait; + this.state.soloAwait = true; + try { + return callback(); + } finally { + this.state.soloAwait = outerContextSoloAwaitState; + } + } + allowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToSet = 8 & ~flags; + if (prodParamToSet) { + this.prodParam.enter(flags | 8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + disallowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToClear = 8 & flags; + if (prodParamToClear) { + this.prodParam.enter(flags & ~8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + registerTopicReference() { + this.state.topicContext.maxTopicIndex = 0; + } + topicReferenceIsAllowedInCurrentContext() { + return this.state.topicContext.maxNumOfResolvableTopics >= 1; + } + topicReferenceWasUsedInCurrentContext() { + return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; + } + parseFSharpPipelineBody(prec) { + const startLoc = this.state.startLoc; + this.state.potentialArrowAt = this.state.start; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = true; + const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } + parseModuleExpression() { + this.expectPlugin("moduleBlocks"); + const node = this.startNode(); + this.next(); + if (!this.match(5)) { + this.unexpected(null, 5); + } + const program = this.startNodeAt(this.state.endLoc); + this.next(); + const revertScopes = this.initializeScopes(true); + this.enterInitialScopes(); + try { + node.body = this.parseProgram(program, 8, "module"); + } finally { + revertScopes(); + } + return this.finishNode(node, "ModuleExpression"); + } + parsePropertyNamePrefixOperator(prop) {} + } + const loopLabel = { + kind: 1 + }, + switchLabel = { + kind: 2 + }; + const loneSurrogate = /[\uD800-\uDFFF]/u; + const keywordRelationalOperator = /in(?:stanceof)?/y; + function babel7CompatTokens(tokens, input) { + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const { + type + } = token; + if (typeof type === "number") { + { + if (type === 138) { + const { + loc, + start, + value, + end + } = token; + const hashEndPos = start + 1; + const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); + tokens.splice(i, 1, new Token({ + type: getExportedToken(27), + value: "#", + start: start, + end: hashEndPos, + startLoc: loc.start, + endLoc: hashEndLoc + }), new Token({ + type: getExportedToken(132), + value: value, + start: hashEndPos, + end: end, + startLoc: hashEndLoc, + endLoc: loc.end + })); + i++; + continue; + } + if (tokenIsTemplate(type)) { + const { + loc, + start, + value, + end + } = token; + const backquoteEnd = start + 1; + const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); + let startToken; + if (input.charCodeAt(start) === 96) { + startToken = new Token({ + type: getExportedToken(22), + value: "`", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } else { + startToken = new Token({ + type: getExportedToken(8), + value: "}", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } + let templateValue, templateElementEnd, templateElementEndLoc, endToken; + if (type === 24) { + templateElementEnd = end - 1; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); + templateValue = value === null ? null : value.slice(1, -1); + endToken = new Token({ + type: getExportedToken(22), + value: "`", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } else { + templateElementEnd = end - 2; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); + templateValue = value === null ? null : value.slice(1, -2); + endToken = new Token({ + type: getExportedToken(23), + value: "${", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } + tokens.splice(i, 1, startToken, new Token({ + type: getExportedToken(20), + value: templateValue, + start: backquoteEnd, + end: templateElementEnd, + startLoc: backquoteEndLoc, + endLoc: templateElementEndLoc + }), endToken); + i += 2; + continue; + } + } + token.type = getExportedToken(type); + } + } + return tokens; + } + class StatementParser extends ExpressionParser { + parseTopLevel(file, program) { + file.program = this.parseProgram(program); + file.comments = this.comments; + if (this.options.tokens) { + file.tokens = babel7CompatTokens(this.tokens, this.input); + } + return this.finishNode(file, "File"); + } + parseProgram(program, end = 139, sourceType = this.options.sourceType) { + program.sourceType = sourceType; + program.interpreter = this.parseInterpreterDirective(); + this.parseBlockBody(program, true, true, end); + if (this.inModule) { + if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { + for (const [localName, at] of Array.from(this.scope.undefinedExports)) { + this.raise(Errors.ModuleExportUndefined, at, { + localName + }); + } + } + this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait); + } + let finishedProgram; + if (end === 139) { + finishedProgram = this.finishNode(program, "Program"); + } else { + finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); + } + return finishedProgram; + } + stmtToDirective(stmt) { + const directive = stmt; + directive.type = "Directive"; + directive.value = directive.expression; + delete directive.expression; + const directiveLiteral = directive.value; + const expressionValue = directiveLiteral.value; + const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); + const val = directiveLiteral.value = raw.slice(1, -1); + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); + this.addExtra(directiveLiteral, "expressionValue", expressionValue); + directiveLiteral.type = "DirectiveLiteral"; + return directive; + } + parseInterpreterDirective() { + if (!this.match(28)) { + return null; + } + const node = this.startNode(); + node.value = this.state.value; + this.next(); + return this.finishNode(node, "InterpreterDirective"); + } + isLet() { + if (!this.isContextual(100)) { + return false; + } + return this.hasFollowingBindingAtom(); + } + chStartsBindingIdentifier(ch, pos) { + if (isIdentifierStart(ch)) { + keywordRelationalOperator.lastIndex = pos; + if (keywordRelationalOperator.test(this.input)) { + const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); + if (!isIdentifierChar(endCh) && endCh !== 92) { + return false; + } + } + return true; + } else if (ch === 92) { + return true; + } else { + return false; + } + } + chStartsBindingPattern(ch) { + return ch === 91 || ch === 123; + } + hasFollowingBindingAtom() { + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); + } + hasInLineFollowingBindingIdentifierOrBrace() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); + } + startsUsingForOf() { + const { + type, + containsEsc + } = this.lookahead(); + if (type === 102 && !containsEsc) { + return false; + } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { + this.expectPlugin("explicitResourceManagement"); + return true; + } + } + startsAwaitUsing() { + let next = this.nextTokenInLineStart(); + if (this.isUnparsedContextual(next, "using")) { + next = this.nextTokenInLineStartSince(next + 5); + const nextCh = this.codePointAtPos(next); + if (this.chStartsBindingIdentifier(nextCh, next)) { + this.expectPlugin("explicitResourceManagement"); + return true; + } + } + return false; + } + parseModuleItem() { + return this.parseStatementLike(1 | 2 | 4 | 8); + } + parseStatementListItem() { + return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); + } + parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { + let flags = 0; + if (this.options.annexB && !this.state.strict) { + flags |= 4; + if (allowLabeledFunction) { + flags |= 8; + } + } + return this.parseStatementLike(flags); + } + parseStatement() { + return this.parseStatementLike(0); + } + parseStatementLike(flags) { + let decorators = null; + if (this.match(26)) { + decorators = this.parseDecorators(true); + } + return this.parseStatementContent(flags, decorators); + } + parseStatementContent(flags, decorators) { + const startType = this.state.type; + const node = this.startNode(); + const allowDeclaration = !!(flags & 2); + const allowFunctionDeclaration = !!(flags & 4); + const topLevel = flags & 1; + switch (startType) { + case 60: + return this.parseBreakContinueStatement(node, true); + case 63: + return this.parseBreakContinueStatement(node, false); + case 64: + return this.parseDebuggerStatement(node); + case 90: + return this.parseDoWhileStatement(node); + case 91: + return this.parseForStatement(node); + case 68: + if (this.lookaheadCharCode() === 46) break; + if (!allowFunctionDeclaration) { + this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); + } + return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); + case 80: + if (!allowDeclaration) this.unexpected(); + return this.parseClass(this.maybeTakeDecorators(decorators, node), true); + case 69: + return this.parseIfStatement(node); + case 70: + return this.parseReturnStatement(node); + case 71: + return this.parseSwitchStatement(node); + case 72: + return this.parseThrowStatement(node); + case 73: + return this.parseTryStatement(node); + case 96: + if (!this.state.containsEsc && this.startsAwaitUsing()) { + if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, node); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, node); + } + this.next(); + return this.parseVarStatement(node, "await using"); + } + break; + case 107: + if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { + break; + } + this.expectPlugin("explicitResourceManagement"); + if (!this.scope.inModule && this.scope.inTopLevel) { + this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + return this.parseVarStatement(node, "using"); + case 100: + { + if (this.state.containsEsc) { + break; + } + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + if (nextCh !== 91) { + if (!allowDeclaration && this.hasFollowingLineBreak()) break; + if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { + break; + } + } + } + case 75: + { + if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + } + case 74: + { + const kind = this.state.value; + return this.parseVarStatement(node, kind); + } + case 92: + return this.parseWhileStatement(node); + case 76: + return this.parseWithStatement(node); + case 5: + return this.parseBlock(); + case 13: + return this.parseEmptyStatement(node); + case 83: + { + const nextTokenCharCode = this.lookaheadCharCode(); + if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { + break; + } + } + case 82: + { + if (!this.options.allowImportExportEverywhere && !topLevel) { + this.raise(Errors.UnexpectedImportExport, this.state.startLoc); + } + this.next(); + let result; + if (startType === 83) { + result = this.parseImport(node); + if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { + this.sawUnambiguousESM = true; + } + } else { + result = this.parseExport(node, decorators); + if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { + this.sawUnambiguousESM = true; + } + } + this.assertModuleNodeAllowed(result); + return result; + } + default: + { + if (this.isAsyncFunction()) { + if (!allowDeclaration) { + this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); + } + this.next(); + return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); + } + } + } + const maybeName = this.state.value; + const expr = this.parseExpression(); + if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) { + return this.parseLabeledStatement(node, maybeName, expr, flags); + } else { + return this.parseExpressionStatement(node, expr, decorators); + } + } + assertModuleNodeAllowed(node) { + if (!this.options.allowImportExportEverywhere && !this.inModule) { + this.raise(Errors.ImportOutsideModule, node); + } + } + decoratorsEnabledBeforeExport() { + if (this.hasPlugin("decorators-legacy")) return true; + return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; + } + maybeTakeDecorators(maybeDecorators, classNode, exportNode) { + if (maybeDecorators) { + if (classNode.decorators && classNode.decorators.length > 0) { + if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { + this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); + } + classNode.decorators.unshift(...maybeDecorators); + } else { + classNode.decorators = maybeDecorators; + } + this.resetStartLocationFromNode(classNode, maybeDecorators[0]); + if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); + } + return classNode; + } + canHaveLeadingDecorator() { + return this.match(80); + } + parseDecorators(allowExport) { + const decorators = []; + do { + decorators.push(this.parseDecorator()); + } while (this.match(26)); + if (this.match(82)) { + if (!allowExport) { + this.unexpected(); + } + if (!this.decoratorsEnabledBeforeExport()) { + this.raise(Errors.DecoratorExportClass, this.state.startLoc); + } + } else if (!this.canHaveLeadingDecorator()) { + throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); + } + return decorators; + } + parseDecorator() { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + const node = this.startNode(); + this.next(); + if (this.hasPlugin("decorators")) { + const startLoc = this.state.startLoc; + let expr; + if (this.match(10)) { + const startLoc = this.state.startLoc; + this.next(); + expr = this.parseExpression(); + this.expect(11); + expr = this.wrapParenthesis(startLoc, expr); + const paramsStartLoc = this.state.startLoc; + node.expression = this.parseMaybeDecoratorArguments(expr); + if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { + this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); + } + } else { + expr = this.parseIdentifier(false); + while (this.eat(16)) { + const node = this.startNodeAt(startLoc); + node.object = expr; + if (this.match(138)) { + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + node.computed = false; + expr = this.finishNode(node, "MemberExpression"); + } + node.expression = this.parseMaybeDecoratorArguments(expr); + } + } else { + node.expression = this.parseExprSubscripts(); + } + return this.finishNode(node, "Decorator"); + } + parseMaybeDecoratorArguments(expr) { + if (this.eat(10)) { + const node = this.startNodeAtNode(expr); + node.callee = expr; + node.arguments = this.parseCallExpressionArguments(11, false); + this.toReferencedList(node.arguments); + return this.finishNode(node, "CallExpression"); + } + return expr; + } + parseBreakContinueStatement(node, isBreak) { + this.next(); + if (this.isLineTerminator()) { + node.label = null; + } else { + node.label = this.parseIdentifier(); + this.semicolon(); + } + this.verifyBreakContinue(node, isBreak); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + } + verifyBreakContinue(node, isBreak) { + let i; + for (i = 0; i < this.state.labels.length; ++i) { + const lab = this.state.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === 1)) { + break; + } + if (node.label && isBreak) break; + } + } + if (i === this.state.labels.length) { + const type = isBreak ? "BreakStatement" : "ContinueStatement"; + this.raise(Errors.IllegalBreakContinue, node, { + type + }); + } + } + parseDebuggerStatement(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + } + parseHeaderExpression() { + this.expect(10); + const val = this.parseExpression(); + this.expect(11); + return val; + } + parseDoWhileStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + this.expect(92); + node.test = this.parseHeaderExpression(); + this.eat(13); + return this.finishNode(node, "DoWhileStatement"); + } + parseForStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + let awaitAt = null; + if (this.isContextual(96) && this.recordAwaitIfAllowed()) { + awaitAt = this.state.startLoc; + this.next(); + } + this.scope.enter(0); + this.expect(10); + if (this.match(13)) { + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + const startsWithLet = this.isContextual(100); + { + const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); + const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf(); + const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; + if (this.match(74) || this.match(75) || isLetOrUsing) { + const initNode = this.startNode(); + let kind; + if (startsWithAwaitUsing) { + kind = "await using"; + if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); + } + this.next(); + } else { + kind = this.state.value; + } + this.next(); + this.parseVar(initNode, true, kind); + const init = this.finishNode(initNode, "VariableDeclaration"); + const isForIn = this.match(58); + if (isForIn && starsWithUsingDeclaration) { + this.raise(Errors.ForInUsing, init); + } + if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { + return this.parseForIn(node, init, awaitAt); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + } + const startsWithAsync = this.isContextual(95); + const refExpressionErrors = new ExpressionErrors(); + const init = this.parseExpression(true, refExpressionErrors); + const isForOf = this.isContextual(102); + if (isForOf) { + if (startsWithLet) { + this.raise(Errors.ForOfLet, init); + } + if (awaitAt === null && startsWithAsync && init.type === "Identifier") { + this.raise(Errors.ForOfAsync, init); + } + } + if (isForOf || this.match(58)) { + this.checkDestructuringPrivate(refExpressionErrors); + this.toAssignable(init, true); + const type = isForOf ? "ForOfStatement" : "ForInStatement"; + this.checkLVal(init, { + type + }); + return this.parseForIn(node, init, awaitAt); + } else { + this.checkExpressionErrors(refExpressionErrors, true); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + parseFunctionStatement(node, isAsync, isHangingDeclaration) { + this.next(); + return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); + } + parseIfStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); + node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; + return this.finishNode(node, "IfStatement"); + } + parseReturnStatement(node) { + if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { + this.raise(Errors.IllegalReturn, this.state.startLoc); + } + this.next(); + if (this.isLineTerminator()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + } + parseSwitchStatement(node) { + this.next(); + node.discriminant = this.parseHeaderExpression(); + const cases = node.cases = []; + this.expect(5); + this.state.labels.push(switchLabel); + this.scope.enter(0); + let cur; + for (let sawDefault; !this.match(8);) { + if (this.match(61) || this.match(65)) { + const isCase = this.match(61); + if (cur) this.finishNode(cur, "SwitchCase"); + cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); + } + sawDefault = true; + cur.test = null; + } + this.expect(14); + } else { + if (cur) { + cur.consequent.push(this.parseStatementListItem()); + } else { + this.unexpected(); + } + } + } + this.scope.exit(); + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + } + parseThrowStatement(node) { + this.next(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + } + parseCatchClauseParam() { + const param = this.parseBindingAtom(); + this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); + this.checkLVal(param, { + type: "CatchClause" + }, 9); + return param; + } + parseTryStatement(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.match(62)) { + const clause = this.startNode(); + this.next(); + if (this.match(10)) { + this.expect(10); + clause.param = this.parseCatchClauseParam(); + this.expect(11); + } else { + clause.param = null; + this.scope.enter(0); + } + clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); + this.scope.exit(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(67) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(Errors.NoCatchOrFinally, node); + } + return this.finishNode(node, "TryStatement"); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + this.next(); + this.parseVar(node, false, kind, allowMissingInitializer); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } + parseWhileStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); + } + parseWithStatement(node) { + if (this.state.strict) { + this.raise(Errors.StrictWith, this.state.startLoc); + } + this.next(); + node.object = this.parseHeaderExpression(); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + return this.finishNode(node, "WithStatement"); + } + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + } + parseLabeledStatement(node, maybeName, expr, flags) { + for (const label of this.state.labels) { + if (label.name === maybeName) { + this.raise(Errors.LabelRedeclaration, expr, { + labelName: maybeName + }); + } + } + const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; + for (let i = this.state.labels.length - 1; i >= 0; i--) { + const label = this.state.labels[i]; + if (label.statementStart === node.start) { + label.statementStart = this.state.start; + label.kind = kind; + } else { + break; + } + } + this.state.labels.push({ + name: maybeName, + kind: kind, + statementStart: this.state.start + }); + node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + } + parseExpressionStatement(node, expr, decorators) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + } + parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { + const node = this.startNode(); + if (allowDirectives) { + this.state.strictErrors.clear(); + } + this.expect(5); + if (createNewLexicalScope) { + this.scope.enter(0); + } + this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); + if (createNewLexicalScope) { + this.scope.exit(); + } + return this.finishNode(node, "BlockStatement"); + } + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + const body = node.body = []; + const directives = node.directives = []; + this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); + } + parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const oldStrict = this.state.strict; + let hasStrictModeDirective = false; + let parsedNonDirective = false; + while (!this.match(end)) { + const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); + if (directives && !parsedNonDirective) { + if (this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + directives.push(directive); + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; + this.setStrict(true); + } + continue; + } + parsedNonDirective = true; + this.state.strictErrors.clear(); + } + body.push(stmt); + } + afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); + if (!oldStrict) { + this.setStrict(false); + } + this.next(); + } + parseFor(node, init) { + node.init = init; + this.semicolon(false); + node.test = this.match(13) ? null : this.parseExpression(); + this.semicolon(false); + node.update = this.match(11) ? null : this.parseExpression(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); + } + parseForIn(node, init, awaitAt) { + const isForIn = this.match(58); + this.next(); + if (isForIn) { + if (awaitAt !== null) this.unexpected(awaitAt); + } else { + node.await = awaitAt !== null; + } + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise(Errors.ForInOfLoopInitializer, init, { + type: isForIn ? "ForInStatement" : "ForOfStatement" + }); + } + if (init.type === "AssignmentPattern") { + this.raise(Errors.InvalidLhs, init, { + ancestor: { + type: "ForStatement" + } + }); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + } + parseVar(node, isFor, kind, allowMissingInitializer = false) { + const declarations = node.declarations = []; + node.kind = kind; + for (;;) { + const decl = this.startNode(); + this.parseVarId(decl, kind); + decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); + if (decl.init === null && !allowMissingInitializer) { + if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind: "destructuring" + }); + } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind + }); + } + } + declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(12)) break; + } + return node; + } + parseVarId(decl, kind) { + const id = this.parseBindingAtom(); + if (kind === "using" || kind === "await using") { + if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { + this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); + } + } + this.checkLVal(id, { + type: "VariableDeclarator" + }, kind === "var" ? 5 : 8201); + decl.id = id; + } + parseAsyncFunctionExpression(node) { + return this.parseFunction(node, 8); + } + parseFunction(node, flags = 0) { + const hangingDeclaration = flags & 2; + const isDeclaration = !!(flags & 1); + const requireId = isDeclaration && !(flags & 4); + const isAsync = !!(flags & 8); + this.initFunction(node, isAsync); + if (this.match(55)) { + if (hangingDeclaration) { + this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); + } + this.next(); + node.generator = true; + } + if (isDeclaration) { + node.id = this.parseFunctionId(requireId); + } + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = false; + this.scope.enter(2); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + if (!isDeclaration) { + node.id = this.parseFunctionId(); + } + this.parseFunctionParams(node, false); + this.withSmartMixTopicForbiddingContext(() => { + this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); + }); + this.prodParam.exit(); + this.scope.exit(); + if (isDeclaration && !hangingDeclaration) { + this.registerFunctionStatementId(node); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return node; + } + parseFunctionId(requireId) { + return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; + } + parseFunctionParams(node, isConstructor) { + this.expect(10); + this.expressionScope.enter(newParameterDeclarationScope()); + node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); + this.expressionScope.exit(); + } + registerFunctionStatementId(node) { + if (!node.id) return; + this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); + } + parseClass(node, isStatement, optionalId) { + this.next(); + const oldStrict = this.state.strict; + this.state.strict = true; + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + node.body = this.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } + isClassProperty() { + return this.match(29) || this.match(13) || this.match(8); + } + isClassMethod() { + return this.match(10); + } + nameIsConstructor(key) { + return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor"; + } + isNonstaticConstructor(method) { + return !method.computed && !method.static && this.nameIsConstructor(method.key); + } + parseClassBody(hadSuperClass, oldStrict) { + this.classScope.enter(); + const state = { + hadConstructor: false, + hadSuperClass + }; + let decorators = []; + const classBody = this.startNode(); + classBody.body = []; + this.expect(5); + this.withSmartMixTopicForbiddingContext(() => { + while (!this.match(8)) { + if (this.eat(13)) { + if (decorators.length > 0) { + throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); + } + continue; + } + if (this.match(26)) { + decorators.push(this.parseDecorator()); + continue; + } + const member = this.startNode(); + if (decorators.length) { + member.decorators = decorators; + this.resetStartLocationFromNode(member, decorators[0]); + decorators = []; + } + this.parseClassMember(classBody, member, state); + if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { + this.raise(Errors.DecoratorConstructor, member); + } + } + }); + this.state.strict = oldStrict; + this.next(); + if (decorators.length) { + throw this.raise(Errors.TrailingDecorator, this.state.startLoc); + } + this.classScope.exit(); + return this.finishNode(classBody, "ClassBody"); + } + parseClassMemberFromModifier(classBody, member) { + const key = this.parseIdentifier(true); + if (this.isClassMethod()) { + const method = member; + method.kind = "method"; + method.computed = false; + method.key = key; + method.static = false; + this.pushClassMethod(classBody, method, false, false, false, false); + return true; + } else if (this.isClassProperty()) { + const prop = member; + prop.computed = false; + prop.key = key; + prop.static = false; + classBody.body.push(this.parseClassProperty(prop)); + return true; + } + this.resetPreviousNodeTrailingComments(key); + return false; + } + parseClassMember(classBody, member, state) { + const isStatic = this.isContextual(106); + if (isStatic) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } + if (this.eat(5)) { + this.parseClassStaticBlock(classBody, member); + return; + } + } + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const publicMethod = member; + const privateMethod = member; + const publicProp = member; + const privateProp = member; + const accessorProp = member; + const method = publicMethod; + const publicMember = publicMethod; + member.static = isStatic; + this.parsePropertyNamePrefixOperator(member); + if (this.eat(55)) { + method.kind = "method"; + const isPrivateName = this.match(138); + this.parseClassElementName(method); + if (isPrivateName) { + this.pushClassPrivateMethod(classBody, privateMethod, true, false); + return; + } + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsGenerator, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, true, false, false, false); + return; + } + const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type); + const key = this.parseClassElementName(member); + const maybeContextualKw = isContextual ? key.name : null; + const isPrivate = this.isPrivateName(key); + const maybeQuestionTokenStartLoc = this.state.startLoc; + this.parsePostMemberNameModifiers(publicMember); + if (this.isClassMethod()) { + method.kind = "method"; + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + return; + } + const isConstructor = this.isNonstaticConstructor(publicMethod); + let allowsDirectSuper = false; + if (isConstructor) { + publicMethod.kind = "constructor"; + if (state.hadConstructor && !this.hasPlugin("typescript")) { + this.raise(Errors.DuplicateConstructor, key); + } + if (isConstructor && this.hasPlugin("typescript") && member.override) { + this.raise(Errors.OverrideOnConstructor, key); + } + state.hadConstructor = true; + allowsDirectSuper = state.hadSuperClass; + } + this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); + } else if (this.isClassProperty()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else if (maybeContextualKw === "async" && !this.isLineTerminator()) { + this.resetPreviousNodeTrailingComments(key); + const isGenerator = this.eat(55); + if (publicMember.optional) { + this.unexpected(maybeQuestionTokenStartLoc); + } + method.kind = "method"; + const isPrivate = this.match(138); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(publicMember); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAsync, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); + } + } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) { + this.resetPreviousNodeTrailingComments(key); + method.kind = maybeContextualKw; + const isPrivate = this.match(138); + this.parseClassElementName(publicMethod); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAccessor, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, false, false, false, false); + } + this.checkGetterSetterParams(publicMethod); + } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) { + this.expectPlugin("decoratorAutoAccessors"); + this.resetPreviousNodeTrailingComments(key); + const isPrivate = this.match(138); + this.parseClassElementName(publicProp); + this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); + } else if (this.isLineTerminator()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else { + this.unexpected(); + } + } + parseClassElementName(member) { + const { + type, + value + } = this.state; + if ((type === 132 || type === 133) && member.static && value === "prototype") { + this.raise(Errors.StaticPrototype, this.state.startLoc); + } + if (type === 138) { + if (value === "constructor") { + this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); + } + const key = this.parsePrivateName(); + member.key = key; + return key; + } + this.parsePropertyName(member); + return member.key; + } + parseClassStaticBlock(classBody, member) { + var _member$decorators; + this.scope.enter(64 | 128 | 16); + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(0); + const body = member.body = []; + this.parseBlockOrModuleBlockBody(body, undefined, false, 8); + this.prodParam.exit(); + this.scope.exit(); + this.state.labels = oldLabels; + classBody.body.push(this.finishNode(member, "StaticBlock")); + if ((_member$decorators = member.decorators) != null && _member$decorators.length) { + this.raise(Errors.DecoratorStaticBlock, member); + } + } + pushClassProperty(classBody, prop) { + if (!prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + classBody.body.push(this.parseClassProperty(prop)); + } + pushClassPrivateProperty(classBody, prop) { + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + pushClassAccessorProperty(classBody, prop, isPrivate) { + if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + const node = this.parseClassAccessorProperty(prop); + classBody.body.push(node); + if (isPrivate) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); + classBody.body.push(node); + const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; + this.declareClassPrivateMethodInScope(node, kind); + } + declareClassPrivateMethodInScope(node, kind) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); + } + parsePostMemberNameModifiers(methodOrProp) {} + parseClassPrivateProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassPrivateProperty"); + } + parseClassProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassProperty"); + } + parseClassAccessorProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassAccessorProperty"); + } + parseInitializer(node) { + this.scope.enter(64 | 16); + this.expressionScope.enter(newExpressionScope()); + this.prodParam.enter(0); + node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; + this.expressionScope.exit(); + this.prodParam.exit(); + this.scope.exit(); + } + parseClassId(node, isStatement, optionalId, bindingType = 8331) { + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + if (isStatement) { + this.declareNameFromIdentifier(node.id, bindingType); + } + } else { + if (optionalId || !isStatement) { + node.id = null; + } else { + throw this.raise(Errors.MissingClassName, this.state.startLoc); + } + } + } + parseClassSuper(node) { + node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; + } + parseExport(node, decorators) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); + const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + const parseAfterDefault = !hasDefault || this.eat(12); + const hasStar = parseAfterDefault && this.eatExportStar(node); + const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); + const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); + const isFromRequired = hasDefault || hasStar; + if (hasStar && !hasNamespace) { + if (hasDefault) this.unexpected(); + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, true); + return this.finishNode(node, "ExportAllDeclaration"); + } + const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); + if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { + this.unexpected(null, 5); + } + if (hasNamespace && parseAfterNamespace) { + this.unexpected(null, 98); + } + let hasDeclaration; + if (isFromRequired || hasSpecifiers) { + hasDeclaration = false; + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, isFromRequired); + } else { + hasDeclaration = this.maybeParseExportDeclaration(node); + } + if (isFromRequired || hasSpecifiers || hasDeclaration) { + var _node2$declaration; + const node2 = node; + this.checkExport(node2, true, false, !!node2.source); + if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, node2.declaration, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + return this.finishNode(node2, "ExportNamedDeclaration"); + } + if (this.eat(65)) { + const node2 = node; + const decl = this.parseExportDefaultExpression(); + node2.declaration = decl; + if (decl.type === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, decl, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.checkExport(node2, true, true); + return this.finishNode(node2, "ExportDefaultDeclaration"); + } + this.unexpected(null, 5); + } + eatExportStar(node) { + return this.eat(55); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { + this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); + const id = maybeDefaultIdentifier || this.parseIdentifier(true); + const specifier = this.startNodeAtNode(id); + specifier.exported = id; + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + if (this.isContextual(93)) { + var _ref, _ref$specifiers; + (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = []; + const specifier = this.startNodeAt(this.state.lastTokStartLoc); + this.next(); + specifier.exported = this.parseModuleExportName(); + node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); + return true; + } + return false; + } + maybeParseExportNamedSpecifiers(node) { + if (this.match(5)) { + const node2 = node; + if (!node2.specifiers) node2.specifiers = []; + const isTypeExport = node2.exportKind === "type"; + node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); + node2.source = null; + node2.declaration = null; + if (this.hasPlugin("importAssertions")) { + node2.assertions = []; + } + return true; + } + return false; + } + maybeParseExportDeclaration(node) { + if (this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + if (this.hasPlugin("importAssertions")) { + node.assertions = []; + } + node.declaration = this.parseExportDeclaration(node); + return true; + } + return false; + } + isAsyncFunction() { + if (!this.isContextual(95)) return false; + const next = this.nextTokenInLineStart(); + return this.isUnparsedContextual(next, "function"); + } + parseExportDefaultExpression() { + const expr = this.startNode(); + if (this.match(68)) { + this.next(); + return this.parseFunction(expr, 1 | 4); + } else if (this.isAsyncFunction()) { + this.next(); + this.next(); + return this.parseFunction(expr, 1 | 4 | 8); + } + if (this.match(80)) { + return this.parseClass(expr, true, true); + } + if (this.match(26)) { + if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); + } + if (this.match(75) || this.match(74) || this.isLet()) { + throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); + } + const res = this.parseMaybeAssignAllowIn(); + this.semicolon(); + return res; + } + parseExportDeclaration(node) { + if (this.match(80)) { + const node = this.parseClass(this.startNode(), true, false); + return node; + } + return this.parseStatementListItem(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (tokenIsIdentifier(type)) { + if (type === 95 && !this.state.containsEsc || type === 100) { + return false; + } + if ((type === 130 || type === 129) && !this.state.containsEsc) { + const { + type: nextType + } = this.lookahead(); + if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) { + this.expectOnePlugin(["flow", "typescript"]); + return false; + } + } + } else if (!this.match(65)) { + return false; + } + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { + return true; + } + if (this.match(65) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + return false; + } + parseExportFrom(node, expect) { + if (this.eatContextual(98)) { + node.source = this.parseImportSource(); + this.checkExport(node); + this.maybeParseImportAttributes(node); + this.checkJSONModuleImport(node); + } else if (expect) { + this.unexpected(); + } + this.semicolon(); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 26) { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + if (this.hasPlugin("decorators")) { + if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return true; + } + } + if (this.isContextual(107)) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + if (this.isContextual(96) && this.startsAwaitUsing()) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); + } + checkExport(node, checkNames, isDefault, isFrom) { + if (checkNames) { + var _node$specifiers; + if (isDefault) { + this.checkDuplicateExports(node, "default"); + if (this.hasPlugin("exportDefaultFrom")) { + var _declaration$extra; + const declaration = node.declaration; + if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { + this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); + } + } + } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { + for (const specifier of node.specifiers) { + const { + exported + } = specifier; + const exportName = exported.type === "Identifier" ? exported.name : exported.value; + this.checkDuplicateExports(specifier, exportName); + if (!isFrom && specifier.local) { + const { + local + } = specifier; + if (local.type !== "Identifier") { + this.raise(Errors.ExportBindingIsString, specifier, { + localName: local.value, + exportName + }); + } else { + this.checkReservedWord(local.name, local.loc.start, true, false); + this.scope.checkLocalExport(local); + } + } + } + } else if (node.declaration) { + const decl = node.declaration; + if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") { + const { + id + } = decl; + if (!id) throw new Error("Assertion failure"); + this.checkDuplicateExports(node, id.name); + } else if (decl.type === "VariableDeclaration") { + for (const declaration of decl.declarations) { + this.checkDeclaration(declaration.id); + } + } + } + } + } + checkDeclaration(node) { + if (node.type === "Identifier") { + this.checkDuplicateExports(node, node.name); + } else if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); + } + } else if (node.type === "ArrayPattern") { + for (const elem of node.elements) { + if (elem) { + this.checkDeclaration(elem); + } + } + } else if (node.type === "ObjectProperty") { + this.checkDeclaration(node.value); + } else if (node.type === "RestElement") { + this.checkDeclaration(node.argument); + } else if (node.type === "AssignmentPattern") { + this.checkDeclaration(node.left); + } + } + checkDuplicateExports(node, exportName) { + if (this.exportedIdentifiers.has(exportName)) { + if (exportName === "default") { + this.raise(Errors.DuplicateDefaultExport, node); + } else { + this.raise(Errors.DuplicateExport, node, { + exportName + }); + } + } + this.exportedIdentifiers.add(exportName); + } + parseExportSpecifiers(isInTypeExport) { + const nodes = []; + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.eat(8)) break; + } + const isMaybeTypeOnly = this.isContextual(130); + const isString = this.match(133); + const node = this.startNode(); + node.local = this.parseModuleExportName(); + nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); + } + return nodes; + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (this.eatContextual(93)) { + node.exported = this.parseModuleExportName(); + } else if (isString) { + node.exported = cloneStringLiteral(node.local); + } else if (!node.exported) { + node.exported = cloneIdentifier(node.local); + } + return this.finishNode(node, "ExportSpecifier"); + } + parseModuleExportName() { + if (this.match(133)) { + const result = this.parseStringLiteral(this.state.value); + const surrogate = loneSurrogate.exec(result.value); + if (surrogate) { + this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { + surrogateCharCode: surrogate[0].charCodeAt(0) + }); + } + return result; + } + return this.parseIdentifier(true); + } + isJSONModuleImport(node) { + if (node.assertions != null) { + return node.assertions.some(({ + key, + value + }) => { + return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); + }); + } + return false; + } + checkImportReflection(node) { + const { + specifiers + } = node; + const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; + if (node.phase === "source") { + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); + } + } else if (node.phase === "defer") { + if (singleBindingType !== "ImportNamespaceSpecifier") { + this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); + } + } else if (node.module) { + var _node$assertions; + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); + } + if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { + this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); + } + } + } + checkJSONModuleImport(node) { + if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { + const { + specifiers + } = node; + if (specifiers != null) { + const nonDefaultNamedSpecifier = specifiers.find(specifier => { + let imported; + if (specifier.type === "ExportSpecifier") { + imported = specifier.local; + } else if (specifier.type === "ImportSpecifier") { + imported = specifier.imported; + } + if (imported !== undefined) { + return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; + } + }); + if (nonDefaultNamedSpecifier !== undefined) { + this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); + } + } + } + } + isPotentialImportPhase(isExport) { + if (isExport) return false; + return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); + } + applyImportPhase(node, isExport, phase, loc) { + if (isExport) { + return; + } + if (phase === "module") { + this.expectPlugin("importReflection", loc); + node.module = true; + } else if (this.hasPlugin("importReflection")) { + node.module = false; + } + if (phase === "source") { + this.expectPlugin("sourcePhaseImports", loc); + node.phase = "source"; + } else if (phase === "defer") { + this.expectPlugin("deferredImportEvaluation", loc); + node.phase = "defer"; + } else if (this.hasPlugin("sourcePhaseImports")) { + node.phase = null; + } + } + parseMaybeImportPhase(node, isExport) { + if (!this.isPotentialImportPhase(isExport)) { + this.applyImportPhase(node, isExport, null); + return null; + } + const phaseIdentifier = this.parseIdentifier(true); + const { + type + } = this.state; + const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + if (isImportPhase) { + this.resetPreviousIdentifierLeadingComments(phaseIdentifier); + this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); + return null; + } else { + this.applyImportPhase(node, isExport, null); + return phaseIdentifier; + } + } + isPrecedingIdImportPhase(phase) { + const { + type + } = this.state; + return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + } + parseImport(node) { + if (this.match(133)) { + return this.parseImportSourceAndAttributes(node); + } + return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); + } + parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { + node.specifiers = []; + const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); + const parseNext = !hasDefault || this.eat(12); + const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); + if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); + this.expectContextual(98); + return this.parseImportSourceAndAttributes(node); + } + parseImportSourceAndAttributes(node) { + var _node$specifiers2; + (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; + node.source = this.parseImportSource(); + this.maybeParseImportAttributes(node); + this.checkImportReflection(node); + this.checkJSONModuleImport(node); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + if (!this.match(133)) this.unexpected(); + return this.parseExprAtom(); + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + finishImportSpecifier(specifier, type, bindingType = 8201) { + this.checkLVal(specifier.local, { + type + }, bindingType); + return this.finishNode(specifier, type); + } + parseImportAttributes() { + this.expect(5); + const attrs = []; + const attrNames = new Set(); + do { + if (this.match(8)) { + break; + } + const node = this.startNode(); + const keyName = this.state.value; + if (attrNames.has(keyName)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { + key: keyName + }); + } + attrNames.add(keyName); + if (this.match(133)) { + node.key = this.parseStringLiteral(keyName); + } else { + node.key = this.parseIdentifier(true); + } + this.expect(14); + if (!this.match(133)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + this.expect(8); + return attrs; + } + parseModuleAttributes() { + const attrs = []; + const attributes = new Set(); + do { + const node = this.startNode(); + node.key = this.parseIdentifier(true); + if (node.key.name !== "type") { + this.raise(Errors.ModuleAttributeDifferentFromType, node.key); + } + if (attributes.has(node.key.name)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { + key: node.key.name + }); + } + attributes.add(node.key.name); + this.expect(14); + if (!this.match(133)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + return attrs; + } + maybeParseImportAttributes(node) { + let attributes; + let useWith = false; + if (this.match(76)) { + if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { + return; + } + this.next(); + { + if (this.hasPlugin("moduleAttributes")) { + attributes = this.parseModuleAttributes(); + } else { + this.expectImportAttributesPlugin(); + attributes = this.parseImportAttributes(); + } + } + useWith = true; + } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { + if (this.hasPlugin("importAttributes")) { + if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) { + this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); + } + this.addExtra(node, "deprecatedAssertSyntax", true); + } else { + this.expectOnePlugin(["importAttributes", "importAssertions"]); + } + this.next(); + attributes = this.parseImportAttributes(); + } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + attributes = []; + } else { + if (this.hasPlugin("moduleAttributes")) { + attributes = []; + } else return; + } + if (!useWith && this.hasPlugin("importAssertions")) { + node.assertions = attributes; + } else { + node.attributes = attributes; + } + } + maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier) { + const specifier = this.startNodeAtNode(maybeDefaultIdentifier); + specifier.local = maybeDefaultIdentifier; + node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); + return true; + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); + return true; + } + return false; + } + maybeParseStarImportSpecifier(node) { + if (this.match(55)) { + const specifier = this.startNode(); + this.next(); + this.expectContextual(93); + this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); + return true; + } + return false; + } + parseNamedImportSpecifiers(node) { + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + if (this.eat(14)) { + throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); + } + this.expect(12); + if (this.eat(8)) break; + } + const specifier = this.startNode(); + const importedIsString = this.match(133); + const isMaybeTypeOnly = this.isContextual(130); + specifier.imported = this.parseModuleExportName(); + const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); + node.specifiers.push(importSpecifier); + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + const { + imported + } = specifier; + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: imported.value + }); + } + this.checkReservedWord(imported.name, specifier.loc.start, true, true); + if (!specifier.local) { + specifier.local = cloneIdentifier(imported); + } + } + return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); + } + isThisParam(param) { + return param.type === "Identifier" && param.name === "this"; + } + } + class Parser extends StatementParser { + constructor(options, input, pluginsMap) { + options = getOptions(options); + super(options, input); + this.options = options; + this.initializeScopes(); + this.plugins = pluginsMap; + this.filename = options.sourceFilename; + } + getScopeHandler() { + return ScopeHandler; + } + parse() { + this.enterInitialScopes(); + const file = this.startNode(); + const program = this.startNode(); + this.nextToken(); + file.errors = null; + this.parseTopLevel(file, program); + file.errors = this.state.errors; + file.comments.length = this.state.commentsLen; + return file; + } + } + function parse(input, options) { + var _options; + if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { + options = Object.assign({}, options); + try { + options.sourceType = "module"; + const parser = getParser(options, input); + const ast = parser.parse(); + if (parser.sawUnambiguousESM) { + return ast; + } + if (parser.ambiguousScriptDifferentAst) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused) {} + } else { + ast.program.sourceType = "script"; + } + return ast; + } catch (moduleError) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused2) {} + throw moduleError; + } + } else { + return getParser(options, input).parse(); + } + } + function parseExpression(input, options) { + const parser = getParser(options, input); + if (parser.options.strictMode) { + parser.state.strict = true; + } + return parser.getExpression(); + } + function generateExportedTokenTypes(internalTokenTypes) { + const tokenTypes = {}; + for (const typeName of Object.keys(internalTokenTypes)) { + tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); + } + return tokenTypes; + } + const tokTypes = generateExportedTokenTypes(tt); + function getParser(options, input) { + let cls = Parser; + const pluginsMap = new Map(); + if (options != null && options.plugins) { + for (const plugin of options.plugins) { + let name, opts; + if (typeof plugin === "string") { + name = plugin; + } else { + [name, opts] = plugin; + } + if (!pluginsMap.has(name)) { + pluginsMap.set(name, opts || {}); + } + } + validatePlugins(pluginsMap); + cls = getParserClass(pluginsMap); + } + return new cls(options, input, pluginsMap); + } + const parserClassCache = new Map(); + function getParserClass(pluginsMap) { + const pluginList = []; + for (const name of mixinPluginNames) { + if (pluginsMap.has(name)) { + pluginList.push(name); + } + } + const key = pluginList.join("|"); + let cls = parserClassCache.get(key); + if (!cls) { + cls = Parser; + for (const plugin of pluginList) { + cls = mixinPlugins[plugin](cls); + } + parserClassCache.set(key, cls); + } + return cls; + } + lib.parse = parse; + lib.parseExpression = parseExpression; + lib.tokTypes = tokTypes; + + return lib; +} + +var libExports = /*@__PURE__*/ requireLib(); + +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +} + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +class SyncWalker extends WalkerBase { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +} + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +function walk$2(ast, { enter, leave }) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); +} + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root; + walk$2(root, { + enter(node, parent) { + parent && parentStack.push(parent); + if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) { + return this.skip(); + } + if (node.type === "Identifier") { + const isLocal = !!knownIds[node.name]; + const isRefed = isReferencedIdentifier(node, parent, parentStack); + if (includeAll || isRefed && !isLocal) { + onIdentifier(node, parent, parentStack, isRefed, isLocal); + } + } else if (node.type === "ObjectProperty" && // eslint-disable-next-line no-restricted-syntax + (parent == null ? void 0 : parent.type) === "ObjectPattern") { + node.inPattern = true; + } else if (isFunctionType(node)) { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkFunctionParams( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "BlockStatement") { + if (node.scopeIds) { + node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); + } else { + walkBlockDeclarations( + node, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + } else if (node.type === "CatchClause" && node.param) { + for (const id of extractIdentifiers$1(node.param)) { + markScopeIdentifier(node, id, knownIds); + } + } else if (isForStatement(node)) { + walkForStatement( + node, + false, + (id) => markScopeIdentifier(node, id, knownIds) + ); + } + }, + leave(node, parent) { + parent && parentStack.pop(); + if (node !== rootExp && node.scopeIds) { + for (const id of node.scopeIds) { + knownIds[id]--; + if (knownIds[id] === 0) { + delete knownIds[id]; + } + } + } + } + }); +} +function isReferencedIdentifier(id, parent, parentStack) { + if (!parent) { + return true; + } + if (id.name === "arguments") { + return false; + } + if (isReferenced(id, parent)) { + return true; + } + switch (parent.type) { + case "AssignmentExpression": + case "AssignmentPattern": + return true; + case "ObjectPattern": + case "ArrayPattern": + return isInDestructureAssignment(parent, parentStack); + } + return false; +} +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; + } + } + } + return false; +} +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; + } + } + return false; +} +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers$1(p)) { + onIdent(id); + } + } +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers$1(decl.id)) { + onIdent(id); + } + } + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + onIdent(stmt.id); + } else if (isForStatement(stmt)) { + walkForStatement(stmt, true, onIdent); + } + } +} +function isForStatement(stmt) { + return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; +} +function walkForStatement(stmt, isVar, onIdent) { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers$1(decl.id)) { + onIdent(id); + } + } + } +} +function extractIdentifiers$1(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers$1(prop.argument, nodes); + } else { + extractIdentifiers$1(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) extractIdentifiers$1(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers$1(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers$1(param.left, nodes); + break; + } + return nodes; +} +function markKnownIds(name, knownIds) { + if (name in knownIds) { + knownIds[name]++; + } else { + knownIds[name] = 1; + } +} +function markScopeIdentifier(node, child, knownIds) { + const { name } = child; + if (node.scopeIds && node.scopeIds.has(name)) { + return; + } + markKnownIds(name, knownIds); + (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name); +} +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +function isReferenced(node, parent, grandparent) { + switch (parent.type) { + // yes: PARENT[NODE] + // yes: NODE.child + // no: parent.NODE + case "MemberExpression": + case "OptionalMemberExpression": + if (parent.property === node) { + return !!parent.computed; + } + return parent.object === node; + case "JSXMemberExpression": + return parent.object === node; + // no: let NODE = init; + // yes: let id = NODE; + case "VariableDeclarator": + return parent.init === node; + // yes: () => NODE + // no: (NODE) => {} + case "ArrowFunctionExpression": + return parent.body === node; + // no: class { #NODE; } + // no: class { get #NODE() {} } + // no: class { #NODE() {} } + // no: class { fn() { return this.#NODE; } } + case "PrivateName": + return false; + // no: class { NODE() {} } + // yes: class { [NODE]() {} } + // no: class { foo(NODE) {} } + case "ClassMethod": + case "ClassPrivateMethod": + case "ObjectMethod": + if (parent.key === node) { + return !!parent.computed; + } + return false; + // yes: { [NODE]: "" } + // no: { NODE: "" } + // depends: { NODE } + // depends: { key: NODE } + case "ObjectProperty": + if (parent.key === node) { + return !!parent.computed; + } + return !grandparent; + // no: class { NODE = value; } + // yes: class { [NODE] = value; } + // yes: class { key = NODE; } + case "ClassProperty": + if (parent.key === node) { + return !!parent.computed; + } + return true; + case "ClassPrivateProperty": + return parent.key !== node; + // no: class NODE {} + // yes: class Foo extends NODE {} + case "ClassDeclaration": + case "ClassExpression": + return parent.superClass === node; + // yes: left = NODE; + // no: NODE = right; + case "AssignmentExpression": + return parent.right === node; + // no: [NODE = foo] = []; + // yes: [foo = NODE] = []; + case "AssignmentPattern": + return parent.right === node; + // no: NODE: for (;;) {} + case "LabeledStatement": + return false; + // no: try {} catch (NODE) {} + case "CatchClause": + return false; + // no: function foo(...NODE) {} + case "RestElement": + return false; + case "BreakStatement": + case "ContinueStatement": + return false; + // no: function NODE() {} + // no: function foo(NODE) {} + case "FunctionDeclaration": + case "FunctionExpression": + return false; + // no: export NODE from "foo"; + // no: export * as NODE from "foo"; + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + // no: export { foo as NODE }; + // yes: export { NODE as foo }; + // no: export { NODE as foo } from "foo"; + case "ExportSpecifier": + return parent.local === node; + // no: import NODE from "foo"; + // no: import * as NODE from "foo"; + // no: import { NODE as foo } from "foo"; + // no: import { foo as NODE } from "foo"; + // no: import NODE from "bar"; + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + // no: import "foo" assert { NODE: "json" } + case "ImportAttribute": + return false; + // no: <div NODE="foo" /> + case "JSXAttribute": + return false; + // no: [NODE] = []; + // no: ({ NODE }) = []; + case "ObjectPattern": + case "ArrayPattern": + return false; + // no: new.NODE + // no: NODE.target + case "MetaProperty": + return false; + // yes: type X = { someProperty: NODE } + // no: type X = { NODE: OtherType } + case "ObjectTypeProperty": + return parent.key !== node; + // yes: enum X { Foo = NODE } + // no: enum X { NODE } + case "TSEnumMember": + return parent.id !== node; + // yes: { [NODE]: value } + // no: { NODE: value } + case "TSPropertySignature": + if (parent.key === node) { + return !!parent.computed; + } + return true; + } + return true; +} +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; + } +} + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; + } +} +const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; +const isMemberExpressionBrowser = (exp) => { + const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; + } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; + } + } + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = (exp, context) => { + try { + let ret = exp.ast || libExports.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + ret = unwrapTSNode(ret); + return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined"; + } catch (e) { + return false; + } +}; +const isMemberExpression = isMemberExpressionNode; +const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); +const isFnExpressionNode = (exp, context) => { + try { + let ret = exp.ast || libExports.parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] + }); + if (ret.type === "Program") { + ret = ret.body[0]; + if (ret.type === "ExpressionStatement") { + ret = ret.expression; + } + } + ret = unwrapTSNode(ret); + return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression"; + } catch (e) { + return false; + } +}; +const isFnExpression = isFnExpressionNode; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column + }, + source, + numberOfCharacters + ); +} +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; + } + } + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; +} +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); + } +} +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && (isString$1(name) ? p.name === name : name.test(p.name))) { + return p; + } + } +} +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; + } + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; + } + } +} +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); +} +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] + ); +} +function isText$1(node) { + return node.type === 5 || node.type === 2; +} +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !isString$1(props) && props.type === 14) { + const callee = props.callee; + if (!isString$1(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); + } + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !isString$1(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || isString$1(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!isString$1(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); + } + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); + } + } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } + } + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } + } +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName + ); + } + return result; +} +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } + switch (node.type) { + case 1: + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; + } + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => isObject$2(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + case 20: + return false; + default: + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: NO, + isPreTag: NO, + isIgnoreNewlineTag: NO, + isCustomElement: NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: true, + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = decodeHTML(exp); + } + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); + } + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); + } + break; + } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (stack[0] && stack[0].tag === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? [createSimpleExpression("prop")] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); + } + } + } + } + }, + ondirarg(start, end) { + if (start === end) return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + const exp = createSimpleExpression(mod, true, getLoc(start, end)); + currentProp.modifiers.push(exp); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); + } + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + { + if (currentProp.name === "for") { + expParseMode = 3 /* Skip */; + } else if (currentProp.name === "slot") { + expParseMode = 1 /* Params */; + } else if (currentProp.name === "on" && currentAttrValue.includes(";")) { + expParseMode = 2 /* Statements */; + } + } + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode + ); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + } + } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); + } + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + // " + case 20: + // ' + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } + } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; +} +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; + } + } + currentOpenTag = null; +} +function onText(content, start, end) { + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if (lastNode && lastNode.type === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } +} +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, lookAhead(end, 62) + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = extend({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns, children } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(children); + } + if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { + const first = children[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); + } + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } +} +function lookAhead(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; + return i; +} +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) i--; + return i; +} +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; + } + } + } + return false; +} +function isComponent({ tag, props }) { + if (currentOptions.isCustomElement(tag)) { + return false; + } + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; + } + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } + } + } + } + return false; +} +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = nodes[i - 1] && nodes[i - 1].type; + const next = nodes[i + 1] && nodes[i + 1].type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); + } + } + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; +} +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } + } + return true; +} +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; + } + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } + } else { + ret += str[i]; + prevCharIsWhitespace = false; + } + } + return ret; +} +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) + }; +} +function cloneLoc(loc) { + return getLoc(loc.start.offset, loc.end.offset); +} +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc + }; + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; + } + return attr; +} +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) { + if (isSimpleIdentifier(content)) { + exp.ast = null; + return exp; + } + try { + const plugins = currentOptions.expressionPlugins; + const options = { + plugins: plugins ? [...plugins, "typescript"] : ["typescript"] + }; + if (parseMode === 2 /* Statements */) { + exp.ast = libExports.parse(` ${content} `, options).program; + } else if (parseMode === 1 /* Params */) { + exp.ast = libExports.parseExpression(`(${content})=>{}`, options); + } else { + exp.ast = libExports.parseExpression(`(${content})`, options); + } + } catch (e) { + exp.ast = false; + emitError(45, loc.start.offset, e.message); + } + } + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = extend({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } + } + } + { + if (currentOptions.decodeEntities) { + console.warn( + `[@vue/compiler-core] decodeEntities option is passed but will be ignored in non-browser builds.` + ); + } + } + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options && options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); + } + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function cacheStatic(root, context) { + walk$1( + root, + void 0, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) { + const { children } = node; + const toCache = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1; + toCache.push(child); + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = codegenNode.patchFlag; + if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } else if (child.type === 12) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType >= 2) { + toCache.push(child); + continue; + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk$1(child, node, context, false, inFor); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk$1(child, node, context, child.children.length === 1, true); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk$1( + child.branches[i2], + node, + context, + child.branches[i2].children.length === 1, + inFor + ); + } + } + } + let cachedAsArray = false; + if (toCache.length === children.length && node.type === 1) { + if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray$3(node.codegenNode.children)) { + node.codegenNode.children = getCacheExpression( + createArrayExpression(node.codegenNode.children) + ); + cachedAsArray = true; + } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray$3(node.codegenNode.children) && node.codegenNode.children.type === 15) { + const slot = getSlotNode(node.codegenNode, "default"); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray$3(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { + const slotName = findDir(node, "slot", true); + const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); + if (slot) { + slot.returns = getCacheExpression( + createArrayExpression(slot.returns) + ); + cachedAsArray = true; + } + } + } + if (!cachedAsArray) { + for (const child of toCache) { + child.codegenNode = context.cache(child.codegenNode); + } + } + function getCacheExpression(value) { + const exp = context.cache(value); + if (inFor && context.hmr) { + exp.needArraySpread = true; + } + return exp; + } + function getSlotNode(node2, name) { + if (node2.children && !isArray$3(node2.children) && node2.children.type === 15) { + const slot = node2.children.properties.find( + (p) => p.key === name || p.key.content === name + ); + return slot && slot.value; + } + } + if (toCache.length && context.transformHoist) { + context.transformHoist(children, context, node); + } +} +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; + } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { + return 0; + } + if (codegenNode.patchFlag === void 0) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString$1(child) || isSymbol$1(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + case 20: + return 2; + default: + return 0; + } +} +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !isString$1(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); + } + } + return 0; +} +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); + } else { + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; + } + } + } + return returnType; +} +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; + } +} + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = NOOP, + isCustomElement = NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && capitalize(camelize(nameMatch[1])), + prefixIdentifiers, + hoistStatic, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + cached: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + grandParent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if (!context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if (removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: NOOP, + addIdentifiers(exp) { + { + if (isString$1(exp)) { + addId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(addId); + } else if (exp.type === 4) { + addId(exp.content); + } + } + }, + removeIdentifiers(exp) { + { + if (isString$1(exp)) { + removeId(exp); + } else if (exp.identifiers) { + exp.identifiers.forEach(removeId); + } else if (exp.type === 4) { + removeId(exp.content); + } + } + }, + hoist(exp) { + if (isString$1(exp)) exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false, inVOnce = false) { + const cacheExp = createCacheExpression( + context.cached.length, + exp, + isVNode, + inVOnce + ); + context.cached.push(cacheExp); + return cacheExp; + } + }; + function addId(id) { + const { identifiers } = context; + if (identifiers[id] === void 0) { + identifiers[id] = 0; + } + identifiers[id]++; + } + function removeId(id) { + context.identifiers[id]--; + } + return context; +} +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + cacheStatic(root, context); + } + if (!options.ssr) { + createRootCodegen(root, context); + } + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; +} +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; + } + } else if (children.length > 1) { + let patchFlag = 64; + if (children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag, + void 0, + void 0, + true, + void 0, + false + ); + } else ; +} +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if (isString$1(child)) continue; + context.grandParent = context.parent; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); + } +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if (isArray$3(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } + } + if (!context.currentNode) { + return; + } else { + node = context.currentNode; + } + } + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + // for container types, further traverse downwards + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; + } + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); + } +} +function createStructuralDirectiveTransform(name, fn) { + const matches = isString$1(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) exitFns.push(onExit); + } + } + return exitFns; + } + }; +} + +var sourceMap$2 = {}; + +var sourceMapGenerator$2 = {}; + +var base64Vlq$2 = {}; + +var base64$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64$2; + +function requireBase64$2 () { + if (hasRequiredBase64$2) return base64$2; + hasRequiredBase64$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + base64$2.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + base64$2.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + return base64$2; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64Vlq$2; + +function requireBase64Vlq$2 () { + if (hasRequiredBase64Vlq$2) return base64Vlq$2; + hasRequiredBase64Vlq$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = /*@__PURE__*/ requireBase64$2(); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + base64Vlq$2.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + base64Vlq$2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + return base64Vlq$2; +} + +var util$3 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredUtil$3; + +function requireUtil$3 () { + if (hasRequiredUtil$3) return util$3; + hasRequiredUtil$3 = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + var MAX_CACHED_INPUTS = 32; + + /** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ + function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; + } + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '<dir>/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + }); + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp; + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + } (util$3)); + return util$3; +} + +var arraySet$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredArraySet$2; + +function requireArraySet$2 () { + if (hasRequiredArraySet$2) return arraySet$2; + hasRequiredArraySet$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$3(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + arraySet$2.ArraySet = ArraySet; + return arraySet$2; +} + +var mappingList$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredMappingList$2; + +function requireMappingList$2 () { + if (hasRequiredMappingList$2) return mappingList$2; + hasRequiredMappingList$2 = 1; + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$3(); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + mappingList$2.MappingList = MappingList; + return mappingList$2; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapGenerator$2; + +function requireSourceMapGenerator$2 () { + if (hasRequiredSourceMapGenerator$2) return sourceMapGenerator$2; + hasRequiredSourceMapGenerator$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = /*@__PURE__*/ requireBase64Vlq$2(); + var util = /*@__PURE__*/ requireUtil$3(); + var ArraySet = /*@__PURE__*/ requireArraySet$2().ArraySet; + var MappingList = /*@__PURE__*/ requireMappingList$2().MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + })); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name) === false) { + return; + } + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.'; + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + var message = 'Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message) + } + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ''; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + sourceMapGenerator$2.SourceMapGenerator = SourceMapGenerator; + return sourceMapGenerator$2; +} + +var sourceMapConsumer$2 = {}; + +var binarySearch$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBinarySearch$2; + +function requireBinarySearch$2 () { + if (hasRequiredBinarySearch$2) return binarySearch$2; + hasRequiredBinarySearch$2 = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + } (binarySearch$2)); + return binarySearch$2; +} + +var quickSort$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredQuickSort$2; + +function requireQuickSort$2 () { + if (hasRequiredQuickSort$2) return quickSort$2; + hasRequiredQuickSort$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + function SortTemplate(comparator) { + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + return doQuickSort; + } + + function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + + let sortCache = new WeakMap(); + quickSort$2.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); + }; + return quickSort$2; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapConsumer$2; + +function requireSourceMapConsumer$2 () { + if (hasRequiredSourceMapConsumer$2) return sourceMapConsumer$2; + hasRequiredSourceMapConsumer$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$3(); + var binarySearch = /*@__PURE__*/ requireBinarySearch$2(); + var ArraySet = /*@__PURE__*/ requireArraySet$2().ArraySet; + var base64VLQ = /*@__PURE__*/ requireBase64Vlq$2(); + var quickSort = /*@__PURE__*/ requireQuickSort$2().quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + sourceMapConsumer$2.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + + const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; + function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } + } + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + sourceMapConsumer$2.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content || content === '') { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + sourceMapConsumer$2.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + return sourceMapConsumer$2; +} + +var sourceNode$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceNode$2; + +function requireSourceNode$2 () { + if (hasRequiredSourceNode$2) return sourceNode$2; + hasRequiredSourceNode$2 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator$2().SourceMapGenerator; + var util = /*@__PURE__*/ requireUtil$3(); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + sourceNode$2.SourceNode = SourceNode; + return sourceNode$2; +} + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var hasRequiredSourceMap$2; + +function requireSourceMap$2 () { + if (hasRequiredSourceMap$2) return sourceMap$2; + hasRequiredSourceMap$2 = 1; + sourceMap$2.SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator$2().SourceMapGenerator; + sourceMap$2.SourceMapConsumer = /*@__PURE__*/ requireSourceMapConsumer$2().SourceMapConsumer; + sourceMap$2.SourceNode = /*@__PURE__*/ requireSourceNode$2().SourceNode; + return sourceMap$2; +} + +var sourceMapExports = /*@__PURE__*/ requireSourceMap$2(); + +const PURE_ANNOTATION = `/*@__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + if (context.map) { + if (node) { + let name; + if (node.type === 4 && !node.isStatic) { + const content = node.content.replace(/^_ctx\./, ""); + if (content !== node.content && isSimpleIdentifier(content)) { + name = content; + } + } + addMapping(node.loc.start, name); + } + if (newlineIndex === -3 /* Unknown */) { + advancePositionWithMutation(context, code); + } else { + context.offset += code.length; + if (newlineIndex === -2 /* None */) { + context.column += code.length; + } else { + if (newlineIndex === -1 /* End */) { + newlineIndex = code.length - 1; + } + context.line++; + context.column = code.length - newlineIndex; + } + } + if (node && node.loc !== locStub) { + addMapping(node.loc.end); + } + } + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + function addMapping(loc, name = null) { + const { _names, _mappings } = context.map; + if (name !== null && !_names.has(name)) _names.add(name); + _mappings.add({ + originalLine: loc.line, + originalColumn: loc.column - 1, + // source-map column is 0 based + generatedLine: context.line, + generatedColumn: context.column - 1, + source: filename, + name + }); + } + if (sourceMap) { + context.map = new sourceMapExports.SourceMapGenerator(); + context.map.setSourceContent(filename, context.source); + context.map._sources.add(filename); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const genScopeId = scopeId != null && mode === "module"; + const isSetupInlined = !!options.inline; + const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; + if (mode === "module") { + genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined); + } else { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + if (options.bindingMetadata && !options.inline) { + args.push("$props", "$setup", "$data", "$options"); + } + const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(",") : args.join(", "); + if (isSetupInlined) { + push(`(${signature}) => {`); + } else { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); + indent(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } + } + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } + } + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); + } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: isSetupInlined ? preambleContext.code : ``, + map: context.map ? context.map.toJSON() : void 0 + }; +} +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + if (prefixIdentifiers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = ${VueBinding} +`, + -1 /* End */ + ); + } else { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); + } + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `const { ${ast.ssrHelpers.map(aliasHelper).join(", ")} } = require("${ssrRuntimeModuleName}") +`, + -1 /* End */ + ); + } + genHoists(ast.hoists, context); + newline(); + push(`return `); +} +function genModulePreamble(ast, context, genScopeId, inline) { + const { + push, + newline, + optimizeImports, + runtimeModuleName, + ssrRuntimeModuleName + } = context; + if (ast.helpers.size) { + const helpers = Array.from(ast.helpers); + if (optimizeImports) { + push( + `import { ${helpers.map((s) => helperNameMap[s]).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + push( + ` +// Binding optimization for webpack code-split +const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(", ")} +`, + -1 /* End */ + ); + } else { + push( + `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from ${JSON.stringify(runtimeModuleName)} +`, + -1 /* End */ + ); + } + } + if (ast.ssrHelpers && ast.ssrHelpers.length) { + push( + `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from "${ssrRuntimeModuleName}" +`, + -1 /* End */ + ); + } + if (ast.imports.length) { + genImports(ast.imports, context); + newline(); + } + genHoists(ast.hoists, context); + newline(); + if (!inline) { + push(`export `); + } +} +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); + } + } +} +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push(`const _hoisted_${i + 1} = `); + genNode(exp, context); + newline(); + } + } + context.pure = false; +} +function genImports(importsOptions, context) { + if (!importsOptions.length) { + return; + } + importsOptions.forEach((imports) => { + context.push(`import `); + genNode(imports.exp, context); + context.push(` from '${imports.path}'`); + context.newline(); + }); +} +function isText(n) { + return isString$1(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || nodes.some((n) => isArray$3(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (isString$1(node)) { + push(node, -3 /* Unknown */); + } else if (isArray$3(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); + } + } + } +} +function genNode(node, context) { + if (isString$1(node)) { + context.push(node, -3 /* Unknown */); + return; + } + if (isSymbol$1(node)) { + context.push(context.helper(node)); + return; + } + switch (node.type) { + case 1: + case 9: + case 11: + assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + // SSR only types + case 22: + genTemplateLiteral(node, context); + break; + case 23: + genIfStatement(node, context); + break; + case 24: + genAssignmentExpression(node, context); + break; + case 25: + genSequenceExpression(node, context); + break; + case 26: + genReturnStatement(node, context); + break; + /* v8 ignore start */ + case 10: + break; + default: + { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; + } + } +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (isString$1(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); + } + } +} +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); + } else { + push(`[${node.content}]`, -3 /* Unknown */, node); + } +} +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); + } + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + let patchFlagString; + if (patchFlag) { + { + if (patchFlag < 0) { + patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `); + patchFlagString = patchFlag + ` /* ${flagNames} */`; + } + } + } + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); + } + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); + } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); + } +} +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) break; + } + return args.slice(0, i + 1).map((arg) => arg || `null`); +} +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = isString$1(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); + } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); +} +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; + } + const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); + } + } + multilines && deindent(); + push(multilines ? `}` : ` }`); +} +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); +} +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); + } + push(`(`, -2 /* None */, node); + if (isArray$3(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); + } + push(`) => `); + if (newline || body) { + push(`{`); + indent(); + } + if (returns) { + if (newline) { + push(`return `); + } + if (isArray$3(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } + } else if (body) { + genNode(body, context); + } + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + push(`)`); + } +} +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); + } + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); +} +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + const { needPauseTracking, needArraySpread } = node; + if (needArraySpread) { + push(`[...(`); + } + push(`_cache[${node.index}] || (`); + if (needPauseTracking) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1`); + if (node.inVOnce) push(`, true`); + push(`),`); + newline(); + push(`(`); + } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (needPauseTracking) { + push(`).cacheIndex = ${node.index},`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); + } + push(`)`); + if (needArraySpread) { + push(`)]`); + } +} +function genTemplateLiteral(node, context) { + const { push, indent, deindent } = context; + push("`"); + const l = node.elements.length; + const multilines = l > 3; + for (let i = 0; i < l; i++) { + const e = node.elements[i]; + if (isString$1(e)) { + push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */); + } else { + push("${"); + if (multilines) indent(); + genNode(e, context); + if (multilines) deindent(); + push("}"); + } + } + push("`"); +} +function genIfStatement(node, context) { + const { push, indent, deindent } = context; + const { test, consequent, alternate } = node; + push(`if (`); + genNode(test, context); + push(`) {`); + indent(); + genNode(consequent, context); + deindent(); + push(`}`); + if (alternate) { + push(` else `); + if (alternate.type === 23) { + genIfStatement(alternate, context); + } else { + push(`{`); + indent(); + genNode(alternate, context); + deindent(); + push(`}`); + } + } +} +function genAssignmentExpression(node, context) { + genNode(node.left, context); + context.push(` = `); + genNode(node.right, context); +} +function genSequenceExpression(node, context) { + context.push(`(`); + genNodeList(node.expressions, context); + context.push(`)`); +} +function genReturnStatement({ returns }, context) { + context.push(`return `); + if (isArray$3(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); + } +} + +const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this"); +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + const memo = findDir(node, "memo"); + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) + !(memo && arg && arg.type === 4 && arg.content === "key")) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } + } + } + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + if (!context.prefixIdentifiers || !node.content.trim()) { + return node; + } + const { inline, bindingMetadata } = context; + const rewriteIdentifier = (raw, parent, id) => { + const type = hasOwn(bindingMetadata, raw) && bindingMetadata[raw]; + if (inline) { + const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id; + const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id; + const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack); + const isNewExpression = parent && isInNewExpression(parentStack); + const wrapWithUnref = (raw2) => { + const wrapped = `${context.helperString(UNREF)}(${raw2})`; + return isNewExpression ? `(${wrapped})` : wrapped; + }; + if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) { + return raw; + } else if (type === "setup-ref") { + return `${raw}.value`; + } else if (type === "setup-maybe-ref") { + return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw); + } else if (type === "setup-let") { + if (isAssignmentLVal) { + const { right: rVal, operator } = parent; + const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1); + const rExpString = stringifyExpression( + processExpression( + createSimpleExpression(rExp, false), + context, + false, + false, + knownIds + ) + ); + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`; + } else if (isUpdateArg) { + id.start = parent.start; + id.end = parent.end; + const { prefix: isPrefix, operator } = parent; + const prefix = isPrefix ? operator : ``; + const postfix = isPrefix ? `` : operator; + return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore +` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`; + } else if (isDestructureAssignment) { + return raw; + } else { + return wrapWithUnref(raw); + } + } else if (type === "props") { + return genPropsAccessExp(raw); + } else if (type === "props-aliased") { + return genPropsAccessExp(bindingMetadata.__propsAliases[raw]); + } + } else { + if (type && type.startsWith("setup") || type === "literal-const") { + return `$setup.${raw}`; + } else if (type === "props-aliased") { + return `$props['${bindingMetadata.__propsAliases[raw]}']`; + } else if (type) { + return `$${type}.${raw}`; + } + } + return `_ctx.${raw}`; + }; + const rawExp = node.content; + let ast = node.ast; + if (ast === false) { + return node; + } + if (ast === null || !ast && isSimpleIdentifier(rawExp)) { + const isScopeVarReference = context.identifiers[rawExp]; + const isAllowedGlobal = isGloballyAllowed(rawExp); + const isLiteral = isLiteralWhitelisted(rawExp); + if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) { + if (isConst(bindingMetadata[rawExp])) { + node.constType = 1; + } + node.content = rewriteIdentifier(rawExp); + } else if (!isScopeVarReference) { + if (isLiteral) { + node.constType = 3; + } else { + node.constType = 2; + } + } + return node; + } + if (!ast) { + const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`; + try { + ast = libExports.parseExpression(source, { + sourceType: "module", + plugins: context.expressionPlugins + }); + } catch (e) { + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + e.message + ) + ); + return node; + } + } + const ids = []; + const parentStack = []; + const knownIds = Object.create(context.identifiers); + walkIdentifiers( + ast, + (node2, parent, _, isReferenced, isLocal) => { + if (isStaticPropertyKey(node2, parent)) { + return; + } + const needPrefix = isReferenced && canPrefix(node2); + if (needPrefix && !isLocal) { + if (isStaticProperty(parent) && parent.shorthand) { + node2.prefix = `${node2.name}: `; + } + node2.name = rewriteIdentifier(node2.name, parent, node2); + ids.push(node2); + } else { + if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) { + node2.isConstant = true; + } + ids.push(node2); + } + }, + true, + // invoke on ALL identifiers + parentStack, + knownIds + ); + const children = []; + ids.sort((a, b) => a.start - b.start); + ids.forEach((id, i) => { + const start = id.start - 1; + const end = id.end - 1; + const last = ids[i - 1]; + const leadingText = rawExp.slice(last ? last.end - 1 : 0, start); + if (leadingText.length || id.prefix) { + children.push(leadingText + (id.prefix || ``)); + } + const source = rawExp.slice(start, end); + children.push( + createSimpleExpression( + id.name, + false, + { + start: advancePositionWithClone(node.loc.start, source, start), + end: advancePositionWithClone(node.loc.start, source, end), + source + }, + id.isConstant ? 3 : 0 + ) + ); + if (i === ids.length - 1 && end < rawExp.length) { + children.push(rawExp.slice(end)); + } + }); + let ret; + if (children.length) { + ret = createCompoundExpression(children, node.loc); + ret.ast = ast; + } else { + ret = node; + ret.constType = 3; + } + ret.identifiers = Object.keys(knownIds); + return ret; +} +function canPrefix(id) { + if (isGloballyAllowed(id.name)) { + return false; + } + if (id.name === "require") { + return false; + } + return true; +} +function stringifyExpression(exp) { + if (isString$1(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} +function isConst(type) { + return type === "setup-const" || type === "literal-const"; +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; + } + } + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if (context.prefixIdentifiers && dir.exp) { + dir.exp = processExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: cloneLoc(node.loc), + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + comments.unshift(sibling); + continue; + } + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; + } + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { + context.onError( + createCompilerError(30, node.loc) + ); + } + context.removeNode(); + const branch = createIfBranch(node, dir); + if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; + } + { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) onExit(); + context.currentNode = null; + } else { + context.onError( + createCompilerError(30, node.loc) + ); + } + break; + } + } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; + return { + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf + }; +} +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + '"v-if"' , + "true" + ]) + ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); + } +} +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag, + void 0, + void 0, + true, + false, + false, + branch.loc + ); + } + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } +} +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; + } + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (exp && exp.type === 4 && !exp.content.trim()) { + { + context.onError( + createCompilerError(34, loc) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + } + if (!exp) { + if (arg.type !== 4 || !arg.isStatic) { + context.onError( + createCompilerError( + 52, + arg.loc + ) + ); + return { + props: [ + createObjectProperty(arg, createSimpleExpression("", true, loc)) + ] + }; + } + transformBindShorthand(dir, context); + exp = dir.exp; + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.some((mod) => mod.content === "camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = camelize(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); + } + } + if (!context.inSSR) { + if (modifiers.some((mod) => mod.content === "prop")) { + injectPrefix(arg, "."); + } + if (modifiers.some((mod) => mod.content === "attr")) { + injectPrefix(arg, "^"); + } + } + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const transformBindShorthand = (dir, context) => { + const arg = dir.arg; + const propName = camelize(arg.content); + dir.exp = createSimpleExpression(propName, false, arg.loc); + { + dir.exp = processExpression(dir.exp, context); + } +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); + } +}; + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`, false, true); + const isDirKey = keyProp && keyProp.type === 7; + if (isDirKey && !keyProp.exp) { + transformBindShorthand(keyProp, context); + } + let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); + if (memo && keyExp && isDirKey) { + { + keyProp.exp = keyExp = processExpression( + keyExp, + context + ); + } + } + const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; + if (isTemplate) { + if (memo) { + memo.exp = processExpression( + memo.exp, + context + ); + } + if (keyProperty && keyProp.type !== 6) { + keyProperty.value = processExpression( + keyProperty.value, + context + ); + } + } + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + renderExp, + fragmentFlag, + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc + ); + return () => { + let childBlock; + const { children } = forNode; + if (isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); + } + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64, + void 0, + void 0, + true, + void 0, + false + ); + } else { + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } + } + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached.length)) + ); + context.cached.push(null); + } else { + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); + } + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) + ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] + }; + context.replaceNode(forNode); + scopes.vFor++; + if (context.prefixIdentifiers) { + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + } + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (context.prefixIdentifiers) { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + } + if (onExit) onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) return; + if (context.prefixIdentifiers) { + result.source = processExpression( + result.source, + context + ); + if (result.key) { + result.key = processExpression( + result.key, + context, + true + ); + } + if (result.index) { + result.index = processExpression( + result.index, + context, + true + ); + } + if (result.value) { + result.value = processExpression( + result.value, + context, + true + ); + } + } + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) break; + } + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); +} + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + const slotProps = vSlot.exp; + if (context.prefixIdentifiers) { + slotProps && context.addIdentifiers(slotProps); + } + context.scopes.vSlot++; + return () => { + if (context.prefixIdentifiers) { + slotProps && context.removeIdentifiers(slotProps); + } + context.scopes.vSlot--; + }; + } + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; + } + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + if (!context.ssr && context.prefixIdentifiers) { + hasDynamicSlots = hasScopeRef(node, context.identifiers); + } + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); + } + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) + ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; + } + } + if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); + } + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc + ) + ); + } + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { + context.onError( + createCompilerError( + 38, + dirLoc + ) + ); + continue; + } + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; + } + } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); + } + } + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } + } + } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); + } + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); + } + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; + } + break; + case 9: + if (hasForwardedSlots(child.branches)) return true; + break; + case 10: + case 11: + if (hasForwardedSlots(child.children)) return true; + break; + } + } + return false; +} +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); +} + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = isObject$2(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject" || tag === "math") + ); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } + } + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if (node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } + } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); + } + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + patchFlag === 0 ? void 0 : patchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc + ); + }; +}; +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp( + node, + "is", + false, + true + /* allow empty */ + ); + if (isProp) { + if (isExplicitDynamic || false) { + let exp; + if (isProp.type === 6) { + exp = isProp.value && createSimpleExpression(isProp.value.content, true); + } else { + exp = isProp.exp; + if (!exp) { + exp = createSimpleExpression(`is`, false, isProp.arg.loc); + { + exp = isProp.exp = processExpression(exp, context); + } + } + } + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); + } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); + } + } + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) context.helper(builtIn); + return builtIn; + } + { + const fromSetup = resolveSetupReference(tag, context); + if (fromSetup) { + return fromSetup; + } + const dotIndex = tag.indexOf("."); + if (dotIndex > 0) { + const ns = resolveSetupReference(tag.slice(0, dotIndex), context); + if (ns) { + return ns + tag.slice(dotIndex); + } + } + } + if (context.selfName && capitalize(camelize(tag)) === context.selfName) { + context.helper(RESOLVE_COMPONENT); + context.components.add(tag + `__self`); + return toValidAssetId(tag, `component`); + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function resolveSetupReference(name, context) { + const bindings = context.bindingMetadata; + if (!bindings || bindings.__isScriptSetup === false) { + return; + } + const camelName = camelize(name); + const PascalName = capitalize(camelName); + const checkType = (type) => { + if (bindings[name] === type) { + return name; + } + if (bindings[camelName] === type) { + return camelName; + } + if (bindings[PascalName] === type) { + return PascalName; + } + }; + const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const"); + if (fromConst) { + return context.inline ? ( + // in inline mode, const setup bindings (e.g. imports) can be used as-is + fromConst + ) : `$setup[${JSON.stringify(fromConst)}]`; + } + const fromMaybeRef = checkType("setup-let") || checkType("setup-ref") || checkType("setup-maybe-ref"); + if (fromMaybeRef) { + return context.inline ? ( + // setup scope bindings that may be refs need to be unrefed + `${context.helperString(UNREF)}(${fromMaybeRef})` + ) : `$setup[${JSON.stringify(fromMaybeRef)}]`; + } + const fromProps = checkType("props"); + if (fromProps) { + return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`; + } +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) + ); + properties = []; + } + if (arg) mergeArgs.push(arg); + }; + const pushRefVForMarker = () => { + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + }; + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = isOn(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !isReservedProp(name)) { + hasHydrationEventBinding = true; + } + if (isEventHandler && isReservedProp(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + } else { + hasDynamicKeys = true; + } + }; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + pushRefVForMarker(); + if (value && context.inline) { + const binding = context.bindingMetadata[value.content]; + if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") { + isStatic = false; + properties.push( + createObjectProperty( + createSimpleExpression("ref_key", true), + createSimpleExpression(value.content, true, value.loc) + ) + ); + } + } + } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || false)) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); + } else { + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || false)) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref")) { + pushRefVForMarker(); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushRefVForMarker(); + pushMergeArg(); + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); + } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); + } + continue; + } + if (isVBind && modifiers.some((mod) => mod.content === "prop")) { + patchFlag |= 32; + } + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if (isSymbol$1(needRuntime)) { + directiveImportMap.set(prop, needRuntime); + } + } + } else if (!isBuiltInDirective(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; + } + } + } + } + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc + ); + } + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } + } + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; + } + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } + } + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || isOn(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } + } + return deduped; +} +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); + } +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + const fromSetup = resolveSetupReference("v-" + dir.name, context); + if (fromSetup) { + dirArgs.push(fromSetup); + } else { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } + } + const { loc } = dir; + if (dir.exp) dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); + } + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(`void 0`); + } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); + } + return createArrayExpression(dirArgs, dir.loc); +} +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = camelize(p.name); + nonNameProps.push(p); + } + } + } else { + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) { + slotName = p.exp; + } else if (p.arg && p.arg.type === 4) { + const name = camelize(p.arg.content); + slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); + { + slotName = p.exp = processExpression(p.exp, context); + } + } + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = camelize(p.arg.content); + } + nonNameProps.push(p); + } + } + } + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, + context, + nonNameProps, + false, + false + ); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); + } + } + return { + slotName, + slotProps + }; +} + +const transformOn$1 = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if (rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + toHandlerKey(camelize(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } + } else { + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); + } + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp, context); + const isInlineStatement = !(isMemberExp || isFnExpression(exp, context)); + const hasMultipleStatements = exp.content.includes(`;`); + if (context.prefixIdentifiers) { + isInlineStatement && context.addIdentifiers(`$event`); + exp = dir.exp = processExpression( + exp, + context, + false, + hasMultipleStatements + ); + isInlineStatement && context.removeIdentifiers(`$event`); + shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once + !context.inVOnce && // runtime constants don't need to be cached + // (this is analyzed by compileScript in SFC <script setup>) + !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component - + // we need to use the original function to preserve arity, + // e.g. <transition> relies on checking cb.length to determine + // transition end handling. Inline function is ok since its arity + // is preserved even when cached. + !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot) + // it must be passed fresh to avoid stale values. + !hasScopeRef(exp, context.identifiers); + if (shouldCache && isMemberExp) { + if (exp.type === 4) { + exp.content = `${exp.content} && ${exp.content}(...args)`; + } else { + exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`]; + } + } + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? ` +//@ts-ignore +` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); + } + } + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + true)) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + (` /* ${PatchFlagNames[1]} */` ) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; + +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true, + true + ); + } + }; + } +}; + +const transformModel$1 = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); + } + const rawExp = exp.loc.source.trim(); + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); + } + const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref"); + if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) { + context.onError( + createCompilerError(43, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + if (maybeRef) { + if (bindingType === "setup-ref") { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event)` + ]); + } else { + const altAssignment = bindingType === "setup-let" ? `${rawExp} = $event` : `null`; + assignmentExp = createCompoundExpression([ + `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`, + createSimpleExpression(rawExp, false, exp.loc), + `).value = $event : ${altAssignment})` + ]); + } + } else { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) { + props[1].value = context.cache(props[1].value); + } + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); + } + return createTransformProps(props); +}; +function createTransformProps(props = []) { + return { props }; +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; + } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); + } + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached.length) + ]); + context.cached.push(null); + } + }; + } +}; + +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[], + ...prefixIdentifiers ? [ + // order is important + trackVForSlotScopes, + transformExpression + ] : [], + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn$1, + bind: transformBind, + model: transformModel$1 + } + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode; + if (!prefixIdentifiers && options.cacheHandlers) { + onError(createCompilerError(49)); + } + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = extend({}, options, { + prefixIdentifiers + }); + const ast = isString$1(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers); + if (options.isTS) { + const { expressionPlugins } = options; + if (!expressionPlugins || !expressionPlugins.includes("typescript")) { + options.expressionPlugins = [...expressionPlugins || [], "typescript"]; + } + } + transform( + ast, + extend({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: extend( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) + ); + return generate(ast, resolvedOptions); +} + +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" +}; + +const noopDirectiveTransform = () => ({ props: [] }); + +const V_MODEL_RADIO = Symbol(`vModelRadio` ); +const V_MODEL_CHECKBOX = Symbol( + `vModelCheckbox` +); +const V_MODEL_TEXT = Symbol(`vModelText` ); +const V_MODEL_SELECT = Symbol( + `vModelSelect` +); +const V_MODEL_DYNAMIC = Symbol( + `vModelDynamic` +); +const V_ON_WITH_MODIFIERS = Symbol( + `vOnModifiersGuard` +); +const V_ON_WITH_KEYS = Symbol( + `vOnKeysGuard` +); +const V_SHOW = Symbol(`vShow` ); +const TRANSITION = Symbol(`Transition` ); +const TRANSITION_GROUP = Symbol( + `TransitionGroup` +); +registerRuntimeHelpers({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +const parserOptions = { + parseMode: "html", + isVoidTag, + isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + isPreTag: (tag) => tag === "pre", + isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", + decodeEntities: void 0, + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; + } + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; + } + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; + } + } + if (ns === 0) { + if (tag === "svg") { + return 1; + } + if (tag === "math") { + return 2; + } + } + return ns; + } +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: createSimpleExpression(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); + } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = parseStringStyle(cssText); + return createSimpleExpression( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return createCompilerError( + code, + loc, + DOMErrorMessages + ); +} +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`innerHTML`, true, loc), + exp || createSimpleExpression("", true) + ) + ] + }; +}; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; + } + return { + props: [ + createObjectProperty( + createSimpleExpression(`textContent`, true), + exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression( + context.helperString(TO_DISPLAY_STRING), + [exp], + loc + ) : createSimpleExpression("", true) + ) + ] + }; +}; + +const transformModel = (dir, node, context) => { + const baseResult = transformModel$1(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; + } + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); + } + function checkDuplicatedValue() { + const value = findDir(node, "bind"); + if (value && isStaticArgOf(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = findProp(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + break; + } + } + } else if (hasDynamicKeyVBind(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + checkDuplicatedValue(); + } + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); + } + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ makeMap( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right"); +const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i].content; + if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if (isStaticExp(key)) { + if (isKeyboardEvent(key.content.toLowerCase())) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } + } + } + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return transformOn$1(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); + } + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); + } + if (nonKeyModifiers.length) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); + } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { + handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); + } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(capitalize).join(""); + key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); + } + return { + props: [createObjectProperty(key, handlerExp)] + }; + }); +}; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); + } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; +}; + +const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; + } + } +}; +function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); +} + +const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g; +const stringifyStatic = (children, context, parent) => { + if (context.scopes.vSlot > 0) { + return; + } + const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray$3(parent.codegenNode.children) && parent.codegenNode.children.type === 20; + let nc = 0; + let ec = 0; + const currentChunk = []; + const stringifyCurrentChunk = (currentIndex) => { + if (nc >= 20 || ec >= 5) { + const staticCall = createCallExpression(context.helper(CREATE_STATIC), [ + JSON.stringify( + currentChunk.map((node) => stringifyNode(node, context)).join("") + ).replace(expReplaceRE, `" + $1 + "`), + // the 2nd argument indicates the number of DOM nodes this static vnode + // will insert / hydrate + String(currentChunk.length) + ]); + const deleteCount = currentChunk.length - 1; + if (isParentCached) { + children.splice( + currentIndex - currentChunk.length, + currentChunk.length, + // @ts-expect-error + staticCall + ); + } else { + currentChunk[0].codegenNode.value = staticCall; + if (currentChunk.length > 1) { + children.splice(currentIndex - currentChunk.length + 1, deleteCount); + const cacheIndex = context.cached.indexOf( + currentChunk[currentChunk.length - 1].codegenNode + ); + if (cacheIndex > -1) { + for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { + const c = context.cached[i2]; + if (c) c.index -= deleteCount; + } + context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); + } + } + } + return deleteCount; + } + return 0; + }; + let i = 0; + for (; i < children.length; i++) { + const child = children[i]; + const isCached = isParentCached || getCachedNode(child); + if (isCached) { + const result = analyzeNode(child); + if (result) { + nc += result[0]; + ec += result[1]; + currentChunk.push(child); + continue; + } + } + i -= stringifyCurrentChunk(i); + nc = 0; + ec = 0; + currentChunk.length = 0; + } + stringifyCurrentChunk(i); +}; +const getCachedNode = (node) => { + if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { + return node.codegenNode; + } +}; +const dataAriaRE = /^(data|aria)-/; +const isStringifiableAttr = (name, ns) => { + return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : ns === 2 ? isKnownMathMLAttr(name) : false) || dataAriaRE.test(name); +}; +const isNonStringifiable = /* @__PURE__ */ makeMap( + `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` +); +function analyzeNode(node) { + if (node.type === 1 && isNonStringifiable(node.tag)) { + return false; + } + if (node.type === 12) { + return [1, 0]; + } + let nc = 1; + let ec = node.props.length > 0 ? 1 : 0; + let bailed = false; + const bail = () => { + bailed = true; + return false; + }; + function walk(node2) { + const isOptionTag = node2.tag === "option" && node2.ns === 0; + for (let i = 0; i < node2.props.length; i++) { + const p = node2.props[i]; + if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) { + return bail(); + } + if (p.type === 7 && p.name === "bind") { + if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) { + return bail(); + } + if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) { + return bail(); + } + if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) { + return bail(); + } + } + } + for (let i = 0; i < node2.children.length; i++) { + nc++; + const child = node2.children[i]; + if (child.type === 1) { + if (child.props.length > 0) { + ec++; + } + walk(child); + if (bailed) { + return false; + } + } + } + return true; + } + return walk(node) ? [nc, ec] : false; +} +function stringifyNode(node, context) { + if (isString$1(node)) { + return node; + } + if (isSymbol$1(node)) { + return ``; + } + switch (node.type) { + case 1: + return stringifyElement(node, context); + case 2: + return escapeHtml(node.content); + case 3: + return `<!--${escapeHtml(node.content)}-->`; + case 5: + return escapeHtml(toDisplayString(evaluateConstant(node.content))); + case 8: + return escapeHtml(evaluateConstant(node)); + case 12: + return stringifyNode(node.content, context); + default: + return ""; + } +} +function stringifyElement(node, context) { + let res = `<${node.tag}`; + let innerHTML = ""; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + res += ` ${p.name}`; + if (p.value) { + res += `="${escapeHtml(p.value.content)}"`; + } + } else if (p.type === 7) { + if (p.name === "bind") { + const exp = p.exp; + if (exp.content[0] === "_") { + res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`; + continue; + } + if (isBooleanAttr(p.arg.content) && exp.content === "false") { + continue; + } + let evaluated = evaluateConstant(exp); + if (evaluated != null) { + const arg = p.arg && p.arg.content; + if (arg === "class") { + evaluated = normalizeClass(evaluated); + } else if (arg === "style") { + evaluated = stringifyStyle(normalizeStyle(evaluated)); + } + res += ` ${p.arg.content}="${escapeHtml( + evaluated + )}"`; + } + } else if (p.name === "html") { + innerHTML = evaluateConstant(p.exp); + } else if (p.name === "text") { + innerHTML = escapeHtml( + toDisplayString(evaluateConstant(p.exp)) + ); + } + } + } + if (context.scopeId) { + res += ` ${context.scopeId}`; + } + res += `>`; + if (innerHTML) { + res += innerHTML; + } else { + for (let i = 0; i < node.children.length; i++) { + res += stringifyNode(node.children[i], context); + } + } + if (!isVoidTag(node.tag)) { + res += `</${node.tag}>`; + } + return res; +} +function evaluateConstant(exp) { + if (exp.type === 4) { + return new Function(`return (${exp.content})`)(); + } else { + let res = ``; + exp.children.forEach((c) => { + if (isString$1(c) || isSymbol$1(c)) { + return; + } + if (c.type === 2) { + res += c.content; + } else if (c.type === 5) { + res += toDisplayString(evaluateConstant(c.content)); + } else { + res += evaluateConstant(c); + } + }); + return res; + } +} + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); + } +}; + +function isValidHTMLNesting(parent, child) { + if (parent in onlyValidChildren) { + return onlyValidChildren[parent].has(child); + } + if (child in onlyValidParents) { + return onlyValidParents[child].has(parent); + } + if (parent in knownInvalidChildren) { + if (knownInvalidChildren[parent].has(child)) return false; + } + if (child in knownInvalidParents) { + if (knownInvalidParents[child].has(parent)) return false; + } + return true; +} +const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); +const emptySet = /* @__PURE__ */ new Set([]); +const onlyValidChildren = { + head: /* @__PURE__ */ new Set([ + "base", + "basefront", + "bgsound", + "link", + "meta", + "title", + "noscript", + "noframes", + "style", + "script", + "template" + ]), + optgroup: /* @__PURE__ */ new Set(["option"]), + select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), + // table + table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), + tr: /* @__PURE__ */ new Set(["td", "th"]), + colgroup: /* @__PURE__ */ new Set(["col"]), + tbody: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["tr"]), + tfoot: /* @__PURE__ */ new Set(["tr"]), + // these elements can not have any children elements + script: emptySet, + iframe: emptySet, + option: emptySet, + textarea: emptySet, + style: emptySet, + title: emptySet +}; +const onlyValidParents = { + // sections + html: emptySet, + body: /* @__PURE__ */ new Set(["html"]), + head: /* @__PURE__ */ new Set(["html"]), + // table + td: /* @__PURE__ */ new Set(["tr"]), + colgroup: /* @__PURE__ */ new Set(["table"]), + caption: /* @__PURE__ */ new Set(["table"]), + tbody: /* @__PURE__ */ new Set(["table"]), + tfoot: /* @__PURE__ */ new Set(["table"]), + col: /* @__PURE__ */ new Set(["colgroup"]), + th: /* @__PURE__ */ new Set(["tr"]), + thead: /* @__PURE__ */ new Set(["table"]), + tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), + // data list + dd: /* @__PURE__ */ new Set(["dl", "div"]), + dt: /* @__PURE__ */ new Set(["dl", "div"]), + // other + figcaption: /* @__PURE__ */ new Set(["figure"]), + // li: new Set(["ul", "ol"]), + summary: /* @__PURE__ */ new Set(["details"]), + area: /* @__PURE__ */ new Set(["map"]) +}; +const knownInvalidChildren = { + p: /* @__PURE__ */ new Set([ + "address", + "article", + "aside", + "blockquote", + "center", + "details", + "dialog", + "dir", + "div", + "dl", + "fieldset", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "li", + "main", + "nav", + "menu", + "ol", + "p", + "pre", + "section", + "table", + "ul" + ]), + svg: /* @__PURE__ */ new Set([ + "b", + "blockquote", + "br", + "code", + "dd", + "div", + "dl", + "dt", + "em", + "embed", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "li", + "menu", + "meta", + "ol", + "p", + "pre", + "ruby", + "s", + "small", + "span", + "strong", + "sub", + "sup", + "table", + "u", + "ul", + "var" + ]) +}; +const knownInvalidParents = { + a: /* @__PURE__ */ new Set(["a"]), + button: /* @__PURE__ */ new Set(["button"]), + dd: /* @__PURE__ */ new Set(["dd", "dt"]), + dt: /* @__PURE__ */ new Set(["dd", "dt"]), + form: /* @__PURE__ */ new Set(["form"]), + li: /* @__PURE__ */ new Set(["li"]), + h1: headings, + h2: headings, + h3: headings, + h4: headings, + h5: headings, + h6: headings +}; + +const validateHtmlNesting = (node, context) => { + if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { + const error = new SyntaxError( + `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` + ); + error.loc = node.loc; + context.onWarn(error); + } +}; + +const DOMNodeTransforms = [ + transformStyle, + ...[transformTransition, validateHtmlNesting] +]; +const DOMDirectiveTransforms = { + cloak: noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile$1(src, options = {}) { + return baseCompile( + src, + extend({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: extend( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: stringifyStatic + }) + ); +} +function parse$3(template, options = {}) { + return baseParse(template, extend({}, parserOptions, options)); +} + +var CompilerDOM = /*#__PURE__*/Object.freeze({ + __proto__: null, + BASE_TRANSITION: BASE_TRANSITION, + BindingTypes: BindingTypes, + CAMELIZE: CAMELIZE, + CAPITALIZE: CAPITALIZE, + CREATE_BLOCK: CREATE_BLOCK, + CREATE_COMMENT: CREATE_COMMENT, + CREATE_ELEMENT_BLOCK: CREATE_ELEMENT_BLOCK, + CREATE_ELEMENT_VNODE: CREATE_ELEMENT_VNODE, + CREATE_SLOTS: CREATE_SLOTS, + CREATE_STATIC: CREATE_STATIC, + CREATE_TEXT: CREATE_TEXT, + CREATE_VNODE: CREATE_VNODE, + CompilerDeprecationTypes: CompilerDeprecationTypes, + ConstantTypes: ConstantTypes, + DOMDirectiveTransforms: DOMDirectiveTransforms, + DOMErrorCodes: DOMErrorCodes, + DOMErrorMessages: DOMErrorMessages, + DOMNodeTransforms: DOMNodeTransforms, + ElementTypes: ElementTypes, + ErrorCodes: ErrorCodes, + FRAGMENT: FRAGMENT, + GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS, + IS_MEMO_SAME: IS_MEMO_SAME, + IS_REF: IS_REF, + KEEP_ALIVE: KEEP_ALIVE, + MERGE_PROPS: MERGE_PROPS, + NORMALIZE_CLASS: NORMALIZE_CLASS, + NORMALIZE_PROPS: NORMALIZE_PROPS, + NORMALIZE_STYLE: NORMALIZE_STYLE, + Namespaces: Namespaces, + NodeTypes: NodeTypes, + OPEN_BLOCK: OPEN_BLOCK, + POP_SCOPE_ID: POP_SCOPE_ID, + PUSH_SCOPE_ID: PUSH_SCOPE_ID, + RENDER_LIST: RENDER_LIST, + RENDER_SLOT: RENDER_SLOT, + RESOLVE_COMPONENT: RESOLVE_COMPONENT, + RESOLVE_DIRECTIVE: RESOLVE_DIRECTIVE, + RESOLVE_DYNAMIC_COMPONENT: RESOLVE_DYNAMIC_COMPONENT, + RESOLVE_FILTER: RESOLVE_FILTER, + SET_BLOCK_TRACKING: SET_BLOCK_TRACKING, + SUSPENSE: SUSPENSE, + TELEPORT: TELEPORT, + TO_DISPLAY_STRING: TO_DISPLAY_STRING, + TO_HANDLERS: TO_HANDLERS, + TO_HANDLER_KEY: TO_HANDLER_KEY, + TRANSITION: TRANSITION, + TRANSITION_GROUP: TRANSITION_GROUP, + TS_NODE_TYPES: TS_NODE_TYPES, + UNREF: UNREF, + V_MODEL_CHECKBOX: V_MODEL_CHECKBOX, + V_MODEL_DYNAMIC: V_MODEL_DYNAMIC, + V_MODEL_RADIO: V_MODEL_RADIO, + V_MODEL_SELECT: V_MODEL_SELECT, + V_MODEL_TEXT: V_MODEL_TEXT, + V_ON_WITH_KEYS: V_ON_WITH_KEYS, + V_ON_WITH_MODIFIERS: V_ON_WITH_MODIFIERS, + V_SHOW: V_SHOW, + WITH_CTX: WITH_CTX, + WITH_DIRECTIVES: WITH_DIRECTIVES, + WITH_MEMO: WITH_MEMO, + advancePositionWithClone: advancePositionWithClone, + advancePositionWithMutation: advancePositionWithMutation, + assert: assert, + baseCompile: baseCompile, + baseParse: baseParse, + buildDirectiveArgs: buildDirectiveArgs, + buildProps: buildProps, + buildSlots: buildSlots, + checkCompatEnabled: checkCompatEnabled, + compile: compile$1, + convertToBlock: convertToBlock, + createArrayExpression: createArrayExpression, + createAssignmentExpression: createAssignmentExpression, + createBlockStatement: createBlockStatement, + createCacheExpression: createCacheExpression, + createCallExpression: createCallExpression, + createCompilerError: createCompilerError, + createCompoundExpression: createCompoundExpression, + createConditionalExpression: createConditionalExpression, + createDOMCompilerError: createDOMCompilerError, + createForLoopParams: createForLoopParams, + createFunctionExpression: createFunctionExpression, + createIfStatement: createIfStatement, + createInterpolation: createInterpolation, + createObjectExpression: createObjectExpression, + createObjectProperty: createObjectProperty, + createReturnStatement: createReturnStatement, + createRoot: createRoot, + createSequenceExpression: createSequenceExpression, + createSimpleExpression: createSimpleExpression, + createStructuralDirectiveTransform: createStructuralDirectiveTransform, + createTemplateLiteral: createTemplateLiteral, + createTransformContext: createTransformContext, + createVNodeCall: createVNodeCall, + errorMessages: errorMessages$1, + extractIdentifiers: extractIdentifiers$1, + findDir: findDir, + findProp: findProp, + forAliasRE: forAliasRE, + generate: generate, + generateCodeFrame: generateCodeFrame, + getBaseTransformPreset: getBaseTransformPreset, + getConstantType: getConstantType, + getMemoedVNodeCall: getMemoedVNodeCall, + getVNodeBlockHelper: getVNodeBlockHelper, + getVNodeHelper: getVNodeHelper, + hasDynamicKeyVBind: hasDynamicKeyVBind, + hasScopeRef: hasScopeRef, + helperNameMap: helperNameMap, + injectProp: injectProp, + isCoreComponent: isCoreComponent, + isFnExpression: isFnExpression, + isFnExpressionBrowser: isFnExpressionBrowser, + isFnExpressionNode: isFnExpressionNode, + isFunctionType: isFunctionType, + isInDestructureAssignment: isInDestructureAssignment, + isInNewExpression: isInNewExpression, + isMemberExpression: isMemberExpression, + isMemberExpressionBrowser: isMemberExpressionBrowser, + isMemberExpressionNode: isMemberExpressionNode, + isReferencedIdentifier: isReferencedIdentifier, + isSimpleIdentifier: isSimpleIdentifier, + isSlotOutlet: isSlotOutlet, + isStaticArgOf: isStaticArgOf, + isStaticExp: isStaticExp, + isStaticProperty: isStaticProperty, + isStaticPropertyKey: isStaticPropertyKey, + isTemplateNode: isTemplateNode, + isText: isText$1, + isVSlot: isVSlot, + locStub: locStub, + noopDirectiveTransform: noopDirectiveTransform, + parse: parse$3, + parserOptions: parserOptions, + processExpression: processExpression, + processFor: processFor, + processIf: processIf, + processSlotOutlet: processSlotOutlet, + registerRuntimeHelpers: registerRuntimeHelpers, + resolveComponentType: resolveComponentType, + stringifyExpression: stringifyExpression, + toValidAssetId: toValidAssetId, + trackSlotScopes: trackSlotScopes, + trackVForSlotScopes: trackVForSlotScopes, + transform: transform, + transformBind: transformBind, + transformElement: transformElement, + transformExpression: transformExpression, + transformModel: transformModel$1, + transformOn: transformOn$1, + transformStyle: transformStyle, + traverseNode: traverseNode, + unwrapTSNode: unwrapTSNode, + walkBlockDeclarations: walkBlockDeclarations, + walkFunctionParams: walkFunctionParams, + walkIdentifiers: walkIdentifiers, + warnDeprecation: warnDeprecation +}); + +var hashSum; +var hasRequiredHashSum; + +function requireHashSum () { + if (hasRequiredHashSum) return hashSum; + hasRequiredHashSum = 1; + + function pad (hash, len) { + while (hash.length < len) { + hash = '0' + hash; + } + return hash; + } + + function fold (hash, text) { + var i; + var chr; + var len; + if (text.length === 0) { + return hash; + } + for (i = 0, len = text.length; i < len; i++) { + chr = text.charCodeAt(i); + hash = ((hash << 5) - hash) + chr; + hash |= 0; + } + return hash < 0 ? hash * -2 : hash; + } + + function foldObject (hash, o, seen) { + return Object.keys(o).sort().reduce(foldKey, hash); + function foldKey (hash, key) { + return foldValue(hash, o[key], key, seen); + } + } + + function foldValue (input, value, key, seen) { + var hash = fold(fold(fold(input, key), toString(value)), typeof value); + if (value === null) { + return fold(hash, 'null'); + } + if (value === undefined) { + return fold(hash, 'undefined'); + } + if (typeof value === 'object' || typeof value === 'function') { + if (seen.indexOf(value) !== -1) { + return fold(hash, '[Circular]' + key); + } + seen.push(value); + + var objHash = foldObject(hash, value, seen); + + if (!('valueOf' in value) || typeof value.valueOf !== 'function') { + return objHash; + } + + try { + return fold(objHash, String(value.valueOf())) + } catch (err) { + return fold(objHash, '[valueOf exception]' + (err.stack || err.message)) + } + } + return fold(hash, value.toString()); + } + + function toString (o) { + return Object.prototype.toString.call(o); + } + + function sum (o) { + return pad(foldValue(0, o, '', []).toString(16), 8); + } + + hashSum = sum; + return hashSum; +} + +var hashSumExports = /*@__PURE__*/ requireHashSum(); +var hash = /*@__PURE__*/getDefaultExportFromCjs(hashSumExports); + +const CSS_VARS_HELPER = `useCssVars`; +function genCssVarsFromList(vars, id, isProd, isSSR = false) { + return `{ + ${vars.map( + (key) => `"${isSSR ? `--` : ``}${genVarName(id, key, isProd, isSSR)}": (${key})` + ).join(",\n ")} +}`; +} +function genVarName(id, raw, isProd, isSSR = false) { + if (isProd) { + return hash(id + raw); + } else { + return `${id}-${getEscapedCssVarName(raw, isSSR)}`; + } +} +function normalizeExpression(exp) { + exp = exp.trim(); + if (exp[0] === `'` && exp[exp.length - 1] === `'` || exp[0] === `"` && exp[exp.length - 1] === `"`) { + return exp.slice(1, -1); + } + return exp; +} +const vBindRE = /v-bind\s*\(/g; +function parseCssVars(sfc) { + const vars = []; + sfc.styles.forEach((style) => { + let match; + const content = style.content.replace(/\/\*([\s\S]*?)\*\/|\/\/.*/g, ""); + while (match = vBindRE.exec(content)) { + const start = match.index + match[0].length; + const end = lexBinding(content, start); + if (end !== null) { + const variable = normalizeExpression(content.slice(start, end)); + if (!vars.includes(variable)) { + vars.push(variable); + } + } + } + }); + return vars; +} +function lexBinding(content, start) { + let state = 0 /* inParens */; + let parenDepth = 0; + for (let i = start; i < content.length; i++) { + const char = content.charAt(i); + switch (state) { + case 0 /* inParens */: + if (char === `'`) { + state = 1 /* inSingleQuoteString */; + } else if (char === `"`) { + state = 2 /* inDoubleQuoteString */; + } else if (char === `(`) { + parenDepth++; + } else if (char === `)`) { + if (parenDepth > 0) { + parenDepth--; + } else { + return i; + } + } + break; + case 1 /* inSingleQuoteString */: + if (char === `'`) { + state = 0 /* inParens */; + } + break; + case 2 /* inDoubleQuoteString */: + if (char === `"`) { + state = 0 /* inParens */; + } + break; + } + } + return null; +} +const cssVarsPlugin = (opts) => { + const { id, isProd } = opts; + return { + postcssPlugin: "vue-sfc-vars", + Declaration(decl) { + const value = decl.value; + if (vBindRE.test(value)) { + vBindRE.lastIndex = 0; + let transformed = ""; + let lastIndex = 0; + let match; + while (match = vBindRE.exec(value)) { + const start = match.index + match[0].length; + const end = lexBinding(value, start); + if (end !== null) { + const variable = normalizeExpression(value.slice(start, end)); + transformed += value.slice(lastIndex, match.index) + `var(--${genVarName(id, variable, isProd)})`; + lastIndex = end + 1; + } + } + decl.value = transformed + value.slice(lastIndex); + } + } + }; +}; +cssVarsPlugin.postcss = true; +function genCssVarsCode(vars, bindings, id, isProd) { + const varsExp = genCssVarsFromList(vars, id, isProd); + const exp = createSimpleExpression(varsExp, false); + const context = createTransformContext(createRoot([]), { + prefixIdentifiers: true, + inline: true, + bindingMetadata: bindings.__isScriptSetup === false ? void 0 : bindings + }); + const transformed = processExpression(exp, context); + const transformedString = transformed.type === 4 ? transformed.content : transformed.children.map((c) => { + return typeof c === "string" ? c : c.content; + }).join(""); + return `_${CSS_VARS_HELPER}(_ctx => (${transformedString}))`; +} +function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd, defaultVar) { + return ` +import { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue' +const __injectCSSVars__ = () => { +${genCssVarsCode( + cssVars, + bindings, + id, + isProd + )}} +const __setup__ = ${defaultVar}.setup +${defaultVar}.setup = __setup__ + ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) } + : __injectCSSVars__ +`; +} + +var global$1 = (typeof global !== "undefined" ? global : + typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : {}); + +// shim for using process in browser +// based off https://github.com/defunctzombie/node-process/blob/master/browser.js + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +var cachedSetTimeout = defaultSetTimout; +var cachedClearTimeout = defaultClearTimeout; +if (typeof global$1.setTimeout === 'function') { + cachedSetTimeout = setTimeout; +} +if (typeof global$1.clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; +} + +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} +function nextTick(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +} +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +var title = 'browser'; +var platform = 'browser'; +var browser = true; +var env = {}; +var argv = []; +var version$1 = ''; // empty string to avoid regexp issues +var versions = {}; +var release = {}; +var config = {}; + +function noop() {} + +var on = noop; +var addListener = noop; +var once = noop; +var off = noop; +var removeListener = noop; +var removeAllListeners = noop; +var emit = noop; + +function binding(name) { + throw new Error('process.binding is not supported'); +} + +function cwd () { return '/' } +function chdir (dir) { + throw new Error('process.chdir is not supported'); +}function umask() { return 0; } + +// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js +var performance = global$1.performance || {}; +var performanceNow = + performance.now || + performance.mozNow || + performance.msNow || + performance.oNow || + performance.webkitNow || + function(){ return (new Date()).getTime() }; + +// generate timestamp or delta +// see http://nodejs.org/api/process.html#process_process_hrtime +function hrtime(previousTimestamp){ + var clocktime = performanceNow.call(performance)*1e-3; + var seconds = Math.floor(clocktime); + var nanoseconds = Math.floor((clocktime%1)*1e9); + if (previousTimestamp) { + seconds = seconds - previousTimestamp[0]; + nanoseconds = nanoseconds - previousTimestamp[1]; + if (nanoseconds<0) { + seconds--; + nanoseconds += 1e9; + } + } + return [seconds,nanoseconds] +} + +var startTime = new Date(); +function uptime() { + var currentTime = new Date(); + var dif = currentTime - startTime; + return dif / 1000; +} + +var browser$1 = { + nextTick: nextTick, + title: title, + browser: browser, + env: env, + argv: argv, + version: version$1, + versions: versions, + on: on, + addListener: addListener, + once: once, + off: off, + removeListener: removeListener, + removeAllListeners: removeAllListeners, + emit: emit, + binding: binding, + cwd: cwd, + chdir: chdir, + umask: umask, + hrtime: hrtime, + platform: platform, + release: release, + config: config, + uptime: uptime +}; + +function createCache(max = 500) { + { + return /* @__PURE__ */ new Map(); + } +} + +function isImportUsed(local, sfc) { + return resolveTemplateUsedIdentifiers(sfc).has(local); +} +const templateUsageCheckCache = createCache(); +function resolveTemplateUsedIdentifiers(sfc) { + const { content, ast } = sfc.template; + const cached = templateUsageCheckCache.get(content); + if (cached) { + return cached; + } + const ids = /* @__PURE__ */ new Set(); + ast.children.forEach(walk); + function walk(node) { + var _a; + switch (node.type) { + case 1: + let tag = node.tag; + if (tag.includes(".")) tag = tag.split(".")[0].trim(); + if (!parserOptions.isNativeTag(tag) && !parserOptions.isBuiltInComponent(tag)) { + ids.add(camelize(tag)); + ids.add(capitalize(camelize(tag))); + } + for (let i = 0; i < node.props.length; i++) { + const prop = node.props[i]; + if (prop.type === 7) { + if (!isBuiltInDirective(prop.name)) { + ids.add(`v${capitalize(camelize(prop.name))}`); + } + if (prop.arg && !prop.arg.isStatic) { + extractIdentifiers(ids, prop.arg); + } + if (prop.name === "for") { + extractIdentifiers(ids, prop.forParseResult.source); + } else if (prop.exp) { + extractIdentifiers(ids, prop.exp); + } else if (prop.name === "bind" && !prop.exp) { + ids.add(camelize(prop.arg.content)); + } + } + if (prop.type === 6 && prop.name === "ref" && ((_a = prop.value) == null ? void 0 : _a.content)) { + ids.add(prop.value.content); + } + } + node.children.forEach(walk); + break; + case 5: + extractIdentifiers(ids, node.content); + break; + } + } + templateUsageCheckCache.set(content, ids); + return ids; +} +function extractIdentifiers(ids, node) { + if (node.ast) { + walkIdentifiers(node.ast, (n) => ids.add(n.name)); + } else if (node.ast === null) { + ids.add(node.content); + } +} + +var __defProp$a = Object.defineProperty; +var __defProps$9 = Object.defineProperties; +var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$a = Object.getOwnPropertySymbols; +var __hasOwnProp$a = Object.prototype.hasOwnProperty; +var __propIsEnum$a = Object.prototype.propertyIsEnumerable; +var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$a = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$a.call(b, prop)) + __defNormalProp$a(a, prop, b[prop]); + if (__getOwnPropSymbols$a) + for (var prop of __getOwnPropSymbols$a(b)) { + if (__propIsEnum$a.call(b, prop)) + __defNormalProp$a(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b)); +const DEFAULT_FILENAME = "anonymous.vue"; +const parseCache$1 = createCache(); +function parse$2(source, options = {}) { + var _a; + const sourceKey = genCacheKey(source, __spreadProps$9(__spreadValues$a({}, options), { + compiler: { parse: (_a = options.compiler) == null ? void 0 : _a.parse } + })); + const cache = parseCache$1.get(sourceKey); + if (cache) { + return cache; + } + const { + sourceMap = true, + filename = DEFAULT_FILENAME, + sourceRoot = "", + pad = false, + ignoreEmpty = true, + compiler = CompilerDOM, + templateParseOptions = {} + } = options; + const descriptor = { + filename, + source, + template: null, + script: null, + scriptSetup: null, + styles: [], + customBlocks: [], + cssVars: [], + slotted: false, + shouldForceReload: (prevImports) => hmrShouldReload(prevImports, descriptor) + }; + const errors = []; + const ast = compiler.parse(source, __spreadProps$9(__spreadValues$a({ + parseMode: "sfc", + prefixIdentifiers: true + }, templateParseOptions), { + onError: (e) => { + errors.push(e); + } + })); + ast.children.forEach((node) => { + if (node.type !== 1) { + return; + } + if (ignoreEmpty && node.tag !== "template" && isEmpty(node) && !hasSrc(node)) { + return; + } + switch (node.tag) { + case "template": + if (!descriptor.template) { + const templateBlock = descriptor.template = createBlock( + node, + source, + false + ); + if (!templateBlock.attrs.src) { + templateBlock.ast = createRoot(node.children, source); + } + if (templateBlock.attrs.functional) { + const err = new SyntaxError( + `<template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.` + ); + err.loc = node.props.find( + (p) => p.type === 6 && p.name === "functional" + ).loc; + errors.push(err); + } + } else { + errors.push(createDuplicateBlockError(node)); + } + break; + case "script": + const scriptBlock = createBlock(node, source, pad); + const isSetup = !!scriptBlock.attrs.setup; + if (isSetup && !descriptor.scriptSetup) { + descriptor.scriptSetup = scriptBlock; + break; + } + if (!isSetup && !descriptor.script) { + descriptor.script = scriptBlock; + break; + } + errors.push(createDuplicateBlockError(node, isSetup)); + break; + case "style": + const styleBlock = createBlock(node, source, pad); + if (styleBlock.attrs.vars) { + errors.push( + new SyntaxError( + `<style vars> has been replaced by a new proposal: https://github.com/vuejs/rfcs/pull/231` + ) + ); + } + descriptor.styles.push(styleBlock); + break; + default: + descriptor.customBlocks.push(createBlock(node, source, pad)); + break; + } + }); + if (!descriptor.template && !descriptor.script && !descriptor.scriptSetup) { + errors.push( + new SyntaxError( + `At least one <template> or <script> is required in a single file component. ${descriptor.filename}` + ) + ); + } + if (descriptor.scriptSetup) { + if (descriptor.scriptSetup.src) { + errors.push( + new SyntaxError( + `<script setup> cannot use the "src" attribute because its syntax will be ambiguous outside of the component.` + ) + ); + descriptor.scriptSetup = null; + } + if (descriptor.script && descriptor.script.src) { + errors.push( + new SyntaxError( + `<script> cannot use the "src" attribute when <script setup> is also present because they must be processed together.` + ) + ); + descriptor.script = null; + } + } + let templateColumnOffset = 0; + if (descriptor.template && (descriptor.template.lang === "pug" || descriptor.template.lang === "jade")) { + [descriptor.template.content, templateColumnOffset] = dedent( + descriptor.template.content + ); + } + if (sourceMap) { + const genMap = (block, columnOffset = 0) => { + if (block && !block.src) { + block.map = generateSourceMap( + filename, + source, + block.content, + sourceRoot, + !pad || block.type === "template" ? block.loc.start.line - 1 : 0, + columnOffset + ); + } + }; + genMap(descriptor.template, templateColumnOffset); + genMap(descriptor.script); + descriptor.styles.forEach((s) => genMap(s)); + descriptor.customBlocks.forEach((s) => genMap(s)); + } + descriptor.cssVars = parseCssVars(descriptor); + const slottedRE = /(?:::v-|:)slotted\(/; + descriptor.slotted = descriptor.styles.some( + (s) => s.scoped && slottedRE.test(s.content) + ); + const result = { + descriptor, + errors + }; + parseCache$1.set(sourceKey, result); + return result; +} +function createDuplicateBlockError(node, isScriptSetup = false) { + const err = new SyntaxError( + `Single file component can contain only one <${node.tag}${isScriptSetup ? ` setup` : ``}> element` + ); + err.loc = node.loc; + return err; +} +function createBlock(node, source, pad) { + const type = node.tag; + const loc = node.innerLoc; + const attrs = {}; + const block = { + type, + content: source.slice(loc.start.offset, loc.end.offset), + loc, + attrs + }; + if (pad) { + block.content = padContent(source, block, pad) + block.content; + } + node.props.forEach((p) => { + if (p.type === 6) { + const name = p.name; + attrs[name] = p.value ? p.value.content || true : true; + if (name === "lang") { + block.lang = p.value && p.value.content; + } else if (name === "src") { + block.src = p.value && p.value.content; + } else if (type === "style") { + if (name === "scoped") { + block.scoped = true; + } else if (name === "module") { + block.module = attrs[name]; + } + } else if (type === "script" && name === "setup") { + block.setup = attrs.setup; + } + } + }); + return block; +} +const splitRE = /\r?\n/g; +const emptyRE = /^(?:\/\/)?\s*$/; +const replaceRE = /./g; +function generateSourceMap(filename, source, generated, sourceRoot, lineOffset, columnOffset) { + const map = new sourceMapExports.SourceMapGenerator({ + file: filename.replace(/\\/g, "/"), + sourceRoot: sourceRoot.replace(/\\/g, "/") + }); + map.setSourceContent(filename, source); + map._sources.add(filename); + generated.split(splitRE).forEach((line, index) => { + if (!emptyRE.test(line)) { + const originalLine = index + 1 + lineOffset; + const generatedLine = index + 1; + for (let i = 0; i < line.length; i++) { + if (!/\s/.test(line[i])) { + map._mappings.add({ + originalLine, + originalColumn: i + columnOffset, + generatedLine, + generatedColumn: i, + source: filename, + name: null + }); + } + } + } + }); + return map.toJSON(); +} +function padContent(content, block, pad) { + content = content.slice(0, block.loc.start.offset); + if (pad === "space") { + return content.replace(replaceRE, " "); + } else { + const offset = content.split(splitRE).length; + const padChar = block.type === "script" && !block.lang ? "//\n" : "\n"; + return Array(offset).join(padChar); + } +} +function hasSrc(node) { + return node.props.some((p) => { + if (p.type !== 6) { + return false; + } + return p.name === "src"; + }); +} +function isEmpty(node) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (child.type !== 2 || child.content.trim() !== "") { + return false; + } + } + return true; +} +function hmrShouldReload(prevImports, next) { + if (!next.scriptSetup || next.scriptSetup.lang !== "ts" && next.scriptSetup.lang !== "tsx") { + return false; + } + for (const key in prevImports) { + if (!prevImports[key].isUsedInTemplate && isImportUsed(key, next)) { + return true; + } + } + return false; +} +function dedent(s) { + const lines = s.split("\n"); + const minIndent = lines.reduce(function(minIndent2, line) { + var _a, _b; + if (line.trim() === "") { + return minIndent2; + } + const indent = ((_b = (_a = line.match(/^\s*/)) == null ? void 0 : _a[0]) == null ? void 0 : _b.length) || 0; + return Math.min(indent, minIndent2); + }, Infinity); + if (minIndent === 0) { + return [s, minIndent]; + } + return [ + lines.map(function(line) { + return line.slice(minIndent); + }).join("\n"), + minIndent + ]; +} + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +function resolve() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : '/'; + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +} +// path.normalize(path) +// posix version +function normalize$1(path) { + var isPathAbsolute = isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isPathAbsolute).join('/'); + + if (!path && !isPathAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isPathAbsolute ? '/' : '') + path; +} +// posix version +function isAbsolute(path) { + return path.charAt(0) === '/'; +} + +// posix version +function join() { + var paths = Array.prototype.slice.call(arguments, 0); + return normalize$1(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +} + + +// path.relative(from, to) +// posix version +function relative(from, to) { + from = resolve(from).substr(1); + to = resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +} + +var sep = '/'; +var delimiter$1 = ':'; + +function dirname(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +} + +function basename(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +} + + +function extname(path) { + return splitPath(path)[3]; +} +var path = { + extname: extname, + basename: basename, + dirname: dirname, + sep: sep, + delimiter: delimiter$1, + relative: relative, + join: join, + isAbsolute: isAbsolute, + normalize: normalize$1, + resolve: resolve +}; +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' ? + function (str, start, len) { return str.substr(start, len) } : + function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +var _polyfillNode_path = /*#__PURE__*/Object.freeze({ + __proto__: null, + basename: basename, + default: path, + delimiter: delimiter$1, + dirname: dirname, + extname: extname, + isAbsolute: isAbsolute, + join: join, + normalize: normalize$1, + relative: relative, + resolve: resolve, + sep: sep +}); + +/*! https://mths.be/punycode v1.4.1 by @mathias */ + + +/** Highest positive signed 32-bit float value */ +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' +var regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map$1(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map$1(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see <https://mathiasbynens.be/notes/javascript-encoding> + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +} + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for ( /* no initialization */ ; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +} + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +function encode$1(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */ ; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +} + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) ? + 'xn--' + encode$1(string) : + string; + }); +} + +var lookup = []; +var revLookup = []; +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; +var inited = false; +function init () { + inited = true; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; +} + +function toByteArray (b64) { + if (!inited) { + init(); + } + var i, j, l, tmp, placeHolders, arr; + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(len * 3 / 4 - placeHolders); + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len; + + var L = 0; + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]; + arr[L++] = (tmp >> 16) & 0xFF; + arr[L++] = (tmp >> 8) & 0xFF; + arr[L++] = tmp & 0xFF; + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4); + arr[L++] = tmp & 0xFF; + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2); + arr[L++] = (tmp >> 8) & 0xFF; + arr[L++] = tmp & 0xFF; + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); + output.push(tripletToBase64(tmp)); + } + return output.join('') +} + +function fromByteArray (uint8) { + if (!inited) { + init(); + } + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var output = ''; + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1]; + output += lookup[tmp >> 2]; + output += lookup[(tmp << 4) & 0x3F]; + output += '=='; + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); + output += lookup[tmp >> 10]; + output += lookup[(tmp >> 4) & 0x3F]; + output += lookup[(tmp << 2) & 0x3F]; + output += '='; + } + + parts.push(output); + + return parts.join('') +} + +function read (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? (nBytes - 1) : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +function write (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); + var i = isLE ? 0 : (nBytes - 1); + var d = isLE ? 1 : -1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; +} + +var toString$1 = {}.toString; + +var isArray$2 = Array.isArray || function (arr) { + return toString$1.call(arr) == '[object Array]'; +}; + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> + * @license MIT + */ +/* eslint-disable no-proto */ + + +var INSPECT_MAX_BYTES = 50; + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer$1.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined + ? global$1.TYPED_ARRAY_SUPPORT + : true; + +/* + * Export kMaxLength after typed array support is determined. + */ +kMaxLength(); + +function kMaxLength () { + return Buffer$1.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length); + that.__proto__ = Buffer$1.prototype; + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer$1(length); + } + that.length = length; + } + + return that +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer$1 (arg, encodingOrOffset, length) { + if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) { + return new Buffer$1(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} + +Buffer$1.poolSize = 8192; // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer$1._augment = function (arr) { + arr.__proto__ = Buffer$1.prototype; + return arr +}; + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer$1.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +}; + +if (Buffer$1.TYPED_ARRAY_SUPPORT) { + Buffer$1.prototype.__proto__ = Uint8Array.prototype; + Buffer$1.__proto__ = Uint8Array; + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer$1[Symbol.species] === Buffer$1) ; +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer$1.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +}; + +function allocUnsafe (that, size) { + assertSize(size); + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); + if (!Buffer$1.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0; + } + } + return that +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer$1.allocUnsafe = function (size) { + return allocUnsafe(null, size) +}; +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer$1.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +}; + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer$1.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0; + that = createBuffer(that, length); + + var actual = that.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual); + } + + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + that = createBuffer(that, length); + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255; + } + return that +} + +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength; // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array); + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset); + } else { + array = new Uint8Array(array, byteOffset, length); + } + + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array; + that.__proto__ = Buffer$1.prototype; + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array); + } + return that +} + +function fromObject (that, obj) { + if (internalIsBuffer(obj)) { + var len = checked(obj.length) | 0; + that = createBuffer(that, len); + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len); + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray$2(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} +Buffer$1.isBuffer = isBuffer$1; +function internalIsBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer$1.compare = function compare (a, b) { + if (!internalIsBuffer(a) || !internalIsBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +}; + +Buffer$1.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +}; + +Buffer$1.concat = function concat (list, length) { + if (!isArray$2(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer$1.alloc(0) + } + + var i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer$1.allocUnsafe(length); + var pos = 0; + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + if (!internalIsBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos); + pos += buf.length; + } + return buffer +}; + +function byteLength (string, encoding) { + if (internalIsBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string; + } + + var len = string.length; + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false; + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } +} +Buffer$1.byteLength = byteLength; + +function slowToString (encoding, start, end) { + var loweredCase = false; + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } +} + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer$1.prototype._isBuffer = true; + +function swap (b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; +} + +Buffer$1.prototype.swap16 = function swap16 () { + var len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this +}; + +Buffer$1.prototype.swap32 = function swap32 () { + var len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this +}; + +Buffer$1.prototype.swap64 = function swap64 () { + var len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this +}; + +Buffer$1.prototype.toString = function toString () { + var length = this.length | 0; + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +}; + +Buffer$1.prototype.equals = function equals (b) { + if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer$1.compare(this, b) === 0 +}; + +Buffer$1.prototype.inspect = function inspect () { + var str = ''; + var max = INSPECT_MAX_BYTES; + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); + if (this.length > max) str += ' ... '; + } + return '<Buffer ' + str + '>' +}; + +Buffer$1.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!internalIsBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + + if (this === target) return 0 + + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +}; + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + byteOffset = +byteOffset; // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1); + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer$1.from(val, encoding); + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (internalIsBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + if (Buffer$1.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i; + if (dir) { + var foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + var found = true; + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer$1.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +}; + +Buffer$1.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +}; + +Buffer$1.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +}; + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + + // must be an even number of digits + var strLen = string.length; + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (isNaN(parsed)) return i + buf[offset + i] = parsed; + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer$1.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0; + if (isFinite(length)) { + length = length | 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8'; + + var loweredCase = false; + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } +}; + +Buffer$1.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +}; + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return fromByteArray(buf) + } else { + return fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + + var i = start; + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + break + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + break + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + break + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000; + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = ''; + var i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ); + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + var out = ''; + for (var i = start; i < end; ++i) { + out += toHex(buf[i]); + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res +} + +Buffer$1.prototype.slice = function slice (start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + + var newBuf; + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end); + newBuf.__proto__ = Buffer$1.prototype; + } else { + var sliceLen = end - start; + newBuf = new Buffer$1(sliceLen, undefined); + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start]; + } + } + + return newBuf +}; + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer$1.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val +}; + +Buffer$1.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val +}; + +Buffer$1.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset] +}; + +Buffer$1.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | (this[offset + 1] << 8) +}; + +Buffer$1.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length); + return (this[offset] << 8) | this[offset + 1] +}; + +Buffer$1.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +}; + +Buffer$1.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +}; + +Buffer$1.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val +}; + +Buffer$1.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val +}; + +Buffer$1.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +}; + +Buffer$1.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | (this[offset + 1] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val +}; + +Buffer$1.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | (this[offset] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val +}; + +Buffer$1.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +}; + +Buffer$1.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +}; + +Buffer$1.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + return read(this, offset, true, 23, 4) +}; + +Buffer$1.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length); + return read(this, offset, false, 23, 4) +}; + +Buffer$1.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length); + return read(this, offset, true, 52, 8) +}; + +Buffer$1.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length); + return read(this, offset, false, 52, 8) +}; + +function checkInt (buf, value, offset, ext, max, min) { + if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer$1.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength +}; + +Buffer$1.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset | 0; + byteLength = byteLength | 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength +}; + +Buffer$1.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value); + this[offset] = (value & 0xff); + return offset + 1 +}; + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1; + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8; + } +} + +Buffer$1.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + } else { + objectWriteUInt16(this, value, offset, true); + } + return offset + 2 +}; + +Buffer$1.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + } else { + objectWriteUInt16(this, value, offset, false); + } + return offset + 2 +}; + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1; + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; + } +} + +Buffer$1.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24); + this[offset + 2] = (value >>> 16); + this[offset + 1] = (value >>> 8); + this[offset] = (value & 0xff); + } else { + objectWriteUInt32(this, value, offset, true); + } + return offset + 4 +}; + +Buffer$1.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + } else { + objectWriteUInt32(this, value, offset, false); + } + return offset + 4 +}; + +Buffer$1.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength +}; + +Buffer$1.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength +}; + +Buffer$1.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value); + if (value < 0) value = 0xff + value + 1; + this[offset] = (value & 0xff); + return offset + 1 +}; + +Buffer$1.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + } else { + objectWriteUInt16(this, value, offset, true); + } + return offset + 2 +}; + +Buffer$1.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + } else { + objectWriteUInt16(this, value, offset, false); + } + return offset + 2 +}; + +Buffer$1.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + this[offset + 2] = (value >>> 16); + this[offset + 3] = (value >>> 24); + } else { + objectWriteUInt32(this, value, offset, true); + } + return offset + 4 +}; + +Buffer$1.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value; + offset = offset | 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + if (Buffer$1.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + } else { + objectWriteUInt32(this, value, offset, false); + } + return offset + 4 +}; + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + write(buf, value, offset, littleEndian, 23, 4); + return offset + 4 +} + +Buffer$1.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +}; + +Buffer$1.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +}; + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + write(buf, value, offset, littleEndian, 52, 8); + return offset + 8 +} + +Buffer$1.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +}; + +Buffer$1.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +}; + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer$1.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + var i; + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start]; + } + } else if (len < 1000 || !Buffer$1.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start]; + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ); + } + + return len +}; + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer$1.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if (code < 256) { + val = code; + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer$1.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255; + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + + if (!val) val = 0; + + var i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = internalIsBuffer(val) + ? val + : utf8ToBytes(new Buffer$1(val, encoding).toString()); + var len = bytes.length; + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this +}; + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } + + // valid lead + leadSurrogate = codePoint; + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo; + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray +} + + +function base64ToBytes (str) { + return toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i]; + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + + +// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +function isBuffer$1(obj) { + return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj)) +} + +function isFastBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0)) +} + +var inherits; +if (typeof Object.create === 'function'){ + inherits = function inherits(ctor, superCtor) { + // implementation from standard node.js 'util' module + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + inherits = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + }; +} + +var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || + function getOwnPropertyDescriptors(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + return descriptors; + }; + +var formatRegExp = /%[sdj%]/g; +function format$1(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject$1(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +} + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +function deprecate(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global$1.process)) { + return function() { + return deprecate(fn, msg).apply(this, arguments); + }; + } + + if (browser$1.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (browser$1.throwDeprecation) { + throw new Error(msg); + } else if (browser$1.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +var debugs = {}; +var debugEnviron; +function debuglog(set) { + if (isUndefined(debugEnviron)) + debugEnviron = browser$1.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = 0; + debugs[set] = function() { + var msg = format$1.apply(null, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +} + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + _extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray$1(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty$2(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty$2(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var length = output.reduce(function(prev, cur) { + if (cur.indexOf('\n') >= 0) ; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray$1(ar) { + return Array.isArray(ar); +} + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} + +function isNull(arg) { + return arg === null; +} + +function isNullOrUndefined(arg) { + return arg == null; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isString(arg) { + return typeof arg === 'string'; +} + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} + +function isUndefined(arg) { + return arg === void 0; +} + +function isRegExp(re) { + return isObject$1(re) && objectToString(re) === '[object RegExp]'; +} + +function isObject$1(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isDate(d) { + return isObject$1(d) && objectToString(d) === '[object Date]'; +} + +function isError(e) { + return isObject$1(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} + +function isBuffer(maybeBuf) { + return Buffer$1.isBuffer(maybeBuf); +} + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +function log() { + console.log('%s - %s', timestamp(), format$1.apply(null, arguments)); +} + +function _extend(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject$1(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +} +function hasOwnProperty$2(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; + +function promisify(original) { + if (typeof original !== 'function') + throw new TypeError('The "original" argument must be of type Function'); + + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== 'function') { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return fn; + } + + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + args.push(function (err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + + return promise; + } + + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return Object.defineProperties( + fn, + getOwnPropertyDescriptors(original) + ); +} + +promisify.custom = kCustomPromisifiedSymbol; + +function callbackifyOnRejected(reason, cb) { + // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). + // Because `null` is a special error value in callbacks which means "no error + // occurred", we error-wrap so the callback consumer can distinguish between + // "the promise rejected with null" or "the promise fulfilled with undefined". + if (!reason) { + var newReason = new Error('Promise was rejected with a falsy value'); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); +} + +function callbackify(original) { + if (typeof original !== 'function') { + throw new TypeError('The "original" argument must be of type Function'); + } + + // We DO NOT return the promise as it gives the user a false sense that + // the promise is actually somehow related to the callback's execution + // and that the callback throwing will reject the promise. + function callbackified() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var maybeCb = args.pop(); + if (typeof maybeCb !== 'function') { + throw new TypeError('The last argument must be of type Function'); + } + var self = this; + var cb = function() { + return maybeCb.apply(self, arguments); + }; + // In true node style we process the callback on `nextTick` with all the + // implications (stack, `uncaughtException`, `async_hooks`) + original.apply(this, args) + .then(function(ret) { browser$1.nextTick(cb.bind(null, null, ret)); }, + function(rej) { browser$1.nextTick(callbackifyOnRejected.bind(null, rej, cb)); }); + } + + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); + return callbackified; +} + +var _polyfillNode_util = { + inherits: inherits, + _extend: _extend, + log: log, + isBuffer: isBuffer, + isPrimitive: isPrimitive, + isFunction: isFunction, + isError: isError, + isDate: isDate, + isObject: isObject$1, + isRegExp: isRegExp, + isUndefined: isUndefined, + isSymbol: isSymbol, + isString: isString, + isNumber: isNumber, + isNullOrUndefined: isNullOrUndefined, + isNull: isNull, + isBoolean: isBoolean, + isArray: isArray$1, + inspect: inspect, + deprecate: deprecate, + format: format$1, + debuglog: debuglog, + promisify: promisify, + callbackify: callbackify, +}; + +var _polyfillNode_util$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + _extend: _extend, + callbackify: callbackify, + debuglog: debuglog, + default: _polyfillNode_util, + deprecate: deprecate, + format: format$1, + inherits: inherits, + inspect: inspect, + isArray: isArray$1, + isBoolean: isBoolean, + isBuffer: isBuffer, + isDate: isDate, + isError: isError, + isFunction: isFunction, + isNull: isNull, + isNullOrUndefined: isNullOrUndefined, + isNumber: isNumber, + isObject: isObject$1, + isPrimitive: isPrimitive, + isRegExp: isRegExp, + isString: isString, + isSymbol: isSymbol, + isUndefined: isUndefined, + log: log, + promisify: promisify +}); + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty$1(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; +function stringifyPrimitive(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +} + +function stringify (obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +} +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + +function parse$1(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty$1(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +} + +// WHATWG API +const URL$1 = global$1.URL; +const URLSearchParams = global$1.URLSearchParams; +var _polyfillNode_url = { + parse: urlParse, + resolve: urlResolve, + resolveObject: urlResolveObject, + fileURLToPath: urlFileURLToPath, + format: urlFormat, + Url: Url, + + // WHATWG API + URL: URL$1, + URLSearchParams, +}; +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }; + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && isObject$1(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + return parse(this, url, parseQueryString, slashesDenoteHost); +}; + +function parse(self, url, parseQueryString, slashesDenoteHost) { + if (!isString(url)) { + throw new TypeError('Parameter \'url\' must be a string, not ' + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + self.path = rest; + self.href = rest; + self.pathname = simplePath[1]; + if (simplePath[2]) { + self.search = simplePath[2]; + if (parseQueryString) { + self.query = parse$1(self.search.substr(1)); + } else { + self.query = self.search.substr(1); + } + } else if (parseQueryString) { + self.search = ''; + self.query = {}; + } + return self; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + self.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + self.slashes = true; + } + } + var i, hec, l, p; + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (i = 0; i < hostEndingChars.length; i++) { + hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + self.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (i = 0; i < nonHostChars.length; i++) { + hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + self.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + parseHost(self); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + self.hostname = self.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = self.hostname[0] === '[' && + self.hostname[self.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = self.hostname.split(/\./); + for (i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + self.hostname = validParts.join('.'); + break; + } + } + } + } + + if (self.hostname.length > hostnameMaxLen) { + self.hostname = ''; + } else { + // hostnames are always lower case. + self.hostname = self.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + self.hostname = toASCII(self.hostname); + } + + p = self.port ? ':' + self.port : ''; + var h = self.hostname || ''; + self.host = h + p; + self.href += self.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + self.hostname = self.hostname.substr(1, self.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + self.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + self.search = rest.substr(qm); + self.query = rest.substr(qm + 1); + if (parseQueryString) { + self.query = parse$1(self.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + self.search = ''; + self.query = {}; + } + if (rest) self.pathname = rest; + if (slashedProtocol[lowerProto] && + self.hostname && !self.pathname) { + self.pathname = '/'; + } + + //to support http.request + if (self.pathname || self.search) { + p = self.pathname || ''; + var s = self.search || ''; + self.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + self.href = format(self); + return self; +} + +function urlFileURLToPath(path) { + if (typeof path === 'string') + path = new Url().parse(path); + else if (!(path instanceof Url)) + throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type ' + (typeof path) + String(path)); + if (path.protocol !== 'file:') + throw new TypeError('The URL must be of scheme file'); + return getPathFromURLPosix(path); +} + +function getPathFromURLPosix(url) { + const pathname = url.pathname; + for (let n = 0; n < pathname.length; n++) { + if (pathname[n] === '%') { + const third = pathname.codePointAt(n + 2) | 0x20; + if (pathname[n + 1] === '2' && third === 102) { + throw new TypeError( + 'must not include encoded / characters' + ); + } + } + } + return decodeURIComponent(pathname); +} + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (isString(obj)) obj = parse({}, obj); + return format(obj); +} + +function format(self) { + var auth = self.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = self.protocol || '', + pathname = self.pathname || '', + hash = self.hash || '', + host = false, + query = ''; + + if (self.host) { + host = auth + self.host; + } else if (self.hostname) { + host = auth + (self.hostname.indexOf(':') === -1 ? + self.hostname : + '[' + this.hostname + ']'); + if (self.port) { + host += ':' + self.port; + } + } + + if (self.query && + isObject$1(self.query) && + Object.keys(self.query).length) { + query = stringify(self.query); + } + + var search = self.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (self.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +} + +Url.prototype.format = function() { + return format(this); +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + var relPath; + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + relPath = relative.pathname && relative.pathname.split('/') || []; + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + var authInHost; + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + return parseHost(this); +}; + +function parseHost(self) { + var host = self.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + self.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) self.hostname = host; +} + +var _polyfillNode_url$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + URL: URL$1, + URLSearchParams: URLSearchParams, + Url: Url, + default: _polyfillNode_url, + fileURLToPath: urlFileURLToPath, + format: urlFormat, + parse: urlParse, + resolve: urlResolve, + resolveObject: urlResolveObject +}); + +function isRelativeUrl(url) { + const firstChar = url.charAt(0); + return firstChar === "." || firstChar === "~" || firstChar === "@"; +} +const externalRE = /^(https?:)?\/\//; +function isExternalUrl(url) { + return externalRE.test(url); +} +const dataUrlRE = /^\s*data:/i; +function isDataUrl(url) { + return dataUrlRE.test(url); +} +function parseUrl(url) { + const firstChar = url.charAt(0); + if (firstChar === "~") { + const secondChar = url.charAt(1); + url = url.slice(secondChar === "/" ? 2 : 1); + } + return parseUriParts(url); +} +function parseUriParts(urlString) { + return urlParse(isString$1(urlString) ? urlString : "", false, true); +} + +var __defProp$9 = Object.defineProperty; +var __defProps$8 = Object.defineProperties; +var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols; +var __hasOwnProp$9 = Object.prototype.hasOwnProperty; +var __propIsEnum$9 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$9 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$9.call(b, prop)) + __defNormalProp$9(a, prop, b[prop]); + if (__getOwnPropSymbols$9) + for (var prop of __getOwnPropSymbols$9(b)) { + if (__propIsEnum$9.call(b, prop)) + __defNormalProp$9(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b)); +const defaultAssetUrlOptions = { + base: null, + includeAbsolute: false, + tags: { + video: ["src", "poster"], + source: ["src"], + img: ["src"], + image: ["xlink:href", "href"], + use: ["xlink:href", "href"] + } +}; +const normalizeOptions = (options) => { + if (Object.keys(options).some((key) => isArray$3(options[key]))) { + return __spreadProps$8(__spreadValues$9({}, defaultAssetUrlOptions), { + tags: options + }); + } + return __spreadValues$9(__spreadValues$9({}, defaultAssetUrlOptions), options); +}; +const createAssetUrlTransformWithOptions = (options) => { + return (node, context) => transformAssetUrl(node, context, options); +}; +const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => { + if (node.type === 1) { + if (!node.props.length) { + return; + } + const tags = options.tags || defaultAssetUrlOptions.tags; + const attrs = tags[node.tag]; + const wildCardAttrs = tags["*"]; + if (!attrs && !wildCardAttrs) { + return; + } + const assetAttrs = (attrs || []).concat(wildCardAttrs || []); + node.props.forEach((attr, index) => { + if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value || isExternalUrl(attr.value.content) || isDataUrl(attr.value.content) || attr.value.content[0] === "#" || !options.includeAbsolute && !isRelativeUrl(attr.value.content)) { + return; + } + const url = parseUrl(attr.value.content); + if (options.base && attr.value.content[0] === ".") { + const base = parseUrl(options.base); + const protocol = base.protocol || ""; + const host = base.host ? protocol + "//" + base.host : ""; + const basePath = base.path || "/"; + attr.value.content = host + (path.posix || path).join(basePath, url.path + (url.hash || "")); + return; + } + const exp = getImportsExpressionExp(url.path, url.hash, attr.loc, context); + node.props[index] = { + type: 7, + name: "bind", + arg: createSimpleExpression(attr.name, true, attr.loc), + exp, + modifiers: [], + loc: attr.loc + }; + }); + } +}; +function getImportsExpressionExp(path2, hash, loc, context) { + if (path2) { + let name; + let exp; + const existingIndex = context.imports.findIndex((i) => i.path === path2); + if (existingIndex > -1) { + name = `_imports_${existingIndex}`; + exp = context.imports[existingIndex].exp; + } else { + name = `_imports_${context.imports.length}`; + exp = createSimpleExpression( + name, + false, + loc, + 3 + ); + context.imports.push({ + exp, + path: decodeURIComponent(path2) + }); + } + if (!hash) { + return exp; + } + const hashExp = `${name} + '${hash}'`; + const finalExp = createSimpleExpression( + hashExp, + false, + loc, + 3 + ); + if (!context.hoistStatic) { + return finalExp; + } + const existingHoistIndex = context.hoists.findIndex((h) => { + return h && h.type === 4 && !h.isStatic && h.content === hashExp; + }); + if (existingHoistIndex > -1) { + return createSimpleExpression( + `_hoisted_${existingHoistIndex + 1}`, + false, + loc, + 3 + ); + } + return context.hoist(finalExp); + } else { + return createSimpleExpression(`''`, false, loc, 3); + } +} + +const srcsetTags = ["img", "source"]; +const escapedSpaceCharacters = /( |\\t|\\n|\\f|\\r)+/g; +const createSrcsetTransformWithOptions = (options) => { + return (node, context) => transformSrcset(node, context, options); +}; +const transformSrcset = (node, context, options = defaultAssetUrlOptions) => { + if (node.type === 1) { + if (srcsetTags.includes(node.tag) && node.props.length) { + node.props.forEach((attr, index) => { + if (attr.name === "srcset" && attr.type === 6) { + if (!attr.value) return; + const value = attr.value.content; + if (!value) return; + const imageCandidates = value.split(",").map((s) => { + const [url, descriptor] = s.replace(escapedSpaceCharacters, " ").trim().split(" ", 2); + return { url, descriptor }; + }); + for (let i = 0; i < imageCandidates.length; i++) { + const { url } = imageCandidates[i]; + if (isDataUrl(url)) { + imageCandidates[i + 1].url = url + "," + imageCandidates[i + 1].url; + imageCandidates.splice(i, 1); + } + } + const shouldProcessUrl = (url) => { + return !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url)); + }; + if (!imageCandidates.some(({ url }) => shouldProcessUrl(url))) { + return; + } + if (options.base) { + const base = options.base; + const set = []; + let needImportTransform = false; + imageCandidates.forEach((candidate) => { + let { url, descriptor } = candidate; + descriptor = descriptor ? ` ${descriptor}` : ``; + if (url[0] === ".") { + candidate.url = (path.posix || path).join(base, url); + set.push(candidate.url + descriptor); + } else if (shouldProcessUrl(url)) { + needImportTransform = true; + } else { + set.push(url + descriptor); + } + }); + if (!needImportTransform) { + attr.value.content = set.join(", "); + return; + } + } + const compoundExpression = createCompoundExpression([], attr.loc); + imageCandidates.forEach(({ url, descriptor }, index2) => { + if (shouldProcessUrl(url)) { + const { path: path2 } = parseUrl(url); + let exp2; + if (path2) { + const existingImportsIndex = context.imports.findIndex( + (i) => i.path === path2 + ); + if (existingImportsIndex > -1) { + exp2 = createSimpleExpression( + `_imports_${existingImportsIndex}`, + false, + attr.loc, + 3 + ); + } else { + exp2 = createSimpleExpression( + `_imports_${context.imports.length}`, + false, + attr.loc, + 3 + ); + context.imports.push({ exp: exp2, path: path2 }); + } + compoundExpression.children.push(exp2); + } + } else { + const exp2 = createSimpleExpression( + `"${url}"`, + false, + attr.loc, + 3 + ); + compoundExpression.children.push(exp2); + } + const isNotLast = imageCandidates.length - 1 > index2; + if (descriptor && isNotLast) { + compoundExpression.children.push(` + ' ${descriptor}, ' + `); + } else if (descriptor) { + compoundExpression.children.push(` + ' ${descriptor}'`); + } else if (isNotLast) { + compoundExpression.children.push(` + ', ' + `); + } + }); + let exp = compoundExpression; + if (context.hoistStatic) { + exp = context.hoist(compoundExpression); + exp.constType = 3; + } + node.props[index] = { + type: 7, + name: "bind", + arg: createSimpleExpression("srcset", true, attr.loc), + exp, + modifiers: [], + loc: attr.loc + }; + } + }); + } + } +}; + +const SSR_INTERPOLATE = Symbol(`ssrInterpolate`); +const SSR_RENDER_VNODE = Symbol(`ssrRenderVNode`); +const SSR_RENDER_COMPONENT = Symbol(`ssrRenderComponent`); +const SSR_RENDER_SLOT = Symbol(`ssrRenderSlot`); +const SSR_RENDER_SLOT_INNER = Symbol(`ssrRenderSlotInner`); +const SSR_RENDER_CLASS = Symbol(`ssrRenderClass`); +const SSR_RENDER_STYLE = Symbol(`ssrRenderStyle`); +const SSR_RENDER_ATTRS = Symbol(`ssrRenderAttrs`); +const SSR_RENDER_ATTR = Symbol(`ssrRenderAttr`); +const SSR_RENDER_DYNAMIC_ATTR = Symbol(`ssrRenderDynamicAttr`); +const SSR_RENDER_LIST = Symbol(`ssrRenderList`); +const SSR_INCLUDE_BOOLEAN_ATTR = Symbol( + `ssrIncludeBooleanAttr` +); +const SSR_LOOSE_EQUAL = Symbol(`ssrLooseEqual`); +const SSR_LOOSE_CONTAIN = Symbol(`ssrLooseContain`); +const SSR_RENDER_DYNAMIC_MODEL = Symbol( + `ssrRenderDynamicModel` +); +const SSR_GET_DYNAMIC_MODEL_PROPS = Symbol( + `ssrGetDynamicModelProps` +); +const SSR_RENDER_TELEPORT = Symbol(`ssrRenderTeleport`); +const SSR_RENDER_SUSPENSE = Symbol(`ssrRenderSuspense`); +const SSR_GET_DIRECTIVE_PROPS = Symbol(`ssrGetDirectiveProps`); +const ssrHelpers = { + [SSR_INTERPOLATE]: `ssrInterpolate`, + [SSR_RENDER_VNODE]: `ssrRenderVNode`, + [SSR_RENDER_COMPONENT]: `ssrRenderComponent`, + [SSR_RENDER_SLOT]: `ssrRenderSlot`, + [SSR_RENDER_SLOT_INNER]: `ssrRenderSlotInner`, + [SSR_RENDER_CLASS]: `ssrRenderClass`, + [SSR_RENDER_STYLE]: `ssrRenderStyle`, + [SSR_RENDER_ATTRS]: `ssrRenderAttrs`, + [SSR_RENDER_ATTR]: `ssrRenderAttr`, + [SSR_RENDER_DYNAMIC_ATTR]: `ssrRenderDynamicAttr`, + [SSR_RENDER_LIST]: `ssrRenderList`, + [SSR_INCLUDE_BOOLEAN_ATTR]: `ssrIncludeBooleanAttr`, + [SSR_LOOSE_EQUAL]: `ssrLooseEqual`, + [SSR_LOOSE_CONTAIN]: `ssrLooseContain`, + [SSR_RENDER_DYNAMIC_MODEL]: `ssrRenderDynamicModel`, + [SSR_GET_DYNAMIC_MODEL_PROPS]: `ssrGetDynamicModelProps`, + [SSR_RENDER_TELEPORT]: `ssrRenderTeleport`, + [SSR_RENDER_SUSPENSE]: `ssrRenderSuspense`, + [SSR_GET_DIRECTIVE_PROPS]: `ssrGetDirectiveProps` +}; +registerRuntimeHelpers(ssrHelpers); + +const ssrTransformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + processIf +); +function ssrProcessIf(node, context, disableNestedFragments = false, disableComment = false) { + const [rootBranch] = node.branches; + const ifStatement = createIfStatement( + rootBranch.condition, + processIfBranch(rootBranch, context, disableNestedFragments) + ); + context.pushStatement(ifStatement); + let currentIf = ifStatement; + for (let i = 1; i < node.branches.length; i++) { + const branch = node.branches[i]; + const branchBlockStatement = processIfBranch( + branch, + context, + disableNestedFragments + ); + if (branch.condition) { + currentIf = currentIf.alternate = createIfStatement( + branch.condition, + branchBlockStatement + ); + } else { + currentIf.alternate = branchBlockStatement; + } + } + if (!currentIf.alternate && !disableComment) { + currentIf.alternate = createBlockStatement([ + createCallExpression(`_push`, ["`<!---->`"]) + ]); + } +} +function processIfBranch(branch, context, disableNestedFragments = false) { + const { children } = branch; + const needFragmentWrapper = !disableNestedFragments && (children.length !== 1 || children[0].type !== 1) && // optimize away nested fragments when the only child is a ForNode + !(children.length === 1 && children[0].type === 11); + return processChildrenAsStatement(branch, context, needFragmentWrapper); +} + +const ssrTransformFor = createStructuralDirectiveTransform("for", processFor); +function ssrProcessFor(node, context, disableNestedFragments = false) { + const needFragmentWrapper = !disableNestedFragments && (node.children.length !== 1 || node.children[0].type !== 1); + const renderLoop = createFunctionExpression( + createForLoopParams(node.parseResult) + ); + renderLoop.body = processChildrenAsStatement( + node, + context, + needFragmentWrapper + ); + if (!disableNestedFragments) { + context.pushStringPart(`<!--[-->`); + } + context.pushStatement( + createCallExpression(context.helper(SSR_RENDER_LIST), [ + node.source, + renderLoop + ]) + ); + if (!disableNestedFragments) { + context.pushStringPart(`<!--]-->`); + } +} + +const ssrTransformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { slotName, slotProps } = processSlotOutlet(node, context); + const args = [ + `_ctx.$slots`, + slotName, + slotProps || `{}`, + // fallback content placeholder. will be replaced in the process phase + `null`, + `_push`, + `_parent` + ]; + if (context.scopeId && context.slotted !== false) { + args.push(`"${context.scopeId}-s"`); + } + let method = SSR_RENDER_SLOT; + let parent = context.parent; + if (parent) { + const children = parent.children; + if (parent.type === 10) { + parent = context.grandParent; + } + let componentType; + if (parent.type === 1 && parent.tagType === 1 && ((componentType = resolveComponentType(parent, context, true)) === TRANSITION || componentType === TRANSITION_GROUP) && children.filter((c) => c.type === 1).length === 1) { + method = SSR_RENDER_SLOT_INNER; + if (!(context.scopeId && context.slotted !== false)) { + args.push("null"); + } + args.push("true"); + } + } + node.ssrCodegenNode = createCallExpression(context.helper(method), args); + } +}; +function ssrProcessSlotOutlet(node, context) { + const renderCall = node.ssrCodegenNode; + if (node.children.length) { + const fallbackRenderFn = createFunctionExpression([]); + fallbackRenderFn.body = processChildrenAsStatement(node, context); + renderCall.arguments[3] = fallbackRenderFn; + } + if (context.withSlotScopeId) { + const slotScopeId = renderCall.arguments[6]; + renderCall.arguments[6] = slotScopeId ? `${slotScopeId} + _scopeId` : `_scopeId`; + } + context.pushStatement(node.ssrCodegenNode); +} + +function createSSRCompilerError(code, loc) { + return createCompilerError(code, loc, SSRErrorMessages); +} +const SSRErrorMessages = { + [65]: `Unsafe attribute name for SSR.`, + [66]: `Missing the 'to' prop on teleport element.`, + [67]: `Invalid AST node during SSR transform.` +}; + +function ssrProcessTeleport(node, context) { + const targetProp = findProp(node, "to"); + if (!targetProp) { + context.onError( + createSSRCompilerError(66, node.loc) + ); + return; + } + let target; + if (targetProp.type === 6) { + target = targetProp.value && createSimpleExpression(targetProp.value.content, true); + } else { + target = targetProp.exp; + } + if (!target) { + context.onError( + createSSRCompilerError( + 66, + targetProp.loc + ) + ); + return; + } + const disabledProp = findProp( + node, + "disabled", + false, + true + /* allow empty */ + ); + const disabled = disabledProp ? disabledProp.type === 6 ? `true` : disabledProp.exp || `false` : `false`; + const contentRenderFn = createFunctionExpression( + [`_push`], + void 0, + // Body is added later + true, + // newline + false, + // isSlot + node.loc + ); + contentRenderFn.body = processChildrenAsStatement(node, context); + context.pushStatement( + createCallExpression(context.helper(SSR_RENDER_TELEPORT), [ + `_push`, + contentRenderFn, + target, + disabled, + `_parent` + ]) + ); +} + +const wipMap$3 = /* @__PURE__ */ new WeakMap(); +function ssrTransformSuspense(node, context) { + return () => { + if (node.children.length) { + const wipEntry = { + slotsExp: null, + // to be immediately set + wipSlots: [] + }; + wipMap$3.set(node, wipEntry); + wipEntry.slotsExp = buildSlots( + node, + context, + (_props, _vForExp, children, loc) => { + const fn = createFunctionExpression( + [], + void 0, + // no return, assign body later + true, + // newline + false, + // suspense slots are not treated as normal slots + loc + ); + wipEntry.wipSlots.push({ + fn, + children + }); + return fn; + } + ).slots; + } + }; +} +function ssrProcessSuspense(node, context) { + const wipEntry = wipMap$3.get(node); + if (!wipEntry) { + return; + } + const { slotsExp, wipSlots } = wipEntry; + for (let i = 0; i < wipSlots.length; i++) { + const slot = wipSlots[i]; + slot.fn.body = processChildrenAsStatement(slot, context); + } + context.pushStatement( + createCallExpression(context.helper(SSR_RENDER_SUSPENSE), [ + `_push`, + slotsExp + ]) + ); +} + +const rawChildrenMap = /* @__PURE__ */ new WeakMap(); +const ssrTransformElement = (node, context) => { + if (node.type !== 1 || node.tagType !== 0) { + return; + } + return function ssrPostTransformElement() { + const openTag = [`<${node.tag}`]; + const needTagForRuntime = node.tag === "textarea" || node.tag.indexOf("-") > 0; + const hasDynamicVBind = hasDynamicKeyVBind(node); + const hasCustomDir = node.props.some( + (p) => p.type === 7 && !isBuiltInDirective(p.name) + ); + const needMergeProps = hasDynamicVBind || hasCustomDir; + if (needMergeProps) { + const { props, directives } = buildProps( + node, + context, + node.props, + false, + false, + true + ); + if (props || directives.length) { + const mergedProps = buildSSRProps(props, directives, context); + const propsExp = createCallExpression( + context.helper(SSR_RENDER_ATTRS), + [mergedProps] + ); + if (node.tag === "textarea") { + const existingText = node.children[0]; + if (!existingText || existingText.type !== 5) { + const tempId = `_temp${context.temps++}`; + propsExp.arguments = [ + createAssignmentExpression( + createSimpleExpression(tempId, false), + mergedProps + ) + ]; + rawChildrenMap.set( + node, + createCallExpression(context.helper(SSR_INTERPOLATE), [ + createConditionalExpression( + createSimpleExpression(`"value" in ${tempId}`, false), + createSimpleExpression(`${tempId}.value`, false), + createSimpleExpression( + existingText ? existingText.content : ``, + true + ), + false + ) + ]) + ); + } + } else if (node.tag === "input") { + const vModel = findVModel(node); + if (vModel) { + const tempId = `_temp${context.temps++}`; + const tempExp = createSimpleExpression(tempId, false); + propsExp.arguments = [ + createSequenceExpression([ + createAssignmentExpression(tempExp, mergedProps), + createCallExpression(context.helper(MERGE_PROPS), [ + tempExp, + createCallExpression( + context.helper(SSR_GET_DYNAMIC_MODEL_PROPS), + [ + tempExp, + // existing props + vModel.exp + // model + ] + ) + ]) + ]) + ]; + } + } else if (directives.length && !node.children.length) { + const vText = findDir(node, "text"); + if (!vText) { + const tempId = `_temp${context.temps++}`; + propsExp.arguments = [ + createAssignmentExpression( + createSimpleExpression(tempId, false), + mergedProps + ) + ]; + rawChildrenMap.set( + node, + createConditionalExpression( + createSimpleExpression(`"textContent" in ${tempId}`, false), + createCallExpression(context.helper(SSR_INTERPOLATE), [ + createSimpleExpression(`${tempId}.textContent`, false) + ]), + createSimpleExpression(`${tempId}.innerHTML ?? ''`, false), + false + ) + ); + } + } + if (needTagForRuntime) { + propsExp.arguments.push(`"${node.tag}"`); + } + openTag.push(propsExp); + } + } + let dynamicClassBinding = void 0; + let staticClassBinding = void 0; + let dynamicStyleBinding = void 0; + for (let i = 0; i < node.props.length; i++) { + const prop = node.props[i]; + if (node.tag === "input" && isTrueFalseValue(prop)) { + continue; + } + if (prop.type === 7) { + if (prop.name === "html" && prop.exp) { + rawChildrenMap.set( + node, + createCompoundExpression([`(`, prop.exp, `) ?? ''`]) + ); + } else if (prop.name === "text" && prop.exp) { + node.children = [createInterpolation(prop.exp, prop.loc)]; + } else if (prop.name === "slot") { + context.onError( + createCompilerError(40, prop.loc) + ); + } else if (isTextareaWithValue(node, prop) && prop.exp) { + if (!needMergeProps) { + node.children = [createInterpolation(prop.exp, prop.loc)]; + } + } else if (!needMergeProps && prop.name !== "on") { + const directiveTransform = context.directiveTransforms[prop.name]; + if (directiveTransform) { + const { props, ssrTagParts } = directiveTransform( + prop, + node, + context + ); + if (ssrTagParts) { + openTag.push(...ssrTagParts); + } + for (let j = 0; j < props.length; j++) { + const { key, value } = props[j]; + if (isStaticExp(key)) { + let attrName = key.content; + if (attrName === "key" || attrName === "ref") { + continue; + } + if (attrName === "class") { + openTag.push( + ` class="`, + dynamicClassBinding = createCallExpression( + context.helper(SSR_RENDER_CLASS), + [value] + ), + `"` + ); + } else if (attrName === "style") { + if (dynamicStyleBinding) { + mergeCall(dynamicStyleBinding, value); + } else { + openTag.push( + ` style="`, + dynamicStyleBinding = createCallExpression( + context.helper(SSR_RENDER_STYLE), + [value] + ), + `"` + ); + } + } else { + attrName = node.tag.indexOf("-") > 0 ? attrName : propsToAttrMap[attrName] || attrName.toLowerCase(); + if (isBooleanAttr(attrName)) { + openTag.push( + createConditionalExpression( + createCallExpression( + context.helper(SSR_INCLUDE_BOOLEAN_ATTR), + [value] + ), + createSimpleExpression(" " + attrName, true), + createSimpleExpression("", true), + false + ) + ); + } else if (isSSRSafeAttrName(attrName)) { + openTag.push( + createCallExpression(context.helper(SSR_RENDER_ATTR), [ + key, + value + ]) + ); + } else { + context.onError( + createSSRCompilerError( + 65, + key.loc + ) + ); + } + } + } else { + const args = [key, value]; + if (needTagForRuntime) { + args.push(`"${node.tag}"`); + } + openTag.push( + createCallExpression( + context.helper(SSR_RENDER_DYNAMIC_ATTR), + args + ) + ); + } + } + } + } + } else { + const name = prop.name; + if (node.tag === "textarea" && name === "value" && prop.value) { + rawChildrenMap.set(node, escapeHtml(prop.value.content)); + } else if (!needMergeProps) { + if (name === "key" || name === "ref") { + continue; + } + if (name === "class" && prop.value) { + staticClassBinding = JSON.stringify(prop.value.content); + } + openTag.push( + ` ${prop.name}` + (prop.value ? `="${escapeHtml(prop.value.content)}"` : ``) + ); + } + } + } + if (dynamicClassBinding && staticClassBinding) { + mergeCall(dynamicClassBinding, staticClassBinding); + removeStaticBinding(openTag, "class"); + } + if (context.scopeId) { + openTag.push(` ${context.scopeId}`); + } + node.ssrCodegenNode = createTemplateLiteral(openTag); + }; +}; +function buildSSRProps(props, directives, context) { + let mergePropsArgs = []; + if (props) { + if (props.type === 14) { + mergePropsArgs = props.arguments; + } else { + mergePropsArgs.push(props); + } + } + if (directives.length) { + for (const dir of directives) { + mergePropsArgs.push( + createCallExpression(context.helper(SSR_GET_DIRECTIVE_PROPS), [ + `_ctx`, + ...buildDirectiveArgs(dir, context).elements + ]) + ); + } + } + return mergePropsArgs.length > 1 ? createCallExpression(context.helper(MERGE_PROPS), mergePropsArgs) : mergePropsArgs[0]; +} +function isTrueFalseValue(prop) { + if (prop.type === 7) { + return prop.name === "bind" && prop.arg && isStaticExp(prop.arg) && (prop.arg.content === "true-value" || prop.arg.content === "false-value"); + } else { + return prop.name === "true-value" || prop.name === "false-value"; + } +} +function isTextareaWithValue(node, prop) { + return !!(node.tag === "textarea" && prop.name === "bind" && isStaticArgOf(prop.arg, "value")); +} +function mergeCall(call, arg) { + const existing = call.arguments[0]; + if (existing.type === 17) { + existing.elements.push(arg); + } else { + call.arguments[0] = createArrayExpression([existing, arg]); + } +} +function removeStaticBinding(tag, binding) { + const regExp = new RegExp(`^ ${binding}=".+"$`); + const i = tag.findIndex((e) => typeof e === "string" && regExp.test(e)); + if (i > -1) { + tag.splice(i, 1); + } +} +function findVModel(node) { + return node.props.find( + (p) => p.type === 7 && p.name === "model" && p.exp + ); +} +function ssrProcessElement(node, context) { + const isVoidTag = context.options.isVoidTag || NO; + const elementsToAdd = node.ssrCodegenNode.elements; + for (let j = 0; j < elementsToAdd.length; j++) { + context.pushStringPart(elementsToAdd[j]); + } + if (context.withSlotScopeId) { + context.pushStringPart(createSimpleExpression(`_scopeId`, false)); + } + context.pushStringPart(`>`); + const rawChildren = rawChildrenMap.get(node); + if (rawChildren) { + context.pushStringPart(rawChildren); + } else if (node.children.length) { + processChildren(node, context); + } + if (!isVoidTag(node.tag)) { + context.pushStringPart(`</${node.tag}>`); + } +} + +const wipMap$2 = /* @__PURE__ */ new WeakMap(); +function ssrTransformTransitionGroup(node, context) { + return () => { + const tag = findProp(node, "tag"); + if (tag) { + const otherProps = node.props.filter((p) => p !== tag); + const { props, directives } = buildProps( + node, + context, + otherProps, + true, + false, + true + ); + let propsExp = null; + if (props || directives.length) { + propsExp = createCallExpression(context.helper(SSR_RENDER_ATTRS), [ + buildSSRProps(props, directives, context) + ]); + } + wipMap$2.set(node, { + tag, + propsExp, + scopeId: context.scopeId || null + }); + } + }; +} +function ssrProcessTransitionGroup(node, context) { + const entry = wipMap$2.get(node); + if (entry) { + const { tag, propsExp, scopeId } = entry; + if (tag.type === 7) { + context.pushStringPart(`<`); + context.pushStringPart(tag.exp); + if (propsExp) { + context.pushStringPart(propsExp); + } + if (scopeId) { + context.pushStringPart(` ${scopeId}`); + } + context.pushStringPart(`>`); + processChildren( + node, + context, + false, + /** + * TransitionGroup has the special runtime behavior of flattening and + * concatenating all children into a single fragment (in order for them to + * be patched using the same key map) so we need to account for that here + * by disabling nested fragment wrappers from being generated. + */ + true, + /** + * TransitionGroup filters out comment children at runtime and thus + * doesn't expect comments to be present during hydration. We need to + * account for that by disabling the empty comment that is otherwise + * rendered for a falsy v-if that has no v-else specified. (#6715) + */ + true + ); + context.pushStringPart(`</`); + context.pushStringPart(tag.exp); + context.pushStringPart(`>`); + } else { + context.pushStringPart(`<${tag.value.content}`); + if (propsExp) { + context.pushStringPart(propsExp); + } + if (scopeId) { + context.pushStringPart(` ${scopeId}`); + } + context.pushStringPart(`>`); + processChildren(node, context, false, true, true); + context.pushStringPart(`</${tag.value.content}>`); + } + } else { + processChildren(node, context, true, true, true); + } +} + +const wipMap$1 = /* @__PURE__ */ new WeakMap(); +function ssrTransformTransition(node, context) { + return () => { + const appear = findProp(node, "appear", false, true); + wipMap$1.set(node, !!appear); + }; +} +function ssrProcessTransition(node, context) { + node.children = node.children.filter((c) => c.type !== 3); + const appear = wipMap$1.get(node); + if (appear) { + context.pushStringPart(`<template>`); + processChildren(node, context, false, true); + context.pushStringPart(`</template>`); + } else { + processChildren(node, context, false, true); + } +} + +var __defProp$8 = Object.defineProperty; +var __defProps$7 = Object.defineProperties; +var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols; +var __hasOwnProp$8 = Object.prototype.hasOwnProperty; +var __propIsEnum$8 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$8 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$8.call(b, prop)) + __defNormalProp$8(a, prop, b[prop]); + if (__getOwnPropSymbols$8) + for (var prop of __getOwnPropSymbols$8(b)) { + if (__propIsEnum$8.call(b, prop)) + __defNormalProp$8(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b)); +const wipMap = /* @__PURE__ */ new WeakMap(); +const WIP_SLOT = Symbol(); +const componentTypeMap = /* @__PURE__ */ new WeakMap(); +const ssrTransformComponent = (node, context) => { + if (node.type !== 1 || node.tagType !== 1) { + return; + } + const component = resolveComponentType( + node, + context, + true + /* ssr */ + ); + const isDynamicComponent = isObject$2(component) && component.callee === RESOLVE_DYNAMIC_COMPONENT; + componentTypeMap.set(node, component); + if (isSymbol$1(component)) { + if (component === SUSPENSE) { + return ssrTransformSuspense(node, context); + } else if (component === TRANSITION_GROUP) { + return ssrTransformTransitionGroup(node, context); + } else if (component === TRANSITION) { + return ssrTransformTransition(node); + } + return; + } + const vnodeBranches = []; + const clonedNode = clone(node); + return function ssrPostTransformComponent() { + if (clonedNode.children.length) { + buildSlots(clonedNode, context, (props, vFor, children) => { + vnodeBranches.push( + createVNodeSlotBranch(props, vFor, children, context) + ); + return createFunctionExpression(void 0); + }); + } + let propsExp = `null`; + if (node.props.length) { + const { props, directives } = buildProps( + node, + context, + void 0, + true, + isDynamicComponent + ); + if (props || directives.length) { + propsExp = buildSSRProps(props, directives, context); + } + } + const wipEntries = []; + wipMap.set(node, wipEntries); + const buildSSRSlotFn = (props, _vForExp, children, loc) => { + const param0 = props && stringifyExpression(props) || `_`; + const fn = createFunctionExpression( + [param0, `_push`, `_parent`, `_scopeId`], + void 0, + // no return, assign body later + true, + // newline + true, + // isSlot + loc + ); + wipEntries.push({ + type: WIP_SLOT, + fn, + children, + // also collect the corresponding vnode branch built earlier + vnodeBranch: vnodeBranches[wipEntries.length] + }); + return fn; + }; + const slots = node.children.length ? buildSlots(node, context, buildSSRSlotFn).slots : `null`; + if (typeof component !== "string") { + node.ssrCodegenNode = createCallExpression( + context.helper(SSR_RENDER_VNODE), + [ + `_push`, + createCallExpression(context.helper(CREATE_VNODE), [ + component, + propsExp, + slots + ]), + `_parent` + ] + ); + } else { + node.ssrCodegenNode = createCallExpression( + context.helper(SSR_RENDER_COMPONENT), + [component, propsExp, slots, `_parent`] + ); + } + }; +}; +function ssrProcessComponent(node, context, parent) { + const component = componentTypeMap.get(node); + if (!node.ssrCodegenNode) { + if (component === TELEPORT) { + return ssrProcessTeleport(node, context); + } else if (component === SUSPENSE) { + return ssrProcessSuspense(node, context); + } else if (component === TRANSITION_GROUP) { + return ssrProcessTransitionGroup(node, context); + } else { + if (parent.type === WIP_SLOT) { + context.pushStringPart(``); + } + if (component === TRANSITION) { + return ssrProcessTransition(node, context); + } + processChildren(node, context); + } + } else { + const wipEntries = wipMap.get(node) || []; + for (let i = 0; i < wipEntries.length; i++) { + const { fn, vnodeBranch } = wipEntries[i]; + fn.body = createIfStatement( + createSimpleExpression(`_push`, false), + processChildrenAsStatement( + wipEntries[i], + context, + false, + true + ), + vnodeBranch + ); + } + if (context.withSlotScopeId) { + node.ssrCodegenNode.arguments.push(`_scopeId`); + } + if (typeof component === "string") { + context.pushStatement( + createCallExpression(`_push`, [node.ssrCodegenNode]) + ); + } else { + context.pushStatement(node.ssrCodegenNode); + } + } +} +const rawOptionsMap = /* @__PURE__ */ new WeakMap(); +const [baseNodeTransforms, baseDirectiveTransforms] = getBaseTransformPreset(true); +const vnodeNodeTransforms = [...baseNodeTransforms, ...DOMNodeTransforms]; +const vnodeDirectiveTransforms = __spreadValues$8(__spreadValues$8({}, baseDirectiveTransforms), DOMDirectiveTransforms); +function createVNodeSlotBranch(slotProps, vFor, children, parentContext) { + const rawOptions = rawOptionsMap.get(parentContext.root); + const subOptions = __spreadProps$7(__spreadValues$8({}, rawOptions), { + // overwrite with vnode-based transforms + nodeTransforms: [ + ...vnodeNodeTransforms, + ...rawOptions.nodeTransforms || [] + ], + directiveTransforms: __spreadValues$8(__spreadValues$8({}, vnodeDirectiveTransforms), rawOptions.directiveTransforms || {}) + }); + const wrapperProps = []; + if (slotProps) { + wrapperProps.push({ + type: 7, + name: "slot", + exp: slotProps, + arg: void 0, + modifiers: [], + loc: locStub + }); + } + if (vFor) { + wrapperProps.push(extend({}, vFor)); + } + const wrapperNode = { + type: 1, + ns: 0, + tag: "template", + tagType: 3, + props: wrapperProps, + children, + loc: locStub, + codegenNode: void 0 + }; + subTransform(wrapperNode, subOptions, parentContext); + return createReturnStatement(children); +} +function subTransform(node, options, parentContext) { + const childRoot = createRoot([node]); + const childContext = createTransformContext(childRoot, options); + childContext.ssr = false; + childContext.scopes = __spreadValues$8({}, parentContext.scopes); + childContext.identifiers = __spreadValues$8({}, parentContext.identifiers); + childContext.imports = parentContext.imports; + traverseNode(childRoot, childContext); + ["helpers", "components", "directives"].forEach((key) => { + childContext[key].forEach((value, helperKey) => { + if (key === "helpers") { + const parentCount = parentContext.helpers.get(helperKey); + if (parentCount === void 0) { + parentContext.helpers.set(helperKey, value); + } else { + parentContext.helpers.set(helperKey, value + parentCount); + } + } else { + parentContext[key].add(value); + } + }); + }); +} +function clone(v) { + if (isArray$3(v)) { + return v.map(clone); + } else if (isPlainObject(v)) { + const res = {}; + for (const key in v) { + res[key] = clone(v[key]); + } + return res; + } else { + return v; + } +} + +function ssrCodegenTransform(ast, options) { + const context = createSSRTransformContext(ast, options); + if (options.ssrCssVars) { + const cssContext = createTransformContext(createRoot([]), options); + const varsExp = processExpression( + createSimpleExpression(options.ssrCssVars, false), + cssContext + ); + context.body.push( + createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`]) + ); + Array.from(cssContext.helpers.keys()).forEach((helper) => { + ast.helpers.add(helper); + }); + } + const isFragment = ast.children.length > 1 && ast.children.some((c) => !isText$1(c)); + processChildren(ast, context, isFragment); + ast.codegenNode = createBlockStatement(context.body); + ast.ssrHelpers = Array.from( + /* @__PURE__ */ new Set([ + ...Array.from(ast.helpers).filter((h) => h in ssrHelpers), + ...context.helpers + ]) + ); + ast.helpers = new Set(Array.from(ast.helpers).filter((h) => !(h in ssrHelpers))); +} +function createSSRTransformContext(root, options, helpers = /* @__PURE__ */ new Set(), withSlotScopeId = false) { + const body = []; + let currentString = null; + return { + root, + options, + body, + helpers, + withSlotScopeId, + onError: options.onError || ((e) => { + throw e; + }), + helper(name) { + helpers.add(name); + return name; + }, + pushStringPart(part) { + if (!currentString) { + const currentCall = createCallExpression(`_push`); + body.push(currentCall); + currentString = createTemplateLiteral([]); + currentCall.arguments.push(currentString); + } + const bufferedElements = currentString.elements; + const lastItem = bufferedElements[bufferedElements.length - 1]; + if (isString$1(part) && isString$1(lastItem)) { + bufferedElements[bufferedElements.length - 1] += part; + } else { + bufferedElements.push(part); + } + }, + pushStatement(statement) { + currentString = null; + body.push(statement); + } + }; +} +function createChildContext(parent, withSlotScopeId = parent.withSlotScopeId) { + return createSSRTransformContext( + parent.root, + parent.options, + parent.helpers, + withSlotScopeId + ); +} +function processChildren(parent, context, asFragment = false, disableNestedFragments = false, disableComment = false) { + if (asFragment) { + context.pushStringPart(`<!--[-->`); + } + const { children } = parent; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + switch (child.tagType) { + case 0: + ssrProcessElement(child, context); + break; + case 1: + ssrProcessComponent(child, context, parent); + break; + case 2: + ssrProcessSlotOutlet(child, context); + break; + case 3: + break; + default: + context.onError( + createSSRCompilerError( + 67, + child.loc + ) + ); + const exhaustiveCheck2 = child; + return exhaustiveCheck2; + } + break; + case 2: + context.pushStringPart(escapeHtml(child.content)); + break; + case 3: + if (!disableComment) { + context.pushStringPart(`<!--${child.content}-->`); + } + break; + case 5: + context.pushStringPart( + createCallExpression(context.helper(SSR_INTERPOLATE), [ + child.content + ]) + ); + break; + case 9: + ssrProcessIf(child, context, disableNestedFragments, disableComment); + break; + case 11: + ssrProcessFor(child, context, disableNestedFragments); + break; + case 10: + break; + case 12: + case 8: + break; + default: + context.onError( + createSSRCompilerError( + 67, + child.loc + ) + ); + const exhaustiveCheck = child; + return exhaustiveCheck; + } + } + if (asFragment) { + context.pushStringPart(`<!--]-->`); + } +} +function processChildrenAsStatement(parent, parentContext, asFragment = false, withSlotScopeId = parentContext.withSlotScopeId) { + const childContext = createChildContext(parentContext, withSlotScopeId); + processChildren(parent, childContext, asFragment); + return createBlockStatement(childContext.body); +} + +const ssrTransformModel = (dir, node, context) => { + const model = dir.exp; + function checkDuplicatedValue() { + const value = findProp(node, "value"); + if (value) { + context.onError( + createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + function processOption(plainNode) { + if (plainNode.tag === "option") { + if (plainNode.props.findIndex((p) => p.name === "selected") === -1) { + const value = findValueBinding(plainNode); + plainNode.ssrCodegenNode.elements.push( + createConditionalExpression( + createCallExpression(context.helper(SSR_INCLUDE_BOOLEAN_ATTR), [ + createConditionalExpression( + createCallExpression(`Array.isArray`, [model]), + createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [ + model, + value + ]), + createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + value + ]) + ) + ]), + createSimpleExpression(" selected", true), + createSimpleExpression("", true), + false + ) + ); + } + } else if (plainNode.tag === "optgroup") { + plainNode.children.forEach( + (option) => processOption(option) + ); + } + } + if (node.tagType === 0) { + const res = { props: [] }; + const defaultProps = [ + // default value binding for text type inputs + createObjectProperty(`value`, model) + ]; + if (node.tag === "input") { + const type = findProp(node, "type"); + if (type) { + const value = findValueBinding(node); + if (type.type === 7) { + res.ssrTagParts = [ + createCallExpression(context.helper(SSR_RENDER_DYNAMIC_MODEL), [ + type.exp, + model, + value + ]) + ]; + } else if (type.value) { + switch (type.value.content) { + case "radio": + res.props = [ + createObjectProperty( + `checked`, + createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + value + ]) + ) + ]; + break; + case "checkbox": + const trueValueBinding = findProp(node, "true-value"); + if (trueValueBinding) { + const trueValue = trueValueBinding.type === 6 ? JSON.stringify(trueValueBinding.value.content) : trueValueBinding.exp; + res.props = [ + createObjectProperty( + `checked`, + createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + trueValue + ]) + ) + ]; + } else { + res.props = [ + createObjectProperty( + `checked`, + createConditionalExpression( + createCallExpression(`Array.isArray`, [model]), + createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [ + model, + value + ]), + model + ) + ) + ]; + } + break; + case "file": + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + res.props = defaultProps; + break; + } + } + } else if (hasDynamicKeyVBind(node)) ; else { + checkDuplicatedValue(); + res.props = defaultProps; + } + } else if (node.tag === "textarea") { + checkDuplicatedValue(); + node.children = [createInterpolation(model, model.loc)]; + } else if (node.tag === "select") { + const processChildren = (children) => { + children.forEach((child) => { + if (child.type === 1) { + processOption(child); + } else if (child.type === 11) { + processChildren(child.children); + } else if (child.type === 9) { + child.branches.forEach((b) => processChildren(b.children)); + } + }); + }; + processChildren(node.children); + } else { + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); + } + return res; + } else { + return transformModel$1(dir, node, context); + } +}; +function findValueBinding(node) { + const valueBinding = findProp(node, "value"); + return valueBinding ? valueBinding.type === 7 ? valueBinding.exp : createSimpleExpression(valueBinding.value.content, true) : createSimpleExpression(`null`, false); +} + +const ssrTransformShow = (dir, node, context) => { + if (!dir.exp) { + context.onError( + createDOMCompilerError(61) + ); + } + return { + props: [ + createObjectProperty( + `style`, + createConditionalExpression( + dir.exp, + createSimpleExpression(`null`, false), + createObjectExpression([ + createObjectProperty( + `display`, + createSimpleExpression(`none`, true) + ) + ]), + false + ) + ) + ] + }; +}; + +const filterChild = (node) => node.children.filter((n) => n.type !== 3); +const hasSingleChild = (node) => filterChild(node).length === 1; +const ssrInjectFallthroughAttrs = (node, context) => { + if (node.type === 0) { + context.identifiers._attrs = 1; + } + if (node.type === 1 && node.tagType === 1 && (node.tag === "transition" || node.tag === "Transition" || node.tag === "KeepAlive" || node.tag === "keep-alive")) { + const rootChildren = filterChild(context.root); + if (rootChildren.length === 1 && rootChildren[0] === node) { + if (hasSingleChild(node)) { + injectFallthroughAttrs(node.children[0]); + } + return; + } + } + const parent = context.parent; + if (!parent || parent.type !== 0) { + return; + } + if (node.type === 10 && hasSingleChild(node)) { + let hasEncounteredIf = false; + for (const c of filterChild(parent)) { + if (c.type === 9 || c.type === 1 && findDir(c, "if")) { + if (hasEncounteredIf) return; + hasEncounteredIf = true; + } else if ( + // node before v-if + !hasEncounteredIf || // non else nodes + !(c.type === 1 && findDir(c, /else/, true)) + ) { + return; + } + } + injectFallthroughAttrs(node.children[0]); + } else if (hasSingleChild(parent)) { + injectFallthroughAttrs(node); + } +}; +function injectFallthroughAttrs(node) { + if (node.type === 1 && (node.tagType === 0 || node.tagType === 1) && !findDir(node, "for")) { + node.props.push({ + type: 7, + name: "bind", + arg: void 0, + exp: createSimpleExpression(`_attrs`, false), + modifiers: [], + loc: locStub + }); + } +} + +const ssrInjectCssVars = (node, context) => { + if (!context.ssrCssVars) { + return; + } + if (node.type === 0) { + context.identifiers._cssVars = 1; + } + const parent = context.parent; + if (!parent || parent.type !== 0) { + return; + } + if (node.type === 10) { + for (const child of node.children) { + injectCssVars(child); + } + } else { + injectCssVars(node); + } +}; +function injectCssVars(node) { + if (node.type === 1 && (node.tagType === 0 || node.tagType === 1) && !findDir(node, "for")) { + if (node.tag === "suspense" || node.tag === "Suspense") { + for (const child of node.children) { + if (child.type === 1 && child.tagType === 3) { + child.children.forEach(injectCssVars); + } else { + injectCssVars(child); + } + } + } else { + node.props.push({ + type: 7, + name: "bind", + arg: void 0, + exp: createSimpleExpression(`_cssVars`, false), + modifiers: [], + loc: locStub + }); + } + } +} + +var __defProp$7 = Object.defineProperty; +var __defProps$6 = Object.defineProperties; +var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols; +var __hasOwnProp$7 = Object.prototype.hasOwnProperty; +var __propIsEnum$7 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$7 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); + if (__getOwnPropSymbols$7) + for (var prop of __getOwnPropSymbols$7(b)) { + if (__propIsEnum$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b)); +function compile(source, options = {}) { + options = __spreadProps$6(__spreadValues$7(__spreadValues$7({}, options), parserOptions), { + ssr: true, + inSSR: true, + scopeId: options.mode === "function" ? null : options.scopeId, + // always prefix since compiler-ssr doesn't have size concern + prefixIdentifiers: true, + // disable optimizations that are unnecessary for ssr + cacheHandlers: false, + hoistStatic: false + }); + const ast = typeof source === "string" ? baseParse(source, options) : source; + rawOptionsMap.set(ast, options); + transform(ast, __spreadProps$6(__spreadValues$7({}, options), { + hoistStatic: false, + nodeTransforms: [ + ssrTransformIf, + ssrTransformFor, + trackVForSlotScopes, + transformExpression, + ssrTransformSlotOutlet, + ssrInjectFallthroughAttrs, + ssrInjectCssVars, + ssrTransformElement, + ssrTransformComponent, + trackSlotScopes, + transformStyle, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: __spreadValues$7({ + // reusing core v-bind + bind: transformBind, + on: transformOn$1, + // model and show have dedicated SSR handling + model: ssrTransformModel, + show: ssrTransformShow, + // the following are ignored during SSR + // on: noopDirectiveTransform, + cloak: noopDirectiveTransform, + once: noopDirectiveTransform, + memo: noopDirectiveTransform + }, options.directiveTransforms || {}) + })); + ssrCodegenTransform(ast, options); + return generate(ast, options); +} + +var CompilerSSR = /*#__PURE__*/Object.freeze({ + __proto__: null, + compile: compile +}); + +var _polyfillNode_fs = {}; + +var _polyfillNode_fs$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + default: _polyfillNode_fs +}); + +var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_fs$1); + +var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_path); + +var require$$0 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_util$1); + +const hasWarned = {}; +function warnOnce$1(msg) { + const isNodeProd = typeof process !== "undefined" && process.env.NODE_ENV === "production"; + if (!isNodeProd && true && !hasWarned[msg]) { + hasWarned[msg] = true; + warn(msg); + } +} +function warn(msg) { + console.warn( + `\x1B[1m\x1B[33m[@vue/compiler-sfc]\x1B[0m\x1B[33m ${msg}\x1B[0m +` + ); +} + +var __defProp$6 = Object.defineProperty; +var __defProps$5 = Object.defineProperties; +var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols; +var __hasOwnProp$6 = Object.prototype.hasOwnProperty; +var __propIsEnum$6 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$6 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); + if (__getOwnPropSymbols$6) + for (var prop of __getOwnPropSymbols$6(b)) { + if (__propIsEnum$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b)); +function preprocess$1({ source, filename, preprocessOptions }, preprocessor) { + let res = ""; + let err = null; + preprocessor.render( + source, + __spreadValues$6({ filename }, preprocessOptions), + (_err, _res) => { + if (_err) err = _err; + res = _res; + } + ); + if (err) throw err; + return res; +} +function compileTemplate(options) { + const { preprocessLang, preprocessCustomRequire } = options; + if (preprocessLang && !preprocessCustomRequire) { + throw new Error( + `[@vue/compiler-sfc] Template preprocessing in the browser build must provide the \`preprocessCustomRequire\` option to return the in-browser version of the preprocessor in the shape of { render(): string }.` + ); + } + const preprocessor = preprocessLang ? preprocessCustomRequire ? preprocessCustomRequire(preprocessLang) : void 0 : false; + if (preprocessor) { + try { + return doCompileTemplate(__spreadProps$5(__spreadValues$6({}, options), { + source: preprocess$1(options, preprocessor), + ast: void 0 + // invalidate AST if template goes through preprocessor + })); + } catch (e) { + return { + code: `export default function render() {}`, + source: options.source, + tips: [], + errors: [e] + }; + } + } else if (preprocessLang) { + return { + code: `export default function render() {}`, + source: options.source, + tips: [ + `Component ${options.filename} uses lang ${preprocessLang} for template. Please install the language preprocessor.` + ], + errors: [ + `Component ${options.filename} uses lang ${preprocessLang} for template, however it is not installed.` + ] + }; + } else { + return doCompileTemplate(options); + } +} +function doCompileTemplate({ + filename, + id, + scoped, + slotted, + inMap, + source, + ast: inAST, + ssr = false, + ssrCssVars, + isProd = false, + compiler, + compilerOptions = {}, + transformAssetUrls +}) { + const errors = []; + const warnings = []; + let nodeTransforms = []; + if (isObject$2(transformAssetUrls)) { + const assetOptions = normalizeOptions(transformAssetUrls); + nodeTransforms = [ + createAssetUrlTransformWithOptions(assetOptions), + createSrcsetTransformWithOptions(assetOptions) + ]; + } else if (transformAssetUrls !== false) { + nodeTransforms = [transformAssetUrl, transformSrcset]; + } + if (ssr && !ssrCssVars) { + warnOnce$1( + `compileTemplate is called with \`ssr: true\` but no corresponding \`cssVars\` option.` + ); + } + if (!id) { + warnOnce$1(`compileTemplate now requires the \`id\` option.`); + id = ""; + } + const shortId = id.replace(/^data-v-/, ""); + const longId = `data-v-${shortId}`; + const defaultCompiler = ssr ? CompilerSSR : CompilerDOM; + compiler = compiler || defaultCompiler; + if (compiler !== defaultCompiler) { + inAST = void 0; + } + if (inAST == null ? void 0 : inAST.transformed) { + const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, __spreadProps$5(__spreadValues$6({ + prefixIdentifiers: true + }, compilerOptions), { + parseMode: "sfc", + onError: (e) => errors.push(e) + })); + const template = newAST.children.find( + (node) => node.type === 1 && node.tag === "template" + ); + inAST = createRoot(template.children, inAST.source); + } + let { code, ast, preamble, map } = compiler.compile(inAST || source, __spreadProps$5(__spreadValues$6({ + mode: "module", + prefixIdentifiers: true, + hoistStatic: true, + cacheHandlers: true, + ssrCssVars: ssr && ssrCssVars && ssrCssVars.length ? genCssVarsFromList(ssrCssVars, shortId, isProd, true) : "", + scopeId: scoped ? longId : void 0, + slotted, + sourceMap: true + }, compilerOptions), { + hmr: !isProd, + nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []), + filename, + onError: (e) => errors.push(e), + onWarn: (w) => warnings.push(w) + })); + if (inMap && !inAST) { + if (map) { + map = mapLines(inMap, map); + } + if (errors.length) { + patchErrors(errors, source, inMap); + } + } + const tips = warnings.map((w) => { + let msg = w.message; + if (w.loc) { + msg += ` +${generateCodeFrame( + (inAST == null ? void 0 : inAST.source) || source, + w.loc.start.offset, + w.loc.end.offset + )}`; + } + return msg; + }); + return { code, ast, preamble, source, errors, tips, map }; +} +function mapLines(oldMap, newMap) { + if (!oldMap) return newMap; + if (!newMap) return oldMap; + const oldMapConsumer = new sourceMapExports.SourceMapConsumer(oldMap); + const newMapConsumer = new sourceMapExports.SourceMapConsumer(newMap); + const mergedMapGenerator = new sourceMapExports.SourceMapGenerator(); + newMapConsumer.eachMapping((m) => { + if (m.originalLine == null) { + return; + } + const origPosInOldMap = oldMapConsumer.originalPositionFor({ + line: m.originalLine, + column: m.originalColumn + }); + if (origPosInOldMap.source == null) { + return; + } + mergedMapGenerator.addMapping({ + generated: { + line: m.generatedLine, + column: m.generatedColumn + }, + original: { + line: origPosInOldMap.line, + // map line + // use current column, since the oldMap produced by @vue/compiler-sfc + // does not + column: m.originalColumn + }, + source: origPosInOldMap.source, + name: origPosInOldMap.name + }); + }); + const generator = mergedMapGenerator; + oldMapConsumer.sources.forEach((sourceFile) => { + generator._sources.add(sourceFile); + const sourceContent = oldMapConsumer.sourceContentFor(sourceFile); + if (sourceContent != null) { + mergedMapGenerator.setSourceContent(sourceFile, sourceContent); + } + }); + generator._sourceRoot = oldMap.sourceRoot; + generator._file = oldMap.file; + return generator.toJSON(); +} +function patchErrors(errors, source, inMap) { + const originalSource = inMap.sourcesContent[0]; + const offset = originalSource.indexOf(source); + const lineOffset = originalSource.slice(0, offset).split(/\r?\n/).length - 1; + errors.forEach((err) => { + if (err.loc) { + err.loc.start.line += lineOffset; + err.loc.start.offset += offset; + if (err.loc.end !== err.loc.start) { + err.loc.end.line += lineOffset; + err.loc.end.offset += offset; + } + } + }); +} + +var picocolors = {exports: {}}; + +var hasRequiredPicocolors; + +function requirePicocolors () { + if (hasRequiredPicocolors) return picocolors.exports; + hasRequiredPicocolors = 1; + let p = browser$1 || {}, argv = p.argv || [], env = p.env || {}; + let isColorSupported = + !(!!env.NO_COLOR || argv.includes("--no-color")) && + (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI); + + let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length); + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + }; + + let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0; + do { + result += string.substring(cursor, index) + replace; + cursor = index + close.length; + index = string.indexOf(close, cursor); + } while (~index) + return result + string.substring(cursor) + }; + + let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } + }; + + picocolors.exports = createColors(); + picocolors.exports.createColors = createColors; + return picocolors.exports; +} + +var tokenize$1; +var hasRequiredTokenize$1; + +function requireTokenize$1 () { + if (hasRequiredTokenize$1) return tokenize$1; + hasRequiredTokenize$1 = 1; + + const SINGLE_QUOTE = "'".charCodeAt(0); + const DOUBLE_QUOTE = '"'.charCodeAt(0); + const BACKSLASH = '\\'.charCodeAt(0); + const SLASH = '/'.charCodeAt(0); + const NEWLINE = '\n'.charCodeAt(0); + const SPACE = ' '.charCodeAt(0); + const FEED = '\f'.charCodeAt(0); + const TAB = '\t'.charCodeAt(0); + const CR = '\r'.charCodeAt(0); + const OPEN_SQUARE = '['.charCodeAt(0); + const CLOSE_SQUARE = ']'.charCodeAt(0); + const OPEN_PARENTHESES = '('.charCodeAt(0); + const CLOSE_PARENTHESES = ')'.charCodeAt(0); + const OPEN_CURLY = '{'.charCodeAt(0); + const CLOSE_CURLY = '}'.charCodeAt(0); + const SEMICOLON = ';'.charCodeAt(0); + const ASTERISK = '*'.charCodeAt(0); + const COLON = ':'.charCodeAt(0); + const AT = '@'.charCodeAt(0); + + const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; + const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; + const RE_BAD_BRACKET = /.[\r\n"'(/\\]/; + const RE_HEX_ESCAPE = /[\da-f]/i; + + tokenize$1 = function tokenizer(input, options = {}) { + let css = input.css.valueOf(); + let ignore = options.ignoreErrors; + + let code, content, escape, next, quote; + let currentToken, escaped, escapePos, n, prev; + + let length = css.length; + let pos = 0; + let buffer = []; + let returned = []; + + function position() { + return pos + } + + function unclosed(what) { + throw input.error('Unclosed ' + what, pos) + } + + function endOfFile() { + return returned.length === 0 && pos >= length + } + + function nextToken(opts) { + if (returned.length) return returned.pop() + if (pos >= length) return + + let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; + + code = css.charCodeAt(pos); + + switch (code) { + case NEWLINE: + case SPACE: + case TAB: + case CR: + case FEED: { + next = pos; + do { + next += 1; + code = css.charCodeAt(next); + } while ( + code === SPACE || + code === NEWLINE || + code === TAB || + code === CR || + code === FEED + ) + + currentToken = ['space', css.slice(pos, next)]; + pos = next - 1; + break + } + + case OPEN_SQUARE: + case CLOSE_SQUARE: + case OPEN_CURLY: + case CLOSE_CURLY: + case COLON: + case SEMICOLON: + case CLOSE_PARENTHESES: { + let controlChar = String.fromCharCode(code); + currentToken = [controlChar, controlChar, pos]; + break + } + + case OPEN_PARENTHESES: { + prev = buffer.length ? buffer.pop()[1] : ''; + n = css.charCodeAt(pos + 1); + if ( + prev === 'url' && + n !== SINGLE_QUOTE && + n !== DOUBLE_QUOTE && + n !== SPACE && + n !== NEWLINE && + n !== TAB && + n !== FEED && + n !== CR + ) { + next = pos; + do { + escaped = false; + next = css.indexOf(')', next + 1); + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos; + break + } else { + unclosed('bracket'); + } + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped) + + currentToken = ['brackets', css.slice(pos, next + 1), pos, next]; + + pos = next; + } else { + next = css.indexOf(')', pos + 1); + content = css.slice(pos, next + 1); + + if (next === -1 || RE_BAD_BRACKET.test(content)) { + currentToken = ['(', '(', pos]; + } else { + currentToken = ['brackets', content, pos, next]; + pos = next; + } + } + + break + } + + case SINGLE_QUOTE: + case DOUBLE_QUOTE: { + quote = code === SINGLE_QUOTE ? "'" : '"'; + next = pos; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + 1; + break + } else { + unclosed('string'); + } + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped) + + currentToken = ['string', css.slice(pos, next + 1), pos, next]; + pos = next; + break + } + + case AT: { + RE_AT_END.lastIndex = pos + 1; + RE_AT_END.test(css); + if (RE_AT_END.lastIndex === 0) { + next = css.length - 1; + } else { + next = RE_AT_END.lastIndex - 2; + } + + currentToken = ['at-word', css.slice(pos, next + 1), pos, next]; + + pos = next; + break + } + + case BACKSLASH: { + next = pos; + escape = true; + while (css.charCodeAt(next + 1) === BACKSLASH) { + next += 1; + escape = !escape; + } + code = css.charCodeAt(next + 1); + if ( + escape && + code !== SLASH && + code !== SPACE && + code !== NEWLINE && + code !== TAB && + code !== CR && + code !== FEED + ) { + next += 1; + if (RE_HEX_ESCAPE.test(css.charAt(next))) { + while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { + next += 1; + } + if (css.charCodeAt(next + 1) === SPACE) { + next += 1; + } + } + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next]; + + pos = next; + break + } + + default: { + if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { + next = css.indexOf('*/', pos + 2) + 1; + if (next === 0) { + if (ignore || ignoreUnclosed) { + next = css.length; + } else { + unclosed('comment'); + } + } + + currentToken = ['comment', css.slice(pos, next + 1), pos, next]; + pos = next; + } else { + RE_WORD_END.lastIndex = pos + 1; + RE_WORD_END.test(css); + if (RE_WORD_END.lastIndex === 0) { + next = css.length - 1; + } else { + next = RE_WORD_END.lastIndex - 2; + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next]; + buffer.push(currentToken); + pos = next; + } + + break + } + } + + pos++; + return currentToken + } + + function back(token) { + returned.push(token); + } + + return { + back, + endOfFile, + nextToken, + position + } + }; + return tokenize$1; +} + +var terminalHighlight_1; +var hasRequiredTerminalHighlight; + +function requireTerminalHighlight () { + if (hasRequiredTerminalHighlight) return terminalHighlight_1; + hasRequiredTerminalHighlight = 1; + + let pico = /*@__PURE__*/ requirePicocolors(); + + let tokenizer = /*@__PURE__*/ requireTokenize$1(); + + let Input; + + function registerInput(dependant) { + Input = dependant; + } + + const HIGHLIGHT_THEME = { + ';': pico.yellow, + ':': pico.yellow, + '(': pico.cyan, + ')': pico.cyan, + '[': pico.yellow, + ']': pico.yellow, + '{': pico.yellow, + '}': pico.yellow, + 'at-word': pico.cyan, + 'brackets': pico.cyan, + 'call': pico.cyan, + 'class': pico.yellow, + 'comment': pico.gray, + 'hash': pico.magenta, + 'string': pico.green + }; + + function getTokenType([type, value], processor) { + if (type === 'word') { + if (value[0] === '.') { + return 'class' + } + if (value[0] === '#') { + return 'hash' + } + } + + if (!processor.endOfFile()) { + let next = processor.nextToken(); + processor.back(next); + if (next[0] === 'brackets' || next[0] === '(') return 'call' + } + + return type + } + + function terminalHighlight(css) { + let processor = tokenizer(new Input(css), { ignoreErrors: true }); + let result = ''; + while (!processor.endOfFile()) { + let token = processor.nextToken(); + let color = HIGHLIGHT_THEME[getTokenType(token, processor)]; + if (color) { + result += token[1] + .split(/\r?\n/) + .map(i => color(i)) + .join('\n'); + } else { + result += token[1]; + } + } + return result + } + + terminalHighlight.registerInput = registerInput; + + terminalHighlight_1 = terminalHighlight; + return terminalHighlight_1; +} + +var cssSyntaxError; +var hasRequiredCssSyntaxError; + +function requireCssSyntaxError () { + if (hasRequiredCssSyntaxError) return cssSyntaxError; + hasRequiredCssSyntaxError = 1; + + let pico = /*@__PURE__*/ requirePicocolors(); + + let terminalHighlight = /*@__PURE__*/ requireTerminalHighlight(); + + class CssSyntaxError extends Error { + constructor(message, line, column, source, file, plugin) { + super(message); + this.name = 'CssSyntaxError'; + this.reason = message; + + if (file) { + this.file = file; + } + if (source) { + this.source = source; + } + if (plugin) { + this.plugin = plugin; + } + if (typeof line !== 'undefined' && typeof column !== 'undefined') { + if (typeof line === 'number') { + this.line = line; + this.column = column; + } else { + this.line = line.line; + this.column = line.column; + this.endLine = column.line; + this.endColumn = column.column; + } + } + + this.setMessage(); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, CssSyntaxError); + } + } + + setMessage() { + this.message = this.plugin ? this.plugin + ': ' : ''; + this.message += this.file ? this.file : '<css input>'; + if (typeof this.line !== 'undefined') { + this.message += ':' + this.line + ':' + this.column; + } + this.message += ': ' + this.reason; + } + + showSourceCode(color) { + if (!this.source) return '' + + let css = this.source; + if (color == null) color = pico.isColorSupported; + + let aside = text => text; + let mark = text => text; + let highlight = text => text; + if (color) { + let { bold, gray, red } = pico.createColors(true); + mark = text => bold(red(text)); + aside = text => gray(text); + if (terminalHighlight) { + highlight = text => terminalHighlight(text); + } + } + + let lines = css.split(/\r?\n/); + let start = Math.max(this.line - 3, 0); + let end = Math.min(this.line + 2, lines.length); + let maxWidth = String(end).length; + + return lines + .slice(start, end) + .map((line, index) => { + let number = start + 1 + index; + let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '; + if (number === this.line) { + if (line.length > 160) { + let padding = 20; + let subLineStart = Math.max(0, this.column - padding); + let subLineEnd = Math.max( + this.column + padding, + this.endColumn + padding + ); + let subLine = line.slice(subLineStart, subLineEnd); + + let spacing = + aside(gutter.replace(/\d/g, ' ')) + + line + .slice(0, Math.min(this.column - 1, padding - 1)) + .replace(/[^\t]/g, ' '); + + return ( + mark('>') + + aside(gutter) + + highlight(subLine) + + '\n ' + + spacing + + mark('^') + ) + } + + let spacing = + aside(gutter.replace(/\d/g, ' ')) + + line.slice(0, this.column - 1).replace(/[^\t]/g, ' '); + + return ( + mark('>') + + aside(gutter) + + highlight(line) + + '\n ' + + spacing + + mark('^') + ) + } + + return ' ' + aside(gutter) + highlight(line) + }) + .join('\n') + } + + toString() { + let code = this.showSourceCode(); + if (code) { + code = '\n\n' + code + '\n'; + } + return this.name + ': ' + this.message + code + } + } + + cssSyntaxError = CssSyntaxError; + CssSyntaxError.default = CssSyntaxError; + return cssSyntaxError; +} + +var stringifier; +var hasRequiredStringifier; + +function requireStringifier () { + if (hasRequiredStringifier) return stringifier; + hasRequiredStringifier = 1; + + const DEFAULT_RAW = { + after: '\n', + beforeClose: '\n', + beforeComment: '\n', + beforeDecl: '\n', + beforeOpen: ' ', + beforeRule: '\n', + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: false + }; + + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1) + } + + class Stringifier { + constructor(builder) { + this.builder = builder; + } + + atrule(node, semicolon) { + let name = '@' + node.name; + let params = node.params ? this.rawValue(node, 'params') : ''; + + if (typeof node.raws.afterName !== 'undefined') { + name += node.raws.afterName; + } else if (params) { + name += ' '; + } + + if (node.nodes) { + this.block(node, name + params); + } else { + let end = (node.raws.between || '') + (semicolon ? ';' : ''); + this.builder(name + params + end, node); + } + } + + beforeAfter(node, detect) { + let value; + if (node.type === 'decl') { + value = this.raw(node, null, 'beforeDecl'); + } else if (node.type === 'comment') { + value = this.raw(node, null, 'beforeComment'); + } else if (detect === 'before') { + value = this.raw(node, null, 'beforeRule'); + } else { + value = this.raw(node, null, 'beforeClose'); + } + + let buf = node.parent; + let depth = 0; + while (buf && buf.type !== 'root') { + depth += 1; + buf = buf.parent; + } + + if (value.includes('\n')) { + let indent = this.raw(node, null, 'indent'); + if (indent.length) { + for (let step = 0; step < depth; step++) value += indent; + } + } + + return value + } + + block(node, start) { + let between = this.raw(node, 'between', 'beforeOpen'); + this.builder(start + between + '{', node, 'start'); + + let after; + if (node.nodes && node.nodes.length) { + this.body(node); + after = this.raw(node, 'after'); + } else { + after = this.raw(node, 'after', 'emptyBody'); + } + + if (after) this.builder(after); + this.builder('}', node, 'end'); + } + + body(node) { + let last = node.nodes.length - 1; + while (last > 0) { + if (node.nodes[last].type !== 'comment') break + last -= 1; + } + + let semicolon = this.raw(node, 'semicolon'); + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; + let before = this.raw(child, 'before'); + if (before) this.builder(before); + this.stringify(child, last !== i || semicolon); + } + } + + comment(node) { + let left = this.raw(node, 'left', 'commentLeft'); + let right = this.raw(node, 'right', 'commentRight'); + this.builder('/*' + left + node.text + right + '*/', node); + } + + decl(node, semicolon) { + let between = this.raw(node, 'between', 'colon'); + let string = node.prop + between + this.rawValue(node, 'value'); + + if (node.important) { + string += node.raws.important || ' !important'; + } + + if (semicolon) string += ';'; + this.builder(string, node); + } + + document(node) { + this.body(node); + } + + raw(node, own, detect) { + let value; + if (!detect) detect = own; + + // Already had + if (own) { + value = node.raws[own]; + if (typeof value !== 'undefined') return value + } + + let parent = node.parent; + + if (detect === 'before') { + // Hack for first rule in CSS + if (!parent || (parent.type === 'root' && parent.first === node)) { + return '' + } + + // `root` nodes in `document` should use only their own raws + if (parent && parent.type === 'document') { + return '' + } + } + + // Floating child without parent + if (!parent) return DEFAULT_RAW[detect] + + // Detect style by other nodes + let root = node.root(); + if (!root.rawCache) root.rawCache = {}; + if (typeof root.rawCache[detect] !== 'undefined') { + return root.rawCache[detect] + } + + if (detect === 'before' || detect === 'after') { + return this.beforeAfter(node, detect) + } else { + let method = 'raw' + capitalize(detect); + if (this[method]) { + value = this[method](root, node); + } else { + root.walk(i => { + value = i.raws[own]; + if (typeof value !== 'undefined') return false + }); + } + } + + if (typeof value === 'undefined') value = DEFAULT_RAW[detect]; + + root.rawCache[detect] = value; + return value + } + + rawBeforeClose(root) { + let value; + root.walk(i => { + if (i.nodes && i.nodes.length > 0) { + if (typeof i.raws.after !== 'undefined') { + value = i.raws.after; + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, ''); + } + return false + } + } + }); + if (value) value = value.replace(/\S/g, ''); + return value + } + + rawBeforeComment(root, node) { + let value; + root.walkComments(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before; + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, ''); + } + return false + } + }); + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeDecl'); + } else if (value) { + value = value.replace(/\S/g, ''); + } + return value + } + + rawBeforeDecl(root, node) { + let value; + root.walkDecls(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before; + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, ''); + } + return false + } + }); + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeRule'); + } else if (value) { + value = value.replace(/\S/g, ''); + } + return value + } + + rawBeforeOpen(root) { + let value; + root.walk(i => { + if (i.type !== 'decl') { + value = i.raws.between; + if (typeof value !== 'undefined') return false + } + }); + return value + } + + rawBeforeRule(root) { + let value; + root.walk(i => { + if (i.nodes && (i.parent !== root || root.first !== i)) { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before; + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, ''); + } + return false + } + } + }); + if (value) value = value.replace(/\S/g, ''); + return value + } + + rawColon(root) { + let value; + root.walkDecls(i => { + if (typeof i.raws.between !== 'undefined') { + value = i.raws.between.replace(/[^\s:]/g, ''); + return false + } + }); + return value + } + + rawEmptyBody(root) { + let value; + root.walk(i => { + if (i.nodes && i.nodes.length === 0) { + value = i.raws.after; + if (typeof value !== 'undefined') return false + } + }); + return value + } + + rawIndent(root) { + if (root.raws.indent) return root.raws.indent + let value; + root.walk(i => { + let p = i.parent; + if (p && p !== root && p.parent && p.parent === root) { + if (typeof i.raws.before !== 'undefined') { + let parts = i.raws.before.split('\n'); + value = parts[parts.length - 1]; + value = value.replace(/\S/g, ''); + return false + } + } + }); + return value + } + + rawSemicolon(root) { + let value; + root.walk(i => { + if (i.nodes && i.nodes.length && i.last.type === 'decl') { + value = i.raws.semicolon; + if (typeof value !== 'undefined') return false + } + }); + return value + } + + rawValue(node, prop) { + let value = node[prop]; + let raw = node.raws[prop]; + if (raw && raw.value === value) { + return raw.raw + } + + return value + } + + root(node) { + this.body(node); + if (node.raws.after) this.builder(node.raws.after); + } + + rule(node) { + this.block(node, this.rawValue(node, 'selector')); + if (node.raws.ownSemicolon) { + this.builder(node.raws.ownSemicolon, node, 'end'); + } + } + + stringify(node, semicolon) { + /* c8 ignore start */ + if (!this[node.type]) { + throw new Error( + 'Unknown AST node type ' + + node.type + + '. ' + + 'Maybe you need to change PostCSS stringifier.' + ) + } + /* c8 ignore stop */ + this[node.type](node, semicolon); + } + } + + stringifier = Stringifier; + Stringifier.default = Stringifier; + return stringifier; +} + +var stringify_1; +var hasRequiredStringify; + +function requireStringify () { + if (hasRequiredStringify) return stringify_1; + hasRequiredStringify = 1; + + let Stringifier = /*@__PURE__*/ requireStringifier(); + + function stringify(node, builder) { + let str = new Stringifier(builder); + str.stringify(node); + } + + stringify_1 = stringify; + stringify.default = stringify; + return stringify_1; +} + +var symbols = {}; + +var hasRequiredSymbols; + +function requireSymbols () { + if (hasRequiredSymbols) return symbols; + hasRequiredSymbols = 1; + + symbols.isClean = Symbol('isClean'); + + symbols.my = Symbol('my'); + return symbols; +} + +var node$2; +var hasRequiredNode$2; + +function requireNode$2 () { + if (hasRequiredNode$2) return node$2; + hasRequiredNode$2 = 1; + + let CssSyntaxError = /*@__PURE__*/ requireCssSyntaxError(); + let Stringifier = /*@__PURE__*/ requireStringifier(); + let stringify = /*@__PURE__*/ requireStringify(); + let { isClean, my } = /*@__PURE__*/ requireSymbols(); + + function cloneNode(obj, parent) { + let cloned = new obj.constructor(); + + for (let i in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, i)) { + /* c8 ignore next 2 */ + continue + } + if (i === 'proxyCache') continue + let value = obj[i]; + let type = typeof value; + + if (i === 'parent' && type === 'object') { + if (parent) cloned[i] = parent; + } else if (i === 'source') { + cloned[i] = value; + } else if (Array.isArray(value)) { + cloned[i] = value.map(j => cloneNode(j, cloned)); + } else { + if (type === 'object' && value !== null) value = cloneNode(value); + cloned[i] = value; + } + } + + return cloned + } + + class Node { + constructor(defaults = {}) { + this.raws = {}; + this[isClean] = false; + this[my] = true; + + for (let name in defaults) { + if (name === 'nodes') { + this.nodes = []; + for (let node of defaults[name]) { + if (typeof node.clone === 'function') { + this.append(node.clone()); + } else { + this.append(node); + } + } + } else { + this[name] = defaults[name]; + } + } + } + + addToError(error) { + error.postcssNode = this; + if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { + let s = this.source; + error.stack = error.stack.replace( + /\n\s{4}at /, + `$&${s.input.from}:${s.start.line}:${s.start.column}$&` + ); + } + return error + } + + after(add) { + this.parent.insertAfter(this, add); + return this + } + + assign(overrides = {}) { + for (let name in overrides) { + this[name] = overrides[name]; + } + return this + } + + before(add) { + this.parent.insertBefore(this, add); + return this + } + + cleanRaws(keepBetween) { + delete this.raws.before; + delete this.raws.after; + if (!keepBetween) delete this.raws.between; + } + + clone(overrides = {}) { + let cloned = cloneNode(this); + for (let name in overrides) { + cloned[name] = overrides[name]; + } + return cloned + } + + cloneAfter(overrides = {}) { + let cloned = this.clone(overrides); + this.parent.insertAfter(this, cloned); + return cloned + } + + cloneBefore(overrides = {}) { + let cloned = this.clone(overrides); + this.parent.insertBefore(this, cloned); + return cloned + } + + error(message, opts = {}) { + if (this.source) { + let { end, start } = this.rangeBy(opts); + return this.source.input.error( + message, + { column: start.column, line: start.line }, + { column: end.column, line: end.line }, + opts + ) + } + return new CssSyntaxError(message) + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (prop === 'root') { + return () => node.root().toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value; + if ( + prop === 'prop' || + prop === 'value' || + prop === 'name' || + prop === 'params' || + prop === 'important' || + /* c8 ignore next */ + prop === 'text' + ) { + node.markDirty(); + } + return true + } + } + } + + /* c8 ignore next 3 */ + markClean() { + this[isClean] = true; + } + + markDirty() { + if (this[isClean]) { + this[isClean] = false; + let next = this; + while ((next = next.parent)) { + next[isClean] = false; + } + } + } + + next() { + if (!this.parent) return undefined + let index = this.parent.index(this); + return this.parent.nodes[index + 1] + } + + positionBy(opts, stringRepresentation) { + let pos = this.source.start; + if (opts.index) { + pos = this.positionInside(opts.index); + } else if (opts.word) { + stringRepresentation = this.source.input.css.slice(this.source.start.offset, this.source.end.offset); + let index = stringRepresentation.indexOf(opts.word); + if (index !== -1) pos = this.positionInside(index); + } + return pos + } + + positionInside(index) { + let column = this.source.start.column; + let line = this.source.start.line; + let offset = this.source.start.offset; + let end = offset + index; + + for (let i = offset; i < end; i++) { + if (this.source.input.css[i] === '\n') { + column = 1; + line += 1; + } else { + column += 1; + } + } + + return { column, line } + } + + prev() { + if (!this.parent) return undefined + let index = this.parent.index(this); + return this.parent.nodes[index - 1] + } + + rangeBy(opts) { + let start = { + column: this.source.start.column, + line: this.source.start.line + }; + let end = this.source.end + ? { + column: this.source.end.column + 1, + line: this.source.end.line + } + : { + column: start.column + 1, + line: start.line + }; + + if (opts.word) { + let stringRepresentation = this.source.input.css.slice(this.source.start.offset, this.source.end.offset); + let index = stringRepresentation.indexOf(opts.word); + if (index !== -1) { + start = this.positionInside(index, stringRepresentation); + end = this.positionInside( + index + opts.word.length, + stringRepresentation + ); + } + } else { + if (opts.start) { + start = { + column: opts.start.column, + line: opts.start.line + }; + } else if (opts.index) { + start = this.positionInside(opts.index); + } + + if (opts.end) { + end = { + column: opts.end.column, + line: opts.end.line + }; + } else if (typeof opts.endIndex === 'number') { + end = this.positionInside(opts.endIndex); + } else if (opts.index) { + end = this.positionInside(opts.index + 1); + } + } + + if ( + end.line < start.line || + (end.line === start.line && end.column <= start.column) + ) { + end = { column: start.column + 1, line: start.line }; + } + + return { end, start } + } + + raw(prop, defaultType) { + let str = new Stringifier(); + return str.raw(this, prop, defaultType) + } + + remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this + } + + replaceWith(...nodes) { + if (this.parent) { + let bookmark = this; + let foundSelf = false; + for (let node of nodes) { + if (node === this) { + foundSelf = true; + } else if (foundSelf) { + this.parent.insertAfter(bookmark, node); + bookmark = node; + } else { + this.parent.insertBefore(bookmark, node); + } + } + + if (!foundSelf) { + this.remove(); + } + } + + return this + } + + root() { + let result = this; + while (result.parent && result.parent.type !== 'document') { + result = result.parent; + } + return result + } + + toJSON(_, inputs) { + let fixed = {}; + let emitInputs = inputs == null; + inputs = inputs || new Map(); + let inputsNextIndex = 0; + + for (let name in this) { + if (!Object.prototype.hasOwnProperty.call(this, name)) { + /* c8 ignore next 2 */ + continue + } + if (name === 'parent' || name === 'proxyCache') continue + let value = this[name]; + + if (Array.isArray(value)) { + fixed[name] = value.map(i => { + if (typeof i === 'object' && i.toJSON) { + return i.toJSON(null, inputs) + } else { + return i + } + }); + } else if (typeof value === 'object' && value.toJSON) { + fixed[name] = value.toJSON(null, inputs); + } else if (name === 'source') { + let inputId = inputs.get(value.input); + if (inputId == null) { + inputId = inputsNextIndex; + inputs.set(value.input, inputsNextIndex); + inputsNextIndex++; + } + fixed[name] = { + end: value.end, + inputId, + start: value.start + }; + } else { + fixed[name] = value; + } + } + + if (emitInputs) { + fixed.inputs = [...inputs.keys()].map(input => input.toJSON()); + } + + return fixed + } + + toProxy() { + if (!this.proxyCache) { + this.proxyCache = new Proxy(this, this.getProxyProcessor()); + } + return this.proxyCache + } + + toString(stringifier = stringify) { + if (stringifier.stringify) stringifier = stringifier.stringify; + let result = ''; + stringifier(this, i => { + result += i; + }); + return result + } + + warn(result, text, opts) { + let data = { node: this }; + for (let i in opts) data[i] = opts[i]; + return result.warn(text, data) + } + + get proxyOf() { + return this + } + } + + node$2 = Node; + Node.default = Node; + return node$2; +} + +var comment$1; +var hasRequiredComment$1; + +function requireComment$1 () { + if (hasRequiredComment$1) return comment$1; + hasRequiredComment$1 = 1; + + let Node = /*@__PURE__*/ requireNode$2(); + + class Comment extends Node { + constructor(defaults) { + super(defaults); + this.type = 'comment'; + } + } + + comment$1 = Comment; + Comment.default = Comment; + return comment$1; +} + +var declaration; +var hasRequiredDeclaration; + +function requireDeclaration () { + if (hasRequiredDeclaration) return declaration; + hasRequiredDeclaration = 1; + + let Node = /*@__PURE__*/ requireNode$2(); + + class Declaration extends Node { + constructor(defaults) { + if ( + defaults && + typeof defaults.value !== 'undefined' && + typeof defaults.value !== 'string' + ) { + defaults = { ...defaults, value: String(defaults.value) }; + } + super(defaults); + this.type = 'decl'; + } + + get variable() { + return this.prop.startsWith('--') || this.prop[0] === '$' + } + } + + declaration = Declaration; + Declaration.default = Declaration; + return declaration; +} + +var container$1; +var hasRequiredContainer$1; + +function requireContainer$1 () { + if (hasRequiredContainer$1) return container$1; + hasRequiredContainer$1 = 1; + + let Comment = /*@__PURE__*/ requireComment$1(); + let Declaration = /*@__PURE__*/ requireDeclaration(); + let Node = /*@__PURE__*/ requireNode$2(); + let { isClean, my } = /*@__PURE__*/ requireSymbols(); + + let AtRule, parse, Root, Rule; + + function cleanSource(nodes) { + return nodes.map(i => { + if (i.nodes) i.nodes = cleanSource(i.nodes); + delete i.source; + return i + }) + } + + function markTreeDirty(node) { + node[isClean] = false; + if (node.proxyOf.nodes) { + for (let i of node.proxyOf.nodes) { + markTreeDirty(i); + } + } + } + + class Container extends Node { + append(...children) { + for (let child of children) { + let nodes = this.normalize(child, this.last); + for (let node of nodes) this.proxyOf.nodes.push(node); + } + + this.markDirty(); + + return this + } + + cleanRaws(keepBetween) { + super.cleanRaws(keepBetween); + if (this.nodes) { + for (let node of this.nodes) node.cleanRaws(keepBetween); + } + } + + each(callback) { + if (!this.proxyOf.nodes) return undefined + let iterator = this.getIterator(); + + let index, result; + while (this.indexes[iterator] < this.proxyOf.nodes.length) { + index = this.indexes[iterator]; + result = callback(this.proxyOf.nodes[index], index); + if (result === false) break + + this.indexes[iterator] += 1; + } + + delete this.indexes[iterator]; + return result + } + + every(condition) { + return this.nodes.every(condition) + } + + getIterator() { + if (!this.lastEach) this.lastEach = 0; + if (!this.indexes) this.indexes = {}; + + this.lastEach += 1; + let iterator = this.lastEach; + this.indexes[iterator] = 0; + + return iterator + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (!node[prop]) { + return node[prop] + } else if ( + prop === 'each' || + (typeof prop === 'string' && prop.startsWith('walk')) + ) { + return (...args) => { + return node[prop]( + ...args.map(i => { + if (typeof i === 'function') { + return (child, index) => i(child.toProxy(), index) + } else { + return i + } + }) + ) + } + } else if (prop === 'every' || prop === 'some') { + return cb => { + return node[prop]((child, ...other) => + cb(child.toProxy(), ...other) + ) + } + } else if (prop === 'root') { + return () => node.root().toProxy() + } else if (prop === 'nodes') { + return node.nodes.map(i => i.toProxy()) + } else if (prop === 'first' || prop === 'last') { + return node[prop].toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value; + if (prop === 'name' || prop === 'params' || prop === 'selector') { + node.markDirty(); + } + return true + } + } + } + + index(child) { + if (typeof child === 'number') return child + if (child.proxyOf) child = child.proxyOf; + return this.proxyOf.nodes.indexOf(child) + } + + insertAfter(exist, add) { + let existIndex = this.index(exist); + let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse(); + existIndex = this.index(exist); + for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node); + + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (existIndex < index) { + this.indexes[id] = index + nodes.length; + } + } + + this.markDirty(); + + return this + } + + insertBefore(exist, add) { + let existIndex = this.index(exist); + let type = existIndex === 0 ? 'prepend' : false; + let nodes = this.normalize( + add, + this.proxyOf.nodes[existIndex], + type + ).reverse(); + existIndex = this.index(exist); + for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node); + + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (existIndex <= index) { + this.indexes[id] = index + nodes.length; + } + } + + this.markDirty(); + + return this + } + + normalize(nodes, sample) { + if (typeof nodes === 'string') { + nodes = cleanSource(parse(nodes).nodes); + } else if (typeof nodes === 'undefined') { + nodes = []; + } else if (Array.isArray(nodes)) { + nodes = nodes.slice(0); + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore'); + } + } else if (nodes.type === 'root' && this.type !== 'document') { + nodes = nodes.nodes.slice(0); + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore'); + } + } else if (nodes.type) { + nodes = [nodes]; + } else if (nodes.prop) { + if (typeof nodes.value === 'undefined') { + throw new Error('Value field is missed in node creation') + } else if (typeof nodes.value !== 'string') { + nodes.value = String(nodes.value); + } + nodes = [new Declaration(nodes)]; + } else if (nodes.selector || nodes.selectors) { + nodes = [new Rule(nodes)]; + } else if (nodes.name) { + nodes = [new AtRule(nodes)]; + } else if (nodes.text) { + nodes = [new Comment(nodes)]; + } else { + throw new Error('Unknown node type in node creation') + } + + let processed = nodes.map(i => { + /* c8 ignore next */ + if (!i[my]) Container.rebuild(i); + i = i.proxyOf; + if (i.parent) i.parent.removeChild(i); + if (i[isClean]) markTreeDirty(i); + + if (!i.raws) i.raws = {}; + if (typeof i.raws.before === 'undefined') { + if (sample && typeof sample.raws.before !== 'undefined') { + i.raws.before = sample.raws.before.replace(/\S/g, ''); + } + } + i.parent = this.proxyOf; + return i + }); + + return processed + } + + prepend(...children) { + children = children.reverse(); + for (let child of children) { + let nodes = this.normalize(child, this.first, 'prepend').reverse(); + for (let node of nodes) this.proxyOf.nodes.unshift(node); + for (let id in this.indexes) { + this.indexes[id] = this.indexes[id] + nodes.length; + } + } + + this.markDirty(); + + return this + } + + push(child) { + child.parent = this; + this.proxyOf.nodes.push(child); + return this + } + + removeAll() { + for (let node of this.proxyOf.nodes) node.parent = undefined; + this.proxyOf.nodes = []; + + this.markDirty(); + + return this + } + + removeChild(child) { + child = this.index(child); + this.proxyOf.nodes[child].parent = undefined; + this.proxyOf.nodes.splice(child, 1); + + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + + this.markDirty(); + + return this + } + + replaceValues(pattern, opts, callback) { + if (!callback) { + callback = opts; + opts = {}; + } + + this.walkDecls(decl => { + if (opts.props && !opts.props.includes(decl.prop)) return + if (opts.fast && !decl.value.includes(opts.fast)) return + + decl.value = decl.value.replace(pattern, callback); + }); + + this.markDirty(); + + return this + } + + some(condition) { + return this.nodes.some(condition) + } + + walk(callback) { + return this.each((child, i) => { + let result; + try { + result = callback(child, i); + } catch (e) { + throw child.addToError(e) + } + if (result !== false && child.walk) { + result = child.walk(callback); + } + + return result + }) + } + + walkAtRules(name, callback) { + if (!callback) { + callback = name; + return this.walk((child, i) => { + if (child.type === 'atrule') { + return callback(child, i) + } + }) + } + if (name instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'atrule' && name.test(child.name)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'atrule' && child.name === name) { + return callback(child, i) + } + }) + } + + walkComments(callback) { + return this.walk((child, i) => { + if (child.type === 'comment') { + return callback(child, i) + } + }) + } + + walkDecls(prop, callback) { + if (!callback) { + callback = prop; + return this.walk((child, i) => { + if (child.type === 'decl') { + return callback(child, i) + } + }) + } + if (prop instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'decl' && prop.test(child.prop)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'decl' && child.prop === prop) { + return callback(child, i) + } + }) + } + + walkRules(selector, callback) { + if (!callback) { + callback = selector; + + return this.walk((child, i) => { + if (child.type === 'rule') { + return callback(child, i) + } + }) + } + if (selector instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'rule' && selector.test(child.selector)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'rule' && child.selector === selector) { + return callback(child, i) + } + }) + } + + get first() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[0] + } + + get last() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] + } + } + + Container.registerParse = dependant => { + parse = dependant; + }; + + Container.registerRule = dependant => { + Rule = dependant; + }; + + Container.registerAtRule = dependant => { + AtRule = dependant; + }; + + Container.registerRoot = dependant => { + Root = dependant; + }; + + container$1 = Container; + Container.default = Container; + + /* c8 ignore start */ + Container.rebuild = node => { + if (node.type === 'atrule') { + Object.setPrototypeOf(node, AtRule.prototype); + } else if (node.type === 'rule') { + Object.setPrototypeOf(node, Rule.prototype); + } else if (node.type === 'decl') { + Object.setPrototypeOf(node, Declaration.prototype); + } else if (node.type === 'comment') { + Object.setPrototypeOf(node, Comment.prototype); + } else if (node.type === 'root') { + Object.setPrototypeOf(node, Root.prototype); + } + + node[my] = true; + + if (node.nodes) { + node.nodes.forEach(child => { + Container.rebuild(child); + }); + } + }; + /* c8 ignore stop */ + return container$1; +} + +var atRule; +var hasRequiredAtRule; + +function requireAtRule () { + if (hasRequiredAtRule) return atRule; + hasRequiredAtRule = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + + class AtRule extends Container { + constructor(defaults) { + super(defaults); + this.type = 'atrule'; + } + + append(...children) { + if (!this.proxyOf.nodes) this.nodes = []; + return super.append(...children) + } + + prepend(...children) { + if (!this.proxyOf.nodes) this.nodes = []; + return super.prepend(...children) + } + } + + atRule = AtRule; + AtRule.default = AtRule; + + Container.registerAtRule(AtRule); + return atRule; +} + +var document; +var hasRequiredDocument; + +function requireDocument () { + if (hasRequiredDocument) return document; + hasRequiredDocument = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + + let LazyResult, Processor; + + class Document extends Container { + constructor(defaults) { + // type needs to be passed to super, otherwise child roots won't be normalized correctly + super({ type: 'document', ...defaults }); + + if (!this.nodes) { + this.nodes = []; + } + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts); + + return lazy.stringify() + } + } + + Document.registerLazyResult = dependant => { + LazyResult = dependant; + }; + + Document.registerProcessor = dependant => { + Processor = dependant; + }; + + document = Document; + Document.default = Document; + return document; +} + +var nonSecure; +var hasRequiredNonSecure; + +function requireNonSecure () { + if (hasRequiredNonSecure) return nonSecure; + hasRequiredNonSecure = 1; + let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; + let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = ''; + let i = size; + while (i--) { + id += alphabet[(Math.random() * alphabet.length) | 0]; + } + return id + } + }; + let nanoid = (size = 21) => { + let id = ''; + let i = size; + while (i--) { + id += urlAlphabet[(Math.random() * 64) | 0]; + } + return id + }; + nonSecure = { nanoid, customAlphabet }; + return nonSecure; +} + +var sourceMap$1 = {}; + +var sourceMapGenerator$1 = {}; + +var base64Vlq$1 = {}; + +var base64$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64$1; + +function requireBase64$1 () { + if (hasRequiredBase64$1) return base64$1; + hasRequiredBase64$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + base64$1.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + base64$1.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + return base64$1; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64Vlq$1; + +function requireBase64Vlq$1 () { + if (hasRequiredBase64Vlq$1) return base64Vlq$1; + hasRequiredBase64Vlq$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = /*@__PURE__*/ requireBase64$1(); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + base64Vlq$1.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + base64Vlq$1.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + return base64Vlq$1; +} + +var util$2 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredUtil$2; + +function requireUtil$2 () { + if (hasRequiredUtil$2) return util$2; + hasRequiredUtil$2 = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + var MAX_CACHED_INPUTS = 32; + + /** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ + function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; + } + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '<dir>/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + }); + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp; + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + } (util$2)); + return util$2; +} + +var arraySet$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredArraySet$1; + +function requireArraySet$1 () { + if (hasRequiredArraySet$1) return arraySet$1; + hasRequiredArraySet$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$2(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + arraySet$1.ArraySet = ArraySet; + return arraySet$1; +} + +var mappingList$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredMappingList$1; + +function requireMappingList$1 () { + if (hasRequiredMappingList$1) return mappingList$1; + hasRequiredMappingList$1 = 1; + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$2(); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + mappingList$1.MappingList = MappingList; + return mappingList$1; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapGenerator$1; + +function requireSourceMapGenerator$1 () { + if (hasRequiredSourceMapGenerator$1) return sourceMapGenerator$1; + hasRequiredSourceMapGenerator$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = /*@__PURE__*/ requireBase64Vlq$1(); + var util = /*@__PURE__*/ requireUtil$2(); + var ArraySet = /*@__PURE__*/ requireArraySet$1().ArraySet; + var MappingList = /*@__PURE__*/ requireMappingList$1().MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + })); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name) === false) { + return; + } + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.'; + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + var message = 'Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message) + } + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ''; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + sourceMapGenerator$1.SourceMapGenerator = SourceMapGenerator; + return sourceMapGenerator$1; +} + +var sourceMapConsumer$1 = {}; + +var binarySearch$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBinarySearch$1; + +function requireBinarySearch$1 () { + if (hasRequiredBinarySearch$1) return binarySearch$1; + hasRequiredBinarySearch$1 = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + } (binarySearch$1)); + return binarySearch$1; +} + +var quickSort$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredQuickSort$1; + +function requireQuickSort$1 () { + if (hasRequiredQuickSort$1) return quickSort$1; + hasRequiredQuickSort$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + function SortTemplate(comparator) { + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + return doQuickSort; + } + + function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + + let sortCache = new WeakMap(); + quickSort$1.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); + }; + return quickSort$1; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapConsumer$1; + +function requireSourceMapConsumer$1 () { + if (hasRequiredSourceMapConsumer$1) return sourceMapConsumer$1; + hasRequiredSourceMapConsumer$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil$2(); + var binarySearch = /*@__PURE__*/ requireBinarySearch$1(); + var ArraySet = /*@__PURE__*/ requireArraySet$1().ArraySet; + var base64VLQ = /*@__PURE__*/ requireBase64Vlq$1(); + var quickSort = /*@__PURE__*/ requireQuickSort$1().quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + } + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + sourceMapConsumer$1.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + + const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; + function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } + } + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + sourceMapConsumer$1.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content || content === '') { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + sourceMapConsumer$1.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + return sourceMapConsumer$1; +} + +var sourceNode$1 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceNode$1; + +function requireSourceNode$1 () { + if (hasRequiredSourceNode$1) return sourceNode$1; + hasRequiredSourceNode$1 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator$1().SourceMapGenerator; + var util = /*@__PURE__*/ requireUtil$2(); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + sourceNode$1.SourceNode = SourceNode; + return sourceNode$1; +} + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var hasRequiredSourceMap$1; + +function requireSourceMap$1 () { + if (hasRequiredSourceMap$1) return sourceMap$1; + hasRequiredSourceMap$1 = 1; + sourceMap$1.SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator$1().SourceMapGenerator; + sourceMap$1.SourceMapConsumer = /*@__PURE__*/ requireSourceMapConsumer$1().SourceMapConsumer; + sourceMap$1.SourceNode = /*@__PURE__*/ requireSourceNode$1().SourceNode; + return sourceMap$1; +} + +var require$$2 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_url$1); + +var previousMap; +var hasRequiredPreviousMap; + +function requirePreviousMap () { + if (hasRequiredPreviousMap) return previousMap; + hasRequiredPreviousMap = 1; + + let { existsSync, readFileSync } = require$$0$1; + let { dirname, join } = require$$1; + let { SourceMapConsumer, SourceMapGenerator } = /*@__PURE__*/ requireSourceMap$1(); + + function fromBase64(str) { + if (Buffer$1) { + return Buffer$1.from(str, 'base64').toString() + } else { + /* c8 ignore next 2 */ + return window.atob(str) + } + } + + class PreviousMap { + constructor(css, opts) { + if (opts.map === false) return + this.loadAnnotation(css); + this.inline = this.startWith(this.annotation, 'data:'); + + let prev = opts.map ? opts.map.prev : undefined; + let text = this.loadMap(opts.from, prev); + if (!this.mapFile && opts.from) { + this.mapFile = opts.from; + } + if (this.mapFile) this.root = dirname(this.mapFile); + if (text) this.text = text; + } + + consumer() { + if (!this.consumerCache) { + this.consumerCache = new SourceMapConsumer(this.text); + } + return this.consumerCache + } + + decodeInline(text) { + let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; + let baseUri = /^data:application\/json;base64,/; + let charsetUri = /^data:application\/json;charset=utf-?8,/; + let uri = /^data:application\/json,/; + + let uriMatch = text.match(charsetUri) || text.match(uri); + if (uriMatch) { + return decodeURIComponent(text.substr(uriMatch[0].length)) + } + + let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri); + if (baseUriMatch) { + return fromBase64(text.substr(baseUriMatch[0].length)) + } + + let encoding = text.match(/data:application\/json;([^,]+),/)[1]; + throw new Error('Unsupported source map encoding ' + encoding) + } + + getAnnotationURL(sourceMapString) { + return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() + } + + isMap(map) { + if (typeof map !== 'object') return false + return ( + typeof map.mappings === 'string' || + typeof map._mappings === 'string' || + Array.isArray(map.sections) + ) + } + + loadAnnotation(css) { + let comments = css.match(/\/\*\s*# sourceMappingURL=/g); + if (!comments) return + + // sourceMappingURLs from comments, strings, etc. + let start = css.lastIndexOf(comments.pop()); + let end = css.indexOf('*/', start); + + if (start > -1 && end > -1) { + // Locate the last sourceMappingURL to avoid pickin + this.annotation = this.getAnnotationURL(css.substring(start, end)); + } + } + + loadFile(path) { + this.root = dirname(path); + if (existsSync(path)) { + this.mapFile = path; + return readFileSync(path, 'utf-8').toString().trim() + } + } + + loadMap(file, prev) { + if (prev === false) return false + + if (prev) { + if (typeof prev === 'string') { + return prev + } else if (typeof prev === 'function') { + let prevPath = prev(file); + if (prevPath) { + let map = this.loadFile(prevPath); + if (!map) { + throw new Error( + 'Unable to load previous source map: ' + prevPath.toString() + ) + } + return map + } + } else if (prev instanceof SourceMapConsumer) { + return SourceMapGenerator.fromSourceMap(prev).toString() + } else if (prev instanceof SourceMapGenerator) { + return prev.toString() + } else if (this.isMap(prev)) { + return JSON.stringify(prev) + } else { + throw new Error( + 'Unsupported previous source map format: ' + prev.toString() + ) + } + } else if (this.inline) { + return this.decodeInline(this.annotation) + } else if (this.annotation) { + let map = this.annotation; + if (file) map = join(dirname(file), map); + return this.loadFile(map) + } + } + + startWith(string, start) { + if (!string) return false + return string.substr(0, start.length) === start + } + + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ) + } + } + + previousMap = PreviousMap; + PreviousMap.default = PreviousMap; + return previousMap; +} + +var input; +var hasRequiredInput; + +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + + let { nanoid } = /*@__PURE__*/ requireNonSecure(); + let { isAbsolute, resolve } = require$$1; + let { SourceMapConsumer, SourceMapGenerator } = /*@__PURE__*/ requireSourceMap$1(); + let { fileURLToPath, pathToFileURL } = require$$2; + + let CssSyntaxError = /*@__PURE__*/ requireCssSyntaxError(); + let PreviousMap = /*@__PURE__*/ requirePreviousMap(); + let terminalHighlight = /*@__PURE__*/ requireTerminalHighlight(); + + let fromOffsetCache = Symbol('fromOffsetCache'); + + let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); + let pathAvailable = Boolean(resolve && isAbsolute); + + class Input { + constructor(css, opts = {}) { + if ( + css === null || + typeof css === 'undefined' || + (typeof css === 'object' && !css.toString) + ) { + throw new Error(`PostCSS received ${css} instead of CSS string`) + } + + this.css = css.toString(); + + if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { + this.hasBOM = true; + this.css = this.css.slice(1); + } else { + this.hasBOM = false; + } + + if (opts.from) { + if ( + !pathAvailable || + /^\w+:\/\//.test(opts.from) || + isAbsolute(opts.from) + ) { + this.file = opts.from; + } else { + this.file = resolve(opts.from); + } + } + + if (pathAvailable && sourceMapAvailable) { + let map = new PreviousMap(this.css, opts); + if (map.text) { + this.map = map; + let file = map.consumer().file; + if (!this.file && file) this.file = this.mapResolve(file); + } + } + + if (!this.file) { + this.id = '<input css ' + nanoid(6) + '>'; + } + if (this.map) this.map.file = this.from; + } + + error(message, line, column, opts = {}) { + let endColumn, endLine, result; + + if (line && typeof line === 'object') { + let start = line; + let end = column; + if (typeof start.offset === 'number') { + let pos = this.fromOffset(start.offset); + line = pos.line; + column = pos.col; + } else { + line = start.line; + column = start.column; + } + if (typeof end.offset === 'number') { + let pos = this.fromOffset(end.offset); + endLine = pos.line; + endColumn = pos.col; + } else { + endLine = end.line; + endColumn = end.column; + } + } else if (!column) { + let pos = this.fromOffset(line); + line = pos.line; + column = pos.col; + } + + let origin = this.origin(line, column, endLine, endColumn); + if (origin) { + result = new CssSyntaxError( + message, + origin.endLine === undefined + ? origin.line + : { column: origin.column, line: origin.line }, + origin.endLine === undefined + ? origin.column + : { column: origin.endColumn, line: origin.endLine }, + origin.source, + origin.file, + opts.plugin + ); + } else { + result = new CssSyntaxError( + message, + endLine === undefined ? line : { column, line }, + endLine === undefined ? column : { column: endColumn, line: endLine }, + this.css, + this.file, + opts.plugin + ); + } + + result.input = { column, endColumn, endLine, line, source: this.css }; + if (this.file) { + if (pathToFileURL) { + result.input.url = pathToFileURL(this.file).toString(); + } + result.input.file = this.file; + } + + return result + } + + fromOffset(offset) { + let lastLine, lineToIndex; + if (!this[fromOffsetCache]) { + let lines = this.css.split('\n'); + lineToIndex = new Array(lines.length); + let prevIndex = 0; + + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex; + prevIndex += lines[i].length + 1; + } + + this[fromOffsetCache] = lineToIndex; + } else { + lineToIndex = this[fromOffsetCache]; + } + lastLine = lineToIndex[lineToIndex.length - 1]; + + let min = 0; + if (offset >= lastLine) { + min = lineToIndex.length - 1; + } else { + let max = lineToIndex.length - 2; + let mid; + while (min < max) { + mid = min + ((max - min) >> 1); + if (offset < lineToIndex[mid]) { + max = mid - 1; + } else if (offset >= lineToIndex[mid + 1]) { + min = mid + 1; + } else { + min = mid; + break + } + } + } + return { + col: offset - lineToIndex[min] + 1, + line: min + 1 + } + } + + mapResolve(file) { + if (/^\w+:\/\//.test(file)) { + return file + } + return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) + } + + origin(line, column, endLine, endColumn) { + if (!this.map) return false + let consumer = this.map.consumer(); + + let from = consumer.originalPositionFor({ column, line }); + if (!from.source) return false + + let to; + if (typeof endLine === 'number') { + to = consumer.originalPositionFor({ column: endColumn, line: endLine }); + } + + let fromUrl; + + if (isAbsolute(from.source)) { + fromUrl = pathToFileURL(from.source); + } else { + fromUrl = new URL( + from.source, + this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) + ); + } + + let result = { + column: from.column, + endColumn: to && to.column, + endLine: to && to.line, + line: from.line, + url: fromUrl.toString() + }; + + if (fromUrl.protocol === 'file:') { + if (fileURLToPath) { + result.file = fileURLToPath(fromUrl); + } else { + /* c8 ignore next 2 */ + throw new Error(`file: protocol is not available in this PostCSS build`) + } + } + + let source = consumer.sourceContentFor(from.source); + if (source) result.source = source; + + return result + } + + toJSON() { + let json = {}; + for (let name of ['hasBOM', 'css', 'file', 'id']) { + if (this[name] != null) { + json[name] = this[name]; + } + } + if (this.map) { + json.map = { ...this.map }; + if (json.map.consumerCache) { + json.map.consumerCache = undefined; + } + } + return json + } + + get from() { + return this.file || this.id + } + } + + input = Input; + Input.default = Input; + + if (terminalHighlight && terminalHighlight.registerInput) { + terminalHighlight.registerInput(Input); + } + return input; +} + +var root$1; +var hasRequiredRoot$1; + +function requireRoot$1 () { + if (hasRequiredRoot$1) return root$1; + hasRequiredRoot$1 = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + + let LazyResult, Processor; + + class Root extends Container { + constructor(defaults) { + super(defaults); + this.type = 'root'; + if (!this.nodes) this.nodes = []; + } + + normalize(child, sample, type) { + let nodes = super.normalize(child); + + if (sample) { + if (type === 'prepend') { + if (this.nodes.length > 1) { + sample.raws.before = this.nodes[1].raws.before; + } else { + delete sample.raws.before; + } + } else if (this.first !== sample) { + for (let node of nodes) { + node.raws.before = sample.raws.before; + } + } + } + + return nodes + } + + removeChild(child, ignore) { + let index = this.index(child); + + if (!ignore && index === 0 && this.nodes.length > 1) { + this.nodes[1].raws.before = this.nodes[index].raws.before; + } + + return super.removeChild(child) + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts); + return lazy.stringify() + } + } + + Root.registerLazyResult = dependant => { + LazyResult = dependant; + }; + + Root.registerProcessor = dependant => { + Processor = dependant; + }; + + root$1 = Root; + Root.default = Root; + + Container.registerRoot(Root); + return root$1; +} + +var list_1; +var hasRequiredList; + +function requireList () { + if (hasRequiredList) return list_1; + hasRequiredList = 1; + + let list = { + comma(string) { + return list.split(string, [','], true) + }, + + space(string) { + let spaces = [' ', '\n', '\t']; + return list.split(string, spaces) + }, + + split(string, separators, last) { + let array = []; + let current = ''; + let split = false; + + let func = 0; + let inQuote = false; + let prevQuote = ''; + let escape = false; + + for (let letter of string) { + if (escape) { + escape = false; + } else if (letter === '\\') { + escape = true; + } else if (inQuote) { + if (letter === prevQuote) { + inQuote = false; + } + } else if (letter === '"' || letter === "'") { + inQuote = true; + prevQuote = letter; + } else if (letter === '(') { + func += 1; + } else if (letter === ')') { + if (func > 0) func -= 1; + } else if (func === 0) { + if (separators.includes(letter)) split = true; + } + + if (split) { + if (current !== '') array.push(current.trim()); + current = ''; + split = false; + } else { + current += letter; + } + } + + if (last || current !== '') array.push(current.trim()); + return array + } + }; + + list_1 = list; + list.default = list; + return list_1; +} + +var rule; +var hasRequiredRule; + +function requireRule () { + if (hasRequiredRule) return rule; + hasRequiredRule = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + let list = /*@__PURE__*/ requireList(); + + class Rule extends Container { + constructor(defaults) { + super(defaults); + this.type = 'rule'; + if (!this.nodes) this.nodes = []; + } + + get selectors() { + return list.comma(this.selector) + } + + set selectors(values) { + let match = this.selector ? this.selector.match(/,\s*/) : null; + let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen'); + this.selector = values.join(sep); + } + } + + rule = Rule; + Rule.default = Rule; + + Container.registerRule(Rule); + return rule; +} + +var fromJSON_1; +var hasRequiredFromJSON; + +function requireFromJSON () { + if (hasRequiredFromJSON) return fromJSON_1; + hasRequiredFromJSON = 1; + + let AtRule = /*@__PURE__*/ requireAtRule(); + let Comment = /*@__PURE__*/ requireComment$1(); + let Declaration = /*@__PURE__*/ requireDeclaration(); + let Input = /*@__PURE__*/ requireInput(); + let PreviousMap = /*@__PURE__*/ requirePreviousMap(); + let Root = /*@__PURE__*/ requireRoot$1(); + let Rule = /*@__PURE__*/ requireRule(); + + function fromJSON(json, inputs) { + if (Array.isArray(json)) return json.map(n => fromJSON(n)) + + let { inputs: ownInputs, ...defaults } = json; + if (ownInputs) { + inputs = []; + for (let input of ownInputs) { + let inputHydrated = { ...input, __proto__: Input.prototype }; + if (inputHydrated.map) { + inputHydrated.map = { + ...inputHydrated.map, + __proto__: PreviousMap.prototype + }; + } + inputs.push(inputHydrated); + } + } + if (defaults.nodes) { + defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)); + } + if (defaults.source) { + let { inputId, ...source } = defaults.source; + defaults.source = source; + if (inputId != null) { + defaults.source.input = inputs[inputId]; + } + } + if (defaults.type === 'root') { + return new Root(defaults) + } else if (defaults.type === 'decl') { + return new Declaration(defaults) + } else if (defaults.type === 'rule') { + return new Rule(defaults) + } else if (defaults.type === 'comment') { + return new Comment(defaults) + } else if (defaults.type === 'atrule') { + return new AtRule(defaults) + } else { + throw new Error('Unknown node type: ' + json.type) + } + } + + fromJSON_1 = fromJSON; + fromJSON.default = fromJSON; + return fromJSON_1; +} + +var mapGenerator; +var hasRequiredMapGenerator; + +function requireMapGenerator () { + if (hasRequiredMapGenerator) return mapGenerator; + hasRequiredMapGenerator = 1; + + let { dirname, relative, resolve, sep } = require$$1; + let { SourceMapConsumer, SourceMapGenerator } = /*@__PURE__*/ requireSourceMap$1(); + let { pathToFileURL } = require$$2; + + let Input = /*@__PURE__*/ requireInput(); + + let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); + let pathAvailable = Boolean(dirname && resolve && relative && sep); + + class MapGenerator { + constructor(stringify, root, opts, cssString) { + this.stringify = stringify; + this.mapOpts = opts.map || {}; + this.root = root; + this.opts = opts; + this.css = cssString; + this.originalCSS = cssString; + this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; + + this.memoizedFileURLs = new Map(); + this.memoizedPaths = new Map(); + this.memoizedURLs = new Map(); + } + + addAnnotation() { + let content; + + if (this.isInline()) { + content = + 'data:application/json;base64,' + this.toBase64(this.map.toString()); + } else if (typeof this.mapOpts.annotation === 'string') { + content = this.mapOpts.annotation; + } else if (typeof this.mapOpts.annotation === 'function') { + content = this.mapOpts.annotation(this.opts.to, this.root); + } else { + content = this.outputFile() + '.map'; + } + let eol = '\n'; + if (this.css.includes('\r\n')) eol = '\r\n'; + + this.css += eol + '/*# sourceMappingURL=' + content + ' */'; + } + + applyPrevMaps() { + for (let prev of this.previous()) { + let from = this.toUrl(this.path(prev.file)); + let root = prev.root || dirname(prev.file); + let map; + + if (this.mapOpts.sourcesContent === false) { + map = new SourceMapConsumer(prev.text); + if (map.sourcesContent) { + map.sourcesContent = null; + } + } else { + map = prev.consumer(); + } + + this.map.applySourceMap(map, from, this.toUrl(this.path(root))); + } + } + + clearAnnotation() { + if (this.mapOpts.annotation === false) return + + if (this.root) { + let node; + for (let i = this.root.nodes.length - 1; i >= 0; i--) { + node = this.root.nodes[i]; + if (node.type !== 'comment') continue + if (node.text.startsWith('# sourceMappingURL=')) { + this.root.removeChild(i); + } + } + } else if (this.css) { + this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, ''); + } + } + + generate() { + this.clearAnnotation(); + if (pathAvailable && sourceMapAvailable && this.isMap()) { + return this.generateMap() + } else { + let result = ''; + this.stringify(this.root, i => { + result += i; + }); + return [result] + } + } + + generateMap() { + if (this.root) { + this.generateString(); + } else if (this.previous().length === 1) { + let prev = this.previous()[0].consumer(); + prev.file = this.outputFile(); + this.map = SourceMapGenerator.fromSourceMap(prev, { + ignoreInvalidMapping: true + }); + } else { + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }); + this.map.addMapping({ + generated: { column: 0, line: 1 }, + original: { column: 0, line: 1 }, + source: this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '<no source>' + }); + } + + if (this.isSourcesContent()) this.setSourcesContent(); + if (this.root && this.previous().length > 0) this.applyPrevMaps(); + if (this.isAnnotation()) this.addAnnotation(); + + if (this.isInline()) { + return [this.css] + } else { + return [this.css, this.map] + } + } + + generateString() { + this.css = ''; + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }); + + let line = 1; + let column = 1; + + let noSource = '<no source>'; + let mapping = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '' + }; + + let last, lines; + this.stringify(this.root, (str, node, type) => { + this.css += str; + + if (node && type !== 'end') { + mapping.generated.line = line; + mapping.generated.column = column - 1; + if (node.source && node.source.start) { + mapping.source = this.sourcePath(node); + mapping.original.line = node.source.start.line; + mapping.original.column = node.source.start.column - 1; + this.map.addMapping(mapping); + } else { + mapping.source = noSource; + mapping.original.line = 1; + mapping.original.column = 0; + this.map.addMapping(mapping); + } + } + + lines = str.match(/\n/g); + if (lines) { + line += lines.length; + last = str.lastIndexOf('\n'); + column = str.length - last; + } else { + column += str.length; + } + + if (node && type !== 'start') { + let p = node.parent || { raws: {} }; + let childless = + node.type === 'decl' || (node.type === 'atrule' && !node.nodes); + if (!childless || node !== p.last || p.raws.semicolon) { + if (node.source && node.source.end) { + mapping.source = this.sourcePath(node); + mapping.original.line = node.source.end.line; + mapping.original.column = node.source.end.column - 1; + mapping.generated.line = line; + mapping.generated.column = column - 2; + this.map.addMapping(mapping); + } else { + mapping.source = noSource; + mapping.original.line = 1; + mapping.original.column = 0; + mapping.generated.line = line; + mapping.generated.column = column - 1; + this.map.addMapping(mapping); + } + } + } + }); + } + + isAnnotation() { + if (this.isInline()) { + return true + } + if (typeof this.mapOpts.annotation !== 'undefined') { + return this.mapOpts.annotation + } + if (this.previous().length) { + return this.previous().some(i => i.annotation) + } + return true + } + + isInline() { + if (typeof this.mapOpts.inline !== 'undefined') { + return this.mapOpts.inline + } + + let annotation = this.mapOpts.annotation; + if (typeof annotation !== 'undefined' && annotation !== true) { + return false + } + + if (this.previous().length) { + return this.previous().some(i => i.inline) + } + return true + } + + isMap() { + if (typeof this.opts.map !== 'undefined') { + return !!this.opts.map + } + return this.previous().length > 0 + } + + isSourcesContent() { + if (typeof this.mapOpts.sourcesContent !== 'undefined') { + return this.mapOpts.sourcesContent + } + if (this.previous().length) { + return this.previous().some(i => i.withContent()) + } + return true + } + + outputFile() { + if (this.opts.to) { + return this.path(this.opts.to) + } else if (this.opts.from) { + return this.path(this.opts.from) + } else { + return 'to.css' + } + } + + path(file) { + if (this.mapOpts.absolute) return file + if (file.charCodeAt(0) === 60 /* `<` */) return file + if (/^\w+:\/\//.test(file)) return file + let cached = this.memoizedPaths.get(file); + if (cached) return cached + + let from = this.opts.to ? dirname(this.opts.to) : '.'; + + if (typeof this.mapOpts.annotation === 'string') { + from = dirname(resolve(from, this.mapOpts.annotation)); + } + + let path = relative(from, file); + this.memoizedPaths.set(file, path); + + return path + } + + previous() { + if (!this.previousMaps) { + this.previousMaps = []; + if (this.root) { + this.root.walk(node => { + if (node.source && node.source.input.map) { + let map = node.source.input.map; + if (!this.previousMaps.includes(map)) { + this.previousMaps.push(map); + } + } + }); + } else { + let input = new Input(this.originalCSS, this.opts); + if (input.map) this.previousMaps.push(input.map); + } + } + + return this.previousMaps + } + + setSourcesContent() { + let already = {}; + if (this.root) { + this.root.walk(node => { + if (node.source) { + let from = node.source.input.from; + if (from && !already[from]) { + already[from] = true; + let fromUrl = this.usesFileUrls + ? this.toFileUrl(from) + : this.toUrl(this.path(from)); + this.map.setSourceContent(fromUrl, node.source.input.css); + } + } + }); + } else if (this.css) { + let from = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '<no source>'; + this.map.setSourceContent(from, this.css); + } + } + + sourcePath(node) { + if (this.mapOpts.from) { + return this.toUrl(this.mapOpts.from) + } else if (this.usesFileUrls) { + return this.toFileUrl(node.source.input.from) + } else { + return this.toUrl(this.path(node.source.input.from)) + } + } + + toBase64(str) { + if (Buffer$1) { + return Buffer$1.from(str).toString('base64') + } else { + return window.btoa(unescape(encodeURIComponent(str))) + } + } + + toFileUrl(path) { + let cached = this.memoizedFileURLs.get(path); + if (cached) return cached + + if (pathToFileURL) { + let fileURL = pathToFileURL(path).toString(); + this.memoizedFileURLs.set(path, fileURL); + + return fileURL + } else { + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ) + } + } + + toUrl(path) { + let cached = this.memoizedURLs.get(path); + if (cached) return cached + + if (sep === '\\') { + path = path.replace(/\\/g, '/'); + } + + let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent); + this.memoizedURLs.set(path, url); + + return url + } + } + + mapGenerator = MapGenerator; + return mapGenerator; +} + +var parser$1; +var hasRequiredParser$1; + +function requireParser$1 () { + if (hasRequiredParser$1) return parser$1; + hasRequiredParser$1 = 1; + + let AtRule = /*@__PURE__*/ requireAtRule(); + let Comment = /*@__PURE__*/ requireComment$1(); + let Declaration = /*@__PURE__*/ requireDeclaration(); + let Root = /*@__PURE__*/ requireRoot$1(); + let Rule = /*@__PURE__*/ requireRule(); + let tokenizer = /*@__PURE__*/ requireTokenize$1(); + + const SAFE_COMMENT_NEIGHBOR = { + empty: true, + space: true + }; + + function findLastWithPosition(tokens) { + for (let i = tokens.length - 1; i >= 0; i--) { + let token = tokens[i]; + let pos = token[3] || token[2]; + if (pos) return pos + } + } + + class Parser { + constructor(input) { + this.input = input; + + this.root = new Root(); + this.current = this.root; + this.spaces = ''; + this.semicolon = false; + + this.createTokenizer(); + this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; + } + + atrule(token) { + let node = new AtRule(); + node.name = token[1].slice(1); + if (node.name === '') { + this.unnamedAtrule(node, token); + } + this.init(node, token[2]); + + let type; + let prev; + let shift; + let last = false; + let open = false; + let params = []; + let brackets = []; + + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken(); + type = token[0]; + + if (type === '(' || type === '[') { + brackets.push(type === '(' ? ')' : ']'); + } else if (type === '{' && brackets.length > 0) { + brackets.push('}'); + } else if (type === brackets[brackets.length - 1]) { + brackets.pop(); + } + + if (brackets.length === 0) { + if (type === ';') { + node.source.end = this.getPosition(token[2]); + node.source.end.offset++; + this.semicolon = true; + break + } else if (type === '{') { + open = true; + break + } else if (type === '}') { + if (params.length > 0) { + shift = params.length - 1; + prev = params[shift]; + while (prev && prev[0] === 'space') { + prev = params[--shift]; + } + if (prev) { + node.source.end = this.getPosition(prev[3] || prev[2]); + node.source.end.offset++; + } + } + this.end(token); + break + } else { + params.push(token); + } + } else { + params.push(token); + } + + if (this.tokenizer.endOfFile()) { + last = true; + break + } + } + + node.raws.between = this.spacesAndCommentsFromEnd(params); + if (params.length) { + node.raws.afterName = this.spacesAndCommentsFromStart(params); + this.raw(node, 'params', params); + if (last) { + token = params[params.length - 1]; + node.source.end = this.getPosition(token[3] || token[2]); + node.source.end.offset++; + this.spaces = node.raws.between; + node.raws.between = ''; + } + } else { + node.raws.afterName = ''; + node.params = ''; + } + + if (open) { + node.nodes = []; + this.current = node; + } + } + + checkMissedSemicolon(tokens) { + let colon = this.colon(tokens); + if (colon === false) return + + let founded = 0; + let token; + for (let j = colon - 1; j >= 0; j--) { + token = tokens[j]; + if (token[0] !== 'space') { + founded += 1; + if (founded === 2) break + } + } + // If the token is a word, e.g. `!important`, `red` or any other valid property's value. + // Then we need to return the colon after that word token. [3] is the "end" colon of that word. + // And because we need it after that one we do +1 to get the next one. + throw this.input.error( + 'Missed semicolon', + token[0] === 'word' ? token[3] + 1 : token[2] + ) + } + + colon(tokens) { + let brackets = 0; + let prev, token, type; + for (let [i, element] of tokens.entries()) { + token = element; + type = token[0]; + + if (type === '(') { + brackets += 1; + } + if (type === ')') { + brackets -= 1; + } + if (brackets === 0 && type === ':') { + if (!prev) { + this.doubleColon(token); + } else if (prev[0] === 'word' && prev[1] === 'progid') { + continue + } else { + return i + } + } + + prev = token; + } + return false + } + + comment(token) { + let node = new Comment(); + this.init(node, token[2]); + node.source.end = this.getPosition(token[3] || token[2]); + node.source.end.offset++; + + let text = token[1].slice(2, -2); + if (/^\s*$/.test(text)) { + node.text = ''; + node.raws.left = text; + node.raws.right = ''; + } else { + let match = text.match(/^(\s*)([^]*\S)(\s*)$/); + node.text = match[2]; + node.raws.left = match[1]; + node.raws.right = match[3]; + } + } + + createTokenizer() { + this.tokenizer = tokenizer(this.input); + } + + decl(tokens, customProperty) { + let node = new Declaration(); + this.init(node, tokens[0][2]); + + let last = tokens[tokens.length - 1]; + if (last[0] === ';') { + this.semicolon = true; + tokens.pop(); + } + + node.source.end = this.getPosition( + last[3] || last[2] || findLastWithPosition(tokens) + ); + node.source.end.offset++; + + while (tokens[0][0] !== 'word') { + if (tokens.length === 1) this.unknownWord(tokens); + node.raws.before += tokens.shift()[1]; + } + node.source.start = this.getPosition(tokens[0][2]); + + node.prop = ''; + while (tokens.length) { + let type = tokens[0][0]; + if (type === ':' || type === 'space' || type === 'comment') { + break + } + node.prop += tokens.shift()[1]; + } + + node.raws.between = ''; + + let token; + while (tokens.length) { + token = tokens.shift(); + + if (token[0] === ':') { + node.raws.between += token[1]; + break + } else { + if (token[0] === 'word' && /\w/.test(token[1])) { + this.unknownWord([token]); + } + node.raws.between += token[1]; + } + } + + if (node.prop[0] === '_' || node.prop[0] === '*') { + node.raws.before += node.prop[0]; + node.prop = node.prop.slice(1); + } + + let firstSpaces = []; + let next; + while (tokens.length) { + next = tokens[0][0]; + if (next !== 'space' && next !== 'comment') break + firstSpaces.push(tokens.shift()); + } + + this.precheckMissedSemicolon(tokens); + + for (let i = tokens.length - 1; i >= 0; i--) { + token = tokens[i]; + if (token[1].toLowerCase() === '!important') { + node.important = true; + let string = this.stringFrom(tokens, i); + string = this.spacesFromEnd(tokens) + string; + if (string !== ' !important') node.raws.important = string; + break + } else if (token[1].toLowerCase() === 'important') { + let cache = tokens.slice(0); + let str = ''; + for (let j = i; j > 0; j--) { + let type = cache[j][0]; + if (str.trim().startsWith('!') && type !== 'space') { + break + } + str = cache.pop()[1] + str; + } + if (str.trim().startsWith('!')) { + node.important = true; + node.raws.important = str; + tokens = cache; + } + } + + if (token[0] !== 'space' && token[0] !== 'comment') { + break + } + } + + let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment'); + + if (hasWord) { + node.raws.between += firstSpaces.map(i => i[1]).join(''); + firstSpaces = []; + } + this.raw(node, 'value', firstSpaces.concat(tokens), customProperty); + + if (node.value.includes(':') && !customProperty) { + this.checkMissedSemicolon(tokens); + } + } + + doubleColon(token) { + throw this.input.error( + 'Double colon', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } + + emptyRule(token) { + let node = new Rule(); + this.init(node, token[2]); + node.selector = ''; + node.raws.between = ''; + this.current = node; + } + + end(token) { + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon; + } + this.semicolon = false; + + this.current.raws.after = (this.current.raws.after || '') + this.spaces; + this.spaces = ''; + + if (this.current.parent) { + this.current.source.end = this.getPosition(token[2]); + this.current.source.end.offset++; + this.current = this.current.parent; + } else { + this.unexpectedClose(token); + } + } + + endFile() { + if (this.current.parent) this.unclosedBlock(); + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon; + } + this.current.raws.after = (this.current.raws.after || '') + this.spaces; + this.root.source.end = this.getPosition(this.tokenizer.position()); + } + + freeSemicolon(token) { + this.spaces += token[1]; + if (this.current.nodes) { + let prev = this.current.nodes[this.current.nodes.length - 1]; + if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { + prev.raws.ownSemicolon = this.spaces; + this.spaces = ''; + } + } + } + + // Helpers + + getPosition(offset) { + let pos = this.input.fromOffset(offset); + return { + column: pos.col, + line: pos.line, + offset + } + } + + init(node, offset) { + this.current.push(node); + node.source = { + input: this.input, + start: this.getPosition(offset) + }; + node.raws.before = this.spaces; + this.spaces = ''; + if (node.type !== 'comment') this.semicolon = false; + } + + other(start) { + let end = false; + let type = null; + let colon = false; + let bracket = null; + let brackets = []; + let customProperty = start[1].startsWith('--'); + + let tokens = []; + let token = start; + while (token) { + type = token[0]; + tokens.push(token); + + if (type === '(' || type === '[') { + if (!bracket) bracket = token; + brackets.push(type === '(' ? ')' : ']'); + } else if (customProperty && colon && type === '{') { + if (!bracket) bracket = token; + brackets.push('}'); + } else if (brackets.length === 0) { + if (type === ';') { + if (colon) { + this.decl(tokens, customProperty); + return + } else { + break + } + } else if (type === '{') { + this.rule(tokens); + return + } else if (type === '}') { + this.tokenizer.back(tokens.pop()); + end = true; + break + } else if (type === ':') { + colon = true; + } + } else if (type === brackets[brackets.length - 1]) { + brackets.pop(); + if (brackets.length === 0) bracket = null; + } + + token = this.tokenizer.nextToken(); + } + + if (this.tokenizer.endOfFile()) end = true; + if (brackets.length > 0) this.unclosedBracket(bracket); + + if (end && colon) { + if (!customProperty) { + while (tokens.length) { + token = tokens[tokens.length - 1][0]; + if (token !== 'space' && token !== 'comment') break + this.tokenizer.back(tokens.pop()); + } + } + this.decl(tokens, customProperty); + } else { + this.unknownWord(tokens); + } + } + + parse() { + let token; + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken(); + + switch (token[0]) { + case 'space': + this.spaces += token[1]; + break + + case ';': + this.freeSemicolon(token); + break + + case '}': + this.end(token); + break + + case 'comment': + this.comment(token); + break + + case 'at-word': + this.atrule(token); + break + + case '{': + this.emptyRule(token); + break + + default: + this.other(token); + break + } + } + this.endFile(); + } + + precheckMissedSemicolon(/* tokens */) { + // Hook for Safe Parser + } + + raw(node, prop, tokens, customProperty) { + let token, type; + let length = tokens.length; + let value = ''; + let clean = true; + let next, prev; + + for (let i = 0; i < length; i += 1) { + token = tokens[i]; + type = token[0]; + if (type === 'space' && i === length - 1 && !customProperty) { + clean = false; + } else if (type === 'comment') { + prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'; + next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'; + if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { + if (value.slice(-1) === ',') { + clean = false; + } else { + value += token[1]; + } + } else { + clean = false; + } + } else { + value += token[1]; + } + } + if (!clean) { + let raw = tokens.reduce((all, i) => all + i[1], ''); + node.raws[prop] = { raw, value }; + } + node[prop] = value; + } + + rule(tokens) { + tokens.pop(); + + let node = new Rule(); + this.init(node, tokens[0][2]); + + node.raws.between = this.spacesAndCommentsFromEnd(tokens); + this.raw(node, 'selector', tokens); + this.current = node; + } + + spacesAndCommentsFromEnd(tokens) { + let lastTokenType; + let spaces = ''; + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0]; + if (lastTokenType !== 'space' && lastTokenType !== 'comment') break + spaces = tokens.pop()[1] + spaces; + } + return spaces + } + + // Errors + + spacesAndCommentsFromStart(tokens) { + let next; + let spaces = ''; + while (tokens.length) { + next = tokens[0][0]; + if (next !== 'space' && next !== 'comment') break + spaces += tokens.shift()[1]; + } + return spaces + } + + spacesFromEnd(tokens) { + let lastTokenType; + let spaces = ''; + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0]; + if (lastTokenType !== 'space') break + spaces = tokens.pop()[1] + spaces; + } + return spaces + } + + stringFrom(tokens, from) { + let result = ''; + for (let i = from; i < tokens.length; i++) { + result += tokens[i][1]; + } + tokens.splice(from, tokens.length - from); + return result + } + + unclosedBlock() { + let pos = this.current.source.start; + throw this.input.error('Unclosed block', pos.line, pos.column) + } + + unclosedBracket(bracket) { + throw this.input.error( + 'Unclosed bracket', + { offset: bracket[2] }, + { offset: bracket[2] + 1 } + ) + } + + unexpectedClose(token) { + throw this.input.error( + 'Unexpected }', + { offset: token[2] }, + { offset: token[2] + 1 } + ) + } + + unknownWord(tokens) { + throw this.input.error( + 'Unknown word', + { offset: tokens[0][2] }, + { offset: tokens[0][2] + tokens[0][1].length } + ) + } + + unnamedAtrule(node, token) { + throw this.input.error( + 'At-rule without name', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } + } + + parser$1 = Parser; + return parser$1; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + let Input = /*@__PURE__*/ requireInput(); + let Parser = /*@__PURE__*/ requireParser$1(); + + function parse(css, opts) { + let input = new Input(css, opts); + let parser = new Parser(input); + try { + parser.parse(); + } catch (e) { + if (browser$1.env.NODE_ENV !== 'production') { + if (e.name === 'CssSyntaxError' && opts && opts.from) { + if (/\.scss$/i.test(opts.from)) { + e.message += + '\nYou tried to parse SCSS with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-scss parser'; + } else if (/\.sass/i.test(opts.from)) { + e.message += + '\nYou tried to parse Sass with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-sass parser'; + } else if (/\.less$/i.test(opts.from)) { + e.message += + '\nYou tried to parse Less with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-less parser'; + } + } + } + throw e + } + + return parser.root + } + + parse_1 = parse; + parse.default = parse; + + Container.registerParse(parse); + return parse_1; +} + +var warning; +var hasRequiredWarning; + +function requireWarning () { + if (hasRequiredWarning) return warning; + hasRequiredWarning = 1; + + class Warning { + constructor(text, opts = {}) { + this.type = 'warning'; + this.text = text; + + if (opts.node && opts.node.source) { + let range = opts.node.rangeBy(opts); + this.line = range.start.line; + this.column = range.start.column; + this.endLine = range.end.line; + this.endColumn = range.end.column; + } + + for (let opt in opts) this[opt] = opts[opt]; + } + + toString() { + if (this.node) { + return this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word + }).message + } + + if (this.plugin) { + return this.plugin + ': ' + this.text + } + + return this.text + } + } + + warning = Warning; + Warning.default = Warning; + return warning; +} + +var result; +var hasRequiredResult; + +function requireResult () { + if (hasRequiredResult) return result; + hasRequiredResult = 1; + + let Warning = /*@__PURE__*/ requireWarning(); + + class Result { + constructor(processor, root, opts) { + this.processor = processor; + this.messages = []; + this.root = root; + this.opts = opts; + this.css = undefined; + this.map = undefined; + } + + toString() { + return this.css + } + + warn(text, opts = {}) { + if (!opts.plugin) { + if (this.lastPlugin && this.lastPlugin.postcssPlugin) { + opts.plugin = this.lastPlugin.postcssPlugin; + } + } + + let warning = new Warning(text, opts); + this.messages.push(warning); + + return warning + } + + warnings() { + return this.messages.filter(i => i.type === 'warning') + } + + get content() { + return this.css + } + } + + result = Result; + Result.default = Result; + return result; +} + +/* eslint-disable no-console */ + +var warnOnce; +var hasRequiredWarnOnce; + +function requireWarnOnce () { + if (hasRequiredWarnOnce) return warnOnce; + hasRequiredWarnOnce = 1; + + let printed = {}; + + warnOnce = function warnOnce(message) { + if (printed[message]) return + printed[message] = true; + + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + }; + return warnOnce; +} + +var lazyResult; +var hasRequiredLazyResult; + +function requireLazyResult () { + if (hasRequiredLazyResult) return lazyResult; + hasRequiredLazyResult = 1; + + let Container = /*@__PURE__*/ requireContainer$1(); + let Document = /*@__PURE__*/ requireDocument(); + let MapGenerator = /*@__PURE__*/ requireMapGenerator(); + let parse = /*@__PURE__*/ requireParse(); + let Result = /*@__PURE__*/ requireResult(); + let Root = /*@__PURE__*/ requireRoot$1(); + let stringify = /*@__PURE__*/ requireStringify(); + let { isClean, my } = /*@__PURE__*/ requireSymbols(); + let warnOnce = /*@__PURE__*/ requireWarnOnce(); + + const TYPE_TO_CLASS_NAME = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule' + }; + + const PLUGIN_PROPS = { + AtRule: true, + AtRuleExit: true, + Comment: true, + CommentExit: true, + Declaration: true, + DeclarationExit: true, + Document: true, + DocumentExit: true, + Once: true, + OnceExit: true, + postcssPlugin: true, + prepare: true, + Root: true, + RootExit: true, + Rule: true, + RuleExit: true + }; + + const NOT_VISITORS = { + Once: true, + postcssPlugin: true, + prepare: true + }; + + const CHILDREN = 0; + + function isPromise(obj) { + return typeof obj === 'object' && typeof obj.then === 'function' + } + + function getEvents(node) { + let key = false; + let type = TYPE_TO_CLASS_NAME[node.type]; + if (node.type === 'decl') { + key = node.prop.toLowerCase(); + } else if (node.type === 'atrule') { + key = node.name.toLowerCase(); + } + + if (key && node.append) { + return [ + type, + type + '-' + key, + CHILDREN, + type + 'Exit', + type + 'Exit-' + key + ] + } else if (key) { + return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] + } else if (node.append) { + return [type, CHILDREN, type + 'Exit'] + } else { + return [type, type + 'Exit'] + } + } + + function toStack(node) { + let events; + if (node.type === 'document') { + events = ['Document', CHILDREN, 'DocumentExit']; + } else if (node.type === 'root') { + events = ['Root', CHILDREN, 'RootExit']; + } else { + events = getEvents(node); + } + + return { + eventIndex: 0, + events, + iterator: 0, + node, + visitorIndex: 0, + visitors: [] + } + } + + function cleanMarks(node) { + node[isClean] = false; + if (node.nodes) node.nodes.forEach(i => cleanMarks(i)); + return node + } + + let postcss = {}; + + class LazyResult { + constructor(processor, css, opts) { + this.stringified = false; + this.processed = false; + + let root; + if ( + typeof css === 'object' && + css !== null && + (css.type === 'root' || css.type === 'document') + ) { + root = cleanMarks(css); + } else if (css instanceof LazyResult || css instanceof Result) { + root = cleanMarks(css.root); + if (css.map) { + if (typeof opts.map === 'undefined') opts.map = {}; + if (!opts.map.inline) opts.map.inline = false; + opts.map.prev = css.map; + } + } else { + let parser = parse; + if (opts.syntax) parser = opts.syntax.parse; + if (opts.parser) parser = opts.parser; + if (parser.parse) parser = parser.parse; + + try { + root = parser(css, opts); + } catch (error) { + this.processed = true; + this.error = error; + } + + if (root && !root[my]) { + /* c8 ignore next 2 */ + Container.rebuild(root); + } + } + + this.result = new Result(processor, root, opts); + this.helpers = { ...postcss, postcss, result: this.result }; + this.plugins = this.processor.plugins.map(plugin => { + if (typeof plugin === 'object' && plugin.prepare) { + return { ...plugin, ...plugin.prepare(this.result) } + } else { + return plugin + } + }); + } + + async() { + if (this.error) return Promise.reject(this.error) + if (this.processed) return Promise.resolve(this.result) + if (!this.processing) { + this.processing = this.runAsync(); + } + return this.processing + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins') + } + + handleError(error, node) { + let plugin = this.result.lastPlugin; + try { + if (node) node.addToError(error); + this.error = error; + if (error.name === 'CssSyntaxError' && !error.plugin) { + error.plugin = plugin.postcssPlugin; + error.setMessage(); + } else if (plugin.postcssVersion) { + if (browser$1.env.NODE_ENV !== 'production') { + let pluginName = plugin.postcssPlugin; + let pluginVer = plugin.postcssVersion; + let runtimeVer = this.result.processor.version; + let a = pluginVer.split('.'); + let b = runtimeVer.split('.'); + + if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { + // eslint-disable-next-line no-console + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS ' + + 'version is ' + + runtimeVer + + ', but ' + + pluginName + + ' uses ' + + pluginVer + + '. Perhaps this is the source of the error below.' + ); + } + } + } + } catch (err) { + /* c8 ignore next 3 */ + // eslint-disable-next-line no-console + if (console && console.error) console.error(err); + } + return error + } + + prepareVisitors() { + this.listeners = {}; + let add = (plugin, type, cb) => { + if (!this.listeners[type]) this.listeners[type] = []; + this.listeners[type].push([plugin, cb]); + }; + for (let plugin of this.plugins) { + if (typeof plugin === 'object') { + for (let event in plugin) { + if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { + throw new Error( + `Unknown event ${event} in ${plugin.postcssPlugin}. ` + + `Try to update PostCSS (${this.processor.version} now).` + ) + } + if (!NOT_VISITORS[event]) { + if (typeof plugin[event] === 'object') { + for (let filter in plugin[event]) { + if (filter === '*') { + add(plugin, event, plugin[event][filter]); + } else { + add( + plugin, + event + '-' + filter.toLowerCase(), + plugin[event][filter] + ); + } + } + } else if (typeof plugin[event] === 'function') { + add(plugin, event, plugin[event]); + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0; + } + + async runAsync() { + this.plugin = 0; + for (let i = 0; i < this.plugins.length; i++) { + let plugin = this.plugins[i]; + let promise = this.runOnRoot(plugin); + if (isPromise(promise)) { + try { + await promise; + } catch (error) { + throw this.handleError(error) + } + } + } + + this.prepareVisitors(); + if (this.hasListener) { + let root = this.result.root; + while (!root[isClean]) { + root[isClean] = true; + let stack = [toStack(root)]; + while (stack.length > 0) { + let promise = this.visitTick(stack); + if (isPromise(promise)) { + try { + await promise; + } catch (e) { + let node = stack[stack.length - 1].node; + throw this.handleError(e, node) + } + } + } + } + + if (this.listeners.OnceExit) { + for (let [plugin, visitor] of this.listeners.OnceExit) { + this.result.lastPlugin = plugin; + try { + if (root.type === 'document') { + let roots = root.nodes.map(subRoot => + visitor(subRoot, this.helpers) + ); + + await Promise.all(roots); + } else { + await visitor(root, this.helpers); + } + } catch (e) { + throw this.handleError(e) + } + } + } + } + + this.processed = true; + return this.stringify() + } + + runOnRoot(plugin) { + this.result.lastPlugin = plugin; + try { + if (typeof plugin === 'object' && plugin.Once) { + if (this.result.root.type === 'document') { + let roots = this.result.root.nodes.map(root => + plugin.Once(root, this.helpers) + ); + + if (isPromise(roots[0])) { + return Promise.all(roots) + } + + return roots + } + + return plugin.Once(this.result.root, this.helpers) + } else if (typeof plugin === 'function') { + return plugin(this.result.root, this.result) + } + } catch (error) { + throw this.handleError(error) + } + } + + stringify() { + if (this.error) throw this.error + if (this.stringified) return this.result + this.stringified = true; + + this.sync(); + + let opts = this.result.opts; + let str = stringify; + if (opts.syntax) str = opts.syntax.stringify; + if (opts.stringifier) str = opts.stringifier; + if (str.stringify) str = str.stringify; + + let map = new MapGenerator(str, this.result.root, this.result.opts); + let data = map.generate(); + this.result.css = data[0]; + this.result.map = data[1]; + + return this.result + } + + sync() { + if (this.error) throw this.error + if (this.processed) return this.result + this.processed = true; + + if (this.processing) { + throw this.getAsyncError() + } + + for (let plugin of this.plugins) { + let promise = this.runOnRoot(plugin); + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + + this.prepareVisitors(); + if (this.hasListener) { + let root = this.result.root; + while (!root[isClean]) { + root[isClean] = true; + this.walkSync(root); + } + if (this.listeners.OnceExit) { + if (root.type === 'document') { + for (let subRoot of root.nodes) { + this.visitSync(this.listeners.OnceExit, subRoot); + } + } else { + this.visitSync(this.listeners.OnceExit, root); + } + } + } + + return this.result + } + + then(onFulfilled, onRejected) { + if (browser$1.env.NODE_ENV !== 'production') { + if (!('from' in this.opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ); + } + } + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this.css + } + + visitSync(visitors, node) { + for (let [plugin, visitor] of visitors) { + this.result.lastPlugin = plugin; + let promise; + try { + promise = visitor(node, this.helpers); + } catch (e) { + throw this.handleError(e, node.proxyOf) + } + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + return true + } + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + } + + visitTick(stack) { + let visit = stack[stack.length - 1]; + let { node, visitors } = visit; + + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + stack.pop(); + return + } + + if (visitors.length > 0 && visit.visitorIndex < visitors.length) { + let [plugin, visitor] = visitors[visit.visitorIndex]; + visit.visitorIndex += 1; + if (visit.visitorIndex === visitors.length) { + visit.visitors = []; + visit.visitorIndex = 0; + } + this.result.lastPlugin = plugin; + try { + return visitor(node.toProxy(), this.helpers) + } catch (e) { + throw this.handleError(e, node) + } + } + + if (visit.iterator !== 0) { + let iterator = visit.iterator; + let child; + while ((child = node.nodes[node.indexes[iterator]])) { + node.indexes[iterator] += 1; + if (!child[isClean]) { + child[isClean] = true; + stack.push(toStack(child)); + return + } + } + visit.iterator = 0; + delete node.indexes[iterator]; + } + + let events = visit.events; + while (visit.eventIndex < events.length) { + let event = events[visit.eventIndex]; + visit.eventIndex += 1; + if (event === CHILDREN) { + if (node.nodes && node.nodes.length) { + node[isClean] = true; + visit.iterator = node.getIterator(); + } + return + } else if (this.listeners[event]) { + visit.visitors = this.listeners[event]; + return + } + } + stack.pop(); + } + + walkSync(node) { + node[isClean] = true; + let events = getEvents(node); + for (let event of events) { + if (event === CHILDREN) { + if (node.nodes) { + node.each(child => { + if (!child[isClean]) this.walkSync(child); + }); + } + } else { + let visitors = this.listeners[event]; + if (visitors) { + if (this.visitSync(visitors, node.toProxy())) return + } + } + } + } + + warnings() { + return this.sync().warnings() + } + + get content() { + return this.stringify().content + } + + get css() { + return this.stringify().css + } + + get map() { + return this.stringify().map + } + + get messages() { + return this.sync().messages + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + return this.sync().root + } + + get [Symbol.toStringTag]() { + return 'LazyResult' + } + } + + LazyResult.registerPostcss = dependant => { + postcss = dependant; + }; + + lazyResult = LazyResult; + LazyResult.default = LazyResult; + + Root.registerLazyResult(LazyResult); + Document.registerLazyResult(LazyResult); + return lazyResult; +} + +var noWorkResult; +var hasRequiredNoWorkResult; + +function requireNoWorkResult () { + if (hasRequiredNoWorkResult) return noWorkResult; + hasRequiredNoWorkResult = 1; + + let MapGenerator = /*@__PURE__*/ requireMapGenerator(); + let parse = /*@__PURE__*/ requireParse(); + const Result = /*@__PURE__*/ requireResult(); + let stringify = /*@__PURE__*/ requireStringify(); + let warnOnce = /*@__PURE__*/ requireWarnOnce(); + + class NoWorkResult { + constructor(processor, css, opts) { + css = css.toString(); + this.stringified = false; + + this._processor = processor; + this._css = css; + this._opts = opts; + this._map = undefined; + let root; + + let str = stringify; + this.result = new Result(this._processor, root, this._opts); + this.result.css = css; + + let self = this; + Object.defineProperty(this.result, 'root', { + get() { + return self.root + } + }); + + let map = new MapGenerator(str, root, this._opts, css); + if (map.isMap()) { + let [generatedCSS, generatedMap] = map.generate(); + if (generatedCSS) { + this.result.css = generatedCSS; + } + if (generatedMap) { + this.result.map = generatedMap; + } + } else { + map.clearAnnotation(); + this.result.css = map.css; + } + } + + async() { + if (this.error) return Promise.reject(this.error) + return Promise.resolve(this.result) + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + sync() { + if (this.error) throw this.error + return this.result + } + + then(onFulfilled, onRejected) { + if (browser$1.env.NODE_ENV !== 'production') { + if (!('from' in this._opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ); + } + } + + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this._css + } + + warnings() { + return [] + } + + get content() { + return this.result.css + } + + get css() { + return this.result.css + } + + get map() { + return this.result.map + } + + get messages() { + return [] + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + if (this._root) { + return this._root + } + + let root; + let parser = parse; + + try { + root = parser(this._css, this._opts); + } catch (error) { + this.error = error; + } + + if (this.error) { + throw this.error + } else { + this._root = root; + return root + } + } + + get [Symbol.toStringTag]() { + return 'NoWorkResult' + } + } + + noWorkResult = NoWorkResult; + NoWorkResult.default = NoWorkResult; + return noWorkResult; +} + +var processor$1; +var hasRequiredProcessor$1; + +function requireProcessor$1 () { + if (hasRequiredProcessor$1) return processor$1; + hasRequiredProcessor$1 = 1; + + let Document = /*@__PURE__*/ requireDocument(); + let LazyResult = /*@__PURE__*/ requireLazyResult(); + let NoWorkResult = /*@__PURE__*/ requireNoWorkResult(); + let Root = /*@__PURE__*/ requireRoot$1(); + + class Processor { + constructor(plugins = []) { + this.version = '8.4.48'; + this.plugins = this.normalize(plugins); + } + + normalize(plugins) { + let normalized = []; + for (let i of plugins) { + if (i.postcss === true) { + i = i(); + } else if (i.postcss) { + i = i.postcss; + } + + if (typeof i === 'object' && Array.isArray(i.plugins)) { + normalized = normalized.concat(i.plugins); + } else if (typeof i === 'object' && i.postcssPlugin) { + normalized.push(i); + } else if (typeof i === 'function') { + normalized.push(i); + } else if (typeof i === 'object' && (i.parse || i.stringify)) { + if (browser$1.env.NODE_ENV !== 'production') { + throw new Error( + 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + + 'one of the syntax/parser/stringifier options as outlined ' + + 'in your PostCSS runner documentation.' + ) + } + } else { + throw new Error(i + ' is not a PostCSS plugin') + } + } + return normalized + } + + process(css, opts = {}) { + if ( + !this.plugins.length && + !opts.parser && + !opts.stringifier && + !opts.syntax + ) { + return new NoWorkResult(this, css, opts) + } else { + return new LazyResult(this, css, opts) + } + } + + use(plugin) { + this.plugins = this.plugins.concat(this.normalize([plugin])); + return this + } + } + + processor$1 = Processor; + Processor.default = Processor; + + Root.registerProcessor(Processor); + Document.registerProcessor(Processor); + return processor$1; +} + +var postcss_1; +var hasRequiredPostcss; + +function requirePostcss () { + if (hasRequiredPostcss) return postcss_1; + hasRequiredPostcss = 1; + + let AtRule = /*@__PURE__*/ requireAtRule(); + let Comment = /*@__PURE__*/ requireComment$1(); + let Container = /*@__PURE__*/ requireContainer$1(); + let CssSyntaxError = /*@__PURE__*/ requireCssSyntaxError(); + let Declaration = /*@__PURE__*/ requireDeclaration(); + let Document = /*@__PURE__*/ requireDocument(); + let fromJSON = /*@__PURE__*/ requireFromJSON(); + let Input = /*@__PURE__*/ requireInput(); + let LazyResult = /*@__PURE__*/ requireLazyResult(); + let list = /*@__PURE__*/ requireList(); + let Node = /*@__PURE__*/ requireNode$2(); + let parse = /*@__PURE__*/ requireParse(); + let Processor = /*@__PURE__*/ requireProcessor$1(); + let Result = /*@__PURE__*/ requireResult(); + let Root = /*@__PURE__*/ requireRoot$1(); + let Rule = /*@__PURE__*/ requireRule(); + let stringify = /*@__PURE__*/ requireStringify(); + let Warning = /*@__PURE__*/ requireWarning(); + + function postcss(...plugins) { + if (plugins.length === 1 && Array.isArray(plugins[0])) { + plugins = plugins[0]; + } + return new Processor(plugins) + } + + postcss.plugin = function plugin(name, initializer) { + let warningPrinted = false; + function creator(...args) { + // eslint-disable-next-line no-console + if (console && console.warn && !warningPrinted) { + warningPrinted = true; + // eslint-disable-next-line no-console + console.warn( + name + + ': postcss.plugin was deprecated. Migration guide:\n' + + 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' + ); + if (browser$1.env.LANG && browser$1.env.LANG.startsWith('cn')) { + /* c8 ignore next 7 */ + // eslint-disable-next-line no-console + console.warn( + name + + ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + + 'https://www.w3ctech.com/topic/2226' + ); + } + } + let transformer = initializer(...args); + transformer.postcssPlugin = name; + transformer.postcssVersion = new Processor().version; + return transformer + } + + let cache; + Object.defineProperty(creator, 'postcss', { + get() { + if (!cache) cache = creator(); + return cache + } + }); + + creator.process = function (css, processOpts, pluginOpts) { + return postcss([creator(pluginOpts)]).process(css, processOpts) + }; + + return creator + }; + + postcss.stringify = stringify; + postcss.parse = parse; + postcss.fromJSON = fromJSON; + postcss.list = list; + + postcss.comment = defaults => new Comment(defaults); + postcss.atRule = defaults => new AtRule(defaults); + postcss.decl = defaults => new Declaration(defaults); + postcss.rule = defaults => new Rule(defaults); + postcss.root = defaults => new Root(defaults); + postcss.document = defaults => new Document(defaults); + + postcss.CssSyntaxError = CssSyntaxError; + postcss.Declaration = Declaration; + postcss.Container = Container; + postcss.Processor = Processor; + postcss.Document = Document; + postcss.Comment = Comment; + postcss.Warning = Warning; + postcss.AtRule = AtRule; + postcss.Result = Result; + postcss.Input = Input; + postcss.Rule = Rule; + postcss.Root = Root; + postcss.Node = Node; + + LazyResult.registerPostcss(postcss); + + postcss_1 = postcss; + postcss.default = postcss; + return postcss_1; +} + +var postcssExports = /*@__PURE__*/ requirePostcss(); +var postcss = /*@__PURE__*/getDefaultExportFromCjs(postcssExports); + +postcss.stringify; +postcss.fromJSON; +postcss.plugin; +postcss.parse; +postcss.list; + +postcss.document; +postcss.comment; +postcss.atRule; +postcss.rule; +postcss.decl; +postcss.root; + +postcss.CssSyntaxError; +postcss.Declaration; +postcss.Container; +postcss.Processor; +postcss.Document; +postcss.Comment; +postcss.Warning; +postcss.AtRule; +postcss.Result; +postcss.Input; +const Rule = postcss.Rule; +postcss.Root; +postcss.Node; + +const trimPlugin = () => { + return { + postcssPlugin: "vue-sfc-trim", + Once(root) { + root.walk(({ type, raws }) => { + if (type === "rule" || type === "atrule") { + if (raws.before) raws.before = "\n"; + if ("after" in raws && raws.after) raws.after = "\n"; + } + }); + } + }; +}; +trimPlugin.postcss = true; + +var dist = {exports: {}}; + +var processor = {exports: {}}; + +var parser = {exports: {}}; + +var root = {exports: {}}; + +var container = {exports: {}}; + +var node$1 = {exports: {}}; + +var util$1 = {}; + +var unesc = {exports: {}}; + +var hasRequiredUnesc; + +function requireUnesc () { + if (hasRequiredUnesc) return unesc.exports; + hasRequiredUnesc = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = unesc; + // Many thanks for this post which made this migration much easier. + // https://mathiasbynens.be/notes/css-escapes + + /** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ + function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); + // check to see if we are dealing with a valid hex char [a-f|0-9] + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + spaceTerminated = code === 32; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return undefined; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; + // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + + // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + + // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; + } + module.exports = exports.default; + } (unesc, unesc.exports)); + return unesc.exports; +} + +var getProp = {exports: {}}; + +var hasRequiredGetProp; + +function requireGetProp () { + if (hasRequiredGetProp) return getProp.exports; + hasRequiredGetProp = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = getProp; + function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return undefined; + } + obj = obj[prop]; + } + return obj; + } + module.exports = exports.default; + } (getProp, getProp.exports)); + return getProp.exports; +} + +var ensureObject = {exports: {}}; + +var hasRequiredEnsureObject; + +function requireEnsureObject () { + if (hasRequiredEnsureObject) return ensureObject.exports; + hasRequiredEnsureObject = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = ensureObject; + function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } + } + module.exports = exports.default; + } (ensureObject, ensureObject.exports)); + return ensureObject.exports; +} + +var stripComments = {exports: {}}; + +var hasRequiredStripComments; + +function requireStripComments () { + if (hasRequiredStripComments) return stripComments.exports; + hasRequiredStripComments = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = stripComments; + function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; + } + module.exports = exports.default; + } (stripComments, stripComments.exports)); + return stripComments.exports; +} + +var hasRequiredUtil$1; + +function requireUtil$1 () { + if (hasRequiredUtil$1) return util$1; + hasRequiredUtil$1 = 1; + + util$1.__esModule = true; + util$1.unesc = util$1.stripComments = util$1.getProp = util$1.ensureObject = void 0; + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc()); + util$1.unesc = _unesc["default"]; + var _getProp = _interopRequireDefault(/*@__PURE__*/ requireGetProp()); + util$1.getProp = _getProp["default"]; + var _ensureObject = _interopRequireDefault(/*@__PURE__*/ requireEnsureObject()); + util$1.ensureObject = _ensureObject["default"]; + var _stripComments = _interopRequireDefault(/*@__PURE__*/ requireStripComments()); + util$1.stripComments = _stripComments["default"]; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + return util$1; +} + +var hasRequiredNode$1; + +function requireNode$1 () { + if (hasRequiredNode$1) return node$1.exports; + hasRequiredNode$1 = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _util = /*@__PURE__*/ requireUtil$1(); + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + return cloned; + }; + var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + var _proto = Node.prototype; + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + this.raws[name] = valueEscaped; + } + + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + if (this.raws) { + delete this.raws[name]; + } + } + + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return undefined; + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node; + }(); + exports["default"] = Node; + module.exports = exports.default; + } (node$1, node$1.exports)); + return node$1.exports; +} + +var types = {}; + +var hasRequiredTypes; + +function requireTypes () { + if (hasRequiredTypes) return types; + hasRequiredTypes = 1; + + types.__esModule = true; + types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = void 0; + var TAG = 'tag'; + types.TAG = TAG; + var STRING = 'string'; + types.STRING = STRING; + var SELECTOR = 'selector'; + types.SELECTOR = SELECTOR; + var ROOT = 'root'; + types.ROOT = ROOT; + var PSEUDO = 'pseudo'; + types.PSEUDO = PSEUDO; + var NESTING = 'nesting'; + types.NESTING = NESTING; + var ID = 'id'; + types.ID = ID; + var COMMENT = 'comment'; + types.COMMENT = COMMENT; + var COMBINATOR = 'combinator'; + types.COMBINATOR = COMBINATOR; + var CLASS = 'class'; + types.CLASS = CLASS; + var ATTRIBUTE = 'attribute'; + types.ATTRIBUTE = ATTRIBUTE; + var UNIVERSAL = 'universal'; + types.UNIVERSAL = UNIVERSAL; + return types; +} + +var hasRequiredContainer; + +function requireContainer () { + if (hasRequiredContainer) return container.exports; + hasRequiredContainer = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + function Container(opts) { + var _this; + _this = _Node.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + var _proto = Container.prototype; + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + for (var id in this.indexes) { + this.indexes[id]++; + } + return this; + }; + _proto.at = function at(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex < index) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= oldIndex) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return undefined; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + if (result !== false && node.length) { + result = node.walk(callback); + } + if (result === false) { + return false; + } + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function (selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function (selector) { + if (selector.type === types.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function (selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function (selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function (selector) { + if (selector.type === types.ID) { + return callback.call(_this6, selector); + } + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function (selector) { + if (selector.type === types.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function (selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function (selector) { + if (selector.type === types.TAG) { + return callback.call(_this9, selector); + } + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function (selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString() { + return this.map(String).join(''); + }; + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + return Container; + }(_node["default"]); + exports["default"] = Container; + module.exports = exports.default; + } (container, container.exports)); + return container.exports; +} + +var hasRequiredRoot; + +function requireRoot () { + if (hasRequiredRoot) return root.exports; + hasRequiredRoot = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + function Root(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + var _proto = Root.prototype; + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root; + }(_container["default"]); + exports["default"] = Root; + module.exports = exports.default; + } (root, root.exports)); + return root.exports; +} + +var selector = {exports: {}}; + +var hasRequiredSelector; + +function requireSelector () { + if (hasRequiredSelector) return selector.exports; + hasRequiredSelector = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + function Selector(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + return Selector; + }(_container["default"]); + exports["default"] = Selector; + module.exports = exports.default; + } (selector, selector.exports)); + return selector.exports; +} + +var className = {exports: {}}; + +/*! https://mths.be/cssesc v3.0.0 by @mathias */ + +var cssesc_1; +var hasRequiredCssesc; + +function requireCssesc () { + if (hasRequiredCssesc) return cssesc_1; + hasRequiredCssesc = 1; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; + }; + + var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; + var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; + var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + + // https://mathiasbynens.be/notes/css-escapes#css + var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; + }; + + // Expose default options (so they can be overridden globally). + cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false + }; + + cssesc.version = '3.0.0'; + + cssesc_1 = cssesc; + return cssesc_1; +} + +var hasRequiredClassName; + +function requireClassName () { + if (hasRequiredClassName) return className.exports; + hasRequiredClassName = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil$1(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + function ClassName(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName.prototype; + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v; + } + }]); + return ClassName; + }(_node["default"]); + exports["default"] = ClassName; + module.exports = exports.default; + } (className, className.exports)); + return className.exports; +} + +var comment = {exports: {}}; + +var hasRequiredComment; + +function requireComment () { + if (hasRequiredComment) return comment.exports; + hasRequiredComment = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + function Comment(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + return Comment; + }(_node["default"]); + exports["default"] = Comment; + module.exports = exports.default; + } (comment, comment.exports)); + return comment.exports; +} + +var id = {exports: {}}; + +var hasRequiredId; + +function requireId () { + if (hasRequiredId) return id.exports; + hasRequiredId = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + function ID(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + var _proto = ID.prototype; + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + return ID; + }(_node["default"]); + exports["default"] = ID; + module.exports = exports.default; + } (id, id.exports)); + return id.exports; +} + +var tag = {exports: {}}; + +var namespace = {exports: {}}; + +var hasRequiredNamespace; + +function requireNamespace () { + if (hasRequiredNamespace) return namespace.exports; + hasRequiredNamespace = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _util = /*@__PURE__*/ requireUtil$1(); + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + function Namespace() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + return Namespace; + }(_node["default"]); + exports["default"] = Namespace; + module.exports = exports.default; + } (namespace, namespace.exports)); + return namespace.exports; +} + +var hasRequiredTag; + +function requireTag () { + if (hasRequiredTag) return tag.exports; + hasRequiredTag = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + function Tag(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + return Tag; + }(_namespace["default"]); + exports["default"] = Tag; + module.exports = exports.default; + } (tag, tag.exports)); + return tag.exports; +} + +var string = {exports: {}}; + +var hasRequiredString; + +function requireString () { + if (hasRequiredString) return string.exports; + hasRequiredString = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + function String(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + return String; + }(_node["default"]); + exports["default"] = String; + module.exports = exports.default; + } (string, string.exports)); + return string.exports; +} + +var pseudo = {exports: {}}; + +var hasRequiredPseudo; + +function requirePseudo () { + if (hasRequiredPseudo) return pseudo.exports; + hasRequiredPseudo = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + function Pseudo(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + var _proto = Pseudo.prototype; + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + return Pseudo; + }(_container["default"]); + exports["default"] = Pseudo; + module.exports = exports.default; + } (pseudo, pseudo.exports)); + return pseudo.exports; +} + +var attribute = {}; + +var node; +var hasRequiredNode; + +function requireNode () { + if (hasRequiredNode) return node; + hasRequiredNode = 1; + /** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + + node = require$$0.deprecate; + return node; +} + +var hasRequiredAttribute; + +function requireAttribute () { + if (hasRequiredAttribute) return attribute; + hasRequiredAttribute = 1; + (function (exports) { + + exports.__esModule = true; + exports["default"] = void 0; + exports.unescapeValue = unescapeValue; + var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); + var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc()); + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + var _CSSESC_QUOTE_OPTIONS; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var deprecate = /*@__PURE__*/ requireNode(); + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + if (opts.value === undefined) { + return opts; + } + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + function Attribute(opts) { + var _this; + if (opts === void 0) { + opts = {}; + } + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */; + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + } + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + } + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + if (name === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + _proto.toString = function toString() { + var _this2 = this; + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "insensitive", + get: function get() { + return this._insensitive; + } + + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + + // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. + // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. + if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { + this.raws.insensitiveFlag = undefined; + } + } + this._insensitive = insensitive; + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + }]); + return Attribute; + }(_namespace["default"]); + exports["default"] = Attribute; + Attribute.NO_QUOTE = null; + Attribute.SINGLE_QUOTE = "'"; + Attribute.DOUBLE_QUOTE = '"'; + var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } + }, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true + }, _CSSESC_QUOTE_OPTIONS); + function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; + } + } (attribute)); + return attribute; +} + +var universal = {exports: {}}; + +var hasRequiredUniversal; + +function requireUniversal () { + if (hasRequiredUniversal) return universal.exports; + hasRequiredUniversal = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + function Universal(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + return Universal; + }(_namespace["default"]); + exports["default"] = Universal; + module.exports = exports.default; + } (universal, universal.exports)); + return universal.exports; +} + +var combinator = {exports: {}}; + +var hasRequiredCombinator; + +function requireCombinator () { + if (hasRequiredCombinator) return combinator.exports; + hasRequiredCombinator = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + function Combinator(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + return Combinator; + }(_node["default"]); + exports["default"] = Combinator; + module.exports = exports.default; + } (combinator, combinator.exports)); + return combinator.exports; +} + +var nesting = {exports: {}}; + +var hasRequiredNesting; + +function requireNesting () { + if (hasRequiredNesting) return nesting.exports; + hasRequiredNesting = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$1()); + var _types = /*@__PURE__*/ requireTypes(); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + function Nesting(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + return Nesting; + }(_node["default"]); + exports["default"] = Nesting; + module.exports = exports.default; + } (nesting, nesting.exports)); + return nesting.exports; +} + +var sortAscending = {exports: {}}; + +var hasRequiredSortAscending; + +function requireSortAscending () { + if (hasRequiredSortAscending) return sortAscending.exports; + hasRequiredSortAscending = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = sortAscending; + function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); + } + module.exports = exports.default; + } (sortAscending, sortAscending.exports)); + return sortAscending.exports; +} + +var tokenize = {}; + +var tokenTypes = {}; + +var hasRequiredTokenTypes; + +function requireTokenTypes () { + if (hasRequiredTokenTypes) return tokenTypes; + hasRequiredTokenTypes = 1; + + tokenTypes.__esModule = true; + tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0; + var ampersand = 38; // `&`.charCodeAt(0); + tokenTypes.ampersand = ampersand; + var asterisk = 42; // `*`.charCodeAt(0); + tokenTypes.asterisk = asterisk; + var at = 64; // `@`.charCodeAt(0); + tokenTypes.at = at; + var comma = 44; // `,`.charCodeAt(0); + tokenTypes.comma = comma; + var colon = 58; // `:`.charCodeAt(0); + tokenTypes.colon = colon; + var semicolon = 59; // `;`.charCodeAt(0); + tokenTypes.semicolon = semicolon; + var openParenthesis = 40; // `(`.charCodeAt(0); + tokenTypes.openParenthesis = openParenthesis; + var closeParenthesis = 41; // `)`.charCodeAt(0); + tokenTypes.closeParenthesis = closeParenthesis; + var openSquare = 91; // `[`.charCodeAt(0); + tokenTypes.openSquare = openSquare; + var closeSquare = 93; // `]`.charCodeAt(0); + tokenTypes.closeSquare = closeSquare; + var dollar = 36; // `$`.charCodeAt(0); + tokenTypes.dollar = dollar; + var tilde = 126; // `~`.charCodeAt(0); + tokenTypes.tilde = tilde; + var caret = 94; // `^`.charCodeAt(0); + tokenTypes.caret = caret; + var plus = 43; // `+`.charCodeAt(0); + tokenTypes.plus = plus; + var equals = 61; // `=`.charCodeAt(0); + tokenTypes.equals = equals; + var pipe = 124; // `|`.charCodeAt(0); + tokenTypes.pipe = pipe; + var greaterThan = 62; // `>`.charCodeAt(0); + tokenTypes.greaterThan = greaterThan; + var space = 32; // ` `.charCodeAt(0); + tokenTypes.space = space; + var singleQuote = 39; // `'`.charCodeAt(0); + tokenTypes.singleQuote = singleQuote; + var doubleQuote = 34; // `"`.charCodeAt(0); + tokenTypes.doubleQuote = doubleQuote; + var slash = 47; // `/`.charCodeAt(0); + tokenTypes.slash = slash; + var bang = 33; // `!`.charCodeAt(0); + tokenTypes.bang = bang; + var backslash = 92; // '\\'.charCodeAt(0); + tokenTypes.backslash = backslash; + var cr = 13; // '\r'.charCodeAt(0); + tokenTypes.cr = cr; + var feed = 12; // '\f'.charCodeAt(0); + tokenTypes.feed = feed; + var newline = 10; // '\n'.charCodeAt(0); + tokenTypes.newline = newline; + var tab = 9; // '\t'.charCodeAt(0); + + // Expose aliases primarily for readability. + tokenTypes.tab = tab; + var str = singleQuote; + + // No good single character representation! + tokenTypes.str = str; + var comment = -1; + tokenTypes.comment = comment; + var word = -2; + tokenTypes.word = word; + var combinator = -3; + tokenTypes.combinator = combinator; + return tokenTypes; +} + +var hasRequiredTokenize; + +function requireTokenize () { + if (hasRequiredTokenize) return tokenize; + hasRequiredTokenize = 1; + (function (exports) { + + exports.__esModule = true; + exports.FIELDS = void 0; + exports["default"] = tokenize; + var t = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes()); + var _unescapable, _wordDelimiters; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); + var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; + } + + /** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + return next - 1; + } + + /** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) ; else if (hex[code]) { + var hexDigits = 0; + // consume up to 6 hex chars + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + // if fewer than 6 hex chars, a trailing space ends the escape + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + return next; + } + var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + exports.FIELDS = FIELDS; + function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed('quote', quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + if (next === 0) { + unclosed('comment', '*/'); + } + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + + // Ensure that the token structure remains consistent + tokens.push([tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end // [6] End position + ]); + + // Reset offset for the next token + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; + } + } (tokenize)); + return tokenize; +} + +var hasRequiredParser; + +function requireParser () { + if (hasRequiredParser) return parser.exports; + hasRequiredParser = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo()); + var _attribute = _interopRequireWildcard(/*@__PURE__*/ requireAttribute()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting()); + var _sortAscending = _interopRequireDefault(/*@__PURE__*/ requireSortAscending()); + var _tokenize = _interopRequireWildcard(/*@__PURE__*/ requireTokenize()); + var tokens = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes()); + var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes()); + var _util = /*@__PURE__*/ requireUtil$1(); + var _WHITESPACE_TOKENS, _Object$assign; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); + var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; + } + function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); + } + function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + return node; + } + function indexesOf(array, item) { + var i = -1; + var indexes = []; + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; + } + function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); + } + var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + }, + sourceIndex: 0 + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + var _proto = Parser.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + if (rawValue) { + node.raws.namespace += content; + } + lastAdded = 'namespace'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && + // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + node.attribute = (node.attribute || "") + content; + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + if (_rawValue) { + node.raws.attribute += content; + } + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + lastAdded = 'insensitive'; + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + if (node.raws.value) { + node.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + return nodes; + } + + /** + * + * @param {*} nodes + */; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = undefined; + } + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + _proto.combinator = function combinator() { + var _this3 = this; + if (this.content() === '|') { + return this.namespace(); + } + // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node; + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + var spaces = {}; + var raws = { + spaces: {} + }; + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position]) + }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector); + this.current = selector; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.pseudo = function pseudo() { + var _this4 = this; + var pseudoStr = ''; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.space = function space() { + var content = this.content(); + // Handle space before and after the selector + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; + // Allow decimal numbers percent in @keyframes + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); + // Eliminate Sass interpolations from the list of id indexes + var interpolations = indexesOf(word, '#{'); + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + _this5.newNode(node, namespace); + // Ensure that the namespace is used only once + namespace = null; + }); + this.position++; + }; + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + } + + /** + * Helpers + */; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + return Parser; + }(); + exports["default"] = Parser; + module.exports = exports.default; + } (parser, parser.exports)); + return parser.exports; +} + +var hasRequiredProcessor; + +function requireProcessor () { + if (hasRequiredProcessor) return processor.exports; + hasRequiredProcessor = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _parser = _interopRequireDefault(/*@__PURE__*/ requireParser()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + var root = this._root(rule, options); + var transform = this.func(root); + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string = undefined; + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + } + + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<parser.Root>} The AST of the selector after processing it. + */; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<any>} The value returned by the processor. + */; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor; + }(); + exports["default"] = Processor; + module.exports = exports.default; + } (processor, processor.exports)); + return processor.exports; +} + +var selectors = {}; + +var constructors = {}; + +var hasRequiredConstructors; + +function requireConstructors () { + if (hasRequiredConstructors) return constructors; + hasRequiredConstructors = 1; + + constructors.__esModule = true; + constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0; + var _attribute = _interopRequireDefault(/*@__PURE__*/ requireAttribute()); + var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName()); + var _combinator = _interopRequireDefault(/*@__PURE__*/ requireCombinator()); + var _comment = _interopRequireDefault(/*@__PURE__*/ requireComment()); + var _id = _interopRequireDefault(/*@__PURE__*/ requireId()); + var _nesting = _interopRequireDefault(/*@__PURE__*/ requireNesting()); + var _pseudo = _interopRequireDefault(/*@__PURE__*/ requirePseudo()); + var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot()); + var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector()); + var _string = _interopRequireDefault(/*@__PURE__*/ requireString()); + var _tag = _interopRequireDefault(/*@__PURE__*/ requireTag()); + var _universal = _interopRequireDefault(/*@__PURE__*/ requireUniversal()); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var attribute = function attribute(opts) { + return new _attribute["default"](opts); + }; + constructors.attribute = attribute; + var className = function className(opts) { + return new _className["default"](opts); + }; + constructors.className = className; + var combinator = function combinator(opts) { + return new _combinator["default"](opts); + }; + constructors.combinator = combinator; + var comment = function comment(opts) { + return new _comment["default"](opts); + }; + constructors.comment = comment; + var id = function id(opts) { + return new _id["default"](opts); + }; + constructors.id = id; + var nesting = function nesting(opts) { + return new _nesting["default"](opts); + }; + constructors.nesting = nesting; + var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); + }; + constructors.pseudo = pseudo; + var root = function root(opts) { + return new _root["default"](opts); + }; + constructors.root = root; + var selector = function selector(opts) { + return new _selector["default"](opts); + }; + constructors.selector = selector; + var string = function string(opts) { + return new _string["default"](opts); + }; + constructors.string = string; + var tag = function tag(opts) { + return new _tag["default"](opts); + }; + constructors.tag = tag; + var universal = function universal(opts) { + return new _universal["default"](opts); + }; + constructors.universal = universal; + return constructors; +} + +var guards = {}; + +var hasRequiredGuards; + +function requireGuards () { + if (hasRequiredGuards) return guards; + hasRequiredGuards = 1; + + guards.__esModule = true; + guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0; + guards.isContainer = isContainer; + guards.isIdentifier = void 0; + guards.isNamespace = isNamespace; + guards.isNesting = void 0; + guards.isNode = isNode; + guards.isPseudo = void 0; + guards.isPseudoClass = isPseudoClass; + guards.isPseudoElement = isPseudoElement; + guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0; + var _types = /*@__PURE__*/ requireTypes(); + var _IS_TYPE; + var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); + function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; + } + function isNodeType(type, node) { + return isNode(node) && node.type === type; + } + var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); + guards.isAttribute = isAttribute; + var isClassName = isNodeType.bind(null, _types.CLASS); + guards.isClassName = isClassName; + var isCombinator = isNodeType.bind(null, _types.COMBINATOR); + guards.isCombinator = isCombinator; + var isComment = isNodeType.bind(null, _types.COMMENT); + guards.isComment = isComment; + var isIdentifier = isNodeType.bind(null, _types.ID); + guards.isIdentifier = isIdentifier; + var isNesting = isNodeType.bind(null, _types.NESTING); + guards.isNesting = isNesting; + var isPseudo = isNodeType.bind(null, _types.PSEUDO); + guards.isPseudo = isPseudo; + var isRoot = isNodeType.bind(null, _types.ROOT); + guards.isRoot = isRoot; + var isSelector = isNodeType.bind(null, _types.SELECTOR); + guards.isSelector = isSelector; + var isString = isNodeType.bind(null, _types.STRING); + guards.isString = isString; + var isTag = isNodeType.bind(null, _types.TAG); + guards.isTag = isTag; + var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); + guards.isUniversal = isUniversal; + function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); + } + function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); + } + function isContainer(node) { + return !!(isNode(node) && node.walk); + } + function isNamespace(node) { + return isAttribute(node) || isTag(node); + } + return guards; +} + +var hasRequiredSelectors; + +function requireSelectors () { + if (hasRequiredSelectors) return selectors; + hasRequiredSelectors = 1; + (function (exports) { + + exports.__esModule = true; + var _types = /*@__PURE__*/ requireTypes(); + Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; + }); + var _constructors = /*@__PURE__*/ requireConstructors(); + Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; + }); + var _guards = /*@__PURE__*/ requireGuards(); + Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; + }); + } (selectors)); + return selectors; +} + +var hasRequiredDist; + +function requireDist () { + if (hasRequiredDist) return dist.exports; + hasRequiredDist = 1; + (function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _processor = _interopRequireDefault(/*@__PURE__*/ requireProcessor()); + var selectors = _interopRequireWildcard(/*@__PURE__*/ requireSelectors()); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var parser = function parser(processor) { + return new _processor["default"](processor); + }; + Object.assign(parser, selectors); + delete parser.__esModule; + var _default = parser; + exports["default"] = _default; + module.exports = exports.default; + } (dist, dist.exports)); + return dist.exports; +} + +var distExports = /*@__PURE__*/ requireDist(); +var selectorParser = /*@__PURE__*/getDefaultExportFromCjs(distExports); + +const animationNameRE = /^(-\w+-)?animation-name$/; +const animationRE = /^(-\w+-)?animation$/; +const scopedPlugin = (id = "") => { + const keyframes = /* @__PURE__ */ Object.create(null); + const shortId = id.replace(/^data-v-/, ""); + return { + postcssPlugin: "vue-sfc-scoped", + Rule(rule) { + processRule(id, rule); + }, + AtRule(node) { + if (/-?keyframes$/.test(node.name) && !node.params.endsWith(`-${shortId}`)) { + keyframes[node.params] = node.params = node.params + "-" + shortId; + } + }, + OnceExit(root) { + if (Object.keys(keyframes).length) { + root.walkDecls((decl) => { + if (animationNameRE.test(decl.prop)) { + decl.value = decl.value.split(",").map((v) => keyframes[v.trim()] || v.trim()).join(","); + } + if (animationRE.test(decl.prop)) { + decl.value = decl.value.split(",").map((v) => { + const vals = v.trim().split(/\s+/); + const i = vals.findIndex((val) => keyframes[val]); + if (i !== -1) { + vals.splice(i, 1, keyframes[vals[i]]); + return vals.join(" "); + } else { + return v; + } + }).join(","); + } + }); + } + } + }; +}; +const processedRules = /* @__PURE__ */ new WeakSet(); +function processRule(id, rule) { + if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" && /-?keyframes$/.test(rule.parent.name)) { + return; + } + processedRules.add(rule); + let deep = false; + let parent = rule.parent; + while (parent && parent.type !== "root") { + if (parent.__deep) { + deep = true; + break; + } + parent = parent.parent; + } + rule.selector = selectorParser((selectorRoot) => { + selectorRoot.each((selector) => { + rewriteSelector(id, rule, selector, selectorRoot, deep); + }); + }).processSync(rule.selector); +} +function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false) { + let node = null; + let shouldInject = !deep; + selector.each((n) => { + if (n.type === "combinator" && (n.value === ">>>" || n.value === "/deep/")) { + n.value = " "; + n.spaces.before = n.spaces.after = ""; + warn( + `the >>> and /deep/ combinators have been deprecated. Use :deep() instead.` + ); + return false; + } + if (n.type === "pseudo") { + const { value } = n; + if (value === ":deep" || value === "::v-deep") { + rule.__deep = true; + if (n.nodes.length) { + let last = n; + n.nodes[0].each((ss) => { + selector.insertAfter(last, ss); + last = ss; + }); + const prev = selector.at(selector.index(n) - 1); + if (!prev || !isSpaceCombinator(prev)) { + selector.insertAfter( + n, + selectorParser.combinator({ + value: " " + }) + ); + } + selector.removeChild(n); + } else { + warn( + `${value} usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead of ${value} <inner-selector>.` + ); + const prev = selector.at(selector.index(n) - 1); + if (prev && isSpaceCombinator(prev)) { + selector.removeChild(prev); + } + selector.removeChild(n); + } + return false; + } + if (value === ":slotted" || value === "::v-slotted") { + rewriteSelector( + id, + rule, + n.nodes[0], + selectorRoot, + deep, + true + ); + let last = n; + n.nodes[0].each((ss) => { + selector.insertAfter(last, ss); + last = ss; + }); + selector.removeChild(n); + shouldInject = false; + return false; + } + if (value === ":global" || value === "::v-global") { + selector.replaceWith(n.nodes[0]); + return false; + } + } + if (n.type === "universal") { + const prev = selector.at(selector.index(n) - 1); + const next = selector.at(selector.index(n) + 1); + if (!prev) { + if (next) { + if (next.type === "combinator" && next.value === " ") { + selector.removeChild(next); + } + selector.removeChild(n); + return; + } else { + node = selectorParser.combinator({ + value: "" + }); + selector.insertBefore(n, node); + selector.removeChild(n); + return false; + } + } + if (node) return; + } + if (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node) { + node = n; + } + }); + if (rule.nodes.some((node2) => node2.type === "rule")) { + const deep2 = rule.__deep; + if (!deep2) { + extractAndWrapNodes(rule); + const atruleNodes = rule.nodes.filter((node2) => node2.type === "atrule"); + for (const atnode of atruleNodes) { + extractAndWrapNodes(atnode); + } + } + shouldInject = deep2; + } + if (node) { + const { type, value } = node; + if (type === "pseudo" && (value === ":is" || value === ":where")) { + node.nodes.forEach( + (value2) => rewriteSelector(id, rule, value2, selectorRoot, deep, slotted) + ); + shouldInject = false; + } + } + if (node) { + node.spaces.after = ""; + } else { + selector.first.spaces.before = ""; + } + if (shouldInject) { + const idToAdd = slotted ? id + "-s" : id; + selector.insertAfter( + // If node is null it means we need to inject [id] at the start + // insertAfter can handle `null` here + node, + selectorParser.attribute({ + attribute: idToAdd, + value: idToAdd, + raws: {}, + quoteMark: `"` + }) + ); + } +} +function isSpaceCombinator(node) { + return node.type === "combinator" && /^\s+$/.test(node.value); +} +function extractAndWrapNodes(parentNode) { + if (!parentNode.nodes) return; + const nodes = parentNode.nodes.filter( + (node) => node.type === "decl" || node.type === "comment" + ); + if (nodes.length) { + for (const node of nodes) { + parentNode.removeChild(node); + } + const wrappedRule = new Rule({ + nodes, + selector: "&" + }); + parentNode.prepend(wrappedRule); + } +} +scopedPlugin.postcss = true; + +var sourceMap = {}; + +var sourceMapGenerator = {}; + +var base64Vlq = {}; + +var base64 = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64; + +function requireBase64 () { + if (hasRequiredBase64) return base64; + hasRequiredBase64 = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + base64.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + base64.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + return base64; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBase64Vlq; + +function requireBase64Vlq () { + if (hasRequiredBase64Vlq) return base64Vlq; + hasRequiredBase64Vlq = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = /*@__PURE__*/ requireBase64(); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + base64Vlq.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + return base64Vlq; +} + +var util = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredUtil; + +function requireUtil () { + if (hasRequiredUtil) return util; + hasRequiredUtil = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '<dir>/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + } (util)); + return util; +} + +var arraySet = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredArraySet; + +function requireArraySet () { + if (hasRequiredArraySet) return arraySet; + hasRequiredArraySet = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + arraySet.ArraySet = ArraySet; + return arraySet; +} + +var mappingList = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredMappingList; + +function requireMappingList () { + if (hasRequiredMappingList) return mappingList; + hasRequiredMappingList = 1; + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil(); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + mappingList.MappingList = MappingList; + return mappingList; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapGenerator; + +function requireSourceMapGenerator () { + if (hasRequiredSourceMapGenerator) return sourceMapGenerator; + hasRequiredSourceMapGenerator = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = /*@__PURE__*/ requireBase64Vlq(); + var util = /*@__PURE__*/ requireUtil(); + var ArraySet = /*@__PURE__*/ requireArraySet().ArraySet; + var MappingList = /*@__PURE__*/ requireMappingList().MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ''; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + sourceMapGenerator.SourceMapGenerator = SourceMapGenerator; + return sourceMapGenerator; +} + +var sourceMapConsumer = {}; + +var binarySearch = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredBinarySearch; + +function requireBinarySearch () { + if (hasRequiredBinarySearch) return binarySearch; + hasRequiredBinarySearch = 1; + (function (exports) { + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + } (binarySearch)); + return binarySearch; +} + +var quickSort = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredQuickSort; + +function requireQuickSort () { + if (hasRequiredQuickSort) return quickSort; + hasRequiredQuickSort = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + quickSort.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + return quickSort; +} + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceMapConsumer; + +function requireSourceMapConsumer () { + if (hasRequiredSourceMapConsumer) return sourceMapConsumer; + hasRequiredSourceMapConsumer = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = /*@__PURE__*/ requireUtil(); + var binarySearch = /*@__PURE__*/ requireBinarySearch(); + var ArraySet = /*@__PURE__*/ requireArraySet().ArraySet; + var base64VLQ = /*@__PURE__*/ requireBase64Vlq(); + var quickSort = /*@__PURE__*/ requireQuickSort().quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + sourceMapConsumer.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + return sourceMapConsumer; +} + +var sourceNode = {}; + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +var hasRequiredSourceNode; + +function requireSourceNode () { + if (hasRequiredSourceNode) return sourceNode; + hasRequiredSourceNode = 1; + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator().SourceMapGenerator; + var util = /*@__PURE__*/ requireUtil(); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + sourceNode.SourceNode = SourceNode; + return sourceNode; +} + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var hasRequiredSourceMap; + +function requireSourceMap () { + if (hasRequiredSourceMap) return sourceMap; + hasRequiredSourceMap = 1; + sourceMap.SourceMapGenerator = /*@__PURE__*/ requireSourceMapGenerator().SourceMapGenerator; + sourceMap.SourceMapConsumer = /*@__PURE__*/ requireSourceMapConsumer().SourceMapConsumer; + sourceMap.SourceNode = /*@__PURE__*/ requireSourceNode().SourceNode; + return sourceMap; +} + +var mergeSourceMap; +var hasRequiredMergeSourceMap; + +function requireMergeSourceMap () { + if (hasRequiredMergeSourceMap) return mergeSourceMap; + hasRequiredMergeSourceMap = 1; + var sourceMap = /*@__PURE__*/ requireSourceMap(); + var SourceMapConsumer = sourceMap.SourceMapConsumer; + var SourceMapGenerator = sourceMap.SourceMapGenerator; + + mergeSourceMap = merge; + + /** + * Merge old source map and new source map and return merged. + * If old or new source map value is falsy, return another one as it is. + * + * @param {object|string} [oldMap] old source map object + * @param {object|string} [newmap] new source map object + * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined + */ + function merge(oldMap, newMap) { + if (!oldMap) return newMap + if (!newMap) return oldMap + + var oldMapConsumer = new SourceMapConsumer(oldMap); + var newMapConsumer = new SourceMapConsumer(newMap); + var mergedMapGenerator = new SourceMapGenerator(); + + // iterate on new map and overwrite original position of new map with one of old map + newMapConsumer.eachMapping(function(m) { + // pass when `originalLine` is null. + // It occurs in case that the node does not have origin in original code. + if (m.originalLine == null) return + + var origPosInOldMap = oldMapConsumer.originalPositionFor({ + line: m.originalLine, + column: m.originalColumn + }); + + if (origPosInOldMap.source == null) return + + mergedMapGenerator.addMapping({ + original: { + line: origPosInOldMap.line, + column: origPosInOldMap.column + }, + generated: { + line: m.generatedLine, + column: m.generatedColumn + }, + source: origPosInOldMap.source, + name: origPosInOldMap.name + }); + }); + + var consumers = [oldMapConsumer, newMapConsumer]; + consumers.forEach(function(consumer) { + consumer.sources.forEach(function(sourceFile) { + mergedMapGenerator._sources.add(sourceFile); + var sourceContent = consumer.sourceContentFor(sourceFile); + if (sourceContent != null) { + mergedMapGenerator.setSourceContent(sourceFile, sourceContent); + } + }); + }); + + mergedMapGenerator._sourceRoot = oldMap.sourceRoot; + mergedMapGenerator._file = oldMap.file; + + return JSON.parse(mergedMapGenerator.toString()) + } + return mergeSourceMap; +} + +var mergeSourceMapExports = /*@__PURE__*/ requireMergeSourceMap(); +var merge = /*@__PURE__*/getDefaultExportFromCjs(mergeSourceMapExports); + +var __defProp$5 = Object.defineProperty; +var __defProps$4 = Object.defineProperties; +var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __hasOwnProp$5 = Object.prototype.hasOwnProperty; +var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$5 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + if (__getOwnPropSymbols$5) + for (var prop of __getOwnPropSymbols$5(b)) { + if (__propIsEnum$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b)); +const scss = (source, map, options, load = require) => { + const nodeSass = load("sass"); + const { compileString, renderSync } = nodeSass; + const data = getSource(source, options.filename, options.additionalData); + let css; + let dependencies; + let sourceMap; + try { + if (compileString) { + const { pathToFileURL, fileURLToPath } = load("url"); + const result = compileString(data, __spreadProps$4(__spreadValues$5({}, options), { + url: pathToFileURL(options.filename), + sourceMap: !!map + })); + css = result.css; + dependencies = result.loadedUrls.map((url) => fileURLToPath(url)); + sourceMap = map ? result.sourceMap : void 0; + } else { + const result = renderSync(__spreadProps$4(__spreadValues$5({}, options), { + data, + file: options.filename, + outFile: options.filename, + sourceMap: !!map + })); + css = result.css.toString(); + dependencies = result.stats.includedFiles; + sourceMap = map ? JSON.parse(result.map.toString()) : void 0; + } + if (map) { + return { + code: css, + errors: [], + dependencies, + map: merge(map, sourceMap) + }; + } + return { code: css, errors: [], dependencies }; + } catch (e) { + return { code: "", errors: [e], dependencies: [] }; + } +}; +const sass = (source, map, options, load) => scss( + source, + map, + __spreadProps$4(__spreadValues$5({}, options), { + indentedSyntax: true + }), + load +); +const less = (source, map, options, load = require) => { + const nodeLess = load("less"); + let result; + let error = null; + nodeLess.render( + getSource(source, options.filename, options.additionalData), + __spreadProps$4(__spreadValues$5({}, options), { syncImport: true }), + (err, output) => { + error = err; + result = output; + } + ); + if (error) return { code: "", errors: [error], dependencies: [] }; + const dependencies = result.imports; + if (map) { + return { + code: result.css.toString(), + map: merge(map, result.map), + errors: [], + dependencies + }; + } + return { + code: result.css.toString(), + errors: [], + dependencies + }; +}; +const styl = (source, map, options, load = require) => { + const nodeStylus = load("stylus"); + try { + const ref = nodeStylus(source, options); + if (map) ref.set("sourcemap", { inline: false, comment: false }); + const result = ref.render(); + const dependencies = ref.deps(); + if (map) { + return { + code: result, + map: merge(map, ref.sourcemap), + errors: [], + dependencies + }; + } + return { code: result, errors: [], dependencies }; + } catch (e) { + return { code: "", errors: [e], dependencies: [] }; + } +}; +function getSource(source, filename, additionalData) { + if (!additionalData) return source; + if (isFunction$1(additionalData)) { + return additionalData(source, filename); + } + return additionalData + source; +} +const processors = { + less, + sass, + scss, + styl, + stylus: styl +}; + +var __defProp$4 = Object.defineProperty; +var __defProps$3 = Object.defineProperties; +var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; +var __hasOwnProp$4 = Object.prototype.hasOwnProperty; +var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$4 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + if (__getOwnPropSymbols$4) + for (var prop of __getOwnPropSymbols$4(b)) { + if (__propIsEnum$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); +function compileStyle(options) { + return doCompileStyle(__spreadProps$3(__spreadValues$4({}, options), { + isAsync: false + })); +} +function compileStyleAsync(options) { + return doCompileStyle(__spreadProps$3(__spreadValues$4({}, options), { + isAsync: true + })); +} +function doCompileStyle(options) { + const { + filename, + id, + scoped = false, + trim = true, + isProd = false, + modules = false, + modulesOptions = {}, + preprocessLang, + postcssOptions, + postcssPlugins + } = options; + const preprocessor = preprocessLang && processors[preprocessLang]; + const preProcessedSource = preprocessor && preprocess(options, preprocessor); + const map = preProcessedSource ? preProcessedSource.map : options.inMap || options.map; + const source = preProcessedSource ? preProcessedSource.code : options.source; + const shortId = id.replace(/^data-v-/, ""); + const longId = `data-v-${shortId}`; + const plugins = (postcssPlugins || []).slice(); + plugins.unshift(cssVarsPlugin({ id: shortId, isProd })); + if (trim) { + plugins.push(trimPlugin()); + } + if (scoped) { + plugins.push(scopedPlugin(longId)); + } + let cssModules; + if (modules) { + { + throw new Error( + "[@vue/compiler-sfc] `modules` option is not supported in the browser build." + ); + } + } + const postCSSOptions = __spreadProps$3(__spreadValues$4({}, postcssOptions), { + to: filename, + from: filename + }); + if (map) { + postCSSOptions.map = { + inline: false, + annotation: false, + prev: map + }; + } + let result; + let code; + let outMap; + const dependencies = new Set( + preProcessedSource ? preProcessedSource.dependencies : [] + ); + dependencies.delete(filename); + const errors = []; + if (preProcessedSource && preProcessedSource.errors.length) { + errors.push(...preProcessedSource.errors); + } + const recordPlainCssDependencies = (messages) => { + messages.forEach((msg) => { + if (msg.type === "dependency") { + dependencies.add(msg.file); + } + }); + return dependencies; + }; + try { + result = postcss(plugins).process(source, postCSSOptions); + if (options.isAsync) { + return result.then((result2) => ({ + code: result2.css || "", + map: result2.map && result2.map.toJSON(), + errors, + modules: cssModules, + rawResult: result2, + dependencies: recordPlainCssDependencies(result2.messages) + })).catch((error) => ({ + code: "", + map: void 0, + errors: [...errors, error], + rawResult: void 0, + dependencies + })); + } + recordPlainCssDependencies(result.messages); + code = result.css; + outMap = result.map; + } catch (e) { + errors.push(e); + } + return { + code: code || ``, + map: outMap && outMap.toJSON(), + errors, + rawResult: result, + dependencies + }; +} +function preprocess(options, preprocessor) { + if (!options.preprocessCustomRequire) { + throw new Error( + `[@vue/compiler-sfc] Style preprocessing in the browser build must provide the \`preprocessCustomRequire\` option to return the in-browser version of the preprocessor.` + ); + } + return preprocessor( + options.source, + options.inMap || options.map, + __spreadValues$4({ + filename: options.filename + }, options.preprocessOptions), + options.preprocessCustomRequire + ); +} + +const UNKNOWN_TYPE = "Unknown"; +function resolveObjectKey(node, computed) { + switch (node.type) { + case "StringLiteral": + case "NumericLiteral": + return String(node.value); + case "Identifier": + if (!computed) return node.name; + } + return void 0; +} +function concatStrings(strs) { + return strs.filter((s) => !!s).join(", "); +} +function isLiteralNode(node) { + return node.type.endsWith("Literal"); +} +function isCallOf(node, test) { + return !!(node && test && node.type === "CallExpression" && node.callee.type === "Identifier" && (typeof test === "string" ? node.callee.name === test : test(node.callee.name))); +} +function toRuntimeTypeString(types) { + return types.length > 1 ? `[${types.join(", ")}]` : types[0]; +} +function getImportedName(specifier) { + if (specifier.type === "ImportSpecifier") + return specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value; + else if (specifier.type === "ImportNamespaceSpecifier") return "*"; + return "default"; +} +function getId(node) { + return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null; +} +const normalize = (path.posix || path).normalize; +const windowsSlashRE = /\\/g; +function normalizePath(p) { + return normalize(p.replace(windowsSlashRE, "/")); +} +const joinPaths = (path.posix || path).join; +const propNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~\-]/; +function getEscapedPropName(key) { + return propNameEscapeSymbolsRE.test(key) ? JSON.stringify(key) : key; +} + +function analyzeScriptBindings(ast) { + for (const node of ast) { + if (node.type === "ExportDefaultDeclaration" && node.declaration.type === "ObjectExpression") { + return analyzeBindingsFromOptions(node.declaration); + } + } + return {}; +} +function analyzeBindingsFromOptions(node) { + const bindings = {}; + Object.defineProperty(bindings, "__isScriptSetup", { + enumerable: false, + value: false + }); + for (const property of node.properties) { + if (property.type === "ObjectProperty" && !property.computed && property.key.type === "Identifier") { + if (property.key.name === "props") { + for (const key of getObjectOrArrayExpressionKeys(property.value)) { + bindings[key] = "props"; + } + } else if (property.key.name === "inject") { + for (const key of getObjectOrArrayExpressionKeys(property.value)) { + bindings[key] = "options"; + } + } else if (property.value.type === "ObjectExpression" && (property.key.name === "computed" || property.key.name === "methods")) { + for (const key of getObjectExpressionKeys(property.value)) { + bindings[key] = "options"; + } + } + } else if (property.type === "ObjectMethod" && property.key.type === "Identifier" && (property.key.name === "setup" || property.key.name === "data")) { + for (const bodyItem of property.body.body) { + if (bodyItem.type === "ReturnStatement" && bodyItem.argument && bodyItem.argument.type === "ObjectExpression") { + for (const key of getObjectExpressionKeys(bodyItem.argument)) { + bindings[key] = property.key.name === "setup" ? "setup-maybe-ref" : "data"; + } + } + } + } + } + return bindings; +} +function getObjectExpressionKeys(node) { + const keys = []; + for (const prop of node.properties) { + if (prop.type === "SpreadElement") continue; + const key = resolveObjectKey(prop.key, prop.computed); + if (key) keys.push(String(key)); + } + return keys; +} +function getArrayExpressionKeys(node) { + const keys = []; + for (const element of node.elements) { + if (element && element.type === "StringLiteral") { + keys.push(element.value); + } + } + return keys; +} +function getObjectOrArrayExpressionKeys(value) { + if (value.type === "ArrayExpression") { + return getArrayExpressionKeys(value); + } + if (value.type === "ObjectExpression") { + return getObjectExpressionKeys(value); + } + return []; +} + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} + +const bufLength = 1024 * 16; +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +var _a, _b; +class ScriptCompileContext { + constructor(descriptor, options) { + this.descriptor = descriptor; + this.options = options; + this.isCE = false; + this.source = this.descriptor.source; + this.filename = this.descriptor.filename; + this.s = new MagicString(this.source); + this.startOffset = (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset; + this.endOffset = (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset; + this.userImports = /* @__PURE__ */ Object.create(null); + // macros presence check + this.hasDefinePropsCall = false; + this.hasDefineEmitCall = false; + this.hasDefineExposeCall = false; + this.hasDefaultExportName = false; + this.hasDefaultExportRender = false; + this.hasDefineOptionsCall = false; + this.hasDefineSlotsCall = false; + this.hasDefineModelCall = false; + this.propsDestructuredBindings = /* @__PURE__ */ Object.create(null); + // defineModel + this.modelDecls = /* @__PURE__ */ Object.create(null); + // codegen + this.bindingMetadata = {}; + this.helperImports = /* @__PURE__ */ new Set(); + const { script, scriptSetup } = descriptor; + const scriptLang = script && script.lang; + const scriptSetupLang = scriptSetup && scriptSetup.lang; + this.isJS = scriptLang === "js" || scriptLang === "jsx" || scriptSetupLang === "js" || scriptSetupLang === "jsx"; + this.isTS = scriptLang === "ts" || scriptLang === "tsx" || scriptSetupLang === "ts" || scriptSetupLang === "tsx"; + const customElement = options.customElement; + const filename = this.descriptor.filename; + if (customElement) { + this.isCE = typeof customElement === "boolean" ? customElement : customElement(filename); + } + const plugins = resolveParserPlugins( + scriptLang || scriptSetupLang, + options.babelParserPlugins + ); + function parse(input, offset) { + try { + return libExports.parse(input, { + plugins, + sourceType: "module" + }).program; + } catch (e) { + e.message = `[vue/compiler-sfc] ${e.message} + +${descriptor.filename} +${generateCodeFrame( + descriptor.source, + e.pos + offset, + e.pos + offset + 1 + )}`; + throw e; + } + } + this.scriptAst = descriptor.script && parse(descriptor.script.content, descriptor.script.loc.start.offset); + this.scriptSetupAst = descriptor.scriptSetup && parse(descriptor.scriptSetup.content, this.startOffset); + } + helper(key) { + this.helperImports.add(key); + return `_${key}`; + } + getString(node, scriptSetup = true) { + const block = scriptSetup ? this.descriptor.scriptSetup : this.descriptor.script; + return block.content.slice(node.start, node.end); + } + warn(msg, node, scope) { + warn(generateError(msg, node, this, scope)); + } + error(msg, node, scope) { + throw new Error( + `[@vue/compiler-sfc] ${generateError(msg, node, this, scope)}` + ); + } +} +function generateError(msg, node, ctx, scope) { + const offset = scope ? scope.offset : ctx.startOffset; + return `${msg} + +${(scope || ctx.descriptor).filename} +${generateCodeFrame( + (scope || ctx.descriptor).source, + node.start + offset, + node.end + offset + )}`; +} +function resolveParserPlugins(lang, userPlugins, dts = false) { + const plugins = []; + if (!userPlugins || !userPlugins.some( + (p) => p === "importAssertions" || p === "importAttributes" || isArray$3(p) && p[0] === "importAttributes" + )) { + plugins.push("importAttributes"); + } + if (lang === "jsx" || lang === "tsx" || lang === "mtsx") { + plugins.push("jsx"); + } else if (userPlugins) { + userPlugins = userPlugins.filter((p) => p !== "jsx"); + } + if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "mtsx") { + plugins.push(["typescript", { dts }], "explicitResourceManagement"); + if (!userPlugins || !userPlugins.includes("decorators")) { + plugins.push("decorators-legacy"); + } + } + if (userPlugins) { + plugins.push(...userPlugins); + } + return plugins; +} + +function rewriteDefault(input, as, parserPlugins) { + const ast = libExports.parse(input, { + sourceType: "module", + plugins: resolveParserPlugins("js", parserPlugins) + }).program.body; + const s = new MagicString(input); + rewriteDefaultAST(ast, s, as); + return s.toString(); +} +function rewriteDefaultAST(ast, s, as) { + if (!hasDefaultExport(ast)) { + s.append(` +const ${as} = {}`); + return; + } + ast.forEach((node) => { + if (node.type === "ExportDefaultDeclaration") { + if (node.declaration.type === "ClassDeclaration" && node.declaration.id) { + let start = node.declaration.decorators && node.declaration.decorators.length > 0 ? node.declaration.decorators[node.declaration.decorators.length - 1].end : node.start; + s.overwrite(start, node.declaration.id.start, ` class `); + s.append(` +const ${as} = ${node.declaration.id.name}`); + } else { + s.overwrite(node.start, node.declaration.start, `const ${as} = `); + } + } else if (node.type === "ExportNamedDeclaration") { + for (const specifier of node.specifiers) { + if (specifier.type === "ExportSpecifier" && specifier.exported.type === "Identifier" && specifier.exported.name === "default") { + if (node.source) { + if (specifier.local.name === "default") { + s.prepend( + `import { default as __VUE_DEFAULT__ } from '${node.source.value}' +` + ); + const end2 = specifierEnd(s, specifier.local.end, node.end); + s.remove(specifier.start, end2); + s.append(` +const ${as} = __VUE_DEFAULT__`); + continue; + } else { + s.prepend( + `import { ${s.slice( + specifier.local.start, + specifier.local.end + )} as __VUE_DEFAULT__ } from '${node.source.value}' +` + ); + const end2 = specifierEnd(s, specifier.exported.end, node.end); + s.remove(specifier.start, end2); + s.append(` +const ${as} = __VUE_DEFAULT__`); + continue; + } + } + const end = specifierEnd(s, specifier.end, node.end); + s.remove(specifier.start, end); + s.append(` +const ${as} = ${specifier.local.name}`); + } + } + } + }); +} +function hasDefaultExport(ast) { + for (const stmt of ast) { + if (stmt.type === "ExportDefaultDeclaration") { + return true; + } else if (stmt.type === "ExportNamedDeclaration" && stmt.specifiers.some( + (spec) => spec.exported.name === "default" + )) { + return true; + } + } + return false; +} +function specifierEnd(s, end, nodeEnd) { + let hasCommas = false; + let oldEnd = end; + while (end < nodeEnd) { + if (/\s/.test(s.slice(end, end + 1))) { + end++; + } else if (s.slice(end, end + 1) === ",") { + end++; + hasCommas = true; + break; + } else if (s.slice(end, end + 1) === "}") { + break; + } + } + return hasCommas ? end : oldEnd; +} + +var __defProp$3 = Object.defineProperty; +var __defProps$2 = Object.defineProperties; +var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; +var __hasOwnProp$3 = Object.prototype.hasOwnProperty; +var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$3 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + if (__getOwnPropSymbols$3) + for (var prop of __getOwnPropSymbols$3(b)) { + if (__propIsEnum$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b)); +const normalScriptDefaultVar = `__default__`; +function processNormalScript(ctx, scopeId) { + var _a; + const script = ctx.descriptor.script; + if (script.lang && !ctx.isJS && !ctx.isTS) { + return script; + } + try { + let content = script.content; + let map = script.map; + const scriptAst = ctx.scriptAst; + const bindings = analyzeScriptBindings(scriptAst.body); + const { cssVars } = ctx.descriptor; + const { genDefaultAs, isProd } = ctx.options; + if (cssVars.length || genDefaultAs) { + const defaultVar = genDefaultAs || normalScriptDefaultVar; + const s = new MagicString(content); + rewriteDefaultAST(scriptAst.body, s, defaultVar); + content = s.toString(); + if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) { + content += genNormalScriptCssVarsCode( + cssVars, + bindings, + scopeId, + !!isProd, + defaultVar + ); + } + if (!genDefaultAs) { + content += ` +export default ${defaultVar}`; + } + } + return __spreadProps$2(__spreadValues$3({}, script), { + content, + map, + bindings, + scriptAst: scriptAst.body + }); + } catch (e) { + return script; + } +} + +var __defProp$2 = Object.defineProperty; +var __defProps$1 = Object.defineProperties; +var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols; +var __hasOwnProp$2 = Object.prototype.hasOwnProperty; +var __propIsEnum$2 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$2 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$2.call(b, prop)) + __defNormalProp$2(a, prop, b[prop]); + if (__getOwnPropSymbols$2) + for (var prop of __getOwnPropSymbols$2(b)) { + if (__propIsEnum$2.call(b, prop)) + __defNormalProp$2(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b)); +class TypeScope { + constructor(filename, source, offset = 0, imports = /* @__PURE__ */ Object.create(null), types = /* @__PURE__ */ Object.create(null), declares = /* @__PURE__ */ Object.create(null)) { + this.filename = filename; + this.source = source; + this.offset = offset; + this.imports = imports; + this.types = types; + this.declares = declares; + this.isGenericScope = false; + this.resolvedImportSources = /* @__PURE__ */ Object.create(null); + this.exportedTypes = /* @__PURE__ */ Object.create(null); + this.exportedDeclares = /* @__PURE__ */ Object.create(null); + } +} +function resolveTypeElements(ctx, node, scope, typeParameters) { + const canCache = !typeParameters; + if (canCache && node._resolvedElements) { + return node._resolvedElements; + } + const resolved = innerResolveTypeElements( + ctx, + node, + node._ownerScope || scope || ctxToScope(ctx), + typeParameters + ); + return canCache ? node._resolvedElements = resolved : resolved; +} +function innerResolveTypeElements(ctx, node, scope, typeParameters) { + var _a, _b; + if (node.leadingComments && node.leadingComments.some((c) => c.value.includes("@vue-ignore"))) { + return { props: {} }; + } + switch (node.type) { + case "TSTypeLiteral": + return typeElementsToMap(ctx, node.members, scope, typeParameters); + case "TSInterfaceDeclaration": + return resolveInterfaceMembers(ctx, node, scope, typeParameters); + case "TSTypeAliasDeclaration": + case "TSTypeAnnotation": + case "TSParenthesizedType": + return resolveTypeElements( + ctx, + node.typeAnnotation, + scope, + typeParameters + ); + case "TSFunctionType": { + return { props: {}, calls: [node] }; + } + case "TSUnionType": + case "TSIntersectionType": + return mergeElements( + node.types.map((t) => resolveTypeElements(ctx, t, scope, typeParameters)), + node.type + ); + case "TSMappedType": + return resolveMappedType(ctx, node, scope, typeParameters); + case "TSIndexedAccessType": { + const types = resolveIndexType(ctx, node, scope); + return mergeElements( + types.map((t) => resolveTypeElements(ctx, t, t._ownerScope)), + "TSUnionType" + ); + } + case "TSExpressionWithTypeArguments": + // referenced by interface extends + case "TSTypeReference": { + const typeName = getReferenceName(node); + if ((typeName === "ExtractPropTypes" || typeName === "ExtractPublicPropTypes") && node.typeParameters && ((_a = scope.imports[typeName]) == null ? void 0 : _a.source) === "vue") { + return resolveExtractPropTypes( + resolveTypeElements( + ctx, + node.typeParameters.params[0], + scope, + typeParameters + ), + scope + ); + } + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + let typeParams; + if ((resolved.type === "TSTypeAliasDeclaration" || resolved.type === "TSInterfaceDeclaration") && resolved.typeParameters && node.typeParameters) { + typeParams = /* @__PURE__ */ Object.create(null); + resolved.typeParameters.params.forEach((p, i) => { + let param = typeParameters && typeParameters[p.name]; + if (!param) param = node.typeParameters.params[i]; + typeParams[p.name] = param; + }); + } + return resolveTypeElements( + ctx, + resolved, + resolved._ownerScope, + typeParams + ); + } else { + if (typeof typeName === "string") { + if (typeParameters && typeParameters[typeName]) { + return resolveTypeElements( + ctx, + typeParameters[typeName], + scope, + typeParameters + ); + } + if ( + // @ts-expect-error + SupportedBuiltinsSet.has(typeName) + ) { + return resolveBuiltin( + ctx, + node, + typeName, + scope, + typeParameters + ); + } else if (typeName === "ReturnType" && node.typeParameters) { + const ret = resolveReturnType( + ctx, + node.typeParameters.params[0], + scope + ); + if (ret) { + return resolveTypeElements(ctx, ret, scope); + } + } + } + return ctx.error( + `Unresolvable type reference or unsupported built-in utility type`, + node, + scope + ); + } + } + case "TSImportType": { + if (getId(node.argument) === "vue" && ((_b = node.qualifier) == null ? void 0 : _b.type) === "Identifier" && node.qualifier.name === "ExtractPropTypes" && node.typeParameters) { + return resolveExtractPropTypes( + resolveTypeElements(ctx, node.typeParameters.params[0], scope), + scope + ); + } + const sourceScope = importSourceToScope( + ctx, + node.argument, + scope, + node.argument.value + ); + const resolved = resolveTypeReference(ctx, node, sourceScope); + if (resolved) { + return resolveTypeElements(ctx, resolved, resolved._ownerScope); + } + break; + } + case "TSTypeQuery": + { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveTypeElements(ctx, resolved, resolved._ownerScope); + } + } + break; + } + return ctx.error(`Unresolvable type: ${node.type}`, node, scope); +} +function typeElementsToMap(ctx, elements, scope = ctxToScope(ctx), typeParameters) { + const res = { props: {} }; + for (const e of elements) { + if (e.type === "TSPropertySignature" || e.type === "TSMethodSignature") { + if (typeParameters) { + scope = createChildScope(scope); + scope.isGenericScope = true; + Object.assign(scope.types, typeParameters); + } + e._ownerScope = scope; + const name = getId(e.key); + if (name && !e.computed) { + res.props[name] = e; + } else if (e.key.type === "TemplateLiteral") { + for (const key of resolveTemplateKeys(ctx, e.key, scope)) { + res.props[key] = e; + } + } else { + ctx.error( + `Unsupported computed key in type referenced by a macro`, + e.key, + scope + ); + } + } else if (e.type === "TSCallSignatureDeclaration") { + (res.calls || (res.calls = [])).push(e); + } + } + return res; +} +function mergeElements(maps, type) { + if (maps.length === 1) return maps[0]; + const res = { props: {} }; + const { props: baseProps } = res; + for (const { props, calls } of maps) { + for (const key in props) { + if (!hasOwn(baseProps, key)) { + baseProps[key] = props[key]; + } else { + baseProps[key] = createProperty( + baseProps[key].key, + { + type, + // @ts-expect-error + types: [baseProps[key], props[key]] + }, + baseProps[key]._ownerScope, + baseProps[key].optional || props[key].optional + ); + } + } + if (calls) { + (res.calls || (res.calls = [])).push(...calls); + } + } + return res; +} +function createProperty(key, typeAnnotation, scope, optional) { + return { + type: "TSPropertySignature", + key, + kind: "get", + optional, + typeAnnotation: { + type: "TSTypeAnnotation", + typeAnnotation + }, + _ownerScope: scope + }; +} +function resolveInterfaceMembers(ctx, node, scope, typeParameters) { + const base = typeElementsToMap( + ctx, + node.body.body, + node._ownerScope, + typeParameters + ); + if (node.extends) { + for (const ext of node.extends) { + try { + const { props, calls } = resolveTypeElements(ctx, ext, scope); + for (const key in props) { + if (!hasOwn(base.props, key)) { + base.props[key] = props[key]; + } + } + if (calls) { + ; + (base.calls || (base.calls = [])).push(...calls); + } + } catch (e) { + ctx.error( + `Failed to resolve extends base type. +If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example: + +interface Props extends /* @vue-ignore */ Base {} + +Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.`, + ext, + scope + ); + } + } + } + return base; +} +function resolveMappedType(ctx, node, scope, typeParameters) { + const res = { props: {} }; + let keys; + if (node.nameType) { + const { name, constraint } = node.typeParameter; + scope = createChildScope(scope); + Object.assign(scope.types, __spreadProps$1(__spreadValues$2({}, typeParameters), { [name]: constraint })); + keys = resolveStringType(ctx, node.nameType, scope); + } else { + keys = resolveStringType(ctx, node.typeParameter.constraint, scope); + } + for (const key of keys) { + res.props[key] = createProperty( + { + type: "Identifier", + name: key + }, + node.typeAnnotation, + scope, + !!node.optional + ); + } + return res; +} +function resolveIndexType(ctx, node, scope) { + var _a, _b; + if (node.indexType.type === "TSNumberKeyword") { + return resolveArrayElementType(ctx, node.objectType, scope); + } + const { indexType, objectType } = node; + const types = []; + let keys; + let resolved; + if (indexType.type === "TSStringKeyword") { + resolved = resolveTypeElements(ctx, objectType, scope); + keys = Object.keys(resolved.props); + } else { + keys = resolveStringType(ctx, indexType, scope); + resolved = resolveTypeElements(ctx, objectType, scope); + } + for (const key of keys) { + const targetType = (_b = (_a = resolved.props[key]) == null ? void 0 : _a.typeAnnotation) == null ? void 0 : _b.typeAnnotation; + if (targetType) { + targetType._ownerScope = resolved.props[key]._ownerScope; + types.push(targetType); + } + } + return types; +} +function resolveArrayElementType(ctx, node, scope) { + if (node.type === "TSArrayType") { + return [node.elementType]; + } + if (node.type === "TSTupleType") { + return node.elementTypes.map( + (t) => t.type === "TSNamedTupleMember" ? t.elementType : t + ); + } + if (node.type === "TSTypeReference") { + if (getReferenceName(node) === "Array" && node.typeParameters) { + return node.typeParameters.params; + } else { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveArrayElementType(ctx, resolved, scope); + } + } + } + return ctx.error( + "Failed to resolve element type from target type", + node, + scope + ); +} +function resolveStringType(ctx, node, scope) { + switch (node.type) { + case "StringLiteral": + return [node.value]; + case "TSLiteralType": + return resolveStringType(ctx, node.literal, scope); + case "TSUnionType": + return node.types.map((t) => resolveStringType(ctx, t, scope)).flat(); + case "TemplateLiteral": { + return resolveTemplateKeys(ctx, node, scope); + } + case "TSTypeReference": { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return resolveStringType(ctx, resolved, scope); + } + if (node.typeName.type === "Identifier") { + const getParam = (index = 0) => resolveStringType(ctx, node.typeParameters.params[index], scope); + switch (node.typeName.name) { + case "Extract": + return getParam(1); + case "Exclude": { + const excluded = getParam(1); + return getParam().filter((s) => !excluded.includes(s)); + } + case "Uppercase": + return getParam().map((s) => s.toUpperCase()); + case "Lowercase": + return getParam().map((s) => s.toLowerCase()); + case "Capitalize": + return getParam().map(capitalize); + case "Uncapitalize": + return getParam().map((s) => s[0].toLowerCase() + s.slice(1)); + default: + ctx.error( + "Unsupported type when resolving index type", + node.typeName, + scope + ); + } + } + } + } + return ctx.error("Failed to resolve index type into finite keys", node, scope); +} +function resolveTemplateKeys(ctx, node, scope) { + if (!node.expressions.length) { + return [node.quasis[0].value.raw]; + } + const res = []; + const e = node.expressions[0]; + const q = node.quasis[0]; + const leading = q ? q.value.raw : ``; + const resolved = resolveStringType(ctx, e, scope); + const restResolved = resolveTemplateKeys( + ctx, + __spreadProps$1(__spreadValues$2({}, node), { + expressions: node.expressions.slice(1), + quasis: q ? node.quasis.slice(1) : node.quasis + }), + scope + ); + for (const r of resolved) { + for (const rr of restResolved) { + res.push(leading + r + rr); + } + } + return res; +} +const SupportedBuiltinsSet = /* @__PURE__ */ new Set([ + "Partial", + "Required", + "Readonly", + "Pick", + "Omit" +]); +function resolveBuiltin(ctx, node, name, scope, typeParameters) { + const t = resolveTypeElements( + ctx, + node.typeParameters.params[0], + scope, + typeParameters + ); + switch (name) { + case "Partial": { + const res2 = { props: {}, calls: t.calls }; + Object.keys(t.props).forEach((key) => { + res2.props[key] = __spreadProps$1(__spreadValues$2({}, t.props[key]), { optional: true }); + }); + return res2; + } + case "Required": { + const res2 = { props: {}, calls: t.calls }; + Object.keys(t.props).forEach((key) => { + res2.props[key] = __spreadProps$1(__spreadValues$2({}, t.props[key]), { optional: false }); + }); + return res2; + } + case "Readonly": + return t; + case "Pick": { + const picked = resolveStringType( + ctx, + node.typeParameters.params[1], + scope + ); + const res2 = { props: {}, calls: t.calls }; + for (const key of picked) { + res2.props[key] = t.props[key]; + } + return res2; + } + case "Omit": + const omitted = resolveStringType( + ctx, + node.typeParameters.params[1], + scope + ); + const res = { props: {}, calls: t.calls }; + for (const key in t.props) { + if (!omitted.includes(key)) { + res.props[key] = t.props[key]; + } + } + return res; + } +} +function resolveTypeReference(ctx, node, scope, name, onlyExported = false) { + const canCache = !(scope == null ? void 0 : scope.isGenericScope); + if (canCache && node._resolvedReference) { + return node._resolvedReference; + } + const resolved = innerResolveTypeReference( + ctx, + scope || ctxToScope(ctx), + name || getReferenceName(node), + node, + onlyExported + ); + return canCache ? node._resolvedReference = resolved : resolved; +} +function innerResolveTypeReference(ctx, scope, name, node, onlyExported) { + if (typeof name === "string") { + if (scope.imports[name]) { + return resolveTypeFromImport(ctx, node, name, scope); + } else { + const lookupSource = node.type === "TSTypeQuery" ? onlyExported ? scope.exportedDeclares : scope.declares : onlyExported ? scope.exportedTypes : scope.types; + if (lookupSource[name]) { + return lookupSource[name]; + } else { + const globalScopes = resolveGlobalScope(ctx); + if (globalScopes) { + for (const s of globalScopes) { + const src = node.type === "TSTypeQuery" ? s.declares : s.types; + if (src[name]) { + (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(s.filename); + return src[name]; + } + } + } + } + } + } else { + let ns = innerResolveTypeReference(ctx, scope, name[0], node, onlyExported); + if (ns) { + if (ns.type !== "TSModuleDeclaration") { + ns = ns._ns; + } + if (ns) { + const childScope = moduleDeclToScope(ctx, ns, ns._ownerScope || scope); + return innerResolveTypeReference( + ctx, + childScope, + name.length > 2 ? name.slice(1) : name[name.length - 1], + node, + !ns.declare + ); + } + } + } +} +function getReferenceName(node) { + const ref = node.type === "TSTypeReference" ? node.typeName : node.type === "TSExpressionWithTypeArguments" ? node.expression : node.type === "TSImportType" ? node.qualifier : node.exprName; + if ((ref == null ? void 0 : ref.type) === "Identifier") { + return ref.name; + } else if ((ref == null ? void 0 : ref.type) === "TSQualifiedName") { + return qualifiedNameToPath(ref); + } else { + return "default"; + } +} +function qualifiedNameToPath(node) { + if (node.type === "Identifier") { + return [node.name]; + } else { + return [...qualifiedNameToPath(node.left), node.right.name]; + } +} +function resolveGlobalScope(ctx) { + if (ctx.options.globalTypeFiles) { + const fs = resolveFS(ctx); + if (!fs) { + throw new Error("[vue/compiler-sfc] globalTypeFiles requires fs access."); + } + return ctx.options.globalTypeFiles.map( + (file) => fileToScope(ctx, normalizePath(file), true) + ); + } +} +let ts; +let loadTS; +function registerTS(_loadTS) { + loadTS = () => { + try { + return _loadTS(); + } catch (err) { + if (typeof err.message === "string" && err.message.includes("Cannot find module")) { + throw new Error( + 'Failed to load TypeScript, which is required for resolving imported types. Please make sure "typescript" is installed as a project dependency.' + ); + } else { + throw new Error( + "Failed to load TypeScript for resolving imported types." + ); + } + } + }; +} +function resolveFS(ctx) { + if (ctx.fs) { + return ctx.fs; + } + if (!ts && loadTS) { + ts = loadTS(); + } + const fs = ctx.options.fs || (ts == null ? void 0 : ts.sys); + if (!fs) { + return; + } + return ctx.fs = { + fileExists(file) { + if (file.endsWith(".vue.ts")) { + file = file.replace(/\.ts$/, ""); + } + return fs.fileExists(file); + }, + readFile(file) { + if (file.endsWith(".vue.ts")) { + file = file.replace(/\.ts$/, ""); + } + return fs.readFile(file); + }, + realpath: fs.realpath + }; +} +function resolveTypeFromImport(ctx, node, name, scope) { + const { source, imported } = scope.imports[name]; + const sourceScope = importSourceToScope(ctx, node, scope, source); + return resolveTypeReference(ctx, node, sourceScope, imported, true); +} +function importSourceToScope(ctx, node, scope, source) { + let fs; + try { + fs = resolveFS(ctx); + } catch (err) { + return ctx.error(err.message, node, scope); + } + if (!fs) { + return ctx.error( + `No fs option provided to \`compileScript\` in non-Node environment. File system access is required for resolving imported types.`, + node, + scope + ); + } + let resolved = scope.resolvedImportSources[source]; + if (!resolved) { + if (source.startsWith("..")) { + const osSpecificJoinFn = joinPaths; + const filename = osSpecificJoinFn(dirname(scope.filename), source); + resolved = resolveExt(filename, fs); + } else if (source[0] === ".") { + const filename = joinPaths(dirname(scope.filename), source); + resolved = resolveExt(filename, fs); + } else { + { + return ctx.error( + `Type import from non-relative sources is not supported in the browser build.`, + node, + scope + ); + } + } + if (resolved) { + resolved = scope.resolvedImportSources[source] = normalizePath(resolved); + } + } + if (resolved) { + (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved); + return fileToScope(ctx, resolved); + } else { + return ctx.error( + `Failed to resolve import source ${JSON.stringify(source)}.`, + node, + scope + ); + } +} +function resolveExt(filename, fs) { + filename = filename.replace(/\.js$/, ""); + const tryResolve = (filename2) => { + if (fs.fileExists(filename2)) return filename2; + }; + return tryResolve(filename) || tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`)); +} +const tsConfigCache = createCache(); +const tsConfigRefMap = /* @__PURE__ */ new Map(); +const fileToScopeCache = createCache(); +function invalidateTypeCache(filename) { + filename = normalizePath(filename); + fileToScopeCache.delete(filename); + tsConfigCache.delete(filename); + const affectedConfig = tsConfigRefMap.get(filename); + if (affectedConfig) tsConfigCache.delete(affectedConfig); +} +function fileToScope(ctx, filename, asGlobal = false) { + const cached = fileToScopeCache.get(filename); + if (cached) { + return cached; + } + const fs = resolveFS(ctx); + const source = fs.readFile(filename) || ""; + const body = parseFile(filename, source, ctx.options.babelParserPlugins); + const scope = new TypeScope(filename, source, 0, recordImports(body)); + recordTypes(ctx, body, scope, asGlobal); + fileToScopeCache.set(filename, scope); + return scope; +} +function parseFile(filename, content, parserPlugins) { + const ext = extname(filename); + if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".mtsx") { + return libExports.parse(content, { + plugins: resolveParserPlugins( + ext.slice(1), + parserPlugins, + /\.d\.m?ts$/.test(filename) + ), + sourceType: "module" + }).program.body; + } else if (ext === ".vue") { + const { + descriptor: { script, scriptSetup } + } = parse$2(content); + if (!script && !scriptSetup) { + return []; + } + const scriptOffset = script ? script.loc.start.offset : Infinity; + const scriptSetupOffset = scriptSetup ? scriptSetup.loc.start.offset : Infinity; + const firstBlock = scriptOffset < scriptSetupOffset ? script : scriptSetup; + const secondBlock = scriptOffset < scriptSetupOffset ? scriptSetup : script; + let scriptContent = " ".repeat(Math.min(scriptOffset, scriptSetupOffset)) + firstBlock.content; + if (secondBlock) { + scriptContent += " ".repeat(secondBlock.loc.start.offset - script.loc.end.offset) + secondBlock.content; + } + const lang = (script == null ? void 0 : script.lang) || (scriptSetup == null ? void 0 : scriptSetup.lang); + return libExports.parse(scriptContent, { + plugins: resolveParserPlugins(lang, parserPlugins), + sourceType: "module" + }).program.body; + } + return []; +} +function ctxToScope(ctx) { + if (ctx.scope) { + return ctx.scope; + } + const body = "ast" in ctx ? ctx.ast : ctx.scriptAst ? [...ctx.scriptAst.body, ...ctx.scriptSetupAst.body] : ctx.scriptSetupAst.body; + const scope = new TypeScope( + ctx.filename, + ctx.source, + "startOffset" in ctx ? ctx.startOffset : 0, + "userImports" in ctx ? Object.create(ctx.userImports) : recordImports(body) + ); + recordTypes(ctx, body, scope); + return ctx.scope = scope; +} +function moduleDeclToScope(ctx, node, parentScope) { + if (node._resolvedChildScope) { + return node._resolvedChildScope; + } + const scope = createChildScope(parentScope); + if (node.body.type === "TSModuleDeclaration") { + const decl = node.body; + decl._ownerScope = scope; + const id = getId(decl.id); + scope.types[id] = scope.exportedTypes[id] = decl; + } else { + recordTypes(ctx, node.body.body, scope); + } + return node._resolvedChildScope = scope; +} +function createChildScope(parentScope) { + return new TypeScope( + parentScope.filename, + parentScope.source, + parentScope.offset, + Object.create(parentScope.imports), + Object.create(parentScope.types), + Object.create(parentScope.declares) + ); +} +const importExportRE = /^Import|^Export/; +function recordTypes(ctx, body, scope, asGlobal = false) { + const { types, declares, exportedTypes, exportedDeclares, imports } = scope; + const isAmbient = asGlobal ? !body.some((s) => importExportRE.test(s.type)) : false; + for (const stmt of body) { + if (asGlobal) { + if (isAmbient) { + if (stmt.declare) { + recordType(stmt, types, declares); + } + } else if (stmt.type === "TSModuleDeclaration" && stmt.global) { + for (const s of stmt.body.body) { + recordType(s, types, declares); + } + } + } else { + recordType(stmt, types, declares); + } + } + if (!asGlobal) { + for (const stmt of body) { + if (stmt.type === "ExportNamedDeclaration") { + if (stmt.declaration) { + recordType(stmt.declaration, types, declares); + recordType(stmt.declaration, exportedTypes, exportedDeclares); + } else { + for (const spec of stmt.specifiers) { + if (spec.type === "ExportSpecifier") { + const local = spec.local.name; + const exported = getId(spec.exported); + if (stmt.source) { + imports[exported] = { + source: stmt.source.value, + imported: local + }; + exportedTypes[exported] = { + type: "TSTypeReference", + typeName: { + type: "Identifier", + name: local + }, + _ownerScope: scope + }; + } else if (types[local]) { + exportedTypes[exported] = types[local]; + } + } + } + } + } else if (stmt.type === "ExportAllDeclaration") { + const sourceScope = importSourceToScope( + ctx, + stmt.source, + scope, + stmt.source.value + ); + Object.assign(scope.exportedTypes, sourceScope.exportedTypes); + } else if (stmt.type === "ExportDefaultDeclaration" && stmt.declaration) { + if (stmt.declaration.type !== "Identifier") { + recordType(stmt.declaration, types, declares, "default"); + recordType( + stmt.declaration, + exportedTypes, + exportedDeclares, + "default" + ); + } else if (types[stmt.declaration.name]) { + exportedTypes["default"] = types[stmt.declaration.name]; + } + } + } + } + for (const key of Object.keys(types)) { + const node = types[key]; + node._ownerScope = scope; + if (node._ns) node._ns._ownerScope = scope; + } + for (const key of Object.keys(declares)) { + declares[key]._ownerScope = scope; + } +} +function recordType(node, types, declares, overwriteId) { + switch (node.type) { + case "TSInterfaceDeclaration": + case "TSEnumDeclaration": + case "TSModuleDeclaration": { + const id = overwriteId || getId(node.id); + let existing = types[id]; + if (existing) { + if (node.type === "TSModuleDeclaration") { + if (existing.type === "TSModuleDeclaration") { + mergeNamespaces(existing, node); + } else { + attachNamespace(existing, node); + } + break; + } + if (existing.type === "TSModuleDeclaration") { + types[id] = node; + attachNamespace(node, existing); + break; + } + if (existing.type !== node.type) { + break; + } + if (node.type === "TSInterfaceDeclaration") { + existing.body.body.push(...node.body.body); + } else { + existing.members.push(...node.members); + } + } else { + types[id] = node; + } + break; + } + case "ClassDeclaration": + if (overwriteId || node.id) types[overwriteId || getId(node.id)] = node; + break; + case "TSTypeAliasDeclaration": + types[node.id.name] = node.typeParameters ? node : node.typeAnnotation; + break; + case "TSDeclareFunction": + if (node.id) declares[node.id.name] = node; + break; + case "VariableDeclaration": { + if (node.declare) { + for (const decl of node.declarations) { + if (decl.id.type === "Identifier" && decl.id.typeAnnotation) { + declares[decl.id.name] = decl.id.typeAnnotation.typeAnnotation; + } + } + } + break; + } + } +} +function mergeNamespaces(to, from) { + const toBody = to.body; + const fromBody = from.body; + if (toBody.type === "TSModuleDeclaration") { + if (fromBody.type === "TSModuleDeclaration") { + mergeNamespaces(toBody, fromBody); + } else { + fromBody.body.push({ + type: "ExportNamedDeclaration", + declaration: toBody, + exportKind: "type", + specifiers: [] + }); + } + } else if (fromBody.type === "TSModuleDeclaration") { + toBody.body.push({ + type: "ExportNamedDeclaration", + declaration: fromBody, + exportKind: "type", + specifiers: [] + }); + } else { + toBody.body.push(...fromBody.body); + } +} +function attachNamespace(to, ns) { + if (!to._ns) { + to._ns = ns; + } else { + mergeNamespaces(to._ns, ns); + } +} +function recordImports(body) { + const imports = /* @__PURE__ */ Object.create(null); + for (const s of body) { + recordImport(s, imports); + } + return imports; +} +function recordImport(node, imports) { + if (node.type !== "ImportDeclaration") { + return; + } + for (const s of node.specifiers) { + imports[s.local.name] = { + imported: getImportedName(s), + source: node.source.value + }; + } +} +function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx), isKeyOf = false) { + try { + switch (node.type) { + case "TSStringKeyword": + return ["String"]; + case "TSNumberKeyword": + return ["Number"]; + case "TSBooleanKeyword": + return ["Boolean"]; + case "TSObjectKeyword": + return ["Object"]; + case "TSNullKeyword": + return ["null"]; + case "TSTypeLiteral": + case "TSInterfaceDeclaration": { + const types = /* @__PURE__ */ new Set(); + const members = node.type === "TSTypeLiteral" ? node.members : node.body.body; + for (const m of members) { + if (isKeyOf) { + if (m.type === "TSPropertySignature" && m.key.type === "NumericLiteral") { + types.add("Number"); + } else if (m.type === "TSIndexSignature") { + const annotation = m.parameters[0].typeAnnotation; + if (annotation && annotation.type !== "Noop") { + const type = inferRuntimeType( + ctx, + annotation.typeAnnotation, + scope + )[0]; + if (type === UNKNOWN_TYPE) return [UNKNOWN_TYPE]; + types.add(type); + } + } else { + types.add("String"); + } + } else if (m.type === "TSCallSignatureDeclaration" || m.type === "TSConstructSignatureDeclaration") { + types.add("Function"); + } else { + types.add("Object"); + } + } + return types.size ? Array.from(types) : [isKeyOf ? UNKNOWN_TYPE : "Object"]; + } + case "TSPropertySignature": + if (node.typeAnnotation) { + return inferRuntimeType( + ctx, + node.typeAnnotation.typeAnnotation, + scope + ); + } + break; + case "TSMethodSignature": + case "TSFunctionType": + return ["Function"]; + case "TSArrayType": + case "TSTupleType": + return ["Array"]; + case "TSLiteralType": + switch (node.literal.type) { + case "StringLiteral": + return ["String"]; + case "BooleanLiteral": + return ["Boolean"]; + case "NumericLiteral": + case "BigIntLiteral": + return ["Number"]; + default: + return [UNKNOWN_TYPE]; + } + case "TSTypeReference": { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) { + return inferRuntimeType(ctx, resolved, resolved._ownerScope, isKeyOf); + } + if (node.typeName.type === "Identifier") { + if (isKeyOf) { + switch (node.typeName.name) { + case "String": + case "Array": + case "ArrayLike": + case "Parameters": + case "ConstructorParameters": + case "ReadonlyArray": + return ["String", "Number"]; + // TS built-in utility types + case "Record": + case "Partial": + case "Required": + case "Readonly": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope, + true + ); + } + break; + case "Pick": + case "Extract": + if (node.typeParameters && node.typeParameters.params[1]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[1], + scope + ); + } + break; + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + case "Error": + case "Uppercase": + case "Lowercase": + case "Capitalize": + case "Uncapitalize": + case "ReadonlyMap": + case "ReadonlySet": + return ["String"]; + } + } else { + switch (node.typeName.name) { + case "Array": + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + case "Error": + return [node.typeName.name]; + // TS built-in utility types + // https://www.typescriptlang.org/docs/handbook/utility-types.html + case "Partial": + case "Required": + case "Readonly": + case "Record": + case "Pick": + case "Omit": + case "InstanceType": + return ["Object"]; + case "Uppercase": + case "Lowercase": + case "Capitalize": + case "Uncapitalize": + return ["String"]; + case "Parameters": + case "ConstructorParameters": + case "ReadonlyArray": + return ["Array"]; + case "ReadonlyMap": + return ["Map"]; + case "ReadonlySet": + return ["Set"]; + case "NonNullable": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope + ).filter((t) => t !== "null"); + } + break; + case "Extract": + if (node.typeParameters && node.typeParameters.params[1]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[1], + scope + ); + } + break; + case "Exclude": + case "OmitThisParameter": + if (node.typeParameters && node.typeParameters.params[0]) { + return inferRuntimeType( + ctx, + node.typeParameters.params[0], + scope + ); + } + break; + } + } + } + break; + } + case "TSParenthesizedType": + return inferRuntimeType(ctx, node.typeAnnotation, scope); + case "TSUnionType": + return flattenTypes(ctx, node.types, scope, isKeyOf); + case "TSIntersectionType": { + return flattenTypes(ctx, node.types, scope, isKeyOf).filter( + (t) => t !== UNKNOWN_TYPE + ); + } + case "TSEnumDeclaration": + return inferEnumType(node); + case "TSSymbolKeyword": + return ["Symbol"]; + case "TSIndexedAccessType": { + const types = resolveIndexType(ctx, node, scope); + return flattenTypes(ctx, types, scope, isKeyOf); + } + case "ClassDeclaration": + return ["Object"]; + case "TSImportType": { + const sourceScope = importSourceToScope( + ctx, + node.argument, + scope, + node.argument.value + ); + const resolved = resolveTypeReference(ctx, node, sourceScope); + if (resolved) { + return inferRuntimeType(ctx, resolved, resolved._ownerScope); + } + break; + } + case "TSTypeQuery": { + const id = node.exprName; + if (id.type === "Identifier") { + const matched = scope.declares[id.name]; + if (matched) { + return inferRuntimeType(ctx, matched, matched._ownerScope, isKeyOf); + } + } + break; + } + // e.g. readonly + case "TSTypeOperator": { + return inferRuntimeType( + ctx, + node.typeAnnotation, + scope, + node.operator === "keyof" + ); + } + case "TSAnyKeyword": { + if (isKeyOf) { + return ["String", "Number", "Symbol"]; + } + break; + } + } + } catch (e) { + } + return [UNKNOWN_TYPE]; +} +function flattenTypes(ctx, types, scope, isKeyOf = false) { + if (types.length === 1) { + return inferRuntimeType(ctx, types[0], scope, isKeyOf); + } + return [ + ...new Set( + [].concat( + ...types.map((t) => inferRuntimeType(ctx, t, scope, isKeyOf)) + ) + ) + ]; +} +function inferEnumType(node) { + const types = /* @__PURE__ */ new Set(); + for (const m of node.members) { + if (m.initializer) { + switch (m.initializer.type) { + case "StringLiteral": + types.add("String"); + break; + case "NumericLiteral": + types.add("Number"); + break; + } + } + } + return types.size ? [...types] : ["Number"]; +} +function resolveExtractPropTypes({ props }, scope) { + const res = { props: {} }; + for (const key in props) { + const raw = props[key]; + res.props[key] = reverseInferType( + raw.key, + raw.typeAnnotation.typeAnnotation, + scope + ); + } + return res; +} +function reverseInferType(key, node, scope, optional = true, checkObjectSyntax = true) { + if (checkObjectSyntax && node.type === "TSTypeLiteral") { + const typeType = findStaticPropertyType(node, "type"); + if (typeType) { + const requiredType = findStaticPropertyType(node, "required"); + const optional2 = requiredType && requiredType.type === "TSLiteralType" && requiredType.literal.type === "BooleanLiteral" ? !requiredType.literal.value : true; + return reverseInferType(key, typeType, scope, optional2, false); + } + } else if (node.type === "TSTypeReference" && node.typeName.type === "Identifier") { + if (node.typeName.name.endsWith("Constructor")) { + return createProperty( + key, + ctorToType(node.typeName.name), + scope, + optional + ); + } else if (node.typeName.name === "PropType" && node.typeParameters) { + return createProperty(key, node.typeParameters.params[0], scope, optional); + } + } + if ((node.type === "TSTypeReference" || node.type === "TSImportType") && node.typeParameters) { + for (const t of node.typeParameters.params) { + const inferred = reverseInferType(key, t, scope, optional); + if (inferred) return inferred; + } + } + return createProperty(key, { type: `TSNullKeyword` }, scope, optional); +} +function ctorToType(ctorType) { + const ctor = ctorType.slice(0, -11); + switch (ctor) { + case "String": + case "Number": + case "Boolean": + return { type: `TS${ctor}Keyword` }; + case "Array": + case "Function": + case "Object": + case "Set": + case "Map": + case "WeakSet": + case "WeakMap": + case "Date": + case "Promise": + return { + type: "TSTypeReference", + typeName: { type: "Identifier", name: ctor } + }; + } + return { type: `TSNullKeyword` }; +} +function findStaticPropertyType(node, key) { + const prop = node.members.find( + (m) => m.type === "TSPropertySignature" && !m.computed && getId(m.key) === key && m.typeAnnotation + ); + return prop && prop.typeAnnotation.typeAnnotation; +} +function resolveReturnType(ctx, arg, scope) { + var _a; + let resolved = arg; + if (arg.type === "TSTypeReference" || arg.type === "TSTypeQuery" || arg.type === "TSImportType") { + resolved = resolveTypeReference(ctx, arg, scope); + } + if (!resolved) return; + if (resolved.type === "TSFunctionType") { + return (_a = resolved.typeAnnotation) == null ? void 0 : _a.typeAnnotation; + } + if (resolved.type === "TSDeclareFunction") { + return resolved.returnType; + } +} +function resolveUnionType(ctx, node, scope) { + if (node.type === "TSTypeReference") { + const resolved = resolveTypeReference(ctx, node, scope); + if (resolved) node = resolved; + } + let types; + if (node.type === "TSUnionType") { + types = node.types.flatMap((node2) => resolveUnionType(ctx, node2, scope)); + } else { + types = [node]; + } + return types; +} + +const DEFINE_MODEL = "defineModel"; +function processDefineModel(ctx, node, declId) { + if (!isCallOf(node, DEFINE_MODEL)) { + return false; + } + ctx.hasDefineModelCall = true; + const type = node.typeParameters && node.typeParameters.params[0] || void 0; + let modelName; + let options; + const arg0 = node.arguments[0] && unwrapTSNode(node.arguments[0]); + const hasName = arg0 && arg0.type === "StringLiteral"; + if (hasName) { + modelName = arg0.value; + options = node.arguments[1]; + } else { + modelName = "modelValue"; + options = arg0; + } + if (ctx.modelDecls[modelName]) { + ctx.error(`duplicate model name ${JSON.stringify(modelName)}`, node); + } + let optionsString = options && ctx.getString(options); + let optionsRemoved = !options; + const runtimeOptionNodes = []; + if (options && options.type === "ObjectExpression" && !options.properties.some((p) => p.type === "SpreadElement" || p.computed)) { + let removed = 0; + for (let i = options.properties.length - 1; i >= 0; i--) { + const p = options.properties[i]; + const next = options.properties[i + 1]; + const start = p.start; + const end = next ? next.start : options.end - 1; + if ((p.type === "ObjectProperty" || p.type === "ObjectMethod") && (p.key.type === "Identifier" && (p.key.name === "get" || p.key.name === "set") || p.key.type === "StringLiteral" && (p.key.value === "get" || p.key.value === "set"))) { + optionsString = optionsString.slice(0, start - options.start) + optionsString.slice(end - options.start); + } else { + removed++; + ctx.s.remove(ctx.startOffset + start, ctx.startOffset + end); + runtimeOptionNodes.push(p); + } + } + if (removed === options.properties.length) { + optionsRemoved = true; + ctx.s.remove( + ctx.startOffset + (hasName ? arg0.end : options.start), + ctx.startOffset + options.end + ); + } + } + ctx.modelDecls[modelName] = { + type, + options: optionsString, + runtimeOptionNodes, + identifier: declId && declId.type === "Identifier" ? declId.name : void 0 + }; + ctx.bindingMetadata[modelName] = "props"; + ctx.s.overwrite( + ctx.startOffset + node.callee.start, + ctx.startOffset + node.callee.end, + ctx.helper("useModel") + ); + ctx.s.appendLeft( + ctx.startOffset + (node.arguments.length ? node.arguments[0].start : node.end - 1), + `__props, ` + (hasName ? `` : `${JSON.stringify(modelName)}${optionsRemoved ? `` : `, `}`) + ); + return true; +} +function genModelProps(ctx) { + if (!ctx.hasDefineModelCall) return; + const isProd = !!ctx.options.isProd; + let modelPropsDecl = ""; + for (const [name, { type, options: runtimeOptions }] of Object.entries( + ctx.modelDecls + )) { + let skipCheck = false; + let codegenOptions = ``; + let runtimeTypes = type && inferRuntimeType(ctx, type); + if (runtimeTypes) { + const hasBoolean = runtimeTypes.includes("Boolean"); + const hasFunction = runtimeTypes.includes("Function"); + const hasUnknownType = runtimeTypes.includes(UNKNOWN_TYPE); + if (hasUnknownType) { + if (hasBoolean || hasFunction) { + runtimeTypes = runtimeTypes.filter((t) => t !== UNKNOWN_TYPE); + skipCheck = true; + } else { + runtimeTypes = ["null"]; + } + } + if (!isProd) { + codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}` + (skipCheck ? ", skipCheck: true" : ""); + } else if (hasBoolean || runtimeOptions && hasFunction) { + codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}`; + } else ; + } + let decl; + if (codegenOptions && runtimeOptions) { + decl = ctx.isTS ? `{ ${codegenOptions}, ...${runtimeOptions} }` : `Object.assign({ ${codegenOptions} }, ${runtimeOptions})`; + } else if (codegenOptions) { + decl = `{ ${codegenOptions} }`; + } else if (runtimeOptions) { + decl = runtimeOptions; + } else { + decl = `{}`; + } + modelPropsDecl += ` + ${JSON.stringify(name)}: ${decl},`; + const modifierPropName = JSON.stringify( + name === "modelValue" ? `modelModifiers` : `${name}Modifiers` + ); + modelPropsDecl += ` + ${modifierPropName}: {},`; + } + return `{${modelPropsDecl} + }`; +} + +const DEFINE_PROPS = "defineProps"; +const WITH_DEFAULTS = "withDefaults"; +function processDefineProps(ctx, node, declId, isWithDefaults = false) { + if (!isCallOf(node, DEFINE_PROPS)) { + return processWithDefaults(ctx, node, declId); + } + if (ctx.hasDefinePropsCall) { + ctx.error(`duplicate ${DEFINE_PROPS}() call`, node); + } + ctx.hasDefinePropsCall = true; + ctx.propsRuntimeDecl = node.arguments[0]; + if (ctx.propsRuntimeDecl) { + for (const key of getObjectOrArrayExpressionKeys(ctx.propsRuntimeDecl)) { + if (!(key in ctx.bindingMetadata)) { + ctx.bindingMetadata[key] = "props"; + } + } + } + if (node.typeParameters) { + if (ctx.propsRuntimeDecl) { + ctx.error( + `${DEFINE_PROPS}() cannot accept both type and non-type arguments at the same time. Use one or the other.`, + node + ); + } + ctx.propsTypeDecl = node.typeParameters.params[0]; + } + if (!isWithDefaults && declId && declId.type === "ObjectPattern") { + processPropsDestructure(ctx, declId); + } + ctx.propsCall = node; + ctx.propsDecl = declId; + return true; +} +function processWithDefaults(ctx, node, declId) { + if (!isCallOf(node, WITH_DEFAULTS)) { + return false; + } + if (!processDefineProps( + ctx, + node.arguments[0], + declId, + true + )) { + ctx.error( + `${WITH_DEFAULTS}' first argument must be a ${DEFINE_PROPS} call.`, + node.arguments[0] || node + ); + } + if (ctx.propsRuntimeDecl) { + ctx.error( + `${WITH_DEFAULTS} can only be used with type-based ${DEFINE_PROPS} declaration.`, + node + ); + } + if (declId && declId.type === "ObjectPattern") { + ctx.warn( + `${WITH_DEFAULTS}() is unnecessary when using destructure with ${DEFINE_PROPS}(). +Reactive destructure will be disabled when using withDefaults(). +Prefer using destructure default values, e.g. const { foo = 1 } = defineProps(...). `, + node.callee + ); + } + ctx.propsRuntimeDefaults = node.arguments[1]; + if (!ctx.propsRuntimeDefaults) { + ctx.error(`The 2nd argument of ${WITH_DEFAULTS} is required.`, node); + } + ctx.propsCall = node; + return true; +} +function genRuntimeProps(ctx) { + let propsDecls; + if (ctx.propsRuntimeDecl) { + propsDecls = ctx.getString(ctx.propsRuntimeDecl).trim(); + if (ctx.propsDestructureDecl) { + const defaults = []; + for (const key in ctx.propsDestructuredBindings) { + const d = genDestructuredDefaultValue(ctx, key); + const finalKey = getEscapedPropName(key); + if (d) + defaults.push( + `${finalKey}: ${d.valueString}${d.needSkipFactory ? `, __skip_${finalKey}: true` : ``}` + ); + } + if (defaults.length) { + propsDecls = `/*@__PURE__*/${ctx.helper( + `mergeDefaults` + )}(${propsDecls}, { + ${defaults.join(",\n ")} +})`; + } + } + } else if (ctx.propsTypeDecl) { + propsDecls = extractRuntimeProps(ctx); + } + const modelsDecls = genModelProps(ctx); + if (propsDecls && modelsDecls) { + return `/*@__PURE__*/${ctx.helper( + "mergeModels" + )}(${propsDecls}, ${modelsDecls})`; + } else { + return modelsDecls || propsDecls; + } +} +function extractRuntimeProps(ctx) { + const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl); + if (!props.length) { + return; + } + const propStrings = []; + const hasStaticDefaults = hasStaticWithDefaults(ctx); + for (const prop of props) { + propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults)); + if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) { + ctx.bindingMetadata[prop.key] = "props"; + } + } + let propsDecls = `{ + ${propStrings.join(",\n ")} + }`; + if (ctx.propsRuntimeDefaults && !hasStaticDefaults) { + propsDecls = `/*@__PURE__*/${ctx.helper( + "mergeDefaults" + )}(${propsDecls}, ${ctx.getString(ctx.propsRuntimeDefaults)})`; + } + return propsDecls; +} +function resolveRuntimePropsFromType(ctx, node) { + const props = []; + const elements = resolveTypeElements(ctx, node); + for (const key in elements.props) { + const e = elements.props[key]; + let type = inferRuntimeType(ctx, e); + let skipCheck = false; + if (type.includes(UNKNOWN_TYPE)) { + if (type.includes("Boolean") || type.includes("Function")) { + type = type.filter((t) => t !== UNKNOWN_TYPE); + skipCheck = true; + } else { + type = ["null"]; + } + } + props.push({ + key, + required: !e.optional, + type: type || [`null`], + skipCheck + }); + } + return props; +} +function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStaticDefaults) { + let defaultString; + const destructured = genDestructuredDefaultValue(ctx, key, type); + if (destructured) { + defaultString = `default: ${destructured.valueString}${destructured.needSkipFactory ? `, skipFactory: true` : ``}`; + } else if (hasStaticDefaults) { + const prop = ctx.propsRuntimeDefaults.properties.find( + (node) => { + if (node.type === "SpreadElement") return false; + return resolveObjectKey(node.key, node.computed) === key; + } + ); + if (prop) { + if (prop.type === "ObjectProperty") { + defaultString = `default: ${ctx.getString(prop.value)}`; + } else { + defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default() ${ctx.getString(prop.body)}`; + } + } + } + const finalKey = getEscapedPropName(key); + if (!ctx.options.isProd) { + return `${finalKey}: { ${concatStrings([ + `type: ${toRuntimeTypeString(type)}`, + `required: ${required}`, + skipCheck && "skipCheck: true", + defaultString + ])} }`; + } else if (type.some( + (el) => el === "Boolean" || (!hasStaticDefaults || defaultString) && el === "Function" + )) { + return `${finalKey}: { ${concatStrings([ + `type: ${toRuntimeTypeString(type)}`, + defaultString + ])} }`; + } else { + if (ctx.isCE) { + if (defaultString) { + return `${finalKey}: ${`{ ${defaultString}, type: ${toRuntimeTypeString( + type + )} }`}`; + } else { + return `${finalKey}: {type: ${toRuntimeTypeString(type)}}`; + } + } + return `${finalKey}: ${defaultString ? `{ ${defaultString} }` : `{}`}`; + } +} +function hasStaticWithDefaults(ctx) { + return !!(ctx.propsRuntimeDefaults && ctx.propsRuntimeDefaults.type === "ObjectExpression" && ctx.propsRuntimeDefaults.properties.every( + (node) => node.type !== "SpreadElement" && (!node.computed || node.key.type.endsWith("Literal")) + )); +} +function genDestructuredDefaultValue(ctx, key, inferredType) { + const destructured = ctx.propsDestructuredBindings[key]; + const defaultVal = destructured && destructured.default; + if (defaultVal) { + const value = ctx.getString(defaultVal); + const unwrapped = unwrapTSNode(defaultVal); + if (inferredType && inferredType.length && !inferredType.includes("null")) { + const valueType = inferValueType(unwrapped); + if (valueType && !inferredType.includes(valueType)) { + ctx.error( + `Default value of prop "${key}" does not match declared type.`, + unwrapped + ); + } + } + const needSkipFactory = !inferredType && (isFunctionType(unwrapped) || unwrapped.type === "Identifier"); + const needFactoryWrap = !needSkipFactory && !isLiteralNode(unwrapped) && !(inferredType == null ? void 0 : inferredType.includes("Function")); + return { + valueString: needFactoryWrap ? `() => (${value})` : value, + needSkipFactory + }; + } +} +function inferValueType(node) { + switch (node.type) { + case "StringLiteral": + return "String"; + case "NumericLiteral": + return "Number"; + case "BooleanLiteral": + return "Boolean"; + case "ObjectExpression": + return "Object"; + case "ArrayExpression": + return "Array"; + case "FunctionExpression": + case "ArrowFunctionExpression": + return "Function"; + } +} + +function processPropsDestructure(ctx, declId) { + if (ctx.options.propsDestructure === "error") { + ctx.error(`Props destructure is explicitly prohibited via config.`, declId); + } else if (ctx.options.propsDestructure === false) { + return; + } + ctx.propsDestructureDecl = declId; + const registerBinding = (key, local, defaultValue) => { + ctx.propsDestructuredBindings[key] = { local, default: defaultValue }; + if (local !== key) { + ctx.bindingMetadata[local] = "props-aliased"; + (ctx.bindingMetadata.__propsAliases || (ctx.bindingMetadata.__propsAliases = {}))[local] = key; + } + }; + for (const prop of declId.properties) { + if (prop.type === "ObjectProperty") { + const propKey = resolveObjectKey(prop.key, prop.computed); + if (!propKey) { + ctx.error( + `${DEFINE_PROPS}() destructure cannot use computed key.`, + prop.key + ); + } + if (prop.value.type === "AssignmentPattern") { + const { left, right } = prop.value; + if (left.type !== "Identifier") { + ctx.error( + `${DEFINE_PROPS}() destructure does not support nested patterns.`, + left + ); + } + registerBinding(propKey, left.name, right); + } else if (prop.value.type === "Identifier") { + registerBinding(propKey, prop.value.name); + } else { + ctx.error( + `${DEFINE_PROPS}() destructure does not support nested patterns.`, + prop.value + ); + } + } else { + ctx.propsDestructureRestId = prop.argument.name; + ctx.bindingMetadata[ctx.propsDestructureRestId] = "setup-reactive-const"; + } + } +} +function transformDestructuredProps(ctx, vueImportAliases) { + if (ctx.options.propsDestructure === false) { + return; + } + const rootScope = /* @__PURE__ */ Object.create(null); + const scopeStack = [rootScope]; + let currentScope = rootScope; + const excludedIds = /* @__PURE__ */ new WeakSet(); + const parentStack = []; + const propsLocalToPublicMap = /* @__PURE__ */ Object.create(null); + for (const key in ctx.propsDestructuredBindings) { + const { local } = ctx.propsDestructuredBindings[key]; + rootScope[local] = true; + propsLocalToPublicMap[local] = key; + } + function pushScope() { + scopeStack.push(currentScope = Object.create(currentScope)); + } + function popScope() { + scopeStack.pop(); + currentScope = scopeStack[scopeStack.length - 1] || null; + } + function registerLocalBinding(id) { + excludedIds.add(id); + if (currentScope) { + currentScope[id.name] = false; + } else { + ctx.error( + "registerBinding called without active scope, something is wrong.", + id + ); + } + } + function walkScope(node, isRoot = false) { + for (const stmt of node.body) { + if (stmt.type === "VariableDeclaration") { + walkVariableDeclaration(stmt, isRoot); + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) continue; + registerLocalBinding(stmt.id); + } else if ((stmt.type === "ForOfStatement" || stmt.type === "ForInStatement") && stmt.left.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.left); + } else if (stmt.type === "ExportNamedDeclaration" && stmt.declaration && stmt.declaration.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.declaration, isRoot); + } else if (stmt.type === "LabeledStatement" && stmt.body.type === "VariableDeclaration") { + walkVariableDeclaration(stmt.body, isRoot); + } + } + } + function walkVariableDeclaration(stmt, isRoot = false) { + if (stmt.declare) { + return; + } + for (const decl of stmt.declarations) { + const isDefineProps = isRoot && decl.init && isCallOf(unwrapTSNode(decl.init), "defineProps"); + for (const id of extractIdentifiers$1(decl.id)) { + if (isDefineProps) { + excludedIds.add(id); + } else { + registerLocalBinding(id); + } + } + } + } + function rewriteId(id, parent, parentStack2) { + if (parent.type === "AssignmentExpression" && id === parent.left || parent.type === "UpdateExpression") { + ctx.error(`Cannot assign to destructured props as they are readonly.`, id); + } + if (isStaticProperty(parent) && parent.shorthand) { + if (!parent.inPattern || isInDestructureAssignment(parent, parentStack2)) { + ctx.s.appendLeft( + id.end + ctx.startOffset, + `: ${genPropsAccessExp(propsLocalToPublicMap[id.name])}` + ); + } + } else { + ctx.s.overwrite( + id.start + ctx.startOffset, + id.end + ctx.startOffset, + genPropsAccessExp(propsLocalToPublicMap[id.name]) + ); + } + } + function checkUsage(node, method, alias = method) { + if (isCallOf(node, alias)) { + const arg = unwrapTSNode(node.arguments[0]); + if (arg.type === "Identifier" && currentScope[arg.name]) { + ctx.error( + `"${arg.name}" is a destructured prop and should not be passed directly to ${method}(). Pass a getter () => ${arg.name} instead.`, + arg + ); + } + } + } + const ast = ctx.scriptSetupAst; + walkScope(ast, true); + walk$2(ast, { + enter(node, parent) { + parent && parentStack.push(parent); + if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) { + return this.skip(); + } + checkUsage(node, "watch", vueImportAliases.watch); + checkUsage(node, "toRef", vueImportAliases.toRef); + if (isFunctionType(node)) { + pushScope(); + walkFunctionParams(node, registerLocalBinding); + if (node.body.type === "BlockStatement") { + walkScope(node.body); + } + return; + } + if (node.type === "CatchClause") { + pushScope(); + if (node.param && node.param.type === "Identifier") { + registerLocalBinding(node.param); + } + walkScope(node.body); + return; + } + if (node.type === "BlockStatement" && !isFunctionType(parent)) { + pushScope(); + walkScope(node); + return; + } + if (node.type === "Identifier") { + if (isReferencedIdentifier(node, parent, parentStack) && !excludedIds.has(node)) { + if (currentScope[node.name]) { + rewriteId(node, parent, parentStack); + } + } + } + }, + leave(node, parent) { + parent && parentStack.pop(); + if (node.type === "BlockStatement" && !isFunctionType(parent) || isFunctionType(node)) { + popScope(); + } + } + }); +} + +const DEFINE_EMITS = "defineEmits"; +function processDefineEmits(ctx, node, declId) { + if (!isCallOf(node, DEFINE_EMITS)) { + return false; + } + if (ctx.hasDefineEmitCall) { + ctx.error(`duplicate ${DEFINE_EMITS}() call`, node); + } + ctx.hasDefineEmitCall = true; + ctx.emitsRuntimeDecl = node.arguments[0]; + if (node.typeParameters) { + if (ctx.emitsRuntimeDecl) { + ctx.error( + `${DEFINE_EMITS}() cannot accept both type and non-type arguments at the same time. Use one or the other.`, + node + ); + } + ctx.emitsTypeDecl = node.typeParameters.params[0]; + } + ctx.emitDecl = declId; + return true; +} +function genRuntimeEmits(ctx) { + let emitsDecl = ""; + if (ctx.emitsRuntimeDecl) { + emitsDecl = ctx.getString(ctx.emitsRuntimeDecl).trim(); + } else if (ctx.emitsTypeDecl) { + const typeDeclaredEmits = extractRuntimeEmits(ctx); + emitsDecl = typeDeclaredEmits.size ? `[${Array.from(typeDeclaredEmits).map((k) => JSON.stringify(k)).join(", ")}]` : ``; + } + if (ctx.hasDefineModelCall) { + let modelEmitsDecl = `[${Object.keys(ctx.modelDecls).map((n) => JSON.stringify(`update:${n}`)).join(", ")}]`; + emitsDecl = emitsDecl ? `/*@__PURE__*/${ctx.helper( + "mergeModels" + )}(${emitsDecl}, ${modelEmitsDecl})` : modelEmitsDecl; + } + return emitsDecl; +} +function extractRuntimeEmits(ctx) { + const emits = /* @__PURE__ */ new Set(); + const node = ctx.emitsTypeDecl; + if (node.type === "TSFunctionType") { + extractEventNames(ctx, node.parameters[0], emits); + return emits; + } + const { props, calls } = resolveTypeElements(ctx, node); + let hasProperty = false; + for (const key in props) { + emits.add(key); + hasProperty = true; + } + if (calls) { + if (hasProperty) { + ctx.error( + `defineEmits() type cannot mixed call signature and property syntax.`, + node + ); + } + for (const call of calls) { + extractEventNames(ctx, call.parameters[0], emits); + } + } + return emits; +} +function extractEventNames(ctx, eventName, emits) { + if (eventName.type === "Identifier" && eventName.typeAnnotation && eventName.typeAnnotation.type === "TSTypeAnnotation") { + const types = resolveUnionType(ctx, eventName.typeAnnotation.typeAnnotation); + for (const type of types) { + if (type.type === "TSLiteralType") { + if (type.literal.type !== "UnaryExpression" && type.literal.type !== "TemplateLiteral") { + emits.add(String(type.literal.value)); + } + } + } + } +} + +const DEFINE_EXPOSE = "defineExpose"; +function processDefineExpose(ctx, node) { + if (isCallOf(node, DEFINE_EXPOSE)) { + if (ctx.hasDefineExposeCall) { + ctx.error(`duplicate ${DEFINE_EXPOSE}() call`, node); + } + ctx.hasDefineExposeCall = true; + return true; + } + return false; +} + +const DEFINE_SLOTS = "defineSlots"; +function processDefineSlots(ctx, node, declId) { + if (!isCallOf(node, DEFINE_SLOTS)) { + return false; + } + if (ctx.hasDefineSlotsCall) { + ctx.error(`duplicate ${DEFINE_SLOTS}() call`, node); + } + ctx.hasDefineSlotsCall = true; + if (node.arguments.length > 0) { + ctx.error(`${DEFINE_SLOTS}() cannot accept arguments`, node); + } + if (declId) { + ctx.s.overwrite( + ctx.startOffset + node.start, + ctx.startOffset + node.end, + `${ctx.helper("useSlots")}()` + ); + } + return true; +} + +const DEFINE_OPTIONS = "defineOptions"; +function processDefineOptions(ctx, node) { + if (!isCallOf(node, DEFINE_OPTIONS)) { + return false; + } + if (ctx.hasDefineOptionsCall) { + ctx.error(`duplicate ${DEFINE_OPTIONS}() call`, node); + } + if (node.typeParameters) { + ctx.error(`${DEFINE_OPTIONS}() cannot accept type arguments`, node); + } + if (!node.arguments[0]) return true; + ctx.hasDefineOptionsCall = true; + ctx.optionsRuntimeDecl = unwrapTSNode(node.arguments[0]); + let propsOption = void 0; + let emitsOption = void 0; + let exposeOption = void 0; + let slotsOption = void 0; + if (ctx.optionsRuntimeDecl.type === "ObjectExpression") { + for (const prop of ctx.optionsRuntimeDecl.properties) { + if ((prop.type === "ObjectProperty" || prop.type === "ObjectMethod") && prop.key.type === "Identifier") { + switch (prop.key.name) { + case "props": + propsOption = prop; + break; + case "emits": + emitsOption = prop; + break; + case "expose": + exposeOption = prop; + break; + case "slots": + slotsOption = prop; + break; + } + } + } + } + if (propsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare props. Use ${DEFINE_PROPS}() instead.`, + propsOption + ); + } + if (emitsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare emits. Use ${DEFINE_EMITS}() instead.`, + emitsOption + ); + } + if (exposeOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare expose. Use ${DEFINE_EXPOSE}() instead.`, + exposeOption + ); + } + if (slotsOption) { + ctx.error( + `${DEFINE_OPTIONS}() cannot be used to declare slots. Use ${DEFINE_SLOTS}() instead.`, + slotsOption + ); + } + return true; +} + +function processAwait(ctx, node, needSemi, isStatement) { + const argumentStart = node.argument.extra && node.argument.extra.parenthesized ? node.argument.extra.parenStart : node.argument.start; + const startOffset = ctx.startOffset; + const argumentStr = ctx.descriptor.source.slice( + argumentStart + startOffset, + node.argument.end + startOffset + ); + const containsNestedAwait = /\bawait\b/.test(argumentStr); + ctx.s.overwrite( + node.start + startOffset, + argumentStart + startOffset, + `${needSemi ? `;` : ``}( + ([__temp,__restore] = ${ctx.helper( + `withAsyncContext` + )}(${containsNestedAwait ? `async ` : ``}() => ` + ); + ctx.s.appendLeft( + node.end + startOffset, + `)), + ${isStatement ? `` : `__temp = `}await __temp, + __restore()${isStatement ? `` : `, + __temp`} +)` + ); +} + +var __defProp$1 = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols; +var __hasOwnProp$1 = Object.prototype.hasOwnProperty; +var __propIsEnum$1 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$1 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$1.call(b, prop)) + __defNormalProp$1(a, prop, b[prop]); + if (__getOwnPropSymbols$1) + for (var prop of __getOwnPropSymbols$1(b)) { + if (__propIsEnum$1.call(b, prop)) + __defNormalProp$1(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +const MACROS = [ + DEFINE_PROPS, + DEFINE_EMITS, + DEFINE_EXPOSE, + DEFINE_OPTIONS, + DEFINE_SLOTS, + DEFINE_MODEL, + WITH_DEFAULTS +]; +function compileScript(sfc, options) { + var _a, _b, _c; + if (!options.id) { + warnOnce$1( + `compileScript now requires passing the \`id\` option. +Upgrade your vite or vue-loader version for compatibility with the latest experimental proposals.` + ); + } + const ctx = new ScriptCompileContext(sfc, options); + const { script, scriptSetup, source, filename } = sfc; + const hoistStatic = options.hoistStatic !== false && !script; + const scopeId = options.id ? options.id.replace(/^data-v-/, "") : ""; + const scriptLang = script && script.lang; + const scriptSetupLang = scriptSetup && scriptSetup.lang; + if (!scriptSetup) { + if (!script) { + throw new Error(`[@vue/compiler-sfc] SFC contains no <script> tags.`); + } + return processNormalScript(ctx, scopeId); + } + if (script && scriptLang !== scriptSetupLang) { + throw new Error( + `[@vue/compiler-sfc] <script> and <script setup> must have the same language type.` + ); + } + if (scriptSetupLang && !ctx.isJS && !ctx.isTS) { + return scriptSetup; + } + const scriptBindings = /* @__PURE__ */ Object.create(null); + const setupBindings = /* @__PURE__ */ Object.create(null); + let defaultExport; + let hasAwait = false; + let hasInlinedSsrRenderFn = false; + const startOffset = ctx.startOffset; + const endOffset = ctx.endOffset; + const scriptStartOffset = script && script.loc.start.offset; + const scriptEndOffset = script && script.loc.end.offset; + function hoistNode(node) { + const start = node.start + startOffset; + let end = node.end + startOffset; + if (node.trailingComments && node.trailingComments.length > 0) { + const lastCommentNode = node.trailingComments[node.trailingComments.length - 1]; + end = lastCommentNode.end + startOffset; + } + while (end <= source.length) { + if (!/\s/.test(source.charAt(end))) { + break; + } + end++; + } + ctx.s.move(start, end, 0); + } + function registerUserImport(source2, local, imported, isType, isFromSetup, needTemplateUsageCheck) { + let isUsedInTemplate = needTemplateUsageCheck; + if (needTemplateUsageCheck && ctx.isTS && sfc.template && !sfc.template.src && !sfc.template.lang) { + isUsedInTemplate = isImportUsed(local, sfc); + } + ctx.userImports[local] = { + isType, + imported, + local, + source: source2, + isFromSetup, + isUsedInTemplate + }; + } + function checkInvalidScopeReference(node, method) { + if (!node) return; + walkIdentifiers(node, (id) => { + const binding = setupBindings[id.name]; + if (binding && binding !== "literal-const") { + ctx.error( + `\`${method}()\` in <script setup> cannot reference locally declared variables because it will be hoisted outside of the setup() function. If your component options require initialization in the module scope, use a separate normal <script> to export the options instead.`, + id + ); + } + }); + } + const scriptAst = ctx.scriptAst; + const scriptSetupAst = ctx.scriptSetupAst; + if (scriptAst) { + for (const node of scriptAst.body) { + if (node.type === "ImportDeclaration") { + for (const specifier of node.specifiers) { + const imported = getImportedName(specifier); + registerUserImport( + node.source.value, + specifier.local.name, + imported, + node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type", + false, + !options.inlineTemplate + ); + } + } + } + } + for (const node of scriptSetupAst.body) { + if (node.type === "ImportDeclaration") { + hoistNode(node); + let removed = 0; + const removeSpecifier = (i) => { + const removeLeft = i > removed; + removed++; + const current = node.specifiers[i]; + const next = node.specifiers[i + 1]; + ctx.s.remove( + removeLeft ? node.specifiers[i - 1].end + startOffset : current.start + startOffset, + next && !removeLeft ? next.start + startOffset : current.end + startOffset + ); + }; + for (let i = 0; i < node.specifiers.length; i++) { + const specifier = node.specifiers[i]; + const local = specifier.local.name; + const imported = getImportedName(specifier); + const source2 = node.source.value; + const existing = ctx.userImports[local]; + if (source2 === "vue" && MACROS.includes(imported)) { + if (local === imported) { + warnOnce$1( + `\`${imported}\` is a compiler macro and no longer needs to be imported.` + ); + } else { + ctx.error( + `\`${imported}\` is a compiler macro and cannot be aliased to a different name.`, + specifier + ); + } + removeSpecifier(i); + } else if (existing) { + if (existing.source === source2 && existing.imported === imported) { + removeSpecifier(i); + } else { + ctx.error( + `different imports aliased to same local name.`, + specifier + ); + } + } else { + registerUserImport( + source2, + local, + imported, + node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type", + true, + !options.inlineTemplate + ); + } + } + if (node.specifiers.length && removed === node.specifiers.length) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } + } + } + const vueImportAliases = {}; + for (const key in ctx.userImports) { + const { source: source2, imported, local } = ctx.userImports[key]; + if (source2 === "vue") vueImportAliases[imported] = local; + } + if (script && scriptAst) { + for (const node of scriptAst.body) { + if (node.type === "ExportDefaultDeclaration") { + defaultExport = node; + let optionProperties; + if (defaultExport.declaration.type === "ObjectExpression") { + optionProperties = defaultExport.declaration.properties; + } else if (defaultExport.declaration.type === "CallExpression" && defaultExport.declaration.arguments[0] && defaultExport.declaration.arguments[0].type === "ObjectExpression") { + optionProperties = defaultExport.declaration.arguments[0].properties; + } + if (optionProperties) { + for (const p of optionProperties) { + if (p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name") { + ctx.hasDefaultExportName = true; + } + if ((p.type === "ObjectMethod" || p.type === "ObjectProperty") && p.key.type === "Identifier" && p.key.name === "render") { + ctx.hasDefaultExportRender = true; + } + } + } + const start = node.start + scriptStartOffset; + const end = node.declaration.start + scriptStartOffset; + ctx.s.overwrite(start, end, `const ${normalScriptDefaultVar} = `); + } else if (node.type === "ExportNamedDeclaration") { + const defaultSpecifier = node.specifiers.find( + (s) => s.exported.type === "Identifier" && s.exported.name === "default" + ); + if (defaultSpecifier) { + defaultExport = node; + if (node.specifiers.length > 1) { + ctx.s.remove( + defaultSpecifier.start + scriptStartOffset, + defaultSpecifier.end + scriptStartOffset + ); + } else { + ctx.s.remove( + node.start + scriptStartOffset, + node.end + scriptStartOffset + ); + } + if (node.source) { + ctx.s.prepend( + `import { ${defaultSpecifier.local.name} as ${normalScriptDefaultVar} } from '${node.source.value}' +` + ); + } else { + ctx.s.appendLeft( + scriptEndOffset, + ` +const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name} +` + ); + } + } + if (node.declaration) { + walkDeclaration( + "script", + node.declaration, + scriptBindings, + vueImportAliases, + hoistStatic + ); + } + } else if ((node.type === "VariableDeclaration" || node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" || node.type === "TSEnumDeclaration") && !node.declare) { + walkDeclaration( + "script", + node, + scriptBindings, + vueImportAliases, + hoistStatic + ); + } + } + if (scriptStartOffset > startOffset) { + if (!/\n$/.test(script.content.trim())) { + ctx.s.appendLeft(scriptEndOffset, ` +`); + } + ctx.s.move(scriptStartOffset, scriptEndOffset, 0); + } + } + for (const node of scriptSetupAst.body) { + if (node.type === "ExpressionStatement") { + const expr = unwrapTSNode(node.expression); + if (processDefineProps(ctx, expr) || processDefineEmits(ctx, expr) || processDefineOptions(ctx, expr) || processDefineSlots(ctx, expr)) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } else if (processDefineExpose(ctx, expr)) { + const callee = expr.callee; + ctx.s.overwrite( + callee.start + startOffset, + callee.end + startOffset, + "__expose" + ); + } else { + processDefineModel(ctx, expr); + } + } + if (node.type === "VariableDeclaration" && !node.declare) { + const total = node.declarations.length; + let left = total; + let lastNonRemoved; + for (let i = 0; i < total; i++) { + const decl = node.declarations[i]; + const init = decl.init && unwrapTSNode(decl.init); + if (init) { + if (processDefineOptions(ctx, init)) { + ctx.error( + `${DEFINE_OPTIONS}() has no returning value, it cannot be assigned.`, + node + ); + } + const isDefineProps = processDefineProps(ctx, init, decl.id); + if (ctx.propsDestructureRestId) { + setupBindings[ctx.propsDestructureRestId] = "setup-reactive-const"; + } + const isDefineEmits = !isDefineProps && processDefineEmits(ctx, init, decl.id); + !isDefineEmits && (processDefineSlots(ctx, init, decl.id) || processDefineModel(ctx, init, decl.id)); + if (isDefineProps && !ctx.propsDestructureRestId && ctx.propsDestructureDecl) { + if (left === 1) { + ctx.s.remove(node.start + startOffset, node.end + startOffset); + } else { + let start = decl.start + startOffset; + let end = decl.end + startOffset; + if (i === total - 1) { + start = node.declarations[lastNonRemoved].end + startOffset; + } else { + end = node.declarations[i + 1].start + startOffset; + } + ctx.s.remove(start, end); + left--; + } + } else if (isDefineEmits) { + ctx.s.overwrite( + startOffset + init.start, + startOffset + init.end, + "__emit" + ); + } else { + lastNonRemoved = i; + } + } + } + } + let isAllLiteral = false; + if ((node.type === "VariableDeclaration" || node.type === "FunctionDeclaration" || node.type === "ClassDeclaration" || node.type === "TSEnumDeclaration") && !node.declare) { + isAllLiteral = walkDeclaration( + "scriptSetup", + node, + setupBindings, + vueImportAliases, + hoistStatic, + !!ctx.propsDestructureDecl + ); + } + if (hoistStatic && isAllLiteral) { + hoistNode(node); + } + if (node.type === "VariableDeclaration" && !node.declare || node.type.endsWith("Statement")) { + const scope = [scriptSetupAst.body]; + walk$2(node, { + enter(child, parent) { + if (isFunctionType(child)) { + this.skip(); + } + if (child.type === "BlockStatement") { + scope.push(child.body); + } + if (child.type === "AwaitExpression") { + hasAwait = true; + const currentScope = scope[scope.length - 1]; + const needsSemi = currentScope.some((n, i) => { + return (scope.length === 1 || i > 0) && n.type === "ExpressionStatement" && n.start === child.start; + }); + processAwait( + ctx, + child, + needsSemi, + parent.type === "ExpressionStatement" + ); + } + }, + exit(node2) { + if (node2.type === "BlockStatement") scope.pop(); + } + }); + } + if (node.type === "ExportNamedDeclaration" && node.exportKind !== "type" || node.type === "ExportAllDeclaration" || node.type === "ExportDefaultDeclaration") { + ctx.error( + `<script setup> cannot contain ES module exports. If you are using a previous version of <script setup>, please consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.`, + node + ); + } + if (ctx.isTS) { + if (node.type.startsWith("TS") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "VariableDeclaration" && node.declare) { + if (node.type !== "TSEnumDeclaration") { + hoistNode(node); + } + } + } + } + if (ctx.propsDestructureDecl) { + transformDestructuredProps(ctx, vueImportAliases); + } + checkInvalidScopeReference(ctx.propsRuntimeDecl, DEFINE_PROPS); + checkInvalidScopeReference(ctx.propsRuntimeDefaults, DEFINE_PROPS); + checkInvalidScopeReference(ctx.propsDestructureDecl, DEFINE_PROPS); + checkInvalidScopeReference(ctx.emitsRuntimeDecl, DEFINE_EMITS); + checkInvalidScopeReference(ctx.optionsRuntimeDecl, DEFINE_OPTIONS); + for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) { + for (const node of runtimeOptionNodes) { + checkInvalidScopeReference(node, DEFINE_MODEL); + } + } + if (script) { + if (startOffset < scriptStartOffset) { + ctx.s.remove(0, startOffset); + ctx.s.remove(endOffset, scriptStartOffset); + ctx.s.remove(scriptEndOffset, source.length); + } else { + ctx.s.remove(0, scriptStartOffset); + ctx.s.remove(scriptEndOffset, startOffset); + ctx.s.remove(endOffset, source.length); + } + } else { + ctx.s.remove(0, startOffset); + ctx.s.remove(endOffset, source.length); + } + if (scriptAst) { + Object.assign(ctx.bindingMetadata, analyzeScriptBindings(scriptAst.body)); + } + for (const [key, { isType, imported, source: source2 }] of Object.entries( + ctx.userImports + )) { + if (isType) continue; + ctx.bindingMetadata[key] = imported === "*" || imported === "default" && source2.endsWith(".vue") || source2 === "vue" ? "setup-const" : "setup-maybe-ref"; + } + for (const key in scriptBindings) { + ctx.bindingMetadata[key] = scriptBindings[key]; + } + for (const key in setupBindings) { + ctx.bindingMetadata[key] = setupBindings[key]; + } + if (sfc.cssVars.length && // no need to do this when targeting SSR + !((_a = options.templateOptions) == null ? void 0 : _a.ssr)) { + ctx.helperImports.add(CSS_VARS_HELPER); + ctx.helperImports.add("unref"); + ctx.s.prependLeft( + startOffset, + ` +${genCssVarsCode( + sfc.cssVars, + ctx.bindingMetadata, + scopeId, + !!options.isProd + )} +` + ); + } + let args = `__props`; + if (ctx.propsTypeDecl) { + args += `: any`; + } + if (ctx.propsDecl) { + if (ctx.propsDestructureRestId) { + ctx.s.overwrite( + startOffset + ctx.propsCall.start, + startOffset + ctx.propsCall.end, + `${ctx.helper(`createPropsRestProxy`)}(__props, ${JSON.stringify( + Object.keys(ctx.propsDestructuredBindings) + )})` + ); + ctx.s.overwrite( + startOffset + ctx.propsDestructureDecl.start, + startOffset + ctx.propsDestructureDecl.end, + ctx.propsDestructureRestId + ); + } else if (!ctx.propsDestructureDecl) { + ctx.s.overwrite( + startOffset + ctx.propsCall.start, + startOffset + ctx.propsCall.end, + "__props" + ); + } + } + if (hasAwait) { + const any = ctx.isTS ? `: any` : ``; + ctx.s.prependLeft(startOffset, ` +let __temp${any}, __restore${any} +`); + } + const destructureElements = ctx.hasDefineExposeCall || !options.inlineTemplate ? [`expose: __expose`] : []; + if (ctx.emitDecl) { + destructureElements.push(`emit: __emit`); + } + if (destructureElements.length) { + args += `, { ${destructureElements.join(", ")} }`; + } + let returned; + if (!options.inlineTemplate || !sfc.template && ctx.hasDefaultExportRender) { + const allBindings = __spreadValues$1(__spreadValues$1({}, scriptBindings), setupBindings); + for (const key in ctx.userImports) { + if (!ctx.userImports[key].isType && ctx.userImports[key].isUsedInTemplate) { + allBindings[key] = true; + } + } + returned = `{ `; + for (const key in allBindings) { + if (allBindings[key] === true && ctx.userImports[key].source !== "vue" && !ctx.userImports[key].source.endsWith(".vue")) { + returned += `get ${key}() { return ${key} }, `; + } else if (ctx.bindingMetadata[key] === "setup-let") { + const setArg = key === "v" ? `_v` : `v`; + returned += `get ${key}() { return ${key} }, set ${key}(${setArg}) { ${key} = ${setArg} }, `; + } else { + returned += `${key}, `; + } + } + returned = returned.replace(/, $/, "") + ` }`; + } else { + if (sfc.template && !sfc.template.src) { + if (options.templateOptions && options.templateOptions.ssr) { + hasInlinedSsrRenderFn = true; + } + const { code, ast, preamble, tips, errors } = compileTemplate(__spreadProps(__spreadValues$1({ + filename, + ast: sfc.template.ast, + source: sfc.template.content, + inMap: sfc.template.map + }, options.templateOptions), { + id: scopeId, + scoped: sfc.styles.some((s) => s.scoped), + isProd: options.isProd, + ssrCssVars: sfc.cssVars, + compilerOptions: __spreadProps(__spreadValues$1({}, options.templateOptions && options.templateOptions.compilerOptions), { + inline: true, + isTS: ctx.isTS, + bindingMetadata: ctx.bindingMetadata + }) + })); + if (tips.length) { + tips.forEach(warnOnce$1); + } + const err = errors[0]; + if (typeof err === "string") { + throw new Error(err); + } else if (err) { + if (err.loc) { + err.message += ` + +` + sfc.filename + "\n" + generateCodeFrame( + source, + err.loc.start.offset, + err.loc.end.offset + ) + ` +`; + } + throw err; + } + if (preamble) { + ctx.s.prepend(preamble); + } + if (ast && ast.helpers.has(UNREF)) { + ctx.helperImports.delete("unref"); + } + returned = code; + } else { + returned = `() => {}`; + } + } + if (!options.inlineTemplate && true) { + ctx.s.appendRight( + endOffset, + ` +const __returned__ = ${returned} +Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true }) +return __returned__ +} + +` + ); + } else { + ctx.s.appendRight(endOffset, ` +return ${returned} +} + +`); + } + const genDefaultAs = options.genDefaultAs ? `const ${options.genDefaultAs} =` : `export default`; + let runtimeOptions = ``; + if (!ctx.hasDefaultExportName && filename && filename !== DEFAULT_FILENAME) { + const match = filename.match(/([^/\\]+)\.\w+$/); + if (match) { + runtimeOptions += ` + __name: '${match[1]}',`; + } + } + if (hasInlinedSsrRenderFn) { + runtimeOptions += ` + __ssrInlineRender: true,`; + } + const propsDecl = genRuntimeProps(ctx); + if (propsDecl) runtimeOptions += ` + props: ${propsDecl},`; + const emitsDecl = genRuntimeEmits(ctx); + if (emitsDecl) runtimeOptions += ` + emits: ${emitsDecl},`; + let definedOptions = ""; + if (ctx.optionsRuntimeDecl) { + definedOptions = scriptSetup.content.slice(ctx.optionsRuntimeDecl.start, ctx.optionsRuntimeDecl.end).trim(); + } + const exposeCall = ctx.hasDefineExposeCall || options.inlineTemplate ? `` : ` __expose(); +`; + if (ctx.isTS) { + const def = (defaultExport ? ` + ...${normalScriptDefaultVar},` : ``) + (definedOptions ? ` + ...${definedOptions},` : ""); + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} /*@__PURE__*/${ctx.helper( + `defineComponent` + )}({${def}${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `})`); + } else { + if (defaultExport || definedOptions) { + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} /*@__PURE__*/Object.assign(${defaultExport ? `${normalScriptDefaultVar}, ` : ""}${definedOptions ? `${definedOptions}, ` : ""}{${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `})`); + } else { + ctx.s.prependLeft( + startOffset, + ` +${genDefaultAs} {${runtimeOptions} + ${hasAwait ? `async ` : ``}setup(${args}) { +${exposeCall}` + ); + ctx.s.appendRight(endOffset, `}`); + } + } + if (ctx.helperImports.size > 0) { + const runtimeModuleName = (_c = (_b = options.templateOptions) == null ? void 0 : _b.compilerOptions) == null ? void 0 : _c.runtimeModuleName; + const importSrc = runtimeModuleName ? JSON.stringify(runtimeModuleName) : `'vue'`; + ctx.s.prepend( + `import { ${[...ctx.helperImports].map((h) => `${h} as _${h}`).join(", ")} } from ${importSrc} +` + ); + } + return __spreadProps(__spreadValues$1({}, scriptSetup), { + bindings: ctx.bindingMetadata, + imports: ctx.userImports, + content: ctx.s.toString(), + map: options.sourceMap !== false ? ctx.s.generateMap({ + source: filename, + hires: true, + includeContent: true + }) : void 0, + scriptAst: scriptAst == null ? void 0 : scriptAst.body, + scriptSetupAst: scriptSetupAst == null ? void 0 : scriptSetupAst.body, + deps: ctx.deps ? [...ctx.deps] : void 0 + }); +} +function registerBinding(bindings, node, type) { + bindings[node.name] = type; +} +function walkDeclaration(from, node, bindings, userImportAliases, hoistStatic, isPropsDestructureEnabled = false) { + let isAllLiteral = false; + if (node.type === "VariableDeclaration") { + const isConst = node.kind === "const"; + isAllLiteral = isConst && node.declarations.every( + (decl) => decl.id.type === "Identifier" && isStaticNode(decl.init) + ); + for (const { id, init: _init } of node.declarations) { + const init = _init && unwrapTSNode(_init); + const isConstMacroCall = isConst && isCallOf( + init, + (c) => c === DEFINE_PROPS || c === DEFINE_EMITS || c === WITH_DEFAULTS || c === DEFINE_SLOTS + ); + if (id.type === "Identifier") { + let bindingType; + const userReactiveBinding = userImportAliases["reactive"]; + if ((hoistStatic || from === "script") && (isAllLiteral || isConst && isStaticNode(init))) { + bindingType = "literal-const"; + } else if (isCallOf(init, userReactiveBinding)) { + bindingType = isConst ? "setup-reactive-const" : "setup-let"; + } else if ( + // if a declaration is a const literal, we can mark it so that + // the generated render fn code doesn't need to unref() it + isConstMacroCall || isConst && canNeverBeRef(init, userReactiveBinding) + ) { + bindingType = isCallOf(init, DEFINE_PROPS) ? "setup-reactive-const" : "setup-const"; + } else if (isConst) { + if (isCallOf( + init, + (m) => m === userImportAliases["ref"] || m === userImportAliases["computed"] || m === userImportAliases["shallowRef"] || m === userImportAliases["customRef"] || m === userImportAliases["toRef"] || m === DEFINE_MODEL + )) { + bindingType = "setup-ref"; + } else { + bindingType = "setup-maybe-ref"; + } + } else { + bindingType = "setup-let"; + } + registerBinding(bindings, id, bindingType); + } else { + if (isCallOf(init, DEFINE_PROPS) && isPropsDestructureEnabled) { + continue; + } + if (id.type === "ObjectPattern") { + walkObjectPattern(id, bindings, isConst, isConstMacroCall); + } else if (id.type === "ArrayPattern") { + walkArrayPattern(id, bindings, isConst, isConstMacroCall); + } + } + } + } else if (node.type === "TSEnumDeclaration") { + isAllLiteral = node.members.every( + (member) => !member.initializer || isStaticNode(member.initializer) + ); + bindings[node.id.name] = isAllLiteral ? "literal-const" : "setup-const"; + } else if (node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") { + bindings[node.id.name] = "setup-const"; + } + return isAllLiteral; +} +function walkObjectPattern(node, bindings, isConst, isDefineCall = false) { + for (const p of node.properties) { + if (p.type === "ObjectProperty") { + if (p.key.type === "Identifier" && p.key === p.value) { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, p.key, type); + } else { + walkPattern(p.value, bindings, isConst, isDefineCall); + } + } else { + const type = isConst ? "setup-const" : "setup-let"; + registerBinding(bindings, p.argument, type); + } + } +} +function walkArrayPattern(node, bindings, isConst, isDefineCall = false) { + for (const e of node.elements) { + e && walkPattern(e, bindings, isConst, isDefineCall); + } +} +function walkPattern(node, bindings, isConst, isDefineCall = false) { + if (node.type === "Identifier") { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, node, type); + } else if (node.type === "RestElement") { + const type = isConst ? "setup-const" : "setup-let"; + registerBinding(bindings, node.argument, type); + } else if (node.type === "ObjectPattern") { + walkObjectPattern(node, bindings, isConst); + } else if (node.type === "ArrayPattern") { + walkArrayPattern(node, bindings, isConst); + } else if (node.type === "AssignmentPattern") { + if (node.left.type === "Identifier") { + const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let"; + registerBinding(bindings, node.left, type); + } else { + walkPattern(node.left, bindings, isConst); + } + } +} +function canNeverBeRef(node, userReactiveImport) { + if (isCallOf(node, userReactiveImport)) { + return true; + } + switch (node.type) { + case "UnaryExpression": + case "BinaryExpression": + case "ArrayExpression": + case "ObjectExpression": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "UpdateExpression": + case "ClassExpression": + case "TaggedTemplateExpression": + return true; + case "SequenceExpression": + return canNeverBeRef( + node.expressions[node.expressions.length - 1], + userReactiveImport + ); + default: + if (isLiteralNode(node)) { + return true; + } + return false; + } +} +function isStaticNode(node) { + node = unwrapTSNode(node); + switch (node.type) { + case "UnaryExpression": + return isStaticNode(node.argument); + case "LogicalExpression": + // 1 > 2 + case "BinaryExpression": + return isStaticNode(node.left) && isStaticNode(node.right); + case "ConditionalExpression": { + return isStaticNode(node.test) && isStaticNode(node.consequent) && isStaticNode(node.alternate); + } + case "SequenceExpression": + // (1, 2) + case "TemplateLiteral": + return node.expressions.every((expr) => isStaticNode(expr)); + case "ParenthesizedExpression": + return isStaticNode(node.expression); + case "StringLiteral": + case "NumericLiteral": + case "BooleanLiteral": + case "NullLiteral": + case "BigIntLiteral": + return true; + } + return false; +} + +var __defProp = Object.defineProperty; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +const version = "3.5.13"; +const parseCache = parseCache$1; +const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages); +const walk = walk$2; +const shouldTransformRef = () => false; + +var parse$4 = libExports.parse; +export { MagicString, parse$4 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, errorMessages, extractIdentifiers$1 as extractIdentifiers, extractRuntimeEmits, extractRuntimeProps, generateCodeFrame, inferRuntimeType, invalidateTypeCache, isInDestructureAssignment, isStaticProperty, parse$2 as parse, parseCache, registerTS, resolveTypeElements, rewriteDefault, rewriteDefaultAST, shouldTransformRef, version, walk, walkIdentifiers }; diff --git a/seller_1/node_modules/@vue/compiler-sfc/package.json b/seller_1/node_modules/@vue/compiler-sfc/package.json new file mode 100644 index 0000000..368ea40 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-sfc/package.json @@ -0,0 +1,67 @@ +{ + "name": "@vue/compiler-sfc", + "version": "3.5.13", + "description": "@vue/compiler-sfc", + "main": "dist/compiler-sfc.cjs.js", + "module": "dist/compiler-sfc.esm-browser.js", + "types": "dist/compiler-sfc.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": { + "types": "./dist/compiler-sfc.d.ts", + "node": "./dist/compiler-sfc.cjs.js", + "module": "./dist/compiler-sfc.esm-browser.js", + "import": "./dist/compiler-sfc.esm-browser.js", + "require": "./dist/compiler-sfc.cjs.js" + }, + "./*": "./*" + }, + "buildOptions": { + "name": "VueCompilerSFC", + "formats": [ + "cjs", + "esm-browser" + ], + "prod": false, + "enableNonBrowserBranches": true + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/compiler-sfc" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme", + "dependencies": { + "@babel/parser": "^7.25.3", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0", + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13" + }, + "devDependencies": { + "@babel/types": "^7.25.2", + "@vue/consolidate": "^1.0.0", + "hash-sum": "^2.0.0", + "lru-cache": "10.1.0", + "merge-source-map": "^1.1.0", + "minimatch": "~9.0.5", + "postcss-modules": "^6.0.0", + "postcss-selector-parser": "^7.0.0", + "pug": "^3.0.3", + "sass": "^1.80.6" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/compiler-ssr/LICENSE b/seller_1/node_modules/@vue/compiler-ssr/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-ssr/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/compiler-ssr/README.md b/seller_1/node_modules/@vue/compiler-ssr/README.md new file mode 100644 index 0000000..9337906 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-ssr/README.md @@ -0,0 +1 @@ +# @vue/compiler-ssr diff --git a/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js b/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js new file mode 100644 index 0000000..241e298 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js @@ -0,0 +1,1404 @@ +/** +* @vue/compiler-ssr v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var compilerDom = require('@vue/compiler-dom'); +var shared = require('@vue/shared'); + +const SSR_INTERPOLATE = Symbol(`ssrInterpolate`); +const SSR_RENDER_VNODE = Symbol(`ssrRenderVNode`); +const SSR_RENDER_COMPONENT = Symbol(`ssrRenderComponent`); +const SSR_RENDER_SLOT = Symbol(`ssrRenderSlot`); +const SSR_RENDER_SLOT_INNER = Symbol(`ssrRenderSlotInner`); +const SSR_RENDER_CLASS = Symbol(`ssrRenderClass`); +const SSR_RENDER_STYLE = Symbol(`ssrRenderStyle`); +const SSR_RENDER_ATTRS = Symbol(`ssrRenderAttrs`); +const SSR_RENDER_ATTR = Symbol(`ssrRenderAttr`); +const SSR_RENDER_DYNAMIC_ATTR = Symbol(`ssrRenderDynamicAttr`); +const SSR_RENDER_LIST = Symbol(`ssrRenderList`); +const SSR_INCLUDE_BOOLEAN_ATTR = Symbol( + `ssrIncludeBooleanAttr` +); +const SSR_LOOSE_EQUAL = Symbol(`ssrLooseEqual`); +const SSR_LOOSE_CONTAIN = Symbol(`ssrLooseContain`); +const SSR_RENDER_DYNAMIC_MODEL = Symbol( + `ssrRenderDynamicModel` +); +const SSR_GET_DYNAMIC_MODEL_PROPS = Symbol( + `ssrGetDynamicModelProps` +); +const SSR_RENDER_TELEPORT = Symbol(`ssrRenderTeleport`); +const SSR_RENDER_SUSPENSE = Symbol(`ssrRenderSuspense`); +const SSR_GET_DIRECTIVE_PROPS = Symbol(`ssrGetDirectiveProps`); +const ssrHelpers = { + [SSR_INTERPOLATE]: `ssrInterpolate`, + [SSR_RENDER_VNODE]: `ssrRenderVNode`, + [SSR_RENDER_COMPONENT]: `ssrRenderComponent`, + [SSR_RENDER_SLOT]: `ssrRenderSlot`, + [SSR_RENDER_SLOT_INNER]: `ssrRenderSlotInner`, + [SSR_RENDER_CLASS]: `ssrRenderClass`, + [SSR_RENDER_STYLE]: `ssrRenderStyle`, + [SSR_RENDER_ATTRS]: `ssrRenderAttrs`, + [SSR_RENDER_ATTR]: `ssrRenderAttr`, + [SSR_RENDER_DYNAMIC_ATTR]: `ssrRenderDynamicAttr`, + [SSR_RENDER_LIST]: `ssrRenderList`, + [SSR_INCLUDE_BOOLEAN_ATTR]: `ssrIncludeBooleanAttr`, + [SSR_LOOSE_EQUAL]: `ssrLooseEqual`, + [SSR_LOOSE_CONTAIN]: `ssrLooseContain`, + [SSR_RENDER_DYNAMIC_MODEL]: `ssrRenderDynamicModel`, + [SSR_GET_DYNAMIC_MODEL_PROPS]: `ssrGetDynamicModelProps`, + [SSR_RENDER_TELEPORT]: `ssrRenderTeleport`, + [SSR_RENDER_SUSPENSE]: `ssrRenderSuspense`, + [SSR_GET_DIRECTIVE_PROPS]: `ssrGetDirectiveProps` +}; +compilerDom.registerRuntimeHelpers(ssrHelpers); + +const ssrTransformIf = compilerDom.createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + compilerDom.processIf +); +function ssrProcessIf(node, context, disableNestedFragments = false, disableComment = false) { + const [rootBranch] = node.branches; + const ifStatement = compilerDom.createIfStatement( + rootBranch.condition, + processIfBranch(rootBranch, context, disableNestedFragments) + ); + context.pushStatement(ifStatement); + let currentIf = ifStatement; + for (let i = 1; i < node.branches.length; i++) { + const branch = node.branches[i]; + const branchBlockStatement = processIfBranch( + branch, + context, + disableNestedFragments + ); + if (branch.condition) { + currentIf = currentIf.alternate = compilerDom.createIfStatement( + branch.condition, + branchBlockStatement + ); + } else { + currentIf.alternate = branchBlockStatement; + } + } + if (!currentIf.alternate && !disableComment) { + currentIf.alternate = compilerDom.createBlockStatement([ + compilerDom.createCallExpression(`_push`, ["`<!---->`"]) + ]); + } +} +function processIfBranch(branch, context, disableNestedFragments = false) { + const { children } = branch; + const needFragmentWrapper = !disableNestedFragments && (children.length !== 1 || children[0].type !== 1) && // optimize away nested fragments when the only child is a ForNode + !(children.length === 1 && children[0].type === 11); + return processChildrenAsStatement(branch, context, needFragmentWrapper); +} + +const ssrTransformFor = compilerDom.createStructuralDirectiveTransform("for", compilerDom.processFor); +function ssrProcessFor(node, context, disableNestedFragments = false) { + const needFragmentWrapper = !disableNestedFragments && (node.children.length !== 1 || node.children[0].type !== 1); + const renderLoop = compilerDom.createFunctionExpression( + compilerDom.createForLoopParams(node.parseResult) + ); + renderLoop.body = processChildrenAsStatement( + node, + context, + needFragmentWrapper + ); + if (!disableNestedFragments) { + context.pushStringPart(`<!--[-->`); + } + context.pushStatement( + compilerDom.createCallExpression(context.helper(SSR_RENDER_LIST), [ + node.source, + renderLoop + ]) + ); + if (!disableNestedFragments) { + context.pushStringPart(`<!--]-->`); + } +} + +const ssrTransformSlotOutlet = (node, context) => { + if (compilerDom.isSlotOutlet(node)) { + const { slotName, slotProps } = compilerDom.processSlotOutlet(node, context); + const args = [ + `_ctx.$slots`, + slotName, + slotProps || `{}`, + // fallback content placeholder. will be replaced in the process phase + `null`, + `_push`, + `_parent` + ]; + if (context.scopeId && context.slotted !== false) { + args.push(`"${context.scopeId}-s"`); + } + let method = SSR_RENDER_SLOT; + let parent = context.parent; + if (parent) { + const children = parent.children; + if (parent.type === 10) { + parent = context.grandParent; + } + let componentType; + if (parent.type === 1 && parent.tagType === 1 && ((componentType = compilerDom.resolveComponentType(parent, context, true)) === compilerDom.TRANSITION || componentType === compilerDom.TRANSITION_GROUP) && children.filter((c) => c.type === 1).length === 1) { + method = SSR_RENDER_SLOT_INNER; + if (!(context.scopeId && context.slotted !== false)) { + args.push("null"); + } + args.push("true"); + } + } + node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(method), args); + } +}; +function ssrProcessSlotOutlet(node, context) { + const renderCall = node.ssrCodegenNode; + if (node.children.length) { + const fallbackRenderFn = compilerDom.createFunctionExpression([]); + fallbackRenderFn.body = processChildrenAsStatement(node, context); + renderCall.arguments[3] = fallbackRenderFn; + } + if (context.withSlotScopeId) { + const slotScopeId = renderCall.arguments[6]; + renderCall.arguments[6] = slotScopeId ? `${slotScopeId} + _scopeId` : `_scopeId`; + } + context.pushStatement(node.ssrCodegenNode); +} + +function createSSRCompilerError(code, loc) { + return compilerDom.createCompilerError(code, loc, SSRErrorMessages); +} +const SSRErrorMessages = { + [65]: `Unsafe attribute name for SSR.`, + [66]: `Missing the 'to' prop on teleport element.`, + [67]: `Invalid AST node during SSR transform.` +}; + +function ssrProcessTeleport(node, context) { + const targetProp = compilerDom.findProp(node, "to"); + if (!targetProp) { + context.onError( + createSSRCompilerError(66, node.loc) + ); + return; + } + let target; + if (targetProp.type === 6) { + target = targetProp.value && compilerDom.createSimpleExpression(targetProp.value.content, true); + } else { + target = targetProp.exp; + } + if (!target) { + context.onError( + createSSRCompilerError( + 66, + targetProp.loc + ) + ); + return; + } + const disabledProp = compilerDom.findProp( + node, + "disabled", + false, + true + /* allow empty */ + ); + const disabled = disabledProp ? disabledProp.type === 6 ? `true` : disabledProp.exp || `false` : `false`; + const contentRenderFn = compilerDom.createFunctionExpression( + [`_push`], + void 0, + // Body is added later + true, + // newline + false, + // isSlot + node.loc + ); + contentRenderFn.body = processChildrenAsStatement(node, context); + context.pushStatement( + compilerDom.createCallExpression(context.helper(SSR_RENDER_TELEPORT), [ + `_push`, + contentRenderFn, + target, + disabled, + `_parent` + ]) + ); +} + +const wipMap$3 = /* @__PURE__ */ new WeakMap(); +function ssrTransformSuspense(node, context) { + return () => { + if (node.children.length) { + const wipEntry = { + slotsExp: null, + // to be immediately set + wipSlots: [] + }; + wipMap$3.set(node, wipEntry); + wipEntry.slotsExp = compilerDom.buildSlots( + node, + context, + (_props, _vForExp, children, loc) => { + const fn = compilerDom.createFunctionExpression( + [], + void 0, + // no return, assign body later + true, + // newline + false, + // suspense slots are not treated as normal slots + loc + ); + wipEntry.wipSlots.push({ + fn, + children + }); + return fn; + } + ).slots; + } + }; +} +function ssrProcessSuspense(node, context) { + const wipEntry = wipMap$3.get(node); + if (!wipEntry) { + return; + } + const { slotsExp, wipSlots } = wipEntry; + for (let i = 0; i < wipSlots.length; i++) { + const slot = wipSlots[i]; + slot.fn.body = processChildrenAsStatement(slot, context); + } + context.pushStatement( + compilerDom.createCallExpression(context.helper(SSR_RENDER_SUSPENSE), [ + `_push`, + slotsExp + ]) + ); +} + +const rawChildrenMap = /* @__PURE__ */ new WeakMap(); +const ssrTransformElement = (node, context) => { + if (node.type !== 1 || node.tagType !== 0) { + return; + } + return function ssrPostTransformElement() { + const openTag = [`<${node.tag}`]; + const needTagForRuntime = node.tag === "textarea" || node.tag.indexOf("-") > 0; + const hasDynamicVBind = compilerDom.hasDynamicKeyVBind(node); + const hasCustomDir = node.props.some( + (p) => p.type === 7 && !shared.isBuiltInDirective(p.name) + ); + const needMergeProps = hasDynamicVBind || hasCustomDir; + if (needMergeProps) { + const { props, directives } = compilerDom.buildProps( + node, + context, + node.props, + false, + false, + true + ); + if (props || directives.length) { + const mergedProps = buildSSRProps(props, directives, context); + const propsExp = compilerDom.createCallExpression( + context.helper(SSR_RENDER_ATTRS), + [mergedProps] + ); + if (node.tag === "textarea") { + const existingText = node.children[0]; + if (!existingText || existingText.type !== 5) { + const tempId = `_temp${context.temps++}`; + propsExp.arguments = [ + compilerDom.createAssignmentExpression( + compilerDom.createSimpleExpression(tempId, false), + mergedProps + ) + ]; + rawChildrenMap.set( + node, + compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [ + compilerDom.createConditionalExpression( + compilerDom.createSimpleExpression(`"value" in ${tempId}`, false), + compilerDom.createSimpleExpression(`${tempId}.value`, false), + compilerDom.createSimpleExpression( + existingText ? existingText.content : ``, + true + ), + false + ) + ]) + ); + } + } else if (node.tag === "input") { + const vModel = findVModel(node); + if (vModel) { + const tempId = `_temp${context.temps++}`; + const tempExp = compilerDom.createSimpleExpression(tempId, false); + propsExp.arguments = [ + compilerDom.createSequenceExpression([ + compilerDom.createAssignmentExpression(tempExp, mergedProps), + compilerDom.createCallExpression(context.helper(compilerDom.MERGE_PROPS), [ + tempExp, + compilerDom.createCallExpression( + context.helper(SSR_GET_DYNAMIC_MODEL_PROPS), + [ + tempExp, + // existing props + vModel.exp + // model + ] + ) + ]) + ]) + ]; + } + } else if (directives.length && !node.children.length) { + const vText = compilerDom.findDir(node, "text"); + if (!vText) { + const tempId = `_temp${context.temps++}`; + propsExp.arguments = [ + compilerDom.createAssignmentExpression( + compilerDom.createSimpleExpression(tempId, false), + mergedProps + ) + ]; + rawChildrenMap.set( + node, + compilerDom.createConditionalExpression( + compilerDom.createSimpleExpression(`"textContent" in ${tempId}`, false), + compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [ + compilerDom.createSimpleExpression(`${tempId}.textContent`, false) + ]), + compilerDom.createSimpleExpression(`${tempId}.innerHTML ?? ''`, false), + false + ) + ); + } + } + if (needTagForRuntime) { + propsExp.arguments.push(`"${node.tag}"`); + } + openTag.push(propsExp); + } + } + let dynamicClassBinding = void 0; + let staticClassBinding = void 0; + let dynamicStyleBinding = void 0; + for (let i = 0; i < node.props.length; i++) { + const prop = node.props[i]; + if (node.tag === "input" && isTrueFalseValue(prop)) { + continue; + } + if (prop.type === 7) { + if (prop.name === "html" && prop.exp) { + rawChildrenMap.set( + node, + compilerDom.createCompoundExpression([`(`, prop.exp, `) ?? ''`]) + ); + } else if (prop.name === "text" && prop.exp) { + node.children = [compilerDom.createInterpolation(prop.exp, prop.loc)]; + } else if (prop.name === "slot") { + context.onError( + compilerDom.createCompilerError(40, prop.loc) + ); + } else if (isTextareaWithValue(node, prop) && prop.exp) { + if (!needMergeProps) { + node.children = [compilerDom.createInterpolation(prop.exp, prop.loc)]; + } + } else if (!needMergeProps && prop.name !== "on") { + const directiveTransform = context.directiveTransforms[prop.name]; + if (directiveTransform) { + const { props, ssrTagParts } = directiveTransform( + prop, + node, + context + ); + if (ssrTagParts) { + openTag.push(...ssrTagParts); + } + for (let j = 0; j < props.length; j++) { + const { key, value } = props[j]; + if (compilerDom.isStaticExp(key)) { + let attrName = key.content; + if (attrName === "key" || attrName === "ref") { + continue; + } + if (attrName === "class") { + openTag.push( + ` class="`, + dynamicClassBinding = compilerDom.createCallExpression( + context.helper(SSR_RENDER_CLASS), + [value] + ), + `"` + ); + } else if (attrName === "style") { + if (dynamicStyleBinding) { + mergeCall(dynamicStyleBinding, value); + } else { + openTag.push( + ` style="`, + dynamicStyleBinding = compilerDom.createCallExpression( + context.helper(SSR_RENDER_STYLE), + [value] + ), + `"` + ); + } + } else { + attrName = node.tag.indexOf("-") > 0 ? attrName : shared.propsToAttrMap[attrName] || attrName.toLowerCase(); + if (shared.isBooleanAttr(attrName)) { + openTag.push( + compilerDom.createConditionalExpression( + compilerDom.createCallExpression( + context.helper(SSR_INCLUDE_BOOLEAN_ATTR), + [value] + ), + compilerDom.createSimpleExpression(" " + attrName, true), + compilerDom.createSimpleExpression("", true), + false + ) + ); + } else if (shared.isSSRSafeAttrName(attrName)) { + openTag.push( + compilerDom.createCallExpression(context.helper(SSR_RENDER_ATTR), [ + key, + value + ]) + ); + } else { + context.onError( + createSSRCompilerError( + 65, + key.loc + ) + ); + } + } + } else { + const args = [key, value]; + if (needTagForRuntime) { + args.push(`"${node.tag}"`); + } + openTag.push( + compilerDom.createCallExpression( + context.helper(SSR_RENDER_DYNAMIC_ATTR), + args + ) + ); + } + } + } + } + } else { + const name = prop.name; + if (node.tag === "textarea" && name === "value" && prop.value) { + rawChildrenMap.set(node, shared.escapeHtml(prop.value.content)); + } else if (!needMergeProps) { + if (name === "key" || name === "ref") { + continue; + } + if (name === "class" && prop.value) { + staticClassBinding = JSON.stringify(prop.value.content); + } + openTag.push( + ` ${prop.name}` + (prop.value ? `="${shared.escapeHtml(prop.value.content)}"` : ``) + ); + } + } + } + if (dynamicClassBinding && staticClassBinding) { + mergeCall(dynamicClassBinding, staticClassBinding); + removeStaticBinding(openTag, "class"); + } + if (context.scopeId) { + openTag.push(` ${context.scopeId}`); + } + node.ssrCodegenNode = compilerDom.createTemplateLiteral(openTag); + }; +}; +function buildSSRProps(props, directives, context) { + let mergePropsArgs = []; + if (props) { + if (props.type === 14) { + mergePropsArgs = props.arguments; + } else { + mergePropsArgs.push(props); + } + } + if (directives.length) { + for (const dir of directives) { + mergePropsArgs.push( + compilerDom.createCallExpression(context.helper(SSR_GET_DIRECTIVE_PROPS), [ + `_ctx`, + ...compilerDom.buildDirectiveArgs(dir, context).elements + ]) + ); + } + } + return mergePropsArgs.length > 1 ? compilerDom.createCallExpression(context.helper(compilerDom.MERGE_PROPS), mergePropsArgs) : mergePropsArgs[0]; +} +function isTrueFalseValue(prop) { + if (prop.type === 7) { + return prop.name === "bind" && prop.arg && compilerDom.isStaticExp(prop.arg) && (prop.arg.content === "true-value" || prop.arg.content === "false-value"); + } else { + return prop.name === "true-value" || prop.name === "false-value"; + } +} +function isTextareaWithValue(node, prop) { + return !!(node.tag === "textarea" && prop.name === "bind" && compilerDom.isStaticArgOf(prop.arg, "value")); +} +function mergeCall(call, arg) { + const existing = call.arguments[0]; + if (existing.type === 17) { + existing.elements.push(arg); + } else { + call.arguments[0] = compilerDom.createArrayExpression([existing, arg]); + } +} +function removeStaticBinding(tag, binding) { + const regExp = new RegExp(`^ ${binding}=".+"$`); + const i = tag.findIndex((e) => typeof e === "string" && regExp.test(e)); + if (i > -1) { + tag.splice(i, 1); + } +} +function findVModel(node) { + return node.props.find( + (p) => p.type === 7 && p.name === "model" && p.exp + ); +} +function ssrProcessElement(node, context) { + const isVoidTag = context.options.isVoidTag || shared.NO; + const elementsToAdd = node.ssrCodegenNode.elements; + for (let j = 0; j < elementsToAdd.length; j++) { + context.pushStringPart(elementsToAdd[j]); + } + if (context.withSlotScopeId) { + context.pushStringPart(compilerDom.createSimpleExpression(`_scopeId`, false)); + } + context.pushStringPart(`>`); + const rawChildren = rawChildrenMap.get(node); + if (rawChildren) { + context.pushStringPart(rawChildren); + } else if (node.children.length) { + processChildren(node, context); + } + if (!isVoidTag(node.tag)) { + context.pushStringPart(`</${node.tag}>`); + } +} + +const wipMap$2 = /* @__PURE__ */ new WeakMap(); +function ssrTransformTransitionGroup(node, context) { + return () => { + const tag = compilerDom.findProp(node, "tag"); + if (tag) { + const otherProps = node.props.filter((p) => p !== tag); + const { props, directives } = compilerDom.buildProps( + node, + context, + otherProps, + true, + false, + true + ); + let propsExp = null; + if (props || directives.length) { + propsExp = compilerDom.createCallExpression(context.helper(SSR_RENDER_ATTRS), [ + buildSSRProps(props, directives, context) + ]); + } + wipMap$2.set(node, { + tag, + propsExp, + scopeId: context.scopeId || null + }); + } + }; +} +function ssrProcessTransitionGroup(node, context) { + const entry = wipMap$2.get(node); + if (entry) { + const { tag, propsExp, scopeId } = entry; + if (tag.type === 7) { + context.pushStringPart(`<`); + context.pushStringPart(tag.exp); + if (propsExp) { + context.pushStringPart(propsExp); + } + if (scopeId) { + context.pushStringPart(` ${scopeId}`); + } + context.pushStringPart(`>`); + processChildren( + node, + context, + false, + /** + * TransitionGroup has the special runtime behavior of flattening and + * concatenating all children into a single fragment (in order for them to + * be patched using the same key map) so we need to account for that here + * by disabling nested fragment wrappers from being generated. + */ + true, + /** + * TransitionGroup filters out comment children at runtime and thus + * doesn't expect comments to be present during hydration. We need to + * account for that by disabling the empty comment that is otherwise + * rendered for a falsy v-if that has no v-else specified. (#6715) + */ + true + ); + context.pushStringPart(`</`); + context.pushStringPart(tag.exp); + context.pushStringPart(`>`); + } else { + context.pushStringPart(`<${tag.value.content}`); + if (propsExp) { + context.pushStringPart(propsExp); + } + if (scopeId) { + context.pushStringPart(` ${scopeId}`); + } + context.pushStringPart(`>`); + processChildren(node, context, false, true, true); + context.pushStringPart(`</${tag.value.content}>`); + } + } else { + processChildren(node, context, true, true, true); + } +} + +const wipMap$1 = /* @__PURE__ */ new WeakMap(); +function ssrTransformTransition(node, context) { + return () => { + const appear = compilerDom.findProp(node, "appear", false, true); + wipMap$1.set(node, !!appear); + }; +} +function ssrProcessTransition(node, context) { + node.children = node.children.filter((c) => c.type !== 3); + const appear = wipMap$1.get(node); + if (appear) { + context.pushStringPart(`<template>`); + processChildren(node, context, false, true); + context.pushStringPart(`</template>`); + } else { + processChildren(node, context, false, true); + } +} + +const wipMap = /* @__PURE__ */ new WeakMap(); +const WIP_SLOT = Symbol(); +const componentTypeMap = /* @__PURE__ */ new WeakMap(); +const ssrTransformComponent = (node, context) => { + if (node.type !== 1 || node.tagType !== 1) { + return; + } + const component = compilerDom.resolveComponentType( + node, + context, + true + /* ssr */ + ); + const isDynamicComponent = shared.isObject(component) && component.callee === compilerDom.RESOLVE_DYNAMIC_COMPONENT; + componentTypeMap.set(node, component); + if (shared.isSymbol(component)) { + if (component === compilerDom.SUSPENSE) { + return ssrTransformSuspense(node, context); + } else if (component === compilerDom.TRANSITION_GROUP) { + return ssrTransformTransitionGroup(node, context); + } else if (component === compilerDom.TRANSITION) { + return ssrTransformTransition(node); + } + return; + } + const vnodeBranches = []; + const clonedNode = clone(node); + return function ssrPostTransformComponent() { + if (clonedNode.children.length) { + compilerDom.buildSlots(clonedNode, context, (props, vFor, children) => { + vnodeBranches.push( + createVNodeSlotBranch(props, vFor, children, context) + ); + return compilerDom.createFunctionExpression(void 0); + }); + } + let propsExp = `null`; + if (node.props.length) { + const { props, directives } = compilerDom.buildProps( + node, + context, + void 0, + true, + isDynamicComponent + ); + if (props || directives.length) { + propsExp = buildSSRProps(props, directives, context); + } + } + const wipEntries = []; + wipMap.set(node, wipEntries); + const buildSSRSlotFn = (props, _vForExp, children, loc) => { + const param0 = props && compilerDom.stringifyExpression(props) || `_`; + const fn = compilerDom.createFunctionExpression( + [param0, `_push`, `_parent`, `_scopeId`], + void 0, + // no return, assign body later + true, + // newline + true, + // isSlot + loc + ); + wipEntries.push({ + type: WIP_SLOT, + fn, + children, + // also collect the corresponding vnode branch built earlier + vnodeBranch: vnodeBranches[wipEntries.length] + }); + return fn; + }; + const slots = node.children.length ? compilerDom.buildSlots(node, context, buildSSRSlotFn).slots : `null`; + if (typeof component !== "string") { + node.ssrCodegenNode = compilerDom.createCallExpression( + context.helper(SSR_RENDER_VNODE), + [ + `_push`, + compilerDom.createCallExpression(context.helper(compilerDom.CREATE_VNODE), [ + component, + propsExp, + slots + ]), + `_parent` + ] + ); + } else { + node.ssrCodegenNode = compilerDom.createCallExpression( + context.helper(SSR_RENDER_COMPONENT), + [component, propsExp, slots, `_parent`] + ); + } + }; +}; +function ssrProcessComponent(node, context, parent) { + const component = componentTypeMap.get(node); + if (!node.ssrCodegenNode) { + if (component === compilerDom.TELEPORT) { + return ssrProcessTeleport(node, context); + } else if (component === compilerDom.SUSPENSE) { + return ssrProcessSuspense(node, context); + } else if (component === compilerDom.TRANSITION_GROUP) { + return ssrProcessTransitionGroup(node, context); + } else { + if (parent.type === WIP_SLOT) { + context.pushStringPart(``); + } + if (component === compilerDom.TRANSITION) { + return ssrProcessTransition(node, context); + } + processChildren(node, context); + } + } else { + const wipEntries = wipMap.get(node) || []; + for (let i = 0; i < wipEntries.length; i++) { + const { fn, vnodeBranch } = wipEntries[i]; + fn.body = compilerDom.createIfStatement( + compilerDom.createSimpleExpression(`_push`, false), + processChildrenAsStatement( + wipEntries[i], + context, + false, + true + ), + vnodeBranch + ); + } + if (context.withSlotScopeId) { + node.ssrCodegenNode.arguments.push(`_scopeId`); + } + if (typeof component === "string") { + context.pushStatement( + compilerDom.createCallExpression(`_push`, [node.ssrCodegenNode]) + ); + } else { + context.pushStatement(node.ssrCodegenNode); + } + } +} +const rawOptionsMap = /* @__PURE__ */ new WeakMap(); +const [baseNodeTransforms, baseDirectiveTransforms] = compilerDom.getBaseTransformPreset(true); +const vnodeNodeTransforms = [...baseNodeTransforms, ...compilerDom.DOMNodeTransforms]; +const vnodeDirectiveTransforms = { + ...baseDirectiveTransforms, + ...compilerDom.DOMDirectiveTransforms +}; +function createVNodeSlotBranch(slotProps, vFor, children, parentContext) { + const rawOptions = rawOptionsMap.get(parentContext.root); + const subOptions = { + ...rawOptions, + // overwrite with vnode-based transforms + nodeTransforms: [ + ...vnodeNodeTransforms, + ...rawOptions.nodeTransforms || [] + ], + directiveTransforms: { + ...vnodeDirectiveTransforms, + ...rawOptions.directiveTransforms || {} + } + }; + const wrapperProps = []; + if (slotProps) { + wrapperProps.push({ + type: 7, + name: "slot", + exp: slotProps, + arg: void 0, + modifiers: [], + loc: compilerDom.locStub + }); + } + if (vFor) { + wrapperProps.push(shared.extend({}, vFor)); + } + const wrapperNode = { + type: 1, + ns: 0, + tag: "template", + tagType: 3, + props: wrapperProps, + children, + loc: compilerDom.locStub, + codegenNode: void 0 + }; + subTransform(wrapperNode, subOptions, parentContext); + return compilerDom.createReturnStatement(children); +} +function subTransform(node, options, parentContext) { + const childRoot = compilerDom.createRoot([node]); + const childContext = compilerDom.createTransformContext(childRoot, options); + childContext.ssr = false; + childContext.scopes = { ...parentContext.scopes }; + childContext.identifiers = { ...parentContext.identifiers }; + childContext.imports = parentContext.imports; + compilerDom.traverseNode(childRoot, childContext); + ["helpers", "components", "directives"].forEach((key) => { + childContext[key].forEach((value, helperKey) => { + if (key === "helpers") { + const parentCount = parentContext.helpers.get(helperKey); + if (parentCount === void 0) { + parentContext.helpers.set(helperKey, value); + } else { + parentContext.helpers.set(helperKey, value + parentCount); + } + } else { + parentContext[key].add(value); + } + }); + }); +} +function clone(v) { + if (shared.isArray(v)) { + return v.map(clone); + } else if (shared.isPlainObject(v)) { + const res = {}; + for (const key in v) { + res[key] = clone(v[key]); + } + return res; + } else { + return v; + } +} + +function ssrCodegenTransform(ast, options) { + const context = createSSRTransformContext(ast, options); + if (options.ssrCssVars) { + const cssContext = compilerDom.createTransformContext(compilerDom.createRoot([]), options); + const varsExp = compilerDom.processExpression( + compilerDom.createSimpleExpression(options.ssrCssVars, false), + cssContext + ); + context.body.push( + compilerDom.createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`]) + ); + Array.from(cssContext.helpers.keys()).forEach((helper) => { + ast.helpers.add(helper); + }); + } + const isFragment = ast.children.length > 1 && ast.children.some((c) => !compilerDom.isText(c)); + processChildren(ast, context, isFragment); + ast.codegenNode = compilerDom.createBlockStatement(context.body); + ast.ssrHelpers = Array.from( + /* @__PURE__ */ new Set([ + ...Array.from(ast.helpers).filter((h) => h in ssrHelpers), + ...context.helpers + ]) + ); + ast.helpers = new Set(Array.from(ast.helpers).filter((h) => !(h in ssrHelpers))); +} +function createSSRTransformContext(root, options, helpers = /* @__PURE__ */ new Set(), withSlotScopeId = false) { + const body = []; + let currentString = null; + return { + root, + options, + body, + helpers, + withSlotScopeId, + onError: options.onError || ((e) => { + throw e; + }), + helper(name) { + helpers.add(name); + return name; + }, + pushStringPart(part) { + if (!currentString) { + const currentCall = compilerDom.createCallExpression(`_push`); + body.push(currentCall); + currentString = compilerDom.createTemplateLiteral([]); + currentCall.arguments.push(currentString); + } + const bufferedElements = currentString.elements; + const lastItem = bufferedElements[bufferedElements.length - 1]; + if (shared.isString(part) && shared.isString(lastItem)) { + bufferedElements[bufferedElements.length - 1] += part; + } else { + bufferedElements.push(part); + } + }, + pushStatement(statement) { + currentString = null; + body.push(statement); + } + }; +} +function createChildContext(parent, withSlotScopeId = parent.withSlotScopeId) { + return createSSRTransformContext( + parent.root, + parent.options, + parent.helpers, + withSlotScopeId + ); +} +function processChildren(parent, context, asFragment = false, disableNestedFragments = false, disableComment = false) { + if (asFragment) { + context.pushStringPart(`<!--[-->`); + } + const { children } = parent; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + switch (child.tagType) { + case 0: + ssrProcessElement(child, context); + break; + case 1: + ssrProcessComponent(child, context, parent); + break; + case 2: + ssrProcessSlotOutlet(child, context); + break; + case 3: + break; + default: + context.onError( + createSSRCompilerError( + 67, + child.loc + ) + ); + const exhaustiveCheck2 = child; + return exhaustiveCheck2; + } + break; + case 2: + context.pushStringPart(shared.escapeHtml(child.content)); + break; + case 3: + if (!disableComment) { + context.pushStringPart(`<!--${child.content}-->`); + } + break; + case 5: + context.pushStringPart( + compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [ + child.content + ]) + ); + break; + case 9: + ssrProcessIf(child, context, disableNestedFragments, disableComment); + break; + case 11: + ssrProcessFor(child, context, disableNestedFragments); + break; + case 10: + break; + case 12: + case 8: + break; + default: + context.onError( + createSSRCompilerError( + 67, + child.loc + ) + ); + const exhaustiveCheck = child; + return exhaustiveCheck; + } + } + if (asFragment) { + context.pushStringPart(`<!--]-->`); + } +} +function processChildrenAsStatement(parent, parentContext, asFragment = false, withSlotScopeId = parentContext.withSlotScopeId) { + const childContext = createChildContext(parentContext, withSlotScopeId); + processChildren(parent, childContext, asFragment); + return compilerDom.createBlockStatement(childContext.body); +} + +const ssrTransformModel = (dir, node, context) => { + const model = dir.exp; + function checkDuplicatedValue() { + const value = compilerDom.findProp(node, "value"); + if (value) { + context.onError( + compilerDom.createDOMCompilerError( + 60, + value.loc + ) + ); + } + } + function processOption(plainNode) { + if (plainNode.tag === "option") { + if (plainNode.props.findIndex((p) => p.name === "selected") === -1) { + const value = findValueBinding(plainNode); + plainNode.ssrCodegenNode.elements.push( + compilerDom.createConditionalExpression( + compilerDom.createCallExpression(context.helper(SSR_INCLUDE_BOOLEAN_ATTR), [ + compilerDom.createConditionalExpression( + compilerDom.createCallExpression(`Array.isArray`, [model]), + compilerDom.createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [ + model, + value + ]), + compilerDom.createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + value + ]) + ) + ]), + compilerDom.createSimpleExpression(" selected", true), + compilerDom.createSimpleExpression("", true), + false + ) + ); + } + } else if (plainNode.tag === "optgroup") { + plainNode.children.forEach( + (option) => processOption(option) + ); + } + } + if (node.tagType === 0) { + const res = { props: [] }; + const defaultProps = [ + // default value binding for text type inputs + compilerDom.createObjectProperty(`value`, model) + ]; + if (node.tag === "input") { + const type = compilerDom.findProp(node, "type"); + if (type) { + const value = findValueBinding(node); + if (type.type === 7) { + res.ssrTagParts = [ + compilerDom.createCallExpression(context.helper(SSR_RENDER_DYNAMIC_MODEL), [ + type.exp, + model, + value + ]) + ]; + } else if (type.value) { + switch (type.value.content) { + case "radio": + res.props = [ + compilerDom.createObjectProperty( + `checked`, + compilerDom.createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + value + ]) + ) + ]; + break; + case "checkbox": + const trueValueBinding = compilerDom.findProp(node, "true-value"); + if (trueValueBinding) { + const trueValue = trueValueBinding.type === 6 ? JSON.stringify(trueValueBinding.value.content) : trueValueBinding.exp; + res.props = [ + compilerDom.createObjectProperty( + `checked`, + compilerDom.createCallExpression(context.helper(SSR_LOOSE_EQUAL), [ + model, + trueValue + ]) + ) + ]; + } else { + res.props = [ + compilerDom.createObjectProperty( + `checked`, + compilerDom.createConditionalExpression( + compilerDom.createCallExpression(`Array.isArray`, [model]), + compilerDom.createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [ + model, + value + ]), + model + ) + ) + ]; + } + break; + case "file": + context.onError( + compilerDom.createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + checkDuplicatedValue(); + res.props = defaultProps; + break; + } + } + } else if (compilerDom.hasDynamicKeyVBind(node)) ; else { + checkDuplicatedValue(); + res.props = defaultProps; + } + } else if (node.tag === "textarea") { + checkDuplicatedValue(); + node.children = [compilerDom.createInterpolation(model, model.loc)]; + } else if (node.tag === "select") { + const processChildren = (children) => { + children.forEach((child) => { + if (child.type === 1) { + processOption(child); + } else if (child.type === 11) { + processChildren(child.children); + } else if (child.type === 9) { + child.branches.forEach((b) => processChildren(b.children)); + } + }); + }; + processChildren(node.children); + } else { + context.onError( + compilerDom.createDOMCompilerError( + 57, + dir.loc + ) + ); + } + return res; + } else { + return compilerDom.transformModel(dir, node, context); + } +}; +function findValueBinding(node) { + const valueBinding = compilerDom.findProp(node, "value"); + return valueBinding ? valueBinding.type === 7 ? valueBinding.exp : compilerDom.createSimpleExpression(valueBinding.value.content, true) : compilerDom.createSimpleExpression(`null`, false); +} + +const ssrTransformShow = (dir, node, context) => { + if (!dir.exp) { + context.onError( + compilerDom.createDOMCompilerError(61) + ); + } + return { + props: [ + compilerDom.createObjectProperty( + `style`, + compilerDom.createConditionalExpression( + dir.exp, + compilerDom.createSimpleExpression(`null`, false), + compilerDom.createObjectExpression([ + compilerDom.createObjectProperty( + `display`, + compilerDom.createSimpleExpression(`none`, true) + ) + ]), + false + ) + ) + ] + }; +}; + +const filterChild = (node) => node.children.filter((n) => n.type !== 3); +const hasSingleChild = (node) => filterChild(node).length === 1; +const ssrInjectFallthroughAttrs = (node, context) => { + if (node.type === 0) { + context.identifiers._attrs = 1; + } + if (node.type === 1 && node.tagType === 1 && (node.tag === "transition" || node.tag === "Transition" || node.tag === "KeepAlive" || node.tag === "keep-alive")) { + const rootChildren = filterChild(context.root); + if (rootChildren.length === 1 && rootChildren[0] === node) { + if (hasSingleChild(node)) { + injectFallthroughAttrs(node.children[0]); + } + return; + } + } + const parent = context.parent; + if (!parent || parent.type !== 0) { + return; + } + if (node.type === 10 && hasSingleChild(node)) { + let hasEncounteredIf = false; + for (const c of filterChild(parent)) { + if (c.type === 9 || c.type === 1 && compilerDom.findDir(c, "if")) { + if (hasEncounteredIf) return; + hasEncounteredIf = true; + } else if ( + // node before v-if + !hasEncounteredIf || // non else nodes + !(c.type === 1 && compilerDom.findDir(c, /else/, true)) + ) { + return; + } + } + injectFallthroughAttrs(node.children[0]); + } else if (hasSingleChild(parent)) { + injectFallthroughAttrs(node); + } +}; +function injectFallthroughAttrs(node) { + if (node.type === 1 && (node.tagType === 0 || node.tagType === 1) && !compilerDom.findDir(node, "for")) { + node.props.push({ + type: 7, + name: "bind", + arg: void 0, + exp: compilerDom.createSimpleExpression(`_attrs`, false), + modifiers: [], + loc: compilerDom.locStub + }); + } +} + +const ssrInjectCssVars = (node, context) => { + if (!context.ssrCssVars) { + return; + } + if (node.type === 0) { + context.identifiers._cssVars = 1; + } + const parent = context.parent; + if (!parent || parent.type !== 0) { + return; + } + if (node.type === 10) { + for (const child of node.children) { + injectCssVars(child); + } + } else { + injectCssVars(node); + } +}; +function injectCssVars(node) { + if (node.type === 1 && (node.tagType === 0 || node.tagType === 1) && !compilerDom.findDir(node, "for")) { + if (node.tag === "suspense" || node.tag === "Suspense") { + for (const child of node.children) { + if (child.type === 1 && child.tagType === 3) { + child.children.forEach(injectCssVars); + } else { + injectCssVars(child); + } + } + } else { + node.props.push({ + type: 7, + name: "bind", + arg: void 0, + exp: compilerDom.createSimpleExpression(`_cssVars`, false), + modifiers: [], + loc: compilerDom.locStub + }); + } + } +} + +function compile(source, options = {}) { + options = { + ...options, + ...compilerDom.parserOptions, + ssr: true, + inSSR: true, + scopeId: options.mode === "function" ? null : options.scopeId, + // always prefix since compiler-ssr doesn't have size concern + prefixIdentifiers: true, + // disable optimizations that are unnecessary for ssr + cacheHandlers: false, + hoistStatic: false + }; + const ast = typeof source === "string" ? compilerDom.baseParse(source, options) : source; + rawOptionsMap.set(ast, options); + compilerDom.transform(ast, { + ...options, + hoistStatic: false, + nodeTransforms: [ + ssrTransformIf, + ssrTransformFor, + compilerDom.trackVForSlotScopes, + compilerDom.transformExpression, + ssrTransformSlotOutlet, + ssrInjectFallthroughAttrs, + ssrInjectCssVars, + ssrTransformElement, + ssrTransformComponent, + compilerDom.trackSlotScopes, + compilerDom.transformStyle, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: { + // reusing core v-bind + bind: compilerDom.transformBind, + on: compilerDom.transformOn, + // model and show have dedicated SSR handling + model: ssrTransformModel, + show: ssrTransformShow, + // the following are ignored during SSR + // on: noopDirectiveTransform, + cloak: compilerDom.noopDirectiveTransform, + once: compilerDom.noopDirectiveTransform, + memo: compilerDom.noopDirectiveTransform, + ...options.directiveTransforms || {} + // user transforms + } + }); + ssrCodegenTransform(ast, options); + return compilerDom.generate(ast, options); +} + +exports.compile = compile; diff --git a/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts b/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts new file mode 100644 index 0000000..60dfb21 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts @@ -0,0 +1,4 @@ +import { RootNode, CompilerOptions, CodegenResult } from '@vue/compiler-dom'; + +export declare function compile(source: string | RootNode, options?: CompilerOptions): CodegenResult; + diff --git a/seller_1/node_modules/@vue/compiler-ssr/package.json b/seller_1/node_modules/@vue/compiler-ssr/package.json new file mode 100644 index 0000000..0313249 --- /dev/null +++ b/seller_1/node_modules/@vue/compiler-ssr/package.json @@ -0,0 +1,34 @@ +{ + "name": "@vue/compiler-ssr", + "version": "3.5.13", + "description": "@vue/compiler-ssr", + "main": "dist/compiler-ssr.cjs.js", + "types": "dist/compiler-ssr.d.ts", + "files": [ + "dist" + ], + "buildOptions": { + "prod": false, + "formats": [ + "cjs" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/compiler-ssr" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme", + "dependencies": { + "@vue/shared": "3.5.13", + "@vue/compiler-dom": "3.5.13" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/api.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/api.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/api.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/app.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/app.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/app.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/component.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/component.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/component.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/context.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/context.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/context.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/index.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/index.js new file mode 100644 index 0000000..22f7589 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/index.js @@ -0,0 +1,22 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./api.js"), exports); +__exportStar(require("./app.js"), exports); +__exportStar(require("./component.js"), exports); +__exportStar(require("./context.js"), exports); +__exportStar(require("./hooks.js"), exports); +__exportStar(require("./util.js"), exports); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/util.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/util.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/api/util.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/const.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/const.js new file mode 100644 index 0000000..84d408c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/const.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HOOK_PLUGIN_SETTINGS_SET = exports.HOOK_SETUP = void 0; +exports.HOOK_SETUP = 'devtools-plugin:setup'; +exports.HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/env.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/env.js new file mode 100644 index 0000000..e6c7ebd --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/env.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isProxyAvailable = exports.getTarget = exports.getDevtoolsGlobalHook = void 0; +function getDevtoolsGlobalHook() { + return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; +} +exports.getDevtoolsGlobalHook = getDevtoolsGlobalHook; +function getTarget() { + // @ts-expect-error navigator and windows are not available in all environments + return (typeof navigator !== 'undefined' && typeof window !== 'undefined') + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : {}; +} +exports.getTarget = getTarget; +exports.isProxyAvailable = typeof Proxy === 'function'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/index.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/index.js new file mode 100644 index 0000000..f8b5fc3 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/index.js @@ -0,0 +1,45 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setupDevtoolsPlugin = void 0; +const env_js_1 = require("./env.js"); +const const_js_1 = require("./const.js"); +const proxy_js_1 = require("./proxy.js"); +__exportStar(require("./api/index.js"), exports); +__exportStar(require("./plugin.js"), exports); +__exportStar(require("./time.js"), exports); +function setupDevtoolsPlugin(pluginDescriptor, setupFn) { + const descriptor = pluginDescriptor; + const target = (0, env_js_1.getTarget)(); + const hook = (0, env_js_1.getDevtoolsGlobalHook)(); + const enableProxy = env_js_1.isProxyAvailable && descriptor.enableEarlyProxy; + if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { + hook.emit(const_js_1.HOOK_SETUP, pluginDescriptor, setupFn); + } + else { + const proxy = enableProxy ? new proxy_js_1.ApiProxy(descriptor, hook) : null; + const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; + list.push({ + pluginDescriptor: descriptor, + setupFn, + proxy, + }); + if (proxy) { + setupFn(proxy.proxiedTarget); + } + } +} +exports.setupDevtoolsPlugin = setupDevtoolsPlugin; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/plugin.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/plugin.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/plugin.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/proxy.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/proxy.js new file mode 100644 index 0000000..731c9ac --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/proxy.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiProxy = void 0; +const const_js_1 = require("./const.js"); +const time_js_1 = require("./time.js"); +class ApiProxy { + constructor(plugin, hook) { + this.target = null; + this.targetQueue = []; + this.onQueue = []; + this.plugin = plugin; + this.hook = hook; + const defaultSettings = {}; + if (plugin.settings) { + for (const id in plugin.settings) { + const item = plugin.settings[id]; + defaultSettings[id] = item.defaultValue; + } + } + const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; + let currentSettings = Object.assign({}, defaultSettings); + try { + const raw = localStorage.getItem(localSettingsSaveId); + const data = JSON.parse(raw); + Object.assign(currentSettings, data); + } + catch (e) { + // noop + } + this.fallbacks = { + getSettings() { + return currentSettings; + }, + setSettings(value) { + try { + localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); + } + catch (e) { + // noop + } + currentSettings = value; + }, + now() { + return (0, time_js_1.now)(); + }, + }; + if (hook) { + hook.on(const_js_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { + if (pluginId === this.plugin.id) { + this.fallbacks.setSettings(value); + } + }); + } + this.proxiedOn = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target.on[prop]; + } + else { + return (...args) => { + this.onQueue.push({ + method: prop, + args, + }); + }; + } + }, + }); + this.proxiedTarget = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target[prop]; + } + else if (prop === 'on') { + return this.proxiedOn; + } + else if (Object.keys(this.fallbacks).includes(prop)) { + return (...args) => { + this.targetQueue.push({ + method: prop, + args, + resolve: () => { }, + }); + return this.fallbacks[prop](...args); + }; + } + else { + return (...args) => { + return new Promise((resolve) => { + this.targetQueue.push({ + method: prop, + args, + resolve, + }); + }); + }; + } + }, + }); + } + async setRealTarget(target) { + this.target = target; + for (const item of this.onQueue) { + this.target.on[item.method](...item.args); + } + for (const item of this.targetQueue) { + item.resolve(await this.target[item.method](...item.args)); + } + } +} +exports.ApiProxy = ApiProxy; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/cjs/time.js b/seller_1/node_modules/@vue/devtools-api/lib/cjs/time.js new file mode 100644 index 0000000..78d7f67 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/cjs/time.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.now = exports.isPerformanceSupported = void 0; +let supported; +let perf; +function isPerformanceSupported() { + var _a; + if (supported !== undefined) { + return supported; + } + if (typeof window !== 'undefined' && window.performance) { + supported = true; + perf = window.performance; + } + else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { + supported = true; + perf = globalThis.perf_hooks.performance; + } + else { + supported = false; + } + return supported; +} +exports.isPerformanceSupported = isPerformanceSupported; +function now() { + return isPerformanceSupported() ? perf.now() : Date.now(); +} +exports.now = now; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts new file mode 100644 index 0000000..2e5494c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts @@ -0,0 +1,108 @@ +import type { ComponentBounds, Hookable } from './hooks.js'; +import type { Context } from './context.js'; +import type { ComponentInstance, ComponentState, StateBase } from './component.js'; +import type { App } from './app.js'; +import type { ID } from './util.js'; +export interface DevtoolsPluginApi<TSettings> { + on: Hookable<Context>; + notifyComponentUpdate: (instance?: ComponentInstance) => void; + addTimelineLayer: (options: TimelineLayerOptions) => void; + addTimelineEvent: (options: TimelineEventOptions) => void; + addInspector: (options: CustomInspectorOptions) => void; + sendInspectorTree: (inspectorId: string) => void; + sendInspectorState: (inspectorId: string) => void; + selectInspectorNode: (inspectorId: string, nodeId: string) => void; + getComponentBounds: (instance: ComponentInstance) => Promise<ComponentBounds>; + getComponentName: (instance: ComponentInstance) => Promise<string>; + getComponentInstances: (app: App) => Promise<ComponentInstance[]>; + highlightElement: (instance: ComponentInstance) => void; + unhighlightElement: () => void; + getSettings: (pluginId?: string) => TSettings; + now: () => number; + /** + * @private + */ + setSettings: (values: TSettings) => void; +} +export interface AppRecord { + id: string; + name: string; + instanceMap: Map<string, ComponentInstance>; + rootInstance: ComponentInstance; +} +export interface TimelineLayerOptions<TData = any, TMeta = any> { + id: string; + label: string; + color: number; + skipScreenshots?: boolean; + groupsOnly?: boolean; + ignoreNoDurationGroups?: boolean; + screenshotOverlayRender?: (event: TimelineEvent<TData, TMeta> & ScreenshotOverlayEvent, ctx: ScreenshotOverlayRenderContext) => ScreenshotOverlayRenderResult | Promise<ScreenshotOverlayRenderResult>; +} +export interface ScreenshotOverlayEvent { + layerId: string; + renderMeta: any; +} +export interface ScreenshotOverlayRenderContext<TData = any, TMeta = any> { + screenshot: ScreenshotData; + events: (TimelineEvent<TData, TMeta> & ScreenshotOverlayEvent)[]; + index: number; +} +export type ScreenshotOverlayRenderResult = HTMLElement | string | false; +export interface ScreenshotData { + time: number; +} +export interface TimelineEventOptions { + layerId: string; + event: TimelineEvent; + all?: boolean; +} +export interface TimelineEvent<TData = any, TMeta = any> { + time: number; + data: TData; + logType?: 'default' | 'warning' | 'error'; + meta?: TMeta; + groupId?: ID; + title?: string; + subtitle?: string; +} +export interface TimelineMarkerOptions { + id: string; + time: number; + color: number; + label: string; + all?: boolean; +} +export interface CustomInspectorOptions { + id: string; + label: string; + icon?: string; + treeFilterPlaceholder?: string; + stateFilterPlaceholder?: string; + noSelectionText?: string; + actions?: { + icon: string; + tooltip?: string; + action: () => void | Promise<void>; + }[]; + nodeActions?: { + icon: string; + tooltip?: string; + action: (nodeId: string) => void | Promise<void>; + }[]; +} +export interface CustomInspectorNode { + id: string; + label: string; + children?: CustomInspectorNode[]; + tags?: InspectorNodeTag[]; +} +export interface InspectorNodeTag { + label: string; + textColor: number; + backgroundColor: number; + tooltip?: string; +} +export interface CustomInspectorState { + [key: string]: (StateBase | Omit<ComponentState, 'type'>)[]; +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/api.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts new file mode 100644 index 0000000..a10f02f --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts @@ -0,0 +1 @@ +export type App = any; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/app.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts new file mode 100644 index 0000000..84fcba7 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts @@ -0,0 +1,78 @@ +import type { InspectorNodeTag } from './api.js'; +import type { ID } from './util.js'; +export type ComponentInstance = any; +export interface ComponentTreeNode { + uid: ID; + id: string; + name: string; + renderKey: string | number; + inactive: boolean; + isFragment: boolean; + hasChildren: boolean; + children: ComponentTreeNode[]; + domOrder?: number[]; + consoleId?: string; + isRouterView?: boolean; + macthedRouteSegment?: string; + tags: InspectorNodeTag[]; + autoOpen: boolean; + meta?: any; +} +export interface InspectedComponentData { + id: string; + name: string; + file: string; + state: ComponentState[]; + functional?: boolean; +} +export interface StateBase { + key: string; + value: any; + editable?: boolean; + objectType?: 'ref' | 'reactive' | 'computed' | 'other'; + raw?: string; +} +export interface ComponentStateBase extends StateBase { + type: string; +} +export interface ComponentPropState extends ComponentStateBase { + meta?: { + type: string; + required: boolean; + /** Vue 1 only */ + mode?: 'default' | 'sync' | 'once'; + }; +} +export type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store'; +export interface ComponentCustomState extends ComponentStateBase { + value: CustomState; +} +export interface CustomState { + _custom: { + type: ComponentBuiltinCustomStateTypes | string; + objectType?: string; + display?: string; + tooltip?: string; + value?: any; + abstract?: boolean; + file?: string; + uid?: number; + readOnly?: boolean; + /** Configure immediate child fields */ + fields?: { + abstract?: boolean; + }; + id?: any; + actions?: { + icon: string; + tooltip?: string; + action: () => void | Promise<void>; + }[]; + /** internal */ + _reviveId?: number; + }; +} +export type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState; +export interface ComponentDevtoolsOptions { + hide?: boolean; +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/component.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts new file mode 100644 index 0000000..29388f1 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts @@ -0,0 +1,5 @@ +import type { AppRecord } from './api.js'; +export interface Context { + currentTab: string; + currentAppRecord: AppRecord; +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/context.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts new file mode 100644 index 0000000..4e5d7cc --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts @@ -0,0 +1,180 @@ +import type { ComponentDevtoolsOptions, ComponentInstance, ComponentTreeNode, InspectedComponentData } from './component.js'; +import type { App } from './app.js'; +import type { CustomInspectorNode, CustomInspectorState, TimelineEvent } from './api.js'; +export declare const enum Hooks { + TRANSFORM_CALL = "transformCall", + GET_APP_RECORD_NAME = "getAppRecordName", + GET_APP_ROOT_INSTANCE = "getAppRootInstance", + REGISTER_APPLICATION = "registerApplication", + WALK_COMPONENT_TREE = "walkComponentTree", + VISIT_COMPONENT_TREE = "visitComponentTree", + WALK_COMPONENT_PARENTS = "walkComponentParents", + INSPECT_COMPONENT = "inspectComponent", + GET_COMPONENT_BOUNDS = "getComponentBounds", + GET_COMPONENT_NAME = "getComponentName", + GET_COMPONENT_INSTANCES = "getComponentInstances", + GET_ELEMENT_COMPONENT = "getElementComponent", + GET_COMPONENT_ROOT_ELEMENTS = "getComponentRootElements", + EDIT_COMPONENT_STATE = "editComponentState", + GET_COMPONENT_DEVTOOLS_OPTIONS = "getAppDevtoolsOptions", + GET_COMPONENT_RENDER_CODE = "getComponentRenderCode", + INSPECT_TIMELINE_EVENT = "inspectTimelineEvent", + TIMELINE_CLEARED = "timelineCleared", + GET_INSPECTOR_TREE = "getInspectorTree", + GET_INSPECTOR_STATE = "getInspectorState", + EDIT_INSPECTOR_STATE = "editInspectorState", + SET_PLUGIN_SETTINGS = "setPluginSettings" +} +export interface ComponentBounds { + left: number; + top: number; + width: number; + height: number; +} +export interface HookPayloads { + [Hooks.TRANSFORM_CALL]: { + callName: string; + inArgs: any[]; + outArgs: any[]; + }; + [Hooks.GET_APP_RECORD_NAME]: { + app: App; + name: string; + }; + [Hooks.GET_APP_ROOT_INSTANCE]: { + app: App; + root: ComponentInstance; + }; + [Hooks.REGISTER_APPLICATION]: { + app: App; + }; + [Hooks.WALK_COMPONENT_TREE]: { + componentInstance: ComponentInstance; + componentTreeData: ComponentTreeNode[]; + maxDepth: number; + filter: string; + recursively: boolean; + }; + [Hooks.VISIT_COMPONENT_TREE]: { + app: App; + componentInstance: ComponentInstance; + treeNode: ComponentTreeNode; + filter: string; + }; + [Hooks.WALK_COMPONENT_PARENTS]: { + componentInstance: ComponentInstance; + parentInstances: ComponentInstance[]; + }; + [Hooks.INSPECT_COMPONENT]: { + app: App; + componentInstance: ComponentInstance; + instanceData: InspectedComponentData; + }; + [Hooks.GET_COMPONENT_BOUNDS]: { + componentInstance: ComponentInstance; + bounds: ComponentBounds; + }; + [Hooks.GET_COMPONENT_NAME]: { + componentInstance: ComponentInstance; + name: string; + }; + [Hooks.GET_COMPONENT_INSTANCES]: { + app: App; + componentInstances: ComponentInstance[]; + }; + [Hooks.GET_ELEMENT_COMPONENT]: { + element: HTMLElement | any; + componentInstance: ComponentInstance; + }; + [Hooks.GET_COMPONENT_ROOT_ELEMENTS]: { + componentInstance: ComponentInstance; + rootElements: (HTMLElement | any)[]; + }; + [Hooks.EDIT_COMPONENT_STATE]: { + app: App; + componentInstance: ComponentInstance; + path: string[]; + type: string; + state: EditStatePayload; + set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void; + }; + [Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS]: { + componentInstance: ComponentInstance; + options: ComponentDevtoolsOptions; + }; + [Hooks.GET_COMPONENT_RENDER_CODE]: { + componentInstance: ComponentInstance; + code: string; + }; + [Hooks.INSPECT_TIMELINE_EVENT]: { + app: App; + layerId: string; + event: TimelineEvent; + all?: boolean; + data: any; + }; + [Hooks.TIMELINE_CLEARED]: Record<string, never>; + [Hooks.GET_INSPECTOR_TREE]: { + app: App; + inspectorId: string; + filter: string; + rootNodes: CustomInspectorNode[]; + }; + [Hooks.GET_INSPECTOR_STATE]: { + app: App; + inspectorId: string; + nodeId: string; + state: CustomInspectorState; + }; + [Hooks.EDIT_INSPECTOR_STATE]: { + app: App; + inspectorId: string; + nodeId: string; + path: string[]; + type: string; + state: EditStatePayload; + set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void; + }; + [Hooks.SET_PLUGIN_SETTINGS]: { + app: App; + pluginId: string; + key: string; + newValue: any; + oldValue: any; + settings: any; + }; +} +export type EditStatePayload = { + value: any; + newKey?: string | null; + remove?: undefined | false; +} | { + value?: undefined; + newKey?: undefined; + remove: true; +}; +export type HookHandler<TPayload, TContext> = (payload: TPayload, ctx: TContext) => void | Promise<void>; +export interface Hookable<TContext> { + transformCall: (handler: HookHandler<HookPayloads[Hooks.TRANSFORM_CALL], TContext>) => any; + getAppRecordName: (handler: HookHandler<HookPayloads[Hooks.GET_APP_RECORD_NAME], TContext>) => any; + getAppRootInstance: (handler: HookHandler<HookPayloads[Hooks.GET_APP_ROOT_INSTANCE], TContext>) => any; + registerApplication: (handler: HookHandler<HookPayloads[Hooks.REGISTER_APPLICATION], TContext>) => any; + walkComponentTree: (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_TREE], TContext>) => any; + visitComponentTree: (handler: HookHandler<HookPayloads[Hooks.VISIT_COMPONENT_TREE], TContext>) => any; + walkComponentParents: (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_PARENTS], TContext>) => any; + inspectComponent: (handler: HookHandler<HookPayloads[Hooks.INSPECT_COMPONENT], TContext>) => any; + getComponentBounds: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_BOUNDS], TContext>) => any; + getComponentName: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_NAME], TContext>) => any; + getComponentInstances: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_INSTANCES], TContext>) => any; + getElementComponent: (handler: HookHandler<HookPayloads[Hooks.GET_ELEMENT_COMPONENT], TContext>) => any; + getComponentRootElements: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_ROOT_ELEMENTS], TContext>) => any; + editComponentState: (handler: HookHandler<HookPayloads[Hooks.EDIT_COMPONENT_STATE], TContext>) => any; + getComponentDevtoolsOptions: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS], TContext>) => any; + getComponentRenderCode: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_RENDER_CODE], TContext>) => any; + inspectTimelineEvent: (handler: HookHandler<HookPayloads[Hooks.INSPECT_TIMELINE_EVENT], TContext>) => any; + timelineCleared: (handler: HookHandler<HookPayloads[Hooks.TIMELINE_CLEARED], TContext>) => any; + getInspectorTree: (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>) => any; + getInspectorState: (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>) => any; + editInspectorState: (handler: HookHandler<HookPayloads[Hooks.EDIT_INSPECTOR_STATE], TContext>) => any; + setPluginSettings: (handler: HookHandler<HookPayloads[Hooks.SET_PLUGIN_SETTINGS], TContext>) => any; +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/hooks.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts new file mode 100644 index 0000000..70d09d2 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts @@ -0,0 +1,6 @@ +export * from './api.js'; +export * from './app.js'; +export * from './component.js'; +export * from './context.js'; +export * from './hooks.js'; +export * from './util.js'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.js new file mode 100644 index 0000000..70d09d2 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/index.js @@ -0,0 +1,6 @@ +export * from './api.js'; +export * from './app.js'; +export * from './component.js'; +export * from './context.js'; +export * from './hooks.js'; +export * from './util.js'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts new file mode 100644 index 0000000..f8ca920 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts @@ -0,0 +1,4 @@ +export type ID = number | string; +export interface WithId { + id: ID; +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/api/util.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/const.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/const.d.ts new file mode 100644 index 0000000..289b254 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/const.d.ts @@ -0,0 +1,2 @@ +export declare const HOOK_SETUP = "devtools-plugin:setup"; +export declare const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set"; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/const.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/const.js new file mode 100644 index 0000000..872ea3e --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/const.js @@ -0,0 +1,2 @@ +export const HOOK_SETUP = 'devtools-plugin:setup'; +export const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/env.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/env.d.ts new file mode 100644 index 0000000..045d95f --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/env.d.ts @@ -0,0 +1,15 @@ +import type { ApiProxy } from './proxy.js'; +import type { PluginDescriptor, SetupFunction } from './index.js'; +export interface PluginQueueItem { + pluginDescriptor: PluginDescriptor; + setupFn: SetupFunction; + proxy?: ApiProxy; +} +interface GlobalTarget { + __VUE_DEVTOOLS_PLUGINS__?: PluginQueueItem[]; + __VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__?: boolean; +} +export declare function getDevtoolsGlobalHook(): any; +export declare function getTarget(): GlobalTarget; +export declare const isProxyAvailable: boolean; +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/env.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/env.js new file mode 100644 index 0000000..a7a74b1 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/env.js @@ -0,0 +1,12 @@ +export function getDevtoolsGlobalHook() { + return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; +} +export function getTarget() { + // @ts-expect-error navigator and windows are not available in all environments + return (typeof navigator !== 'undefined' && typeof window !== 'undefined') + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : {}; +} +export const isProxyAvailable = typeof Proxy === 'function'; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/index.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/index.d.ts new file mode 100644 index 0000000..162518b --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/index.d.ts @@ -0,0 +1,18 @@ +import type { DevtoolsPluginApi } from './api/index.js'; +import type { ExtractSettingsTypes, PluginDescriptor, PluginSettingsItem } from './plugin.js'; +export * from './api/index.js'; +export * from './plugin.js'; +export * from './time.js'; +export { PluginQueueItem } from './env.js'; +type Cast<A, B> = A extends B ? A : B; +type Narrowable = string | number | bigint | boolean; +type Narrow<A> = Cast<A, [] | (A extends Narrowable ? A : never) | ({ + [K in keyof A]: Narrow<A[K]>; +})>; +type Exact<C, T> = { + [K in keyof C]: K extends keyof T ? T[K] : never; +}; +export type SetupFunction<TSettings = any> = (api: DevtoolsPluginApi<TSettings>) => void; +export declare function setupDevtoolsPlugin<TDescriptor extends Exact<TDescriptor, PluginDescriptor>, TSettings = ExtractSettingsTypes<TDescriptor extends { + settings: infer S; +} ? S extends Record<string, PluginSettingsItem> ? S : Record<string, PluginSettingsItem> : Record<string, PluginSettingsItem>>>(pluginDescriptor: Narrow<TDescriptor>, setupFn: SetupFunction<TSettings>): void; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/index.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/index.js new file mode 100644 index 0000000..c7a50ec --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/index.js @@ -0,0 +1,27 @@ +import { getDevtoolsGlobalHook, getTarget, isProxyAvailable } from './env.js'; +import { HOOK_SETUP } from './const.js'; +import { ApiProxy } from './proxy.js'; +export * from './api/index.js'; +export * from './plugin.js'; +export * from './time.js'; +export function setupDevtoolsPlugin(pluginDescriptor, setupFn) { + const descriptor = pluginDescriptor; + const target = getTarget(); + const hook = getDevtoolsGlobalHook(); + const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy; + if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { + hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); + } + else { + const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null; + const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; + list.push({ + pluginDescriptor: descriptor, + setupFn, + proxy, + }); + if (proxy) { + setupFn(proxy.proxiedTarget); + } + } +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts new file mode 100644 index 0000000..52322ca --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts @@ -0,0 +1,47 @@ +import type { App } from './api/index.js'; +export interface PluginDescriptor { + id: string; + label: string; + app: App; + packageName?: string; + homepage?: string; + componentStateTypes?: string[]; + logo?: string; + disableAppScope?: boolean; + disablePluginScope?: boolean; + /** + * Run the plugin setup and expose the api even if the devtools is not opened yet. + * Useful to record timeline events early. + */ + enableEarlyProxy?: boolean; + settings?: Record<string, PluginSettingsItem>; +} +export type PluginSettingsItem = { + label: string; + description?: string; +} & ({ + type: 'boolean'; + defaultValue: boolean; +} | { + type: 'choice'; + defaultValue: string | number; + options: { + value: string | number; + label: string; + }[]; + component?: 'select' | 'button-group'; +} | { + type: 'text'; + defaultValue: string; +}); +type InferSettingsType<T extends PluginSettingsItem> = [T] extends [{ + type: 'boolean'; +}] ? boolean : [T] extends [{ + type: 'choice'; +}] ? T['options'][number]['value'] : [T] extends [{ + type: 'text'; +}] ? string : unknown; +export type ExtractSettingsTypes<O extends Record<string, PluginSettingsItem>> = { + [K in keyof O]: InferSettingsType<O[K]>; +}; +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/plugin.js @@ -0,0 +1 @@ +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts new file mode 100644 index 0000000..38ff867 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts @@ -0,0 +1,20 @@ +import type { Context, DevtoolsPluginApi, Hookable } from './api/index.js'; +import type { PluginDescriptor } from './plugin.js'; +interface QueueItem { + method: string; + args: any[]; + resolve?: (value?: any) => void; +} +export declare class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi<any>> { + target: TTarget | null; + targetQueue: QueueItem[]; + proxiedTarget: TTarget; + onQueue: QueueItem[]; + proxiedOn: Hookable<Context>; + plugin: PluginDescriptor; + hook: any; + fallbacks: Record<string, any>; + constructor(plugin: PluginDescriptor, hook: any); + setRealTarget(target: TTarget): Promise<void>; +} +export {}; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.js new file mode 100644 index 0000000..3cce0ff --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/proxy.js @@ -0,0 +1,107 @@ +import { HOOK_PLUGIN_SETTINGS_SET } from './const.js'; +import { now } from './time.js'; +export class ApiProxy { + constructor(plugin, hook) { + this.target = null; + this.targetQueue = []; + this.onQueue = []; + this.plugin = plugin; + this.hook = hook; + const defaultSettings = {}; + if (plugin.settings) { + for (const id in plugin.settings) { + const item = plugin.settings[id]; + defaultSettings[id] = item.defaultValue; + } + } + const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; + let currentSettings = Object.assign({}, defaultSettings); + try { + const raw = localStorage.getItem(localSettingsSaveId); + const data = JSON.parse(raw); + Object.assign(currentSettings, data); + } + catch (e) { + // noop + } + this.fallbacks = { + getSettings() { + return currentSettings; + }, + setSettings(value) { + try { + localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); + } + catch (e) { + // noop + } + currentSettings = value; + }, + now() { + return now(); + }, + }; + if (hook) { + hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { + if (pluginId === this.plugin.id) { + this.fallbacks.setSettings(value); + } + }); + } + this.proxiedOn = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target.on[prop]; + } + else { + return (...args) => { + this.onQueue.push({ + method: prop, + args, + }); + }; + } + }, + }); + this.proxiedTarget = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target[prop]; + } + else if (prop === 'on') { + return this.proxiedOn; + } + else if (Object.keys(this.fallbacks).includes(prop)) { + return (...args) => { + this.targetQueue.push({ + method: prop, + args, + resolve: () => { }, + }); + return this.fallbacks[prop](...args); + }; + } + else { + return (...args) => { + return new Promise((resolve) => { + this.targetQueue.push({ + method: prop, + args, + resolve, + }); + }); + }; + } + }, + }); + } + async setRealTarget(target) { + this.target = target; + for (const item of this.onQueue) { + this.target.on[item.method](...item.args); + } + for (const item of this.targetQueue) { + item.resolve(await this.target[item.method](...item.args)); + } + } +} diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/time.d.ts b/seller_1/node_modules/@vue/devtools-api/lib/esm/time.d.ts new file mode 100644 index 0000000..1aebade --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/time.d.ts @@ -0,0 +1,2 @@ +export declare function isPerformanceSupported(): boolean; +export declare function now(): number; diff --git a/seller_1/node_modules/@vue/devtools-api/lib/esm/time.js b/seller_1/node_modules/@vue/devtools-api/lib/esm/time.js new file mode 100644 index 0000000..fd15ffe --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/lib/esm/time.js @@ -0,0 +1,23 @@ +let supported; +let perf; +export function isPerformanceSupported() { + var _a; + if (supported !== undefined) { + return supported; + } + if (typeof window !== 'undefined' && window.performance) { + supported = true; + perf = window.performance; + } + else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { + supported = true; + perf = globalThis.perf_hooks.performance; + } + else { + supported = false; + } + return supported; +} +export function now() { + return isPerformanceSupported() ? perf.now() : Date.now(); +} diff --git a/seller_1/node_modules/@vue/devtools-api/package.json b/seller_1/node_modules/@vue/devtools-api/package.json new file mode 100644 index 0000000..85e9706 --- /dev/null +++ b/seller_1/node_modules/@vue/devtools-api/package.json @@ -0,0 +1,37 @@ +{ + "name": "@vue/devtools-api", + "version": "6.6.4", + "description": "Interact with the Vue devtools from the page", + "author": { + "name": "Guillaume Chau" + }, + "license": "MIT", + "repository": { + "url": "https://github.com/vuejs/vue-devtools.git", + "type": "git", + "directory": "packages/api" + }, + "sideEffects": false, + "main": "lib/cjs/index.js", + "browser": "lib/esm/index.js", + "module": "lib/esm/index.js", + "types": "lib/esm/index.d.ts", + "files": [ + "lib/cjs", + "lib/esm" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "rimraf lib && yarn build:esm && yarn build:cjs", + "build:esm": "tsc --module es2015 --outDir lib/esm -d", + "build:cjs": "tsc --module commonjs --outDir lib/cjs", + "build:watch": "yarn tsc --module es2015 --outDir lib/esm -d -w --sourceMap" + }, + "devDependencies": { + "@types/node": "^20.11.16", + "@types/webpack-env": "^1.15.1", + "typescript": "^5.3.3" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/reactivity/LICENSE b/seller_1/node_modules/@vue/reactivity/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/reactivity/README.md b/seller_1/node_modules/@vue/reactivity/README.md new file mode 100644 index 0000000..e478074 --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/README.md @@ -0,0 +1,19 @@ +# @vue/reactivity + +## Usage Note + +This package is inlined into Global & Browser ESM builds of user-facing renderers (e.g. `@vue/runtime-dom`), but also published as a package that can be used standalone. The standalone build should not be used alongside a pre-bundled build of a user-facing renderer, as they will have different internal storage for reactivity connections. A user-facing renderer should re-export all APIs from this package. + +For full exposed APIs, see `src/index.ts`. + +## Credits + +The implementation of this module is inspired by the following prior art in the JavaScript ecosystem: + +- [Meteor Tracker](https://docs.meteor.com/api/tracker.html) +- [nx-js/observer-util](https://github.com/nx-js/observer-util) +- [salesforce/observable-membrane](https://github.com/salesforce/observable-membrane) + +## Caveats + +- Built-in objects are not observed except for `Array`, `Map`, `WeakMap`, `Set` and `WeakSet`. diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.js new file mode 100644 index 0000000..a547a2a --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.js @@ -0,0 +1,1939 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var shared = require('@vue/shared'); + +function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} + +let activeSub; +const EffectFlags = { + "ACTIVE": 1, + "1": "ACTIVE", + "RUNNING": 2, + "2": "RUNNING", + "TRACKING": 4, + "4": "TRACKING", + "NOTIFIED": 8, + "8": "NOTIFIED", + "DIRTY": 16, + "16": "DIRTY", + "ALLOW_RECURSE": 32, + "32": "ALLOW_RECURSE", + "PAUSED": 64, + "64": "PAUSED" +}; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || shared.hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + shared.extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function onEffectCleanup(fn, failSilently = false) { + if (activeSub instanceof ReactiveEffect) { + activeSub.cleanup = fn; + } else if (!failSilently) { + warn( + `onEffectCleanup() was called when there was no active effect to associate with.` + ); + } +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + shared.extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + shared.extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + "Object iterate" +); +const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" +); +const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = shared.isArray(target); + const isArrayIndex = targetIsArray && shared.isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !shared.isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (shared.isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => shared.isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(shared.isSymbol) +); +function hasOwnProperty(key) { + if (!shared.isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = shared.isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && shared.isIntegerKey(key) ? res : res.value; + } + if (shared.isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = shared.hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + shared.isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = shared.isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn( + `${shared.capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (shared.hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (shared.hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + shared.extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = shared.toRawType(target); + warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(shared.toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!shared.isObject(target)) { + { + warn( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!shared.hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + shared.def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => shared.isObject(value) ? reactive(value) : value; +const toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (shared.hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } + } + } +} +function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } + } +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return shared.isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!isProxy(object)) { + warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = shared.isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (shared.isFunction(source)) { + return new GetterRefImpl(source); + } else if (shared.isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn("Write operation failed: computed value is readonly"); + } + } +} +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (shared.isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; +} + +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw", + "IS_REF": "__v_isRef" +}; + +const WatchErrorCodes = { + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP" +}; +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch(source, cb, options = shared.EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (shared.isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (shared.isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (shared.isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = shared.NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + shared.remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (shared.isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (shared.isSet(value) || shared.isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (shared.isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY; +exports.EffectFlags = EffectFlags; +exports.EffectScope = EffectScope; +exports.ITERATE_KEY = ITERATE_KEY; +exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY; +exports.ReactiveEffect = ReactiveEffect; +exports.ReactiveFlags = ReactiveFlags; +exports.TrackOpTypes = TrackOpTypes; +exports.TriggerOpTypes = TriggerOpTypes; +exports.WatchErrorCodes = WatchErrorCodes; +exports.computed = computed; +exports.customRef = customRef; +exports.effect = effect; +exports.effectScope = effectScope; +exports.enableTracking = enableTracking; +exports.getCurrentScope = getCurrentScope; +exports.getCurrentWatcher = getCurrentWatcher; +exports.isProxy = isProxy; +exports.isReactive = isReactive; +exports.isReadonly = isReadonly; +exports.isRef = isRef; +exports.isShallow = isShallow; +exports.markRaw = markRaw; +exports.onEffectCleanup = onEffectCleanup; +exports.onScopeDispose = onScopeDispose; +exports.onWatcherCleanup = onWatcherCleanup; +exports.pauseTracking = pauseTracking; +exports.proxyRefs = proxyRefs; +exports.reactive = reactive; +exports.reactiveReadArray = reactiveReadArray; +exports.readonly = readonly; +exports.ref = ref; +exports.resetTracking = resetTracking; +exports.shallowReactive = shallowReactive; +exports.shallowReadArray = shallowReadArray; +exports.shallowReadonly = shallowReadonly; +exports.shallowRef = shallowRef; +exports.stop = stop; +exports.toRaw = toRaw; +exports.toReactive = toReactive; +exports.toReadonly = toReadonly; +exports.toRef = toRef; +exports.toRefs = toRefs; +exports.toValue = toValue; +exports.track = track; +exports.traverse = traverse; +exports.trigger = trigger; +exports.triggerRef = triggerRef; +exports.unref = unref; +exports.watch = watch; diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js new file mode 100644 index 0000000..ee6811b --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js @@ -0,0 +1,1789 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var shared = require('@vue/shared'); + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } +} + +let activeSub; +const EffectFlags = { + "ACTIVE": 1, + "1": "ACTIVE", + "RUNNING": 2, + "2": "RUNNING", + "TRACKING": 4, + "4": "TRACKING", + "NOTIFIED": 8, + "8": "NOTIFIED", + "DIRTY": 16, + "16": "DIRTY", + "ALLOW_RECURSE": 32, + "32": "ALLOW_RECURSE", + "PAUSED": 64, + "64": "PAUSED" +}; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || shared.hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + shared.extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function onEffectCleanup(fn, failSilently = false) { + if (activeSub instanceof ReactiveEffect) { + activeSub.cleanup = fn; + } +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (false) ; + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + "" +); +const MAP_KEY_ITERATE_KEY = Symbol( + "" +); +const ARRAY_ITERATE_KEY = Symbol( + "" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track(); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger(); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = shared.isArray(target); + const isArrayIndex = targetIsArray && shared.isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !shared.isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (shared.isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => shared.isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(shared.isSymbol) +); +function hasOwnProperty(key) { + if (!shared.isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = shared.isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && shared.isIntegerKey(key) ? res : res.value; + } + if (shared.isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = shared.hasOwn(target, key); + target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + shared.isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + return true; + } + deleteProperty(target, key) { + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = shared.isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (shared.hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (shared.hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + shared.extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } + get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(shared.toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!shared.isObject(target)) { + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!shared.hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + shared.def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => shared.isObject(value) ? reactive(value) : value; +const toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track(); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (shared.hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger(); + } + } + } +} +function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger(); + } + } +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return shared.isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + const ret = shared.isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (shared.isFunction(source)) { + return new GetterRefImpl(source); + } else if (shared.isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track(); + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } + } +} +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (shared.isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + return cRef; +} + +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw", + "IS_REF": "__v_isRef" +}; + +const WatchErrorCodes = { + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP" +}; +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } +} +function watch(source, cb, options = shared.EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (shared.isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (shared.isFunction(s)) { + return call ? call(s, 2) : s(); + } else ; + }); + } else if (shared.isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = shared.NOOP; + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + shared.remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (shared.isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (shared.isSet(value) || shared.isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (shared.isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY; +exports.EffectFlags = EffectFlags; +exports.EffectScope = EffectScope; +exports.ITERATE_KEY = ITERATE_KEY; +exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY; +exports.ReactiveEffect = ReactiveEffect; +exports.ReactiveFlags = ReactiveFlags; +exports.TrackOpTypes = TrackOpTypes; +exports.TriggerOpTypes = TriggerOpTypes; +exports.WatchErrorCodes = WatchErrorCodes; +exports.computed = computed; +exports.customRef = customRef; +exports.effect = effect; +exports.effectScope = effectScope; +exports.enableTracking = enableTracking; +exports.getCurrentScope = getCurrentScope; +exports.getCurrentWatcher = getCurrentWatcher; +exports.isProxy = isProxy; +exports.isReactive = isReactive; +exports.isReadonly = isReadonly; +exports.isRef = isRef; +exports.isShallow = isShallow; +exports.markRaw = markRaw; +exports.onEffectCleanup = onEffectCleanup; +exports.onScopeDispose = onScopeDispose; +exports.onWatcherCleanup = onWatcherCleanup; +exports.pauseTracking = pauseTracking; +exports.proxyRefs = proxyRefs; +exports.reactive = reactive; +exports.reactiveReadArray = reactiveReadArray; +exports.readonly = readonly; +exports.ref = ref; +exports.resetTracking = resetTracking; +exports.shallowReactive = shallowReactive; +exports.shallowReadArray = shallowReadArray; +exports.shallowReadonly = shallowReadonly; +exports.shallowRef = shallowRef; +exports.stop = stop; +exports.toRaw = toRaw; +exports.toReactive = toReactive; +exports.toReadonly = toReadonly; +exports.toRef = toRef; +exports.toRefs = toRefs; +exports.toValue = toValue; +exports.track = track; +exports.traverse = traverse; +exports.trigger = trigger; +exports.triggerRef = triggerRef; +exports.unref = unref; +exports.watch = watch; diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.d.ts b/seller_1/node_modules/@vue/reactivity/dist/reactivity.d.ts new file mode 100644 index 0000000..da9fc95 --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.d.ts @@ -0,0 +1,754 @@ +import { IfAny } from '@vue/shared'; + +export declare enum TrackOpTypes { + GET = "get", + HAS = "has", + ITERATE = "iterate" +} +export declare enum TriggerOpTypes { + SET = "set", + ADD = "add", + DELETE = "delete", + CLEAR = "clear" +} +export declare enum ReactiveFlags { + SKIP = "__v_skip", + IS_REACTIVE = "__v_isReactive", + IS_READONLY = "__v_isReadonly", + IS_SHALLOW = "__v_isShallow", + RAW = "__v_raw", + IS_REF = "__v_isRef" +} + +export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>; +declare const ReactiveMarkerSymbol: unique symbol; +export interface ReactiveMarker { + [ReactiveMarkerSymbol]?: void; +} +export type Reactive<T> = UnwrapNestedRefs<T> & (T extends readonly any[] ? ReactiveMarker : {}); +/** + * Returns a reactive proxy of the object. + * + * The reactive conversion is "deep": it affects all nested properties. A + * reactive object also deeply unwraps any properties that are refs while + * maintaining reactivity. + * + * @example + * ```js + * const obj = reactive({ count: 0 }) + * ``` + * + * @param target - The source object. + * @see {@link https://vuejs.org/api/reactivity-core.html#reactive} + */ +export declare function reactive<T extends object>(target: T): Reactive<T>; +declare const ShallowReactiveMarker: unique symbol; +export type ShallowReactive<T> = T & { + [ShallowReactiveMarker]?: true; +}; +/** + * Shallow version of {@link reactive()}. + * + * Unlike {@link reactive()}, there is no deep conversion: only root-level + * properties are reactive for a shallow reactive object. Property values are + * stored and exposed as-is - this also means properties with ref values will + * not be automatically unwrapped. + * + * @example + * ```js + * const state = shallowReactive({ + * foo: 1, + * nested: { + * bar: 2 + * } + * }) + * + * // mutating state's own properties is reactive + * state.foo++ + * + * // ...but does not convert nested objects + * isReactive(state.nested) // false + * + * // NOT reactive + * state.nested.bar++ + * ``` + * + * @param target - The source object. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive} + */ +export declare function shallowReactive<T extends object>(target: T): ShallowReactive<T>; +type Primitive = string | number | boolean | bigint | symbol | undefined | null; +type Builtin = Primitive | Function | Date | Error | RegExp; +export type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends WeakSet<infer U> ? WeakSet<DeepReadonly<U>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends Ref<infer U, unknown> ? Readonly<Ref<DeepReadonly<U>>> : T extends {} ? { + readonly [K in keyof T]: DeepReadonly<T[K]>; +} : Readonly<T>; +/** + * Takes an object (reactive or plain) or a ref and returns a readonly proxy to + * the original. + * + * A readonly proxy is deep: any nested property accessed will be readonly as + * well. It also has the same ref-unwrapping behavior as {@link reactive()}, + * except the unwrapped values will also be made readonly. + * + * @example + * ```js + * const original = reactive({ count: 0 }) + * + * const copy = readonly(original) + * + * watchEffect(() => { + * // works for reactivity tracking + * console.log(copy.count) + * }) + * + * // mutating original will trigger watchers relying on the copy + * original.count++ + * + * // mutating the copy will fail and result in a warning + * copy.count++ // warning! + * ``` + * + * @param target - The source object. + * @see {@link https://vuejs.org/api/reactivity-core.html#readonly} + */ +export declare function readonly<T extends object>(target: T): DeepReadonly<UnwrapNestedRefs<T>>; +/** + * Shallow version of {@link readonly()}. + * + * Unlike {@link readonly()}, there is no deep conversion: only root-level + * properties are made readonly. Property values are stored and exposed as-is - + * this also means properties with ref values will not be automatically + * unwrapped. + * + * @example + * ```js + * const state = shallowReadonly({ + * foo: 1, + * nested: { + * bar: 2 + * } + * }) + * + * // mutating state's own properties will fail + * state.foo++ + * + * // ...but works on nested objects + * isReadonly(state.nested) // false + * + * // works + * state.nested.bar++ + * ``` + * + * @param target - The source object. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly} + */ +export declare function shallowReadonly<T extends object>(target: T): Readonly<T>; +/** + * Checks if an object is a proxy created by {@link reactive()} or + * {@link shallowReactive()} (or {@link ref()} in some cases). + * + * @example + * ```js + * isReactive(reactive({})) // => true + * isReactive(readonly(reactive({}))) // => true + * isReactive(ref({}).value) // => true + * isReactive(readonly(ref({})).value) // => true + * isReactive(ref(true)) // => false + * isReactive(shallowRef({}).value) // => false + * isReactive(shallowReactive({})) // => true + * ``` + * + * @param value - The value to check. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive} + */ +export declare function isReactive(value: unknown): boolean; +/** + * Checks whether the passed value is a readonly object. The properties of a + * readonly object can change, but they can't be assigned directly via the + * passed object. + * + * The proxies created by {@link readonly()} and {@link shallowReadonly()} are + * both considered readonly, as is a computed ref without a set function. + * + * @param value - The value to check. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly} + */ +export declare function isReadonly(value: unknown): boolean; +export declare function isShallow(value: unknown): boolean; +/** + * Checks if an object is a proxy created by {@link reactive}, + * {@link readonly}, {@link shallowReactive} or {@link shallowReadonly()}. + * + * @param value - The value to check. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy} + */ +export declare function isProxy(value: any): boolean; +/** + * Returns the raw, original object of a Vue-created proxy. + * + * `toRaw()` can return the original object from proxies created by + * {@link reactive()}, {@link readonly()}, {@link shallowReactive()} or + * {@link shallowReadonly()}. + * + * This is an escape hatch that can be used to temporarily read without + * incurring proxy access / tracking overhead or write without triggering + * changes. It is **not** recommended to hold a persistent reference to the + * original object. Use with caution. + * + * @example + * ```js + * const foo = {} + * const reactiveFoo = reactive(foo) + * + * console.log(toRaw(reactiveFoo) === foo) // true + * ``` + * + * @param observed - The object for which the "raw" value is requested. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw} + */ +export declare function toRaw<T>(observed: T): T; +export type Raw<T> = T & { + [RawSymbol]?: true; +}; +/** + * Marks an object so that it will never be converted to a proxy. Returns the + * object itself. + * + * @example + * ```js + * const foo = markRaw({}) + * console.log(isReactive(reactive(foo))) // false + * + * // also works when nested inside other reactive objects + * const bar = reactive({ foo }) + * console.log(isReactive(bar.foo)) // false + * ``` + * + * **Warning:** `markRaw()` together with the shallow APIs such as + * {@link shallowReactive()} allow you to selectively opt-out of the default + * deep reactive/readonly conversion and embed raw, non-proxied objects in your + * state graph. + * + * @param value - The object to be marked as "raw". + * @see {@link https://vuejs.org/api/reactivity-advanced.html#markraw} + */ +export declare function markRaw<T extends object>(value: T): Raw<T>; +/** + * Returns a reactive proxy of the given value (if possible). + * + * If the given value is not an object, the original value itself is returned. + * + * @param value - The value for which a reactive proxy shall be created. + */ +export declare const toReactive: <T extends unknown>(value: T) => T; +/** + * Returns a readonly proxy of the given value (if possible). + * + * If the given value is not an object, the original value itself is returned. + * + * @param value - The value for which a readonly proxy shall be created. + */ +export declare const toReadonly: <T extends unknown>(value: T) => DeepReadonly<T>; + +export type EffectScheduler = (...args: any[]) => any; +export type DebuggerEvent = { + effect: Subscriber; +} & DebuggerEventExtraInfo; +export type DebuggerEventExtraInfo = { + target: object; + type: TrackOpTypes | TriggerOpTypes; + key: any; + newValue?: any; + oldValue?: any; + oldTarget?: Map<any, any> | Set<any>; +}; +export interface DebuggerOptions { + onTrack?: (event: DebuggerEvent) => void; + onTrigger?: (event: DebuggerEvent) => void; +} +export interface ReactiveEffectOptions extends DebuggerOptions { + scheduler?: EffectScheduler; + allowRecurse?: boolean; + onStop?: () => void; +} +export declare enum EffectFlags { + /** + * ReactiveEffect only + */ + ACTIVE = 1, + RUNNING = 2, + TRACKING = 4, + NOTIFIED = 8, + DIRTY = 16, + ALLOW_RECURSE = 32, + PAUSED = 64 +} +/** + * Subscriber is a type that tracks (or subscribes to) a list of deps. + */ +interface Subscriber extends DebuggerOptions { +} +export declare class ReactiveEffect<T = any> implements Subscriber, ReactiveEffectOptions { + fn: () => T; + scheduler?: EffectScheduler; + onStop?: () => void; + onTrack?: (event: DebuggerEvent) => void; + onTrigger?: (event: DebuggerEvent) => void; + constructor(fn: () => T); + pause(): void; + resume(): void; + run(): T; + stop(): void; + trigger(): void; + get dirty(): boolean; +} +export interface ReactiveEffectRunner<T = any> { + (): T; + effect: ReactiveEffect; +} +export interface ReactiveEffectRunner<T = any> { + (): T; + effect: ReactiveEffect; +} +export declare function effect<T = any>(fn: () => T, options?: ReactiveEffectOptions): ReactiveEffectRunner<T>; +/** + * Stops the effect associated with the given runner. + * + * @param runner - Association with the effect to stop tracking. + */ +export declare function stop(runner: ReactiveEffectRunner): void; +/** + * Temporarily pauses tracking. + */ +export declare function pauseTracking(): void; +/** + * Re-enables effect tracking (if it was paused). + */ +export declare function enableTracking(): void; +/** + * Resets the previous global effect tracking state. + */ +export declare function resetTracking(): void; +/** + * Registers a cleanup function for the current active effect. + * The cleanup function is called right before the next effect run, or when the + * effect is stopped. + * + * Throws a warning if there is no current active effect. The warning can be + * suppressed by passing `true` to the second argument. + * + * @param fn - the cleanup function to be registered + * @param failSilently - if `true`, will not throw warning when called without + * an active effect. + */ +export declare function onEffectCleanup(fn: () => void, failSilently?: boolean): void; + +declare const ComputedRefSymbol: unique symbol; +declare const WritableComputedRefSymbol: unique symbol; +interface BaseComputedRef<T, S = T> extends Ref<T, S> { + [ComputedRefSymbol]: true; + /** + * @deprecated computed no longer uses effect + */ + effect: ComputedRefImpl; +} +export interface ComputedRef<T = any> extends BaseComputedRef<T> { + readonly value: T; +} +export interface WritableComputedRef<T, S = T> extends BaseComputedRef<T, S> { + [WritableComputedRefSymbol]: true; +} +export type ComputedGetter<T> = (oldValue?: T) => T; +export type ComputedSetter<T> = (newValue: T) => void; +export interface WritableComputedOptions<T, S = T> { + get: ComputedGetter<T>; + set: ComputedSetter<S>; +} +/** + * @private exported by @vue/reactivity for Vue core use, but not exported from + * the main vue package + */ +export declare class ComputedRefImpl<T = any> implements Subscriber { + fn: ComputedGetter<T>; + private readonly setter; + effect: this; + onTrack?: (event: DebuggerEvent) => void; + onTrigger?: (event: DebuggerEvent) => void; + constructor(fn: ComputedGetter<T>, setter: ComputedSetter<T> | undefined, isSSR: boolean); + get value(): T; + set value(newValue: T); +} +/** + * Takes a getter function and returns a readonly reactive ref object for the + * returned value from the getter. It can also take an object with get and set + * functions to create a writable ref object. + * + * @example + * ```js + * // Creating a readonly computed ref: + * const count = ref(1) + * const plusOne = computed(() => count.value + 1) + * + * console.log(plusOne.value) // 2 + * plusOne.value++ // error + * ``` + * + * ```js + * // Creating a writable computed ref: + * const count = ref(1) + * const plusOne = computed({ + * get: () => count.value + 1, + * set: (val) => { + * count.value = val - 1 + * } + * }) + * + * plusOne.value = 1 + * console.log(count.value) // 0 + * ``` + * + * @param getter - Function that produces the next value. + * @param debugOptions - For debugging. See {@link https://vuejs.org/guide/extras/reactivity-in-depth.html#computed-debugging}. + * @see {@link https://vuejs.org/api/reactivity-core.html#computed} + */ +export declare function computed<T>(getter: ComputedGetter<T>, debugOptions?: DebuggerOptions): ComputedRef<T>; +export declare function computed<T, S = T>(options: WritableComputedOptions<T, S>, debugOptions?: DebuggerOptions): WritableComputedRef<T, S>; + +declare const RefSymbol: unique symbol; +declare const RawSymbol: unique symbol; +export interface Ref<T = any, S = T> { + get value(): T; + set value(_: S); + /** + * Type differentiator only. + * We need this to be in public d.ts but don't want it to show up in IDE + * autocomplete, so we use a private Symbol instead. + */ + [RefSymbol]: true; +} +/** + * Checks if a value is a ref object. + * + * @param r - The value to inspect. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#isref} + */ +export declare function isRef<T>(r: Ref<T> | unknown): r is Ref<T>; +/** + * Takes an inner value and returns a reactive and mutable ref object, which + * has a single property `.value` that points to the inner value. + * + * @param value - The object to wrap in the ref. + * @see {@link https://vuejs.org/api/reactivity-core.html#ref} + */ +export declare function ref<T>(value: T): [T] extends [Ref] ? IfAny<T, Ref<T>, T> : Ref<UnwrapRef<T>, UnwrapRef<T> | T>; +export declare function ref<T = any>(): Ref<T | undefined>; +declare const ShallowRefMarker: unique symbol; +export type ShallowRef<T = any, S = T> = Ref<T, S> & { + [ShallowRefMarker]?: true; +}; +/** + * Shallow version of {@link ref()}. + * + * @example + * ```js + * const state = shallowRef({ count: 1 }) + * + * // does NOT trigger change + * state.value.count = 2 + * + * // does trigger change + * state.value = { count: 2 } + * ``` + * + * @param value - The "inner value" for the shallow ref. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowref} + */ +export declare function shallowRef<T>(value: T): Ref extends T ? T extends Ref ? IfAny<T, ShallowRef<T>, T> : ShallowRef<T> : ShallowRef<T>; +export declare function shallowRef<T = any>(): ShallowRef<T | undefined>; +/** + * Force trigger effects that depends on a shallow ref. This is typically used + * after making deep mutations to the inner value of a shallow ref. + * + * @example + * ```js + * const shallow = shallowRef({ + * greet: 'Hello, world' + * }) + * + * // Logs "Hello, world" once for the first run-through + * watchEffect(() => { + * console.log(shallow.value.greet) + * }) + * + * // This won't trigger the effect because the ref is shallow + * shallow.value.greet = 'Hello, universe' + * + * // Logs "Hello, universe" + * triggerRef(shallow) + * ``` + * + * @param ref - The ref whose tied effects shall be executed. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#triggerref} + */ +export declare function triggerRef(ref: Ref): void; +export type MaybeRef<T = any> = T | Ref<T> | ShallowRef<T> | WritableComputedRef<T>; +export type MaybeRefOrGetter<T = any> = MaybeRef<T> | ComputedRef<T> | (() => T); +/** + * Returns the inner value if the argument is a ref, otherwise return the + * argument itself. This is a sugar function for + * `val = isRef(val) ? val.value : val`. + * + * @example + * ```js + * function useFoo(x: number | Ref<number>) { + * const unwrapped = unref(x) + * // unwrapped is guaranteed to be number now + * } + * ``` + * + * @param ref - Ref or plain value to be converted into the plain value. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#unref} + */ +export declare function unref<T>(ref: MaybeRef<T> | ComputedRef<T>): T; +/** + * Normalizes values / refs / getters to values. + * This is similar to {@link unref()}, except that it also normalizes getters. + * If the argument is a getter, it will be invoked and its return value will + * be returned. + * + * @example + * ```js + * toValue(1) // 1 + * toValue(ref(1)) // 1 + * toValue(() => 1) // 1 + * ``` + * + * @param source - A getter, an existing ref, or a non-function value. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#tovalue} + */ +export declare function toValue<T>(source: MaybeRefOrGetter<T>): T; +/** + * Returns a proxy for the given object that shallowly unwraps properties that + * are refs. If the object already is reactive, it's returned as-is. If not, a + * new reactive proxy is created. + * + * @param objectWithRefs - Either an already-reactive object or a simple object + * that contains refs. + */ +export declare function proxyRefs<T extends object>(objectWithRefs: T): ShallowUnwrapRef<T>; +export type CustomRefFactory<T> = (track: () => void, trigger: () => void) => { + get: () => T; + set: (value: T) => void; +}; +/** + * Creates a customized ref with explicit control over its dependency tracking + * and updates triggering. + * + * @param factory - The function that receives the `track` and `trigger` callbacks. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#customref} + */ +export declare function customRef<T>(factory: CustomRefFactory<T>): Ref<T>; +export type ToRefs<T = any> = { + [K in keyof T]: ToRef<T[K]>; +}; +/** + * Converts a reactive object to a plain object where each property of the + * resulting object is a ref pointing to the corresponding property of the + * original object. Each individual ref is created using {@link toRef()}. + * + * @param object - Reactive object to be made into an object of linked refs. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs} + */ +export declare function toRefs<T extends object>(object: T): ToRefs<T>; +export type ToRef<T> = IfAny<T, Ref<T>, [T] extends [Ref] ? T : Ref<T>>; +/** + * Used to normalize values / refs / getters into refs. + * + * @example + * ```js + * // returns existing refs as-is + * toRef(existingRef) + * + * // creates a ref that calls the getter on .value access + * toRef(() => props.foo) + * + * // creates normal refs from non-function values + * // equivalent to ref(1) + * toRef(1) + * ``` + * + * Can also be used to create a ref for a property on a source reactive object. + * The created ref is synced with its source property: mutating the source + * property will update the ref, and vice-versa. + * + * @example + * ```js + * const state = reactive({ + * foo: 1, + * bar: 2 + * }) + * + * const fooRef = toRef(state, 'foo') + * + * // mutating the ref updates the original + * fooRef.value++ + * console.log(state.foo) // 2 + * + * // mutating the original also updates the ref + * state.foo++ + * console.log(fooRef.value) // 3 + * ``` + * + * @param source - A getter, an existing ref, a non-function value, or a + * reactive object to create a property ref from. + * @param [key] - (optional) Name of the property in the reactive object. + * @see {@link https://vuejs.org/api/reactivity-utilities.html#toref} + */ +export declare function toRef<T>(value: T): T extends () => infer R ? Readonly<Ref<R>> : T extends Ref ? T : Ref<UnwrapRef<T>>; +export declare function toRef<T extends object, K extends keyof T>(object: T, key: K): ToRef<T[K]>; +export declare function toRef<T extends object, K extends keyof T>(object: T, key: K, defaultValue: T[K]): ToRef<Exclude<T[K], undefined>>; +/** + * This is a special exported interface for other packages to declare + * additional types that should bail out for ref unwrapping. For example + * \@vue/runtime-dom can declare it like so in its d.ts: + * + * ``` ts + * declare module '@vue/reactivity' { + * export interface RefUnwrapBailTypes { + * runtimeDOMBailTypes: Node | Window + * } + * } + * ``` + */ +export interface RefUnwrapBailTypes { +} +export type ShallowUnwrapRef<T> = { + [K in keyof T]: DistributeRef<T[K]>; +}; +type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T; +export type UnwrapRef<T> = T extends ShallowRef<infer V, unknown> ? V : T extends Ref<infer V, unknown> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>; +type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | { + [RawSymbol]?: true; +} ? T : T extends Map<infer K, infer V> ? Map<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Map<any, any>>> : T extends WeakMap<infer K, infer V> ? WeakMap<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakMap<any, any>>> : T extends Set<infer V> ? Set<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Set<any>>> : T extends WeakSet<infer V> ? WeakSet<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakSet<any>>> : T extends ReadonlyArray<any> ? { + [K in keyof T]: UnwrapRefSimple<T[K]>; +} : T extends object & { + [ShallowReactiveMarker]?: never; +} ? { + [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>; +} : T; + +export declare const ITERATE_KEY: unique symbol; +export declare const MAP_KEY_ITERATE_KEY: unique symbol; +export declare const ARRAY_ITERATE_KEY: unique symbol; +/** + * Tracks access to a reactive property. + * + * This will check which effect is running at the moment and record it as dep + * which records all effects that depend on the reactive property. + * + * @param target - Object holding the reactive property. + * @param type - Defines the type of access to the reactive property. + * @param key - Identifier of the reactive property to track. + */ +export declare function track(target: object, type: TrackOpTypes, key: unknown): void; +/** + * Finds all deps associated with the target (or a specific property) and + * triggers the effects stored within. + * + * @param target - The reactive object. + * @param type - Defines the type of the operation that needs to trigger effects. + * @param key - Can be used to target a specific reactive property in the target object. + */ +export declare function trigger(target: object, type: TriggerOpTypes, key?: unknown, newValue?: unknown, oldValue?: unknown, oldTarget?: Map<unknown, unknown> | Set<unknown>): void; + +export declare class EffectScope { + detached: boolean; + private _isPaused; + constructor(detached?: boolean); + get active(): boolean; + pause(): void; + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume(): void; + run<T>(fn: () => T): T | undefined; + stop(fromParent?: boolean): void; +} +/** + * Creates an effect scope object which can capture the reactive effects (i.e. + * computed and watchers) created within it so that these effects can be + * disposed together. For detailed use cases of this API, please consult its + * corresponding {@link https://github.com/vuejs/rfcs/blob/master/active-rfcs/0041-reactivity-effect-scope.md | RFC}. + * + * @param detached - Can be used to create a "detached" effect scope. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#effectscope} + */ +export declare function effectScope(detached?: boolean): EffectScope; +/** + * Returns the current active effect scope if there is one. + * + * @see {@link https://vuejs.org/api/reactivity-advanced.html#getcurrentscope} + */ +export declare function getCurrentScope(): EffectScope | undefined; +/** + * Registers a dispose callback on the current active effect scope. The + * callback will be invoked when the associated effect scope is stopped. + * + * @param fn - The callback function to attach to the scope's cleanup. + * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose} + */ +export declare function onScopeDispose(fn: () => void, failSilently?: boolean): void; + +/** + * Track array iteration and return: + * - if input is reactive: a cloned raw array with reactive values + * - if input is non-reactive or shallowReactive: the original raw array + */ +export declare function reactiveReadArray<T>(array: T[]): T[]; +/** + * Track array iteration and return raw array + */ +export declare function shallowReadArray<T>(arr: T[]): T[]; + +export declare enum WatchErrorCodes { + WATCH_GETTER = 2, + WATCH_CALLBACK = 3, + WATCH_CLEANUP = 4 +} +export type WatchEffect = (onCleanup: OnCleanup) => void; +export type WatchSource<T = any> = Ref<T, any> | ComputedRef<T> | (() => T); +export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any; +export type OnCleanup = (cleanupFn: () => void) => void; +export interface WatchOptions<Immediate = boolean> extends DebuggerOptions { + immediate?: Immediate; + deep?: boolean | number; + once?: boolean; + scheduler?: WatchScheduler; + onWarn?: (msg: string, ...args: any[]) => void; +} +export type WatchStopHandle = () => void; +export interface WatchHandle extends WatchStopHandle { + pause: () => void; + resume: () => void; + stop: () => void; +} +export type WatchScheduler = (job: () => void, isFirstRun: boolean) => void; +/** + * Returns the current active effect if there is one. + */ +export declare function getCurrentWatcher(): ReactiveEffect<any> | undefined; +/** + * Registers a cleanup callback on the current active effect. This + * registered cleanup callback will be invoked right before the + * associated effect re-runs. + * + * @param cleanupFn - The callback function to attach to the effect's cleanup. + * @param failSilently - if `true`, will not throw warning when called without + * an active effect. + * @param owner - The effect that this cleanup function should be attached to. + * By default, the current active effect. + */ +export declare function onWatcherCleanup(cleanupFn: () => void, failSilently?: boolean, owner?: ReactiveEffect | undefined): void; +export declare function watch(source: WatchSource | WatchSource[] | WatchEffect | object, cb?: WatchCallback | null, options?: WatchOptions): WatchHandle; +export declare function traverse(value: unknown, depth?: number, seen?: Set<unknown>): unknown; + diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.js new file mode 100644 index 0000000..ef30911 --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.js @@ -0,0 +1,1938 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const NOOP = () => { +}; +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty$1 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; + +function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} + +let activeSub; +const EffectFlags = { + "ACTIVE": 1, + "1": "ACTIVE", + "RUNNING": 2, + "2": "RUNNING", + "TRACKING": 4, + "4": "TRACKING", + "NOTIFIED": 8, + "8": "NOTIFIED", + "DIRTY": 16, + "16": "DIRTY", + "ALLOW_RECURSE": 32, + "32": "ALLOW_RECURSE", + "PAUSED": 64, + "64": "PAUSED" +}; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function onEffectCleanup(fn, failSilently = false) { + if (activeSub instanceof ReactiveEffect) { + activeSub.cleanup = fn; + } else if (!failSilently) { + warn( + `onEffectCleanup() was called when there was no active effect to associate with.` + ); + } +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + "Object iterate" +); +const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" +); +const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + warn( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => isObject(value) ? reactive(value) : value; +const toReadonly = (value) => isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } + } + } +} +function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } + } +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!isProxy(object)) { + warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn("Write operation failed: computed value is readonly"); + } + } +} +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; +} + +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw", + "IS_REF": "__v_isRef" +}; + +const WatchErrorCodes = { + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP" +}; +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +export { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch }; diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.prod.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.prod.js new file mode 100644 index 0000000..fc57b0a --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-browser.prod.js @@ -0,0 +1,5 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let e,t,i,s,r;let n={},l=()=>{},a=Object.assign,o=(e,t)=>{let i=e.indexOf(t);i>-1&&e.splice(i,1)},u=Object.prototype.hasOwnProperty,h=(e,t)=>u.call(e,t),c=Array.isArray,f=e=>"[object Map]"===R(e),p=e=>"[object Set]"===R(e),d=e=>"function"==typeof e,_=e=>"string"==typeof e,v=e=>"symbol"==typeof e,g=e=>null!==e&&"object"==typeof e,y=Object.prototype.toString,R=e=>y.call(e),b=e=>R(e).slice(8,-1),w=e=>"[object Object]"===R(e),S=e=>_(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,x=(e,t)=>!Object.is(e,t),E=(e,t,i,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:i})};class m{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=e,!t&&e&&(this.index=(e.scopes||(e.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(t){if(this._active){let i=e;try{return e=this,t()}finally{e=i}}}on(){e=this}off(){e=this.parent}stop(e){if(this._active){let t,i;for(t=0,this._active=!1,i=this.effects.length;t<i;t++)this.effects[t].stop();for(t=0,this.effects.length=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function T(e){return new m(e)}function k(){return e}function A(t,i=!1){e&&e.cleanups.push(t)}let D={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",PAUSED:64,64:"PAUSED"},O=new WeakSet;class I{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,e&&e.active&&e.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,O.has(this)&&(O.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||j(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,q(this),P(this);let e=t,i=U;t=this,U=!0;try{return this.fn()}finally{W(this),t=e,U=i,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)K(e);this.deps=this.depsTail=void 0,q(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?O.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){N(this)&&this.run()}get dirty(){return N(this)}}let L=0;function j(e,t=!1){if(e.flags|=8,t){e.next=s,s=e;return}e.next=i,i=e}function C(){let e;if(!(--L>0)){if(s){let e=s;for(s=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;i;){let t=i;for(i=void 0;t;){let i=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=i}}if(e)throw e}}function P(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function W(e){let t;let i=e.depsTail,s=i;for(;s;){let e=s.prevDep;-1===s.version?(s===i&&(i=e),K(s),function(e){let{prevDep:t,nextDep:i}=e;t&&(t.nextDep=i,e.prevDep=void 0),i&&(i.prevDep=t,e.nextDep=void 0)}(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=e}e.deps=t,e.depsTail=i}function N(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(V(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function V(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===J))return;e.globalVersion=J;let i=e.dep;if(e.flags|=2,i.version>0&&!e.isSSR&&e.deps&&!N(e)){e.flags&=-3;return}let s=t,r=U;t=e,U=!0;try{P(e);let t=e.fn(e._value);(0===i.version||x(t,e._value))&&(e._value=t,i.version++)}catch(e){throw i.version++,e}finally{t=s,U=r,W(e),e.flags&=-3}}function K(e,t=!1){let{dep:i,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),i.subs===e&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let e=i.computed.deps;e;e=e.nextDep)K(e,!0)}t||--i.sc||!i.map||i.map.delete(i.key)}function M(e,t){e.effect instanceof I&&(e=e.effect.fn);let i=new I(e);t&&a(i,t);try{i.run()}catch(e){throw i.stop(),e}let s=i.run.bind(i);return s.effect=i,s}function H(e){e.effect.stop()}let U=!0,Y=[];function G(){Y.push(U),U=!1}function F(){Y.push(U),U=!0}function z(){let e=Y.pop();U=void 0===e||e}function B(e,i=!1){t instanceof I&&(t.cleanup=e)}function q(e){let{cleanup:i}=e;if(e.cleanup=void 0,i){let e=t;t=void 0;try{i()}finally{t=e}}}let J=0;class Q{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class X{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!t||!U||t===this.computed)return;let i=this.activeLink;if(void 0===i||i.sub!==t)i=this.activeLink=new Q(t,this),t.deps?(i.prevDep=t.depsTail,t.depsTail.nextDep=i,t.depsTail=i):t.deps=t.depsTail=i,function e(t){if(t.dep.sc++,4&t.sub.flags){let i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let t=i.deps;t;t=t.nextDep)e(t)}let s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}(i);else if(-1===i.version&&(i.version=this.version,i.nextDep)){let e=i.nextDep;e.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=e),i.prevDep=t.depsTail,i.nextDep=void 0,t.depsTail.nextDep=i,t.depsTail=i,t.deps===i&&(t.deps=e)}return i}trigger(e){this.version++,J++,this.notify(e)}notify(e){L++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{C()}}}let Z=new WeakMap,$=Symbol(""),ee=Symbol(""),et=Symbol("");function ei(e,i,s){if(U&&t){let t=Z.get(e);t||Z.set(e,t=new Map);let i=t.get(s);i||(t.set(s,i=new X),i.map=t,i.key=s),i.track()}}function es(e,t,i,s,r,n){let l=Z.get(e);if(!l){J++;return}let a=e=>{e&&e.trigger()};if(L++,"clear"===t)l.forEach(a);else{let r=c(e),n=r&&S(i);if(r&&"length"===i){let e=Number(s);l.forEach((t,i)=>{("length"===i||i===et||!v(i)&&i>=e)&&a(t)})}else switch((void 0!==i||l.has(void 0))&&a(l.get(i)),n&&a(l.get(et)),t){case"add":r?n&&a(l.get("length")):(a(l.get($)),f(e)&&a(l.get(ee)));break;case"delete":!r&&(a(l.get($)),f(e)&&a(l.get(ee)));break;case"set":f(e)&&a(l.get($))}}C()}function er(e){let t=eG(e);return t===e?t:(ei(t,"iterate",et),eU(e)?t:t.map(ez))}function en(e){return ei(e=eG(e),"iterate",et),e}let el={__proto__:null,[Symbol.iterator](){return ea(this,Symbol.iterator,ez)},concat(...e){return er(this).concat(...e.map(e=>c(e)?er(e):e))},entries(){return ea(this,"entries",e=>(e[1]=ez(e[1]),e))},every(e,t){return eu(this,"every",e,t,void 0,arguments)},filter(e,t){return eu(this,"filter",e,t,e=>e.map(ez),arguments)},find(e,t){return eu(this,"find",e,t,ez,arguments)},findIndex(e,t){return eu(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eu(this,"findLast",e,t,ez,arguments)},findLastIndex(e,t){return eu(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eu(this,"forEach",e,t,void 0,arguments)},includes(...e){return ec(this,"includes",e)},indexOf(...e){return ec(this,"indexOf",e)},join(e){return er(this).join(e)},lastIndexOf(...e){return ec(this,"lastIndexOf",e)},map(e,t){return eu(this,"map",e,t,void 0,arguments)},pop(){return ef(this,"pop")},push(...e){return ef(this,"push",e)},reduce(e,...t){return eh(this,"reduce",e,t)},reduceRight(e,...t){return eh(this,"reduceRight",e,t)},shift(){return ef(this,"shift")},some(e,t){return eu(this,"some",e,t,void 0,arguments)},splice(...e){return ef(this,"splice",e)},toReversed(){return er(this).toReversed()},toSorted(e){return er(this).toSorted(e)},toSpliced(...e){return er(this).toSpliced(...e)},unshift(...e){return ef(this,"unshift",e)},values(){return ea(this,"values",ez)}};function ea(e,t,i){let s=en(e),r=s[t]();return s===e||eU(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=i(e.value)),e}),r}let eo=Array.prototype;function eu(e,t,i,s,r,n){let l=en(e),a=l!==e&&!eU(e),o=l[t];if(o!==eo[t]){let t=o.apply(e,n);return a?ez(t):t}let u=i;l!==e&&(a?u=function(t,s){return i.call(this,ez(t),s,e)}:i.length>2&&(u=function(t,s){return i.call(this,t,s,e)}));let h=o.call(l,u,s);return a&&r?r(h):h}function eh(e,t,i,s){let r=en(e),n=i;return r!==e&&(eU(e)?i.length>3&&(n=function(t,s,r){return i.call(this,t,s,r,e)}):n=function(t,s,r){return i.call(this,t,ez(s),r,e)}),r[t](n,...s)}function ec(e,t,i){let s=eG(e);ei(s,"iterate",et);let r=s[t](...i);return(-1===r||!1===r)&&eY(i[0])?(i[0]=eG(i[0]),s[t](...i)):r}function ef(e,t,i=[]){G(),L++;let s=eG(e)[t].apply(e,i);return C(),z(),s}let ep=function(e){let t=Object.create(null);for(let i of e.split(","))t[i]=1;return e=>e in t}("__proto__,__v_isRef,__isVue"),ed=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(v));function e_(e){v(e)||(e=String(e));let t=eG(this);return ei(t,"has",e),t.hasOwnProperty(e)}class ev{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if("__v_skip"===t)return e.__v_skip;let s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return i===(s?r?eC:ej:r?eL:eI).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;let n=c(e);if(!s){let e;if(n&&(e=el[t]))return e;if("hasOwnProperty"===t)return e_}let l=Reflect.get(e,t,eq(e)?e:i);return(v(t)?ed.has(t):ep(t))?l:(s||ei(e,"get",t),r)?l:eq(l)?n&&S(t)?l:l.value:g(l)?s?eN(l):eP(l):l}}class eg extends ev{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){let t=eH(r);if(eU(i)||eH(i)||(r=eG(r),i=eG(i)),!c(e)&&eq(r)&&!eq(i))return!t&&(r.value=i,!0)}let n=c(e)&&S(t)?Number(t)<e.length:h(e,t),l=Reflect.set(e,t,i,eq(e)?e:s);return e===eG(s)&&(n?x(i,r)&&es(e,"set",t,i):es(e,"add",t,i)),l}deleteProperty(e,t){let i=h(e,t);e[t];let s=Reflect.deleteProperty(e,t);return s&&i&&es(e,"delete",t,void 0),s}has(e,t){let i=Reflect.has(e,t);return v(t)&&ed.has(t)||ei(e,"has",t),i}ownKeys(e){return ei(e,"iterate",c(e)?"length":$),Reflect.ownKeys(e)}}class ey extends ev{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}let eR=new eg,eb=new ey,ew=new eg(!0),eS=new ey(!0),ex=e=>e,eE=e=>Reflect.getPrototypeOf(e);function em(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function eT(e,t){let i=function(e,t){let i={get(i){let s=this.__v_raw,r=eG(s),n=eG(i);e||(x(i,n)&&ei(r,"get",i),ei(r,"get",n));let{has:l}=eE(r),a=t?ex:e?eB:ez;return l.call(r,i)?a(s.get(i)):l.call(r,n)?a(s.get(n)):void(s!==r&&s.get(i))},get size(){let t=this.__v_raw;return e||ei(eG(t),"iterate",$),Reflect.get(t,"size",t)},has(t){let i=this.__v_raw,s=eG(i),r=eG(t);return e||(x(t,r)&&ei(s,"has",t),ei(s,"has",r)),t===r?i.has(t):i.has(t)||i.has(r)},forEach(i,s){let r=this,n=r.__v_raw,l=eG(n),a=t?ex:e?eB:ez;return e||ei(l,"iterate",$),n.forEach((e,t)=>i.call(s,a(e),a(t),r))}};return a(i,e?{add:em("add"),set:em("set"),delete:em("delete"),clear:em("clear")}:{add(e){t||eU(e)||eH(e)||(e=eG(e));let i=eG(this);return eE(i).has.call(i,e)||(i.add(e),es(i,"add",e,e)),this},set(e,i){t||eU(i)||eH(i)||(i=eG(i));let s=eG(this),{has:r,get:n}=eE(s),l=r.call(s,e);l||(e=eG(e),l=r.call(s,e));let a=n.call(s,e);return s.set(e,i),l?x(i,a)&&es(s,"set",e,i):es(s,"add",e,i),this},delete(e){let t=eG(this),{has:i,get:s}=eE(t),r=i.call(t,e);r||(e=eG(e),r=i.call(t,e)),s&&s.call(t,e);let n=t.delete(e);return r&&es(t,"delete",e,void 0),n},clear(){let e=eG(this),t=0!==e.size,i=e.clear();return t&&es(e,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=function(...i){let r=this.__v_raw,n=eG(r),l=f(n),a="entries"===s||s===Symbol.iterator&&l,o=r[s](...i),u=t?ex:e?eB:ez;return e||ei(n,"iterate","keys"===s&&l?ee:$),{next(){let{value:e,done:t}=o.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),i}(e,t);return(t,s,r)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(h(i,s)&&s in t?i:t,s,r)}let ek={get:eT(!1,!1)},eA={get:eT(!1,!0)},eD={get:eT(!0,!1)},eO={get:eT(!0,!0)},eI=new WeakMap,eL=new WeakMap,ej=new WeakMap,eC=new WeakMap;function eP(e){return eH(e)?e:eK(e,!1,eR,ek,eI)}function eW(e){return eK(e,!1,ew,eA,eL)}function eN(e){return eK(e,!0,eb,eD,ej)}function eV(e){return eK(e,!0,eS,eO,eC)}function eK(e,t,i,s,r){if(!g(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let n=r.get(e);if(n)return n;let l=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(b(e));if(0===l)return e;let a=new Proxy(e,2===l?s:i);return r.set(e,a),a}function eM(e){return eH(e)?eM(e.__v_raw):!!(e&&e.__v_isReactive)}function eH(e){return!!(e&&e.__v_isReadonly)}function eU(e){return!!(e&&e.__v_isShallow)}function eY(e){return!!e&&!!e.__v_raw}function eG(e){let t=e&&e.__v_raw;return t?eG(t):e}function eF(e){return!h(e,"__v_skip")&&Object.isExtensible(e)&&E(e,"__v_skip",!0),e}let ez=e=>g(e)?eP(e):e,eB=e=>g(e)?eN(e):e;function eq(e){return!!e&&!0===e.__v_isRef}function eJ(e){return eX(e,!1)}function eQ(e){return eX(e,!0)}function eX(e,t){return eq(e)?e:new eZ(e,t)}class eZ{constructor(e,t){this.dep=new X,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:eG(e),this._value=t?e:ez(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,i=this.__v_isShallow||eU(e)||eH(e);x(e=i?e:eG(e),t)&&(this._rawValue=e,this._value=i?e:ez(e),this.dep.trigger())}}function e$(e){e.dep&&e.dep.trigger()}function e0(e){return eq(e)?e.value:e}function e1(e){return d(e)?e():e0(e)}let e2={get:(e,t,i)=>"__v_raw"===t?e:e0(Reflect.get(e,t,i)),set:(e,t,i,s)=>{let r=e[t];return eq(r)&&!eq(i)?(r.value=i,!0):Reflect.set(e,t,i,s)}};function e4(e){return eM(e)?e:new Proxy(e,e2)}class e3{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new X,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function e6(e){return new e3(e)}function e8(e){let t=c(e)?Array(e.length):{};for(let i in e)t[i]=te(e,i);return t}class e5{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let i=Z.get(e);return i&&i.get(t)}(eG(this._object),this._key)}}class e9{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function e7(e,t,i){return eq(e)?e:d(e)?new e9(e):g(e)&&arguments.length>1?te(e,t,i):eJ(e)}function te(e,t,i){let s=e[t];return eq(s)?s:new e5(e,t,i)}class tt{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new X(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=J-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(8&this.flags)&&t!==this)return j(this,!0),!0}get value(){let e=this.dep.track();return V(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ti(e,t,i=!1){let s,r;return d(e)?s=e:(s=e.get,r=e.set),new tt(s,r,i)}let ts={GET:"get",HAS:"has",ITERATE:"iterate"},tr={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tn={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw",IS_REF:"__v_isRef"},tl={WATCH_GETTER:2,2:"WATCH_GETTER",WATCH_CALLBACK:3,3:"WATCH_CALLBACK",WATCH_CLEANUP:4,4:"WATCH_CLEANUP"},ta={},to=new WeakMap;function tu(){return r}function th(e,t=!1,i=r){if(i){let t=to.get(i);t||to.set(i,t=[]),t.push(e)}}function tc(e,t,i=n){let s,a,u,h;let{immediate:f,deep:p,once:_,scheduler:v,augmentJob:g,call:y}=i,R=e=>p?e:eU(e)||!1===p||0===p?tf(e,1):tf(e),b=!1,w=!1;if(eq(e)?(a=()=>e.value,b=eU(e)):eM(e)?(a=()=>R(e),b=!0):c(e)?(w=!0,b=e.some(e=>eM(e)||eU(e)),a=()=>e.map(e=>eq(e)?e.value:eM(e)?R(e):d(e)?y?y(e,2):e():void 0)):a=d(e)?t?y?()=>y(e,2):e:()=>{if(u){G();try{u()}finally{z()}}let t=r;r=s;try{return y?y(e,3,[h]):e(h)}finally{r=t}}:l,t&&p){let e=a,t=!0===p?1/0:p;a=()=>tf(e(),t)}let S=k(),E=()=>{s.stop(),S&&S.active&&o(S.effects,s)};if(_&&t){let e=t;t=(...t)=>{e(...t),E()}}let m=w?Array(e.length).fill(ta):ta,T=e=>{if(1&s.flags&&(s.dirty||e)){if(t){let e=s.run();if(p||b||(w?e.some((e,t)=>x(e,m[t])):x(e,m))){u&&u();let i=r;r=s;try{let i=[e,m===ta?void 0:w&&m[0]===ta?[]:m,h];y?y(t,3,i):t(...i),m=e}finally{r=i}}}else s.run()}};return g&&g(T),(s=new I(a)).scheduler=v?()=>v(T,!1):T,h=e=>th(e,!1,s),u=s.onStop=()=>{let e=to.get(s);if(e){if(y)y(e,4);else for(let t of e)t();to.delete(s)}},t?f?T(!0):m=s.run():v?v(T.bind(null,!0),!0):s.run(),E.pause=s.pause.bind(s),E.resume=s.resume.bind(s),E.stop=E,E}function tf(e,t=1/0,i){if(t<=0||!g(e)||e.__v_skip||(i=i||new Set).has(e))return e;if(i.add(e),t--,eq(e))tf(e.value,t,i);else if(c(e))for(let s=0;s<e.length;s++)tf(e[s],t,i);else if(p(e)||f(e))e.forEach(e=>{tf(e,t,i)});else if(w(e)){for(let s in e)tf(e[s],t,i);for(let s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&tf(e[s],t,i)}return e}export{et as ARRAY_ITERATE_KEY,D as EffectFlags,m as EffectScope,$ as ITERATE_KEY,ee as MAP_KEY_ITERATE_KEY,I as ReactiveEffect,tn as ReactiveFlags,ts as TrackOpTypes,tr as TriggerOpTypes,tl as WatchErrorCodes,ti as computed,e6 as customRef,M as effect,T as effectScope,F as enableTracking,k as getCurrentScope,tu as getCurrentWatcher,eY as isProxy,eM as isReactive,eH as isReadonly,eq as isRef,eU as isShallow,eF as markRaw,B as onEffectCleanup,A as onScopeDispose,th as onWatcherCleanup,G as pauseTracking,e4 as proxyRefs,eP as reactive,er as reactiveReadArray,eN as readonly,eJ as ref,z as resetTracking,eW as shallowReactive,en as shallowReadArray,eV as shallowReadonly,eQ as shallowRef,H as stop,eG as toRaw,ez as toReactive,eB as toReadonly,e7 as toRef,e8 as toRefs,e1 as toValue,ei as track,tf as traverse,es as trigger,e$ as triggerRef,e0 as unref,tc as watch}; diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js new file mode 100644 index 0000000..8f8a91b --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js @@ -0,0 +1,1896 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { hasChanged, extend, isArray, isIntegerKey, isSymbol, isMap, hasOwn, isObject, makeMap, toRawType, capitalize, def, isFunction, EMPTY_OBJ, isSet, isPlainObject, NOOP, remove } from '@vue/shared'; + +function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!!(process.env.NODE_ENV !== "production") && !failSilently) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} + +let activeSub; +const EffectFlags = { + "ACTIVE": 1, + "1": "ACTIVE", + "RUNNING": 2, + "2": "RUNNING", + "TRACKING": 4, + "4": "TRACKING", + "NOTIFIED": 8, + "8": "NOTIFIED", + "DIRTY": 16, + "16": "DIRTY", + "ALLOW_RECURSE": 32, + "32": "ALLOW_RECURSE", + "PAUSED": 64, + "64": "PAUSED" +}; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (!!(process.env.NODE_ENV !== "production") && activeSub !== this) { + warn( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function onEffectCleanup(fn, failSilently = false) { + if (activeSub instanceof ReactiveEffect) { + activeSub.cleanup = fn; + } else if (!!(process.env.NODE_ENV !== "production") && !failSilently) { + warn( + `onEffectCleanup() was called when there was no active effect to associate with.` + ); + } +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + if (!!(process.env.NODE_ENV !== "production")) { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (!!(process.env.NODE_ENV !== "production") && activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (!!(process.env.NODE_ENV !== "production")) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + !!(process.env.NODE_ENV !== "production") ? "Object iterate" : "" +); +const MAP_KEY_ITERATE_KEY = Symbol( + !!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "" +); +const ARRAY_ITERATE_KEY = Symbol( + !!(process.env.NODE_ENV !== "production") ? "Array iterate" : "" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + if (!!(process.env.NODE_ENV !== "production")) { + dep.track({ + target, + type, + key + }); + } else { + dep.track(); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + if (!!(process.env.NODE_ENV !== "production")) { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } else { + dep.trigger(); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + if (!!(process.env.NODE_ENV !== "production")) { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + if (!!(process.env.NODE_ENV !== "production")) { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + if (!!(process.env.NODE_ENV !== "production")) { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else if (!!(process.env.NODE_ENV !== "production")) { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else if (!!(process.env.NODE_ENV !== "production")) { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + if (!!(process.env.NODE_ENV !== "production")) { + warn( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => isObject(value) ? reactive(value) : value; +const toReadonly = (value) => isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + if (!!(process.env.NODE_ENV !== "production")) { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } else { + this.dep.track(); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + if (!!(process.env.NODE_ENV !== "production")) { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } else { + this.dep.trigger(); + } + } + } +} +function triggerRef(ref2) { + if (ref2.dep) { + if (!!(process.env.NODE_ENV !== "production")) { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } else { + ref2.dep.trigger(); + } + } +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!!(process.env.NODE_ENV !== "production") && !isProxy(object)) { + warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } else if (!!(process.env.NODE_ENV !== "production")) ; + } + get value() { + const link = !!(process.env.NODE_ENV !== "production") ? this.dep.track({ + target: this, + type: "get", + key: "value" + }) : this.dep.track(); + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn("Write operation failed: computed value is readonly"); + } + } +} +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; +} + +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw", + "IS_REF": "__v_isRef" +}; + +const WatchErrorCodes = { + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP" +}; +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!!(process.env.NODE_ENV !== "production") && !failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + !!(process.env.NODE_ENV !== "production") && warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + !!(process.env.NODE_ENV !== "production") && warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + if (!!(process.env.NODE_ENV !== "production")) { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +export { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch }; diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.js new file mode 100644 index 0000000..c6d17c1 --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.js @@ -0,0 +1,1994 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +var VueReactivity = (function (exports) { + 'use strict'; + + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; + } + + const EMPTY_OBJ = Object.freeze({}) ; + const NOOP = () => { + }; + const extend = Object.assign; + const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } + }; + const hasOwnProperty$1 = Object.prototype.hasOwnProperty; + const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); + const isArray = Array.isArray; + const isMap = (val) => toTypeString(val) === "[object Map]"; + const isSet = (val) => toTypeString(val) === "[object Set]"; + const isFunction = (val) => typeof val === "function"; + const isString = (val) => typeof val === "string"; + const isSymbol = (val) => typeof val === "symbol"; + const isObject = (val) => val !== null && typeof val === "object"; + const objectToString = Object.prototype.toString; + const toTypeString = (value) => objectToString.call(value); + const toRawType = (value) => { + return toTypeString(value).slice(8, -1); + }; + const isPlainObject = (val) => toTypeString(val) === "[object Object]"; + const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; + const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; + }; + const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); + }); + const hasChanged = (value, oldValue) => !Object.is(value, oldValue); + const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); + }; + + function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); + } + + let activeEffectScope; + class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } + } + function effectScope(detached) { + return new EffectScope(detached); + } + function getCurrentScope() { + return activeEffectScope; + } + function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } + } + + let activeSub; + const EffectFlags = { + "ACTIVE": 1, + "1": "ACTIVE", + "RUNNING": 2, + "2": "RUNNING", + "TRACKING": 4, + "4": "TRACKING", + "NOTIFIED": 8, + "8": "NOTIFIED", + "DIRTY": 16, + "16": "DIRTY", + "ALLOW_RECURSE": 32, + "32": "ALLOW_RECURSE", + "PAUSED": 64, + "64": "PAUSED" + }; + const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); + class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } + } + let batchDepth = 0; + let batchedSub; + let batchedComputed; + function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; + } + function startBatch() { + batchDepth++; + } + function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; + } + function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } + } + function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; + } + function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; + } + function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } + } + function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } + } + function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } + } + function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; + } + function stop(runner) { + runner.effect.stop(); + } + let shouldTrack = true; + const trackStack = []; + function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; + } + function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; + } + function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; + } + function onEffectCleanup(fn, failSilently = false) { + if (activeSub instanceof ReactiveEffect) { + activeSub.cleanup = fn; + } else if (!failSilently) { + warn( + `onEffectCleanup() was called when there was no active effect to associate with.` + ); + } + } + function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } + } + + let globalVersion = 0; + class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } + } + class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } + } + function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } + } + const targetMap = /* @__PURE__ */ new WeakMap(); + const ITERATE_KEY = Symbol( + "Object iterate" + ); + const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" + ); + const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" + ); + function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } + } + function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); + } + function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); + } + + function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); + } + function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; + } + const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } + }; + function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; + } + const arrayProto = Array.prototype; + function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; + } + function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); + } + function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; + } + function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; + } + + const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); + const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) + ); + function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); + } + class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } + } + class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } + } + class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + } + const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); + const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); + const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); + const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + + const toShallow = (value) => value; + const getProto = (v) => Reflect.getPrototypeOf(v); + function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; + } + function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; + } + function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; + } + function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; + } + const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) + }; + const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) + }; + const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) + }; + const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) + }; + function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } + } + + const reactiveMap = /* @__PURE__ */ new WeakMap(); + const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); + const readonlyMap = /* @__PURE__ */ new WeakMap(); + const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); + function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } + } + function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); + } + function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); + } + function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); + } + function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); + } + function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); + } + function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + warn( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; + } + function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); + } + function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); + } + function isShallow(value) { + return !!(value && value["__v_isShallow"]); + } + function isProxy(value) { + return value ? !!value["__v_raw"] : false; + } + function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; + } + function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; + } + const toReactive = (value) => isObject(value) ? reactive(value) : value; + const toReadonly = (value) => isObject(value) ? readonly(value) : value; + + function isRef(r) { + return r ? r["__v_isRef"] === true : false; + } + function ref(value) { + return createRef(value, false); + } + function shallowRef(value) { + return createRef(value, true); + } + function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); + } + class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } + } + } + } + function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } + } + } + function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; + } + function toValue(source) { + return isFunction(source) ? source() : unref(source); + } + const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } + }; + function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); + } + class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } + } + function customRef(factory) { + return new CustomRefImpl(factory); + } + function toRefs(object) { + if (!isProxy(object)) { + warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; + } + class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } + } + class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } + } + function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } + } + function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); + } + + class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn("Write operation failed: computed value is readonly"); + } + } + } + function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; + } + + const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" + }; + const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" + }; + const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw", + "IS_REF": "__v_isRef" + }; + + const WatchErrorCodes = { + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP" + }; + const INITIAL_WATCHER_VALUE = {}; + const cleanupMap = /* @__PURE__ */ new WeakMap(); + let activeWatcher = void 0; + function getCurrentWatcher() { + return activeWatcher; + } + function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } + } + function watch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; + } + function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; + } + + exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY; + exports.EffectFlags = EffectFlags; + exports.EffectScope = EffectScope; + exports.ITERATE_KEY = ITERATE_KEY; + exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY; + exports.ReactiveEffect = ReactiveEffect; + exports.ReactiveFlags = ReactiveFlags; + exports.TrackOpTypes = TrackOpTypes; + exports.TriggerOpTypes = TriggerOpTypes; + exports.WatchErrorCodes = WatchErrorCodes; + exports.computed = computed; + exports.customRef = customRef; + exports.effect = effect; + exports.effectScope = effectScope; + exports.enableTracking = enableTracking; + exports.getCurrentScope = getCurrentScope; + exports.getCurrentWatcher = getCurrentWatcher; + exports.isProxy = isProxy; + exports.isReactive = isReactive; + exports.isReadonly = isReadonly; + exports.isRef = isRef; + exports.isShallow = isShallow; + exports.markRaw = markRaw; + exports.onEffectCleanup = onEffectCleanup; + exports.onScopeDispose = onScopeDispose; + exports.onWatcherCleanup = onWatcherCleanup; + exports.pauseTracking = pauseTracking; + exports.proxyRefs = proxyRefs; + exports.reactive = reactive; + exports.reactiveReadArray = reactiveReadArray; + exports.readonly = readonly; + exports.ref = ref; + exports.resetTracking = resetTracking; + exports.shallowReactive = shallowReactive; + exports.shallowReadArray = shallowReadArray; + exports.shallowReadonly = shallowReadonly; + exports.shallowRef = shallowRef; + exports.stop = stop; + exports.toRaw = toRaw; + exports.toReactive = toReactive; + exports.toReadonly = toReadonly; + exports.toRef = toRef; + exports.toRefs = toRefs; + exports.toValue = toValue; + exports.track = track; + exports.traverse = traverse; + exports.trigger = trigger; + exports.triggerRef = triggerRef; + exports.unref = unref; + exports.watch = watch; + + return exports; + +})({}); diff --git a/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.prod.js b/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.prod.js new file mode 100644 index 0000000..798e26f --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/dist/reactivity.global.prod.js @@ -0,0 +1,5 @@ +/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/var VueReactivity=function(e){"use strict";let t,i,s,r,n;let l={},a=()=>{},o=Object.assign,u=(e,t)=>{let i=e.indexOf(t);i>-1&&e.splice(i,1)},c=Object.prototype.hasOwnProperty,h=(e,t)=>c.call(e,t),f=Array.isArray,p=e=>"[object Map]"===b(e),d=e=>"[object Set]"===b(e),_=e=>"function"==typeof e,v=e=>"string"==typeof e,g=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,R=Object.prototype.toString,b=e=>R.call(e),w=e=>b(e).slice(8,-1),S=e=>"[object Object]"===b(e),E=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,x=(e,t)=>!Object.is(e,t),m=(e,t,i,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:i})};class T{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=t,!e&&t&&(this.index=(t.scopes||(t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let i=t;try{return t=this,e()}finally{t=i}}}on(){t=this}off(){t=this.parent}stop(e){if(this._active){let t,i;for(t=0,this._active=!1,i=this.effects.length;t<i;t++)this.effects[t].stop();for(t=0,this.effects.length=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}let k=new WeakSet;class A{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,t&&t.active&&t.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,k.has(this)&&(k.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||O(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,H(this),L(this);let e=i,t=N;i=this,N=!0;try{return this.fn()}finally{j(this),i=e,N=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)W(e);this.deps=this.depsTail=void 0,H(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?k.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){C(this)&&this.run()}get dirty(){return C(this)}}let D=0;function O(e,t=!1){if(e.flags|=8,t){e.next=r,r=e;return}e.next=s,s=e}function I(){let e;if(!(--D>0)){if(r){let e=r;for(r=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;s;){let t=s;for(s=void 0;t;){let i=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=i}}if(e)throw e}}function L(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function j(e){let t;let i=e.depsTail,s=i;for(;s;){let e=s.prevDep;-1===s.version?(s===i&&(i=e),W(s),function(e){let{prevDep:t,nextDep:i}=e;t&&(t.nextDep=i,e.prevDep=void 0),i&&(i.prevDep=t,e.nextDep=void 0)}(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=e}e.deps=t,e.depsTail=i}function C(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(P(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function P(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===U))return;e.globalVersion=U;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!C(e)){e.flags&=-3;return}let s=i,r=N;i=e,N=!0;try{L(e);let i=e.fn(e._value);(0===t.version||x(i,e._value))&&(e._value=i,t.version++)}catch(e){throw t.version++,e}finally{i=s,N=r,j(e),e.flags&=-3}}function W(e,t=!1){let{dep:i,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),i.subs===e&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let e=i.computed.deps;e;e=e.nextDep)W(e,!0)}t||--i.sc||!i.map||i.map.delete(i.key)}let N=!0,V=[];function K(){V.push(N),N=!1}function M(){let e=V.pop();N=void 0===e||e}function H(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=i;i=void 0;try{t()}finally{i=e}}}let U=0;class Y{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class G{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!i||!N||i===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==i)t=this.activeLink=new Y(i,this),i.deps?(t.prevDep=i.depsTail,i.depsTail.nextDep=t,i.depsTail=t):i.deps=i.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let t=i.deps;t;t=t.nextDep)e(t)}let s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=i.depsTail,t.nextDep=void 0,i.depsTail.nextDep=t,i.depsTail=t,i.deps===t&&(i.deps=e)}return t}trigger(e){this.version++,U++,this.notify(e)}notify(e){D++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{I()}}}let F=new WeakMap,z=Symbol(""),B=Symbol(""),q=Symbol("");function J(e,t,s){if(N&&i){let t=F.get(e);t||F.set(e,t=new Map);let i=t.get(s);i||(t.set(s,i=new G),i.map=t,i.key=s),i.track()}}function Q(e,t,i,s,r,n){let l=F.get(e);if(!l){U++;return}let a=e=>{e&&e.trigger()};if(D++,"clear"===t)l.forEach(a);else{let r=f(e),n=r&&E(i);if(r&&"length"===i){let e=Number(s);l.forEach((t,i)=>{("length"===i||i===q||!g(i)&&i>=e)&&a(t)})}else switch((void 0!==i||l.has(void 0))&&a(l.get(i)),n&&a(l.get(q)),t){case"add":r?n&&a(l.get("length")):(a(l.get(z)),p(e)&&a(l.get(B)));break;case"delete":!r&&(a(l.get(z)),p(e)&&a(l.get(B)));break;case"set":p(e)&&a(l.get(z))}}I()}function X(e){let t=eP(e);return t===e?t:(J(t,"iterate",q),ej(e)?t:t.map(eW))}function Z(e){return J(e=eP(e),"iterate",q),e}let $={__proto__:null,[Symbol.iterator](){return ee(this,Symbol.iterator,eW)},concat(...e){return X(this).concat(...e.map(e=>f(e)?X(e):e))},entries(){return ee(this,"entries",e=>(e[1]=eW(e[1]),e))},every(e,t){return ei(this,"every",e,t,void 0,arguments)},filter(e,t){return ei(this,"filter",e,t,e=>e.map(eW),arguments)},find(e,t){return ei(this,"find",e,t,eW,arguments)},findIndex(e,t){return ei(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ei(this,"findLast",e,t,eW,arguments)},findLastIndex(e,t){return ei(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ei(this,"forEach",e,t,void 0,arguments)},includes(...e){return er(this,"includes",e)},indexOf(...e){return er(this,"indexOf",e)},join(e){return X(this).join(e)},lastIndexOf(...e){return er(this,"lastIndexOf",e)},map(e,t){return ei(this,"map",e,t,void 0,arguments)},pop(){return en(this,"pop")},push(...e){return en(this,"push",e)},reduce(e,...t){return es(this,"reduce",e,t)},reduceRight(e,...t){return es(this,"reduceRight",e,t)},shift(){return en(this,"shift")},some(e,t){return ei(this,"some",e,t,void 0,arguments)},splice(...e){return en(this,"splice",e)},toReversed(){return X(this).toReversed()},toSorted(e){return X(this).toSorted(e)},toSpliced(...e){return X(this).toSpliced(...e)},unshift(...e){return en(this,"unshift",e)},values(){return ee(this,"values",eW)}};function ee(e,t,i){let s=Z(e),r=s[t]();return s===e||ej(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=i(e.value)),e}),r}let et=Array.prototype;function ei(e,t,i,s,r,n){let l=Z(e),a=l!==e&&!ej(e),o=l[t];if(o!==et[t]){let t=o.apply(e,n);return a?eW(t):t}let u=i;l!==e&&(a?u=function(t,s){return i.call(this,eW(t),s,e)}:i.length>2&&(u=function(t,s){return i.call(this,t,s,e)}));let c=o.call(l,u,s);return a&&r?r(c):c}function es(e,t,i,s){let r=Z(e),n=i;return r!==e&&(ej(e)?i.length>3&&(n=function(t,s,r){return i.call(this,t,s,r,e)}):n=function(t,s,r){return i.call(this,t,eW(s),r,e)}),r[t](n,...s)}function er(e,t,i){let s=eP(e);J(s,"iterate",q);let r=s[t](...i);return(-1===r||!1===r)&&eC(i[0])?(i[0]=eP(i[0]),s[t](...i)):r}function en(e,t,i=[]){K(),D++;let s=eP(e)[t].apply(e,i);return I(),M(),s}let el=function(e){let t=Object.create(null);for(let i of e.split(","))t[i]=1;return e=>e in t}("__proto__,__v_isRef,__isVue"),ea=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(g));function eo(e){g(e)||(e=String(e));let t=eP(this);return J(t,"has",e),t.hasOwnProperty(e)}class eu{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if("__v_skip"===t)return e.__v_skip;let s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return i===(s?r?ek:eT:r?em:ex).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;let n=f(e);if(!s){let e;if(n&&(e=$[t]))return e;if("hasOwnProperty"===t)return eo}let l=Reflect.get(e,t,eV(e)?e:i);return(g(t)?ea.has(t):el(t))?l:(s||J(e,"get",t),r)?l:eV(l)?n&&E(t)?l:l.value:y(l)?s?eD(l):eA(l):l}}class ec extends eu{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){let t=eL(r);if(ej(i)||eL(i)||(r=eP(r),i=eP(i)),!f(e)&&eV(r)&&!eV(i))return!t&&(r.value=i,!0)}let n=f(e)&&E(t)?Number(t)<e.length:h(e,t),l=Reflect.set(e,t,i,eV(e)?e:s);return e===eP(s)&&(n?x(i,r)&&Q(e,"set",t,i):Q(e,"add",t,i)),l}deleteProperty(e,t){let i=h(e,t);e[t];let s=Reflect.deleteProperty(e,t);return s&&i&&Q(e,"delete",t,void 0),s}has(e,t){let i=Reflect.has(e,t);return g(t)&&ea.has(t)||J(e,"has",t),i}ownKeys(e){return J(e,"iterate",f(e)?"length":z),Reflect.ownKeys(e)}}class eh extends eu{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}let ef=new ec,ep=new eh,ed=new ec(!0),e_=new eh(!0),ev=e=>e,eg=e=>Reflect.getPrototypeOf(e);function ey(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function eR(e,t){let i=function(e,t){let i={get(i){let s=this.__v_raw,r=eP(s),n=eP(i);e||(x(i,n)&&J(r,"get",i),J(r,"get",n));let{has:l}=eg(r),a=t?ev:e?eN:eW;return l.call(r,i)?a(s.get(i)):l.call(r,n)?a(s.get(n)):void(s!==r&&s.get(i))},get size(){let t=this.__v_raw;return e||J(eP(t),"iterate",z),Reflect.get(t,"size",t)},has(t){let i=this.__v_raw,s=eP(i),r=eP(t);return e||(x(t,r)&&J(s,"has",t),J(s,"has",r)),t===r?i.has(t):i.has(t)||i.has(r)},forEach(i,s){let r=this,n=r.__v_raw,l=eP(n),a=t?ev:e?eN:eW;return e||J(l,"iterate",z),n.forEach((e,t)=>i.call(s,a(e),a(t),r))}};return o(i,e?{add:ey("add"),set:ey("set"),delete:ey("delete"),clear:ey("clear")}:{add(e){t||ej(e)||eL(e)||(e=eP(e));let i=eP(this);return eg(i).has.call(i,e)||(i.add(e),Q(i,"add",e,e)),this},set(e,i){t||ej(i)||eL(i)||(i=eP(i));let s=eP(this),{has:r,get:n}=eg(s),l=r.call(s,e);l||(e=eP(e),l=r.call(s,e));let a=n.call(s,e);return s.set(e,i),l?x(i,a)&&Q(s,"set",e,i):Q(s,"add",e,i),this},delete(e){let t=eP(this),{has:i,get:s}=eg(t),r=i.call(t,e);r||(e=eP(e),r=i.call(t,e)),s&&s.call(t,e);let n=t.delete(e);return r&&Q(t,"delete",e,void 0),n},clear(){let e=eP(this),t=0!==e.size,i=e.clear();return t&&Q(e,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=function(...i){let r=this.__v_raw,n=eP(r),l=p(n),a="entries"===s||s===Symbol.iterator&&l,o=r[s](...i),u=t?ev:e?eN:eW;return e||J(n,"iterate","keys"===s&&l?B:z),{next(){let{value:e,done:t}=o.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),i}(e,t);return(t,s,r)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(h(i,s)&&s in t?i:t,s,r)}let eb={get:eR(!1,!1)},ew={get:eR(!1,!0)},eS={get:eR(!0,!1)},eE={get:eR(!0,!0)},ex=new WeakMap,em=new WeakMap,eT=new WeakMap,ek=new WeakMap;function eA(e){return eL(e)?e:eO(e,!1,ef,eb,ex)}function eD(e){return eO(e,!0,ep,eS,eT)}function eO(e,t,i,s,r){if(!y(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let n=r.get(e);if(n)return n;let l=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(w(e));if(0===l)return e;let a=new Proxy(e,2===l?s:i);return r.set(e,a),a}function eI(e){return eL(e)?eI(e.__v_raw):!!(e&&e.__v_isReactive)}function eL(e){return!!(e&&e.__v_isReadonly)}function ej(e){return!!(e&&e.__v_isShallow)}function eC(e){return!!e&&!!e.__v_raw}function eP(e){let t=e&&e.__v_raw;return t?eP(t):e}let eW=e=>y(e)?eA(e):e,eN=e=>y(e)?eD(e):e;function eV(e){return!!e&&!0===e.__v_isRef}function eK(e){return eM(e,!1)}function eM(e,t){return eV(e)?e:new eH(e,t)}class eH{constructor(e,t){this.dep=new G,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:eP(e),this._value=t?e:eW(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,i=this.__v_isShallow||ej(e)||eL(e);x(e=i?e:eP(e),t)&&(this._rawValue=e,this._value=i?e:eW(e),this.dep.trigger())}}function eU(e){return eV(e)?e.value:e}let eY={get:(e,t,i)=>"__v_raw"===t?e:eU(Reflect.get(e,t,i)),set:(e,t,i,s)=>{let r=e[t];return eV(r)&&!eV(i)?(r.value=i,!0):Reflect.set(e,t,i,s)}};class eG{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new G,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}class eF{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let i=F.get(e);return i&&i.get(t)}(eP(this._object),this._key)}}class ez{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function eB(e,t,i){let s=e[t];return eV(s)?s:new eF(e,t,i)}class eq{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new G(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=U-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(8&this.flags)&&i!==this)return O(this,!0),!0}get value(){let e=this.dep.track();return P(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let eJ={},eQ=new WeakMap;function eX(e,t=!1,i=n){if(i){let t=eQ.get(i);t||eQ.set(i,t=[]),t.push(e)}}function eZ(e,t=1/0,i){if(t<=0||!y(e)||e.__v_skip||(i=i||new Set).has(e))return e;if(i.add(e),t--,eV(e))eZ(e.value,t,i);else if(f(e))for(let s=0;s<e.length;s++)eZ(e[s],t,i);else if(d(e)||p(e))e.forEach(e=>{eZ(e,t,i)});else if(S(e)){for(let s in e)eZ(e[s],t,i);for(let s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&eZ(e[s],t,i)}return e}return e.ARRAY_ITERATE_KEY=q,e.EffectFlags={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",PAUSED:64,64:"PAUSED"},e.EffectScope=T,e.ITERATE_KEY=z,e.MAP_KEY_ITERATE_KEY=B,e.ReactiveEffect=A,e.ReactiveFlags={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw",IS_REF:"__v_isRef"},e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.WatchErrorCodes={WATCH_GETTER:2,2:"WATCH_GETTER",WATCH_CALLBACK:3,3:"WATCH_CALLBACK",WATCH_CLEANUP:4,4:"WATCH_CLEANUP"},e.computed=function(e,t,i=!1){let s,r;return _(e)?s=e:(s=e.get,r=e.set),new eq(s,r,i)},e.customRef=function(e){return new eG(e)},e.effect=function(e,t){e.effect instanceof A&&(e=e.effect.fn);let i=new A(e);t&&o(i,t);try{i.run()}catch(e){throw i.stop(),e}let s=i.run.bind(i);return s.effect=i,s},e.effectScope=function(e){return new T(e)},e.enableTracking=function(){V.push(N),N=!0},e.getCurrentScope=function(){return t},e.getCurrentWatcher=function(){return n},e.isProxy=eC,e.isReactive=eI,e.isReadonly=eL,e.isRef=eV,e.isShallow=ej,e.markRaw=function(e){return!h(e,"__v_skip")&&Object.isExtensible(e)&&m(e,"__v_skip",!0),e},e.onEffectCleanup=function(e,t=!1){i instanceof A&&(i.cleanup=e)},e.onScopeDispose=function(e,i=!1){t&&t.cleanups.push(e)},e.onWatcherCleanup=eX,e.pauseTracking=K,e.proxyRefs=function(e){return eI(e)?e:new Proxy(e,eY)},e.reactive=eA,e.reactiveReadArray=X,e.readonly=eD,e.ref=eK,e.resetTracking=M,e.shallowReactive=function(e){return eO(e,!1,ed,ew,em)},e.shallowReadArray=Z,e.shallowReadonly=function(e){return eO(e,!0,e_,eE,ek)},e.shallowRef=function(e){return eM(e,!0)},e.stop=function(e){e.effect.stop()},e.toRaw=eP,e.toReactive=eW,e.toReadonly=eN,e.toRef=function(e,t,i){return eV(e)?e:_(e)?new ez(e):y(e)&&arguments.length>1?eB(e,t,i):eK(e)},e.toRefs=function(e){let t=f(e)?Array(e.length):{};for(let i in e)t[i]=eB(e,i);return t},e.toValue=function(e){return _(e)?e():eU(e)},e.track=J,e.traverse=eZ,e.trigger=Q,e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=eU,e.watch=function(e,i,s=l){let r,o,c,h;let{immediate:p,deep:d,once:v,scheduler:g,augmentJob:y,call:R}=s,b=e=>d?e:ej(e)||!1===d||0===d?eZ(e,1):eZ(e),w=!1,S=!1;if(eV(e)?(o=()=>e.value,w=ej(e)):eI(e)?(o=()=>b(e),w=!0):f(e)?(S=!0,w=e.some(e=>eI(e)||ej(e)),o=()=>e.map(e=>eV(e)?e.value:eI(e)?b(e):_(e)?R?R(e,2):e():void 0)):o=_(e)?i?R?()=>R(e,2):e:()=>{if(c){K();try{c()}finally{M()}}let t=n;n=r;try{return R?R(e,3,[h]):e(h)}finally{n=t}}:a,i&&d){let e=o,t=!0===d?1/0:d;o=()=>eZ(e(),t)}let E=t,m=()=>{r.stop(),E&&E.active&&u(E.effects,r)};if(v&&i){let e=i;i=(...t)=>{e(...t),m()}}let T=S?Array(e.length).fill(eJ):eJ,k=e=>{if(1&r.flags&&(r.dirty||e)){if(i){let e=r.run();if(d||w||(S?e.some((e,t)=>x(e,T[t])):x(e,T))){c&&c();let t=n;n=r;try{let t=[e,T===eJ?void 0:S&&T[0]===eJ?[]:T,h];R?R(i,3,t):i(...t),T=e}finally{n=t}}}else r.run()}};return y&&y(k),(r=new A(o)).scheduler=g?()=>g(k,!1):k,h=e=>eX(e,!1,r),c=r.onStop=()=>{let e=eQ.get(r);if(e){if(R)R(e,4);else for(let t of e)t();eQ.delete(r)}},i?p?k(!0):T=r.run():g?g(k.bind(null,!0),!0):r.run(),m.pause=r.pause.bind(r),m.resume=r.resume.bind(r),m.stop=m,m},e}({}); diff --git a/seller_1/node_modules/@vue/reactivity/index.js b/seller_1/node_modules/@vue/reactivity/index.js new file mode 100644 index 0000000..04a8ba5 --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/reactivity.cjs.prod.js') +} else { + module.exports = require('./dist/reactivity.cjs.js') +} diff --git a/seller_1/node_modules/@vue/reactivity/package.json b/seller_1/node_modules/@vue/reactivity/package.json new file mode 100644 index 0000000..6778f1c --- /dev/null +++ b/seller_1/node_modules/@vue/reactivity/package.json @@ -0,0 +1,55 @@ +{ + "name": "@vue/reactivity", + "version": "3.5.13", + "description": "@vue/reactivity", + "main": "index.js", + "module": "dist/reactivity.esm-bundler.js", + "types": "dist/reactivity.d.ts", + "unpkg": "dist/reactivity.global.js", + "jsdelivr": "dist/reactivity.global.js", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/reactivity.d.ts", + "node": { + "production": "./dist/reactivity.cjs.prod.js", + "development": "./dist/reactivity.cjs.js", + "default": "./index.js" + }, + "module": "./dist/reactivity.esm-bundler.js", + "import": "./dist/reactivity.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/reactivity" + }, + "buildOptions": { + "name": "VueReactivity", + "formats": [ + "esm-bundler", + "esm-browser", + "cjs", + "global" + ] + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme", + "dependencies": { + "@vue/shared": "3.5.13" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/runtime-core/LICENSE b/seller_1/node_modules/@vue/runtime-core/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/runtime-core/README.md b/seller_1/node_modules/@vue/runtime-core/README.md new file mode 100644 index 0000000..452ef52 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/README.md @@ -0,0 +1,28 @@ +# @vue/runtime-core + +> This package is published only for typing and building custom renderers. It is NOT meant to be used in applications. + +For full exposed APIs, see `src/index.ts`. + +## Building a Custom Renderer + +```ts +import { createRenderer } from '@vue/runtime-core' + +const { render, createApp } = createRenderer({ + patchProp, + insert, + remove, + createElement, + // ... +}) + +// `render` is the low-level API +// `createApp` returns an app instance with configurable context shared +// by the entire app tree. +export { render, createApp } + +export * from '@vue/runtime-core' +``` + +See `@vue/runtime-dom` for how a DOM-targeting renderer is implemented. diff --git a/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js new file mode 100644 index 0000000..4307f03 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js @@ -0,0 +1,8493 @@ +/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var reactivity = require('@vue/reactivity'); +var shared = require('@vue/shared'); + +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + reactivity.pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + reactivity.resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (shared.isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (reactivity.isRef(value)) { + value = formatProp(key, reactivity.toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (shared.isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = reactivity.toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function assertNumber(val, type) { + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} + +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (shared.isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && shared.isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (shared.isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings$1[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + reactivity.pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + reactivity.resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } +} + +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!shared.isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = (job) => checkRecursiveUpdates(seen, job) ; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Map(); +{ + shared.getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); +} +function updateComponentDef(oldComp, newComp) { + shared.extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} + +let devtools$1; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +function validateDirectiveName(name) { + if (shared.isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } +} +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i]; + if (dir) { + if (shared.isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + reactivity.traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + reactivity.pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + reactivity.resetTracking(); + } + } +} + +const TeleportEndKey = Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (shared.isString(targetSelector)) { + if (!select) { + warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!target && !isTeleportDisabled(props)) { + warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); + } + return target; + } + } else { + if (!targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; + } +}; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if (isHmrUpdating) { + optimized = false; + dynamicChildren = null; + } + if (n1 == null) { + const placeholder = n2.el = createComment("teleport start") ; + const mainAnchor = n2.anchor = createComment("teleport end") ; + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + if (parentComponent && parentComponent.isCE) { + parentComponent.ce._teleportTarget = container2; + } + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = () => { + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = prepareAnchor(target, n2, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (!disabled) { + mount(target, targetAnchor); + updateCssVars(n2, false); + } + } else if (!disabled) { + warn$1( + "Invalid Teleport target on mount:", + target, + `(${typeof target})` + ); + } + }; + if (disabled) { + mount(container, mainAnchor); + updateCssVars(n2, true); + } + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(() => { + mountToTarget(); + n2.el.__isMounted = true; + }, parentSuspense); + } else { + mountToTarget(); + } + } else { + if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + queuePostRenderEffect(() => { + TeleportImpl.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + delete n1.el.__isMounted; + }, parentSuspense); + return; + } + n2.el = n1.el; + n2.targetStart = n1.targetStart; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const disabled = isTeleportDisabled(vnode.props); + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetStart = targetNode; + vnode.targetAnchor = targetNode && nextSibling(targetNode); + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target); + insert(targetAnchor, target); + } + return targetAnchor; +} + +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + const child = findNonCommentChild(children); + const rawProps = reactivity.toRaw(props); + const { mode } = rawProps; + if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid <transition> mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (hasFound) { + warn$1( + "<transition> can only be used on a single element or component. Use <transition-group> for lists." + ); + break; + } + child = c; + hasFound = true; + } + } + } + return child; +} +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (shared.isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && shared.isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return shared.isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } else { + warn$1( + `useId() is called when there is no active component instance to be associated with.` + ); + } + return ""; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} + +const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); +function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = reactivity.shallowRef(null); + if (i) { + const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs; + let desc; + if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { + warn$1(`useTemplateRef('${key}') already exists.`); + } else { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } else { + warn$1( + `useTemplateRef() is called when there is no active component instance to be associated with.` + ); + } + const ret = reactivity.readonly(r) ; + { + knownTemplateRefs.add(ret); + } + return ret; +} + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (shared.isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if (!owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = reactivity.toRaw(setupState); + const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => { + { + if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + return shared.hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (shared.isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (reactivity.isRef(oldRef)) { + oldRef.value = null; + } + } + if (shared.isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = shared.isString(ref); + const _isRef = reactivity.isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + shared.isArray(existing) && shared.remove(existing, refValue); + } else { + if (!shared.isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + } +} + +let hasLoggedMismatchError = false; +const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +const isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + { + shared.def(node, "__vnode", vnode, true); + shared.def(node, "__vueParentComponent", parentComponent, true); + } + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + let hasWarned = false; + while (next) { + if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + if (el.textContent !== clientText) { + if (!isMismatchAllowed(el, 0 /* TEXT */)) { + warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${el.textContent} + - expected on client: ${vnode.children}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if (// #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement) { + patchProp(el, key, null, props[key], void 0, parentComponent); + } + } + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasWarned = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { + warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; +} +function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + actual = el.getAttribute("class"); + expected = shared.normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2 /* CLASS */; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3 /* STYLE */; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) { + if (shared.isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = shared.includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = shared.isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4 /* ATTRIBUTE */; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; +} +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); +} +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; +} +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; +} +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; +} +function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + expectedMap.set( + `--${shared.getEscapedCssVarName(key, false)}`, + String(cssVars[key]) + ); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } +} +const allowMismatchAttr = "data-allow-mismatch"; +const MismatchTypeString = { + [0 /* TEXT */]: "text", + [1 /* CHILDREN */]: "children", + [2 /* CLASS */]: "class", + [3 /* STYLE */]: "style", + [4 /* ATTRIBUTE */]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + const allowedAttr = el && el.getAttribute(allowMismatchAttr); + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 /* TEXT */ && list.includes("children")) { + return true; + } + return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + } +} + +const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { + const id = requestIdleCallback(hydrate, { timeout }); + return () => cancelIdleCallback(id); +}; +function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); +} +const hydrateOnVisible = (opts) => (hydrate, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); +}; +const hydrateOnMediaQuery = (query) => (hydrate) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate(); + } else { + mql.addEventListener("change", hydrate, { once: true }); + return () => mql.removeEventListener("change", hydrate); + } + } +}; +const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { + if (shared.isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; +}; +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (shared.isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (comp && !shared.isObject(comp) && !shared.isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + hydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : hydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = reactivity.ref(false); + const error = reactivity.ref(); + const delayed = reactivity.ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; + } + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + shared.invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + shared.invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= ~256; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (shared.isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (shared.isString(pattern)) { + return pattern.split(",").includes(name); + } else if (shared.isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + shared.remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + reactivity.pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + reactivity.resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else { + const apiName = shared.toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (shared.isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else { + warn$1( + `resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = shared.isArray(source); + if (sourceIsArray || shared.isString(source)) { + const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source); + let needsWrap = false; + if (sourceIsReactiveArray) { + needsWrap = !reactivity.isShallow(source); + source = reactivity.shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? reactivity.toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (shared.isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (shared.isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + 64 + ); + } + let slot = slots[name]; + if (slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!shared.isObject(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => reactivity.shallowReadonly(i.props) , + $attrs: (i) => reactivity.shallowReadonly(i.attrs) , + $slots: (i) => reactivity.shallowReadonly(i.slots) , + $refs: (i) => reactivity.shallowReadonly(i.refs) , + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + reactivity.track(instance.attrs, "get", ""); + markAttrsAccessed(); + } else if (key === "$slots") { + reactivity.track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!shared.isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== shared.EMPTY_OBJ && isReservedPrefix(key[0]) && shared.hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && shared.hasOwn(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { + data[key] = value; + return true; + } else if (shared.hasOwn(instance.props, key)) { + warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if (key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); + } else { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (shared.hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +{ + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` + ); + return Reflect.ownKeys(target); + }; +} +const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !shared.isGloballyAllowed(key); + if (!has && PublicInstanceProxyHandlers.has(_, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} should not start with _ which is a reserved prefix for Vue internals.` + ); + } + return has; + } +}); +function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: shared.NOOP + }); + }); + return target; +} +function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: shared.NOOP + }); + }); + } +} +function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys(reactivity.toRaw(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; + } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: shared.NOOP + }); + } + }); +} + +const warnRuntimeUsage = (method) => warn$1( + `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` +); +function defineProps() { + { + warnRuntimeUsage(`defineProps`); + } + return null; +} +function defineEmits() { + { + warnRuntimeUsage(`defineEmits`); + } + return null; +} +function defineExpose(exposed) { + { + warnRuntimeUsage(`defineExpose`); + } +} +function defineOptions(options) { + { + warnRuntimeUsage(`defineOptions`); + } +} +function defineSlots() { + { + warnRuntimeUsage(`defineSlots`); + } + return null; +} +function defineModel() { + { + warnRuntimeUsage("defineModel"); + } +} +function withDefaults(props, defaults) { + { + warnRuntimeUsage(`withDefaults`); + } + return null; +} +function useSlots() { + return getContext().slots; +} +function useAttrs() { + return getContext().attrs; +} +function getContext() { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useContext() called without active instance.`); + } + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return shared.isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} +function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) continue; + let opt = props[key]; + if (opt) { + if (shared.isArray(opt) || shared.isFunction(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; + } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else { + warn$1(`props default key "${key}" has no corresponding declaration.`); + } + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; +} +function mergeModels(a, b) { + if (!a || !b) return a || b; + if (shared.isArray(a) && shared.isArray(b)) return a.concat(b); + return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +} +function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; +} +function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + if (!ctx) { + warn$1( + `withAsyncContext called without active current instance. This is likely a bug.` + ); + } + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if (shared.isPromise(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; +} + +function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); + } else { + cache[key] = type; + } + }; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = createDuplicateChecker() ; + { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } + } + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (shared.isFunction(methodHandler)) { + { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } + { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } + } + } + if (dataOptions) { + if (!shared.isFunction(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` + ); + } + const data = dataOptions.call(publicThis, publicThis); + if (shared.isPromise(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + ); + } + if (!shared.isObject(data)) { + warn$1(`data() should return an object.`); + } else { + instance.data = reactivity.reactive(data); + { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: shared.NOOP + }); + } + } + } + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP; + if (get === shared.NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } ; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + { + checkDuplicateProperties("Computed" /* COMPUTED */, key); + } + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (shared.isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (shared.isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === shared.NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) { + if (shared.isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (shared.isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (reactivity.isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + { + checkDuplicateProperties("Inject" /* INJECT */, key); + } + } +} +function callHook(hook, instance, type) { + callWithAsyncErrorHandling( + shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (shared.isString(raw)) { + const handler = ctx[raw]; + if (shared.isFunction(handler)) { + { + watch(getter, handler); + } + } else { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); + } + } else if (shared.isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (shared.isObject(raw)) { + if (shared.isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (shared.isFunction(handler)) { + watch(getter, handler, raw); + } else { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); + } + } + } else { + warn$1(`Invalid watch option: "${key}"`, raw); + } +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (shared.isObject(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") { + warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); + } else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (shared.extend)( + shared.isFunction(to) ? to.call(this, this) : to, + shared.isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (shared.isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (shared.isArray(to) && shared.isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return shared.extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = shared.extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: shared.NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!shared.isFunction(rootComponent)) { + rootComponent = shared.extend({}, rootComponent); + } + if (rootProps != null && !shared.isObject(rootProps)) { + warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); + } + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && shared.isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (shared.isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); + } + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") + ); + } + } + return app; + }, + component(name, component) { + { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if (context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if (context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if (rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + ); + } + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + { + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + { + app._instance = vnode.component; + devtoolsInitApp(app, version); + } + return getComponentPublicInstance(vnode.component); + } else { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` + ); + } + }, + onUnmount(cleanupFn) { + if (typeof cleanupFn !== "function") { + warn$1( + `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` + ); + } + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + { + app._instance = null; + devtoolsUnmountApp(app); + } + delete app._container.__vue_app__; + } else { + warn$1(`Cannot unmount an app that is not mounted.`); + } + }, + provide(key, value) { + if (key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) { + { + warn$1(`provide() can only be used inside setup().`); + } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else { + warn$1(`injection "${String(key)}" not found.`); + } + } else { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} +function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); +} + +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : reactivity.shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) return true; + instance = instance.parent; + } +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = reactivity.toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (shared.hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = shared.camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !shared.hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + reactivity.trigger(instance.attrs, "set", ""); + } + { + validateProps(rawProps || {}, props, instance); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (shared.isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = reactivity.toRaw(props); + const castValues = rawCastValues || shared.EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !shared.hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = shared.hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!shared.isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + shared.extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (shared.isObject(comp)) { + cache.set(comp, shared.EMPTY_ARR); + } + return shared.EMPTY_ARR; + } + if (shared.isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + if (!shared.isString(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); + } + const normalizedKey = shared.camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = shared.EMPTY_OBJ; + } + } + } else if (raw) { + if (!shared.isObject(raw)) { + warn$1(`invalid props options`, raw); + } + for (const key in raw) { + const normalizedKey = shared.camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (shared.isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = shared.isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = shared.isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || shared.hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (shared.isObject(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !shared.isReservedProp(key)) { + return true; + } else { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; +} +function getType(ctor) { + if (ctor === null) { + return "null"; + } + if (typeof ctor === "function") { + return ctor.name || ""; + } else if (typeof ctor === "object") { + const name = ctor.constructor && ctor.constructor.name; + return name || ""; + } + return ""; +} +function validateProps(rawProps, props, instance) { + const resolvedValues = reactivity.toRaw(props); + const options = instance.propsOptions[0]; + const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key)); + for (const key in options) { + let opt = options[key]; + if (opt == null) continue; + validateProp( + key, + resolvedValues[key], + opt, + reactivity.shallowReadonly(resolvedValues) , + !camelizePropsKey.includes(key) + ); + } +} +function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = shared.isArray(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); + return; + } + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } +} +const isSimpleType = /* @__PURE__ */ shared.makeMap( + "String,Number,Boolean,Function,Symbol,BigInt" +); +function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (expectedType === "null") { + valid = value === null; + } else if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; + } + } else if (expectedType === "Object") { + valid = shared.isObject(value); + } else if (expectedType === "Array") { + valid = shared.isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + }; +} +function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; + } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(shared.capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = shared.toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message; +} +function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } +} +function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); +} +function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); +} + +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + ); + } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (shared.isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + if (!isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + shared.def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = shared.EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (isHmrUpdating) { + assignSlots(slots, children, optimized); + reactivity.trigger(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; + +let supported; +let perf; +function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; + } else { + supported = false; + } + return supported; +} + +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + const target = shared.getGlobalThis(); + target.__VUE__ = true; + { + setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = shared.NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); + } else { + n2.el = n1.el; + n2.anchor = n1.anchor; + } + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !shared.isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + { + shared.def(el, "__vnode", vnode, true); + shared.def(el, "__vueParentComponent", parentComponent, true); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; + } + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + { + el.__vnode = n2; + } + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || shared.EMPTY_OBJ; + const newProps = n2.props || shared.EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== shared.EMPTY_OBJ) { + for (const key in oldProps) { + if (!shared.isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (shared.isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if ( + // #5523 dev root fragment may inherit directives + isHmrUpdating || patchFlag & 2048 + ) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if (instance.type.__hmrId) { + registerHMR(instance); + } + { + pushWarningContext(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + { + startMeasure(instance, `init`); + } + setupComponent(instance, false, optimized); + { + endMeasure(instance, `init`); + } + } + if (instance.asyncDep) { + if (isHmrUpdating) initialVNode.el = null; + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + { + popWarningContext(); + endMeasure(instance, `mount`); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + { + pushWarningContext(n2); + } + updateComponentPreRender(instance, n2, optimized); + { + popWarningContext(); + } + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + shared.invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + { + endMeasure(instance, `hydrate`); + } + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + { + pushWarningContext(next || instance.vnode); + } + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + shared.invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + { + devtoolsComponentUpdated(instance); + } + { + popWarningContext(); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + { + effect.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0; + } + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + reactivity.pauseTracking(); + flushPreFlushCbs(instance); + reactivity.resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || shared.EMPTY_ARR; + c2 = c2 || shared.EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + if (keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if (instance.type.__hmrId) { + unregisterHMR(instance); + } + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + shared.invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); + } + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; +} +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; +} +function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } +} +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; +} +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (shared.isArray(ch1) && shared.isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if (c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } + } +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } +} +function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } +} + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); + } + return ctx; + } +}; + +function watchEffect(effect, options) { + return doWatch(effect, null, options); +} +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + shared.extend({}, options, { flush: "post" }) + ); +} +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + shared.extend({}, options, { flush: "sync" }) + ); +} +function watch(source, cb, options) { + if (!shared.isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = shared.EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = shared.extend({}, options); + baseWatchOptions.onWarn = warn$1; + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = shared.NOOP; + watchStopHandle.resume = shared.NOOP; + watchStopHandle.pause = shared.NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = reactivity.watch(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (shared.isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} + +function useModel(props, name, options = shared.EMPTY_OBJ) { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useModel() called without active instance.`); + return reactivity.ref(); + } + const camelizedName = shared.camelize(name); + if (!i.propsOptions[0][camelizedName]) { + warn$1(`useModel() called with prop "${name}" which is not declared.`); + return reactivity.ref(); + } + const hyphenatedName = shared.hyphenate(name); + const modifiers = getModelModifiers(props, camelizedName); + const res = reactivity.customRef((track, trigger) => { + let localValue; + let prevSetValue = shared.EMPTY_OBJ; + let prevEmittedValue; + watchSyncEffect(() => { + const propValue = props[camelizedName]; + if (shared.hasChanged(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const emittedValue = options.set ? options.set(value) : value; + if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) { + return; + } + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { + localValue = value; + trigger(); + } + i.emit(`update:${name}`, emittedValue); + if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) { + trigger(); + } + prevSetValue = value; + prevEmittedValue = emittedValue; + } + }; + }); + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false }; + } else { + return { done: true }; + } + } + }; + }; + return res; +} +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`]; +}; + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || shared.EMPTY_OBJ; + { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (shared.isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(shared.looseToNumber); + } + } + { + devtoolsComponentEmit(instance, event, args); + } + { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[shared.toHandlerKey(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${shared.hyphenate( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = shared.toHandlerKey(shared.camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!shared.isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + shared.extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (shared.isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (shared.isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + shared.extend(normalized, raw); + } + if (shared.isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !shared.isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key); +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + true ? reactivity.shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode( + render2.length > 1 ? render2( + true ? reactivity.shallowReadonly(props) : props, + true ? { + get attrs() { + markAttrsAccessed(); + return reactivity.shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + true ? reactivity.shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(shared.isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } else if (!accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (shared.isOn(key)) { + if (!shared.isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` + ); + } + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); + } + setTransitionHooks(root, vnode.transition); + } + if (setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { + return getChildRoot(childRoot); + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode(childRoot), setRoot]; +}; +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || shared.isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!shared.isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ((prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} + +const isSuspense = (type) => type.__isSuspense; +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (shared.isFunction(eventListener)) { + eventListener(); + } +} +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +let hasWarned = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (!hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + `<Suspense> is an experimental feature and its API will likely change.` + ); + } + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0; + { + assertNumber(timeout, `Suspense timeout`); + } + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) === container2) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +function normalizeSuspenseSlot(s) { + let block; + if (shared.isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (shared.isArray(s)) { + const singleChild = filterSingleRoot(s); + if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn$1(`<Suspense> slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; +} +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (shared.isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; +} + +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +const blockStack = []; +let currentBlock = null; +function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); +} +function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; +} +let isBlockTreeEnabled = 1; +function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } +} +function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); + } + return vnode; +} +function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); +} +function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); +} +function isVNode(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + if (n2.shapeFlag & 6 && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type); + if (dirtyInstances && dirtyInstances.has(n1.component)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; + } + } + return n1.type === n2.type && n1.key === n2.key; +} +let vnodeArgsTransformer; +function transformVNodeArgs(transformer) { + vnodeArgsTransformer = transformer; +} +const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args + ); +}; +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +}; +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= shared.isString(children) ? 8 : 16; + } + if (vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; +} +const createVNode = createVNodeWithArgsTransform ; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if (!type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); + } + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !shared.isString(klass)) { + props.class = shared.normalizeClass(klass); + } + if (shared.isObject(style)) { + if (reactivity.isProxy(style) && !shared.isArray(style)) { + style = shared.extend({}, style); + } + props.style = shared.normalizeStyle(style); + } + } + const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0; + if (shapeFlag & 4 && reactivity.isProxy(type)) { + type = reactivity.toRaw(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); + } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); +} +function guardReactiveProps(props) { + if (!props) return null; + return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: patchFlag === -1 && shared.isArray(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; +} +function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if (shared.isArray(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); + } + return cloned; +} +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); +} +function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (shared.isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } +} +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (shared.isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (shared.isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = shared.normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = shared.normalizeStyle([ret.style, toMerge.style]); + } else if (shared.isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} + +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new reactivity.EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: shared.EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: shared.EMPTY_OBJ, + data: shared.EMPTY_OBJ, + props: shared.EMPTY_OBJ, + attrs: shared.EMPTY_OBJ, + slots: shared.EMPTY_OBJ, + refs: shared.EMPTY_OBJ, + setupState: shared.EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + { + instance.ctx = createDevRenderContext(instance); + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => currentInstance || currentRenderingInstance; +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = shared.getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); +} +const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component"); +function validateComponentName(name, { isNativeTag }) { + if (isBuiltInTag(name) || isNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); + } +} +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); + } + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); + } + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } + } + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + reactivity.pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + reactivity.shallowReadonly(instance.props) , + setupContext + ] + ); + const isAsyncSetup = shared.isPromise(setupResult); + reactivity.resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if (!instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } +} +function handleSetupResult(instance, setupResult, isSSR) { + if (shared.isFunction(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if (shared.isObject(setupResult)) { + if (isVNode(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = reactivity.proxyRefs(setupResult); + { + exposeSetupStateOnRenderContext(instance); + } + } else if (setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); +} +let compile; +let installWithProxy; +function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; +} +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + { + startMeasure(instance, `compile`); + } + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = shared.extend( + shared.extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + { + endMeasure(instance, `compile`); + } + } + } + instance.render = Component.render || shared.NOOP; + if (installWithProxy) { + installWithProxy(instance); + } + } + { + const reset = setCurrentInstance(instance); + reactivity.pauseTracking(); + try { + applyOptions(instance); + } finally { + reactivity.resetTracking(); + reset(); + } + } + if (!Component.render && instance.render === shared.NOOP && !isSSR) { + if (!compile && Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (``) + ); + } else { + warn$1(`Component is missing template or render function: `, Component); + } + } +} +const attrsProxyHandlers = { + get(target, key) { + markAttrsAccessed(); + reactivity.track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } +} ; +function getSlotsProxy(instance) { + return new Proxy(instance.slots, { + get(target, key) { + reactivity.track(instance, "get", "$slots"); + return target[key]; + } + }); +} +function createSetupContext(instance) { + const expose = (exposed) => { + { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if (shared.isArray(exposed)) { + exposedType = "array"; + } else if (reactivity.isRef(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + { + let attrsProxy; + let slotsProxy; + return Object.freeze({ + get attrs() { + return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); + }, + get slots() { + return slotsProxy || (slotsProxy = getSlotsProxy(instance)); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } +} +function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return shared.isFunction(value) && "__vccOpts" in value; +} + +const computed = (getterOrOptions, debugOptions) => { + const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup); + { + const i = getCurrentInstance(); + if (i && i.appContext.config.warnRecursiveComputed) { + c._warnRecursive = true; + } + } + return c; +}; + +function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); + } + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); + } + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; + } + return createVNode(type, propsOrChildren, children); + } +} + +function initCustomFormatter() { + if (typeof window === "undefined") { + return; + } + const vueStyle = { style: "color:#3ba776" }; + const numberStyle = { style: "color:#1677ff" }; + const stringStyle = { style: "color:#f5222d" }; + const keywordStyle = { style: "color:#eb2f96" }; + const formatter = { + __vue_custom_formatter: true, + header(obj) { + if (!shared.isObject(obj)) { + return null; + } + if (obj.__isVue) { + return ["div", vueStyle, `VueInstance`]; + } else if (reactivity.isRef(obj)) { + return [ + "div", + {}, + ["span", vueStyle, genRefFlag(obj)], + "<", + // avoid debugger accessing value affecting behavior + formatValue("_value" in obj ? obj._value : obj), + `>` + ]; + } else if (reactivity.isReactive(obj)) { + return [ + "div", + {}, + ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReactive" : "Reactive"], + "<", + formatValue(obj), + `>${reactivity.isReadonly(obj) ? ` (readonly)` : ``}` + ]; + } else if (reactivity.isReadonly(obj)) { + return [ + "div", + {}, + ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReadonly" : "Readonly"], + "<", + formatValue(obj), + ">" + ]; + } + return null; + }, + hasBody(obj) { + return obj && obj.__isVue; + }, + body(obj) { + if (obj && obj.__isVue) { + return [ + "div", + {}, + ...formatInstance(obj.$) + ]; + } + } + }; + function formatInstance(instance) { + const blocks = []; + if (instance.type.props && instance.props) { + blocks.push(createInstanceBlock("props", reactivity.toRaw(instance.props))); + } + if (instance.setupState !== shared.EMPTY_OBJ) { + blocks.push(createInstanceBlock("setup", instance.setupState)); + } + if (instance.data !== shared.EMPTY_OBJ) { + blocks.push(createInstanceBlock("data", reactivity.toRaw(instance.data))); + } + const computed = extractKeys(instance, "computed"); + if (computed) { + blocks.push(createInstanceBlock("computed", computed)); + } + const injected = extractKeys(instance, "inject"); + if (injected) { + blocks.push(createInstanceBlock("injected", injected)); + } + blocks.push([ + "div", + {}, + [ + "span", + { + style: keywordStyle.style + ";opacity:0.66" + }, + "$ (internal): " + ], + ["object", { object: instance }] + ]); + return blocks; + } + function createInstanceBlock(type, target) { + target = shared.extend({}, target); + if (!Object.keys(target).length) { + return ["span", {}]; + } + return [ + "div", + { style: "line-height:1.25em;margin-bottom:0.6em" }, + [ + "div", + { + style: "color:#476582" + }, + type + ], + [ + "div", + { + style: "padding-left:1.25em" + }, + ...Object.keys(target).map((key) => { + return [ + "div", + {}, + ["span", keywordStyle, key + ": "], + formatValue(target[key], false) + ]; + }) + ] + ]; + } + function formatValue(v, asRaw = true) { + if (typeof v === "number") { + return ["span", numberStyle, v]; + } else if (typeof v === "string") { + return ["span", stringStyle, JSON.stringify(v)]; + } else if (typeof v === "boolean") { + return ["span", keywordStyle, v]; + } else if (shared.isObject(v)) { + return ["object", { object: asRaw ? reactivity.toRaw(v) : v }]; + } else { + return ["span", stringStyle, String(v)]; + } + } + function extractKeys(instance, type) { + const Comp = instance.type; + if (shared.isFunction(Comp)) { + return; + } + const extracted = {}; + for (const key in instance.ctx) { + if (isKeyOfType(Comp, key, type)) { + extracted[key] = instance.ctx[key]; + } + } + return extracted; + } + function isKeyOfType(Comp, key, type) { + const opts = Comp[type]; + if (shared.isArray(opts) && opts.includes(key) || shared.isObject(opts) && key in opts) { + return true; + } + if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { + return true; + } + if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { + return true; + } + } + function genRefFlag(v) { + if (reactivity.isShallow(v)) { + return `ShallowRef`; + } + if (v.effect) { + return `ComputedRef`; + } + return `Ref`; + } + if (window.devtoolsFormatters) { + window.devtoolsFormatters.push(formatter); + } else { + window.devtoolsFormatters = [formatter]; + } +} + +function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + ret.cacheIndex = index; + return cache[index] = ret; +} +function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if (shared.hasChanged(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; +} + +const version = "3.5.13"; +const warn = warn$1 ; +const ErrorTypeStrings = ErrorTypeStrings$1 ; +const devtools = devtools$1 ; +const setDevtoolsHook = setDevtoolsHook$1 ; +const _ssrUtils = { + createComponentInstance, + setupComponent, + renderComponentRoot, + setCurrentRenderingInstance, + isVNode: isVNode, + normalizeVNode, + getComponentPublicInstance, + ensureValidVNode, + pushWarningContext, + popWarningContext +}; +const ssrUtils = _ssrUtils ; +const resolveFilter = null; +const compatUtils = null; +const DeprecationTypes = null; + +exports.EffectScope = reactivity.EffectScope; +exports.ReactiveEffect = reactivity.ReactiveEffect; +exports.TrackOpTypes = reactivity.TrackOpTypes; +exports.TriggerOpTypes = reactivity.TriggerOpTypes; +exports.customRef = reactivity.customRef; +exports.effect = reactivity.effect; +exports.effectScope = reactivity.effectScope; +exports.getCurrentScope = reactivity.getCurrentScope; +exports.getCurrentWatcher = reactivity.getCurrentWatcher; +exports.isProxy = reactivity.isProxy; +exports.isReactive = reactivity.isReactive; +exports.isReadonly = reactivity.isReadonly; +exports.isRef = reactivity.isRef; +exports.isShallow = reactivity.isShallow; +exports.markRaw = reactivity.markRaw; +exports.onScopeDispose = reactivity.onScopeDispose; +exports.onWatcherCleanup = reactivity.onWatcherCleanup; +exports.proxyRefs = reactivity.proxyRefs; +exports.reactive = reactivity.reactive; +exports.readonly = reactivity.readonly; +exports.ref = reactivity.ref; +exports.shallowReactive = reactivity.shallowReactive; +exports.shallowReadonly = reactivity.shallowReadonly; +exports.shallowRef = reactivity.shallowRef; +exports.stop = reactivity.stop; +exports.toRaw = reactivity.toRaw; +exports.toRef = reactivity.toRef; +exports.toRefs = reactivity.toRefs; +exports.toValue = reactivity.toValue; +exports.triggerRef = reactivity.triggerRef; +exports.unref = reactivity.unref; +exports.camelize = shared.camelize; +exports.capitalize = shared.capitalize; +exports.normalizeClass = shared.normalizeClass; +exports.normalizeProps = shared.normalizeProps; +exports.normalizeStyle = shared.normalizeStyle; +exports.toDisplayString = shared.toDisplayString; +exports.toHandlerKey = shared.toHandlerKey; +exports.BaseTransition = BaseTransition; +exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators; +exports.Comment = Comment; +exports.DeprecationTypes = DeprecationTypes; +exports.ErrorCodes = ErrorCodes; +exports.ErrorTypeStrings = ErrorTypeStrings; +exports.Fragment = Fragment; +exports.KeepAlive = KeepAlive; +exports.Static = Static; +exports.Suspense = Suspense; +exports.Teleport = Teleport; +exports.Text = Text; +exports.assertNumber = assertNumber; +exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling; +exports.callWithErrorHandling = callWithErrorHandling; +exports.cloneVNode = cloneVNode; +exports.compatUtils = compatUtils; +exports.computed = computed; +exports.createBlock = createBlock; +exports.createCommentVNode = createCommentVNode; +exports.createElementBlock = createElementBlock; +exports.createElementVNode = createBaseVNode; +exports.createHydrationRenderer = createHydrationRenderer; +exports.createPropsRestProxy = createPropsRestProxy; +exports.createRenderer = createRenderer; +exports.createSlots = createSlots; +exports.createStaticVNode = createStaticVNode; +exports.createTextVNode = createTextVNode; +exports.createVNode = createVNode; +exports.defineAsyncComponent = defineAsyncComponent; +exports.defineComponent = defineComponent; +exports.defineEmits = defineEmits; +exports.defineExpose = defineExpose; +exports.defineModel = defineModel; +exports.defineOptions = defineOptions; +exports.defineProps = defineProps; +exports.defineSlots = defineSlots; +exports.devtools = devtools; +exports.getCurrentInstance = getCurrentInstance; +exports.getTransitionRawChildren = getTransitionRawChildren; +exports.guardReactiveProps = guardReactiveProps; +exports.h = h; +exports.handleError = handleError; +exports.hasInjectionContext = hasInjectionContext; +exports.hydrateOnIdle = hydrateOnIdle; +exports.hydrateOnInteraction = hydrateOnInteraction; +exports.hydrateOnMediaQuery = hydrateOnMediaQuery; +exports.hydrateOnVisible = hydrateOnVisible; +exports.initCustomFormatter = initCustomFormatter; +exports.inject = inject; +exports.isMemoSame = isMemoSame; +exports.isRuntimeOnly = isRuntimeOnly; +exports.isVNode = isVNode; +exports.mergeDefaults = mergeDefaults; +exports.mergeModels = mergeModels; +exports.mergeProps = mergeProps; +exports.nextTick = nextTick; +exports.onActivated = onActivated; +exports.onBeforeMount = onBeforeMount; +exports.onBeforeUnmount = onBeforeUnmount; +exports.onBeforeUpdate = onBeforeUpdate; +exports.onDeactivated = onDeactivated; +exports.onErrorCaptured = onErrorCaptured; +exports.onMounted = onMounted; +exports.onRenderTracked = onRenderTracked; +exports.onRenderTriggered = onRenderTriggered; +exports.onServerPrefetch = onServerPrefetch; +exports.onUnmounted = onUnmounted; +exports.onUpdated = onUpdated; +exports.openBlock = openBlock; +exports.popScopeId = popScopeId; +exports.provide = provide; +exports.pushScopeId = pushScopeId; +exports.queuePostFlushCb = queuePostFlushCb; +exports.registerRuntimeCompiler = registerRuntimeCompiler; +exports.renderList = renderList; +exports.renderSlot = renderSlot; +exports.resolveComponent = resolveComponent; +exports.resolveDirective = resolveDirective; +exports.resolveDynamicComponent = resolveDynamicComponent; +exports.resolveFilter = resolveFilter; +exports.resolveTransitionHooks = resolveTransitionHooks; +exports.setBlockTracking = setBlockTracking; +exports.setDevtoolsHook = setDevtoolsHook; +exports.setTransitionHooks = setTransitionHooks; +exports.ssrContextKey = ssrContextKey; +exports.ssrUtils = ssrUtils; +exports.toHandlers = toHandlers; +exports.transformVNodeArgs = transformVNodeArgs; +exports.useAttrs = useAttrs; +exports.useId = useId; +exports.useModel = useModel; +exports.useSSRContext = useSSRContext; +exports.useSlots = useSlots; +exports.useTemplateRef = useTemplateRef; +exports.useTransitionState = useTransitionState; +exports.version = version; +exports.warn = warn; +exports.watch = watch; +exports.watchEffect = watchEffect; +exports.watchPostEffect = watchPostEffect; +exports.watchSyncEffect = watchSyncEffect; +exports.withAsyncContext = withAsyncContext; +exports.withCtx = withCtx; +exports.withDefaults = withDefaults; +exports.withDirectives = withDirectives; +exports.withMemo = withMemo; +exports.withScopeId = withScopeId; diff --git a/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js new file mode 100644 index 0000000..a2ed5e5 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js @@ -0,0 +1,6654 @@ +/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var reactivity = require('@vue/reactivity'); +var shared = require('@vue/shared'); + +function pushWarningContext(vnode) { +} +function popWarningContext() { +} +function assertNumber(val, type) { + return; +} + +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (shared.isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && shared.isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (shared.isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + reactivity.pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + reactivity.resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + if (throwInProd) { + throw err; + } else { + console.error(err); + } +} + +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!shared.isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (false) ; + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(); + } + } +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i]; + if (dir) { + if (shared.isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + reactivity.traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + reactivity.pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + reactivity.resetTracking(); + } + } +} + +const TeleportEndKey = Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (shared.isString(targetSelector)) { + if (!select) { + return null; + } else { + const target = select(targetSelector); + return target; + } + } else { + return targetSelector; + } +}; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if (n1 == null) { + const placeholder = n2.el = createText(""); + const mainAnchor = n2.anchor = createText(""); + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + if (parentComponent && parentComponent.isCE) { + parentComponent.ce._teleportTarget = container2; + } + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = () => { + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = prepareAnchor(target, n2, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (!disabled) { + mount(target, targetAnchor); + updateCssVars(n2, false); + } + } + }; + if (disabled) { + mount(container, mainAnchor); + updateCssVars(n2, true); + } + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(() => { + mountToTarget(); + n2.el.__isMounted = true; + }, parentSuspense); + } else { + mountToTarget(); + } + } else { + if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + queuePostRenderEffect(() => { + TeleportImpl.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + delete n1.el.__isMounted; + }, parentSuspense); + return; + } + n2.el = n1.el; + n2.targetStart = n1.targetStart; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const disabled = isTeleportDisabled(vnode.props); + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetStart = targetNode; + vnode.targetAnchor = targetNode && nextSibling(targetNode); + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target); + insert(targetAnchor, target); + } + return targetAnchor; +} + +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + const child = findNonCommentChild(children); + const rawProps = reactivity.toRaw(props); + const { mode } = rawProps; + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + for (const c of children) { + if (c.type !== Comment) { + child = c; + break; + } + } + } + return child; +} +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (shared.isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && shared.isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return shared.isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } + return ""; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} + +function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = reactivity.shallowRef(null); + if (i) { + const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs; + { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } + const ret = r; + return ret; +} + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (shared.isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = reactivity.toRaw(setupState); + const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => { + return shared.hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (shared.isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (reactivity.isRef(oldRef)) { + oldRef.value = null; + } + } + if (shared.isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = shared.isString(ref); + const _isRef = reactivity.isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + shared.isArray(existing) && shared.remove(existing, refValue); + } else { + if (!shared.isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else ; + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } + } +} + +let hasLoggedMismatchError = false; +const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +const isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else ; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + if (forcePatch || patchFlag !== -1) { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + while (next) { + if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { + logMismatchError(); + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + if (el.textContent !== clientText) { + if (!isMismatchAllowed(el, 0 /* TEXT */)) { + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + if (forcePatch || !optimized || patchFlag & (16 | 32)) { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement) { + patchProp(el, key, null, props[key], void 0, parentComponent); + } + } + } else if (props.onClick) { + patchProp( + el, + "onClick", + null, + props.onClick, + void 0, + parentComponent + ); + } else if (patchFlag & 4 && reactivity.isReactive(props.style)) { + for (const key in props.style) props.style[key]; + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { + logMismatchError(); + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; +} +const allowMismatchAttr = "data-allow-mismatch"; +const MismatchTypeString = { + [0 /* TEXT */]: "text", + [1 /* CHILDREN */]: "children", + [2 /* CLASS */]: "class", + [3 /* STYLE */]: "style", + [4 /* ATTRIBUTE */]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + const allowedAttr = el && el.getAttribute(allowMismatchAttr); + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 /* TEXT */ && list.includes("children")) { + return true; + } + return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + } +} + +const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { + const id = requestIdleCallback(hydrate, { timeout }); + return () => cancelIdleCallback(id); +}; +function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); +} +const hydrateOnVisible = (opts) => (hydrate, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); +}; +const hydrateOnMediaQuery = (query) => (hydrate) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate(); + } else { + mql.addEventListener("change", hydrate, { once: true }); + return () => mql.removeEventListener("change", hydrate); + } + } +}; +const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { + if (shared.isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; +}; +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (shared.isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + hydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : hydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = reactivity.ref(false); + const error = reactivity.ref(); + const delayed = reactivity.ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; + } + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + shared.invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + shared.invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= ~256; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (shared.isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (shared.isString(pattern)) { + return pattern.split(",").includes(name); + } else if (shared.isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + shared.remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + reactivity.pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + reactivity.resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (shared.isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + return res; + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = shared.isArray(source); + if (sourceIsArray || shared.isString(source)) { + const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source); + let needsWrap = false; + if (sourceIsReactiveArray) { + needsWrap = !reactivity.isShallow(source); + source = reactivity.shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? reactivity.toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (shared.isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (shared.isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + 64 + ); + } + let slot = slots[name]; + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => i.props, + $attrs: (i) => i.attrs, + $slots: (i) => i.slots, + $refs: (i) => i.refs, + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + reactivity.track(instance.attrs, "get", ""); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else ; + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { + data[key] = value; + return true; + } else if (shared.hasOwn(instance.props, key)) { + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + return false; + } else { + { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (shared.hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !shared.isGloballyAllowed(key); + return has; + } +}); + +function defineProps() { + return null; +} +function defineEmits() { + return null; +} +function defineExpose(exposed) { +} +function defineOptions(options) { +} +function defineSlots() { + return null; +} +function defineModel() { +} +function withDefaults(props, defaults) { + return null; +} +function useSlots() { + return getContext().slots; +} +function useAttrs() { + return getContext().attrs; +} +function getContext() { + const i = getCurrentInstance(); + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return shared.isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} +function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) continue; + let opt = props[key]; + if (opt) { + if (shared.isArray(opt) || shared.isFunction(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; + } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else ; + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; +} +function mergeModels(a, b) { + if (!a || !b) return a || b; + if (shared.isArray(a) && shared.isArray(b)) return a.concat(b); + return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +} +function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; +} +function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if (shared.isPromise(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; +} + +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = null; + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (shared.isFunction(methodHandler)) { + { + ctx[key] = methodHandler.bind(publicThis); + } + } + } + } + if (dataOptions) { + const data = dataOptions.call(publicThis, publicThis); + if (!shared.isObject(data)) ; else { + instance.data = reactivity.reactive(data); + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP; + const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (shared.isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (shared.isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === shared.NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) { + if (shared.isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (shared.isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (reactivity.isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + } +} +function callHook(hook, instance, type) { + callWithAsyncErrorHandling( + shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (shared.isString(raw)) { + const handler = ctx[raw]; + if (shared.isFunction(handler)) { + { + watch(getter, handler); + } + } + } else if (shared.isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (shared.isObject(raw)) { + if (shared.isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (shared.isFunction(handler)) { + watch(getter, handler, raw); + } + } + } else ; +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (shared.isObject(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") ; else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (shared.extend)( + shared.isFunction(to) ? to.call(this, this) : to, + shared.isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (shared.isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (shared.isArray(to) && shared.isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return shared.extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = shared.extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: shared.NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!shared.isFunction(rootComponent)) { + rootComponent = shared.extend({}, rootComponent); + } + if (rootProps != null && !shared.isObject(rootProps)) { + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (shared.isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else ; + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } + } + return app; + }, + component(name, component) { + if (!component) { + return context.components[name]; + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + if (!directive) { + return context.directives[name]; + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + return getComponentPublicInstance(vnode.component); + } + }, + onUnmount(cleanupFn) { + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + delete app._container.__vue_app__; + } + }, + provide(key, value) { + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) ; else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else ; + } +} +function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); +} + +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + if (isStateful) { + instance.props = isSSR ? props : reactivity.shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = reactivity.toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (shared.hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = shared.camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !shared.hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + reactivity.trigger(instance.attrs, "set", ""); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (shared.isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = reactivity.toRaw(props); + const castValues = rawCastValues || shared.EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !shared.hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = shared.hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!shared.isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + shared.extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (shared.isObject(comp)) { + cache.set(comp, shared.EMPTY_ARR); + } + return shared.EMPTY_ARR; + } + if (shared.isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + const normalizedKey = shared.camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = shared.EMPTY_OBJ; + } + } + } else if (raw) { + for (const key in raw) { + const normalizedKey = shared.camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (shared.isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = shared.isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = shared.isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || shared.hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (shared.isObject(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !shared.isReservedProp(key)) { + return true; + } + return false; +} + +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (false) ; + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (shared.isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + shared.def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = shared.EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; + +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + const target = shared.getGlobalThis(); + target.__VUE__ = true; + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = shared.NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else ; + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !shared.isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || shared.EMPTY_OBJ; + const newProps = n2.props || shared.EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== shared.EMPTY_OBJ) { + for (const key in oldProps) { + if (!shared.isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (shared.isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + if ( + // #2080 if the stable fragment has a key, it's a <template v-for> that may + // get moved around. Make sure all root level vnodes inherit el. + // #2134 or if it's a component root, it may also get moved around + // as the component is being moved. + n2.key != null || parentComponent && n2 === parentComponent.subTree + ) { + traverseStaticChildren( + n1, + n2, + true + /* shallow */ + ); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + setupComponent(instance, false, optimized); + } + if (instance.asyncDep) { + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + updateComponentPreRender(instance, n2, optimized); + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + shared.invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + instance.subTree = renderComponentRoot(instance); + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + const subTree = instance.subTree = renderComponentRoot(instance); + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + shared.invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + const nextTree = renderComponentRoot(instance); + const prevTree = instance.subTree; + instance.subTree = nextTree; + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + reactivity.pauseTracking(); + flushPreFlushCbs(instance); + reactivity.resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || shared.EMPTY_ARR; + c2 = c2 || shared.EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + shared.invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); + } + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; +} +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; +} +function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } +} +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; +} +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (shared.isArray(ch1) && shared.isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + } + } +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } +} +function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } +} + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + return ctx; + } +}; + +function watchEffect(effect, options) { + return doWatch(effect, null, options); +} +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + { flush: "post" } + ); +} +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + { flush: "sync" } + ); +} +function watch(source, cb, options) { + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = shared.EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + const baseWatchOptions = shared.extend({}, options); + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = shared.NOOP; + watchStopHandle.resume = shared.NOOP; + watchStopHandle.pause = shared.NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = reactivity.watch(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (shared.isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} + +function useModel(props, name, options = shared.EMPTY_OBJ) { + const i = getCurrentInstance(); + const camelizedName = shared.camelize(name); + const hyphenatedName = shared.hyphenate(name); + const modifiers = getModelModifiers(props, camelizedName); + const res = reactivity.customRef((track, trigger) => { + let localValue; + let prevSetValue = shared.EMPTY_OBJ; + let prevEmittedValue; + watchSyncEffect(() => { + const propValue = props[camelizedName]; + if (shared.hasChanged(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const emittedValue = options.set ? options.set(value) : value; + if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) { + return; + } + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { + localValue = value; + trigger(); + } + i.emit(`update:${name}`, emittedValue); + if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) { + trigger(); + } + prevSetValue = value; + prevEmittedValue = emittedValue; + } + }; + }); + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false }; + } else { + return { done: true }; + } + } + }; + }; + return res; +} +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`]; +}; + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || shared.EMPTY_OBJ; + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(shared.looseToNumber); + } + } + let handlerName; + let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = shared.toHandlerKey(shared.camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!shared.isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + shared.extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (shared.isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (shared.isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + shared.extend(normalized, raw); + } + if (shared.isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !shared.isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key); +} + +function markAttrsAccessed() { +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = false ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + false ? shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (false) ; + result = normalizeVNode( + render2.length > 1 ? render2( + false ? shallowReadonly(props) : props, + false ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + false ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(shared.isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } + } + } + if (vnode.dirs) { + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + setTransitionHooks(root, vnode.transition); + } + { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || shared.isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!shared.isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} + +const isSuspense = (type) => type.__isSuspense; +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (shared.isFunction(eventListener)) { + eventListener(); + } +} +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0; + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) === container2) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +function normalizeSuspenseSlot(s) { + let block; + if (shared.isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (shared.isArray(s)) { + const singleChild = filterSingleRoot(s); + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; +} +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (shared.isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; +} + +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +const blockStack = []; +let currentBlock = null; +function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); +} +function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; +} +let isBlockTreeEnabled = 1; +function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } +} +function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); + } + return vnode; +} +function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); +} +function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); +} +function isVNode(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + return n1.type === n2.type && n1.key === n2.key; +} +function transformVNodeArgs(transformer) { +} +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +}; +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= shared.isString(children) ? 8 : 16; + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; +} +const createVNode = _createVNode; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !shared.isString(klass)) { + props.class = shared.normalizeClass(klass); + } + if (shared.isObject(style)) { + if (reactivity.isProxy(style) && !shared.isArray(style)) { + style = shared.extend({}, style); + } + props.style = shared.normalizeStyle(style); + } + } + const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0; + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); +} +function guardReactiveProps(props) { + if (!props) return null; + return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; +} +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); +} +function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (shared.isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } +} +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (shared.isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (shared.isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = shared.normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = shared.normalizeStyle([ret.style, toMerge.style]); + } else if (shared.isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} + +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new reactivity.EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: shared.EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: shared.EMPTY_OBJ, + data: shared.EMPTY_OBJ, + props: shared.EMPTY_OBJ, + attrs: shared.EMPTY_OBJ, + slots: shared.EMPTY_OBJ, + refs: shared.EMPTY_OBJ, + setupState: shared.EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + { + instance.ctx = { _: instance }; + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => currentInstance || currentRenderingInstance; +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = shared.getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); +} +const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + const Component = instance.type; + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + const { setup } = Component; + if (setup) { + reactivity.pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + instance.props, + setupContext + ] + ); + const isAsyncSetup = shared.isPromise(setupResult); + reactivity.resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } +} +function handleSetupResult(instance, setupResult, isSSR) { + if (shared.isFunction(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if (shared.isObject(setupResult)) { + instance.setupState = reactivity.proxyRefs(setupResult); + } else ; + finishComponentSetup(instance, isSSR); +} +let compile; +let installWithProxy; +function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; +} +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = shared.extend( + shared.extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + } + } + instance.render = Component.render || shared.NOOP; + if (installWithProxy) { + installWithProxy(instance); + } + } + { + const reset = setCurrentInstance(instance); + reactivity.pauseTracking(); + try { + applyOptions(instance); + } finally { + reactivity.resetTracking(); + reset(); + } + } +} +const attrsProxyHandlers = { + get(target, key) { + reactivity.track(target, "get", ""); + return target[key]; + } +}; +function createSetupContext(instance) { + const expose = (exposed) => { + instance.exposed = exposed || {}; + }; + { + return { + attrs: new Proxy(instance.attrs, attrsProxyHandlers), + slots: instance.slots, + emit: instance.emit, + expose + }; + } +} +function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } +} +function getComponentName(Component, includeInferred = true) { + return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function isClassComponent(value) { + return shared.isFunction(value) && "__vccOpts" in value; +} + +const computed = (getterOrOptions, debugOptions) => { + const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup); + return c; +}; + +function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); + } + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); + } + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; + } + return createVNode(type, propsOrChildren, children); + } +} + +function initCustomFormatter() { + { + return; + } +} + +function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + ret.cacheIndex = index; + return cache[index] = ret; +} +function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if (shared.hasChanged(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; +} + +const version = "3.5.13"; +const warn$1 = shared.NOOP; +const ErrorTypeStrings = ErrorTypeStrings$1 ; +const devtools = void 0; +const setDevtoolsHook = shared.NOOP; +const _ssrUtils = { + createComponentInstance, + setupComponent, + renderComponentRoot, + setCurrentRenderingInstance, + isVNode: isVNode, + normalizeVNode, + getComponentPublicInstance, + ensureValidVNode, + pushWarningContext, + popWarningContext +}; +const ssrUtils = _ssrUtils ; +const resolveFilter = null; +const compatUtils = null; +const DeprecationTypes = null; + +exports.EffectScope = reactivity.EffectScope; +exports.ReactiveEffect = reactivity.ReactiveEffect; +exports.TrackOpTypes = reactivity.TrackOpTypes; +exports.TriggerOpTypes = reactivity.TriggerOpTypes; +exports.customRef = reactivity.customRef; +exports.effect = reactivity.effect; +exports.effectScope = reactivity.effectScope; +exports.getCurrentScope = reactivity.getCurrentScope; +exports.getCurrentWatcher = reactivity.getCurrentWatcher; +exports.isProxy = reactivity.isProxy; +exports.isReactive = reactivity.isReactive; +exports.isReadonly = reactivity.isReadonly; +exports.isRef = reactivity.isRef; +exports.isShallow = reactivity.isShallow; +exports.markRaw = reactivity.markRaw; +exports.onScopeDispose = reactivity.onScopeDispose; +exports.onWatcherCleanup = reactivity.onWatcherCleanup; +exports.proxyRefs = reactivity.proxyRefs; +exports.reactive = reactivity.reactive; +exports.readonly = reactivity.readonly; +exports.ref = reactivity.ref; +exports.shallowReactive = reactivity.shallowReactive; +exports.shallowReadonly = reactivity.shallowReadonly; +exports.shallowRef = reactivity.shallowRef; +exports.stop = reactivity.stop; +exports.toRaw = reactivity.toRaw; +exports.toRef = reactivity.toRef; +exports.toRefs = reactivity.toRefs; +exports.toValue = reactivity.toValue; +exports.triggerRef = reactivity.triggerRef; +exports.unref = reactivity.unref; +exports.camelize = shared.camelize; +exports.capitalize = shared.capitalize; +exports.normalizeClass = shared.normalizeClass; +exports.normalizeProps = shared.normalizeProps; +exports.normalizeStyle = shared.normalizeStyle; +exports.toDisplayString = shared.toDisplayString; +exports.toHandlerKey = shared.toHandlerKey; +exports.BaseTransition = BaseTransition; +exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators; +exports.Comment = Comment; +exports.DeprecationTypes = DeprecationTypes; +exports.ErrorCodes = ErrorCodes; +exports.ErrorTypeStrings = ErrorTypeStrings; +exports.Fragment = Fragment; +exports.KeepAlive = KeepAlive; +exports.Static = Static; +exports.Suspense = Suspense; +exports.Teleport = Teleport; +exports.Text = Text; +exports.assertNumber = assertNumber; +exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling; +exports.callWithErrorHandling = callWithErrorHandling; +exports.cloneVNode = cloneVNode; +exports.compatUtils = compatUtils; +exports.computed = computed; +exports.createBlock = createBlock; +exports.createCommentVNode = createCommentVNode; +exports.createElementBlock = createElementBlock; +exports.createElementVNode = createBaseVNode; +exports.createHydrationRenderer = createHydrationRenderer; +exports.createPropsRestProxy = createPropsRestProxy; +exports.createRenderer = createRenderer; +exports.createSlots = createSlots; +exports.createStaticVNode = createStaticVNode; +exports.createTextVNode = createTextVNode; +exports.createVNode = createVNode; +exports.defineAsyncComponent = defineAsyncComponent; +exports.defineComponent = defineComponent; +exports.defineEmits = defineEmits; +exports.defineExpose = defineExpose; +exports.defineModel = defineModel; +exports.defineOptions = defineOptions; +exports.defineProps = defineProps; +exports.defineSlots = defineSlots; +exports.devtools = devtools; +exports.getCurrentInstance = getCurrentInstance; +exports.getTransitionRawChildren = getTransitionRawChildren; +exports.guardReactiveProps = guardReactiveProps; +exports.h = h; +exports.handleError = handleError; +exports.hasInjectionContext = hasInjectionContext; +exports.hydrateOnIdle = hydrateOnIdle; +exports.hydrateOnInteraction = hydrateOnInteraction; +exports.hydrateOnMediaQuery = hydrateOnMediaQuery; +exports.hydrateOnVisible = hydrateOnVisible; +exports.initCustomFormatter = initCustomFormatter; +exports.inject = inject; +exports.isMemoSame = isMemoSame; +exports.isRuntimeOnly = isRuntimeOnly; +exports.isVNode = isVNode; +exports.mergeDefaults = mergeDefaults; +exports.mergeModels = mergeModels; +exports.mergeProps = mergeProps; +exports.nextTick = nextTick; +exports.onActivated = onActivated; +exports.onBeforeMount = onBeforeMount; +exports.onBeforeUnmount = onBeforeUnmount; +exports.onBeforeUpdate = onBeforeUpdate; +exports.onDeactivated = onDeactivated; +exports.onErrorCaptured = onErrorCaptured; +exports.onMounted = onMounted; +exports.onRenderTracked = onRenderTracked; +exports.onRenderTriggered = onRenderTriggered; +exports.onServerPrefetch = onServerPrefetch; +exports.onUnmounted = onUnmounted; +exports.onUpdated = onUpdated; +exports.openBlock = openBlock; +exports.popScopeId = popScopeId; +exports.provide = provide; +exports.pushScopeId = pushScopeId; +exports.queuePostFlushCb = queuePostFlushCb; +exports.registerRuntimeCompiler = registerRuntimeCompiler; +exports.renderList = renderList; +exports.renderSlot = renderSlot; +exports.resolveComponent = resolveComponent; +exports.resolveDirective = resolveDirective; +exports.resolveDynamicComponent = resolveDynamicComponent; +exports.resolveFilter = resolveFilter; +exports.resolveTransitionHooks = resolveTransitionHooks; +exports.setBlockTracking = setBlockTracking; +exports.setDevtoolsHook = setDevtoolsHook; +exports.setTransitionHooks = setTransitionHooks; +exports.ssrContextKey = ssrContextKey; +exports.ssrUtils = ssrUtils; +exports.toHandlers = toHandlers; +exports.transformVNodeArgs = transformVNodeArgs; +exports.useAttrs = useAttrs; +exports.useId = useId; +exports.useModel = useModel; +exports.useSSRContext = useSSRContext; +exports.useSlots = useSlots; +exports.useTemplateRef = useTemplateRef; +exports.useTransitionState = useTransitionState; +exports.version = version; +exports.warn = warn$1; +exports.watch = watch; +exports.watchEffect = watchEffect; +exports.watchPostEffect = watchPostEffect; +exports.watchSyncEffect = watchSyncEffect; +exports.withAsyncContext = withAsyncContext; +exports.withCtx = withCtx; +exports.withDefaults = withDefaults; +exports.withDirectives = withDirectives; +exports.withMemo = withMemo; +exports.withScopeId = withScopeId; diff --git a/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.d.ts b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.d.ts new file mode 100644 index 0000000..dd923af --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.d.ts @@ -0,0 +1,1832 @@ +import { computed as computed$1, Ref, OnCleanup, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, WatchCallback, ReactiveEffect, DebuggerOptions, WatchEffect, WatchHandle, WatchSource, ReactiveMarker, ShallowRef, WatchErrorCodes, reactive } from '@vue/reactivity'; +export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity'; +import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters, IsKeyValues } from '@vue/shared'; +export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; + +export declare const computed: typeof computed$1; + +export type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[]; +type InternalSlots = { + [name: string]: Slot | undefined; +}; +export type Slots = Readonly<InternalSlots>; +declare const SlotSymbol: unique symbol; +export type SlotsType<T extends Record<string, any> = Record<string, any>> = { + [SlotSymbol]?: T; +}; +type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T> & T; +type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{ + [K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>; +}>>; +type RawSlots = { + [name: string]: unknown; + $stable?: boolean; +}; + +declare enum SchedulerJobFlags { + QUEUED = 1, + PRE = 2, + /** + * Indicates whether the effect is allowed to recursively trigger itself + * when managed by the scheduler. + * + * By default, a job cannot trigger itself because some built-in method calls, + * e.g. Array.prototype.push actually performs reads as well (#1740) which + * can lead to confusing infinite loops. + * The allowed cases are component update functions and watch callbacks. + * Component update functions may update child component props, which in turn + * trigger flush: "pre" watch callbacks that mutates state that the parent + * relies on (#1801). Watch callbacks doesn't track its dependencies so if it + * triggers itself again, it's likely intentional and it is the user's + * responsibility to perform recursive state mutation that eventually + * stabilizes (#1727). + */ + ALLOW_RECURSE = 4, + DISPOSED = 8 +} +interface SchedulerJob extends Function { + id?: number; + /** + * flags can technically be undefined, but it can still be used in bitwise + * operations just like 0. + */ + flags?: SchedulerJobFlags; + /** + * Attached by renderer.ts when setting up a component's render effect + * Used to obtain component information when reporting max recursive updates. + */ + i?: ComponentInternalInstance; +} +type SchedulerJobs = SchedulerJob | SchedulerJob[]; +export declare function nextTick<T = void, R = void>(this: T, fn?: (this: T) => R): Promise<Awaited<R>>; +export declare function queuePostFlushCb(cb: SchedulerJobs): void; + +export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[]; +export type ComponentObjectPropsOptions<P = Data> = { + [K in keyof P]: Prop<P[K]> | null; +}; +export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>; +type DefaultFactory<T> = (props: Data) => T | null | undefined; +interface PropOptions<T = any, D = T> { + type?: PropType<T> | true | null; + required?: boolean; + default?: D | DefaultFactory<D> | null | undefined | object; + validator?(value: unknown, props: Data): boolean; +} +export type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[]; +type PropConstructor<T = any> = { + new (...args: any[]): T & {}; +} | { + (): T; +} | PropMethod<T>; +type PropMethod<T, TConstructor = any> = [T] extends [ + ((...args: any) => any) | undefined +] ? { + new (): TConstructor; + (): T; + readonly prototype: TConstructor; +} : never; +type RequiredKeys<T> = { + [K in keyof T]: T[K] extends { + required: true; + } | { + default: any; + } | BooleanConstructor | { + type: BooleanConstructor; + } ? T[K] extends { + default: undefined | (() => undefined); + } ? never : K : never; +}[keyof T]; +type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>; +type DefaultKeys<T> = { + [K in keyof T]: T[K] extends { + default: any; + } | BooleanConstructor | { + type: BooleanConstructor; + } ? T[K] extends { + type: BooleanConstructor; + required: true; + } ? never : K : never; +}[keyof T]; +type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{ + type: null | true; +}] ? any : [T] extends [ObjectConstructor | { + type: ObjectConstructor; +}] ? Record<string, any> : [T] extends [BooleanConstructor | { + type: BooleanConstructor; +}] ? boolean : [T] extends [DateConstructor | { + type: DateConstructor; +}] ? Date : [T] extends [(infer U)[] | { + type: (infer U)[]; +}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T; +/** + * Extract prop types from a runtime props options object. + * The extracted types are **internal** - i.e. the resolved props received by + * the component. + * - Boolean props are always present + * - Props with default values are always present + * + * To extract accepted props from the parent, use {@link ExtractPublicPropTypes}. + */ +export type ExtractPropTypes<O> = { + [K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>; +} & { + [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>; +}; +type PublicRequiredKeys<T> = { + [K in keyof T]: T[K] extends { + required: true; + } ? K : never; +}[keyof T]; +type PublicOptionalKeys<T> = Exclude<keyof T, PublicRequiredKeys<T>>; +/** + * Extract prop types from a runtime props options object. + * The extracted types are **public** - i.e. the expected props that can be + * passed to component. + */ +export type ExtractPublicPropTypes<O> = { + [K in keyof Pick<O, PublicRequiredKeys<O>>]: InferPropType<O[K]>; +} & { + [K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>; +}; +export type ExtractDefaultPropTypes<O> = O extends object ? { + [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>; +} : {}; + +/** + * Vue `<script setup>` compiler macro for declaring component props. The + * expected argument is the same as the component `props` option. + * + * Example runtime declaration: + * ```js + * // using Array syntax + * const props = defineProps(['foo', 'bar']) + * // using Object syntax + * const props = defineProps({ + * foo: String, + * bar: { + * type: Number, + * required: true + * } + * }) + * ``` + * + * Equivalent type-based declaration: + * ```ts + * // will be compiled into equivalent runtime declarations + * const props = defineProps<{ + * foo?: string + * bar: number + * }>() + * ``` + * + * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits} + * + * This is only usable inside `<script setup>`, is compiled away in the + * output and should **not** be actually called at runtime. + */ +export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{ + [key in PropNames]?: any; +}>>; +export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>; +export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>; +export type DefineProps<T, BKeys extends keyof T> = Readonly<T> & { + readonly [K in BKeys]-?: boolean; +}; +type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never; +/** + * Vue `<script setup>` compiler macro for declaring a component's emitted + * events. The expected argument is the same as the component `emits` option. + * + * Example runtime declaration: + * ```js + * const emit = defineEmits(['change', 'update']) + * ``` + * + * Example type-based declaration: + * ```ts + * const emit = defineEmits<{ + * // <eventName>: <expected arguments> + * change: [] + * update: [value: number] // named tuple syntax + * }>() + * + * emit('change') + * emit('update', 1) + * ``` + * + * This is only usable inside `<script setup>`, is compiled away in the + * output and should **not** be actually called at runtime. + * + * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits} + */ +export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>; +export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>; +export declare function defineEmits<T extends ComponentTypeEmits>(): T extends (...args: any[]) => any ? T : ShortEmits<T>; +export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>; +type RecordToUnion<T extends Record<string, any>> = T[keyof T]; +type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{ + [K in keyof T]: (evt: K, ...args: T[K]) => void; +}>>; +/** + * Vue `<script setup>` compiler macro for declaring a component's exposed + * instance properties when it is accessed by a parent component via template + * refs. + * + * `<script setup>` components are closed by default - i.e. variables inside + * the `<script setup>` scope is not exposed to parent unless explicitly exposed + * via `defineExpose`. + * + * This is only usable inside `<script setup>`, is compiled away in the + * output and should **not** be actually called at runtime. + * + * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose} + */ +export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void; +/** + * Vue `<script setup>` compiler macro for declaring a component's additional + * options. This should be used only for options that cannot be expressed via + * Composition API - e.g. `inheritAttrs`. + * + * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions} + */ +export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsBase<{}, RawBindings, D, C, M, Mixin, Extends, {}> & { + /** + * props should be defined via defineProps(). + */ + props?: never; + /** + * emits should be defined via defineEmits(). + */ + emits?: never; + /** + * expose should be defined via defineExpose(). + */ + expose?: never; + /** + * slots should be defined via defineSlots(). + */ + slots?: never; +}): void; +export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>; +export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ + ModelRef<T, M, G, S>, + Record<M, true | undefined> +]; +type DefineModelOptions<T = any, G = T, S = T> = { + get?: (v: T) => G; + set?: (v: S) => any; +}; +/** + * Vue `<script setup>` compiler macro for declaring a + * two-way binding prop that can be consumed via `v-model` from the parent + * component. This will declare a prop with the same name and a corresponding + * `update:propName` event. + * + * If the first argument is a string, it will be used as the prop name; + * Otherwise the prop name will default to "modelValue". In both cases, you + * can also pass an additional object which will be used as the prop's options. + * + * The returned ref behaves differently depending on whether the parent + * provided the corresponding v-model props or not: + * - If yes, the returned ref's value will always be in sync with the parent + * prop. + * - If not, the returned ref will behave like a normal local ref. + * + * @example + * ```ts + * // default model (consumed via `v-model`) + * const modelValue = defineModel<string>() + * modelValue.value = "hello" + * + * // default model with options + * const modelValue = defineModel<string>({ required: true }) + * + * // with specified name (consumed via `v-model:count`) + * const count = defineModel<number>('count') + * count.value++ + * + * // with specified name and default value + * const count = defineModel<number>('count', { default: 0 }) + * ``` + */ +export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({ + default: any; +} | { + required: true; +}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>; +export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>; +export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({ + default: any; +} | { + required: true; +}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>; +export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>; +type NotUndefined<T> = T extends undefined ? never : T; +type MappedOmit<T, K extends keyof any> = { + [P in keyof T as P extends K ? never : P]: T[P]; +}; +type InferDefaults<T> = { + [K in keyof T]?: InferDefault<T, T[K]>; +}; +type NativeType = null | number | string | boolean | symbol | Function; +type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never); +type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & { + readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never; +} & { + readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean; +} : never; +/** + * Vue `<script setup>` compiler macro for providing props default values when + * using type-based `defineProps` declaration. + * + * Example usage: + * ```ts + * withDefaults(defineProps<{ + * size?: number + * labels?: string[] + * }>(), { + * size: 3, + * labels: () => ['default label'] + * }) + * ``` + * + * This is only usable inside `<script setup>`, is compiled away in the output + * and should **not** be actually called at runtime. + * + * @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props} + */ +export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>; +export declare function useSlots(): SetupContext['slots']; +export declare function useAttrs(): SetupContext['attrs']; + +export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>; +export type EmitsOptions = ObjectEmitsOptions | string[]; +export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? { + [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any; +} : T extends ObjectEmitsOptions ? { + [K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any; +} : {}; +type TypeEmitsToOptions<T extends ComponentTypeEmits> = { + [K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any; +} & (T extends (...args: any[]) => any ? ParametersToFns<OverloadParameters<T>> : {}); +type ParametersToFns<T extends any[]> = { + [K in T[0]]: IsStringLiteral<K> extends true ? (...args: T extends [e: infer E, ...args: infer P] ? K extends E ? P : never : never) => any : never; +}; +type IsStringLiteral<T> = T extends string ? string extends T ? false : true : false; +export type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { + [K in keyof E]: (...args: E[K]) => any; +} : E; +export type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> ? (event: V, ...args: any[]) => void : {} extends Options ? (event: string, ...args: any[]) => void : UnionToIntersection<{ + [key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : Options[key] extends any[] ? (event: key, ...args: Options[key]) => void : (event: key, ...args: any[]) => void; +}[Event]>; + +/** +Runtime helper for applying directives to a vnode. Example usage: + +const comp = resolveComponent('comp') +const foo = resolveDirective('foo') +const bar = resolveDirective('bar') + +return withDirectives(h(comp), [ + [foo, this.x], + [bar, this.y] +]) +*/ + +export interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg extends string = string> { + instance: ComponentPublicInstance | Record<string, any> | null; + value: Value; + oldValue: Value | null; + arg?: Arg; + modifiers: DirectiveModifiers<Modifiers>; + dir: ObjectDirective<any, Value>; +} +export type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg extends string = string> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void; +type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg extends string = string> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined; +export interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> { + created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>; + beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>; + mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>; + beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>; + updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>; + beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>; + unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>; + getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>; + deep?: boolean; +} +export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>; +export type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>; +type DirectiveModifiers<K extends string = string> = Record<K, boolean>; +export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>; +/** + * Adds directives to a VNode. + */ +export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T; + +/** + * Custom properties added to component instances in any way and can be accessed through `this` + * + * @example + * Here is an example of adding a property `$router` to every component instance: + * ```ts + * import { createApp } from 'vue' + * import { Router, createRouter } from 'vue-router' + * + * declare module 'vue' { + * interface ComponentCustomProperties { + * $router: Router + * } + * } + * + * // effectively adding the router to every component instance + * const app = createApp({}) + * const router = createRouter() + * app.config.globalProperties.$router = router + * + * const vm = app.mount('#app') + * // we can access the router from the instance + * vm.$router.push('/') + * ``` + */ +export interface ComponentCustomProperties { +} +type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false; +type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults, any, any, any, any, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never; +type ExtractMixin<T> = { + Mixin: MixinToOptionTypes<T>; +}[T extends ComponentOptionsMixin ? 'Mixin' : never]; +type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>; +type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never; +type EnsureNonVoid<T> = T extends void ? {} : T; +type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = { + __isFragment?: never; + __isTeleport?: never; + __isSuspense?: never; + new (...args: any[]): T; +}; +/** + * @deprecated This is no longer used internally, but exported and relied on by + * existing library types generated by vue-tsc. + */ +export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S>, I, S>; +/** + * This is the same as `CreateComponentPublicInstance` but adds local components, + * global directives, exposed, and provide inference. + * It changes the arguments order so that we don't need to repeat mixin + * inference everywhere internally, but it has to be a new type to avoid + * breaking types that relies on previous arguments order (#10842) + */ +export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl extends Element = any, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs, TypeEl>; +type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>; +export type ComponentPublicInstance<P = {}, // props type extracted from props option +B = {}, // raw bindings returned from setup() +D = {}, // return from data() +C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}, TypeEl extends Element = any> = { + $: ComponentInternalInstance; + $data: D; + $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps; + $attrs: Data; + $refs: Data & TypeRefs; + $slots: UnwrapSlotsType<S>; + $root: ComponentPublicInstance | null; + $parent: ComponentPublicInstance | null; + $host: Element | null; + $emit: EmitFn<E>; + $el: TypeEl; + $options: Options & MergedComponentOptionsOverride; + $forceUpdate: () => void; + $nextTick: typeof nextTick; + $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle; +} & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>; + +declare enum LifecycleHooks { + BEFORE_CREATE = "bc", + CREATED = "c", + BEFORE_MOUNT = "bm", + MOUNTED = "m", + BEFORE_UPDATE = "bu", + UPDATED = "u", + BEFORE_UNMOUNT = "bum", + UNMOUNTED = "um", + DEACTIVATED = "da", + ACTIVATED = "a", + RENDER_TRIGGERED = "rtg", + RENDER_TRACKED = "rtc", + ERROR_CAPTURED = "ec", + SERVER_PREFETCH = "sp" +} + +export interface SuspenseProps { + onResolve?: () => void; + onPending?: () => void; + onFallback?: () => void; + timeout?: string | number; + /** + * Allow suspense to be captured by parent suspense + * + * @default false + */ + suspensible?: boolean; +} +declare const SuspenseImpl: { + name: string; + __isSuspense: boolean; + process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void; + hydrate: typeof hydrateSuspense; + normalize: typeof normalizeSuspenseChildren; +}; +export declare const Suspense: { + __isSuspense: true; + new (): { + $props: VNodeProps & SuspenseProps; + $slots: { + default(): VNode[]; + fallback(): VNode[]; + }; + }; +}; +export interface SuspenseBoundary { + vnode: VNode<RendererNode, RendererElement, SuspenseProps>; + parent: SuspenseBoundary | null; + parentComponent: ComponentInternalInstance | null; + namespace: ElementNamespace; + container: RendererElement; + hiddenContainer: RendererElement; + activeBranch: VNode | null; + pendingBranch: VNode | null; + deps: number; + pendingId: number; + timeout: number; + isInFallback: boolean; + isHydrating: boolean; + isUnmounted: boolean; + effects: Function[]; + resolve(force?: boolean, sync?: boolean): void; + fallback(fallbackVNode: VNode): void; + move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void; + next(): RendererNode | null; + registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void; + unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void; +} +declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null; +declare function normalizeSuspenseChildren(vnode: VNode): void; + +export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Element | ShadowRoot) & { + _vnode?: VNode; +}) => void; + +type Hook<T = () => void> = T | T[]; +export interface BaseTransitionProps<HostElement = RendererElement> { + mode?: 'in-out' | 'out-in' | 'default'; + appear?: boolean; + persisted?: boolean; + onBeforeEnter?: Hook<(el: HostElement) => void>; + onEnter?: Hook<(el: HostElement, done: () => void) => void>; + onAfterEnter?: Hook<(el: HostElement) => void>; + onEnterCancelled?: Hook<(el: HostElement) => void>; + onBeforeLeave?: Hook<(el: HostElement) => void>; + onLeave?: Hook<(el: HostElement, done: () => void) => void>; + onAfterLeave?: Hook<(el: HostElement) => void>; + onLeaveCancelled?: Hook<(el: HostElement) => void>; + onBeforeAppear?: Hook<(el: HostElement) => void>; + onAppear?: Hook<(el: HostElement, done: () => void) => void>; + onAfterAppear?: Hook<(el: HostElement) => void>; + onAppearCancelled?: Hook<(el: HostElement) => void>; +} +export interface TransitionHooks<HostElement = RendererElement> { + mode: BaseTransitionProps['mode']; + persisted: boolean; + beforeEnter(el: HostElement): void; + enter(el: HostElement): void; + leave(el: HostElement, remove: () => void): void; + clone(vnode: VNode): TransitionHooks<HostElement>; + afterLeave?(): void; + delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void; + delayedLeave?(): void; +} +export interface TransitionState { + isMounted: boolean; + isLeaving: boolean; + isUnmounting: boolean; + leavingVNodes: Map<any, Record<string, VNode>>; +} +export declare function useTransitionState(): TransitionState; +export declare const BaseTransitionPropsValidators: Record<string, any>; +export declare const BaseTransition: { + new (): { + $props: BaseTransitionProps<any>; + $slots: { + default(): VNode[]; + }; + }; +}; +export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks; +export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void; +export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[]; + +export interface Renderer<HostElement = RendererElement> { + render: RootRenderFunction<HostElement>; + createApp: CreateAppFunction<HostElement>; +} +export interface HydrationRenderer extends Renderer<Element | ShadowRoot> { + hydrate: RootHydrateFunction; +} +export type ElementNamespace = 'svg' | 'mathml' | undefined; +export type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement, namespace?: ElementNamespace) => void; +export interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> { + patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void; + insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void; + remove(el: HostNode): void; + createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & { + [key: string]: any; + }) | null): HostElement; + createText(text: string): HostNode; + createComment(text: string): HostNode; + setText(node: HostNode, text: string): void; + setElementText(node: HostElement, text: string): void; + parentNode(node: HostNode): HostElement | null; + nextSibling(node: HostNode): HostNode | null; + querySelector?(selector: string): HostElement | null; + setScopeId?(el: HostElement, id: string): void; + cloneNode?(node: HostNode): HostNode; + insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode]; +} +export interface RendererNode { + [key: string | symbol]: any; +} +export interface RendererElement extends RendererNode { +} +interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> { + p: PatchFn; + um: UnmountFn; + r: RemoveFn; + m: MoveFn; + mt: MountComponentFn; + mc: MountChildrenFn; + pc: PatchChildrenFn; + pbc: PatchBlockChildrenFn; + n: NextFn; + o: RendererOptions<HostNode, HostElement>; +} +type PatchFn = (n1: VNode | null, // null means this is a mount +n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void; +type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void; +type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean) => void; +type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void; +type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void; +type NextFn = (vnode: VNode) => RendererNode | null; +type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void; +type RemoveFn = (vnode: VNode) => void; +type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void; +type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void; +declare enum MoveType { + ENTER = 0, + LEAVE = 1, + REORDER = 2 +} +/** + * The createRenderer function accepts two generic arguments: + * HostNode and HostElement, corresponding to Node and Element types in the + * host environment. For example, for runtime-dom, HostNode would be the DOM + * `Node` interface and HostElement would be the DOM `Element` interface. + * + * Custom renderers can pass in the platform specific types like this: + * + * ``` js + * const { render, createApp } = createRenderer<Node, Element>({ + * patchProp, + * ...nodeOps + * }) + * ``` + */ +export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>; +export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer; + +type MatchPattern = string | RegExp | (string | RegExp)[]; +export interface KeepAliveProps { + include?: MatchPattern; + exclude?: MatchPattern; + max?: number | string; +} +export declare const KeepAlive: { + __isKeepAlive: true; + new (): { + $props: VNodeProps & KeepAliveProps; + $slots: { + default(): VNode[]; + }; + }; +}; +export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void; +export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void; + +type CreateHook<T = any> = (hook: T, target?: ComponentInternalInstance | null) => void; +export declare const onBeforeMount: CreateHook; +export declare const onMounted: CreateHook; +export declare const onBeforeUpdate: CreateHook; +export declare const onUpdated: CreateHook; +export declare const onBeforeUnmount: CreateHook; +export declare const onUnmounted: CreateHook; +export declare const onServerPrefetch: CreateHook; +type DebuggerHook = (e: DebuggerEvent) => void; +export declare const onRenderTriggered: CreateHook<DebuggerHook>; +export declare const onRenderTracked: CreateHook<DebuggerHook>; +type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void; +export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void; + +declare enum DeprecationTypes$1 { + GLOBAL_MOUNT = "GLOBAL_MOUNT", + GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER", + GLOBAL_EXTEND = "GLOBAL_EXTEND", + GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE", + GLOBAL_SET = "GLOBAL_SET", + GLOBAL_DELETE = "GLOBAL_DELETE", + GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE", + GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL", + CONFIG_SILENT = "CONFIG_SILENT", + CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS", + CONFIG_KEY_CODES = "CONFIG_KEY_CODES", + CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP", + CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS", + CONFIG_WHITESPACE = "CONFIG_WHITESPACE", + CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS", + INSTANCE_SET = "INSTANCE_SET", + INSTANCE_DELETE = "INSTANCE_DELETE", + INSTANCE_DESTROY = "INSTANCE_DESTROY", + INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER", + INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS", + INSTANCE_CHILDREN = "INSTANCE_CHILDREN", + INSTANCE_LISTENERS = "INSTANCE_LISTENERS", + INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS", + INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE", + OPTIONS_DATA_FN = "OPTIONS_DATA_FN", + OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE", + OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY", + OPTIONS_DESTROYED = "OPTIONS_DESTROYED", + WATCH_ARRAY = "WATCH_ARRAY", + PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS", + V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER", + CUSTOM_DIR = "CUSTOM_DIR", + ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE", + ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION", + TRANSITION_CLASSES = "TRANSITION_CLASSES", + TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT", + COMPONENT_ASYNC = "COMPONENT_ASYNC", + COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL", + COMPONENT_V_MODEL = "COMPONENT_V_MODEL", + RENDER_FUNCTION = "RENDER_FUNCTION", + FILTERS = "FILTERS", + PRIVATE_APIS = "PRIVATE_APIS" +} +type CompatConfig = Partial<Record<DeprecationTypes$1, boolean | 'suppress-warning'>> & { + MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3); +}; +declare function configureCompat(config: CompatConfig): void; + +/** + * Interface for declaring custom options. + * + * @example + * ```ts + * declare module 'vue' { + * interface ComponentCustomOptions { + * beforeRouteUpdate?( + * to: Route, + * from: Route, + * next: () => void + * ): void + * } + * } + * ``` + */ +export interface ComponentCustomOptions { +} +export type RenderFunction = () => VNodeChild; +export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, ComponentCustomOptions { + setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void; + name?: string; + template?: string | object; + render?: Function; + components?: LC & Record<string, Component>; + directives?: Directives & Record<string, Directive>; + inheritAttrs?: boolean; + emits?: (E | EE[]) & ThisType<void>; + slots?: S; + expose?: Exposed[]; + serverPrefetch?(): void | Promise<any>; + compilerOptions?: RuntimeCompilerOptions; + call?: (this: unknown, ...args: unknown[]) => never; + __isFragment?: never; + __isTeleport?: never; + __isSuspense?: never; + __defaults?: Defaults; +} +/** + * Subset of compiler options that makes sense for the runtime. + */ +export interface RuntimeCompilerOptions { + isCustomElement?: (tag: string) => boolean; + whitespace?: 'preserve' | 'condense'; + comments?: boolean; + delimiters?: [string, string]; +} +export type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>; +export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>; +export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>; +export interface MethodOptions { + [key: string]: Function; +} +type ExtractComputedReturns<T extends any> = { + [key in keyof T]: T[key] extends { + get: (...args: any[]) => infer TReturn; + } ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never; +}; +type ObjectWatchOptionItem = { + handler: WatchCallback | string; +} & WatchOptions; +type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem; +type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[]; +type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>; +export type ComponentProvideOptions = ObjectProvideOptions | Function; +type ObjectProvideOptions = Record<string | symbol, unknown>; +export type ComponentInjectOptions = string[] | ObjectInjectOptions; +type ObjectInjectOptions = Record<string | symbol, string | symbol | { + from?: string | symbol; + default?: unknown; +}>; +type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { + [K in T[number]]?: unknown; +} : T extends ObjectInjectOptions ? { + [K in keyof T]?: unknown; +} : never; +interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string, Provide extends ComponentProvideOptions = ComponentProvideOptions> { + compatConfig?: CompatConfig; + [key: string]: any; + data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D; + computed?: C; + methods?: M; + watch?: ComponentWatchOptions; + provide?: Provide; + inject?: I | II[]; + filters?: Record<string, Function>; + mixins?: Mixin[]; + extends?: Extends; + beforeCreate?(): void; + created?(): void; + beforeMount?(): void; + mounted?(): void; + beforeUpdate?(): void; + updated?(): void; + activated?(): void; + deactivated?(): void; + /** @deprecated use `beforeUnmount` instead */ + beforeDestroy?(): void; + beforeUnmount?(): void; + /** @deprecated use `unmounted` instead */ + destroyed?(): void; + unmounted?(): void; + renderTracked?: DebuggerHook; + renderTriggered?: DebuggerHook; + errorCaptured?: ErrorCapturedHook; + /** + * runtime compile only + * @deprecated use `compilerOptions.delimiters` instead. + */ + delimiters?: [string, string]; + /** + * #3468 + * + * type-only, used to assist Mixin's type inference, + * typescript will try to simplify the inferred `Mixin` type, + * with the `__differentiator`, typescript won't be able to combine different mixins, + * because the `__differentiator` will be different + */ + __differentiator?: keyof D | keyof C | keyof M; +} +type MergedHook<T = () => void> = T | T[]; +type MergedComponentOptionsOverride = { + beforeCreate?: MergedHook; + created?: MergedHook; + beforeMount?: MergedHook; + mounted?: MergedHook; + beforeUpdate?: MergedHook; + updated?: MergedHook; + activated?: MergedHook; + deactivated?: MergedHook; + /** @deprecated use `beforeUnmount` instead */ + beforeDestroy?: MergedHook; + beforeUnmount?: MergedHook; + /** @deprecated use `unmounted` instead */ + destroyed?: MergedHook; + unmounted?: MergedHook; + renderTracked?: MergedHook<DebuggerHook>; + renderTriggered?: MergedHook<DebuggerHook>; + errorCaptured?: MergedHook<ErrorCapturedHook>; +}; +type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults'; +type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = { + P: P; + B: B; + D: D; + C: C; + M: M; + Defaults: Defaults; +}; +/** + * @deprecated + */ +export type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, TE extends ComponentTypeEmits = {}, ResolvedEmits extends EmitsOptions = {} extends E ? TypeEmitsToOptions<TE> : E, PE = Props & EmitsToProps<ResolvedEmits>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & { + props?: never; + /** + * @private for language-tools use only + */ + __typeProps?: Props; + /** + * @private for language-tools use only + */ + __typeEmits?: TE; +} & ThisType<CreateComponentPublicInstanceWithMixins<PE, RawBindings, D, C, M, Mixin, Extends, ResolvedEmits, EE, {}, false, I, S, LC, Directives, Exposed>>; +/** + * @deprecated + */ +export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<{ + [key in PropNames]?: any; +} & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & { + props: PropNames[]; +} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S, LC, Directives, Exposed>>; +/** + * @deprecated + */ +export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions>> & Readonly<EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & { + props: PropsOptions & ThisType<void>; +} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>; + +interface InjectionConstraint<T> { +} +export type InjectionKey<T> = symbol & InjectionConstraint<T>; +export declare function provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): void; +export declare function inject<T>(key: InjectionKey<T> | string): T | undefined; +export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T; +export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T; +/** + * Returns true if `inject()` can be used without warning about being called in the wrong place (e.g. outside of + * setup()). This is used by libraries that want to use `inject()` internally without triggering a warning to the end + * user. One example is `useRoute()` in `vue-router`. + */ +export declare function hasInjectionContext(): boolean; + +export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps; +type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>); +export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP; +export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>; +type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>; +export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & { + props?: (keyof Props)[]; + emits?: E | EE[]; + slots?: S; +}): DefineSetupFnComponent<Props, E, S>; +export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & { + props?: ComponentObjectPropsOptions<Props>; + emits?: E | EE[]; + slots?: S; +}): DefineSetupFnComponent<Props, E, S>; +export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { + [key in RuntimePropsKeys]?: any; +}, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: { + props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[]; + /** + * @private for language-tools use only + */ + __typeProps?: TypeProps; + /** + * @private for language-tools use only + */ + __typeEmits?: TypeEmits; + /** + * @private for language-tools use only + */ + __typeRefs?: TypeRefs; + /** + * @private for language-tools use only + */ + __typeEl?: TypeEl; +} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults +InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>; + +export interface App<HostElement = any> { + version: string; + config: AppConfig; + use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): this; + use<Options>(plugin: Plugin<Options>, options: Options): this; + mixin(mixin: ComponentOptions): this; + component(name: string): Component | undefined; + component<T extends Component | DefineComponent>(name: string, component: T): this; + directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined; + directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this; + mount(rootContainer: HostElement | string, + /** + * @internal + */ + isHydrate?: boolean, + /** + * @internal + */ + namespace?: boolean | ElementNamespace, + /** + * @internal + */ + vnode?: VNode): ComponentPublicInstance; + unmount(): void; + onUnmount(cb: () => void): void; + provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this; + /** + * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access + * to variables provided via `app.provide()`. + * + * @param fn - function to run with the app as active instance + */ + runWithContext<T>(fn: () => T): T; + _uid: number; + _component: ConcreteComponent; + _props: Data | null; + _container: HostElement | null; + _context: AppContext; + _instance: ComponentInternalInstance | null; + /** + * v2 compat only + */ + filter?(name: string): Function | undefined; + filter?(name: string, filter: Function): this; +} +export type OptionMergeFunction = (to: unknown, from: unknown) => any; +export interface AppConfig { + readonly isNativeTag: (tag: string) => boolean; + performance: boolean; + optionMergeStrategies: Record<string, OptionMergeFunction>; + globalProperties: ComponentCustomProperties & Record<string, any>; + errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void; + warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void; + /** + * Options to pass to `@vue/compiler-dom`. + * Only supported in runtime compiler build. + */ + compilerOptions: RuntimeCompilerOptions; + /** + * @deprecated use config.compilerOptions.isCustomElement + */ + isCustomElement?: (tag: string) => boolean; + /** + * TODO document for 3.5 + * Enable warnings for computed getters that recursively trigger itself. + */ + warnRecursiveComputed?: boolean; + /** + * Whether to throw unhandled errors in production. + * Default is `false` to avoid crashing on any error (and only logs it) + * But in some cases, e.g. SSR, throwing might be more desirable. + */ + throwUnhandledErrorInProduction?: boolean; + /** + * Prefix for all useId() calls within this app + */ + idPrefix?: string; +} +export interface AppContext { + app: App; + config: AppConfig; + mixins: ComponentOptions[]; + components: Record<string, Component>; + directives: Record<string, Directive>; + provides: Record<string | symbol, any>; +} +type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any; +export type ObjectPlugin<Options = any[]> = { + install: PluginInstallFunction<Options>; +}; +export type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>; +export type Plugin<Options = any[]> = FunctionPlugin<Options> | ObjectPlugin<Options>; +export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>; + +type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>; +export interface TeleportProps { + to: string | RendererElement | null | undefined; + disabled?: boolean; + defer?: boolean; +} +declare const TeleportImpl: { + name: string; + __isTeleport: boolean; + process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void; + remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void; + move: typeof moveTeleport; + hydrate: typeof hydrateTeleport; +}; +declare enum TeleportMoveTypes { + TARGET_CHANGE = 0, + TOGGLE = 1,// enable / disable + REORDER = 2 +} +declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void; +declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null; +export declare const Teleport: { + __isTeleport: true; + new (): { + $props: VNodeProps & TeleportProps; + $slots: { + default(): VNode[]; + }; + }; +}; + +/** + * @private + */ +export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string; +declare const NULL_DYNAMIC_COMPONENT: unique symbol; +/** + * @private + */ +export declare function resolveDynamicComponent(component: unknown): VNodeTypes; +/** + * @private + */ +export declare function resolveDirective(name: string): Directive | undefined; + +export declare const Fragment: { + __isFragment: true; + new (): { + $props: VNodeProps; + }; +}; +export declare const Text: unique symbol; +export declare const Comment: unique symbol; +export declare const Static: unique symbol; +export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl; +export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void); +type VNodeNormalizedRefAtom = { + /** + * component instance + */ + i: ComponentInternalInstance; + /** + * Actual ref + */ + r: VNodeRef; + /** + * setup ref key + */ + k?: string; + /** + * refInFor marker + */ + f?: boolean; +}; +type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[]; +type VNodeMountHook = (vnode: VNode) => void; +type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void; +export type VNodeProps = { + key?: PropertyKey; + ref?: VNodeRef; + ref_for?: boolean; + ref_key?: string; + onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[]; + onVnodeMounted?: VNodeMountHook | VNodeMountHook[]; + onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[]; + onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[]; + onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[]; + onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[]; +}; +type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void; +export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>; +export type VNodeChild = VNodeChildAtom | VNodeArrayChildren; +export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null; +export interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = { + [key: string]: any; +}> { + type: VNodeTypes; + props: (VNodeProps & ExtraProps) | null; + key: PropertyKey | null; + ref: VNodeNormalizedRef | null; + /** + * SFC only. This is assigned on vnode creation using currentScopeId + * which is set alongside currentRenderingInstance. + */ + scopeId: string | null; + children: VNodeNormalizedChildren; + component: ComponentInternalInstance | null; + dirs: DirectiveBinding[] | null; + transition: TransitionHooks<HostElement> | null; + el: HostNode | null; + anchor: HostNode | null; + target: HostElement | null; + targetStart: HostNode | null; + targetAnchor: HostNode | null; + suspense: SuspenseBoundary | null; + shapeFlag: number; + patchFlag: number; + appContext: AppContext | null; +} +/** + * Open a block. + * This must be called before `createBlock`. It cannot be part of `createBlock` + * because the children of the block are evaluated before `createBlock` itself + * is called. The generated code typically looks like this: + * + * ```js + * function render() { + * return (openBlock(),createBlock('div', null, [...])) + * } + * ``` + * disableTracking is true when creating a v-for fragment block, since a v-for + * fragment always diffs its children. + * + * @private + */ +export declare function openBlock(disableTracking?: boolean): void; +/** + * Block tracking sometimes needs to be disabled, for example during the + * creation of a tree that needs to be cached by v-once. The compiler generates + * code like this: + * + * ``` js + * _cache[1] || ( + * setBlockTracking(-1, true), + * _cache[1] = createVNode(...), + * setBlockTracking(1), + * _cache[1] + * ) + * ``` + * + * @private + */ +export declare function setBlockTracking(value: number, inVOnce?: boolean): void; +/** + * @private + */ +export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode; +/** + * Create a block root vnode. Takes the same exact arguments as `createVNode`. + * A block root keeps track of dynamic nodes within the block in the + * `dynamicChildren` array. + * + * @private + */ +export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode; +export declare function isVNode(value: any): value is VNode; +declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined; +/** + * Internal API for registering an arguments transform for createVNode + * used for creating stubs in the test-utils + * It is *internal* but needs to be exposed for test-utils to pick up proper + * typings + */ +export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void; +export declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number, isBlockNode?: boolean, needFullChildrenNormalization?: boolean): VNode; + +export declare const createVNode: typeof _createVNode; +declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode; +export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null; +export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean, cloneTransition?: boolean): VNode<T, U>; +/** + * @private + */ +export declare function createTextVNode(text?: string, flag?: number): VNode; +/** + * @private + */ +export declare function createStaticVNode(content: string, numberOfNodes: number): VNode; +/** + * @private + */ +export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode; +export declare function mergeProps(...args: (Data & VNodeProps)[]): Data; + +type Data = Record<string, unknown>; +/** + * Public utility type for extracting the instance type of a component. + * Works with all valid component definition types. This is intended to replace + * the usage of `InstanceType<typeof Comp>` which only works for + * constructor-based component definition types. + * + * @example + * ```ts + * const MyComp = { ... } + * declare const instance: ComponentInstance<typeof MyComp> + * ``` + */ +export type ComponentInstance<T> = T extends { + new (): ComponentPublicInstance; +} ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer Props, infer RawBindings, infer D, infer C, infer M> ? ComponentPublicInstance<unknown extends Props ? {} : Props, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never; +/** + * For extending allowed non-declared props on components in TSX + */ +export interface ComponentCustomProps { +} +/** + * For globally defined Directives + * Here is an example of adding a directive `VTooltip` as global directive: + * + * @example + * ```ts + * import VTooltip from 'v-tooltip' + * + * declare module '@vue/runtime-core' { + * interface GlobalDirectives { + * VTooltip + * } + * } + * ``` + */ +export interface GlobalDirectives { +} +/** + * For globally defined Components + * Here is an example of adding a component `RouterView` as global component: + * + * @example + * ```ts + * import { RouterView } from 'vue-router' + * + * declare module '@vue/runtime-core' { + * interface GlobalComponents { + * RouterView + * } + * } + * ``` + */ +export interface GlobalComponents { + Teleport: DefineComponent<TeleportProps>; + Suspense: DefineComponent<SuspenseProps>; + KeepAlive: DefineComponent<KeepAliveProps>; + BaseTransition: DefineComponent<BaseTransitionProps>; +} +/** + * Default allowed non-declared props on component in TSX + */ +export interface AllowedComponentProps { + class?: unknown; + style?: unknown; +} +interface ComponentInternalOptions { + /** + * Compat build only, for bailing out of certain compatibility behavior + */ + __isBuiltIn?: boolean; + /** + * This one should be exposed so that devtools can make use of it + */ + __file?: string; + /** + * name inferred from filename + */ + __name?: string; +} +export interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions { + (props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any; + props?: ComponentPropsOptions<P>; + emits?: EE | (keyof EE)[]; + slots?: IfAny<S, Slots, SlotsType<S>>; + inheritAttrs?: boolean; + displayName?: string; + compatConfig?: CompatConfig; +} +interface ClassComponent { + new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>; + __vccOpts: ComponentOptions; +} +/** + * Concrete component type matches its actual value: it's either an options + * object, or a function. Use this where the code expects to work with actual + * values, e.g. checking if its a function or not. This is mostly for internal + * implementation code. + */ +export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, E, S>; +/** + * A type used in public APIs where a component type is expected. + * The constructor type is an artificial type returned by defineComponent(). + */ +export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<Props, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<Props>; + +export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? { + attrs: Data; + slots: UnwrapSlotsType<S>; + emit: EmitFn<E>; + expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void; +} : never; +/** + * We expose a subset of properties on the internal instance as they are + * useful for advanced external libraries and tools. + */ +export interface ComponentInternalInstance { + uid: number; + type: ConcreteComponent; + parent: ComponentInternalInstance | null; + root: ComponentInternalInstance; + appContext: AppContext; + /** + * Vnode representing this component in its parent's vdom tree + */ + vnode: VNode; + /** + * Root vnode of this component's own vdom tree + */ + subTree: VNode; + /** + * Render effect instance + */ + effect: ReactiveEffect; + /** + * Force update render effect + */ + update: () => void; + /** + * Render effect job to be passed to scheduler (checks if dirty) + */ + job: SchedulerJob; + proxy: ComponentPublicInstance | null; + exposed: Record<string, any> | null; + exposeProxy: Record<string, any> | null; + data: Data; + props: Data; + attrs: Data; + slots: InternalSlots; + refs: Data; + emit: EmitFn; + isMounted: boolean; + isUnmounted: boolean; + isDeactivated: boolean; +} +export declare const getCurrentInstance: () => ComponentInternalInstance | null; +/** + * For runtime-dom to register the compiler. + * Note the exported method uses any to avoid d.ts relying on the compiler types. + */ +export declare function registerRuntimeCompiler(_compile: any): void; +export declare const isRuntimeOnly: () => boolean; +export interface ComponentCustomElementInterface { +} + +type MaybeUndefined<T, I> = I extends true ? T | undefined : T; +type MapSources<T, Immediate> = { + [K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never; +}; +export interface WatchEffectOptions extends DebuggerOptions { + flush?: 'pre' | 'post' | 'sync'; +} +export interface WatchOptions<Immediate = boolean> extends WatchEffectOptions { + immediate?: Immediate; + deep?: boolean | number; + once?: boolean; +} +export declare function watchEffect(effect: WatchEffect, options?: WatchEffectOptions): WatchHandle; +export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle; +export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle; +export type MultiWatchSources = (WatchSource<unknown> | object)[]; +export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle; +export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle; +export declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle; +export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle; + +/** + * A lazy hydration strategy for async components. + * @param hydrate - call this to perform the actual hydration. + * @param forEachElement - iterate through the root elements of the component's + * non-hydrated DOM, accounting for possible fragments. + * @returns a teardown function to be called if the async component is unmounted + * before it is hydrated. This can be used to e.g. remove DOM event + * listeners. + */ +export type HydrationStrategy = (hydrate: () => void, forEachElement: (cb: (el: Element) => any) => void) => (() => void) | void; +export type HydrationStrategyFactory<Options> = (options?: Options) => HydrationStrategy; +export declare const hydrateOnIdle: HydrationStrategyFactory<number>; +export declare const hydrateOnVisible: HydrationStrategyFactory<IntersectionObserverInit>; +export declare const hydrateOnMediaQuery: HydrationStrategyFactory<string>; +export declare const hydrateOnInteraction: HydrationStrategyFactory<keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>>; + +type AsyncComponentResolveResult<T = Component> = T | { + default: T; +}; +export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>; +export interface AsyncComponentOptions<T = any> { + loader: AsyncComponentLoader<T>; + loadingComponent?: Component; + errorComponent?: Component; + delay?: number; + timeout?: number; + suspensible?: boolean; + hydrate?: HydrationStrategy; + onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any; +} +/*! #__NO_SIDE_EFFECTS__ */ +export declare function defineAsyncComponent<T extends Component = { + new (): ComponentPublicInstance; +}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T; + +export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T, G = T[K], S = T[K]>(props: T, name: K, options?: DefineModelOptions<T[K], G, S>): ModelRef<T[K], M, G, S>; + +export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>; + +export declare function useId(): string; + +type RawProps = VNodeProps & { + __v_isVNode?: never; + [Symbol.iterator]?: never; +} & Record<string, any>; +type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any); +interface Constructor<P = any> { + __isFragment?: never; + __isTeleport?: never; + __isSuspense?: never; + new (...args: any[]): { + $props: P; + }; +} +type HTMLElementEventHandler = { + [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any; +}; +export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, children?: RawChildren): VNode; +export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, props?: (RawProps & HTMLElementEventHandler) | null, children?: RawChildren | RawSlots): VNode; +export declare function h(type: string, children?: RawChildren): VNode; +export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode; +export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode; +export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode; +export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode; +export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode; +export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode; +export declare function h(type: typeof Suspense, children?: RawChildren): VNode; +export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode; +export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, any, S, any>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): VNode; +export declare function h(type: Component, children?: RawChildren): VNode; +export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode; +export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode; +export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode; +export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode; +export declare function h(type: Constructor, children?: RawChildren): VNode; +export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode; +export declare function h(type: DefineComponent, children?: RawChildren): VNode; +export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode; +export declare function h(type: string | Component, children?: RawChildren): VNode; +export declare function h<P>(type: string | Component<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode; + +export declare const ssrContextKey: unique symbol; +export declare const useSSRContext: <T = Record<string, any>>() => T | undefined; + +declare function warn$1(msg: string, ...args: any[]): void; + +export declare enum ErrorCodes { + SETUP_FUNCTION = 0, + RENDER_FUNCTION = 1, + NATIVE_EVENT_HANDLER = 5, + COMPONENT_EVENT_HANDLER = 6, + VNODE_HOOK = 7, + DIRECTIVE_HOOK = 8, + TRANSITION_HOOK = 9, + APP_ERROR_HANDLER = 10, + APP_WARN_HANDLER = 11, + FUNCTION_REF = 12, + ASYNC_COMPONENT_LOADER = 13, + SCHEDULER = 14, + COMPONENT_UPDATE = 15, + APP_UNMOUNT_CLEANUP = 16 +} +type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes; +export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[]): any; +export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any; +export declare function handleError(err: unknown, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, throwInDev?: boolean): void; + +export declare function initCustomFormatter(): void; + +interface AppRecord { + id: number; + app: App; + version: string; + types: Record<string, string | Symbol>; +} +interface DevtoolsHook { + enabled?: boolean; + emit: (event: string, ...payload: any[]) => void; + on: (event: string, handler: Function) => void; + once: (event: string, handler: Function) => void; + off: (event: string, handler: Function) => void; + appRecords: AppRecord[]; + /** + * Added at https://github.com/vuejs/devtools/commit/f2ad51eea789006ab66942e5a27c0f0986a257f9 + * Returns whether the arg was buffered or not + */ + cleanupBuffer?: (matchArg: unknown) => boolean; +} +declare function setDevtoolsHook$1(hook: DevtoolsHook, target: any): void; + +type HMRComponent = ComponentOptions | ClassComponent; +export interface HMRRuntime { + createRecord: typeof createRecord; + rerender: typeof rerender; + reload: typeof reload; +} +declare function createRecord(id: string, initialDef: HMRComponent): boolean; +declare function rerender(id: string, newRender?: Function): void; +declare function reload(id: string, newComp: HMRComponent): void; + +/** + * Set scope id when creating hoisted vnodes. + * @private compiler helper + */ +export declare function pushScopeId(id: string | null): void; +/** + * Technically we no longer need this after 3.0.8 but we need to keep the same + * API for backwards compat w/ code generated by compilers. + * @private + */ +export declare function popScopeId(): void; +/** + * Only for backwards compat + * @private + */ +export declare const withScopeId: (_id: string) => typeof withCtx; +/** + * Wrap a slot function to memoize current rendering instance + * @private compiler helper + */ +export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function; + +/** + * v-for string + * @private + */ +export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[]; +/** + * v-for number + */ +export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[]; +/** + * v-for array + */ +export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[]; +/** + * v-for iterable + */ +export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[]; +/** + * v-for object + */ +export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: string, index: number) => VNodeChild): VNodeChild[]; + +/** + * For prefixing keys in v-on="obj" with "on" + * @private + */ +export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>; + +/** + * Compiler runtime helper for rendering `<slot/>` + * @private + */ +export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode; + +type SSRSlot = (...args: any[]) => VNode[] | undefined; +interface CompiledSlotDescriptor { + name: string; + fn: SSRSlot; + key?: string; +} +/** + * Compiler runtime helper for creating dynamic slots object + * @private + */ +export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>; + +export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any>; +export declare function isMemoSame(cached: VNode, memo: any[]): boolean; + +export type LegacyConfig = { + /** + * @deprecated `config.silent` option has been removed + */ + silent?: boolean; + /** + * @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead + * https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags + */ + devtools?: boolean; + /** + * @deprecated use `config.isCustomElement` instead + * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement + */ + ignoredElements?: (string | RegExp)[]; + /** + * @deprecated + * https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html + */ + keyCodes?: Record<string, number | number[]>; + /** + * @deprecated + * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed + */ + productionTip?: boolean; +}; + +type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties; +interface LegacyPublicProperties { + $set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void; + $delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void; + $mount(el?: string | Element): this; + $destroy(): void; + $scopedSlots: Slots; + $on(event: string | string[], fn: Function): this; + $once(event: string, fn: Function): this; + $off(event?: string | string[], fn?: Function): this; + $children: LegacyPublicProperties[]; + $listeners: Record<string, Function | Function[]>; +} + +/** + * @deprecated the default `Vue` export has been removed in Vue 3. The type for + * the default export is provided only for migration purposes. Please use + * named imports instead - e.g. `import { createApp } from 'vue'`. + */ +export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & { + configureCompat: typeof configureCompat; + new (options?: ComponentOptions): LegacyPublicInstance; + version: string; + config: AppConfig & LegacyConfig; + nextTick: typeof nextTick; + use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): CompatVue; + use<Options>(plugin: Plugin<Options>, options: Options): CompatVue; + mixin(mixin: ComponentOptions): CompatVue; + component(name: string): Component | undefined; + component(name: string, component: Component): CompatVue; + directive<T = any, V = any>(name: string): Directive<T, V> | undefined; + directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue; + compile(template: string): RenderFunction; + /** + * @deprecated Vue 3 no longer supports extending constructors. + */ + extend: (options?: ComponentOptions) => CompatVue; + /** + * @deprecated Vue 3 no longer needs set() for adding new properties. + */ + set(target: any, key: PropertyKey, value: any): void; + /** + * @deprecated Vue 3 no longer needs delete() for property deletions. + */ + delete(target: any, key: PropertyKey): void; + /** + * @deprecated use `reactive` instead. + */ + observable: typeof reactive; + /** + * @deprecated filters have been removed from Vue 3. + */ + filter(name: string, arg?: any): null; +}; + +export declare const version: string; + +export declare const warn: typeof warn$1; + +export declare const devtools: DevtoolsHook; +export declare const setDevtoolsHook: typeof setDevtoolsHook$1; + +declare module '@vue/reactivity' { + interface RefUnwrapBailTypes { + runtimeCoreBailTypes: VNode | { + $: ComponentInternalInstance; + }; + } +} + +export declare const DeprecationTypes: typeof DeprecationTypes$1; + +export { type WatchEffectOptions as WatchOptionsBase, createBaseVNode as createElementVNode, }; +// Note: this file is auto concatenated to the end of the bundled d.ts during +// build. + +declare module '@vue/runtime-core' { + export interface GlobalComponents { + Teleport: DefineComponent<TeleportProps> + Suspense: DefineComponent<SuspenseProps> + KeepAlive: DefineComponent<KeepAliveProps> + BaseTransition: DefineComponent<BaseTransitionProps> + } +} + +// Note: this file is auto concatenated to the end of the bundled d.ts during +// build. +type _defineProps = typeof defineProps +type _defineEmits = typeof defineEmits +type _defineExpose = typeof defineExpose +type _defineOptions = typeof defineOptions +type _defineSlots = typeof defineSlots +type _defineModel = typeof defineModel +type _withDefaults = typeof withDefaults + +declare global { + const defineProps: _defineProps + const defineEmits: _defineEmits + const defineExpose: _defineExpose + const defineOptions: _defineOptions + const defineSlots: _defineSlots + const defineModel: _defineModel + const withDefaults: _withDefaults +} diff --git a/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js new file mode 100644 index 0000000..ec24dbd --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js @@ -0,0 +1,8419 @@ +/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity'; +export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity'; +import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared'; +export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; + +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function assertNumber(val, type) { + if (!!!(process.env.NODE_ENV !== "production")) return; + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} + +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + if (!!(process.env.NODE_ENV !== "production")) { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } else if (throwInProd) { + throw err; + } else { + console.error(err); + } +} + +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + if (!!(process.env.NODE_ENV !== "production")) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + if (!!(process.env.NODE_ENV !== "production")) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + if (!!(process.env.NODE_ENV !== "production")) { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (!!(process.env.NODE_ENV !== "production") && check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Map(); +if (!!(process.env.NODE_ENV !== "production")) { + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); +} +function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} + +let devtools$1; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } +} +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + !!(process.env.NODE_ENV !== "production") && warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} + +const TeleportEndKey = Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (isString(targetSelector)) { + if (!select) { + !!(process.env.NODE_ENV !== "production") && warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!!(process.env.NODE_ENV !== "production") && !target && !isTeleportDisabled(props)) { + warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); + } + return target; + } + } else { + if (!!(process.env.NODE_ENV !== "production") && !targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; + } +}; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) { + optimized = false; + dynamicChildren = null; + } + if (n1 == null) { + const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText(""); + const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText(""); + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + if (parentComponent && parentComponent.isCE) { + parentComponent.ce._teleportTarget = container2; + } + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = () => { + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = prepareAnchor(target, n2, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (!disabled) { + mount(target, targetAnchor); + updateCssVars(n2, false); + } + } else if (!!(process.env.NODE_ENV !== "production") && !disabled) { + warn$1( + "Invalid Teleport target on mount:", + target, + `(${typeof target})` + ); + } + }; + if (disabled) { + mount(container, mainAnchor); + updateCssVars(n2, true); + } + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(() => { + mountToTarget(); + n2.el.__isMounted = true; + }, parentSuspense); + } else { + mountToTarget(); + } + } else { + if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + queuePostRenderEffect(() => { + TeleportImpl.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + delete n1.el.__isMounted; + }, parentSuspense); + return; + } + n2.el = n1.el; + n2.targetStart = n1.targetStart; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const disabled = isTeleportDisabled(vnode.props); + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetStart = targetNode; + vnode.targetAnchor = targetNode && nextSibling(targetNode); + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target); + insert(targetAnchor, target); + } + return targetAnchor; +} + +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + const child = findNonCommentChild(children); + const rawProps = toRaw(props); + const { mode } = rawProps; + if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid <transition> mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (!!(process.env.NODE_ENV !== "production") && hasFound) { + warn$1( + "<transition> can only be used on a single element or component. Use <transition-group> for lists." + ); + break; + } + child = c; + hasFound = true; + if (!!!(process.env.NODE_ENV !== "production")) break; + } + } + } + return child; +} +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (!!(process.env.NODE_ENV !== "production") && vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `useId() is called when there is no active component instance to be associated with.` + ); + } + return ""; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} + +const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); +function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = shallowRef(null); + if (i) { + const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; + let desc; + if (!!(process.env.NODE_ENV !== "production") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { + warn$1(`useTemplateRef('${key}') already exists.`); + } else { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `useTemplateRef() is called when there is no active component instance to be associated with.` + ); + } + const ret = !!(process.env.NODE_ENV !== "production") ? readonly(r) : r; + if (!!(process.env.NODE_ENV !== "production")) { + knownTemplateRefs.add(ret); + } + return ret; +} + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if (!!(process.env.NODE_ENV !== "production") && !owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { + if (!!(process.env.NODE_ENV !== "production")) { + if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + return hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (isRef(oldRef)) { + oldRef.value = null; + } + } + if (isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = isString(ref); + const _isRef = isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + } +} + +let hasLoggedMismatchError = false; +const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +const isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + def(node, "__vnode", vnode, true); + def(node, "__vueParentComponent", parentComponent, true); + } + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + let hasWarned = false; + while (next) { + if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { + if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + if (el.textContent !== clientText) { + if (!isMismatchAllowed(el, 0 /* TEXT */)) { + (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${el.textContent} + - expected on client: ${vnode.children}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement) { + patchProp(el, key, null, props[key], void 0, parentComponent); + } + } + } else if (props.onClick) { + patchProp( + el, + "onClick", + null, + props.onClick, + void 0, + parentComponent + ); + } else if (patchFlag & 4 && isReactive(props.style)) { + for (const key in props.style) props.style[key]; + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasWarned = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { + if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { + (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; +} +function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + actual = el.getAttribute("class"); + expected = normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2 /* CLASS */; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3 /* STYLE */; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { + if (isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4 /* ATTRIBUTE */; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; +} +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); +} +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; +} +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; +} +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; +} +function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + expectedMap.set( + `--${getEscapedCssVarName(key, false)}`, + String(cssVars[key]) + ); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } +} +const allowMismatchAttr = "data-allow-mismatch"; +const MismatchTypeString = { + [0 /* TEXT */]: "text", + [1 /* CHILDREN */]: "children", + [2 /* CLASS */]: "class", + [3 /* STYLE */]: "style", + [4 /* ATTRIBUTE */]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + const allowedAttr = el && el.getAttribute(allowMismatchAttr); + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 /* TEXT */ && list.includes("children")) { + return true; + } + return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + } +} + +const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { + const id = requestIdleCallback(hydrate, { timeout }); + return () => cancelIdleCallback(id); +}; +function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); +} +const hydrateOnVisible = (opts) => (hydrate, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); +}; +const hydrateOnMediaQuery = (query) => (hydrate) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate(); + } else { + mql.addEventListener("change", hydrate, { once: true }); + return () => mql.removeEventListener("change", hydrate); + } + } +}; +const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { + if (isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; +}; +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!!(process.env.NODE_ENV !== "production") && !comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + hydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : hydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error = ref(); + const delayed = ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; + } + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= ~256; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (isString(pattern)) { + return pattern.split(",").includes(name); + } else if (isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else if (!!(process.env.NODE_ENV !== "production")) { + const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = isArray(source); + if (sourceIsArray || isString(source)) { + const sourceIsReactiveArray = sourceIsArray && isReactive(source); + let needsWrap = false; + if (sourceIsReactiveArray) { + needsWrap = !isShallow(source); + source = shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) { + warn$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + 64 + ); + } + let slot = slots[name]; + if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!!(process.env.NODE_ENV !== "production") && !isObject(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props, + $attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs, + $slots: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.slots) : i.slots, + $refs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.refs) : i.refs, + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type, + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + !!(process.env.NODE_ENV !== "production") && markAttrsAccessed(); + } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + data[key] = value; + return true; + } else if (hasOwn(instance.props, key)) { + !!(process.env.NODE_ENV !== "production") && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + !!(process.env.NODE_ENV !== "production") && warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if (!!(process.env.NODE_ENV !== "production") && key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); + } else { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +if (!!(process.env.NODE_ENV !== "production") && true) { + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` + ); + return Reflect.ownKeys(target); + }; +} +const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !isGloballyAllowed(key); + if (!!(process.env.NODE_ENV !== "production") && !has && PublicInstanceProxyHandlers.has(_, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} should not start with _ which is a reserved prefix for Vue internals.` + ); + } + return has; + } +}); +function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: NOOP + }); + }); + return target; +} +function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: NOOP + }); + }); + } +} +function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys(toRaw(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; + } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: NOOP + }); + } + }); +} + +const warnRuntimeUsage = (method) => warn$1( + `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` +); +function defineProps() { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`defineProps`); + } + return null; +} +function defineEmits() { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`defineEmits`); + } + return null; +} +function defineExpose(exposed) { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`defineExpose`); + } +} +function defineOptions(options) { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`defineOptions`); + } +} +function defineSlots() { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`defineSlots`); + } + return null; +} +function defineModel() { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage("defineModel"); + } +} +function withDefaults(props, defaults) { + if (!!(process.env.NODE_ENV !== "production")) { + warnRuntimeUsage(`withDefaults`); + } + return null; +} +function useSlots() { + return getContext().slots; +} +function useAttrs() { + return getContext().attrs; +} +function getContext() { + const i = getCurrentInstance(); + if (!!(process.env.NODE_ENV !== "production") && !i) { + warn$1(`useContext() called without active instance.`); + } + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} +function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) continue; + let opt = props[key]; + if (opt) { + if (isArray(opt) || isFunction(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; + } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`props default key "${key}" has no corresponding declaration.`); + } + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; +} +function mergeModels(a, b) { + if (!a || !b) return a || b; + if (isArray(a) && isArray(b)) return a.concat(b); + return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +} +function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; +} +function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + if (!!(process.env.NODE_ENV !== "production") && !ctx) { + warn$1( + `withAsyncContext called without active current instance. This is likely a bug.` + ); + } + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if (isPromise(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; +} + +function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); + } else { + cache[key] = type; + } + }; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = !!(process.env.NODE_ENV !== "production") ? createDuplicateChecker() : null; + if (!!(process.env.NODE_ENV !== "production")) { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } + } + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (isFunction(methodHandler)) { + if (!!(process.env.NODE_ENV !== "production")) { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } else { + ctx[key] = methodHandler.bind(publicThis); + } + if (!!(process.env.NODE_ENV !== "production")) { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } + } + } + if (dataOptions) { + if (!!(process.env.NODE_ENV !== "production") && !isFunction(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` + ); + } + const data = dataOptions.call(publicThis, publicThis); + if (!!(process.env.NODE_ENV !== "production") && isPromise(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + ); + } + if (!isObject(data)) { + !!(process.env.NODE_ENV !== "production") && warn$1(`data() should return an object.`); + } else { + instance.data = reactive(data); + if (!!(process.env.NODE_ENV !== "production")) { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: NOOP + }); + } + } + } + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; + if (!!(process.env.NODE_ENV !== "production") && get === NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } : NOOP; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + if (!!(process.env.NODE_ENV !== "production")) { + checkDuplicateProperties("Computed" /* COMPUTED */, key); + } + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { + if (isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + if (!!(process.env.NODE_ENV !== "production")) { + checkDuplicateProperties("Inject" /* INJECT */, key); + } + } +} +function callHook(hook, instance, type) { + callWithAsyncErrorHandling( + isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (isString(raw)) { + const handler = ctx[raw]; + if (isFunction(handler)) { + { + watch(getter, handler); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); + } + } else if (isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (isObject(raw)) { + if (isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction(handler)) { + watch(getter, handler, raw); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); + } + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`Invalid watch option: "${key}"`, raw); + } +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (isObject(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") { + !!(process.env.NODE_ENV !== "production") && warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); + } else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (extend)( + isFunction(to) ? to.call(this, this) : to, + isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray(to) && isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!isFunction(rootComponent)) { + rootComponent = extend({}, rootComponent); + } + if (rootProps != null && !isObject(rootProps)) { + !!(process.env.NODE_ENV !== "production") && warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); + } + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + !!(process.env.NODE_ENV !== "production") && warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); + } + return app; + }, + mixin(mixin) { + if (__VUE_OPTIONS_API__) { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") + ); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1("Mixins are only available in builds supporting Options API"); + } + return app; + }, + component(name, component) { + if (!!(process.env.NODE_ENV !== "production")) { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if (!!(process.env.NODE_ENV !== "production") && context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + if (!!(process.env.NODE_ENV !== "production")) { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if (!!(process.env.NODE_ENV !== "production") && context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + ); + } + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + if (!!(process.env.NODE_ENV !== "production")) { + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + app._instance = vnode.component; + devtoolsInitApp(app, version); + } + return getComponentPublicInstance(vnode.component); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` + ); + } + }, + onUnmount(cleanupFn) { + if (!!(process.env.NODE_ENV !== "production") && typeof cleanupFn !== "function") { + warn$1( + `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` + ); + } + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + app._instance = null; + devtoolsUnmountApp(app); + } + delete app._container.__vue_app__; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`Cannot unmount an app that is not mounted.`); + } + }, + provide(key, value) { + if (!!(process.env.NODE_ENV !== "production") && key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) { + if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`provide() can only be used inside setup().`); + } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`injection "${String(key)}" not found.`); + } + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} +function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); +} + +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + if (!!(process.env.NODE_ENV !== "production")) { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) return true; + instance = instance.parent; + } +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !(!!(process.env.NODE_ENV !== "production") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + trigger(instance.attrs, "set", ""); + } + if (!!(process.env.NODE_ENV !== "production")) { + validateProps(rawProps || {}, props, instance); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && hasOwn(options, camelKey = camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = toRaw(props); + const castValues = rawCastValues || EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (__VUE_OPTIONS_API__ && !isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, EMPTY_ARR); + } + return EMPTY_ARR; + } + if (isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); + } + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = EMPTY_OBJ; + } + } + } else if (raw) { + if (!!(process.env.NODE_ENV !== "production") && !isObject(raw)) { + warn$1(`invalid props options`, raw); + } + for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (isObject(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !isReservedProp(key)) { + return true; + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; +} +function getType(ctor) { + if (ctor === null) { + return "null"; + } + if (typeof ctor === "function") { + return ctor.name || ""; + } else if (typeof ctor === "object") { + const name = ctor.constructor && ctor.constructor.name; + return name || ""; + } + return ""; +} +function validateProps(rawProps, props, instance) { + const resolvedValues = toRaw(props); + const options = instance.propsOptions[0]; + const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); + for (const key in options) { + let opt = options[key]; + if (opt == null) continue; + validateProp( + key, + resolvedValues[key], + opt, + !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues, + !camelizePropsKey.includes(key) + ); + } +} +function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = isArray(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); + return; + } + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } +} +const isSimpleType = /* @__PURE__ */ makeMap( + "String,Number,Boolean,Function,Symbol,BigInt" +); +function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (expectedType === "null") { + valid = value === null; + } else if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; + } + } else if (expectedType === "Object") { + valid = isObject(value); + } else if (expectedType === "Array") { + valid = isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + }; +} +function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; + } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message; +} +function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } +} +function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); +} +function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); +} + +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (!!(process.env.NODE_ENV !== "production") && currentInstance && (!ctx || ctx.root === currentInstance.root)) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + ); + } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + if (!!(process.env.NODE_ENV !== "production") && true) { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + if (!!(process.env.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) { + assignSlots(slots, children, optimized); + trigger(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; + +let supported; +let perf; +function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; + } else { + supported = false; + } + return supported; +} + +function initFeatureFlags() { + const needWarn = []; + if (typeof __VUE_OPTIONS_API__ !== "boolean") { + !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_OPTIONS_API__`); + getGlobalThis().__VUE_OPTIONS_API__ = true; + } + if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") { + !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`); + getGlobalThis().__VUE_PROD_DEVTOOLS__ = false; + } + if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") { + !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`); + getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false; + } + if (!!(process.env.NODE_ENV !== "production") && needWarn.length) { + const multi = needWarn.length > 1; + console.warn( + `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. + +For more details, see https://link.vuejs.org/feature-flags.` + ); + } +} + +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + { + initFeatureFlags(); + } + const target = getGlobalThis(); + target.__VUE__ = true; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else if (!!(process.env.NODE_ENV !== "production")) { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); + } else { + n2.el = n1.el; + n2.anchor = n1.anchor; + } + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + def(el, "__vnode", vnode, true); + def(el, "__vueParentComponent", parentComponent, true); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; + } + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + el.__vnode = n2; + } + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || EMPTY_OBJ; + const newProps = n2.props || EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + if (!!(process.env.NODE_ENV !== "production")) { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== EMPTY_OBJ) { + for (const key in oldProps) { + if (!isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if (!!(process.env.NODE_ENV !== "production") && // #5523 dev root fragment may inherit directives + (isHmrUpdating || patchFlag & 2048)) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + if (!!(process.env.NODE_ENV !== "production")) { + traverseStaticChildren(n1, n2); + } else if ( + // #2080 if the stable fragment has a key, it's a <template v-for> that may + // get moved around. Make sure all root level vnodes inherit el. + // #2134 or if it's a component root, it may also get moved around + // as the component is being moved. + n2.key != null || parentComponent && n2 === parentComponent.subTree + ) { + traverseStaticChildren( + n1, + n2, + true + /* shallow */ + ); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) { + registerHMR(instance); + } + if (!!(process.env.NODE_ENV !== "production")) { + pushWarningContext(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `init`); + } + setupComponent(instance, false, optimized); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `init`); + } + } + if (instance.asyncDep) { + if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null; + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + if (!!(process.env.NODE_ENV !== "production")) { + popWarningContext(); + endMeasure(instance, `mount`); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + if (!!(process.env.NODE_ENV !== "production")) { + pushWarningContext(n2); + } + updateComponentPreRender(instance, n2, optimized); + if (!!(process.env.NODE_ENV !== "production")) { + popWarningContext(); + } + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot(instance); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `render`); + } + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `hydrate`); + } + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot(instance); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `render`); + } + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `patch`); + } + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + if (!!(process.env.NODE_ENV !== "production")) { + pushWarningContext(next || instance.vnode); + } + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot(instance); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentUpdated(instance); + } + if (!!(process.env.NODE_ENV !== "production")) { + popWarningContext(); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + if (!!(process.env.NODE_ENV !== "production")) { + effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; + } + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + pauseTracking(); + flushPreFlushCbs(instance); + resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || EMPTY_ARR; + c2 = c2 || EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + if (!!(process.env.NODE_ENV !== "production") && keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if (!!(process.env.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) { + unregisterHMR(instance); + } + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); + } + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; +} +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; +} +function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } +} +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; +} +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (isArray(ch1) && isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if (!!(process.env.NODE_ENV !== "production") && c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } + } +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } +} +function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } +} + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + !!(process.env.NODE_ENV !== "production") && warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); + } + return ctx; + } +}; + +function watchEffect(effect, options) { + return doWatch(effect, null, options); +} +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" } + ); +} +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" } + ); +} +function watch(source, cb, options) { + if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!!(process.env.NODE_ENV !== "production") && !cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = extend({}, options); + if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1; + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = NOOP; + watchStopHandle.resume = NOOP; + watchStopHandle.pause = NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch$1(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} + +function useModel(props, name, options = EMPTY_OBJ) { + const i = getCurrentInstance(); + if (!!(process.env.NODE_ENV !== "production") && !i) { + warn$1(`useModel() called without active instance.`); + return ref(); + } + const camelizedName = camelize(name); + if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) { + warn$1(`useModel() called with prop "${name}" which is not declared.`); + return ref(); + } + const hyphenatedName = hyphenate(name); + const modifiers = getModelModifiers(props, camelizedName); + const res = customRef((track, trigger) => { + let localValue; + let prevSetValue = EMPTY_OBJ; + let prevEmittedValue; + watchSyncEffect(() => { + const propValue = props[camelizedName]; + if (hasChanged(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const emittedValue = options.set ? options.set(value) : value; + if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) { + return; + } + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { + localValue = value; + trigger(); + } + i.emit(`update:${name}`, emittedValue); + if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) { + trigger(); + } + prevSetValue = value; + prevEmittedValue = emittedValue; + } + }; + }); + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false }; + } else { + return { done: true }; + } + } + }; + }; + return res; +} +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; +}; + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + if (!!(process.env.NODE_ENV !== "production")) { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(looseToNumber); + } + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + devtoolsComponentEmit(instance, event, args); + } + if (!!(process.env.NODE_ENV !== "production")) { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (__VUE_OPTIONS_API__ && !isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + if (!!(process.env.NODE_ENV !== "production")) { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (!!(process.env.NODE_ENV !== "production") && attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode( + render2.length > 1 ? render2( + !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, + !!(process.env.NODE_ENV !== "production") ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` + ); + } + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); + } + setTransitionHooks(root, vnode.transition); + } + if (!!(process.env.NODE_ENV !== "production") && setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { + return getChildRoot(childRoot); + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode(childRoot), setRoot]; +}; +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} + +const isSuspense = (type) => type.__isSuspense; +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (isFunction(eventListener)) { + eventListener(); + } +} +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +let hasWarned = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (!!(process.env.NODE_ENV !== "production") && true && !hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + `<Suspense> is an experimental feature and its API will likely change.` + ); + } + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; + if (!!(process.env.NODE_ENV !== "production")) { + assertNumber(timeout, `Suspense timeout`); + } + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + if (!!(process.env.NODE_ENV !== "production")) { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) === container2) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + if (!!(process.env.NODE_ENV !== "production")) { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + if (!!(process.env.NODE_ENV !== "production")) { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +function normalizeSuspenseSlot(s) { + let block; + if (isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (isArray(s)) { + const singleChild = filterSingleRoot(s); + if (!!(process.env.NODE_ENV !== "production") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn$1(`<Suspense> slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; +} +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; +} + +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +const blockStack = []; +let currentBlock = null; +function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); +} +function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; +} +let isBlockTreeEnabled = 1; +function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } +} +function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); + } + return vnode; +} +function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); +} +function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); +} +function isVNode(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + if (!!(process.env.NODE_ENV !== "production") && n2.shapeFlag & 6 && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type); + if (dirtyInstances && dirtyInstances.has(n1.component)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; + } + } + return n1.type === n2.type && n1.key === n2.key; +} +let vnodeArgsTransformer; +function transformVNodeArgs(transformer) { + vnodeArgsTransformer = transformer; +} +const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args + ); +}; +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +}; +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= isString(children) ? 8 : 16; + } + if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; +} +const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if (!!(process.env.NODE_ENV !== "production") && !type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); + } + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (isObject(style)) { + if (isProxy(style) && !isArray(style)) { + style = extend({}, style); + } + props.style = normalizeStyle(style); + } + } + const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; + if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) { + type = toRaw(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); + } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); +} +function guardReactiveProps(props) { + if (!props) return null; + return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; +} +function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if (isArray(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); + } + return cloned; +} +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); +} +function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } +} +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = normalizeStyle([ret.style, toMerge.style]); + } else if (isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} + +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: EMPTY_OBJ, + data: EMPTY_OBJ, + props: EMPTY_OBJ, + attrs: EMPTY_OBJ, + slots: EMPTY_OBJ, + refs: EMPTY_OBJ, + setupState: EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + if (!!(process.env.NODE_ENV !== "production")) { + instance.ctx = createDevRenderContext(instance); + } else { + instance.ctx = { _: instance }; + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => currentInstance || currentRenderingInstance; +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); +} +const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component"); +function validateComponentName(name, { isNativeTag }) { + if (isBuiltInTag(name) || isNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); + } +} +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + if (!!(process.env.NODE_ENV !== "production")) { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); + } + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); + } + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } + } + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + if (!!(process.env.NODE_ENV !== "production")) { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + !!(process.env.NODE_ENV !== "production") ? shallowReadonly(instance.props) : instance.props, + setupContext + ] + ); + const isAsyncSetup = isPromise(setupResult); + resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } +} +function handleSetupResult(instance, setupResult, isSSR) { + if (isFunction(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if (isObject(setupResult)) { + if (!!(process.env.NODE_ENV !== "production") && isVNode(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = proxyRefs(setupResult); + if (!!(process.env.NODE_ENV !== "production")) { + exposeSetupStateOnRenderContext(instance); + } + } else if (!!(process.env.NODE_ENV !== "production") && setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); +} +let compile; +let installWithProxy; +function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; +} +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template; + if (template) { + if (!!(process.env.NODE_ENV !== "production")) { + startMeasure(instance, `compile`); + } + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = extend( + extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + if (!!(process.env.NODE_ENV !== "production")) { + endMeasure(instance, `compile`); + } + } + } + instance.render = Component.render || NOOP; + if (installWithProxy) { + installWithProxy(instance); + } + } + if (__VUE_OPTIONS_API__ && true) { + const reset = setCurrentInstance(instance); + pauseTracking(); + try { + applyOptions(instance); + } finally { + resetTracking(); + reset(); + } + } + if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) { + if (!compile && Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` ) + ); + } else { + warn$1(`Component is missing template or render function: `, Component); + } + } +} +const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? { + get(target, key) { + markAttrsAccessed(); + track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } +} : { + get(target, key) { + track(target, "get", ""); + return target[key]; + } +}; +function getSlotsProxy(instance) { + return new Proxy(instance.slots, { + get(target, key) { + track(instance, "get", "$slots"); + return target[key]; + } + }); +} +function createSetupContext(instance) { + const expose = (exposed) => { + if (!!(process.env.NODE_ENV !== "production")) { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if (isArray(exposed)) { + exposedType = "array"; + } else if (isRef(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + if (!!(process.env.NODE_ENV !== "production")) { + let attrsProxy; + let slotsProxy; + return Object.freeze({ + get attrs() { + return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); + }, + get slots() { + return slotsProxy || (slotsProxy = getSlotsProxy(instance)); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } else { + return { + attrs: new Proxy(instance.attrs, attrsProxyHandlers), + slots: instance.slots, + emit: instance.emit, + expose + }; + } +} +function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return isFunction(value) && "__vccOpts" in value; +} + +const computed = (getterOrOptions, debugOptions) => { + const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); + if (!!(process.env.NODE_ENV !== "production")) { + const i = getCurrentInstance(); + if (i && i.appContext.config.warnRecursiveComputed) { + c._warnRecursive = true; + } + } + return c; +}; + +function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); + } + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); + } + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; + } + return createVNode(type, propsOrChildren, children); + } +} + +function initCustomFormatter() { + if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") { + return; + } + const vueStyle = { style: "color:#3ba776" }; + const numberStyle = { style: "color:#1677ff" }; + const stringStyle = { style: "color:#f5222d" }; + const keywordStyle = { style: "color:#eb2f96" }; + const formatter = { + __vue_custom_formatter: true, + header(obj) { + if (!isObject(obj)) { + return null; + } + if (obj.__isVue) { + return ["div", vueStyle, `VueInstance`]; + } else if (isRef(obj)) { + return [ + "div", + {}, + ["span", vueStyle, genRefFlag(obj)], + "<", + // avoid debugger accessing value affecting behavior + formatValue("_value" in obj ? obj._value : obj), + `>` + ]; + } else if (isReactive(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], + "<", + formatValue(obj), + `>${isReadonly(obj) ? ` (readonly)` : ``}` + ]; + } else if (isReadonly(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], + "<", + formatValue(obj), + ">" + ]; + } + return null; + }, + hasBody(obj) { + return obj && obj.__isVue; + }, + body(obj) { + if (obj && obj.__isVue) { + return [ + "div", + {}, + ...formatInstance(obj.$) + ]; + } + } + }; + function formatInstance(instance) { + const blocks = []; + if (instance.type.props && instance.props) { + blocks.push(createInstanceBlock("props", toRaw(instance.props))); + } + if (instance.setupState !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("setup", instance.setupState)); + } + if (instance.data !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("data", toRaw(instance.data))); + } + const computed = extractKeys(instance, "computed"); + if (computed) { + blocks.push(createInstanceBlock("computed", computed)); + } + const injected = extractKeys(instance, "inject"); + if (injected) { + blocks.push(createInstanceBlock("injected", injected)); + } + blocks.push([ + "div", + {}, + [ + "span", + { + style: keywordStyle.style + ";opacity:0.66" + }, + "$ (internal): " + ], + ["object", { object: instance }] + ]); + return blocks; + } + function createInstanceBlock(type, target) { + target = extend({}, target); + if (!Object.keys(target).length) { + return ["span", {}]; + } + return [ + "div", + { style: "line-height:1.25em;margin-bottom:0.6em" }, + [ + "div", + { + style: "color:#476582" + }, + type + ], + [ + "div", + { + style: "padding-left:1.25em" + }, + ...Object.keys(target).map((key) => { + return [ + "div", + {}, + ["span", keywordStyle, key + ": "], + formatValue(target[key], false) + ]; + }) + ] + ]; + } + function formatValue(v, asRaw = true) { + if (typeof v === "number") { + return ["span", numberStyle, v]; + } else if (typeof v === "string") { + return ["span", stringStyle, JSON.stringify(v)]; + } else if (typeof v === "boolean") { + return ["span", keywordStyle, v]; + } else if (isObject(v)) { + return ["object", { object: asRaw ? toRaw(v) : v }]; + } else { + return ["span", stringStyle, String(v)]; + } + } + function extractKeys(instance, type) { + const Comp = instance.type; + if (isFunction(Comp)) { + return; + } + const extracted = {}; + for (const key in instance.ctx) { + if (isKeyOfType(Comp, key, type)) { + extracted[key] = instance.ctx[key]; + } + } + return extracted; + } + function isKeyOfType(Comp, key, type) { + const opts = Comp[type]; + if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) { + return true; + } + if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { + return true; + } + if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { + return true; + } + } + function genRefFlag(v) { + if (isShallow(v)) { + return `ShallowRef`; + } + if (v.effect) { + return `ComputedRef`; + } + return `Ref`; + } + if (window.devtoolsFormatters) { + window.devtoolsFormatters.push(formatter); + } else { + window.devtoolsFormatters = [formatter]; + } +} + +function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + ret.cacheIndex = index; + return cache[index] = ret; +} +function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if (hasChanged(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; +} + +const version = "3.5.13"; +const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP; +const ErrorTypeStrings = ErrorTypeStrings$1 ; +const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0; +const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP; +const _ssrUtils = { + createComponentInstance, + setupComponent, + renderComponentRoot, + setCurrentRenderingInstance, + isVNode: isVNode, + normalizeVNode, + getComponentPublicInstance, + ensureValidVNode, + pushWarningContext, + popWarningContext +}; +const ssrUtils = _ssrUtils ; +const resolveFilter = null; +const compatUtils = null; +const DeprecationTypes = null; + +export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId }; diff --git a/seller_1/node_modules/@vue/runtime-core/index.js b/seller_1/node_modules/@vue/runtime-core/index.js new file mode 100644 index 0000000..50c4882 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/runtime-core.cjs.prod.js') +} else { + module.exports = require('./dist/runtime-core.cjs.js') +} diff --git a/seller_1/node_modules/@vue/runtime-core/package.json b/seller_1/node_modules/@vue/runtime-core/package.json new file mode 100644 index 0000000..aefa10c --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-core/package.json @@ -0,0 +1,52 @@ +{ + "name": "@vue/runtime-core", + "version": "3.5.13", + "description": "@vue/runtime-core", + "main": "index.js", + "module": "dist/runtime-core.esm-bundler.js", + "types": "dist/runtime-core.d.ts", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/runtime-core.d.ts", + "node": { + "production": "./dist/runtime-core.cjs.prod.js", + "development": "./dist/runtime-core.cjs.js", + "default": "./index.js" + }, + "module": "./dist/runtime-core.esm-bundler.js", + "import": "./dist/runtime-core.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "buildOptions": { + "name": "VueRuntimeCore", + "formats": [ + "esm-bundler", + "cjs" + ] + }, + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/runtime-core" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme", + "dependencies": { + "@vue/shared": "3.5.13", + "@vue/reactivity": "3.5.13" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/runtime-dom/LICENSE b/seller_1/node_modules/@vue/runtime-dom/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/runtime-dom/README.md b/seller_1/node_modules/@vue/runtime-dom/README.md new file mode 100644 index 0000000..11c373f --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/README.md @@ -0,0 +1,13 @@ +# @vue/runtime-dom + +```js +import { h, createApp } from '@vue/runtime-dom' + +const RootComponent = { + render() { + return h('div', 'hello world') + }, +} + +createApp(RootComponent).mount('#app') +``` diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js new file mode 100644 index 0000000..f18e009 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js @@ -0,0 +1,1820 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var runtimeCore = require('@vue/runtime-core'); +var shared = require('@vue/shared'); + +let policy = void 0; +const tt = typeof window !== "undefined" && window.trustedTypes; +if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + runtimeCore.warn(`Error creating trusted types policy: ${e}`); + } +} +const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; + +const TRANSITION = "transition"; +const ANIMATION = "animation"; +const vtcKey = Symbol("_vtc"); +const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String +}; +const TransitionPropsValidators = /* @__PURE__ */ shared.extend( + {}, + runtimeCore.BaseTransitionPropsValidators, + DOMTransitionPropsValidators +); +const decorate$1 = (t) => { + t.displayName = "Transition"; + t.props = TransitionPropsValidators; + return t; +}; +const Transition = /* @__PURE__ */ decorate$1( + (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots) +); +const callHook = (hook, args = []) => { + if (shared.isArray(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } +}; +const hasExplicitCallback = (hook) => { + return hook ? shared.isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; +}; +function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; + } + } + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done, isCancelled) => { + el._enterCancelled = isCancelled; + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); + }; + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); + }; + }; + return shared.extend(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + if (!el._enterCancelled) { + forceReflow(); + addTransitionClass(el, leaveActiveClass); + } else { + addTransitionClass(el, leaveActiveClass); + forceReflow(); + } + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } + }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false, void 0, true); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true, void 0, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); +} +function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if (shared.isObject(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; + } +} +function NumberOf(val) { + const res = shared.toNumber(val); + { + runtimeCore.assertNumber(res, "<transition> explicit duration"); + } + return res; +} +function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); +} +function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; + } + } +} +function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); + }); +} +let endId = 0; +function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); + } + }; + if (explicitTimeout != null) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); + } + }; + setTimeout(() => { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(endEvent, onEnd); +} +function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; + } + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; +} +function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); +} +function toMs(s) { + if (s === "auto") return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; +} +function forceReflow() { + return document.body.offsetHeight; +} + +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } +} + +const vShowOriginalDisplay = Symbol("_vod"); +const vShowHidden = Symbol("_vsh"); +const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); + } +}; +{ + vShow.name = "show"; +} +function setDisplay(el, value) { + el.style.display = value ? el[vShowOriginalDisplay] : "none"; + el[vShowHidden] = !value; +} +function initVShowForSSR() { + vShow.getSSRProps = ({ value }) => { + if (!value) { + return { style: { display: "none" } }; + } + }; +} + +const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" ); +function useCssVars(getter) { + return; +} + +const displayRE = /(^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = shared.isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!shared.isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } +} +const semicolonRE = /[^\\];\s*$/; +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if (shared.isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + { + if (semicolonRE.test(val)) { + runtimeCore.warn( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } + } + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + shared.hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = runtimeCore.camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = shared.capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !shared.includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : shared.isSymbol(value) ? String(value) : value + ); + } + } +} + +function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = shared.includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + if (!needRemove) { + runtimeCore.warn( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(attrName || key); +} + +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + sanitizeEventValue(nextValue, rawName) , + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : shared.hyphenate(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + runtimeCore.callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function sanitizeEventValue(value, propName) { + if (shared.isFunction(value) || shared.isArray(value)) { + return value; + } + runtimeCore.warn( + `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? +Expected function or array of functions, received type ${typeof value}.` + ); + return shared.NOOP; +} +function patchStopImmediatePropagation(e, value) { + if (shared.isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (shared.isOn(key)) { + if (!shared.isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue)) + ) { + patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } +}; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && shared.isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && shared.isString(value)) { + return false; + } + return key in el; +} + +const REMOVAL = {}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineCustomElement(options, extraOptions, _createApp) { + const Comp = runtimeCore.defineComponent(options, extraOptions); + if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, _createApp); + } + } + VueCustomElement.def = Comp; + return VueCustomElement; +} +/*! #__NO_SIDE_EFFECTS__ */ +const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { + return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); +}; +const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { +}; +class VueElement extends BaseClass { + constructor(_def, _props = {}, _createApp = createApp) { + super(); + this._def = _def; + this._props = _props; + this._createApp = _createApp; + this._isVueCE = true; + /** + * @internal + */ + this._instance = null; + /** + * @internal + */ + this._app = null; + /** + * @internal + */ + this._nonce = this._def.nonce; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._styleChildren = /* @__PURE__ */ new WeakSet(); + this._ob = null; + if (this.shadowRoot && _createApp !== createApp) { + this._root = this.shadowRoot; + } else { + if (this.shadowRoot) { + runtimeCore.warn( + `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + ); + } + if (_def.shadowRoot !== false) { + this.attachShadow({ mode: "open" }); + this._root = this.shadowRoot; + } else { + this._root = this; + } + } + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); + } + } + connectedCallback() { + if (!this.isConnected) return; + if (!this.shadowRoot) { + this._parseSlots(); + } + this._connected = true; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + this._parent = parent; + break; + } + } + if (!this._instance) { + if (this._resolved) { + this._setParent(); + this._update(); + } else { + if (parent && parent._pendingResolve) { + this._pendingResolve = parent._pendingResolve.then(() => { + this._pendingResolve = void 0; + this._resolveDef(); + }); + } else { + this._resolveDef(); + } + } + } + } + _setParent(parent = this._parent) { + if (parent) { + this._instance.parent = parent._instance; + this._instance.provides = parent._instance.provides; + } + } + disconnectedCallback() { + this._connected = false; + runtimeCore.nextTick(() => { + if (!this._connected) { + if (this._ob) { + this._ob.disconnect(); + this._ob = null; + } + this._app && this._app.unmount(); + if (this._instance) this._instance.ce = void 0; + this._app = this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + if (this._pendingResolve) { + return; + } + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); + } + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + this._resolved = true; + this._pendingResolve = void 0; + const { props, styles } = def; + let numberProps; + if (props && !shared.isArray(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = shared.toNumber(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + if (this.shadowRoot) { + this._applyStyles(styles); + } else if (styles) { + runtimeCore.warn( + "Custom element style injection is not supported when using shadowRoot: false" + ); + } + this._mount(def); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + this._pendingResolve = asyncDef().then( + (def) => resolve(this._def = def, true) + ); + } else { + resolve(this._def); + } + } + _mount(def) { + if (!def.name) { + def.name = "VueElement"; + } + this._app = this._createApp(def); + if (def.configureApp) { + def.configureApp(this._app); + } + this._app._ceVNode = this._createVNode(); + this._app.mount(this._root); + const exposed = this._instance && this._instance.exposed; + if (!exposed) return; + for (const key in exposed) { + if (!shared.hasOwn(this, key)) { + Object.defineProperty(this, key, { + // unwrap ref to be consistent with public instance behavior + get: () => runtimeCore.unref(exposed[key]) + }); + } else { + runtimeCore.warn(`Exposed property "${key}" already exists on custom element.`); + } + } + } + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key]); + } + } + for (const key of declaredPropKeys.map(shared.camelize)) { + Object.defineProperty(this, key, { + get() { + return this._getProp(key); + }, + set(val) { + this._setProp(key, val, true, true); + } + }); + } + } + _setAttr(key) { + if (key.startsWith("data-v-")) return; + const has = this.hasAttribute(key); + let value = has ? this.getAttribute(key) : REMOVAL; + const camelKey = shared.camelize(key); + if (has && this._numberProps && this._numberProps[camelKey]) { + value = shared.toNumber(value); + } + this._setProp(camelKey, value, false, true); + } + /** + * @internal + */ + _getProp(key) { + return this._props[key]; + } + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = false) { + if (val !== this._props[key]) { + if (val === REMOVAL) { + delete this._props[key]; + } else { + this._props[key] = val; + if (key === "key" && this._app) { + this._app._ceVNode.key = val; + } + } + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + const ob = this._ob; + ob && ob.disconnect(); + if (val === true) { + this.setAttribute(shared.hyphenate(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute(shared.hyphenate(key), val + ""); + } else if (!val) { + this.removeAttribute(shared.hyphenate(key)); + } + ob && ob.observe(this, { attributes: true }); + } + } + } + _update() { + render(this._createVNode(), this._root); + } + _createVNode() { + const baseProps = {}; + if (!this.shadowRoot) { + baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); + } + const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.ce = this; + instance.isCE = true; + { + instance.ceReload = (newStyles) => { + if (this._styles) { + this._styles.forEach((s) => this._root.removeChild(s)); + this._styles.length = 0; + } + this._applyStyles(newStyles); + this._instance = null; + this._update(); + }; + } + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent( + event, + shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args } + ) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if (shared.hyphenate(event) !== event) { + dispatch(shared.hyphenate(event), args); + } + }; + this._setParent(); + }; + } + return vnode; + } + _applyStyles(styles, owner) { + if (!styles) return; + if (owner) { + if (owner === this._def || this._styleChildren.has(owner)) { + return; + } + this._styleChildren.add(owner); + } + const nonce = this._nonce; + for (let i = styles.length - 1; i >= 0; i--) { + const s = document.createElement("style"); + if (nonce) s.setAttribute("nonce", nonce); + s.textContent = styles[i]; + this.shadowRoot.prepend(s); + { + if (owner) { + if (owner.__hmrId) { + if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); + let entry = this._childStyles.get(owner.__hmrId); + if (!entry) { + this._childStyles.set(owner.__hmrId, entry = []); + } + entry.push(s); + } + } else { + (this._styles || (this._styles = [])).push(s); + } + } + } + } + /** + * Only called when shadowRoot is false + */ + _parseSlots() { + const slots = this._slots = {}; + let n; + while (n = this.firstChild) { + const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; + (slots[slotName] || (slots[slotName] = [])).push(n); + this.removeChild(n); + } + } + /** + * Only called when shadowRoot is false + */ + _renderSlots() { + const outlets = (this._teleportTarget || this).querySelectorAll("slot"); + const scopeId = this._instance.type.__scopeId; + for (let i = 0; i < outlets.length; i++) { + const o = outlets[i]; + const slotName = o.getAttribute("name") || "default"; + const content = this._slots[slotName]; + const parent = o.parentNode; + if (content) { + for (const n of content) { + if (scopeId && n.nodeType === 1) { + const id = scopeId + "-s"; + const walker = document.createTreeWalker(n, 1); + n.setAttribute(id, ""); + let child; + while (child = walker.nextNode()) { + child.setAttribute(id, ""); + } + } + parent.insertBefore(n, o); + } + } else { + while (o.firstChild) parent.insertBefore(o.firstChild, o); + } + parent.removeChild(o); + } + } + /** + * @internal + */ + _injectChildStyle(comp) { + this._applyStyles(comp.styles, comp); + } + /** + * @internal + */ + _removeChildStyle(comp) { + { + this._styleChildren.delete(comp); + if (this._childStyles && comp.__hmrId) { + const oldStyles = this._childStyles.get(comp.__hmrId); + if (oldStyles) { + oldStyles.forEach((s) => this._root.removeChild(s)); + oldStyles.length = 0; + } + } + } + } +} +function useHost(caller) { + const instance = runtimeCore.getCurrentInstance(); + const el = instance && instance.ce; + if (el) { + return el; + } else { + if (!instance) { + runtimeCore.warn( + `${caller || "useHost"} called without an active component instance.` + ); + } else { + runtimeCore.warn( + `${caller || "useHost"} can only be used in components defined via defineCustomElement.` + ); + } + } + return null; +} +function useShadowRoot() { + const el = useHost("useShadowRoot") ; + return el && el.shadowRoot; +} + +function useCssModule(name = "$style") { + { + const instance = runtimeCore.getCurrentInstance(); + if (!instance) { + runtimeCore.warn(`useCssModule must be called inside setup()`); + return shared.EMPTY_OBJ; + } + const modules = instance.type.__cssModules; + if (!modules) { + runtimeCore.warn(`Current instance does not have CSS modules injected.`); + return shared.EMPTY_OBJ; + } + const mod = modules[name]; + if (!mod) { + runtimeCore.warn(`Current instance does not have CSS module named "${name}".`); + return shared.EMPTY_OBJ; + } + return mod; + } +} + +const positionMap = /* @__PURE__ */ new WeakMap(); +const newPositionMap = /* @__PURE__ */ new WeakMap(); +const moveCbKey = Symbol("_moveCb"); +const enterCbKey = Symbol("_enterCb"); +const decorate = (t) => { + delete t.props.mode; + return t; +}; +const TransitionGroupImpl = /* @__PURE__ */ decorate({ + name: "TransitionGroup", + props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = runtimeCore.getCurrentInstance(); + const state = runtimeCore.useTransitionState(); + let prevChildren; + let children; + runtimeCore.onUpdated(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = runtimeCore.toRaw(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || runtimeCore.Fragment; + prevChildren = []; + if (children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.el && child.el instanceof Element) { + prevChildren.push(child); + runtimeCore.setTransitionHooks( + child, + runtimeCore.resolveTransitionHooks( + child, + cssTransitionProps, + state, + instance + ) + ); + positionMap.set( + child, + child.el.getBoundingClientRect() + ); + } + } + } + children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + runtimeCore.setTransitionHooks( + child, + runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance) + ); + } else if (child.type !== runtimeCore.Text) { + runtimeCore.warn(`<TransitionGroup> children must be keyed.`); + } + } + return runtimeCore.createVNode(tag, null, children); + }; + } +}); +const TransitionGroup = TransitionGroupImpl; +function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); + } +} +function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); +} +function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } +} +function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; +} + +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return shared.isArray(fn) ? (value) => shared.invokeArrayFns(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = shared.looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } +}; +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (shared.isArray(modelValue)) { + const index = shared.looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (shared.isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } +}; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (shared.isArray(value)) { + checked = shared.looseIndexOf(value, vnode.props.value) > -1; + } else if (shared.isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = shared.looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = shared.looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = shared.looseEqual(value, vnode.props.value); + } + } +}; +const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = shared.isSet(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? shared.looseToNumber(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + el._assigning = true; + runtimeCore.nextTick(() => { + el._assigning = false; + }); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + if (!el._assigning) { + setSelected(el, value); + } + } +}; +function setSelected(el, value) { + const isMultiple = el.multiple; + const isArrayValue = shared.isArray(value); + if (isMultiple && !isArrayValue && !shared.isSet(value)) { + runtimeCore.warn( + `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` + ); + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if (isArrayValue) { + const optionType = typeof optionValue; + if (optionType === "string" || optionType === "number") { + option.selected = value.some((v) => String(v) === String(optionValue)); + } else { + option.selected = shared.looseIndexOf(value, optionValue) > -1; + } + } else { + option.selected = value.has(optionValue); + } + } else if (shared.looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) el.selectedIndex = i; + return; + } + } + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; + } +} +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); + } +}; +function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; + } + } +} +function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && shared.looseEqual(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if (shared.isArray(value)) { + if (vnode.props && shared.looseIndexOf(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if (shared.isSet(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; + vModelDynamic.getSSRProps = (binding, vnode) => { + if (typeof vnode.type !== "string") { + return; + } + const modelToUse = resolveDynamicModel( + // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase + vnode.type.toUpperCase(), + vnode.props && vnode.props.type + ); + if (modelToUse.getSSRProps) { + return modelToUse.getSSRProps(binding, vnode); + } + }; +} + +const systemModifiers = ["ctrl", "shift", "alt", "meta"]; +const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + }); +}; +const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" +}; +const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; + } + const eventKey = shared.hyphenate(event.key); + if (modifiers.some( + (k) => k === eventKey || keyNames[k] === eventKey + )) { + return fn(event); + } + }); +}; + +const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps); +let renderer; +let enabledHydration = false; +function ensureRenderer() { + return renderer || (renderer = runtimeCore.createRenderer(rendererOptions)); +} +function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : runtimeCore.createHydrationRenderer(rendererOptions); + enabledHydration = true; + return renderer; +} +const render = (...args) => { + ensureRenderer().render(...args); +}; +const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); +}; +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!shared.isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; +}; +const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); + } + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } +} +function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), + writable: false + }); +} +function injectCompilerOptionsCheck(app) { + if (runtimeCore.isRuntimeOnly()) { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + runtimeCore.warn( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + runtimeCore.warn(msg); + return compilerOptions; + }, + set() { + runtimeCore.warn(msg); + } + }); + } +} +function normalizeContainer(container) { + if (shared.isString(container)) { + const res = document.querySelector(container); + if (!res) { + runtimeCore.warn( + `Failed to mount app: mount target selector "${container}" returned null.` + ); + } + return res; + } + if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + runtimeCore.warn( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); + } + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + initVShowForSSR(); + } +} ; + +exports.Transition = Transition; +exports.TransitionGroup = TransitionGroup; +exports.VueElement = VueElement; +exports.createApp = createApp; +exports.createSSRApp = createSSRApp; +exports.defineCustomElement = defineCustomElement; +exports.defineSSRCustomElement = defineSSRCustomElement; +exports.hydrate = hydrate; +exports.initDirectivesForSSR = initDirectivesForSSR; +exports.render = render; +exports.useCssModule = useCssModule; +exports.useCssVars = useCssVars; +exports.useHost = useHost; +exports.useShadowRoot = useShadowRoot; +exports.vModelCheckbox = vModelCheckbox; +exports.vModelDynamic = vModelDynamic; +exports.vModelRadio = vModelRadio; +exports.vModelSelect = vModelSelect; +exports.vModelText = vModelText; +exports.vShow = vShow; +exports.withKeys = withKeys; +exports.withModifiers = withModifiers; +Object.keys(runtimeCore).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeCore[k]; +}); diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js new file mode 100644 index 0000000..9e46c11 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js @@ -0,0 +1,1669 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var runtimeCore = require('@vue/runtime-core'); +var shared = require('@vue/shared'); + +let policy = void 0; +const tt = typeof window !== "undefined" && window.trustedTypes; +if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + } +} +const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; + +const TRANSITION = "transition"; +const ANIMATION = "animation"; +const vtcKey = Symbol("_vtc"); +const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String +}; +const TransitionPropsValidators = /* @__PURE__ */ shared.extend( + {}, + runtimeCore.BaseTransitionPropsValidators, + DOMTransitionPropsValidators +); +const decorate$1 = (t) => { + t.displayName = "Transition"; + t.props = TransitionPropsValidators; + return t; +}; +const Transition = /* @__PURE__ */ decorate$1( + (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots) +); +const callHook = (hook, args = []) => { + if (shared.isArray(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } +}; +const hasExplicitCallback = (hook) => { + return hook ? shared.isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; +}; +function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; + } + } + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done, isCancelled) => { + el._enterCancelled = isCancelled; + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); + }; + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); + }; + }; + return shared.extend(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + if (!el._enterCancelled) { + forceReflow(); + addTransitionClass(el, leaveActiveClass); + } else { + addTransitionClass(el, leaveActiveClass); + forceReflow(); + } + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } + }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false, void 0, true); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true, void 0, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); +} +function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if (shared.isObject(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; + } +} +function NumberOf(val) { + const res = shared.toNumber(val); + return res; +} +function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); +} +function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; + } + } +} +function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); + }); +} +let endId = 0; +function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); + } + }; + if (explicitTimeout != null) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); + } + }; + setTimeout(() => { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(endEvent, onEnd); +} +function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; + } + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; +} +function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); +} +function toMs(s) { + if (s === "auto") return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; +} +function forceReflow() { + return document.body.offsetHeight; +} + +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } +} + +const vShowOriginalDisplay = Symbol("_vod"); +const vShowHidden = Symbol("_vsh"); +const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); + } +}; +function setDisplay(el, value) { + el.style.display = value ? el[vShowOriginalDisplay] : "none"; + el[vShowHidden] = !value; +} +function initVShowForSSR() { + vShow.getSSRProps = ({ value }) => { + if (!value) { + return { style: { display: "none" } }; + } + }; +} + +const CSS_VAR_TEXT = Symbol(""); +function useCssVars(getter) { + return; +} + +const displayRE = /(^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = shared.isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!shared.isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } +} +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if (shared.isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + shared.hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = runtimeCore.camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = shared.capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !shared.includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : shared.isSymbol(value) ? String(value) : value + ); + } + } +} + +function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = shared.includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + } + needRemove && el.removeAttribute(attrName || key); +} + +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = nextValue; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + nextValue, + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : shared.hyphenate(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + runtimeCore.callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function patchStopImmediatePropagation(e, value) { + if (shared.isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (shared.isOn(key)) { + if (!shared.isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue)) + ) { + patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } +}; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && shared.isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && shared.isString(value)) { + return false; + } + return key in el; +} + +const REMOVAL = {}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineCustomElement(options, extraOptions, _createApp) { + const Comp = runtimeCore.defineComponent(options, extraOptions); + if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, _createApp); + } + } + VueCustomElement.def = Comp; + return VueCustomElement; +} +/*! #__NO_SIDE_EFFECTS__ */ +const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { + return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); +}; +const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { +}; +class VueElement extends BaseClass { + constructor(_def, _props = {}, _createApp = createApp) { + super(); + this._def = _def; + this._props = _props; + this._createApp = _createApp; + this._isVueCE = true; + /** + * @internal + */ + this._instance = null; + /** + * @internal + */ + this._app = null; + /** + * @internal + */ + this._nonce = this._def.nonce; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._styleChildren = /* @__PURE__ */ new WeakSet(); + this._ob = null; + if (this.shadowRoot && _createApp !== createApp) { + this._root = this.shadowRoot; + } else { + if (_def.shadowRoot !== false) { + this.attachShadow({ mode: "open" }); + this._root = this.shadowRoot; + } else { + this._root = this; + } + } + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); + } + } + connectedCallback() { + if (!this.isConnected) return; + if (!this.shadowRoot) { + this._parseSlots(); + } + this._connected = true; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + this._parent = parent; + break; + } + } + if (!this._instance) { + if (this._resolved) { + this._setParent(); + this._update(); + } else { + if (parent && parent._pendingResolve) { + this._pendingResolve = parent._pendingResolve.then(() => { + this._pendingResolve = void 0; + this._resolveDef(); + }); + } else { + this._resolveDef(); + } + } + } + } + _setParent(parent = this._parent) { + if (parent) { + this._instance.parent = parent._instance; + this._instance.provides = parent._instance.provides; + } + } + disconnectedCallback() { + this._connected = false; + runtimeCore.nextTick(() => { + if (!this._connected) { + if (this._ob) { + this._ob.disconnect(); + this._ob = null; + } + this._app && this._app.unmount(); + if (this._instance) this._instance.ce = void 0; + this._app = this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + if (this._pendingResolve) { + return; + } + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); + } + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + this._resolved = true; + this._pendingResolve = void 0; + const { props, styles } = def; + let numberProps; + if (props && !shared.isArray(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = shared.toNumber(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + if (this.shadowRoot) { + this._applyStyles(styles); + } + this._mount(def); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + this._pendingResolve = asyncDef().then( + (def) => resolve(this._def = def, true) + ); + } else { + resolve(this._def); + } + } + _mount(def) { + this._app = this._createApp(def); + if (def.configureApp) { + def.configureApp(this._app); + } + this._app._ceVNode = this._createVNode(); + this._app.mount(this._root); + const exposed = this._instance && this._instance.exposed; + if (!exposed) return; + for (const key in exposed) { + if (!shared.hasOwn(this, key)) { + Object.defineProperty(this, key, { + // unwrap ref to be consistent with public instance behavior + get: () => runtimeCore.unref(exposed[key]) + }); + } + } + } + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key]); + } + } + for (const key of declaredPropKeys.map(shared.camelize)) { + Object.defineProperty(this, key, { + get() { + return this._getProp(key); + }, + set(val) { + this._setProp(key, val, true, true); + } + }); + } + } + _setAttr(key) { + if (key.startsWith("data-v-")) return; + const has = this.hasAttribute(key); + let value = has ? this.getAttribute(key) : REMOVAL; + const camelKey = shared.camelize(key); + if (has && this._numberProps && this._numberProps[camelKey]) { + value = shared.toNumber(value); + } + this._setProp(camelKey, value, false, true); + } + /** + * @internal + */ + _getProp(key) { + return this._props[key]; + } + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = false) { + if (val !== this._props[key]) { + if (val === REMOVAL) { + delete this._props[key]; + } else { + this._props[key] = val; + if (key === "key" && this._app) { + this._app._ceVNode.key = val; + } + } + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + const ob = this._ob; + ob && ob.disconnect(); + if (val === true) { + this.setAttribute(shared.hyphenate(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute(shared.hyphenate(key), val + ""); + } else if (!val) { + this.removeAttribute(shared.hyphenate(key)); + } + ob && ob.observe(this, { attributes: true }); + } + } + } + _update() { + render(this._createVNode(), this._root); + } + _createVNode() { + const baseProps = {}; + if (!this.shadowRoot) { + baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); + } + const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.ce = this; + instance.isCE = true; + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent( + event, + shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args } + ) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if (shared.hyphenate(event) !== event) { + dispatch(shared.hyphenate(event), args); + } + }; + this._setParent(); + }; + } + return vnode; + } + _applyStyles(styles, owner) { + if (!styles) return; + if (owner) { + if (owner === this._def || this._styleChildren.has(owner)) { + return; + } + this._styleChildren.add(owner); + } + const nonce = this._nonce; + for (let i = styles.length - 1; i >= 0; i--) { + const s = document.createElement("style"); + if (nonce) s.setAttribute("nonce", nonce); + s.textContent = styles[i]; + this.shadowRoot.prepend(s); + } + } + /** + * Only called when shadowRoot is false + */ + _parseSlots() { + const slots = this._slots = {}; + let n; + while (n = this.firstChild) { + const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; + (slots[slotName] || (slots[slotName] = [])).push(n); + this.removeChild(n); + } + } + /** + * Only called when shadowRoot is false + */ + _renderSlots() { + const outlets = (this._teleportTarget || this).querySelectorAll("slot"); + const scopeId = this._instance.type.__scopeId; + for (let i = 0; i < outlets.length; i++) { + const o = outlets[i]; + const slotName = o.getAttribute("name") || "default"; + const content = this._slots[slotName]; + const parent = o.parentNode; + if (content) { + for (const n of content) { + if (scopeId && n.nodeType === 1) { + const id = scopeId + "-s"; + const walker = document.createTreeWalker(n, 1); + n.setAttribute(id, ""); + let child; + while (child = walker.nextNode()) { + child.setAttribute(id, ""); + } + } + parent.insertBefore(n, o); + } + } else { + while (o.firstChild) parent.insertBefore(o.firstChild, o); + } + parent.removeChild(o); + } + } + /** + * @internal + */ + _injectChildStyle(comp) { + this._applyStyles(comp.styles, comp); + } + /** + * @internal + */ + _removeChildStyle(comp) { + } +} +function useHost(caller) { + const instance = runtimeCore.getCurrentInstance(); + const el = instance && instance.ce; + if (el) { + return el; + } + return null; +} +function useShadowRoot() { + const el = useHost(); + return el && el.shadowRoot; +} + +function useCssModule(name = "$style") { + { + const instance = runtimeCore.getCurrentInstance(); + if (!instance) { + return shared.EMPTY_OBJ; + } + const modules = instance.type.__cssModules; + if (!modules) { + return shared.EMPTY_OBJ; + } + const mod = modules[name]; + if (!mod) { + return shared.EMPTY_OBJ; + } + return mod; + } +} + +const positionMap = /* @__PURE__ */ new WeakMap(); +const newPositionMap = /* @__PURE__ */ new WeakMap(); +const moveCbKey = Symbol("_moveCb"); +const enterCbKey = Symbol("_enterCb"); +const decorate = (t) => { + delete t.props.mode; + return t; +}; +const TransitionGroupImpl = /* @__PURE__ */ decorate({ + name: "TransitionGroup", + props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = runtimeCore.getCurrentInstance(); + const state = runtimeCore.useTransitionState(); + let prevChildren; + let children; + runtimeCore.onUpdated(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = runtimeCore.toRaw(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || runtimeCore.Fragment; + prevChildren = []; + if (children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.el && child.el instanceof Element) { + prevChildren.push(child); + runtimeCore.setTransitionHooks( + child, + runtimeCore.resolveTransitionHooks( + child, + cssTransitionProps, + state, + instance + ) + ); + positionMap.set( + child, + child.el.getBoundingClientRect() + ); + } + } + } + children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + runtimeCore.setTransitionHooks( + child, + runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance) + ); + } + } + return runtimeCore.createVNode(tag, null, children); + }; + } +}); +const TransitionGroup = TransitionGroupImpl; +function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); + } +} +function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); +} +function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } +} +function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; +} + +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return shared.isArray(fn) ? (value) => shared.invokeArrayFns(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = shared.looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } +}; +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (shared.isArray(modelValue)) { + const index = shared.looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (shared.isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } +}; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (shared.isArray(value)) { + checked = shared.looseIndexOf(value, vnode.props.value) > -1; + } else if (shared.isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = shared.looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = shared.looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = shared.looseEqual(value, vnode.props.value); + } + } +}; +const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = shared.isSet(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? shared.looseToNumber(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + el._assigning = true; + runtimeCore.nextTick(() => { + el._assigning = false; + }); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + if (!el._assigning) { + setSelected(el, value); + } + } +}; +function setSelected(el, value) { + const isMultiple = el.multiple; + const isArrayValue = shared.isArray(value); + if (isMultiple && !isArrayValue && !shared.isSet(value)) { + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if (isArrayValue) { + const optionType = typeof optionValue; + if (optionType === "string" || optionType === "number") { + option.selected = value.some((v) => String(v) === String(optionValue)); + } else { + option.selected = shared.looseIndexOf(value, optionValue) > -1; + } + } else { + option.selected = value.has(optionValue); + } + } else if (shared.looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) el.selectedIndex = i; + return; + } + } + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; + } +} +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); + } +}; +function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; + } + } +} +function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && shared.looseEqual(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if (shared.isArray(value)) { + if (vnode.props && shared.looseIndexOf(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if (shared.isSet(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; + vModelDynamic.getSSRProps = (binding, vnode) => { + if (typeof vnode.type !== "string") { + return; + } + const modelToUse = resolveDynamicModel( + // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase + vnode.type.toUpperCase(), + vnode.props && vnode.props.type + ); + if (modelToUse.getSSRProps) { + return modelToUse.getSSRProps(binding, vnode); + } + }; +} + +const systemModifiers = ["ctrl", "shift", "alt", "meta"]; +const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + }); +}; +const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" +}; +const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; + } + const eventKey = shared.hyphenate(event.key); + if (modifiers.some( + (k) => k === eventKey || keyNames[k] === eventKey + )) { + return fn(event); + } + }); +}; + +const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps); +let renderer; +let enabledHydration = false; +function ensureRenderer() { + return renderer || (renderer = runtimeCore.createRenderer(rendererOptions)); +} +function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : runtimeCore.createHydrationRenderer(rendererOptions); + enabledHydration = true; + return renderer; +} +const render = (...args) => { + ensureRenderer().render(...args); +}; +const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); +}; +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!shared.isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; +}; +const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); + } + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } +} +function normalizeContainer(container) { + if (shared.isString(container)) { + const res = document.querySelector(container); + return res; + } + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + initVShowForSSR(); + } +} ; + +exports.Transition = Transition; +exports.TransitionGroup = TransitionGroup; +exports.VueElement = VueElement; +exports.createApp = createApp; +exports.createSSRApp = createSSRApp; +exports.defineCustomElement = defineCustomElement; +exports.defineSSRCustomElement = defineSSRCustomElement; +exports.hydrate = hydrate; +exports.initDirectivesForSSR = initDirectivesForSSR; +exports.render = render; +exports.useCssModule = useCssModule; +exports.useCssVars = useCssVars; +exports.useHost = useHost; +exports.useShadowRoot = useShadowRoot; +exports.vModelCheckbox = vModelCheckbox; +exports.vModelDynamic = vModelDynamic; +exports.vModelRadio = vModelRadio; +exports.vModelSelect = vModelSelect; +exports.vModelText = vModelText; +exports.vShow = vShow; +exports.withKeys = withKeys; +exports.withModifiers = withModifiers; +Object.keys(runtimeCore).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeCore[k]; +}); diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts new file mode 100644 index 0000000..72d2b8b --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts @@ -0,0 +1,1395 @@ +import { BaseTransitionProps, FunctionalComponent, ObjectDirective, Directive, App, SetupContext, RenderFunction, ComponentOptions, ComponentObjectPropsOptions, EmitsOptions, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentInjectOptions, SlotsType, Component, ComponentProvideOptions, ExtractPropTypes, EmitsToProps, ComponentOptionsBase, CreateComponentPublicInstanceWithMixins, ComponentPublicInstance, DefineComponent, ComponentCustomElementInterface, CreateAppFunction, ConcreteComponent, VNodeRef, RootRenderFunction, RootHydrateFunction } from '@vue/runtime-core'; +export * from '@vue/runtime-core'; +import * as CSS from 'csstype'; + +declare const TRANSITION = "transition"; +declare const ANIMATION = "animation"; +type AnimationTypes = typeof TRANSITION | typeof ANIMATION; +export interface TransitionProps extends BaseTransitionProps<Element> { + name?: string; + type?: AnimationTypes; + css?: boolean; + duration?: number | { + enter: number; + leave: number; + }; + enterFromClass?: string; + enterActiveClass?: string; + enterToClass?: string; + appearFromClass?: string; + appearActiveClass?: string; + appearToClass?: string; + leaveFromClass?: string; + leaveActiveClass?: string; + leaveToClass?: string; +} +/** + * DOM Transition is a higher-order-component based on the platform-agnostic + * base Transition component, with DOM-specific logic. + */ +export declare const Transition: FunctionalComponent<TransitionProps>; + +export type TransitionGroupProps = Omit<TransitionProps, 'mode'> & { + tag?: string; + moveClass?: string; +}; +export declare const TransitionGroup: { + new (): { + $props: TransitionGroupProps; + }; +}; + +declare const vShowOriginalDisplay: unique symbol; +declare const vShowHidden: unique symbol; +interface VShowElement extends HTMLElement { + [vShowOriginalDisplay]: string; + [vShowHidden]: boolean; +} +export declare const vShow: ObjectDirective<VShowElement> & { + name?: 'show'; +}; + +declare const systemModifiers: readonly ["ctrl", "shift", "alt", "meta"]; +type SystemModifiers = (typeof systemModifiers)[number]; +type CompatModifiers = keyof typeof keyNames; +type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers; +type ModifierGuards = 'shift' | 'ctrl' | 'alt' | 'meta' | 'left' | 'right' | 'stop' | 'prevent' | 'self' | 'middle' | 'exact'; +/** + * @private + */ +export declare const withModifiers: <T extends (event: Event, ...args: unknown[]) => any>(fn: T & { + _withMods?: { + [key: string]: T; + }; +}, modifiers: VOnModifiers[]) => T; +declare const keyNames: Record<'esc' | 'space' | 'up' | 'left' | 'right' | 'down' | 'delete', string>; +/** + * @private + */ +export declare const withKeys: <T extends (event: KeyboardEvent) => any>(fn: T & { + _withKeys?: { + [k: string]: T; + }; +}, modifiers: string[]) => T; +type VOnDirective = Directive<any, any, VOnModifiers>; + +type AssignerFn = (value: any) => void; +declare const assignKey: unique symbol; +type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & { + [assignKey]: AssignerFn; + _assigning?: boolean; +}, any, Modifiers>; +export declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, 'trim' | 'number' | 'lazy'>; +export declare const vModelCheckbox: ModelDirective<HTMLInputElement>; +export declare const vModelRadio: ModelDirective<HTMLInputElement>; +export declare const vModelSelect: ModelDirective<HTMLSelectElement, 'number'>; +export declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>; +type VModelDirective = typeof vModelText | typeof vModelCheckbox | typeof vModelSelect | typeof vModelRadio | typeof vModelDynamic; + +export type VueElementConstructor<P = {}> = { + new (initialProps?: Record<string, any>): VueElement & P; +}; +export interface CustomElementOptions { + styles?: string[]; + shadowRoot?: boolean; + nonce?: string; + configureApp?: (app: App) => void; +} +export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & { + props?: (keyof Props)[]; +}): VueElementConstructor<Props>; +export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & { + props?: ComponentObjectPropsOptions<Props>; +}): VueElementConstructor<Props>; +export declare function defineCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, PropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, EmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, InferredProps = string extends PropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { + [key in PropsKeys]?: any; +}, ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & { + props?: (RuntimePropsOptions & ThisType<void>) | PropsKeys[]; +} & ComponentOptionsBase<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, // Defaults +InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<Readonly<ResolvedProps>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>, extraOptions?: CustomElementOptions): VueElementConstructor<ResolvedProps>; +export declare function defineCustomElement<T extends { + new (...args: any[]): ComponentPublicInstance<any>; +}>(options: T, extraOptions?: CustomElementOptions): VueElementConstructor<T extends DefineComponent<infer P, any, any, any> ? P : unknown>; +/*! #__NO_SIDE_EFFECTS__ */ +export declare const defineSSRCustomElement: typeof defineCustomElement; +declare const BaseClass: typeof HTMLElement; +type InnerComponentDef = ConcreteComponent & CustomElementOptions; +export declare class VueElement extends BaseClass implements ComponentCustomElementInterface { + /** + * Component def - note this may be an AsyncWrapper, and this._def will + * be overwritten by the inner component when resolved. + */ + private _def; + private _props; + private _createApp; + _isVueCE: boolean; + private _connected; + private _resolved; + private _numberProps; + private _styleChildren; + private _pendingResolve; + private _parent; + /** + * dev only + */ + private _styles?; + /** + * dev only + */ + private _childStyles?; + private _ob?; + private _slots?; + constructor( + /** + * Component def - note this may be an AsyncWrapper, and this._def will + * be overwritten by the inner component when resolved. + */ + _def: InnerComponentDef, _props?: Record<string, any>, _createApp?: CreateAppFunction<Element>); + connectedCallback(): void; + private _setParent; + disconnectedCallback(): void; + /** + * resolve inner component definition (handle possible async component) + */ + private _resolveDef; + private _mount; + private _resolveProps; + protected _setAttr(key: string): void; + private _update; + private _createVNode; + private _applyStyles; + /** + * Only called when shadowRoot is false + */ + private _parseSlots; + /** + * Only called when shadowRoot is false + */ + private _renderSlots; +} +export declare function useHost(caller?: string): VueElement | null; +/** + * Retrieve the shadowRoot of the current custom element. Only usable in setup() + * of a `defineCustomElement` component. + */ +export declare function useShadowRoot(): ShadowRoot | null; + +export declare function useCssModule(name?: string): Record<string, string>; + +/** + * Runtime helper for SFC's CSS variable injection feature. + * @private + */ +export declare function useCssVars(getter: (ctx: any) => Record<string, string>): void; + +export interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> { + /** + * The index signature was removed to enable closed typing for style + * using CSSType. You're able to use type assertion or module augmentation + * to add properties or an index signature of your own. + * + * For examples and more information, visit: + * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors + */ + [v: `--${string}`]: string | number | undefined; +} +type Booleanish = boolean | 'true' | 'false'; +type Numberish = number | string; +export interface AriaAttributes { + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + 'aria-activedescendant'?: string; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ + 'aria-atomic'?: Booleanish; + /** + * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be + * presented if they are made. + */ + 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ + 'aria-busy'?: Booleanish; + /** + * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. + */ + 'aria-checked'?: Booleanish | 'mixed'; + /** + * Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. + */ + 'aria-colcount'?: Numberish; + /** + * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * @see aria-colcount @see aria-colspan. + */ + 'aria-colindex'?: Numberish; + /** + * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. + */ + 'aria-colspan'?: Numberish; + /** + * Identifies the element (or elements) whose contents or presence are controlled by the current element. + * @see aria-owns. + */ + 'aria-controls'?: string; + /** Indicates the element that represents the current item within a container or set of related elements. */ + 'aria-current'?: Booleanish | 'page' | 'step' | 'location' | 'date' | 'time'; + /** + * Identifies the element (or elements) that describes the object. + * @see aria-labelledby + */ + 'aria-describedby'?: string; + /** + * Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. + */ + 'aria-details'?: string; + /** + * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. + */ + 'aria-disabled'?: Booleanish; + /** + * Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 + */ + 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; + /** + * Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. + */ + 'aria-errormessage'?: string; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + 'aria-expanded'?: Booleanish; + /** + * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. + */ + 'aria-flowto'?: string; + /** + * Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 + */ + 'aria-grabbed'?: Booleanish; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ + 'aria-haspopup'?: Booleanish | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; + /** + * Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. + */ + 'aria-hidden'?: Booleanish; + /** + * Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. + */ + 'aria-invalid'?: Booleanish | 'grammar' | 'spelling'; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + 'aria-keyshortcuts'?: string; + /** + * Defines a string value that labels the current element. + * @see aria-labelledby. + */ + 'aria-label'?: string; + /** + * Identifies the element (or elements) that labels the current element. + * @see aria-describedby. + */ + 'aria-labelledby'?: string; + /** Defines the hierarchical level of an element within a structure. */ + 'aria-level'?: Numberish; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ + 'aria-live'?: 'off' | 'assertive' | 'polite'; + /** Indicates whether an element is modal when displayed. */ + 'aria-modal'?: Booleanish; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + 'aria-multiline'?: Booleanish; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + 'aria-multiselectable'?: Booleanish; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + 'aria-orientation'?: 'horizontal' | 'vertical'; + /** + * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. + */ + 'aria-owns'?: string; + /** + * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. + */ + 'aria-placeholder'?: string; + /** + * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-setsize. + */ + 'aria-posinset'?: Numberish; + /** + * Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. + */ + 'aria-pressed'?: Booleanish | 'mixed'; + /** + * Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. + */ + 'aria-readonly'?: Booleanish; + /** + * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. + */ + 'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals'; + /** Indicates that user input is required on the element before a form may be submitted. */ + 'aria-required'?: Booleanish; + /** Defines a human-readable, author-localized description for the role of an element. */ + 'aria-roledescription'?: string; + /** + * Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. + */ + 'aria-rowcount'?: Numberish; + /** + * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. + */ + 'aria-rowindex'?: Numberish; + /** + * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. + */ + 'aria-rowspan'?: Numberish; + /** + * Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. + */ + 'aria-selected'?: Booleanish; + /** + * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-posinset. + */ + 'aria-setsize'?: Numberish; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; + /** Defines the maximum allowed value for a range widget. */ + 'aria-valuemax'?: Numberish; + /** Defines the minimum allowed value for a range widget. */ + 'aria-valuemin'?: Numberish; + /** + * Defines the current value for a range widget. + * @see aria-valuetext. + */ + 'aria-valuenow'?: Numberish; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + 'aria-valuetext'?: string; +} +export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>; +export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> { + innerHTML?: string; + class?: any; + style?: StyleValue; + accesskey?: string; + contenteditable?: Booleanish | 'inherit' | 'plaintext-only'; + contextmenu?: string; + dir?: string; + draggable?: Booleanish; + hidden?: Booleanish | '' | 'hidden' | 'until-found'; + id?: string; + inert?: Booleanish; + lang?: string; + placeholder?: string; + spellcheck?: Booleanish; + tabindex?: Numberish; + title?: string; + translate?: 'yes' | 'no'; + radiogroup?: string; + role?: string; + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + autocapitalize?: string; + autocorrect?: string; + autosave?: string; + color?: string; + itemprop?: string; + itemscope?: Booleanish; + itemtype?: string; + itemid?: string; + itemref?: string; + results?: Numberish; + security?: string; + unselectable?: 'on' | 'off'; + /** + * Hints at the type of data that might be entered by the user while editing the element or its contents + * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute + */ + inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; + /** + * Specify that a standard HTML element should behave like a defined custom built-in element + * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is + */ + is?: string; +} +type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; +export interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string; + hreflang?: string; + media?: string; + ping?: string; + rel?: string; + target?: string; + type?: string; + referrerpolicy?: HTMLAttributeReferrerPolicy; +} +export interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string; + coords?: string; + download?: any; + href?: string; + hreflang?: string; + media?: string; + referrerpolicy?: HTMLAttributeReferrerPolicy; + rel?: string; + shape?: string; + target?: string; +} +export interface AudioHTMLAttributes extends MediaHTMLAttributes { +} +export interface BaseHTMLAttributes extends HTMLAttributes { + href?: string; + target?: string; +} +export interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string; +} +export interface ButtonHTMLAttributes extends HTMLAttributes { + autofocus?: Booleanish; + disabled?: Booleanish; + form?: string; + formaction?: string; + formenctype?: string; + formmethod?: string; + formnovalidate?: Booleanish; + formtarget?: string; + name?: string; + type?: 'submit' | 'reset' | 'button'; + value?: string | ReadonlyArray<string> | number; +} +export interface CanvasHTMLAttributes extends HTMLAttributes { + height?: Numberish; + width?: Numberish; +} +export interface ColHTMLAttributes extends HTMLAttributes { + span?: Numberish; + width?: Numberish; +} +export interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: Numberish; +} +export interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray<string> | number; +} +export interface DetailsHTMLAttributes extends HTMLAttributes { + name?: string; + open?: Booleanish; + onToggle?: (payload: ToggleEvent) => void; +} +export interface DelHTMLAttributes extends HTMLAttributes { + cite?: string; + datetime?: string; +} +export interface DialogHTMLAttributes extends HTMLAttributes { + open?: Booleanish; + onClose?: (payload: Event) => void; +} +export interface EmbedHTMLAttributes extends HTMLAttributes { + height?: Numberish; + src?: string; + type?: string; + width?: Numberish; +} +export interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: Booleanish; + form?: string; + name?: string; +} +export interface FormHTMLAttributes extends HTMLAttributes { + acceptcharset?: string; + action?: string; + autocomplete?: string; + enctype?: string; + method?: string; + name?: string; + novalidate?: Booleanish; + target?: string; +} +export interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string; +} +export interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string; + allowfullscreen?: Booleanish; + allowtransparency?: Booleanish; + /** @deprecated */ + frameborder?: Numberish; + height?: Numberish; + loading?: 'eager' | 'lazy'; + /** @deprecated */ + marginheight?: Numberish; + /** @deprecated */ + marginwidth?: Numberish; + name?: string; + referrerpolicy?: HTMLAttributeReferrerPolicy; + sandbox?: string; + /** @deprecated */ + scrolling?: string; + seamless?: Booleanish; + src?: string; + srcdoc?: string; + width?: Numberish; +} +export interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string; + crossorigin?: 'anonymous' | 'use-credentials' | ''; + decoding?: 'async' | 'auto' | 'sync'; + height?: Numberish; + loading?: 'eager' | 'lazy'; + referrerpolicy?: HTMLAttributeReferrerPolicy; + sizes?: string; + src?: string; + srcset?: string; + usemap?: string; + width?: Numberish; +} +export interface InsHTMLAttributes extends HTMLAttributes { + cite?: string; + datetime?: string; +} +export type InputTypeHTMLAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {}); +export interface InputHTMLAttributes extends HTMLAttributes { + accept?: string; + alt?: string; + autocomplete?: string; + autofocus?: Booleanish; + capture?: boolean | 'user' | 'environment'; + checked?: Booleanish | any[] | Set<any>; + crossorigin?: string; + disabled?: Booleanish; + enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; + form?: string; + formaction?: string; + formenctype?: string; + formmethod?: string; + formnovalidate?: Booleanish; + formtarget?: string; + height?: Numberish; + indeterminate?: boolean; + list?: string; + max?: Numberish; + maxlength?: Numberish; + min?: Numberish; + minlength?: Numberish; + multiple?: Booleanish; + name?: string; + pattern?: string; + placeholder?: string; + readonly?: Booleanish; + required?: Booleanish; + size?: Numberish; + src?: string; + step?: Numberish; + type?: InputTypeHTMLAttribute; + value?: any; + width?: Numberish; +} +export interface KeygenHTMLAttributes extends HTMLAttributes { + autofocus?: Booleanish; + challenge?: string; + disabled?: Booleanish; + form?: string; + keytype?: string; + keyparams?: string; + name?: string; +} +export interface LabelHTMLAttributes extends HTMLAttributes { + for?: string; + form?: string; +} +export interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray<string> | number; +} +export interface LinkHTMLAttributes extends HTMLAttributes { + as?: string; + crossorigin?: string; + href?: string; + hreflang?: string; + integrity?: string; + media?: string; + referrerpolicy?: HTMLAttributeReferrerPolicy; + rel?: string; + sizes?: string; + type?: string; + charset?: string; +} +export interface MapHTMLAttributes extends HTMLAttributes { + name?: string; +} +export interface MenuHTMLAttributes extends HTMLAttributes { + type?: string; +} +export interface MediaHTMLAttributes extends HTMLAttributes { + autoplay?: Booleanish; + controls?: Booleanish; + controlslist?: string; + crossorigin?: string; + loop?: Booleanish; + mediagroup?: string; + muted?: Booleanish; + playsinline?: Booleanish; + preload?: string; + src?: string; +} +export interface MetaHTMLAttributes extends HTMLAttributes { + charset?: string; + content?: string; + httpequiv?: string; + name?: string; +} +export interface MeterHTMLAttributes extends HTMLAttributes { + form?: string; + high?: Numberish; + low?: Numberish; + max?: Numberish; + min?: Numberish; + optimum?: Numberish; + value?: string | ReadonlyArray<string> | number; +} +export interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string; +} +export interface ObjectHTMLAttributes extends HTMLAttributes { + classid?: string; + data?: string; + form?: string; + height?: Numberish; + name?: string; + type?: string; + usemap?: string; + width?: Numberish; + wmode?: string; +} +export interface OlHTMLAttributes extends HTMLAttributes { + reversed?: Booleanish; + start?: Numberish; + type?: '1' | 'a' | 'A' | 'i' | 'I'; +} +export interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: Booleanish; + label?: string; +} +export interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: Booleanish; + label?: string; + selected?: Booleanish; + value?: any; +} +export interface OutputHTMLAttributes extends HTMLAttributes { + for?: string; + form?: string; + name?: string; +} +export interface ParamHTMLAttributes extends HTMLAttributes { + name?: string; + value?: string | ReadonlyArray<string> | number; +} +export interface ProgressHTMLAttributes extends HTMLAttributes { + max?: Numberish; + value?: string | ReadonlyArray<string> | number; +} +export interface ScriptHTMLAttributes extends HTMLAttributes { + async?: Booleanish; + /** @deprecated */ + charset?: string; + crossorigin?: string; + defer?: Booleanish; + integrity?: string; + nomodule?: Booleanish; + referrerpolicy?: HTMLAttributeReferrerPolicy; + nonce?: string; + src?: string; + type?: string; +} +export interface SelectHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: Booleanish; + disabled?: Booleanish; + form?: string; + multiple?: Booleanish; + name?: string; + required?: Booleanish; + size?: Numberish; + value?: any; +} +export interface SourceHTMLAttributes extends HTMLAttributes { + media?: string; + sizes?: string; + src?: string; + srcset?: string; + type?: string; +} +export interface StyleHTMLAttributes extends HTMLAttributes { + media?: string; + nonce?: string; + scoped?: Booleanish; + type?: string; +} +export interface TableHTMLAttributes extends HTMLAttributes { + cellpadding?: Numberish; + cellspacing?: Numberish; + summary?: string; + width?: Numberish; +} +export interface TextareaHTMLAttributes extends HTMLAttributes { + autocomplete?: string; + autofocus?: Booleanish; + cols?: Numberish; + dirname?: string; + disabled?: Booleanish; + form?: string; + maxlength?: Numberish; + minlength?: Numberish; + name?: string; + placeholder?: string; + readonly?: Booleanish; + required?: Booleanish; + rows?: Numberish; + value?: string | ReadonlyArray<string> | number | null; + wrap?: string; +} +export interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char'; + colspan?: Numberish; + headers?: string; + rowspan?: Numberish; + scope?: string; + abbr?: string; + height?: Numberish; + width?: Numberish; + valign?: 'top' | 'middle' | 'bottom' | 'baseline'; +} +export interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char'; + colspan?: Numberish; + headers?: string; + rowspan?: Numberish; + scope?: string; + abbr?: string; +} +export interface TimeHTMLAttributes extends HTMLAttributes { + datetime?: string; +} +export interface TrackHTMLAttributes extends HTMLAttributes { + default?: Booleanish; + kind?: string; + label?: string; + src?: string; + srclang?: string; +} +export interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: Numberish; + playsinline?: Booleanish; + poster?: string; + width?: Numberish; + disablePictureInPicture?: Booleanish; + disableRemotePlayback?: Booleanish; +} +export interface WebViewHTMLAttributes extends HTMLAttributes { + allowfullscreen?: Booleanish; + allowpopups?: Booleanish; + autoFocus?: Booleanish; + autosize?: Booleanish; + blinkfeatures?: string; + disableblinkfeatures?: string; + disableguestresize?: Booleanish; + disablewebsecurity?: Booleanish; + guestinstance?: string; + httpreferrer?: string; + nodeintegration?: Booleanish; + partition?: string; + plugins?: Booleanish; + preload?: string; + src?: string; + useragent?: string; + webpreferences?: string; +} +export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> { + innerHTML?: string; + /** + * SVG Styling Attributes + * @see https://www.w3.org/TR/SVG/styling.html#ElementSpecificStyling + */ + class?: any; + style?: StyleValue; + color?: string; + height?: Numberish; + id?: string; + lang?: string; + max?: Numberish; + media?: string; + method?: string; + min?: Numberish; + name?: string; + target?: string; + type?: string; + width?: Numberish; + role?: string; + tabindex?: Numberish; + crossOrigin?: 'anonymous' | 'use-credentials' | ''; + 'accent-height'?: Numberish; + accumulate?: 'none' | 'sum'; + additive?: 'replace' | 'sum'; + 'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; + allowReorder?: 'no' | 'yes'; + alphabetic?: Numberish; + amplitude?: Numberish; + 'arabic-form'?: 'initial' | 'medial' | 'terminal' | 'isolated'; + ascent?: Numberish; + attributeName?: string; + attributeType?: string; + autoReverse?: Numberish; + azimuth?: Numberish; + baseFrequency?: Numberish; + 'baseline-shift'?: Numberish; + baseProfile?: Numberish; + bbox?: Numberish; + begin?: Numberish; + bias?: Numberish; + by?: Numberish; + calcMode?: Numberish; + 'cap-height'?: Numberish; + clip?: Numberish; + 'clip-path'?: string; + clipPathUnits?: Numberish; + 'clip-rule'?: Numberish; + 'color-interpolation'?: Numberish; + 'color-interpolation-filters'?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit'; + 'color-profile'?: Numberish; + 'color-rendering'?: Numberish; + contentScriptType?: Numberish; + contentStyleType?: Numberish; + cursor?: Numberish; + cx?: Numberish; + cy?: Numberish; + d?: string; + decelerate?: Numberish; + descent?: Numberish; + diffuseConstant?: Numberish; + direction?: Numberish; + display?: Numberish; + divisor?: Numberish; + 'dominant-baseline'?: Numberish; + dur?: Numberish; + dx?: Numberish; + dy?: Numberish; + edgeMode?: Numberish; + elevation?: Numberish; + 'enable-background'?: Numberish; + end?: Numberish; + exponent?: Numberish; + externalResourcesRequired?: Numberish; + fill?: string; + 'fill-opacity'?: Numberish; + 'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit'; + filter?: string; + filterRes?: Numberish; + filterUnits?: Numberish; + 'flood-color'?: Numberish; + 'flood-opacity'?: Numberish; + focusable?: Numberish; + 'font-family'?: string; + 'font-size'?: Numberish; + 'font-size-adjust'?: Numberish; + 'font-stretch'?: Numberish; + 'font-style'?: Numberish; + 'font-variant'?: Numberish; + 'font-weight'?: Numberish; + format?: Numberish; + from?: Numberish; + fx?: Numberish; + fy?: Numberish; + g1?: Numberish; + g2?: Numberish; + 'glyph-name'?: Numberish; + 'glyph-orientation-horizontal'?: Numberish; + 'glyph-orientation-vertical'?: Numberish; + glyphRef?: Numberish; + gradientTransform?: string; + gradientUnits?: string; + hanging?: Numberish; + 'horiz-adv-x'?: Numberish; + 'horiz-origin-x'?: Numberish; + href?: string; + ideographic?: Numberish; + 'image-rendering'?: Numberish; + in2?: Numberish; + in?: string; + intercept?: Numberish; + k1?: Numberish; + k2?: Numberish; + k3?: Numberish; + k4?: Numberish; + k?: Numberish; + kernelMatrix?: Numberish; + kernelUnitLength?: Numberish; + kerning?: Numberish; + keyPoints?: Numberish; + keySplines?: Numberish; + keyTimes?: Numberish; + lengthAdjust?: Numberish; + 'letter-spacing'?: Numberish; + 'lighting-color'?: Numberish; + limitingConeAngle?: Numberish; + local?: Numberish; + 'marker-end'?: string; + markerHeight?: Numberish; + 'marker-mid'?: string; + 'marker-start'?: string; + markerUnits?: Numberish; + markerWidth?: Numberish; + mask?: string; + maskContentUnits?: Numberish; + maskUnits?: Numberish; + mathematical?: Numberish; + mode?: Numberish; + numOctaves?: Numberish; + offset?: Numberish; + opacity?: Numberish; + operator?: Numberish; + order?: Numberish; + orient?: Numberish; + orientation?: Numberish; + origin?: Numberish; + overflow?: Numberish; + 'overline-position'?: Numberish; + 'overline-thickness'?: Numberish; + 'paint-order'?: Numberish; + 'panose-1'?: Numberish; + pathLength?: Numberish; + patternContentUnits?: string; + patternTransform?: Numberish; + patternUnits?: string; + 'pointer-events'?: Numberish; + points?: string; + pointsAtX?: Numberish; + pointsAtY?: Numberish; + pointsAtZ?: Numberish; + preserveAlpha?: Numberish; + preserveAspectRatio?: string; + primitiveUnits?: Numberish; + r?: Numberish; + radius?: Numberish; + refX?: Numberish; + refY?: Numberish; + renderingIntent?: Numberish; + repeatCount?: Numberish; + repeatDur?: Numberish; + requiredExtensions?: Numberish; + requiredFeatures?: Numberish; + restart?: Numberish; + result?: string; + rotate?: Numberish; + rx?: Numberish; + ry?: Numberish; + scale?: Numberish; + seed?: Numberish; + 'shape-rendering'?: Numberish; + slope?: Numberish; + spacing?: Numberish; + specularConstant?: Numberish; + specularExponent?: Numberish; + speed?: Numberish; + spreadMethod?: string; + startOffset?: Numberish; + stdDeviation?: Numberish; + stemh?: Numberish; + stemv?: Numberish; + stitchTiles?: Numberish; + 'stop-color'?: string; + 'stop-opacity'?: Numberish; + 'strikethrough-position'?: Numberish; + 'strikethrough-thickness'?: Numberish; + string?: Numberish; + stroke?: string; + 'stroke-dasharray'?: Numberish; + 'stroke-dashoffset'?: Numberish; + 'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit'; + 'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit'; + 'stroke-miterlimit'?: Numberish; + 'stroke-opacity'?: Numberish; + 'stroke-width'?: Numberish; + surfaceScale?: Numberish; + systemLanguage?: Numberish; + tableValues?: Numberish; + targetX?: Numberish; + targetY?: Numberish; + 'text-anchor'?: string; + 'text-decoration'?: Numberish; + textLength?: Numberish; + 'text-rendering'?: Numberish; + to?: Numberish; + transform?: string; + u1?: Numberish; + u2?: Numberish; + 'underline-position'?: Numberish; + 'underline-thickness'?: Numberish; + unicode?: Numberish; + 'unicode-bidi'?: Numberish; + 'unicode-range'?: Numberish; + 'unitsPer-em'?: Numberish; + 'v-alphabetic'?: Numberish; + values?: string; + 'vector-effect'?: Numberish; + version?: string; + 'vert-adv-y'?: Numberish; + 'vert-origin-x'?: Numberish; + 'vert-origin-y'?: Numberish; + 'v-hanging'?: Numberish; + 'v-ideographic'?: Numberish; + viewBox?: string; + viewTarget?: Numberish; + visibility?: Numberish; + 'v-mathematical'?: Numberish; + widths?: Numberish; + 'word-spacing'?: Numberish; + 'writing-mode'?: Numberish; + x1?: Numberish; + x2?: Numberish; + x?: Numberish; + xChannelSelector?: string; + 'x-height'?: Numberish; + xlinkActuate?: string; + xlinkArcrole?: string; + xlinkHref?: string; + xlinkRole?: string; + xlinkShow?: string; + xlinkTitle?: string; + xlinkType?: string; + xmlns?: string; + xmlnsXlink?: string; + y1?: Numberish; + y2?: Numberish; + y?: Numberish; + yChannelSelector?: string; + z?: Numberish; + zoomAndPan?: string; +} +export interface IntrinsicElementAttributes { + a: AnchorHTMLAttributes; + abbr: HTMLAttributes; + address: HTMLAttributes; + area: AreaHTMLAttributes; + article: HTMLAttributes; + aside: HTMLAttributes; + audio: AudioHTMLAttributes; + b: HTMLAttributes; + base: BaseHTMLAttributes; + bdi: HTMLAttributes; + bdo: HTMLAttributes; + blockquote: BlockquoteHTMLAttributes; + body: HTMLAttributes; + br: HTMLAttributes; + button: ButtonHTMLAttributes; + canvas: CanvasHTMLAttributes; + caption: HTMLAttributes; + cite: HTMLAttributes; + code: HTMLAttributes; + col: ColHTMLAttributes; + colgroup: ColgroupHTMLAttributes; + data: DataHTMLAttributes; + datalist: HTMLAttributes; + dd: HTMLAttributes; + del: DelHTMLAttributes; + details: DetailsHTMLAttributes; + dfn: HTMLAttributes; + dialog: DialogHTMLAttributes; + div: HTMLAttributes; + dl: HTMLAttributes; + dt: HTMLAttributes; + em: HTMLAttributes; + embed: EmbedHTMLAttributes; + fieldset: FieldsetHTMLAttributes; + figcaption: HTMLAttributes; + figure: HTMLAttributes; + footer: HTMLAttributes; + form: FormHTMLAttributes; + h1: HTMLAttributes; + h2: HTMLAttributes; + h3: HTMLAttributes; + h4: HTMLAttributes; + h5: HTMLAttributes; + h6: HTMLAttributes; + head: HTMLAttributes; + header: HTMLAttributes; + hgroup: HTMLAttributes; + hr: HTMLAttributes; + html: HtmlHTMLAttributes; + i: HTMLAttributes; + iframe: IframeHTMLAttributes; + img: ImgHTMLAttributes; + input: InputHTMLAttributes; + ins: InsHTMLAttributes; + kbd: HTMLAttributes; + keygen: KeygenHTMLAttributes; + label: LabelHTMLAttributes; + legend: HTMLAttributes; + li: LiHTMLAttributes; + link: LinkHTMLAttributes; + main: HTMLAttributes; + map: MapHTMLAttributes; + mark: HTMLAttributes; + menu: MenuHTMLAttributes; + meta: MetaHTMLAttributes; + meter: MeterHTMLAttributes; + nav: HTMLAttributes; + noindex: HTMLAttributes; + noscript: HTMLAttributes; + object: ObjectHTMLAttributes; + ol: OlHTMLAttributes; + optgroup: OptgroupHTMLAttributes; + option: OptionHTMLAttributes; + output: OutputHTMLAttributes; + p: HTMLAttributes; + param: ParamHTMLAttributes; + picture: HTMLAttributes; + pre: HTMLAttributes; + progress: ProgressHTMLAttributes; + q: QuoteHTMLAttributes; + rp: HTMLAttributes; + rt: HTMLAttributes; + ruby: HTMLAttributes; + s: HTMLAttributes; + samp: HTMLAttributes; + script: ScriptHTMLAttributes; + section: HTMLAttributes; + select: SelectHTMLAttributes; + small: HTMLAttributes; + source: SourceHTMLAttributes; + span: HTMLAttributes; + strong: HTMLAttributes; + style: StyleHTMLAttributes; + sub: HTMLAttributes; + summary: HTMLAttributes; + sup: HTMLAttributes; + table: TableHTMLAttributes; + template: HTMLAttributes; + tbody: HTMLAttributes; + td: TdHTMLAttributes; + textarea: TextareaHTMLAttributes; + tfoot: HTMLAttributes; + th: ThHTMLAttributes; + thead: HTMLAttributes; + time: TimeHTMLAttributes; + title: HTMLAttributes; + tr: HTMLAttributes; + track: TrackHTMLAttributes; + u: HTMLAttributes; + ul: HTMLAttributes; + var: HTMLAttributes; + video: VideoHTMLAttributes; + wbr: HTMLAttributes; + webview: WebViewHTMLAttributes; + svg: SVGAttributes; + animate: SVGAttributes; + animateMotion: SVGAttributes; + animateTransform: SVGAttributes; + circle: SVGAttributes; + clipPath: SVGAttributes; + defs: SVGAttributes; + desc: SVGAttributes; + ellipse: SVGAttributes; + feBlend: SVGAttributes; + feColorMatrix: SVGAttributes; + feComponentTransfer: SVGAttributes; + feComposite: SVGAttributes; + feConvolveMatrix: SVGAttributes; + feDiffuseLighting: SVGAttributes; + feDisplacementMap: SVGAttributes; + feDistantLight: SVGAttributes; + feDropShadow: SVGAttributes; + feFlood: SVGAttributes; + feFuncA: SVGAttributes; + feFuncB: SVGAttributes; + feFuncG: SVGAttributes; + feFuncR: SVGAttributes; + feGaussianBlur: SVGAttributes; + feImage: SVGAttributes; + feMerge: SVGAttributes; + feMergeNode: SVGAttributes; + feMorphology: SVGAttributes; + feOffset: SVGAttributes; + fePointLight: SVGAttributes; + feSpecularLighting: SVGAttributes; + feSpotLight: SVGAttributes; + feTile: SVGAttributes; + feTurbulence: SVGAttributes; + filter: SVGAttributes; + foreignObject: SVGAttributes; + g: SVGAttributes; + image: SVGAttributes; + line: SVGAttributes; + linearGradient: SVGAttributes; + marker: SVGAttributes; + mask: SVGAttributes; + metadata: SVGAttributes; + mpath: SVGAttributes; + path: SVGAttributes; + pattern: SVGAttributes; + polygon: SVGAttributes; + polyline: SVGAttributes; + radialGradient: SVGAttributes; + rect: SVGAttributes; + stop: SVGAttributes; + switch: SVGAttributes; + symbol: SVGAttributes; + text: SVGAttributes; + textPath: SVGAttributes; + tspan: SVGAttributes; + use: SVGAttributes; + view: SVGAttributes; +} +export interface Events { + onCopy: ClipboardEvent; + onCut: ClipboardEvent; + onPaste: ClipboardEvent; + onCompositionend: CompositionEvent; + onCompositionstart: CompositionEvent; + onCompositionupdate: CompositionEvent; + onDrag: DragEvent; + onDragend: DragEvent; + onDragenter: DragEvent; + onDragexit: DragEvent; + onDragleave: DragEvent; + onDragover: DragEvent; + onDragstart: DragEvent; + onDrop: DragEvent; + onFocus: FocusEvent; + onFocusin: FocusEvent; + onFocusout: FocusEvent; + onBlur: FocusEvent; + onChange: Event; + onBeforeinput: Event; + onInput: Event; + onReset: Event; + onSubmit: Event; + onInvalid: Event; + onLoad: Event; + onError: Event; + onKeydown: KeyboardEvent; + onKeypress: KeyboardEvent; + onKeyup: KeyboardEvent; + onAuxclick: MouseEvent; + onClick: MouseEvent; + onContextmenu: MouseEvent; + onDblclick: MouseEvent; + onMousedown: MouseEvent; + onMouseenter: MouseEvent; + onMouseleave: MouseEvent; + onMousemove: MouseEvent; + onMouseout: MouseEvent; + onMouseover: MouseEvent; + onMouseup: MouseEvent; + onAbort: Event; + onCanplay: Event; + onCanplaythrough: Event; + onDurationchange: Event; + onEmptied: Event; + onEncrypted: Event; + onEnded: Event; + onLoadeddata: Event; + onLoadedmetadata: Event; + onLoadstart: Event; + onPause: Event; + onPlay: Event; + onPlaying: Event; + onProgress: Event; + onRatechange: Event; + onSeeked: Event; + onSeeking: Event; + onStalled: Event; + onSuspend: Event; + onTimeupdate: Event; + onVolumechange: Event; + onWaiting: Event; + onSelect: Event; + onScroll: Event; + onScrollend: Event; + onTouchcancel: TouchEvent; + onTouchend: TouchEvent; + onTouchmove: TouchEvent; + onTouchstart: TouchEvent; + onPointerdown: PointerEvent; + onPointermove: PointerEvent; + onPointerup: PointerEvent; + onPointercancel: PointerEvent; + onPointerenter: PointerEvent; + onPointerleave: PointerEvent; + onPointerover: PointerEvent; + onPointerout: PointerEvent; + onWheel: WheelEvent; + onAnimationstart: AnimationEvent; + onAnimationend: AnimationEvent; + onAnimationiteration: AnimationEvent; + onTransitionend: TransitionEvent; + onTransitionstart: TransitionEvent; +} +type EventHandlers<E> = { + [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void; +}; + +export type ReservedProps = { + key?: PropertyKey; + ref?: VNodeRef; + ref_for?: boolean; + ref_key?: string; +}; +export type NativeElements = { + [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & ReservedProps; +}; + +/** + * This is a stub implementation to prevent the need to use dom types. + * + * To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`. + */ +type DomStub = {}; +type DomType<T> = typeof globalThis extends { + window: unknown; +} ? T : DomStub; +declare module '@vue/reactivity' { + interface RefUnwrapBailTypes { + runtimeDOMBailTypes: DomType<Node | Window>; + } +} +declare module '@vue/runtime-core' { + interface GlobalComponents { + Transition: DefineComponent<TransitionProps>; + TransitionGroup: DefineComponent<TransitionGroupProps>; + } + interface GlobalDirectives { + vShow: typeof vShow; + vOn: VOnDirective; + vBind: VModelDirective; + vIf: Directive<any, boolean>; + VOnce: Directive; + VSlot: Directive; + } +} +export declare const render: RootRenderFunction<Element | ShadowRoot>; +export declare const hydrate: RootHydrateFunction; +export declare const createApp: CreateAppFunction<Element>; +export declare const createSSRApp: CreateAppFunction<Element>; + diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js new file mode 100644 index 0000000..52f8775 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js @@ -0,0 +1,12332 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const EMPTY_ARR = Object.freeze([]) ; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty$1 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} + +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => `\\${s}` + ); +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const isRef$1 = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef$1(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +function warn$2(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn$2(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn$2( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} + +let activeSub; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn$2( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + "Object iterate" +); +const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" +); +const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn$2( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn$2( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn$2( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn$2( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + warn$2( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => isObject(value) ? reactive(value) : value; +const toReadonly = (value) => isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } + } + } +} +function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } + } +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!isProxy(object)) { + warn$2(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn$2("Write operation failed: computed value is readonly"); + } + } +} +function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; +} + +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; + +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn$2( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch$1(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn$2)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function assertNumber(val, type) { + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} + +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings$1[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } +} + +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = (job) => checkRecursiveUpdates(seen, job) ; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Map(); +{ + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); +} +function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} + +let devtools$1; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } +} +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} + +const TeleportEndKey = Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (isString(targetSelector)) { + if (!select) { + warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!target && !isTeleportDisabled(props)) { + warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); + } + return target; + } + } else { + if (!targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; + } +}; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if (isHmrUpdating) { + optimized = false; + dynamicChildren = null; + } + if (n1 == null) { + const placeholder = n2.el = createComment("teleport start") ; + const mainAnchor = n2.anchor = createComment("teleport end") ; + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + if (parentComponent && parentComponent.isCE) { + parentComponent.ce._teleportTarget = container2; + } + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = () => { + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = prepareAnchor(target, n2, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (!disabled) { + mount(target, targetAnchor); + updateCssVars(n2, false); + } + } else if (!disabled) { + warn$1( + "Invalid Teleport target on mount:", + target, + `(${typeof target})` + ); + } + }; + if (disabled) { + mount(container, mainAnchor); + updateCssVars(n2, true); + } + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(() => { + mountToTarget(); + n2.el.__isMounted = true; + }, parentSuspense); + } else { + mountToTarget(); + } + } else { + if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + queuePostRenderEffect(() => { + TeleportImpl.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + delete n1.el.__isMounted; + }, parentSuspense); + return; + } + n2.el = n1.el; + n2.targetStart = n1.targetStart; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const disabled = isTeleportDisabled(vnode.props); + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetStart = targetNode; + vnode.targetAnchor = targetNode && nextSibling(targetNode); + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target); + insert(targetAnchor, target); + } + return targetAnchor; +} + +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey$1 = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + const child = findNonCommentChild(children); + const rawProps = toRaw(props); + const { mode } = rawProps; + if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid <transition> mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (hasFound) { + warn$1( + "<transition> can only be used on a single element or component. Use <transition-group> for lists." + ); + break; + } + child = c; + hasFound = true; + } + } + } + return child; +} +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey$1] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey$1] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey$1]) { + el[enterCbKey$1]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } else { + warn$1( + `useId() is called when there is no active component instance to be associated with.` + ); + } + return ""; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} + +const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); +function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = shallowRef(null); + if (i) { + const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; + let desc; + if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { + warn$1(`useTemplateRef('${key}') already exists.`); + } else { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } else { + warn$1( + `useTemplateRef() is called when there is no active component instance to be associated with.` + ); + } + const ret = readonly(r) ; + { + knownTemplateRefs.add(ret); + } + return ret; +} + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if (!owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { + { + if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + return hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (isRef(oldRef)) { + oldRef.value = null; + } + } + if (isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = isString(ref); + const _isRef = isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + } +} + +let hasLoggedMismatchError = false; +const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +const isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + { + def(node, "__vnode", vnode, true); + def(node, "__vueParentComponent", parentComponent, true); + } + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + let hasWarned = false; + while (next) { + if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + if (el.textContent !== clientText) { + if (!isMismatchAllowed(el, 0 /* TEXT */)) { + warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${el.textContent} + - expected on client: ${vnode.children}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if (// #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement) { + patchProp(el, key, null, props[key], void 0, parentComponent); + } + } + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasWarned = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { + warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; +} +function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + actual = el.getAttribute("class"); + expected = normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2 /* CLASS */; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3 /* STYLE */; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { + if (isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4 /* ATTRIBUTE */; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; +} +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); +} +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; +} +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; +} +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; +} +function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + expectedMap.set( + `--${getEscapedCssVarName(key)}`, + String(cssVars[key]) + ); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } +} +const allowMismatchAttr = "data-allow-mismatch"; +const MismatchTypeString = { + [0 /* TEXT */]: "text", + [1 /* CHILDREN */]: "children", + [2 /* CLASS */]: "class", + [3 /* STYLE */]: "style", + [4 /* ATTRIBUTE */]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + const allowedAttr = el && el.getAttribute(allowMismatchAttr); + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 /* TEXT */ && list.includes("children")) { + return true; + } + return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + } +} + +const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { + const id = requestIdleCallback(hydrate, { timeout }); + return () => cancelIdleCallback(id); +}; +function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); +} +const hydrateOnVisible = (opts) => (hydrate, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); +}; +const hydrateOnMediaQuery = (query) => (hydrate) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate(); + } else { + mql.addEventListener("change", hydrate, { once: true }); + return () => mql.removeEventListener("change", hydrate); + } + } +}; +const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { + if (isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; +}; +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (comp && !isObject(comp) && !isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + hydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : hydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error = ref(); + const delayed = ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; + } + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= ~256; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (isString(pattern)) { + return pattern.split(",").includes(name); + } else if (isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else { + const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else { + warn$1( + `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = isArray(source); + if (sourceIsArray || isString(source)) { + const sourceIsReactiveArray = sourceIsArray && isReactive(source); + let needsWrap = false; + if (sourceIsReactiveArray) { + needsWrap = !isShallow(source); + source = shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + 64 + ); + } + let slot = slots[name]; + if (slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!isObject(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => shallowReadonly(i.props) , + $attrs: (i) => shallowReadonly(i.attrs) , + $slots: (i) => shallowReadonly(i.slots) , + $refs: (i) => shallowReadonly(i.refs) , + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + markAttrsAccessed(); + } else if (key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + data[key] = value; + return true; + } else if (hasOwn(instance.props, key)) { + warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if (key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); + } else { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +{ + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` + ); + return Reflect.ownKeys(target); + }; +} +const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !isGloballyAllowed(key); + if (!has && PublicInstanceProxyHandlers.has(_, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} should not start with _ which is a reserved prefix for Vue internals.` + ); + } + return has; + } +}); +function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: NOOP + }); + }); + return target; +} +function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: NOOP + }); + }); + } +} +function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys(toRaw(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; + } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: NOOP + }); + } + }); +} + +const warnRuntimeUsage = (method) => warn$1( + `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` +); +function defineProps() { + { + warnRuntimeUsage(`defineProps`); + } + return null; +} +function defineEmits() { + { + warnRuntimeUsage(`defineEmits`); + } + return null; +} +function defineExpose(exposed) { + { + warnRuntimeUsage(`defineExpose`); + } +} +function defineOptions(options) { + { + warnRuntimeUsage(`defineOptions`); + } +} +function defineSlots() { + { + warnRuntimeUsage(`defineSlots`); + } + return null; +} +function defineModel() { + { + warnRuntimeUsage("defineModel"); + } +} +function withDefaults(props, defaults) { + { + warnRuntimeUsage(`withDefaults`); + } + return null; +} +function useSlots() { + return getContext().slots; +} +function useAttrs() { + return getContext().attrs; +} +function getContext() { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useContext() called without active instance.`); + } + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} +function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) continue; + let opt = props[key]; + if (opt) { + if (isArray(opt) || isFunction(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; + } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else { + warn$1(`props default key "${key}" has no corresponding declaration.`); + } + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; +} +function mergeModels(a, b) { + if (!a || !b) return a || b; + if (isArray(a) && isArray(b)) return a.concat(b); + return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +} +function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; +} +function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + if (!ctx) { + warn$1( + `withAsyncContext called without active current instance. This is likely a bug.` + ); + } + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if (isPromise(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; +} + +function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); + } else { + cache[key] = type; + } + }; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook$1(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = createDuplicateChecker() ; + { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } + } + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (isFunction(methodHandler)) { + { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } + { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } + } + } + if (dataOptions) { + if (!isFunction(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` + ); + } + const data = dataOptions.call(publicThis, publicThis); + if (isPromise(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + ); + } + if (!isObject(data)) { + warn$1(`data() should return an object.`); + } else { + instance.data = reactive(data); + { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: NOOP + }); + } + } + } + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; + if (get === NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } ; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + { + checkDuplicateProperties("Computed" /* COMPUTED */, key); + } + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook$1(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { + if (isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + { + checkDuplicateProperties("Inject" /* INJECT */, key); + } + } +} +function callHook$1(hook, instance, type) { + callWithAsyncErrorHandling( + isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (isString(raw)) { + const handler = ctx[raw]; + if (isFunction(handler)) { + { + watch(getter, handler); + } + } else { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); + } + } else if (isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (isObject(raw)) { + if (isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction(handler)) { + watch(getter, handler, raw); + } else { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); + } + } + } else { + warn$1(`Invalid watch option: "${key}"`, raw); + } +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (isObject(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") { + warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); + } else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (extend)( + isFunction(to) ? to.call(this, this) : to, + isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray(to) && isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!isFunction(rootComponent)) { + rootComponent = extend({}, rootComponent); + } + if (rootProps != null && !isObject(rootProps)) { + warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); + } + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); + } + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") + ); + } + } + return app; + }, + component(name, component) { + { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if (context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if (context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if (rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + ); + } + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + { + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + { + app._instance = vnode.component; + devtoolsInitApp(app, version); + } + return getComponentPublicInstance(vnode.component); + } else { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` + ); + } + }, + onUnmount(cleanupFn) { + if (typeof cleanupFn !== "function") { + warn$1( + `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` + ); + } + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + { + app._instance = null; + devtoolsUnmountApp(app); + } + delete app._container.__vue_app__; + } else { + warn$1(`Cannot unmount an app that is not mounted.`); + } + }, + provide(key, value) { + if (key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) { + { + warn$1(`provide() can only be used inside setup().`); + } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else { + warn$1(`injection "${String(key)}" not found.`); + } + } else { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} +function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); +} + +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) return true; + instance = instance.parent; + } +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + trigger(instance.attrs, "set", ""); + } + { + validateProps(rawProps || {}, props, instance); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && hasOwn(options, camelKey = camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = toRaw(props); + const castValues = rawCastValues || EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, EMPTY_ARR); + } + return EMPTY_ARR; + } + if (isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + if (!isString(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); + } + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = EMPTY_OBJ; + } + } + } else if (raw) { + if (!isObject(raw)) { + warn$1(`invalid props options`, raw); + } + for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (isObject(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !isReservedProp(key)) { + return true; + } else { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; +} +function getType(ctor) { + if (ctor === null) { + return "null"; + } + if (typeof ctor === "function") { + return ctor.name || ""; + } else if (typeof ctor === "object") { + const name = ctor.constructor && ctor.constructor.name; + return name || ""; + } + return ""; +} +function validateProps(rawProps, props, instance) { + const resolvedValues = toRaw(props); + const options = instance.propsOptions[0]; + const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); + for (const key in options) { + let opt = options[key]; + if (opt == null) continue; + validateProp( + key, + resolvedValues[key], + opt, + shallowReadonly(resolvedValues) , + !camelizePropsKey.includes(key) + ); + } +} +function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = isArray(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); + return; + } + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } +} +const isSimpleType = /* @__PURE__ */ makeMap( + "String,Number,Boolean,Function,Symbol,BigInt" +); +function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (expectedType === "null") { + valid = value === null; + } else if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; + } + } else if (expectedType === "Object") { + valid = isObject(value); + } else if (expectedType === "Array") { + valid = isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + }; +} +function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; + } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message; +} +function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } +} +function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); +} +function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); +} + +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + ); + } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + if (!isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (isHmrUpdating) { + assignSlots(slots, children, optimized); + trigger(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; + +let supported; +let perf; +function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; + } else { + supported = false; + } + return supported; +} + +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + const target = getGlobalThis(); + target.__VUE__ = true; + { + setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); + } else { + n2.el = n1.el; + n2.anchor = n1.anchor; + } + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + { + def(el, "__vnode", vnode, true); + def(el, "__vueParentComponent", parentComponent, true); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; + } + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + { + el.__vnode = n2; + } + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || EMPTY_OBJ; + const newProps = n2.props || EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== EMPTY_OBJ) { + for (const key in oldProps) { + if (!isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if ( + // #5523 dev root fragment may inherit directives + isHmrUpdating || patchFlag & 2048 + ) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if (instance.type.__hmrId) { + registerHMR(instance); + } + { + pushWarningContext(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + { + startMeasure(instance, `init`); + } + setupComponent(instance, false, optimized); + { + endMeasure(instance, `init`); + } + } + if (instance.asyncDep) { + if (isHmrUpdating) initialVNode.el = null; + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + { + popWarningContext(); + endMeasure(instance, `mount`); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + { + pushWarningContext(n2); + } + updateComponentPreRender(instance, n2, optimized); + { + popWarningContext(); + } + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + { + endMeasure(instance, `hydrate`); + } + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + { + pushWarningContext(next || instance.vnode); + } + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + { + devtoolsComponentUpdated(instance); + } + { + popWarningContext(); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + { + effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; + } + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + pauseTracking(); + flushPreFlushCbs(instance); + resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || EMPTY_ARR; + c2 = c2 || EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + if (keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if (instance.type.__hmrId) { + unregisterHMR(instance); + } + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); + } + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; +} +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; +} +function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } +} +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; +} +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (isArray(ch1) && isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if (c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } + } +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } +} +function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } +} + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); + } + return ctx; + } +}; + +function watchEffect(effect, options) { + return doWatch(effect, null, options); +} +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "post" }) + ); +} +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "sync" }) + ); +} +function watch(source, cb, options) { + if (!isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = extend({}, options); + baseWatchOptions.onWarn = warn$1; + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = NOOP; + watchStopHandle.resume = NOOP; + watchStopHandle.pause = NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch$1(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} + +function useModel(props, name, options = EMPTY_OBJ) { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useModel() called without active instance.`); + return ref(); + } + const camelizedName = camelize(name); + if (!i.propsOptions[0][camelizedName]) { + warn$1(`useModel() called with prop "${name}" which is not declared.`); + return ref(); + } + const hyphenatedName = hyphenate(name); + const modifiers = getModelModifiers(props, camelizedName); + const res = customRef((track, trigger) => { + let localValue; + let prevSetValue = EMPTY_OBJ; + let prevEmittedValue; + watchSyncEffect(() => { + const propValue = props[camelizedName]; + if (hasChanged(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const emittedValue = options.set ? options.set(value) : value; + if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) { + return; + } + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { + localValue = value; + trigger(); + } + i.emit(`update:${name}`, emittedValue); + if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) { + trigger(); + } + prevSetValue = value; + prevEmittedValue = emittedValue; + } + }; + }); + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false }; + } else { + return { done: true }; + } + } + }; + }; + return res; +} +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; +}; + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(looseToNumber); + } + } + { + devtoolsComponentEmit(instance, event, args); + } + { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + true ? shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode( + render2.length > 1 ? render2( + true ? shallowReadonly(props) : props, + true ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + true ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } else if (!accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` + ); + } + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); + } + setTransitionHooks(root, vnode.transition); + } + if (setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { + return getChildRoot(childRoot); + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode(childRoot), setRoot]; +}; +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ((prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} + +const isSuspense = (type) => type.__isSuspense; +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (isFunction(eventListener)) { + eventListener(); + } +} +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +let hasWarned = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (!hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + `<Suspense> is an experimental feature and its API will likely change.` + ); + } + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; + { + assertNumber(timeout, `Suspense timeout`); + } + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) === container2) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +function normalizeSuspenseSlot(s) { + let block; + if (isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (isArray(s)) { + const singleChild = filterSingleRoot(s); + if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn$1(`<Suspense> slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; +} +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; +} + +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +const blockStack = []; +let currentBlock = null; +function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); +} +function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; +} +let isBlockTreeEnabled = 1; +function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } +} +function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); + } + return vnode; +} +function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); +} +function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); +} +function isVNode(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + if (n2.shapeFlag & 6 && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type); + if (dirtyInstances && dirtyInstances.has(n1.component)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; + } + } + return n1.type === n2.type && n1.key === n2.key; +} +let vnodeArgsTransformer; +function transformVNodeArgs(transformer) { + vnodeArgsTransformer = transformer; +} +const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args + ); +}; +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +}; +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= isString(children) ? 8 : 16; + } + if (vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; +} +const createVNode = createVNodeWithArgsTransform ; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if (!type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); + } + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (isObject(style)) { + if (isProxy(style) && !isArray(style)) { + style = extend({}, style); + } + props.style = normalizeStyle(style); + } + } + const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; + if (shapeFlag & 4 && isProxy(type)) { + type = toRaw(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); + } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); +} +function guardReactiveProps(props) { + if (!props) return null; + return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; +} +function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if (isArray(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); + } + return cloned; +} +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); +} +function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } +} +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = normalizeStyle([ret.style, toMerge.style]); + } else if (isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} + +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: EMPTY_OBJ, + data: EMPTY_OBJ, + props: EMPTY_OBJ, + attrs: EMPTY_OBJ, + slots: EMPTY_OBJ, + refs: EMPTY_OBJ, + setupState: EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + { + instance.ctx = createDevRenderContext(instance); + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => currentInstance || currentRenderingInstance; +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); +} +const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component"); +function validateComponentName(name, { isNativeTag }) { + if (isBuiltInTag(name) || isNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); + } +} +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); + } + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); + } + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } + } + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + shallowReadonly(instance.props) , + setupContext + ] + ); + const isAsyncSetup = isPromise(setupResult); + resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if (!instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } +} +function handleSetupResult(instance, setupResult, isSSR) { + if (isFunction(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if (isObject(setupResult)) { + if (isVNode(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = proxyRefs(setupResult); + { + exposeSetupStateOnRenderContext(instance); + } + } else if (setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); +} +let compile; +let installWithProxy; +function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; +} +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + { + startMeasure(instance, `compile`); + } + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = extend( + extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + { + endMeasure(instance, `compile`); + } + } + } + instance.render = Component.render || NOOP; + if (installWithProxy) { + installWithProxy(instance); + } + } + { + const reset = setCurrentInstance(instance); + pauseTracking(); + try { + applyOptions(instance); + } finally { + resetTracking(); + reset(); + } + } + if (!Component.render && instance.render === NOOP && !isSSR) { + if (!compile && Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` ) + ); + } else { + warn$1(`Component is missing template or render function: `, Component); + } + } +} +const attrsProxyHandlers = { + get(target, key) { + markAttrsAccessed(); + track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } +} ; +function getSlotsProxy(instance) { + return new Proxy(instance.slots, { + get(target, key) { + track(instance, "get", "$slots"); + return target[key]; + } + }); +} +function createSetupContext(instance) { + const expose = (exposed) => { + { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if (isArray(exposed)) { + exposedType = "array"; + } else if (isRef(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + { + let attrsProxy; + let slotsProxy; + return Object.freeze({ + get attrs() { + return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); + }, + get slots() { + return slotsProxy || (slotsProxy = getSlotsProxy(instance)); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } +} +function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return isFunction(value) && "__vccOpts" in value; +} + +const computed = (getterOrOptions, debugOptions) => { + const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); + { + const i = getCurrentInstance(); + if (i && i.appContext.config.warnRecursiveComputed) { + c._warnRecursive = true; + } + } + return c; +}; + +function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); + } + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); + } + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; + } + return createVNode(type, propsOrChildren, children); + } +} + +function initCustomFormatter() { + if (typeof window === "undefined") { + return; + } + const vueStyle = { style: "color:#3ba776" }; + const numberStyle = { style: "color:#1677ff" }; + const stringStyle = { style: "color:#f5222d" }; + const keywordStyle = { style: "color:#eb2f96" }; + const formatter = { + __vue_custom_formatter: true, + header(obj) { + if (!isObject(obj)) { + return null; + } + if (obj.__isVue) { + return ["div", vueStyle, `VueInstance`]; + } else if (isRef(obj)) { + return [ + "div", + {}, + ["span", vueStyle, genRefFlag(obj)], + "<", + // avoid debugger accessing value affecting behavior + formatValue("_value" in obj ? obj._value : obj), + `>` + ]; + } else if (isReactive(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], + "<", + formatValue(obj), + `>${isReadonly(obj) ? ` (readonly)` : ``}` + ]; + } else if (isReadonly(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], + "<", + formatValue(obj), + ">" + ]; + } + return null; + }, + hasBody(obj) { + return obj && obj.__isVue; + }, + body(obj) { + if (obj && obj.__isVue) { + return [ + "div", + {}, + ...formatInstance(obj.$) + ]; + } + } + }; + function formatInstance(instance) { + const blocks = []; + if (instance.type.props && instance.props) { + blocks.push(createInstanceBlock("props", toRaw(instance.props))); + } + if (instance.setupState !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("setup", instance.setupState)); + } + if (instance.data !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("data", toRaw(instance.data))); + } + const computed = extractKeys(instance, "computed"); + if (computed) { + blocks.push(createInstanceBlock("computed", computed)); + } + const injected = extractKeys(instance, "inject"); + if (injected) { + blocks.push(createInstanceBlock("injected", injected)); + } + blocks.push([ + "div", + {}, + [ + "span", + { + style: keywordStyle.style + ";opacity:0.66" + }, + "$ (internal): " + ], + ["object", { object: instance }] + ]); + return blocks; + } + function createInstanceBlock(type, target) { + target = extend({}, target); + if (!Object.keys(target).length) { + return ["span", {}]; + } + return [ + "div", + { style: "line-height:1.25em;margin-bottom:0.6em" }, + [ + "div", + { + style: "color:#476582" + }, + type + ], + [ + "div", + { + style: "padding-left:1.25em" + }, + ...Object.keys(target).map((key) => { + return [ + "div", + {}, + ["span", keywordStyle, key + ": "], + formatValue(target[key], false) + ]; + }) + ] + ]; + } + function formatValue(v, asRaw = true) { + if (typeof v === "number") { + return ["span", numberStyle, v]; + } else if (typeof v === "string") { + return ["span", stringStyle, JSON.stringify(v)]; + } else if (typeof v === "boolean") { + return ["span", keywordStyle, v]; + } else if (isObject(v)) { + return ["object", { object: asRaw ? toRaw(v) : v }]; + } else { + return ["span", stringStyle, String(v)]; + } + } + function extractKeys(instance, type) { + const Comp = instance.type; + if (isFunction(Comp)) { + return; + } + const extracted = {}; + for (const key in instance.ctx) { + if (isKeyOfType(Comp, key, type)) { + extracted[key] = instance.ctx[key]; + } + } + return extracted; + } + function isKeyOfType(Comp, key, type) { + const opts = Comp[type]; + if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) { + return true; + } + if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { + return true; + } + if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { + return true; + } + } + function genRefFlag(v) { + if (isShallow(v)) { + return `ShallowRef`; + } + if (v.effect) { + return `ComputedRef`; + } + return `Ref`; + } + if (window.devtoolsFormatters) { + window.devtoolsFormatters.push(formatter); + } else { + window.devtoolsFormatters = [formatter]; + } +} + +function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + ret.cacheIndex = index; + return cache[index] = ret; +} +function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if (hasChanged(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; +} + +const version = "3.5.13"; +const warn = warn$1 ; +const ErrorTypeStrings = ErrorTypeStrings$1 ; +const devtools = devtools$1 ; +const setDevtoolsHook = setDevtoolsHook$1 ; +const _ssrUtils = { + createComponentInstance, + setupComponent, + renderComponentRoot, + setCurrentRenderingInstance, + isVNode: isVNode, + normalizeVNode, + getComponentPublicInstance, + ensureValidVNode, + pushWarningContext, + popWarningContext +}; +const ssrUtils = _ssrUtils ; +const resolveFilter = null; +const compatUtils = null; +const DeprecationTypes = null; + +let policy = void 0; +const tt = typeof window !== "undefined" && window.trustedTypes; +if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + warn(`Error creating trusted types policy: ${e}`); + } +} +const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; + +const TRANSITION = "transition"; +const ANIMATION = "animation"; +const vtcKey = Symbol("_vtc"); +const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String +}; +const TransitionPropsValidators = /* @__PURE__ */ extend( + {}, + BaseTransitionPropsValidators, + DOMTransitionPropsValidators +); +const decorate$1 = (t) => { + t.displayName = "Transition"; + t.props = TransitionPropsValidators; + return t; +}; +const Transition = /* @__PURE__ */ decorate$1( + (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots) +); +const callHook = (hook, args = []) => { + if (isArray(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } +}; +const hasExplicitCallback = (hook) => { + return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; +}; +function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; + } + } + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done, isCancelled) => { + el._enterCancelled = isCancelled; + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); + }; + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); + }; + }; + return extend(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + if (!el._enterCancelled) { + forceReflow(); + addTransitionClass(el, leaveActiveClass); + } else { + addTransitionClass(el, leaveActiveClass); + forceReflow(); + } + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } + }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false, void 0, true); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true, void 0, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); +} +function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if (isObject(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; + } +} +function NumberOf(val) { + const res = toNumber(val); + { + assertNumber(res, "<transition> explicit duration"); + } + return res; +} +function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); +} +function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; + } + } +} +function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); + }); +} +let endId = 0; +function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); + } + }; + if (explicitTimeout != null) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); + } + }; + setTimeout(() => { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(endEvent, onEnd); +} +function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; + } + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; +} +function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); +} +function toMs(s) { + if (s === "auto") return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; +} +function forceReflow() { + return document.body.offsetHeight; +} + +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } +} + +const vShowOriginalDisplay = Symbol("_vod"); +const vShowHidden = Symbol("_vsh"); +const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); + } +}; +{ + vShow.name = "show"; +} +function setDisplay(el, value) { + el.style.display = value ? el[vShowOriginalDisplay] : "none"; + el[vShowHidden] = !value; +} +function initVShowForSSR() { + vShow.getSSRProps = ({ value }) => { + if (!value) { + return { style: { display: "none" } }; + } + }; +} + +const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" ); +function useCssVars(getter) { + const instance = getCurrentInstance(); + if (!instance) { + warn(`useCssVars is called without current active component instance.`); + return; + } + const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { + Array.from( + document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) + ).forEach((node) => setVarsOnNode(node, vars)); + }; + { + instance.getCssVars = () => getter(instance.proxy); + } + const setVars = () => { + const vars = getter(instance.proxy); + if (instance.ce) { + setVarsOnNode(instance.ce, vars); + } else { + setVarsOnVNode(instance.subTree, vars); + } + updateTeleports(vars); + }; + onBeforeUpdate(() => { + queuePostFlushCb(setVars); + }); + onMounted(() => { + watch(setVars, NOOP, { flush: "post" }); + const ob = new MutationObserver(setVars); + ob.observe(instance.subTree.el.parentNode, { childList: true }); + onUnmounted(() => ob.disconnect()); + }); +} +function setVarsOnVNode(vnode, vars) { + if (vnode.shapeFlag & 128) { + const suspense = vnode.suspense; + vnode = suspense.activeBranch; + if (suspense.pendingBranch && !suspense.isHydrating) { + suspense.effects.push(() => { + setVarsOnVNode(suspense.activeBranch, vars); + }); + } + } + while (vnode.component) { + vnode = vnode.component.subTree; + } + if (vnode.shapeFlag & 1 && vnode.el) { + setVarsOnNode(vnode.el, vars); + } else if (vnode.type === Fragment) { + vnode.children.forEach((c) => setVarsOnVNode(c, vars)); + } else if (vnode.type === Static) { + let { el, anchor } = vnode; + while (el) { + setVarsOnNode(el, vars); + if (el === anchor) break; + el = el.nextSibling; + } + } +} +function setVarsOnNode(el, vars) { + if (el.nodeType === 1) { + const style = el.style; + let cssText = ""; + for (const key in vars) { + style.setProperty(`--${key}`, vars[key]); + cssText += `--${key}: ${vars[key]};`; + } + style[CSS_VAR_TEXT] = cssText; + } +} + +const displayRE = /(^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } +} +const semicolonRE = /[^\\];\s*$/; +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if (isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + { + if (semicolonRE.test(val)) { + warn( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } + } + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : isSymbol(value) ? String(value) : value + ); + } + } +} + +function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + if (!needRemove) { + warn( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(attrName || key); +} + +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + sanitizeEventValue(nextValue, rawName) , + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function sanitizeEventValue(value, propName) { + if (isFunction(value) || isArray(value)) { + return value; + } + warn( + `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? +Expected function or array of functions, received type ${typeof value}.` + ); + return NOOP; +} +function patchStopImmediatePropagation(e, value) { + if (isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (isOn(key)) { + if (!isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue)) + ) { + patchDOMProp(el, camelize(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } +}; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && isString(value)) { + return false; + } + return key in el; +} + +const REMOVAL = {}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineCustomElement(options, extraOptions, _createApp) { + const Comp = defineComponent(options, extraOptions); + if (isPlainObject(Comp)) extend(Comp, extraOptions); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, _createApp); + } + } + VueCustomElement.def = Comp; + return VueCustomElement; +} +/*! #__NO_SIDE_EFFECTS__ */ +const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { + return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); +}; +const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { +}; +class VueElement extends BaseClass { + constructor(_def, _props = {}, _createApp = createApp) { + super(); + this._def = _def; + this._props = _props; + this._createApp = _createApp; + this._isVueCE = true; + /** + * @internal + */ + this._instance = null; + /** + * @internal + */ + this._app = null; + /** + * @internal + */ + this._nonce = this._def.nonce; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._styleChildren = /* @__PURE__ */ new WeakSet(); + this._ob = null; + if (this.shadowRoot && _createApp !== createApp) { + this._root = this.shadowRoot; + } else { + if (this.shadowRoot) { + warn( + `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + ); + } + if (_def.shadowRoot !== false) { + this.attachShadow({ mode: "open" }); + this._root = this.shadowRoot; + } else { + this._root = this; + } + } + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); + } + } + connectedCallback() { + if (!this.isConnected) return; + if (!this.shadowRoot) { + this._parseSlots(); + } + this._connected = true; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + this._parent = parent; + break; + } + } + if (!this._instance) { + if (this._resolved) { + this._setParent(); + this._update(); + } else { + if (parent && parent._pendingResolve) { + this._pendingResolve = parent._pendingResolve.then(() => { + this._pendingResolve = void 0; + this._resolveDef(); + }); + } else { + this._resolveDef(); + } + } + } + } + _setParent(parent = this._parent) { + if (parent) { + this._instance.parent = parent._instance; + this._instance.provides = parent._instance.provides; + } + } + disconnectedCallback() { + this._connected = false; + nextTick(() => { + if (!this._connected) { + if (this._ob) { + this._ob.disconnect(); + this._ob = null; + } + this._app && this._app.unmount(); + if (this._instance) this._instance.ce = void 0; + this._app = this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + if (this._pendingResolve) { + return; + } + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); + } + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + this._resolved = true; + this._pendingResolve = void 0; + const { props, styles } = def; + let numberProps; + if (props && !isArray(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = toNumber(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + if (this.shadowRoot) { + this._applyStyles(styles); + } else if (styles) { + warn( + "Custom element style injection is not supported when using shadowRoot: false" + ); + } + this._mount(def); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + this._pendingResolve = asyncDef().then( + (def) => resolve(this._def = def, true) + ); + } else { + resolve(this._def); + } + } + _mount(def) { + if (!def.name) { + def.name = "VueElement"; + } + this._app = this._createApp(def); + if (def.configureApp) { + def.configureApp(this._app); + } + this._app._ceVNode = this._createVNode(); + this._app.mount(this._root); + const exposed = this._instance && this._instance.exposed; + if (!exposed) return; + for (const key in exposed) { + if (!hasOwn(this, key)) { + Object.defineProperty(this, key, { + // unwrap ref to be consistent with public instance behavior + get: () => unref(exposed[key]) + }); + } else { + warn(`Exposed property "${key}" already exists on custom element.`); + } + } + } + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = isArray(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key]); + } + } + for (const key of declaredPropKeys.map(camelize)) { + Object.defineProperty(this, key, { + get() { + return this._getProp(key); + }, + set(val) { + this._setProp(key, val, true, true); + } + }); + } + } + _setAttr(key) { + if (key.startsWith("data-v-")) return; + const has = this.hasAttribute(key); + let value = has ? this.getAttribute(key) : REMOVAL; + const camelKey = camelize(key); + if (has && this._numberProps && this._numberProps[camelKey]) { + value = toNumber(value); + } + this._setProp(camelKey, value, false, true); + } + /** + * @internal + */ + _getProp(key) { + return this._props[key]; + } + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = false) { + if (val !== this._props[key]) { + if (val === REMOVAL) { + delete this._props[key]; + } else { + this._props[key] = val; + if (key === "key" && this._app) { + this._app._ceVNode.key = val; + } + } + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + const ob = this._ob; + ob && ob.disconnect(); + if (val === true) { + this.setAttribute(hyphenate(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute(hyphenate(key), val + ""); + } else if (!val) { + this.removeAttribute(hyphenate(key)); + } + ob && ob.observe(this, { attributes: true }); + } + } + } + _update() { + render(this._createVNode(), this._root); + } + _createVNode() { + const baseProps = {}; + if (!this.shadowRoot) { + baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); + } + const vnode = createVNode(this._def, extend(baseProps, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.ce = this; + instance.isCE = true; + { + instance.ceReload = (newStyles) => { + if (this._styles) { + this._styles.forEach((s) => this._root.removeChild(s)); + this._styles.length = 0; + } + this._applyStyles(newStyles); + this._instance = null; + this._update(); + }; + } + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent( + event, + isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args } + ) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if (hyphenate(event) !== event) { + dispatch(hyphenate(event), args); + } + }; + this._setParent(); + }; + } + return vnode; + } + _applyStyles(styles, owner) { + if (!styles) return; + if (owner) { + if (owner === this._def || this._styleChildren.has(owner)) { + return; + } + this._styleChildren.add(owner); + } + const nonce = this._nonce; + for (let i = styles.length - 1; i >= 0; i--) { + const s = document.createElement("style"); + if (nonce) s.setAttribute("nonce", nonce); + s.textContent = styles[i]; + this.shadowRoot.prepend(s); + { + if (owner) { + if (owner.__hmrId) { + if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); + let entry = this._childStyles.get(owner.__hmrId); + if (!entry) { + this._childStyles.set(owner.__hmrId, entry = []); + } + entry.push(s); + } + } else { + (this._styles || (this._styles = [])).push(s); + } + } + } + } + /** + * Only called when shadowRoot is false + */ + _parseSlots() { + const slots = this._slots = {}; + let n; + while (n = this.firstChild) { + const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; + (slots[slotName] || (slots[slotName] = [])).push(n); + this.removeChild(n); + } + } + /** + * Only called when shadowRoot is false + */ + _renderSlots() { + const outlets = (this._teleportTarget || this).querySelectorAll("slot"); + const scopeId = this._instance.type.__scopeId; + for (let i = 0; i < outlets.length; i++) { + const o = outlets[i]; + const slotName = o.getAttribute("name") || "default"; + const content = this._slots[slotName]; + const parent = o.parentNode; + if (content) { + for (const n of content) { + if (scopeId && n.nodeType === 1) { + const id = scopeId + "-s"; + const walker = document.createTreeWalker(n, 1); + n.setAttribute(id, ""); + let child; + while (child = walker.nextNode()) { + child.setAttribute(id, ""); + } + } + parent.insertBefore(n, o); + } + } else { + while (o.firstChild) parent.insertBefore(o.firstChild, o); + } + parent.removeChild(o); + } + } + /** + * @internal + */ + _injectChildStyle(comp) { + this._applyStyles(comp.styles, comp); + } + /** + * @internal + */ + _removeChildStyle(comp) { + { + this._styleChildren.delete(comp); + if (this._childStyles && comp.__hmrId) { + const oldStyles = this._childStyles.get(comp.__hmrId); + if (oldStyles) { + oldStyles.forEach((s) => this._root.removeChild(s)); + oldStyles.length = 0; + } + } + } + } +} +function useHost(caller) { + const instance = getCurrentInstance(); + const el = instance && instance.ce; + if (el) { + return el; + } else { + if (!instance) { + warn( + `${caller || "useHost"} called without an active component instance.` + ); + } else { + warn( + `${caller || "useHost"} can only be used in components defined via defineCustomElement.` + ); + } + } + return null; +} +function useShadowRoot() { + const el = useHost("useShadowRoot") ; + return el && el.shadowRoot; +} + +function useCssModule(name = "$style") { + { + const instance = getCurrentInstance(); + if (!instance) { + warn(`useCssModule must be called inside setup()`); + return EMPTY_OBJ; + } + const modules = instance.type.__cssModules; + if (!modules) { + warn(`Current instance does not have CSS modules injected.`); + return EMPTY_OBJ; + } + const mod = modules[name]; + if (!mod) { + warn(`Current instance does not have CSS module named "${name}".`); + return EMPTY_OBJ; + } + return mod; + } +} + +const positionMap = /* @__PURE__ */ new WeakMap(); +const newPositionMap = /* @__PURE__ */ new WeakMap(); +const moveCbKey = Symbol("_moveCb"); +const enterCbKey = Symbol("_enterCb"); +const decorate = (t) => { + delete t.props.mode; + return t; +}; +const TransitionGroupImpl = /* @__PURE__ */ decorate({ + name: "TransitionGroup", + props: /* @__PURE__ */ extend({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + let prevChildren; + let children; + onUpdated(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = toRaw(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || Fragment; + prevChildren = []; + if (children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.el && child.el instanceof Element) { + prevChildren.push(child); + setTransitionHooks( + child, + resolveTransitionHooks( + child, + cssTransitionProps, + state, + instance + ) + ); + positionMap.set( + child, + child.el.getBoundingClientRect() + ); + } + } + } + children = slots.default ? getTransitionRawChildren(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + setTransitionHooks( + child, + resolveTransitionHooks(child, cssTransitionProps, state, instance) + ); + } else if (child.type !== Text) { + warn(`<TransitionGroup> children must be keyed.`); + } + } + return createVNode(tag, null, children); + }; + } +}); +const TransitionGroup = TransitionGroupImpl; +function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); + } +} +function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); +} +function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } +} +function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; +} + +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } +}; +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (isArray(modelValue)) { + const index = looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } +}; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (isArray(value)) { + checked = looseIndexOf(value, vnode.props.value) > -1; + } else if (isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = looseEqual(value, vnode.props.value); + } + } +}; +const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = isSet(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? looseToNumber(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + el._assigning = true; + nextTick(() => { + el._assigning = false; + }); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + if (!el._assigning) { + setSelected(el, value); + } + } +}; +function setSelected(el, value) { + const isMultiple = el.multiple; + const isArrayValue = isArray(value); + if (isMultiple && !isArrayValue && !isSet(value)) { + warn( + `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` + ); + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if (isArrayValue) { + const optionType = typeof optionValue; + if (optionType === "string" || optionType === "number") { + option.selected = value.some((v) => String(v) === String(optionValue)); + } else { + option.selected = looseIndexOf(value, optionValue) > -1; + } + } else { + option.selected = value.has(optionValue); + } + } else if (looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) el.selectedIndex = i; + return; + } + } + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; + } +} +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); + } +}; +function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; + } + } +} +function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && looseEqual(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if (isArray(value)) { + if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if (isSet(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; + vModelDynamic.getSSRProps = (binding, vnode) => { + if (typeof vnode.type !== "string") { + return; + } + const modelToUse = resolveDynamicModel( + // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase + vnode.type.toUpperCase(), + vnode.props && vnode.props.type + ); + if (modelToUse.getSSRProps) { + return modelToUse.getSSRProps(binding, vnode); + } + }; +} + +const systemModifiers = ["ctrl", "shift", "alt", "meta"]; +const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + }); +}; +const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" +}; +const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; + } + const eventKey = hyphenate(event.key); + if (modifiers.some( + (k) => k === eventKey || keyNames[k] === eventKey + )) { + return fn(event); + } + }); +}; + +const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); +let renderer; +let enabledHydration = false; +function ensureRenderer() { + return renderer || (renderer = createRenderer(rendererOptions)); +} +function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions); + enabledHydration = true; + return renderer; +} +const render = (...args) => { + ensureRenderer().render(...args); +}; +const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); +}; +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; +}; +const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); + } + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } +} +function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + writable: false + }); +} +function injectCompilerOptionsCheck(app) { + if (isRuntimeOnly()) { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + warn( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + warn(msg); + return compilerOptions; + }, + set() { + warn(msg); + } + }); + } +} +function normalizeContainer(container) { + if (isString(container)) { + const res = document.querySelector(container); + if (!res) { + warn( + `Failed to mount app: mount target selector "${container}" returned null.` + ); + } + return res; + } + if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + warn( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); + } + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + initVShowForSSR(); + } +} ; + +export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId }; diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js new file mode 100644 index 0000000..9bf603c --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js @@ -0,0 +1,5 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/var e,t;let n,l,r,i,s,o,a,u,c,f,p,d;function h(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let g={},m=[],_=()=>{},y=()=>!1,b=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),S=e=>e.startsWith("onUpdate:"),C=Object.assign,x=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,w=(e,t)=>E.call(e,t),k=Array.isArray,T=e=>"[object Map]"===F(e),A=e=>"[object Set]"===F(e),R=e=>"[object Date]"===F(e),N=e=>"[object RegExp]"===F(e),O=e=>"function"==typeof e,P=e=>"string"==typeof e,M=e=>"symbol"==typeof e,I=e=>null!==e&&"object"==typeof e,L=e=>(I(e)||O(e))&&O(e.then)&&O(e.catch),D=Object.prototype.toString,F=e=>D.call(e),V=e=>F(e).slice(8,-1),U=e=>"[object Object]"===F(e),j=e=>P(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,B=h(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},H=/-(\w)/g,W=$(e=>e.replace(H,(e,t)=>t?t.toUpperCase():"")),K=/\B([A-Z])/g,z=$(e=>e.replace(K,"-$1").toLowerCase()),q=$(e=>e.charAt(0).toUpperCase()+e.slice(1)),G=$(e=>e?`on${q(e)}`:""),J=(e,t)=>!Object.is(e,t),X=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Z=(e,t,n,l=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},Y=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Q=e=>{let t=P(e)?Number(e):NaN;return isNaN(t)?e:t},ee=()=>n||(n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),et=h("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function en(e){if(k(e)){let t={};for(let n=0;n<e.length;n++){let l=e[n],r=P(l)?function(e){let t={};return e.replace(ei,"").split(el).forEach(e=>{if(e){let n=e.split(er);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):en(l);if(r)for(let e in r)t[e]=r[e]}return t}if(P(e)||I(e))return e}let el=/;(?![^(]*\))/g,er=/:([^]+)/,ei=/\/\*[^]*?\*\//g;function es(e){let t="";if(P(e))t=e;else if(k(e))for(let n=0;n<e.length;n++){let l=es(e[n]);l&&(t+=l+" ")}else if(I(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}function eo(e){if(!e)return null;let{class:t,style:n}=e;return t&&!P(t)&&(e.class=es(t)),n&&(e.style=en(n)),e}let ea=h("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function eu(e,t){if(e===t)return!0;let n=R(e),l=R(t);if(n||l)return!!n&&!!l&&e.getTime()===t.getTime();if(n=M(e),l=M(t),n||l)return e===t;if(n=k(e),l=k(t),n||l)return!!n&&!!l&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let l=0;n&&l<e.length;l++)n=eu(e[l],t[l]);return n}(e,t);if(n=I(e),l=I(t),n||l){if(!n||!l||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let l=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(l&&!r||!l&&r||!eu(e[n],t[n]))return!1}}return String(e)===String(t)}function ec(e,t){return e.findIndex(e=>eu(e,t))}let ef=e=>!!(e&&!0===e.__v_isRef),ep=e=>P(e)?e:null==e?"":k(e)||I(e)&&(e.toString===D||!O(e.toString))?ef(e)?ep(e.value):JSON.stringify(e,ed,2):String(e),ed=(e,t)=>ef(t)?ed(e,t.value):T(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[eh(t,l)+" =>"]=n,e),{})}:A(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eh(e))}:M(t)?eh(t):!I(t)||k(t)||U(t)?t:String(t),eh=(e,t="")=>{var n;return M(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eg{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=l,!e&&l&&(this.index=(l.scopes||(l.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=l;try{return l=this,e()}finally{l=t}}}on(){l=this}off(){l=this.parent}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,this.effects.length=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function ev(e){return new eg(e)}function em(){return l}function e_(e,t=!1){l&&l.cleanups.push(e)}let ey=new WeakSet;class eb{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,l&&l.active&&l.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ey.has(this)&&(ey.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||eC(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,eL(this),eE(this);let e=r,t=eO;r=this,eO=!0;try{return this.fn()}finally{ew(this),r=e,eO=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)eA(e);this.deps=this.depsTail=void 0,eL(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ey.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ek(this)&&this.run()}get dirty(){return ek(this)}}let eS=0;function eC(e,t=!1){if(e.flags|=8,t){e.next=s,s=e;return}e.next=i,i=e}function ex(){let e;if(!(--eS>0)){if(s){let e=s;for(s=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;i;){let t=i;for(i=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eE(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ew(e){let t;let n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eA(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function ek(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eT(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eT(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eD))return;e.globalVersion=eD;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ek(e)){e.flags&=-3;return}let n=r,l=eO;r=e,eO=!0;try{eE(e);let n=e.fn(e._value);(0===t.version||J(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{r=n,eO=l,ew(e),e.flags&=-3}}function eA(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eA(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function eR(e,t){e.effect instanceof eb&&(e=e.effect.fn);let n=new eb(e);t&&C(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l}function eN(e){e.effect.stop()}let eO=!0,eP=[];function eM(){eP.push(eO),eO=!1}function eI(){let e=eP.pop();eO=void 0===e||e}function eL(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=r;r=void 0;try{t()}finally{r=e}}}let eD=0;class eF{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eV{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!r||!eO||r===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==r)t=this.activeLink=new eF(r,this),r.deps?(t.prevDep=r.depsTail,r.depsTail.nextDep=t,r.depsTail=t):r.deps=r.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=r.depsTail,t.nextDep=void 0,r.depsTail.nextDep=t,r.depsTail=t,r.deps===t&&(r.deps=e)}return t}trigger(e){this.version++,eD++,this.notify(e)}notify(e){eS++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ex()}}}let eU=new WeakMap,ej=Symbol(""),eB=Symbol(""),e$=Symbol("");function eH(e,t,n){if(eO&&r){let t=eU.get(e);t||eU.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eV),l.map=t,l.key=n),l.track()}}function eW(e,t,n,l,r,i){let s=eU.get(e);if(!s){eD++;return}let o=e=>{e&&e.trigger()};if(eS++,"clear"===t)s.forEach(o);else{let r=k(e),i=r&&j(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===e$||!M(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(e$)),t){case"add":r?i&&o(s.get("length")):(o(s.get(ej)),T(e)&&o(s.get(eB)));break;case"delete":!r&&(o(s.get(ej)),T(e)&&o(s.get(eB)));break;case"set":T(e)&&o(s.get(ej))}}ex()}function eK(e){let t=tS(e);return t===e?t:(eH(t,"iterate",e$),ty(e)?t:t.map(tx))}function ez(e){return eH(e=tS(e),"iterate",e$),e}let eq={__proto__:null,[Symbol.iterator](){return eG(this,Symbol.iterator,tx)},concat(...e){return eK(this).concat(...e.map(e=>k(e)?eK(e):e))},entries(){return eG(this,"entries",e=>(e[1]=tx(e[1]),e))},every(e,t){return eX(this,"every",e,t,void 0,arguments)},filter(e,t){return eX(this,"filter",e,t,e=>e.map(tx),arguments)},find(e,t){return eX(this,"find",e,t,tx,arguments)},findIndex(e,t){return eX(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eX(this,"findLast",e,t,tx,arguments)},findLastIndex(e,t){return eX(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eX(this,"forEach",e,t,void 0,arguments)},includes(...e){return eY(this,"includes",e)},indexOf(...e){return eY(this,"indexOf",e)},join(e){return eK(this).join(e)},lastIndexOf(...e){return eY(this,"lastIndexOf",e)},map(e,t){return eX(this,"map",e,t,void 0,arguments)},pop(){return eQ(this,"pop")},push(...e){return eQ(this,"push",e)},reduce(e,...t){return eZ(this,"reduce",e,t)},reduceRight(e,...t){return eZ(this,"reduceRight",e,t)},shift(){return eQ(this,"shift")},some(e,t){return eX(this,"some",e,t,void 0,arguments)},splice(...e){return eQ(this,"splice",e)},toReversed(){return eK(this).toReversed()},toSorted(e){return eK(this).toSorted(e)},toSpliced(...e){return eK(this).toSpliced(...e)},unshift(...e){return eQ(this,"unshift",e)},values(){return eG(this,"values",tx)}};function eG(e,t,n){let l=ez(e),r=l[t]();return l===e||ty(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eJ=Array.prototype;function eX(e,t,n,l,r,i){let s=ez(e),o=s!==e&&!ty(e),a=s[t];if(a!==eJ[t]){let t=a.apply(e,i);return o?tx(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tx(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eZ(e,t,n,l){let r=ez(e),i=n;return r!==e&&(ty(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tx(l),r,e)}),r[t](i,...l)}function eY(e,t,n){let l=tS(e);eH(l,"iterate",e$);let r=l[t](...n);return(-1===r||!1===r)&&tb(n[0])?(n[0]=tS(n[0]),l[t](...n)):r}function eQ(e,t,n=[]){eM(),eS++;let l=tS(e)[t].apply(e,n);return ex(),eI(),l}let e0=h("__proto__,__v_isRef,__isVue"),e1=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(M));function e2(e){M(e)||(e=String(e));let t=tS(this);return eH(t,"has",e),t.hasOwnProperty(e)}class e6{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?tf:tc:r?tu:ta).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=k(e);if(!l){let e;if(i&&(e=eq[t]))return e;if("hasOwnProperty"===t)return e2}let s=Reflect.get(e,t,tw(e)?e:n);return(M(t)?e1.has(t):e0(t))?s:(l||eH(e,"get",t),r)?s:tw(s)?i&&j(t)?s:s.value:I(s)?l?th(s):tp(s):s}}class e4 extends e6{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=t_(r);if(ty(n)||t_(n)||(r=tS(r),n=tS(n)),!k(e)&&tw(r)&&!tw(n))return!t&&(r.value=n,!0)}let i=k(e)&&j(t)?Number(t)<e.length:w(e,t),s=Reflect.set(e,t,n,tw(e)?e:l);return e===tS(l)&&(i?J(n,r)&&eW(e,"set",t,n):eW(e,"add",t,n)),s}deleteProperty(e,t){let n=w(e,t);e[t];let l=Reflect.deleteProperty(e,t);return l&&n&&eW(e,"delete",t,void 0),l}has(e,t){let n=Reflect.has(e,t);return M(t)&&e1.has(t)||eH(e,"has",t),n}ownKeys(e){return eH(e,"iterate",k(e)?"length":ej),Reflect.ownKeys(e)}}class e8 extends e6{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}let e3=new e4,e5=new e8,e9=new e4(!0),e7=new e8(!0),te=e=>e,tt=e=>Reflect.getPrototypeOf(e);function tn(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function tl(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=tS(l),i=tS(n);e||(J(n,i)&&eH(r,"get",n),eH(r,"get",i));let{has:s}=tt(r),o=t?te:e?tE:tx;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eH(tS(t),"iterate",ej),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=tS(n),r=tS(t);return e||(J(t,r)&&eH(l,"has",t),eH(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=tS(i),o=t?te:e?tE:tx;return e||eH(s,"iterate",ej),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return C(n,e?{add:tn("add"),set:tn("set"),delete:tn("delete"),clear:tn("clear")}:{add(e){t||ty(e)||t_(e)||(e=tS(e));let n=tS(this);return tt(n).has.call(n,e)||(n.add(e),eW(n,"add",e,e)),this},set(e,n){t||ty(n)||t_(n)||(n=tS(n));let l=tS(this),{has:r,get:i}=tt(l),s=r.call(l,e);s||(e=tS(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?J(n,o)&&eW(l,"set",e,n):eW(l,"add",e,n),this},delete(e){let t=tS(this),{has:n,get:l}=tt(t),r=n.call(t,e);r||(e=tS(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eW(t,"delete",e,void 0),i},clear(){let e=tS(this),t=0!==e.size,n=e.clear();return t&&eW(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=tS(r),s=T(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?te:e?tE:tx;return e||eH(i,"iterate","keys"===l&&s?eB:ej),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(w(n,l)&&l in t?n:t,l,r)}let tr={get:tl(!1,!1)},ti={get:tl(!1,!0)},ts={get:tl(!0,!1)},to={get:tl(!0,!0)},ta=new WeakMap,tu=new WeakMap,tc=new WeakMap,tf=new WeakMap;function tp(e){return t_(e)?e:tv(e,!1,e3,tr,ta)}function td(e){return tv(e,!1,e9,ti,tu)}function th(e){return tv(e,!0,e5,ts,tc)}function tg(e){return tv(e,!0,e7,to,tf)}function tv(e,t,n,l,r){if(!I(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=r.get(e);if(i)return i;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(V(e));if(0===s)return e;let o=new Proxy(e,2===s?l:n);return r.set(e,o),o}function tm(e){return t_(e)?tm(e.__v_raw):!!(e&&e.__v_isReactive)}function t_(e){return!!(e&&e.__v_isReadonly)}function ty(e){return!!(e&&e.__v_isShallow)}function tb(e){return!!e&&!!e.__v_raw}function tS(e){let t=e&&e.__v_raw;return t?tS(t):e}function tC(e){return!w(e,"__v_skip")&&Object.isExtensible(e)&&Z(e,"__v_skip",!0),e}let tx=e=>I(e)?tp(e):e,tE=e=>I(e)?th(e):e;function tw(e){return!!e&&!0===e.__v_isRef}function tk(e){return tA(e,!1)}function tT(e){return tA(e,!0)}function tA(e,t){return tw(e)?e:new tR(e,t)}class tR{constructor(e,t){this.dep=new eV,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tS(e),this._value=t?e:tx(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||ty(e)||t_(e);J(e=n?e:tS(e),t)&&(this._rawValue=e,this._value=n?e:tx(e),this.dep.trigger())}}function tN(e){e.dep&&e.dep.trigger()}function tO(e){return tw(e)?e.value:e}function tP(e){return O(e)?e():tO(e)}let tM={get:(e,t,n)=>"__v_raw"===t?e:tO(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return tw(r)&&!tw(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tI(e){return tm(e)?e:new Proxy(e,tM)}class tL{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eV,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tD(e){return new tL(e)}function tF(e){let t=k(e)?Array(e.length):{};for(let n in e)t[n]=tB(e,n);return t}class tV{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eU.get(e);return n&&n.get(t)}(tS(this._object),this._key)}}class tU{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tj(e,t,n){return tw(e)?e:O(e)?new tU(e):I(e)&&arguments.length>1?tB(e,t,n):tk(e)}function tB(e,t,n){let l=e[t];return tw(l)?l:new tV(e,t,n)}class t${constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eV(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eD-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&r!==this)return eC(this,!0),!0}get value(){let e=this.dep.track();return eT(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tH={GET:"get",HAS:"has",ITERATE:"iterate"},tW={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},tK={},tz=new WeakMap;function tq(){return p}function tG(e,t=!1,n=p){if(n){let t=tz.get(n);t||tz.set(n,t=[]),t.push(e)}}function tJ(e,t=1/0,n){if(t<=0||!I(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tw(e))tJ(e.value,t,n);else if(k(e))for(let l=0;l<e.length;l++)tJ(e[l],t,n);else if(A(e)||T(e))e.forEach(e=>{tJ(e,t,n)});else if(U(e)){for(let l in e)tJ(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tJ(e[l],t,n)}return e}function tX(e,t){}let tZ={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"};function tY(e,t,n,l){try{return l?e(...l):e()}catch(e){t0(e,t,n)}}function tQ(e,t,n,l){if(O(e)){let r=tY(e,t,n,l);return r&&L(r)&&r.catch(e=>{t0(e,t,n)}),r}if(k(e)){let r=[];for(let i=0;i<e.length;i++)r.push(tQ(e[i],t,n,l));return r}}function t0(e,t,n,l=!0){t&&t.vnode;let{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||g;if(t){let l=t.parent,i=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){let t=l.ec;if(t){for(let n=0;n<t.length;n++)if(!1===t[n](e,i,s))return}l=l.parent}if(r){eM(),tY(r,null,10,[e,i,s]),eI();return}}!function(e,t,n,l=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,l,i)}let t1=[],t2=-1,t6=[],t4=null,t8=0,t3=Promise.resolve(),t5=null;function t9(e){let t=t5||t3;return e?t.then(this?e.bind(this):e):t}function t7(e){if(!(1&e.flags)){let t=nr(e),n=t1[t1.length-1];!n||!(2&e.flags)&&t>=nr(n)?t1.push(e):t1.splice(function(e){let t=t2+1,n=t1.length;for(;t<n;){let l=t+n>>>1,r=t1[l],i=nr(r);i<e||i===e&&2&r.flags?t=l+1:n=l}return t}(t),0,e),e.flags|=1,ne()}}function ne(){t5||(t5=t3.then(function e(t){try{for(t2=0;t2<t1.length;t2++){let e=t1[t2];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),tY(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;t2<t1.length;t2++){let e=t1[t2];e&&(e.flags&=-2)}t2=-1,t1.length=0,nl(),t5=null,(t1.length||t6.length)&&e()}}))}function nt(e){k(e)?t6.push(...e):t4&&-1===e.id?t4.splice(t8+1,0,e):1&e.flags||(t6.push(e),e.flags|=1),ne()}function nn(e,t,n=t2+1){for(;n<t1.length;n++){let t=t1[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;t1.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function nl(e){if(t6.length){let e=[...new Set(t6)].sort((e,t)=>nr(e)-nr(t));if(t6.length=0,t4){t4.push(...e);return}for(t8=0,t4=e;t8<t4.length;t8++){let e=t4[t8];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}t4=null,t8=0}}let nr=e=>null==e.id?2&e.flags?-1:1/0:e.id,ni=null,ns=null;function no(e){let t=ni;return ni=e,ns=e&&e.type.__scopeId||null,t}function na(e){ns=e}function nu(){ns=null}let nc=e=>nf;function nf(e,t=ni,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&r7(-1);let i=no(t);try{r=e(...n)}finally{no(i),l._d&&r7(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function np(e,t){if(null===ni)return e;let n=iV(ni),l=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,i,s,o=g]=t[e];r&&(O(r)&&(r={mounted:r,updated:r}),r.deep&&tJ(i),l.push({dir:r,instance:n,value:i,oldValue:void 0,arg:s,modifiers:o}))}return e}function nd(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;s<r.length;s++){let o=r[s];i&&(o.oldValue=i[s].value);let a=o.dir[l];a&&(eM(),tQ(a,n,8,[e.el,o,e,t]),eI())}}let nh=Symbol("_vte"),ng=e=>e.__isTeleport,nv=e=>e&&(e.disabled||""===e.disabled),nm=e=>e&&(e.defer||""===e.defer),n_=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,ny=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nb=(e,t)=>{let n=e&&e.to;return P(n)?t?t(n):null:n},nS={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=nv(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=nb(t.props,h),n=nw(e,t,g,d);e&&("svg"!==s&&n_(e)?s="svg":"mathml"!==s&&ny(e)&&(s="mathml"),_||(f(e,n),nE(t,!1)))};_&&(f(n,u),nE(t,!0)),nm(t.props)?ry(()=>{p(),t.el.__isMounted=!0},i):p()}else{if(nm(t.props)&&!e.el.__isMounted){ry(()=>{nS.process(e,t,n,l,r,i,s,o,a,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=nv(e.props),y=m?n:d;if("svg"===s||n_(d)?s="svg":("mathml"===s||ny(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),rk(e,t,!0)):a||f(e,t,y,m?c:g,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nC(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nb(t.props,h);e&&nC(t,e,null,u,0)}else m&&nC(t,d,g,u,1);nE(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!nv(p);for(let r=0;r<o.length;r++){let i=o[r];l(i,t,n,e,!!i.dynamicChildren)}}},move:nC,hydrate:function(e,t,n,l,r,i,{o:{nextSibling:s,parentNode:o,querySelector:a,insert:u,createText:c}},f){let p=t.target=nb(t.props,a);if(p){let a=nv(t.props),d=p._lpa||p.firstChild;if(16&t.shapeFlag){if(a)t.anchor=f(s(e),t,o(e),n,l,r,i),t.targetStart=d,t.targetAnchor=d&&s(d);else{t.anchor=s(e);let o=d;for(;o;){if(o&&8===o.nodeType){if("teleport start anchor"===o.data)t.targetStart=o;else if("teleport anchor"===o.data){t.targetAnchor=o,p._lpa=t.targetAnchor&&s(t.targetAnchor);break}}o=s(o)}t.targetAnchor||nw(p,t,c,u),f(d&&s(d),t,p,n,l,r,i)}}nE(t,a)}return t.anchor&&s(t.anchor)}};function nC(e,t,n,{o:{insert:l},m:r},i=2){0===i&&l(e.targetAnchor,t,n);let{el:s,anchor:o,shapeFlag:a,children:u,props:c}=e,f=2===i;if(f&&l(s,t,n),(!f||nv(c))&&16&a)for(let e=0;e<u.length;e++)r(u[e],t,n,2);f&&l(o,t,n)}let nx=nS;function nE(e,t){let n=e.ctx;if(n&&n.ut){let l,r;for(t?(l=e.el,r=e.anchor):(l=e.targetStart,r=e.targetAnchor);l&&l!==r;)1===l.nodeType&&l.setAttribute("data-v-owner",n.uid),l=l.nextSibling;n.ut()}}function nw(e,t,n,l){let r=t.targetStart=n(""),i=t.targetAnchor=n("");return r[nh]=i,e&&(l(r,e),l(i,e)),i}let nk=Symbol("_leaveCb"),nT=Symbol("_enterCb");function nA(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return lf(()=>{e.isMounted=!0}),lh(()=>{e.isUnmounting=!0}),e}let nR=[Function,Array],nN={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nR,onEnter:nR,onAfterEnter:nR,onEnterCancelled:nR,onBeforeLeave:nR,onLeave:nR,onAfterLeave:nR,onLeaveCancelled:nR,onBeforeAppear:nR,onAppear:nR,onAfterAppear:nR,onAppearCancelled:nR},nO=e=>{let t=e.subTree;return t.component?nO(t.component):t};function nP(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==r2){t=n;break}}return t}let nM={name:"BaseTransition",props:nN,setup(e,{slots:t}){let n=ik(),l=nA();return()=>{let r=t.default&&nU(t.default(),!0);if(!r||!r.length)return;let i=nP(r),s=tS(e),{mode:o}=s;if(l.isLeaving)return nD(i);let a=nF(i);if(!a)return nD(i);let u=nL(a,s,l,n,e=>u=e);a.type!==r2&&nV(a,u);let c=n.subTree&&nF(n.subTree);if(c&&c.type!==r2&&!ii(a,c)&&nO(n).type!==r2){let e=nL(c,s,l,n);if(nV(c,e),"out-in"===o&&a.type!==r2)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nD(i);"in-out"===o&&a.type!==r2?e.delayLeave=(e,t,n)=>{nI(l,c)[String(c.key)]=c,e[nk]=()=>{t(),e[nk]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nI(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function nL(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nI(n,e),x=(e,t)=>{e&&tQ(e,l,9,t)},E=(e,t)=>{let n=t[1];x(e,t),k(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted){if(!i)return;l=m||a}t[nk]&&t[nk](!0);let r=C[S];r&&ii(e,r)&&r.el[nk]&&r.el[nk](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted){if(!i)return;t=_||u,l=y||c,r=b||f}let s=!1,o=e[nT]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),w.delayedLeave&&w.delayedLeave(),e[nT]=void 0)};t?E(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[nT]&&t[nT](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[nk]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[nk]=void 0,C[r]!==e||delete C[r])};C[r]=e,d?E(d,[t,s]):s()},clone(e){let i=nL(e,t,n,l,r);return r&&r(i),i}};return w}function nD(e){if(le(e))return(e=id(e)).children=null,e}function nF(e){if(!le(e))return ng(e.type)&&e.children?nP(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&O(n.default))return n.default()}}function nV(e,t){6&e.shapeFlag&&e.component?(e.transition=t,nV(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nU(e,t=!1,n){let l=[],r=0;for(let i=0;i<e.length;i++){let s=e[i],o=null==n?s.key:String(n)+String(null!=s.key?s.key:i);s.type===r0?(128&s.patchFlag&&r++,l=l.concat(nU(s.children,t,o))):(t||s.type!==r2)&&l.push(null!=o?id(s,{key:o}):s)}if(r>1)for(let e=0;e<l.length;e++)l[e].patchFlag=-2;return l}function nj(e,t){return O(e)?C({name:e.name},t,{setup:e}):e}function nB(){let e=ik();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function n$(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function nH(e){let t=ik(),n=tT(null);return t&&Object.defineProperty(t.refs===g?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n}function nW(e,t,n,l,r=!1){if(k(e)){e.forEach((e,i)=>nW(e,t&&(k(t)?t[i]:t),n,l,r));return}if(n5(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&nW(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?iV(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===g?o.refs={}:o.refs,f=o.setupState,p=tS(f),d=f===g?()=>!1:e=>w(p,e);if(null!=u&&u!==a&&(P(u)?(c[u]=null,d(u)&&(f[u]=null)):tw(u)&&(u.value=null)),O(a))tY(a,o,12,[s,c]);else{let t=P(a),l=tw(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?k(n)&&x(n,i):k(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,ry(o,n)):o()}}}let nK=!1,nz=()=>{nK||(console.error("Hydration completed but contains mismatches."),nK=!0)},nq=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nG=e=>e.namespaceURI.includes("MathML"),nJ=e=>{if(1===e.nodeType){if(nq(e))return"svg";if(nG(e))return"mathml"}},nX=e=>8===e.nodeType;function nZ(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nX(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:E,shapeFlag:w,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case r1:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nz(),n.data=l.children),A=i(n));break;case r2:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case r6:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t<l.staticCount;t++)e&&(l.children+=1===A.nodeType?A.outerHTML:A.data),t===l.staticCount-1&&(l.anchor=A),A=i(A);return S?i(A):A}C();break;case r0:A=S?d(n,l,o,u,y,b):C();break;default:if(1&w)A=1===T&&l.type.toLowerCase()===n.tagName.toLowerCase()||_(n)?f(n,l,o,u,y,b):C();else if(6&w){l.slotScopeIds=y;let e=s(n);if(A=S?g(n):nX(n)&&"teleport start"===n.data?g(n,n.data,"teleport end"):i(n),t(l,e,null,o,u,nJ(e),b),n5(l)&&!l.type.__asyncResolved){let t;S?(t=ic(r0)).anchor=A?A.previousSibling:e.lastChild:t=3===n.nodeType?ih(""):ic("div"),t.el=n,l.component.subTree=t}}else 64&w?A=8!==T?C():l.type.hydrate(n,l,o,u,y,b,e,p):128&w&&(A=l.type.hydrate(n,l,o,u,nJ(s(n)),y,b,e,c))}return null!=E&&nW(E,null,u,l),A},f=(e,t,n,r,i,s)=>{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&nd(t,null,n,"created");let y=!1;if(_(e)){y=rw(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;y&&h.beforeEnter(l),m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){n0(e,1)||nz();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(n0(e,0)||nz(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||b(r)&&!B(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tm(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&iS(a,n,t),d&&nd(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&rY(()=>{a&&iS(a,n,t),y&&h.enter(e),d&&nd(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t<d;t++){let h=f?p[t]:p[t]=im(p[t]),g=h.type===r1;e?(g&&!f&&t+1<d&&im(p[t+1]).type===r1&&(a(r(e.data.slice(h.children.length)),l,i(e)),e.data=h.children),e=c(e,h,s,o,u,f)):g&&!h.children?a(h.el=r(""),l):(n0(l,1)||nz(),n(null,h,l,null,s,o,nJ(l),u))}return e},d=(e,t,n,l,r,o)=>{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nX(d)&&"]"===d.data?i(t.anchor=d):(nz(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(n0(e.parentElement,1)||nz(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nJ(f),a),l&&(l.vnode.el=t.el,rK(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nX(e)&&(e.data===t&&l++,e.data===n)){if(0===l)return i(e);l--}return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),nl(),t._vnode=e;return}c(t.firstChild,e,null,null,null),nl(),t._vnode=e},c]}let nY="data-allow-mismatch",nQ={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function n0(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nY);)e=e.parentElement;let n=e&&e.getAttribute(nY);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(nQ[t])}}let n1=ee().requestIdleCallback||(e=>setTimeout(e,1)),n2=ee().cancelIdleCallback||(e=>clearTimeout(e)),n6=(e=1e4)=>t=>{let n=n1(t,{timeout:e});return()=>n2(n)},n4=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t<i||l>0&&l<i)&&(n>0&&n<s||r>0&&r<s)}(e))return t(),l.disconnect(),!1;l.observe(e)}}),()=>l.disconnect()},n8=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},n3=(e=[])=>(t,n)=>{P(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},n5=e=>!!e.type.__asyncLoader;function n9(e){let t;O(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>(f++,c=null,d()),d=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t(p()),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nj({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(l,t=>(function(e,t){if(nX(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nX(l)){if("]"===l.data){if(0==--n)break}else"["===l.data&&n++}l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:l;t?r():d().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=iw;if(n$(e),t)return()=>n7(t,e);let n=t=>{c=null,t0(t,e,13,!r)};if(a&&e.suspense||iN)return d().then(t=>()=>n7(t,e)).catch(e=>(n(e),()=>r?ic(r,{error:e}):null));let s=tk(!1),u=tk(),f=tk(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),d().then(()=>{s.value=!0,e.parent&&le(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?n7(t,e):u.value&&r?ic(r,{error:u.value}):l&&!f.value?ic(l):void 0}})}function n7(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=ic(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let le=e=>e.type.__isKeepAlive,lt={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=ik(),l=n.ctx;if(!l.renderer)return()=>{let e=t.default&&t.default();return e&&1===e.length?e[0]:e};let r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){ls(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=iU(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&ii(t,s)?s&&ls(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),ry(()=>{i.isDeactivated=!1,i.a&&X(i.a);let t=e.props&&e.props.onVnodeMounted;t&&iS(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;rT(t.m),rT(t.a),u(e,p,null,1,o),ry(()=>{t.da&&X(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&iS(n,t.parent,e),t.isDeactivated=!0},o)},rM(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>ln(e,t)),t&&h(e=>!ln(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(rz(n.subTree.type)?ry(()=>{r.set(m,lo(n.subTree))},n.subTree.suspense):r.set(m,lo(n.subTree)))};return lf(_),ld(_),lh(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=lo(t);if(e.type===r.type&&e.key===r.key){ls(r);let e=r.component.da;e&&ry(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!ir(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=lo(l);if(o.type===r2)return s=null,o;let a=o.type,u=iU(n5(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!ln(c,u))||f&&u&&ln(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=id(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&nV(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,rz(l.type)?l:o}}};function ln(e,t){return k(e)?e.some(e=>ln(e,t)):P(e)?e.split(",").includes(t):!!N(e)&&(e.lastIndex=0,e.test(t))}function ll(e,t){li(e,"a",t)}function lr(e,t){li(e,"da",t)}function li(e,t,n=iw){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(la(t,l,n),n){let e=n.parent;for(;e&&e.parent;)le(e.parent.vnode)&&function(e,t,n,l){let r=la(t,e,l,!0);lg(()=>{x(l[t],r)},n)}(l,t,n,e),e=e.parent}}function ls(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function lo(e){return 128&e.shapeFlag?e.ssContent:e}function la(e,t,n=iw,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eM();let r=iT(n),i=tQ(t,n,e,l);return r(),eI(),i});return l?r.unshift(i):r.push(i),i}}let lu=e=>(t,n=iw)=>{iN&&"sp"!==e||la(e,(...e)=>t(...e),n)},lc=lu("bm"),lf=lu("m"),lp=lu("bu"),ld=lu("u"),lh=lu("bum"),lg=lu("um"),lv=lu("sp"),lm=lu("rtg"),l_=lu("rtc");function ly(e,t=iw){la("ec",e,t)}let lb="components";function lS(e,t){return lw(lb,e,!0,t)||e}let lC=Symbol.for("v-ndc");function lx(e){return P(e)?lw(lb,e,!1)||e:e||lC}function lE(e){return lw("directives",e)}function lw(e,t,n=!0,l=!1){let r=ni||iw;if(r){let n=r.type;if(e===lb){let e=iU(n,!1);if(e&&(e===t||e===W(t)||e===q(W(t))))return n}let i=lk(r[e]||n[e],t)||lk(r.appContext[e],t);return!i&&l?n:i}}function lk(e,t){return e&&(e[t]||e[W(t)]||e[q(W(t))])}function lT(e,t,n,l){let r;let i=n&&n[l],s=k(e);if(s||P(e)){let n=s&&tm(e),l=!1;n&&(l=!ty(e),e=ez(e)),r=Array(e.length);for(let n=0,s=e.length;n<s;n++)r[n]=t(l?tx(e[n]):e[n],n,void 0,i&&i[n])}else if("number"==typeof e){r=Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,i&&i[n])}else if(I(e)){if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l<s;l++){let s=n[l];r[l]=t(e[s],s,l,i&&i[l])}}}else r=[];return n&&(n[l]=r),r}function lA(e,t){for(let n=0;n<t.length;n++){let l=t[n];if(k(l))for(let t=0;t<l.length;t++)e[l[t].name]=l[t].fn;else l&&(e[l.name]=l.key?(...e)=>{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e}function lR(e,t,n={},l,r){if(ni.ce||ni.parent&&n5(ni.parent)&&ni.parent.ce)return"default"!==t&&(n.name=t),r3(),il(r0,null,[ic("slot",n,l&&l())],64);let i=e[t];i&&i._c&&(i._d=!1),r3();let s=i&&lN(i(n)),o=n.key||s&&s.key,a=il(r0,{key:(o&&!M(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function lN(e){return e.some(e=>!ir(e)||!!(e.type!==r2&&(e.type!==r0||lN(e.children))))?e:null}function lO(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:G(l)]=e[l];return n}let lP=e=>e?iR(e)?iV(e):lP(e.parent):null,lM=C(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lP(e.parent),$root:e=>lP(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>l0(e),$forceUpdate:e=>e.f||(e.f=()=>{t7(e.update)}),$nextTick:e=>e.n||(e.n=t9.bind(e.proxy)),$watch:e=>rL.bind(e)}),lI=(e,t)=>e!==g&&!e.__isScriptSetup&&w(e,t),lL={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(lI(s,t))return u[t]=1,s[t];if(o!==g&&w(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&w(n,t))return u[t]=3,a[t];if(i!==g&&w(i,t))return u[t]=4,i[t];lY&&(u[t]=0)}}let p=lM[t];return p?("$attrs"===t&&eH(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==g&&w(i,t)?(u[t]=4,i[t]):w(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return lI(r,t)?(r[t]=n,!0):l!==g&&w(l,t)?(l[t]=n,!0):!w(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==g&&w(e,s)||lI(t,s)||(o=i[0])&&w(o,s)||w(l,s)||w(lM,s)||w(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:w(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},lD=C({},lL,{get(e,t){if(t!==Symbol.unscopables)return lL.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!et(t)});function lF(){return null}function lV(){return null}function lU(e){}function lj(e){}function lB(){return null}function l$(){}function lH(e,t){return null}function lW(){return lz().slots}function lK(){return lz().attrs}function lz(){let e=ik();return e.setupContext||(e.setupContext=iF(e))}function lq(e){return k(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function lG(e,t){let n=lq(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?k(l)||O(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n}function lJ(e,t){return e&&t?k(e)&&k(t)?e.concat(t):C({},lq(e),lq(t)):e||t}function lX(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n}function lZ(e){let t=ik(),n=e();return iA(),L(n)&&(n=n.catch(e=>{throw iT(t),e})),[n,()=>iT(t)]}let lY=!0;function lQ(e,t,n){tQ(k(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function l0(e){let t;let n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>l1(t,e,o,!0)),l1(t,n,o)):t=n,I(n)&&s.set(n,t),t}function l1(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&l1(e,i,n,!0),r&&r.forEach(t=>l1(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=l2[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let l2={data:l6,props:l5,emits:l5,methods:l3,computed:l3,beforeCreate:l8,created:l8,beforeMount:l8,mounted:l8,beforeUpdate:l8,updated:l8,beforeDestroy:l8,beforeUnmount:l8,destroyed:l8,unmounted:l8,activated:l8,deactivated:l8,errorCaptured:l8,serverPrefetch:l8,components:l3,directives:l3,watch:function(e,t){if(!e)return t;if(!t)return e;let n=C(Object.create(null),e);for(let l in t)n[l]=l8(e[l],t[l]);return n},provide:l6,inject:function(e,t){return l3(l4(e),l4(t))}};function l6(e,t){return t?e?function(){return C(O(e)?e.call(this,this):e,O(t)?t.call(this,this):t)}:t:e}function l4(e){if(k(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function l8(e,t){return e?[...new Set([].concat(e,t))]:t}function l3(e,t){return e?C(Object.create(null),e,t):t}function l5(e,t){return e?k(e)&&k(t)?[...new Set([...e,...t])]:C(Object.create(null),lq(e),lq(null!=t?t:{})):t}function l9(){return{app:null,config:{isNativeTag:y,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let l7=0,re=null;function rt(e,t){if(iw){let n=iw.provides,l=iw.parent&&iw.parent.provides;l===n&&(n=iw.provides=Object.create(l)),n[e]=t}}function rn(e,t,n=!1){let l=iw||ni;if(l||re){let r=re?re._context.provides:l?null==l.parent?l.vnode.appContext&&l.vnode.appContext.provides:l.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&O(t)?t.call(l&&l.proxy):t}}function rl(){return!!(iw||ni||re)}let rr={},ri=()=>Object.create(rr),rs=e=>Object.getPrototypeOf(e)===rr;function ro(e,t,n,l){let r;let[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(B(a))continue;let c=t[a];i&&w(i,u=W(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:rj(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=tS(n),l=r||g;for(let r=0;r<s.length;r++){let o=s[r];n[o]=ra(i,t,o,l[o],e,!w(l,o))}}return o}function ra(e,t,n,l,r,i){let s=e[n];if(null!=s){let e=w(s,"default");if(e&&void 0===l){let e=s.default;if(s.type!==Function&&!s.skipFactory&&O(e)){let{propsDefaults:i}=r;if(n in i)l=i[n];else{let s=iT(r);l=i[n]=e.call(null,t),s()}}else l=e;r.ce&&r.ce._setProp(n,l)}s[0]&&(i&&!e?l=!1:s[1]&&(""===l||l===z(n))&&(l=!0))}return l}let ru=new WeakMap;function rc(e){return!("$"===e[0]||B(e))}let rf=e=>"_"===e[0]||"$stable"===e,rp=e=>k(e)?e.map(im):[im(e)],rd=(e,t,n)=>{if(t._n)return t;let l=nf((...e)=>rp(t(...e)),n);return l._c=!1,l},rh=(e,t,n)=>{let l=e._ctx;for(let n in e){if(rf(n))continue;let r=e[n];if(O(r))t[n]=rd(n,r,l);else if(null!=r){let e=rp(r);t[n]=()=>e}}},rg=(e,t)=>{let n=rp(t);e.slots.default=()=>n},rv=(e,t,n)=>{for(let l in t)(n||"_"!==l)&&(e[l]=t[l])},rm=(e,t,n)=>{let l=e.slots=ri();if(32&e.vnode.shapeFlag){let e=t._;e?(rv(l,t,n),n&&Z(l,"_",e,!0)):rh(t,l)}else t&&rg(e,t)},r_=(e,t,n)=>{let{vnode:l,slots:r}=e,i=!0,s=g;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:rv(r,t,n):(i=!t.$stable,rh(t,r)),s=t}else t&&(rg(e,t),s={default:1});if(i)for(let e in r)rf(e)||null!=s[e]||delete r[e]},ry=rY;function rb(e){return rC(e)}function rS(e){return rC(e,nZ)}function rC(e,t){var n;let l,r;ee().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:u,createComment:c,setText:f,setElementText:p,parentNode:d,nextSibling:h,setScopeId:y=_,insertStaticContent:b}=e,S=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!ii(e,t)&&(l=er(e),Y(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case r1:x(e,t,n,l);break;case r2:E(e,t,n,l);break;case r6:null==e&&k(t,n,l,s);break;case r0:V(e,t,n,l,r,i,s,o,a);break;default:1&f?R(e,t,n,l,r,i,s,o,a):6&f?U(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,eo):128&f&&u.process(e,t,n,l,r,i,s,o,a,eo)}null!=c&&r&&nW(c,e&&e.ref,i,t||e,!t)},x=(e,t,n,l)=>{if(null==e)i(t.el=u(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=c(t.children||""),n,l):t.el=e.el},k=(e,t,n,l)=>{[e.el,e.anchor]=b(e.children,t,n,l,e.el,e.anchor)},T=({el:e,anchor:t},n,l)=>{let r;for(;e&&e!==t;)r=h(e),i(e,n,l),e=r;i(t,n,l)},A=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},R=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?N(t,n,l,r,i,s,o,a):L(e,t,r,i,s,o,a)},N=(e,t,n,l,r,s,u,c)=>{let f,d;let{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?p(f,e.children):16&g&&M(e.children,f,null,l,r,rx(e,s),u,c),_&&nd(e,null,l,"created"),P(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||B(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(d=h.onVnodeBeforeMount)&&iS(d,l,e)}_&&nd(e,null,l,"beforeMount");let y=rw(r,m);y&&m.beforeEnter(f),i(f,t,n),((d=h&&h.onVnodeMounted)||y||_)&&ry(()=>{d&&iS(d,l,e),y&&m.enter(f),_&&nd(e,null,l,"mounted")},r)},P=(e,t,n,l,r)=>{if(n&&y(e,n),l)for(let t=0;t<l.length;t++)y(e,l[t]);if(r){let n=r.subTree;if(t===n||rz(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=r.vnode;P(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},M=(e,t,n,l,r,i,s,o,a=0)=>{for(let u=a;u<e.length;u++)S(null,e[u]=o?i_(e[u]):im(e[u]),t,n,l,r,i,s,o)},L=(e,t,n,l,r,i,s)=>{let a;let u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:d}=t;c|=16&e.patchFlag;let h=e.props||g,m=t.props||g;if(n&&rE(n,!1),(a=m.onVnodeBeforeUpdate)&&iS(a,n,t,e),d&&nd(t,e,n,"beforeUpdate"),n&&rE(n,!0),(h.innerHTML&&null==m.innerHTML||h.textContent&&null==m.textContent)&&p(u,""),f?D(e.dynamicChildren,f,u,n,l,rx(t,r),i):s||q(e,t,u,null,n,l,rx(t,r),i,!1),c>0){if(16&c)F(u,h,m,n,r);else if(2&c&&h.class!==m.class&&o(u,"class",null,m.class,r),4&c&&o(u,"style",h.style,m.style,r),8&c){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let l=e[t],i=h[l],s=m[l];(s!==i||"value"===l)&&o(u,l,i,s,r,n)}}1&c&&e.children!==t.children&&p(u,t.children)}else s||null!=f||F(u,h,m,n,r);((a=m.onVnodeUpdated)||d)&&ry(()=>{a&&iS(a,n,t,e),d&&nd(t,e,n,"updated")},l)},D=(e,t,n,l,r,i,s)=>{for(let o=0;o<t.length;o++){let a=e[o],u=t[o],c=a.el&&(a.type===r0||!ii(a,u)||70&a.shapeFlag)?d(a.el):n;S(a,u,c,null,l,r,i,s,!0)}},F=(e,t,n,l,r)=>{if(t!==n){if(t!==g)for(let i in t)B(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if(B(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},V=(e,t,n,l,r,s,o,a,c)=>{let f=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),M(t.children||[],n,p,r,s,o,a,c)):d>0&&64&d&&h&&e.dynamicChildren?(D(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&rk(e,t,!0)):q(e,t,n,p,r,s,o,a,c)},U=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):j(t,n,l,r,i,s,a):$(e,t,a)},j=(e,t,n,l,r,i,s)=>{let o=e.component=iE(e,l,r);le(e)&&(o.ctx.renderer=eo),iO(o,!1,s),o.asyncDep?(r&&r.registerDep(o,H,s),e.el||E(null,o.subTree=ic(r2),t,n)):H(o,e,t,n,r,i,s)},$=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||rW(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?rW(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(s[n]!==l[n]&&!rj(u,n))return!0}}return!1}(e,t,n)){if(l.asyncDep&&!l.asyncResolved){K(l,t,n);return}l.next=t,l.update()}else t.el=e.el,l.vnode=t},H=(e,t,n,l,i,s,o)=>{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=c.el,K(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;rE(e,!1),n?(n.el=c.el,K(e,n,o)):n=c,l&&X(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&iS(t,u,n,c),rE(e,!0);let p=rB(e),h=e.subTree;e.subTree=p,S(h,p,d(h.el),er(h),e,i,s),n.el=p.el,null===f&&rK(e,p.el),r&&ry(r,i),(t=n.props&&n.props.onVnodeUpdated)&&ry(()=>iS(t,u,n,c),i)}else{let o;let{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=n5(t);if(rE(e,!1),c&&X(c),!g&&(o=u&&u.onVnodeBeforeMount)&&iS(o,p,t),rE(e,!0),a&&r){let t=()=>{e.subTree=rB(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&d.ce._injectChildStyle(h);let r=e.subTree=rB(e);S(null,r,n,l,e,i,s),t.el=r.el}if(f&&ry(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;ry(()=>iS(o,p,e),i)}(256&t.shapeFlag||p&&n5(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&ry(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new eb(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>t7(f),rE(e,!0),c()},K=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=tS(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l<n.length;l++){let s=n[l];if(rj(e.emitsOptions,s))continue;let c=t[s];if(a){if(w(i,s))c!==i[s]&&(i[s]=c,u=!0);else{let t=W(s);r[t]=ra(a,o,t,c,e,!1)}}else c!==i[s]&&(i[s]=c,u=!0)}}}else{let l;for(let s in ro(e,t,r,i)&&(u=!0),o)t&&(w(t,s)||(l=z(s))!==s&&w(t,l))||(a?n&&(void 0!==n[s]||void 0!==n[l])&&(r[s]=ra(a,o,s,void 0,e,!0)):delete r[s]);if(i!==o)for(let e in i)t&&w(t,e)||(delete i[e],u=!0)}u&&eW(e.attrs,"set","")}(e,t.props,l,n),r_(e,t.children,n),eM(),nn(e),eI()},q=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d){J(u,f,n,l,r,i,s,o,a);return}if(256&d){G(u,f,n,l,r,i,s,o,a);return}}8&h?(16&c&&el(u,r,i),f!==u&&p(n,f)):16&c?16&h?J(u,f,n,l,r,i,s,o,a):el(u,r,i,!0):(8&c&&p(n,""),16&h&&M(f,n,l,r,i,s,o,a))},G=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||m,t=t||m;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;u<p;u++){let l=t[u]=a?i_(t[u]):im(t[u]);S(e[u],l,n,null,r,i,s,o,a)}c>f?el(e,r,i,!0,!1,p):M(t,n,l,r,i,s,o,a,p)},J=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?i_(t[u]):im(t[u]);if(ii(l,c))S(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?i_(t[p]):im(t[p]);if(ii(l,u))S(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=e<c?t[e].el:l;for(;u<=p;)S(null,t[u]=a?i_(t[u]):im(t[u]),n,f,r,i,s,o,a),u++}}else if(u>p)for(;u<=f;)Y(e[u],r,i,!0),u++;else{let d;let h=u,g=u,_=new Map;for(u=g;u<=p;u++){let e=t[u]=a?i_(t[u]):im(t[u]);null!=e.key&&_.set(e.key,u)}let y=0,b=p-g+1,C=!1,x=0,E=Array(b);for(u=0;u<b;u++)E[u]=0;for(u=h;u<=f;u++){let l;let c=e[u];if(y>=b){Y(c,r,i,!0);continue}if(null!=c.key)l=_.get(c.key);else for(d=g;d<=p;d++)if(0===E[d-g]&&ii(c,t[d])){l=d;break}void 0===l?Y(c,r,i,!0):(E[l-g]=u+1,l>=x?x=l:C=!0,S(c,t[l],n,null,r,i,s,o,a),y++)}let w=C?function(e){let t,n,l,r,i;let s=e.slice(),o=[0],a=e.length;for(t=0;t<a;t++){let a=e[t];if(0!==a){if(e[n=o[o.length-1]]<a){s[t]=n,o.push(t);continue}for(l=0,r=o.length-1;l<r;)e[o[i=l+r>>1]]<a?l=i+1:r=i;a<e[o[l]]&&(l>0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(E):m;for(d=w.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1<c?t[e+1].el:l;0===E[u]?S(null,f,n,p,r,i,s,o,a):C&&(d<0||u!==w[d]?Z(f,n,p,2):d--)}}},Z=(e,t,n,l,r=null)=>{let{el:s,type:o,transition:a,children:u,shapeFlag:c}=e;if(6&c){Z(e.component.subTree,t,n,l);return}if(128&c){e.suspense.move(t,n,l);return}if(64&c){o.move(e,t,n,eo);return}if(o===r0){i(s,t,n);for(let e=0;e<u.length;e++)Z(u[e],t,n,l);i(e.anchor,t,n);return}if(o===r6){T(e,t,n);return}if(2!==l&&1&c&&a){if(0===l)a.beforeEnter(s),i(s,t,n),ry(()=>a.enter(s),r);else{let{leave:e,delayLeave:l,afterLeave:r}=a,o=()=>i(s,t,n),u=()=>{e(s,()=>{o(),r&&r()})};l?l(s,o,u):u()}}else i(s,t,n)},Y=(e,t,n,l=!1,r=!1)=>{let i;let{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&nW(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&f){t.ctx.deactivate(e);return}let g=1&f&&d,m=!n5(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&iS(i,t,e),6&f)en(e.component,n,l);else{if(128&f){e.suspense.unmount(n,l);return}g&&nd(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,eo,l):c&&!c.hasOnce&&(s!==r0||p>0&&64&p)?el(c,t,n,!1,!0):(s===r0&&384&p||!r&&16&f)&&el(u,t,n),l&&Q(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&ry(()=>{i&&iS(i,t,e),g&&nd(e,null,t,"unmounted")},n)},Q=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===r0){et(n,l);return}if(t===r6){A(e);return}let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},et=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},en=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u}=e;rT(a),rT(u),l&&X(l),r.stop(),i&&(i.flags|=8,Y(s,e,t,n)),o&&ry(o,t),ry(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},el=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s<e.length;s++)Y(e[s],t,n,l,r)},er=e=>{if(6&e.shapeFlag)return er(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[nh];return n?h(n):t},ei=!1,es=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):S(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ei||(ei=!0,nn(),nl(),ei=!1)},eo={p:S,um:Y,m:Z,r:Q,mt:j,mc:M,pc:q,pbc:D,n:er,o:e};return t&&([l,r]=t(eo)),{render:es,hydrate:l,createApp:(n=l,function(e,t=null){O(e)||(e=C({},e)),null==t||I(t)||(t=null);let l=l9(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:l7++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:iK,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&O(e.install)?(r.add(e),e.install(o,...t)):O(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||ic(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):es(u,r,a),s=!0,o._container=r,r.__vue_app__=o,iV(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tQ(i,o._instance,16),es(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=re;re=o;try{return e()}finally{re=t}}};return o})}}function rx({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rE({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function rw(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rk(e,t,n=!1){let l=e.children,r=t.children;if(k(l)&&k(r))for(let e=0;e<l.length;e++){let t=l[e],i=r[e];!(1&i.shapeFlag)||i.dynamicChildren||((i.patchFlag<=0||32===i.patchFlag)&&((i=r[e]=i_(r[e])).el=t.el),n||-2===i.patchFlag||rk(t,i)),i.type===r1&&(i.el=t.el)}}function rT(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}let rA=Symbol.for("v-scx"),rR=()=>rn(rA);function rN(e,t){return rI(e,null,t)}function rO(e,t){return rI(e,null,{flush:"post"})}function rP(e,t){return rI(e,null,{flush:"sync"})}function rM(e,t,n){return rI(e,t,n)}function rI(e,t,n=g){let l;let{immediate:r,deep:i,flush:s,once:o}=n,a=C({},n),u=t&&r||!t&&"post"!==s;if(iN){if("sync"===s){let e=rR();l=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){let e=()=>{};return e.stop=_,e.resume=_,e.pause=_,e}}let c=iw;a.call=(e,t,n)=>tQ(e,c,t,n);let f=!1;"post"===s?a.scheduler=e=>{ry(e,c&&c.suspense)}:"sync"!==s&&(f=!0,a.scheduler=(e,t)=>{t?e():t7(e)}),a.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};let d=function(e,t,n=g){let l,r,i,s;let{immediate:o,deep:a,once:u,scheduler:c,augmentJob:f,call:d}=n,h=e=>a?e:ty(e)||!1===a||0===a?tJ(e,1):tJ(e),m=!1,y=!1;if(tw(e)?(r=()=>e.value,m=ty(e)):tm(e)?(r=()=>h(e),m=!0):k(e)?(y=!0,m=e.some(e=>tm(e)||ty(e)),r=()=>e.map(e=>tw(e)?e.value:tm(e)?h(e):O(e)?d?d(e,2):e():void 0)):r=O(e)?t?d?()=>d(e,2):e:()=>{if(i){eM();try{i()}finally{eI()}}let t=p;p=l;try{return d?d(e,3,[s]):e(s)}finally{p=t}}:_,t&&a){let e=r,t=!0===a?1/0:a;r=()=>tJ(e(),t)}let b=em(),S=()=>{l.stop(),b&&b.active&&x(b.effects,l)};if(u&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=y?Array(e.length).fill(tK):tK,E=e=>{if(1&l.flags&&(l.dirty||e)){if(t){let e=l.run();if(a||m||(y?e.some((e,t)=>J(e,C[t])):J(e,C))){i&&i();let n=p;p=l;try{let n=[e,C===tK?void 0:y&&C[0]===tK?[]:C,s];d?d(t,3,n):t(...n),C=e}finally{p=n}}}else l.run()}};return f&&f(E),(l=new eb(r)).scheduler=c?()=>c(E,!1):E,s=e=>tG(e,!1,l),i=l.onStop=()=>{let e=tz.get(l);if(e){if(d)d(e,4);else for(let t of e)t();tz.delete(l)}},t?o?E(!0):C=l.run():c?c(E.bind(null,!0),!0):l.run(),S.pause=l.pause.bind(l),S.resume=l.resume.bind(l),S.stop=S,S}(e,t,a);return iN&&(l?l.push(d):u&&d()),d}function rL(e,t,n){let l;let r=this.proxy,i=P(e)?e.includes(".")?rD(r,e):()=>r[e]:e.bind(r,r);O(t)?l=t:(l=t.handler,n=t);let s=iT(this),o=rI(i,l.bind(r),n);return s(),o}function rD(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function rF(e,t,n=g){let l=ik(),r=W(t),i=z(t),s=rV(e,r),o=tD((s,o)=>{let a,u;let c=g;return rP(()=>{let t=e[r];J(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!J(s,a)&&!(c!==g&&J(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),J(e,s)&&J(e,c)&&!J(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||g:o,done:!1}:{done:!0}}},o}let rV=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${W(t)}Modifiers`]||e[`${z(t)}Modifiers`];function rU(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||g,i=n,s=t.startsWith("update:"),o=s&&rV(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>P(e)?e.trim():e)),o.number&&(i=n.map(Y)));let a=r[l=G(t)]||r[l=G(W(t))];!a&&s&&(a=r[l=G(z(t))]),a&&tQ(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tQ(u,e,6,i)}}function rj(e,t){return!!(e&&b(t))&&(w(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||w(e,z(t))||w(e,t))}function rB(e){let t,n;let{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=no(e);try{if(4&r.shapeFlag){let e=s||i;t=im(f.call(e,e,p,d,g,h,m)),n=u}else t=im(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:r$(u)}catch(n){r4.length=0,t0(n,e,1),t=ic(r2)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(S)&&(n=rH(n,o)),b=id(b,n,!1,!0))}return r.dirs&&((b=id(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&nV(b,r.transition),t=b,no(y),t}let r$=e=>{let t;for(let n in e)("class"===n||"style"===n||b(n))&&((t||(t={}))[n]=e[n]);return t},rH=(e,t)=>{let n={};for(let l in e)S(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function rW(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;r<l.length;r++){let i=l[r];if(t[i]!==e[i]&&!rj(n,i))return!0}return!1}function rK({vnode:e,parent:t},n){for(;t;){let l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.el=e.el),l===e)(e=t.vnode).el=n,t=t.parent;else break}}let rz=e=>e.__isSuspense,rq=0,rG={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e)!function(e,t,n,l,r,i,s,o,a){let{p:u,o:{createElement:c}}=a,f=c("div"),p=e.suspense=rX(e,r,l,t,f,n,i,s,o,a);u(null,p.pendingBranch=e.ssContent,f,null,l,p,i,s),p.deps>0?(rJ(e,"onPending"),rJ(e,"onFallback"),u(null,e.ssFallback,t,n,l,null,i,s),rQ(p,e.ssFallback)):p.resolve(!1,!0)}(t,n,l,r,i,s,o,a,u);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}!function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,ii(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),rQ(f,d))):(f.pendingId=rq++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),rQ(f,d))):h&&ii(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&ii(p,h))a(h,p,n,l,r,f,i,s,o),rQ(f,p);else if(rJ(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=rq++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}}(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=rX(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=rZ(l?n.default:n),e.ssFallback=l?rZ(n.fallback):ic(r2)}};function rJ(e,t){let n=e.props&&e.props[t];O(n)&&n()}function rX(e,t,n,l,r,i,s,o,a,u,c=!1){let f;let{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?Q(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:rq++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:e||((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),nt(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),rQ(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||nt(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),rJ(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;rJ(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),rQ(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{t0(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;iP(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),rK(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function rZ(e){let t;if(O(e)){let n=r9&&e._c;n&&(e._d=!1,r3()),e=e(),n&&(e._d=!0,t=r8,r5())}return k(e)&&(e=function(e,t=!0){let n;for(let t=0;t<e.length;t++){let l=e[t];if(!ir(l))return;if(l.type!==r2||"v-if"===l.children){if(n)return;n=l}}return n}(e)),e=im(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function rY(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):nt(e)}function rQ(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,rK(l,r))}let r0=Symbol.for("v-fgt"),r1=Symbol.for("v-txt"),r2=Symbol.for("v-cmt"),r6=Symbol.for("v-stc"),r4=[],r8=null;function r3(e=!1){r4.push(r8=e?null:[])}function r5(){r4.pop(),r8=r4[r4.length-1]||null}let r9=1;function r7(e,t=!1){r9+=e,e<0&&r8&&t&&(r8.hasOnce=!0)}function ie(e){return e.dynamicChildren=r9>0?r8||m:null,r5(),r9>0&&r8&&r8.push(e),e}function it(e,t,n,l,r,i){return ie(iu(e,t,n,l,r,i,!0))}function il(e,t,n,l,r){return ie(ic(e,t,n,l,r,!0))}function ir(e){return!!e&&!0===e.__v_isVNode}function ii(e,t){return e.type===t.type&&e.key===t.key}function is(e){}let io=({key:e})=>null!=e?e:null,ia=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?P(e)||tw(e)||O(e)?{i:ni,r:e,k:t,f:!!n}:e:null);function iu(e,t=null,n=null,l=0,r=null,i=e===r0?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&io(t),ref:t&&ia(t),scopeId:ns,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ni};return o?(iy(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=P(n)?8:16),r9>0&&!s&&r8&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&r8.push(a),a}let ic=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==lC||(e=r2),ir(e)){let l=id(e,t,!0);return n&&iy(l,n),r9>0&&!i&&r8&&(6&l.shapeFlag?r8[r8.indexOf(e)]=l:r8.push(l)),l.patchFlag=-2,l}if(O(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=ip(t);e&&!P(e)&&(t.class=es(e)),I(n)&&(tb(n)&&!k(n)&&(n=C({},n)),t.style=en(n))}let o=P(e)?1:rz(e)?128:ng(e)?64:I(e)?4:O(e)?2:0;return iu(e,t,n,l,r,o,i,!0)};function ip(e){return e?tb(e)||rs(e)?C({},e):e:null}function id(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?ib(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&io(u),ref:t&&t.ref?n&&i?k(i)?i.concat(ia(t)):[i,ia(t)]:ia(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==r0?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&id(e.ssContent),ssFallback:e.ssFallback&&id(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&nV(c,a.clone(c)),c}function ih(e=" ",t=0){return ic(r1,null,e,t)}function ig(e,t){let n=ic(r6,null,e);return n.staticCount=t,n}function iv(e="",t=!1){return t?(r3(),il(r2,null,e)):ic(r2,null,e)}function im(e){return null==e||"boolean"==typeof e?ic(r2):k(e)?ic(r0,null,e.slice()):ir(e)?i_(e):ic(r1,null,String(e))}function i_(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:id(e)}function iy(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(k(t))n=16;else if("object"==typeof t){if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),iy(e,n()),n._c&&(n._d=!0));return}{n=32;let l=t._;l||rs(t)?3===l&&ni&&(1===ni.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=ni}}else O(t)?(t={default:t,_ctx:ni},n=32):(t=String(t),64&l?(n=16,t=[ih(t)]):n=8);e.children=t,e.shapeFlag|=n}function ib(...e){let t={};for(let n=0;n<e.length;n++){let l=e[n];for(let e in l)if("class"===e)t.class!==l.class&&(t.class=es([t.class,l.class]));else if("style"===e)t.style=en([t.style,l.style]);else if(b(e)){let n=t[e],r=l[e];r&&n!==r&&!(k(n)&&n.includes(r))&&(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=l[e])}return t}function iS(e,t,n,l=null){tQ(e,t,7,[n,l])}let iC=l9(),ix=0;function iE(e,t,n){let l=e.type,r=(t?t.appContext:e.appContext)||iC,i={uid:ix++,vnode:e,type:l,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new eg(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,l=!1){let r=l?ru:n.propsCache,i=r.get(t);if(i)return i;let s=t.props,o={},a=[],u=!1;if(!O(t)){let r=t=>{u=!0;let[l,r]=e(t,n,!0);C(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return I(t)&&r.set(t,m),m;if(k(s))for(let e=0;e<s.length;e++){let t=W(s[e]);rc(t)&&(o[t]=g)}else if(s)for(let e in s){let t=W(e);if(rc(t)){let n=s[e],l=o[t]=k(n)||O(n)?{type:n}:C({},n),r=l.type,i=!1,u=!0;if(k(r))for(let e=0;e<r.length;++e){let t=r[e],n=O(t)&&t.name;if("Boolean"===n){i=!0;break}"String"===n&&(u=!1)}else i=O(r)&&"Boolean"===r.name;l[0]=i,l[1]=u,(i||w(l,"default"))&&a.push(t)}}let c=[o,a];return I(t)&&r.set(t,c),c}(l,r),emitsOptions:function e(t,n,l=!1){let r=n.emitsCache,i=r.get(t);if(void 0!==i)return i;let s=t.emits,o={},a=!1;if(!O(t)){let r=t=>{let l=e(t,n,!0);l&&(a=!0,C(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(k(s)?s.forEach(e=>o[e]=null):C(o,s),I(t)&&r.set(t,o),o):(I(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:g,inheritAttrs:l.inheritAttrs,ctx:g,data:g,props:g,attrs:g,slots:g,refs:g,setupState:g,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=rU.bind(null,i),e.ce&&e.ce(i),i}let iw=null,ik=()=>iw||ni;{let e=ee(),t=(t,n)=>{let l;return(l=e[t])||(l=e[t]=[]),l.push(n),e=>{l.length>1?l.forEach(t=>t(e)):l[0](e)}};o=t("__VUE_INSTANCE_SETTERS__",e=>iw=e),a=t("__VUE_SSR_SETTERS__",e=>iN=e)}let iT=e=>{let t=iw;return o(e),e.scope.on(),()=>{e.scope.off(),o(t)}},iA=()=>{iw&&iw.scope.off(),o(null)};function iR(e){return 4&e.vnode.shapeFlag}let iN=!1;function iO(e,t=!1,n=!1){t&&a(t);let{props:l,children:r}=e.vnode,i=iR(e);!function(e,t,n,l=!1){let r={},i=ri();for(let n in e.propsDefaults=Object.create(null),ro(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:td(r):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),rm(e,r,n);let s=i?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lL);let{setup:l}=n;if(l){eM();let n=e.setupContext=l.length>1?iF(e):null,r=iT(e),i=tY(l,e,0,[e.props,n]),s=L(i);if(eI(),r(),(s||e.sp)&&!n5(e)&&n$(e),s){if(i.then(iA,iA),t)return i.then(n=>{iP(e,n,t)}).catch(t=>{t0(t,e,0)});e.asyncDep=i}else iP(e,i,t)}else iL(e,t)}(e,t):void 0;return t&&a(!1),s}function iP(e,t,n){O(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:I(t)&&(e.setupState=tI(t)),iL(e,n)}function iM(e){u=e,c=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,lD))}}let iI=()=>!u;function iL(e,t,n){let l=e.type;if(!e.render){if(!t&&u&&!l.render){let t=l.template||l0(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=C(C({isCustomElement:n,delimiters:i},r),s);l.render=u(t,o)}}e.render=l.render||_,c&&c(e)}{let t=iT(e);eM();try{!function(e){let t=l0(e),n=e.proxy,l=e.ctx;lY=!1,t.beforeCreate&&lQ(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:E,renderTriggered:w,errorCaptured:T,serverPrefetch:A,expose:R,inheritAttrs:N,components:M,directives:L,filters:D}=t;if(u&&function(e,t,n=_){for(let n in k(e)&&(e=l4(e)),e){let l;let r=e[n];tw(l=I(r)?"default"in r?rn(r.from||n,r.default,!0):rn(r.from||n):rn(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];O(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);I(t)&&(e.data=tp(t))}if(lY=!0,i)for(let e in i){let t=i[e],r=O(t)?t.bind(n,n):O(t.get)?t.get.bind(n,n):_,s=ij({get:r,set:!O(t)&&O(t.set)?t.set.bind(n):_});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?rD(l,r):()=>l[r];if(P(t)){let e=n[t];O(e)&&rM(i,e)}else if(O(t))rM(i,t.bind(l));else if(I(t)){if(k(t))t.forEach(t=>e(t,n,l,r));else{let e=O(t.handler)?t.handler.bind(l):n[t.handler];O(e)&&rM(i,e,t)}}}(o[e],l,n,e);if(a){let e=O(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{rt(t,e[t])})}function F(e,t){k(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&lQ(c,e,"c"),F(lc,f),F(lf,p),F(lp,d),F(ld,h),F(ll,g),F(lr,m),F(ly,T),F(l_,E),F(lm,w),F(lh,b),F(lg,C),F(lv,A),k(R)){if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}x&&e.render===_&&(e.render=x),null!=N&&(e.inheritAttrs=N),M&&(e.components=M),L&&(e.directives=L),A&&n$(e)}(e)}finally{eI(),t()}}}let iD={get:(e,t)=>(eH(e,"get",""),e[t])};function iF(e){return{attrs:new Proxy(e.attrs,iD),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function iV(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tI(tC(e.exposed)),{get:(t,n)=>n in t?t[n]:n in lM?lM[n](e):void 0,has:(e,t)=>t in e||t in lM})):e.proxy}function iU(e,t=!0){return O(e)?e.displayName||e.name:e.name||t&&e.__name}let ij=(e,t)=>(function(e,t,n=!1){let l,r;return O(e)?l=e:(l=e.get,r=e.set),new t$(l,r,n)})(e,0,iN);function iB(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&ir(n)&&(n=[n]),ic(e,t,n)):!I(t)||k(t)?ic(e,null,t):ir(t)?ic(e,null,[t]):ic(e,t)}function i$(){}function iH(e,t,n,l){let r=n[l];if(r&&iW(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i}function iW(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(J(n[e],t[e]))return!1;return r9>0&&r8&&r8.push(e),!0}let iK="3.5.13",iz=_,iq=null,iG=void 0,iJ=_,iX={createComponentInstance:iE,setupComponent:iO,renderComponentRoot:rB,setCurrentRenderingInstance:no,isVNode:ir,normalizeVNode:im,getComponentPublicInstance:iV,ensureValidVNode:lN,pushWarningContext:function(e){},popWarningContext:function(){}},iZ=null,iY=null,iQ=null,i0="undefined"!=typeof window&&window.trustedTypes;if(i0)try{d=i0.createPolicy("vue",{createHTML:e=>e})}catch(e){}let i1=d?e=>d.createHTML(e):e=>e,i2="undefined"!=typeof document?document:null,i6=i2&&i2.createElement("template"),i4="transition",i8="animation",i3=Symbol("_vtc"),i5={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},i9=C({},nN,i5),i7=((e=(e,{slots:t})=>iB(nM,sn(e),t)).displayName="Transition",e.props=i9,e),se=(e,t=[])=>{k(e)?e.forEach(e=>e(...t)):e&&e(...t)},st=e=>!!e&&(k(e)?e.some(e=>e.length>1):e.length>1);function sn(e){let t={};for(let n in e)n in i5||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(I(e))return[Q(e.enter),Q(e.leave)];{let t=Q(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:x,onBeforeAppear:E=_,onAppear:w=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,sr(e,t?c:o),sr(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,sr(e,f),sr(e,d),sr(e,p),t&&t()},R=e=>(t,n)=>{let r=e?w:y,s=()=>T(t,e,n);se(r,[t,s]),si(()=>{sr(t,e?a:i),sl(t,e?c:o),st(r)||so(t,l,g,s)})};return C(t,{onBeforeEnter(e){se(_,[e]),sl(e,i),sl(e,s)},onBeforeAppear(e){se(E,[e]),sl(e,a),sl(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);sl(e,f),e._enterCancelled?(sl(e,p),sf()):(sf(),sl(e,p)),si(()=>{e._isLeaving&&(sr(e,f),sl(e,d),st(S)||so(e,l,m,n))}),se(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),se(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),se(k,[e])},onLeaveCancelled(e){A(e),se(x,[e])}})}function sl(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[i3]||(e[i3]=new Set)).add(t)}function sr(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[i3];n&&(n.delete(t),n.size||(e[i3]=void 0))}function si(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ss=0;function so(e,t,n,l){let r=e._endId=++ss,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=sa(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c<a&&f()},o+1),e.addEventListener(u,p)}function sa(e,t){let n=window.getComputedStyle(e),l=e=>(n[e]||"").split(", "),r=l(`${i4}Delay`),i=l(`${i4}Duration`),s=su(r,i),o=l(`${i8}Delay`),a=l(`${i8}Duration`),u=su(o,a),c=null,f=0,p=0;t===i4?s>0&&(c=i4,f=s,p=i.length):t===i8?u>0&&(c=i8,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?i4:i8:null)?c===i4?i.length:a.length:0;let d=c===i4&&/\b(transform|all)(,|$)/.test(l(`${i4}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function su(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>sc(t)+sc(e[n])))}function sc(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function sf(){return document.body.offsetHeight}let sp=Symbol("_vod"),sd=Symbol("_vsh"),sh={beforeMount(e,{value:t},{transition:n}){e[sp]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):sg(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),sg(e,!0),l.enter(e)):l.leave(e,()=>{sg(e,!1)}):sg(e,t))},beforeUnmount(e,{value:t}){sg(e,t)}};function sg(e,t){e.style.display=t?e[sp]:"none",e[sd]=!t}let sv=Symbol("");function sm(e){let t=ik();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>s_(e,n))},l=()=>{let l=e(t.proxy);t.ce?s_(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)s_(t.el,n);else if(t.type===r0)t.children.forEach(t=>e(t,n));else if(t.type===r6){let{el:e,anchor:l}=t;for(;e&&(s_(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};lp(()=>{nt(l)}),lf(()=>{rM(l,_,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),lg(()=>e.disconnect())})}function s_(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[sv]=l}}let sy=/(^|;)\s*display\s*:/,sb=/\s*!important$/;function sS(e,t,n){if(k(n))n.forEach(n=>sS(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=sx[t];if(n)return n;let l=W(t);if("filter"!==l&&l in e)return sx[t]=l;l=q(l);for(let n=0;n<sC.length;n++){let r=sC[n]+l;if(r in e)return sx[t]=r}return t}(e,t);sb.test(n)?e.setProperty(z(l),n.replace(sb,""),"important"):e[l]=n}}let sC=["Webkit","Moz","ms"],sx={},sE="http://www.w3.org/1999/xlink";function sw(e,t,n,l,r,i=ea(t)){l&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(sE,t.slice(6,t.length)):e.setAttributeNS(sE,t,n):null==n||i&&!(n||""===n)?e.removeAttribute(t):e.setAttribute(t,i?"":M(n)?String(n):n)}function sk(e,t,n,l,r){if("innerHTML"===t||"textContent"===t){null!=n&&(e[t]="innerHTML"===t?i1(n):n);return}let i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){let l="OPTION"===i?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);l===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),e._value=n;return}let s=!1;if(""===n||null==n){let l=typeof e[t];if("boolean"===l){var o;n=!!(o=n)||""===o}else null==n&&"string"===l?(n="",s=!0):"number"===l&&(n=0,s=!0)}try{e[t]=n}catch(e){}s&&e.removeAttribute(r||t)}function sT(e,t,n,l){e.addEventListener(t,n,l)}let sA=Symbol("_vei"),sR=/(?:Once|Passive|Capture)$/,sN=0,sO=Promise.resolve(),sP=()=>sN||(sO.then(()=>sN=0),sN=Date.now()),sM=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),sI={};function sL(e,t,n){let l=nj(e,t);U(l)&&C(l,t);class r extends sV{constructor(e){super(l,e,n)}}return r.def=l,r}let sD=(e,t)=>sL(e,t,op),sF="undefined"!=typeof HTMLElement?HTMLElement:class{};class sV extends sF{constructor(e,t={},n=of){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==of?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof sV){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,t9(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(e=>{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!k(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=Q(this._props[e])),(n||(n=Object.create(null)))[W(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)w(this,e)||Object.defineProperty(this,e,{get:()=>tO(t[e])})}_resolveProps(e){let{props:t}=e,n=k(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(W))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):sI,l=W(e);t&&this._numberProps&&this._numberProps[l]&&(n=Q(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===sI?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(z(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(z(e),t+""):t||this.removeAttribute(z(e)),n&&n.observe(this,{attributes:!0})}}_update(){ou(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=ic(this._def,C(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,U(t[0])?C({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),z(e)!==e&&t(z(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let l=e[n],r=l.getAttribute("name")||"default",i=this._slots[r],s=l.parentNode;if(i)for(let e of i){if(t&&1===e.nodeType){let n;let l=t+"-s",r=document.createTreeWalker(e,1);for(e.setAttribute(l,"");n=r.nextNode();)n.setAttribute(l,"")}s.insertBefore(e,l)}else for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}}_injectChildStyle(e){this._applyStyles(e.styles,e)}_removeChildStyle(e){}}function sU(e){let t=ik();return t&&t.ce||null}function sj(){let e=sU();return e&&e.shadowRoot}function sB(e="$style"){{let t=ik();if(!t)return g;let n=t.type.__cssModules;return n&&n[e]||g}}let s$=new WeakMap,sH=new WeakMap,sW=Symbol("_moveCb"),sK=Symbol("_enterCb"),sz=(t={name:"TransitionGroup",props:C({},i9,{tag:String,moveClass:String}),setup(e,{slots:t}){let n,l;let r=ik(),i=nA();return ld(()=>{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[i3];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=sa(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t))return;n.forEach(sq),n.forEach(sG);let l=n.filter(sJ);sf(),l.forEach(e=>{let n=e.el,l=n.style;sl(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[sW]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[sW]=null,sr(n,t))};n.addEventListener("transitionend",r)})}),()=>{let s=tS(e),o=sn(s),a=s.tag||r0;if(n=[],l)for(let e=0;e<l.length;e++){let t=l[e];t.el&&t.el instanceof Element&&(n.push(t),nV(t,nL(t,o,i,r)),s$.set(t,t.el.getBoundingClientRect()))}l=t.default?nU(t.default()):[];for(let e=0;e<l.length;e++){let t=l[e];null!=t.key&&nV(t,nL(t,o,i,r))}return ic(a,null,l)}}},delete t.props.mode,t);function sq(e){let t=e.el;t[sW]&&t[sW](),t[sK]&&t[sK]()}function sG(e){sH.set(e,e.el.getBoundingClientRect())}function sJ(e){let t=s$.get(e),n=sH.get(e),l=t.left-n.left,r=t.top-n.top;if(l||r){let t=e.el.style;return t.transform=t.webkitTransform=`translate(${l}px,${r}px)`,t.transitionDuration="0s",e}}let sX=e=>{let t=e.props["onUpdate:modelValue"]||!1;return k(t)?e=>X(t,e):t};function sZ(e){e.target.composing=!0}function sY(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let sQ=Symbol("_assign"),s0={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[sQ]=sX(r);let i=l||r.props&&"number"===r.props.type;sT(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Y(l)),e[sQ](l)}),n&&sT(e,"change",()=>{e.value=e.value.trim()}),t||(sT(e,"compositionstart",sZ),sT(e,"compositionend",sY),sT(e,"change",sY))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[sQ]=sX(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?Y(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a)||(e.value=a)}},s1={deep:!0,created(e,t,n){e[sQ]=sX(n),sT(e,"change",()=>{let t=e._modelValue,n=s3(e),l=e.checked,r=e[sQ];if(k(t)){let e=ec(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(A(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(s5(e,l))})},mounted:s2,beforeUpdate(e,t,n){e[sQ]=sX(n),s2(e,t,n)}};function s2(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,k(t))r=ec(t,l.props.value)>-1;else if(A(t))r=t.has(l.props.value);else{if(t===n)return;r=eu(t,s5(e,!0))}e.checked!==r&&(e.checked=r)}let s6={created(e,{value:t},n){e.checked=eu(t,n.props.value),e[sQ]=sX(n),sT(e,"change",()=>{e[sQ](s3(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[sQ]=sX(l),t!==n&&(e.checked=eu(t,l.props.value))}},s4={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=A(t);sT(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Y(s3(e)):s3(e));e[sQ](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,t9(()=>{e._assigning=!1})}),e[sQ]=sX(l)},mounted(e,{value:t}){s8(e,t)},beforeUpdate(e,t,n){e[sQ]=sX(n)},updated(e,{value:t}){e._assigning||s8(e,t)}};function s8(e,t){let n=e.multiple,l=k(t);if(!n||l||A(t)){for(let r=0,i=e.options.length;r<i;r++){let i=e.options[r],s=s3(i);if(n){if(l){let e=typeof s;"string"===e||"number"===e?i.selected=t.some(e=>String(e)===String(s)):i.selected=ec(t,s)>-1}else i.selected=t.has(s)}else if(eu(s3(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function s3(e){return"_value"in e?e._value:e.value}function s5(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}let s9={created(e,t,n){oe(e,t,n,null,"created")},mounted(e,t,n){oe(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){oe(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){oe(e,t,n,l,"updated")}};function s7(e,t){switch(e){case"SELECT":return s4;case"TEXTAREA":return s0;default:switch(t){case"checkbox":return s1;case"radio":return s6;default:return s0}}}function oe(e,t,n,l,r){let i=s7(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let ot=["ctrl","shift","alt","meta"],on={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>ot.some(n=>e[`${n}Key`]&&!t.includes(n))},ol=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;e<t.length;e++){let l=on[t[e]];if(l&&l(n,t))return}return e(n,...l)})},or={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},oi=(e,t)=>{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=z(n.key);if(t.some(e=>e===l||or[e]===l))return e(n)})},os=C({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;"class"===t?function(e,t,n){let l=e[i3];l&&(t=(t?[t,...l]:[...l]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,l,s):"style"===t?function(e,t,n){let l=e.style,r=P(n),i=!1;if(n&&!r){if(t){if(P(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&sS(l,t,"")}else for(let e in t)null==n[e]&&sS(l,e,"")}for(let e in n)"display"===e&&(i=!0),sS(l,e,n[e])}else if(r){if(t!==n){let e=l[sv];e&&(n+=";"+e),l.cssText=n,i=sy.test(n)}}else t&&e.removeAttribute("style");sp in e&&(e[sp]=i?l.display:"",e[sd]&&(l.display="none"))}(e,n,l):b(t)?S(t)||function(e,t,n,l,r=null){let i=e[sA]||(e[sA]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(sR.test(e)){let n;for(t={};n=e.match(sR);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):z(e.slice(2)),t]}(t);l?sT(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tQ(function(e,t){if(!k(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=sP(),n}(l,r),o):s&&(!function(e,t,n,l){e.removeEventListener(t,n,l)}(e,n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&sM(t)&&O(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(sM(t)&&P(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!P(l))?sk(e,W(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),sw(e,t,l,s)):(sk(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||sw(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?i2.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?i2.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?i2.createElement(e,{is:n}):i2.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>i2.createTextNode(e),createComment:e=>i2.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>i2.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{i6.innerHTML=i1("svg"===l?`<svg>${e}</svg>`:"mathml"===l?`<math>${e}</math>`:e);let r=i6.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),oo=!1;function oa(){return f=oo?f:rS(os),oo=!0,f}let ou=(...e)=>{(f||(f=rb(os))).render(...e)},oc=(...e)=>{oa().hydrate(...e)},of=(...e)=>{let t=(f||(f=rb(os))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=oh(e);if(!l)return;let r=t._component;O(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,od(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},op=(...e)=>{let t=oa().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=oh(e);if(t)return n(t,!0,od(t))},t};function od(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function oh(e){return P(e)?document.querySelector(e):e}let og=!1,ov=()=>{og||(og=!0,s0.getSSRProps=({value:e})=>({value:e}),s6.getSSRProps=({value:e},t)=>{if(t.props&&eu(t.props.value,e))return{checked:!0}},s1.getSSRProps=({value:e},t)=>{if(k(e)){if(t.props&&ec(e,t.props.value)>-1)return{checked:!0}}else if(A(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},s9.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;let n=s7(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)},sh.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};export{nM as BaseTransition,nN as BaseTransitionPropsValidators,r2 as Comment,iQ as DeprecationTypes,eg as EffectScope,tZ as ErrorCodes,iq as ErrorTypeStrings,r0 as Fragment,lt as KeepAlive,eb as ReactiveEffect,r6 as Static,rG as Suspense,nx as Teleport,r1 as Text,tH as TrackOpTypes,i7 as Transition,sz as TransitionGroup,tW as TriggerOpTypes,sV as VueElement,tX as assertNumber,tQ as callWithAsyncErrorHandling,tY as callWithErrorHandling,W as camelize,q as capitalize,id as cloneVNode,iY as compatUtils,ij as computed,of as createApp,il as createBlock,iv as createCommentVNode,it as createElementBlock,iu as createElementVNode,rS as createHydrationRenderer,lX as createPropsRestProxy,rb as createRenderer,op as createSSRApp,lA as createSlots,ig as createStaticVNode,ih as createTextVNode,ic as createVNode,tD as customRef,n9 as defineAsyncComponent,nj as defineComponent,sL as defineCustomElement,lV as defineEmits,lU as defineExpose,l$ as defineModel,lj as defineOptions,lF as defineProps,sD as defineSSRCustomElement,lB as defineSlots,iG as devtools,eR as effect,ev as effectScope,ik as getCurrentInstance,em as getCurrentScope,tq as getCurrentWatcher,nU as getTransitionRawChildren,ip as guardReactiveProps,iB as h,t0 as handleError,rl as hasInjectionContext,oc as hydrate,n6 as hydrateOnIdle,n3 as hydrateOnInteraction,n8 as hydrateOnMediaQuery,n4 as hydrateOnVisible,i$ as initCustomFormatter,ov as initDirectivesForSSR,rn as inject,iW as isMemoSame,tb as isProxy,tm as isReactive,t_ as isReadonly,tw as isRef,iI as isRuntimeOnly,ty as isShallow,ir as isVNode,tC as markRaw,lG as mergeDefaults,lJ as mergeModels,ib as mergeProps,t9 as nextTick,es as normalizeClass,eo as normalizeProps,en as normalizeStyle,ll as onActivated,lc as onBeforeMount,lh as onBeforeUnmount,lp as onBeforeUpdate,lr as onDeactivated,ly as onErrorCaptured,lf as onMounted,l_ as onRenderTracked,lm as onRenderTriggered,e_ as onScopeDispose,lv as onServerPrefetch,lg as onUnmounted,ld as onUpdated,tG as onWatcherCleanup,r3 as openBlock,nu as popScopeId,rt as provide,tI as proxyRefs,na as pushScopeId,nt as queuePostFlushCb,tp as reactive,th as readonly,tk as ref,iM as registerRuntimeCompiler,ou as render,lT as renderList,lR as renderSlot,lS as resolveComponent,lE as resolveDirective,lx as resolveDynamicComponent,iZ as resolveFilter,nL as resolveTransitionHooks,r7 as setBlockTracking,iJ as setDevtoolsHook,nV as setTransitionHooks,td as shallowReactive,tg as shallowReadonly,tT as shallowRef,rA as ssrContextKey,iX as ssrUtils,eN as stop,ep as toDisplayString,G as toHandlerKey,lO as toHandlers,tS as toRaw,tj as toRef,tF as toRefs,tP as toValue,is as transformVNodeArgs,tN as triggerRef,tO as unref,lK as useAttrs,sB as useCssModule,sm as useCssVars,sU as useHost,nB as useId,rF as useModel,rR as useSSRContext,sj as useShadowRoot,lW as useSlots,nH as useTemplateRef,nA as useTransitionState,s1 as vModelCheckbox,s9 as vModelDynamic,s6 as vModelRadio,s4 as vModelSelect,s0 as vModelText,sh as vShow,iK as version,iz as warn,rM as watch,rN as watchEffect,rO as watchPostEffect,rP as watchSyncEffect,lZ as withAsyncContext,nf as withCtx,lH as withDefaults,np as withDirectives,oi as withKeys,iH as withMemo,ol as withModifiers,nc as withScopeId}; diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js new file mode 100644 index 0000000..ffdd0b2 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js @@ -0,0 +1,1860 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core'; +export * from '@vue/runtime-core'; +import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, isPlainObject, hasOwn, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared'; + +let policy = void 0; +const tt = typeof window !== "undefined" && window.trustedTypes; +if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + !!(process.env.NODE_ENV !== "production") && warn(`Error creating trusted types policy: ${e}`); + } +} +const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; + +const TRANSITION = "transition"; +const ANIMATION = "animation"; +const vtcKey = Symbol("_vtc"); +const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String +}; +const TransitionPropsValidators = /* @__PURE__ */ extend( + {}, + BaseTransitionPropsValidators, + DOMTransitionPropsValidators +); +const decorate$1 = (t) => { + t.displayName = "Transition"; + t.props = TransitionPropsValidators; + return t; +}; +const Transition = /* @__PURE__ */ decorate$1( + (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots) +); +const callHook = (hook, args = []) => { + if (isArray(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } +}; +const hasExplicitCallback = (hook) => { + return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; +}; +function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; + } + } + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done, isCancelled) => { + el._enterCancelled = isCancelled; + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); + }; + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); + }; + }; + return extend(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + if (!el._enterCancelled) { + forceReflow(); + addTransitionClass(el, leaveActiveClass); + } else { + addTransitionClass(el, leaveActiveClass); + forceReflow(); + } + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } + }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false, void 0, true); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true, void 0, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); +} +function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if (isObject(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; + } +} +function NumberOf(val) { + const res = toNumber(val); + if (!!(process.env.NODE_ENV !== "production")) { + assertNumber(res, "<transition> explicit duration"); + } + return res; +} +function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); +} +function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; + } + } +} +function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); + }); +} +let endId = 0; +function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); + } + }; + if (explicitTimeout != null) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); + } + }; + setTimeout(() => { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(endEvent, onEnd); +} +function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; + } + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; +} +function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); +} +function toMs(s) { + if (s === "auto") return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; +} +function forceReflow() { + return document.body.offsetHeight; +} + +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } +} + +const vShowOriginalDisplay = Symbol("_vod"); +const vShowHidden = Symbol("_vsh"); +const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); + } +}; +if (!!(process.env.NODE_ENV !== "production")) { + vShow.name = "show"; +} +function setDisplay(el, value) { + el.style.display = value ? el[vShowOriginalDisplay] : "none"; + el[vShowHidden] = !value; +} +function initVShowForSSR() { + vShow.getSSRProps = ({ value }) => { + if (!value) { + return { style: { display: "none" } }; + } + }; +} + +const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : ""); +function useCssVars(getter) { + const instance = getCurrentInstance(); + if (!instance) { + !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`); + return; + } + const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { + Array.from( + document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) + ).forEach((node) => setVarsOnNode(node, vars)); + }; + if (!!(process.env.NODE_ENV !== "production")) { + instance.getCssVars = () => getter(instance.proxy); + } + const setVars = () => { + const vars = getter(instance.proxy); + if (instance.ce) { + setVarsOnNode(instance.ce, vars); + } else { + setVarsOnVNode(instance.subTree, vars); + } + updateTeleports(vars); + }; + onBeforeUpdate(() => { + queuePostFlushCb(setVars); + }); + onMounted(() => { + watch(setVars, NOOP, { flush: "post" }); + const ob = new MutationObserver(setVars); + ob.observe(instance.subTree.el.parentNode, { childList: true }); + onUnmounted(() => ob.disconnect()); + }); +} +function setVarsOnVNode(vnode, vars) { + if (vnode.shapeFlag & 128) { + const suspense = vnode.suspense; + vnode = suspense.activeBranch; + if (suspense.pendingBranch && !suspense.isHydrating) { + suspense.effects.push(() => { + setVarsOnVNode(suspense.activeBranch, vars); + }); + } + } + while (vnode.component) { + vnode = vnode.component.subTree; + } + if (vnode.shapeFlag & 1 && vnode.el) { + setVarsOnNode(vnode.el, vars); + } else if (vnode.type === Fragment) { + vnode.children.forEach((c) => setVarsOnVNode(c, vars)); + } else if (vnode.type === Static) { + let { el, anchor } = vnode; + while (el) { + setVarsOnNode(el, vars); + if (el === anchor) break; + el = el.nextSibling; + } + } +} +function setVarsOnNode(el, vars) { + if (el.nodeType === 1) { + const style = el.style; + let cssText = ""; + for (const key in vars) { + style.setProperty(`--${key}`, vars[key]); + cssText += `--${key}: ${vars[key]};`; + } + style[CSS_VAR_TEXT] = cssText; + } +} + +const displayRE = /(^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } +} +const semicolonRE = /[^\\];\s*$/; +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if (isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + if (!!(process.env.NODE_ENV !== "production")) { + if (semicolonRE.test(val)) { + warn( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } + } + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : isSymbol(value) ? String(value) : value + ); + } + } +} + +function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + if (!!(process.env.NODE_ENV !== "production") && !needRemove) { + warn( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(attrName || key); +} + +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function sanitizeEventValue(value, propName) { + if (isFunction(value) || isArray(value)) { + return value; + } + warn( + `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? +Expected function or array of functions, received type ${typeof value}.` + ); + return NOOP; +} +function patchStopImmediatePropagation(e, value) { + if (isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (isOn(key)) { + if (!isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue)) + ) { + patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } +}; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && isString(value)) { + return false; + } + return key in el; +} + +const REMOVAL = {}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineCustomElement(options, extraOptions, _createApp) { + const Comp = defineComponent(options, extraOptions); + if (isPlainObject(Comp)) extend(Comp, extraOptions); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, _createApp); + } + } + VueCustomElement.def = Comp; + return VueCustomElement; +} +/*! #__NO_SIDE_EFFECTS__ */ +const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { + return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); +}; +const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { +}; +class VueElement extends BaseClass { + constructor(_def, _props = {}, _createApp = createApp) { + super(); + this._def = _def; + this._props = _props; + this._createApp = _createApp; + this._isVueCE = true; + /** + * @internal + */ + this._instance = null; + /** + * @internal + */ + this._app = null; + /** + * @internal + */ + this._nonce = this._def.nonce; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._styleChildren = /* @__PURE__ */ new WeakSet(); + this._ob = null; + if (this.shadowRoot && _createApp !== createApp) { + this._root = this.shadowRoot; + } else { + if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) { + warn( + `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + ); + } + if (_def.shadowRoot !== false) { + this.attachShadow({ mode: "open" }); + this._root = this.shadowRoot; + } else { + this._root = this; + } + } + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); + } + } + connectedCallback() { + if (!this.isConnected) return; + if (!this.shadowRoot) { + this._parseSlots(); + } + this._connected = true; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + this._parent = parent; + break; + } + } + if (!this._instance) { + if (this._resolved) { + this._setParent(); + this._update(); + } else { + if (parent && parent._pendingResolve) { + this._pendingResolve = parent._pendingResolve.then(() => { + this._pendingResolve = void 0; + this._resolveDef(); + }); + } else { + this._resolveDef(); + } + } + } + } + _setParent(parent = this._parent) { + if (parent) { + this._instance.parent = parent._instance; + this._instance.provides = parent._instance.provides; + } + } + disconnectedCallback() { + this._connected = false; + nextTick(() => { + if (!this._connected) { + if (this._ob) { + this._ob.disconnect(); + this._ob = null; + } + this._app && this._app.unmount(); + if (this._instance) this._instance.ce = void 0; + this._app = this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + if (this._pendingResolve) { + return; + } + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); + } + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + this._resolved = true; + this._pendingResolve = void 0; + const { props, styles } = def; + let numberProps; + if (props && !isArray(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = toNumber(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + if (this.shadowRoot) { + this._applyStyles(styles); + } else if (!!(process.env.NODE_ENV !== "production") && styles) { + warn( + "Custom element style injection is not supported when using shadowRoot: false" + ); + } + this._mount(def); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + this._pendingResolve = asyncDef().then( + (def) => resolve(this._def = def, true) + ); + } else { + resolve(this._def); + } + } + _mount(def) { + if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) { + def.name = "VueElement"; + } + this._app = this._createApp(def); + if (def.configureApp) { + def.configureApp(this._app); + } + this._app._ceVNode = this._createVNode(); + this._app.mount(this._root); + const exposed = this._instance && this._instance.exposed; + if (!exposed) return; + for (const key in exposed) { + if (!hasOwn(this, key)) { + Object.defineProperty(this, key, { + // unwrap ref to be consistent with public instance behavior + get: () => unref(exposed[key]) + }); + } else if (!!(process.env.NODE_ENV !== "production")) { + warn(`Exposed property "${key}" already exists on custom element.`); + } + } + } + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = isArray(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key]); + } + } + for (const key of declaredPropKeys.map(camelize$1)) { + Object.defineProperty(this, key, { + get() { + return this._getProp(key); + }, + set(val) { + this._setProp(key, val, true, true); + } + }); + } + } + _setAttr(key) { + if (key.startsWith("data-v-")) return; + const has = this.hasAttribute(key); + let value = has ? this.getAttribute(key) : REMOVAL; + const camelKey = camelize$1(key); + if (has && this._numberProps && this._numberProps[camelKey]) { + value = toNumber(value); + } + this._setProp(camelKey, value, false, true); + } + /** + * @internal + */ + _getProp(key) { + return this._props[key]; + } + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = false) { + if (val !== this._props[key]) { + if (val === REMOVAL) { + delete this._props[key]; + } else { + this._props[key] = val; + if (key === "key" && this._app) { + this._app._ceVNode.key = val; + } + } + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + const ob = this._ob; + ob && ob.disconnect(); + if (val === true) { + this.setAttribute(hyphenate(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute(hyphenate(key), val + ""); + } else if (!val) { + this.removeAttribute(hyphenate(key)); + } + ob && ob.observe(this, { attributes: true }); + } + } + } + _update() { + render(this._createVNode(), this._root); + } + _createVNode() { + const baseProps = {}; + if (!this.shadowRoot) { + baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); + } + const vnode = createVNode(this._def, extend(baseProps, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.ce = this; + instance.isCE = true; + if (!!(process.env.NODE_ENV !== "production")) { + instance.ceReload = (newStyles) => { + if (this._styles) { + this._styles.forEach((s) => this._root.removeChild(s)); + this._styles.length = 0; + } + this._applyStyles(newStyles); + this._instance = null; + this._update(); + }; + } + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent( + event, + isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args } + ) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if (hyphenate(event) !== event) { + dispatch(hyphenate(event), args); + } + }; + this._setParent(); + }; + } + return vnode; + } + _applyStyles(styles, owner) { + if (!styles) return; + if (owner) { + if (owner === this._def || this._styleChildren.has(owner)) { + return; + } + this._styleChildren.add(owner); + } + const nonce = this._nonce; + for (let i = styles.length - 1; i >= 0; i--) { + const s = document.createElement("style"); + if (nonce) s.setAttribute("nonce", nonce); + s.textContent = styles[i]; + this.shadowRoot.prepend(s); + if (!!(process.env.NODE_ENV !== "production")) { + if (owner) { + if (owner.__hmrId) { + if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); + let entry = this._childStyles.get(owner.__hmrId); + if (!entry) { + this._childStyles.set(owner.__hmrId, entry = []); + } + entry.push(s); + } + } else { + (this._styles || (this._styles = [])).push(s); + } + } + } + } + /** + * Only called when shadowRoot is false + */ + _parseSlots() { + const slots = this._slots = {}; + let n; + while (n = this.firstChild) { + const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; + (slots[slotName] || (slots[slotName] = [])).push(n); + this.removeChild(n); + } + } + /** + * Only called when shadowRoot is false + */ + _renderSlots() { + const outlets = (this._teleportTarget || this).querySelectorAll("slot"); + const scopeId = this._instance.type.__scopeId; + for (let i = 0; i < outlets.length; i++) { + const o = outlets[i]; + const slotName = o.getAttribute("name") || "default"; + const content = this._slots[slotName]; + const parent = o.parentNode; + if (content) { + for (const n of content) { + if (scopeId && n.nodeType === 1) { + const id = scopeId + "-s"; + const walker = document.createTreeWalker(n, 1); + n.setAttribute(id, ""); + let child; + while (child = walker.nextNode()) { + child.setAttribute(id, ""); + } + } + parent.insertBefore(n, o); + } + } else { + while (o.firstChild) parent.insertBefore(o.firstChild, o); + } + parent.removeChild(o); + } + } + /** + * @internal + */ + _injectChildStyle(comp) { + this._applyStyles(comp.styles, comp); + } + /** + * @internal + */ + _removeChildStyle(comp) { + if (!!(process.env.NODE_ENV !== "production")) { + this._styleChildren.delete(comp); + if (this._childStyles && comp.__hmrId) { + const oldStyles = this._childStyles.get(comp.__hmrId); + if (oldStyles) { + oldStyles.forEach((s) => this._root.removeChild(s)); + oldStyles.length = 0; + } + } + } + } +} +function useHost(caller) { + const instance = getCurrentInstance(); + const el = instance && instance.ce; + if (el) { + return el; + } else if (!!(process.env.NODE_ENV !== "production")) { + if (!instance) { + warn( + `${caller || "useHost"} called without an active component instance.` + ); + } else { + warn( + `${caller || "useHost"} can only be used in components defined via defineCustomElement.` + ); + } + } + return null; +} +function useShadowRoot() { + const el = !!(process.env.NODE_ENV !== "production") ? useHost("useShadowRoot") : useHost(); + return el && el.shadowRoot; +} + +function useCssModule(name = "$style") { + { + const instance = getCurrentInstance(); + if (!instance) { + !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`); + return EMPTY_OBJ; + } + const modules = instance.type.__cssModules; + if (!modules) { + !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`); + return EMPTY_OBJ; + } + const mod = modules[name]; + if (!mod) { + !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`); + return EMPTY_OBJ; + } + return mod; + } +} + +const positionMap = /* @__PURE__ */ new WeakMap(); +const newPositionMap = /* @__PURE__ */ new WeakMap(); +const moveCbKey = Symbol("_moveCb"); +const enterCbKey = Symbol("_enterCb"); +const decorate = (t) => { + delete t.props.mode; + return t; +}; +const TransitionGroupImpl = /* @__PURE__ */ decorate({ + name: "TransitionGroup", + props: /* @__PURE__ */ extend({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + let prevChildren; + let children; + onUpdated(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = toRaw(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || Fragment; + prevChildren = []; + if (children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.el && child.el instanceof Element) { + prevChildren.push(child); + setTransitionHooks( + child, + resolveTransitionHooks( + child, + cssTransitionProps, + state, + instance + ) + ); + positionMap.set( + child, + child.el.getBoundingClientRect() + ); + } + } + } + children = slots.default ? getTransitionRawChildren(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + setTransitionHooks( + child, + resolveTransitionHooks(child, cssTransitionProps, state, instance) + ); + } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) { + warn(`<TransitionGroup> children must be keyed.`); + } + } + return createVNode(tag, null, children); + }; + } +}); +const TransitionGroup = TransitionGroupImpl; +function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); + } +} +function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); +} +function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } +} +function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; +} + +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } +}; +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (isArray(modelValue)) { + const index = looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } +}; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (isArray(value)) { + checked = looseIndexOf(value, vnode.props.value) > -1; + } else if (isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = looseEqual(value, vnode.props.value); + } + } +}; +const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = isSet(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? looseToNumber(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + el._assigning = true; + nextTick(() => { + el._assigning = false; + }); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + if (!el._assigning) { + setSelected(el, value); + } + } +}; +function setSelected(el, value) { + const isMultiple = el.multiple; + const isArrayValue = isArray(value); + if (isMultiple && !isArrayValue && !isSet(value)) { + !!(process.env.NODE_ENV !== "production") && warn( + `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` + ); + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if (isArrayValue) { + const optionType = typeof optionValue; + if (optionType === "string" || optionType === "number") { + option.selected = value.some((v) => String(v) === String(optionValue)); + } else { + option.selected = looseIndexOf(value, optionValue) > -1; + } + } else { + option.selected = value.has(optionValue); + } + } else if (looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) el.selectedIndex = i; + return; + } + } + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; + } +} +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); + } +}; +function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; + } + } +} +function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && looseEqual(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if (isArray(value)) { + if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if (isSet(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; + vModelDynamic.getSSRProps = (binding, vnode) => { + if (typeof vnode.type !== "string") { + return; + } + const modelToUse = resolveDynamicModel( + // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase + vnode.type.toUpperCase(), + vnode.props && vnode.props.type + ); + if (modelToUse.getSSRProps) { + return modelToUse.getSSRProps(binding, vnode); + } + }; +} + +const systemModifiers = ["ctrl", "shift", "alt", "meta"]; +const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + }); +}; +const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" +}; +const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; + } + const eventKey = hyphenate(event.key); + if (modifiers.some( + (k) => k === eventKey || keyNames[k] === eventKey + )) { + return fn(event); + } + }); +}; + +const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); +let renderer; +let enabledHydration = false; +function ensureRenderer() { + return renderer || (renderer = createRenderer(rendererOptions)); +} +function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions); + enabledHydration = true; + return renderer; +} +const render = (...args) => { + ensureRenderer().render(...args); +}; +const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); +}; +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + if (!!(process.env.NODE_ENV !== "production")) { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; +}; +const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + if (!!(process.env.NODE_ENV !== "production")) { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); + } + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } +} +function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + writable: false + }); +} +function injectCompilerOptionsCheck(app) { + if (isRuntimeOnly()) { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + warn( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + warn(msg); + return compilerOptions; + }, + set() { + warn(msg); + } + }); + } +} +function normalizeContainer(container) { + if (isString(container)) { + const res = document.querySelector(container); + if (!!(process.env.NODE_ENV !== "production") && !res) { + warn( + `Failed to mount app: mount target selector "${container}" returned null.` + ); + } + return res; + } + if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + warn( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); + } + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + initVShowForSSR(); + } +} ; + +export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers }; diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.js new file mode 100644 index 0000000..c54b5c7 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.js @@ -0,0 +1,12383 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +var VueRuntimeDOM = (function (exports) { + 'use strict'; + + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; + } + + const EMPTY_OBJ = Object.freeze({}) ; + const EMPTY_ARR = Object.freeze([]) ; + const NOOP = () => { + }; + const NO = () => false; + const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter + (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); + const isModelListener = (key) => key.startsWith("onUpdate:"); + const extend = Object.assign; + const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } + }; + const hasOwnProperty$1 = Object.prototype.hasOwnProperty; + const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); + const isArray = Array.isArray; + const isMap = (val) => toTypeString(val) === "[object Map]"; + const isSet = (val) => toTypeString(val) === "[object Set]"; + const isDate = (val) => toTypeString(val) === "[object Date]"; + const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; + const isFunction = (val) => typeof val === "function"; + const isString = (val) => typeof val === "string"; + const isSymbol = (val) => typeof val === "symbol"; + const isObject = (val) => val !== null && typeof val === "object"; + const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); + }; + const objectToString = Object.prototype.toString; + const toTypeString = (value) => objectToString.call(value); + const toRawType = (value) => { + return toTypeString(value).slice(8, -1); + }; + const isPlainObject = (val) => toTypeString(val) === "[object Object]"; + const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; + const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" + ); + const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" + ); + const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; + }; + const camelizeRE = /-(\w)/g; + const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } + ); + const hyphenateRE = /\B([A-Z])/g; + const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() + ); + const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); + }); + const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } + ); + const hasChanged = (value, oldValue) => !Object.is(value, oldValue); + const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } + }; + const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); + }; + const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; + }; + const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; + }; + let _globalThis; + const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); + }; + + const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; + const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); + + function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } + } + const listDelimiterRE = /;(?![^(]*\))/g; + const propertyDelimiterRE = /:([^]+)/; + const styleCommentRE = /\/\*[^]*?\*\//g; + function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; + } + function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; + } + function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); + } + function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; + } + + const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; + const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; + const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; + const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); + const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); + const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); + + const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; + const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); + const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` + ); + function includeBooleanAttr(value) { + return !!value || value === ""; + } + const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` + ); + const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` + ); + function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; + } + + const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; + function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => `\\${s}` + ); + } + + function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; + } + function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); + } + function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); + } + + const isRef$1 = (val) => { + return !!(val && val["__v_isRef"] === true); + }; + const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); + }; + const replacer = (_key, val) => { + if (isRef$1(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; + }; + const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); + }; + + function warn$2(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); + } + + let activeEffectScope; + class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn$2(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } + } + function effectScope(detached) { + return new EffectScope(detached); + } + function getCurrentScope() { + return activeEffectScope; + } + function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn$2( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } + } + + let activeSub; + const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); + class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn$2( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } + } + let batchDepth = 0; + let batchedSub; + let batchedComputed; + function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; + } + function startBatch() { + batchDepth++; + } + function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; + } + function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } + } + function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; + } + function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; + } + function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } + } + function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } + } + function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } + } + function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; + } + function stop(runner) { + runner.effect.stop(); + } + let shouldTrack = true; + const trackStack = []; + function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; + } + function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; + } + function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } + } + + let globalVersion = 0; + class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } + } + class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } + } + function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } + } + const targetMap = /* @__PURE__ */ new WeakMap(); + const ITERATE_KEY = Symbol( + "Object iterate" + ); + const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" + ); + const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" + ); + function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } + } + function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); + } + function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); + } + + function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); + } + function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; + } + const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } + }; + function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; + } + const arrayProto = Array.prototype; + function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; + } + function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); + } + function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; + } + function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; + } + + const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); + const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) + ); + function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); + } + class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } + } + class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } + } + class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn$2( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn$2( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + } + const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); + const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); + const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); + const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + + const toShallow = (value) => value; + const getProto = (v) => Reflect.getPrototypeOf(v); + function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; + } + function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn$2( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; + } + function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; + } + function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; + } + const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) + }; + const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) + }; + const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) + }; + const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) + }; + function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn$2( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } + } + + const reactiveMap = /* @__PURE__ */ new WeakMap(); + const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); + const readonlyMap = /* @__PURE__ */ new WeakMap(); + const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); + function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } + } + function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); + } + function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); + } + function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); + } + function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); + } + function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); + } + function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + warn$2( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; + } + function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); + } + function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); + } + function isShallow(value) { + return !!(value && value["__v_isShallow"]); + } + function isProxy(value) { + return value ? !!value["__v_raw"] : false; + } + function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; + } + function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; + } + const toReactive = (value) => isObject(value) ? reactive(value) : value; + const toReadonly = (value) => isObject(value) ? readonly(value) : value; + + function isRef(r) { + return r ? r["__v_isRef"] === true : false; + } + function ref(value) { + return createRef(value, false); + } + function shallowRef(value) { + return createRef(value, true); + } + function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); + } + class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } + } + } + } + function triggerRef(ref2) { + if (ref2.dep) { + { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } + } + } + function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; + } + function toValue(source) { + return isFunction(source) ? source() : unref(source); + } + const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } + }; + function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); + } + class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } + } + function customRef(factory) { + return new CustomRefImpl(factory); + } + function toRefs(object) { + if (!isProxy(object)) { + warn$2(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; + } + class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + } + get value() { + const val = this._object[this._key]; + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } + } + class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } + } + function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } + } + function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); + } + + class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn$2("Write operation failed: computed value is readonly"); + } + } + } + function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; + } + + const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" + }; + const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" + }; + + const INITIAL_WATCHER_VALUE = {}; + const cleanupMap = /* @__PURE__ */ new WeakMap(); + let activeWatcher = void 0; + function getCurrentWatcher() { + return activeWatcher; + } + function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn$2( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } + } + function watch$1(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn$2)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; + } + function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; + } + + const stack = []; + function pushWarningContext(vnode) { + stack.push(vnode); + } + function popWarningContext() { + stack.pop(); + } + let isWarning = false; + function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; + } + function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; + } + function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; + } + function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; + } + function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; + } + function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } + } + function assertNumber(val, type) { + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } + } + + const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" + }; + const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" + }; + function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } + } + function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } + } + function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings$1[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); + } + function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } + } + + const queue = []; + let flushIndex = -1; + const pendingPostFlushCbs = []; + let activePostFlushCbs = null; + let postFlushIndex = 0; + const resolvedPromise = /* @__PURE__ */ Promise.resolve(); + let currentFlushPromise = null; + const RECURSION_LIMIT = 100; + function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; + } + function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; + } + function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } + } + function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } + } + function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); + } + function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } + } + function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } + } + const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; + function flushJobs(seen) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = (job) => checkRecursiveUpdates(seen, job) ; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } + } + function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; + } + + let isHmrUpdating = false; + const hmrDirtyComponents = /* @__PURE__ */ new Map(); + { + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; + } + const map = /* @__PURE__ */ new Map(); + function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); + } + function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); + } + function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; + } + function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; + } + function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); + } + function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); + } + function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } + } + function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; + } + + let devtools$1; + let buffer = []; + let devtoolsNotInstalled = false; + function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } + } + function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } + } + function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); + } + function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); + } + const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); + const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); + const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ + ); + const devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } + }; + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; + } + const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); + const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); + function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; + } + function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); + } + + let currentRenderingInstance = null; + let currentScopeId = null; + function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; + } + function pushScopeId(id) { + currentScopeId = id; + } + function popScopeId() { + currentScopeId = null; + } + const withScopeId = (_id) => withCtx; + function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; + } + + function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } + } + function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; + } + function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } + } + + const TeleportEndKey = Symbol("_vte"); + const isTeleport = (type) => type.__isTeleport; + const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); + const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); + const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; + const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; + const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (isString(targetSelector)) { + if (!select) { + warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!target && !isTeleportDisabled(props)) { + warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); + } + return target; + } + } else { + if (!targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; + } + }; + const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if (isHmrUpdating) { + optimized = false; + dynamicChildren = null; + } + if (n1 == null) { + const placeholder = n2.el = createComment("teleport start") ; + const mainAnchor = n2.anchor = createComment("teleport end") ; + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + if (parentComponent && parentComponent.isCE) { + parentComponent.ce._teleportTarget = container2; + } + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = () => { + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = prepareAnchor(target, n2, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (!disabled) { + mount(target, targetAnchor); + updateCssVars(n2, false); + } + } else if (!disabled) { + warn$1( + "Invalid Teleport target on mount:", + target, + `(${typeof target})` + ); + } + }; + if (disabled) { + mount(container, mainAnchor); + updateCssVars(n2, true); + } + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(() => { + mountToTarget(); + n2.el.__isMounted = true; + }, parentSuspense); + } else { + mountToTarget(); + } + } else { + if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { + queuePostRenderEffect(() => { + TeleportImpl.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + delete n1.el.__isMounted; + }, parentSuspense); + return; + } + n2.el = n1.el; + n2.targetStart = n1.targetStart; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport + }; + function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } + } + function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } + }, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const disabled = isTeleportDisabled(vnode.props); + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetStart = targetNode; + vnode.targetAnchor = targetNode && nextSibling(targetNode); + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } + return vnode.anchor && nextSibling(vnode.anchor); + } + const Teleport = TeleportImpl; + function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } + } + function prepareAnchor(target, vnode, createText, insert) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target); + insert(targetAnchor, target); + } + return targetAnchor; + } + + const leaveCbKey = Symbol("_leaveCb"); + const enterCbKey$1 = Symbol("_enterCb"); + function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; + } + const TransitionHookValidator = [Function, Array]; + const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator + }; + const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; + }; + const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + const child = findNonCommentChild(children); + const rawProps = toRaw(props); + const { mode } = rawProps; + if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid <transition> mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } + }; + function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (hasFound) { + warn$1( + "<transition> can only be used on a single element or component. Use <transition-group> for lists." + ); + break; + } + child = c; + hasFound = true; + } + } + } + return child; + } + const BaseTransition = BaseTransitionImpl; + function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; + } + function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey$1] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey$1] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey$1]) { + el[enterCbKey$1]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; + } + function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } + } + function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && isFunction(children.default)) { + return children.default(); + } + } + } + function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } + } + function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; + } + + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; + } + + function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } else { + warn$1( + `useId() is called when there is no active component instance to be associated with.` + ); + } + return ""; + } + function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; + } + + const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); + function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = shallowRef(null); + if (i) { + const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; + let desc; + if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { + warn$1(`useTemplateRef('${key}') already exists.`); + } else { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } else { + warn$1( + `useTemplateRef() is called when there is no active component instance to be associated with.` + ); + } + const ret = readonly(r) ; + { + knownTemplateRefs.add(ret); + } + return ret; + } + + function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if (!owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { + { + if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + return hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (isRef(oldRef)) { + oldRef.value = null; + } + } + if (isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = isString(ref); + const _isRef = isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + } + } + + let hasLoggedMismatchError = false; + const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; + }; + const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; + const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); + const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; + }; + const isComment = (node) => node.nodeType === 8; + function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + { + def(node, "__vnode", vnode, true); + def(node, "__vueParentComponent", parentComponent, true); + } + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + let hasWarned = false; + while (next) { + if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + if (el.textContent !== clientText) { + if (!isMismatchAllowed(el, 0 /* TEXT */)) { + warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${el.textContent} + - expected on client: ${vnode.children}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if (// #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement) { + patchProp(el, key, null, props[key], void 0, parentComponent); + } + } + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasWarned = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { + if (!hasWarned) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + hasWarned = true; + } + logMismatchError(); + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { + warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; + } + function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + actual = el.getAttribute("class"); + expected = normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2 /* CLASS */; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3 /* STYLE */; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { + if (isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4 /* ATTRIBUTE */; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; + } + function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); + } + function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; + } + function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; + } + function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; + } + function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + expectedMap.set( + `--${getEscapedCssVarName(key)}`, + String(cssVars[key]) + ); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } + } + const allowMismatchAttr = "data-allow-mismatch"; + const MismatchTypeString = { + [0 /* TEXT */]: "text", + [1 /* CHILDREN */]: "children", + [2 /* CLASS */]: "class", + [3 /* STYLE */]: "style", + [4 /* ATTRIBUTE */]: "attribute" + }; + function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + const allowedAttr = el && el.getAttribute(allowMismatchAttr); + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 /* TEXT */ && list.includes("children")) { + return true; + } + return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); + } + } + + const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); + const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); + const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { + const id = requestIdleCallback(hydrate, { timeout }); + return () => cancelIdleCallback(id); + }; + function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); + } + const hydrateOnVisible = (opts) => (hydrate, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); + }; + const hydrateOnMediaQuery = (query) => (hydrate) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate(); + } else { + mql.addEventListener("change", hydrate, { once: true }); + return () => mql.removeEventListener("change", hydrate); + } + } + }; + const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { + if (isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; + }; + function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } + } + + const isAsyncWrapper = (i) => !!i.type.__asyncLoader; + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (comp && !isObject(comp) && !isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + hydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : hydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || false) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error = ref(); + const delayed = ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); + } + function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; + } + + const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; + const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= ~256; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } + }; + const KeepAlive = KeepAliveImpl; + function matches(pattern, name) { + if (isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (isString(pattern)) { + return pattern.split(",").includes(name); + } else if (isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; + } + function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); + } + function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); + } + function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } + } + function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); + } + function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; + } + function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; + } + + function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else { + const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } + } + const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } + }; + const onBeforeMount = createHook("bm"); + const onMounted = createHook("m"); + const onBeforeUpdate = createHook( + "bu" + ); + const onUpdated = createHook("u"); + const onBeforeUnmount = createHook( + "bum" + ); + const onUnmounted = createHook("um"); + const onServerPrefetch = createHook( + "sp" + ); + const onRenderTriggered = createHook("rtg"); + const onRenderTracked = createHook("rtc"); + function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); + } + + const COMPONENTS = "components"; + const DIRECTIVES = "directives"; + function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; + } + const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); + function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } + } + function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); + } + function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else { + warn$1( + `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } + } + function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); + } + + function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = isArray(source); + if (sourceIsArray || isString(source)) { + const sourceIsReactiveArray = sourceIsArray && isReactive(source); + let needsWrap = false; + if (sourceIsReactiveArray) { + needsWrap = !isShallow(source); + source = shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; + } + + function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; + } + + function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + 64 + ); + } + let slot = slots[name]; + if (slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; + } + function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; + } + + function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!isObject(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; + } + + const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); + }; + const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => shallowReadonly(i.props) , + $attrs: (i) => shallowReadonly(i.attrs) , + $slots: (i) => shallowReadonly(i.slots) , + $refs: (i) => shallowReadonly(i.refs) , + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) + ); + const isReservedPrefix = (key) => key === "_" || key === "$"; + const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); + const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + markAttrsAccessed(); + } else if (key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + data[key] = value; + return true; + } else if (hasOwn(instance.props, key)) { + warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if (key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); + } else { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } + }; + { + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` + ); + return Reflect.ownKeys(target); + }; + } + const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !isGloballyAllowed(key); + if (!has && PublicInstanceProxyHandlers.has(_, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} should not start with _ which is a reserved prefix for Vue internals.` + ); + } + return has; + } + }); + function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: NOOP + }); + }); + return target; + } + function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: NOOP + }); + }); + } + } + function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys(toRaw(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; + } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: NOOP + }); + } + }); + } + + const warnRuntimeUsage = (method) => warn$1( + `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` + ); + function defineProps() { + { + warnRuntimeUsage(`defineProps`); + } + return null; + } + function defineEmits() { + { + warnRuntimeUsage(`defineEmits`); + } + return null; + } + function defineExpose(exposed) { + { + warnRuntimeUsage(`defineExpose`); + } + } + function defineOptions(options) { + { + warnRuntimeUsage(`defineOptions`); + } + } + function defineSlots() { + { + warnRuntimeUsage(`defineSlots`); + } + return null; + } + function defineModel() { + { + warnRuntimeUsage("defineModel"); + } + } + function withDefaults(props, defaults) { + { + warnRuntimeUsage(`withDefaults`); + } + return null; + } + function useSlots() { + return getContext().slots; + } + function useAttrs() { + return getContext().attrs; + } + function getContext() { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useContext() called without active instance.`); + } + return i.setupContext || (i.setupContext = createSetupContext(i)); + } + function normalizePropsOrEmits(props) { + return isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; + } + function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) continue; + let opt = props[key]; + if (opt) { + if (isArray(opt) || isFunction(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; + } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else { + warn$1(`props default key "${key}" has no corresponding declaration.`); + } + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; + } + function mergeModels(a, b) { + if (!a || !b) return a || b; + if (isArray(a) && isArray(b)) return a.concat(b); + return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); + } + function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; + } + function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + if (!ctx) { + warn$1( + `withAsyncContext called without active current instance. This is likely a bug.` + ); + } + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if (isPromise(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; + } + + function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); + } else { + cache[key] = type; + } + }; + } + let shouldCacheAccess = true; + function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook$1(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = createDuplicateChecker() ; + { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } + } + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (isFunction(methodHandler)) { + { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } + { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } + } + } + if (dataOptions) { + if (!isFunction(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` + ); + } + const data = dataOptions.call(publicThis, publicThis); + if (isPromise(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + ); + } + if (!isObject(data)) { + warn$1(`data() should return an object.`); + } else { + instance.data = reactive(data); + { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: NOOP + }); + } + } + } + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; + if (get === NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } ; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + { + checkDuplicateProperties("Computed" /* COMPUTED */, key); + } + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook$1(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + } + function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { + if (isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + { + checkDuplicateProperties("Inject" /* INJECT */, key); + } + } + } + function callHook$1(hook, instance, type) { + callWithAsyncErrorHandling( + isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); + } + function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (isString(raw)) { + const handler = ctx[raw]; + if (isFunction(handler)) { + { + watch(getter, handler); + } + } else { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); + } + } else if (isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (isObject(raw)) { + if (isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction(handler)) { + watch(getter, handler, raw); + } else { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); + } + } + } else { + warn$1(`Invalid watch option: "${key}"`, raw); + } + } + function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (isObject(base)) { + cache.set(base, resolved); + } + return resolved; + } + function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") { + warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); + } else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; + } + const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject + }; + function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (extend)( + isFunction(to) ? to.call(this, this) : to, + isFunction(from) ? from.call(this, this) : from + ); + }; + } + function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); + } + function normalizeInject(raw) { + if (isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; + } + function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; + } + function mergeObjectOptions(to, from) { + return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; + } + function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray(to) && isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } + } + function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; + } + + function createAppContext() { + return { + app: null, + config: { + isNativeTag: NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; + } + let uid$1 = 0; + function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!isFunction(rootComponent)) { + rootComponent = extend({}, rootComponent); + } + if (rootProps != null && !isObject(rootProps)) { + warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); + } + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); + } + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") + ); + } + } + return app; + }, + component(name, component) { + { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if (context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if (context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if (rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + ); + } + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + { + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + { + app._instance = vnode.component; + devtoolsInitApp(app, version); + } + return getComponentPublicInstance(vnode.component); + } else { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` + ); + } + }, + onUnmount(cleanupFn) { + if (typeof cleanupFn !== "function") { + warn$1( + `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` + ); + } + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + { + app._instance = null; + devtoolsUnmountApp(app); + } + delete app._container.__vue_app__; + } else { + warn$1(`Cannot unmount an app that is not mounted.`); + } + }, + provide(key, value) { + if (key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; + } + let currentApp = null; + + function provide(key, value) { + if (!currentInstance) { + { + warn$1(`provide() can only be used inside setup().`); + } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } + } + function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else { + warn$1(`injection "${String(key)}" not found.`); + } + } else { + warn$1(`inject() can only be used inside setup() or functional components.`); + } + } + function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); + } + + const internalObjectProto = {}; + const createInternalObject = () => Object.create(internalObjectProto); + const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + + function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; + } + function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) return true; + instance = instance.parent; + } + } + function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + trigger(instance.attrs, "set", ""); + } + { + validateProps(rawProps || {}, props, instance); + } + } + function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && hasOwn(options, camelKey = camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = toRaw(props); + const castValues = rawCastValues || EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; + } + function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) { + value = true; + } + } + } + return value; + } + const mixinPropsCache = /* @__PURE__ */ new WeakMap(); + function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, EMPTY_ARR); + } + return EMPTY_ARR; + } + if (isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + if (!isString(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); + } + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = EMPTY_OBJ; + } + } + } else if (raw) { + if (!isObject(raw)) { + warn$1(`invalid props options`, raw); + } + for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (isObject(comp)) { + cache.set(comp, res); + } + return res; + } + function validatePropName(key) { + if (key[0] !== "$" && !isReservedProp(key)) { + return true; + } else { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; + } + function getType(ctor) { + if (ctor === null) { + return "null"; + } + if (typeof ctor === "function") { + return ctor.name || ""; + } else if (typeof ctor === "object") { + const name = ctor.constructor && ctor.constructor.name; + return name || ""; + } + return ""; + } + function validateProps(rawProps, props, instance) { + const resolvedValues = toRaw(props); + const options = instance.propsOptions[0]; + const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); + for (const key in options) { + let opt = options[key]; + if (opt == null) continue; + validateProp( + key, + resolvedValues[key], + opt, + shallowReadonly(resolvedValues) , + !camelizePropsKey.includes(key) + ); + } + } + function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = isArray(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); + return; + } + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } + } + const isSimpleType = /* @__PURE__ */ makeMap( + "String,Number,Boolean,Function,Symbol,BigInt" + ); + function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (expectedType === "null") { + valid = value === null; + } else if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; + } + } else if (expectedType === "Object") { + valid = isObject(value); + } else if (expectedType === "Array") { + valid = isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + }; + } + function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; + } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message; + } + function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } + } + function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); + } + function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); + } + + const isInternalKey = (key) => key[0] === "_" || key === "$stable"; + const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; + const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + ); + } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; + }; + const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } + }; + const normalizeVNodeSlots = (instance, children) => { + if (!isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; + }; + const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } + }; + const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } + }; + const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (isHmrUpdating) { + assignSlots(slots, children, optimized); + trigger(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } + }; + + let supported; + let perf; + function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + } + } + function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } + } + function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; + } else { + supported = false; + } + return supported; + } + + const queuePostRenderEffect = queueEffectWithSuspense ; + function createRenderer(options) { + return baseCreateRenderer(options); + } + function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); + } + function baseCreateRenderer(options, createHydrationFns) { + const target = getGlobalThis(); + target.__VUE__ = true; + { + setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); + } else { + n2.el = n1.el; + n2.anchor = n1.anchor; + } + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + { + def(el, "__vnode", vnode, true); + def(el, "__vueParentComponent", parentComponent, true); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; + } + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + { + el.__vnode = n2; + } + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || EMPTY_OBJ; + const newProps = n2.props || EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== EMPTY_OBJ) { + for (const key in oldProps) { + if (!isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if ( + // #5523 dev root fragment may inherit directives + isHmrUpdating || patchFlag & 2048 + ) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if (instance.type.__hmrId) { + registerHMR(instance); + } + { + pushWarningContext(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + { + startMeasure(instance, `init`); + } + setupComponent(instance, false, optimized); + { + endMeasure(instance, `init`); + } + } + if (instance.asyncDep) { + if (isHmrUpdating) initialVNode.el = null; + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + { + popWarningContext(); + endMeasure(instance, `mount`); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + { + pushWarningContext(n2); + } + updateComponentPreRender(instance, n2, optimized); + { + popWarningContext(); + } + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + { + endMeasure(instance, `hydrate`); + } + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + { + pushWarningContext(next || instance.vnode); + } + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot(instance); + { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + { + devtoolsComponentUpdated(instance); + } + { + popWarningContext(); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + { + effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; + } + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + pauseTracking(); + flushPreFlushCbs(instance); + resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || EMPTY_ARR; + c2 = c2 || EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + if (keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if (instance.type.__hmrId) { + unregisterHMR(instance); + } + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); + } + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; + } + function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; + } + function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } + } + function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; + } + function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (isArray(ch1) && isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if (c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } + } + } + function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; + } + function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } + } + function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } + } + + const ssrContextKey = Symbol.for("v-scx"); + const useSSRContext = () => { + { + warn$1(`useSSRContext() is not supported in the global build.`); + } + }; + + function watchEffect(effect, options) { + return doWatch(effect, null, options); + } + function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "post" }) + ); + } + function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "sync" }) + ); + } + function watch(source, cb, options) { + if (!isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); + } + function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = extend({}, options); + baseWatchOptions.onWarn = warn$1; + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch$1(source, cb, baseWatchOptions); + return watchHandle; + } + function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; + } + function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; + } + + function useModel(props, name, options = EMPTY_OBJ) { + const i = getCurrentInstance(); + if (!i) { + warn$1(`useModel() called without active instance.`); + return ref(); + } + const camelizedName = camelize(name); + if (!i.propsOptions[0][camelizedName]) { + warn$1(`useModel() called with prop "${name}" which is not declared.`); + return ref(); + } + const hyphenatedName = hyphenate(name); + const modifiers = getModelModifiers(props, camelizedName); + const res = customRef((track, trigger) => { + let localValue; + let prevSetValue = EMPTY_OBJ; + let prevEmittedValue; + watchSyncEffect(() => { + const propValue = props[camelizedName]; + if (hasChanged(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const emittedValue = options.set ? options.set(value) : value; + if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) { + return; + } + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { + localValue = value; + trigger(); + } + i.emit(`update:${name}`, emittedValue); + if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) { + trigger(); + } + prevSetValue = value; + prevEmittedValue = emittedValue; + } + }; + }); + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false }; + } else { + return { done: true }; + } + } + }; + }; + return res; + } + const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; + }; + + function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(looseToNumber); + } + } + { + devtoolsComponentEmit(instance, event, args); + } + { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } + } + function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; + } + function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); + } + + let accessedAttrs = false; + function markAttrsAccessed() { + accessedAttrs = true; + } + function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + true ? shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode( + render2.length > 1 ? render2( + true ? shallowReadonly(props) : props, + true ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + true ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } else if (!accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` + ); + } + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); + } + setTransitionHooks(root, vnode.transition); + } + if (setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; + } + const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { + return getChildRoot(childRoot); + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode(childRoot), setRoot]; + }; + function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; + } + const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; + }; + const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; + }; + const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; + }; + function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ((prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; + } + function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; + } + function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } + } + + const isSuspense = (type) => type.__isSuspense; + let suspenseId = 0; + const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren + }; + const Suspense = SuspenseImpl ; + function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (isFunction(eventListener)) { + eventListener(); + } + } + function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } + } + function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } + } + let hasWarned = false; + function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (!hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + `<Suspense> is an experimental feature and its API will likely change.` + ); + } + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; + { + assertNumber(timeout, `Suspense timeout`); + } + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) === container2) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; + } + function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; + } + function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); + } + function normalizeSuspenseSlot(s) { + let block; + if (isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (isArray(s)) { + const singleChild = filterSingleRoot(s); + if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn$1(`<Suspense> slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; + } + function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } + } + function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } + } + function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; + } + + const Fragment = Symbol.for("v-fgt"); + const Text = Symbol.for("v-txt"); + const Comment = Symbol.for("v-cmt"); + const Static = Symbol.for("v-stc"); + const blockStack = []; + let currentBlock = null; + function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); + } + function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; + } + let isBlockTreeEnabled = 1; + function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } + } + function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); + } + return vnode; + } + function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); + } + function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); + } + function isVNode(value) { + return value ? value.__v_isVNode === true : false; + } + function isSameVNodeType(n1, n2) { + if (n2.shapeFlag & 6 && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type); + if (dirtyInstances && dirtyInstances.has(n1.component)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; + } + } + return n1.type === n2.type && n1.key === n2.key; + } + let vnodeArgsTransformer; + function transformVNodeArgs(transformer) { + vnodeArgsTransformer = transformer; + } + const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args + ); + }; + const normalizeKey = ({ key }) => key != null ? key : null; + const normalizeRef = ({ + ref, + ref_key, + ref_for + }) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; + }; + function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= isString(children) ? 8 : 16; + } + if (vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; + } + const createVNode = createVNodeWithArgsTransform ; + function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if (!type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); + } + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (isObject(style)) { + if (isProxy(style) && !isArray(style)) { + style = extend({}, style); + } + props.style = normalizeStyle(style); + } + } + const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; + if (shapeFlag & 4 && isProxy(type)) { + type = toRaw(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); + } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); + } + function guardReactiveProps(props) { + if (!props) return null; + return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; + } + function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; + } + function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if (isArray(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); + } + return cloned; + } + function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); + } + function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; + } + function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); + } + function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } + } + function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); + } + function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; + } + function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = normalizeStyle([ret.style, toMerge.style]); + } else if (isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; + } + function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); + } + + const emptyAppContext = createAppContext(); + let uid = 0; + function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: EMPTY_OBJ, + data: EMPTY_OBJ, + props: EMPTY_OBJ, + attrs: EMPTY_OBJ, + slots: EMPTY_OBJ, + refs: EMPTY_OBJ, + setupState: EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + { + instance.ctx = createDevRenderContext(instance); + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; + } + let currentInstance = null; + const getCurrentInstance = () => currentInstance || currentRenderingInstance; + let internalSetCurrentInstance; + let setInSSRSetupState; + { + internalSetCurrentInstance = (i) => { + currentInstance = i; + }; + setInSSRSetupState = (v) => { + isInSSRComponentSetup = v; + }; + } + const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; + }; + const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); + }; + const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component"); + function validateComponentName(name, { isNativeTag }) { + if (isBuiltInTag(name) || isNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); + } + } + function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; + } + let isInSSRComponentSetup = false; + function setupComponent(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; + } + function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); + } + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); + } + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } + } + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + shallowReadonly(instance.props) , + setupContext + ] + ); + const isAsyncSetup = isPromise(setupResult); + resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if (!instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } + } + function handleSetupResult(instance, setupResult, isSSR) { + if (isFunction(setupResult)) { + { + instance.render = setupResult; + } + } else if (isObject(setupResult)) { + if (isVNode(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = proxyRefs(setupResult); + { + exposeSetupStateOnRenderContext(instance); + } + } else if (setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); + } + let compile; + let installWithProxy; + function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; + } + const isRuntimeOnly = () => !compile; + function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + { + startMeasure(instance, `compile`); + } + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = extend( + extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + { + endMeasure(instance, `compile`); + } + } + } + instance.render = Component.render || NOOP; + if (installWithProxy) { + installWithProxy(instance); + } + } + { + const reset = setCurrentInstance(instance); + pauseTracking(); + try { + applyOptions(instance); + } finally { + resetTracking(); + reset(); + } + } + if (!Component.render && instance.render === NOOP && !isSSR) { + if (!compile && Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` ) + ); + } else { + warn$1(`Component is missing template or render function: `, Component); + } + } + } + const attrsProxyHandlers = { + get(target, key) { + markAttrsAccessed(); + track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } + } ; + function getSlotsProxy(instance) { + return new Proxy(instance.slots, { + get(target, key) { + track(instance, "get", "$slots"); + return target[key]; + } + }); + } + function createSetupContext(instance) { + const expose = (exposed) => { + { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if (isArray(exposed)) { + exposedType = "array"; + } else if (isRef(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + { + let attrsProxy; + let slotsProxy; + return Object.freeze({ + get attrs() { + return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); + }, + get slots() { + return slotsProxy || (slotsProxy = getSlotsProxy(instance)); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } + } + function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } + } + const classifyRE = /(?:^|[-_])(\w)/g; + const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); + function getComponentName(Component, includeInferred = true) { + return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; + } + function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; + } + function isClassComponent(value) { + return isFunction(value) && "__vccOpts" in value; + } + + const computed = (getterOrOptions, debugOptions) => { + const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); + { + const i = getCurrentInstance(); + if (i && i.appContext.config.warnRecursiveComputed) { + c._warnRecursive = true; + } + } + return c; + }; + + function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); + } + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); + } + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; + } + return createVNode(type, propsOrChildren, children); + } + } + + function initCustomFormatter() { + if (typeof window === "undefined") { + return; + } + const vueStyle = { style: "color:#3ba776" }; + const numberStyle = { style: "color:#1677ff" }; + const stringStyle = { style: "color:#f5222d" }; + const keywordStyle = { style: "color:#eb2f96" }; + const formatter = { + __vue_custom_formatter: true, + header(obj) { + if (!isObject(obj)) { + return null; + } + if (obj.__isVue) { + return ["div", vueStyle, `VueInstance`]; + } else if (isRef(obj)) { + return [ + "div", + {}, + ["span", vueStyle, genRefFlag(obj)], + "<", + // avoid debugger accessing value affecting behavior + formatValue("_value" in obj ? obj._value : obj), + `>` + ]; + } else if (isReactive(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], + "<", + formatValue(obj), + `>${isReadonly(obj) ? ` (readonly)` : ``}` + ]; + } else if (isReadonly(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], + "<", + formatValue(obj), + ">" + ]; + } + return null; + }, + hasBody(obj) { + return obj && obj.__isVue; + }, + body(obj) { + if (obj && obj.__isVue) { + return [ + "div", + {}, + ...formatInstance(obj.$) + ]; + } + } + }; + function formatInstance(instance) { + const blocks = []; + if (instance.type.props && instance.props) { + blocks.push(createInstanceBlock("props", toRaw(instance.props))); + } + if (instance.setupState !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("setup", instance.setupState)); + } + if (instance.data !== EMPTY_OBJ) { + blocks.push(createInstanceBlock("data", toRaw(instance.data))); + } + const computed = extractKeys(instance, "computed"); + if (computed) { + blocks.push(createInstanceBlock("computed", computed)); + } + const injected = extractKeys(instance, "inject"); + if (injected) { + blocks.push(createInstanceBlock("injected", injected)); + } + blocks.push([ + "div", + {}, + [ + "span", + { + style: keywordStyle.style + ";opacity:0.66" + }, + "$ (internal): " + ], + ["object", { object: instance }] + ]); + return blocks; + } + function createInstanceBlock(type, target) { + target = extend({}, target); + if (!Object.keys(target).length) { + return ["span", {}]; + } + return [ + "div", + { style: "line-height:1.25em;margin-bottom:0.6em" }, + [ + "div", + { + style: "color:#476582" + }, + type + ], + [ + "div", + { + style: "padding-left:1.25em" + }, + ...Object.keys(target).map((key) => { + return [ + "div", + {}, + ["span", keywordStyle, key + ": "], + formatValue(target[key], false) + ]; + }) + ] + ]; + } + function formatValue(v, asRaw = true) { + if (typeof v === "number") { + return ["span", numberStyle, v]; + } else if (typeof v === "string") { + return ["span", stringStyle, JSON.stringify(v)]; + } else if (typeof v === "boolean") { + return ["span", keywordStyle, v]; + } else if (isObject(v)) { + return ["object", { object: asRaw ? toRaw(v) : v }]; + } else { + return ["span", stringStyle, String(v)]; + } + } + function extractKeys(instance, type) { + const Comp = instance.type; + if (isFunction(Comp)) { + return; + } + const extracted = {}; + for (const key in instance.ctx) { + if (isKeyOfType(Comp, key, type)) { + extracted[key] = instance.ctx[key]; + } + } + return extracted; + } + function isKeyOfType(Comp, key, type) { + const opts = Comp[type]; + if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) { + return true; + } + if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { + return true; + } + if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { + return true; + } + } + function genRefFlag(v) { + if (isShallow(v)) { + return `ShallowRef`; + } + if (v.effect) { + return `ComputedRef`; + } + return `Ref`; + } + if (window.devtoolsFormatters) { + window.devtoolsFormatters.push(formatter); + } else { + window.devtoolsFormatters = [formatter]; + } + } + + function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + ret.cacheIndex = index; + return cache[index] = ret; + } + function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if (hasChanged(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; + } + + const version = "3.5.13"; + const warn = warn$1 ; + const ErrorTypeStrings = ErrorTypeStrings$1 ; + const devtools = devtools$1 ; + const setDevtoolsHook = setDevtoolsHook$1 ; + const ssrUtils = null; + const resolveFilter = null; + const compatUtils = null; + const DeprecationTypes = null; + + let policy = void 0; + const tt = typeof window !== "undefined" && window.trustedTypes; + if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + warn(`Error creating trusted types policy: ${e}`); + } + } + const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; + const svgNS = "http://www.w3.org/2000/svg"; + const mathmlNS = "http://www.w3.org/1998/Math/MathML"; + const doc = typeof document !== "undefined" ? document : null; + const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); + const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } + }; + + const TRANSITION = "transition"; + const ANIMATION = "animation"; + const vtcKey = Symbol("_vtc"); + const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String + }; + const TransitionPropsValidators = /* @__PURE__ */ extend( + {}, + BaseTransitionPropsValidators, + DOMTransitionPropsValidators + ); + const decorate$1 = (t) => { + t.displayName = "Transition"; + t.props = TransitionPropsValidators; + return t; + }; + const Transition = /* @__PURE__ */ decorate$1( + (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots) + ); + const callHook = (hook, args = []) => { + if (isArray(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } + }; + const hasExplicitCallback = (hook) => { + return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; + }; + function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; + } + } + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done, isCancelled) => { + el._enterCancelled = isCancelled; + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); + }; + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); + }; + }; + return extend(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + if (!el._enterCancelled) { + forceReflow(); + addTransitionClass(el, leaveActiveClass); + } else { + addTransitionClass(el, leaveActiveClass); + forceReflow(); + } + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } + }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false, void 0, true); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true, void 0, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); + } + function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if (isObject(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; + } + } + function NumberOf(val) { + const res = toNumber(val); + { + assertNumber(res, "<transition> explicit duration"); + } + return res; + } + function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); + } + function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; + } + } + } + function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); + }); + } + let endId = 0; + function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); + } + }; + if (explicitTimeout != null) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); + } + }; + setTimeout(() => { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(endEvent, onEnd); + } + function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; + } + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; + } + function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); + } + function toMs(s) { + if (s === "auto") return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; + } + function forceReflow() { + return document.body.offsetHeight; + } + + function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } + } + + const vShowOriginalDisplay = Symbol("_vod"); + const vShowHidden = Symbol("_vsh"); + const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); + } + }; + { + vShow.name = "show"; + } + function setDisplay(el, value) { + el.style.display = value ? el[vShowOriginalDisplay] : "none"; + el[vShowHidden] = !value; + } + + const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" ); + function useCssVars(getter) { + const instance = getCurrentInstance(); + if (!instance) { + warn(`useCssVars is called without current active component instance.`); + return; + } + const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { + Array.from( + document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) + ).forEach((node) => setVarsOnNode(node, vars)); + }; + { + instance.getCssVars = () => getter(instance.proxy); + } + const setVars = () => { + const vars = getter(instance.proxy); + if (instance.ce) { + setVarsOnNode(instance.ce, vars); + } else { + setVarsOnVNode(instance.subTree, vars); + } + updateTeleports(vars); + }; + onBeforeUpdate(() => { + queuePostFlushCb(setVars); + }); + onMounted(() => { + watch(setVars, NOOP, { flush: "post" }); + const ob = new MutationObserver(setVars); + ob.observe(instance.subTree.el.parentNode, { childList: true }); + onUnmounted(() => ob.disconnect()); + }); + } + function setVarsOnVNode(vnode, vars) { + if (vnode.shapeFlag & 128) { + const suspense = vnode.suspense; + vnode = suspense.activeBranch; + if (suspense.pendingBranch && !suspense.isHydrating) { + suspense.effects.push(() => { + setVarsOnVNode(suspense.activeBranch, vars); + }); + } + } + while (vnode.component) { + vnode = vnode.component.subTree; + } + if (vnode.shapeFlag & 1 && vnode.el) { + setVarsOnNode(vnode.el, vars); + } else if (vnode.type === Fragment) { + vnode.children.forEach((c) => setVarsOnVNode(c, vars)); + } else if (vnode.type === Static) { + let { el, anchor } = vnode; + while (el) { + setVarsOnNode(el, vars); + if (el === anchor) break; + el = el.nextSibling; + } + } + } + function setVarsOnNode(el, vars) { + if (el.nodeType === 1) { + const style = el.style; + let cssText = ""; + for (const key in vars) { + style.setProperty(`--${key}`, vars[key]); + cssText += `--${key}: ${vars[key]};`; + } + style[CSS_VAR_TEXT] = cssText; + } + } + + const displayRE = /(^|;)\s*display\s*:/; + function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } + } + const semicolonRE = /[^\\];\s*$/; + const importantRE = /\s*!important$/; + function setStyle(style, name, val) { + if (isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + { + if (semicolonRE.test(val)) { + warn( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } + } + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } + } + const prefixes = ["Webkit", "Moz", "ms"]; + const prefixCache = {}; + function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; + } + + const xlinkNS = "http://www.w3.org/1999/xlink"; + function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : isSymbol(value) ? String(value) : value + ); + } + } + } + + function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + if (!needRemove) { + warn( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(attrName || key); + } + + function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); + } + function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); + } + const veiKey = Symbol("_vei"); + function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + sanitizeEventValue(nextValue, rawName) , + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } + } + const optionsModifierRE = /(?:Once|Passive|Capture)$/; + function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); + return [event, options]; + } + let cachedNow = 0; + const p = /* @__PURE__ */ Promise.resolve(); + const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); + function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; + } + function sanitizeEventValue(value, propName) { + if (isFunction(value) || isArray(value)) { + return value; + } + warn( + `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? +Expected function or array of functions, received type ${typeof value}.` + ); + return NOOP; + } + function patchStopImmediatePropagation(e, value) { + if (isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } + } + + const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter + key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; + const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (isOn(key)) { + if (!isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue)) + ) { + patchDOMProp(el, camelize(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } + }; + function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && isString(value)) { + return false; + } + return key in el; + } + + const REMOVAL = {}; + /*! #__NO_SIDE_EFFECTS__ */ + // @__NO_SIDE_EFFECTS__ + function defineCustomElement(options, extraOptions, _createApp) { + const Comp = defineComponent(options, extraOptions); + if (isPlainObject(Comp)) extend(Comp, extraOptions); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, _createApp); + } + } + VueCustomElement.def = Comp; + return VueCustomElement; + } + /*! #__NO_SIDE_EFFECTS__ */ + const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { + return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); + }; + const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { + }; + class VueElement extends BaseClass { + constructor(_def, _props = {}, _createApp = createApp) { + super(); + this._def = _def; + this._props = _props; + this._createApp = _createApp; + this._isVueCE = true; + /** + * @internal + */ + this._instance = null; + /** + * @internal + */ + this._app = null; + /** + * @internal + */ + this._nonce = this._def.nonce; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._styleChildren = /* @__PURE__ */ new WeakSet(); + this._ob = null; + if (this.shadowRoot && _createApp !== createApp) { + this._root = this.shadowRoot; + } else { + if (this.shadowRoot) { + warn( + `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + ); + } + if (_def.shadowRoot !== false) { + this.attachShadow({ mode: "open" }); + this._root = this.shadowRoot; + } else { + this._root = this; + } + } + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); + } + } + connectedCallback() { + if (!this.isConnected) return; + if (!this.shadowRoot) { + this._parseSlots(); + } + this._connected = true; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + this._parent = parent; + break; + } + } + if (!this._instance) { + if (this._resolved) { + this._setParent(); + this._update(); + } else { + if (parent && parent._pendingResolve) { + this._pendingResolve = parent._pendingResolve.then(() => { + this._pendingResolve = void 0; + this._resolveDef(); + }); + } else { + this._resolveDef(); + } + } + } + } + _setParent(parent = this._parent) { + if (parent) { + this._instance.parent = parent._instance; + this._instance.provides = parent._instance.provides; + } + } + disconnectedCallback() { + this._connected = false; + nextTick(() => { + if (!this._connected) { + if (this._ob) { + this._ob.disconnect(); + this._ob = null; + } + this._app && this._app.unmount(); + if (this._instance) this._instance.ce = void 0; + this._app = this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + if (this._pendingResolve) { + return; + } + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); + } + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + this._resolved = true; + this._pendingResolve = void 0; + const { props, styles } = def; + let numberProps; + if (props && !isArray(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = toNumber(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + if (this.shadowRoot) { + this._applyStyles(styles); + } else if (styles) { + warn( + "Custom element style injection is not supported when using shadowRoot: false" + ); + } + this._mount(def); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + this._pendingResolve = asyncDef().then( + (def) => resolve(this._def = def, true) + ); + } else { + resolve(this._def); + } + } + _mount(def) { + if (!def.name) { + def.name = "VueElement"; + } + this._app = this._createApp(def); + if (def.configureApp) { + def.configureApp(this._app); + } + this._app._ceVNode = this._createVNode(); + this._app.mount(this._root); + const exposed = this._instance && this._instance.exposed; + if (!exposed) return; + for (const key in exposed) { + if (!hasOwn(this, key)) { + Object.defineProperty(this, key, { + // unwrap ref to be consistent with public instance behavior + get: () => unref(exposed[key]) + }); + } else { + warn(`Exposed property "${key}" already exists on custom element.`); + } + } + } + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = isArray(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key]); + } + } + for (const key of declaredPropKeys.map(camelize)) { + Object.defineProperty(this, key, { + get() { + return this._getProp(key); + }, + set(val) { + this._setProp(key, val, true, true); + } + }); + } + } + _setAttr(key) { + if (key.startsWith("data-v-")) return; + const has = this.hasAttribute(key); + let value = has ? this.getAttribute(key) : REMOVAL; + const camelKey = camelize(key); + if (has && this._numberProps && this._numberProps[camelKey]) { + value = toNumber(value); + } + this._setProp(camelKey, value, false, true); + } + /** + * @internal + */ + _getProp(key) { + return this._props[key]; + } + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = false) { + if (val !== this._props[key]) { + if (val === REMOVAL) { + delete this._props[key]; + } else { + this._props[key] = val; + if (key === "key" && this._app) { + this._app._ceVNode.key = val; + } + } + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + const ob = this._ob; + ob && ob.disconnect(); + if (val === true) { + this.setAttribute(hyphenate(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute(hyphenate(key), val + ""); + } else if (!val) { + this.removeAttribute(hyphenate(key)); + } + ob && ob.observe(this, { attributes: true }); + } + } + } + _update() { + render(this._createVNode(), this._root); + } + _createVNode() { + const baseProps = {}; + if (!this.shadowRoot) { + baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); + } + const vnode = createVNode(this._def, extend(baseProps, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.ce = this; + instance.isCE = true; + { + instance.ceReload = (newStyles) => { + if (this._styles) { + this._styles.forEach((s) => this._root.removeChild(s)); + this._styles.length = 0; + } + this._applyStyles(newStyles); + this._instance = null; + this._update(); + }; + } + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent( + event, + isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args } + ) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if (hyphenate(event) !== event) { + dispatch(hyphenate(event), args); + } + }; + this._setParent(); + }; + } + return vnode; + } + _applyStyles(styles, owner) { + if (!styles) return; + if (owner) { + if (owner === this._def || this._styleChildren.has(owner)) { + return; + } + this._styleChildren.add(owner); + } + const nonce = this._nonce; + for (let i = styles.length - 1; i >= 0; i--) { + const s = document.createElement("style"); + if (nonce) s.setAttribute("nonce", nonce); + s.textContent = styles[i]; + this.shadowRoot.prepend(s); + { + if (owner) { + if (owner.__hmrId) { + if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); + let entry = this._childStyles.get(owner.__hmrId); + if (!entry) { + this._childStyles.set(owner.__hmrId, entry = []); + } + entry.push(s); + } + } else { + (this._styles || (this._styles = [])).push(s); + } + } + } + } + /** + * Only called when shadowRoot is false + */ + _parseSlots() { + const slots = this._slots = {}; + let n; + while (n = this.firstChild) { + const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; + (slots[slotName] || (slots[slotName] = [])).push(n); + this.removeChild(n); + } + } + /** + * Only called when shadowRoot is false + */ + _renderSlots() { + const outlets = (this._teleportTarget || this).querySelectorAll("slot"); + const scopeId = this._instance.type.__scopeId; + for (let i = 0; i < outlets.length; i++) { + const o = outlets[i]; + const slotName = o.getAttribute("name") || "default"; + const content = this._slots[slotName]; + const parent = o.parentNode; + if (content) { + for (const n of content) { + if (scopeId && n.nodeType === 1) { + const id = scopeId + "-s"; + const walker = document.createTreeWalker(n, 1); + n.setAttribute(id, ""); + let child; + while (child = walker.nextNode()) { + child.setAttribute(id, ""); + } + } + parent.insertBefore(n, o); + } + } else { + while (o.firstChild) parent.insertBefore(o.firstChild, o); + } + parent.removeChild(o); + } + } + /** + * @internal + */ + _injectChildStyle(comp) { + this._applyStyles(comp.styles, comp); + } + /** + * @internal + */ + _removeChildStyle(comp) { + { + this._styleChildren.delete(comp); + if (this._childStyles && comp.__hmrId) { + const oldStyles = this._childStyles.get(comp.__hmrId); + if (oldStyles) { + oldStyles.forEach((s) => this._root.removeChild(s)); + oldStyles.length = 0; + } + } + } + } + } + function useHost(caller) { + const instance = getCurrentInstance(); + const el = instance && instance.ce; + if (el) { + return el; + } else { + if (!instance) { + warn( + `${caller || "useHost"} called without an active component instance.` + ); + } else { + warn( + `${caller || "useHost"} can only be used in components defined via defineCustomElement.` + ); + } + } + return null; + } + function useShadowRoot() { + const el = useHost("useShadowRoot") ; + return el && el.shadowRoot; + } + + function useCssModule(name = "$style") { + { + { + warn(`useCssModule() is not supported in the global build.`); + } + return EMPTY_OBJ; + } + } + + const positionMap = /* @__PURE__ */ new WeakMap(); + const newPositionMap = /* @__PURE__ */ new WeakMap(); + const moveCbKey = Symbol("_moveCb"); + const enterCbKey = Symbol("_enterCb"); + const decorate = (t) => { + delete t.props.mode; + return t; + }; + const TransitionGroupImpl = /* @__PURE__ */ decorate({ + name: "TransitionGroup", + props: /* @__PURE__ */ extend({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + let prevChildren; + let children; + onUpdated(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = toRaw(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || Fragment; + prevChildren = []; + if (children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.el && child.el instanceof Element) { + prevChildren.push(child); + setTransitionHooks( + child, + resolveTransitionHooks( + child, + cssTransitionProps, + state, + instance + ) + ); + positionMap.set( + child, + child.el.getBoundingClientRect() + ); + } + } + } + children = slots.default ? getTransitionRawChildren(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + setTransitionHooks( + child, + resolveTransitionHooks(child, cssTransitionProps, state, instance) + ); + } else if (child.type !== Text) { + warn(`<TransitionGroup> children must be keyed.`); + } + } + return createVNode(tag, null, children); + }; + } + }); + const TransitionGroup = TransitionGroupImpl; + function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); + } + } + function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); + } + function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } + } + function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; + } + + const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; + }; + function onCompositionStart(e) { + e.target.composing = true; + } + function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } + } + const assignKey = Symbol("_assign"); + const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } + }; + const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (isArray(modelValue)) { + const index = looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } + }; + function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (isArray(value)) { + checked = looseIndexOf(value, vnode.props.value) > -1; + } else if (isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } + } + const vModelRadio = { + created(el, { value }, vnode) { + el.checked = looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = looseEqual(value, vnode.props.value); + } + } + }; + const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = isSet(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? looseToNumber(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + el._assigning = true; + nextTick(() => { + el._assigning = false; + }); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + if (!el._assigning) { + setSelected(el, value); + } + } + }; + function setSelected(el, value) { + const isMultiple = el.multiple; + const isArrayValue = isArray(value); + if (isMultiple && !isArrayValue && !isSet(value)) { + warn( + `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` + ); + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if (isArrayValue) { + const optionType = typeof optionValue; + if (optionType === "string" || optionType === "number") { + option.selected = value.some((v) => String(v) === String(optionValue)); + } else { + option.selected = looseIndexOf(value, optionValue) > -1; + } + } else { + option.selected = value.has(optionValue); + } + } else if (looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) el.selectedIndex = i; + return; + } + } + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; + } + } + function getValue(el) { + return "_value" in el ? el._value : el.value; + } + function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; + } + const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); + } + }; + function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; + } + } + } + function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); + } + + const systemModifiers = ["ctrl", "shift", "alt", "meta"]; + const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) + }; + const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + }); + }; + const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" + }; + const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; + } + const eventKey = hyphenate(event.key); + if (modifiers.some( + (k) => k === eventKey || keyNames[k] === eventKey + )) { + return fn(event); + } + }); + }; + + const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); + let renderer; + let enabledHydration = false; + function ensureRenderer() { + return renderer || (renderer = createRenderer(rendererOptions)); + } + function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions); + enabledHydration = true; + return renderer; + } + const render = (...args) => { + ensureRenderer().render(...args); + }; + const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); + }; + const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; + }; + const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); + } + }; + return app; + }; + function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } + } + function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + writable: false + }); + } + function injectCompilerOptionsCheck(app) { + if (isRuntimeOnly()) { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + warn( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + warn(msg); + return compilerOptions; + }, + set() { + warn(msg); + } + }); + } + } + function normalizeContainer(container) { + if (isString(container)) { + const res = document.querySelector(container); + if (!res) { + warn( + `Failed to mount app: mount target selector "${container}" returned null.` + ); + } + return res; + } + if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + warn( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); + } + return container; + } + const initDirectivesForSSR = NOOP; + + exports.BaseTransition = BaseTransition; + exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators; + exports.Comment = Comment; + exports.DeprecationTypes = DeprecationTypes; + exports.EffectScope = EffectScope; + exports.ErrorCodes = ErrorCodes; + exports.ErrorTypeStrings = ErrorTypeStrings; + exports.Fragment = Fragment; + exports.KeepAlive = KeepAlive; + exports.ReactiveEffect = ReactiveEffect; + exports.Static = Static; + exports.Suspense = Suspense; + exports.Teleport = Teleport; + exports.Text = Text; + exports.TrackOpTypes = TrackOpTypes; + exports.Transition = Transition; + exports.TransitionGroup = TransitionGroup; + exports.TriggerOpTypes = TriggerOpTypes; + exports.VueElement = VueElement; + exports.assertNumber = assertNumber; + exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling; + exports.callWithErrorHandling = callWithErrorHandling; + exports.camelize = camelize; + exports.capitalize = capitalize; + exports.cloneVNode = cloneVNode; + exports.compatUtils = compatUtils; + exports.computed = computed; + exports.createApp = createApp; + exports.createBlock = createBlock; + exports.createCommentVNode = createCommentVNode; + exports.createElementBlock = createElementBlock; + exports.createElementVNode = createBaseVNode; + exports.createHydrationRenderer = createHydrationRenderer; + exports.createPropsRestProxy = createPropsRestProxy; + exports.createRenderer = createRenderer; + exports.createSSRApp = createSSRApp; + exports.createSlots = createSlots; + exports.createStaticVNode = createStaticVNode; + exports.createTextVNode = createTextVNode; + exports.createVNode = createVNode; + exports.customRef = customRef; + exports.defineAsyncComponent = defineAsyncComponent; + exports.defineComponent = defineComponent; + exports.defineCustomElement = defineCustomElement; + exports.defineEmits = defineEmits; + exports.defineExpose = defineExpose; + exports.defineModel = defineModel; + exports.defineOptions = defineOptions; + exports.defineProps = defineProps; + exports.defineSSRCustomElement = defineSSRCustomElement; + exports.defineSlots = defineSlots; + exports.devtools = devtools; + exports.effect = effect; + exports.effectScope = effectScope; + exports.getCurrentInstance = getCurrentInstance; + exports.getCurrentScope = getCurrentScope; + exports.getCurrentWatcher = getCurrentWatcher; + exports.getTransitionRawChildren = getTransitionRawChildren; + exports.guardReactiveProps = guardReactiveProps; + exports.h = h; + exports.handleError = handleError; + exports.hasInjectionContext = hasInjectionContext; + exports.hydrate = hydrate; + exports.hydrateOnIdle = hydrateOnIdle; + exports.hydrateOnInteraction = hydrateOnInteraction; + exports.hydrateOnMediaQuery = hydrateOnMediaQuery; + exports.hydrateOnVisible = hydrateOnVisible; + exports.initCustomFormatter = initCustomFormatter; + exports.initDirectivesForSSR = initDirectivesForSSR; + exports.inject = inject; + exports.isMemoSame = isMemoSame; + exports.isProxy = isProxy; + exports.isReactive = isReactive; + exports.isReadonly = isReadonly; + exports.isRef = isRef; + exports.isRuntimeOnly = isRuntimeOnly; + exports.isShallow = isShallow; + exports.isVNode = isVNode; + exports.markRaw = markRaw; + exports.mergeDefaults = mergeDefaults; + exports.mergeModels = mergeModels; + exports.mergeProps = mergeProps; + exports.nextTick = nextTick; + exports.normalizeClass = normalizeClass; + exports.normalizeProps = normalizeProps; + exports.normalizeStyle = normalizeStyle; + exports.onActivated = onActivated; + exports.onBeforeMount = onBeforeMount; + exports.onBeforeUnmount = onBeforeUnmount; + exports.onBeforeUpdate = onBeforeUpdate; + exports.onDeactivated = onDeactivated; + exports.onErrorCaptured = onErrorCaptured; + exports.onMounted = onMounted; + exports.onRenderTracked = onRenderTracked; + exports.onRenderTriggered = onRenderTriggered; + exports.onScopeDispose = onScopeDispose; + exports.onServerPrefetch = onServerPrefetch; + exports.onUnmounted = onUnmounted; + exports.onUpdated = onUpdated; + exports.onWatcherCleanup = onWatcherCleanup; + exports.openBlock = openBlock; + exports.popScopeId = popScopeId; + exports.provide = provide; + exports.proxyRefs = proxyRefs; + exports.pushScopeId = pushScopeId; + exports.queuePostFlushCb = queuePostFlushCb; + exports.reactive = reactive; + exports.readonly = readonly; + exports.ref = ref; + exports.registerRuntimeCompiler = registerRuntimeCompiler; + exports.render = render; + exports.renderList = renderList; + exports.renderSlot = renderSlot; + exports.resolveComponent = resolveComponent; + exports.resolveDirective = resolveDirective; + exports.resolveDynamicComponent = resolveDynamicComponent; + exports.resolveFilter = resolveFilter; + exports.resolveTransitionHooks = resolveTransitionHooks; + exports.setBlockTracking = setBlockTracking; + exports.setDevtoolsHook = setDevtoolsHook; + exports.setTransitionHooks = setTransitionHooks; + exports.shallowReactive = shallowReactive; + exports.shallowReadonly = shallowReadonly; + exports.shallowRef = shallowRef; + exports.ssrContextKey = ssrContextKey; + exports.ssrUtils = ssrUtils; + exports.stop = stop; + exports.toDisplayString = toDisplayString; + exports.toHandlerKey = toHandlerKey; + exports.toHandlers = toHandlers; + exports.toRaw = toRaw; + exports.toRef = toRef; + exports.toRefs = toRefs; + exports.toValue = toValue; + exports.transformVNodeArgs = transformVNodeArgs; + exports.triggerRef = triggerRef; + exports.unref = unref; + exports.useAttrs = useAttrs; + exports.useCssModule = useCssModule; + exports.useCssVars = useCssVars; + exports.useHost = useHost; + exports.useId = useId; + exports.useModel = useModel; + exports.useSSRContext = useSSRContext; + exports.useShadowRoot = useShadowRoot; + exports.useSlots = useSlots; + exports.useTemplateRef = useTemplateRef; + exports.useTransitionState = useTransitionState; + exports.vModelCheckbox = vModelCheckbox; + exports.vModelDynamic = vModelDynamic; + exports.vModelRadio = vModelRadio; + exports.vModelSelect = vModelSelect; + exports.vModelText = vModelText; + exports.vShow = vShow; + exports.version = version; + exports.warn = warn; + exports.watch = watch; + exports.watchEffect = watchEffect; + exports.watchPostEffect = watchPostEffect; + exports.watchSyncEffect = watchSyncEffect; + exports.withAsyncContext = withAsyncContext; + exports.withCtx = withCtx; + exports.withDefaults = withDefaults; + exports.withDirectives = withDirectives; + exports.withKeys = withKeys; + exports.withMemo = withMemo; + exports.withModifiers = withModifiers; + exports.withScopeId = withScopeId; + + return exports; + +})({}); diff --git a/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.prod.js b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.prod.js new file mode 100644 index 0000000..80ad452 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/dist/runtime-dom.global.prod.js @@ -0,0 +1,5 @@ +/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/var VueRuntimeDOM=function(e){"use strict";var t,n;let l,r,i,s,o,a,u,c,f,p,d,h;function g(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let m={},_=[],y=()=>{},b=()=>!1,S=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),C=e=>e.startsWith("onUpdate:"),x=Object.assign,w=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,k=(e,t)=>E.call(e,t),T=Array.isArray,A=e=>"[object Map]"===V(e),R=e=>"[object Set]"===V(e),O=e=>"[object Date]"===V(e),N=e=>"[object RegExp]"===V(e),P=e=>"function"==typeof e,M=e=>"string"==typeof e,I=e=>"symbol"==typeof e,L=e=>null!==e&&"object"==typeof e,D=e=>(L(e)||P(e))&&P(e.then)&&P(e.catch),F=Object.prototype.toString,V=e=>F.call(e),U=e=>V(e).slice(8,-1),j=e=>"[object Object]"===V(e),B=e=>M(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,$=g(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},W=/-(\w)/g,K=H(e=>e.replace(W,(e,t)=>t?t.toUpperCase():"")),z=/\B([A-Z])/g,q=H(e=>e.replace(z,"-$1").toLowerCase()),G=H(e=>e.charAt(0).toUpperCase()+e.slice(1)),J=H(e=>e?`on${G(e)}`:""),X=(e,t)=>!Object.is(e,t),Z=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Y=(e,t,n,l=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},Q=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ee=e=>{let t=M(e)?Number(e):NaN;return isNaN(t)?e:t},et=()=>l||(l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),en=g("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function el(e){if(T(e)){let t={};for(let n=0;n<e.length;n++){let l=e[n],r=M(l)?function(e){let t={};return e.replace(es,"").split(er).forEach(e=>{if(e){let n=e.split(ei);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):el(l);if(r)for(let e in r)t[e]=r[e]}return t}if(M(e)||L(e))return e}let er=/;(?![^(]*\))/g,ei=/:([^]+)/,es=/\/\*[^]*?\*\//g;function eo(e){let t="";if(M(e))t=e;else if(T(e))for(let n=0;n<e.length;n++){let l=eo(e[n]);l&&(t+=l+" ")}else if(L(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}let ea=g("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function eu(e,t){if(e===t)return!0;let n=O(e),l=O(t);if(n||l)return!!n&&!!l&&e.getTime()===t.getTime();if(n=I(e),l=I(t),n||l)return e===t;if(n=T(e),l=T(t),n||l)return!!n&&!!l&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let l=0;n&&l<e.length;l++)n=eu(e[l],t[l]);return n}(e,t);if(n=L(e),l=L(t),n||l){if(!n||!l||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let l=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(l&&!r||!l&&r||!eu(e[n],t[n]))return!1}}return String(e)===String(t)}function ec(e,t){return e.findIndex(e=>eu(e,t))}let ef=e=>!!(e&&!0===e.__v_isRef),ep=e=>M(e)?e:null==e?"":T(e)||L(e)&&(e.toString===F||!P(e.toString))?ef(e)?ep(e.value):JSON.stringify(e,ed,2):String(e),ed=(e,t)=>ef(t)?ed(e,t.value):A(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[eh(t,l)+" =>"]=n,e),{})}:R(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>eh(e))}:I(t)?eh(t):!L(t)||T(t)||j(t)?t:String(t),eh=(e,t="")=>{var n;return I(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eg{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=r,!e&&r&&(this.index=(r.scopes||(r.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=r;try{return r=this,e()}finally{r=t}}}on(){r=this}off(){r=this.parent}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,this.effects.length=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}let ev=new WeakSet;class em{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,r&&r.active&&r.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ev.has(this)&&(ev.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||ey(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,eO(this),eS(this);let e=i,t=ek;i=this,ek=!0;try{return this.fn()}finally{eC(this),i=e,ek=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)eE(e);this.deps=this.depsTail=void 0,eO(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ev.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ex(this)&&this.run()}get dirty(){return ex(this)}}let e_=0;function ey(e,t=!1){if(e.flags|=8,t){e.next=o,o=e;return}e.next=s,s=e}function eb(){let e;if(!(--e_>0)){if(o){let e=o;for(o=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;s;){let t=s;for(s=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eS(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eC(e){let t;let n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eE(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function ex(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ew(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ew(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eN))return;e.globalVersion=eN;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!ex(e)){e.flags&=-3;return}let n=i,l=ek;i=e,ek=!0;try{eS(e);let n=e.fn(e._value);(0===t.version||X(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{i=n,ek=l,eC(e),e.flags&=-3}}function eE(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eE(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let ek=!0,eT=[];function eA(){eT.push(ek),ek=!1}function eR(){let e=eT.pop();ek=void 0===e||e}function eO(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=i;i=void 0;try{t()}finally{i=e}}}let eN=0;class eP{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eM{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!i||!ek||i===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==i)t=this.activeLink=new eP(i,this),i.deps?(t.prevDep=i.depsTail,i.depsTail.nextDep=t,i.depsTail=t):i.deps=i.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=i.depsTail,t.nextDep=void 0,i.depsTail.nextDep=t,i.depsTail=t,i.deps===t&&(i.deps=e)}return t}trigger(e){this.version++,eN++,this.notify(e)}notify(e){e_++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eb()}}}let eI=new WeakMap,eL=Symbol(""),eD=Symbol(""),eF=Symbol("");function eV(e,t,n){if(ek&&i){let t=eI.get(e);t||eI.set(e,t=new Map);let l=t.get(n);l||(t.set(n,l=new eM),l.map=t,l.key=n),l.track()}}function eU(e,t,n,l,r,i){let s=eI.get(e);if(!s){eN++;return}let o=e=>{e&&e.trigger()};if(e_++,"clear"===t)s.forEach(o);else{let r=T(e),i=r&&B(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===eF||!I(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(eF)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eL)),A(e)&&o(s.get(eD)));break;case"delete":!r&&(o(s.get(eL)),A(e)&&o(s.get(eD)));break;case"set":A(e)&&o(s.get(eL))}}eb()}function ej(e){let t=tg(e);return t===e?t:(eV(t,"iterate",eF),td(e)?t:t.map(tm))}function eB(e){return eV(e=tg(e),"iterate",eF),e}let e$={__proto__:null,[Symbol.iterator](){return eH(this,Symbol.iterator,tm)},concat(...e){return ej(this).concat(...e.map(e=>T(e)?ej(e):e))},entries(){return eH(this,"entries",e=>(e[1]=tm(e[1]),e))},every(e,t){return eK(this,"every",e,t,void 0,arguments)},filter(e,t){return eK(this,"filter",e,t,e=>e.map(tm),arguments)},find(e,t){return eK(this,"find",e,t,tm,arguments)},findIndex(e,t){return eK(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eK(this,"findLast",e,t,tm,arguments)},findLastIndex(e,t){return eK(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eK(this,"forEach",e,t,void 0,arguments)},includes(...e){return eq(this,"includes",e)},indexOf(...e){return eq(this,"indexOf",e)},join(e){return ej(this).join(e)},lastIndexOf(...e){return eq(this,"lastIndexOf",e)},map(e,t){return eK(this,"map",e,t,void 0,arguments)},pop(){return eG(this,"pop")},push(...e){return eG(this,"push",e)},reduce(e,...t){return ez(this,"reduce",e,t)},reduceRight(e,...t){return ez(this,"reduceRight",e,t)},shift(){return eG(this,"shift")},some(e,t){return eK(this,"some",e,t,void 0,arguments)},splice(...e){return eG(this,"splice",e)},toReversed(){return ej(this).toReversed()},toSorted(e){return ej(this).toSorted(e)},toSpliced(...e){return ej(this).toSpliced(...e)},unshift(...e){return eG(this,"unshift",e)},values(){return eH(this,"values",tm)}};function eH(e,t,n){let l=eB(e),r=l[t]();return l===e||td(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eW=Array.prototype;function eK(e,t,n,l,r,i){let s=eB(e),o=s!==e&&!td(e),a=s[t];if(a!==eW[t]){let t=a.apply(e,i);return o?tm(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tm(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function ez(e,t,n,l){let r=eB(e),i=n;return r!==e&&(td(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tm(l),r,e)}),r[t](i,...l)}function eq(e,t,n){let l=tg(e);eV(l,"iterate",eF);let r=l[t](...n);return(-1===r||!1===r)&&th(n[0])?(n[0]=tg(n[0]),l[t](...n)):r}function eG(e,t,n=[]){eA(),e_++;let l=tg(e)[t].apply(e,n);return eb(),eR(),l}let eJ=g("__proto__,__v_isRef,__isVue"),eX=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(I));function eZ(e){I(e)||(e=String(e));let t=tg(this);return eV(t,"has",e),t.hasOwnProperty(e)}class eY{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?ts:ti:r?tr:tl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=T(e);if(!l){let e;if(i&&(e=e$[t]))return e;if("hasOwnProperty"===t)return eZ}let s=Reflect.get(e,t,ty(e)?e:n);return(I(t)?eX.has(t):eJ(t))?s:(l||eV(e,"get",t),r)?s:ty(s)?i&&B(t)?s:s.value:L(s)?l?tu(s):to(s):s}}class eQ extends eY{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=tp(r);if(td(n)||tp(n)||(r=tg(r),n=tg(n)),!T(e)&&ty(r)&&!ty(n))return!t&&(r.value=n,!0)}let i=T(e)&&B(t)?Number(t)<e.length:k(e,t),s=Reflect.set(e,t,n,ty(e)?e:l);return e===tg(l)&&(i?X(n,r)&&eU(e,"set",t,n):eU(e,"add",t,n)),s}deleteProperty(e,t){let n=k(e,t);e[t];let l=Reflect.deleteProperty(e,t);return l&&n&&eU(e,"delete",t,void 0),l}has(e,t){let n=Reflect.has(e,t);return I(t)&&eX.has(t)||eV(e,"has",t),n}ownKeys(e){return eV(e,"iterate",T(e)?"length":eL),Reflect.ownKeys(e)}}class e0 extends eY{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}let e1=new eQ,e2=new e0,e6=new eQ(!0),e4=new e0(!0),e8=e=>e,e3=e=>Reflect.getPrototypeOf(e);function e5(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function e9(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=tg(l),i=tg(n);e||(X(n,i)&&eV(r,"get",n),eV(r,"get",i));let{has:s}=e3(r),o=t?e8:e?t_:tm;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eV(tg(t),"iterate",eL),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=tg(n),r=tg(t);return e||(X(t,r)&&eV(l,"has",t),eV(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=tg(i),o=t?e8:e?t_:tm;return e||eV(s,"iterate",eL),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return x(n,e?{add:e5("add"),set:e5("set"),delete:e5("delete"),clear:e5("clear")}:{add(e){t||td(e)||tp(e)||(e=tg(e));let n=tg(this);return e3(n).has.call(n,e)||(n.add(e),eU(n,"add",e,e)),this},set(e,n){t||td(n)||tp(n)||(n=tg(n));let l=tg(this),{has:r,get:i}=e3(l),s=r.call(l,e);s||(e=tg(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?X(n,o)&&eU(l,"set",e,n):eU(l,"add",e,n),this},delete(e){let t=tg(this),{has:n,get:l}=e3(t),r=n.call(t,e);r||(e=tg(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eU(t,"delete",e,void 0),i},clear(){let e=tg(this),t=0!==e.size,n=e.clear();return t&&eU(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=tg(r),s=A(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e8:e?t_:tm;return e||eV(i,"iterate","keys"===l&&s?eD:eL),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(k(n,l)&&l in t?n:t,l,r)}let e7={get:e9(!1,!1)},te={get:e9(!1,!0)},tt={get:e9(!0,!1)},tn={get:e9(!0,!0)},tl=new WeakMap,tr=new WeakMap,ti=new WeakMap,ts=new WeakMap;function to(e){return tp(e)?e:tc(e,!1,e1,e7,tl)}function ta(e){return tc(e,!1,e6,te,tr)}function tu(e){return tc(e,!0,e2,tt,ti)}function tc(e,t,n,l,r){if(!L(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=r.get(e);if(i)return i;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(U(e));if(0===s)return e;let o=new Proxy(e,2===s?l:n);return r.set(e,o),o}function tf(e){return tp(e)?tf(e.__v_raw):!!(e&&e.__v_isReactive)}function tp(e){return!!(e&&e.__v_isReadonly)}function td(e){return!!(e&&e.__v_isShallow)}function th(e){return!!e&&!!e.__v_raw}function tg(e){let t=e&&e.__v_raw;return t?tg(t):e}function tv(e){return!k(e,"__v_skip")&&Object.isExtensible(e)&&Y(e,"__v_skip",!0),e}let tm=e=>L(e)?to(e):e,t_=e=>L(e)?tu(e):e;function ty(e){return!!e&&!0===e.__v_isRef}function tb(e){return tC(e,!1)}function tS(e){return tC(e,!0)}function tC(e,t){return ty(e)?e:new tx(e,t)}class tx{constructor(e,t){this.dep=new eM,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tg(e),this._value=t?e:tm(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||td(e)||tp(e);X(e=n?e:tg(e),t)&&(this._rawValue=e,this._value=n?e:tm(e),this.dep.trigger())}}function tw(e){return ty(e)?e.value:e}let tE={get:(e,t,n)=>"__v_raw"===t?e:tw(Reflect.get(e,t,n)),set:(e,t,n,l)=>{let r=e[t];return ty(r)&&!ty(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tk(e){return tf(e)?e:new Proxy(e,tE)}class tT{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new eM,{get:n,set:l}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tA(e){return new tT(e)}class tR{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){let e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){let n=eI.get(e);return n&&n.get(t)}(tg(this._object),this._key)}}class tO{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function tN(e,t,n){let l=e[t];return ty(l)?l:new tR(e,t,n)}class tP{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eM(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eN-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&i!==this)return ey(this,!0),!0}get value(){let e=this.dep.track();return ew(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tM={},tI=new WeakMap;function tL(e,t=!1,n=d){if(n){let t=tI.get(n);t||tI.set(n,t=[]),t.push(e)}}function tD(e,t=1/0,n){if(t<=0||!L(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,ty(e))tD(e.value,t,n);else if(T(e))for(let l=0;l<e.length;l++)tD(e[l],t,n);else if(R(e)||A(e))e.forEach(e=>{tD(e,t,n)});else if(j(e)){for(let l in e)tD(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tD(e[l],t,n)}return e}function tF(e,t,n,l){try{return l?e(...l):e()}catch(e){tU(e,t,n)}}function tV(e,t,n,l){if(P(e)){let r=tF(e,t,n,l);return r&&D(r)&&r.catch(e=>{tU(e,t,n)}),r}if(T(e)){let r=[];for(let i=0;i<e.length;i++)r.push(tV(e[i],t,n,l));return r}}function tU(e,t,n,l=!0){t&&t.vnode;let{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||m;if(t){let l=t.parent,i=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){let t=l.ec;if(t){for(let n=0;n<t.length;n++)if(!1===t[n](e,i,s))return}l=l.parent}if(r){eA(),tF(r,null,10,[e,i,s]),eR();return}}!function(e,t,n,l=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,l,i)}let tj=[],tB=-1,t$=[],tH=null,tW=0,tK=Promise.resolve(),tz=null;function tq(e){let t=tz||tK;return e?t.then(this?e.bind(this):e):t}function tG(e){if(!(1&e.flags)){let t=tQ(e),n=tj[tj.length-1];!n||!(2&e.flags)&&t>=tQ(n)?tj.push(e):tj.splice(function(e){let t=tB+1,n=tj.length;for(;t<n;){let l=t+n>>>1,r=tj[l],i=tQ(r);i<e||i===e&&2&r.flags?t=l+1:n=l}return t}(t),0,e),e.flags|=1,tJ()}}function tJ(){tz||(tz=tK.then(function e(t){try{for(tB=0;tB<tj.length;tB++){let e=tj[tB];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),tF(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;tB<tj.length;tB++){let e=tj[tB];e&&(e.flags&=-2)}tB=-1,tj.length=0,tY(),tz=null,(tj.length||t$.length)&&e()}}))}function tX(e){T(e)?t$.push(...e):tH&&-1===e.id?tH.splice(tW+1,0,e):1&e.flags||(t$.push(e),e.flags|=1),tJ()}function tZ(e,t,n=tB+1){for(;n<tj.length;n++){let t=tj[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;tj.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function tY(e){if(t$.length){let e=[...new Set(t$)].sort((e,t)=>tQ(e)-tQ(t));if(t$.length=0,tH){tH.push(...e);return}for(tW=0,tH=e;tW<tH.length;tW++){let e=tH[tW];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}tH=null,tW=0}}let tQ=e=>null==e.id?2&e.flags?-1:1/0:e.id,t0=null,t1=null;function t2(e){let t=t0;return t0=e,t1=e&&e.type.__scopeId||null,t}function t6(e,t=t0,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&rs(-1);let i=t2(t);try{r=e(...n)}finally{t2(i),l._d&&rs(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}function t4(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;s<r.length;s++){let o=r[s];i&&(o.oldValue=i[s].value);let a=o.dir[l];a&&(eA(),tV(a,n,8,[e.el,o,e,t]),eR())}}let t8=Symbol("_vte"),t3=e=>e.__isTeleport,t5=e=>e&&(e.disabled||""===e.disabled),t9=e=>e&&(e.defer||""===e.defer),t7=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,ne=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,nt=(e,t)=>{let n=e&&e.to;return M(n)?t?t(n):null:n},nn={name:"Teleport",__isTeleport:!0,process(e,t,n,l,r,i,s,o,a,u){let{mc:c,pc:f,pbc:p,o:{insert:d,querySelector:h,createText:g,createComment:m}}=u,_=t5(t.props),{shapeFlag:y,children:b,dynamicChildren:S}=t;if(null==e){let e=t.el=g(""),u=t.anchor=g("");d(e,n,l),d(u,n,l);let f=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(b,e,t,r,i,s,o,a))},p=()=>{let e=t.target=nt(t.props,h),n=ni(e,t,g,d);e&&("svg"!==s&&t7(e)?s="svg":"mathml"!==s&&ne(e)&&(s="mathml"),_||(f(e,n),nr(t,!1)))};_&&(f(n,u),nr(t,!0)),t9(t.props)?lM(()=>{p(),t.el.__isMounted=!0},i):p()}else{if(t9(t.props)&&!e.el.__isMounted){lM(()=>{nn.process(e,t,n,l,r,i,s,o,a,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;let c=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=t5(e.props),y=m?n:d;if("svg"===s||t7(d)?s="svg":("mathml"===s||ne(d))&&(s="mathml"),S?(p(e.dynamicChildren,S,y,r,i,s,o),lU(e,t,!0)):a||f(e,t,y,m?c:g,r,i,s,o,!1),_)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nl(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=nt(t.props,h);e&&nl(t,e,null,u,0)}else m&&nl(t,d,g,u,1);nr(t,_)}},remove(e,t,n,{um:l,o:{remove:r}},i){let{shapeFlag:s,children:o,anchor:a,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(r(u),r(c)),i&&r(a),16&s){let e=i||!t5(p);for(let r=0;r<o.length;r++){let i=o[r];l(i,t,n,e,!!i.dynamicChildren)}}},move:nl,hydrate:function(e,t,n,l,r,i,{o:{nextSibling:s,parentNode:o,querySelector:a,insert:u,createText:c}},f){let p=t.target=nt(t.props,a);if(p){let a=t5(t.props),d=p._lpa||p.firstChild;if(16&t.shapeFlag){if(a)t.anchor=f(s(e),t,o(e),n,l,r,i),t.targetStart=d,t.targetAnchor=d&&s(d);else{t.anchor=s(e);let o=d;for(;o;){if(o&&8===o.nodeType){if("teleport start anchor"===o.data)t.targetStart=o;else if("teleport anchor"===o.data){t.targetAnchor=o,p._lpa=t.targetAnchor&&s(t.targetAnchor);break}}o=s(o)}t.targetAnchor||ni(p,t,c,u),f(d&&s(d),t,p,n,l,r,i)}}nr(t,a)}return t.anchor&&s(t.anchor)}};function nl(e,t,n,{o:{insert:l},m:r},i=2){0===i&&l(e.targetAnchor,t,n);let{el:s,anchor:o,shapeFlag:a,children:u,props:c}=e,f=2===i;if(f&&l(s,t,n),(!f||t5(c))&&16&a)for(let e=0;e<u.length;e++)r(u[e],t,n,2);f&&l(o,t,n)}function nr(e,t){let n=e.ctx;if(n&&n.ut){let l,r;for(t?(l=e.el,r=e.anchor):(l=e.targetStart,r=e.targetAnchor);l&&l!==r;)1===l.nodeType&&l.setAttribute("data-v-owner",n.uid),l=l.nextSibling;n.ut()}}function ni(e,t,n,l){let r=t.targetStart=n(""),i=t.targetAnchor=n("");return r[t8]=i,e&&(l(r,e),l(i,e)),i}let ns=Symbol("_leaveCb"),no=Symbol("_enterCb");function na(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return nq(()=>{e.isMounted=!0}),nX(()=>{e.isUnmounting=!0}),e}let nu=[Function,Array],nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:nu,onEnter:nu,onAfterEnter:nu,onEnterCancelled:nu,onBeforeLeave:nu,onLeave:nu,onAfterLeave:nu,onLeaveCancelled:nu,onBeforeAppear:nu,onAppear:nu,onAfterAppear:nu,onAppearCancelled:nu},nf=e=>{let t=e.subTree;return t.component?nf(t.component):t};function np(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==l7){t=n;break}}return t}let nd={name:"BaseTransition",props:nc,setup(e,{slots:t}){let n=rk(),l=na();return()=>{let r=t.default&&ny(t.default(),!0);if(!r||!r.length)return;let i=np(r),s=tg(e),{mode:o}=s;if(l.isLeaving)return nv(i);let a=nm(i);if(!a)return nv(i);let u=ng(a,s,l,n,e=>u=e);a.type!==l7&&n_(a,u);let c=n.subTree&&nm(n.subTree);if(c&&c.type!==l7&&!rc(a,c)&&nf(n).type!==l7){let e=ng(c,s,l,n);if(n_(c,e),"out-in"===o&&a.type!==l7)return l.isLeaving=!0,e.afterLeave=()=>{l.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},nv(i);"in-out"===o&&a.type!==l7?e.delayLeave=(e,t,n)=>{nh(l,c)[String(c.key)]=c,e[ns]=()=>{t(),e[ns]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function nh(e,t){let{leavingVNodes:n}=e,l=n.get(t.type);return l||(l=Object.create(null),n.set(t.type,l)),l}function ng(e,t,n,l,r){let{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:m,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,S=String(e.key),C=nh(n,e),x=(e,t)=>{e&&tV(e,l,9,t)},w=(e,t)=>{let n=t[1];x(e,t),T(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},E={mode:s,persisted:o,beforeEnter(t){let l=a;if(!n.isMounted){if(!i)return;l=m||a}t[ns]&&t[ns](!0);let r=C[S];r&&rc(e,r)&&r.el[ns]&&r.el[ns](),x(l,[t])},enter(e){let t=u,l=c,r=f;if(!n.isMounted){if(!i)return;t=_||u,l=y||c,r=b||f}let s=!1,o=e[no]=t=>{s||(s=!0,t?x(r,[e]):x(l,[e]),E.delayedLeave&&E.delayedLeave(),e[no]=void 0)};t?w(t,[e,o]):o()},leave(t,l){let r=String(e.key);if(t[no]&&t[no](!0),n.isUnmounting)return l();x(p,[t]);let i=!1,s=t[ns]=n=>{i||(i=!0,l(),n?x(g,[t]):x(h,[t]),t[ns]=void 0,C[r]!==e||delete C[r])};C[r]=e,d?w(d,[t,s]):s()},clone(e){let i=ng(e,t,n,l,r);return r&&r(i),i}};return E}function nv(e){if(nF(e))return(e=rv(e)).children=null,e}function nm(e){if(!nF(e))return t3(e.type)&&e.children?np(e.children):e;let{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&P(n.default))return n.default()}}function n_(e,t){6&e.shapeFlag&&e.component?(e.transition=t,n_(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ny(e,t=!1,n){let l=[],r=0;for(let i=0;i<e.length;i++){let s=e[i],o=null==n?s.key:String(n)+String(null!=s.key?s.key:i);s.type===l5?(128&s.patchFlag&&r++,l=l.concat(ny(s.children,t,o))):(t||s.type!==l7)&&l.push(null!=o?rv(s,{key:o}):s)}if(r>1)for(let e=0;e<l.length;e++)l[e].patchFlag=-2;return l}function nb(e,t){return P(e)?x({name:e.name},t,{setup:e}):e}function nS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function nC(e,t,n,l,r=!1){if(T(e)){e.forEach((e,i)=>nC(e,t&&(T(t)?t[i]:t),n,l,r));return}if(nL(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&nC(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?rL(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===m?o.refs={}:o.refs,f=o.setupState,p=tg(f),d=f===m?()=>!1:e=>k(p,e);if(null!=u&&u!==a&&(M(u)?(c[u]=null,d(u)&&(f[u]=null)):ty(u)&&(u.value=null)),P(a))tF(a,o,12,[s,c]);else{let t=M(a),l=ty(a);if(t||l){let o=()=>{if(e.f){let n=t?d(a)?f[a]:c[a]:a.value;r?T(n)&&w(n,i):T(n)?n.includes(i)||n.push(i):t?(c[a]=[i],d(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,d(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,lM(o,n)):o()}}}let nx=!1,nw=()=>{nx||(console.error("Hydration completed but contains mismatches."),nx=!0)},nE=e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName,nk=e=>e.namespaceURI.includes("MathML"),nT=e=>{if(1===e.nodeType){if(nE(e))return"svg";if(nk(e))return"mathml"}},nA=e=>8===e.nodeType;function nR(e){let{mt:t,p:n,o:{patchProp:l,createText:r,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=e,c=(n,l,o,u,y,b=!1)=>{b=b||!!l.dynamicChildren;let S=nA(n)&&"["===n.data,C=()=>h(n,l,o,u,y,S),{type:x,ref:w,shapeFlag:E,patchFlag:k}=l,T=n.nodeType;l.el=n,-2===k&&(b=!1,l.dynamicChildren=null);let A=null;switch(x){case l9:3!==T?""===l.children?(a(l.el=r(""),s(n),n),A=n):A=C():(n.data!==l.children&&(nw(),n.data=l.children),A=i(n));break;case l7:_(n)?(A=i(n),m(l.el=n.content.firstChild,n,o)):A=8!==T||S?C():i(n);break;case re:if(S&&(T=(n=i(n)).nodeType),1===T||3===T){A=n;let e=!l.children.length;for(let t=0;t<l.staticCount;t++)e&&(l.children+=1===A.nodeType?A.outerHTML:A.data),t===l.staticCount-1&&(l.anchor=A),A=i(A);return S?i(A):A}C();break;case l5:A=S?d(n,l,o,u,y,b):C();break;default:if(1&E)A=1===T&&l.type.toLowerCase()===n.tagName.toLowerCase()||_(n)?f(n,l,o,u,y,b):C();else if(6&E){l.slotScopeIds=y;let e=s(n);if(A=S?g(n):nA(n)&&"teleport start"===n.data?g(n,n.data,"teleport end"):i(n),t(l,e,null,o,u,nT(e),b),nL(l)&&!l.type.__asyncResolved){let t;S?(t=rh(l5)).anchor=A?A.previousSibling:e.lastChild:t=3===n.nodeType?rm(""):rh("div"),t.el=n,l.component.subTree=t}}else 64&E?A=8!==T?C():l.type.hydrate(n,l,o,u,y,b,e,p):128&E&&(A=l.type.hydrate(n,l,o,u,nT(s(n)),y,b,e,c))}return null!=w&&nC(w,null,u,l),A},f=(e,t,n,r,i,s)=>{s=s||!!t.dynamicChildren;let{type:a,props:u,patchFlag:c,shapeFlag:f,dirs:d,transition:h}=t,g="input"===a||"option"===a;if(g||-1!==c){let a;d&&t4(t,null,n,"created");let y=!1;if(_(e)){y=lV(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let l=e.content.firstChild;y&&h.beforeEnter(l),m(l,e,n),t.el=e=l}if(16&f&&!(u&&(u.innerHTML||u.textContent))){let l=p(e.firstChild,t,e,n,r,i,s);for(;l;){nP(e,1)||nw();let t=l;l=l.nextSibling,o(t)}}else if(8&f){let n=t.children;"\n"===n[0]&&("PRE"===e.tagName||"TEXTAREA"===e.tagName)&&(n=n.slice(1)),e.textContent!==n&&(nP(e,0)||nw(),e.textContent=t.children)}if(u){if(g||!s||48&c){let t=e.tagName.includes("-");for(let r in u)(g&&(r.endsWith("value")||"indeterminate"===r)||S(r)&&!$(r)||"."===r[0]||t)&&l(e,r,null,u[r],void 0,n)}else if(u.onClick)l(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&tf(u.style))for(let e in u.style)u.style[e]}(a=u&&u.onVnodeBeforeMount)&&rC(a,n,t),d&&t4(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||d||y)&&l8(()=>{a&&rC(a,n,t),y&&h.enter(e),d&&t4(t,null,n,"mounted")},r)}return e.nextSibling},p=(e,t,l,s,o,u,f)=>{f=f||!!t.dynamicChildren;let p=t.children,d=p.length;for(let t=0;t<d;t++){let h=f?p[t]:p[t]=r_(p[t]),g=h.type===l9;e?(g&&!f&&t+1<d&&r_(p[t+1]).type===l9&&(a(r(e.data.slice(h.children.length)),l,i(e)),e.data=h.children),e=c(e,h,s,o,u,f)):g&&!h.children?a(h.el=r(""),l):(nP(l,1)||nw(),n(null,h,l,null,s,o,nT(l),u))}return e},d=(e,t,n,l,r,o)=>{let{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);let f=s(e),d=p(i(e),t,f,n,l,r,o);return d&&nA(d)&&"]"===d.data?i(t.anchor=d):(nw(),a(t.anchor=u("]"),f,d),d)},h=(e,t,l,r,a,u)=>{if(nP(e.parentElement,1)||nw(),t.el=null,u){let t=g(e);for(;;){let n=i(e);if(n&&n!==t)o(n);else break}}let c=i(e),f=s(e);return o(e),n(null,t,f,c,l,r,nT(f),a),l&&(l.vnode.el=t.el,lQ(l,t.el)),c},g=(e,t="[",n="]")=>{let l=0;for(;e;)if((e=i(e))&&nA(e)&&(e.data===t&&l++,e.data===n)){if(0===l)return i(e);l--}return e},m=(e,t,n)=>{let l=t.parentNode;l&&l.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),tY(),t._vnode=e;return}c(t.firstChild,e,null,null,null),tY(),t._vnode=e},c]}let nO="data-allow-mismatch",nN={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function nP(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(nO);)e=e.parentElement;let n=e&&e.getAttribute(nO);if(null==n)return!1;if(""===n)return!0;{let e=n.split(",");return!!(0===t&&e.includes("children"))||n.split(",").includes(nN[t])}}let nM=et().requestIdleCallback||(e=>setTimeout(e,1)),nI=et().cancelIdleCallback||(e=>clearTimeout(e)),nL=e=>!!e.type.__asyncLoader;function nD(e,t){let{ref:n,props:l,children:r,ce:i}=t.vnode,s=rh(e,l,r);return s.ref=n,s.ce=i,delete t.vnode.ce,s}let nF=e=>e.type.__isKeepAlive;function nV(e,t){return T(e)?e.some(e=>nV(e,t)):M(e)?e.split(",").includes(t):!!N(e)&&(e.lastIndex=0,e.test(t))}function nU(e,t){nB(e,"a",t)}function nj(e,t){nB(e,"da",t)}function nB(e,t,n=rE){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(nW(t,l,n),n){let e=n.parent;for(;e&&e.parent;)nF(e.parent.vnode)&&function(e,t,n,l){let r=nW(t,e,l,!0);nZ(()=>{w(l[t],r)},n)}(l,t,n,e),e=e.parent}}function n$(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function nH(e){return 128&e.shapeFlag?e.ssContent:e}function nW(e,t,n=rE,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eA();let r=rT(n),i=tV(t,n,e,l);return r(),eR(),i});return l?r.unshift(i):r.push(i),i}}let nK=e=>(t,n=rE)=>{rO&&"sp"!==e||nW(e,(...e)=>t(...e),n)},nz=nK("bm"),nq=nK("m"),nG=nK("bu"),nJ=nK("u"),nX=nK("bum"),nZ=nK("um"),nY=nK("sp"),nQ=nK("rtg"),n0=nK("rtc");function n1(e,t=rE){nW("ec",e,t)}let n2="components",n6=Symbol.for("v-ndc");function n4(e,t,n=!0,l=!1){let r=t0||rE;if(r){let n=r.type;if(e===n2){let e=rD(n,!1);if(e&&(e===t||e===K(t)||e===G(K(t))))return n}let i=n8(r[e]||n[e],t)||n8(r.appContext[e],t);return!i&&l?n:i}}function n8(e,t){return e&&(e[t]||e[K(t)]||e[G(K(t))])}let n3=e=>e?rR(e)?rL(e):n3(e.parent):null,n5=x(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>n3(e.parent),$root:e=>n3(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>li(e),$forceUpdate:e=>e.f||(e.f=()=>{tG(e.update)}),$nextTick:e=>e.n||(e.n=tq.bind(e.proxy)),$watch:e=>lW.bind(e)}),n9=(e,t)=>e!==m&&!e.__isScriptSetup&&k(e,t),n7={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(n9(s,t))return u[t]=1,s[t];if(o!==m&&k(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&k(n,t))return u[t]=3,a[t];if(i!==m&&k(i,t))return u[t]=4,i[t];ll&&(u[t]=0)}}let p=n5[t];return p?("$attrs"===t&&eV(e.attrs,"get",""),p(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==m&&k(i,t)?(u[t]=4,i[t]):k(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return n9(r,t)?(r[t]=n,!0):l!==m&&k(l,t)?(l[t]=n,!0):!k(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==m&&k(e,s)||n9(t,s)||(o=i[0])&&k(o,s)||k(l,s)||k(n5,s)||k(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:k(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},le=x({},n7,{get(e,t){if(t!==Symbol.unscopables)return n7.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!en(t)});function lt(){let e=rk();return e.setupContext||(e.setupContext=rI(e))}function ln(e){return T(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let ll=!0;function lr(e,t,n){tV(T(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function li(e){let t;let n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>ls(t,e,o,!0)),ls(t,n,o)):t=n,L(n)&&s.set(n,t),t}function ls(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&ls(e,i,n,!0),r&&r.forEach(t=>ls(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=lo[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let lo={data:la,props:lp,emits:lp,methods:lf,computed:lf,beforeCreate:lc,created:lc,beforeMount:lc,mounted:lc,beforeUpdate:lc,updated:lc,beforeDestroy:lc,beforeUnmount:lc,destroyed:lc,unmounted:lc,activated:lc,deactivated:lc,errorCaptured:lc,serverPrefetch:lc,components:lf,directives:lf,watch:function(e,t){if(!e)return t;if(!t)return e;let n=x(Object.create(null),e);for(let l in t)n[l]=lc(e[l],t[l]);return n},provide:la,inject:function(e,t){return lf(lu(e),lu(t))}};function la(e,t){return t?e?function(){return x(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function lu(e){if(T(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function lc(e,t){return e?[...new Set([].concat(e,t))]:t}function lf(e,t){return e?x(Object.create(null),e,t):t}function lp(e,t){return e?T(e)&&T(t)?[...new Set([...e,...t])]:x(Object.create(null),ln(e),ln(null!=t?t:{})):t}function ld(){return{app:null,config:{isNativeTag:b,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let lh=0,lg=null;function lv(e,t){if(rE){let n=rE.provides,l=rE.parent&&rE.parent.provides;l===n&&(n=rE.provides=Object.create(l)),n[e]=t}}function lm(e,t,n=!1){let l=rE||t0;if(l||lg){let r=lg?lg._context.provides:l?null==l.parent?l.vnode.appContext&&l.vnode.appContext.provides:l.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&P(t)?t.call(l&&l.proxy):t}}let l_={},ly=()=>Object.create(l_),lb=e=>Object.getPrototypeOf(e)===l_;function lS(e,t,n,l){let r;let[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if($(a))continue;let c=t[a];i&&k(i,u=K(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:lG(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=tg(n),l=r||m;for(let r=0;r<s.length;r++){let o=s[r];n[o]=lC(i,t,o,l[o],e,!k(l,o))}}return o}function lC(e,t,n,l,r,i){let s=e[n];if(null!=s){let e=k(s,"default");if(e&&void 0===l){let e=s.default;if(s.type!==Function&&!s.skipFactory&&P(e)){let{propsDefaults:i}=r;if(n in i)l=i[n];else{let s=rT(r);l=i[n]=e.call(null,t),s()}}else l=e;r.ce&&r.ce._setProp(n,l)}s[0]&&(i&&!e?l=!1:s[1]&&(""===l||l===q(n))&&(l=!0))}return l}let lx=new WeakMap;function lw(e){return!("$"===e[0]||$(e))}let lE=e=>"_"===e[0]||"$stable"===e,lk=e=>T(e)?e.map(r_):[r_(e)],lT=(e,t,n)=>{if(t._n)return t;let l=t6((...e)=>lk(t(...e)),n);return l._c=!1,l},lA=(e,t,n)=>{let l=e._ctx;for(let n in e){if(lE(n))continue;let r=e[n];if(P(r))t[n]=lT(n,r,l);else if(null!=r){let e=lk(r);t[n]=()=>e}}},lR=(e,t)=>{let n=lk(t);e.slots.default=()=>n},lO=(e,t,n)=>{for(let l in t)(n||"_"!==l)&&(e[l]=t[l])},lN=(e,t,n)=>{let l=e.slots=ly();if(32&e.vnode.shapeFlag){let e=t._;e?(lO(l,t,n),n&&Y(l,"_",e,!0)):lA(t,l)}else t&&lR(e,t)},lP=(e,t,n)=>{let{vnode:l,slots:r}=e,i=!0,s=m;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:lO(r,t,n):(i=!t.$stable,lA(t,r)),s=t}else t&&(lR(e,t),s={default:1});if(i)for(let e in r)lE(e)||null!=s[e]||delete r[e]},lM=l8;function lI(e){return lL(e,nR)}function lL(e,t){var n;let l,r;et().__VUE__=!0;let{insert:i,remove:s,patchProp:o,createElement:a,createText:c,createComment:f,setText:p,setElementText:d,parentNode:h,nextSibling:g,setScopeId:b=y,insertStaticContent:S}=e,C=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!rc(e,t)&&(l=eo(e),en(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case l9:w(e,t,n,l);break;case l7:E(e,t,n,l);break;case re:null==e&&A(t,n,l,s);break;case l5:B(e,t,n,l,r,i,s,o,a);break;default:1&f?N(e,t,n,l,r,i,s,o,a):6&f?H(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,ec):128&f&&u.process(e,t,n,l,r,i,s,o,a,ec)}null!=c&&r&&nC(c,e&&e.ref,i,t||e,!t)},w=(e,t,n,l)=>{if(null==e)i(t.el=c(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},E=(e,t,n,l)=>{null==e?i(t.el=f(t.children||""),n,l):t.el=e.el},A=(e,t,n,l)=>{[e.el,e.anchor]=S(e.children,t,n,l,e.el,e.anchor)},R=({el:e,anchor:t},n,l)=>{let r;for(;e&&e!==t;)r=g(e),i(e,n,l),e=r;i(t,n,l)},O=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=g(e),s(e),e=n;s(t)},N=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?M(t,n,l,r,i,s,o,a):V(e,t,r,i,s,o,a)},M=(e,t,n,l,r,s,u,c)=>{let f,p;let{props:h,shapeFlag:g,transition:m,dirs:_}=e;if(f=e.el=a(e.type,s,h&&h.is,h),8&g?d(f,e.children):16&g&&F(e.children,f,null,l,r,lD(e,s),u,c),_&&t4(e,null,l,"created"),I(f,e,e.scopeId,u,l),h){for(let e in h)"value"===e||$(e)||o(f,e,null,h[e],s,l);"value"in h&&o(f,"value",null,h.value,s),(p=h.onVnodeBeforeMount)&&rC(p,l,e)}_&&t4(e,null,l,"beforeMount");let y=lV(r,m);y&&m.beforeEnter(f),i(f,t,n),((p=h&&h.onVnodeMounted)||y||_)&&lM(()=>{p&&rC(p,l,e),y&&m.enter(f),_&&t4(e,null,l,"mounted")},r)},I=(e,t,n,l,r)=>{if(n&&b(e,n),l)for(let t=0;t<l.length;t++)b(e,l[t]);if(r){let n=r.subTree;if(t===n||l0(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=r.vnode;I(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},F=(e,t,n,l,r,i,s,o,a=0)=>{for(let u=a;u<e.length;u++)C(null,e[u]=o?ry(e[u]):r_(e[u]),t,n,l,r,i,s,o)},V=(e,t,n,l,r,i,s)=>{let a;let u=t.el=e.el,{patchFlag:c,dynamicChildren:f,dirs:p}=t;c|=16&e.patchFlag;let h=e.props||m,g=t.props||m;if(n&&lF(n,!1),(a=g.onVnodeBeforeUpdate)&&rC(a,n,t,e),p&&t4(t,e,n,"beforeUpdate"),n&&lF(n,!0),(h.innerHTML&&null==g.innerHTML||h.textContent&&null==g.textContent)&&d(u,""),f?U(e.dynamicChildren,f,u,n,l,lD(t,r),i):s||X(e,t,u,null,n,l,lD(t,r),i,!1),c>0){if(16&c)j(u,h,g,n,r);else if(2&c&&h.class!==g.class&&o(u,"class",null,g.class,r),4&c&&o(u,"style",h.style,g.style,r),8&c){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let l=e[t],i=h[l],s=g[l];(s!==i||"value"===l)&&o(u,l,i,s,r,n)}}1&c&&e.children!==t.children&&d(u,t.children)}else s||null!=f||j(u,h,g,n,r);((a=g.onVnodeUpdated)||p)&&lM(()=>{a&&rC(a,n,t,e),p&&t4(t,e,n,"updated")},l)},U=(e,t,n,l,r,i,s)=>{for(let o=0;o<t.length;o++){let a=e[o],u=t[o],c=a.el&&(a.type===l5||!rc(a,u)||70&a.shapeFlag)?h(a.el):n;C(a,u,c,null,l,r,i,s,!0)}},j=(e,t,n,l,r)=>{if(t!==n){if(t!==m)for(let i in t)$(i)||i in n||o(e,i,t[i],null,r,l);for(let i in n){if($(i))continue;let s=n[i],a=t[i];s!==a&&"value"!==i&&o(e,i,a,s,r,l)}"value"in n&&o(e,"value",t.value,n.value,r)}},B=(e,t,n,l,r,s,o,a,u)=>{let f=t.el=e?e.el:c(""),p=t.anchor=e?e.anchor:c(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(a=a?a.concat(g):g),null==e?(i(f,n,l),i(p,n,l),F(t.children||[],n,p,r,s,o,a,u)):d>0&&64&d&&h&&e.dynamicChildren?(U(e.dynamicChildren,h,n,r,s,o,a),(null!=t.key||r&&t===r.subTree)&&lU(e,t,!0)):X(e,t,n,p,r,s,o,a,u)},H=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):W(t,n,l,r,i,s,a):z(e,t,a)},W=(e,t,n,l,r,i,s)=>{let o=e.component=function(e,t,n){let l=e.type,r=(t?t.appContext:e.appContext)||rx,i={uid:rw++,vnode:e,type:l,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new eg(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,l=!1){let r=l?lx:n.propsCache,i=r.get(t);if(i)return i;let s=t.props,o={},a=[],u=!1;if(!P(t)){let r=t=>{u=!0;let[l,r]=e(t,n,!0);x(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return L(t)&&r.set(t,_),_;if(T(s))for(let e=0;e<s.length;e++){let t=K(s[e]);lw(t)&&(o[t]=m)}else if(s)for(let e in s){let t=K(e);if(lw(t)){let n=s[e],l=o[t]=T(n)||P(n)?{type:n}:x({},n),r=l.type,i=!1,u=!0;if(T(r))for(let e=0;e<r.length;++e){let t=r[e],n=P(t)&&t.name;if("Boolean"===n){i=!0;break}"String"===n&&(u=!1)}else i=P(r)&&"Boolean"===r.name;l[0]=i,l[1]=u,(i||k(l,"default"))&&a.push(t)}}let c=[o,a];return L(t)&&r.set(t,c),c}(l,r),emitsOptions:function e(t,n,l=!1){let r=n.emitsCache,i=r.get(t);if(void 0!==i)return i;let s=t.emits,o={},a=!1;if(!P(t)){let r=t=>{let l=e(t,n,!0);l&&(a=!0,x(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(T(s)?s.forEach(e=>o[e]=null):x(o,s),L(t)&&r.set(t,o),o):(L(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:m,inheritAttrs:l.inheritAttrs,ctx:m,data:m,props:m,attrs:m,slots:m,refs:m,setupState:m,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=lq.bind(null,i),e.ce&&e.ce(i),i}(e,l,r);nF(e)&&(o.ctx.renderer=ec),function(e,t=!1,n=!1){t&&u(t);let{props:l,children:r}=e.vnode,i=rR(e);(function(e,t,n,l=!1){let r={},i=ly();for(let n in e.propsDefaults=Object.create(null),lS(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:ta(r):e.type.props?e.props=r:e.props=i,e.attrs=i})(e,l,i,t),lN(e,r,n),i&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,n7);let{setup:l}=n;if(l){eA();let n=e.setupContext=l.length>1?rI(e):null,r=rT(e),i=tF(l,e,0,[e.props,n]),s=D(i);if(eR(),r(),(s||e.sp)&&!nL(e)&&nS(e),s){if(i.then(rA,rA),t)return i.then(n=>{rN(e,n,t)}).catch(t=>{tU(t,e,0)});e.asyncDep=i}else rN(e,i,t)}else rP(e,t)}(e,t),t&&u(!1)}(o,!1,s),o.asyncDep?(r&&r.registerDep(o,G,s),e.el||E(null,o.subTree=rh(l7),t,n)):G(o,e,t,n,r,i,s)},z=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||lY(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?lY(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(s[n]!==l[n]&&!lG(u,n))return!0}}return!1}(e,t,n)){if(l.asyncDep&&!l.asyncResolved){J(l,t,n);return}l.next=t,l.update()}else t.el=e.el,l.vnode=t},G=(e,t,n,l,i,s,o)=>{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=c.el,J(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;lF(e,!1),n?(n.el=c.el,J(e,n,o)):n=c,l&&Z(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&rC(t,u,n,c),lF(e,!0);let p=lJ(e),d=e.subTree;e.subTree=p,C(d,p,h(d.el),eo(d),e,i,s),n.el=p.el,null===f&&lQ(e,p.el),r&&lM(r,i),(t=n.props&&n.props.onVnodeUpdated)&&lM(()=>rC(t,u,n,c),i)}else{let o;let{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=nL(t);if(lF(e,!1),c&&Z(c),!g&&(o=u&&u.onVnodeBeforeMount)&&rC(o,p,t),lF(e,!0),a&&r){let t=()=>{e.subTree=lJ(e),r(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&d.ce._injectChildStyle(h);let r=e.subTree=lJ(e);C(null,r,n,l,e,i,s),t.el=r.el}if(f&&lM(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;lM(()=>rC(o,p,e),i)}(256&t.shapeFlag||p&&nL(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&lM(e.a,i),e.isMounted=!0,t=n=l=null}};e.scope.on();let u=e.effect=new em(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>tG(f),lF(e,!0),c()},J=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=tg(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l<n.length;l++){let s=n[l];if(lG(e.emitsOptions,s))continue;let c=t[s];if(a){if(k(i,s))c!==i[s]&&(i[s]=c,u=!0);else{let t=K(s);r[t]=lC(a,o,t,c,e,!1)}}else c!==i[s]&&(i[s]=c,u=!0)}}}else{let l;for(let s in lS(e,t,r,i)&&(u=!0),o)t&&(k(t,s)||(l=q(s))!==s&&k(t,l))||(a?n&&(void 0!==n[s]||void 0!==n[l])&&(r[s]=lC(a,o,s,void 0,e,!0)):delete r[s]);if(i!==o)for(let e in i)t&&k(t,e)||(delete i[e],u=!0)}u&&eU(e.attrs,"set","")}(e,t.props,l,n),lP(e,t.children,n),eA(),tZ(e),eR()},X=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,c=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p){Q(u,f,n,l,r,i,s,o,a);return}if(256&p){Y(u,f,n,l,r,i,s,o,a);return}}8&h?(16&c&&es(u,r,i),f!==u&&d(n,f)):16&c?16&h?Q(u,f,n,l,r,i,s,o,a):es(u,r,i,!0):(8&c&&d(n,""),16&h&&F(f,n,l,r,i,s,o,a))},Y=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||_,t=t||_;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;u<p;u++){let l=t[u]=a?ry(t[u]):r_(t[u]);C(e[u],l,n,null,r,i,s,o,a)}c>f?es(e,r,i,!0,!1,p):F(t,n,l,r,i,s,o,a,p)},Q=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?ry(t[u]):r_(t[u]);if(rc(l,c))C(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?ry(t[p]):r_(t[p]);if(rc(l,u))C(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=e<c?t[e].el:l;for(;u<=p;)C(null,t[u]=a?ry(t[u]):r_(t[u]),n,f,r,i,s,o,a),u++}}else if(u>p)for(;u<=f;)en(e[u],r,i,!0),u++;else{let d;let h=u,g=u,m=new Map;for(u=g;u<=p;u++){let e=t[u]=a?ry(t[u]):r_(t[u]);null!=e.key&&m.set(e.key,u)}let y=0,b=p-g+1,S=!1,x=0,w=Array(b);for(u=0;u<b;u++)w[u]=0;for(u=h;u<=f;u++){let l;let c=e[u];if(y>=b){en(c,r,i,!0);continue}if(null!=c.key)l=m.get(c.key);else for(d=g;d<=p;d++)if(0===w[d-g]&&rc(c,t[d])){l=d;break}void 0===l?en(c,r,i,!0):(w[l-g]=u+1,l>=x?x=l:S=!0,C(c,t[l],n,null,r,i,s,o,a),y++)}let E=S?function(e){let t,n,l,r,i;let s=e.slice(),o=[0],a=e.length;for(t=0;t<a;t++){let a=e[t];if(0!==a){if(e[n=o[o.length-1]]<a){s[t]=n,o.push(t);continue}for(l=0,r=o.length-1;l<r;)e[o[i=l+r>>1]]<a?l=i+1:r=i;a<e[o[l]]&&(l>0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(w):_;for(d=E.length-1,u=b-1;u>=0;u--){let e=g+u,f=t[e],p=e+1<c?t[e+1].el:l;0===w[u]?C(null,f,n,p,r,i,s,o,a):S&&(d<0||u!==E[d]?ee(f,n,p,2):d--)}}},ee=(e,t,n,l,r=null)=>{let{el:s,type:o,transition:a,children:u,shapeFlag:c}=e;if(6&c){ee(e.component.subTree,t,n,l);return}if(128&c){e.suspense.move(t,n,l);return}if(64&c){o.move(e,t,n,ec);return}if(o===l5){i(s,t,n);for(let e=0;e<u.length;e++)ee(u[e],t,n,l);i(e.anchor,t,n);return}if(o===re){R(e,t,n);return}if(2!==l&&1&c&&a){if(0===l)a.beforeEnter(s),i(s,t,n),lM(()=>a.enter(s),r);else{let{leave:e,delayLeave:l,afterLeave:r}=a,o=()=>i(s,t,n),u=()=>{e(s,()=>{o(),r&&r()})};l?l(s,o,u):u()}}else i(s,t,n)},en=(e,t,n,l=!1,r=!1)=>{let i;let{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&nC(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&f){t.ctx.deactivate(e);return}let g=1&f&&d,m=!nL(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&rC(i,t,e),6&f)ei(e.component,n,l);else{if(128&f){e.suspense.unmount(n,l);return}g&&t4(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,ec,l):c&&!c.hasOnce&&(s!==l5||p>0&&64&p)?es(c,t,n,!1,!0):(s===l5&&384&p||!r&&16&f)&&es(u,t,n),l&&el(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&lM(()=>{i&&rC(i,t,e),g&&t4(e,null,t,"unmounted")},n)},el=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===l5){er(n,l);return}if(t===re){O(e);return}let i=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,s=()=>t(n,i);l?l(e.el,i,s):s()}else i()},er=(e,t)=>{let n;for(;e!==t;)n=g(e),s(e),e=n;s(t)},ei=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u}=e;lj(a),lj(u),l&&Z(l),r.stop(),i&&(i.flags|=8,en(s,e,t,n)),o&&lM(o,t),lM(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},es=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s<e.length;s++)en(e[s],t,n,l,r)},eo=e=>{if(6&e.shapeFlag)return eo(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=g(e.anchor||e.el),n=t&&t[t8];return n?g(n):t},ea=!1,eu=(e,t,n)=>{null==e?t._vnode&&en(t._vnode,null,null,!0):C(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ea||(ea=!0,tZ(),tY(),ea=!1)},ec={p:C,um:en,m:ee,r:el,mt:W,mc:F,pc:X,pbc:U,n:eo,o:e};return t&&([l,r]=t(ec)),{render:eu,hydrate:l,createApp:(n=l,function(e,t=null){P(e)||(e=x({},e)),null==t||L(t)||(t=null);let l=ld(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:lh++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:rj,get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&P(e.install)?(r.add(e),e.install(o,...t)):P(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||rh(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):eu(u,r,a),s=!0,o._container=r,r.__vue_app__=o,rL(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tV(i,o._instance,16),eu(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=lg;lg=o;try{return e()}finally{lg=t}}};return o})}}function lD({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function lF({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function lV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lU(e,t,n=!1){let l=e.children,r=t.children;if(T(l)&&T(r))for(let e=0;e<l.length;e++){let t=l[e],i=r[e];!(1&i.shapeFlag)||i.dynamicChildren||((i.patchFlag<=0||32===i.patchFlag)&&((i=r[e]=ry(r[e])).el=t.el),n||-2===i.patchFlag||lU(t,i)),i.type===l9&&(i.el=t.el)}}function lj(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}let lB=Symbol.for("v-scx");function l$(e,t){return lH(e,null,{flush:"sync"})}function lH(e,t,n=m){let{immediate:l,deep:i,flush:s,once:o}=n,a=x({},n),u=rE;a.call=(e,t,n)=>tV(e,u,t,n);let c=!1;return"post"===s?a.scheduler=e=>{lM(e,u&&u.suspense)}:"sync"!==s&&(c=!0,a.scheduler=(e,t)=>{t?e():tG(e)}),a.augmentJob=e=>{t&&(e.flags|=4),c&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))},function(e,t,n=m){let l,i,s,o;let{immediate:a,deep:u,once:c,scheduler:f,augmentJob:p,call:h}=n,g=e=>u?e:td(e)||!1===u||0===u?tD(e,1):tD(e),_=!1,b=!1;if(ty(e)?(i=()=>e.value,_=td(e)):tf(e)?(i=()=>g(e),_=!0):T(e)?(b=!0,_=e.some(e=>tf(e)||td(e)),i=()=>e.map(e=>ty(e)?e.value:tf(e)?g(e):P(e)?h?h(e,2):e():void 0)):i=P(e)?t?h?()=>h(e,2):e:()=>{if(s){eA();try{s()}finally{eR()}}let t=d;d=l;try{return h?h(e,3,[o]):e(o)}finally{d=t}}:y,t&&u){let e=i,t=!0===u?1/0:u;i=()=>tD(e(),t)}let S=r,C=()=>{l.stop(),S&&S.active&&w(S.effects,l)};if(c&&t){let e=t;t=(...t)=>{e(...t),C()}}let x=b?Array(e.length).fill(tM):tM,E=e=>{if(1&l.flags&&(l.dirty||e)){if(t){let e=l.run();if(u||_||(b?e.some((e,t)=>X(e,x[t])):X(e,x))){s&&s();let n=d;d=l;try{let n=[e,x===tM?void 0:b&&x[0]===tM?[]:x,o];h?h(t,3,n):t(...n),x=e}finally{d=n}}}else l.run()}};return p&&p(E),(l=new em(i)).scheduler=f?()=>f(E,!1):E,o=e=>tL(e,!1,l),s=l.onStop=()=>{let e=tI.get(l);if(e){if(h)h(e,4);else for(let t of e)t();tI.delete(l)}},t?a?E(!0):x=l.run():f?f(E.bind(null,!0),!0):l.run(),C.pause=l.pause.bind(l),C.resume=l.resume.bind(l),C.stop=C,C}(e,t,a)}function lW(e,t,n){let l;let r=this.proxy,i=M(e)?e.includes(".")?lK(r,e):()=>r[e]:e.bind(r,r);P(t)?l=t:(l=t.handler,n=t);let s=rT(this),o=lH(i,l.bind(r),n);return s(),o}function lK(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}let lz=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${K(t)}Modifiers`]||e[`${q(t)}Modifiers`];function lq(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||m,i=n,s=t.startsWith("update:"),o=s&&lz(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>M(e)?e.trim():e)),o.number&&(i=n.map(Q)));let a=r[l=J(t)]||r[l=J(K(t))];!a&&s&&(a=r[l=J(q(t))]),a&&tV(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tV(u,e,6,i)}}function lG(e,t){return!!(e&&S(t))&&(k(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||k(e,q(t))||k(e,t))}function lJ(e){let t,n;let{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,y=t2(e);try{if(4&r.shapeFlag){let e=s||i;t=r_(f.call(e,e,p,d,g,h,m)),n=u}else t=r_(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:lX(u)}catch(n){rt.length=0,tU(n,e,1),t=rh(l7)}let b=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=b;e.length&&7&t&&(o&&e.some(C)&&(n=lZ(n,o)),b=rv(b,n,!1,!0))}return r.dirs&&((b=rv(b,null,!1,!0)).dirs=b.dirs?b.dirs.concat(r.dirs):r.dirs),r.transition&&n_(b,r.transition),t=b,t2(y),t}let lX=e=>{let t;for(let n in e)("class"===n||"style"===n||S(n))&&((t||(t={}))[n]=e[n]);return t},lZ=(e,t)=>{let n={};for(let l in e)C(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function lY(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;r<l.length;r++){let i=l[r];if(t[i]!==e[i]&&!lG(n,i))return!0}return!1}function lQ({vnode:e,parent:t},n){for(;t;){let l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.el=e.el),l===e)(e=t.vnode).el=n,t=t.parent;else break}}let l0=e=>e.__isSuspense,l1=0;function l2(e,t){let n=e.props&&e.props[t];P(n)&&n()}function l6(e,t,n,l,r,i,s,o,a,u,c=!1){let f;let{p:p,m:d,um:h,n:g,o:{parentNode:m,remove:_}}=u,y=function(e){let t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(f=t.pendingId,t.deps++);let b=e.props?ee(e.props.timeout):void 0,S=i,C={vnode:e,parent:t,parentComponent:n,namespace:s,container:l,hiddenContainer:r,deps:0,pendingId:l1++,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:l,activeBranch:r,pendingBranch:s,pendingId:o,effects:a,parentComponent:u,container:c}=C,p=!1;C.isHydrating?C.isHydrating=!1:e||((p=r&&s.transition&&"out-in"===s.transition.mode)&&(r.transition.afterLeave=()=>{o===C.pendingId&&(d(s,c,i===S?g(r):i,0),tX(a))}),r&&(m(r.el)===c&&(i=g(r)),h(r,u,C,!0)),p||d(s,c,i,0)),l3(C,s),C.pendingBranch=null,C.isInFallback=!1;let _=C.parent,b=!1;for(;_;){if(_.pendingBranch){_.effects.push(...a),b=!0;break}_=_.parent}b||p||tX(a),C.effects=[],y&&t&&t.pendingBranch&&f===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),l2(l,"onResolve")},fallback(e){if(!C.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:l,container:r,namespace:i}=C;l2(t,"onFallback");let s=g(n),u=()=>{C.isInFallback&&(p(null,e,r,s,l,null,i,o,a),l3(C,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),C.isInFallback=!0,h(n,l,null,!0),c||u()},move(e,t,n){C.activeBranch&&d(C.activeBranch,e,t,n),C.container=e},next:()=>C.activeBranch&&g(C.activeBranch),registerDep(e,t,n){let l=!!C.pendingBranch;l&&C.deps++;let r=e.vnode.el;e.asyncDep.catch(t=>{tU(t,e,0)}).then(i=>{if(e.isUnmounted||C.isUnmounted||C.pendingId!==e.suspenseId)return;e.asyncResolved=!0;let{vnode:o}=e;rN(e,i,!1),r&&(o.el=r);let a=!r&&e.subTree.el;t(e,o,m(r||e.subTree.el),r?null:g(e.subTree),C,s,n),a&&_(a),lQ(e,o.el),l&&0==--C.deps&&C.resolve()})},unmount(e,t){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,e,t),C.pendingBranch&&h(C.pendingBranch,n,e,t)}};return C}function l4(e){let t;if(P(e)){let n=ri&&e._c;n&&(e._d=!1,rl()),e=e(),n&&(e._d=!0,t=rn,rr())}return T(e)&&(e=function(e,t=!0){let n;for(let t=0;t<e.length;t++){let l=e[t];if(!ru(l))return;if(l.type!==l7||"v-if"===l.children){if(n)return;n=l}}return n}(e)),e=r_(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function l8(e,t){t&&t.pendingBranch?T(e)?t.effects.push(...e):t.effects.push(e):tX(e)}function l3(e,t){e.activeBranch=t;let{vnode:n,parentComponent:l}=e,r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,l&&l.subTree===n&&(l.vnode.el=r,lQ(l,r))}let l5=Symbol.for("v-fgt"),l9=Symbol.for("v-txt"),l7=Symbol.for("v-cmt"),re=Symbol.for("v-stc"),rt=[],rn=null;function rl(e=!1){rt.push(rn=e?null:[])}function rr(){rt.pop(),rn=rt[rt.length-1]||null}let ri=1;function rs(e,t=!1){ri+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function ro(e){return e.dynamicChildren=ri>0?rn||_:null,rr(),ri>0&&rn&&rn.push(e),e}function ra(e,t,n,l,r){return ro(rh(e,t,n,l,r,!0))}function ru(e){return!!e&&!0===e.__v_isVNode}function rc(e,t){return e.type===t.type&&e.key===t.key}let rf=({key:e})=>null!=e?e:null,rp=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?M(e)||ty(e)||P(e)?{i:t0,r:e,k:t,f:!!n}:e:null);function rd(e,t=null,n=null,l=0,r=null,i=e===l5?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rf(t),ref:t&&rp(t),scopeId:t1,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:t0};return o?(rb(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=M(n)?8:16),ri>0&&!s&&rn&&(a.patchFlag>0||6&i)&&32!==a.patchFlag&&rn.push(a),a}let rh=function(e,t=null,n=null,l=0,r=null,i=!1){var s;if(e&&e!==n6||(e=l7),ru(e)){let l=rv(e,t,!0);return n&&rb(l,n),ri>0&&!i&&rn&&(6&l.shapeFlag?rn[rn.indexOf(e)]=l:rn.push(l)),l.patchFlag=-2,l}if(P(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=rg(t);e&&!M(e)&&(t.class=eo(e)),L(n)&&(th(n)&&!T(n)&&(n=x({},n)),t.style=el(n))}let o=M(e)?1:l0(e)?128:t3(e)?64:L(e)?4:P(e)?2:0;return rd(e,t,n,l,r,o,i,!0)};function rg(e){return e?th(e)||lb(e)?x({},e):e:null}function rv(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?rS(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&rf(u),ref:t&&t.ref?n&&i?T(i)?i.concat(rp(t)):[i,rp(t)]:rp(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==l5?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rv(e.ssContent),ssFallback:e.ssFallback&&rv(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&n_(c,a.clone(c)),c}function rm(e=" ",t=0){return rh(l9,null,e,t)}function r_(e){return null==e||"boolean"==typeof e?rh(l7):T(e)?rh(l5,null,e.slice()):ru(e)?ry(e):rh(l9,null,String(e))}function ry(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:rv(e)}function rb(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(T(t))n=16;else if("object"==typeof t){if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),rb(e,n()),n._c&&(n._d=!0));return}{n=32;let l=t._;l||lb(t)?3===l&&t0&&(1===t0.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=t0}}else P(t)?(t={default:t,_ctx:t0},n=32):(t=String(t),64&l?(n=16,t=[rm(t)]):n=8);e.children=t,e.shapeFlag|=n}function rS(...e){let t={};for(let n=0;n<e.length;n++){let l=e[n];for(let e in l)if("class"===e)t.class!==l.class&&(t.class=eo([t.class,l.class]));else if("style"===e)t.style=el([t.style,l.style]);else if(S(e)){let n=t[e],r=l[e];r&&n!==r&&!(T(n)&&n.includes(r))&&(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=l[e])}return t}function rC(e,t,n,l=null){tV(e,t,7,[n,l])}let rx=ld(),rw=0,rE=null,rk=()=>rE||t0;a=e=>{rE=e},u=e=>{rO=e};let rT=e=>{let t=rE;return a(e),e.scope.on(),()=>{e.scope.off(),a(t)}},rA=()=>{rE&&rE.scope.off(),a(null)};function rR(e){return 4&e.vnode.shapeFlag}let rO=!1;function rN(e,t,n){P(t)?e.render=t:L(t)&&(e.setupState=tk(t)),rP(e,n)}function rP(e,t,n){let l=e.type;if(!e.render){if(!t&&c&&!l.render){let t=l.template||li(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,o=x(x({isCustomElement:n,delimiters:i},r),s);l.render=c(t,o)}}e.render=l.render||y,f&&f(e)}{let t=rT(e);eA();try{!function(e){let t=li(e),n=e.proxy,l=e.ctx;ll=!1,t.beforeCreate&&lr(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:h,activated:g,deactivated:m,beforeDestroy:_,beforeUnmount:b,destroyed:S,unmounted:C,render:x,renderTracked:w,renderTriggered:E,errorCaptured:k,serverPrefetch:A,expose:R,inheritAttrs:O,components:N,directives:I,filters:D}=t;if(u&&function(e,t,n=y){for(let n in T(e)&&(e=lu(e)),e){let l;let r=e[n];ty(l=L(r)?"default"in r?lm(r.from||n,r.default,!0):lm(r.from||n):lm(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];P(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);L(t)&&(e.data=to(t))}if(ll=!0,i)for(let e in i){let t=i[e],r=P(t)?t.bind(n,n):P(t.get)?t.get.bind(n,n):y,s=rF({get:r,set:!P(t)&&P(t.set)?t.set.bind(n):y});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?lK(l,r):()=>l[r];if(M(t)){let e=n[t];P(e)&&lH(i,e,void 0)}else if(P(t)){var s;s=t.bind(l),lH(i,s,void 0)}else if(L(t)){if(T(t))t.forEach(t=>e(t,n,l,r));else{let e=P(t.handler)?t.handler.bind(l):n[t.handler];P(e)&&lH(i,e,t)}}}(o[e],l,n,e);if(a){let e=P(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{lv(t,e[t])})}function F(e,t){T(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&lr(c,e,"c"),F(nz,f),F(nq,p),F(nG,d),F(nJ,h),F(nU,g),F(nj,m),F(n1,k),F(n0,w),F(nQ,E),F(nX,b),F(nZ,C),F(nY,A),T(R)){if(R.length){let t=e.exposed||(e.exposed={});R.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}x&&e.render===y&&(e.render=x),null!=O&&(e.inheritAttrs=O),N&&(e.components=N),I&&(e.directives=I)}(e)}finally{eR(),t()}}}let rM={get:(e,t)=>(eV(e,"get",""),e[t])};function rI(e){return{attrs:new Proxy(e.attrs,rM),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function rL(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tk(tv(e.exposed)),{get:(t,n)=>n in t?t[n]:n in n5?n5[n](e):void 0,has:(e,t)=>t in e||t in n5})):e.proxy}function rD(e,t=!0){return P(e)?e.displayName||e.name:e.name||t&&e.__name}let rF=(e,t)=>(function(e,t,n=!1){let l,r;return P(e)?l=e:(l=e.get,r=e.set),new tP(l,r,n)})(e,0,rO);function rV(e,t,n){let l=arguments.length;return 2!==l?(l>3?n=Array.prototype.slice.call(arguments,2):3===l&&ru(n)&&(n=[n]),rh(e,t,n)):!L(t)||T(t)?rh(e,null,t):ru(t)?rh(e,null,[t]):rh(e,t)}function rU(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(X(n[e],t[e]))return!1;return ri>0&&rn&&rn.push(e),!0}let rj="3.5.13",rB="undefined"!=typeof window&&window.trustedTypes;if(rB)try{h=rB.createPolicy("vue",{createHTML:e=>e})}catch(e){}let r$=h?e=>h.createHTML(e):e=>e,rH="undefined"!=typeof document?document:null,rW=rH&&rH.createElement("template"),rK="transition",rz="animation",rq=Symbol("_vtc"),rG={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rJ=x({},nc,rG),rX=((t=(e,{slots:t})=>rV(nd,rQ(e),t)).displayName="Transition",t.props=rJ,t),rZ=(e,t=[])=>{T(e)?e.forEach(e=>e(...t)):e&&e(...t)},rY=e=>!!e&&(T(e)?e.some(e=>e.length>1):e.length>1);function rQ(e){let t={};for(let n in e)n in rG||(t[n]=e[n]);if(!1===e.css)return t;let{name:n="v",type:l,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:u=s,appearToClass:c=o,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,h=function(e){if(null==e)return null;if(L(e))return[ee(e.enter),ee(e.leave)];{let t=ee(e);return[t,t]}}(r),g=h&&h[0],m=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=_,onAppear:E=y,onAppearCancelled:k=b}=t,T=(e,t,n,l)=>{e._enterCancelled=l,r1(e,t?c:o),r1(e,t?u:s),n&&n()},A=(e,t)=>{e._isLeaving=!1,r1(e,f),r1(e,d),r1(e,p),t&&t()},R=e=>(t,n)=>{let r=e?E:y,s=()=>T(t,e,n);rZ(r,[t,s]),r2(()=>{r1(t,e?a:i),r0(t,e?c:o),rY(r)||r4(t,l,g,s)})};return x(t,{onBeforeEnter(e){rZ(_,[e]),r0(e,i),r0(e,s)},onBeforeAppear(e){rZ(w,[e]),r0(e,a),r0(e,u)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>A(e,t);r0(e,f),e._enterCancelled?(r0(e,p),r9()):(r9(),r0(e,p)),r2(()=>{e._isLeaving&&(r1(e,f),r0(e,d),rY(S)||r4(e,l,m,n))}),rZ(S,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),rZ(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),rZ(k,[e])},onLeaveCancelled(e){A(e),rZ(C,[e])}})}function r0(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[rq]||(e[rq]=new Set)).add(t)}function r1(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[rq];n&&(n.delete(t),n.size||(e[rq]=void 0))}function r2(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let r6=0;function r4(e,t,n,l){let r=e._endId=++r6,i=()=>{r===e._endId&&l()};if(null!=n)return setTimeout(i,n);let{type:s,timeout:o,propCount:a}=r8(e,t);if(!s)return l();let u=s+"end",c=0,f=()=>{e.removeEventListener(u,p),i()},p=t=>{t.target===e&&++c>=a&&f()};setTimeout(()=>{c<a&&f()},o+1),e.addEventListener(u,p)}function r8(e,t){let n=window.getComputedStyle(e),l=e=>(n[e]||"").split(", "),r=l(`${rK}Delay`),i=l(`${rK}Duration`),s=r3(r,i),o=l(`${rz}Delay`),a=l(`${rz}Duration`),u=r3(o,a),c=null,f=0,p=0;t===rK?s>0&&(c=rK,f=s,p=i.length):t===rz?u>0&&(c=rz,f=u,p=a.length):p=(c=(f=Math.max(s,u))>0?s>u?rK:rz:null)?c===rK?i.length:a.length:0;let d=c===rK&&/\b(transform|all)(,|$)/.test(l(`${rK}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:d}}function r3(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>r5(t)+r5(e[n])))}function r5(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function r9(){return document.body.offsetHeight}let r7=Symbol("_vod"),ie=Symbol("_vsh");function it(e,t){e.style.display=t?e[r7]:"none",e[ie]=!t}let il=Symbol("");function ir(e,t){if(1===e.nodeType){let n=e.style,l="";for(let e in t)n.setProperty(`--${e}`,t[e]),l+=`--${e}: ${t[e]};`;n[il]=l}}let ii=/(^|;)\s*display\s*:/,is=/\s*!important$/;function io(e,t,n){if(T(n))n.forEach(n=>io(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=iu[t];if(n)return n;let l=K(t);if("filter"!==l&&l in e)return iu[t]=l;l=G(l);for(let n=0;n<ia.length;n++){let r=ia[n]+l;if(r in e)return iu[t]=r}return t}(e,t);is.test(n)?e.setProperty(q(l),n.replace(is,""),"important"):e[l]=n}}let ia=["Webkit","Moz","ms"],iu={},ic="http://www.w3.org/1999/xlink";function ip(e,t,n,l,r,i=ea(t)){l&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(ic,t.slice(6,t.length)):e.setAttributeNS(ic,t,n):null==n||i&&!(n||""===n)?e.removeAttribute(t):e.setAttribute(t,i?"":I(n)?String(n):n)}function id(e,t,n,l,r){if("innerHTML"===t||"textContent"===t){null!=n&&(e[t]="innerHTML"===t?r$(n):n);return}let i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){let l="OPTION"===i?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);l===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),e._value=n;return}let s=!1;if(""===n||null==n){let l=typeof e[t];if("boolean"===l){var o;n=!!(o=n)||""===o}else null==n&&"string"===l?(n="",s=!0):"number"===l&&(n=0,s=!0)}try{e[t]=n}catch(e){}s&&e.removeAttribute(r||t)}function ih(e,t,n,l){e.addEventListener(t,n,l)}let ig=Symbol("_vei"),iv=/(?:Once|Passive|Capture)$/,im=0,i_=Promise.resolve(),iy=()=>im||(i_.then(()=>im=0),im=Date.now()),ib=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),iS={};function iC(e,t,n){let l=nb(e,t);j(l)&&x(l,t);class r extends iw{constructor(e){super(l,e,n)}}return r.def=l,r}let ix="undefined"!=typeof HTMLElement?HTMLElement:class{};class iw extends ix{constructor(e,t={},n=i0){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==i0?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof iw){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,tq(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(e=>{for(let t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{let n;this._resolved=!0,this._pendingResolve=void 0;let{props:l,styles:r}=e;if(l&&!T(l))for(let e in l){let t=l[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=ee(this._props[e])),(n||(n=Object.create(null)))[K(e)]=!0)}this._numberProps=n,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)k(this,e)||Object.defineProperty(this,e,{get:()=>tw(t[e])})}_resolveProps(e){let{props:t}=e,n=T(t)?t:Object.keys(t||{});for(let e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(K))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):iS,l=K(e);t&&this._numberProps&&this._numberProps[l]&&(n=ee(n)),this._setProp(l,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,l=!1){if(t!==this._props[e]&&(t===iS?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),l&&this._instance&&this._update(),n)){let n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(q(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(q(e),t+""):t||this.removeAttribute(q(e)),n&&n.observe(this,{attributes:!0})}}_update(){iQ(this._createVNode(),this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=rh(this._def,x(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,j(t[0])?x({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),q(e)!==e&&t(q(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let n=this._nonce;for(let t=e.length-1;t>=0;t--){let l=document.createElement("style");n&&l.setAttribute("nonce",n),l.textContent=e[t],this.shadowRoot.prepend(l)}}_parseSlots(){let e;let t=this._slots={};for(;e=this.firstChild;){let n=1===e.nodeType&&e.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(e),this.removeChild(e)}}_renderSlots(){let e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let l=e[n],r=l.getAttribute("name")||"default",i=this._slots[r],s=l.parentNode;if(i)for(let e of i){if(t&&1===e.nodeType){let n;let l=t+"-s",r=document.createTreeWalker(e,1);for(e.setAttribute(l,"");n=r.nextNode();)n.setAttribute(l,"")}s.insertBefore(e,l)}else for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}}_injectChildStyle(e){this._applyStyles(e.styles,e)}_removeChildStyle(e){}}function iE(e){let t=rk();return t&&t.ce||null}let ik=new WeakMap,iT=new WeakMap,iA=Symbol("_moveCb"),iR=Symbol("_enterCb"),iO=(n={name:"TransitionGroup",props:x({},rJ,{tag:String,moveClass:String}),setup(e,{slots:t}){let n,l;let r=rk(),i=na();return nJ(()=>{if(!n.length)return;let t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){let l=e.cloneNode(),r=e[rq];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&l.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&l.classList.add(e)),l.style.display="none";let i=1===t.nodeType?t:t.parentNode;i.appendChild(l);let{hasTransform:s}=r8(l);return i.removeChild(l),s}(n[0].el,r.vnode.el,t))return;n.forEach(iN),n.forEach(iP);let l=n.filter(iM);r9(),l.forEach(e=>{let n=e.el,l=n.style;r0(n,t),l.transform=l.webkitTransform=l.transitionDuration="";let r=n[iA]=e=>{(!e||e.target===n)&&(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener("transitionend",r),n[iA]=null,r1(n,t))};n.addEventListener("transitionend",r)})}),()=>{let s=tg(e),o=rQ(s),a=s.tag||l5;if(n=[],l)for(let e=0;e<l.length;e++){let t=l[e];t.el&&t.el instanceof Element&&(n.push(t),n_(t,ng(t,o,i,r)),ik.set(t,t.el.getBoundingClientRect()))}l=t.default?ny(t.default()):[];for(let e=0;e<l.length;e++){let t=l[e];null!=t.key&&n_(t,ng(t,o,i,r))}return rh(a,null,l)}}},delete n.props.mode,n);function iN(e){let t=e.el;t[iA]&&t[iA](),t[iR]&&t[iR]()}function iP(e){iT.set(e,e.el.getBoundingClientRect())}function iM(e){let t=ik.get(e),n=iT.get(e),l=t.left-n.left,r=t.top-n.top;if(l||r){let t=e.el.style;return t.transform=t.webkitTransform=`translate(${l}px,${r}px)`,t.transitionDuration="0s",e}}let iI=e=>{let t=e.props["onUpdate:modelValue"]||!1;return T(t)?e=>Z(t,e):t};function iL(e){e.target.composing=!0}function iD(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}let iF=Symbol("_assign"),iV={created(e,{modifiers:{lazy:t,trim:n,number:l}},r){e[iF]=iI(r);let i=l||r.props&&"number"===r.props.type;ih(e,t?"change":"input",t=>{if(t.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Q(l)),e[iF](l)}),n&&ih(e,"change",()=>{e.value=e.value.trim()}),t||(ih(e,"compositionstart",iL),ih(e,"compositionend",iD),ih(e,"change",iD))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:l,trim:r,number:i}},s){if(e[iF]=iI(s),e.composing)return;let o=(i||"number"===e.type)&&!/^0\d/.test(e.value)?Q(e.value):e.value,a=null==t?"":t;o===a||document.activeElement===e&&"range"!==e.type&&(l&&t===n||r&&e.value.trim()===a)||(e.value=a)}},iU={deep:!0,created(e,t,n){e[iF]=iI(n),ih(e,"change",()=>{let t=e._modelValue,n=iW(e),l=e.checked,r=e[iF];if(T(t)){let e=ec(t,n),i=-1!==e;if(l&&!i)r(t.concat(n));else if(!l&&i){let n=[...t];n.splice(e,1),r(n)}}else if(R(t)){let e=new Set(t);l?e.add(n):e.delete(n),r(e)}else r(iK(e,l))})},mounted:ij,beforeUpdate(e,t,n){e[iF]=iI(n),ij(e,t,n)}};function ij(e,{value:t,oldValue:n},l){let r;if(e._modelValue=t,T(t))r=ec(t,l.props.value)>-1;else if(R(t))r=t.has(l.props.value);else{if(t===n)return;r=eu(t,iK(e,!0))}e.checked!==r&&(e.checked=r)}let iB={created(e,{value:t},n){e.checked=eu(t,n.props.value),e[iF]=iI(n),ih(e,"change",()=>{e[iF](iW(e))})},beforeUpdate(e,{value:t,oldValue:n},l){e[iF]=iI(l),t!==n&&(e.checked=eu(t,l.props.value))}},i$={deep:!0,created(e,{value:t,modifiers:{number:n}},l){let r=R(t);ih(e,"change",()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Q(iW(e)):iW(e));e[iF](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,tq(()=>{e._assigning=!1})}),e[iF]=iI(l)},mounted(e,{value:t}){iH(e,t)},beforeUpdate(e,t,n){e[iF]=iI(n)},updated(e,{value:t}){e._assigning||iH(e,t)}};function iH(e,t){let n=e.multiple,l=T(t);if(!n||l||R(t)){for(let r=0,i=e.options.length;r<i;r++){let i=e.options[r],s=iW(i);if(n){if(l){let e=typeof s;"string"===e||"number"===e?i.selected=t.some(e=>String(e)===String(s)):i.selected=ec(t,s)>-1}else i.selected=t.has(s)}else if(eu(iW(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function iW(e){return"_value"in e?e._value:e.value}function iK(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}function iz(e,t,n,l,r){let i=function(e,t){switch(e){case"SELECT":return i$;case"TEXTAREA":return iV;default:switch(t){case"checkbox":return iU;case"radio":return iB;default:return iV}}}(e.tagName,n.props&&n.props.type)[r];i&&i(e,t,n,l)}let iq=["ctrl","shift","alt","meta"],iG={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>iq.some(n=>e[`${n}Key`]&&!t.includes(n))},iJ={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},iX=x({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;"class"===t?function(e,t,n){let l=e[rq];l&&(t=(t?[t,...l]:[...l]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,l,s):"style"===t?function(e,t,n){let l=e.style,r=M(n),i=!1;if(n&&!r){if(t){if(M(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&io(l,t,"")}else for(let e in t)null==n[e]&&io(l,e,"")}for(let e in n)"display"===e&&(i=!0),io(l,e,n[e])}else if(r){if(t!==n){let e=l[il];e&&(n+=";"+e),l.cssText=n,i=ii.test(n)}}else t&&e.removeAttribute("style");r7 in e&&(e[r7]=i?l.display:"",e[ie]&&(l.display="none"))}(e,n,l):S(t)?C(t)||function(e,t,n,l,r=null){let i=e[ig]||(e[ig]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(iv.test(e)){let n;for(t={};n=e.match(iv);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):q(e.slice(2)),t]}(t);l?ih(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tV(function(e,t){if(!T(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=iy(),n}(l,r),o):s&&(!function(e,t,n,l){e.removeEventListener(t,n,l)}(e,n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&ib(t)&&P(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(ib(t)&&M(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!M(l))?id(e,K(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),ip(e,t,l,s)):(id(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||ip(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?rH.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?rH.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?rH.createElement(e,{is:n}):rH.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>rH.createTextNode(e),createComment:e=>rH.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rH.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{rW.innerHTML=r$("svg"===l?`<svg>${e}</svg>`:"mathml"===l?`<math>${e}</math>`:e);let r=rW.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),iZ=!1;function iY(){return p=iZ?p:lI(iX),iZ=!0,p}let iQ=(...e)=>{(p||(p=lL(iX))).render(...e)},i0=(...e)=>{let t=(p||(p=lL(iX))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=i6(e);if(!l)return;let r=t._component;P(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,i2(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},i1=(...e)=>{let t=iY().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=i6(e);if(t)return n(t,!0,i2(t))},t};function i2(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function i6(e){return M(e)?document.querySelector(e):e}return e.BaseTransition=nd,e.BaseTransitionPropsValidators=nc,e.Comment=l7,e.DeprecationTypes=null,e.EffectScope=eg,e.ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},e.ErrorTypeStrings=null,e.Fragment=l5,e.KeepAlive={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=rk(),l=n.ctx,r=new Map,i=new Set,s=null,o=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:f}}}=l,p=f("div");function d(e){n$(e),c(e,n,o,!0)}function h(e){r.forEach((t,n)=>{let l=rD(t.type);l&&!e(l)&&g(n)})}function g(e){let t=r.get(e);!t||s&&rc(t,s)?s&&n$(s):d(t),r.delete(e),i.delete(e)}l.activate=(e,t,n,l,r)=>{let i=e.component;u(e,t,n,0,o),a(i.vnode,e,t,n,i,o,l,e.slotScopeIds,r),lM(()=>{i.isDeactivated=!1,i.a&&Z(i.a);let t=e.props&&e.props.onVnodeMounted;t&&rC(t,i.parent,e)},o)},l.deactivate=e=>{let t=e.component;lj(t.m),lj(t.a),u(e,p,null,1,o),lM(()=>{t.da&&Z(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&rC(n,t.parent,e),t.isDeactivated=!0},o)},lH(()=>[e.include,e.exclude],([e,t])=>{e&&h(t=>nV(e,t)),t&&h(e=>!nV(t,e))},{flush:"post",deep:!0});let m=null,_=()=>{null!=m&&(l0(n.subTree.type)?lM(()=>{r.set(m,nH(n.subTree))},n.subTree.suspense):r.set(m,nH(n.subTree)))};return nq(_),nJ(_),nX(()=>{r.forEach(e=>{let{subTree:t,suspense:l}=n,r=nH(t);if(e.type===r.type&&e.key===r.key){n$(r);let e=r.component.da;e&&lM(e,l);return}d(e)})}),()=>{if(m=null,!t.default)return s=null;let n=t.default(),l=n[0];if(n.length>1)return s=null,n;if(!ru(l)||!(4&l.shapeFlag)&&!(128&l.shapeFlag))return s=null,l;let o=nH(l);if(o.type===l7)return s=null,o;let a=o.type,u=rD(nL(o)?o.type.__asyncResolved||{}:a),{include:c,exclude:f,max:p}=e;if(c&&(!u||!nV(c,u))||f&&u&&nV(f,u))return o.shapeFlag&=-257,s=o,l;let d=null==o.key?a:o.key,h=r.get(d);return o.el&&(o=rv(o),128&l.shapeFlag&&(l.ssContent=o)),m=d,h?(o.el=h.el,o.component=h.component,o.transition&&n_(o,o.transition),o.shapeFlag|=512,i.delete(d),i.add(d)):(i.add(d),p&&i.size>parseInt(p,10)&&g(i.values().next().value)),o.shapeFlag|=256,s=o,l0(l.type)?l:o}}},e.ReactiveEffect=em,e.Static=re,e.Suspense={name:"Suspense",__isSuspense:!0,process(e,t,n,l,r,i,s,o,a,u){if(null==e)(function(e,t,n,l,r,i,s,o,a){let{p:u,o:{createElement:c}}=a,f=c("div"),p=e.suspense=l6(e,r,l,t,f,n,i,s,o,a);u(null,p.pendingBranch=e.ssContent,f,null,l,p,i,s),p.deps>0?(l2(e,"onPending"),l2(e,"onFallback"),u(null,e.ssFallback,t,n,l,null,i,s),l3(p,e.ssFallback)):p.resolve(!1,!0)})(t,n,l,r,i,s,o,a,u);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}(function(e,t,n,l,r,i,s,o,{p:a,um:u,o:{createElement:c}}){let f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;let p=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:_}=f;if(g)f.pendingBranch=p,rc(p,g)?(a(g,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():m&&!_&&(a(h,d,n,l,r,null,i,s,o),l3(f,d))):(f.pendingId=l1++,_?(f.isHydrating=!1,f.activeBranch=g):u(g,r,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),m?(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0?f.resolve():(a(h,d,n,l,r,null,i,s,o),l3(f,d))):h&&rc(p,h)?(a(h,p,n,l,r,f,i,s,o),f.resolve(!0)):(a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0&&f.resolve()));else if(h&&rc(p,h))a(h,p,n,l,r,f,i,s,o),l3(f,p);else if(l2(t,"onPending"),f.pendingBranch=p,512&p.shapeFlag?f.pendingId=p.component.suspenseId:f.pendingId=l1++,a(null,p,f.hiddenContainer,null,r,f,i,s,o),f.deps<=0)f.resolve();else{let{timeout:e,pendingId:t}=f;e>0?setTimeout(()=>{f.pendingId===t&&f.fallback(d)},e):0===e&&f.fallback(d)}})(e,t,n,l,r,s,o,a,u)}},hydrate:function(e,t,n,l,r,i,s,o,a){let u=t.suspense=l6(t,l,n,e.parentNode,document.createElement("div"),null,r,i,s,o,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,i,s);return 0===u.deps&&u.resolve(!1,!0),c},normalize:function(e){let{shapeFlag:t,children:n}=e,l=32&t;e.ssContent=l4(l?n.default:n),e.ssFallback=l?l4(n.fallback):rh(l7)}},e.Teleport=nn,e.Text=l9,e.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},e.Transition=rX,e.TransitionGroup=iO,e.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},e.VueElement=iw,e.assertNumber=function(e,t){},e.callWithAsyncErrorHandling=tV,e.callWithErrorHandling=tF,e.camelize=K,e.capitalize=G,e.cloneVNode=rv,e.compatUtils=null,e.computed=rF,e.createApp=i0,e.createBlock=ra,e.createCommentVNode=function(e="",t=!1){return t?(rl(),ra(l7,null,e)):rh(l7,null,e)},e.createElementBlock=function(e,t,n,l,r,i){return ro(rd(e,t,n,l,r,i,!0))},e.createElementVNode=rd,e.createHydrationRenderer=lI,e.createPropsRestProxy=function(e,t){let n={};for(let l in e)t.includes(l)||Object.defineProperty(n,l,{enumerable:!0,get:()=>e[l]});return n},e.createRenderer=function(e){return lL(e)},e.createSSRApp=i1,e.createSlots=function(e,t){for(let n=0;n<t.length;n++){let l=t[n];if(T(l))for(let t=0;t<l.length;t++)e[l[t].name]=l[t].fn;else l&&(e[l.name]=l.key?(...e)=>{let t=l.fn(...e);return t&&(t.key=l.key),t}:l.fn)}return e},e.createStaticVNode=function(e,t){let n=rh(re,null,e);return n.staticCount=t,n},e.createTextVNode=rm,e.createVNode=rh,e.customRef=tA,e.defineAsyncComponent=function(e){let t;P(e)&&(e={loader:e});let{loader:n,loadingComponent:l,errorComponent:r,delay:i=200,hydrate:s,timeout:o,suspensible:a=!0,onError:u}=e,c=null,f=0,p=()=>(f++,c=null,d()),d=()=>{let e;return c||(e=c=n().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),u)return new Promise((t,n)=>{u(e,()=>t(p()),()=>n(e),f+1)});throw e}).then(n=>e!==c&&c?c:(n&&(n.__esModule||"Module"===n[Symbol.toStringTag])&&(n=n.default),t=n,n)))};return nb({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(e,n,l){let r=s?()=>{let t=s(l,t=>(function(e,t){if(nA(e)&&"["===e.data){let n=1,l=e.nextSibling;for(;l;){if(1===l.nodeType){if(!1===t(l))break}else if(nA(l)){if("]"===l.data){if(0==--n)break}else"["===l.data&&n++}l=l.nextSibling}}else t(e)})(e,t));t&&(n.bum||(n.bum=[])).push(t)}:l;t?r():d().then(()=>!n.isUnmounted&&r())},get __asyncResolved(){return t},setup(){let e=rE;if(nS(e),t)return()=>nD(t,e);let n=t=>{c=null,tU(t,e,13,!r)};if(a&&e.suspense)return d().then(t=>()=>nD(t,e)).catch(e=>(n(e),()=>r?rh(r,{error:e}):null));let s=tb(!1),u=tb(),f=tb(!!i);return i&&setTimeout(()=>{f.value=!1},i),null!=o&&setTimeout(()=>{if(!s.value&&!u.value){let e=Error(`Async component timed out after ${o}ms.`);n(e),u.value=e}},o),d().then(()=>{s.value=!0,e.parent&&nF(e.parent.vnode)&&e.parent.update()}).catch(e=>{n(e),u.value=e}),()=>s.value&&t?nD(t,e):u.value&&r?rh(r,{error:u.value}):l&&!f.value?rh(l):void 0}})},e.defineComponent=nb,e.defineCustomElement=iC,e.defineEmits=function(){return null},e.defineExpose=function(e){},e.defineModel=function(){},e.defineOptions=function(e){},e.defineProps=function(){return null},e.defineSSRCustomElement=(e,t)=>iC(e,t,i1),e.defineSlots=function(){return null},e.devtools=void 0,e.effect=function(e,t){e.effect instanceof em&&(e=e.effect.fn);let n=new em(e);t&&x(n,t);try{n.run()}catch(e){throw n.stop(),e}let l=n.run.bind(n);return l.effect=n,l},e.effectScope=function(e){return new eg(e)},e.getCurrentInstance=rk,e.getCurrentScope=function(){return r},e.getCurrentWatcher=function(){return d},e.getTransitionRawChildren=ny,e.guardReactiveProps=rg,e.h=rV,e.handleError=tU,e.hasInjectionContext=function(){return!!(rE||t0||lg)},e.hydrate=(...e)=>{iY().hydrate(...e)},e.hydrateOnIdle=(e=1e4)=>t=>{let n=nM(t,{timeout:e});return()=>nI(n)},e.hydrateOnInteraction=(e=[])=>(t,n)=>{M(e)&&(e=[e]);let l=!1,r=e=>{l||(l=!0,i(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},i=()=>{n(t=>{for(let n of e)t.removeEventListener(n,r)})};return n(t=>{for(let n of e)t.addEventListener(n,r,{once:!0})}),i},e.hydrateOnMediaQuery=e=>t=>{if(e){let n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},e.hydrateOnVisible=e=>(t,n)=>{let l=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){l.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(function(e){let{top:t,left:n,bottom:l,right:r}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:s}=window;return(t>0&&t<i||l>0&&l<i)&&(n>0&&n<s||r>0&&r<s)}(e))return t(),l.disconnect(),!1;l.observe(e)}}),()=>l.disconnect()},e.initCustomFormatter=function(){},e.initDirectivesForSSR=y,e.inject=lm,e.isMemoSame=rU,e.isProxy=th,e.isReactive=tf,e.isReadonly=tp,e.isRef=ty,e.isRuntimeOnly=()=>!c,e.isShallow=td,e.isVNode=ru,e.markRaw=tv,e.mergeDefaults=function(e,t){let n=ln(e);for(let e in t){if(e.startsWith("__skip"))continue;let l=n[e];l?T(l)||P(l)?l=n[e]={type:l,default:t[e]}:l.default=t[e]:null===l&&(l=n[e]={default:t[e]}),l&&t[`__skip_${e}`]&&(l.skipFactory=!0)}return n},e.mergeModels=function(e,t){return e&&t?T(e)&&T(t)?e.concat(t):x({},ln(e),ln(t)):e||t},e.mergeProps=rS,e.nextTick=tq,e.normalizeClass=eo,e.normalizeProps=function(e){if(!e)return null;let{class:t,style:n}=e;return t&&!M(t)&&(e.class=eo(t)),n&&(e.style=el(n)),e},e.normalizeStyle=el,e.onActivated=nU,e.onBeforeMount=nz,e.onBeforeUnmount=nX,e.onBeforeUpdate=nG,e.onDeactivated=nj,e.onErrorCaptured=n1,e.onMounted=nq,e.onRenderTracked=n0,e.onRenderTriggered=nQ,e.onScopeDispose=function(e,t=!1){r&&r.cleanups.push(e)},e.onServerPrefetch=nY,e.onUnmounted=nZ,e.onUpdated=nJ,e.onWatcherCleanup=tL,e.openBlock=rl,e.popScopeId=function(){t1=null},e.provide=lv,e.proxyRefs=tk,e.pushScopeId=function(e){t1=e},e.queuePostFlushCb=tX,e.reactive=to,e.readonly=tu,e.ref=tb,e.registerRuntimeCompiler=function(e){c=e,f=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,le))}},e.render=iQ,e.renderList=function(e,t,n,l){let r;let i=n&&n[l],s=T(e);if(s||M(e)){let n=s&&tf(e),l=!1;n&&(l=!td(e),e=eB(e)),r=Array(e.length);for(let n=0,s=e.length;n<s;n++)r[n]=t(l?tm(e[n]):e[n],n,void 0,i&&i[n])}else if("number"==typeof e){r=Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,i&&i[n])}else if(L(e)){if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,i&&i[n]));else{let n=Object.keys(e);r=Array(n.length);for(let l=0,s=n.length;l<s;l++){let s=n[l];r[l]=t(e[s],s,l,i&&i[l])}}}else r=[];return n&&(n[l]=r),r},e.renderSlot=function(e,t,n={},l,r){if(t0.ce||t0.parent&&nL(t0.parent)&&t0.parent.ce)return"default"!==t&&(n.name=t),rl(),ra(l5,null,[rh("slot",n,l&&l())],64);let i=e[t];i&&i._c&&(i._d=!1),rl();let s=i&&function e(t){return t.some(t=>!ru(t)||!!(t.type!==l7&&(t.type!==l5||e(t.children))))?t:null}(i(n)),o=n.key||s&&s.key,a=ra(l5,{key:(o&&!I(o)?o:`_${t}`)+(!s&&l?"_fb":"")},s||(l?l():[]),s&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a},e.resolveComponent=function(e,t){return n4(n2,e,!0,t)||e},e.resolveDirective=function(e){return n4("directives",e)},e.resolveDynamicComponent=function(e){return M(e)?n4(n2,e,!1)||e:e||n6},e.resolveFilter=null,e.resolveTransitionHooks=ng,e.setBlockTracking=rs,e.setDevtoolsHook=y,e.setTransitionHooks=n_,e.shallowReactive=ta,e.shallowReadonly=function(e){return tc(e,!0,e4,tn,ts)},e.shallowRef=tS,e.ssrContextKey=lB,e.ssrUtils=null,e.stop=function(e){e.effect.stop()},e.toDisplayString=ep,e.toHandlerKey=J,e.toHandlers=function(e,t){let n={};for(let l in e)n[t&&/[A-Z]/.test(l)?`on:${l}`:J(l)]=e[l];return n},e.toRaw=tg,e.toRef=function(e,t,n){return ty(e)?e:P(e)?new tO(e):L(e)&&arguments.length>1?tN(e,t,n):tb(e)},e.toRefs=function(e){let t=T(e)?Array(e.length):{};for(let n in e)t[n]=tN(e,n);return t},e.toValue=function(e){return P(e)?e():tw(e)},e.transformVNodeArgs=function(e){},e.triggerRef=function(e){e.dep&&e.dep.trigger()},e.unref=tw,e.useAttrs=function(){return lt().attrs},e.useCssModule=function(e="$style"){return m},e.useCssVars=function(e){let t=rk();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>ir(e,n))},l=()=>{let l=e(t.proxy);t.ce?ir(t.ce,l):function e(t,n){if(128&t.shapeFlag){let l=t.suspense;t=l.activeBranch,l.pendingBranch&&!l.isHydrating&&l.effects.push(()=>{e(l.activeBranch,n)})}for(;t.component;)t=t.component.subTree;if(1&t.shapeFlag&&t.el)ir(t.el,n);else if(t.type===l5)t.children.forEach(t=>e(t,n));else if(t.type===re){let{el:e,anchor:l}=t;for(;e&&(ir(e,n),e!==l);)e=e.nextSibling}}(t.subTree,l),n(l)};nG(()=>{tX(l)}),nq(()=>{lH(l,y,{flush:"post"});let e=new MutationObserver(l);e.observe(t.subTree.el.parentNode,{childList:!0}),nZ(()=>e.disconnect())})},e.useHost=iE,e.useId=function(){let e=rk();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""},e.useModel=function(e,t,n=m){let l=rk(),r=K(t),i=q(t),s=lz(e,r),o=tA((s,o)=>{let a,u;let c=m;return l$(()=>{let t=e[r];X(a,t)&&(a=t,o())}),{get:()=>(s(),n.get?n.get(a):a),set(e){let s=n.set?n.set(e):e;if(!X(s,a)&&!(c!==m&&X(e,c)))return;let f=l.vnode.props;f&&(t in f||r in f||i in f)&&(`onUpdate:${t}`in f||`onUpdate:${r}`in f||`onUpdate:${i}`in f)||(a=e,o()),l.emit(`update:${t}`,s),X(e,s)&&X(e,c)&&!X(s,u)&&o(),c=e,u=s}}});return o[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?s||m:o,done:!1}:{done:!0}}},o},e.useSSRContext=()=>{},e.useShadowRoot=function(){let e=iE();return e&&e.shadowRoot},e.useSlots=function(){return lt().slots},e.useTemplateRef=function(e){let t=rk(),n=tS(null);return t&&Object.defineProperty(t.refs===m?t.refs={}:t.refs,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e}),n},e.useTransitionState=na,e.vModelCheckbox=iU,e.vModelDynamic={created(e,t,n){iz(e,t,n,null,"created")},mounted(e,t,n){iz(e,t,n,null,"mounted")},beforeUpdate(e,t,n,l){iz(e,t,n,l,"beforeUpdate")},updated(e,t,n,l){iz(e,t,n,l,"updated")}},e.vModelRadio=iB,e.vModelSelect=i$,e.vModelText=iV,e.vShow={beforeMount(e,{value:t},{transition:n}){e[r7]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):it(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:l}){!t!=!n&&(l?t?(l.beforeEnter(e),it(e,!0),l.enter(e)):l.leave(e,()=>{it(e,!1)}):it(e,t))},beforeUnmount(e,{value:t}){it(e,t)}},e.version=rj,e.warn=y,e.watch=function(e,t,n){return lH(e,t,n)},e.watchEffect=function(e,t){return lH(e,null,t)},e.watchPostEffect=function(e,t){return lH(e,null,{flush:"post"})},e.watchSyncEffect=l$,e.withAsyncContext=function(e){let t=rk(),n=e();return rA(),D(n)&&(n=n.catch(e=>{throw rT(t),e})),[n,()=>rT(t)]},e.withCtx=t6,e.withDefaults=function(e,t){return null},e.withDirectives=function(e,t){if(null===t0)return e;let n=rL(t0),l=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,i,s,o=m]=t[e];r&&(P(r)&&(r={mounted:r,updated:r}),r.deep&&tD(i),l.push({dir:r,instance:n,value:i,oldValue:void 0,arg:s,modifiers:o}))}return e},e.withKeys=(e,t)=>{let n=e._withKeys||(e._withKeys={}),l=t.join(".");return n[l]||(n[l]=n=>{if(!("key"in n))return;let l=q(n.key);if(t.some(e=>e===l||iJ[e]===l))return e(n)})},e.withMemo=function(e,t,n,l){let r=n[l];if(r&&rU(r,e))return r;let i=t();return i.memo=e.slice(),i.cacheIndex=l,n[l]=i},e.withModifiers=(e,t)=>{let n=e._withMods||(e._withMods={}),l=t.join(".");return n[l]||(n[l]=(n,...l)=>{for(let e=0;e<t.length;e++){let l=iG[t[e]];if(l&&l(n,t))return}return e(n,...l)})},e.withScopeId=e=>t6,e}({}); diff --git a/seller_1/node_modules/@vue/runtime-dom/index.js b/seller_1/node_modules/@vue/runtime-dom/index.js new file mode 100644 index 0000000..cdc29b2 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/runtime-dom.cjs.prod.js') +} else { + module.exports = require('./dist/runtime-dom.cjs.js') +} diff --git a/seller_1/node_modules/@vue/runtime-dom/package.json b/seller_1/node_modules/@vue/runtime-dom/package.json new file mode 100644 index 0000000..0448547 --- /dev/null +++ b/seller_1/node_modules/@vue/runtime-dom/package.json @@ -0,0 +1,60 @@ +{ + "name": "@vue/runtime-dom", + "version": "3.5.13", + "description": "@vue/runtime-dom", + "main": "index.js", + "module": "dist/runtime-dom.esm-bundler.js", + "types": "dist/runtime-dom.d.ts", + "unpkg": "dist/runtime-dom.global.js", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/runtime-dom.d.ts", + "node": { + "production": "./dist/runtime-dom.cjs.prod.js", + "development": "./dist/runtime-dom.cjs.js", + "default": "./index.js" + }, + "module": "./dist/runtime-dom.esm-bundler.js", + "import": "./dist/runtime-dom.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "sideEffects": false, + "buildOptions": { + "name": "VueRuntimeDOM", + "formats": [ + "esm-bundler", + "esm-browser", + "cjs", + "global" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/runtime-dom" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme", + "dependencies": { + "csstype": "^3.1.3", + "@vue/shared": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/reactivity": "3.5.13" + }, + "devDependencies": { + "@types/trusted-types": "^2.0.7" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/server-renderer/LICENSE b/seller_1/node_modules/@vue/server-renderer/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/server-renderer/README.md b/seller_1/node_modules/@vue/server-renderer/README.md new file mode 100644 index 0000000..55323e4 --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/README.md @@ -0,0 +1,178 @@ +# @vue/server-renderer + +**Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/server-renderer`. This means you no longer need to explicitly install this package and ensure its version match that of `vue`'s. Just use the `vue/server-renderer` deep import instead.** + +## Basic API + +### `renderToString` + +**Signature** + +```ts +function renderToString( + input: App | VNode, + context?: SSRContext, +): Promise<string> +``` + +**Usage** + +```js +const { createSSRApp } = require('vue') +const { renderToString } = require('@vue/server-renderer') + +const app = createSSRApp({ + data: () => ({ msg: 'hello' }), + template: `<div>{{ msg }}</div>`, +}) + +;(async () => { + const html = await renderToString(app) + console.log(html) +})() +``` + +### Handling Teleports + +If the rendered app contains teleports, the teleported content will not be part of the rendered string. Instead, they are exposed under the `teleports` property of the ssr context object: + +```js +const ctx = {} +const html = await renderToString(app, ctx) + +console.log(ctx.teleports) // { '#teleported': 'teleported content' } +``` + +## Streaming API + +### `renderToNodeStream` + +Renders input as a [Node.js Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable). + +**Signature** + +```ts +function renderToNodeStream(input: App | VNode, context?: SSRContext): Readable +``` + +**Usage** + +```js +// inside a Node.js http handler +renderToNodeStream(app).pipe(res) +``` + +**Note:** This method is not supported in the ESM build of `@vue/server-renderer`, which is decoupled from Node.js environments. Use `pipeToNodeWritable` instead. + +### `pipeToNodeWritable` + +Render and pipe to an existing [Node.js Writable stream](https://nodejs.org/api/stream.html#stream_writable_streams) instance. + +**Signature** + +```ts +function pipeToNodeWritable( + input: App | VNode, + context: SSRContext = {}, + writable: Writable, +): void +``` + +**Usage** + +```js +// inside a Node.js http handler +pipeToNodeWritable(app, {}, res) +``` + +### `renderToWebStream` + +Renders input as a [Web ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API). + +**Signature** + +```ts +function renderToWebStream( + input: App | VNode, + context?: SSRContext, +): ReadableStream +``` + +**Usage** + +```js +// inside an environment with ReadableStream support +return new Response(renderToWebStream(app)) +``` + +**Note:** in environments that do not expose `ReadableStream` constructor in the global scope, `pipeToWebWritable` should be used instead. + +### `pipeToWebWritable` + +Render and pipe to an existing [Web WritableStream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) instance. + +**Signature** + +```ts +function pipeToWebWritable( + input: App | VNode, + context: SSRContext = {}, + writable: WritableStream, +): void +``` + +**Usage** + +This is typically used in combination with [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream): + +```js +// TransformStream is available in environments such as CloudFlare workers. +// in Node.js, TransformStream needs to be explicitly imported from 'stream/web' +const { readable, writable } = new TransformStream() +pipeToWebWritable(app, {}, writable) + +return new Response(readable) +``` + +### `renderToSimpleStream` + +Renders input in streaming mode using a simple readable interface. + +**Signature** + +```ts +function renderToSimpleStream( + input: App | VNode, + context: SSRContext, + options: SimpleReadable, +): SimpleReadable + +interface SimpleReadable { + push(content: string | null): void + destroy(err: any): void +} +``` + +**Usage** + +```js +let res = '' + +renderToSimpleStream( + app, + {}, + { + push(chunk) { + if (chunk === null) { + // done + console(`render complete: ${res}`) + } else { + res += chunk + } + }, + destroy(err) { + // error encountered + }, + }, +) +``` diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js new file mode 100644 index 0000000..8725f8d --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js @@ -0,0 +1,1129 @@ +/** +* @vue/server-renderer v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var Vue = require('vue'); +var shared = require('@vue/shared'); +var compilerSsr = require('@vue/compiler-ssr'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + for (var k in e) { + n[k] = e[k]; + } + } + n.default = e; + return Object.freeze(n); +} + +var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue); + +const shouldIgnoreProp = /* @__PURE__ */ shared.makeMap( + `,key,ref,innerHTML,textContent,ref_key,ref_for` +); +function ssrRenderAttrs(props, tag) { + let ret = ""; + for (const key in props) { + if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value") { + continue; + } + const value = props[key]; + if (key === "class") { + ret += ` class="${ssrRenderClass(value)}"`; + } else if (key === "style") { + ret += ` style="${ssrRenderStyle(value)}"`; + } else if (key === "className") { + ret += ` class="${String(value)}"`; + } else { + ret += ssrRenderDynamicAttr(key, value, tag); + } + } + return ret; +} +function ssrRenderDynamicAttr(key, value, tag) { + if (!shared.isRenderableAttrValue(value)) { + return ``; + } + const attrKey = tag && (tag.indexOf("-") > 0 || shared.isSVGTag(tag)) ? key : shared.propsToAttrMap[key] || key.toLowerCase(); + if (shared.isBooleanAttr(attrKey)) { + return shared.includeBooleanAttr(value) ? ` ${attrKey}` : ``; + } else if (shared.isSSRSafeAttrName(attrKey)) { + return value === "" ? ` ${attrKey}` : ` ${attrKey}="${shared.escapeHtml(value)}"`; + } else { + console.warn( + `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}` + ); + return ``; + } +} +function ssrRenderAttr(key, value) { + if (!shared.isRenderableAttrValue(value)) { + return ``; + } + return ` ${key}="${shared.escapeHtml(value)}"`; +} +function ssrRenderClass(raw) { + return shared.escapeHtml(shared.normalizeClass(raw)); +} +function ssrRenderStyle(raw) { + if (!raw) { + return ""; + } + if (shared.isString(raw)) { + return shared.escapeHtml(raw); + } + const styles = shared.normalizeStyle(raw); + return shared.escapeHtml(shared.stringifyStyle(styles)); +} + +function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) { + return renderComponentVNode( + Vue.createVNode(comp, props, children), + parentComponent, + slotScopeId + ); +} + +const { ensureValidVNode } = Vue.ssrUtils; +function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) { + push(`<!--[-->`); + ssrRenderSlotInner( + slots, + slotName, + slotProps, + fallbackRenderFn, + push, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); +} +function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) { + const slotFn = slots[slotName]; + if (slotFn) { + const slotBuffer = []; + const bufferedPush = (item) => { + slotBuffer.push(item); + }; + const ret = slotFn( + slotProps, + bufferedPush, + parentComponent, + slotScopeId ? " " + slotScopeId : "" + ); + if (shared.isArray(ret)) { + const validSlotContent = ensureValidVNode(ret); + if (validSlotContent) { + renderVNodeChildren( + push, + validSlotContent, + parentComponent, + slotScopeId + ); + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let isEmptySlot = true; + if (transition) { + isEmptySlot = false; + } else { + for (let i = 0; i < slotBuffer.length; i++) { + if (!isComment(slotBuffer[i])) { + isEmptySlot = false; + break; + } + } + } + if (isEmptySlot) { + if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let start = 0; + let end = slotBuffer.length; + if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") { + start++; + end--; + } + for (let i = start; i < end; i++) { + push(slotBuffer[i]); + } + } + } + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } +} +const commentTestRE = /^<!--[\s\S]*-->$/; +const commentRE = /<!--[^]*?-->/gm; +function isComment(item) { + if (typeof item !== "string" || !commentTestRE.test(item)) return false; + if (item.length <= 8) return true; + return !item.replace(commentRE, "").trim(); +} + +function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) { + parentPush("<!--teleport start-->"); + const context = parentComponent.appContext.provides[Vue.ssrContextKey]; + const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {}); + const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []); + const bufferIndex = targetBuffer.length; + let teleportContent; + if (disabled) { + contentRenderFn(parentPush); + teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`; + } else { + const { getBuffer, push } = createBuffer(); + push(`<!--teleport start anchor-->`); + contentRenderFn(push); + push(`<!--teleport anchor-->`); + teleportContent = getBuffer(); + } + targetBuffer.splice(bufferIndex, 0, teleportContent); + parentPush("<!--teleport end-->"); +} + +function ssrInterpolate(value) { + return shared.escapeHtml(shared.toDisplayString(value)); +} + +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} + +const stack = []; +function pushWarningContext$1(vnode) { + stack.push(vnode); +} +function popWarningContext$1() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (shared.isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (shared.isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} + +const ErrorTypeStrings = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + { + const info = ErrorTypeStrings[type]; + if (contextVNode) { + pushWarningContext$1(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext$1(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } +} + +{ + const g = shared.getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => v + ); + registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => v + ); +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} + +const warn = warn$1 ; + +function ssrRenderList(source, renderItem) { + if (shared.isArray(source) || shared.isString(source)) { + for (let i = 0, l = source.length; i < l; i++) { + renderItem(source[i], i); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn(`The v-for range expect an integer value but got ${source}.`); + return; + } + for (let i = 0; i < source; i++) { + renderItem(i + 1, i); + } + } else if (shared.isObject(source)) { + if (source[Symbol.iterator]) { + const arr = Array.from(source); + for (let i = 0, l = arr.length; i < l; i++) { + renderItem(arr[i], i); + } + } else { + const keys = Object.keys(source); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + renderItem(source[key], key, i); + } + } + } +} + +async function ssrRenderSuspense(push, { default: renderContent }) { + if (renderContent) { + renderContent(); + } else { + push(`<!---->`); + } +} + +function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) { + if (typeof dir !== "function" && dir.getSSRProps) { + return dir.getSSRProps( + { + dir, + instance: Vue.ssrUtils.getComponentPublicInstance(instance.$), + value, + oldValue: void 0, + arg, + modifiers + }, + null + ) || {}; + } + return {}; +} + +const ssrLooseEqual = shared.looseEqual; +function ssrLooseContain(arr, value) { + return shared.looseIndexOf(arr, value) > -1; +} +function ssrRenderDynamicModel(type, model, value) { + switch (type) { + case "radio": + return shared.looseEqual(model, value) ? " checked" : ""; + case "checkbox": + return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : ""; + default: + return ssrRenderAttr("value", model); + } +} +function ssrGetDynamicModelProps(existingProps = {}, model) { + const { type, value } = existingProps; + switch (type) { + case "radio": + return shared.looseEqual(model, value) ? { checked: true } : null; + case "checkbox": + return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null; + default: + return { value: model }; + } +} + +var helpers = /*#__PURE__*/Object.freeze({ + __proto__: null, + ssrGetDirectiveProps: ssrGetDirectiveProps, + ssrGetDynamicModelProps: ssrGetDynamicModelProps, + ssrIncludeBooleanAttr: shared.includeBooleanAttr, + ssrInterpolate: ssrInterpolate, + ssrLooseContain: ssrLooseContain, + ssrLooseEqual: ssrLooseEqual, + ssrRenderAttr: ssrRenderAttr, + ssrRenderAttrs: ssrRenderAttrs, + ssrRenderClass: ssrRenderClass, + ssrRenderComponent: ssrRenderComponent, + ssrRenderDynamicAttr: ssrRenderDynamicAttr, + ssrRenderDynamicModel: ssrRenderDynamicModel, + ssrRenderList: ssrRenderList, + ssrRenderSlot: ssrRenderSlot, + ssrRenderSlotInner: ssrRenderSlotInner, + ssrRenderStyle: ssrRenderStyle, + ssrRenderSuspense: ssrRenderSuspense, + ssrRenderTeleport: ssrRenderTeleport, + ssrRenderVNode: renderVNode +}); + +const compileCache = /* @__PURE__ */ Object.create(null); +function ssrCompile(template, instance) { + const Component = instance.type; + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = shared.extend( + shared.extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + finalCompilerOptions.isCustomElement = finalCompilerOptions.isCustomElement || shared.NO; + finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO; + const cacheKey = JSON.stringify( + { + template, + compilerOptions: finalCompilerOptions + }, + (key, value) => { + return shared.isFunction(value) ? value.toString() : value; + } + ); + const cached = compileCache[cacheKey]; + if (cached) { + return cached; + } + finalCompilerOptions.onError = (err) => { + { + const message = `[@vue/server-renderer] Template compilation error: ${err.message}`; + const codeFrame = err.loc && shared.generateCodeFrame( + template, + err.loc.start.offset, + err.loc.end.offset + ); + Vue.warn(codeFrame ? `${message} +${codeFrame}` : message); + } + }; + const { code } = compilerSsr.compile(template, finalCompilerOptions); + const requireMap = { + vue: Vue__namespace, + "vue/server-renderer": helpers + }; + const fakeRequire = (id) => requireMap[id]; + return compileCache[cacheKey] = Function("require", code)(fakeRequire); +} + +const { + createComponentInstance, + setCurrentRenderingInstance, + setupComponent, + renderComponentRoot, + normalizeVNode, + pushWarningContext, + popWarningContext +} = Vue.ssrUtils; +function createBuffer() { + let appendable = false; + const buffer = []; + return { + getBuffer() { + return buffer; + }, + push(item) { + const isStringItem = shared.isString(item); + if (appendable && isStringItem) { + buffer[buffer.length - 1] += item; + return; + } + buffer.push(item); + appendable = isStringItem; + if (shared.isPromise(item) || shared.isArray(item) && item.hasAsync) { + buffer.hasAsync = true; + } + } + }; +} +function renderComponentVNode(vnode, parentComponent = null, slotScopeId) { + const instance = vnode.component = createComponentInstance( + vnode, + parentComponent, + null + ); + pushWarningContext(vnode); + const res = setupComponent( + instance, + true + /* isSSR */ + ); + popWarningContext(); + const hasAsyncSetup = shared.isPromise(res); + let prefetches = instance.sp; + if (hasAsyncSetup || prefetches) { + const p = Promise.resolve(res).then(() => { + if (hasAsyncSetup) prefetches = instance.sp; + if (prefetches) { + return Promise.all( + prefetches.map((prefetch) => prefetch.call(instance.proxy)) + ); + } + }).catch(shared.NOOP); + return p.then(() => renderComponentSubTree(instance, slotScopeId)); + } else { + return renderComponentSubTree(instance, slotScopeId); + } +} +function renderComponentSubTree(instance, slotScopeId) { + pushWarningContext(instance.vnode); + const comp = instance.type; + const { getBuffer, push } = createBuffer(); + if (shared.isFunction(comp)) { + let root = renderComponentRoot(instance); + if (!comp.props) { + for (const key in instance.attrs) { + if (key.startsWith(`data-v-`)) { + (root.props || (root.props = {}))[key] = ``; + } + } + } + renderVNode(push, instance.subTree = root, instance, slotScopeId); + } else { + if ((!instance.render || instance.render === shared.NOOP) && !instance.ssrRender && !comp.ssrRender && shared.isString(comp.template)) { + comp.ssrRender = ssrCompile(comp.template, instance); + } + const ssrRender = instance.ssrRender || comp.ssrRender; + if (ssrRender) { + let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0; + let hasCloned = false; + let cur = instance; + while (true) { + const scopeId = cur.vnode.scopeId; + if (scopeId) { + if (!hasCloned) { + attrs = { ...attrs }; + hasCloned = true; + } + attrs[scopeId] = ""; + } + const parent = cur.parent; + if (parent && parent.subTree && parent.subTree === cur.vnode) { + cur = parent; + } else { + break; + } + } + if (slotScopeId) { + if (!hasCloned) attrs = { ...attrs }; + const slotScopeIdList = slotScopeId.trim().split(" "); + for (let i = 0; i < slotScopeIdList.length; i++) { + attrs[slotScopeIdList[i]] = ""; + } + } + const prev = setCurrentRenderingInstance(instance); + try { + ssrRender( + instance.proxy, + push, + instance, + attrs, + // compiler-optimized bindings + instance.props, + instance.setupState, + instance.data, + instance.ctx + ); + } finally { + setCurrentRenderingInstance(prev); + } + } else if (instance.render && instance.render !== shared.NOOP) { + renderVNode( + push, + instance.subTree = renderComponentRoot(instance), + instance, + slotScopeId + ); + } else { + const componentName = comp.name || comp.__file || `<Anonymous>`; + Vue.warn(`Component ${componentName} is missing template or render function.`); + push(`<!---->`); + } + } + popWarningContext(); + return getBuffer(); +} +function renderVNode(push, vnode, parentComponent, slotScopeId) { + const { type, shapeFlag, children, dirs, props } = vnode; + if (dirs) { + vnode.props = applySSRDirectives(vnode, props, dirs); + } + switch (type) { + case Vue.Text: + push(shared.escapeHtml(children)); + break; + case Vue.Comment: + push( + children ? `<!--${shared.escapeHtmlComment(children)}-->` : `<!---->` + ); + break; + case Vue.Static: + push(children); + break; + case Vue.Fragment: + if (vnode.slotScopeIds) { + slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" "); + } + push(`<!--[-->`); + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); + break; + default: + if (shapeFlag & 1) { + renderElementVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 6) { + push(renderComponentVNode(vnode, parentComponent, slotScopeId)); + } else if (shapeFlag & 64) { + renderTeleportVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 128) { + renderVNode(push, vnode.ssContent, parentComponent, slotScopeId); + } else { + Vue.warn( + "[@vue/server-renderer] Invalid VNode type:", + type, + `(${typeof type})` + ); + } + } +} +function renderVNodeChildren(push, children, parentComponent, slotScopeId) { + for (let i = 0; i < children.length; i++) { + renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId); + } +} +function renderElementVNode(push, vnode, parentComponent, slotScopeId) { + const tag = vnode.type; + let { props, children, shapeFlag, scopeId } = vnode; + let openTag = `<${tag}`; + if (props) { + openTag += ssrRenderAttrs(props, tag); + } + if (scopeId) { + openTag += ` ${scopeId}`; + } + let curParent = parentComponent; + let curVnode = vnode; + while (curParent && curVnode === curParent.subTree) { + curVnode = curParent.vnode; + if (curVnode.scopeId) { + openTag += ` ${curVnode.scopeId}`; + } + curParent = curParent.parent; + } + if (slotScopeId) { + openTag += ` ${slotScopeId}`; + } + push(openTag + `>`); + if (!shared.isVoidTag(tag)) { + let hasChildrenOverride = false; + if (props) { + if (props.innerHTML) { + hasChildrenOverride = true; + push(props.innerHTML); + } else if (props.textContent) { + hasChildrenOverride = true; + push(shared.escapeHtml(props.textContent)); + } else if (tag === "textarea" && props.value) { + hasChildrenOverride = true; + push(shared.escapeHtml(props.value)); + } + } + if (!hasChildrenOverride) { + if (shapeFlag & 8) { + push(shared.escapeHtml(children)); + } else if (shapeFlag & 16) { + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + } + } + push(`</${tag}>`); + } +} +function applySSRDirectives(vnode, rawProps, dirs) { + const toMerge = []; + for (let i = 0; i < dirs.length; i++) { + const binding = dirs[i]; + const { + dir: { getSSRProps } + } = binding; + if (getSSRProps) { + const props = getSSRProps(binding, vnode); + if (props) toMerge.push(props); + } + } + return Vue.mergeProps(rawProps || {}, ...toMerge); +} +function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) { + const target = vnode.props && vnode.props.to; + const disabled = vnode.props && vnode.props.disabled; + if (!target) { + if (!disabled) { + Vue.warn(`[@vue/server-renderer] Teleport is missing target prop.`); + } + return []; + } + if (!shared.isString(target)) { + Vue.warn( + `[@vue/server-renderer] Teleport target must be a query selector string.` + ); + return []; + } + ssrRenderTeleport( + push, + (push2) => { + renderVNodeChildren( + push2, + vnode.children, + parentComponent, + slotScopeId + ); + }, + target, + disabled || disabled === "", + parentComponent + ); +} + +const { isVNode: isVNode$1 } = Vue.ssrUtils; +function nestedUnrollBuffer(buffer, parentRet, startIndex) { + if (!buffer.hasAsync) { + return parentRet + unrollBufferSync$1(buffer); + } + let ret = parentRet; + for (let i = startIndex; i < buffer.length; i += 1) { + const item = buffer[i]; + if (shared.isString(item)) { + ret += item; + continue; + } + if (shared.isPromise(item)) { + return item.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, ret, i); + }); + } + const result = nestedUnrollBuffer(item, ret, 0); + if (shared.isPromise(result)) { + return result.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, "", i); + }); + } + ret = result; + } + return ret; +} +function unrollBuffer$1(buffer) { + return nestedUnrollBuffer(buffer, "", 0); +} +function unrollBufferSync$1(buffer) { + let ret = ""; + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isString(item)) { + ret += item; + } else { + ret += unrollBufferSync$1(item); + } + } + return ret; +} +async function renderToString(input, context = {}) { + if (isVNode$1(input)) { + return renderToString(Vue.createApp({ render: () => input }), context); + } + const vnode = Vue.createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(Vue.ssrContextKey, context); + const buffer = await renderComponentVNode(vnode); + const result = await unrollBuffer$1(buffer); + await resolveTeleports(context); + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + return result; +} +async function resolveTeleports(context) { + if (context.__teleportBuffers) { + context.teleports = context.teleports || {}; + for (const key in context.__teleportBuffers) { + context.teleports[key] = await unrollBuffer$1( + await Promise.all([context.__teleportBuffers[key]]) + ); + } + } +} + +const { isVNode } = Vue.ssrUtils; +async function unrollBuffer(buffer, stream) { + if (buffer.hasAsync) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isPromise(item)) { + item = await item; + } + if (shared.isString(item)) { + stream.push(item); + } else { + await unrollBuffer(item, stream); + } + } + } else { + unrollBufferSync(buffer, stream); + } +} +function unrollBufferSync(buffer, stream) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isString(item)) { + stream.push(item); + } else { + unrollBufferSync(item, stream); + } + } +} +function renderToSimpleStream(input, context, stream) { + if (isVNode(input)) { + return renderToSimpleStream( + Vue.createApp({ render: () => input }), + context, + stream + ); + } + const vnode = Vue.createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(Vue.ssrContextKey, context); + Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => { + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + }).then(() => stream.push(null)).catch((error) => { + stream.destroy(error); + }); + return stream; +} +function renderToStream(input, context = {}) { + console.warn( + `[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.` + ); + return renderToNodeStream(input, context); +} +function renderToNodeStream(input, context = {}) { + const stream = new (require("node:stream")).Readable({ read() { + } }) ; + if (!stream) { + throw new Error( + `ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.` + ); + } + return renderToSimpleStream(input, context, stream); +} +function pipeToNodeWritable(input, context = {}, writable) { + renderToSimpleStream(input, context, { + push(content) { + if (content != null) { + writable.write(content); + } else { + writable.end(); + } + }, + destroy(err) { + writable.destroy(err); + } + }); +} +function renderToWebStream(input, context = {}) { + if (typeof ReadableStream !== "function") { + throw new Error( + `ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.` + ); + } + const encoder = new TextEncoder(); + let cancelled = false; + return new ReadableStream({ + start(controller) { + renderToSimpleStream(input, context, { + push(content) { + if (cancelled) return; + if (content != null) { + controller.enqueue(encoder.encode(content)); + } else { + controller.close(); + } + }, + destroy(err) { + controller.error(err); + } + }); + }, + cancel() { + cancelled = true; + } + }); +} +function pipeToWebWritable(input, context = {}, writable) { + const writer = writable.getWriter(); + const encoder = new TextEncoder(); + let hasReady = false; + try { + hasReady = shared.isPromise(writer.ready); + } catch (e) { + } + renderToSimpleStream(input, context, { + async push(content) { + if (hasReady) { + await writer.ready; + } + if (content != null) { + return writer.write(encoder.encode(content)); + } else { + return writer.close(); + } + }, + destroy(err) { + console.log(err); + writer.close(); + } + }); +} + +Vue.initDirectivesForSSR(); + +exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr; +exports.pipeToNodeWritable = pipeToNodeWritable; +exports.pipeToWebWritable = pipeToWebWritable; +exports.renderToNodeStream = renderToNodeStream; +exports.renderToSimpleStream = renderToSimpleStream; +exports.renderToStream = renderToStream; +exports.renderToString = renderToString; +exports.renderToWebStream = renderToWebStream; +exports.ssrGetDirectiveProps = ssrGetDirectiveProps; +exports.ssrGetDynamicModelProps = ssrGetDynamicModelProps; +exports.ssrInterpolate = ssrInterpolate; +exports.ssrLooseContain = ssrLooseContain; +exports.ssrLooseEqual = ssrLooseEqual; +exports.ssrRenderAttr = ssrRenderAttr; +exports.ssrRenderAttrs = ssrRenderAttrs; +exports.ssrRenderClass = ssrRenderClass; +exports.ssrRenderComponent = ssrRenderComponent; +exports.ssrRenderDynamicAttr = ssrRenderDynamicAttr; +exports.ssrRenderDynamicModel = ssrRenderDynamicModel; +exports.ssrRenderList = ssrRenderList; +exports.ssrRenderSlot = ssrRenderSlot; +exports.ssrRenderSlotInner = ssrRenderSlotInner; +exports.ssrRenderStyle = ssrRenderStyle; +exports.ssrRenderSuspense = ssrRenderSuspense; +exports.ssrRenderTeleport = ssrRenderTeleport; +exports.ssrRenderVNode = renderVNode; diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js new file mode 100644 index 0000000..b85ba7a --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js @@ -0,0 +1,857 @@ +/** +* @vue/server-renderer v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var Vue = require('vue'); +var shared = require('@vue/shared'); +var compilerSsr = require('@vue/compiler-ssr'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + for (var k in e) { + n[k] = e[k]; + } + } + n.default = e; + return Object.freeze(n); +} + +var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue); + +const shouldIgnoreProp = /* @__PURE__ */ shared.makeMap( + `,key,ref,innerHTML,textContent,ref_key,ref_for` +); +function ssrRenderAttrs(props, tag) { + let ret = ""; + for (const key in props) { + if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value") { + continue; + } + const value = props[key]; + if (key === "class") { + ret += ` class="${ssrRenderClass(value)}"`; + } else if (key === "style") { + ret += ` style="${ssrRenderStyle(value)}"`; + } else if (key === "className") { + ret += ` class="${String(value)}"`; + } else { + ret += ssrRenderDynamicAttr(key, value, tag); + } + } + return ret; +} +function ssrRenderDynamicAttr(key, value, tag) { + if (!shared.isRenderableAttrValue(value)) { + return ``; + } + const attrKey = tag && (tag.indexOf("-") > 0 || shared.isSVGTag(tag)) ? key : shared.propsToAttrMap[key] || key.toLowerCase(); + if (shared.isBooleanAttr(attrKey)) { + return shared.includeBooleanAttr(value) ? ` ${attrKey}` : ``; + } else if (shared.isSSRSafeAttrName(attrKey)) { + return value === "" ? ` ${attrKey}` : ` ${attrKey}="${shared.escapeHtml(value)}"`; + } else { + console.warn( + `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}` + ); + return ``; + } +} +function ssrRenderAttr(key, value) { + if (!shared.isRenderableAttrValue(value)) { + return ``; + } + return ` ${key}="${shared.escapeHtml(value)}"`; +} +function ssrRenderClass(raw) { + return shared.escapeHtml(shared.normalizeClass(raw)); +} +function ssrRenderStyle(raw) { + if (!raw) { + return ""; + } + if (shared.isString(raw)) { + return shared.escapeHtml(raw); + } + const styles = shared.normalizeStyle(raw); + return shared.escapeHtml(shared.stringifyStyle(styles)); +} + +function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) { + return renderComponentVNode( + Vue.createVNode(comp, props, children), + parentComponent, + slotScopeId + ); +} + +const { ensureValidVNode } = Vue.ssrUtils; +function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) { + push(`<!--[-->`); + ssrRenderSlotInner( + slots, + slotName, + slotProps, + fallbackRenderFn, + push, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); +} +function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) { + const slotFn = slots[slotName]; + if (slotFn) { + const slotBuffer = []; + const bufferedPush = (item) => { + slotBuffer.push(item); + }; + const ret = slotFn( + slotProps, + bufferedPush, + parentComponent, + slotScopeId ? " " + slotScopeId : "" + ); + if (shared.isArray(ret)) { + const validSlotContent = ensureValidVNode(ret); + if (validSlotContent) { + renderVNodeChildren( + push, + validSlotContent, + parentComponent, + slotScopeId + ); + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let isEmptySlot = true; + if (transition) { + isEmptySlot = false; + } else { + for (let i = 0; i < slotBuffer.length; i++) { + if (!isComment(slotBuffer[i])) { + isEmptySlot = false; + break; + } + } + } + if (isEmptySlot) { + if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let start = 0; + let end = slotBuffer.length; + if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") { + start++; + end--; + } + for (let i = start; i < end; i++) { + push(slotBuffer[i]); + } + } + } + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } +} +const commentTestRE = /^<!--[\s\S]*-->$/; +const commentRE = /<!--[^]*?-->/gm; +function isComment(item) { + if (typeof item !== "string" || !commentTestRE.test(item)) return false; + if (item.length <= 8) return true; + return !item.replace(commentRE, "").trim(); +} + +function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) { + parentPush("<!--teleport start-->"); + const context = parentComponent.appContext.provides[Vue.ssrContextKey]; + const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {}); + const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []); + const bufferIndex = targetBuffer.length; + let teleportContent; + if (disabled) { + contentRenderFn(parentPush); + teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`; + } else { + const { getBuffer, push } = createBuffer(); + push(`<!--teleport start anchor-->`); + contentRenderFn(push); + push(`<!--teleport anchor-->`); + teleportContent = getBuffer(); + } + targetBuffer.splice(bufferIndex, 0, teleportContent); + parentPush("<!--teleport end-->"); +} + +function ssrInterpolate(value) { + return shared.escapeHtml(shared.toDisplayString(value)); +} + +function ssrRenderList(source, renderItem) { + if (shared.isArray(source) || shared.isString(source)) { + for (let i = 0, l = source.length; i < l; i++) { + renderItem(source[i], i); + } + } else if (typeof source === "number") { + for (let i = 0; i < source; i++) { + renderItem(i + 1, i); + } + } else if (shared.isObject(source)) { + if (source[Symbol.iterator]) { + const arr = Array.from(source); + for (let i = 0, l = arr.length; i < l; i++) { + renderItem(arr[i], i); + } + } else { + const keys = Object.keys(source); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + renderItem(source[key], key, i); + } + } + } +} + +async function ssrRenderSuspense(push, { default: renderContent }) { + if (renderContent) { + renderContent(); + } else { + push(`<!---->`); + } +} + +function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) { + if (typeof dir !== "function" && dir.getSSRProps) { + return dir.getSSRProps( + { + dir, + instance: Vue.ssrUtils.getComponentPublicInstance(instance.$), + value, + oldValue: void 0, + arg, + modifiers + }, + null + ) || {}; + } + return {}; +} + +const ssrLooseEqual = shared.looseEqual; +function ssrLooseContain(arr, value) { + return shared.looseIndexOf(arr, value) > -1; +} +function ssrRenderDynamicModel(type, model, value) { + switch (type) { + case "radio": + return shared.looseEqual(model, value) ? " checked" : ""; + case "checkbox": + return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : ""; + default: + return ssrRenderAttr("value", model); + } +} +function ssrGetDynamicModelProps(existingProps = {}, model) { + const { type, value } = existingProps; + switch (type) { + case "radio": + return shared.looseEqual(model, value) ? { checked: true } : null; + case "checkbox": + return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null; + default: + return { value: model }; + } +} + +var helpers = /*#__PURE__*/Object.freeze({ + __proto__: null, + ssrGetDirectiveProps: ssrGetDirectiveProps, + ssrGetDynamicModelProps: ssrGetDynamicModelProps, + ssrIncludeBooleanAttr: shared.includeBooleanAttr, + ssrInterpolate: ssrInterpolate, + ssrLooseContain: ssrLooseContain, + ssrLooseEqual: ssrLooseEqual, + ssrRenderAttr: ssrRenderAttr, + ssrRenderAttrs: ssrRenderAttrs, + ssrRenderClass: ssrRenderClass, + ssrRenderComponent: ssrRenderComponent, + ssrRenderDynamicAttr: ssrRenderDynamicAttr, + ssrRenderDynamicModel: ssrRenderDynamicModel, + ssrRenderList: ssrRenderList, + ssrRenderSlot: ssrRenderSlot, + ssrRenderSlotInner: ssrRenderSlotInner, + ssrRenderStyle: ssrRenderStyle, + ssrRenderSuspense: ssrRenderSuspense, + ssrRenderTeleport: ssrRenderTeleport, + ssrRenderVNode: renderVNode +}); + +const compileCache = /* @__PURE__ */ Object.create(null); +function ssrCompile(template, instance) { + const Component = instance.type; + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = shared.extend( + shared.extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + finalCompilerOptions.isCustomElement = finalCompilerOptions.isCustomElement || shared.NO; + finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO; + const cacheKey = JSON.stringify( + { + template, + compilerOptions: finalCompilerOptions + }, + (key, value) => { + return shared.isFunction(value) ? value.toString() : value; + } + ); + const cached = compileCache[cacheKey]; + if (cached) { + return cached; + } + finalCompilerOptions.onError = (err) => { + { + throw err; + } + }; + const { code } = compilerSsr.compile(template, finalCompilerOptions); + const requireMap = { + vue: Vue__namespace, + "vue/server-renderer": helpers + }; + const fakeRequire = (id) => requireMap[id]; + return compileCache[cacheKey] = Function("require", code)(fakeRequire); +} + +const { + createComponentInstance, + setCurrentRenderingInstance, + setupComponent, + renderComponentRoot, + normalizeVNode, + pushWarningContext, + popWarningContext +} = Vue.ssrUtils; +function createBuffer() { + let appendable = false; + const buffer = []; + return { + getBuffer() { + return buffer; + }, + push(item) { + const isStringItem = shared.isString(item); + if (appendable && isStringItem) { + buffer[buffer.length - 1] += item; + return; + } + buffer.push(item); + appendable = isStringItem; + if (shared.isPromise(item) || shared.isArray(item) && item.hasAsync) { + buffer.hasAsync = true; + } + } + }; +} +function renderComponentVNode(vnode, parentComponent = null, slotScopeId) { + const instance = vnode.component = createComponentInstance( + vnode, + parentComponent, + null + ); + const res = setupComponent( + instance, + true + /* isSSR */ + ); + const hasAsyncSetup = shared.isPromise(res); + let prefetches = instance.sp; + if (hasAsyncSetup || prefetches) { + const p = Promise.resolve(res).then(() => { + if (hasAsyncSetup) prefetches = instance.sp; + if (prefetches) { + return Promise.all( + prefetches.map((prefetch) => prefetch.call(instance.proxy)) + ); + } + }).catch(shared.NOOP); + return p.then(() => renderComponentSubTree(instance, slotScopeId)); + } else { + return renderComponentSubTree(instance, slotScopeId); + } +} +function renderComponentSubTree(instance, slotScopeId) { + const comp = instance.type; + const { getBuffer, push } = createBuffer(); + if (shared.isFunction(comp)) { + let root = renderComponentRoot(instance); + if (!comp.props) { + for (const key in instance.attrs) { + if (key.startsWith(`data-v-`)) { + (root.props || (root.props = {}))[key] = ``; + } + } + } + renderVNode(push, instance.subTree = root, instance, slotScopeId); + } else { + if ((!instance.render || instance.render === shared.NOOP) && !instance.ssrRender && !comp.ssrRender && shared.isString(comp.template)) { + comp.ssrRender = ssrCompile(comp.template, instance); + } + const ssrRender = instance.ssrRender || comp.ssrRender; + if (ssrRender) { + let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0; + let hasCloned = false; + let cur = instance; + while (true) { + const scopeId = cur.vnode.scopeId; + if (scopeId) { + if (!hasCloned) { + attrs = { ...attrs }; + hasCloned = true; + } + attrs[scopeId] = ""; + } + const parent = cur.parent; + if (parent && parent.subTree && parent.subTree === cur.vnode) { + cur = parent; + } else { + break; + } + } + if (slotScopeId) { + if (!hasCloned) attrs = { ...attrs }; + const slotScopeIdList = slotScopeId.trim().split(" "); + for (let i = 0; i < slotScopeIdList.length; i++) { + attrs[slotScopeIdList[i]] = ""; + } + } + const prev = setCurrentRenderingInstance(instance); + try { + ssrRender( + instance.proxy, + push, + instance, + attrs, + // compiler-optimized bindings + instance.props, + instance.setupState, + instance.data, + instance.ctx + ); + } finally { + setCurrentRenderingInstance(prev); + } + } else if (instance.render && instance.render !== shared.NOOP) { + renderVNode( + push, + instance.subTree = renderComponentRoot(instance), + instance, + slotScopeId + ); + } else { + const componentName = comp.name || comp.__file || `<Anonymous>`; + Vue.warn(`Component ${componentName} is missing template or render function.`); + push(`<!---->`); + } + } + return getBuffer(); +} +function renderVNode(push, vnode, parentComponent, slotScopeId) { + const { type, shapeFlag, children, dirs, props } = vnode; + if (dirs) { + vnode.props = applySSRDirectives(vnode, props, dirs); + } + switch (type) { + case Vue.Text: + push(shared.escapeHtml(children)); + break; + case Vue.Comment: + push( + children ? `<!--${shared.escapeHtmlComment(children)}-->` : `<!---->` + ); + break; + case Vue.Static: + push(children); + break; + case Vue.Fragment: + if (vnode.slotScopeIds) { + slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" "); + } + push(`<!--[-->`); + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); + break; + default: + if (shapeFlag & 1) { + renderElementVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 6) { + push(renderComponentVNode(vnode, parentComponent, slotScopeId)); + } else if (shapeFlag & 64) { + renderTeleportVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 128) { + renderVNode(push, vnode.ssContent, parentComponent, slotScopeId); + } else { + Vue.warn( + "[@vue/server-renderer] Invalid VNode type:", + type, + `(${typeof type})` + ); + } + } +} +function renderVNodeChildren(push, children, parentComponent, slotScopeId) { + for (let i = 0; i < children.length; i++) { + renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId); + } +} +function renderElementVNode(push, vnode, parentComponent, slotScopeId) { + const tag = vnode.type; + let { props, children, shapeFlag, scopeId } = vnode; + let openTag = `<${tag}`; + if (props) { + openTag += ssrRenderAttrs(props, tag); + } + if (scopeId) { + openTag += ` ${scopeId}`; + } + let curParent = parentComponent; + let curVnode = vnode; + while (curParent && curVnode === curParent.subTree) { + curVnode = curParent.vnode; + if (curVnode.scopeId) { + openTag += ` ${curVnode.scopeId}`; + } + curParent = curParent.parent; + } + if (slotScopeId) { + openTag += ` ${slotScopeId}`; + } + push(openTag + `>`); + if (!shared.isVoidTag(tag)) { + let hasChildrenOverride = false; + if (props) { + if (props.innerHTML) { + hasChildrenOverride = true; + push(props.innerHTML); + } else if (props.textContent) { + hasChildrenOverride = true; + push(shared.escapeHtml(props.textContent)); + } else if (tag === "textarea" && props.value) { + hasChildrenOverride = true; + push(shared.escapeHtml(props.value)); + } + } + if (!hasChildrenOverride) { + if (shapeFlag & 8) { + push(shared.escapeHtml(children)); + } else if (shapeFlag & 16) { + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + } + } + push(`</${tag}>`); + } +} +function applySSRDirectives(vnode, rawProps, dirs) { + const toMerge = []; + for (let i = 0; i < dirs.length; i++) { + const binding = dirs[i]; + const { + dir: { getSSRProps } + } = binding; + if (getSSRProps) { + const props = getSSRProps(binding, vnode); + if (props) toMerge.push(props); + } + } + return Vue.mergeProps(rawProps || {}, ...toMerge); +} +function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) { + const target = vnode.props && vnode.props.to; + const disabled = vnode.props && vnode.props.disabled; + if (!target) { + if (!disabled) { + Vue.warn(`[@vue/server-renderer] Teleport is missing target prop.`); + } + return []; + } + if (!shared.isString(target)) { + Vue.warn( + `[@vue/server-renderer] Teleport target must be a query selector string.` + ); + return []; + } + ssrRenderTeleport( + push, + (push2) => { + renderVNodeChildren( + push2, + vnode.children, + parentComponent, + slotScopeId + ); + }, + target, + disabled || disabled === "", + parentComponent + ); +} + +const { isVNode: isVNode$1 } = Vue.ssrUtils; +function nestedUnrollBuffer(buffer, parentRet, startIndex) { + if (!buffer.hasAsync) { + return parentRet + unrollBufferSync$1(buffer); + } + let ret = parentRet; + for (let i = startIndex; i < buffer.length; i += 1) { + const item = buffer[i]; + if (shared.isString(item)) { + ret += item; + continue; + } + if (shared.isPromise(item)) { + return item.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, ret, i); + }); + } + const result = nestedUnrollBuffer(item, ret, 0); + if (shared.isPromise(result)) { + return result.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, "", i); + }); + } + ret = result; + } + return ret; +} +function unrollBuffer$1(buffer) { + return nestedUnrollBuffer(buffer, "", 0); +} +function unrollBufferSync$1(buffer) { + let ret = ""; + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isString(item)) { + ret += item; + } else { + ret += unrollBufferSync$1(item); + } + } + return ret; +} +async function renderToString(input, context = {}) { + if (isVNode$1(input)) { + return renderToString(Vue.createApp({ render: () => input }), context); + } + const vnode = Vue.createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(Vue.ssrContextKey, context); + const buffer = await renderComponentVNode(vnode); + const result = await unrollBuffer$1(buffer); + await resolveTeleports(context); + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + return result; +} +async function resolveTeleports(context) { + if (context.__teleportBuffers) { + context.teleports = context.teleports || {}; + for (const key in context.__teleportBuffers) { + context.teleports[key] = await unrollBuffer$1( + await Promise.all([context.__teleportBuffers[key]]) + ); + } + } +} + +const { isVNode } = Vue.ssrUtils; +async function unrollBuffer(buffer, stream) { + if (buffer.hasAsync) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isPromise(item)) { + item = await item; + } + if (shared.isString(item)) { + stream.push(item); + } else { + await unrollBuffer(item, stream); + } + } + } else { + unrollBufferSync(buffer, stream); + } +} +function unrollBufferSync(buffer, stream) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (shared.isString(item)) { + stream.push(item); + } else { + unrollBufferSync(item, stream); + } + } +} +function renderToSimpleStream(input, context, stream) { + if (isVNode(input)) { + return renderToSimpleStream( + Vue.createApp({ render: () => input }), + context, + stream + ); + } + const vnode = Vue.createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(Vue.ssrContextKey, context); + Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => { + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + }).then(() => stream.push(null)).catch((error) => { + stream.destroy(error); + }); + return stream; +} +function renderToStream(input, context = {}) { + console.warn( + `[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.` + ); + return renderToNodeStream(input, context); +} +function renderToNodeStream(input, context = {}) { + const stream = new (require("node:stream")).Readable({ read() { + } }) ; + if (!stream) { + throw new Error( + `ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.` + ); + } + return renderToSimpleStream(input, context, stream); +} +function pipeToNodeWritable(input, context = {}, writable) { + renderToSimpleStream(input, context, { + push(content) { + if (content != null) { + writable.write(content); + } else { + writable.end(); + } + }, + destroy(err) { + writable.destroy(err); + } + }); +} +function renderToWebStream(input, context = {}) { + if (typeof ReadableStream !== "function") { + throw new Error( + `ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.` + ); + } + const encoder = new TextEncoder(); + let cancelled = false; + return new ReadableStream({ + start(controller) { + renderToSimpleStream(input, context, { + push(content) { + if (cancelled) return; + if (content != null) { + controller.enqueue(encoder.encode(content)); + } else { + controller.close(); + } + }, + destroy(err) { + controller.error(err); + } + }); + }, + cancel() { + cancelled = true; + } + }); +} +function pipeToWebWritable(input, context = {}, writable) { + const writer = writable.getWriter(); + const encoder = new TextEncoder(); + let hasReady = false; + try { + hasReady = shared.isPromise(writer.ready); + } catch (e) { + } + renderToSimpleStream(input, context, { + async push(content) { + if (hasReady) { + await writer.ready; + } + if (content != null) { + return writer.write(encoder.encode(content)); + } else { + return writer.close(); + } + }, + destroy(err) { + console.log(err); + writer.close(); + } + }); +} + +Vue.initDirectivesForSSR(); + +exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr; +exports.pipeToNodeWritable = pipeToNodeWritable; +exports.pipeToWebWritable = pipeToWebWritable; +exports.renderToNodeStream = renderToNodeStream; +exports.renderToSimpleStream = renderToSimpleStream; +exports.renderToStream = renderToStream; +exports.renderToString = renderToString; +exports.renderToWebStream = renderToWebStream; +exports.ssrGetDirectiveProps = ssrGetDirectiveProps; +exports.ssrGetDynamicModelProps = ssrGetDynamicModelProps; +exports.ssrInterpolate = ssrInterpolate; +exports.ssrLooseContain = ssrLooseContain; +exports.ssrLooseEqual = ssrLooseEqual; +exports.ssrRenderAttr = ssrRenderAttr; +exports.ssrRenderAttrs = ssrRenderAttrs; +exports.ssrRenderClass = ssrRenderClass; +exports.ssrRenderComponent = ssrRenderComponent; +exports.ssrRenderDynamicAttr = ssrRenderDynamicAttr; +exports.ssrRenderDynamicModel = ssrRenderDynamicModel; +exports.ssrRenderList = ssrRenderList; +exports.ssrRenderSlot = ssrRenderSlot; +exports.ssrRenderSlotInner = ssrRenderSlotInner; +exports.ssrRenderStyle = ssrRenderStyle; +exports.ssrRenderSuspense = ssrRenderSuspense; +exports.ssrRenderTeleport = ssrRenderTeleport; +exports.ssrRenderVNode = renderVNode; diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.d.ts b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.d.ts new file mode 100644 index 0000000..40f9ccc --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.d.ts @@ -0,0 +1,65 @@ +import { VNode, ComponentInternalInstance, App, Slots, Component, ComponentPublicInstance, Directive } from 'vue'; +import { Readable, Writable } from 'node:stream'; +export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared'; + +type SSRBuffer = SSRBufferItem[] & { + hasAsync?: boolean; +}; +type SSRBufferItem = string | SSRBuffer | Promise<SSRBuffer>; +type PushFn = (item: SSRBufferItem) => void; +type Props = Record<string, unknown>; +export type SSRContext = { + [key: string]: any; + teleports?: Record<string, string>; +}; +export declare function renderVNode(push: PushFn, vnode: VNode, parentComponent: ComponentInternalInstance, slotScopeId?: string): void; + +export declare function renderToString(input: App | VNode, context?: SSRContext): Promise<string>; + +export interface SimpleReadable { + push(chunk: string | null): void; + destroy(err: any): void; +} +export declare function renderToSimpleStream<T extends SimpleReadable>(input: App | VNode, context: SSRContext, stream: T): T; +/** + * @deprecated + */ +export declare function renderToStream(input: App | VNode, context?: SSRContext): Readable; +export declare function renderToNodeStream(input: App | VNode, context?: SSRContext): Readable; +export declare function pipeToNodeWritable(input: App | VNode, context: SSRContext | undefined, writable: Writable): void; +export declare function renderToWebStream(input: App | VNode, context?: SSRContext): ReadableStream; +export declare function pipeToWebWritable(input: App | VNode, context: SSRContext | undefined, writable: WritableStream): void; + +type SSRSlots = Record<string, SSRSlot>; +type SSRSlot = (props: Props, push: PushFn, parentComponent: ComponentInternalInstance | null, scopeId: string | null) => void; +export declare function ssrRenderSlot(slots: Slots | SSRSlots, slotName: string, slotProps: Props, fallbackRenderFn: (() => void) | null, push: PushFn, parentComponent: ComponentInternalInstance, slotScopeId?: string): void; +export declare function ssrRenderSlotInner(slots: Slots | SSRSlots, slotName: string, slotProps: Props, fallbackRenderFn: (() => void) | null, push: PushFn, parentComponent: ComponentInternalInstance, slotScopeId?: string, transition?: boolean): void; + +export declare function ssrRenderComponent(comp: Component, props?: Props | null, children?: Slots | SSRSlots | null, parentComponent?: ComponentInternalInstance | null, slotScopeId?: string): SSRBuffer | Promise<SSRBuffer>; + +export declare function ssrRenderTeleport(parentPush: PushFn, contentRenderFn: (push: PushFn) => void, target: string, disabled: boolean, parentComponent: ComponentInternalInstance): void; + +export declare function ssrRenderAttrs(props: Record<string, unknown>, tag?: string): string; +export declare function ssrRenderDynamicAttr(key: string, value: unknown, tag?: string): string; +export declare function ssrRenderAttr(key: string, value: unknown): string; +export declare function ssrRenderClass(raw: unknown): string; +export declare function ssrRenderStyle(raw: unknown): string; + +export declare function ssrInterpolate(value: unknown): string; + +export declare function ssrRenderList(source: unknown, renderItem: (value: unknown, key: string | number, index?: number) => void): void; + +export declare function ssrRenderSuspense(push: PushFn, { default: renderContent }: Record<string, (() => void) | undefined>): Promise<void>; + +export declare function ssrGetDirectiveProps(instance: ComponentPublicInstance, dir: Directive, value?: any, arg?: string, modifiers?: Record<string, boolean>): Record<string, any>; + +export declare const ssrLooseEqual: (a: unknown, b: unknown) => boolean; +export declare function ssrLooseContain(arr: unknown[], value: unknown): boolean; +export declare function ssrRenderDynamicModel(type: unknown, model: unknown, value: unknown): string; +export declare function ssrGetDynamicModelProps(existingProps: any, model: unknown): { + checked: true; +} | { + value: any; +} | null; + +export { renderVNode as ssrRenderVNode }; diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js new file mode 100644 index 0000000..fbf67fe --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js @@ -0,0 +1,8566 @@ +/** +* @vue/server-renderer v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const EMPTY_ARR = Object.freeze([]) ; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty$1 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.slice(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const isRef$1 = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef$1(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +function warn$2(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this._isPaused = false; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn$2(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function getCurrentScope() { + return activeEffectScope; +} + +let activeSub; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 1 | 4; + /** + * @internal + */ + this.next = void 0; + /** + * @internal + */ + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope && activeEffectScope.active) { + activeEffectScope.effects.push(this); + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= ~64; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn$2( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= ~2; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= ~1; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed) { + if (computed.flags & 4 && !(computed.flags & 16)) { + return; + } + computed.flags &= ~16; + if (computed.globalVersion === globalVersion) { + return; + } + computed.globalVersion = globalVersion; + const dep = computed.dep; + computed.flags |= 2; + if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { + computed.flags &= ~2; + return; + } + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed; + shouldTrack = true; + try { + prepareDeps(computed); + const value = computed.fn(computed._value); + if (dep.version === 0 || hasChanged(value, computed._value)) { + computed._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed); + computed.flags &= ~2; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= ~4; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} + +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed = link.dep.computed; + if (computed && !link.dep.subs) { + computed.flags |= 4 | 16; + for (let l = computed.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( + "Object iterate" +); +const MAP_KEY_ITERATE_KEY = Symbol( + "Map keys iterate" +); +const ARRAY_ITERATE_KEY = Symbol( + "Array iterate" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track({ + target, + type, + key + }); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} + +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, toReactive); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toReactive(value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); + }, + find(fn, thisArg) { + return apply(this, "find", fn, thisArg, toReactive, arguments); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply(this, "findLast", fn, thisArg, toReactive, arguments); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimisation required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", toReactive); + } +}; +function iterator(self, method, wrapValue) { + const arr = shallowReadArray(self); + const iter = arr[method](); + if (arr !== self && !isShallow(self)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (result.value) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self); + const needsWrap = arr !== self && !isShallow(self); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toReactive(item), index, self); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self, method, fn, args) { + const arr = shallowReadArray(self); + let wrappedFn = fn; + if (arr !== self) { + if (!isShallow(self)) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, toReactive(item), index, self); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self); + }; + } + } + return arr[method](wrappedFn, ...args); +} +function searchProxy(self, method, args) { + const arr = toRaw(self); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self)[method].apply(self, args); + endBatch(); + resetTracking(); + return res; +} + +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef(target) ? target : receiver + ); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + { + warn$2( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn$2( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn$2( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; + !readonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn$2( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + warn$2( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => isObject(value) ? reactive(value) : value; +const toReadonly = (value) => isObject(value) ? readonly(value) : value; + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} + +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + /** + * @internal + */ + this._value = void 0; + /** + * @internal + */ + this.dep = new Dep(this); + /** + * @internal + */ + this.__v_isRef = true; + // TODO isolatedDeclarations "__v_isReadonly" + // A computed is also a subscriber that tracks other deps + /** + * @internal + */ + this.deps = void 0; + /** + * @internal + */ + this.depsTail = void 0; + /** + * @internal + */ + this.flags = 16; + /** + * @internal + */ + this.globalVersion = globalVersion - 1; + /** + * @internal + */ + this.next = void 0; + // for backwards compat + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link = this.dep.track({ + target: this, + type: "get", + key: "value" + }) ; + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else { + warn$2("Write operation failed: computed value is readonly"); + } + } +} +function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + return cRef; +} + +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn$2( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch$1(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn$2)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect.stop(); + if (scope && scope.active) { + remove(scope.effects, effect); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + watchHandle(); + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + oldValue = newValue; + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect = new ReactiveEffect(getter); + effect.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect); + } + }; + { + effect.onTrack = options.onTrack; + effect.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect.run(); + } + watchHandle.pause = effect.pause.bind(effect); + watchHandle.resume = effect.resume.bind(effect); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + depth--; + if (isRef(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +const stack = []; +function pushWarningContext$1(vnode) { + stack.push(vnode); +} +function popWarningContext$1() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} + +const ErrorTypeStrings = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + { + const info = ErrorTypeStrings[type]; + if (contextVNode) { + pushWarningContext$1(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext$1(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } +} + +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= ~1; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= ~1; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= ~1; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= ~1; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = (job) => checkRecursiveUpdates(seen, job) ; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= ~1; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Map(); +{ + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); +} +function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} + +let devtools; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools) { + devtools.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook(hook, target) { + var _a, _b; + devtools = hook; + if (devtools) { + devtools.enabled = true; + buffer.forEach(({ event, args }) => devtools.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook(newHook, target); + }); + setTimeout(() => { + if (!devtools) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance$1(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance$1(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance$1(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} + +const TeleportEndKey = Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; + +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} + +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} + +const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if (!owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { + { + if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + return hasOwn(rawSetupState, key); + }; + if (oldRef != null && oldRef !== ref) { + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (isRef(oldRef)) { + oldRef.value = null; + } + } + if (isFunction(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = isString(ref); + const _isRef = isRef(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if (canSetSetupRef(ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if (canSetSetupRef(ref)) { + setupState[ref] = value; + } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) refs[rawRef.k] = value; + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); + } + } else { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); + } + } +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else { + const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); + +function ensureValidVNode$1(vnodes) { + return vnodes.some((child) => { + if (!isVNode$2(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode$1(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => shallowReadonly(i.props) , + $attrs: (i) => shallowReadonly(i.attrs) , + $slots: (i) => shallowReadonly(i.slots) , + $refs: (i) => shallowReadonly(i.refs) , + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + markAttrsAccessed(); + } else if (key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + data[key] = value; + return true; + } else if (hasOwn(instance.props, key)) { + warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if (key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); + } else { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +{ + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` + ); + return Reflect.ownKeys(target); + }; +} +function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: NOOP + }); + }); + return target; +} +function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: NOOP + }); + }); + } +} +function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys(toRaw(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; + } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: NOOP + }); + } + }); +} + +function normalizePropsOrEmits(props) { + return isArray(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} + +function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); + } else { + cache[key] = type; + } + }; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = createDuplicateChecker() ; + { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } + } + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (isFunction(methodHandler)) { + { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } + { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } + } + } + if (dataOptions) { + if (!isFunction(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` + ); + } + const data = dataOptions.call(publicThis, publicThis); + if (isPromise(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + ); + } + if (!isObject(data)) { + warn$1(`data() should return an object.`); + } else { + instance.data = reactive(data); + { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: NOOP + }); + } + } + } + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; + if (get === NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } ; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + { + checkDuplicateProperties("Computed" /* COMPUTED */, key); + } + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { + if (isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (isObject(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + { + checkDuplicateProperties("Inject" /* INJECT */, key); + } + } +} +function callHook(hook, instance, type) { + callWithAsyncErrorHandling( + isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (isString(raw)) { + const handler = ctx[raw]; + if (isFunction(handler)) { + { + watch(getter, handler); + } + } else { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); + } + } else if (isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (isObject(raw)) { + if (isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction(handler)) { + watch(getter, handler, raw); + } else { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); + } + } + } else { + warn$1(`Invalid watch option: "${key}"`, raw); + } +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (isObject(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") { + warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); + } else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return (extend)( + isFunction(to) ? to.call(this, this) : to, + isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray(to) && isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!isFunction(rootComponent)) { + rootComponent = extend({}, rootComponent); + } + if (rootProps != null && !isObject(rootProps)) { + warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); + } + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); + } + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") + ); + } + } + return app; + }, + component(name, component) { + { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if (context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if (context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if (rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + ); + } + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + { + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + { + app._instance = vnode.component; + devtoolsInitApp(app, version); + } + return getComponentPublicInstance(vnode.component); + } else { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` + ); + } + }, + onUnmount(cleanupFn) { + if (typeof cleanupFn !== "function") { + warn$1( + `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` + ); + } + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + { + app._instance = null; + devtoolsUnmountApp(app); + } + delete app._container.__vue_app__; + } else { + warn$1(`Cannot unmount an app that is not mounted.`); + } + }, + provide(key, value) { + if (key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` + ); + } + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) { + { + warn$1(`provide() can only be used inside setup().`); + } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else { + warn$1(`injection "${String(key)}" not found.`); + } + } else { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} + +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) return true; + instance = instance.parent; + } +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + trigger(instance.attrs, "set", ""); + } + { + validateProps(rawProps || {}, props, instance); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && hasOwn(options, camelKey = camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = toRaw(props); + const castValues = rawCastValues || EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, EMPTY_ARR); + } + return EMPTY_ARR; + } + if (isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + if (!isString(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); + } + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = EMPTY_OBJ; + } + } + } else if (raw) { + if (!isObject(raw)) { + warn$1(`invalid props options`, raw); + } + for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = isFunction(propType) && propType.name === "Boolean"; + } + prop[0 /* shouldCast */] = shouldCast; + prop[1 /* shouldCastTrue */] = shouldCastTrue; + if (shouldCast || hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (isObject(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !isReservedProp(key)) { + return true; + } else { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; +} +function getType(ctor) { + if (ctor === null) { + return "null"; + } + if (typeof ctor === "function") { + return ctor.name || ""; + } else if (typeof ctor === "object") { + const name = ctor.constructor && ctor.constructor.name; + return name || ""; + } + return ""; +} +function validateProps(rawProps, props, instance) { + const resolvedValues = toRaw(props); + const options = instance.propsOptions[0]; + const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); + for (const key in options) { + let opt = options[key]; + if (opt == null) continue; + validateProp( + key, + resolvedValues[key], + opt, + shallowReadonly(resolvedValues) , + !camelizePropsKey.includes(key) + ); + } +} +function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = isArray(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); + return; + } + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } +} +const isSimpleType = /* @__PURE__ */ makeMap( + "String,Number,Boolean,Function,Symbol,BigInt" +); +function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (expectedType === "null") { + valid = value === null; + } else if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; + } + } else if (expectedType === "Object") { + valid = isObject(value); + } else if (expectedType === "Array") { + valid = isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + }; +} +function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; + } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message; +} +function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } +} +function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); +} +function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); +} + +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode$1) : [normalizeVNode$1(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + ); + } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + if (!isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || key !== "_") { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (isHmrUpdating) { + assignSlots(slots, children, optimized); + trigger(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; + +let supported; +let perf; +function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } +} +function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; + } else { + supported = false; + } + return supported; +} + +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function baseCreateRenderer(options, createHydrationFns) { + const target = getGlobalThis(); + target.__VUE__ = true; + { + setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } + } + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); + } else { + n2.el = n1.el; + n2.anchor = n1.anchor; + } + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + { + def(el, "__vnode", vnode, true); + def(el, "__vueParentComponent", parentComponent, true); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; + } + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + { + el.__vnode = n2; + } + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || EMPTY_OBJ; + const newProps = n2.props || EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if (isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== EMPTY_OBJ) { + for (const key in oldProps) { + if (!isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if ( + // #5523 dev root fragment may inherit directives + isHmrUpdating || patchFlag & 2048 + ) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + { + traverseStaticChildren(n1, n2); + } + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); + } else { + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); + } + } else { + updateComponent(n1, n2, optimized); + } + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance$1( + initialVNode, + parentComponent, + parentSuspense + )); + if (instance.type.__hmrId) { + registerHMR(instance); + } + { + pushWarningContext$1(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + { + startMeasure(instance, `init`); + } + setupComponent$1(instance, false, optimized); + { + endMeasure(instance, `init`); + } + } + if (instance.asyncDep) { + if (isHmrUpdating) initialVNode.el = null; + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); + } + } else { + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); + } + { + popWarningContext$1(); + endMeasure(instance, `mount`); + } + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + { + pushWarningContext$1(n2); + } + updateComponentPreRender(instance, n2, optimized); + { + popWarningContext$1(); + } + return; + } else { + instance.next = n2; + instance.update(); + } + } else { + n2.el = n1.el; + instance.vnode = n2; + } + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent, root, type } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + invokeArrayFns(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot$1(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + { + endMeasure(instance, `hydrate`); + } + }; + if (isAsyncWrapperVNode && type.__asyncHydrate) { + type.__asyncHydrate( + el, + instance, + hydrateSubTree + ); + } else { + hydrateSubTree(); + } + } else { + if (root.ce) { + root.ce._injectChildStyle(type); + } + { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot$1(instance); + { + endMeasure(instance, `render`); + } + { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; + } + } + let originNext = next; + let vnodeHook; + { + pushWarningContext$1(next || instance.vnode); + } + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; + } + if (bu) { + invokeArrayFns(bu); + } + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); + } + toggleRecurse(instance, true); + { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot$1(instance); + { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + { + devtoolsComponentUpdated(instance); + } + { + popWarningContext$1(); + } + } + }; + instance.scope.on(); + const effect = instance.effect = new ReactiveEffect(componentUpdateFn); + instance.scope.off(); + const update = instance.update = effect.run.bind(effect); + const job = instance.job = effect.runIfDirty.bind(effect); + job.i = instance; + job.id = instance.uid; + effect.scheduler = () => queueJob(job); + toggleRecurse(instance, true); + { + effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; + } + update(); + }; + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + pauseTracking(); + flushPreFlushCbs(instance); + resetTracking(); + }; + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + return; + } + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); + } + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + } + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || EMPTY_ARR; + c2 = c2 || EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + i++; + } + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode$1(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; + } + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } + } + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; + } + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]); + if (nextChild.key != null) { + if (keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } + } + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; + } + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); + } else { + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; + } + } + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } + } + } + }; + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); + return; + } + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; + } + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); + return; + } + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; + } + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; + } + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { + transition.beforeEnter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); + } else { + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } + } + } else { + hostInsert(el, container, anchor); + } + }; + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs, + cacheIndex + } = vnode; + if (patchFlag === -2) { + optimized = false; + } + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (cacheIndex != null) { + parentComponent.renderCache[cacheIndex] = void 0; + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); + return; + } + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + internals, + doRemove + ); + } else if (dynamicChildren && // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); + } + }; + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); + } + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); + } + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); + } + }; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; + } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if (instance.type.__hmrId) { + unregisterHMR(instance); + } + const { bum, scope, job, subTree, um, m, a } = instance; + invalidateMount(m); + invalidateMount(a); + if (bum) { + invokeArrayFns(bum); + } + scope.stop(); + if (job) { + job.flags |= 8; + unmount(subTree, instance, parentSuspense, doRemove); + } + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); + } + } + { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + const el = hostNextSibling(vnode.anchor || vnode.el); + const teleportEnd = el && el[TeleportEndKey]; + return teleportEnd ? hostNextSibling(teleportEnd) : el; + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); + } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + container._vnode = vnode; + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; + } + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; +} +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; +} +function toggleRecurse({ effect, job }, allowed) { + if (allowed) { + effect.flags |= 32; + job.flags |= 4; + } else { + effect.flags &= ~32; + job.flags &= ~4; + } +} +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; +} +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if (isArray(ch1) && isArray(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow && c2.patchFlag !== -2) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if (c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } + } +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); + continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } + } + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); + } + } +} +function invalidateMount(hooks) { + if (hooks) { + for (let i = 0; i < hooks.length; i++) + hooks[i].flags |= 8; + } +} + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); + } + return ctx; + } +}; + +function watch(source, cb, options) { + if (!isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = extend({}, options); + baseWatchOptions.onWarn = warn$1; + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = NOOP; + watchStopHandle.resume = NOOP; + watchStopHandle.pause = NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch$1(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} + +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; +}; + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(looseToNumber); + } + } + { + devtoolsComponentEmit(instance, event, args); + } + { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot$1(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance$1(instance); + let result; + let fallthroughAttrs; + { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode$1( + render.call( + thisProxy, + proxyToUse, + renderCache, + true ? shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode$1( + render2.length > 1 ? render2( + true ? shallowReadonly(props) : props, + true ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs); + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + true ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } else if (!accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` + ); + } + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); + } + setTransitionHooks(root, vnode.transition); + } + if (setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance$1(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { + return getChildRoot(childRoot); + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode$1(childRoot), setRoot]; +}; +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode$2(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ((prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} + +const isSuspense = (type) => type.__isSuspense; +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} + +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +let currentBlock = null; +let isBlockTreeEnabled = 1; +function setBlockTracking(value, inVOnce = false) { + isBlockTreeEnabled += value; + if (value < 0 && currentBlock && inVOnce) { + currentBlock.hasOnce = true; + } +} +function isVNode$2(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + if (n2.shapeFlag & 6 && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type); + if (dirtyInstances && dirtyInstances.has(n1.component)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; + } + } + return n1.type === n2.type && n1.key === n2.key; +} +const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...args + ); +}; +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; + } + return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +}; +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetStart: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); + } + } else if (children) { + vnode.shapeFlag |= isString(children) ? 8 : 16; + } + if (vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); + } + return vnode; +} +const createVNode = createVNodeWithArgsTransform ; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if (!type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); + } + type = Comment; + } + if (isVNode$2(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ + ); + if (children) { + normalizeChildren(cloned, children); + } + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } + } + cloned.patchFlag = -2; + return cloned; + } + if (isClassComponent(type)) { + type = type.__vccOpts; + } + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (isObject(style)) { + if (isProxy(style) && !isArray(style)) { + style = extend({}, style); + } + props.style = normalizeStyle(style); + } + } + const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; + if (shapeFlag & 4 && isProxy(type)) { + type = toRaw(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); + } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); +} +function guardReactiveProps(props) { + if (!props) return null; + return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { + const { props, ref, patchFlag, children, transition } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetStart: vnode.targetStart, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + if (transition && cloneTransition) { + setTransitionHooks( + cloned, + transition.clone(cloned) + ); + } + return cloned; +} +function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if (isArray(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); + } + return cloned; +} +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function normalizeVNode$1(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if (isArray(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (isVNode$2(child)) { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); + } +} +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if (isArray(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !isInternalObject(children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } + } + } else if (isFunction(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; + } + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = normalizeClass([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = normalizeStyle([ret.style, toMerge.style]); + } else if (isOn(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; + } + } else if (key !== "") { + ret[key] = toMerge[key]; + } + } + } + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} + +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance$1(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + job: null, + scope: new EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + ids: parent ? parent.ids : ["", 0, 0], + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: EMPTY_OBJ, + data: EMPTY_OBJ, + props: EMPTY_OBJ, + attrs: EMPTY_OBJ, + slots: EMPTY_OBJ, + refs: EMPTY_OBJ, + setupState: EMPTY_OBJ, + setupContext: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + { + instance.ctx = createDevRenderContext(instance); + } + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); + } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => currentInstance || currentRenderingInstance; +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); +} +const setCurrentInstance = (instance) => { + const prev = currentInstance; + internalSetCurrentInstance(instance); + instance.scope.on(); + return () => { + instance.scope.off(); + internalSetCurrentInstance(prev); + }; +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component"); +function validateComponentName(name, { isNativeTag }) { + if (isBuiltInTag(name) || isNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); + } +} +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent$1(instance, isSSR = false, optimized = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children, optimized); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); + } + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); + } + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } + } + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); + { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + pauseTracking(); + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + const reset = setCurrentInstance(instance); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + shallowReadonly(instance.props) , + setupContext + ] + ); + const isAsyncSetup = isPromise(setupResult); + resetTracking(); + reset(); + if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { + markAsyncBoundary(instance); + } + if (isAsyncSetup) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if (!instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); + } + } else { + finishComponentSetup(instance, isSSR); + } +} +function handleSetupResult(instance, setupResult, isSSR) { + if (isFunction(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if (isObject(setupResult)) { + if (isVNode$2(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = proxyRefs(setupResult); + { + exposeSetupStateOnRenderContext(instance); + } + } else if (setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); +} +let compile; +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + { + startMeasure(instance, `compile`); + } + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = extend( + extend( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + { + endMeasure(instance, `compile`); + } + } + } + instance.render = Component.render || NOOP; + } + { + const reset = setCurrentInstance(instance); + pauseTracking(); + try { + applyOptions(instance); + } finally { + resetTracking(); + reset(); + } + } + if (!Component.render && instance.render === NOOP && !isSSR) { + if (Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` ) + ); + } else { + warn$1(`Component is missing template or render function: `, Component); + } + } +} +const attrsProxyHandlers = { + get(target, key) { + markAttrsAccessed(); + track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } +} ; +function getSlotsProxy(instance) { + return new Proxy(instance.slots, { + get(target, key) { + track(instance, "get", "$slots"); + return target[key]; + } + }); +} +function createSetupContext(instance) { + const expose = (exposed) => { + { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if (isArray(exposed)) { + exposedType = "array"; + } else if (isRef(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + { + let attrsProxy; + let slotsProxy; + return Object.freeze({ + get attrs() { + return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); + }, + get slots() { + return slotsProxy || (slotsProxy = getSlotsProxy(instance)); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } +} +function getComponentPublicInstance(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); + } else { + return instance.proxy; + } +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return isFunction(value) && "__vccOpts" in value; +} + +const computed = (getterOrOptions, debugOptions) => { + const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); + { + const i = getCurrentInstance(); + if (i && i.appContext.config.warnRecursiveComputed) { + c._warnRecursive = true; + } + } + return c; +}; + +const version = "3.5.13"; +const warn = warn$1 ; +const _ssrUtils = { + createComponentInstance: createComponentInstance$1, + setupComponent: setupComponent$1, + renderComponentRoot: renderComponentRoot$1, + setCurrentRenderingInstance: setCurrentRenderingInstance$1, + isVNode: isVNode$2, + normalizeVNode: normalizeVNode$1, + getComponentPublicInstance, + ensureValidVNode: ensureValidVNode$1, + pushWarningContext: pushWarningContext$1, + popWarningContext: popWarningContext$1 +}; +const ssrUtils = _ssrUtils ; + +let policy = void 0; +const tt = typeof window !== "undefined" && window.trustedTypes; +if (tt) { + try { + policy = /* @__PURE__ */ tt.createPolicy("vue", { + createHTML: (val) => val + }); + } catch (e) { + warn(`Error creating trusted types policy: ${e}`); + } +} +const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) break; + } + } else { + templateContainer.innerHTML = unsafeToTrustedHTML( + namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content + ); + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; + +const vtcKey = Symbol("_vtc"); + +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); + } + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; + } +} + +const vShowOriginalDisplay = Symbol("_vod"); +const vShowHidden = Symbol("_vsh"); + +const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" ); + +const displayRE = /(^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = isString(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) { + if (!isString(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } else { + for (const prevStyle of prev.split(";")) { + const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + } + for (const key in next) { + if (key === "display") { + hasControlledDisplay = true; + } + setStyle(style, key, next[key]); + } + } else { + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + hasControlledDisplay = displayRE.test(next); + } + } else if (prev) { + el.removeAttribute("style"); + } + } + if (vShowOriginalDisplay in el) { + el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; + if (el[vShowHidden]) { + style.display = "none"; + } + } +} +const semicolonRE = /[^\\];\s*$/; +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if (isArray(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) val = ""; + { + if (semicolonRE.test(val)) { + warn( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } + } + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + hyphenate(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } + } + } +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; + } + let name = camelize(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; + } + name = capitalize(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } + } + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (value == null || isBoolean && !includeBooleanAttr(value)) { + el.removeAttribute(key); + } else { + el.setAttribute( + key, + isBoolean ? "" : isSymbol(value) ? String(value) : value + ); + } + } +} + +function patchDOMProp(el, key, value, parentComponent, attrName) { + if (key === "innerHTML" || key === "textContent") { + if (value != null) { + el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; + } + return; + } + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; + const newValue = value == null ? ( + // #11647: value should be set as empty string for null and undefined, + // but <input type="checkbox"> should be set as 'on'. + el.type === "checkbox" ? "on" : "" + ) : String(value); + if (oldValue !== newValue || !("_value" in el)) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + el._value = value; + return; + } + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = includeBooleanAttr(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } + } + try { + el[key] = value; + } catch (e) { + if (!needRemove) { + warn( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(attrName || key); +} + +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; + } else { + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker( + sanitizeEventValue(nextValue, rawName) , + instance + ); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } + } +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; + } + } + const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { + return; + } + callWithAsyncErrorHandling( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function sanitizeEventValue(value, propName) { + if (isFunction(value) || isArray(value)) { + return value; + } + warn( + `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? +Expected function or array of functions, received type ${typeof value}.` + ); + return NOOP; +} +function patchStopImmediatePropagation(e, value) { + if (isArray(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map( + (fn) => (e2) => !e2._stopped && fn && fn(e2) + ); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if (isOn(key)) { + if (!isModelListener(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); + } + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp(el, key, nextValue); + if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { + patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); + } + } else if ( + // #11081 force set props for possible async custom element + el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue)) + ) { + patchDOMProp(el, camelize(key), nextValue, parentComponent, key); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } +}; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && isFunction(value)) { + return true; + } + return false; + } + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; + } + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; + } + } + if (isNativeOn(key) && isString(value)) { + return false; + } + return key in el; +} + +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = looseToNumber(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); + } + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); + } + }, + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; + }, + beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) return; + const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; + } + if (document.activeElement === el && el.type !== "range") { + if (lazy && value === oldValue) { + return; + } + if (trim && el.value.trim() === newValue) { + return; + } + } + el.value = newValue; + } +}; +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if (isArray(modelValue)) { + const index = looseIndexOf(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if (isSet(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } +}; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + let checked; + if (isArray(value)) { + checked = looseIndexOf(value, vnode.props.value) > -1; + } else if (isSet(value)) { + checked = value.has(vnode.props.value); + } else { + if (value === oldValue) return; + checked = looseEqual(value, getCheckboxValue(el, true)); + } + if (el.checked !== checked) { + el.checked = checked; + } +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = looseEqual(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = looseEqual(value, vnode.props.value); + } + } +}; +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && looseEqual(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if (isArray(value)) { + if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if (isSet(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; +} + +const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); +let renderer; +function ensureRenderer() { + return renderer || (renderer = createRenderer(rendererOptions)); +} +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); + } + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!isFunction(component) && !component.render && !component.template) { + component.template = container.innerHTML; + } + if (container.nodeType === 1) { + container.textContent = ""; + } + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); + } + return proxy; + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; + } + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; + } +} +function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag), + writable: false + }); +} +function injectCompilerOptionsCheck(app) { + { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + warn( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + warn(msg); + return compilerOptions; + }, + set() { + warn(msg); + } + }); + } +} +function normalizeContainer(container) { + if (isString(container)) { + const res = document.querySelector(container); + if (!res) { + warn( + `Failed to mount app: mount target selector "${container}" returned null.` + ); + } + return res; + } + if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + warn( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); + } + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + } +} ; + +const shouldIgnoreProp = /* @__PURE__ */ makeMap( + `,key,ref,innerHTML,textContent,ref_key,ref_for` +); +function ssrRenderAttrs(props, tag) { + let ret = ""; + for (const key in props) { + if (shouldIgnoreProp(key) || isOn(key) || tag === "textarea" && key === "value") { + continue; + } + const value = props[key]; + if (key === "class") { + ret += ` class="${ssrRenderClass(value)}"`; + } else if (key === "style") { + ret += ` style="${ssrRenderStyle(value)}"`; + } else if (key === "className") { + ret += ` class="${String(value)}"`; + } else { + ret += ssrRenderDynamicAttr(key, value, tag); + } + } + return ret; +} +function ssrRenderDynamicAttr(key, value, tag) { + if (!isRenderableAttrValue(value)) { + return ``; + } + const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase(); + if (isBooleanAttr(attrKey)) { + return includeBooleanAttr(value) ? ` ${attrKey}` : ``; + } else if (isSSRSafeAttrName(attrKey)) { + return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`; + } else { + console.warn( + `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}` + ); + return ``; + } +} +function ssrRenderAttr(key, value) { + if (!isRenderableAttrValue(value)) { + return ``; + } + return ` ${key}="${escapeHtml(value)}"`; +} +function ssrRenderClass(raw) { + return escapeHtml(normalizeClass(raw)); +} +function ssrRenderStyle(raw) { + if (!raw) { + return ""; + } + if (isString(raw)) { + return escapeHtml(raw); + } + const styles = normalizeStyle(raw); + return escapeHtml(stringifyStyle(styles)); +} + +function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) { + return renderComponentVNode( + createVNode(comp, props, children), + parentComponent, + slotScopeId + ); +} + +const { ensureValidVNode } = ssrUtils; +function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) { + push(`<!--[-->`); + ssrRenderSlotInner( + slots, + slotName, + slotProps, + fallbackRenderFn, + push, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); +} +function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) { + const slotFn = slots[slotName]; + if (slotFn) { + const slotBuffer = []; + const bufferedPush = (item) => { + slotBuffer.push(item); + }; + const ret = slotFn( + slotProps, + bufferedPush, + parentComponent, + slotScopeId ? " " + slotScopeId : "" + ); + if (isArray(ret)) { + const validSlotContent = ensureValidVNode(ret); + if (validSlotContent) { + renderVNodeChildren( + push, + validSlotContent, + parentComponent, + slotScopeId + ); + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let isEmptySlot = true; + if (transition) { + isEmptySlot = false; + } else { + for (let i = 0; i < slotBuffer.length; i++) { + if (!isComment(slotBuffer[i])) { + isEmptySlot = false; + break; + } + } + } + if (isEmptySlot) { + if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let start = 0; + let end = slotBuffer.length; + if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") { + start++; + end--; + } + for (let i = start; i < end; i++) { + push(slotBuffer[i]); + } + } + } + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } +} +const commentTestRE = /^<!--[\s\S]*-->$/; +const commentRE = /<!--[^]*?-->/gm; +function isComment(item) { + if (typeof item !== "string" || !commentTestRE.test(item)) return false; + if (item.length <= 8) return true; + return !item.replace(commentRE, "").trim(); +} + +function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) { + parentPush("<!--teleport start-->"); + const context = parentComponent.appContext.provides[ssrContextKey]; + const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {}); + const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []); + const bufferIndex = targetBuffer.length; + let teleportContent; + if (disabled) { + contentRenderFn(parentPush); + teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`; + } else { + const { getBuffer, push } = createBuffer(); + push(`<!--teleport start anchor-->`); + contentRenderFn(push); + push(`<!--teleport anchor-->`); + teleportContent = getBuffer(); + } + targetBuffer.splice(bufferIndex, 0, teleportContent); + parentPush("<!--teleport end-->"); +} + +function ssrInterpolate(value) { + return escapeHtml(toDisplayString(value)); +} + +function ssrRenderList(source, renderItem) { + if (isArray(source) || isString(source)) { + for (let i = 0, l = source.length; i < l; i++) { + renderItem(source[i], i); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn(`The v-for range expect an integer value but got ${source}.`); + return; + } + for (let i = 0; i < source; i++) { + renderItem(i + 1, i); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + const arr = Array.from(source); + for (let i = 0, l = arr.length; i < l; i++) { + renderItem(arr[i], i); + } + } else { + const keys = Object.keys(source); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + renderItem(source[key], key, i); + } + } + } +} + +async function ssrRenderSuspense(push, { default: renderContent }) { + if (renderContent) { + renderContent(); + } else { + push(`<!---->`); + } +} + +function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) { + if (typeof dir !== "function" && dir.getSSRProps) { + return dir.getSSRProps( + { + dir, + instance: ssrUtils.getComponentPublicInstance(instance.$), + value, + oldValue: void 0, + arg, + modifiers + }, + null + ) || {}; + } + return {}; +} + +const ssrLooseEqual = looseEqual; +function ssrLooseContain(arr, value) { + return looseIndexOf(arr, value) > -1; +} +function ssrRenderDynamicModel(type, model, value) { + switch (type) { + case "radio": + return looseEqual(model, value) ? " checked" : ""; + case "checkbox": + return (isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : ""; + default: + return ssrRenderAttr("value", model); + } +} +function ssrGetDynamicModelProps(existingProps = {}, model) { + const { type, value } = existingProps; + switch (type) { + case "radio": + return looseEqual(model, value) ? { checked: true } : null; + case "checkbox": + return (isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null; + default: + return { value: model }; + } +} + +function ssrCompile(template, instance) { + { + throw new Error( + `On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.` + ); + } +} + +const { + createComponentInstance, + setCurrentRenderingInstance, + setupComponent, + renderComponentRoot, + normalizeVNode, + pushWarningContext, + popWarningContext +} = ssrUtils; +function createBuffer() { + let appendable = false; + const buffer = []; + return { + getBuffer() { + return buffer; + }, + push(item) { + const isStringItem = isString(item); + if (appendable && isStringItem) { + buffer[buffer.length - 1] += item; + return; + } + buffer.push(item); + appendable = isStringItem; + if (isPromise(item) || isArray(item) && item.hasAsync) { + buffer.hasAsync = true; + } + } + }; +} +function renderComponentVNode(vnode, parentComponent = null, slotScopeId) { + const instance = vnode.component = createComponentInstance( + vnode, + parentComponent, + null + ); + pushWarningContext(vnode); + const res = setupComponent( + instance, + true + /* isSSR */ + ); + popWarningContext(); + const hasAsyncSetup = isPromise(res); + let prefetches = instance.sp; + if (hasAsyncSetup || prefetches) { + const p = Promise.resolve(res).then(() => { + if (hasAsyncSetup) prefetches = instance.sp; + if (prefetches) { + return Promise.all( + prefetches.map((prefetch) => prefetch.call(instance.proxy)) + ); + } + }).catch(NOOP); + return p.then(() => renderComponentSubTree(instance, slotScopeId)); + } else { + return renderComponentSubTree(instance, slotScopeId); + } +} +function renderComponentSubTree(instance, slotScopeId) { + pushWarningContext(instance.vnode); + const comp = instance.type; + const { getBuffer, push } = createBuffer(); + if (isFunction(comp)) { + let root = renderComponentRoot(instance); + if (!comp.props) { + for (const key in instance.attrs) { + if (key.startsWith(`data-v-`)) { + (root.props || (root.props = {}))[key] = ``; + } + } + } + renderVNode(push, instance.subTree = root, instance, slotScopeId); + } else { + if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) { + comp.ssrRender = ssrCompile(comp.template); + } + const ssrRender = instance.ssrRender || comp.ssrRender; + if (ssrRender) { + let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0; + let hasCloned = false; + let cur = instance; + while (true) { + const scopeId = cur.vnode.scopeId; + if (scopeId) { + if (!hasCloned) { + attrs = { ...attrs }; + hasCloned = true; + } + attrs[scopeId] = ""; + } + const parent = cur.parent; + if (parent && parent.subTree && parent.subTree === cur.vnode) { + cur = parent; + } else { + break; + } + } + if (slotScopeId) { + if (!hasCloned) attrs = { ...attrs }; + const slotScopeIdList = slotScopeId.trim().split(" "); + for (let i = 0; i < slotScopeIdList.length; i++) { + attrs[slotScopeIdList[i]] = ""; + } + } + const prev = setCurrentRenderingInstance(instance); + try { + ssrRender( + instance.proxy, + push, + instance, + attrs, + // compiler-optimized bindings + instance.props, + instance.setupState, + instance.data, + instance.ctx + ); + } finally { + setCurrentRenderingInstance(prev); + } + } else if (instance.render && instance.render !== NOOP) { + renderVNode( + push, + instance.subTree = renderComponentRoot(instance), + instance, + slotScopeId + ); + } else { + const componentName = comp.name || comp.__file || `<Anonymous>`; + warn(`Component ${componentName} is missing template or render function.`); + push(`<!---->`); + } + } + popWarningContext(); + return getBuffer(); +} +function renderVNode(push, vnode, parentComponent, slotScopeId) { + const { type, shapeFlag, children, dirs, props } = vnode; + if (dirs) { + vnode.props = applySSRDirectives(vnode, props, dirs); + } + switch (type) { + case Text: + push(escapeHtml(children)); + break; + case Comment: + push( + children ? `<!--${escapeHtmlComment(children)}-->` : `<!---->` + ); + break; + case Static: + push(children); + break; + case Fragment: + if (vnode.slotScopeIds) { + slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" "); + } + push(`<!--[-->`); + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); + break; + default: + if (shapeFlag & 1) { + renderElementVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 6) { + push(renderComponentVNode(vnode, parentComponent, slotScopeId)); + } else if (shapeFlag & 64) { + renderTeleportVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 128) { + renderVNode(push, vnode.ssContent, parentComponent, slotScopeId); + } else { + warn( + "[@vue/server-renderer] Invalid VNode type:", + type, + `(${typeof type})` + ); + } + } +} +function renderVNodeChildren(push, children, parentComponent, slotScopeId) { + for (let i = 0; i < children.length; i++) { + renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId); + } +} +function renderElementVNode(push, vnode, parentComponent, slotScopeId) { + const tag = vnode.type; + let { props, children, shapeFlag, scopeId } = vnode; + let openTag = `<${tag}`; + if (props) { + openTag += ssrRenderAttrs(props, tag); + } + if (scopeId) { + openTag += ` ${scopeId}`; + } + let curParent = parentComponent; + let curVnode = vnode; + while (curParent && curVnode === curParent.subTree) { + curVnode = curParent.vnode; + if (curVnode.scopeId) { + openTag += ` ${curVnode.scopeId}`; + } + curParent = curParent.parent; + } + if (slotScopeId) { + openTag += ` ${slotScopeId}`; + } + push(openTag + `>`); + if (!isVoidTag(tag)) { + let hasChildrenOverride = false; + if (props) { + if (props.innerHTML) { + hasChildrenOverride = true; + push(props.innerHTML); + } else if (props.textContent) { + hasChildrenOverride = true; + push(escapeHtml(props.textContent)); + } else if (tag === "textarea" && props.value) { + hasChildrenOverride = true; + push(escapeHtml(props.value)); + } + } + if (!hasChildrenOverride) { + if (shapeFlag & 8) { + push(escapeHtml(children)); + } else if (shapeFlag & 16) { + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + } + } + push(`</${tag}>`); + } +} +function applySSRDirectives(vnode, rawProps, dirs) { + const toMerge = []; + for (let i = 0; i < dirs.length; i++) { + const binding = dirs[i]; + const { + dir: { getSSRProps } + } = binding; + if (getSSRProps) { + const props = getSSRProps(binding, vnode); + if (props) toMerge.push(props); + } + } + return mergeProps(rawProps || {}, ...toMerge); +} +function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) { + const target = vnode.props && vnode.props.to; + const disabled = vnode.props && vnode.props.disabled; + if (!target) { + if (!disabled) { + warn(`[@vue/server-renderer] Teleport is missing target prop.`); + } + return []; + } + if (!isString(target)) { + warn( + `[@vue/server-renderer] Teleport target must be a query selector string.` + ); + return []; + } + ssrRenderTeleport( + push, + (push2) => { + renderVNodeChildren( + push2, + vnode.children, + parentComponent, + slotScopeId + ); + }, + target, + disabled || disabled === "", + parentComponent + ); +} + +const { isVNode: isVNode$1 } = ssrUtils; +function nestedUnrollBuffer(buffer, parentRet, startIndex) { + if (!buffer.hasAsync) { + return parentRet + unrollBufferSync$1(buffer); + } + let ret = parentRet; + for (let i = startIndex; i < buffer.length; i += 1) { + const item = buffer[i]; + if (isString(item)) { + ret += item; + continue; + } + if (isPromise(item)) { + return item.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, ret, i); + }); + } + const result = nestedUnrollBuffer(item, ret, 0); + if (isPromise(result)) { + return result.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, "", i); + }); + } + ret = result; + } + return ret; +} +function unrollBuffer$1(buffer) { + return nestedUnrollBuffer(buffer, "", 0); +} +function unrollBufferSync$1(buffer) { + let ret = ""; + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isString(item)) { + ret += item; + } else { + ret += unrollBufferSync$1(item); + } + } + return ret; +} +async function renderToString(input, context = {}) { + if (isVNode$1(input)) { + return renderToString(createApp({ render: () => input }), context); + } + const vnode = createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(ssrContextKey, context); + const buffer = await renderComponentVNode(vnode); + const result = await unrollBuffer$1(buffer); + await resolveTeleports(context); + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + return result; +} +async function resolveTeleports(context) { + if (context.__teleportBuffers) { + context.teleports = context.teleports || {}; + for (const key in context.__teleportBuffers) { + context.teleports[key] = await unrollBuffer$1( + await Promise.all([context.__teleportBuffers[key]]) + ); + } + } +} + +const { isVNode } = ssrUtils; +async function unrollBuffer(buffer, stream) { + if (buffer.hasAsync) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isPromise(item)) { + item = await item; + } + if (isString(item)) { + stream.push(item); + } else { + await unrollBuffer(item, stream); + } + } + } else { + unrollBufferSync(buffer, stream); + } +} +function unrollBufferSync(buffer, stream) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isString(item)) { + stream.push(item); + } else { + unrollBufferSync(item, stream); + } + } +} +function renderToSimpleStream(input, context, stream) { + if (isVNode(input)) { + return renderToSimpleStream( + createApp({ render: () => input }), + context, + stream + ); + } + const vnode = createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(ssrContextKey, context); + Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => { + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + }).then(() => stream.push(null)).catch((error) => { + stream.destroy(error); + }); + return stream; +} +function renderToStream(input, context = {}) { + console.warn( + `[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.` + ); + return renderToNodeStream(input, context); +} +function renderToNodeStream(input, context = {}) { + { + throw new Error( + `ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.` + ); + } +} +function pipeToNodeWritable(input, context = {}, writable) { + renderToSimpleStream(input, context, { + push(content) { + if (content != null) { + writable.write(content); + } else { + writable.end(); + } + }, + destroy(err) { + writable.destroy(err); + } + }); +} +function renderToWebStream(input, context = {}) { + if (typeof ReadableStream !== "function") { + throw new Error( + `ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.` + ); + } + const encoder = new TextEncoder(); + let cancelled = false; + return new ReadableStream({ + start(controller) { + renderToSimpleStream(input, context, { + push(content) { + if (cancelled) return; + if (content != null) { + controller.enqueue(encoder.encode(content)); + } else { + controller.close(); + } + }, + destroy(err) { + controller.error(err); + } + }); + }, + cancel() { + cancelled = true; + } + }); +} +function pipeToWebWritable(input, context = {}, writable) { + const writer = writable.getWriter(); + const encoder = new TextEncoder(); + let hasReady = false; + try { + hasReady = isPromise(writer.ready); + } catch (e) { + } + renderToSimpleStream(input, context, { + async push(content) { + if (hasReady) { + await writer.ready; + } + if (content != null) { + return writer.write(encoder.encode(content)); + } else { + return writer.close(); + } + }, + destroy(err) { + console.log(err); + writer.close(); + } + }); +} + +initDirectivesForSSR(); + +export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode }; diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js new file mode 100644 index 0000000..c0cfd01 --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js @@ -0,0 +1,5 @@ +/** +* @vue/server-renderer v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let e,t,n,l,r,i,s,o,a,u,c;function f(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let p={},d=[],h=()=>{},g=()=>!1,m=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),y=e=>e.startsWith("onUpdate:"),_=Object.assign,b=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},x=Object.prototype.hasOwnProperty,S=(e,t)=>x.call(e,t),w=Array.isArray,k=e=>"[object Map]"===$(e),C=e=>"[object Set]"===$(e),T=e=>"[object Date]"===$(e),O=e=>"function"==typeof e,R=e=>"string"==typeof e,P=e=>"symbol"==typeof e,E=e=>null!==e&&"object"==typeof e,M=e=>(E(e)||O(e))&&O(e.then)&&O(e.catch),A=Object.prototype.toString,$=e=>A.call(e),j=e=>$(e).slice(8,-1),D=e=>"[object Object]"===$(e),I=e=>R(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,N=f(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),F=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},L=/-(\w)/g,V=F(e=>e.replace(L,(e,t)=>t?t.toUpperCase():"")),W=/\B([A-Z])/g,U=F(e=>e.replace(W,"-$1").toLowerCase()),B=F(e=>e.charAt(0).toUpperCase()+e.slice(1)),H=F(e=>e?`on${B(e)}`:""),q=(e,t)=>!Object.is(e,t),G=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},z=(e,t,n,l=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},K=e=>{let t=parseFloat(e);return isNaN(t)?e:t},J=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Z(e){if(w(e)){let t={};for(let n=0;n<e.length;n++){let l=e[n],r=R(l)?function(e){let t={};return e.replace(Y,"").split(X).forEach(e=>{if(e){let n=e.split(Q);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):Z(l);if(r)for(let e in r)t[e]=r[e]}return t}if(R(e)||E(e))return e}let X=/;(?![^(]*\))/g,Q=/:([^]+)/,Y=/\/\*[^]*?\*\//g;function ee(e){let t="";if(R(e))t=e;else if(w(e))for(let n=0;n<e.length;n++){let l=ee(e[n]);l&&(t+=l+" ")}else if(E(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}let et=f("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),en=f("area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"),el="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",er=f(el),ei=f(el+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function es(e){return!!e||""===e}let eo=/[>/="'\u0009\u000a\u000c\u0020]/,ea={},eu={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};function ec(e){if(null==e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t}let ef=/["'&<>]/;function ep(e){let t,n;let l=""+e,r=ef.exec(l);if(!r)return l;let i="",s=0;for(n=r.index;n<l.length;n++){switch(l.charCodeAt(n)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}s!==n&&(i+=l.slice(s,n)),s=n+1,i+=t}return s!==n?i+l.slice(s,n):i}let ed=/^-?>|<!--|-->|--!>|<!-$/g;function eh(e,t){if(e===t)return!0;let n=T(e),l=T(t);if(n||l)return!!n&&!!l&&e.getTime()===t.getTime();if(n=P(e),l=P(t),n||l)return e===t;if(n=w(e),l=w(t),n||l)return!!n&&!!l&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let l=0;n&&l<e.length;l++)n=eh(e[l],t[l]);return n}(e,t);if(n=E(e),l=E(t),n||l){if(!n||!l||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let l=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(l&&!r||!l&&r||!eh(e[n],t[n]))return!1}}return String(e)===String(t)}function eg(e,t){return e.findIndex(e=>eh(e,t))}let ev=e=>!!(e&&!0===e.__v_isRef),em=e=>R(e)?e:null==e?"":w(e)||E(e)&&(e.toString===A||!O(e.toString))?ev(e)?em(e.value):JSON.stringify(e,ey,2):String(e),ey=(e,t)=>ev(t)?ey(e,t.value):k(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[e_(t,l)+" =>"]=n,e),{})}:C(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>e_(e))}:P(t)?e_(t):!E(t)||w(t)||D(t)?t:String(t),e_=(e,t="")=>{var n;return P(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class eb{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=t,!e&&t&&(this.index=(t.scopes||(t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let n=t;try{return t=this,e()}finally{t=n}}}on(){t=this}off(){t=this.parent}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,this.effects.length=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}let ex=new WeakSet;class eS{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,t&&t.active&&t.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ex.has(this)&&(ex.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||ek(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,eD(this),eT(this);let e=n,t=eM;n=this,eM=!0;try{return this.fn()}finally{eO(this),n=e,eM=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)eE(e);this.deps=this.depsTail=void 0,eD(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ex.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){eR(this)&&this.run()}get dirty(){return eR(this)}}let ew=0;function ek(e,t=!1){if(e.flags|=8,t){e.next=r,r=e;return}e.next=l,l=e}function eC(){let e;if(!(--ew>0)){if(r){let e=r;for(r=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;l;){let t=l;for(l=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function eT(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eO(e){let t;let n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eE(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function eR(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eP(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eP(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===eI))return;e.globalVersion=eI;let t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!eR(e)){e.flags&=-3;return}let l=n,r=eM;n=e,eM=!0;try{eT(e);let n=e.fn(e._value);(0===t.version||q(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{n=l,eM=r,eO(e),e.flags&=-3}}function eE(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eE(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let eM=!0,eA=[];function e$(){eA.push(eM),eM=!1}function ej(){let e=eA.pop();eM=void 0===e||e}function eD(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=n;n=void 0;try{t()}finally{n=e}}}let eI=0;class eN{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eF{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!n||!eM||n===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==n)t=this.activeLink=new eN(n,this),n.deps?(t.prevDep=n.depsTail,n.depsTail.nextDep=t,n.depsTail=t):n.deps=n.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=n.depsTail,t.nextDep=void 0,n.depsTail.nextDep=t,n.depsTail=t,n.deps===t&&(n.deps=e)}return t}trigger(e){this.version++,eI++,this.notify(e)}notify(e){ew++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{eC()}}}let eL=new WeakMap,eV=Symbol(""),eW=Symbol(""),eU=Symbol("");function eB(e,t,l){if(eM&&n){let t=eL.get(e);t||eL.set(e,t=new Map);let n=t.get(l);n||(t.set(l,n=new eF),n.map=t,n.key=l),n.track()}}function eH(e,t,n,l,r,i){let s=eL.get(e);if(!s){eI++;return}let o=e=>{e&&e.trigger()};if(ew++,"clear"===t)s.forEach(o);else{let r=w(e),i=r&&I(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===eU||!P(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(eU)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eV)),k(e)&&o(s.get(eW)));break;case"delete":!r&&(o(s.get(eV)),k(e)&&o(s.get(eW)));break;case"set":k(e)&&o(s.get(eV))}}eC()}function eq(e){let t=tv(e);return t===e?t:(eB(t,"iterate",eU),th(e)?t:t.map(tm))}function eG(e){return eB(e=tv(e),"iterate",eU),e}let ez={__proto__:null,[Symbol.iterator](){return eK(this,Symbol.iterator,tm)},concat(...e){return eq(this).concat(...e.map(e=>w(e)?eq(e):e))},entries(){return eK(this,"entries",e=>(e[1]=tm(e[1]),e))},every(e,t){return eZ(this,"every",e,t,void 0,arguments)},filter(e,t){return eZ(this,"filter",e,t,e=>e.map(tm),arguments)},find(e,t){return eZ(this,"find",e,t,tm,arguments)},findIndex(e,t){return eZ(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eZ(this,"findLast",e,t,tm,arguments)},findLastIndex(e,t){return eZ(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eZ(this,"forEach",e,t,void 0,arguments)},includes(...e){return eQ(this,"includes",e)},indexOf(...e){return eQ(this,"indexOf",e)},join(e){return eq(this).join(e)},lastIndexOf(...e){return eQ(this,"lastIndexOf",e)},map(e,t){return eZ(this,"map",e,t,void 0,arguments)},pop(){return eY(this,"pop")},push(...e){return eY(this,"push",e)},reduce(e,...t){return eX(this,"reduce",e,t)},reduceRight(e,...t){return eX(this,"reduceRight",e,t)},shift(){return eY(this,"shift")},some(e,t){return eZ(this,"some",e,t,void 0,arguments)},splice(...e){return eY(this,"splice",e)},toReversed(){return eq(this).toReversed()},toSorted(e){return eq(this).toSorted(e)},toSpliced(...e){return eq(this).toSpliced(...e)},unshift(...e){return eY(this,"unshift",e)},values(){return eK(this,"values",tm)}};function eK(e,t,n){let l=eG(e),r=l[t]();return l===e||th(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let eJ=Array.prototype;function eZ(e,t,n,l,r,i){let s=eG(e),o=s!==e&&!th(e),a=s[t];if(a!==eJ[t]){let t=a.apply(e,i);return o?tm(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tm(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eX(e,t,n,l){let r=eG(e),i=n;return r!==e&&(th(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tm(l),r,e)}),r[t](i,...l)}function eQ(e,t,n){let l=tv(e);eB(l,"iterate",eU);let r=l[t](...n);return(-1===r||!1===r)&&tg(n[0])?(n[0]=tv(n[0]),l[t](...n)):r}function eY(e,t,n=[]){e$(),ew++;let l=tv(e)[t].apply(e,n);return eC(),ej(),l}let e0=f("__proto__,__v_isRef,__isVue"),e1=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(P));function e2(e){P(e)||(e=String(e));let t=tv(this);return eB(t,"has",e),t.hasOwnProperty(e)}class e6{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?ta:to:r?ts:ti).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=w(e);if(!l){let e;if(i&&(e=ez[t]))return e;if("hasOwnProperty"===t)return e2}let s=Reflect.get(e,t,t_(e)?e:n);return(P(t)?e1.has(t):e0(t))?s:(l||eB(e,"get",t),r)?s:t_(s)?i&&I(t)?s:s.value:E(s)?l?tc(s):tu(s):s}}class e4 extends e6{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=td(r);if(th(n)||td(n)||(r=tv(r),n=tv(n)),!w(e)&&t_(r)&&!t_(n))return!t&&(r.value=n,!0)}let i=w(e)&&I(t)?Number(t)<e.length:S(e,t),s=Reflect.set(e,t,n,t_(e)?e:l);return e===tv(l)&&(i?q(n,r)&&eH(e,"set",t,n):eH(e,"add",t,n)),s}deleteProperty(e,t){let n=S(e,t);e[t];let l=Reflect.deleteProperty(e,t);return l&&n&&eH(e,"delete",t,void 0),l}has(e,t){let n=Reflect.has(e,t);return P(t)&&e1.has(t)||eB(e,"has",t),n}ownKeys(e){return eB(e,"iterate",w(e)?"length":eV),Reflect.ownKeys(e)}}let e8=new e4,e3=new class extends e6{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},e5=new e4(!0),e9=e=>e,e7=e=>Reflect.getPrototypeOf(e);function te(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function tt(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=tv(l),i=tv(n);e||(q(n,i)&&eB(r,"get",n),eB(r,"get",i));let{has:s}=e7(r),o=t?e9:e?ty:tm;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eB(tv(t),"iterate",eV),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=tv(n),r=tv(t);return e||(q(t,r)&&eB(l,"has",t),eB(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=tv(i),o=t?e9:e?ty:tm;return e||eB(s,"iterate",eV),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return _(n,e?{add:te("add"),set:te("set"),delete:te("delete"),clear:te("clear")}:{add(e){t||th(e)||td(e)||(e=tv(e));let n=tv(this);return e7(n).has.call(n,e)||(n.add(e),eH(n,"add",e,e)),this},set(e,n){t||th(n)||td(n)||(n=tv(n));let l=tv(this),{has:r,get:i}=e7(l),s=r.call(l,e);s||(e=tv(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?q(n,o)&&eH(l,"set",e,n):eH(l,"add",e,n),this},delete(e){let t=tv(this),{has:n,get:l}=e7(t),r=n.call(t,e);r||(e=tv(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eH(t,"delete",e,void 0),i},clear(){let e=tv(this),t=0!==e.size,n=e.clear();return t&&eH(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=tv(r),s=k(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e9:e?ty:tm;return e||eB(i,"iterate","keys"===l&&s?eW:eV),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(S(n,l)&&l in t?n:t,l,r)}let tn={get:tt(!1,!1)},tl={get:tt(!1,!0)},tr={get:tt(!0,!1)},ti=new WeakMap,ts=new WeakMap,to=new WeakMap,ta=new WeakMap;function tu(e){return td(e)?e:tf(e,!1,e8,tn,ti)}function tc(e){return tf(e,!0,e3,tr,to)}function tf(e,t,n,l,r){if(!E(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=r.get(e);if(i)return i;let s=e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(j(e));if(0===s)return e;let o=new Proxy(e,2===s?l:n);return r.set(e,o),o}function tp(e){return td(e)?tp(e.__v_raw):!!(e&&e.__v_isReactive)}function td(e){return!!(e&&e.__v_isReadonly)}function th(e){return!!(e&&e.__v_isShallow)}function tg(e){return!!e&&!!e.__v_raw}function tv(e){let t=e&&e.__v_raw;return t?tv(t):e}let tm=e=>E(e)?tu(e):e,ty=e=>E(e)?tc(e):e;function t_(e){return!!e&&!0===e.__v_isRef}let tb={get:(e,t,n)=>{var l;return"__v_raw"===t?e:t_(l=Reflect.get(e,t,n))?l.value:l},set:(e,t,n,l)=>{let r=e[t];return t_(r)&&!t_(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function tx(e){return tp(e)?e:new Proxy(e,tb)}class tS{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eF(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eI-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&n!==this)return ek(this,!0),!0}get value(){let e=this.dep.track();return eP(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tw={},tk=new WeakMap;function tC(e,t=1/0,n){if(t<=0||!E(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,t_(e))tC(e.value,t,n);else if(w(e))for(let l=0;l<e.length;l++)tC(e[l],t,n);else if(C(e)||k(e))e.forEach(e=>{tC(e,t,n)});else if(D(e)){for(let l in e)tC(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tC(e[l],t,n)}return e}function tT(e,t,n,l){try{return l?e(...l):e()}catch(e){tR(e,t,n)}}function tO(e,t,n,l){if(O(e)){let r=tT(e,t,n,l);return r&&M(r)&&r.catch(e=>{tR(e,t,n)}),r}if(w(e)){let r=[];for(let i=0;i<e.length;i++)r.push(tO(e[i],t,n,l));return r}}function tR(e,t,n,l=!0){t&&t.vnode;let{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||p;if(t){let l=t.parent,i=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){let t=l.ec;if(t){for(let n=0;n<t.length;n++)if(!1===t[n](e,i,s))return}l=l.parent}if(r){e$(),tT(r,null,10,[e,i,s]),ej();return}}!function(e,t,n,l=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,l,i)}let tP=[],tE=-1,tM=[],tA=null,t$=0,tj=Promise.resolve(),tD=null;function tI(e){let t=tD||tj;return e?t.then(this?e.bind(this):e):t}function tN(e){if(!(1&e.flags)){let t=tW(e),n=tP[tP.length-1];!n||!(2&e.flags)&&t>=tW(n)?tP.push(e):tP.splice(function(e){let t=tE+1,n=tP.length;for(;t<n;){let l=t+n>>>1,r=tP[l],i=tW(r);i<e||i===e&&2&r.flags?t=l+1:n=l}return t}(t),0,e),e.flags|=1,tF()}}function tF(){tD||(tD=tj.then(function e(t){try{for(tE=0;tE<tP.length;tE++){let e=tP[tE];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),tT(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;tE<tP.length;tE++){let e=tP[tE];e&&(e.flags&=-2)}tE=-1,tP.length=0,tV(),tD=null,(tP.length||tM.length)&&e()}}))}function tL(e,t,n=tE+1){for(;n<tP.length;n++){let t=tP[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;tP.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function tV(e){if(tM.length){let e=[...new Set(tM)].sort((e,t)=>tW(e)-tW(t));if(tM.length=0,tA){tA.push(...e);return}for(t$=0,tA=e;t$<tA.length;t$++){let e=tA[t$];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}tA=null,t$=0}}let tW=e=>null==e.id?2&e.flags?-1:1/0:e.id,tU=null,tB=null;function tH(e){let t=tU;return tU=e,tB=e&&e.type.__scopeId||null,t}function tq(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;s<r.length;s++){let o=r[s];i&&(o.oldValue=i[s].value);let a=o.dir[l];a&&(e$(),tO(a,n,8,[e.el,o,e,t]),ej())}}let tG=Symbol("_vte"),tz=e=>e.__isTeleport;function tK(e,t){6&e.shapeFlag&&e.component?(e.transition=t,tK(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function tJ(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function tZ(e,t,n,l,r=!1){if(w(e)){e.forEach((e,i)=>tZ(e,t&&(w(t)?t[i]:t),n,l,r));return}if(tX(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&tZ(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?lx(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===p?o.refs={}:o.refs,f=o.setupState,d=tv(f),h=f===p?()=>!1:e=>S(d,e);if(null!=u&&u!==a&&(R(u)?(c[u]=null,h(u)&&(f[u]=null)):t_(u)&&(u.value=null)),O(a))tT(a,o,12,[s,c]);else{let t=R(a),l=t_(a);if(t||l){let o=()=>{if(e.f){let n=t?h(a)?f[a]:c[a]:a.value;r?w(n)&&b(n,i):w(n)?n.includes(i)||n.push(i):t?(c[a]=[i],h(a)&&(f[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,h(a)&&(f[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,nL(o,n)):o()}}}let tX=e=>!!e.type.__asyncLoader,tQ=e=>e.type.__isKeepAlive;function tY(e,t){t1(e,"a",t)}function t0(e,t){t1(e,"da",t)}function t1(e,t,n=lp){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(t2(t,l,n),n){let e=n.parent;for(;e&&e.parent;)tQ(e.parent.vnode)&&function(e,t,n,l){let r=t2(t,e,l,!0);t7(()=>{b(l[t],r)},n)}(l,t,n,e),e=e.parent}}function t2(e,t,n=lp,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{e$();let r=ld(n),i=tO(t,n,e,l);return r(),ej(),i});return l?r.unshift(i):r.push(i),i}}let t6=e=>(t,n=lp)=>{lv&&"sp"!==e||t2(e,(...e)=>t(...e),n)},t4=t6("bm"),t8=t6("m"),t3=t6("bu"),t5=t6("u"),t9=t6("bum"),t7=t6("um"),ne=t6("sp"),nt=t6("rtg"),nn=t6("rtc");function nl(e,t=lp){t2("ec",e,t)}let nr=Symbol.for("v-ndc"),ni=e=>e?lg(e)?lx(e):ni(e.parent):null,ns=_(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ni(e.parent),$root:e=>ni(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>np(e),$forceUpdate:e=>e.f||(e.f=()=>{tN(e.update)}),$nextTick:e=>e.n||(e.n=tI.bind(e.proxy)),$watch:e=>nG.bind(e)}),no=(e,t)=>e!==p&&!e.__isScriptSetup&&S(e,t),na={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:f}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(no(s,t))return u[t]=1,s[t];if(o!==p&&S(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&S(n,t))return u[t]=3,a[t];if(i!==p&&S(i,t))return u[t]=4,i[t];nc&&(u[t]=0)}}let d=ns[t];return d?("$attrs"===t&&eB(e.attrs,"get",""),d(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==p&&S(i,t)?(u[t]=4,i[t]):S(r=f.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return no(r,t)?(r[t]=n,!0):l!==p&&S(l,t)?(l[t]=n,!0):!S(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==p&&S(e,s)||no(t,s)||(o=i[0])&&S(o,s)||S(l,s)||S(ns,s)||S(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:S(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function nu(e){return w(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let nc=!0;function nf(e,t,n){tO(w(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function np(e){let t;let n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>nd(t,e,o,!0)),nd(t,n,o)):t=n,E(n)&&s.set(n,t),t}function nd(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&nd(e,i,n,!0),r&&r.forEach(t=>nd(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=nh[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let nh={data:ng,props:n_,emits:n_,methods:ny,computed:ny,beforeCreate:nm,created:nm,beforeMount:nm,mounted:nm,beforeUpdate:nm,updated:nm,beforeDestroy:nm,beforeUnmount:nm,destroyed:nm,unmounted:nm,activated:nm,deactivated:nm,errorCaptured:nm,serverPrefetch:nm,components:ny,directives:ny,watch:function(e,t){if(!e)return t;if(!t)return e;let n=_(Object.create(null),e);for(let l in t)n[l]=nm(e[l],t[l]);return n},provide:ng,inject:function(e,t){return ny(nv(e),nv(t))}};function ng(e,t){return t?e?function(){return _(O(e)?e.call(this,this):e,O(t)?t.call(this,this):t)}:t:e}function nv(e){if(w(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function nm(e,t){return e?[...new Set([].concat(e,t))]:t}function ny(e,t){return e?_(Object.create(null),e,t):t}function n_(e,t){return e?w(e)&&w(t)?[...new Set([...e,...t])]:_(Object.create(null),nu(e),nu(null!=t?t:{})):t}function nb(){return{app:null,config:{isNativeTag:g,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let nx=0,nS=null;function nw(e,t,n=!1){let l=lp||tU;if(l||nS){let r=nS?nS._context.provides:l?null==l.parent?l.vnode.appContext&&l.vnode.appContext.provides:l.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&O(t)?t.call(l&&l.proxy):t}}let nk={},nC=()=>Object.create(nk),nT=e=>Object.getPrototypeOf(e)===nk;function nO(e,t,n,l){let r;let[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(N(a))continue;let c=t[a];i&&S(i,u=V(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:nZ(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=tv(n),l=r||p;for(let r=0;r<s.length;r++){let o=s[r];n[o]=nR(i,t,o,l[o],e,!S(l,o))}}return o}function nR(e,t,n,l,r,i){let s=e[n];if(null!=s){let e=S(s,"default");if(e&&void 0===l){let e=s.default;if(s.type!==Function&&!s.skipFactory&&O(e)){let{propsDefaults:i}=r;if(n in i)l=i[n];else{let s=ld(r);l=i[n]=e.call(null,t),s()}}else l=e;r.ce&&r.ce._setProp(n,l)}s[0]&&(i&&!e?l=!1:s[1]&&(""===l||l===U(n))&&(l=!0))}return l}let nP=new WeakMap;function nE(e){return!("$"===e[0]||N(e))}let nM=e=>"_"===e[0]||"$stable"===e,nA=e=>w(e)?e.map(lr):[lr(e)],n$=(e,t,n)=>{if(t._n)return t;let l=function(e,t=tU,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&n5(-1);let i=tH(t);try{r=e(...n)}finally{tH(i),l._d&&n5(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}((...e)=>nA(t(...e)),n);return l._c=!1,l},nj=(e,t,n)=>{let l=e._ctx;for(let n in e){if(nM(n))continue;let r=e[n];if(O(r))t[n]=n$(n,r,l);else if(null!=r){let e=nA(r);t[n]=()=>e}}},nD=(e,t)=>{let n=nA(t);e.slots.default=()=>n},nI=(e,t,n)=>{for(let l in t)(n||"_"!==l)&&(e[l]=t[l])},nN=(e,t,n)=>{let l=e.slots=nC();if(32&e.vnode.shapeFlag){let e=t._;e?(nI(l,t,n),n&&z(l,"_",e,!0)):nj(t,l)}else t&&nD(e,t)},nF=(e,t,n)=>{let{vnode:l,slots:r}=e,i=!0,s=p;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:nI(r,t,n):(i=!t.$stable,nj(t,r)),s=t}else t&&(nD(e,t),s={default:1});if(i)for(let e in r)nM(e)||null!=s[e]||delete r[e]},nL=function(e,t){t&&t.pendingBranch?w(e)?t.effects.push(...e):t.effects.push(e):(w(e)?tM.push(...e):tA&&-1===e.id?tA.splice(t$+1,0,e):1&e.flags||(tM.push(e),e.flags|=1),tF())};function nV({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nW({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function nU(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}let nB=Symbol.for("v-scx"),nH=()=>nw(nB);function nq(e,n,l=p){let r;let{immediate:i,deep:s,flush:o,once:a}=l,c=_({},l),f=n&&i||!n&&"post"!==o;if(lv){if("sync"===o){let e=nH();r=e.__watcherHandles||(e.__watcherHandles=[])}else if(!f){let e=()=>{};return e.stop=h,e.resume=h,e.pause=h,e}}let d=lp;c.call=(e,t,n)=>tO(e,d,t,n);let g=!1;"post"===o?c.scheduler=e=>{nL(e,d&&d.suspense)}:"sync"!==o&&(g=!0,c.scheduler=(e,t)=>{t?e():tN(e)}),c.augmentJob=e=>{n&&(e.flags|=4),g&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};let m=function(e,n,l=p){let r,i,s,o;let{immediate:a,deep:c,once:f,scheduler:d,augmentJob:g,call:m}=l,y=e=>c?e:th(e)||!1===c||0===c?tC(e,1):tC(e),_=!1,x=!1;if(t_(e)?(i=()=>e.value,_=th(e)):tp(e)?(i=()=>y(e),_=!0):w(e)?(x=!0,_=e.some(e=>tp(e)||th(e)),i=()=>e.map(e=>t_(e)?e.value:tp(e)?y(e):O(e)?m?m(e,2):e():void 0)):i=O(e)?n?m?()=>m(e,2):e:()=>{if(s){e$();try{s()}finally{ej()}}let t=u;u=r;try{return m?m(e,3,[o]):e(o)}finally{u=t}}:h,n&&c){let e=i,t=!0===c?1/0:c;i=()=>tC(e(),t)}let S=t,k=()=>{r.stop(),S&&S.active&&b(S.effects,r)};if(f&&n){let e=n;n=(...t)=>{e(...t),k()}}let C=x?Array(e.length).fill(tw):tw,T=e=>{if(1&r.flags&&(r.dirty||e)){if(n){let e=r.run();if(c||_||(x?e.some((e,t)=>q(e,C[t])):q(e,C))){s&&s();let t=u;u=r;try{let t=[e,C===tw?void 0:x&&C[0]===tw?[]:C,o];m?m(n,3,t):n(...t),C=e}finally{u=t}}}else r.run()}};return g&&g(T),(r=new eS(i)).scheduler=d?()=>d(T,!1):T,o=e=>(function(e,t=!1,n=u){if(n){let t=tk.get(n);t||tk.set(n,t=[]),t.push(e)}})(e,!1,r),s=r.onStop=()=>{let e=tk.get(r);if(e){if(m)m(e,4);else for(let t of e)t();tk.delete(r)}},n?a?T(!0):C=r.run():d?d(T.bind(null,!0),!0):r.run(),k.pause=r.pause.bind(r),k.resume=r.resume.bind(r),k.stop=k,k}(e,n,c);return lv&&(r?r.push(m):f&&m()),m}function nG(e,t,n){let l;let r=this.proxy,i=R(e)?e.includes(".")?nz(r,e):()=>r[e]:e.bind(r,r);O(t)?l=t:(l=t.handler,n=t);let s=ld(this),o=nq(i,l.bind(r),n);return s(),o}function nz(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}let nK=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${V(t)}Modifiers`]||e[`${U(t)}Modifiers`];function nJ(e,t,...n){let l;if(e.isUnmounted)return;let r=e.vnode.props||p,i=n,s=t.startsWith("update:"),o=s&&nK(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>R(e)?e.trim():e)),o.number&&(i=n.map(K)));let a=r[l=H(t)]||r[l=H(V(t))];!a&&s&&(a=r[l=H(U(t))]),a&&tO(a,e,6,i);let u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tO(u,e,6,i)}}function nZ(e,t){return!!(e&&m(t))&&(S(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||S(e,U(t))||S(e,t))}function nX(e){let t,n;let{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:m,inheritAttrs:_}=e,b=tH(e);try{if(4&r.shapeFlag){let e=s||i;t=lr(f.call(e,e,p,d,g,h,m)),n=u}else t=lr(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:nQ(u)}catch(n){tR(n,e,1),t=ln(n4)}let x=t;if(n&&!1!==_){let e=Object.keys(n),{shapeFlag:t}=x;e.length&&7&t&&(o&&e.some(y)&&(n=nY(n,o)),x=ll(x,n,!1,!0))}return r.dirs&&((x=ll(x,null,!1,!0)).dirs=x.dirs?x.dirs.concat(r.dirs):r.dirs),r.transition&&tK(x,r.transition),t=x,tH(b),t}let nQ=e=>{let t;for(let n in e)("class"===n||"style"===n||m(n))&&((t||(t={}))[n]=e[n]);return t},nY=(e,t)=>{let n={};for(let l in e)y(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function n0(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;r<l.length;r++){let i=l[r];if(t[i]!==e[i]&&!nZ(n,i))return!0}return!1}let n1=e=>e.__isSuspense,n2=Symbol.for("v-fgt"),n6=Symbol.for("v-txt"),n4=Symbol.for("v-cmt"),n8=Symbol.for("v-stc"),n3=1;function n5(e,t=!1){n3+=e}function n9(e){return!!e&&!0===e.__v_isVNode}function n7(e,t){return e.type===t.type&&e.key===t.key}let le=({key:e})=>null!=e?e:null,lt=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?R(e)||t_(e)||O(e)?{i:tU,r:e,k:t,f:!!n}:e:null),ln=function(e,t=null,n=null,l=0,r=null,i=!1){var s,o;if(e&&e!==nr||(e=n4),n9(e)){let l=ll(e,t,!0);return n&&ls(l,n),l.patchFlag=-2,l}if(O(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=(o=t)?tg(o)||nT(o)?_({},o):o:null;e&&!R(e)&&(t.class=ee(e)),E(n)&&(tg(n)&&!w(n)&&(n=_({},n)),t.style=Z(n))}let a=R(e)?1:n1(e)?128:tz(e)?64:E(e)?4:O(e)?2:0;return function(e,t=null,n=null,l=0,r=null,i=e===n2?0:1,s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&le(t),ref:t&<(t),scopeId:tB,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:tU};return o?(ls(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=R(n)?8:16),a}(e,t,n,l,r,a,i,!0)};function ll(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?lo(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&le(u),ref:t&&t.ref?n&&i?w(i)?i.concat(lt(t)):[i,lt(t)]:lt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==n2?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ll(e.ssContent),ssFallback:e.ssFallback&&ll(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&tK(c,a.clone(c)),c}function lr(e){return null==e||"boolean"==typeof e?ln(n4):w(e)?ln(n2,null,e.slice()):n9(e)?li(e):ln(n6,null,String(e))}function li(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:ll(e)}function ls(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(w(t))n=16;else if("object"==typeof t){if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),ls(e,n()),n._c&&(n._d=!0));return}{n=32;let l=t._;l||nT(t)?3===l&&tU&&(1===tU.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=tU}}else O(t)?(t={default:t,_ctx:tU},n=32):(t=String(t),64&l?(n=16,t=[function(e=" ",t=0){return ln(n6,null,e,t)}(t)]):n=8);e.children=t,e.shapeFlag|=n}function lo(...e){let t={};for(let n=0;n<e.length;n++){let l=e[n];for(let e in l)if("class"===e)t.class!==l.class&&(t.class=ee([t.class,l.class]));else if("style"===e)t.style=Z([t.style,l.style]);else if(m(e)){let n=t[e],r=l[e];r&&n!==r&&!(w(n)&&n.includes(r))&&(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=l[e])}return t}function la(e,t,n,l=null){tO(e,t,7,[n,l])}let lu=nb(),lc=0;function lf(e,t,n){let l=e.type,r=(t?t.appContext:e.appContext)||lu,i={uid:lc++,vnode:e,type:l,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new eb(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,l=!1){let r=l?nP:n.propsCache,i=r.get(t);if(i)return i;let s=t.props,o={},a=[],u=!1;if(!O(t)){let r=t=>{u=!0;let[l,r]=e(t,n,!0);_(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return E(t)&&r.set(t,d),d;if(w(s))for(let e=0;e<s.length;e++){let t=V(s[e]);nE(t)&&(o[t]=p)}else if(s)for(let e in s){let t=V(e);if(nE(t)){let n=s[e],l=o[t]=w(n)||O(n)?{type:n}:_({},n),r=l.type,i=!1,u=!0;if(w(r))for(let e=0;e<r.length;++e){let t=r[e],n=O(t)&&t.name;if("Boolean"===n){i=!0;break}"String"===n&&(u=!1)}else i=O(r)&&"Boolean"===r.name;l[0]=i,l[1]=u,(i||S(l,"default"))&&a.push(t)}}let c=[o,a];return E(t)&&r.set(t,c),c}(l,r),emitsOptions:function e(t,n,l=!1){let r=n.emitsCache,i=r.get(t);if(void 0!==i)return i;let s=t.emits,o={},a=!1;if(!O(t)){let r=t=>{let l=e(t,n,!0);l&&(a=!0,_(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(w(s)?s.forEach(e=>o[e]=null):_(o,s),E(t)&&r.set(t,o),o):(E(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:p,inheritAttrs:l.inheritAttrs,ctx:p,data:p,props:p,attrs:p,slots:p,refs:p,setupState:p,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=nJ.bind(null,i),e.ce&&e.ce(i),i}let lp=null;{let e=J(),t=(t,n)=>{let l;return(l=e[t])||(l=e[t]=[]),l.push(n),e=>{l.length>1?l.forEach(t=>t(e)):l[0](e)}};i=t("__VUE_INSTANCE_SETTERS__",e=>lp=e),s=t("__VUE_SSR_SETTERS__",e=>lv=e)}let ld=e=>{let t=lp;return i(e),e.scope.on(),()=>{e.scope.off(),i(t)}},lh=()=>{lp&&lp.scope.off(),i(null)};function lg(e){return 4&e.vnode.shapeFlag}let lv=!1;function lm(e,t=!1,n=!1){t&&s(t);let{props:l,children:r}=e.vnode,i=lg(e);!function(e,t,n,l=!1){let r={},i=nC();for(let n in e.propsDefaults=Object.create(null),nO(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:tf(r,!1,e5,tl,ts):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),nN(e,r,n);let o=i?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,na);let{setup:l}=n;if(l){e$();let n=e.setupContext=l.length>1?{attrs:new Proxy(e.attrs,lb),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}:null,r=ld(e),i=tT(l,e,0,[e.props,n]),s=M(i);if(ej(),r(),(s||e.sp)&&!tX(e)&&tJ(e),s){if(i.then(lh,lh),t)return i.then(n=>{ly(e,n,t)}).catch(t=>{tR(t,e,0)});e.asyncDep=i}else ly(e,i,t)}else l_(e,t)}(e,t):void 0;return t&&s(!1),o}function ly(e,t,n){O(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:E(t)&&(e.setupState=tx(t)),l_(e,n)}function l_(e,t,n){let l=e.type;if(!e.render){if(!t&&o&&!l.render){let t=l.template||np(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:s}=l,a=_(_({isCustomElement:n,delimiters:i},r),s);l.render=o(t,a)}}e.render=l.render||h}{let t=ld(e);e$();try{!function(e){let t=np(e),n=e.proxy,l=e.ctx;nc=!1,t.beforeCreate&&nf(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:d,updated:g,activated:m,deactivated:y,beforeDestroy:_,beforeUnmount:b,destroyed:x,unmounted:S,render:k,renderTracked:C,renderTriggered:T,errorCaptured:P,serverPrefetch:M,expose:A,inheritAttrs:$,components:j,directives:D,filters:I}=t;if(u&&function(e,t,n=h){for(let n in w(e)&&(e=nv(e)),e){let l;let r=e[n];t_(l=E(r)?"default"in r?nw(r.from||n,r.default,!0):nw(r.from||n):nw(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];O(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);E(t)&&(e.data=tu(t))}if(nc=!0,i)for(let e in i){let t=i[e],r=O(t)?t.bind(n,n):O(t.get)?t.get.bind(n,n):h,s=lS({get:r,set:!O(t)&&O(t.set)?t.set.bind(n):h});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){let i=r.includes(".")?nz(l,r):()=>l[r];if(R(t)){let e=n[t];O(e)&&nq(i,e,void 0)}else if(O(t)){var s;s=t.bind(l),nq(i,s,void 0)}else if(E(t)){if(w(t))t.forEach(t=>e(t,n,l,r));else{let e=O(t.handler)?t.handler.bind(l):n[t.handler];O(e)&&nq(i,e,t)}}}(o[e],l,n,e);if(a){let e=O(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(lp){let n=lp.provides,l=lp.parent&&lp.parent.provides;l===n&&(n=lp.provides=Object.create(l)),n[e]=t}}(t,e[t])})}function N(e,t){w(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&nf(c,e,"c"),N(t4,f),N(t8,p),N(t3,d),N(t5,g),N(tY,m),N(t0,y),N(nl,P),N(nn,C),N(nt,T),N(t9,b),N(t7,S),N(ne,M),w(A)){if(A.length){let t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={})}k&&e.render===h&&(e.render=k),null!=$&&(e.inheritAttrs=$),j&&(e.components=j),D&&(e.directives=D),M&&tJ(e)}(e)}finally{ej(),t()}}}let lb={get:(e,t)=>(eB(e,"get",""),e[t])};function lx(e){var t;return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tx((!S(t=e.exposed,"__v_skip")&&Object.isExtensible(t)&&z(t,"__v_skip",!0),t)),{get:(t,n)=>n in t?t[n]:n in ns?ns[n](e):void 0,has:(e,t)=>t in e||t in ns})):e.proxy}let lS=(e,t)=>(function(e,t,n=!1){let l,r;return O(e)?l=e:(l=e.get,r=e.set),new tS(l,r,n)})(e,0,lv),lw={createComponentInstance:lf,setupComponent:lm,renderComponentRoot:nX,setCurrentRenderingInstance:tH,isVNode:n9,normalizeVNode:lr,getComponentPublicInstance:lx,ensureValidVNode:function e(t){return t.some(t=>!n9(t)||!!(t.type!==n4&&(t.type!==n2||e(t.children))))?t:null},pushWarningContext:function(e){},popWarningContext:function(){}},lk="undefined"!=typeof window&&window.trustedTypes;if(lk)try{c=lk.createPolicy("vue",{createHTML:e=>e})}catch(e){}let lC=c?e=>c.createHTML(e):e=>e,lT="undefined"!=typeof document?document:null,lO=lT&&lT.createElement("template"),lR=Symbol("_vtc"),lP=Symbol("_vod"),lE=Symbol("_vsh"),lM=Symbol(""),lA=/(^|;)\s*display\s*:/,l$=/\s*!important$/;function lj(e,t,n){if(w(n))n.forEach(n=>lj(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=lI[t];if(n)return n;let l=V(t);if("filter"!==l&&l in e)return lI[t]=l;l=B(l);for(let n=0;n<lD.length;n++){let r=lD[n]+l;if(r in e)return lI[t]=r}return t}(e,t);l$.test(n)?e.setProperty(U(l),n.replace(l$,""),"important"):e[l]=n}}let lD=["Webkit","Moz","ms"],lI={},lN="http://www.w3.org/1999/xlink";function lF(e,t,n,l,r,i=er(t)){l&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(lN,t.slice(6,t.length)):e.setAttributeNS(lN,t,n):null==n||i&&!es(n)?e.removeAttribute(t):e.setAttribute(t,i?"":P(n)?String(n):n)}function lL(e,t,n,l,r){if("innerHTML"===t||"textContent"===t){null!=n&&(e[t]="innerHTML"===t?lC(n):n);return}let i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){let l="OPTION"===i?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);l===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),e._value=n;return}let s=!1;if(""===n||null==n){let l=typeof e[t];"boolean"===l?n=es(n):null==n&&"string"===l?(n="",s=!0):"number"===l&&(n=0,s=!0)}try{e[t]=n}catch(e){}s&&e.removeAttribute(r||t)}let lV=Symbol("_vei"),lW=/(?:Once|Passive|Capture)$/,lU=0,lB=Promise.resolve(),lH=()=>lU||(lB.then(()=>lU=0),lU=Date.now()),lq=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2);Symbol("_assign");let lG=_({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;"class"===t?function(e,t,n){let l=e[lR];l&&(t=(t?[t,...l]:[...l]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,l,s):"style"===t?function(e,t,n){let l=e.style,r=R(n),i=!1;if(n&&!r){if(t){if(R(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&lj(l,t,"")}else for(let e in t)null==n[e]&&lj(l,e,"")}for(let e in n)"display"===e&&(i=!0),lj(l,e,n[e])}else if(r){if(t!==n){let e=l[lM];e&&(n+=";"+e),l.cssText=n,i=lA.test(n)}}else t&&e.removeAttribute("style");lP in e&&(e[lP]=i?l.display:"",e[lE]&&(l.display="none"))}(e,n,l):m(t)?y(t)||function(e,t,n,l,r=null){let i=e[lV]||(e[lV]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(lW.test(e)){let n;for(t={};n=e.match(lW);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):U(e.slice(2)),t]}(t);l?function(e,t,n,l){e.addEventListener(t,n,l)}(e,n,i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tO(function(e,t){if(!w(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=lH(),n}(l,r),o):s&&(!function(e,t,n,l){e.removeEventListener(t,n,l)}(e,n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&lq(t)&&O(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(lq(t)&&R(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!R(l))?lL(e,V(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),lF(e,t,l,s)):(lL(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||lF(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?lT.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?lT.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?lT.createElement(e,{is:n}):lT.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>lT.createTextNode(e),createComment:e=>lT.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>lT.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{lO.innerHTML=lC("svg"===l?`<svg>${e}</svg>`:"mathml"===l?`<math>${e}</math>`:e);let r=lO.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),lz=(...e)=>{let t=(a||(a=function(e,t){let n,l;J().__VUE__=!0;let{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:u,setText:c,setElementText:f,parentNode:g,nextSibling:m,setScopeId:y=h,insertStaticContent:b}=e,x=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!n7(e,t)&&(l=er(e),Y(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case n6:k(e,t,n,l);break;case n4:C(e,t,n,l);break;case n8:null==e&&T(t,n,l,s);break;case n2:L(e,t,n,l,r,i,s,o,a);break;default:1&f?M(e,t,n,l,r,i,s,o,a):6&f?W(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,eo):128&f&&u.process(e,t,n,l,r,i,s,o,a,eo)}null!=c&&r&&tZ(c,e&&e.ref,i,t||e,!t)},k=(e,t,n,l)=>{if(null==e)r(t.el=a(t.children),n,l);else{let n=t.el=e.el;t.children!==e.children&&c(n,t.children)}},C=(e,t,n,l)=>{null==e?r(t.el=u(t.children||""),n,l):t.el=e.el},T=(e,t,n,l)=>{[e.el,e.anchor]=b(e.children,t,n,l,e.el,e.anchor)},R=({el:e,anchor:t},n,l)=>{let i;for(;e&&e!==t;)i=m(e),r(e,n,l),e=i;r(t,n,l)},P=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),i(e),e=n;i(t)},M=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?A(t,n,l,r,i,s,o,a):D(e,t,r,i,s,o,a)},A=(e,t,n,l,i,a,u,c)=>{let p,d;let{props:h,shapeFlag:g,transition:m,dirs:y}=e;if(p=e.el=o(e.type,a,h&&h.is,h),8&g?f(p,e.children):16&g&&j(e.children,p,null,l,i,nV(e,a),u,c),y&&tq(e,null,l,"created"),$(p,e,e.scopeId,u,l),h){for(let e in h)"value"===e||N(e)||s(p,e,null,h[e],a,l);"value"in h&&s(p,"value",null,h.value,a),(d=h.onVnodeBeforeMount)&&la(d,l,e)}y&&tq(e,null,l,"beforeMount");let _=(!i||i&&!i.pendingBranch)&&m&&!m.persisted;_&&m.beforeEnter(p),r(p,t,n),((d=h&&h.onVnodeMounted)||_||y)&&nL(()=>{d&&la(d,l,e),_&&m.enter(p),y&&tq(e,null,l,"mounted")},i)},$=(e,t,n,l,r)=>{if(n&&y(e,n),l)for(let t=0;t<l.length;t++)y(e,l[t]);if(r){let n=r.subTree;if(t===n||n1(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=r.vnode;$(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},j=(e,t,n,l,r,i,s,o,a=0)=>{for(let u=a;u<e.length;u++)x(null,e[u]=o?li(e[u]):lr(e[u]),t,n,l,r,i,s,o)},D=(e,t,n,l,r,i,o)=>{let a;let u=t.el=e.el,{patchFlag:c,dynamicChildren:d,dirs:h}=t;c|=16&e.patchFlag;let g=e.props||p,m=t.props||p;if(n&&nW(n,!1),(a=m.onVnodeBeforeUpdate)&&la(a,n,t,e),h&&tq(t,e,n,"beforeUpdate"),n&&nW(n,!0),(g.innerHTML&&null==m.innerHTML||g.textContent&&null==m.textContent)&&f(u,""),d?I(e.dynamicChildren,d,u,n,l,nV(t,r),i):o||K(e,t,u,null,n,l,nV(t,r),i,!1),c>0){if(16&c)F(u,g,m,n,r);else if(2&c&&g.class!==m.class&&s(u,"class",null,m.class,r),4&c&&s(u,"style",g.style,m.style,r),8&c){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let l=e[t],i=g[l],o=m[l];(o!==i||"value"===l)&&s(u,l,i,o,r,n)}}1&c&&e.children!==t.children&&f(u,t.children)}else o||null!=d||F(u,g,m,n,r);((a=m.onVnodeUpdated)||h)&&nL(()=>{a&&la(a,n,t,e),h&&tq(t,e,n,"updated")},l)},I=(e,t,n,l,r,i,s)=>{for(let o=0;o<t.length;o++){let a=e[o],u=t[o],c=a.el&&(a.type===n2||!n7(a,u)||70&a.shapeFlag)?g(a.el):n;x(a,u,c,null,l,r,i,s,!0)}},F=(e,t,n,l,r)=>{if(t!==n){if(t!==p)for(let i in t)N(i)||i in n||s(e,i,t[i],null,r,l);for(let i in n){if(N(i))continue;let o=n[i],a=t[i];o!==a&&"value"!==i&&s(e,i,a,o,r,l)}"value"in n&&s(e,"value",t.value,n.value,r)}},L=(e,t,n,l,i,s,o,u,c)=>{let f=t.el=e?e.el:a(""),p=t.anchor=e?e.anchor:a(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(u=u?u.concat(g):g),null==e?(r(f,n,l),r(p,n,l),j(t.children||[],n,p,i,s,o,u,c)):d>0&&64&d&&h&&e.dynamicChildren?(I(e.dynamicChildren,h,n,i,s,o,u),(null!=t.key||i&&t===i.subTree)&&function e(t,n,l=!1){let r=t.children,i=n.children;if(w(r)&&w(i))for(let t=0;t<r.length;t++){let n=r[t],s=i[t];!(1&s.shapeFlag)||s.dynamicChildren||((s.patchFlag<=0||32===s.patchFlag)&&((s=i[t]=li(i[t])).el=n.el),l||-2===s.patchFlag||e(n,s)),s.type===n6&&(s.el=n.el)}}(e,t,!0)):K(e,t,n,p,i,s,o,u,c)},W=(e,t,n,l,r,i,s,o,a)=>{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):B(t,n,l,r,i,s,a):H(e,t,a)},B=(e,t,n,l,r,i,s)=>{let o=e.component=lf(e,l,r);tQ(e)&&(o.ctx.renderer=eo),lm(o,!1,s),o.asyncDep?(r&&r.registerDep(o,q,s),e.el||C(null,o.subTree=ln(n4),t,n)):q(o,e,t,n,r,i,s)},H=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||n0(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?n0(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(s[n]!==l[n]&&!nZ(u,n))return!0}}return!1}(e,t,n)){if(l.asyncDep&&!l.asyncResolved){z(l,t,n);return}l.next=t,l.update()}else t.el=e.el,l.vnode=t},q=(e,t,n,r,i,s,o)=>{let a=()=>{if(e.isMounted){let t,{next:n,bu:l,u:r,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:e(n)}(e);if(t){n&&(n.el=c.el,z(e,n,o)),t.asyncDep.then(()=>{e.isUnmounted||a()});return}}let f=n;nW(e,!1),n?(n.el=c.el,z(e,n,o)):n=c,l&&G(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&la(t,u,n,c),nW(e,!0);let p=nX(e),d=e.subTree;e.subTree=p,x(d,p,g(d.el),er(d),e,i,s),n.el=p.el,null===f&&function({vnode:e,parent:t},n){for(;t;){let l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.el=e.el),l===e)(e=t.vnode).el=n,t=t.parent;else break}}(e,p.el),r&&nL(r,i),(t=n.props&&n.props.onVnodeUpdated)&&nL(()=>la(t,u,n,c),i)}else{let o;let{el:a,props:u}=t,{bm:c,m:f,parent:p,root:d,type:h}=e,g=tX(t);if(nW(e,!1),c&&G(c),!g&&(o=u&&u.onVnodeBeforeMount)&&la(o,p,t),nW(e,!0),a&&l){let t=()=>{e.subTree=nX(e),l(a,e.subTree,e,i,null)};g&&h.__asyncHydrate?h.__asyncHydrate(a,e,t):t()}else{d.ce&&d.ce._injectChildStyle(h);let l=e.subTree=nX(e);x(null,l,n,r,e,i,s),t.el=l.el}if(f&&nL(f,i),!g&&(o=u&&u.onVnodeMounted)){let e=t;nL(()=>la(o,p,e),i)}(256&t.shapeFlag||p&&tX(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&nL(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let u=e.effect=new eS(a);e.scope.off();let c=e.update=u.run.bind(u),f=e.job=u.runIfDirty.bind(u);f.i=e,f.id=e.uid,u.scheduler=()=>tN(f),nW(e,!0),c()},z=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=tv(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l<n.length;l++){let s=n[l];if(nZ(e.emitsOptions,s))continue;let c=t[s];if(a){if(S(i,s))c!==i[s]&&(i[s]=c,u=!0);else{let t=V(s);r[t]=nR(a,o,t,c,e,!1)}}else c!==i[s]&&(i[s]=c,u=!0)}}}else{let l;for(let s in nO(e,t,r,i)&&(u=!0),o)t&&(S(t,s)||(l=U(s))!==s&&S(t,l))||(a?n&&(void 0!==n[s]||void 0!==n[l])&&(r[s]=nR(a,o,s,void 0,e,!0)):delete r[s]);if(i!==o)for(let e in i)t&&S(t,e)||(delete i[e],u=!0)}u&&eH(e.attrs,"set","")}(e,t.props,l,n),nF(e,t.children,n),e$(),tL(e),ej()},K=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,c=e?e.shapeFlag:0,p=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d){X(u,p,n,l,r,i,s,o,a);return}if(256&d){Z(u,p,n,l,r,i,s,o,a);return}}8&h?(16&c&&el(u,r,i),p!==u&&f(n,p)):16&c?16&h?X(u,p,n,l,r,i,s,o,a):el(u,r,i,!0):(8&c&&f(n,""),16&h&&j(p,n,l,r,i,s,o,a))},Z=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||d,t=t||d;let c=e.length,f=t.length,p=Math.min(c,f);for(u=0;u<p;u++){let l=t[u]=a?li(t[u]):lr(t[u]);x(e[u],l,n,null,r,i,s,o,a)}c>f?el(e,r,i,!0,!1,p):j(t,n,l,r,i,s,o,a,p)},X=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,p=c-1;for(;u<=f&&u<=p;){let l=e[u],c=t[u]=a?li(t[u]):lr(t[u]);if(n7(l,c))x(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=p;){let l=e[f],u=t[p]=a?li(t[p]):lr(t[p]);if(n7(l,u))x(l,u,n,null,r,i,s,o,a);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,f=e<c?t[e].el:l;for(;u<=p;)x(null,t[u]=a?li(t[u]):lr(t[u]),n,f,r,i,s,o,a),u++}}else if(u>p)for(;u<=f;)Y(e[u],r,i,!0),u++;else{let h;let g=u,m=u,y=new Map;for(u=m;u<=p;u++){let e=t[u]=a?li(t[u]):lr(t[u]);null!=e.key&&y.set(e.key,u)}let _=0,b=p-m+1,S=!1,w=0,k=Array(b);for(u=0;u<b;u++)k[u]=0;for(u=g;u<=f;u++){let l;let c=e[u];if(_>=b){Y(c,r,i,!0);continue}if(null!=c.key)l=y.get(c.key);else for(h=m;h<=p;h++)if(0===k[h-m]&&n7(c,t[h])){l=h;break}void 0===l?Y(c,r,i,!0):(k[l-m]=u+1,l>=w?w=l:S=!0,x(c,t[l],n,null,r,i,s,o,a),_++)}let C=S?function(e){let t,n,l,r,i;let s=e.slice(),o=[0],a=e.length;for(t=0;t<a;t++){let a=e[t];if(0!==a){if(e[n=o[o.length-1]]<a){s[t]=n,o.push(t);continue}for(l=0,r=o.length-1;l<r;)e[o[i=l+r>>1]]<a?l=i+1:r=i;a<e[o[l]]&&(l>0&&(s[t]=o[l-1]),o[l]=t)}}for(l=o.length,r=o[l-1];l-- >0;)o[l]=r,r=s[r];return o}(k):d;for(h=C.length-1,u=b-1;u>=0;u--){let e=m+u,f=t[e],p=e+1<c?t[e+1].el:l;0===k[u]?x(null,f,n,p,r,i,s,o,a):S&&(h<0||u!==C[h]?Q(f,n,p,2):h--)}}},Q=(e,t,n,l,i=null)=>{let{el:s,type:o,transition:a,children:u,shapeFlag:c}=e;if(6&c){Q(e.component.subTree,t,n,l);return}if(128&c){e.suspense.move(t,n,l);return}if(64&c){o.move(e,t,n,eo);return}if(o===n2){r(s,t,n);for(let e=0;e<u.length;e++)Q(u[e],t,n,l);r(e.anchor,t,n);return}if(o===n8){R(e,t,n);return}if(2!==l&&1&c&&a){if(0===l)a.beforeEnter(s),r(s,t,n),nL(()=>a.enter(s),i);else{let{leave:e,delayLeave:l,afterLeave:i}=a,o=()=>r(s,t,n),u=()=>{e(s,()=>{o(),i&&i()})};l?l(s,o,u):u()}}else r(s,t,n)},Y=(e,t,n,l=!1,r=!1)=>{let i;let{type:s,props:o,ref:a,children:u,dynamicChildren:c,shapeFlag:f,patchFlag:p,dirs:d,cacheIndex:h}=e;if(-2===p&&(r=!1),null!=a&&tZ(a,null,n,e,!0),null!=h&&(t.renderCache[h]=void 0),256&f){t.ctx.deactivate(e);return}let g=1&f&&d,m=!tX(e);if(m&&(i=o&&o.onVnodeBeforeUnmount)&&la(i,t,e),6&f)en(e.component,n,l);else{if(128&f){e.suspense.unmount(n,l);return}g&&tq(e,null,t,"beforeUnmount"),64&f?e.type.remove(e,t,n,eo,l):c&&!c.hasOnce&&(s!==n2||p>0&&64&p)?el(c,t,n,!1,!0):(s===n2&&384&p||!r&&16&f)&&el(u,t,n),l&&ee(e)}(m&&(i=o&&o.onVnodeUnmounted)||g)&&nL(()=>{i&&la(i,t,e),g&&tq(e,null,t,"unmounted")},n)},ee=e=>{let{type:t,el:n,anchor:l,transition:r}=e;if(t===n2){et(n,l);return}if(t===n8){P(e);return}let s=()=>{i(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){let{leave:t,delayLeave:l}=r,i=()=>t(n,s);l?l(e.el,s,i):i()}else s()},et=(e,t)=>{let n;for(;e!==t;)n=m(e),i(e),e=n;i(t)},en=(e,t,n)=>{let{bum:l,scope:r,job:i,subTree:s,um:o,m:a,a:u}=e;nU(a),nU(u),l&&G(l),r.stop(),i&&(i.flags|=8,Y(s,e,t,n)),o&&nL(o,t),nL(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},el=(e,t,n,l=!1,r=!1,i=0)=>{for(let s=i;s<e.length;s++)Y(e[s],t,n,l,r)},er=e=>{if(6&e.shapeFlag)return er(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=m(e.anchor||e.el),n=t&&t[tG];return n?m(n):t},ei=!1,es=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ei||(ei=!0,tL(),tV(),ei=!1)},eo={p:x,um:Y,m:Q,r:ee,mt:B,mc:j,pc:K,pbc:I,n:er,o:e};return{render:es,hydrate:n,createApp:function(e,t=null){O(e)||(e=_({},e)),null==t||E(t)||(t=null);let l=nb(),r=new WeakSet,i=[],s=!1,o=l.app={_uid:nx++,_component:e,_props:t,_container:null,_context:l,_instance:null,version:"3.5.13",get config(){return l.config},set config(v){},use:(e,...t)=>(r.has(e)||(e&&O(e.install)?(r.add(e),e.install(o,...t)):O(e)&&(r.add(e),e(o,...t))),o),mixin:e=>(l.mixins.includes(e)||l.mixins.push(e),o),component:(e,t)=>t?(l.components[e]=t,o):l.components[e],directive:(e,t)=>t?(l.directives[e]=t,o):l.directives[e],mount(r,i,a){if(!s){let u=o._ceVNode||ln(e,t);return u.appContext=l,!0===a?a="svg":!1===a&&(a=void 0),i&&n?n(u,r):es(u,r,a),s=!0,o._container=r,r.__vue_app__=o,lx(u.component)}},onUnmount(e){i.push(e)},unmount(){s&&(tO(i,o._instance,16),es(null,o._container),delete o._container.__vue_app__)},provide:(e,t)=>(l.provides[e]=t,o),runWithContext(e){let t=nS;nS=o;try{return e()}finally{nS=t}}};return o}}}(lG))).createApp(...e),{mount:n}=t;return t.mount=e=>{let l=R(e)?document.querySelector(e):e;if(!l)return;let r=t._component;O(r)||r.render||r.template||(r.template=l.innerHTML),1===l.nodeType&&(l.textContent="");let i=n(l,!1,l instanceof SVGElement?"svg":"function"==typeof MathMLElement&&l instanceof MathMLElement?"mathml":void 0);return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t},lK=!1,lJ=f(",key,ref,innerHTML,textContent,ref_key,ref_for");function lZ(e,t){let n="";for(let l in e){if(lJ(l)||m(l)||"textarea"===t&&"value"===l)continue;let r=e[l];"class"===l?n+=` class="${lY(r)}"`:"style"===l?n+=` style="${l0(r)}"`:"className"===l?n+=` class="${String(r)}"`:n+=lX(l,r,t)}return n}function lX(e,t,n){if(!ec(t))return"";let l=n&&(n.indexOf("-")>0||et(n))?e:eu[e]||e.toLowerCase();return ei(l)?es(t)?` ${l}`:"":!function(e){if(ea.hasOwnProperty(e))return ea[e];let t=eo.test(e);return t&&console.error(`unsafe attribute name: ${e}`),ea[e]=!t}(l)?(console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${l}`),""):""===t?` ${l}`:` ${l}="${ep(t)}"`}function lQ(e,t){return ec(t)?` ${e}="${ep(t)}"`:""}function lY(e){return ep(ee(e))}function l0(e){return e?R(e)?ep(e):ep(function(e){if(!e)return"";if(R(e))return e;let t="";for(let n in e){let l=e[n];if(R(l)||"number"==typeof l){let e=n.startsWith("--")?n:U(n);t+=`${e}:${l};`}}return t}(Z(e))):""}function l1(e,t=null,n=null,l=null,r){return rh(ln(e,t,n),l,r)}let{ensureValidVNode:l2}=lw;function l6(e,t,n,l,r,i,s){r("<!--[-->"),l4(e,t,n,l,r,i,s),r("<!--]-->")}function l4(e,t,n,l,r,i,s,o){let a=e[t];if(a){let e=[],t=a(n,t=>{e.push(t)},i,s?" "+s:"");if(w(t)){let e=l2(t);e?rm(r,e,i,s):l&&l()}else{let t=!0;if(o)t=!1;else for(let n=0;n<e.length;n++){var u;if(!("string"==typeof(u=e[n])&&l8.test(u)&&(u.length<=8||!u.replace(l3,"").trim()))){t=!1;break}}if(t)l&&l();else{let t=0,n=e.length;o&&"<!--[-->"===e[0]&&"<!--]-->"===e[n-1]&&(t++,n--);for(let l=t;l<n;l++)r(e[l])}}}else l&&l()}let l8=/^<!--[\s\S]*-->$/,l3=/<!--[^]*?-->/gm;function l5(e,t,n,l,r){let i;e("<!--teleport start-->");let s=r.appContext.provides[nB],o=s.__teleportBuffers||(s.__teleportBuffers={}),a=o[n]||(o[n]=[]),u=a.length;if(l)t(e),i="<!--teleport start anchor--><!--teleport anchor-->";else{let{getBuffer:e,push:n}=rd();n("<!--teleport start anchor-->"),t(n),n("<!--teleport anchor-->"),i=e()}a.splice(u,0,i),e("<!--teleport end-->")}function l9(e){return ep(em(e))}function l7(e,t){if(w(e)||R(e))for(let n=0,l=e.length;n<l;n++)t(e[n],n);else if("number"==typeof e)for(let n=0;n<e;n++)t(n+1,n);else if(E(e)){if(e[Symbol.iterator]){let n=Array.from(e);for(let e=0,l=n.length;e<l;e++)t(n[e],e)}else{let n=Object.keys(e);for(let l=0,r=n.length;l<r;l++){let r=n[l];t(e[r],r,l)}}}}async function re(e,{default:t}){t?t():e("<!---->")}function rt(e,t,n,l,r={}){return"function"!=typeof t&&t.getSSRProps&&t.getSSRProps({dir:t,instance:lw.getComponentPublicInstance(e.$),value:n,oldValue:void 0,arg:l,modifiers:r},null)||{}}let rn=eh;function rl(e,t){return eg(e,t)>-1}function rr(e,t,n){switch(e){case"radio":return eh(t,n)?" checked":"";case"checkbox":return(w(t)?rl(t,n):t)?" checked":"";default:return lQ("value",t)}}function ri(e={},t){let{type:n,value:l}=e;switch(n){case"radio":return eh(t,l)?{checked:!0}:null;case"checkbox":return(w(t)?rl(t,l):t)?{checked:!0}:null;default:return{value:t}}}let{createComponentInstance:rs,setCurrentRenderingInstance:ro,setupComponent:ra,renderComponentRoot:ru,normalizeVNode:rc,pushWarningContext:rf,popWarningContext:rp}=lw;function rd(){let e=!1,t=[];return{getBuffer:()=>t,push(n){let l=R(n);if(e&&l){t[t.length-1]+=n;return}t.push(n),e=l,(M(n)||w(n)&&n.hasAsync)&&(t.hasAsync=!0)}}}function rh(e,t=null,n){let l=e.component=rs(e,t,null),r=ra(l,!0),i=M(r),s=l.sp;return i||s?Promise.resolve(r).then(()=>{if(i&&(s=l.sp),s)return Promise.all(s.map(e=>e.call(l.proxy)))}).catch(h).then(()=>rg(l,n)):rg(l,n)}function rg(e,t){let n=e.type,{getBuffer:l,push:r}=rd();if(O(n)){let l=ru(e);if(!n.props)for(let t in e.attrs)t.startsWith("data-v-")&&((l.props||(l.props={}))[t]="");rv(r,e.subTree=l,e,t)}else{(!e.render||e.render===h)&&!e.ssrRender&&!n.ssrRender&&R(n.template)&&(n.ssrRender=function(e,t){throw Error("On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.")}(n.template));let l=e.ssrRender||n.ssrRender;if(l){let n=!1!==e.inheritAttrs?e.attrs:void 0,i=!1,s=e;for(;;){let e=s.vnode.scopeId;e&&(i||(n={...n},i=!0),n[e]="");let t=s.parent;if(t&&t.subTree&&t.subTree===s.vnode)s=t;else break}if(t){i||(n={...n});let e=t.trim().split(" ");for(let t=0;t<e.length;t++)n[e[t]]=""}let o=ro(e);try{l(e.proxy,r,e,n,e.props,e.setupState,e.data,e.ctx)}finally{ro(o)}}else e.render&&e.render!==h?rv(r,e.subTree=ru(e),e,t):(n.name||n.__file,r("<!---->"))}return l()}function rv(e,t,n,l){let{type:r,shapeFlag:i,children:s,dirs:o,props:a}=t;switch(o&&(t.props=function(e,t,n){let l=[];for(let t=0;t<n.length;t++){let r=n[t],{dir:{getSSRProps:i}}=r;if(i){let t=i(r,e);t&&l.push(t)}}return lo(t||{},...l)}(t,a,o)),r){case n6:e(ep(s));break;case n4:e(s?`<!--${s.replace(ed,"")}-->`:"<!---->");break;case n8:e(s);break;case n2:t.slotScopeIds&&(l=(l?l+" ":"")+t.slotScopeIds.join(" ")),e("<!--[-->"),rm(e,s,n,l),e("<!--]-->");break;default:1&i?function(e,t,n,l){let r=t.type,{props:i,children:s,shapeFlag:o,scopeId:a}=t,u=`<${r}`;i&&(u+=lZ(i,r)),a&&(u+=` ${a}`);let c=n,f=t;for(;c&&f===c.subTree;)(f=c.vnode).scopeId&&(u+=` ${f.scopeId}`),c=c.parent;if(l&&(u+=` ${l}`),e(u+">"),!en(r)){let t=!1;i&&(i.innerHTML?(t=!0,e(i.innerHTML)):i.textContent?(t=!0,e(ep(i.textContent))):"textarea"===r&&i.value&&(t=!0,e(ep(i.value)))),!t&&(8&o?e(ep(s)):16&o&&rm(e,s,n,l)),e(`</${r}>`)}}(e,t,n,l):6&i?e(rh(t,n,l)):64&i?function(e,t,n,l){let r=t.props&&t.props.to,i=t.props&&t.props.disabled;if(!r||!R(r))return[];l5(e,e=>{rm(e,t.children,n,l)},r,i||""===i,n)}(e,t,n,l):128&i&&rv(e,t.ssContent,n,l)}}function rm(e,t,n,l){for(let r=0;r<t.length;r++)rv(e,rc(t[r]),n,l)}let{isVNode:ry}=lw;function r_(e){return function e(t,n,l){if(!t.hasAsync)return n+function e(t){let n="";for(let l=0;l<t.length;l++){let r=t[l];R(r)?n+=r:n+=e(r)}return n}(t);let r=n;for(let n=l;n<t.length;n+=1){let l=t[n];if(R(l)){r+=l;continue}if(M(l))return l.then(l=>(t[n]=l,e(t,r,n)));let i=e(l,r,0);if(M(i))return i.then(l=>(t[n]=l,e(t,"",n)));r=i}return r}(e,"",0)}async function rb(e,t={}){if(ry(e))return rb(lz({render:()=>e}),t);let n=ln(e._component,e._props);n.appContext=e._context,e.provide(nB,t);let l=await rh(n),r=await r_(l);if(await rx(t),t.__watcherHandles)for(let e of t.__watcherHandles)e();return r}async function rx(e){if(e.__teleportBuffers)for(let t in e.teleports=e.teleports||{},e.__teleportBuffers)e.teleports[t]=await r_(await Promise.all([e.__teleportBuffers[t]]))}let{isVNode:rS}=lw;async function rw(e,t){if(e.hasAsync)for(let n=0;n<e.length;n++){let l=e[n];M(l)&&(l=await l),R(l)?t.push(l):await rw(l,t)}else!function e(t,n){for(let l=0;l<t.length;l++){let r=t[l];R(r)?n.push(r):e(r,n)}}(e,t)}function rk(e,t,n){if(rS(e))return rk(lz({render:()=>e}),t,n);let l=ln(e._component,e._props);return l.appContext=e._context,e.provide(nB,t),Promise.resolve(rh(l)).then(e=>rw(e,n)).then(()=>rx(t)).then(()=>{if(t.__watcherHandles)for(let e of t.__watcherHandles)e()}).then(()=>n.push(null)).catch(e=>{n.destroy(e)}),n}function rC(e,t={}){return console.warn("[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead."),rT(e,t)}function rT(e,t={}){throw Error("ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.")}function rO(e,t={},n){rk(e,t,{push(e){null!=e?n.write(e):n.end()},destroy(e){n.destroy(e)}})}function rR(e,t={}){if("function"!=typeof ReadableStream)throw Error("ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.");let n=new TextEncoder,l=!1;return new ReadableStream({start(r){rk(e,t,{push(e){l||(null!=e?r.enqueue(n.encode(e)):r.close())},destroy(e){r.error(e)}})},cancel(){l=!0}})}function rP(e,t={},n){let l=n.getWriter(),r=new TextEncoder,i=!1;try{i=M(l.ready)}catch(e){}rk(e,t,{push:async e=>(i&&await l.ready,null!=e)?l.write(r.encode(e)):l.close(),destroy(e){console.log(e),l.close()}})}lK||(lK=!0,({value:e},t)=>{if(w(e)){if(t.props&&eg(e,t.props.value)>-1)return{checked:!0}}else if(C(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}});export{rO as pipeToNodeWritable,rP as pipeToWebWritable,rT as renderToNodeStream,rk as renderToSimpleStream,rC as renderToStream,rb as renderToString,rR as renderToWebStream,rt as ssrGetDirectiveProps,ri as ssrGetDynamicModelProps,es as ssrIncludeBooleanAttr,l9 as ssrInterpolate,rl as ssrLooseContain,rn as ssrLooseEqual,lQ as ssrRenderAttr,lZ as ssrRenderAttrs,lY as ssrRenderClass,l1 as ssrRenderComponent,lX as ssrRenderDynamicAttr,rr as ssrRenderDynamicModel,l7 as ssrRenderList,l6 as ssrRenderSlot,l4 as ssrRenderSlotInner,l0 as ssrRenderStyle,re as ssrRenderSuspense,l5 as ssrRenderTeleport,rv as ssrRenderVNode}; diff --git a/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js new file mode 100644 index 0000000..c357c52 --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js @@ -0,0 +1,1224 @@ +/** +* @vue/server-renderer v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +import { createVNode, ssrUtils, ssrContextKey, warn as warn$2, Fragment, Static, Comment, Text, mergeProps, createApp, initDirectivesForSSR } from 'vue'; +import { isOn, isRenderableAttrValue, isSVGTag, propsToAttrMap, isBooleanAttr, includeBooleanAttr, isSSRSafeAttrName, escapeHtml, normalizeClass, isString, normalizeStyle, stringifyStyle, makeMap, isArray, toDisplayString, extend, isFunction, EMPTY_OBJ, getGlobalThis, NOOP, isObject, looseEqual, looseIndexOf, isPromise, escapeHtmlComment, isVoidTag } from '@vue/shared'; +export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared'; + +const shouldIgnoreProp = /* @__PURE__ */ makeMap( + `,key,ref,innerHTML,textContent,ref_key,ref_for` +); +function ssrRenderAttrs(props, tag) { + let ret = ""; + for (const key in props) { + if (shouldIgnoreProp(key) || isOn(key) || tag === "textarea" && key === "value") { + continue; + } + const value = props[key]; + if (key === "class") { + ret += ` class="${ssrRenderClass(value)}"`; + } else if (key === "style") { + ret += ` style="${ssrRenderStyle(value)}"`; + } else if (key === "className") { + ret += ` class="${String(value)}"`; + } else { + ret += ssrRenderDynamicAttr(key, value, tag); + } + } + return ret; +} +function ssrRenderDynamicAttr(key, value, tag) { + if (!isRenderableAttrValue(value)) { + return ``; + } + const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase(); + if (isBooleanAttr(attrKey)) { + return includeBooleanAttr(value) ? ` ${attrKey}` : ``; + } else if (isSSRSafeAttrName(attrKey)) { + return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`; + } else { + console.warn( + `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}` + ); + return ``; + } +} +function ssrRenderAttr(key, value) { + if (!isRenderableAttrValue(value)) { + return ``; + } + return ` ${key}="${escapeHtml(value)}"`; +} +function ssrRenderClass(raw) { + return escapeHtml(normalizeClass(raw)); +} +function ssrRenderStyle(raw) { + if (!raw) { + return ""; + } + if (isString(raw)) { + return escapeHtml(raw); + } + const styles = normalizeStyle(raw); + return escapeHtml(stringifyStyle(styles)); +} + +function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) { + return renderComponentVNode( + createVNode(comp, props, children), + parentComponent, + slotScopeId + ); +} + +const { ensureValidVNode } = ssrUtils; +function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) { + push(`<!--[-->`); + ssrRenderSlotInner( + slots, + slotName, + slotProps, + fallbackRenderFn, + push, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); +} +function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) { + const slotFn = slots[slotName]; + if (slotFn) { + const slotBuffer = []; + const bufferedPush = (item) => { + slotBuffer.push(item); + }; + const ret = slotFn( + slotProps, + bufferedPush, + parentComponent, + slotScopeId ? " " + slotScopeId : "" + ); + if (isArray(ret)) { + const validSlotContent = ensureValidVNode(ret); + if (validSlotContent) { + renderVNodeChildren( + push, + validSlotContent, + parentComponent, + slotScopeId + ); + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let isEmptySlot = true; + if (transition) { + isEmptySlot = false; + } else { + for (let i = 0; i < slotBuffer.length; i++) { + if (!isComment(slotBuffer[i])) { + isEmptySlot = false; + break; + } + } + } + if (isEmptySlot) { + if (fallbackRenderFn) { + fallbackRenderFn(); + } + } else { + let start = 0; + let end = slotBuffer.length; + if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") { + start++; + end--; + } + for (let i = start; i < end; i++) { + push(slotBuffer[i]); + } + } + } + } else if (fallbackRenderFn) { + fallbackRenderFn(); + } +} +const commentTestRE = /^<!--[\s\S]*-->$/; +const commentRE = /<!--[^]*?-->/gm; +function isComment(item) { + if (typeof item !== "string" || !commentTestRE.test(item)) return false; + if (item.length <= 8) return true; + return !item.replace(commentRE, "").trim(); +} + +function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) { + parentPush("<!--teleport start-->"); + const context = parentComponent.appContext.provides[ssrContextKey]; + const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {}); + const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []); + const bufferIndex = targetBuffer.length; + let teleportContent; + if (disabled) { + contentRenderFn(parentPush); + teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`; + } else { + const { getBuffer, push } = createBuffer(); + push(`<!--teleport start anchor-->`); + contentRenderFn(push); + push(`<!--teleport anchor-->`); + teleportContent = getBuffer(); + } + targetBuffer.splice(bufferIndex, 0, teleportContent); + parentPush("<!--teleport end-->"); +} + +function ssrInterpolate(value) { + return escapeHtml(toDisplayString(value)); +} + +let activeSub; +let batchDepth = 0; +let batchedSub; +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= ~8; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} + +class Dep { + constructor(computed) { + this.computed = computed; + this.version = 0; + /** + * Link between this dep and the current active effect + */ + this.activeLink = void 0; + /** + * Doubly linked list representing the subscribing effects (tail) + */ + this.subs = void 0; + /** + * For object property deps cleanup + */ + this.map = void 0; + this.key = void 0; + /** + * Subscriber counter + */ + this.sc = 0; + if (!!(process.env.NODE_ENV !== "production")) { + this.subsHead = void 0; + } + } + track(debugInfo) { + { + return; + } + } + trigger(debugInfo) { + this.version++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (!!(process.env.NODE_ENV !== "production")) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +Symbol( + !!(process.env.NODE_ENV !== "production") ? "Object iterate" : "" +); +Symbol( + !!(process.env.NODE_ENV !== "production") ? "Map keys iterate" : "" +); +Symbol( + !!(process.env.NODE_ENV !== "production") ? "Array iterate" : "" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + if (!!(process.env.NODE_ENV !== "production")) { + dep.track({ + target, + type, + key + }); + } else { + dep.track(); + } + } +} + +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} + +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} + +const stack = []; +function pushWarningContext$1(vnode) { + stack.push(vnode); +} +function popWarningContext$1() { + stack.pop(); +} +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} + +const ErrorTypeStrings = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings[type] : `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + if (!!(process.env.NODE_ENV !== "production")) { + const info = ErrorTypeStrings[type]; + if (contextVNode) { + pushWarningContext$1(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext$1(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } else if (throwInProd) { + throw err; + } else { + console.error(err); + } +} + +let devtools; +let buffer = []; +function setDevtoolsHook(hook, target) { + var _a, _b; + devtools = hook; + if (devtools) { + devtools.enabled = true; + buffer.forEach(({ event, args }) => devtools.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook(newHook, target); + }); + setTimeout(() => { + if (!devtools) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + buffer = []; + } + }, 3e3); + } else { + buffer = []; + } +} + +{ + const g = getGlobalThis(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) setters.forEach((set) => set(v)); + else setters[0](v); + }; + }; + registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => v + ); + registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => v + ); +} +!!(process.env.NODE_ENV !== "production") ? { + get(target, key) { + track(target, "get", ""); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } +} : { + get(target, key) { + track(target, "get", ""); + return target[key]; + } +}; +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; + } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return isFunction(value) && "__vccOpts" in value; +} + +const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP; +!!(process.env.NODE_ENV !== "production") || true ? devtools : void 0; +!!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook : NOOP; + +function ssrRenderList(source, renderItem) { + if (isArray(source) || isString(source)) { + for (let i = 0, l = source.length; i < l; i++) { + renderItem(source[i], i); + } + } else if (typeof source === "number") { + if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) { + warn(`The v-for range expect an integer value but got ${source}.`); + return; + } + for (let i = 0; i < source; i++) { + renderItem(i + 1, i); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + const arr = Array.from(source); + for (let i = 0, l = arr.length; i < l; i++) { + renderItem(arr[i], i); + } + } else { + const keys = Object.keys(source); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + renderItem(source[key], key, i); + } + } + } +} + +async function ssrRenderSuspense(push, { default: renderContent }) { + if (renderContent) { + renderContent(); + } else { + push(`<!---->`); + } +} + +function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) { + if (typeof dir !== "function" && dir.getSSRProps) { + return dir.getSSRProps( + { + dir, + instance: ssrUtils.getComponentPublicInstance(instance.$), + value, + oldValue: void 0, + arg, + modifiers + }, + null + ) || {}; + } + return {}; +} + +const ssrLooseEqual = looseEqual; +function ssrLooseContain(arr, value) { + return looseIndexOf(arr, value) > -1; +} +function ssrRenderDynamicModel(type, model, value) { + switch (type) { + case "radio": + return looseEqual(model, value) ? " checked" : ""; + case "checkbox": + return (isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : ""; + default: + return ssrRenderAttr("value", model); + } +} +function ssrGetDynamicModelProps(existingProps = {}, model) { + const { type, value } = existingProps; + switch (type) { + case "radio": + return looseEqual(model, value) ? { checked: true } : null; + case "checkbox": + return (isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null; + default: + return { value: model }; + } +} + +function ssrCompile(template, instance) { + { + throw new Error( + `On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.` + ); + } +} + +const { + createComponentInstance, + setCurrentRenderingInstance, + setupComponent, + renderComponentRoot, + normalizeVNode, + pushWarningContext, + popWarningContext +} = ssrUtils; +function createBuffer() { + let appendable = false; + const buffer = []; + return { + getBuffer() { + return buffer; + }, + push(item) { + const isStringItem = isString(item); + if (appendable && isStringItem) { + buffer[buffer.length - 1] += item; + return; + } + buffer.push(item); + appendable = isStringItem; + if (isPromise(item) || isArray(item) && item.hasAsync) { + buffer.hasAsync = true; + } + } + }; +} +function renderComponentVNode(vnode, parentComponent = null, slotScopeId) { + const instance = vnode.component = createComponentInstance( + vnode, + parentComponent, + null + ); + if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(vnode); + const res = setupComponent( + instance, + true + /* isSSR */ + ); + if (!!(process.env.NODE_ENV !== "production")) popWarningContext(); + const hasAsyncSetup = isPromise(res); + let prefetches = instance.sp; + if (hasAsyncSetup || prefetches) { + const p = Promise.resolve(res).then(() => { + if (hasAsyncSetup) prefetches = instance.sp; + if (prefetches) { + return Promise.all( + prefetches.map((prefetch) => prefetch.call(instance.proxy)) + ); + } + }).catch(NOOP); + return p.then(() => renderComponentSubTree(instance, slotScopeId)); + } else { + return renderComponentSubTree(instance, slotScopeId); + } +} +function renderComponentSubTree(instance, slotScopeId) { + if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(instance.vnode); + const comp = instance.type; + const { getBuffer, push } = createBuffer(); + if (isFunction(comp)) { + let root = renderComponentRoot(instance); + if (!comp.props) { + for (const key in instance.attrs) { + if (key.startsWith(`data-v-`)) { + (root.props || (root.props = {}))[key] = ``; + } + } + } + renderVNode(push, instance.subTree = root, instance, slotScopeId); + } else { + if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) { + comp.ssrRender = ssrCompile(comp.template); + } + const ssrRender = instance.ssrRender || comp.ssrRender; + if (ssrRender) { + let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0; + let hasCloned = false; + let cur = instance; + while (true) { + const scopeId = cur.vnode.scopeId; + if (scopeId) { + if (!hasCloned) { + attrs = { ...attrs }; + hasCloned = true; + } + attrs[scopeId] = ""; + } + const parent = cur.parent; + if (parent && parent.subTree && parent.subTree === cur.vnode) { + cur = parent; + } else { + break; + } + } + if (slotScopeId) { + if (!hasCloned) attrs = { ...attrs }; + const slotScopeIdList = slotScopeId.trim().split(" "); + for (let i = 0; i < slotScopeIdList.length; i++) { + attrs[slotScopeIdList[i]] = ""; + } + } + const prev = setCurrentRenderingInstance(instance); + try { + ssrRender( + instance.proxy, + push, + instance, + attrs, + // compiler-optimized bindings + instance.props, + instance.setupState, + instance.data, + instance.ctx + ); + } finally { + setCurrentRenderingInstance(prev); + } + } else if (instance.render && instance.render !== NOOP) { + renderVNode( + push, + instance.subTree = renderComponentRoot(instance), + instance, + slotScopeId + ); + } else { + const componentName = comp.name || comp.__file || `<Anonymous>`; + warn$2(`Component ${componentName} is missing template or render function.`); + push(`<!---->`); + } + } + if (!!(process.env.NODE_ENV !== "production")) popWarningContext(); + return getBuffer(); +} +function renderVNode(push, vnode, parentComponent, slotScopeId) { + const { type, shapeFlag, children, dirs, props } = vnode; + if (dirs) { + vnode.props = applySSRDirectives(vnode, props, dirs); + } + switch (type) { + case Text: + push(escapeHtml(children)); + break; + case Comment: + push( + children ? `<!--${escapeHtmlComment(children)}-->` : `<!---->` + ); + break; + case Static: + push(children); + break; + case Fragment: + if (vnode.slotScopeIds) { + slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" "); + } + push(`<!--[-->`); + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + push(`<!--]-->`); + break; + default: + if (shapeFlag & 1) { + renderElementVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 6) { + push(renderComponentVNode(vnode, parentComponent, slotScopeId)); + } else if (shapeFlag & 64) { + renderTeleportVNode(push, vnode, parentComponent, slotScopeId); + } else if (shapeFlag & 128) { + renderVNode(push, vnode.ssContent, parentComponent, slotScopeId); + } else { + warn$2( + "[@vue/server-renderer] Invalid VNode type:", + type, + `(${typeof type})` + ); + } + } +} +function renderVNodeChildren(push, children, parentComponent, slotScopeId) { + for (let i = 0; i < children.length; i++) { + renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId); + } +} +function renderElementVNode(push, vnode, parentComponent, slotScopeId) { + const tag = vnode.type; + let { props, children, shapeFlag, scopeId } = vnode; + let openTag = `<${tag}`; + if (props) { + openTag += ssrRenderAttrs(props, tag); + } + if (scopeId) { + openTag += ` ${scopeId}`; + } + let curParent = parentComponent; + let curVnode = vnode; + while (curParent && curVnode === curParent.subTree) { + curVnode = curParent.vnode; + if (curVnode.scopeId) { + openTag += ` ${curVnode.scopeId}`; + } + curParent = curParent.parent; + } + if (slotScopeId) { + openTag += ` ${slotScopeId}`; + } + push(openTag + `>`); + if (!isVoidTag(tag)) { + let hasChildrenOverride = false; + if (props) { + if (props.innerHTML) { + hasChildrenOverride = true; + push(props.innerHTML); + } else if (props.textContent) { + hasChildrenOverride = true; + push(escapeHtml(props.textContent)); + } else if (tag === "textarea" && props.value) { + hasChildrenOverride = true; + push(escapeHtml(props.value)); + } + } + if (!hasChildrenOverride) { + if (shapeFlag & 8) { + push(escapeHtml(children)); + } else if (shapeFlag & 16) { + renderVNodeChildren( + push, + children, + parentComponent, + slotScopeId + ); + } + } + push(`</${tag}>`); + } +} +function applySSRDirectives(vnode, rawProps, dirs) { + const toMerge = []; + for (let i = 0; i < dirs.length; i++) { + const binding = dirs[i]; + const { + dir: { getSSRProps } + } = binding; + if (getSSRProps) { + const props = getSSRProps(binding, vnode); + if (props) toMerge.push(props); + } + } + return mergeProps(rawProps || {}, ...toMerge); +} +function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) { + const target = vnode.props && vnode.props.to; + const disabled = vnode.props && vnode.props.disabled; + if (!target) { + if (!disabled) { + warn$2(`[@vue/server-renderer] Teleport is missing target prop.`); + } + return []; + } + if (!isString(target)) { + warn$2( + `[@vue/server-renderer] Teleport target must be a query selector string.` + ); + return []; + } + ssrRenderTeleport( + push, + (push2) => { + renderVNodeChildren( + push2, + vnode.children, + parentComponent, + slotScopeId + ); + }, + target, + disabled || disabled === "", + parentComponent + ); +} + +const { isVNode: isVNode$1 } = ssrUtils; +function nestedUnrollBuffer(buffer, parentRet, startIndex) { + if (!buffer.hasAsync) { + return parentRet + unrollBufferSync$1(buffer); + } + let ret = parentRet; + for (let i = startIndex; i < buffer.length; i += 1) { + const item = buffer[i]; + if (isString(item)) { + ret += item; + continue; + } + if (isPromise(item)) { + return item.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, ret, i); + }); + } + const result = nestedUnrollBuffer(item, ret, 0); + if (isPromise(result)) { + return result.then((nestedItem) => { + buffer[i] = nestedItem; + return nestedUnrollBuffer(buffer, "", i); + }); + } + ret = result; + } + return ret; +} +function unrollBuffer$1(buffer) { + return nestedUnrollBuffer(buffer, "", 0); +} +function unrollBufferSync$1(buffer) { + let ret = ""; + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isString(item)) { + ret += item; + } else { + ret += unrollBufferSync$1(item); + } + } + return ret; +} +async function renderToString(input, context = {}) { + if (isVNode$1(input)) { + return renderToString(createApp({ render: () => input }), context); + } + const vnode = createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(ssrContextKey, context); + const buffer = await renderComponentVNode(vnode); + const result = await unrollBuffer$1(buffer); + await resolveTeleports(context); + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + return result; +} +async function resolveTeleports(context) { + if (context.__teleportBuffers) { + context.teleports = context.teleports || {}; + for (const key in context.__teleportBuffers) { + context.teleports[key] = await unrollBuffer$1( + await Promise.all([context.__teleportBuffers[key]]) + ); + } + } +} + +const { isVNode } = ssrUtils; +async function unrollBuffer(buffer, stream) { + if (buffer.hasAsync) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isPromise(item)) { + item = await item; + } + if (isString(item)) { + stream.push(item); + } else { + await unrollBuffer(item, stream); + } + } + } else { + unrollBufferSync(buffer, stream); + } +} +function unrollBufferSync(buffer, stream) { + for (let i = 0; i < buffer.length; i++) { + let item = buffer[i]; + if (isString(item)) { + stream.push(item); + } else { + unrollBufferSync(item, stream); + } + } +} +function renderToSimpleStream(input, context, stream) { + if (isVNode(input)) { + return renderToSimpleStream( + createApp({ render: () => input }), + context, + stream + ); + } + const vnode = createVNode(input._component, input._props); + vnode.appContext = input._context; + input.provide(ssrContextKey, context); + Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => { + if (context.__watcherHandles) { + for (const unwatch of context.__watcherHandles) { + unwatch(); + } + } + }).then(() => stream.push(null)).catch((error) => { + stream.destroy(error); + }); + return stream; +} +function renderToStream(input, context = {}) { + console.warn( + `[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.` + ); + return renderToNodeStream(input, context); +} +function renderToNodeStream(input, context = {}) { + { + throw new Error( + `ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.` + ); + } +} +function pipeToNodeWritable(input, context = {}, writable) { + renderToSimpleStream(input, context, { + push(content) { + if (content != null) { + writable.write(content); + } else { + writable.end(); + } + }, + destroy(err) { + writable.destroy(err); + } + }); +} +function renderToWebStream(input, context = {}) { + if (typeof ReadableStream !== "function") { + throw new Error( + `ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.` + ); + } + const encoder = new TextEncoder(); + let cancelled = false; + return new ReadableStream({ + start(controller) { + renderToSimpleStream(input, context, { + push(content) { + if (cancelled) return; + if (content != null) { + controller.enqueue(encoder.encode(content)); + } else { + controller.close(); + } + }, + destroy(err) { + controller.error(err); + } + }); + }, + cancel() { + cancelled = true; + } + }); +} +function pipeToWebWritable(input, context = {}, writable) { + const writer = writable.getWriter(); + const encoder = new TextEncoder(); + let hasReady = false; + try { + hasReady = isPromise(writer.ready); + } catch (e) { + } + renderToSimpleStream(input, context, { + async push(content) { + if (hasReady) { + await writer.ready; + } + if (content != null) { + return writer.write(encoder.encode(content)); + } else { + return writer.close(); + } + }, + destroy(err) { + console.log(err); + writer.close(); + } + }); +} + +initDirectivesForSSR(); + +export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode }; diff --git a/seller_1/node_modules/@vue/server-renderer/index.js b/seller_1/node_modules/@vue/server-renderer/index.js new file mode 100644 index 0000000..f5a3d90 --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/server-renderer.cjs.prod.js') +} else { + module.exports = require('./dist/server-renderer.cjs.js') +} diff --git a/seller_1/node_modules/@vue/server-renderer/package.json b/seller_1/node_modules/@vue/server-renderer/package.json new file mode 100644 index 0000000..d44abb9 --- /dev/null +++ b/seller_1/node_modules/@vue/server-renderer/package.json @@ -0,0 +1,55 @@ +{ + "name": "@vue/server-renderer", + "version": "3.5.13", + "description": "@vue/server-renderer", + "main": "index.js", + "module": "dist/server-renderer.esm-bundler.js", + "types": "dist/server-renderer.d.ts", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/server-renderer.d.ts", + "node": { + "production": "./dist/server-renderer.cjs.prod.js", + "development": "./dist/server-renderer.cjs.js", + "default": "./index.js" + }, + "module": "./dist/server-renderer.esm-bundler.js", + "import": "./dist/server-renderer.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "buildOptions": { + "name": "VueServerRenderer", + "formats": [ + "esm-bundler", + "esm-browser", + "cjs" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/server-renderer" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme", + "peerDependencies": { + "vue": "3.5.13" + }, + "dependencies": { + "@vue/shared": "3.5.13", + "@vue/compiler-ssr": "3.5.13" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/@vue/shared/LICENSE b/seller_1/node_modules/@vue/shared/LICENSE new file mode 100644 index 0000000..15f1f7e --- /dev/null +++ b/seller_1/node_modules/@vue/shared/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/seller_1/node_modules/@vue/shared/README.md b/seller_1/node_modules/@vue/shared/README.md new file mode 100644 index 0000000..1d01f2f --- /dev/null +++ b/seller_1/node_modules/@vue/shared/README.md @@ -0,0 +1,3 @@ +# @vue/shared + +Internal utility functions and constants shared across `@vue` packages. diff --git a/seller_1/node_modules/@vue/shared/dist/shared.cjs.js b/seller_1/node_modules/@vue/shared/dist/shared.cjs.js new file mode 100644 index 0000000..94f7cc6 --- /dev/null +++ b/seller_1/node_modules/@vue/shared/dist/shared.cjs.js @@ -0,0 +1,594 @@ +/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const EMPTY_ARR = Object.freeze([]) ; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name) { + return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; +} +function genCacheKey(source, options) { + return source + JSON.stringify( + options, + (_, val) => typeof val === "function" ? val.toString() : val + ); +} + +const PatchFlags = { + "TEXT": 1, + "1": "TEXT", + "CLASS": 2, + "2": "CLASS", + "STYLE": 4, + "4": "STYLE", + "PROPS": 8, + "8": "PROPS", + "FULL_PROPS": 16, + "16": "FULL_PROPS", + "NEED_HYDRATION": 32, + "32": "NEED_HYDRATION", + "STABLE_FRAGMENT": 64, + "64": "STABLE_FRAGMENT", + "KEYED_FRAGMENT": 128, + "128": "KEYED_FRAGMENT", + "UNKEYED_FRAGMENT": 256, + "256": "UNKEYED_FRAGMENT", + "NEED_PATCH": 512, + "512": "NEED_PATCH", + "DYNAMIC_SLOTS": 1024, + "1024": "DYNAMIC_SLOTS", + "DEV_ROOT_FRAGMENT": 2048, + "2048": "DEV_ROOT_FRAGMENT", + "CACHED": -1, + "-1": "CACHED", + "BAIL": -2, + "-2": "BAIL" +}; +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const ShapeFlags = { + "ELEMENT": 1, + "1": "ELEMENT", + "FUNCTIONAL_COMPONENT": 2, + "2": "FUNCTIONAL_COMPONENT", + "STATEFUL_COMPONENT": 4, + "4": "STATEFUL_COMPONENT", + "TEXT_CHILDREN": 8, + "8": "TEXT_CHILDREN", + "ARRAY_CHILDREN": 16, + "16": "ARRAY_CHILDREN", + "SLOTS_CHILDREN": 32, + "32": "SLOTS_CHILDREN", + "TELEPORT": 64, + "64": "TELEPORT", + "SUSPENSE": 128, + "128": "SUSPENSE", + "COMPONENT_SHOULD_KEEP_ALIVE": 256, + "256": "COMPONENT_SHOULD_KEEP_ALIVE", + "COMPONENT_KEPT_ALIVE": 512, + "512": "COMPONENT_KEPT_ALIVE", + "COMPONENT": 6, + "6": "COMPONENT" +}; + +const SlotFlags = { + "STABLE": 1, + "1": "STABLE", + "DYNAMIC": 2, + "2": "DYNAMIC", + "FORWARDED": 3, + "3": "FORWARDED" +}; +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); +const isGloballyWhitelisted = isGloballyAllowed; + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +const isKnownMathMLAttr = /* @__PURE__ */ makeMap( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.slice(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); +} +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const isRef = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +exports.EMPTY_ARR = EMPTY_ARR; +exports.EMPTY_OBJ = EMPTY_OBJ; +exports.NO = NO; +exports.NOOP = NOOP; +exports.PatchFlagNames = PatchFlagNames; +exports.PatchFlags = PatchFlags; +exports.ShapeFlags = ShapeFlags; +exports.SlotFlags = SlotFlags; +exports.camelize = camelize; +exports.capitalize = capitalize; +exports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE; +exports.def = def; +exports.escapeHtml = escapeHtml; +exports.escapeHtmlComment = escapeHtmlComment; +exports.extend = extend; +exports.genCacheKey = genCacheKey; +exports.genPropsAccessExp = genPropsAccessExp; +exports.generateCodeFrame = generateCodeFrame; +exports.getEscapedCssVarName = getEscapedCssVarName; +exports.getGlobalThis = getGlobalThis; +exports.hasChanged = hasChanged; +exports.hasOwn = hasOwn; +exports.hyphenate = hyphenate; +exports.includeBooleanAttr = includeBooleanAttr; +exports.invokeArrayFns = invokeArrayFns; +exports.isArray = isArray; +exports.isBooleanAttr = isBooleanAttr; +exports.isBuiltInDirective = isBuiltInDirective; +exports.isDate = isDate; +exports.isFunction = isFunction; +exports.isGloballyAllowed = isGloballyAllowed; +exports.isGloballyWhitelisted = isGloballyWhitelisted; +exports.isHTMLTag = isHTMLTag; +exports.isIntegerKey = isIntegerKey; +exports.isKnownHtmlAttr = isKnownHtmlAttr; +exports.isKnownMathMLAttr = isKnownMathMLAttr; +exports.isKnownSvgAttr = isKnownSvgAttr; +exports.isMap = isMap; +exports.isMathMLTag = isMathMLTag; +exports.isModelListener = isModelListener; +exports.isObject = isObject; +exports.isOn = isOn; +exports.isPlainObject = isPlainObject; +exports.isPromise = isPromise; +exports.isRegExp = isRegExp; +exports.isRenderableAttrValue = isRenderableAttrValue; +exports.isReservedProp = isReservedProp; +exports.isSSRSafeAttrName = isSSRSafeAttrName; +exports.isSVGTag = isSVGTag; +exports.isSet = isSet; +exports.isSpecialBooleanAttr = isSpecialBooleanAttr; +exports.isString = isString; +exports.isSymbol = isSymbol; +exports.isVoidTag = isVoidTag; +exports.looseEqual = looseEqual; +exports.looseIndexOf = looseIndexOf; +exports.looseToNumber = looseToNumber; +exports.makeMap = makeMap; +exports.normalizeClass = normalizeClass; +exports.normalizeProps = normalizeProps; +exports.normalizeStyle = normalizeStyle; +exports.objectToString = objectToString; +exports.parseStringStyle = parseStringStyle; +exports.propsToAttrMap = propsToAttrMap; +exports.remove = remove; +exports.slotFlagsText = slotFlagsText; +exports.stringifyStyle = stringifyStyle; +exports.toDisplayString = toDisplayString; +exports.toHandlerKey = toHandlerKey; +exports.toNumber = toNumber; +exports.toRawType = toRawType; +exports.toTypeString = toTypeString; diff --git a/seller_1/node_modules/@vue/shared/dist/shared.cjs.prod.js b/seller_1/node_modules/@vue/shared/dist/shared.cjs.prod.js new file mode 100644 index 0000000..14b1902 --- /dev/null +++ b/seller_1/node_modules/@vue/shared/dist/shared.cjs.prod.js @@ -0,0 +1,594 @@ +/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = {}; +const EMPTY_ARR = []; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name) { + return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; +} +function genCacheKey(source, options) { + return source + JSON.stringify( + options, + (_, val) => typeof val === "function" ? val.toString() : val + ); +} + +const PatchFlags = { + "TEXT": 1, + "1": "TEXT", + "CLASS": 2, + "2": "CLASS", + "STYLE": 4, + "4": "STYLE", + "PROPS": 8, + "8": "PROPS", + "FULL_PROPS": 16, + "16": "FULL_PROPS", + "NEED_HYDRATION": 32, + "32": "NEED_HYDRATION", + "STABLE_FRAGMENT": 64, + "64": "STABLE_FRAGMENT", + "KEYED_FRAGMENT": 128, + "128": "KEYED_FRAGMENT", + "UNKEYED_FRAGMENT": 256, + "256": "UNKEYED_FRAGMENT", + "NEED_PATCH": 512, + "512": "NEED_PATCH", + "DYNAMIC_SLOTS": 1024, + "1024": "DYNAMIC_SLOTS", + "DEV_ROOT_FRAGMENT": 2048, + "2048": "DEV_ROOT_FRAGMENT", + "CACHED": -1, + "-1": "CACHED", + "BAIL": -2, + "-2": "BAIL" +}; +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const ShapeFlags = { + "ELEMENT": 1, + "1": "ELEMENT", + "FUNCTIONAL_COMPONENT": 2, + "2": "FUNCTIONAL_COMPONENT", + "STATEFUL_COMPONENT": 4, + "4": "STATEFUL_COMPONENT", + "TEXT_CHILDREN": 8, + "8": "TEXT_CHILDREN", + "ARRAY_CHILDREN": 16, + "16": "ARRAY_CHILDREN", + "SLOTS_CHILDREN": 32, + "32": "SLOTS_CHILDREN", + "TELEPORT": 64, + "64": "TELEPORT", + "SUSPENSE": 128, + "128": "SUSPENSE", + "COMPONENT_SHOULD_KEEP_ALIVE": 256, + "256": "COMPONENT_SHOULD_KEEP_ALIVE", + "COMPONENT_KEPT_ALIVE": 512, + "512": "COMPONENT_KEPT_ALIVE", + "COMPONENT": 6, + "6": "COMPONENT" +}; + +const SlotFlags = { + "STABLE": 1, + "1": "STABLE", + "DYNAMIC": 2, + "2": "DYNAMIC", + "FORWARDED": 3, + "3": "FORWARDED" +}; +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); +const isGloballyWhitelisted = isGloballyAllowed; + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +const isKnownMathMLAttr = /* @__PURE__ */ makeMap( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.slice(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); +} +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const isRef = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +exports.EMPTY_ARR = EMPTY_ARR; +exports.EMPTY_OBJ = EMPTY_OBJ; +exports.NO = NO; +exports.NOOP = NOOP; +exports.PatchFlagNames = PatchFlagNames; +exports.PatchFlags = PatchFlags; +exports.ShapeFlags = ShapeFlags; +exports.SlotFlags = SlotFlags; +exports.camelize = camelize; +exports.capitalize = capitalize; +exports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE; +exports.def = def; +exports.escapeHtml = escapeHtml; +exports.escapeHtmlComment = escapeHtmlComment; +exports.extend = extend; +exports.genCacheKey = genCacheKey; +exports.genPropsAccessExp = genPropsAccessExp; +exports.generateCodeFrame = generateCodeFrame; +exports.getEscapedCssVarName = getEscapedCssVarName; +exports.getGlobalThis = getGlobalThis; +exports.hasChanged = hasChanged; +exports.hasOwn = hasOwn; +exports.hyphenate = hyphenate; +exports.includeBooleanAttr = includeBooleanAttr; +exports.invokeArrayFns = invokeArrayFns; +exports.isArray = isArray; +exports.isBooleanAttr = isBooleanAttr; +exports.isBuiltInDirective = isBuiltInDirective; +exports.isDate = isDate; +exports.isFunction = isFunction; +exports.isGloballyAllowed = isGloballyAllowed; +exports.isGloballyWhitelisted = isGloballyWhitelisted; +exports.isHTMLTag = isHTMLTag; +exports.isIntegerKey = isIntegerKey; +exports.isKnownHtmlAttr = isKnownHtmlAttr; +exports.isKnownMathMLAttr = isKnownMathMLAttr; +exports.isKnownSvgAttr = isKnownSvgAttr; +exports.isMap = isMap; +exports.isMathMLTag = isMathMLTag; +exports.isModelListener = isModelListener; +exports.isObject = isObject; +exports.isOn = isOn; +exports.isPlainObject = isPlainObject; +exports.isPromise = isPromise; +exports.isRegExp = isRegExp; +exports.isRenderableAttrValue = isRenderableAttrValue; +exports.isReservedProp = isReservedProp; +exports.isSSRSafeAttrName = isSSRSafeAttrName; +exports.isSVGTag = isSVGTag; +exports.isSet = isSet; +exports.isSpecialBooleanAttr = isSpecialBooleanAttr; +exports.isString = isString; +exports.isSymbol = isSymbol; +exports.isVoidTag = isVoidTag; +exports.looseEqual = looseEqual; +exports.looseIndexOf = looseIndexOf; +exports.looseToNumber = looseToNumber; +exports.makeMap = makeMap; +exports.normalizeClass = normalizeClass; +exports.normalizeProps = normalizeProps; +exports.normalizeStyle = normalizeStyle; +exports.objectToString = objectToString; +exports.parseStringStyle = parseStringStyle; +exports.propsToAttrMap = propsToAttrMap; +exports.remove = remove; +exports.slotFlagsText = slotFlagsText; +exports.stringifyStyle = stringifyStyle; +exports.toDisplayString = toDisplayString; +exports.toHandlerKey = toHandlerKey; +exports.toNumber = toNumber; +exports.toRawType = toRawType; +exports.toTypeString = toTypeString; diff --git a/seller_1/node_modules/@vue/shared/dist/shared.d.ts b/seller_1/node_modules/@vue/shared/dist/shared.d.ts new file mode 100644 index 0000000..ab2199d --- /dev/null +++ b/seller_1/node_modules/@vue/shared/dist/shared.d.ts @@ -0,0 +1,328 @@ +/** + * Make a map and return a function for checking if a key + * is in that map. + * IMPORTANT: all calls of this function must be prefixed with + * \/\*#\_\_PURE\_\_\*\/ + * So that rollup can tree-shake them if necessary. + */ +/*! #__NO_SIDE_EFFECTS__ */ +export declare function makeMap(str: string): (key: string) => boolean; + +export declare const EMPTY_OBJ: { + readonly [key: string]: any; +}; +export declare const EMPTY_ARR: readonly never[]; +export declare const NOOP: () => void; +/** + * Always return false. + */ +export declare const NO: () => boolean; +export declare const isOn: (key: string) => boolean; +export declare const isModelListener: (key: string) => key is `onUpdate:${string}`; +export declare const extend: typeof Object.assign; +export declare const remove: <T>(arr: T[], el: T) => void; +export declare const hasOwn: (val: object, key: string | symbol) => key is keyof typeof val; +export declare const isArray: typeof Array.isArray; +export declare const isMap: (val: unknown) => val is Map<any, any>; +export declare const isSet: (val: unknown) => val is Set<any>; +export declare const isDate: (val: unknown) => val is Date; +export declare const isRegExp: (val: unknown) => val is RegExp; +export declare const isFunction: (val: unknown) => val is Function; +export declare const isString: (val: unknown) => val is string; +export declare const isSymbol: (val: unknown) => val is symbol; +export declare const isObject: (val: unknown) => val is Record<any, any>; +export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>; +export declare const objectToString: typeof Object.prototype.toString; +export declare const toTypeString: (value: unknown) => string; +export declare const toRawType: (value: unknown) => string; +export declare const isPlainObject: (val: unknown) => val is object; +export declare const isIntegerKey: (key: unknown) => boolean; +export declare const isReservedProp: (key: string) => boolean; +export declare const isBuiltInDirective: (key: string) => boolean; +/** + * @private + */ +export declare const camelize: (str: string) => string; +/** + * @private + */ +export declare const hyphenate: (str: string) => string; +/** + * @private + */ +export declare const capitalize: <T extends string>(str: T) => Capitalize<T>; +/** + * @private + */ +export declare const toHandlerKey: <T extends string>(str: T) => T extends '' ? '' : `on${Capitalize<T>}`; +export declare const hasChanged: (value: any, oldValue: any) => boolean; +export declare const invokeArrayFns: (fns: Function[], ...arg: any[]) => void; +export declare const def: (obj: object, key: string | symbol, value: any, writable?: boolean) => void; +/** + * "123-foo" will be parsed to 123 + * This is used for the .number modifier in v-model + */ +export declare const looseToNumber: (val: any) => any; +/** + * Only concerns number-like strings + * "123-foo" will be returned as-is + */ +export declare const toNumber: (val: any) => any; +export declare const getGlobalThis: () => any; +export declare function genPropsAccessExp(name: string): string; +export declare function genCacheKey(source: string, options: any): string; + +/** + * Patch flags are optimization hints generated by the compiler. + * when a block with dynamicChildren is encountered during diff, the algorithm + * enters "optimized mode". In this mode, we know that the vdom is produced by + * a render function generated by the compiler, so the algorithm only needs to + * handle updates explicitly marked by these patch flags. + * + * Patch flags can be combined using the | bitwise operator and can be checked + * using the & operator, e.g. + * + * ```js + * const flag = TEXT | CLASS + * if (flag & TEXT) { ... } + * ``` + * + * Check the `patchElement` function in '../../runtime-core/src/renderer.ts' to see how the + * flags are handled during diff. + */ +export declare enum PatchFlags { + /** + * Indicates an element with dynamic textContent (children fast path) + */ + TEXT = 1, + /** + * Indicates an element with dynamic class binding. + */ + CLASS = 2, + /** + * Indicates an element with dynamic style + * The compiler pre-compiles static string styles into static objects + * + detects and hoists inline static objects + * e.g. `style="color: red"` and `:style="{ color: 'red' }"` both get hoisted + * as: + * ```js + * const style = { color: 'red' } + * render() { return e('div', { style }) } + * ``` + */ + STYLE = 4, + /** + * Indicates an element that has non-class/style dynamic props. + * Can also be on a component that has any dynamic props (includes + * class/style). when this flag is present, the vnode also has a dynamicProps + * array that contains the keys of the props that may change so the runtime + * can diff them faster (without having to worry about removed props) + */ + PROPS = 8, + /** + * Indicates an element with props with dynamic keys. When keys change, a full + * diff is always needed to remove the old key. This flag is mutually + * exclusive with CLASS, STYLE and PROPS. + */ + FULL_PROPS = 16, + /** + * Indicates an element that requires props hydration + * (but not necessarily patching) + * e.g. event listeners & v-bind with prop modifier + */ + NEED_HYDRATION = 32, + /** + * Indicates a fragment whose children order doesn't change. + */ + STABLE_FRAGMENT = 64, + /** + * Indicates a fragment with keyed or partially keyed children + */ + KEYED_FRAGMENT = 128, + /** + * Indicates a fragment with unkeyed children. + */ + UNKEYED_FRAGMENT = 256, + /** + * Indicates an element that only needs non-props patching, e.g. ref or + * directives (onVnodeXXX hooks). since every patched vnode checks for refs + * and onVnodeXXX hooks, it simply marks the vnode so that a parent block + * will track it. + */ + NEED_PATCH = 512, + /** + * Indicates a component with dynamic slots (e.g. slot that references a v-for + * iterated value, or dynamic slot names). + * Components with this flag are always force updated. + */ + DYNAMIC_SLOTS = 1024, + /** + * Indicates a fragment that was created only because the user has placed + * comments at the root level of a template. This is a dev-only flag since + * comments are stripped in production. + */ + DEV_ROOT_FRAGMENT = 2048, + /** + * SPECIAL FLAGS ------------------------------------------------------------- + * Special flags are negative integers. They are never matched against using + * bitwise operators (bitwise matching should only happen in branches where + * patchFlag > 0), and are mutually exclusive. When checking for a special + * flag, simply check patchFlag === FLAG. + */ + /** + * Indicates a cached static vnode. This is also a hint for hydration to skip + * the entire sub tree since static content never needs to be updated. + */ + CACHED = -1, + /** + * A special flag that indicates that the diffing algorithm should bail out + * of optimized mode. For example, on block fragments created by renderSlot() + * when encountering non-compiler generated slots (i.e. manually written + * render functions, which should always be fully diffed) + * OR manually cloneVNodes + */ + BAIL = -2 +} +/** + * dev only flag -> name mapping + */ +export declare const PatchFlagNames: Record<PatchFlags, string>; + +export declare enum ShapeFlags { + ELEMENT = 1, + FUNCTIONAL_COMPONENT = 2, + STATEFUL_COMPONENT = 4, + TEXT_CHILDREN = 8, + ARRAY_CHILDREN = 16, + SLOTS_CHILDREN = 32, + TELEPORT = 64, + SUSPENSE = 128, + COMPONENT_SHOULD_KEEP_ALIVE = 256, + COMPONENT_KEPT_ALIVE = 512, + COMPONENT = 6 +} + +export declare enum SlotFlags { + /** + * Stable slots that only reference slot props or context state. The slot + * can fully capture its own dependencies so when passed down the parent won't + * need to force the child to update. + */ + STABLE = 1, + /** + * Slots that reference scope variables (v-for or an outer slot prop), or + * has conditional structure (v-if, v-for). The parent will need to force + * the child to update because the slot does not fully capture its dependencies. + */ + DYNAMIC = 2, + /** + * `<slot/>` being forwarded into a child component. Whether the parent needs + * to update the child is dependent on what kind of slots the parent itself + * received. This has to be refined at runtime, when the child's vnode + * is being created (in `normalizeChildren`) + */ + FORWARDED = 3 +} +/** + * Dev only + */ +export declare const slotFlagsText: Record<SlotFlags, string>; + +export declare const isGloballyAllowed: (key: string) => boolean; +/** @deprecated use `isGloballyAllowed` instead */ +export declare const isGloballyWhitelisted: (key: string) => boolean; + +export declare function generateCodeFrame(source: string, start?: number, end?: number): string; + +export type NormalizedStyle = Record<string, string | number>; +export declare function normalizeStyle(value: unknown): NormalizedStyle | string | undefined; +export declare function parseStringStyle(cssText: string): NormalizedStyle; +export declare function stringifyStyle(styles: NormalizedStyle | string | undefined): string; +export declare function normalizeClass(value: unknown): string; +export declare function normalizeProps(props: Record<string, any> | null): Record<string, any> | null; + +/** + * Compiler only. + * Do NOT use in runtime code paths unless behind `__DEV__` flag. + */ +export declare const isHTMLTag: (key: string) => boolean; +/** + * Compiler only. + * Do NOT use in runtime code paths unless behind `__DEV__` flag. + */ +export declare const isSVGTag: (key: string) => boolean; +/** + * Compiler only. + * Do NOT use in runtime code paths unless behind `__DEV__` flag. + */ +export declare const isMathMLTag: (key: string) => boolean; +/** + * Compiler only. + * Do NOT use in runtime code paths unless behind `__DEV__` flag. + */ +export declare const isVoidTag: (key: string) => boolean; + +export declare const isSpecialBooleanAttr: (key: string) => boolean; +/** + * The full list is needed during SSR to produce the correct initial markup. + */ +export declare const isBooleanAttr: (key: string) => boolean; +/** + * Boolean attributes should be included if the value is truthy or ''. + * e.g. `<select multiple>` compiles to `{ multiple: '' }` + */ +export declare function includeBooleanAttr(value: unknown): boolean; +export declare function isSSRSafeAttrName(name: string): boolean; +export declare const propsToAttrMap: Record<string, string | undefined>; +/** + * Known attributes, this is used for stringification of runtime static nodes + * so that we don't stringify bindings that cannot be set from HTML. + * Don't also forget to allow `data-*` and `aria-*`! + * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes + */ +export declare const isKnownHtmlAttr: (key: string) => boolean; +/** + * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute + */ +export declare const isKnownSvgAttr: (key: string) => boolean; +/** + * Generated from https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute + */ +export declare const isKnownMathMLAttr: (key: string) => boolean; +/** + * Shared between server-renderer and runtime-core hydration logic + */ +export declare function isRenderableAttrValue(value: unknown): boolean; + +export declare function escapeHtml(string: unknown): string; +export declare function escapeHtmlComment(src: string): string; +export declare const cssVarNameEscapeSymbolsRE: RegExp; +export declare function getEscapedCssVarName(key: string, doubleEscape: boolean): string; + +export declare function looseEqual(a: any, b: any): boolean; +export declare function looseIndexOf(arr: any[], val: any): number; + +/** + * For converting {{ interpolation }} values to displayed strings. + * @private + */ +export declare const toDisplayString: (val: unknown) => string; + +export type Prettify<T> = { + [K in keyof T]: T[K]; +} & {}; +export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +export type LooseRequired<T> = { + [P in keyof (T & Required<T>)]: T[P]; +}; +export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N; +export type IsKeyValues<T, K = string> = IfAny<T, false, T extends object ? (keyof T extends K ? true : false) : false>; +/** + * Utility for extracting the parameters from a function overload (for typed emits) + * https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709 + */ +export type OverloadParameters<T extends (...args: any[]) => any> = Parameters<OverloadUnion<T>>; +type OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>; +type OverloadUnionRecursive<TOverload, TPartialOverload = unknown> = TOverload extends (...args: infer TArgs) => infer TReturn ? TPartialOverload extends TOverload ? never : OverloadUnionRecursive<TPartialOverload & TOverload, TPartialOverload & ((...args: TArgs) => TReturn) & OverloadProps<TOverload>> | ((...args: TArgs) => TReturn) : never; +type OverloadUnion<TOverload extends (...args: any[]) => any> = Exclude<OverloadUnionRecursive<(() => never) & TOverload>, TOverload extends () => never ? never : () => never>; + diff --git a/seller_1/node_modules/@vue/shared/dist/shared.esm-bundler.js b/seller_1/node_modules/@vue/shared/dist/shared.esm-bundler.js new file mode 100644 index 0000000..68f3306 --- /dev/null +++ b/seller_1/node_modules/@vue/shared/dist/shared.esm-bundler.js @@ -0,0 +1,519 @@ +/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} + +const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {}; +const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : []; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name) { + return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; +} +function genCacheKey(source, options) { + return source + JSON.stringify( + options, + (_, val) => typeof val === "function" ? val.toString() : val + ); +} + +const PatchFlags = { + "TEXT": 1, + "1": "TEXT", + "CLASS": 2, + "2": "CLASS", + "STYLE": 4, + "4": "STYLE", + "PROPS": 8, + "8": "PROPS", + "FULL_PROPS": 16, + "16": "FULL_PROPS", + "NEED_HYDRATION": 32, + "32": "NEED_HYDRATION", + "STABLE_FRAGMENT": 64, + "64": "STABLE_FRAGMENT", + "KEYED_FRAGMENT": 128, + "128": "KEYED_FRAGMENT", + "UNKEYED_FRAGMENT": 256, + "256": "UNKEYED_FRAGMENT", + "NEED_PATCH": 512, + "512": "NEED_PATCH", + "DYNAMIC_SLOTS": 1024, + "1024": "DYNAMIC_SLOTS", + "DEV_ROOT_FRAGMENT": 2048, + "2048": "DEV_ROOT_FRAGMENT", + "CACHED": -1, + "-1": "CACHED", + "BAIL": -2, + "-2": "BAIL" +}; +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const ShapeFlags = { + "ELEMENT": 1, + "1": "ELEMENT", + "FUNCTIONAL_COMPONENT": 2, + "2": "FUNCTIONAL_COMPONENT", + "STATEFUL_COMPONENT": 4, + "4": "STATEFUL_COMPONENT", + "TEXT_CHILDREN": 8, + "8": "TEXT_CHILDREN", + "ARRAY_CHILDREN": 16, + "16": "ARRAY_CHILDREN", + "SLOTS_CHILDREN": 32, + "32": "SLOTS_CHILDREN", + "TELEPORT": 64, + "64": "TELEPORT", + "SUSPENSE": 128, + "128": "SUSPENSE", + "COMPONENT_SHOULD_KEEP_ALIVE": 256, + "256": "COMPONENT_SHOULD_KEEP_ALIVE", + "COMPONENT_KEPT_ALIVE": 512, + "512": "COMPONENT_KEPT_ALIVE", + "COMPONENT": 6, + "6": "COMPONENT" +}; + +const SlotFlags = { + "STABLE": 1, + "1": "STABLE", + "DYNAMIC": 2, + "2": "DYNAMIC", + "FORWARDED": 3, + "3": "FORWARDED" +}; +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); +const isGloballyWhitelisted = isGloballyAllowed; + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + start = Math.max(0, Math.min(start, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +const isKnownMathMLAttr = /* @__PURE__ */ makeMap( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.slice(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); +} +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const isRef = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString }; diff --git a/seller_1/node_modules/@vue/shared/index.js b/seller_1/node_modules/@vue/shared/index.js new file mode 100644 index 0000000..a2ee43e --- /dev/null +++ b/seller_1/node_modules/@vue/shared/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/shared.cjs.prod.js') +} else { + module.exports = require('./dist/shared.cjs.js') +} diff --git a/seller_1/node_modules/@vue/shared/package.json b/seller_1/node_modules/@vue/shared/package.json new file mode 100644 index 0000000..9541478 --- /dev/null +++ b/seller_1/node_modules/@vue/shared/package.json @@ -0,0 +1,47 @@ +{ + "name": "@vue/shared", + "version": "3.5.13", + "description": "internal utils shared across @vue packages", + "main": "index.js", + "module": "dist/shared.esm-bundler.js", + "types": "dist/shared.d.ts", + "files": [ + "index.js", + "dist" + ], + "exports": { + ".": { + "types": "./dist/shared.d.ts", + "node": { + "production": "./dist/shared.cjs.prod.js", + "development": "./dist/shared.cjs.js", + "default": "./index.js" + }, + "module": "./dist/shared.esm-bundler.js", + "import": "./dist/shared.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, + "sideEffects": false, + "buildOptions": { + "formats": [ + "esm-bundler", + "cjs" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/core.git", + "directory": "packages/shared" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/core/issues" + }, + "homepage": "https://github.com/vuejs/core/tree/main/packages/shared#readme" +} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/LICENSE.md b/seller_1/node_modules/chart.js/LICENSE.md new file mode 100644 index 0000000..f216610 --- /dev/null +++ b/seller_1/node_modules/chart.js/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Chart.js Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/chart.js/README.md b/seller_1/node_modules/chart.js/README.md new file mode 100644 index 0000000..df7334e --- /dev/null +++ b/seller_1/node_modules/chart.js/README.md @@ -0,0 +1,38 @@ +<p align="center"> + <a href="https://www.chartjs.org/" target="_blank"> + <img src="https://www.chartjs.org/media/logo-title.svg" alt="https://www.chartjs.org/"><br/> + </a> + Simple yet flexible JavaScript charting for designers & developers +</p> + +<p align="center"> + <a href="https://www.chartjs.org/docs/latest/getting-started/installation.html"><img src="https://img.shields.io/github/release/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Downloads"></a> + <a href="https://github.com/chartjs/Chart.js/actions?query=workflow%3ACI+branch%3Amaster"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/chartjs/Chart.js/ci.yml?branch=master&style=flat-square"></a> + <a href="https://coveralls.io/github/chartjs/Chart.js?branch=master"><img src="https://img.shields.io/coveralls/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Coverage"></a> + <a href="https://github.com/chartjs/awesome"><img src="https://awesome.re/badge-flat2.svg" alt="Awesome"></a> + <a href="https://discord.gg/HxEguTK6av"><img src="https://img.shields.io/badge/discord-chartjs-blue?style=flat-square&maxAge=3600" alt="Discord"></a> +</p> + +## Documentation + +All the links point to the new version 4 of the lib. + +* [Introduction](https://www.chartjs.org/docs/latest/) +* [Getting Started](https://www.chartjs.org/docs/latest/getting-started/index) +* [General](https://www.chartjs.org/docs/latest/general/data-structures) +* [Configuration](https://www.chartjs.org/docs/latest/configuration/index) +* [Charts](https://www.chartjs.org/docs/latest/charts/line) +* [Axes](https://www.chartjs.org/docs/latest/axes/index) +* [Developers](https://www.chartjs.org/docs/latest/developers/index) +* [Popular Extensions](https://github.com/chartjs/awesome) +* [Samples](https://www.chartjs.org/samples/) + +In case you are looking for an older version of the docs, you will have to specify the specific version in the url like this: [https://www.chartjs.org/docs/2.9.4/](https://www.chartjs.org/docs/2.9.4/) + +## Contributing + +Instructions on building and testing Chart.js can be found in [the documentation](https://www.chartjs.org/docs/master/developers/contributing.html#building-and-testing). Before submitting an issue or a pull request, please take a moment to look over the [contributing guidelines](https://www.chartjs.org/docs/master/developers/contributing) first. For support, please post questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/chart.js) with the `chart.js` tag. + +## License + +Chart.js is available under the [MIT license](LICENSE.md). diff --git a/seller_1/node_modules/chart.js/auto/auto.cjs b/seller_1/node_modules/chart.js/auto/auto.cjs new file mode 100644 index 0000000..62e08b1 --- /dev/null +++ b/seller_1/node_modules/chart.js/auto/auto.cjs @@ -0,0 +1,6 @@ +const chartjs = require('../dist/chart.cjs'); +const {Chart, registerables} = chartjs; + +Chart.register(...registerables); + +module.exports = Object.assign(Chart, chartjs); diff --git a/seller_1/node_modules/chart.js/auto/auto.d.ts b/seller_1/node_modules/chart.js/auto/auto.d.ts new file mode 100644 index 0000000..fb1263a --- /dev/null +++ b/seller_1/node_modules/chart.js/auto/auto.d.ts @@ -0,0 +1,4 @@ +import {Chart} from '../dist/types.js'; + +export * from '../dist/types.js'; +export default Chart; diff --git a/seller_1/node_modules/chart.js/auto/auto.js b/seller_1/node_modules/chart.js/auto/auto.js new file mode 100644 index 0000000..924a0f9 --- /dev/null +++ b/seller_1/node_modules/chart.js/auto/auto.js @@ -0,0 +1,6 @@ +import {Chart, registerables} from '../dist/chart.js'; + +Chart.register(...registerables); + +export * from '../dist/chart.js'; +export default Chart; diff --git a/seller_1/node_modules/chart.js/auto/package.json b/seller_1/node_modules/chart.js/auto/package.json new file mode 100644 index 0000000..7e0ca32 --- /dev/null +++ b/seller_1/node_modules/chart.js/auto/package.json @@ -0,0 +1,14 @@ +{ + "name": "chart.js-auto", + "private": true, + "description": "Auto registering package. Exists to support bundlers without exports support such as webpack 4.", + "type": "module", + "main": "./auto.cjs", + "module": "./auto.js", + "exports": { + "types": "./auto.d.ts", + "import": "./auto.js", + "require": "./auto.cjs" + }, + "types": "./auto.d.ts" +} diff --git a/seller_1/node_modules/chart.js/dist/chart.cjs b/seller_1/node_modules/chart.js/dist/chart.cjs new file mode 100644 index 0000000..73254cb --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.cjs @@ -0,0 +1,11530 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +'use strict'; + +var helpers_segment = require('./chunks/helpers.segment.cjs'); +require('@kurkle/color'); + +class Animator { + constructor(){ + this._request = null; + this._charts = new Map(); + this._running = false; + this._lastDate = undefined; + } + _notify(chart, anims, date, type) { + const callbacks = anims.listeners[type]; + const numSteps = anims.duration; + callbacks.forEach((fn)=>fn({ + chart, + initial: anims.initial, + numSteps, + currentStep: Math.min(date - anims.start, numSteps) + })); + } + _refresh() { + if (this._request) { + return; + } + this._running = true; + this._request = helpers_segment.requestAnimFrame.call(window, ()=>{ + this._update(); + this._request = null; + if (this._running) { + this._refresh(); + } + }); + } + _update(date = Date.now()) { + let remaining = 0; + this._charts.forEach((anims, chart)=>{ + if (!anims.running || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + let draw = false; + let item; + for(; i >= 0; --i){ + item = items[i]; + if (item._active) { + if (item._total > anims.duration) { + anims.duration = item._total; + } + item.tick(date); + draw = true; + } else { + items[i] = items[items.length - 1]; + items.pop(); + } + } + if (draw) { + chart.draw(); + this._notify(chart, anims, date, 'progress'); + } + if (!items.length) { + anims.running = false; + this._notify(chart, anims, date, 'complete'); + anims.initial = false; + } + remaining += items.length; + }); + this._lastDate = date; + if (remaining === 0) { + this._running = false; + } + } + _getAnims(chart) { + const charts = this._charts; + let anims = charts.get(chart); + if (!anims) { + anims = { + running: false, + initial: true, + items: [], + listeners: { + complete: [], + progress: [] + } + }; + charts.set(chart, anims); + } + return anims; + } + listen(chart, event, cb) { + this._getAnims(chart).listeners[event].push(cb); + } + add(chart, items) { + if (!items || !items.length) { + return; + } + this._getAnims(chart).items.push(...items); + } + has(chart) { + return this._getAnims(chart).items.length > 0; + } + start(chart) { + const anims = this._charts.get(chart); + if (!anims) { + return; + } + anims.running = true; + anims.start = Date.now(); + anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0); + this._refresh(); + } + running(chart) { + if (!this._running) { + return false; + } + const anims = this._charts.get(chart); + if (!anims || !anims.running || !anims.items.length) { + return false; + } + return true; + } + stop(chart) { + const anims = this._charts.get(chart); + if (!anims || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + for(; i >= 0; --i){ + items[i].cancel(); + } + anims.items = []; + this._notify(chart, anims, Date.now(), 'complete'); + } + remove(chart) { + return this._charts.delete(chart); + } +} +var animator = /* #__PURE__ */ new Animator(); + +const transparent = 'transparent'; +const interpolators = { + boolean (from, to, factor) { + return factor > 0.5 ? to : from; + }, + color (from, to, factor) { + const c0 = helpers_segment.color(from || transparent); + const c1 = c0.valid && helpers_segment.color(to || transparent); + return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to; + }, + number (from, to, factor) { + return from + (to - from) * factor; + } +}; +class Animation { + constructor(cfg, target, prop, to){ + const currentValue = target[prop]; + to = helpers_segment.resolve([ + cfg.to, + to, + currentValue, + cfg.from + ]); + const from = helpers_segment.resolve([ + cfg.from, + currentValue, + to + ]); + this._active = true; + this._fn = cfg.fn || interpolators[cfg.type || typeof from]; + this._easing = helpers_segment.effects[cfg.easing] || helpers_segment.effects.linear; + this._start = Math.floor(Date.now() + (cfg.delay || 0)); + this._duration = this._total = Math.floor(cfg.duration); + this._loop = !!cfg.loop; + this._target = target; + this._prop = prop; + this._from = from; + this._to = to; + this._promises = undefined; + } + active() { + return this._active; + } + update(cfg, to, date) { + if (this._active) { + this._notify(false); + const currentValue = this._target[this._prop]; + const elapsed = date - this._start; + const remain = this._duration - elapsed; + this._start = date; + this._duration = Math.floor(Math.max(remain, cfg.duration)); + this._total += elapsed; + this._loop = !!cfg.loop; + this._to = helpers_segment.resolve([ + cfg.to, + to, + currentValue, + cfg.from + ]); + this._from = helpers_segment.resolve([ + cfg.from, + currentValue, + to + ]); + } + } + cancel() { + if (this._active) { + this.tick(Date.now()); + this._active = false; + this._notify(false); + } + } + tick(date) { + const elapsed = date - this._start; + const duration = this._duration; + const prop = this._prop; + const from = this._from; + const loop = this._loop; + const to = this._to; + let factor; + this._active = from !== to && (loop || elapsed < duration); + if (!this._active) { + this._target[prop] = to; + this._notify(true); + return; + } + if (elapsed < 0) { + this._target[prop] = from; + return; + } + factor = elapsed / duration % 2; + factor = loop && factor > 1 ? 2 - factor : factor; + factor = this._easing(Math.min(1, Math.max(0, factor))); + this._target[prop] = this._fn(from, to, factor); + } + wait() { + const promises = this._promises || (this._promises = []); + return new Promise((res, rej)=>{ + promises.push({ + res, + rej + }); + }); + } + _notify(resolved) { + const method = resolved ? 'res' : 'rej'; + const promises = this._promises || []; + for(let i = 0; i < promises.length; i++){ + promises[i][method](); + } + } +} + +class Animations { + constructor(chart, config){ + this._chart = chart; + this._properties = new Map(); + this.configure(config); + } + configure(config) { + if (!helpers_segment.isObject(config)) { + return; + } + const animationOptions = Object.keys(helpers_segment.defaults.animation); + const animatedProps = this._properties; + Object.getOwnPropertyNames(config).forEach((key)=>{ + const cfg = config[key]; + if (!helpers_segment.isObject(cfg)) { + return; + } + const resolved = {}; + for (const option of animationOptions){ + resolved[option] = cfg[option]; + } + (helpers_segment.isArray(cfg.properties) && cfg.properties || [ + key + ]).forEach((prop)=>{ + if (prop === key || !animatedProps.has(prop)) { + animatedProps.set(prop, resolved); + } + }); + }); + } + _animateOptions(target, values) { + const newOptions = values.options; + const options = resolveTargetOptions(target, newOptions); + if (!options) { + return []; + } + const animations = this._createAnimations(options, newOptions); + if (newOptions.$shared) { + awaitAll(target.options.$animations, newOptions).then(()=>{ + target.options = newOptions; + }, ()=>{ + }); + } + return animations; + } + _createAnimations(target, values) { + const animatedProps = this._properties; + const animations = []; + const running = target.$animations || (target.$animations = {}); + const props = Object.keys(values); + const date = Date.now(); + let i; + for(i = props.length - 1; i >= 0; --i){ + const prop = props[i]; + if (prop.charAt(0) === '$') { + continue; + } + if (prop === 'options') { + animations.push(...this._animateOptions(target, values)); + continue; + } + const value = values[prop]; + let animation = running[prop]; + const cfg = animatedProps.get(prop); + if (animation) { + if (cfg && animation.active()) { + animation.update(cfg, value, date); + continue; + } else { + animation.cancel(); + } + } + if (!cfg || !cfg.duration) { + target[prop] = value; + continue; + } + running[prop] = animation = new Animation(cfg, target, prop, value); + animations.push(animation); + } + return animations; + } + update(target, values) { + if (this._properties.size === 0) { + Object.assign(target, values); + return; + } + const animations = this._createAnimations(target, values); + if (animations.length) { + animator.add(this._chart, animations); + return true; + } + } +} +function awaitAll(animations, properties) { + const running = []; + const keys = Object.keys(properties); + for(let i = 0; i < keys.length; i++){ + const anim = animations[keys[i]]; + if (anim && anim.active()) { + running.push(anim.wait()); + } + } + return Promise.all(running); +} +function resolveTargetOptions(target, newOptions) { + if (!newOptions) { + return; + } + let options = target.options; + if (!options) { + target.options = newOptions; + return; + } + if (options.$shared) { + target.options = options = Object.assign({}, options, { + $shared: false, + $animations: {} + }); + } + return options; +} + +function scaleClip(scale, allowedOverflow) { + const opts = scale && scale.options || {}; + const reverse = opts.reverse; + const min = opts.min === undefined ? allowedOverflow : 0; + const max = opts.max === undefined ? allowedOverflow : 0; + return { + start: reverse ? max : min, + end: reverse ? min : max + }; +} +function defaultClip(xScale, yScale, allowedOverflow) { + if (allowedOverflow === false) { + return false; + } + const x = scaleClip(xScale, allowedOverflow); + const y = scaleClip(yScale, allowedOverflow); + return { + top: y.end, + right: x.end, + bottom: y.start, + left: x.start + }; +} +function toClip(value) { + let t, r, b, l; + if (helpers_segment.isObject(value)) { + t = value.top; + r = value.right; + b = value.bottom; + l = value.left; + } else { + t = r = b = l = value; + } + return { + top: t, + right: r, + bottom: b, + left: l, + disabled: value === false + }; +} +function getSortedDatasetIndices(chart, filterVisible) { + const keys = []; + const metasets = chart._getSortedDatasetMetas(filterVisible); + let i, ilen; + for(i = 0, ilen = metasets.length; i < ilen; ++i){ + keys.push(metasets[i].index); + } + return keys; +} +function applyStack(stack, value, dsIndex, options = {}) { + const keys = stack.keys; + const singleMode = options.mode === 'single'; + let i, ilen, datasetIndex, otherValue; + if (value === null) { + return; + } + let found = false; + for(i = 0, ilen = keys.length; i < ilen; ++i){ + datasetIndex = +keys[i]; + if (datasetIndex === dsIndex) { + found = true; + if (options.all) { + continue; + } + break; + } + otherValue = stack.values[datasetIndex]; + if (helpers_segment.isNumberFinite(otherValue) && (singleMode || value === 0 || helpers_segment.sign(value) === helpers_segment.sign(otherValue))) { + value += otherValue; + } + } + if (!found && !options.all) { + return 0; + } + return value; +} +function convertObjectDataToArray(data, meta) { + const { iScale , vScale } = meta; + const iAxisKey = iScale.axis === 'x' ? 'x' : 'y'; + const vAxisKey = vScale.axis === 'x' ? 'x' : 'y'; + const keys = Object.keys(data); + const adata = new Array(keys.length); + let i, ilen, key; + for(i = 0, ilen = keys.length; i < ilen; ++i){ + key = keys[i]; + adata[i] = { + [iAxisKey]: key, + [vAxisKey]: data[key] + }; + } + return adata; +} +function isStacked(scale, meta) { + const stacked = scale && scale.options.stacked; + return stacked || stacked === undefined && meta.stack !== undefined; +} +function getStackKey(indexScale, valueScale, meta) { + return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`; +} +function getUserBounds(scale) { + const { min , max , minDefined , maxDefined } = scale.getUserBounds(); + return { + min: minDefined ? min : Number.NEGATIVE_INFINITY, + max: maxDefined ? max : Number.POSITIVE_INFINITY + }; +} +function getOrCreateStack(stacks, stackKey, indexValue) { + const subStack = stacks[stackKey] || (stacks[stackKey] = {}); + return subStack[indexValue] || (subStack[indexValue] = {}); +} +function getLastIndexInStack(stack, vScale, positive, type) { + for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){ + const value = stack[meta.index]; + if (positive && value > 0 || !positive && value < 0) { + return meta.index; + } + } + return null; +} +function updateStacks(controller, parsed) { + const { chart , _cachedMeta: meta } = controller; + const stacks = chart._stacks || (chart._stacks = {}); + const { iScale , vScale , index: datasetIndex } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const key = getStackKey(iScale, vScale, meta); + const ilen = parsed.length; + let stack; + for(let i = 0; i < ilen; ++i){ + const item = parsed[i]; + const { [iAxis]: index , [vAxis]: value } = item; + const itemStacks = item._stacks || (item._stacks = {}); + stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index); + stack[datasetIndex] = value; + stack._top = getLastIndexInStack(stack, vScale, true, meta.type); + stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type); + const visualValues = stack._visualValues || (stack._visualValues = {}); + visualValues[datasetIndex] = value; + } +} +function getFirstScaleId(chart, axis) { + const scales = chart.scales; + return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift(); +} +function createDatasetContext(parent, index) { + return helpers_segment.createContext(parent, { + active: false, + dataset: undefined, + datasetIndex: index, + index, + mode: 'default', + type: 'dataset' + }); +} +function createDataContext(parent, index, element) { + return helpers_segment.createContext(parent, { + active: false, + dataIndex: index, + parsed: undefined, + raw: undefined, + element, + index, + mode: 'default', + type: 'data' + }); +} +function clearStacks(meta, items) { + const datasetIndex = meta.controller.index; + const axis = meta.vScale && meta.vScale.axis; + if (!axis) { + return; + } + items = items || meta._parsed; + for (const parsed of items){ + const stacks = parsed._stacks; + if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) { + return; + } + delete stacks[axis][datasetIndex]; + if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) { + delete stacks[axis]._visualValues[datasetIndex]; + } + } +} +const isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none'; +const cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached); +const createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && { + keys: getSortedDatasetIndices(chart, true), + values: null + }; +class DatasetController { + static defaults = {}; + static datasetElementType = null; + static dataElementType = null; + constructor(chart, datasetIndex){ + this.chart = chart; + this._ctx = chart.ctx; + this.index = datasetIndex; + this._cachedDataOpts = {}; + this._cachedMeta = this.getMeta(); + this._type = this._cachedMeta.type; + this.options = undefined; + this._parsing = false; + this._data = undefined; + this._objectData = undefined; + this._sharedOptions = undefined; + this._drawStart = undefined; + this._drawCount = undefined; + this.enableOptionSharing = false; + this.supportsDecimation = false; + this.$context = undefined; + this._syncList = []; + this.datasetElementType = new.target.datasetElementType; + this.dataElementType = new.target.dataElementType; + this.initialize(); + } + initialize() { + const meta = this._cachedMeta; + this.configure(); + this.linkScales(); + meta._stacked = isStacked(meta.vScale, meta); + this.addElements(); + if (this.options.fill && !this.chart.isPluginEnabled('filler')) { + console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options"); + } + } + updateIndex(datasetIndex) { + if (this.index !== datasetIndex) { + clearStacks(this._cachedMeta); + } + this.index = datasetIndex; + } + linkScales() { + const chart = this.chart; + const meta = this._cachedMeta; + const dataset = this.getDataset(); + const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y; + const xid = meta.xAxisID = helpers_segment.valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x')); + const yid = meta.yAxisID = helpers_segment.valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y')); + const rid = meta.rAxisID = helpers_segment.valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r')); + const indexAxis = meta.indexAxis; + const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid); + const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid); + meta.xScale = this.getScaleForId(xid); + meta.yScale = this.getScaleForId(yid); + meta.rScale = this.getScaleForId(rid); + meta.iScale = this.getScaleForId(iid); + meta.vScale = this.getScaleForId(vid); + } + getDataset() { + return this.chart.data.datasets[this.index]; + } + getMeta() { + return this.chart.getDatasetMeta(this.index); + } + getScaleForId(scaleID) { + return this.chart.scales[scaleID]; + } + _getOtherScale(scale) { + const meta = this._cachedMeta; + return scale === meta.iScale ? meta.vScale : meta.iScale; + } + reset() { + this._update('reset'); + } + _destroy() { + const meta = this._cachedMeta; + if (this._data) { + helpers_segment.unlistenArrayEvents(this._data, this); + } + if (meta._stacked) { + clearStacks(meta); + } + } + _dataCheck() { + const dataset = this.getDataset(); + const data = dataset.data || (dataset.data = []); + const _data = this._data; + if (helpers_segment.isObject(data)) { + const meta = this._cachedMeta; + this._data = convertObjectDataToArray(data, meta); + } else if (_data !== data) { + if (_data) { + helpers_segment.unlistenArrayEvents(_data, this); + const meta = this._cachedMeta; + clearStacks(meta); + meta._parsed = []; + } + if (data && Object.isExtensible(data)) { + helpers_segment.listenArrayEvents(data, this); + } + this._syncList = []; + this._data = data; + } + } + addElements() { + const meta = this._cachedMeta; + this._dataCheck(); + if (this.datasetElementType) { + meta.dataset = new this.datasetElementType(); + } + } + buildOrUpdateElements(resetNewElements) { + const meta = this._cachedMeta; + const dataset = this.getDataset(); + let stackChanged = false; + this._dataCheck(); + const oldStacked = meta._stacked; + meta._stacked = isStacked(meta.vScale, meta); + if (meta.stack !== dataset.stack) { + stackChanged = true; + clearStacks(meta); + meta.stack = dataset.stack; + } + this._resyncElements(resetNewElements); + if (stackChanged || oldStacked !== meta._stacked) { + updateStacks(this, meta._parsed); + meta._stacked = isStacked(meta.vScale, meta); + } + } + configure() { + const config = this.chart.config; + const scopeKeys = config.datasetScopeKeys(this._type); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true); + this.options = config.createResolver(scopes, this.getContext()); + this._parsing = this.options.parsing; + this._cachedDataOpts = {}; + } + parse(start, count) { + const { _cachedMeta: meta , _data: data } = this; + const { iScale , _stacked } = meta; + const iAxis = iScale.axis; + let sorted = start === 0 && count === data.length ? true : meta._sorted; + let prev = start > 0 && meta._parsed[start - 1]; + let i, cur, parsed; + if (this._parsing === false) { + meta._parsed = data; + meta._sorted = true; + parsed = data; + } else { + if (helpers_segment.isArray(data[start])) { + parsed = this.parseArrayData(meta, data, start, count); + } else if (helpers_segment.isObject(data[start])) { + parsed = this.parseObjectData(meta, data, start, count); + } else { + parsed = this.parsePrimitiveData(meta, data, start, count); + } + const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis]; + for(i = 0; i < count; ++i){ + meta._parsed[i + start] = cur = parsed[i]; + if (sorted) { + if (isNotInOrderComparedToPrev()) { + sorted = false; + } + prev = cur; + } + } + meta._sorted = sorted; + } + if (_stacked) { + updateStacks(this, parsed); + } + } + parsePrimitiveData(meta, data, start, count) { + const { iScale , vScale } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = new Array(count); + let i, ilen, index; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + parsed[i] = { + [iAxis]: singleScale || iScale.parse(labels[index], index), + [vAxis]: vScale.parse(data[index], index) + }; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const { xScale , yScale } = meta; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + x: xScale.parse(item[0], index), + y: yScale.parse(item[1], index) + }; + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const { xScale , yScale } = meta; + const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + x: xScale.parse(helpers_segment.resolveObjectKey(item, xAxisKey), index), + y: yScale.parse(helpers_segment.resolveObjectKey(item, yAxisKey), index) + }; + } + return parsed; + } + getParsed(index) { + return this._cachedMeta._parsed[index]; + } + getDataElement(index) { + return this._cachedMeta.data[index]; + } + applyStack(scale, parsed, mode) { + const chart = this.chart; + const meta = this._cachedMeta; + const value = parsed[scale.axis]; + const stack = { + keys: getSortedDatasetIndices(chart, true), + values: parsed._stacks[scale.axis]._visualValues + }; + return applyStack(stack, value, meta.index, { + mode + }); + } + updateRangeFromParsed(range, scale, parsed, stack) { + const parsedValue = parsed[scale.axis]; + let value = parsedValue === null ? NaN : parsedValue; + const values = stack && parsed._stacks[scale.axis]; + if (stack && values) { + stack.values = values; + value = applyStack(stack, parsedValue, this._cachedMeta.index); + } + range.min = Math.min(range.min, value); + range.max = Math.max(range.max, value); + } + getMinMax(scale, canStack) { + const meta = this._cachedMeta; + const _parsed = meta._parsed; + const sorted = meta._sorted && scale === meta.iScale; + const ilen = _parsed.length; + const otherScale = this._getOtherScale(scale); + const stack = createStack(canStack, meta, this.chart); + const range = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + const { min: otherMin , max: otherMax } = getUserBounds(otherScale); + let i, parsed; + function _skip() { + parsed = _parsed[i]; + const otherValue = parsed[otherScale.axis]; + return !helpers_segment.isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue; + } + for(i = 0; i < ilen; ++i){ + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range, scale, parsed, stack); + if (sorted) { + break; + } + } + if (sorted) { + for(i = ilen - 1; i >= 0; --i){ + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range, scale, parsed, stack); + break; + } + } + return range; + } + getAllParsedValues(scale) { + const parsed = this._cachedMeta._parsed; + const values = []; + let i, ilen, value; + for(i = 0, ilen = parsed.length; i < ilen; ++i){ + value = parsed[i][scale.axis]; + if (helpers_segment.isNumberFinite(value)) { + values.push(value); + } + } + return values; + } + getMaxOverflow() { + return false; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const iScale = meta.iScale; + const vScale = meta.vScale; + const parsed = this.getParsed(index); + return { + label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '', + value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : '' + }; + } + _update(mode) { + const meta = this._cachedMeta; + this.update(mode || 'default'); + meta._clip = toClip(helpers_segment.valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow()))); + } + update(mode) {} + draw() { + const ctx = this._ctx; + const chart = this.chart; + const meta = this._cachedMeta; + const elements = meta.data || []; + const area = chart.chartArea; + const active = []; + const start = this._drawStart || 0; + const count = this._drawCount || elements.length - start; + const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop; + let i; + if (meta.dataset) { + meta.dataset.draw(ctx, area, start, count); + } + for(i = start; i < start + count; ++i){ + const element = elements[i]; + if (element.hidden) { + continue; + } + if (element.active && drawActiveElementsOnTop) { + active.push(element); + } else { + element.draw(ctx, area); + } + } + for(i = 0; i < active.length; ++i){ + active[i].draw(ctx, area); + } + } + getStyle(index, active) { + const mode = active ? 'active' : 'default'; + return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode); + } + getContext(index, active, mode) { + const dataset = this.getDataset(); + let context; + if (index >= 0 && index < this._cachedMeta.data.length) { + const element = this._cachedMeta.data[index]; + context = element.$context || (element.$context = createDataContext(this.getContext(), index, element)); + context.parsed = this.getParsed(index); + context.raw = dataset.data[index]; + context.index = context.dataIndex = index; + } else { + context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index)); + context.dataset = dataset; + context.index = context.datasetIndex = this.index; + } + context.active = !!active; + context.mode = mode; + return context; + } + resolveDatasetElementOptions(mode) { + return this._resolveElementOptions(this.datasetElementType.id, mode); + } + resolveDataElementOptions(index, mode) { + return this._resolveElementOptions(this.dataElementType.id, mode, index); + } + _resolveElementOptions(elementType, mode = 'default', index) { + const active = mode === 'active'; + const cache = this._cachedDataOpts; + const cacheKey = elementType + '-' + mode; + const cached = cache[cacheKey]; + const sharing = this.enableOptionSharing && helpers_segment.defined(index); + if (cached) { + return cloneIfNotShared(cached, sharing); + } + const config = this.chart.config; + const scopeKeys = config.datasetElementScopeKeys(this._type, elementType); + const prefixes = active ? [ + `${elementType}Hover`, + 'hover', + elementType, + '' + ] : [ + elementType, + '' + ]; + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + const names = Object.keys(helpers_segment.defaults.elements[elementType]); + const context = ()=>this.getContext(index, active, mode); + const values = config.resolveNamedOptions(scopes, names, context, prefixes); + if (values.$shared) { + values.$shared = sharing; + cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing)); + } + return values; + } + _resolveAnimations(index, transition, active) { + const chart = this.chart; + const cache = this._cachedDataOpts; + const cacheKey = `animation-${transition}`; + const cached = cache[cacheKey]; + if (cached) { + return cached; + } + let options; + if (chart.options.animation !== false) { + const config = this.chart.config; + const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + options = config.createResolver(scopes, this.getContext(index, active, transition)); + } + const animations = new Animations(chart, options && options.animations); + if (options && options._cacheable) { + cache[cacheKey] = Object.freeze(animations); + } + return animations; + } + getSharedOptions(options) { + if (!options.$shared) { + return; + } + return this._sharedOptions || (this._sharedOptions = Object.assign({}, options)); + } + includeOptions(mode, sharedOptions) { + return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled; + } + _getSharedOptions(start, mode) { + const firstOpts = this.resolveDataElementOptions(start, mode); + const previouslySharedOptions = this._sharedOptions; + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions; + this.updateSharedOptions(sharedOptions, mode, firstOpts); + return { + sharedOptions, + includeOptions + }; + } + updateElement(element, index, properties, mode) { + if (isDirectUpdateMode(mode)) { + Object.assign(element, properties); + } else { + this._resolveAnimations(index, mode).update(element, properties); + } + } + updateSharedOptions(sharedOptions, mode, newOptions) { + if (sharedOptions && !isDirectUpdateMode(mode)) { + this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions); + } + } + _setStyle(element, index, mode, active) { + element.active = active; + const options = this.getStyle(index, active); + this._resolveAnimations(index, mode, active).update(element, { + options: !active && this.getSharedOptions(options) || options + }); + } + removeHoverStyle(element, datasetIndex, index) { + this._setStyle(element, index, 'active', false); + } + setHoverStyle(element, datasetIndex, index) { + this._setStyle(element, index, 'active', true); + } + _removeDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, undefined, 'active', false); + } + } + _setDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, undefined, 'active', true); + } + } + _resyncElements(resetNewElements) { + const data = this._data; + const elements = this._cachedMeta.data; + for (const [method, arg1, arg2] of this._syncList){ + this[method](arg1, arg2); + } + this._syncList = []; + const numMeta = elements.length; + const numData = data.length; + const count = Math.min(numData, numMeta); + if (count) { + this.parse(0, count); + } + if (numData > numMeta) { + this._insertElements(numMeta, numData - numMeta, resetNewElements); + } else if (numData < numMeta) { + this._removeElements(numData, numMeta - numData); + } + } + _insertElements(start, count, resetNewElements = true) { + const meta = this._cachedMeta; + const data = meta.data; + const end = start + count; + let i; + const move = (arr)=>{ + arr.length += count; + for(i = arr.length - 1; i >= end; i--){ + arr[i] = arr[i - count]; + } + }; + move(data); + for(i = start; i < end; ++i){ + data[i] = new this.dataElementType(); + } + if (this._parsing) { + move(meta._parsed); + } + this.parse(start, count); + if (resetNewElements) { + this.updateElements(data, start, count, 'reset'); + } + } + updateElements(element, start, count, mode) {} + _removeElements(start, count) { + const meta = this._cachedMeta; + if (this._parsing) { + const removed = meta._parsed.splice(start, count); + if (meta._stacked) { + clearStacks(meta, removed); + } + } + meta.data.splice(start, count); + } + _sync(args) { + if (this._parsing) { + this._syncList.push(args); + } else { + const [method, arg1, arg2] = args; + this[method](arg1, arg2); + } + this.chart._dataChanges.push([ + this.index, + ...args + ]); + } + _onDataPush() { + const count = arguments.length; + this._sync([ + '_insertElements', + this.getDataset().data.length - count, + count + ]); + } + _onDataPop() { + this._sync([ + '_removeElements', + this._cachedMeta.data.length - 1, + 1 + ]); + } + _onDataShift() { + this._sync([ + '_removeElements', + 0, + 1 + ]); + } + _onDataSplice(start, count) { + if (count) { + this._sync([ + '_removeElements', + start, + count + ]); + } + const newCount = arguments.length - 2; + if (newCount) { + this._sync([ + '_insertElements', + start, + newCount + ]); + } + } + _onDataUnshift() { + this._sync([ + '_insertElements', + 0, + arguments.length + ]); + } +} + +function getAllScaleValues(scale, type) { + if (!scale._cache.$bar) { + const visibleMetas = scale.getMatchingVisibleMetas(type); + let values = []; + for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){ + values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale)); + } + scale._cache.$bar = helpers_segment._arrayUnique(values.sort((a, b)=>a - b)); + } + return scale._cache.$bar; +} + function computeMinSampleSize(meta) { + const scale = meta.iScale; + const values = getAllScaleValues(scale, meta.type); + let min = scale._length; + let i, ilen, curr, prev; + const updateMinAndPrev = ()=>{ + if (curr === 32767 || curr === -32768) { + return; + } + if (helpers_segment.defined(prev)) { + min = Math.min(min, Math.abs(curr - prev) || min); + } + prev = curr; + }; + for(i = 0, ilen = values.length; i < ilen; ++i){ + curr = scale.getPixelForValue(values[i]); + updateMinAndPrev(); + } + prev = undefined; + for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){ + curr = scale.getPixelForTick(i); + updateMinAndPrev(); + } + return min; +} + function computeFitCategoryTraits(index, ruler, options, stackCount) { + const thickness = options.barThickness; + let size, ratio; + if (helpers_segment.isNullOrUndef(thickness)) { + size = ruler.min * options.categoryPercentage; + ratio = options.barPercentage; + } else { + size = thickness * stackCount; + ratio = 1; + } + return { + chunk: size / stackCount, + ratio, + start: ruler.pixels[index] - size / 2 + }; +} + function computeFlexCategoryTraits(index, ruler, options, stackCount) { + const pixels = ruler.pixels; + const curr = pixels[index]; + let prev = index > 0 ? pixels[index - 1] : null; + let next = index < pixels.length - 1 ? pixels[index + 1] : null; + const percent = options.categoryPercentage; + if (prev === null) { + prev = curr - (next === null ? ruler.end - ruler.start : next - curr); + } + if (next === null) { + next = curr + curr - prev; + } + const start = curr - (curr - Math.min(prev, next)) / 2 * percent; + const size = Math.abs(next - prev) / 2 * percent; + return { + chunk: size / stackCount, + ratio: options.barPercentage, + start + }; +} +function parseFloatBar(entry, item, vScale, i) { + const startValue = vScale.parse(entry[0], i); + const endValue = vScale.parse(entry[1], i); + const min = Math.min(startValue, endValue); + const max = Math.max(startValue, endValue); + let barStart = min; + let barEnd = max; + if (Math.abs(min) > Math.abs(max)) { + barStart = max; + barEnd = min; + } + item[vScale.axis] = barEnd; + item._custom = { + barStart, + barEnd, + start: startValue, + end: endValue, + min, + max + }; +} +function parseValue(entry, item, vScale, i) { + if (helpers_segment.isArray(entry)) { + parseFloatBar(entry, item, vScale, i); + } else { + item[vScale.axis] = vScale.parse(entry, i); + } + return item; +} +function parseArrayOrPrimitive(meta, data, start, count) { + const iScale = meta.iScale; + const vScale = meta.vScale; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = []; + let i, ilen, item, entry; + for(i = start, ilen = start + count; i < ilen; ++i){ + entry = data[i]; + item = {}; + item[iScale.axis] = singleScale || iScale.parse(labels[i], i); + parsed.push(parseValue(entry, item, vScale, i)); + } + return parsed; +} +function isFloatBar(custom) { + return custom && custom.barStart !== undefined && custom.barEnd !== undefined; +} +function barSign(size, vScale, actualBase) { + if (size !== 0) { + return helpers_segment.sign(size); + } + return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1); +} +function borderProps(properties) { + let reverse, start, end, top, bottom; + if (properties.horizontal) { + reverse = properties.base > properties.x; + start = 'left'; + end = 'right'; + } else { + reverse = properties.base < properties.y; + start = 'bottom'; + end = 'top'; + } + if (reverse) { + top = 'end'; + bottom = 'start'; + } else { + top = 'start'; + bottom = 'end'; + } + return { + start, + end, + reverse, + top, + bottom + }; +} +function setBorderSkipped(properties, options, stack, index) { + let edge = options.borderSkipped; + const res = {}; + if (!edge) { + properties.borderSkipped = res; + return; + } + if (edge === true) { + properties.borderSkipped = { + top: true, + right: true, + bottom: true, + left: true + }; + return; + } + const { start , end , reverse , top , bottom } = borderProps(properties); + if (edge === 'middle' && stack) { + properties.enableBorderRadius = true; + if ((stack._top || 0) === index) { + edge = top; + } else if ((stack._bottom || 0) === index) { + edge = bottom; + } else { + res[parseEdge(bottom, start, end, reverse)] = true; + edge = top; + } + } + res[parseEdge(edge, start, end, reverse)] = true; + properties.borderSkipped = res; +} +function parseEdge(edge, a, b, reverse) { + if (reverse) { + edge = swap(edge, a, b); + edge = startEnd(edge, b, a); + } else { + edge = startEnd(edge, a, b); + } + return edge; +} +function swap(orig, v1, v2) { + return orig === v1 ? v2 : orig === v2 ? v1 : orig; +} +function startEnd(v, start, end) { + return v === 'start' ? start : v === 'end' ? end : v; +} +function setInflateAmount(properties, { inflateAmount }, ratio) { + properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount; +} +class BarController extends DatasetController { + static id = 'bar'; + static defaults = { + datasetElementType: false, + dataElementType: 'bar', + categoryPercentage: 0.8, + barPercentage: 0.9, + grouped: true, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'base', + 'width', + 'height' + ] + } + } + }; + static overrides = { + scales: { + _index_: { + type: 'category', + offset: true, + grid: { + offset: true + } + }, + _value_: { + type: 'linear', + beginAtZero: true + } + } + }; + parsePrimitiveData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseArrayData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseObjectData(meta, data, start, count) { + const { iScale , vScale } = meta; + const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing; + const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey; + const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey; + const parsed = []; + let i, ilen, item, obj; + for(i = start, ilen = start + count; i < ilen; ++i){ + obj = data[i]; + item = {}; + item[iScale.axis] = iScale.parse(helpers_segment.resolveObjectKey(obj, iAxisKey), i); + parsed.push(parseValue(helpers_segment.resolveObjectKey(obj, vAxisKey), item, vScale, i)); + } + return parsed; + } + updateRangeFromParsed(range, scale, parsed, stack) { + super.updateRangeFromParsed(range, scale, parsed, stack); + const custom = parsed._custom; + if (custom && scale === this._cachedMeta.vScale) { + range.min = Math.min(range.min, custom.min); + range.max = Math.max(range.max, custom.max); + } + } + getMaxOverflow() { + return 0; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const { iScale , vScale } = meta; + const parsed = this.getParsed(index); + const custom = parsed._custom; + const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]); + return { + label: '' + iScale.getLabelForValue(parsed[iScale.axis]), + value + }; + } + initialize() { + this.enableOptionSharing = true; + super.initialize(); + const meta = this._cachedMeta; + meta.stack = this.getDataset().stack; + } + update(mode) { + const meta = this._cachedMeta; + this.updateElements(meta.data, 0, meta.data.length, mode); + } + updateElements(bars, start, count, mode) { + const reset = mode === 'reset'; + const { index , _cachedMeta: { vScale } } = this; + const base = vScale.getBasePixel(); + const horizontal = vScale.isHorizontal(); + const ruler = this._getRuler(); + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + for(let i = start; i < start + count; i++){ + const parsed = this.getParsed(i); + const vpixels = reset || helpers_segment.isNullOrUndef(parsed[vScale.axis]) ? { + base, + head: base + } : this._calculateBarValuePixels(i); + const ipixels = this._calculateBarIndexPixels(i, ruler); + const stack = (parsed._stacks || {})[vScale.axis]; + const properties = { + horizontal, + base: vpixels.base, + enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom, + x: horizontal ? vpixels.head : ipixels.center, + y: horizontal ? ipixels.center : vpixels.head, + height: horizontal ? ipixels.size : Math.abs(vpixels.size), + width: horizontal ? Math.abs(vpixels.size) : ipixels.size + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode); + } + const options = properties.options || bars[i].options; + setBorderSkipped(properties, options, stack, index); + setInflateAmount(properties, options, ruler.ratio); + this.updateElement(bars[i], i, properties, mode); + } + } + _getStacks(last, dataIndex) { + const { iScale } = this._cachedMeta; + const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped); + const stacked = iScale.options.stacked; + const stacks = []; + const currentParsed = this._cachedMeta.controller.getParsed(dataIndex); + const iScaleValue = currentParsed && currentParsed[iScale.axis]; + const skipNull = (meta)=>{ + const parsed = meta._parsed.find((item)=>item[iScale.axis] === iScaleValue); + const val = parsed && parsed[meta.vScale.axis]; + if (helpers_segment.isNullOrUndef(val) || isNaN(val)) { + return true; + } + }; + for (const meta of metasets){ + if (dataIndex !== undefined && skipNull(meta)) { + continue; + } + if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) { + stacks.push(meta.stack); + } + if (meta.index === last) { + break; + } + } + if (!stacks.length) { + stacks.push(undefined); + } + return stacks; + } + _getStackCount(index) { + return this._getStacks(undefined, index).length; + } + _getStackIndex(datasetIndex, name, dataIndex) { + const stacks = this._getStacks(datasetIndex, dataIndex); + const index = name !== undefined ? stacks.indexOf(name) : -1; + return index === -1 ? stacks.length - 1 : index; + } + _getRuler() { + const opts = this.options; + const meta = this._cachedMeta; + const iScale = meta.iScale; + const pixels = []; + let i, ilen; + for(i = 0, ilen = meta.data.length; i < ilen; ++i){ + pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i)); + } + const barThickness = opts.barThickness; + const min = barThickness || computeMinSampleSize(meta); + return { + min, + pixels, + start: iScale._startPixel, + end: iScale._endPixel, + stackCount: this._getStackCount(), + scale: iScale, + grouped: opts.grouped, + ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage + }; + } + _calculateBarValuePixels(index) { + const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this; + const actualBase = baseValue || 0; + const parsed = this.getParsed(index); + const custom = parsed._custom; + const floating = isFloatBar(custom); + let value = parsed[vScale.axis]; + let start = 0; + let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value; + let head, size; + if (length !== value) { + start = length - value; + length = value; + } + if (floating) { + value = custom.barStart; + length = custom.barEnd - custom.barStart; + if (value !== 0 && helpers_segment.sign(value) !== helpers_segment.sign(custom.barEnd)) { + start = 0; + } + start += value; + } + const startValue = !helpers_segment.isNullOrUndef(baseValue) && !floating ? baseValue : start; + let base = vScale.getPixelForValue(startValue); + if (this.chart.getDataVisibility(index)) { + head = vScale.getPixelForValue(start + length); + } else { + head = base; + } + size = head - base; + if (Math.abs(size) < minBarLength) { + size = barSign(size, vScale, actualBase) * minBarLength; + if (value === actualBase) { + base -= size / 2; + } + const startPixel = vScale.getPixelForDecimal(0); + const endPixel = vScale.getPixelForDecimal(1); + const min = Math.min(startPixel, endPixel); + const max = Math.max(startPixel, endPixel); + base = Math.max(Math.min(base, max), min); + head = base + size; + if (_stacked && !floating) { + parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base); + } + } + if (base === vScale.getPixelForValue(actualBase)) { + const halfGrid = helpers_segment.sign(size) * vScale.getLineWidthForValue(actualBase) / 2; + base += halfGrid; + size -= halfGrid; + } + return { + size, + base, + head, + center: head + size / 2 + }; + } + _calculateBarIndexPixels(index, ruler) { + const scale = ruler.scale; + const options = this.options; + const skipNull = options.skipNull; + const maxBarThickness = helpers_segment.valueOrDefault(options.maxBarThickness, Infinity); + let center, size; + if (ruler.grouped) { + const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount; + const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount); + const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined); + center = range.start + range.chunk * stackIndex + range.chunk / 2; + size = Math.min(maxBarThickness, range.chunk * range.ratio); + } else { + center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index); + size = Math.min(maxBarThickness, ruler.min * ruler.ratio); + } + return { + base: center - size / 2, + head: center + size / 2, + center, + size + }; + } + draw() { + const meta = this._cachedMeta; + const vScale = meta.vScale; + const rects = meta.data; + const ilen = rects.length; + let i = 0; + for(; i < ilen; ++i){ + if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) { + rects[i].draw(this._ctx); + } + } + } +} + +class BubbleController extends DatasetController { + static id = 'bubble'; + static defaults = { + datasetElementType: false, + dataElementType: 'point', + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'borderWidth', + 'radius' + ] + } + } + }; + static overrides = { + scales: { + x: { + type: 'linear' + }, + y: { + type: 'linear' + } + } + }; + initialize() { + this.enableOptionSharing = true; + super.initialize(); + } + parsePrimitiveData(meta, data, start, count) { + const parsed = super.parsePrimitiveData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + parsed[i]._custom = this.resolveDataElementOptions(i + start).radius; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const parsed = super.parseArrayData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + const item = data[start + i]; + parsed[i]._custom = helpers_segment.valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const parsed = super.parseObjectData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + const item = data[start + i]; + parsed[i]._custom = helpers_segment.valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + getMaxOverflow() { + const data = this._cachedMeta.data; + let max = 0; + for(let i = data.length - 1; i >= 0; --i){ + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale , yScale } = meta; + const parsed = this.getParsed(index); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + const r = parsed._custom; + return { + label: labels[index] || '', + value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')' + }; + } + update(mode) { + const points = this._cachedMeta.data; + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale } = this._cachedMeta; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + for(let i = start; i < start + count; i++){ + const point = points[i]; + const parsed = !reset && this.getParsed(i); + const properties = {}; + const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]); + const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]); + properties.skip = isNaN(iPixel) || isNaN(vPixel); + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + if (reset) { + properties.options.radius = 0; + } + } + this.updateElement(point, i, properties, mode); + } + } + resolveDataElementOptions(index, mode) { + const parsed = this.getParsed(index); + let values = super.resolveDataElementOptions(index, mode); + if (values.$shared) { + values = Object.assign({}, values, { + $shared: false + }); + } + const radius = values.radius; + if (mode !== 'active') { + values.radius = 0; + } + values.radius += helpers_segment.valueOrDefault(parsed && parsed._custom, radius); + return values; + } +} + +function getRatioAndOffset(rotation, circumference, cutout) { + let ratioX = 1; + let ratioY = 1; + let offsetX = 0; + let offsetY = 0; + if (circumference < helpers_segment.TAU) { + const startAngle = rotation; + const endAngle = startAngle + circumference; + const startX = Math.cos(startAngle); + const startY = Math.sin(startAngle); + const endX = Math.cos(endAngle); + const endY = Math.sin(endAngle); + const calcMax = (angle, a, b)=>helpers_segment._angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout); + const calcMin = (angle, a, b)=>helpers_segment._angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout); + const maxX = calcMax(0, startX, endX); + const maxY = calcMax(helpers_segment.HALF_PI, startY, endY); + const minX = calcMin(helpers_segment.PI, startX, endX); + const minY = calcMin(helpers_segment.PI + helpers_segment.HALF_PI, startY, endY); + ratioX = (maxX - minX) / 2; + ratioY = (maxY - minY) / 2; + offsetX = -(maxX + minX) / 2; + offsetY = -(maxY + minY) / 2; + } + return { + ratioX, + ratioY, + offsetX, + offsetY + }; +} +class DoughnutController extends DatasetController { + static id = 'doughnut'; + static defaults = { + datasetElementType: false, + dataElementType: 'arc', + animation: { + animateRotate: true, + animateScale: false + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'circumference', + 'endAngle', + 'innerRadius', + 'outerRadius', + 'startAngle', + 'x', + 'y', + 'offset', + 'borderWidth', + 'spacing' + ] + } + }, + cutout: '50%', + rotation: 0, + circumference: 360, + radius: '100%', + spacing: 0, + indexAxis: 'r' + }; + static descriptors = { + _scriptable: (name)=>name !== 'spacing', + _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash') + }; + static overrides = { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels (chart) { + const data = chart.data; + if (data.labels.length && data.datasets.length) { + const { labels: { pointStyle , color } } = chart.legend.options; + return data.labels.map((label, i)=>{ + const meta = chart.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + fontColor: color, + lineWidth: style.borderWidth, + pointStyle: pointStyle, + hidden: !chart.getDataVisibility(i), + index: i + }; + }); + } + return []; + } + }, + onClick (e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + } + }; + constructor(chart, datasetIndex){ + super(chart, datasetIndex); + this.enableOptionSharing = true; + this.innerRadius = undefined; + this.outerRadius = undefined; + this.offsetX = undefined; + this.offsetY = undefined; + } + linkScales() {} + parse(start, count) { + const data = this.getDataset().data; + const meta = this._cachedMeta; + if (this._parsing === false) { + meta._parsed = data; + } else { + let getter = (i)=>+data[i]; + if (helpers_segment.isObject(data[start])) { + const { key ='value' } = this._parsing; + getter = (i)=>+helpers_segment.resolveObjectKey(data[i], key); + } + let i, ilen; + for(i = start, ilen = start + count; i < ilen; ++i){ + meta._parsed[i] = getter(i); + } + } + } + _getRotation() { + return helpers_segment.toRadians(this.options.rotation - 90); + } + _getCircumference() { + return helpers_segment.toRadians(this.options.circumference); + } + _getRotationExtents() { + let min = helpers_segment.TAU; + let max = -helpers_segment.TAU; + for(let i = 0; i < this.chart.data.datasets.length; ++i){ + if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) { + const controller = this.chart.getDatasetMeta(i).controller; + const rotation = controller._getRotation(); + const circumference = controller._getCircumference(); + min = Math.min(min, rotation); + max = Math.max(max, rotation + circumference); + } + } + return { + rotation: min, + circumference: max - min + }; + } + update(mode) { + const chart = this.chart; + const { chartArea } = chart; + const meta = this._cachedMeta; + const arcs = meta.data; + const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing; + const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0); + const cutout = Math.min(helpers_segment.toPercentage(this.options.cutout, maxSize), 1); + const chartWeight = this._getRingWeight(this.index); + const { circumference , rotation } = this._getRotationExtents(); + const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout); + const maxWidth = (chartArea.width - spacing) / ratioX; + const maxHeight = (chartArea.height - spacing) / ratioY; + const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0); + const outerRadius = helpers_segment.toDimension(this.options.radius, maxRadius); + const innerRadius = Math.max(outerRadius * cutout, 0); + const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal(); + this.offsetX = offsetX * outerRadius; + this.offsetY = offsetY * outerRadius; + meta.total = this.calculateTotal(); + this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index); + this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0); + this.updateElements(arcs, 0, arcs.length, mode); + } + _circumference(i, reset) { + const opts = this.options; + const meta = this._cachedMeta; + const circumference = this._getCircumference(); + if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) { + return 0; + } + return this.calculateCircumference(meta._parsed[i] * circumference / helpers_segment.TAU); + } + updateElements(arcs, start, count, mode) { + const reset = mode === 'reset'; + const chart = this.chart; + const chartArea = chart.chartArea; + const opts = chart.options; + const animationOpts = opts.animation; + const centerX = (chartArea.left + chartArea.right) / 2; + const centerY = (chartArea.top + chartArea.bottom) / 2; + const animateScale = reset && animationOpts.animateScale; + const innerRadius = animateScale ? 0 : this.innerRadius; + const outerRadius = animateScale ? 0 : this.outerRadius; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + let startAngle = this._getRotation(); + let i; + for(i = 0; i < start; ++i){ + startAngle += this._circumference(i, reset); + } + for(i = start; i < start + count; ++i){ + const circumference = this._circumference(i, reset); + const arc = arcs[i]; + const properties = { + x: centerX + this.offsetX, + y: centerY + this.offsetY, + startAngle, + endAngle: startAngle + circumference, + circumference, + outerRadius, + innerRadius + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode); + } + startAngle += circumference; + this.updateElement(arc, i, properties, mode); + } + } + calculateTotal() { + const meta = this._cachedMeta; + const metaData = meta.data; + let total = 0; + let i; + for(i = 0; i < metaData.length; i++){ + const value = meta._parsed[i]; + if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) { + total += Math.abs(value); + } + } + return total; + } + calculateCircumference(value) { + const total = this._cachedMeta.total; + if (total > 0 && !isNaN(value)) { + return helpers_segment.TAU * (Math.abs(value) / total); + } + return 0; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const chart = this.chart; + const labels = chart.data.labels || []; + const value = helpers_segment.formatNumber(meta._parsed[index], chart.options.locale); + return { + label: labels[index] || '', + value + }; + } + getMaxBorderWidth(arcs) { + let max = 0; + const chart = this.chart; + let i, ilen, meta, controller, options; + if (!arcs) { + for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){ + if (chart.isDatasetVisible(i)) { + meta = chart.getDatasetMeta(i); + arcs = meta.data; + controller = meta.controller; + break; + } + } + } + if (!arcs) { + return 0; + } + for(i = 0, ilen = arcs.length; i < ilen; ++i){ + options = controller.resolveDataElementOptions(i); + if (options.borderAlign !== 'inner') { + max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0); + } + } + return max; + } + getMaxOffset(arcs) { + let max = 0; + for(let i = 0, ilen = arcs.length; i < ilen; ++i){ + const options = this.resolveDataElementOptions(i); + max = Math.max(max, options.offset || 0, options.hoverOffset || 0); + } + return max; + } + _getRingWeightOffset(datasetIndex) { + let ringWeightOffset = 0; + for(let i = 0; i < datasetIndex; ++i){ + if (this.chart.isDatasetVisible(i)) { + ringWeightOffset += this._getRingWeight(i); + } + } + return ringWeightOffset; + } + _getRingWeight(datasetIndex) { + return Math.max(helpers_segment.valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0); + } + _getVisibleDatasetWeightTotal() { + return this._getRingWeightOffset(this.chart.data.datasets.length) || 1; + } +} + +class LineController extends DatasetController { + static id = 'line'; + static defaults = { + datasetElementType: 'line', + dataElementType: 'point', + showLine: true, + spanGaps: false + }; + static overrides = { + scales: { + _index_: { + type: 'category' + }, + _value_: { + type: 'linear' + } + } + }; + initialize() { + this.enableOptionSharing = true; + this.supportsDecimation = true; + super.initialize(); + } + update(mode) { + const meta = this._cachedMeta; + const { dataset: line , data: points = [] , _dataset } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start , count } = helpers_segment._getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (helpers_segment._scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + options.segment = this.options.segment; + this.updateElement(line, undefined, { + animated: !animationsDisabled, + options + }, mode); + this.updateElements(points, start, count, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale , _stacked , _dataset } = this._cachedMeta; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps , segment } = this.options; + const maxGapLength = helpers_segment.isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === 'none'; + const end = start + count; + const pointsCount = points.length; + let prevParsed = start > 0 && this.getParsed(start - 1); + for(let i = 0; i < pointsCount; ++i){ + const point = points[i]; + const properties = directUpdate ? point : {}; + if (i < start || i >= end) { + properties.skip = true; + continue; + } + const parsed = this.getParsed(i); + const nullData = helpers_segment.isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + } + getMaxOverflow() { + const meta = this._cachedMeta; + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + const data = meta.data || []; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } + draw() { + const meta = this._cachedMeta; + meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis); + super.draw(); + } +} + +class PolarAreaController extends DatasetController { + static id = 'polarArea'; + static defaults = { + dataElementType: 'arc', + animation: { + animateRotate: true, + animateScale: true + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius' + ] + } + }, + indexAxis: 'r', + startAngle: 0 + }; + static overrides = { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels (chart) { + const data = chart.data; + if (data.labels.length && data.datasets.length) { + const { labels: { pointStyle , color } } = chart.legend.options; + return data.labels.map((label, i)=>{ + const meta = chart.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + fontColor: color, + lineWidth: style.borderWidth, + pointStyle: pointStyle, + hidden: !chart.getDataVisibility(i), + index: i + }; + }); + } + return []; + } + }, + onClick (e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + }, + scales: { + r: { + type: 'radialLinear', + angleLines: { + display: false + }, + beginAtZero: true, + grid: { + circular: true + }, + pointLabels: { + display: false + }, + startAngle: 0 + } + } + }; + constructor(chart, datasetIndex){ + super(chart, datasetIndex); + this.innerRadius = undefined; + this.outerRadius = undefined; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const chart = this.chart; + const labels = chart.data.labels || []; + const value = helpers_segment.formatNumber(meta._parsed[index].r, chart.options.locale); + return { + label: labels[index] || '', + value + }; + } + parseObjectData(meta, data, start, count) { + return helpers_segment._parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const arcs = this._cachedMeta.data; + this._updateRadius(); + this.updateElements(arcs, 0, arcs.length, mode); + } + getMinMax() { + const meta = this._cachedMeta; + const range = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + meta.data.forEach((element, index)=>{ + const parsed = this.getParsed(index).r; + if (!isNaN(parsed) && this.chart.getDataVisibility(index)) { + if (parsed < range.min) { + range.min = parsed; + } + if (parsed > range.max) { + range.max = parsed; + } + } + }); + return range; + } + _updateRadius() { + const chart = this.chart; + const chartArea = chart.chartArea; + const opts = chart.options; + const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top); + const outerRadius = Math.max(minSize / 2, 0); + const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0); + const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount(); + this.outerRadius = outerRadius - radiusLength * this.index; + this.innerRadius = this.outerRadius - radiusLength; + } + updateElements(arcs, start, count, mode) { + const reset = mode === 'reset'; + const chart = this.chart; + const opts = chart.options; + const animationOpts = opts.animation; + const scale = this._cachedMeta.rScale; + const centerX = scale.xCenter; + const centerY = scale.yCenter; + const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * helpers_segment.PI; + let angle = datasetStartAngle; + let i; + const defaultAngle = 360 / this.countVisibleElements(); + for(i = 0; i < start; ++i){ + angle += this._computeAngle(i, mode, defaultAngle); + } + for(i = start; i < start + count; i++){ + const arc = arcs[i]; + let startAngle = angle; + let endAngle = angle + this._computeAngle(i, mode, defaultAngle); + let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0; + angle = endAngle; + if (reset) { + if (animationOpts.animateScale) { + outerRadius = 0; + } + if (animationOpts.animateRotate) { + startAngle = endAngle = datasetStartAngle; + } + } + const properties = { + x: centerX, + y: centerY, + innerRadius: 0, + outerRadius, + startAngle, + endAngle, + options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode) + }; + this.updateElement(arc, i, properties, mode); + } + } + countVisibleElements() { + const meta = this._cachedMeta; + let count = 0; + meta.data.forEach((element, index)=>{ + if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) { + count++; + } + }); + return count; + } + _computeAngle(index, mode, defaultAngle) { + return this.chart.getDataVisibility(index) ? helpers_segment.toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0; + } +} + +class PieController extends DoughnutController { + static id = 'pie'; + static defaults = { + cutout: 0, + rotation: 0, + circumference: 360, + radius: '100%' + }; +} + +class RadarController extends DatasetController { + static id = 'radar'; + static defaults = { + datasetElementType: 'line', + dataElementType: 'point', + indexAxis: 'r', + showLine: true, + elements: { + line: { + fill: 'start' + } + } + }; + static overrides = { + aspectRatio: 1, + scales: { + r: { + type: 'radialLinear' + } + } + }; + getLabelAndValue(index) { + const vScale = this._cachedMeta.vScale; + const parsed = this.getParsed(index); + return { + label: vScale.getLabels()[index], + value: '' + vScale.getLabelForValue(parsed[vScale.axis]) + }; + } + parseObjectData(meta, data, start, count) { + return helpers_segment._parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const meta = this._cachedMeta; + const line = meta.dataset; + const points = meta.data || []; + const labels = meta.iScale.getLabels(); + line.points = points; + if (mode !== 'resize') { + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + const properties = { + _loop: true, + _fullLoop: labels.length === points.length, + options + }; + this.updateElement(line, undefined, properties, mode); + } + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const scale = this._cachedMeta.rScale; + const reset = mode === 'reset'; + for(let i = start; i < start + count; i++){ + const point = points[i]; + const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode); + const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r); + const x = reset ? scale.xCenter : pointPosition.x; + const y = reset ? scale.yCenter : pointPosition.y; + const properties = { + x, + y, + angle: pointPosition.angle, + skip: isNaN(x) || isNaN(y), + options + }; + this.updateElement(point, i, properties, mode); + } + } +} + +class ScatterController extends DatasetController { + static id = 'scatter'; + static defaults = { + datasetElementType: false, + dataElementType: 'point', + showLine: false, + fill: false + }; + static overrides = { + interaction: { + mode: 'point' + }, + scales: { + x: { + type: 'linear' + }, + y: { + type: 'linear' + } + } + }; + getLabelAndValue(index) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale , yScale } = meta; + const parsed = this.getParsed(index); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + return { + label: labels[index] || '', + value: '(' + x + ', ' + y + ')' + }; + } + update(mode) { + const meta = this._cachedMeta; + const { data: points = [] } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start , count } = helpers_segment._getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (helpers_segment._scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + if (this.options.showLine) { + if (!this.datasetElementType) { + this.addElements(); + } + const { dataset: line , _dataset } = meta; + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + options.segment = this.options.segment; + this.updateElement(line, undefined, { + animated: !animationsDisabled, + options + }, mode); + } else if (this.datasetElementType) { + delete meta.dataset; + this.datasetElementType = false; + } + this.updateElements(points, start, count, mode); + } + addElements() { + const { showLine } = this.options; + if (!this.datasetElementType && showLine) { + this.datasetElementType = this.chart.registry.getElement('line'); + } + super.addElements(); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale , _stacked , _dataset } = this._cachedMeta; + const firstOpts = this.resolveDataElementOptions(start, mode); + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps , segment } = this.options; + const maxGapLength = helpers_segment.isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === 'none'; + let prevParsed = start > 0 && this.getParsed(start - 1); + for(let i = start; i < start + count; ++i){ + const point = points[i]; + const parsed = this.getParsed(i); + const properties = directUpdate ? point : {}; + const nullData = helpers_segment.isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + this.updateSharedOptions(sharedOptions, mode, firstOpts); + } + getMaxOverflow() { + const meta = this._cachedMeta; + const data = meta.data || []; + if (!this.options.showLine) { + let max = 0; + for(let i = data.length - 1; i >= 0; --i){ + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } +} + +var controllers = /*#__PURE__*/Object.freeze({ +__proto__: null, +BarController: BarController, +BubbleController: BubbleController, +DoughnutController: DoughnutController, +LineController: LineController, +PieController: PieController, +PolarAreaController: PolarAreaController, +RadarController: RadarController, +ScatterController: ScatterController +}); + +/** + * @namespace Chart._adapters + * @since 2.8.0 + * @private + */ function abstract() { + throw new Error('This method is not implemented: Check that a complete date adapter is provided.'); +} +/** + * Date adapter (current used by the time scale) + * @namespace Chart._adapters._date + * @memberof Chart._adapters + * @private + */ class DateAdapterBase { + /** + * Override default date adapter methods. + * Accepts type parameter to define options type. + * @example + * Chart._adapters._date.override<{myAdapterOption: string}>({ + * init() { + * console.log(this.options.myAdapterOption); + * } + * }) + */ static override(members) { + Object.assign(DateAdapterBase.prototype, members); + } + options; + constructor(options){ + this.options = options || {}; + } + // eslint-disable-next-line @typescript-eslint/no-empty-function + init() {} + formats() { + return abstract(); + } + parse() { + return abstract(); + } + format() { + return abstract(); + } + add() { + return abstract(); + } + diff() { + return abstract(); + } + startOf() { + return abstract(); + } + endOf() { + return abstract(); + } +} +var adapters = { + _date: DateAdapterBase +}; + +function binarySearch(metaset, axis, value, intersect) { + const { controller , data , _sorted } = metaset; + const iScale = controller._cachedMeta.iScale; + if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) { + const lookupMethod = iScale._reversePixels ? helpers_segment._rlookupByKey : helpers_segment._lookupByKey; + if (!intersect) { + return lookupMethod(data, axis, value); + } else if (controller._sharedOptions) { + const el = data[0]; + const range = typeof el.getRange === 'function' && el.getRange(axis); + if (range) { + const start = lookupMethod(data, axis, value - range); + const end = lookupMethod(data, axis, value + range); + return { + lo: start.lo, + hi: end.hi + }; + } + } + } + return { + lo: 0, + hi: data.length - 1 + }; +} + function evaluateInteractionItems(chart, axis, position, handler, intersect) { + const metasets = chart.getSortedVisibleDatasetMetas(); + const value = position[axis]; + for(let i = 0, ilen = metasets.length; i < ilen; ++i){ + const { index , data } = metasets[i]; + const { lo , hi } = binarySearch(metasets[i], axis, value, intersect); + for(let j = lo; j <= hi; ++j){ + const element = data[j]; + if (!element.skip) { + handler(element, index, j); + } + } + } +} + function getDistanceMetricForAxis(axis) { + const useX = axis.indexOf('x') !== -1; + const useY = axis.indexOf('y') !== -1; + return function(pt1, pt2) { + const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0; + const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0; + return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)); + }; +} + function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) { + const items = []; + if (!includeInvisible && !chart.isPointInArea(position)) { + return items; + } + const evaluationFunc = function(element, datasetIndex, index) { + if (!includeInvisible && !helpers_segment._isPointInArea(element, chart.chartArea, 0)) { + return; + } + if (element.inRange(position.x, position.y, useFinalPosition)) { + items.push({ + element, + datasetIndex, + index + }); + } + }; + evaluateInteractionItems(chart, axis, position, evaluationFunc, true); + return items; +} + function getNearestRadialItems(chart, position, axis, useFinalPosition) { + let items = []; + function evaluationFunc(element, datasetIndex, index) { + const { startAngle , endAngle } = element.getProps([ + 'startAngle', + 'endAngle' + ], useFinalPosition); + const { angle } = helpers_segment.getAngleFromPoint(element, { + x: position.x, + y: position.y + }); + if (helpers_segment._angleBetween(angle, startAngle, endAngle)) { + items.push({ + element, + datasetIndex, + index + }); + } + } + evaluateInteractionItems(chart, axis, position, evaluationFunc); + return items; +} + function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) { + let items = []; + const distanceMetric = getDistanceMetricForAxis(axis); + let minDistance = Number.POSITIVE_INFINITY; + function evaluationFunc(element, datasetIndex, index) { + const inRange = element.inRange(position.x, position.y, useFinalPosition); + if (intersect && !inRange) { + return; + } + const center = element.getCenterPoint(useFinalPosition); + const pointInArea = !!includeInvisible || chart.isPointInArea(center); + if (!pointInArea && !inRange) { + return; + } + const distance = distanceMetric(position, center); + if (distance < minDistance) { + items = [ + { + element, + datasetIndex, + index + } + ]; + minDistance = distance; + } else if (distance === minDistance) { + items.push({ + element, + datasetIndex, + index + }); + } + } + evaluateInteractionItems(chart, axis, position, evaluationFunc); + return items; +} + function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) { + if (!includeInvisible && !chart.isPointInArea(position)) { + return []; + } + return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible); +} + function getAxisItems(chart, position, axis, intersect, useFinalPosition) { + const items = []; + const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange'; + let intersectsItem = false; + evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{ + if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) { + items.push({ + element, + datasetIndex, + index + }); + intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition); + } + }); + if (intersect && !intersectsItem) { + return []; + } + return items; +} + var Interaction = { + evaluateInteractionItems, + modes: { + index (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + const axis = options.axis || 'x'; + const includeInvisible = options.includeInvisible || false; + const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible); + const elements = []; + if (!items.length) { + return []; + } + chart.getSortedVisibleDatasetMetas().forEach((meta)=>{ + const index = items[0].index; + const element = meta.data[index]; + if (element && !element.skip) { + elements.push({ + element, + datasetIndex: meta.index, + index + }); + } + }); + return elements; + }, + dataset (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible); + if (items.length > 0) { + const datasetIndex = items[0].datasetIndex; + const data = chart.getDatasetMeta(datasetIndex).data; + items = []; + for(let i = 0; i < data.length; ++i){ + items.push({ + element: data[i], + datasetIndex, + index: i + }); + } + } + return items; + }, + point (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible); + }, + nearest (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible); + }, + x (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition); + }, + y (chart, e, options, useFinalPosition) { + const position = helpers_segment.getRelativePosition(e, chart); + return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition); + } + } +}; + +const STATIC_POSITIONS = [ + 'left', + 'top', + 'right', + 'bottom' +]; +function filterByPosition(array, position) { + return array.filter((v)=>v.pos === position); +} +function filterDynamicPositionByAxis(array, axis) { + return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis); +} +function sortByWeight(array, reverse) { + return array.sort((a, b)=>{ + const v0 = reverse ? b : a; + const v1 = reverse ? a : b; + return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight; + }); +} +function wrapBoxes(boxes) { + const layoutBoxes = []; + let i, ilen, box, pos, stack, stackWeight; + for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){ + box = boxes[i]; + ({ position: pos , options: { stack , stackWeight =1 } } = box); + layoutBoxes.push({ + index: i, + box, + pos, + horizontal: box.isHorizontal(), + weight: box.weight, + stack: stack && pos + stack, + stackWeight + }); + } + return layoutBoxes; +} +function buildStacks(layouts) { + const stacks = {}; + for (const wrap of layouts){ + const { stack , pos , stackWeight } = wrap; + if (!stack || !STATIC_POSITIONS.includes(pos)) { + continue; + } + const _stack = stacks[stack] || (stacks[stack] = { + count: 0, + placed: 0, + weight: 0, + size: 0 + }); + _stack.count++; + _stack.weight += stackWeight; + } + return stacks; +} + function setLayoutDims(layouts, params) { + const stacks = buildStacks(layouts); + const { vBoxMaxWidth , hBoxMaxHeight } = params; + let i, ilen, layout; + for(i = 0, ilen = layouts.length; i < ilen; ++i){ + layout = layouts[i]; + const { fullSize } = layout.box; + const stack = stacks[layout.stack]; + const factor = stack && layout.stackWeight / stack.weight; + if (layout.horizontal) { + layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth; + layout.height = hBoxMaxHeight; + } else { + layout.width = vBoxMaxWidth; + layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight; + } + } + return stacks; +} +function buildLayoutBoxes(boxes) { + const layoutBoxes = wrapBoxes(boxes); + const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true); + const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true); + const right = sortByWeight(filterByPosition(layoutBoxes, 'right')); + const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true); + const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom')); + const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x'); + const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y'); + return { + fullSize, + leftAndTop: left.concat(top), + rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal), + chartArea: filterByPosition(layoutBoxes, 'chartArea'), + vertical: left.concat(right).concat(centerVertical), + horizontal: top.concat(bottom).concat(centerHorizontal) + }; +} +function getCombinedMax(maxPadding, chartArea, a, b) { + return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]); +} +function updateMaxPadding(maxPadding, boxPadding) { + maxPadding.top = Math.max(maxPadding.top, boxPadding.top); + maxPadding.left = Math.max(maxPadding.left, boxPadding.left); + maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom); + maxPadding.right = Math.max(maxPadding.right, boxPadding.right); +} +function updateDims(chartArea, params, layout, stacks) { + const { pos , box } = layout; + const maxPadding = chartArea.maxPadding; + if (!helpers_segment.isObject(pos)) { + if (layout.size) { + chartArea[pos] -= layout.size; + } + const stack = stacks[layout.stack] || { + size: 0, + count: 1 + }; + stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width); + layout.size = stack.size / stack.count; + chartArea[pos] += layout.size; + } + if (box.getPadding) { + updateMaxPadding(maxPadding, box.getPadding()); + } + const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right')); + const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom')); + const widthChanged = newWidth !== chartArea.w; + const heightChanged = newHeight !== chartArea.h; + chartArea.w = newWidth; + chartArea.h = newHeight; + return layout.horizontal ? { + same: widthChanged, + other: heightChanged + } : { + same: heightChanged, + other: widthChanged + }; +} +function handleMaxPadding(chartArea) { + const maxPadding = chartArea.maxPadding; + function updatePos(pos) { + const change = Math.max(maxPadding[pos] - chartArea[pos], 0); + chartArea[pos] += change; + return change; + } + chartArea.y += updatePos('top'); + chartArea.x += updatePos('left'); + updatePos('right'); + updatePos('bottom'); +} +function getMargins(horizontal, chartArea) { + const maxPadding = chartArea.maxPadding; + function marginForPositions(positions) { + const margin = { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + positions.forEach((pos)=>{ + margin[pos] = Math.max(chartArea[pos], maxPadding[pos]); + }); + return margin; + } + return horizontal ? marginForPositions([ + 'left', + 'right' + ]) : marginForPositions([ + 'top', + 'bottom' + ]); +} +function fitBoxes(boxes, chartArea, params, stacks) { + const refitBoxes = []; + let i, ilen, layout, box, refit, changed; + for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){ + layout = boxes[i]; + box = layout.box; + box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea)); + const { same , other } = updateDims(chartArea, params, layout, stacks); + refit |= same && refitBoxes.length; + changed = changed || other; + if (!box.fullSize) { + refitBoxes.push(layout); + } + } + return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed; +} +function setBoxDims(box, left, top, width, height) { + box.top = top; + box.left = left; + box.right = left + width; + box.bottom = top + height; + box.width = width; + box.height = height; +} +function placeBoxes(boxes, chartArea, params, stacks) { + const userPadding = params.padding; + let { x , y } = chartArea; + for (const layout of boxes){ + const box = layout.box; + const stack = stacks[layout.stack] || { + count: 1, + placed: 0, + weight: 1 + }; + const weight = layout.stackWeight / stack.weight || 1; + if (layout.horizontal) { + const width = chartArea.w * weight; + const height = stack.size || box.height; + if (helpers_segment.defined(stack.start)) { + y = stack.start; + } + if (box.fullSize) { + setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height); + } else { + setBoxDims(box, chartArea.left + stack.placed, y, width, height); + } + stack.start = y; + stack.placed += width; + y = box.bottom; + } else { + const height = chartArea.h * weight; + const width = stack.size || box.width; + if (helpers_segment.defined(stack.start)) { + x = stack.start; + } + if (box.fullSize) { + setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top); + } else { + setBoxDims(box, x, chartArea.top + stack.placed, width, height); + } + stack.start = x; + stack.placed += height; + x = box.right; + } + } + chartArea.x = x; + chartArea.y = y; +} +var layouts = { + addBox (chart, item) { + if (!chart.boxes) { + chart.boxes = []; + } + item.fullSize = item.fullSize || false; + item.position = item.position || 'top'; + item.weight = item.weight || 0; + item._layers = item._layers || function() { + return [ + { + z: 0, + draw (chartArea) { + item.draw(chartArea); + } + } + ]; + }; + chart.boxes.push(item); + }, + removeBox (chart, layoutItem) { + const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1; + if (index !== -1) { + chart.boxes.splice(index, 1); + } + }, + configure (chart, item, options) { + item.fullSize = options.fullSize; + item.position = options.position; + item.weight = options.weight; + }, + update (chart, width, height, minPadding) { + if (!chart) { + return; + } + const padding = helpers_segment.toPadding(chart.options.layout.padding); + const availableWidth = Math.max(width - padding.width, 0); + const availableHeight = Math.max(height - padding.height, 0); + const boxes = buildLayoutBoxes(chart.boxes); + const verticalBoxes = boxes.vertical; + const horizontalBoxes = boxes.horizontal; + helpers_segment.each(chart.boxes, (box)=>{ + if (typeof box.beforeLayout === 'function') { + box.beforeLayout(); + } + }); + const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1; + const params = Object.freeze({ + outerWidth: width, + outerHeight: height, + padding, + availableWidth, + availableHeight, + vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount, + hBoxMaxHeight: availableHeight / 2 + }); + const maxPadding = Object.assign({}, padding); + updateMaxPadding(maxPadding, helpers_segment.toPadding(minPadding)); + const chartArea = Object.assign({ + maxPadding, + w: availableWidth, + h: availableHeight, + x: padding.left, + y: padding.top + }, padding); + const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params); + fitBoxes(boxes.fullSize, chartArea, params, stacks); + fitBoxes(verticalBoxes, chartArea, params, stacks); + if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) { + fitBoxes(verticalBoxes, chartArea, params, stacks); + } + handleMaxPadding(chartArea); + placeBoxes(boxes.leftAndTop, chartArea, params, stacks); + chartArea.x += chartArea.w; + chartArea.y += chartArea.h; + placeBoxes(boxes.rightAndBottom, chartArea, params, stacks); + chart.chartArea = { + left: chartArea.left, + top: chartArea.top, + right: chartArea.left + chartArea.w, + bottom: chartArea.top + chartArea.h, + height: chartArea.h, + width: chartArea.w + }; + helpers_segment.each(boxes.chartArea, (layout)=>{ + const box = layout.box; + Object.assign(box, chart.chartArea); + box.update(chartArea.w, chartArea.h, { + left: 0, + top: 0, + right: 0, + bottom: 0 + }); + }); + } +}; + +class BasePlatform { + acquireContext(canvas, aspectRatio) {} + releaseContext(context) { + return false; + } + addEventListener(chart, type, listener) {} + removeEventListener(chart, type, listener) {} + getDevicePixelRatio() { + return 1; + } + getMaximumSize(element, width, height, aspectRatio) { + width = Math.max(0, width || element.width); + height = height || element.height; + return { + width, + height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height) + }; + } + isAttached(canvas) { + return true; + } + updateConfig(config) { + } +} + +class BasicPlatform extends BasePlatform { + acquireContext(item) { + return item && item.getContext && item.getContext('2d') || null; + } + updateConfig(config) { + config.options.animation = false; + } +} + +const EXPANDO_KEY = '$chartjs'; + const EVENT_TYPES = { + touchstart: 'mousedown', + touchmove: 'mousemove', + touchend: 'mouseup', + pointerenter: 'mouseenter', + pointerdown: 'mousedown', + pointermove: 'mousemove', + pointerup: 'mouseup', + pointerleave: 'mouseout', + pointerout: 'mouseout' +}; +const isNullOrEmpty = (value)=>value === null || value === ''; + function initCanvas(canvas, aspectRatio) { + const style = canvas.style; + const renderHeight = canvas.getAttribute('height'); + const renderWidth = canvas.getAttribute('width'); + canvas[EXPANDO_KEY] = { + initial: { + height: renderHeight, + width: renderWidth, + style: { + display: style.display, + height: style.height, + width: style.width + } + } + }; + style.display = style.display || 'block'; + style.boxSizing = style.boxSizing || 'border-box'; + if (isNullOrEmpty(renderWidth)) { + const displayWidth = helpers_segment.readUsedSize(canvas, 'width'); + if (displayWidth !== undefined) { + canvas.width = displayWidth; + } + } + if (isNullOrEmpty(renderHeight)) { + if (canvas.style.height === '') { + canvas.height = canvas.width / (aspectRatio || 2); + } else { + const displayHeight = helpers_segment.readUsedSize(canvas, 'height'); + if (displayHeight !== undefined) { + canvas.height = displayHeight; + } + } + } + return canvas; +} +const eventListenerOptions = helpers_segment.supportsEventListenerOptions ? { + passive: true +} : false; +function addListener(node, type, listener) { + if (node) { + node.addEventListener(type, listener, eventListenerOptions); + } +} +function removeListener(chart, type, listener) { + if (chart && chart.canvas) { + chart.canvas.removeEventListener(type, listener, eventListenerOptions); + } +} +function fromNativeEvent(event, chart) { + const type = EVENT_TYPES[event.type] || event.type; + const { x , y } = helpers_segment.getRelativePosition(event, chart); + return { + type, + chart, + native: event, + x: x !== undefined ? x : null, + y: y !== undefined ? y : null + }; +} +function nodeListContains(nodeList, canvas) { + for (const node of nodeList){ + if (node === canvas || node.contains(canvas)) { + return true; + } + } +} +function createAttachObserver(chart, type, listener) { + const canvas = chart.canvas; + const observer = new MutationObserver((entries)=>{ + let trigger = false; + for (const entry of entries){ + trigger = trigger || nodeListContains(entry.addedNodes, canvas); + trigger = trigger && !nodeListContains(entry.removedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; +} +function createDetachObserver(chart, type, listener) { + const canvas = chart.canvas; + const observer = new MutationObserver((entries)=>{ + let trigger = false; + for (const entry of entries){ + trigger = trigger || nodeListContains(entry.removedNodes, canvas); + trigger = trigger && !nodeListContains(entry.addedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; +} +const drpListeningCharts = new Map(); +let oldDevicePixelRatio = 0; +function onWindowResize() { + const dpr = window.devicePixelRatio; + if (dpr === oldDevicePixelRatio) { + return; + } + oldDevicePixelRatio = dpr; + drpListeningCharts.forEach((resize, chart)=>{ + if (chart.currentDevicePixelRatio !== dpr) { + resize(); + } + }); +} +function listenDevicePixelRatioChanges(chart, resize) { + if (!drpListeningCharts.size) { + window.addEventListener('resize', onWindowResize); + } + drpListeningCharts.set(chart, resize); +} +function unlistenDevicePixelRatioChanges(chart) { + drpListeningCharts.delete(chart); + if (!drpListeningCharts.size) { + window.removeEventListener('resize', onWindowResize); + } +} +function createResizeObserver(chart, type, listener) { + const canvas = chart.canvas; + const container = canvas && helpers_segment._getParentNode(canvas); + if (!container) { + return; + } + const resize = helpers_segment.throttled((width, height)=>{ + const w = container.clientWidth; + listener(width, height); + if (w < container.clientWidth) { + listener(); + } + }, window); + const observer = new ResizeObserver((entries)=>{ + const entry = entries[0]; + const width = entry.contentRect.width; + const height = entry.contentRect.height; + if (width === 0 && height === 0) { + return; + } + resize(width, height); + }); + observer.observe(container); + listenDevicePixelRatioChanges(chart, resize); + return observer; +} +function releaseObserver(chart, type, observer) { + if (observer) { + observer.disconnect(); + } + if (type === 'resize') { + unlistenDevicePixelRatioChanges(chart); + } +} +function createProxyAndListen(chart, type, listener) { + const canvas = chart.canvas; + const proxy = helpers_segment.throttled((event)=>{ + if (chart.ctx !== null) { + listener(fromNativeEvent(event, chart)); + } + }, chart); + addListener(canvas, type, proxy); + return proxy; +} + class DomPlatform extends BasePlatform { + acquireContext(canvas, aspectRatio) { + const context = canvas && canvas.getContext && canvas.getContext('2d'); + if (context && context.canvas === canvas) { + initCanvas(canvas, aspectRatio); + return context; + } + return null; + } + releaseContext(context) { + const canvas = context.canvas; + if (!canvas[EXPANDO_KEY]) { + return false; + } + const initial = canvas[EXPANDO_KEY].initial; + [ + 'height', + 'width' + ].forEach((prop)=>{ + const value = initial[prop]; + if (helpers_segment.isNullOrUndef(value)) { + canvas.removeAttribute(prop); + } else { + canvas.setAttribute(prop, value); + } + }); + const style = initial.style || {}; + Object.keys(style).forEach((key)=>{ + canvas.style[key] = style[key]; + }); + canvas.width = canvas.width; + delete canvas[EXPANDO_KEY]; + return true; + } + addEventListener(chart, type, listener) { + this.removeEventListener(chart, type); + const proxies = chart.$proxies || (chart.$proxies = {}); + const handlers = { + attach: createAttachObserver, + detach: createDetachObserver, + resize: createResizeObserver + }; + const handler = handlers[type] || createProxyAndListen; + proxies[type] = handler(chart, type, listener); + } + removeEventListener(chart, type) { + const proxies = chart.$proxies || (chart.$proxies = {}); + const proxy = proxies[type]; + if (!proxy) { + return; + } + const handlers = { + attach: releaseObserver, + detach: releaseObserver, + resize: releaseObserver + }; + const handler = handlers[type] || removeListener; + handler(chart, type, proxy); + proxies[type] = undefined; + } + getDevicePixelRatio() { + return window.devicePixelRatio; + } + getMaximumSize(canvas, width, height, aspectRatio) { + return helpers_segment.getMaximumSize(canvas, width, height, aspectRatio); + } + isAttached(canvas) { + const container = canvas && helpers_segment._getParentNode(canvas); + return !!(container && container.isConnected); + } +} + +function _detectPlatform(canvas) { + if (!helpers_segment._isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) { + return BasicPlatform; + } + return DomPlatform; +} + +class Element { + static defaults = {}; + static defaultRoutes = undefined; + x; + y; + active = false; + options; + $animations; + tooltipPosition(useFinalPosition) { + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return { + x, + y + }; + } + hasValue() { + return helpers_segment.isNumber(this.x) && helpers_segment.isNumber(this.y); + } + getProps(props, final) { + const anims = this.$animations; + if (!final || !anims) { + // let's not create an object, if not needed + return this; + } + const ret = {}; + props.forEach((prop)=>{ + ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop]; + }); + return ret; + } +} + +function autoSkip(scale, ticks) { + const tickOpts = scale.options.ticks; + const determinedMaxTicks = determineMaxTicks(scale); + const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks); + const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : []; + const numMajorIndices = majorIndices.length; + const first = majorIndices[0]; + const last = majorIndices[numMajorIndices - 1]; + const newTicks = []; + if (numMajorIndices > ticksLimit) { + skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit); + return newTicks; + } + const spacing = calculateSpacing(majorIndices, ticks, ticksLimit); + if (numMajorIndices > 0) { + let i, ilen; + const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null; + skip(ticks, newTicks, spacing, helpers_segment.isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first); + for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){ + skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]); + } + skip(ticks, newTicks, spacing, last, helpers_segment.isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing); + return newTicks; + } + skip(ticks, newTicks, spacing); + return newTicks; +} +function determineMaxTicks(scale) { + const offset = scale.options.offset; + const tickLength = scale._tickSize(); + const maxScale = scale._length / tickLength + (offset ? 0 : 1); + const maxChart = scale._maxLength / tickLength; + return Math.floor(Math.min(maxScale, maxChart)); +} + function calculateSpacing(majorIndices, ticks, ticksLimit) { + const evenMajorSpacing = getEvenSpacing(majorIndices); + const spacing = ticks.length / ticksLimit; + if (!evenMajorSpacing) { + return Math.max(spacing, 1); + } + const factors = helpers_segment._factorize(evenMajorSpacing); + for(let i = 0, ilen = factors.length - 1; i < ilen; i++){ + const factor = factors[i]; + if (factor > spacing) { + return factor; + } + } + return Math.max(spacing, 1); +} + function getMajorIndices(ticks) { + const result = []; + let i, ilen; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + if (ticks[i].major) { + result.push(i); + } + } + return result; +} + function skipMajors(ticks, newTicks, majorIndices, spacing) { + let count = 0; + let next = majorIndices[0]; + let i; + spacing = Math.ceil(spacing); + for(i = 0; i < ticks.length; i++){ + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = majorIndices[count * spacing]; + } + } +} + function skip(ticks, newTicks, spacing, majorStart, majorEnd) { + const start = helpers_segment.valueOrDefault(majorStart, 0); + const end = Math.min(helpers_segment.valueOrDefault(majorEnd, ticks.length), ticks.length); + let count = 0; + let length, i, next; + spacing = Math.ceil(spacing); + if (majorEnd) { + length = majorEnd - majorStart; + spacing = length / Math.floor(length / spacing); + } + next = start; + while(next < 0){ + count++; + next = Math.round(start + count * spacing); + } + for(i = Math.max(start, 0); i < end; i++){ + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = Math.round(start + count * spacing); + } + } +} + function getEvenSpacing(arr) { + const len = arr.length; + let i, diff; + if (len < 2) { + return false; + } + for(diff = arr[0], i = 1; i < len; ++i){ + if (arr[i] - arr[i - 1] !== diff) { + return false; + } + } + return diff; +} + +const reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align; +const offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset; +const getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength); + function sample(arr, numItems) { + const result = []; + const increment = arr.length / numItems; + const len = arr.length; + let i = 0; + for(; i < len; i += increment){ + result.push(arr[Math.floor(i)]); + } + return result; +} + function getPixelForGridLine(scale, index, offsetGridLines) { + const length = scale.ticks.length; + const validIndex = Math.min(index, length - 1); + const start = scale._startPixel; + const end = scale._endPixel; + const epsilon = 1e-6; + let lineValue = scale.getPixelForTick(validIndex); + let offset; + if (offsetGridLines) { + if (length === 1) { + offset = Math.max(lineValue - start, end - lineValue); + } else if (index === 0) { + offset = (scale.getPixelForTick(1) - lineValue) / 2; + } else { + offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2; + } + lineValue += validIndex < index ? offset : -offset; + if (lineValue < start - epsilon || lineValue > end + epsilon) { + return; + } + } + return lineValue; +} + function garbageCollect(caches, length) { + helpers_segment.each(caches, (cache)=>{ + const gc = cache.gc; + const gcLen = gc.length / 2; + let i; + if (gcLen > length) { + for(i = 0; i < gcLen; ++i){ + delete cache.data[gc[i]]; + } + gc.splice(0, gcLen); + } + }); +} + function getTickMarkLength(options) { + return options.drawTicks ? options.tickLength : 0; +} + function getTitleHeight(options, fallback) { + if (!options.display) { + return 0; + } + const font = helpers_segment.toFont(options.font, fallback); + const padding = helpers_segment.toPadding(options.padding); + const lines = helpers_segment.isArray(options.text) ? options.text.length : 1; + return lines * font.lineHeight + padding.height; +} +function createScaleContext(parent, scale) { + return helpers_segment.createContext(parent, { + scale, + type: 'scale' + }); +} +function createTickContext(parent, index, tick) { + return helpers_segment.createContext(parent, { + tick, + index, + type: 'tick' + }); +} +function titleAlign(align, position, reverse) { + let ret = helpers_segment._toLeftRightCenter(align); + if (reverse && position !== 'right' || !reverse && position === 'right') { + ret = reverseAlign(ret); + } + return ret; +} +function titleArgs(scale, offset, position, align) { + const { top , left , bottom , right , chart } = scale; + const { chartArea , scales } = chart; + let rotation = 0; + let maxWidth, titleX, titleY; + const height = bottom - top; + const width = right - left; + if (scale.isHorizontal()) { + titleX = helpers_segment._alignStartEnd(align, left, right); + if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleY = scales[positionAxisID].getPixelForValue(value) + height - offset; + } else if (position === 'center') { + titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset; + } else { + titleY = offsetFromEdge(scale, position, offset); + } + maxWidth = right - left; + } else { + if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleX = scales[positionAxisID].getPixelForValue(value) - width + offset; + } else if (position === 'center') { + titleX = (chartArea.left + chartArea.right) / 2 - width + offset; + } else { + titleX = offsetFromEdge(scale, position, offset); + } + titleY = helpers_segment._alignStartEnd(align, bottom, top); + rotation = position === 'left' ? -helpers_segment.HALF_PI : helpers_segment.HALF_PI; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; +} +class Scale extends Element { + constructor(cfg){ + super(); + this.id = cfg.id; + this.type = cfg.type; + this.options = undefined; + this.ctx = cfg.ctx; + this.chart = cfg.chart; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.width = undefined; + this.height = undefined; + this._margins = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + this.maxWidth = undefined; + this.maxHeight = undefined; + this.paddingTop = undefined; + this.paddingBottom = undefined; + this.paddingLeft = undefined; + this.paddingRight = undefined; + this.axis = undefined; + this.labelRotation = undefined; + this.min = undefined; + this.max = undefined; + this._range = undefined; + this.ticks = []; + this._gridLineItems = null; + this._labelItems = null; + this._labelSizes = null; + this._length = 0; + this._maxLength = 0; + this._longestTextCache = {}; + this._startPixel = undefined; + this._endPixel = undefined; + this._reversePixels = false; + this._userMax = undefined; + this._userMin = undefined; + this._suggestedMax = undefined; + this._suggestedMin = undefined; + this._ticksLength = 0; + this._borderValue = 0; + this._cache = {}; + this._dataLimitsCached = false; + this.$context = undefined; + } + init(options) { + this.options = options.setContext(this.getContext()); + this.axis = options.axis; + this._userMin = this.parse(options.min); + this._userMax = this.parse(options.max); + this._suggestedMin = this.parse(options.suggestedMin); + this._suggestedMax = this.parse(options.suggestedMax); + } + parse(raw, index) { + return raw; + } + getUserBounds() { + let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this; + _userMin = helpers_segment.finiteOrDefault(_userMin, Number.POSITIVE_INFINITY); + _userMax = helpers_segment.finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY); + _suggestedMin = helpers_segment.finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY); + _suggestedMax = helpers_segment.finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY); + return { + min: helpers_segment.finiteOrDefault(_userMin, _suggestedMin), + max: helpers_segment.finiteOrDefault(_userMax, _suggestedMax), + minDefined: helpers_segment.isNumberFinite(_userMin), + maxDefined: helpers_segment.isNumberFinite(_userMax) + }; + } + getMinMax(canStack) { + let { min , max , minDefined , maxDefined } = this.getUserBounds(); + let range; + if (minDefined && maxDefined) { + return { + min, + max + }; + } + const metas = this.getMatchingVisibleMetas(); + for(let i = 0, ilen = metas.length; i < ilen; ++i){ + range = metas[i].controller.getMinMax(this, canStack); + if (!minDefined) { + min = Math.min(min, range.min); + } + if (!maxDefined) { + max = Math.max(max, range.max); + } + } + min = maxDefined && min > max ? max : min; + max = minDefined && min > max ? min : max; + return { + min: helpers_segment.finiteOrDefault(min, helpers_segment.finiteOrDefault(max, min)), + max: helpers_segment.finiteOrDefault(max, helpers_segment.finiteOrDefault(min, max)) + }; + } + getPadding() { + return { + left: this.paddingLeft || 0, + top: this.paddingTop || 0, + right: this.paddingRight || 0, + bottom: this.paddingBottom || 0 + }; + } + getTicks() { + return this.ticks; + } + getLabels() { + const data = this.chart.data; + return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || []; + } + getLabelItems(chartArea = this.chart.chartArea) { + const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea)); + return items; + } + beforeLayout() { + this._cache = {}; + this._dataLimitsCached = false; + } + beforeUpdate() { + helpers_segment.callback(this.options.beforeUpdate, [ + this + ]); + } + update(maxWidth, maxHeight, margins) { + const { beginAtZero , grace , ticks: tickOpts } = this.options; + const sampleSize = tickOpts.sampleSize; + this.beforeUpdate(); + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins = Object.assign({ + left: 0, + right: 0, + top: 0, + bottom: 0 + }, margins); + this.ticks = null; + this._labelSizes = null; + this._gridLineItems = null; + this._labelItems = null; + this.beforeSetDimensions(); + this.setDimensions(); + this.afterSetDimensions(); + this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom; + if (!this._dataLimitsCached) { + this.beforeDataLimits(); + this.determineDataLimits(); + this.afterDataLimits(); + this._range = helpers_segment._addGrace(this, grace, beginAtZero); + this._dataLimitsCached = true; + } + this.beforeBuildTicks(); + this.ticks = this.buildTicks() || []; + this.afterBuildTicks(); + const samplingEnabled = sampleSize < this.ticks.length; + this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks); + this.configure(); + this.beforeCalculateLabelRotation(); + this.calculateLabelRotation(); + this.afterCalculateLabelRotation(); + if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) { + this.ticks = autoSkip(this, this.ticks); + this._labelSizes = null; + this.afterAutoSkip(); + } + if (samplingEnabled) { + this._convertTicksToLabels(this.ticks); + } + this.beforeFit(); + this.fit(); + this.afterFit(); + this.afterUpdate(); + } + configure() { + let reversePixels = this.options.reverse; + let startPixel, endPixel; + if (this.isHorizontal()) { + startPixel = this.left; + endPixel = this.right; + } else { + startPixel = this.top; + endPixel = this.bottom; + reversePixels = !reversePixels; + } + this._startPixel = startPixel; + this._endPixel = endPixel; + this._reversePixels = reversePixels; + this._length = endPixel - startPixel; + this._alignToPixels = this.options.alignToPixels; + } + afterUpdate() { + helpers_segment.callback(this.options.afterUpdate, [ + this + ]); + } + beforeSetDimensions() { + helpers_segment.callback(this.options.beforeSetDimensions, [ + this + ]); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = 0; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = 0; + this.bottom = this.height; + } + this.paddingLeft = 0; + this.paddingTop = 0; + this.paddingRight = 0; + this.paddingBottom = 0; + } + afterSetDimensions() { + helpers_segment.callback(this.options.afterSetDimensions, [ + this + ]); + } + _callHooks(name) { + this.chart.notifyPlugins(name, this.getContext()); + helpers_segment.callback(this.options[name], [ + this + ]); + } + beforeDataLimits() { + this._callHooks('beforeDataLimits'); + } + determineDataLimits() {} + afterDataLimits() { + this._callHooks('afterDataLimits'); + } + beforeBuildTicks() { + this._callHooks('beforeBuildTicks'); + } + buildTicks() { + return []; + } + afterBuildTicks() { + this._callHooks('afterBuildTicks'); + } + beforeTickToLabelConversion() { + helpers_segment.callback(this.options.beforeTickToLabelConversion, [ + this + ]); + } + generateTickLabels(ticks) { + const tickOpts = this.options.ticks; + let i, ilen, tick; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + tick = ticks[i]; + tick.label = helpers_segment.callback(tickOpts.callback, [ + tick.value, + i, + ticks + ], this); + } + } + afterTickToLabelConversion() { + helpers_segment.callback(this.options.afterTickToLabelConversion, [ + this + ]); + } + beforeCalculateLabelRotation() { + helpers_segment.callback(this.options.beforeCalculateLabelRotation, [ + this + ]); + } + calculateLabelRotation() { + const options = this.options; + const tickOpts = options.ticks; + const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit); + const minRotation = tickOpts.minRotation || 0; + const maxRotation = tickOpts.maxRotation; + let labelRotation = minRotation; + let tickWidth, maxHeight, maxLabelDiagonal; + if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) { + this.labelRotation = minRotation; + return; + } + const labelSizes = this._getLabelSizes(); + const maxLabelWidth = labelSizes.widest.width; + const maxLabelHeight = labelSizes.highest.height; + const maxWidth = helpers_segment._limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth); + tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1); + if (maxLabelWidth + 6 > tickWidth) { + tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1)); + maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font); + maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight); + labelRotation = helpers_segment.toDegrees(Math.min(Math.asin(helpers_segment._limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(helpers_segment._limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(helpers_segment._limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1)))); + labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation)); + } + this.labelRotation = labelRotation; + } + afterCalculateLabelRotation() { + helpers_segment.callback(this.options.afterCalculateLabelRotation, [ + this + ]); + } + afterAutoSkip() {} + beforeFit() { + helpers_segment.callback(this.options.beforeFit, [ + this + ]); + } + fit() { + const minSize = { + width: 0, + height: 0 + }; + const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this; + const display = this._isVisible(); + const isHorizontal = this.isHorizontal(); + if (display) { + const titleHeight = getTitleHeight(titleOpts, chart.options.font); + if (isHorizontal) { + minSize.width = this.maxWidth; + minSize.height = getTickMarkLength(gridOpts) + titleHeight; + } else { + minSize.height = this.maxHeight; + minSize.width = getTickMarkLength(gridOpts) + titleHeight; + } + if (tickOpts.display && this.ticks.length) { + const { first , last , widest , highest } = this._getLabelSizes(); + const tickPadding = tickOpts.padding * 2; + const angleRadians = helpers_segment.toRadians(this.labelRotation); + const cos = Math.cos(angleRadians); + const sin = Math.sin(angleRadians); + if (isHorizontal) { + const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height; + minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding); + } else { + const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height; + minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding); + } + this._calculatePadding(first, last, sin, cos); + } + } + this._handleMargins(); + if (isHorizontal) { + this.width = this._length = chart.width - this._margins.left - this._margins.right; + this.height = minSize.height; + } else { + this.width = minSize.width; + this.height = this._length = chart.height - this._margins.top - this._margins.bottom; + } + } + _calculatePadding(first, last, sin, cos) { + const { ticks: { align , padding } , position } = this.options; + const isRotated = this.labelRotation !== 0; + const labelsBelowTicks = position !== 'top' && this.axis === 'x'; + if (this.isHorizontal()) { + const offsetLeft = this.getPixelForTick(0) - this.left; + const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1); + let paddingLeft = 0; + let paddingRight = 0; + if (isRotated) { + if (labelsBelowTicks) { + paddingLeft = cos * first.width; + paddingRight = sin * last.height; + } else { + paddingLeft = sin * first.height; + paddingRight = cos * last.width; + } + } else if (align === 'start') { + paddingRight = last.width; + } else if (align === 'end') { + paddingLeft = first.width; + } else if (align !== 'inner') { + paddingLeft = first.width / 2; + paddingRight = last.width / 2; + } + this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0); + this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0); + } else { + let paddingTop = last.height / 2; + let paddingBottom = first.height / 2; + if (align === 'start') { + paddingTop = 0; + paddingBottom = first.height; + } else if (align === 'end') { + paddingTop = last.height; + paddingBottom = 0; + } + this.paddingTop = paddingTop + padding; + this.paddingBottom = paddingBottom + padding; + } + } + _handleMargins() { + if (this._margins) { + this._margins.left = Math.max(this.paddingLeft, this._margins.left); + this._margins.top = Math.max(this.paddingTop, this._margins.top); + this._margins.right = Math.max(this.paddingRight, this._margins.right); + this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom); + } + } + afterFit() { + helpers_segment.callback(this.options.afterFit, [ + this + ]); + } + isHorizontal() { + const { axis , position } = this.options; + return position === 'top' || position === 'bottom' || axis === 'x'; + } + isFullSize() { + return this.options.fullSize; + } + _convertTicksToLabels(ticks) { + this.beforeTickToLabelConversion(); + this.generateTickLabels(ticks); + let i, ilen; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + if (helpers_segment.isNullOrUndef(ticks[i].label)) { + ticks.splice(i, 1); + ilen--; + i--; + } + } + this.afterTickToLabelConversion(); + } + _getLabelSizes() { + let labelSizes = this._labelSizes; + if (!labelSizes) { + const sampleSize = this.options.ticks.sampleSize; + let ticks = this.ticks; + if (sampleSize < ticks.length) { + ticks = sample(ticks, sampleSize); + } + this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit); + } + return labelSizes; + } + _computeLabelSizes(ticks, length, maxTicksLimit) { + const { ctx , _longestTextCache: caches } = this; + const widths = []; + const heights = []; + const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit)); + let widestLabelSize = 0; + let highestLabelSize = 0; + let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel; + for(i = 0; i < length; i += increment){ + label = ticks[i].label; + tickFont = this._resolveTickFontOptions(i); + ctx.font = fontString = tickFont.string; + cache = caches[fontString] = caches[fontString] || { + data: {}, + gc: [] + }; + lineHeight = tickFont.lineHeight; + width = height = 0; + if (!helpers_segment.isNullOrUndef(label) && !helpers_segment.isArray(label)) { + width = helpers_segment._measureText(ctx, cache.data, cache.gc, width, label); + height = lineHeight; + } else if (helpers_segment.isArray(label)) { + for(j = 0, jlen = label.length; j < jlen; ++j){ + nestedLabel = label[j]; + if (!helpers_segment.isNullOrUndef(nestedLabel) && !helpers_segment.isArray(nestedLabel)) { + width = helpers_segment._measureText(ctx, cache.data, cache.gc, width, nestedLabel); + height += lineHeight; + } + } + } + widths.push(width); + heights.push(height); + widestLabelSize = Math.max(width, widestLabelSize); + highestLabelSize = Math.max(height, highestLabelSize); + } + garbageCollect(caches, length); + const widest = widths.indexOf(widestLabelSize); + const highest = heights.indexOf(highestLabelSize); + const valueAt = (idx)=>({ + width: widths[idx] || 0, + height: heights[idx] || 0 + }); + return { + first: valueAt(0), + last: valueAt(length - 1), + widest: valueAt(widest), + highest: valueAt(highest), + widths, + heights + }; + } + getLabelForValue(value) { + return value; + } + getPixelForValue(value, index) { + return NaN; + } + getValueForPixel(pixel) {} + getPixelForTick(index) { + const ticks = this.ticks; + if (index < 0 || index > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index].value); + } + getPixelForDecimal(decimal) { + if (this._reversePixels) { + decimal = 1 - decimal; + } + const pixel = this._startPixel + decimal * this._length; + return helpers_segment._int16Range(this._alignToPixels ? helpers_segment._alignPixel(this.chart, pixel, 0) : pixel); + } + getDecimalForPixel(pixel) { + const decimal = (pixel - this._startPixel) / this._length; + return this._reversePixels ? 1 - decimal : decimal; + } + getBasePixel() { + return this.getPixelForValue(this.getBaseValue()); + } + getBaseValue() { + const { min , max } = this; + return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0; + } + getContext(index) { + const ticks = this.ticks || []; + if (index >= 0 && index < ticks.length) { + const tick = ticks[index]; + return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick)); + } + return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this)); + } + _tickSize() { + const optionTicks = this.options.ticks; + const rot = helpers_segment.toRadians(this.labelRotation); + const cos = Math.abs(Math.cos(rot)); + const sin = Math.abs(Math.sin(rot)); + const labelSizes = this._getLabelSizes(); + const padding = optionTicks.autoSkipPadding || 0; + const w = labelSizes ? labelSizes.widest.width + padding : 0; + const h = labelSizes ? labelSizes.highest.height + padding : 0; + return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin; + } + _isVisible() { + const display = this.options.display; + if (display !== 'auto') { + return !!display; + } + return this.getMatchingVisibleMetas().length > 0; + } + _computeGridLineItems(chartArea) { + const axis = this.axis; + const chart = this.chart; + const options = this.options; + const { grid , position , border } = options; + const offset = grid.offset; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const ticksLength = ticks.length + (offset ? 1 : 0); + const tl = getTickMarkLength(grid); + const items = []; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = borderOpts.display ? borderOpts.width : 0; + const axisHalfWidth = axisWidth / 2; + const alignBorderValue = function(pixel) { + return helpers_segment._alignPixel(chart, pixel, axisWidth); + }; + let borderValue, i, lineValue, alignedLineValue; + let tx1, ty1, tx2, ty2, x1, y1, x2, y2; + if (position === 'top') { + borderValue = alignBorderValue(this.bottom); + ty1 = this.bottom - tl; + ty2 = borderValue - axisHalfWidth; + y1 = alignBorderValue(chartArea.top) + axisHalfWidth; + y2 = chartArea.bottom; + } else if (position === 'bottom') { + borderValue = alignBorderValue(this.top); + y1 = chartArea.top; + y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth; + ty1 = borderValue + axisHalfWidth; + ty2 = this.top + tl; + } else if (position === 'left') { + borderValue = alignBorderValue(this.right); + tx1 = this.right - tl; + tx2 = borderValue - axisHalfWidth; + x1 = alignBorderValue(chartArea.left) + axisHalfWidth; + x2 = chartArea.right; + } else if (position === 'right') { + borderValue = alignBorderValue(this.left); + x1 = chartArea.left; + x2 = alignBorderValue(chartArea.right) - axisHalfWidth; + tx1 = borderValue + axisHalfWidth; + tx2 = this.left + tl; + } else if (axis === 'x') { + if (position === 'center') { + borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5); + } else if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + y1 = chartArea.top; + y2 = chartArea.bottom; + ty1 = borderValue + axisHalfWidth; + ty2 = ty1 + tl; + } else if (axis === 'y') { + if (position === 'center') { + borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2); + } else if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + tx1 = borderValue - axisHalfWidth; + tx2 = tx1 - tl; + x1 = chartArea.left; + x2 = chartArea.right; + } + const limit = helpers_segment.valueOrDefault(options.ticks.maxTicksLimit, ticksLength); + const step = Math.max(1, Math.ceil(ticksLength / limit)); + for(i = 0; i < ticksLength; i += step){ + const context = this.getContext(i); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + const lineWidth = optsAtIndex.lineWidth; + const lineColor = optsAtIndex.color; + const borderDash = optsAtIndexBorder.dash || []; + const borderDashOffset = optsAtIndexBorder.dashOffset; + const tickWidth = optsAtIndex.tickWidth; + const tickColor = optsAtIndex.tickColor; + const tickBorderDash = optsAtIndex.tickBorderDash || []; + const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset; + lineValue = getPixelForGridLine(this, i, offset); + if (lineValue === undefined) { + continue; + } + alignedLineValue = helpers_segment._alignPixel(chart, lineValue, lineWidth); + if (isHorizontal) { + tx1 = tx2 = x1 = x2 = alignedLineValue; + } else { + ty1 = ty2 = y1 = y2 = alignedLineValue; + } + items.push({ + tx1, + ty1, + tx2, + ty2, + x1, + y1, + x2, + y2, + width: lineWidth, + color: lineColor, + borderDash, + borderDashOffset, + tickWidth, + tickColor, + tickBorderDash, + tickBorderDashOffset + }); + } + this._ticksLength = ticksLength; + this._borderValue = borderValue; + return items; + } + _computeLabelItems(chartArea) { + const axis = this.axis; + const options = this.options; + const { position , ticks: optionTicks } = options; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const { align , crossAlign , padding , mirror } = optionTicks; + const tl = getTickMarkLength(options.grid); + const tickAndPadding = tl + padding; + const hTickAndPadding = mirror ? -padding : tickAndPadding; + const rotation = -helpers_segment.toRadians(this.labelRotation); + const items = []; + let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset; + let textBaseline = 'middle'; + if (position === 'top') { + y = this.bottom - hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === 'bottom') { + y = this.top + hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === 'left') { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (position === 'right') { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (axis === 'x') { + if (position === 'center') { + y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding; + } else if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding; + } + textAlign = this._getXAxisLabelAlignment(); + } else if (axis === 'y') { + if (position === 'center') { + x = (chartArea.left + chartArea.right) / 2 - tickAndPadding; + } else if (helpers_segment.isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + x = this.chart.scales[positionAxisID].getPixelForValue(value); + } + textAlign = this._getYAxisLabelAlignment(tl).textAlign; + } + if (axis === 'y') { + if (align === 'start') { + textBaseline = 'top'; + } else if (align === 'end') { + textBaseline = 'bottom'; + } + } + const labelSizes = this._getLabelSizes(); + for(i = 0, ilen = ticks.length; i < ilen; ++i){ + tick = ticks[i]; + label = tick.label; + const optsAtIndex = optionTicks.setContext(this.getContext(i)); + pixel = this.getPixelForTick(i) + optionTicks.labelOffset; + font = this._resolveTickFontOptions(i); + lineHeight = font.lineHeight; + lineCount = helpers_segment.isArray(label) ? label.length : 1; + const halfCount = lineCount / 2; + const color = optsAtIndex.color; + const strokeColor = optsAtIndex.textStrokeColor; + const strokeWidth = optsAtIndex.textStrokeWidth; + let tickTextAlign = textAlign; + if (isHorizontal) { + x = pixel; + if (textAlign === 'inner') { + if (i === ilen - 1) { + tickTextAlign = !this.options.reverse ? 'right' : 'left'; + } else if (i === 0) { + tickTextAlign = !this.options.reverse ? 'left' : 'right'; + } else { + tickTextAlign = 'center'; + } + } + if (position === 'top') { + if (crossAlign === 'near' || rotation !== 0) { + textOffset = -lineCount * lineHeight + lineHeight / 2; + } else if (crossAlign === 'center') { + textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight; + } else { + textOffset = -labelSizes.highest.height + lineHeight / 2; + } + } else { + if (crossAlign === 'near' || rotation !== 0) { + textOffset = lineHeight / 2; + } else if (crossAlign === 'center') { + textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight; + } else { + textOffset = labelSizes.highest.height - lineCount * lineHeight; + } + } + if (mirror) { + textOffset *= -1; + } + if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) { + x += lineHeight / 2 * Math.sin(rotation); + } + } else { + y = pixel; + textOffset = (1 - lineCount) * lineHeight / 2; + } + let backdrop; + if (optsAtIndex.showLabelBackdrop) { + const labelPadding = helpers_segment.toPadding(optsAtIndex.backdropPadding); + const height = labelSizes.heights[i]; + const width = labelSizes.widths[i]; + let top = textOffset - labelPadding.top; + let left = 0 - labelPadding.left; + switch(textBaseline){ + case 'middle': + top -= height / 2; + break; + case 'bottom': + top -= height; + break; + } + switch(textAlign){ + case 'center': + left -= width / 2; + break; + case 'right': + left -= width; + break; + case 'inner': + if (i === ilen - 1) { + left -= width; + } else if (i > 0) { + left -= width / 2; + } + break; + } + backdrop = { + left, + top, + width: width + labelPadding.width, + height: height + labelPadding.height, + color: optsAtIndex.backdropColor + }; + } + items.push({ + label, + font, + textOffset, + options: { + rotation, + color, + strokeColor, + strokeWidth, + textAlign: tickTextAlign, + textBaseline, + translation: [ + x, + y + ], + backdrop + } + }); + } + return items; + } + _getXAxisLabelAlignment() { + const { position , ticks } = this.options; + const rotation = -helpers_segment.toRadians(this.labelRotation); + if (rotation) { + return position === 'top' ? 'left' : 'right'; + } + let align = 'center'; + if (ticks.align === 'start') { + align = 'left'; + } else if (ticks.align === 'end') { + align = 'right'; + } else if (ticks.align === 'inner') { + align = 'inner'; + } + return align; + } + _getYAxisLabelAlignment(tl) { + const { position , ticks: { crossAlign , mirror , padding } } = this.options; + const labelSizes = this._getLabelSizes(); + const tickAndPadding = tl + padding; + const widest = labelSizes.widest.width; + let textAlign; + let x; + if (position === 'left') { + if (mirror) { + x = this.right + padding; + if (crossAlign === 'near') { + textAlign = 'left'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x += widest / 2; + } else { + textAlign = 'right'; + x += widest; + } + } else { + x = this.right - tickAndPadding; + if (crossAlign === 'near') { + textAlign = 'right'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x -= widest / 2; + } else { + textAlign = 'left'; + x = this.left; + } + } + } else if (position === 'right') { + if (mirror) { + x = this.left + padding; + if (crossAlign === 'near') { + textAlign = 'right'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x -= widest / 2; + } else { + textAlign = 'left'; + x -= widest; + } + } else { + x = this.left + tickAndPadding; + if (crossAlign === 'near') { + textAlign = 'left'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x += widest / 2; + } else { + textAlign = 'right'; + x = this.right; + } + } + } else { + textAlign = 'right'; + } + return { + textAlign, + x + }; + } + _computeLabelArea() { + if (this.options.ticks.mirror) { + return; + } + const chart = this.chart; + const position = this.options.position; + if (position === 'left' || position === 'right') { + return { + top: 0, + left: this.left, + bottom: chart.height, + right: this.right + }; + } + if (position === 'top' || position === 'bottom') { + return { + top: this.top, + left: 0, + bottom: this.bottom, + right: chart.width + }; + } + } + drawBackground() { + const { ctx , options: { backgroundColor } , left , top , width , height } = this; + if (backgroundColor) { + ctx.save(); + ctx.fillStyle = backgroundColor; + ctx.fillRect(left, top, width, height); + ctx.restore(); + } + } + getLineWidthForValue(value) { + const grid = this.options.grid; + if (!this._isVisible() || !grid.display) { + return 0; + } + const ticks = this.ticks; + const index = ticks.findIndex((t)=>t.value === value); + if (index >= 0) { + const opts = grid.setContext(this.getContext(index)); + return opts.lineWidth; + } + return 0; + } + drawGrid(chartArea) { + const grid = this.options.grid; + const ctx = this.ctx; + const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea)); + let i, ilen; + const drawLine = (p1, p2, style)=>{ + if (!style.width || !style.color) { + return; + } + ctx.save(); + ctx.lineWidth = style.width; + ctx.strokeStyle = style.color; + ctx.setLineDash(style.borderDash || []); + ctx.lineDashOffset = style.borderDashOffset; + ctx.beginPath(); + ctx.moveTo(p1.x, p1.y); + ctx.lineTo(p2.x, p2.y); + ctx.stroke(); + ctx.restore(); + }; + if (grid.display) { + for(i = 0, ilen = items.length; i < ilen; ++i){ + const item = items[i]; + if (grid.drawOnChartArea) { + drawLine({ + x: item.x1, + y: item.y1 + }, { + x: item.x2, + y: item.y2 + }, item); + } + if (grid.drawTicks) { + drawLine({ + x: item.tx1, + y: item.ty1 + }, { + x: item.tx2, + y: item.ty2 + }, { + color: item.tickColor, + width: item.tickWidth, + borderDash: item.tickBorderDash, + borderDashOffset: item.tickBorderDashOffset + }); + } + } + } + } + drawBorder() { + const { chart , ctx , options: { border , grid } } = this; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = border.display ? borderOpts.width : 0; + if (!axisWidth) { + return; + } + const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth; + const borderValue = this._borderValue; + let x1, x2, y1, y2; + if (this.isHorizontal()) { + x1 = helpers_segment._alignPixel(chart, this.left, axisWidth) - axisWidth / 2; + x2 = helpers_segment._alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2; + y1 = y2 = borderValue; + } else { + y1 = helpers_segment._alignPixel(chart, this.top, axisWidth) - axisWidth / 2; + y2 = helpers_segment._alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2; + x1 = x2 = borderValue; + } + ctx.save(); + ctx.lineWidth = borderOpts.width; + ctx.strokeStyle = borderOpts.color; + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + ctx.restore(); + } + drawLabels(chartArea) { + const optionTicks = this.options.ticks; + if (!optionTicks.display) { + return; + } + const ctx = this.ctx; + const area = this._computeLabelArea(); + if (area) { + helpers_segment.clipArea(ctx, area); + } + const items = this.getLabelItems(chartArea); + for (const item of items){ + const renderTextOptions = item.options; + const tickFont = item.font; + const label = item.label; + const y = item.textOffset; + helpers_segment.renderText(ctx, label, 0, y, tickFont, renderTextOptions); + } + if (area) { + helpers_segment.unclipArea(ctx); + } + } + drawTitle() { + const { ctx , options: { position , title , reverse } } = this; + if (!title.display) { + return; + } + const font = helpers_segment.toFont(title.font); + const padding = helpers_segment.toPadding(title.padding); + const align = title.align; + let offset = font.lineHeight / 2; + if (position === 'bottom' || position === 'center' || helpers_segment.isObject(position)) { + offset += padding.bottom; + if (helpers_segment.isArray(title.text)) { + offset += font.lineHeight * (title.text.length - 1); + } + } else { + offset += padding.top; + } + const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align); + helpers_segment.renderText(ctx, title.text, 0, 0, font, { + color: title.color, + maxWidth, + rotation, + textAlign: titleAlign(align, position, reverse), + textBaseline: 'middle', + translation: [ + titleX, + titleY + ] + }); + } + draw(chartArea) { + if (!this._isVisible()) { + return; + } + this.drawBackground(); + this.drawGrid(chartArea); + this.drawBorder(); + this.drawTitle(); + this.drawLabels(chartArea); + } + _layers() { + const opts = this.options; + const tz = opts.ticks && opts.ticks.z || 0; + const gz = helpers_segment.valueOrDefault(opts.grid && opts.grid.z, -1); + const bz = helpers_segment.valueOrDefault(opts.border && opts.border.z, 0); + if (!this._isVisible() || this.draw !== Scale.prototype.draw) { + return [ + { + z: tz, + draw: (chartArea)=>{ + this.draw(chartArea); + } + } + ]; + } + return [ + { + z: gz, + draw: (chartArea)=>{ + this.drawBackground(); + this.drawGrid(chartArea); + this.drawTitle(); + } + }, + { + z: bz, + draw: ()=>{ + this.drawBorder(); + } + }, + { + z: tz, + draw: (chartArea)=>{ + this.drawLabels(chartArea); + } + } + ]; + } + getMatchingVisibleMetas(type) { + const metas = this.chart.getSortedVisibleDatasetMetas(); + const axisID = this.axis + 'AxisID'; + const result = []; + let i, ilen; + for(i = 0, ilen = metas.length; i < ilen; ++i){ + const meta = metas[i]; + if (meta[axisID] === this.id && (!type || meta.type === type)) { + result.push(meta); + } + } + return result; + } + _resolveTickFontOptions(index) { + const opts = this.options.ticks.setContext(this.getContext(index)); + return helpers_segment.toFont(opts.font); + } + _maxDigits() { + const fontSize = this._resolveTickFontOptions(0).lineHeight; + return (this.isHorizontal() ? this.width : this.height) / fontSize; + } +} + +class TypedRegistry { + constructor(type, scope, override){ + this.type = type; + this.scope = scope; + this.override = override; + this.items = Object.create(null); + } + isForType(type) { + return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype); + } + register(item) { + const proto = Object.getPrototypeOf(item); + let parentScope; + if (isIChartComponent(proto)) { + parentScope = this.register(proto); + } + const items = this.items; + const id = item.id; + const scope = this.scope + '.' + id; + if (!id) { + throw new Error('class does not have id: ' + item); + } + if (id in items) { + return scope; + } + items[id] = item; + registerDefaults(item, scope, parentScope); + if (this.override) { + helpers_segment.defaults.override(item.id, item.overrides); + } + return scope; + } + get(id) { + return this.items[id]; + } + unregister(item) { + const items = this.items; + const id = item.id; + const scope = this.scope; + if (id in items) { + delete items[id]; + } + if (scope && id in helpers_segment.defaults[scope]) { + delete helpers_segment.defaults[scope][id]; + if (this.override) { + delete helpers_segment.overrides[id]; + } + } + } +} +function registerDefaults(item, scope, parentScope) { + const itemDefaults = helpers_segment.merge(Object.create(null), [ + parentScope ? helpers_segment.defaults.get(parentScope) : {}, + helpers_segment.defaults.get(scope), + item.defaults + ]); + helpers_segment.defaults.set(scope, itemDefaults); + if (item.defaultRoutes) { + routeDefaults(scope, item.defaultRoutes); + } + if (item.descriptors) { + helpers_segment.defaults.describe(scope, item.descriptors); + } +} +function routeDefaults(scope, routes) { + Object.keys(routes).forEach((property)=>{ + const propertyParts = property.split('.'); + const sourceName = propertyParts.pop(); + const sourceScope = [ + scope + ].concat(propertyParts).join('.'); + const parts = routes[property].split('.'); + const targetName = parts.pop(); + const targetScope = parts.join('.'); + helpers_segment.defaults.route(sourceScope, sourceName, targetScope, targetName); + }); +} +function isIChartComponent(proto) { + return 'id' in proto && 'defaults' in proto; +} + +class Registry { + constructor(){ + this.controllers = new TypedRegistry(DatasetController, 'datasets', true); + this.elements = new TypedRegistry(Element, 'elements'); + this.plugins = new TypedRegistry(Object, 'plugins'); + this.scales = new TypedRegistry(Scale, 'scales'); + this._typedRegistries = [ + this.controllers, + this.scales, + this.elements + ]; + } + add(...args) { + this._each('register', args); + } + remove(...args) { + this._each('unregister', args); + } + addControllers(...args) { + this._each('register', args, this.controllers); + } + addElements(...args) { + this._each('register', args, this.elements); + } + addPlugins(...args) { + this._each('register', args, this.plugins); + } + addScales(...args) { + this._each('register', args, this.scales); + } + getController(id) { + return this._get(id, this.controllers, 'controller'); + } + getElement(id) { + return this._get(id, this.elements, 'element'); + } + getPlugin(id) { + return this._get(id, this.plugins, 'plugin'); + } + getScale(id) { + return this._get(id, this.scales, 'scale'); + } + removeControllers(...args) { + this._each('unregister', args, this.controllers); + } + removeElements(...args) { + this._each('unregister', args, this.elements); + } + removePlugins(...args) { + this._each('unregister', args, this.plugins); + } + removeScales(...args) { + this._each('unregister', args, this.scales); + } + _each(method, args, typedRegistry) { + [ + ...args + ].forEach((arg)=>{ + const reg = typedRegistry || this._getRegistryForType(arg); + if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) { + this._exec(method, reg, arg); + } else { + helpers_segment.each(arg, (item)=>{ + const itemReg = typedRegistry || this._getRegistryForType(item); + this._exec(method, itemReg, item); + }); + } + }); + } + _exec(method, registry, component) { + const camelMethod = helpers_segment._capitalize(method); + helpers_segment.callback(component['before' + camelMethod], [], component); + registry[method](component); + helpers_segment.callback(component['after' + camelMethod], [], component); + } + _getRegistryForType(type) { + for(let i = 0; i < this._typedRegistries.length; i++){ + const reg = this._typedRegistries[i]; + if (reg.isForType(type)) { + return reg; + } + } + return this.plugins; + } + _get(id, typedRegistry, type) { + const item = typedRegistry.get(id); + if (item === undefined) { + throw new Error('"' + id + '" is not a registered ' + type + '.'); + } + return item; + } +} +var registry = /* #__PURE__ */ new Registry(); + +class PluginService { + constructor(){ + this._init = []; + } + notify(chart, hook, args, filter) { + if (hook === 'beforeInit') { + this._init = this._createDescriptors(chart, true); + this._notify(this._init, chart, 'install'); + } + const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart); + const result = this._notify(descriptors, chart, hook, args); + if (hook === 'afterDestroy') { + this._notify(descriptors, chart, 'stop'); + this._notify(this._init, chart, 'uninstall'); + } + return result; + } + _notify(descriptors, chart, hook, args) { + args = args || {}; + for (const descriptor of descriptors){ + const plugin = descriptor.plugin; + const method = plugin[hook]; + const params = [ + chart, + args, + descriptor.options + ]; + if (helpers_segment.callback(method, params, plugin) === false && args.cancelable) { + return false; + } + } + return true; + } + invalidate() { + if (!helpers_segment.isNullOrUndef(this._cache)) { + this._oldCache = this._cache; + this._cache = undefined; + } + } + _descriptors(chart) { + if (this._cache) { + return this._cache; + } + const descriptors = this._cache = this._createDescriptors(chart); + this._notifyStateChanges(chart); + return descriptors; + } + _createDescriptors(chart, all) { + const config = chart && chart.config; + const options = helpers_segment.valueOrDefault(config.options && config.options.plugins, {}); + const plugins = allPlugins(config); + return options === false && !all ? [] : createDescriptors(chart, plugins, options, all); + } + _notifyStateChanges(chart) { + const previousDescriptors = this._oldCache || []; + const descriptors = this._cache; + const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id)); + this._notify(diff(previousDescriptors, descriptors), chart, 'stop'); + this._notify(diff(descriptors, previousDescriptors), chart, 'start'); + } +} + function allPlugins(config) { + const localIds = {}; + const plugins = []; + const keys = Object.keys(registry.plugins.items); + for(let i = 0; i < keys.length; i++){ + plugins.push(registry.getPlugin(keys[i])); + } + const local = config.plugins || []; + for(let i = 0; i < local.length; i++){ + const plugin = local[i]; + if (plugins.indexOf(plugin) === -1) { + plugins.push(plugin); + localIds[plugin.id] = true; + } + } + return { + plugins, + localIds + }; +} +function getOpts(options, all) { + if (!all && options === false) { + return null; + } + if (options === true) { + return {}; + } + return options; +} +function createDescriptors(chart, { plugins , localIds }, options, all) { + const result = []; + const context = chart.getContext(); + for (const plugin of plugins){ + const id = plugin.id; + const opts = getOpts(options[id], all); + if (opts === null) { + continue; + } + result.push({ + plugin, + options: pluginOpts(chart.config, { + plugin, + local: localIds[id] + }, opts, context) + }); + } + return result; +} +function pluginOpts(config, { plugin , local }, opts, context) { + const keys = config.pluginScopeKeys(plugin); + const scopes = config.getOptionScopes(opts, keys); + if (local && plugin.defaults) { + scopes.push(plugin.defaults); + } + return config.createResolver(scopes, context, [ + '' + ], { + scriptable: false, + indexable: false, + allKeys: true + }); +} + +function getIndexAxis(type, options) { + const datasetDefaults = helpers_segment.defaults.datasets[type] || {}; + const datasetOptions = (options.datasets || {})[type] || {}; + return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x'; +} +function getAxisFromDefaultScaleID(id, indexAxis) { + let axis = id; + if (id === '_index_') { + axis = indexAxis; + } else if (id === '_value_') { + axis = indexAxis === 'x' ? 'y' : 'x'; + } + return axis; +} +function getDefaultScaleIDFromAxis(axis, indexAxis) { + return axis === indexAxis ? '_index_' : '_value_'; +} +function idMatchesAxis(id) { + if (id === 'x' || id === 'y' || id === 'r') { + return id; + } +} +function axisFromPosition(position) { + if (position === 'top' || position === 'bottom') { + return 'x'; + } + if (position === 'left' || position === 'right') { + return 'y'; + } +} +function determineAxis(id, ...scaleOptions) { + if (idMatchesAxis(id)) { + return id; + } + for (const opts of scaleOptions){ + const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase()); + if (axis) { + return axis; + } + } + throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`); +} +function getAxisFromDataset(id, axis, dataset) { + if (dataset[axis + 'AxisID'] === id) { + return { + axis + }; + } +} +function retrieveAxisFromDatasets(id, config) { + if (config.data && config.data.datasets) { + const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id); + if (boundDs.length) { + return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]); + } + } + return {}; +} +function mergeScaleConfig(config, options) { + const chartDefaults = helpers_segment.overrides[config.type] || { + scales: {} + }; + const configScales = options.scales || {}; + const chartIndexAxis = getIndexAxis(config.type, options); + const scales = Object.create(null); + Object.keys(configScales).forEach((id)=>{ + const scaleConf = configScales[id]; + if (!helpers_segment.isObject(scaleConf)) { + return console.error(`Invalid scale configuration for scale: ${id}`); + } + if (scaleConf._proxy) { + return console.warn(`Ignoring resolver passed as options for scale: ${id}`); + } + const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), helpers_segment.defaults.scales[scaleConf.type]); + const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis); + const defaultScaleOptions = chartDefaults.scales || {}; + scales[id] = helpers_segment.mergeIf(Object.create(null), [ + { + axis + }, + scaleConf, + defaultScaleOptions[axis], + defaultScaleOptions[defaultId] + ]); + }); + config.data.datasets.forEach((dataset)=>{ + const type = dataset.type || config.type; + const indexAxis = dataset.indexAxis || getIndexAxis(type, options); + const datasetDefaults = helpers_segment.overrides[type] || {}; + const defaultScaleOptions = datasetDefaults.scales || {}; + Object.keys(defaultScaleOptions).forEach((defaultID)=>{ + const axis = getAxisFromDefaultScaleID(defaultID, indexAxis); + const id = dataset[axis + 'AxisID'] || axis; + scales[id] = scales[id] || Object.create(null); + helpers_segment.mergeIf(scales[id], [ + { + axis + }, + configScales[id], + defaultScaleOptions[defaultID] + ]); + }); + }); + Object.keys(scales).forEach((key)=>{ + const scale = scales[key]; + helpers_segment.mergeIf(scale, [ + helpers_segment.defaults.scales[scale.type], + helpers_segment.defaults.scale + ]); + }); + return scales; +} +function initOptions(config) { + const options = config.options || (config.options = {}); + options.plugins = helpers_segment.valueOrDefault(options.plugins, {}); + options.scales = mergeScaleConfig(config, options); +} +function initData(data) { + data = data || {}; + data.datasets = data.datasets || []; + data.labels = data.labels || []; + return data; +} +function initConfig(config) { + config = config || {}; + config.data = initData(config.data); + initOptions(config); + return config; +} +const keyCache = new Map(); +const keysCached = new Set(); +function cachedKeys(cacheKey, generate) { + let keys = keyCache.get(cacheKey); + if (!keys) { + keys = generate(); + keyCache.set(cacheKey, keys); + keysCached.add(keys); + } + return keys; +} +const addIfFound = (set, obj, key)=>{ + const opts = helpers_segment.resolveObjectKey(obj, key); + if (opts !== undefined) { + set.add(opts); + } +}; +class Config { + constructor(config){ + this._config = initConfig(config); + this._scopeCache = new Map(); + this._resolverCache = new Map(); + } + get platform() { + return this._config.platform; + } + get type() { + return this._config.type; + } + set type(type) { + this._config.type = type; + } + get data() { + return this._config.data; + } + set data(data) { + this._config.data = initData(data); + } + get options() { + return this._config.options; + } + set options(options) { + this._config.options = options; + } + get plugins() { + return this._config.plugins; + } + update() { + const config = this._config; + this.clearCache(); + initOptions(config); + } + clearCache() { + this._scopeCache.clear(); + this._resolverCache.clear(); + } + datasetScopeKeys(datasetType) { + return cachedKeys(datasetType, ()=>[ + [ + `datasets.${datasetType}`, + '' + ] + ]); + } + datasetAnimationScopeKeys(datasetType, transition) { + return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[ + [ + `datasets.${datasetType}.transitions.${transition}`, + `transitions.${transition}` + ], + [ + `datasets.${datasetType}`, + '' + ] + ]); + } + datasetElementScopeKeys(datasetType, elementType) { + return cachedKeys(`${datasetType}-${elementType}`, ()=>[ + [ + `datasets.${datasetType}.elements.${elementType}`, + `datasets.${datasetType}`, + `elements.${elementType}`, + '' + ] + ]); + } + pluginScopeKeys(plugin) { + const id = plugin.id; + const type = this.type; + return cachedKeys(`${type}-plugin-${id}`, ()=>[ + [ + `plugins.${id}`, + ...plugin.additionalOptionScopes || [] + ] + ]); + } + _cachedScopes(mainScope, resetCache) { + const _scopeCache = this._scopeCache; + let cache = _scopeCache.get(mainScope); + if (!cache || resetCache) { + cache = new Map(); + _scopeCache.set(mainScope, cache); + } + return cache; + } + getOptionScopes(mainScope, keyLists, resetCache) { + const { options , type } = this; + const cache = this._cachedScopes(mainScope, resetCache); + const cached = cache.get(keyLists); + if (cached) { + return cached; + } + const scopes = new Set(); + keyLists.forEach((keys)=>{ + if (mainScope) { + scopes.add(mainScope); + keys.forEach((key)=>addIfFound(scopes, mainScope, key)); + } + keys.forEach((key)=>addIfFound(scopes, options, key)); + keys.forEach((key)=>addIfFound(scopes, helpers_segment.overrides[type] || {}, key)); + keys.forEach((key)=>addIfFound(scopes, helpers_segment.defaults, key)); + keys.forEach((key)=>addIfFound(scopes, helpers_segment.descriptors, key)); + }); + const array = Array.from(scopes); + if (array.length === 0) { + array.push(Object.create(null)); + } + if (keysCached.has(keyLists)) { + cache.set(keyLists, array); + } + return array; + } + chartOptionScopes() { + const { options , type } = this; + return [ + options, + helpers_segment.overrides[type] || {}, + helpers_segment.defaults.datasets[type] || {}, + { + type + }, + helpers_segment.defaults, + helpers_segment.descriptors + ]; + } + resolveNamedOptions(scopes, names, context, prefixes = [ + '' + ]) { + const result = { + $shared: true + }; + const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes); + let options = resolver; + if (needContext(resolver, names)) { + result.$shared = false; + context = helpers_segment.isFunction(context) ? context() : context; + const subResolver = this.createResolver(scopes, context, subPrefixes); + options = helpers_segment._attachContext(resolver, context, subResolver); + } + for (const prop of names){ + result[prop] = options[prop]; + } + return result; + } + createResolver(scopes, context, prefixes = [ + '' + ], descriptorDefaults) { + const { resolver } = getResolver(this._resolverCache, scopes, prefixes); + return helpers_segment.isObject(context) ? helpers_segment._attachContext(resolver, context, undefined, descriptorDefaults) : resolver; + } +} +function getResolver(resolverCache, scopes, prefixes) { + let cache = resolverCache.get(scopes); + if (!cache) { + cache = new Map(); + resolverCache.set(scopes, cache); + } + const cacheKey = prefixes.join(); + let cached = cache.get(cacheKey); + if (!cached) { + const resolver = helpers_segment._createResolver(scopes, prefixes); + cached = { + resolver, + subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover')) + }; + cache.set(cacheKey, cached); + } + return cached; +} +const hasFunction = (value)=>helpers_segment.isObject(value) && Object.getOwnPropertyNames(value).some((key)=>helpers_segment.isFunction(value[key])); +function needContext(proxy, names) { + const { isScriptable , isIndexable } = helpers_segment._descriptors(proxy); + for (const prop of names){ + const scriptable = isScriptable(prop); + const indexable = isIndexable(prop); + const value = (indexable || scriptable) && proxy[prop]; + if (scriptable && (helpers_segment.isFunction(value) || hasFunction(value)) || indexable && helpers_segment.isArray(value)) { + return true; + } + } + return false; +} + +var version = "4.4.7"; + +const KNOWN_POSITIONS = [ + 'top', + 'bottom', + 'left', + 'right', + 'chartArea' +]; +function positionIsHorizontal(position, axis) { + return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x'; +} +function compare2Level(l1, l2) { + return function(a, b) { + return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1]; + }; +} +function onAnimationsComplete(context) { + const chart = context.chart; + const animationOptions = chart.options.animation; + chart.notifyPlugins('afterRender'); + helpers_segment.callback(animationOptions && animationOptions.onComplete, [ + context + ], chart); +} +function onAnimationProgress(context) { + const chart = context.chart; + const animationOptions = chart.options.animation; + helpers_segment.callback(animationOptions && animationOptions.onProgress, [ + context + ], chart); +} + function getCanvas(item) { + if (helpers_segment._isDomSupported() && typeof item === 'string') { + item = document.getElementById(item); + } else if (item && item.length) { + item = item[0]; + } + if (item && item.canvas) { + item = item.canvas; + } + return item; +} +const instances = {}; +const getChart = (key)=>{ + const canvas = getCanvas(key); + return Object.values(instances).filter((c)=>c.canvas === canvas).pop(); +}; +function moveNumericKeys(obj, start, move) { + const keys = Object.keys(obj); + for (const key of keys){ + const intKey = +key; + if (intKey >= start) { + const value = obj[key]; + delete obj[key]; + if (move > 0 || intKey > start) { + obj[intKey + move] = value; + } + } + } +} + function determineLastEvent(e, lastEvent, inChartArea, isClick) { + if (!inChartArea || e.type === 'mouseout') { + return null; + } + if (isClick) { + return lastEvent; + } + return e; +} +function getSizeForArea(scale, chartArea, field) { + return scale.options.clip ? scale[field] : chartArea[field]; +} +function getDatasetArea(meta, chartArea) { + const { xScale , yScale } = meta; + if (xScale && yScale) { + return { + left: getSizeForArea(xScale, chartArea, 'left'), + right: getSizeForArea(xScale, chartArea, 'right'), + top: getSizeForArea(yScale, chartArea, 'top'), + bottom: getSizeForArea(yScale, chartArea, 'bottom') + }; + } + return chartArea; +} +class Chart { + static defaults = helpers_segment.defaults; + static instances = instances; + static overrides = helpers_segment.overrides; + static registry = registry; + static version = version; + static getChart = getChart; + static register(...items) { + registry.add(...items); + invalidatePlugins(); + } + static unregister(...items) { + registry.remove(...items); + invalidatePlugins(); + } + constructor(item, userConfig){ + const config = this.config = new Config(userConfig); + const initialCanvas = getCanvas(item); + const existingChart = getChart(initialCanvas); + if (existingChart) { + throw new Error('Canvas is already in use. Chart with ID \'' + existingChart.id + '\'' + ' must be destroyed before the canvas with ID \'' + existingChart.canvas.id + '\' can be reused.'); + } + const options = config.createResolver(config.chartOptionScopes(), this.getContext()); + this.platform = new (config.platform || _detectPlatform(initialCanvas))(); + this.platform.updateConfig(config); + const context = this.platform.acquireContext(initialCanvas, options.aspectRatio); + const canvas = context && context.canvas; + const height = canvas && canvas.height; + const width = canvas && canvas.width; + this.id = helpers_segment.uid(); + this.ctx = context; + this.canvas = canvas; + this.width = width; + this.height = height; + this._options = options; + this._aspectRatio = this.aspectRatio; + this._layers = []; + this._metasets = []; + this._stacks = undefined; + this.boxes = []; + this.currentDevicePixelRatio = undefined; + this.chartArea = undefined; + this._active = []; + this._lastEvent = undefined; + this._listeners = {}; + this._responsiveListeners = undefined; + this._sortedMetasets = []; + this.scales = {}; + this._plugins = new PluginService(); + this.$proxies = {}; + this._hiddenIndices = {}; + this.attached = false; + this._animationsDisabled = undefined; + this.$context = undefined; + this._doResize = helpers_segment.debounce((mode)=>this.update(mode), options.resizeDelay || 0); + this._dataChanges = []; + instances[this.id] = this; + if (!context || !canvas) { + console.error("Failed to create chart: can't acquire context from the given item"); + return; + } + animator.listen(this, 'complete', onAnimationsComplete); + animator.listen(this, 'progress', onAnimationProgress); + this._initialize(); + if (this.attached) { + this.update(); + } + } + get aspectRatio() { + const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this; + if (!helpers_segment.isNullOrUndef(aspectRatio)) { + return aspectRatio; + } + if (maintainAspectRatio && _aspectRatio) { + return _aspectRatio; + } + return height ? width / height : null; + } + get data() { + return this.config.data; + } + set data(data) { + this.config.data = data; + } + get options() { + return this._options; + } + set options(options) { + this.config.options = options; + } + get registry() { + return registry; + } + _initialize() { + this.notifyPlugins('beforeInit'); + if (this.options.responsive) { + this.resize(); + } else { + helpers_segment.retinaScale(this, this.options.devicePixelRatio); + } + this.bindEvents(); + this.notifyPlugins('afterInit'); + return this; + } + clear() { + helpers_segment.clearCanvas(this.canvas, this.ctx); + return this; + } + stop() { + animator.stop(this); + return this; + } + resize(width, height) { + if (!animator.running(this)) { + this._resize(width, height); + } else { + this._resizeBeforeDraw = { + width, + height + }; + } + } + _resize(width, height) { + const options = this.options; + const canvas = this.canvas; + const aspectRatio = options.maintainAspectRatio && this.aspectRatio; + const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio); + const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio(); + const mode = this.width ? 'resize' : 'attach'; + this.width = newSize.width; + this.height = newSize.height; + this._aspectRatio = this.aspectRatio; + if (!helpers_segment.retinaScale(this, newRatio, true)) { + return; + } + this.notifyPlugins('resize', { + size: newSize + }); + helpers_segment.callback(options.onResize, [ + this, + newSize + ], this); + if (this.attached) { + if (this._doResize(mode)) { + this.render(); + } + } + } + ensureScalesHaveIDs() { + const options = this.options; + const scalesOptions = options.scales || {}; + helpers_segment.each(scalesOptions, (axisOptions, axisID)=>{ + axisOptions.id = axisID; + }); + } + buildOrUpdateScales() { + const options = this.options; + const scaleOpts = options.scales; + const scales = this.scales; + const updated = Object.keys(scales).reduce((obj, id)=>{ + obj[id] = false; + return obj; + }, {}); + let items = []; + if (scaleOpts) { + items = items.concat(Object.keys(scaleOpts).map((id)=>{ + const scaleOptions = scaleOpts[id]; + const axis = determineAxis(id, scaleOptions); + const isRadial = axis === 'r'; + const isHorizontal = axis === 'x'; + return { + options: scaleOptions, + dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left', + dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear' + }; + })); + } + helpers_segment.each(items, (item)=>{ + const scaleOptions = item.options; + const id = scaleOptions.id; + const axis = determineAxis(id, scaleOptions); + const scaleType = helpers_segment.valueOrDefault(scaleOptions.type, item.dtype); + if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) { + scaleOptions.position = item.dposition; + } + updated[id] = true; + let scale = null; + if (id in scales && scales[id].type === scaleType) { + scale = scales[id]; + } else { + const scaleClass = registry.getScale(scaleType); + scale = new scaleClass({ + id, + type: scaleType, + ctx: this.ctx, + chart: this + }); + scales[scale.id] = scale; + } + scale.init(scaleOptions, options); + }); + helpers_segment.each(updated, (hasUpdated, id)=>{ + if (!hasUpdated) { + delete scales[id]; + } + }); + helpers_segment.each(scales, (scale)=>{ + layouts.configure(this, scale, scale.options); + layouts.addBox(this, scale); + }); + } + _updateMetasets() { + const metasets = this._metasets; + const numData = this.data.datasets.length; + const numMeta = metasets.length; + metasets.sort((a, b)=>a.index - b.index); + if (numMeta > numData) { + for(let i = numData; i < numMeta; ++i){ + this._destroyDatasetMeta(i); + } + metasets.splice(numData, numMeta - numData); + } + this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index')); + } + _removeUnreferencedMetasets() { + const { _metasets: metasets , data: { datasets } } = this; + if (metasets.length > datasets.length) { + delete this._stacks; + } + metasets.forEach((meta, index)=>{ + if (datasets.filter((x)=>x === meta._dataset).length === 0) { + this._destroyDatasetMeta(index); + } + }); + } + buildOrUpdateControllers() { + const newControllers = []; + const datasets = this.data.datasets; + let i, ilen; + this._removeUnreferencedMetasets(); + for(i = 0, ilen = datasets.length; i < ilen; i++){ + const dataset = datasets[i]; + let meta = this.getDatasetMeta(i); + const type = dataset.type || this.config.type; + if (meta.type && meta.type !== type) { + this._destroyDatasetMeta(i); + meta = this.getDatasetMeta(i); + } + meta.type = type; + meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options); + meta.order = dataset.order || 0; + meta.index = i; + meta.label = '' + dataset.label; + meta.visible = this.isDatasetVisible(i); + if (meta.controller) { + meta.controller.updateIndex(i); + meta.controller.linkScales(); + } else { + const ControllerClass = registry.getController(type); + const { datasetElementType , dataElementType } = helpers_segment.defaults.datasets[type]; + Object.assign(ControllerClass, { + dataElementType: registry.getElement(dataElementType), + datasetElementType: datasetElementType && registry.getElement(datasetElementType) + }); + meta.controller = new ControllerClass(this, i); + newControllers.push(meta.controller); + } + } + this._updateMetasets(); + return newControllers; + } + _resetElements() { + helpers_segment.each(this.data.datasets, (dataset, datasetIndex)=>{ + this.getDatasetMeta(datasetIndex).controller.reset(); + }, this); + } + reset() { + this._resetElements(); + this.notifyPlugins('reset'); + } + update(mode) { + const config = this.config; + config.update(); + const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext()); + const animsDisabled = this._animationsDisabled = !options.animation; + this._updateScales(); + this._checkEventBindings(); + this._updateHiddenIndices(); + this._plugins.invalidate(); + if (this.notifyPlugins('beforeUpdate', { + mode, + cancelable: true + }) === false) { + return; + } + const newControllers = this.buildOrUpdateControllers(); + this.notifyPlugins('beforeElementsUpdate'); + let minPadding = 0; + for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){ + const { controller } = this.getDatasetMeta(i); + const reset = !animsDisabled && newControllers.indexOf(controller) === -1; + controller.buildOrUpdateElements(reset); + minPadding = Math.max(+controller.getMaxOverflow(), minPadding); + } + minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0; + this._updateLayout(minPadding); + if (!animsDisabled) { + helpers_segment.each(newControllers, (controller)=>{ + controller.reset(); + }); + } + this._updateDatasets(mode); + this.notifyPlugins('afterUpdate', { + mode + }); + this._layers.sort(compare2Level('z', '_idx')); + const { _active , _lastEvent } = this; + if (_lastEvent) { + this._eventHandler(_lastEvent, true); + } else if (_active.length) { + this._updateHoverStyles(_active, _active, true); + } + this.render(); + } + _updateScales() { + helpers_segment.each(this.scales, (scale)=>{ + layouts.removeBox(this, scale); + }); + this.ensureScalesHaveIDs(); + this.buildOrUpdateScales(); + } + _checkEventBindings() { + const options = this.options; + const existingEvents = new Set(Object.keys(this._listeners)); + const newEvents = new Set(options.events); + if (!helpers_segment.setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) { + this.unbindEvents(); + this.bindEvents(); + } + } + _updateHiddenIndices() { + const { _hiddenIndices } = this; + const changes = this._getUniformDataChanges() || []; + for (const { method , start , count } of changes){ + const move = method === '_removeElements' ? -count : count; + moveNumericKeys(_hiddenIndices, start, move); + } + } + _getUniformDataChanges() { + const _dataChanges = this._dataChanges; + if (!_dataChanges || !_dataChanges.length) { + return; + } + this._dataChanges = []; + const datasetCount = this.data.datasets.length; + const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(','))); + const changeSet = makeSet(0); + for(let i = 1; i < datasetCount; i++){ + if (!helpers_segment.setsEqual(changeSet, makeSet(i))) { + return; + } + } + return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({ + method: a[1], + start: +a[2], + count: +a[3] + })); + } + _updateLayout(minPadding) { + if (this.notifyPlugins('beforeLayout', { + cancelable: true + }) === false) { + return; + } + layouts.update(this, this.width, this.height, minPadding); + const area = this.chartArea; + const noArea = area.width <= 0 || area.height <= 0; + this._layers = []; + helpers_segment.each(this.boxes, (box)=>{ + if (noArea && box.position === 'chartArea') { + return; + } + if (box.configure) { + box.configure(); + } + this._layers.push(...box._layers()); + }, this); + this._layers.forEach((item, index)=>{ + item._idx = index; + }); + this.notifyPlugins('afterLayout'); + } + _updateDatasets(mode) { + if (this.notifyPlugins('beforeDatasetsUpdate', { + mode, + cancelable: true + }) === false) { + return; + } + for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this.getDatasetMeta(i).controller.configure(); + } + for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this._updateDataset(i, helpers_segment.isFunction(mode) ? mode({ + datasetIndex: i + }) : mode); + } + this.notifyPlugins('afterDatasetsUpdate', { + mode + }); + } + _updateDataset(index, mode) { + const meta = this.getDatasetMeta(index); + const args = { + meta, + index, + mode, + cancelable: true + }; + if (this.notifyPlugins('beforeDatasetUpdate', args) === false) { + return; + } + meta.controller._update(mode); + args.cancelable = false; + this.notifyPlugins('afterDatasetUpdate', args); + } + render() { + if (this.notifyPlugins('beforeRender', { + cancelable: true + }) === false) { + return; + } + if (animator.has(this)) { + if (this.attached && !animator.running(this)) { + animator.start(this); + } + } else { + this.draw(); + onAnimationsComplete({ + chart: this + }); + } + } + draw() { + let i; + if (this._resizeBeforeDraw) { + const { width , height } = this._resizeBeforeDraw; + this._resizeBeforeDraw = null; + this._resize(width, height); + } + this.clear(); + if (this.width <= 0 || this.height <= 0) { + return; + } + if (this.notifyPlugins('beforeDraw', { + cancelable: true + }) === false) { + return; + } + const layers = this._layers; + for(i = 0; i < layers.length && layers[i].z <= 0; ++i){ + layers[i].draw(this.chartArea); + } + this._drawDatasets(); + for(; i < layers.length; ++i){ + layers[i].draw(this.chartArea); + } + this.notifyPlugins('afterDraw'); + } + _getSortedDatasetMetas(filterVisible) { + const metasets = this._sortedMetasets; + const result = []; + let i, ilen; + for(i = 0, ilen = metasets.length; i < ilen; ++i){ + const meta = metasets[i]; + if (!filterVisible || meta.visible) { + result.push(meta); + } + } + return result; + } + getSortedVisibleDatasetMetas() { + return this._getSortedDatasetMetas(true); + } + _drawDatasets() { + if (this.notifyPlugins('beforeDatasetsDraw', { + cancelable: true + }) === false) { + return; + } + const metasets = this.getSortedVisibleDatasetMetas(); + for(let i = metasets.length - 1; i >= 0; --i){ + this._drawDataset(metasets[i]); + } + this.notifyPlugins('afterDatasetsDraw'); + } + _drawDataset(meta) { + const ctx = this.ctx; + const clip = meta._clip; + const useClip = !clip.disabled; + const area = getDatasetArea(meta, this.chartArea); + const args = { + meta, + index: meta.index, + cancelable: true + }; + if (this.notifyPlugins('beforeDatasetDraw', args) === false) { + return; + } + if (useClip) { + helpers_segment.clipArea(ctx, { + left: clip.left === false ? 0 : area.left - clip.left, + right: clip.right === false ? this.width : area.right + clip.right, + top: clip.top === false ? 0 : area.top - clip.top, + bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom + }); + } + meta.controller.draw(); + if (useClip) { + helpers_segment.unclipArea(ctx); + } + args.cancelable = false; + this.notifyPlugins('afterDatasetDraw', args); + } + isPointInArea(point) { + return helpers_segment._isPointInArea(point, this.chartArea, this._minPadding); + } + getElementsAtEventForMode(e, mode, options, useFinalPosition) { + const method = Interaction.modes[mode]; + if (typeof method === 'function') { + return method(this, e, options, useFinalPosition); + } + return []; + } + getDatasetMeta(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + const metasets = this._metasets; + let meta = metasets.filter((x)=>x && x._dataset === dataset).pop(); + if (!meta) { + meta = { + type: null, + data: [], + dataset: null, + controller: null, + hidden: null, + xAxisID: null, + yAxisID: null, + order: dataset && dataset.order || 0, + index: datasetIndex, + _dataset: dataset, + _parsed: [], + _sorted: false + }; + metasets.push(meta); + } + return meta; + } + getContext() { + return this.$context || (this.$context = helpers_segment.createContext(null, { + chart: this, + type: 'chart' + })); + } + getVisibleDatasetCount() { + return this.getSortedVisibleDatasetMetas().length; + } + isDatasetVisible(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + if (!dataset) { + return false; + } + const meta = this.getDatasetMeta(datasetIndex); + return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden; + } + setDatasetVisibility(datasetIndex, visible) { + const meta = this.getDatasetMeta(datasetIndex); + meta.hidden = !visible; + } + toggleDataVisibility(index) { + this._hiddenIndices[index] = !this._hiddenIndices[index]; + } + getDataVisibility(index) { + return !this._hiddenIndices[index]; + } + _updateVisibility(datasetIndex, dataIndex, visible) { + const mode = visible ? 'show' : 'hide'; + const meta = this.getDatasetMeta(datasetIndex); + const anims = meta.controller._resolveAnimations(undefined, mode); + if (helpers_segment.defined(dataIndex)) { + meta.data[dataIndex].hidden = !visible; + this.update(); + } else { + this.setDatasetVisibility(datasetIndex, visible); + anims.update(meta, { + visible + }); + this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined); + } + } + hide(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, false); + } + show(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, true); + } + _destroyDatasetMeta(datasetIndex) { + const meta = this._metasets[datasetIndex]; + if (meta && meta.controller) { + meta.controller._destroy(); + } + delete this._metasets[datasetIndex]; + } + _stop() { + let i, ilen; + this.stop(); + animator.remove(this); + for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this._destroyDatasetMeta(i); + } + } + destroy() { + this.notifyPlugins('beforeDestroy'); + const { canvas , ctx } = this; + this._stop(); + this.config.clearCache(); + if (canvas) { + this.unbindEvents(); + helpers_segment.clearCanvas(canvas, ctx); + this.platform.releaseContext(ctx); + this.canvas = null; + this.ctx = null; + } + delete instances[this.id]; + this.notifyPlugins('afterDestroy'); + } + toBase64Image(...args) { + return this.canvas.toDataURL(...args); + } + bindEvents() { + this.bindUserEvents(); + if (this.options.responsive) { + this.bindResponsiveEvents(); + } else { + this.attached = true; + } + } + bindUserEvents() { + const listeners = this._listeners; + const platform = this.platform; + const _add = (type, listener)=>{ + platform.addEventListener(this, type, listener); + listeners[type] = listener; + }; + const listener = (e, x, y)=>{ + e.offsetX = x; + e.offsetY = y; + this._eventHandler(e); + }; + helpers_segment.each(this.options.events, (type)=>_add(type, listener)); + } + bindResponsiveEvents() { + if (!this._responsiveListeners) { + this._responsiveListeners = {}; + } + const listeners = this._responsiveListeners; + const platform = this.platform; + const _add = (type, listener)=>{ + platform.addEventListener(this, type, listener); + listeners[type] = listener; + }; + const _remove = (type, listener)=>{ + if (listeners[type]) { + platform.removeEventListener(this, type, listener); + delete listeners[type]; + } + }; + const listener = (width, height)=>{ + if (this.canvas) { + this.resize(width, height); + } + }; + let detached; + const attached = ()=>{ + _remove('attach', attached); + this.attached = true; + this.resize(); + _add('resize', listener); + _add('detach', detached); + }; + detached = ()=>{ + this.attached = false; + _remove('resize', listener); + this._stop(); + this._resize(0, 0); + _add('attach', attached); + }; + if (platform.isAttached(this.canvas)) { + attached(); + } else { + detached(); + } + } + unbindEvents() { + helpers_segment.each(this._listeners, (listener, type)=>{ + this.platform.removeEventListener(this, type, listener); + }); + this._listeners = {}; + helpers_segment.each(this._responsiveListeners, (listener, type)=>{ + this.platform.removeEventListener(this, type, listener); + }); + this._responsiveListeners = undefined; + } + updateHoverStyle(items, mode, enabled) { + const prefix = enabled ? 'set' : 'remove'; + let meta, item, i, ilen; + if (mode === 'dataset') { + meta = this.getDatasetMeta(items[0].datasetIndex); + meta.controller['_' + prefix + 'DatasetHoverStyle'](); + } + for(i = 0, ilen = items.length; i < ilen; ++i){ + item = items[i]; + const controller = item && this.getDatasetMeta(item.datasetIndex).controller; + if (controller) { + controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index); + } + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements) { + const lastActive = this._active || []; + const active = activeElements.map(({ datasetIndex , index })=>{ + const meta = this.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error('No dataset found at index ' + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index], + index + }; + }); + const changed = !helpers_segment._elementsEqual(active, lastActive); + if (changed) { + this._active = active; + this._lastEvent = null; + this._updateHoverStyles(active, lastActive); + } + } + notifyPlugins(hook, args, filter) { + return this._plugins.notify(this, hook, args, filter); + } + isPluginEnabled(pluginId) { + return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1; + } + _updateHoverStyles(active, lastActive, replay) { + const hoverOptions = this.options.hover; + const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index)); + const deactivated = diff(lastActive, active); + const activated = replay ? active : diff(active, lastActive); + if (deactivated.length) { + this.updateHoverStyle(deactivated, hoverOptions.mode, false); + } + if (activated.length && hoverOptions.mode) { + this.updateHoverStyle(activated, hoverOptions.mode, true); + } + } + _eventHandler(e, replay) { + const args = { + event: e, + replay, + cancelable: true, + inChartArea: this.isPointInArea(e) + }; + const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type); + if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) { + return; + } + const changed = this._handleEvent(e, replay, args.inChartArea); + args.cancelable = false; + this.notifyPlugins('afterEvent', args, eventFilter); + if (changed || args.changed) { + this.render(); + } + return this; + } + _handleEvent(e, replay, inChartArea) { + const { _active: lastActive = [] , options } = this; + const useFinalPosition = replay; + const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition); + const isClick = helpers_segment._isClickEvent(e); + const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick); + if (inChartArea) { + this._lastEvent = null; + helpers_segment.callback(options.onHover, [ + e, + active, + this + ], this); + if (isClick) { + helpers_segment.callback(options.onClick, [ + e, + active, + this + ], this); + } + } + const changed = !helpers_segment._elementsEqual(active, lastActive); + if (changed || replay) { + this._active = active; + this._updateHoverStyles(active, lastActive, replay); + } + this._lastEvent = lastEvent; + return changed; + } + _getActiveElements(e, lastActive, inChartArea, useFinalPosition) { + if (e.type === 'mouseout') { + return []; + } + if (!inChartArea) { + return lastActive; + } + const hoverOptions = this.options.hover; + return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition); + } +} +function invalidatePlugins() { + return helpers_segment.each(Chart.instances, (chart)=>chart._plugins.invalidate()); +} + +function clipArc(ctx, element, endAngle) { + const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element; + let angleMargin = pixelMargin / outerRadius; + // Draw an inner border by clipping the arc and drawing a double-width border + // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders + ctx.beginPath(); + ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin); + if (innerRadius > pixelMargin) { + angleMargin = pixelMargin / innerRadius; + ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true); + } else { + ctx.arc(x, y, pixelMargin, endAngle + helpers_segment.HALF_PI, startAngle - helpers_segment.HALF_PI); + } + ctx.closePath(); + ctx.clip(); +} +function toRadiusCorners(value) { + return helpers_segment._readValueToProps(value, [ + 'outerStart', + 'outerEnd', + 'innerStart', + 'innerEnd' + ]); +} +/** + * Parse border radius from the provided options + */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) { + const o = toRadiusCorners(arc.options.borderRadius); + const halfThickness = (outerRadius - innerRadius) / 2; + const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2); + // Outer limits are complicated. We want to compute the available angular distance at + // a radius of outerRadius - borderRadius because for small angular distances, this term limits. + // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners. + // + // If the borderRadius is large, that value can become negative. + // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius + // we know that the thickness term will dominate and compute the limits at that point + const computeOuterLimit = (val)=>{ + const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2; + return helpers_segment._limitValue(val, 0, Math.min(halfThickness, outerArcLimit)); + }; + return { + outerStart: computeOuterLimit(o.outerStart), + outerEnd: computeOuterLimit(o.outerEnd), + innerStart: helpers_segment._limitValue(o.innerStart, 0, innerLimit), + innerEnd: helpers_segment._limitValue(o.innerEnd, 0, innerLimit) + }; +} +/** + * Convert (r, 𝜃) to (x, y) + */ function rThetaToXY(r, theta, x, y) { + return { + x: x + r * Math.cos(theta), + y: y + r * Math.sin(theta) + }; +} +/** + * Path the arc, respecting border radius by separating into left and right halves. + * + * Start End + * + * 1--->a--->2 Outer + * / \ + * 8 3 + * | | + * | | + * 7 4 + * \ / + * 6<---b<---5 Inner + */ function pathArc(ctx, element, offset, spacing, end, circular) { + const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element; + const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0); + const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0; + let spacingOffset = 0; + const alpha = end - start; + if (spacing) { + // When spacing is present, it is the same for all items + // So we adjust the start and end angle of the arc such that + // the distance is the same as it would be without the spacing + const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0; + const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0; + const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2; + const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha; + spacingOffset = (alpha - adjustedAngle) / 2; + } + const beta = Math.max(0.001, alpha * outerRadius - offset / helpers_segment.PI) / outerRadius; + const angleOffset = (alpha - beta) / 2; + const startAngle = start + angleOffset + spacingOffset; + const endAngle = end - angleOffset - spacingOffset; + const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle); + const outerStartAdjustedRadius = outerRadius - outerStart; + const outerEndAdjustedRadius = outerRadius - outerEnd; + const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius; + const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius; + const innerStartAdjustedRadius = innerRadius + innerStart; + const innerEndAdjustedRadius = innerRadius + innerEnd; + const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius; + const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius; + ctx.beginPath(); + if (circular) { + // The first arc segments from point 1 to point a to point 2 + const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2; + ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle); + ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle); + // The corner segment from point 2 to point 3 + if (outerEnd > 0) { + const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + helpers_segment.HALF_PI); + } + // The line from point 3 to point 4 + const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y); + ctx.lineTo(p4.x, p4.y); + // The corner segment from point 4 to point 5 + if (innerEnd > 0) { + const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + helpers_segment.HALF_PI, innerEndAdjustedAngle + Math.PI); + } + // The inner arc from point 5 to point b to point 6 + const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2; + ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true); + ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true); + // The corner segment from point 6 to point 7 + if (innerStart > 0) { + const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - helpers_segment.HALF_PI); + } + // The line from point 7 to point 8 + const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y); + ctx.lineTo(p8.x, p8.y); + // The corner segment from point 8 to point 1 + if (outerStart > 0) { + const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - helpers_segment.HALF_PI, outerStartAdjustedAngle); + } + } else { + ctx.moveTo(x, y); + const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x; + const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerStartX, outerStartY); + const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x; + const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerEndX, outerEndY); + } + ctx.closePath(); +} +function drawArc(ctx, element, offset, spacing, circular) { + const { fullCircles , startAngle , circumference } = element; + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for(let i = 0; i < fullCircles; ++i){ + ctx.fill(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % helpers_segment.TAU || helpers_segment.TAU); + } + } + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.fill(); + return endAngle; +} +function drawBorder(ctx, element, offset, spacing, circular) { + const { fullCircles , startAngle , circumference , options } = element; + const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options; + const inner = options.borderAlign === 'inner'; + if (!borderWidth) { + return; + } + ctx.setLineDash(borderDash || []); + ctx.lineDashOffset = borderDashOffset; + if (inner) { + ctx.lineWidth = borderWidth * 2; + ctx.lineJoin = borderJoinStyle || 'round'; + } else { + ctx.lineWidth = borderWidth; + ctx.lineJoin = borderJoinStyle || 'bevel'; + } + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for(let i = 0; i < fullCircles; ++i){ + ctx.stroke(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % helpers_segment.TAU || helpers_segment.TAU); + } + } + if (inner) { + clipArc(ctx, element, endAngle); + } + if (!fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.stroke(); + } +} +class ArcElement extends Element { + static id = 'arc'; + static defaults = { + borderAlign: 'center', + borderColor: '#fff', + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: undefined, + borderRadius: 0, + borderWidth: 2, + offset: 0, + spacing: 0, + angle: undefined, + circular: true + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor' + }; + static descriptors = { + _scriptable: true, + _indexable: (name)=>name !== 'borderDash' + }; + circumference; + endAngle; + fullCircles; + innerRadius; + outerRadius; + pixelMargin; + startAngle; + constructor(cfg){ + super(); + this.options = undefined; + this.circumference = undefined; + this.startAngle = undefined; + this.endAngle = undefined; + this.innerRadius = undefined; + this.outerRadius = undefined; + this.pixelMargin = 0; + this.fullCircles = 0; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(chartX, chartY, useFinalPosition) { + const point = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + const { angle , distance } = helpers_segment.getAngleFromPoint(point, { + x: chartX, + y: chartY + }); + const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([ + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius', + 'circumference' + ], useFinalPosition); + const rAdjust = (this.options.spacing + this.options.borderWidth) / 2; + const _circumference = helpers_segment.valueOrDefault(circumference, endAngle - startAngle); + const nonZeroBetween = helpers_segment._angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle; + const betweenAngles = _circumference >= helpers_segment.TAU || nonZeroBetween; + const withinRadius = helpers_segment._isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust); + return betweenAngles && withinRadius; + } + getCenterPoint(useFinalPosition) { + const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([ + 'x', + 'y', + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius' + ], useFinalPosition); + const { offset , spacing } = this.options; + const halfAngle = (startAngle + endAngle) / 2; + const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2; + return { + x: x + Math.cos(halfAngle) * halfRadius, + y: y + Math.sin(halfAngle) * halfRadius + }; + } + tooltipPosition(useFinalPosition) { + return this.getCenterPoint(useFinalPosition); + } + draw(ctx) { + const { options , circumference } = this; + const offset = (options.offset || 0) / 4; + const spacing = (options.spacing || 0) / 2; + const circular = options.circular; + this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0; + this.fullCircles = circumference > helpers_segment.TAU ? Math.floor(circumference / helpers_segment.TAU) : 0; + if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) { + return; + } + ctx.save(); + const halfAngle = (this.startAngle + this.endAngle) / 2; + ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset); + const fix = 1 - Math.sin(Math.min(helpers_segment.PI, circumference || 0)); + const radiusOffset = offset * fix; + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + drawArc(ctx, this, radiusOffset, spacing, circular); + drawBorder(ctx, this, radiusOffset, spacing, circular); + ctx.restore(); + } +} + +function setStyle(ctx, options, style = options) { + ctx.lineCap = helpers_segment.valueOrDefault(style.borderCapStyle, options.borderCapStyle); + ctx.setLineDash(helpers_segment.valueOrDefault(style.borderDash, options.borderDash)); + ctx.lineDashOffset = helpers_segment.valueOrDefault(style.borderDashOffset, options.borderDashOffset); + ctx.lineJoin = helpers_segment.valueOrDefault(style.borderJoinStyle, options.borderJoinStyle); + ctx.lineWidth = helpers_segment.valueOrDefault(style.borderWidth, options.borderWidth); + ctx.strokeStyle = helpers_segment.valueOrDefault(style.borderColor, options.borderColor); +} +function lineTo(ctx, previous, target) { + ctx.lineTo(target.x, target.y); +} + function getLineMethod(options) { + if (options.stepped) { + return helpers_segment._steppedLineTo; + } + if (options.tension || options.cubicInterpolationMode === 'monotone') { + return helpers_segment._bezierCurveTo; + } + return lineTo; +} +function pathVars(points, segment, params = {}) { + const count = points.length; + const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params; + const { start: segmentStart , end: segmentEnd } = segment; + const start = Math.max(paramsStart, segmentStart); + const end = Math.min(paramsEnd, segmentEnd); + const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd; + return { + count, + start, + loop: segment.loop, + ilen: end < start && !outside ? count + end - start : end - start + }; +} + function pathSegment(ctx, line, segment, params) { + const { points , options } = line; + const { count , start , loop , ilen } = pathVars(points, segment, params); + const lineMethod = getLineMethod(options); + let { move =true , reverse } = params || {}; + let i, point, prev; + for(i = 0; i <= ilen; ++i){ + point = points[(start + (reverse ? ilen - i : i)) % count]; + if (point.skip) { + continue; + } else if (move) { + ctx.moveTo(point.x, point.y); + move = false; + } else { + lineMethod(ctx, prev, point, reverse, options.stepped); + } + prev = point; + } + if (loop) { + point = points[(start + (reverse ? ilen : 0)) % count]; + lineMethod(ctx, prev, point, reverse, options.stepped); + } + return !!loop; +} + function fastPathSegment(ctx, line, segment, params) { + const points = line.points; + const { count , start , ilen } = pathVars(points, segment, params); + const { move =true , reverse } = params || {}; + let avgX = 0; + let countX = 0; + let i, point, prevX, minY, maxY, lastY; + const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count; + const drawX = ()=>{ + if (minY !== maxY) { + ctx.lineTo(avgX, maxY); + ctx.lineTo(avgX, minY); + ctx.lineTo(avgX, lastY); + } + }; + if (move) { + point = points[pointIndex(0)]; + ctx.moveTo(point.x, point.y); + } + for(i = 0; i <= ilen; ++i){ + point = points[pointIndex(i)]; + if (point.skip) { + continue; + } + const x = point.x; + const y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + } else if (y > maxY) { + maxY = y; + } + avgX = (countX * avgX + x) / ++countX; + } else { + drawX(); + ctx.lineTo(x, y); + prevX = truncX; + countX = 0; + minY = maxY = y; + } + lastY = y; + } + drawX(); +} + function _getSegmentMethod(line) { + const opts = line.options; + const borderDash = opts.borderDash && opts.borderDash.length; + const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash; + return useFastPath ? fastPathSegment : pathSegment; +} + function _getInterpolationMethod(options) { + if (options.stepped) { + return helpers_segment._steppedInterpolation; + } + if (options.tension || options.cubicInterpolationMode === 'monotone') { + return helpers_segment._bezierInterpolation; + } + return helpers_segment._pointInLine; +} +function strokePathWithCache(ctx, line, start, count) { + let path = line._path; + if (!path) { + path = line._path = new Path2D(); + if (line.path(path, start, count)) { + path.closePath(); + } + } + setStyle(ctx, line.options); + ctx.stroke(path); +} +function strokePathDirect(ctx, line, start, count) { + const { segments , options } = line; + const segmentMethod = _getSegmentMethod(line); + for (const segment of segments){ + setStyle(ctx, options, segment.style); + ctx.beginPath(); + if (segmentMethod(ctx, line, segment, { + start, + end: start + count - 1 + })) { + ctx.closePath(); + } + ctx.stroke(); + } +} +const usePath2D = typeof Path2D === 'function'; +function draw(ctx, line, start, count) { + if (usePath2D && !line.options.segment) { + strokePathWithCache(ctx, line, start, count); + } else { + strokePathDirect(ctx, line, start, count); + } +} +class LineElement extends Element { + static id = 'line'; + static defaults = { + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: 'miter', + borderWidth: 3, + capBezierPoints: true, + cubicInterpolationMode: 'default', + fill: false, + spanGaps: false, + stepped: false, + tension: 0 + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + static descriptors = { + _scriptable: true, + _indexable: (name)=>name !== 'borderDash' && name !== 'fill' + }; + constructor(cfg){ + super(); + this.animated = true; + this.options = undefined; + this._chart = undefined; + this._loop = undefined; + this._fullLoop = undefined; + this._path = undefined; + this._points = undefined; + this._segments = undefined; + this._decimated = false; + this._pointsUpdated = false; + this._datasetIndex = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + updateControlPoints(chartArea, indexAxis) { + const options = this.options; + if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) { + const loop = options.spanGaps ? this._loop : this._fullLoop; + helpers_segment._updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis); + this._pointsUpdated = true; + } + } + set points(points) { + this._points = points; + delete this._segments; + delete this._path; + this._pointsUpdated = false; + } + get points() { + return this._points; + } + get segments() { + return this._segments || (this._segments = helpers_segment._computeSegments(this, this.options.segment)); + } + first() { + const segments = this.segments; + const points = this.points; + return segments.length && points[segments[0].start]; + } + last() { + const segments = this.segments; + const points = this.points; + const count = segments.length; + return count && points[segments[count - 1].end]; + } + interpolate(point, property) { + const options = this.options; + const value = point[property]; + const points = this.points; + const segments = helpers_segment._boundSegments(this, { + property, + start: value, + end: value + }); + if (!segments.length) { + return; + } + const result = []; + const _interpolate = _getInterpolationMethod(options); + let i, ilen; + for(i = 0, ilen = segments.length; i < ilen; ++i){ + const { start , end } = segments[i]; + const p1 = points[start]; + const p2 = points[end]; + if (p1 === p2) { + result.push(p1); + continue; + } + const t = Math.abs((value - p1[property]) / (p2[property] - p1[property])); + const interpolated = _interpolate(p1, p2, t, options.stepped); + interpolated[property] = point[property]; + result.push(interpolated); + } + return result.length === 1 ? result[0] : result; + } + pathSegment(ctx, segment, params) { + const segmentMethod = _getSegmentMethod(this); + return segmentMethod(ctx, this, segment, params); + } + path(ctx, start, count) { + const segments = this.segments; + const segmentMethod = _getSegmentMethod(this); + let loop = this._loop; + start = start || 0; + count = count || this.points.length - start; + for (const segment of segments){ + loop &= segmentMethod(ctx, this, segment, { + start, + end: start + count - 1 + }); + } + return !!loop; + } + draw(ctx, chartArea, start, count) { + const options = this.options || {}; + const points = this.points || []; + if (points.length && options.borderWidth) { + ctx.save(); + draw(ctx, this, start, count); + ctx.restore(); + } + if (this.animated) { + this._pointsUpdated = false; + this._path = undefined; + } + } +} + +function inRange$1(el, pos, axis, useFinalPosition) { + const options = el.options; + const { [axis]: value } = el.getProps([ + axis + ], useFinalPosition); + return Math.abs(pos - value) < options.radius + options.hitRadius; +} +class PointElement extends Element { + static id = 'point'; + parsed; + skip; + stop; + /** + * @type {any} + */ static defaults = { + borderWidth: 1, + hitRadius: 1, + hoverBorderWidth: 1, + hoverRadius: 4, + pointStyle: 'circle', + radius: 3, + rotation: 0 + }; + /** + * @type {any} + */ static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + constructor(cfg){ + super(); + this.options = undefined; + this.parsed = undefined; + this.skip = undefined; + this.stop = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(mouseX, mouseY, useFinalPosition) { + const options = this.options; + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2); + } + inXRange(mouseX, useFinalPosition) { + return inRange$1(this, mouseX, 'x', useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange$1(this, mouseY, 'y', useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return { + x, + y + }; + } + size(options) { + options = options || this.options || {}; + let radius = options.radius || 0; + radius = Math.max(radius, radius && options.hoverRadius || 0); + const borderWidth = radius && options.borderWidth || 0; + return (radius + borderWidth) * 2; + } + draw(ctx, area) { + const options = this.options; + if (this.skip || options.radius < 0.1 || !helpers_segment._isPointInArea(this, area, this.size(options) / 2)) { + return; + } + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.fillStyle = options.backgroundColor; + helpers_segment.drawPoint(ctx, options, this.x, this.y); + } + getRange() { + const options = this.options || {}; + // @ts-expect-error Fallbacks should never be hit in practice + return options.radius + options.hitRadius; + } +} + +function getBarBounds(bar, useFinalPosition) { + const { x , y , base , width , height } = bar.getProps([ + 'x', + 'y', + 'base', + 'width', + 'height' + ], useFinalPosition); + let left, right, top, bottom, half; + if (bar.horizontal) { + half = height / 2; + left = Math.min(x, base); + right = Math.max(x, base); + top = y - half; + bottom = y + half; + } else { + half = width / 2; + left = x - half; + right = x + half; + top = Math.min(y, base); + bottom = Math.max(y, base); + } + return { + left, + top, + right, + bottom + }; +} +function skipOrLimit(skip, value, min, max) { + return skip ? 0 : helpers_segment._limitValue(value, min, max); +} +function parseBorderWidth(bar, maxW, maxH) { + const value = bar.options.borderWidth; + const skip = bar.borderSkipped; + const o = helpers_segment.toTRBL(value); + return { + t: skipOrLimit(skip.top, o.top, 0, maxH), + r: skipOrLimit(skip.right, o.right, 0, maxW), + b: skipOrLimit(skip.bottom, o.bottom, 0, maxH), + l: skipOrLimit(skip.left, o.left, 0, maxW) + }; +} +function parseBorderRadius(bar, maxW, maxH) { + const { enableBorderRadius } = bar.getProps([ + 'enableBorderRadius' + ]); + const value = bar.options.borderRadius; + const o = helpers_segment.toTRBLCorners(value); + const maxR = Math.min(maxW, maxH); + const skip = bar.borderSkipped; + const enableBorder = enableBorderRadius || helpers_segment.isObject(value); + return { + topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR), + topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR), + bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR), + bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR) + }; +} +function boundingRects(bar) { + const bounds = getBarBounds(bar); + const width = bounds.right - bounds.left; + const height = bounds.bottom - bounds.top; + const border = parseBorderWidth(bar, width / 2, height / 2); + const radius = parseBorderRadius(bar, width / 2, height / 2); + return { + outer: { + x: bounds.left, + y: bounds.top, + w: width, + h: height, + radius + }, + inner: { + x: bounds.left + border.l, + y: bounds.top + border.t, + w: width - border.l - border.r, + h: height - border.t - border.b, + radius: { + topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)), + topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)), + bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)), + bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)) + } + } + }; +} +function inRange(bar, x, y, useFinalPosition) { + const skipX = x === null; + const skipY = y === null; + const skipBoth = skipX && skipY; + const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition); + return bounds && (skipX || helpers_segment._isBetween(x, bounds.left, bounds.right)) && (skipY || helpers_segment._isBetween(y, bounds.top, bounds.bottom)); +} +function hasRadius(radius) { + return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight; +} + function addNormalRectPath(ctx, rect) { + ctx.rect(rect.x, rect.y, rect.w, rect.h); +} +function inflateRect(rect, amount, refRect = {}) { + const x = rect.x !== refRect.x ? -amount : 0; + const y = rect.y !== refRect.y ? -amount : 0; + const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x; + const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y; + return { + x: rect.x + x, + y: rect.y + y, + w: rect.w + w, + h: rect.h + h, + radius: rect.radius + }; +} +class BarElement extends Element { + static id = 'bar'; + static defaults = { + borderSkipped: 'start', + borderWidth: 0, + borderRadius: 0, + inflateAmount: 'auto', + pointStyle: undefined + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + constructor(cfg){ + super(); + this.options = undefined; + this.horizontal = undefined; + this.base = undefined; + this.width = undefined; + this.height = undefined; + this.inflateAmount = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + draw(ctx) { + const { inflateAmount , options: { borderColor , backgroundColor } } = this; + const { inner , outer } = boundingRects(this); + const addRectPath = hasRadius(outer.radius) ? helpers_segment.addRoundedRectPath : addNormalRectPath; + ctx.save(); + if (outer.w !== inner.w || outer.h !== inner.h) { + ctx.beginPath(); + addRectPath(ctx, inflateRect(outer, inflateAmount, inner)); + ctx.clip(); + addRectPath(ctx, inflateRect(inner, -inflateAmount, outer)); + ctx.fillStyle = borderColor; + ctx.fill('evenodd'); + } + ctx.beginPath(); + addRectPath(ctx, inflateRect(inner, inflateAmount)); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + inRange(mouseX, mouseY, useFinalPosition) { + return inRange(this, mouseX, mouseY, useFinalPosition); + } + inXRange(mouseX, useFinalPosition) { + return inRange(this, mouseX, null, useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange(this, null, mouseY, useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x , y , base , horizontal } = this.getProps([ + 'x', + 'y', + 'base', + 'horizontal' + ], useFinalPosition); + return { + x: horizontal ? (x + base) / 2 : x, + y: horizontal ? y : (y + base) / 2 + }; + } + getRange(axis) { + return axis === 'x' ? this.width / 2 : this.height / 2; + } +} + +var elements = /*#__PURE__*/Object.freeze({ +__proto__: null, +ArcElement: ArcElement, +BarElement: BarElement, +LineElement: LineElement, +PointElement: PointElement +}); + +const BORDER_COLORS = [ + 'rgb(54, 162, 235)', + 'rgb(255, 99, 132)', + 'rgb(255, 159, 64)', + 'rgb(255, 205, 86)', + 'rgb(75, 192, 192)', + 'rgb(153, 102, 255)', + 'rgb(201, 203, 207)' // grey +]; +// Border colors with 50% transparency +const BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)')); +function getBorderColor(i) { + return BORDER_COLORS[i % BORDER_COLORS.length]; +} +function getBackgroundColor(i) { + return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length]; +} +function colorizeDefaultDataset(dataset, i) { + dataset.borderColor = getBorderColor(i); + dataset.backgroundColor = getBackgroundColor(i); + return ++i; +} +function colorizeDoughnutDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++)); + return i; +} +function colorizePolarAreaDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++)); + return i; +} +function getColorizer(chart) { + let i = 0; + return (dataset, datasetIndex)=>{ + const controller = chart.getDatasetMeta(datasetIndex).controller; + if (controller instanceof DoughnutController) { + i = colorizeDoughnutDataset(dataset, i); + } else if (controller instanceof PolarAreaController) { + i = colorizePolarAreaDataset(dataset, i); + } else if (controller) { + i = colorizeDefaultDataset(dataset, i); + } + }; +} +function containsColorsDefinitions(descriptors) { + let k; + for(k in descriptors){ + if (descriptors[k].borderColor || descriptors[k].backgroundColor) { + return true; + } + } + return false; +} +function containsColorsDefinition(descriptor) { + return descriptor && (descriptor.borderColor || descriptor.backgroundColor); +} +function containsDefaultColorsDefenitions() { + return helpers_segment.defaults.borderColor !== 'rgba(0,0,0,0.1)' || helpers_segment.defaults.backgroundColor !== 'rgba(0,0,0,0.1)'; +} +var plugin_colors = { + id: 'colors', + defaults: { + enabled: true, + forceOverride: false + }, + beforeLayout (chart, _args, options) { + if (!options.enabled) { + return; + } + const { data: { datasets } , options: chartOptions } = chart.config; + const { elements } = chartOptions; + const containsColorDefenition = containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements) || containsDefaultColorsDefenitions(); + if (!options.forceOverride && containsColorDefenition) { + return; + } + const colorizer = getColorizer(chart); + datasets.forEach(colorizer); + } +}; + +function lttbDecimation(data, start, count, availableWidth, options) { + const samples = options.samples || availableWidth; + if (samples >= count) { + return data.slice(start, start + count); + } + const decimated = []; + const bucketWidth = (count - 2) / (samples - 2); + let sampledIndex = 0; + const endIndex = start + count - 1; + let a = start; + let i, maxAreaPoint, maxArea, area, nextA; + decimated[sampledIndex++] = data[a]; + for(i = 0; i < samples - 2; i++){ + let avgX = 0; + let avgY = 0; + let j; + const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start; + const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start; + const avgRangeLength = avgRangeEnd - avgRangeStart; + for(j = avgRangeStart; j < avgRangeEnd; j++){ + avgX += data[j].x; + avgY += data[j].y; + } + avgX /= avgRangeLength; + avgY /= avgRangeLength; + const rangeOffs = Math.floor(i * bucketWidth) + 1 + start; + const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start; + const { x: pointAx , y: pointAy } = data[a]; + maxArea = area = -1; + for(j = rangeOffs; j < rangeTo; j++){ + area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy)); + if (area > maxArea) { + maxArea = area; + maxAreaPoint = data[j]; + nextA = j; + } + } + decimated[sampledIndex++] = maxAreaPoint; + a = nextA; + } + decimated[sampledIndex++] = data[endIndex]; + return decimated; +} +function minMaxDecimation(data, start, count, availableWidth) { + let avgX = 0; + let countX = 0; + let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY; + const decimated = []; + const endIndex = start + count - 1; + const xMin = data[start].x; + const xMax = data[endIndex].x; + const dx = xMax - xMin; + for(i = start; i < start + count; ++i){ + point = data[i]; + x = (point.x - xMin) / dx * availableWidth; + y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + minIndex = i; + } else if (y > maxY) { + maxY = y; + maxIndex = i; + } + avgX = (countX * avgX + point.x) / ++countX; + } else { + const lastIndex = i - 1; + if (!helpers_segment.isNullOrUndef(minIndex) && !helpers_segment.isNullOrUndef(maxIndex)) { + const intermediateIndex1 = Math.min(minIndex, maxIndex); + const intermediateIndex2 = Math.max(minIndex, maxIndex); + if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex1], + x: avgX + }); + } + if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex2], + x: avgX + }); + } + } + if (i > 0 && lastIndex !== startIndex) { + decimated.push(data[lastIndex]); + } + decimated.push(point); + prevX = truncX; + countX = 0; + minY = maxY = y; + minIndex = maxIndex = startIndex = i; + } + } + return decimated; +} +function cleanDecimatedDataset(dataset) { + if (dataset._decimated) { + const data = dataset._data; + delete dataset._decimated; + delete dataset._data; + Object.defineProperty(dataset, 'data', { + configurable: true, + enumerable: true, + writable: true, + value: data + }); + } +} +function cleanDecimatedData(chart) { + chart.data.datasets.forEach((dataset)=>{ + cleanDecimatedDataset(dataset); + }); +} +function getStartAndCountOfVisiblePointsSimplified(meta, points) { + const pointCount = points.length; + let start = 0; + let count; + const { iScale } = meta; + const { min , max , minDefined , maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = helpers_segment._limitValue(helpers_segment._lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1); + } + if (maxDefined) { + count = helpers_segment._limitValue(helpers_segment._lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start; + } else { + count = pointCount - start; + } + return { + start, + count + }; +} +var plugin_decimation = { + id: 'decimation', + defaults: { + algorithm: 'min-max', + enabled: false + }, + beforeElementsUpdate: (chart, args, options)=>{ + if (!options.enabled) { + cleanDecimatedData(chart); + return; + } + const availableWidth = chart.width; + chart.data.datasets.forEach((dataset, datasetIndex)=>{ + const { _data , indexAxis } = dataset; + const meta = chart.getDatasetMeta(datasetIndex); + const data = _data || dataset.data; + if (helpers_segment.resolve([ + indexAxis, + chart.options.indexAxis + ]) === 'y') { + return; + } + if (!meta.controller.supportsDecimation) { + return; + } + const xAxis = chart.scales[meta.xAxisID]; + if (xAxis.type !== 'linear' && xAxis.type !== 'time') { + return; + } + if (chart.options.parsing) { + return; + } + let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data); + const threshold = options.threshold || 4 * availableWidth; + if (count <= threshold) { + cleanDecimatedDataset(dataset); + return; + } + if (helpers_segment.isNullOrUndef(_data)) { + dataset._data = data; + delete dataset.data; + Object.defineProperty(dataset, 'data', { + configurable: true, + enumerable: true, + get: function() { + return this._decimated; + }, + set: function(d) { + this._data = d; + } + }); + } + let decimated; + switch(options.algorithm){ + case 'lttb': + decimated = lttbDecimation(data, start, count, availableWidth, options); + break; + case 'min-max': + decimated = minMaxDecimation(data, start, count, availableWidth); + break; + default: + throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`); + } + dataset._decimated = decimated; + }); + }, + destroy (chart) { + cleanDecimatedData(chart); + } +}; + +function _segments(line, target, property) { + const segments = line.segments; + const points = line.points; + const tpoints = target.points; + const parts = []; + for (const segment of segments){ + let { start , end } = segment; + end = _findSegmentEnd(start, end, points); + const bounds = _getBounds(property, points[start], points[end], segment.loop); + if (!target.segments) { + parts.push({ + source: segment, + target: bounds, + start: points[start], + end: points[end] + }); + continue; + } + const targetSegments = helpers_segment._boundSegments(target, bounds); + for (const tgt of targetSegments){ + const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop); + const fillSources = helpers_segment._boundSegment(segment, points, subBounds); + for (const fillSource of fillSources){ + parts.push({ + source: fillSource, + target: tgt, + start: { + [property]: _getEdge(bounds, subBounds, 'start', Math.max) + }, + end: { + [property]: _getEdge(bounds, subBounds, 'end', Math.min) + } + }); + } + } + } + return parts; +} +function _getBounds(property, first, last, loop) { + if (loop) { + return; + } + let start = first[property]; + let end = last[property]; + if (property === 'angle') { + start = helpers_segment._normalizeAngle(start); + end = helpers_segment._normalizeAngle(end); + } + return { + property, + start, + end + }; +} +function _pointsFromSegments(boundary, line) { + const { x =null , y =null } = boundary || {}; + const linePoints = line.points; + const points = []; + line.segments.forEach(({ start , end })=>{ + end = _findSegmentEnd(start, end, linePoints); + const first = linePoints[start]; + const last = linePoints[end]; + if (y !== null) { + points.push({ + x: first.x, + y + }); + points.push({ + x: last.x, + y + }); + } else if (x !== null) { + points.push({ + x, + y: first.y + }); + points.push({ + x, + y: last.y + }); + } + }); + return points; +} +function _findSegmentEnd(start, end, points) { + for(; end > start; end--){ + const point = points[end]; + if (!isNaN(point.x) && !isNaN(point.y)) { + break; + } + } + return end; +} +function _getEdge(a, b, prop, fn) { + if (a && b) { + return fn(a[prop], b[prop]); + } + return a ? a[prop] : b ? b[prop] : 0; +} + +function _createBoundaryLine(boundary, line) { + let points = []; + let _loop = false; + if (helpers_segment.isArray(boundary)) { + _loop = true; + points = boundary; + } else { + points = _pointsFromSegments(boundary, line); + } + return points.length ? new LineElement({ + points, + options: { + tension: 0 + }, + _loop, + _fullLoop: _loop + }) : null; +} +function _shouldApplyFill(source) { + return source && source.fill !== false; +} + +function _resolveTarget(sources, index, propagate) { + const source = sources[index]; + let fill = source.fill; + const visited = [ + index + ]; + let target; + if (!propagate) { + return fill; + } + while(fill !== false && visited.indexOf(fill) === -1){ + if (!helpers_segment.isNumberFinite(fill)) { + return fill; + } + target = sources[fill]; + if (!target) { + return false; + } + if (target.visible) { + return fill; + } + visited.push(fill); + fill = target.fill; + } + return false; +} + function _decodeFill(line, index, count) { + const fill = parseFillOption(line); + if (helpers_segment.isObject(fill)) { + return isNaN(fill.value) ? false : fill; + } + let target = parseFloat(fill); + if (helpers_segment.isNumberFinite(target) && Math.floor(target) === target) { + return decodeTargetIndex(fill[0], index, target, count); + } + return [ + 'origin', + 'start', + 'end', + 'stack', + 'shape' + ].indexOf(fill) >= 0 && fill; +} +function decodeTargetIndex(firstCh, index, target, count) { + if (firstCh === '-' || firstCh === '+') { + target = index + target; + } + if (target === index || target < 0 || target >= count) { + return false; + } + return target; +} + function _getTargetPixel(fill, scale) { + let pixel = null; + if (fill === 'start') { + pixel = scale.bottom; + } else if (fill === 'end') { + pixel = scale.top; + } else if (helpers_segment.isObject(fill)) { + pixel = scale.getPixelForValue(fill.value); + } else if (scale.getBasePixel) { + pixel = scale.getBasePixel(); + } + return pixel; +} + function _getTargetValue(fill, scale, startValue) { + let value; + if (fill === 'start') { + value = startValue; + } else if (fill === 'end') { + value = scale.options.reverse ? scale.min : scale.max; + } else if (helpers_segment.isObject(fill)) { + value = fill.value; + } else { + value = scale.getBaseValue(); + } + return value; +} + function parseFillOption(line) { + const options = line.options; + const fillOption = options.fill; + let fill = helpers_segment.valueOrDefault(fillOption && fillOption.target, fillOption); + if (fill === undefined) { + fill = !!options.backgroundColor; + } + if (fill === false || fill === null) { + return false; + } + if (fill === true) { + return 'origin'; + } + return fill; +} + +function _buildStackLine(source) { + const { scale , index , line } = source; + const points = []; + const segments = line.segments; + const sourcePoints = line.points; + const linesBelow = getLinesBelow(scale, index); + linesBelow.push(_createBoundaryLine({ + x: null, + y: scale.bottom + }, line)); + for(let i = 0; i < segments.length; i++){ + const segment = segments[i]; + for(let j = segment.start; j <= segment.end; j++){ + addPointsBelow(points, sourcePoints[j], linesBelow); + } + } + return new LineElement({ + points, + options: {} + }); +} + function getLinesBelow(scale, index) { + const below = []; + const metas = scale.getMatchingVisibleMetas('line'); + for(let i = 0; i < metas.length; i++){ + const meta = metas[i]; + if (meta.index === index) { + break; + } + if (!meta.hidden) { + below.unshift(meta.dataset); + } + } + return below; +} + function addPointsBelow(points, sourcePoint, linesBelow) { + const postponed = []; + for(let j = 0; j < linesBelow.length; j++){ + const line = linesBelow[j]; + const { first , last , point } = findPoint(line, sourcePoint, 'x'); + if (!point || first && last) { + continue; + } + if (first) { + postponed.unshift(point); + } else { + points.push(point); + if (!last) { + break; + } + } + } + points.push(...postponed); +} + function findPoint(line, sourcePoint, property) { + const point = line.interpolate(sourcePoint, property); + if (!point) { + return {}; + } + const pointValue = point[property]; + const segments = line.segments; + const linePoints = line.points; + let first = false; + let last = false; + for(let i = 0; i < segments.length; i++){ + const segment = segments[i]; + const firstValue = linePoints[segment.start][property]; + const lastValue = linePoints[segment.end][property]; + if (helpers_segment._isBetween(pointValue, firstValue, lastValue)) { + first = pointValue === firstValue; + last = pointValue === lastValue; + break; + } + } + return { + first, + last, + point + }; +} + +class simpleArc { + constructor(opts){ + this.x = opts.x; + this.y = opts.y; + this.radius = opts.radius; + } + pathSegment(ctx, bounds, opts) { + const { x , y , radius } = this; + bounds = bounds || { + start: 0, + end: helpers_segment.TAU + }; + ctx.arc(x, y, radius, bounds.end, bounds.start, true); + return !opts.bounds; + } + interpolate(point) { + const { x , y , radius } = this; + const angle = point.angle; + return { + x: x + Math.cos(angle) * radius, + y: y + Math.sin(angle) * radius, + angle + }; + } +} + +function _getTarget(source) { + const { chart , fill , line } = source; + if (helpers_segment.isNumberFinite(fill)) { + return getLineByIndex(chart, fill); + } + if (fill === 'stack') { + return _buildStackLine(source); + } + if (fill === 'shape') { + return true; + } + const boundary = computeBoundary(source); + if (boundary instanceof simpleArc) { + return boundary; + } + return _createBoundaryLine(boundary, line); +} + function getLineByIndex(chart, index) { + const meta = chart.getDatasetMeta(index); + const visible = meta && chart.isDatasetVisible(index); + return visible ? meta.dataset : null; +} +function computeBoundary(source) { + const scale = source.scale || {}; + if (scale.getPointPositionForValue) { + return computeCircularBoundary(source); + } + return computeLinearBoundary(source); +} +function computeLinearBoundary(source) { + const { scale ={} , fill } = source; + const pixel = _getTargetPixel(fill, scale); + if (helpers_segment.isNumberFinite(pixel)) { + const horizontal = scale.isHorizontal(); + return { + x: horizontal ? pixel : null, + y: horizontal ? null : pixel + }; + } + return null; +} +function computeCircularBoundary(source) { + const { scale , fill } = source; + const options = scale.options; + const length = scale.getLabels().length; + const start = options.reverse ? scale.max : scale.min; + const value = _getTargetValue(fill, scale, start); + const target = []; + if (options.grid.circular) { + const center = scale.getPointPositionForValue(0, start); + return new simpleArc({ + x: center.x, + y: center.y, + radius: scale.getDistanceFromCenterForValue(value) + }); + } + for(let i = 0; i < length; ++i){ + target.push(scale.getPointPositionForValue(i, value)); + } + return target; +} + +function _drawfill(ctx, source, area) { + const target = _getTarget(source); + const { line , scale , axis } = source; + const lineOpts = line.options; + const fillOption = lineOpts.fill; + const color = lineOpts.backgroundColor; + const { above =color , below =color } = fillOption || {}; + if (target && line.points.length) { + helpers_segment.clipArea(ctx, area); + doFill(ctx, { + line, + target, + above, + below, + area, + scale, + axis + }); + helpers_segment.unclipArea(ctx); + } +} +function doFill(ctx, cfg) { + const { line , target , above , below , area , scale } = cfg; + const property = line._loop ? 'angle' : cfg.axis; + ctx.save(); + if (property === 'x' && below !== above) { + clipVertical(ctx, target, area.top); + fill(ctx, { + line, + target, + color: above, + scale, + property + }); + ctx.restore(); + ctx.save(); + clipVertical(ctx, target, area.bottom); + } + fill(ctx, { + line, + target, + color: below, + scale, + property + }); + ctx.restore(); +} +function clipVertical(ctx, target, clipY) { + const { segments , points } = target; + let first = true; + let lineLoop = false; + ctx.beginPath(); + for (const segment of segments){ + const { start , end } = segment; + const firstPoint = points[start]; + const lastPoint = points[_findSegmentEnd(start, end, points)]; + if (first) { + ctx.moveTo(firstPoint.x, firstPoint.y); + first = false; + } else { + ctx.lineTo(firstPoint.x, clipY); + ctx.lineTo(firstPoint.x, firstPoint.y); + } + lineLoop = !!target.pathSegment(ctx, segment, { + move: lineLoop + }); + if (lineLoop) { + ctx.closePath(); + } else { + ctx.lineTo(lastPoint.x, clipY); + } + } + ctx.lineTo(target.first().x, clipY); + ctx.closePath(); + ctx.clip(); +} +function fill(ctx, cfg) { + const { line , target , property , color , scale } = cfg; + const segments = _segments(line, target, property); + for (const { source: src , target: tgt , start , end } of segments){ + const { style: { backgroundColor =color } = {} } = src; + const notShape = target !== true; + ctx.save(); + ctx.fillStyle = backgroundColor; + clipBounds(ctx, scale, notShape && _getBounds(property, start, end)); + ctx.beginPath(); + const lineLoop = !!line.pathSegment(ctx, src); + let loop; + if (notShape) { + if (lineLoop) { + ctx.closePath(); + } else { + interpolatedLineTo(ctx, target, end, property); + } + const targetLoop = !!target.pathSegment(ctx, tgt, { + move: lineLoop, + reverse: true + }); + loop = lineLoop && targetLoop; + if (!loop) { + interpolatedLineTo(ctx, target, start, property); + } + } + ctx.closePath(); + ctx.fill(loop ? 'evenodd' : 'nonzero'); + ctx.restore(); + } +} +function clipBounds(ctx, scale, bounds) { + const { top , bottom } = scale.chart.chartArea; + const { property , start , end } = bounds || {}; + if (property === 'x') { + ctx.beginPath(); + ctx.rect(start, top, end - start, bottom - top); + ctx.clip(); + } +} +function interpolatedLineTo(ctx, target, point, property) { + const interpolatedPoint = target.interpolate(point, property); + if (interpolatedPoint) { + ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y); + } +} + +var index = { + id: 'filler', + afterDatasetsUpdate (chart, _args, options) { + const count = (chart.data.datasets || []).length; + const sources = []; + let meta, i, line, source; + for(i = 0; i < count; ++i){ + meta = chart.getDatasetMeta(i); + line = meta.dataset; + source = null; + if (line && line.options && line instanceof LineElement) { + source = { + visible: chart.isDatasetVisible(i), + index: i, + fill: _decodeFill(line, i, count), + chart, + axis: meta.controller.options.indexAxis, + scale: meta.vScale, + line + }; + } + meta.$filler = source; + sources.push(source); + } + for(i = 0; i < count; ++i){ + source = sources[i]; + if (!source || source.fill === false) { + continue; + } + source.fill = _resolveTarget(sources, i, options.propagate); + } + }, + beforeDraw (chart, _args, options) { + const draw = options.drawTime === 'beforeDraw'; + const metasets = chart.getSortedVisibleDatasetMetas(); + const area = chart.chartArea; + for(let i = metasets.length - 1; i >= 0; --i){ + const source = metasets[i].$filler; + if (!source) { + continue; + } + source.line.updateControlPoints(area, source.axis); + if (draw && source.fill) { + _drawfill(chart.ctx, source, area); + } + } + }, + beforeDatasetsDraw (chart, _args, options) { + if (options.drawTime !== 'beforeDatasetsDraw') { + return; + } + const metasets = chart.getSortedVisibleDatasetMetas(); + for(let i = metasets.length - 1; i >= 0; --i){ + const source = metasets[i].$filler; + if (_shouldApplyFill(source)) { + _drawfill(chart.ctx, source, chart.chartArea); + } + } + }, + beforeDatasetDraw (chart, args, options) { + const source = args.meta.$filler; + if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') { + return; + } + _drawfill(chart.ctx, source, chart.chartArea); + }, + defaults: { + propagate: true, + drawTime: 'beforeDatasetDraw' + } +}; + +const getBoxSize = (labelOpts, fontSize)=>{ + let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts; + if (labelOpts.usePointStyle) { + boxHeight = Math.min(boxHeight, fontSize); + boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize); + } + return { + boxWidth, + boxHeight, + itemHeight: Math.max(fontSize, boxHeight) + }; +}; +const itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index; +class Legend extends Element { + constructor(config){ + super(); + this._added = false; + this.legendHitBoxes = []; + this._hoveredItem = null; + this.doughnutMode = false; + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this.legendItems = undefined; + this.columnSizes = undefined; + this.lineWidths = undefined; + this.maxHeight = undefined; + this.maxWidth = undefined; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.height = undefined; + this.width = undefined; + this._margins = undefined; + this.position = undefined; + this.weight = undefined; + this.fullSize = undefined; + } + update(maxWidth, maxHeight, margins) { + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins; + this.setDimensions(); + this.buildLabels(); + this.fit(); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = this._margins.left; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = this._margins.top; + this.bottom = this.height; + } + } + buildLabels() { + const labelOpts = this.options.labels || {}; + let legendItems = helpers_segment.callback(labelOpts.generateLabels, [ + this.chart + ], this) || []; + if (labelOpts.filter) { + legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data)); + } + if (labelOpts.sort) { + legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data)); + } + if (this.options.reverse) { + legendItems.reverse(); + } + this.legendItems = legendItems; + } + fit() { + const { options , ctx } = this; + if (!options.display) { + this.width = this.height = 0; + return; + } + const labelOpts = options.labels; + const labelFont = helpers_segment.toFont(labelOpts.font); + const fontSize = labelFont.size; + const titleHeight = this._computeTitleHeight(); + const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize); + let width, height; + ctx.font = labelFont.string; + if (this.isHorizontal()) { + width = this.maxWidth; + height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10; + } else { + height = this.maxHeight; + width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10; + } + this.width = Math.min(width, options.maxWidth || this.maxWidth); + this.height = Math.min(height, options.maxHeight || this.maxHeight); + } + _fitRows(titleHeight, fontSize, boxWidth, itemHeight) { + const { ctx , maxWidth , options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const lineWidths = this.lineWidths = [ + 0 + ]; + const lineHeight = itemHeight + padding; + let totalHeight = titleHeight; + ctx.textAlign = 'left'; + ctx.textBaseline = 'middle'; + let row = -1; + let top = -lineHeight; + this.legendItems.forEach((legendItem, i)=>{ + const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width; + if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) { + totalHeight += lineHeight; + lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0; + top += lineHeight; + row++; + } + hitboxes[i] = { + left: 0, + top, + row, + width: itemWidth, + height: itemHeight + }; + lineWidths[lineWidths.length - 1] += itemWidth + padding; + }); + return totalHeight; + } + _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) { + const { ctx , maxHeight , options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const columnSizes = this.columnSizes = []; + const heightLimit = maxHeight - titleHeight; + let totalWidth = padding; + let currentColWidth = 0; + let currentColHeight = 0; + let left = 0; + let col = 0; + this.legendItems.forEach((legendItem, i)=>{ + const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight); + if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) { + totalWidth += currentColWidth + padding; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + left += currentColWidth + padding; + col++; + currentColWidth = currentColHeight = 0; + } + hitboxes[i] = { + left, + top: currentColHeight, + col, + width: itemWidth, + height: itemHeight + }; + currentColWidth = Math.max(currentColWidth, itemWidth); + currentColHeight += itemHeight + padding; + }); + totalWidth += currentColWidth; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + return totalWidth; + } + adjustHitBoxes() { + if (!this.options.display) { + return; + } + const titleHeight = this._computeTitleHeight(); + const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this; + const rtlHelper = helpers_segment.getRtlAdapter(rtl, this.left, this.width); + if (this.isHorizontal()) { + let row = 0; + let left = helpers_segment._alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + for (const hitbox of hitboxes){ + if (row !== hitbox.row) { + row = hitbox.row; + left = helpers_segment._alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + } + hitbox.top += this.top + titleHeight + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width); + left += hitbox.width + padding; + } + } else { + let col = 0; + let top = helpers_segment._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + for (const hitbox of hitboxes){ + if (hitbox.col !== col) { + col = hitbox.col; + top = helpers_segment._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + } + hitbox.top = top; + hitbox.left += this.left + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width); + top += hitbox.height + padding; + } + } + } + isHorizontal() { + return this.options.position === 'top' || this.options.position === 'bottom'; + } + draw() { + if (this.options.display) { + const ctx = this.ctx; + helpers_segment.clipArea(ctx, this); + this._draw(); + helpers_segment.unclipArea(ctx); + } + } + _draw() { + const { options: opts , columnSizes , lineWidths , ctx } = this; + const { align , labels: labelOpts } = opts; + const defaultColor = helpers_segment.defaults.color; + const rtlHelper = helpers_segment.getRtlAdapter(opts.rtl, this.left, this.width); + const labelFont = helpers_segment.toFont(labelOpts.font); + const { padding } = labelOpts; + const fontSize = labelFont.size; + const halfFontSize = fontSize / 2; + let cursor; + this.drawTitle(); + ctx.textAlign = rtlHelper.textAlign('left'); + ctx.textBaseline = 'middle'; + ctx.lineWidth = 0.5; + ctx.font = labelFont.string; + const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize); + const drawLegendBox = function(x, y, legendItem) { + if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) { + return; + } + ctx.save(); + const lineWidth = helpers_segment.valueOrDefault(legendItem.lineWidth, 1); + ctx.fillStyle = helpers_segment.valueOrDefault(legendItem.fillStyle, defaultColor); + ctx.lineCap = helpers_segment.valueOrDefault(legendItem.lineCap, 'butt'); + ctx.lineDashOffset = helpers_segment.valueOrDefault(legendItem.lineDashOffset, 0); + ctx.lineJoin = helpers_segment.valueOrDefault(legendItem.lineJoin, 'miter'); + ctx.lineWidth = lineWidth; + ctx.strokeStyle = helpers_segment.valueOrDefault(legendItem.strokeStyle, defaultColor); + ctx.setLineDash(helpers_segment.valueOrDefault(legendItem.lineDash, [])); + if (labelOpts.usePointStyle) { + const drawOptions = { + radius: boxHeight * Math.SQRT2 / 2, + pointStyle: legendItem.pointStyle, + rotation: legendItem.rotation, + borderWidth: lineWidth + }; + const centerX = rtlHelper.xPlus(x, boxWidth / 2); + const centerY = y + halfFontSize; + helpers_segment.drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth); + } else { + const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0); + const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth); + const borderRadius = helpers_segment.toTRBLCorners(legendItem.borderRadius); + ctx.beginPath(); + if (Object.values(borderRadius).some((v)=>v !== 0)) { + helpers_segment.addRoundedRectPath(ctx, { + x: xBoxLeft, + y: yBoxTop, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + } else { + ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight); + } + ctx.fill(); + if (lineWidth !== 0) { + ctx.stroke(); + } + } + ctx.restore(); + }; + const fillText = function(x, y, legendItem) { + helpers_segment.renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, { + strikethrough: legendItem.hidden, + textAlign: rtlHelper.textAlign(legendItem.textAlign) + }); + }; + const isHorizontal = this.isHorizontal(); + const titleHeight = this._computeTitleHeight(); + if (isHorizontal) { + cursor = { + x: helpers_segment._alignStartEnd(align, this.left + padding, this.right - lineWidths[0]), + y: this.top + padding + titleHeight, + line: 0 + }; + } else { + cursor = { + x: this.left + padding, + y: helpers_segment._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height), + line: 0 + }; + } + helpers_segment.overrideTextDirection(this.ctx, opts.textDirection); + const lineHeight = itemHeight + padding; + this.legendItems.forEach((legendItem, i)=>{ + ctx.strokeStyle = legendItem.fontColor; + ctx.fillStyle = legendItem.fontColor; + const textWidth = ctx.measureText(legendItem.text).width; + const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign)); + const width = boxWidth + halfFontSize + textWidth; + let x = cursor.x; + let y = cursor.y; + rtlHelper.setWidth(this.width); + if (isHorizontal) { + if (i > 0 && x + width + padding > this.right) { + y = cursor.y += lineHeight; + cursor.line++; + x = cursor.x = helpers_segment._alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]); + } + } else if (i > 0 && y + lineHeight > this.bottom) { + x = cursor.x = x + columnSizes[cursor.line].width + padding; + cursor.line++; + y = cursor.y = helpers_segment._alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height); + } + const realX = rtlHelper.x(x); + drawLegendBox(realX, y, legendItem); + x = helpers_segment._textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl); + fillText(rtlHelper.x(x), y, legendItem); + if (isHorizontal) { + cursor.x += width + padding; + } else if (typeof legendItem.text !== 'string') { + const fontLineHeight = labelFont.lineHeight; + cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding; + } else { + cursor.y += lineHeight; + } + }); + helpers_segment.restoreTextDirection(this.ctx, opts.textDirection); + } + drawTitle() { + const opts = this.options; + const titleOpts = opts.title; + const titleFont = helpers_segment.toFont(titleOpts.font); + const titlePadding = helpers_segment.toPadding(titleOpts.padding); + if (!titleOpts.display) { + return; + } + const rtlHelper = helpers_segment.getRtlAdapter(opts.rtl, this.left, this.width); + const ctx = this.ctx; + const position = titleOpts.position; + const halfFontSize = titleFont.size / 2; + const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize; + let y; + let left = this.left; + let maxWidth = this.width; + if (this.isHorizontal()) { + maxWidth = Math.max(...this.lineWidths); + y = this.top + topPaddingPlusHalfFontSize; + left = helpers_segment._alignStartEnd(opts.align, left, this.right - maxWidth); + } else { + const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0); + y = topPaddingPlusHalfFontSize + helpers_segment._alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight()); + } + const x = helpers_segment._alignStartEnd(position, left, left + maxWidth); + ctx.textAlign = rtlHelper.textAlign(helpers_segment._toLeftRightCenter(position)); + ctx.textBaseline = 'middle'; + ctx.strokeStyle = titleOpts.color; + ctx.fillStyle = titleOpts.color; + ctx.font = titleFont.string; + helpers_segment.renderText(ctx, titleOpts.text, x, y, titleFont); + } + _computeTitleHeight() { + const titleOpts = this.options.title; + const titleFont = helpers_segment.toFont(titleOpts.font); + const titlePadding = helpers_segment.toPadding(titleOpts.padding); + return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0; + } + _getLegendItemAt(x, y) { + let i, hitBox, lh; + if (helpers_segment._isBetween(x, this.left, this.right) && helpers_segment._isBetween(y, this.top, this.bottom)) { + lh = this.legendHitBoxes; + for(i = 0; i < lh.length; ++i){ + hitBox = lh[i]; + if (helpers_segment._isBetween(x, hitBox.left, hitBox.left + hitBox.width) && helpers_segment._isBetween(y, hitBox.top, hitBox.top + hitBox.height)) { + return this.legendItems[i]; + } + } + } + return null; + } + handleEvent(e) { + const opts = this.options; + if (!isListened(e.type, opts)) { + return; + } + const hoveredItem = this._getLegendItemAt(e.x, e.y); + if (e.type === 'mousemove' || e.type === 'mouseout') { + const previous = this._hoveredItem; + const sameItem = itemsEqual(previous, hoveredItem); + if (previous && !sameItem) { + helpers_segment.callback(opts.onLeave, [ + e, + previous, + this + ], this); + } + this._hoveredItem = hoveredItem; + if (hoveredItem && !sameItem) { + helpers_segment.callback(opts.onHover, [ + e, + hoveredItem, + this + ], this); + } + } else if (hoveredItem) { + helpers_segment.callback(opts.onClick, [ + e, + hoveredItem, + this + ], this); + } + } +} +function calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) { + const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx); + const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight); + return { + itemWidth, + itemHeight + }; +} +function calculateItemWidth(legendItem, boxWidth, labelFont, ctx) { + let legendItemText = legendItem.text; + if (legendItemText && typeof legendItemText !== 'string') { + legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b); + } + return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width; +} +function calculateItemHeight(_itemHeight, legendItem, fontLineHeight) { + let itemHeight = _itemHeight; + if (typeof legendItem.text !== 'string') { + itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight); + } + return itemHeight; +} +function calculateLegendItemHeight(legendItem, fontLineHeight) { + const labelHeight = legendItem.text ? legendItem.text.length : 0; + return fontLineHeight * labelHeight; +} +function isListened(type, opts) { + if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) { + return true; + } + if (opts.onClick && (type === 'click' || type === 'mouseup')) { + return true; + } + return false; +} +var plugin_legend = { + id: 'legend', + _element: Legend, + start (chart, _args, options) { + const legend = chart.legend = new Legend({ + ctx: chart.ctx, + options, + chart + }); + layouts.configure(chart, legend, options); + layouts.addBox(chart, legend); + }, + stop (chart) { + layouts.removeBox(chart, chart.legend); + delete chart.legend; + }, + beforeUpdate (chart, _args, options) { + const legend = chart.legend; + layouts.configure(chart, legend, options); + legend.options = options; + }, + afterUpdate (chart) { + const legend = chart.legend; + legend.buildLabels(); + legend.adjustHitBoxes(); + }, + afterEvent (chart, args) { + if (!args.replay) { + chart.legend.handleEvent(args.event); + } + }, + defaults: { + display: true, + position: 'top', + align: 'center', + fullSize: true, + reverse: false, + weight: 1000, + onClick (e, legendItem, legend) { + const index = legendItem.datasetIndex; + const ci = legend.chart; + if (ci.isDatasetVisible(index)) { + ci.hide(index); + legendItem.hidden = true; + } else { + ci.show(index); + legendItem.hidden = false; + } + }, + onHover: null, + onLeave: null, + labels: { + color: (ctx)=>ctx.chart.options.color, + boxWidth: 40, + padding: 10, + generateLabels (chart) { + const datasets = chart.data.datasets; + const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options; + return chart._getSortedDatasetMetas().map((meta)=>{ + const style = meta.controller.getStyle(usePointStyle ? 0 : undefined); + const borderWidth = helpers_segment.toPadding(style.borderWidth); + return { + text: datasets[meta.index].label, + fillStyle: style.backgroundColor, + fontColor: color, + hidden: !meta.visible, + lineCap: style.borderCapStyle, + lineDash: style.borderDash, + lineDashOffset: style.borderDashOffset, + lineJoin: style.borderJoinStyle, + lineWidth: (borderWidth.width + borderWidth.height) / 4, + strokeStyle: style.borderColor, + pointStyle: pointStyle || style.pointStyle, + rotation: style.rotation, + textAlign: textAlign || style.textAlign, + borderRadius: useBorderRadius && (borderRadius || style.borderRadius), + datasetIndex: meta.index + }; + }, this); + } + }, + title: { + color: (ctx)=>ctx.chart.options.color, + display: false, + position: 'center', + text: '' + } + }, + descriptors: { + _scriptable: (name)=>!name.startsWith('on'), + labels: { + _scriptable: (name)=>![ + 'generateLabels', + 'filter', + 'sort' + ].includes(name) + } + } +}; + +class Title extends Element { + constructor(config){ + super(); + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this._padding = undefined; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.width = undefined; + this.height = undefined; + this.position = undefined; + this.weight = undefined; + this.fullSize = undefined; + } + update(maxWidth, maxHeight) { + const opts = this.options; + this.left = 0; + this.top = 0; + if (!opts.display) { + this.width = this.height = this.right = this.bottom = 0; + return; + } + this.width = this.right = maxWidth; + this.height = this.bottom = maxHeight; + const lineCount = helpers_segment.isArray(opts.text) ? opts.text.length : 1; + this._padding = helpers_segment.toPadding(opts.padding); + const textSize = lineCount * helpers_segment.toFont(opts.font).lineHeight + this._padding.height; + if (this.isHorizontal()) { + this.height = textSize; + } else { + this.width = textSize; + } + } + isHorizontal() { + const pos = this.options.position; + return pos === 'top' || pos === 'bottom'; + } + _drawArgs(offset) { + const { top , left , bottom , right , options } = this; + const align = options.align; + let rotation = 0; + let maxWidth, titleX, titleY; + if (this.isHorizontal()) { + titleX = helpers_segment._alignStartEnd(align, left, right); + titleY = top + offset; + maxWidth = right - left; + } else { + if (options.position === 'left') { + titleX = left + offset; + titleY = helpers_segment._alignStartEnd(align, bottom, top); + rotation = helpers_segment.PI * -0.5; + } else { + titleX = right - offset; + titleY = helpers_segment._alignStartEnd(align, top, bottom); + rotation = helpers_segment.PI * 0.5; + } + maxWidth = bottom - top; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; + } + draw() { + const ctx = this.ctx; + const opts = this.options; + if (!opts.display) { + return; + } + const fontOpts = helpers_segment.toFont(opts.font); + const lineHeight = fontOpts.lineHeight; + const offset = lineHeight / 2 + this._padding.top; + const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset); + helpers_segment.renderText(ctx, opts.text, 0, 0, fontOpts, { + color: opts.color, + maxWidth, + rotation, + textAlign: helpers_segment._toLeftRightCenter(opts.align), + textBaseline: 'middle', + translation: [ + titleX, + titleY + ] + }); + } +} +function createTitle(chart, titleOpts) { + const title = new Title({ + ctx: chart.ctx, + options: titleOpts, + chart + }); + layouts.configure(chart, title, titleOpts); + layouts.addBox(chart, title); + chart.titleBlock = title; +} +var plugin_title = { + id: 'title', + _element: Title, + start (chart, _args, options) { + createTitle(chart, options); + }, + stop (chart) { + const titleBlock = chart.titleBlock; + layouts.removeBox(chart, titleBlock); + delete chart.titleBlock; + }, + beforeUpdate (chart, _args, options) { + const title = chart.titleBlock; + layouts.configure(chart, title, options); + title.options = options; + }, + defaults: { + align: 'center', + display: false, + font: { + weight: 'bold' + }, + fullSize: true, + padding: 10, + position: 'top', + text: '', + weight: 2000 + }, + defaultRoutes: { + color: 'color' + }, + descriptors: { + _scriptable: true, + _indexable: false + } +}; + +const map = new WeakMap(); +var plugin_subtitle = { + id: 'subtitle', + start (chart, _args, options) { + const title = new Title({ + ctx: chart.ctx, + options, + chart + }); + layouts.configure(chart, title, options); + layouts.addBox(chart, title); + map.set(chart, title); + }, + stop (chart) { + layouts.removeBox(chart, map.get(chart)); + map.delete(chart); + }, + beforeUpdate (chart, _args, options) { + const title = map.get(chart); + layouts.configure(chart, title, options); + title.options = options; + }, + defaults: { + align: 'center', + display: false, + font: { + weight: 'normal' + }, + fullSize: true, + padding: 0, + position: 'top', + text: '', + weight: 1500 + }, + defaultRoutes: { + color: 'color' + }, + descriptors: { + _scriptable: true, + _indexable: false + } +}; + +const positioners = { + average (items) { + if (!items.length) { + return false; + } + let i, len; + let xSet = new Set(); + let y = 0; + let count = 0; + for(i = 0, len = items.length; i < len; ++i){ + const el = items[i].element; + if (el && el.hasValue()) { + const pos = el.tooltipPosition(); + xSet.add(pos.x); + y += pos.y; + ++count; + } + } + if (count === 0 || xSet.size === 0) { + return false; + } + const xAverage = [ + ...xSet + ].reduce((a, b)=>a + b) / xSet.size; + return { + x: xAverage, + y: y / count + }; + }, + nearest (items, eventPosition) { + if (!items.length) { + return false; + } + let x = eventPosition.x; + let y = eventPosition.y; + let minDistance = Number.POSITIVE_INFINITY; + let i, len, nearestElement; + for(i = 0, len = items.length; i < len; ++i){ + const el = items[i].element; + if (el && el.hasValue()) { + const center = el.getCenterPoint(); + const d = helpers_segment.distanceBetweenPoints(eventPosition, center); + if (d < minDistance) { + minDistance = d; + nearestElement = el; + } + } + } + if (nearestElement) { + const tp = nearestElement.tooltipPosition(); + x = tp.x; + y = tp.y; + } + return { + x, + y + }; + } +}; +function pushOrConcat(base, toPush) { + if (toPush) { + if (helpers_segment.isArray(toPush)) { + Array.prototype.push.apply(base, toPush); + } else { + base.push(toPush); + } + } + return base; +} + function splitNewlines(str) { + if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) { + return str.split('\n'); + } + return str; +} + function createTooltipItem(chart, item) { + const { element , datasetIndex , index } = item; + const controller = chart.getDatasetMeta(datasetIndex).controller; + const { label , value } = controller.getLabelAndValue(index); + return { + chart, + label, + parsed: controller.getParsed(index), + raw: chart.data.datasets[datasetIndex].data[index], + formattedValue: value, + dataset: controller.getDataset(), + dataIndex: index, + datasetIndex, + element + }; +} + function getTooltipSize(tooltip, options) { + const ctx = tooltip.chart.ctx; + const { body , footer , title } = tooltip; + const { boxWidth , boxHeight } = options; + const bodyFont = helpers_segment.toFont(options.bodyFont); + const titleFont = helpers_segment.toFont(options.titleFont); + const footerFont = helpers_segment.toFont(options.footerFont); + const titleLineCount = title.length; + const footerLineCount = footer.length; + const bodyLineItemCount = body.length; + const padding = helpers_segment.toPadding(options.padding); + let height = padding.height; + let width = 0; + let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0); + combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length; + if (titleLineCount) { + height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom; + } + if (combinedBodyLength) { + const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight; + height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing; + } + if (footerLineCount) { + height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing; + } + let widthPadding = 0; + const maxLineWidth = function(line) { + width = Math.max(width, ctx.measureText(line).width + widthPadding); + }; + ctx.save(); + ctx.font = titleFont.string; + helpers_segment.each(tooltip.title, maxLineWidth); + ctx.font = bodyFont.string; + helpers_segment.each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth); + widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0; + helpers_segment.each(body, (bodyItem)=>{ + helpers_segment.each(bodyItem.before, maxLineWidth); + helpers_segment.each(bodyItem.lines, maxLineWidth); + helpers_segment.each(bodyItem.after, maxLineWidth); + }); + widthPadding = 0; + ctx.font = footerFont.string; + helpers_segment.each(tooltip.footer, maxLineWidth); + ctx.restore(); + width += padding.width; + return { + width, + height + }; +} +function determineYAlign(chart, size) { + const { y , height } = size; + if (y < height / 2) { + return 'top'; + } else if (y > chart.height - height / 2) { + return 'bottom'; + } + return 'center'; +} +function doesNotFitWithAlign(xAlign, chart, options, size) { + const { x , width } = size; + const caret = options.caretSize + options.caretPadding; + if (xAlign === 'left' && x + width + caret > chart.width) { + return true; + } + if (xAlign === 'right' && x - width - caret < 0) { + return true; + } +} +function determineXAlign(chart, options, size, yAlign) { + const { x , width } = size; + const { width: chartWidth , chartArea: { left , right } } = chart; + let xAlign = 'center'; + if (yAlign === 'center') { + xAlign = x <= (left + right) / 2 ? 'left' : 'right'; + } else if (x <= width / 2) { + xAlign = 'left'; + } else if (x >= chartWidth - width / 2) { + xAlign = 'right'; + } + if (doesNotFitWithAlign(xAlign, chart, options, size)) { + xAlign = 'center'; + } + return xAlign; +} + function determineAlignment(chart, options, size) { + const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size); + return { + xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign), + yAlign + }; +} +function alignX(size, xAlign) { + let { x , width } = size; + if (xAlign === 'right') { + x -= width; + } else if (xAlign === 'center') { + x -= width / 2; + } + return x; +} +function alignY(size, yAlign, paddingAndSize) { + let { y , height } = size; + if (yAlign === 'top') { + y += paddingAndSize; + } else if (yAlign === 'bottom') { + y -= height + paddingAndSize; + } else { + y -= height / 2; + } + return y; +} + function getBackgroundPoint(options, size, alignment, chart) { + const { caretSize , caretPadding , cornerRadius } = options; + const { xAlign , yAlign } = alignment; + const paddingAndSize = caretSize + caretPadding; + const { topLeft , topRight , bottomLeft , bottomRight } = helpers_segment.toTRBLCorners(cornerRadius); + let x = alignX(size, xAlign); + const y = alignY(size, yAlign, paddingAndSize); + if (yAlign === 'center') { + if (xAlign === 'left') { + x += paddingAndSize; + } else if (xAlign === 'right') { + x -= paddingAndSize; + } + } else if (xAlign === 'left') { + x -= Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === 'right') { + x += Math.max(topRight, bottomRight) + caretSize; + } + return { + x: helpers_segment._limitValue(x, 0, chart.width - size.width), + y: helpers_segment._limitValue(y, 0, chart.height - size.height) + }; +} +function getAlignedX(tooltip, align, options) { + const padding = helpers_segment.toPadding(options.padding); + return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left; +} + function getBeforeAfterBodyLines(callback) { + return pushOrConcat([], splitNewlines(callback)); +} +function createTooltipContext(parent, tooltip, tooltipItems) { + return helpers_segment.createContext(parent, { + tooltip, + tooltipItems, + type: 'tooltip' + }); +} +function overrideCallbacks(callbacks, context) { + const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks; + return override ? callbacks.override(override) : callbacks; +} +const defaultCallbacks = { + beforeTitle: helpers_segment.noop, + title (tooltipItems) { + if (tooltipItems.length > 0) { + const item = tooltipItems[0]; + const labels = item.chart.data.labels; + const labelCount = labels ? labels.length : 0; + if (this && this.options && this.options.mode === 'dataset') { + return item.dataset.label || ''; + } else if (item.label) { + return item.label; + } else if (labelCount > 0 && item.dataIndex < labelCount) { + return labels[item.dataIndex]; + } + } + return ''; + }, + afterTitle: helpers_segment.noop, + beforeBody: helpers_segment.noop, + beforeLabel: helpers_segment.noop, + label (tooltipItem) { + if (this && this.options && this.options.mode === 'dataset') { + return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue; + } + let label = tooltipItem.dataset.label || ''; + if (label) { + label += ': '; + } + const value = tooltipItem.formattedValue; + if (!helpers_segment.isNullOrUndef(value)) { + label += value; + } + return label; + }, + labelColor (tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + borderColor: options.borderColor, + backgroundColor: options.backgroundColor, + borderWidth: options.borderWidth, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderRadius: 0 + }; + }, + labelTextColor () { + return this.options.bodyColor; + }, + labelPointStyle (tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + pointStyle: options.pointStyle, + rotation: options.rotation + }; + }, + afterLabel: helpers_segment.noop, + afterBody: helpers_segment.noop, + beforeFooter: helpers_segment.noop, + footer: helpers_segment.noop, + afterFooter: helpers_segment.noop +}; + function invokeCallbackWithFallback(callbacks, name, ctx, arg) { + const result = callbacks[name].call(ctx, arg); + if (typeof result === 'undefined') { + return defaultCallbacks[name].call(ctx, arg); + } + return result; +} +class Tooltip extends Element { + static positioners = positioners; + constructor(config){ + super(); + this.opacity = 0; + this._active = []; + this._eventPosition = undefined; + this._size = undefined; + this._cachedAnimations = undefined; + this._tooltipItems = []; + this.$animations = undefined; + this.$context = undefined; + this.chart = config.chart; + this.options = config.options; + this.dataPoints = undefined; + this.title = undefined; + this.beforeBody = undefined; + this.body = undefined; + this.afterBody = undefined; + this.footer = undefined; + this.xAlign = undefined; + this.yAlign = undefined; + this.x = undefined; + this.y = undefined; + this.height = undefined; + this.width = undefined; + this.caretX = undefined; + this.caretY = undefined; + this.labelColors = undefined; + this.labelPointStyles = undefined; + this.labelTextColors = undefined; + } + initialize(options) { + this.options = options; + this._cachedAnimations = undefined; + this.$context = undefined; + } + _resolveAnimations() { + const cached = this._cachedAnimations; + if (cached) { + return cached; + } + const chart = this.chart; + const options = this.options.setContext(this.getContext()); + const opts = options.enabled && chart.options.animation && options.animations; + const animations = new Animations(this.chart, opts); + if (opts._cacheable) { + this._cachedAnimations = Object.freeze(animations); + } + return animations; + } + getContext() { + return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems)); + } + getTitle(context, options) { + const { callbacks } = options; + const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context); + const title = invokeCallbackWithFallback(callbacks, 'title', this, context); + const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeTitle)); + lines = pushOrConcat(lines, splitNewlines(title)); + lines = pushOrConcat(lines, splitNewlines(afterTitle)); + return lines; + } + getBeforeBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)); + } + getBody(tooltipItems, options) { + const { callbacks } = options; + const bodyItems = []; + helpers_segment.each(tooltipItems, (context)=>{ + const bodyItem = { + before: [], + lines: [], + after: [] + }; + const scoped = overrideCallbacks(callbacks, context); + pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context))); + pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context)); + pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context))); + bodyItems.push(bodyItem); + }); + return bodyItems; + } + getAfterBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)); + } + getFooter(tooltipItems, options) { + const { callbacks } = options; + const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems); + const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems); + const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeFooter)); + lines = pushOrConcat(lines, splitNewlines(footer)); + lines = pushOrConcat(lines, splitNewlines(afterFooter)); + return lines; + } + _createItems(options) { + const active = this._active; + const data = this.chart.data; + const labelColors = []; + const labelPointStyles = []; + const labelTextColors = []; + let tooltipItems = []; + let i, len; + for(i = 0, len = active.length; i < len; ++i){ + tooltipItems.push(createTooltipItem(this.chart, active[i])); + } + if (options.filter) { + tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data)); + } + if (options.itemSort) { + tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data)); + } + helpers_segment.each(tooltipItems, (context)=>{ + const scoped = overrideCallbacks(options.callbacks, context); + labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context)); + labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context)); + labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context)); + }); + this.labelColors = labelColors; + this.labelPointStyles = labelPointStyles; + this.labelTextColors = labelTextColors; + this.dataPoints = tooltipItems; + return tooltipItems; + } + update(changed, replay) { + const options = this.options.setContext(this.getContext()); + const active = this._active; + let properties; + let tooltipItems = []; + if (!active.length) { + if (this.opacity !== 0) { + properties = { + opacity: 0 + }; + } + } else { + const position = positioners[options.position].call(this, active, this._eventPosition); + tooltipItems = this._createItems(options); + this.title = this.getTitle(tooltipItems, options); + this.beforeBody = this.getBeforeBody(tooltipItems, options); + this.body = this.getBody(tooltipItems, options); + this.afterBody = this.getAfterBody(tooltipItems, options); + this.footer = this.getFooter(tooltipItems, options); + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, size); + const alignment = determineAlignment(this.chart, options, positionAndSize); + const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart); + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + properties = { + opacity: 1, + x: backgroundPoint.x, + y: backgroundPoint.y, + width: size.width, + height: size.height, + caretX: position.x, + caretY: position.y + }; + } + this._tooltipItems = tooltipItems; + this.$context = undefined; + if (properties) { + this._resolveAnimations().update(this, properties); + } + if (changed && options.external) { + options.external.call(this, { + chart: this.chart, + tooltip: this, + replay + }); + } + } + drawCaret(tooltipPoint, ctx, size, options) { + const caretPosition = this.getCaretPosition(tooltipPoint, size, options); + ctx.lineTo(caretPosition.x1, caretPosition.y1); + ctx.lineTo(caretPosition.x2, caretPosition.y2); + ctx.lineTo(caretPosition.x3, caretPosition.y3); + } + getCaretPosition(tooltipPoint, size, options) { + const { xAlign , yAlign } = this; + const { caretSize , cornerRadius } = options; + const { topLeft , topRight , bottomLeft , bottomRight } = helpers_segment.toTRBLCorners(cornerRadius); + const { x: ptX , y: ptY } = tooltipPoint; + const { width , height } = size; + let x1, x2, x3, y1, y2, y3; + if (yAlign === 'center') { + y2 = ptY + height / 2; + if (xAlign === 'left') { + x1 = ptX; + x2 = x1 - caretSize; + y1 = y2 + caretSize; + y3 = y2 - caretSize; + } else { + x1 = ptX + width; + x2 = x1 + caretSize; + y1 = y2 - caretSize; + y3 = y2 + caretSize; + } + x3 = x1; + } else { + if (xAlign === 'left') { + x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === 'right') { + x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize; + } else { + x2 = this.caretX; + } + if (yAlign === 'top') { + y1 = ptY; + y2 = y1 - caretSize; + x1 = x2 - caretSize; + x3 = x2 + caretSize; + } else { + y1 = ptY + height; + y2 = y1 + caretSize; + x1 = x2 + caretSize; + x3 = x2 - caretSize; + } + y3 = y1; + } + return { + x1, + x2, + x3, + y1, + y2, + y3 + }; + } + drawTitle(pt, ctx, options) { + const title = this.title; + const length = title.length; + let titleFont, titleSpacing, i; + if (length) { + const rtlHelper = helpers_segment.getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.titleAlign, options); + ctx.textAlign = rtlHelper.textAlign(options.titleAlign); + ctx.textBaseline = 'middle'; + titleFont = helpers_segment.toFont(options.titleFont); + titleSpacing = options.titleSpacing; + ctx.fillStyle = options.titleColor; + ctx.font = titleFont.string; + for(i = 0; i < length; ++i){ + ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2); + pt.y += titleFont.lineHeight + titleSpacing; + if (i + 1 === length) { + pt.y += options.titleMarginBottom - titleSpacing; + } + } + } + } + _drawColorBox(ctx, pt, i, rtlHelper, options) { + const labelColor = this.labelColors[i]; + const labelPointStyle = this.labelPointStyles[i]; + const { boxHeight , boxWidth } = options; + const bodyFont = helpers_segment.toFont(options.bodyFont); + const colorX = getAlignedX(this, 'left', options); + const rtlColorX = rtlHelper.x(colorX); + const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0; + const colorY = pt.y + yOffSet; + if (options.usePointStyle) { + const drawOptions = { + radius: Math.min(boxWidth, boxHeight) / 2, + pointStyle: labelPointStyle.pointStyle, + rotation: labelPointStyle.rotation, + borderWidth: 1 + }; + const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2; + const centerY = colorY + boxHeight / 2; + ctx.strokeStyle = options.multiKeyBackground; + ctx.fillStyle = options.multiKeyBackground; + helpers_segment.drawPoint(ctx, drawOptions, centerX, centerY); + ctx.strokeStyle = labelColor.borderColor; + ctx.fillStyle = labelColor.backgroundColor; + helpers_segment.drawPoint(ctx, drawOptions, centerX, centerY); + } else { + ctx.lineWidth = helpers_segment.isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1; + ctx.strokeStyle = labelColor.borderColor; + ctx.setLineDash(labelColor.borderDash || []); + ctx.lineDashOffset = labelColor.borderDashOffset || 0; + const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth); + const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2); + const borderRadius = helpers_segment.toTRBLCorners(labelColor.borderRadius); + if (Object.values(borderRadius).some((v)=>v !== 0)) { + ctx.beginPath(); + ctx.fillStyle = options.multiKeyBackground; + helpers_segment.addRoundedRectPath(ctx, { + x: outerX, + y: colorY, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + ctx.fill(); + ctx.stroke(); + ctx.fillStyle = labelColor.backgroundColor; + ctx.beginPath(); + helpers_segment.addRoundedRectPath(ctx, { + x: innerX, + y: colorY + 1, + w: boxWidth - 2, + h: boxHeight - 2, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillStyle = options.multiKeyBackground; + ctx.fillRect(outerX, colorY, boxWidth, boxHeight); + ctx.strokeRect(outerX, colorY, boxWidth, boxHeight); + ctx.fillStyle = labelColor.backgroundColor; + ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2); + } + } + ctx.fillStyle = this.labelTextColors[i]; + } + drawBody(pt, ctx, options) { + const { body } = this; + const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options; + const bodyFont = helpers_segment.toFont(options.bodyFont); + let bodyLineHeight = bodyFont.lineHeight; + let xLinePadding = 0; + const rtlHelper = helpers_segment.getRtlAdapter(options.rtl, this.x, this.width); + const fillLineOfText = function(line) { + ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2); + pt.y += bodyLineHeight + bodySpacing; + }; + const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign); + let bodyItem, textColor, lines, i, j, ilen, jlen; + ctx.textAlign = bodyAlign; + ctx.textBaseline = 'middle'; + ctx.font = bodyFont.string; + pt.x = getAlignedX(this, bodyAlignForCalculation, options); + ctx.fillStyle = options.bodyColor; + helpers_segment.each(this.beforeBody, fillLineOfText); + xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0; + for(i = 0, ilen = body.length; i < ilen; ++i){ + bodyItem = body[i]; + textColor = this.labelTextColors[i]; + ctx.fillStyle = textColor; + helpers_segment.each(bodyItem.before, fillLineOfText); + lines = bodyItem.lines; + if (displayColors && lines.length) { + this._drawColorBox(ctx, pt, i, rtlHelper, options); + bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight); + } + for(j = 0, jlen = lines.length; j < jlen; ++j){ + fillLineOfText(lines[j]); + bodyLineHeight = bodyFont.lineHeight; + } + helpers_segment.each(bodyItem.after, fillLineOfText); + } + xLinePadding = 0; + bodyLineHeight = bodyFont.lineHeight; + helpers_segment.each(this.afterBody, fillLineOfText); + pt.y -= bodySpacing; + } + drawFooter(pt, ctx, options) { + const footer = this.footer; + const length = footer.length; + let footerFont, i; + if (length) { + const rtlHelper = helpers_segment.getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.footerAlign, options); + pt.y += options.footerMarginTop; + ctx.textAlign = rtlHelper.textAlign(options.footerAlign); + ctx.textBaseline = 'middle'; + footerFont = helpers_segment.toFont(options.footerFont); + ctx.fillStyle = options.footerColor; + ctx.font = footerFont.string; + for(i = 0; i < length; ++i){ + ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2); + pt.y += footerFont.lineHeight + options.footerSpacing; + } + } + } + drawBackground(pt, ctx, tooltipSize, options) { + const { xAlign , yAlign } = this; + const { x , y } = pt; + const { width , height } = tooltipSize; + const { topLeft , topRight , bottomLeft , bottomRight } = helpers_segment.toTRBLCorners(options.cornerRadius); + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.beginPath(); + ctx.moveTo(x + topLeft, y); + if (yAlign === 'top') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width - topRight, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + topRight); + if (yAlign === 'center' && xAlign === 'right') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width, y + height - bottomRight); + ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height); + if (yAlign === 'bottom') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + bottomLeft, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft); + if (yAlign === 'center' && xAlign === 'left') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x, y + topLeft); + ctx.quadraticCurveTo(x, y, x + topLeft, y); + ctx.closePath(); + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } + } + _updateAnimationTarget(options) { + const chart = this.chart; + const anims = this.$animations; + const animX = anims && anims.x; + const animY = anims && anims.y; + if (animX || animY) { + const position = positioners[options.position].call(this, this._active, this._eventPosition); + if (!position) { + return; + } + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, this._size); + const alignment = determineAlignment(chart, options, positionAndSize); + const point = getBackgroundPoint(options, positionAndSize, alignment, chart); + if (animX._to !== point.x || animY._to !== point.y) { + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + this.width = size.width; + this.height = size.height; + this.caretX = position.x; + this.caretY = position.y; + this._resolveAnimations().update(this, point); + } + } + } + _willRender() { + return !!this.opacity; + } + draw(ctx) { + const options = this.options.setContext(this.getContext()); + let opacity = this.opacity; + if (!opacity) { + return; + } + this._updateAnimationTarget(options); + const tooltipSize = { + width: this.width, + height: this.height + }; + const pt = { + x: this.x, + y: this.y + }; + opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity; + const padding = helpers_segment.toPadding(options.padding); + const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length; + if (options.enabled && hasTooltipContent) { + ctx.save(); + ctx.globalAlpha = opacity; + this.drawBackground(pt, ctx, tooltipSize, options); + helpers_segment.overrideTextDirection(ctx, options.textDirection); + pt.y += padding.top; + this.drawTitle(pt, ctx, options); + this.drawBody(pt, ctx, options); + this.drawFooter(pt, ctx, options); + helpers_segment.restoreTextDirection(ctx, options.textDirection); + ctx.restore(); + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements, eventPosition) { + const lastActive = this._active; + const active = activeElements.map(({ datasetIndex , index })=>{ + const meta = this.chart.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error('Cannot find a dataset at index ' + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index], + index + }; + }); + const changed = !helpers_segment._elementsEqual(lastActive, active); + const positionChanged = this._positionChanged(active, eventPosition); + if (changed || positionChanged) { + this._active = active; + this._eventPosition = eventPosition; + this._ignoreReplayEvents = true; + this.update(true); + } + } + handleEvent(e, replay, inChartArea = true) { + if (replay && this._ignoreReplayEvents) { + return false; + } + this._ignoreReplayEvents = false; + const options = this.options; + const lastActive = this._active || []; + const active = this._getActiveElements(e, lastActive, replay, inChartArea); + const positionChanged = this._positionChanged(active, e); + const changed = replay || !helpers_segment._elementsEqual(active, lastActive) || positionChanged; + if (changed) { + this._active = active; + if (options.enabled || options.external) { + this._eventPosition = { + x: e.x, + y: e.y + }; + this.update(true, replay); + } + } + return changed; + } + _getActiveElements(e, lastActive, replay, inChartArea) { + const options = this.options; + if (e.type === 'mouseout') { + return []; + } + if (!inChartArea) { + return lastActive.filter((i)=>this.chart.data.datasets[i.datasetIndex] && this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined); + } + const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay); + if (options.reverse) { + active.reverse(); + } + return active; + } + _positionChanged(active, e) { + const { caretX , caretY , options } = this; + const position = positioners[options.position].call(this, active, e); + return position !== false && (caretX !== position.x || caretY !== position.y); + } +} +var plugin_tooltip = { + id: 'tooltip', + _element: Tooltip, + positioners, + afterInit (chart, _args, options) { + if (options) { + chart.tooltip = new Tooltip({ + chart, + options + }); + } + }, + beforeUpdate (chart, _args, options) { + if (chart.tooltip) { + chart.tooltip.initialize(options); + } + }, + reset (chart, _args, options) { + if (chart.tooltip) { + chart.tooltip.initialize(options); + } + }, + afterDraw (chart) { + const tooltip = chart.tooltip; + if (tooltip && tooltip._willRender()) { + const args = { + tooltip + }; + if (chart.notifyPlugins('beforeTooltipDraw', { + ...args, + cancelable: true + }) === false) { + return; + } + tooltip.draw(chart.ctx); + chart.notifyPlugins('afterTooltipDraw', args); + } + }, + afterEvent (chart, args) { + if (chart.tooltip) { + const useFinalPosition = args.replay; + if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) { + args.changed = true; + } + } + }, + defaults: { + enabled: true, + external: null, + position: 'average', + backgroundColor: 'rgba(0,0,0,0.8)', + titleColor: '#fff', + titleFont: { + weight: 'bold' + }, + titleSpacing: 2, + titleMarginBottom: 6, + titleAlign: 'left', + bodyColor: '#fff', + bodySpacing: 2, + bodyFont: {}, + bodyAlign: 'left', + footerColor: '#fff', + footerSpacing: 2, + footerMarginTop: 6, + footerFont: { + weight: 'bold' + }, + footerAlign: 'left', + padding: 6, + caretPadding: 2, + caretSize: 5, + cornerRadius: 6, + boxHeight: (ctx, opts)=>opts.bodyFont.size, + boxWidth: (ctx, opts)=>opts.bodyFont.size, + multiKeyBackground: '#fff', + displayColors: true, + boxPadding: 0, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 0, + animation: { + duration: 400, + easing: 'easeOutQuart' + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'width', + 'height', + 'caretX', + 'caretY' + ] + }, + opacity: { + easing: 'linear', + duration: 200 + } + }, + callbacks: defaultCallbacks + }, + defaultRoutes: { + bodyFont: 'font', + footerFont: 'font', + titleFont: 'font' + }, + descriptors: { + _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external', + _indexable: false, + callbacks: { + _scriptable: false, + _indexable: false + }, + animation: { + _fallback: false + }, + animations: { + _fallback: 'animation' + } + }, + additionalOptionScopes: [ + 'interaction' + ] +}; + +var plugins = /*#__PURE__*/Object.freeze({ +__proto__: null, +Colors: plugin_colors, +Decimation: plugin_decimation, +Filler: index, +Legend: plugin_legend, +SubTitle: plugin_subtitle, +Title: plugin_title, +Tooltip: plugin_tooltip +}); + +const addIfString = (labels, raw, index, addedLabels)=>{ + if (typeof raw === 'string') { + index = labels.push(raw) - 1; + addedLabels.unshift({ + index, + label: raw + }); + } else if (isNaN(raw)) { + index = null; + } + return index; +}; +function findOrAddLabel(labels, raw, index, addedLabels) { + const first = labels.indexOf(raw); + if (first === -1) { + return addIfString(labels, raw, index, addedLabels); + } + const last = labels.lastIndexOf(raw); + return first !== last ? index : first; +} +const validIndex = (index, max)=>index === null ? null : helpers_segment._limitValue(Math.round(index), 0, max); +function _getLabelForValue(value) { + const labels = this.getLabels(); + if (value >= 0 && value < labels.length) { + return labels[value]; + } + return value; +} +class CategoryScale extends Scale { + static id = 'category'; + static defaults = { + ticks: { + callback: _getLabelForValue + } + }; + constructor(cfg){ + super(cfg); + this._startValue = undefined; + this._valueRange = 0; + this._addedLabels = []; + } + init(scaleOptions) { + const added = this._addedLabels; + if (added.length) { + const labels = this.getLabels(); + for (const { index , label } of added){ + if (labels[index] === label) { + labels.splice(index, 1); + } + } + this._addedLabels = []; + } + super.init(scaleOptions); + } + parse(raw, index) { + if (helpers_segment.isNullOrUndef(raw)) { + return null; + } + const labels = this.getLabels(); + index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, helpers_segment.valueOrDefault(index, raw), this._addedLabels); + return validIndex(index, labels.length - 1); + } + determineDataLimits() { + const { minDefined , maxDefined } = this.getUserBounds(); + let { min , max } = this.getMinMax(true); + if (this.options.bounds === 'ticks') { + if (!minDefined) { + min = 0; + } + if (!maxDefined) { + max = this.getLabels().length - 1; + } + } + this.min = min; + this.max = max; + } + buildTicks() { + const min = this.min; + const max = this.max; + const offset = this.options.offset; + const ticks = []; + let labels = this.getLabels(); + labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1); + this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1); + this._startValue = this.min - (offset ? 0.5 : 0); + for(let value = min; value <= max; value++){ + ticks.push({ + value + }); + } + return ticks; + } + getLabelForValue(value) { + return _getLabelForValue.call(this, value); + } + configure() { + super.configure(); + if (!this.isHorizontal()) { + this._reversePixels = !this._reversePixels; + } + } + getPixelForValue(value) { + if (typeof value !== 'number') { + value = this.parse(value); + } + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getPixelForTick(index) { + const ticks = this.ticks; + if (index < 0 || index > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index].value); + } + getValueForPixel(pixel) { + return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange); + } + getBasePixel() { + return this.bottom; + } +} + +function generateTicks$1(generationOptions, dataRange) { + const ticks = []; + const MIN_SPACING = 1e-14; + const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions; + const unit = step || 1; + const maxSpaces = maxTicks - 1; + const { min: rmin , max: rmax } = dataRange; + const minDefined = !helpers_segment.isNullOrUndef(min); + const maxDefined = !helpers_segment.isNullOrUndef(max); + const countDefined = !helpers_segment.isNullOrUndef(count); + const minSpacing = (rmax - rmin) / (maxDigits + 1); + let spacing = helpers_segment.niceNum((rmax - rmin) / maxSpaces / unit) * unit; + let factor, niceMin, niceMax, numSpaces; + if (spacing < MIN_SPACING && !minDefined && !maxDefined) { + return [ + { + value: rmin + }, + { + value: rmax + } + ]; + } + numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing); + if (numSpaces > maxSpaces) { + spacing = helpers_segment.niceNum(numSpaces * spacing / maxSpaces / unit) * unit; + } + if (!helpers_segment.isNullOrUndef(precision)) { + factor = Math.pow(10, precision); + spacing = Math.ceil(spacing * factor) / factor; + } + if (bounds === 'ticks') { + niceMin = Math.floor(rmin / spacing) * spacing; + niceMax = Math.ceil(rmax / spacing) * spacing; + } else { + niceMin = rmin; + niceMax = rmax; + } + if (minDefined && maxDefined && step && helpers_segment.almostWhole((max - min) / step, spacing / 1000)) { + numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks)); + spacing = (max - min) / numSpaces; + niceMin = min; + niceMax = max; + } else if (countDefined) { + niceMin = minDefined ? min : niceMin; + niceMax = maxDefined ? max : niceMax; + numSpaces = count - 1; + spacing = (niceMax - niceMin) / numSpaces; + } else { + numSpaces = (niceMax - niceMin) / spacing; + if (helpers_segment.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) { + numSpaces = Math.round(numSpaces); + } else { + numSpaces = Math.ceil(numSpaces); + } + } + const decimalPlaces = Math.max(helpers_segment._decimalPlaces(spacing), helpers_segment._decimalPlaces(niceMin)); + factor = Math.pow(10, helpers_segment.isNullOrUndef(precision) ? decimalPlaces : precision); + niceMin = Math.round(niceMin * factor) / factor; + niceMax = Math.round(niceMax * factor) / factor; + let j = 0; + if (minDefined) { + if (includeBounds && niceMin !== min) { + ticks.push({ + value: min + }); + if (niceMin < min) { + j++; + } + if (helpers_segment.almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) { + j++; + } + } else if (niceMin < min) { + j++; + } + } + for(; j < numSpaces; ++j){ + const tickValue = Math.round((niceMin + j * spacing) * factor) / factor; + if (maxDefined && tickValue > max) { + break; + } + ticks.push({ + value: tickValue + }); + } + if (maxDefined && includeBounds && niceMax !== max) { + if (ticks.length && helpers_segment.almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) { + ticks[ticks.length - 1].value = max; + } else { + ticks.push({ + value: max + }); + } + } else if (!maxDefined || niceMax === max) { + ticks.push({ + value: niceMax + }); + } + return ticks; +} +function relativeLabelSize(value, minSpacing, { horizontal , minRotation }) { + const rad = helpers_segment.toRadians(minRotation); + const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001; + const length = 0.75 * minSpacing * ('' + value).length; + return Math.min(minSpacing / ratio, length); +} +class LinearScaleBase extends Scale { + constructor(cfg){ + super(cfg); + this.start = undefined; + this.end = undefined; + this._startValue = undefined; + this._endValue = undefined; + this._valueRange = 0; + } + parse(raw, index) { + if (helpers_segment.isNullOrUndef(raw)) { + return null; + } + if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) { + return null; + } + return +raw; + } + handleTickRangeOptions() { + const { beginAtZero } = this.options; + const { minDefined , maxDefined } = this.getUserBounds(); + let { min , max } = this; + const setMin = (v)=>min = minDefined ? min : v; + const setMax = (v)=>max = maxDefined ? max : v; + if (beginAtZero) { + const minSign = helpers_segment.sign(min); + const maxSign = helpers_segment.sign(max); + if (minSign < 0 && maxSign < 0) { + setMax(0); + } else if (minSign > 0 && maxSign > 0) { + setMin(0); + } + } + if (min === max) { + let offset = max === 0 ? 1 : Math.abs(max * 0.05); + setMax(max + offset); + if (!beginAtZero) { + setMin(min - offset); + } + } + this.min = min; + this.max = max; + } + getTickLimit() { + const tickOpts = this.options.ticks; + let { maxTicksLimit , stepSize } = tickOpts; + let maxTicks; + if (stepSize) { + maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1; + if (maxTicks > 1000) { + console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`); + maxTicks = 1000; + } + } else { + maxTicks = this.computeTickLimit(); + maxTicksLimit = maxTicksLimit || 11; + } + if (maxTicksLimit) { + maxTicks = Math.min(maxTicksLimit, maxTicks); + } + return maxTicks; + } + computeTickLimit() { + return Number.POSITIVE_INFINITY; + } + buildTicks() { + const opts = this.options; + const tickOpts = opts.ticks; + let maxTicks = this.getTickLimit(); + maxTicks = Math.max(2, maxTicks); + const numericGeneratorOptions = { + maxTicks, + bounds: opts.bounds, + min: opts.min, + max: opts.max, + precision: tickOpts.precision, + step: tickOpts.stepSize, + count: tickOpts.count, + maxDigits: this._maxDigits(), + horizontal: this.isHorizontal(), + minRotation: tickOpts.minRotation || 0, + includeBounds: tickOpts.includeBounds !== false + }; + const dataRange = this._range || this; + const ticks = generateTicks$1(numericGeneratorOptions, dataRange); + if (opts.bounds === 'ticks') { + helpers_segment._setMinAndMaxByKey(ticks, this, 'value'); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + configure() { + const ticks = this.ticks; + let start = this.min; + let end = this.max; + super.configure(); + if (this.options.offset && ticks.length) { + const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2; + start -= offset; + end += offset; + } + this._startValue = start; + this._endValue = end; + this._valueRange = end - start; + } + getLabelForValue(value) { + return helpers_segment.formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } +} + +class LinearScale extends LinearScaleBase { + static id = 'linear'; + static defaults = { + ticks: { + callback: helpers_segment.Ticks.formatters.numeric + } + }; + determineDataLimits() { + const { min , max } = this.getMinMax(true); + this.min = helpers_segment.isNumberFinite(min) ? min : 0; + this.max = helpers_segment.isNumberFinite(max) ? max : 1; + this.handleTickRangeOptions(); + } + computeTickLimit() { + const horizontal = this.isHorizontal(); + const length = horizontal ? this.width : this.height; + const minRotation = helpers_segment.toRadians(this.options.ticks.minRotation); + const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001; + const tickFont = this._resolveTickFontOptions(0); + return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio)); + } + getPixelForValue(value) { + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange; + } +} + +const log10Floor = (v)=>Math.floor(helpers_segment.log10(v)); +const changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m); +function isMajor(tickVal) { + const remain = tickVal / Math.pow(10, log10Floor(tickVal)); + return remain === 1; +} +function steps(min, max, rangeExp) { + const rangeStep = Math.pow(10, rangeExp); + const start = Math.floor(min / rangeStep); + const end = Math.ceil(max / rangeStep); + return end - start; +} +function startExp(min, max) { + const range = max - min; + let rangeExp = log10Floor(range); + while(steps(min, max, rangeExp) > 10){ + rangeExp++; + } + while(steps(min, max, rangeExp) < 10){ + rangeExp--; + } + return Math.min(rangeExp, log10Floor(min)); +} + function generateTicks(generationOptions, { min , max }) { + min = helpers_segment.finiteOrDefault(generationOptions.min, min); + const ticks = []; + const minExp = log10Floor(min); + let exp = startExp(min, max); + let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1; + const stepSize = Math.pow(10, exp); + const base = minExp > exp ? Math.pow(10, minExp) : 0; + const start = Math.round((min - base) * precision) / precision; + const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10; + let significand = Math.floor((start - offset) / Math.pow(10, exp)); + let value = helpers_segment.finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision); + while(value < max){ + ticks.push({ + value, + major: isMajor(value), + significand + }); + if (significand >= 10) { + significand = significand < 15 ? 15 : 20; + } else { + significand++; + } + if (significand >= 20) { + exp++; + significand = 2; + precision = exp >= 0 ? 1 : precision; + } + value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision; + } + const lastTick = helpers_segment.finiteOrDefault(generationOptions.max, value); + ticks.push({ + value: lastTick, + major: isMajor(lastTick), + significand + }); + return ticks; +} +class LogarithmicScale extends Scale { + static id = 'logarithmic'; + static defaults = { + ticks: { + callback: helpers_segment.Ticks.formatters.logarithmic, + major: { + enabled: true + } + } + }; + constructor(cfg){ + super(cfg); + this.start = undefined; + this.end = undefined; + this._startValue = undefined; + this._valueRange = 0; + } + parse(raw, index) { + const value = LinearScaleBase.prototype.parse.apply(this, [ + raw, + index + ]); + if (value === 0) { + this._zero = true; + return undefined; + } + return helpers_segment.isNumberFinite(value) && value > 0 ? value : null; + } + determineDataLimits() { + const { min , max } = this.getMinMax(true); + this.min = helpers_segment.isNumberFinite(min) ? Math.max(0, min) : null; + this.max = helpers_segment.isNumberFinite(max) ? Math.max(0, max) : null; + if (this.options.beginAtZero) { + this._zero = true; + } + if (this._zero && this.min !== this._suggestedMin && !helpers_segment.isNumberFinite(this._userMin)) { + this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0); + } + this.handleTickRangeOptions(); + } + handleTickRangeOptions() { + const { minDefined , maxDefined } = this.getUserBounds(); + let min = this.min; + let max = this.max; + const setMin = (v)=>min = minDefined ? min : v; + const setMax = (v)=>max = maxDefined ? max : v; + if (min === max) { + if (min <= 0) { + setMin(1); + setMax(10); + } else { + setMin(changeExponent(min, -1)); + setMax(changeExponent(max, +1)); + } + } + if (min <= 0) { + setMin(changeExponent(max, -1)); + } + if (max <= 0) { + setMax(changeExponent(min, +1)); + } + this.min = min; + this.max = max; + } + buildTicks() { + const opts = this.options; + const generationOptions = { + min: this._userMin, + max: this._userMax + }; + const ticks = generateTicks(generationOptions, this); + if (opts.bounds === 'ticks') { + helpers_segment._setMinAndMaxByKey(ticks, this, 'value'); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + getLabelForValue(value) { + return value === undefined ? '0' : helpers_segment.formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } + configure() { + const start = this.min; + super.configure(); + this._startValue = helpers_segment.log10(start); + this._valueRange = helpers_segment.log10(this.max) - helpers_segment.log10(start); + } + getPixelForValue(value) { + if (value === undefined || value === 0) { + value = this.min; + } + if (value === null || isNaN(value)) { + return NaN; + } + return this.getPixelForDecimal(value === this.min ? 0 : (helpers_segment.log10(value) - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + const decimal = this.getDecimalForPixel(pixel); + return Math.pow(10, this._startValue + decimal * this._valueRange); + } +} + +function getTickBackdropHeight(opts) { + const tickOpts = opts.ticks; + if (tickOpts.display && opts.display) { + const padding = helpers_segment.toPadding(tickOpts.backdropPadding); + return helpers_segment.valueOrDefault(tickOpts.font && tickOpts.font.size, helpers_segment.defaults.font.size) + padding.height; + } + return 0; +} +function measureLabelSize(ctx, font, label) { + label = helpers_segment.isArray(label) ? label : [ + label + ]; + return { + w: helpers_segment._longestText(ctx, font.string, label), + h: label.length * font.lineHeight + }; +} +function determineLimits(angle, pos, size, min, max) { + if (angle === min || angle === max) { + return { + start: pos - size / 2, + end: pos + size / 2 + }; + } else if (angle < min || angle > max) { + return { + start: pos - size, + end: pos + }; + } + return { + start: pos, + end: pos + size + }; +} + function fitWithPointLabels(scale) { + const orig = { + l: scale.left + scale._padding.left, + r: scale.right - scale._padding.right, + t: scale.top + scale._padding.top, + b: scale.bottom - scale._padding.bottom + }; + const limits = Object.assign({}, orig); + const labelSizes = []; + const padding = []; + const valueCount = scale._pointLabels.length; + const pointLabelOpts = scale.options.pointLabels; + const additionalAngle = pointLabelOpts.centerPointLabels ? helpers_segment.PI / valueCount : 0; + for(let i = 0; i < valueCount; i++){ + const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i)); + padding[i] = opts.padding; + const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle); + const plFont = helpers_segment.toFont(opts.font); + const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]); + labelSizes[i] = textSize; + const angleRadians = helpers_segment._normalizeAngle(scale.getIndexAngle(i) + additionalAngle); + const angle = Math.round(helpers_segment.toDegrees(angleRadians)); + const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180); + const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270); + updateLimits(limits, orig, angleRadians, hLimits, vLimits); + } + scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b); + scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding); +} +function updateLimits(limits, orig, angle, hLimits, vLimits) { + const sin = Math.abs(Math.sin(angle)); + const cos = Math.abs(Math.cos(angle)); + let x = 0; + let y = 0; + if (hLimits.start < orig.l) { + x = (orig.l - hLimits.start) / sin; + limits.l = Math.min(limits.l, orig.l - x); + } else if (hLimits.end > orig.r) { + x = (hLimits.end - orig.r) / sin; + limits.r = Math.max(limits.r, orig.r + x); + } + if (vLimits.start < orig.t) { + y = (orig.t - vLimits.start) / cos; + limits.t = Math.min(limits.t, orig.t - y); + } else if (vLimits.end > orig.b) { + y = (vLimits.end - orig.b) / cos; + limits.b = Math.max(limits.b, orig.b + y); + } +} +function createPointLabelItem(scale, index, itemOpts) { + const outerDistance = scale.drawingArea; + const { extra , additionalAngle , padding , size } = itemOpts; + const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle); + const angle = Math.round(helpers_segment.toDegrees(helpers_segment._normalizeAngle(pointLabelPosition.angle + helpers_segment.HALF_PI))); + const y = yForAngle(pointLabelPosition.y, size.h, angle); + const textAlign = getTextAlignForAngle(angle); + const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign); + return { + visible: true, + x: pointLabelPosition.x, + y, + textAlign, + left, + top: y, + right: left + size.w, + bottom: y + size.h + }; +} +function isNotOverlapped(item, area) { + if (!area) { + return true; + } + const { left , top , right , bottom } = item; + const apexesInArea = helpers_segment._isPointInArea({ + x: left, + y: top + }, area) || helpers_segment._isPointInArea({ + x: left, + y: bottom + }, area) || helpers_segment._isPointInArea({ + x: right, + y: top + }, area) || helpers_segment._isPointInArea({ + x: right, + y: bottom + }, area); + return !apexesInArea; +} +function buildPointLabelItems(scale, labelSizes, padding) { + const items = []; + const valueCount = scale._pointLabels.length; + const opts = scale.options; + const { centerPointLabels , display } = opts.pointLabels; + const itemOpts = { + extra: getTickBackdropHeight(opts) / 2, + additionalAngle: centerPointLabels ? helpers_segment.PI / valueCount : 0 + }; + let area; + for(let i = 0; i < valueCount; i++){ + itemOpts.padding = padding[i]; + itemOpts.size = labelSizes[i]; + const item = createPointLabelItem(scale, i, itemOpts); + items.push(item); + if (display === 'auto') { + item.visible = isNotOverlapped(item, area); + if (item.visible) { + area = item; + } + } + } + return items; +} +function getTextAlignForAngle(angle) { + if (angle === 0 || angle === 180) { + return 'center'; + } else if (angle < 180) { + return 'left'; + } + return 'right'; +} +function leftForTextAlign(x, w, align) { + if (align === 'right') { + x -= w; + } else if (align === 'center') { + x -= w / 2; + } + return x; +} +function yForAngle(y, h, angle) { + if (angle === 90 || angle === 270) { + y -= h / 2; + } else if (angle > 270 || angle < 90) { + y -= h; + } + return y; +} +function drawPointLabelBox(ctx, opts, item) { + const { left , top , right , bottom } = item; + const { backdropColor } = opts; + if (!helpers_segment.isNullOrUndef(backdropColor)) { + const borderRadius = helpers_segment.toTRBLCorners(opts.borderRadius); + const padding = helpers_segment.toPadding(opts.backdropPadding); + ctx.fillStyle = backdropColor; + const backdropLeft = left - padding.left; + const backdropTop = top - padding.top; + const backdropWidth = right - left + padding.width; + const backdropHeight = bottom - top + padding.height; + if (Object.values(borderRadius).some((v)=>v !== 0)) { + ctx.beginPath(); + helpers_segment.addRoundedRectPath(ctx, { + x: backdropLeft, + y: backdropTop, + w: backdropWidth, + h: backdropHeight, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight); + } + } +} +function drawPointLabels(scale, labelCount) { + const { ctx , options: { pointLabels } } = scale; + for(let i = labelCount - 1; i >= 0; i--){ + const item = scale._pointLabelItems[i]; + if (!item.visible) { + continue; + } + const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i)); + drawPointLabelBox(ctx, optsAtIndex, item); + const plFont = helpers_segment.toFont(optsAtIndex.font); + const { x , y , textAlign } = item; + helpers_segment.renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, { + color: optsAtIndex.color, + textAlign: textAlign, + textBaseline: 'middle' + }); + } +} +function pathRadiusLine(scale, radius, circular, labelCount) { + const { ctx } = scale; + if (circular) { + ctx.arc(scale.xCenter, scale.yCenter, radius, 0, helpers_segment.TAU); + } else { + let pointPosition = scale.getPointPosition(0, radius); + ctx.moveTo(pointPosition.x, pointPosition.y); + for(let i = 1; i < labelCount; i++){ + pointPosition = scale.getPointPosition(i, radius); + ctx.lineTo(pointPosition.x, pointPosition.y); + } + } +} +function drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) { + const ctx = scale.ctx; + const circular = gridLineOpts.circular; + const { color , lineWidth } = gridLineOpts; + if (!circular && !labelCount || !color || !lineWidth || radius < 0) { + return; + } + ctx.save(); + ctx.strokeStyle = color; + ctx.lineWidth = lineWidth; + ctx.setLineDash(borderOpts.dash || []); + ctx.lineDashOffset = borderOpts.dashOffset; + ctx.beginPath(); + pathRadiusLine(scale, radius, circular, labelCount); + ctx.closePath(); + ctx.stroke(); + ctx.restore(); +} +function createPointLabelContext(parent, index, label) { + return helpers_segment.createContext(parent, { + label, + index, + type: 'pointLabel' + }); +} +class RadialLinearScale extends LinearScaleBase { + static id = 'radialLinear'; + static defaults = { + display: true, + animate: true, + position: 'chartArea', + angleLines: { + display: true, + lineWidth: 1, + borderDash: [], + borderDashOffset: 0.0 + }, + grid: { + circular: false + }, + startAngle: 0, + ticks: { + showLabelBackdrop: true, + callback: helpers_segment.Ticks.formatters.numeric + }, + pointLabels: { + backdropColor: undefined, + backdropPadding: 2, + display: true, + font: { + size: 10 + }, + callback (label) { + return label; + }, + padding: 5, + centerPointLabels: false + } + }; + static defaultRoutes = { + 'angleLines.color': 'borderColor', + 'pointLabels.color': 'color', + 'ticks.color': 'color' + }; + static descriptors = { + angleLines: { + _fallback: 'grid' + } + }; + constructor(cfg){ + super(cfg); + this.xCenter = undefined; + this.yCenter = undefined; + this.drawingArea = undefined; + this._pointLabels = []; + this._pointLabelItems = []; + } + setDimensions() { + const padding = this._padding = helpers_segment.toPadding(getTickBackdropHeight(this.options) / 2); + const w = this.width = this.maxWidth - padding.width; + const h = this.height = this.maxHeight - padding.height; + this.xCenter = Math.floor(this.left + w / 2 + padding.left); + this.yCenter = Math.floor(this.top + h / 2 + padding.top); + this.drawingArea = Math.floor(Math.min(w, h) / 2); + } + determineDataLimits() { + const { min , max } = this.getMinMax(false); + this.min = helpers_segment.isNumberFinite(min) && !isNaN(min) ? min : 0; + this.max = helpers_segment.isNumberFinite(max) && !isNaN(max) ? max : 0; + this.handleTickRangeOptions(); + } + computeTickLimit() { + return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options)); + } + generateTickLabels(ticks) { + LinearScaleBase.prototype.generateTickLabels.call(this, ticks); + this._pointLabels = this.getLabels().map((value, index)=>{ + const label = helpers_segment.callback(this.options.pointLabels.callback, [ + value, + index + ], this); + return label || label === 0 ? label : ''; + }).filter((v, i)=>this.chart.getDataVisibility(i)); + } + fit() { + const opts = this.options; + if (opts.display && opts.pointLabels.display) { + fitWithPointLabels(this); + } else { + this.setCenterPoint(0, 0, 0, 0); + } + } + setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) { + this.xCenter += Math.floor((leftMovement - rightMovement) / 2); + this.yCenter += Math.floor((topMovement - bottomMovement) / 2); + this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement)); + } + getIndexAngle(index) { + const angleMultiplier = helpers_segment.TAU / (this._pointLabels.length || 1); + const startAngle = this.options.startAngle || 0; + return helpers_segment._normalizeAngle(index * angleMultiplier + helpers_segment.toRadians(startAngle)); + } + getDistanceFromCenterForValue(value) { + if (helpers_segment.isNullOrUndef(value)) { + return NaN; + } + const scalingFactor = this.drawingArea / (this.max - this.min); + if (this.options.reverse) { + return (this.max - value) * scalingFactor; + } + return (value - this.min) * scalingFactor; + } + getValueForDistanceFromCenter(distance) { + if (helpers_segment.isNullOrUndef(distance)) { + return NaN; + } + const scaledDistance = distance / (this.drawingArea / (this.max - this.min)); + return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance; + } + getPointLabelContext(index) { + const pointLabels = this._pointLabels || []; + if (index >= 0 && index < pointLabels.length) { + const pointLabel = pointLabels[index]; + return createPointLabelContext(this.getContext(), index, pointLabel); + } + } + getPointPosition(index, distanceFromCenter, additionalAngle = 0) { + const angle = this.getIndexAngle(index) - helpers_segment.HALF_PI + additionalAngle; + return { + x: Math.cos(angle) * distanceFromCenter + this.xCenter, + y: Math.sin(angle) * distanceFromCenter + this.yCenter, + angle + }; + } + getPointPositionForValue(index, value) { + return this.getPointPosition(index, this.getDistanceFromCenterForValue(value)); + } + getBasePosition(index) { + return this.getPointPositionForValue(index || 0, this.getBaseValue()); + } + getPointLabelPosition(index) { + const { left , top , right , bottom } = this._pointLabelItems[index]; + return { + left, + top, + right, + bottom + }; + } + drawBackground() { + const { backgroundColor , grid: { circular } } = this.options; + if (backgroundColor) { + const ctx = this.ctx; + ctx.save(); + ctx.beginPath(); + pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length); + ctx.closePath(); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + } + drawGrid() { + const ctx = this.ctx; + const opts = this.options; + const { angleLines , grid , border } = opts; + const labelCount = this._pointLabels.length; + let i, offset, position; + if (opts.pointLabels.display) { + drawPointLabels(this, labelCount); + } + if (grid.display) { + this.ticks.forEach((tick, index)=>{ + if (index !== 0 || index === 0 && this.min < 0) { + offset = this.getDistanceFromCenterForValue(tick.value); + const context = this.getContext(index); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder); + } + }); + } + if (angleLines.display) { + ctx.save(); + for(i = labelCount - 1; i >= 0; i--){ + const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i)); + const { color , lineWidth } = optsAtIndex; + if (!lineWidth || !color) { + continue; + } + ctx.lineWidth = lineWidth; + ctx.strokeStyle = color; + ctx.setLineDash(optsAtIndex.borderDash); + ctx.lineDashOffset = optsAtIndex.borderDashOffset; + offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max); + position = this.getPointPosition(i, offset); + ctx.beginPath(); + ctx.moveTo(this.xCenter, this.yCenter); + ctx.lineTo(position.x, position.y); + ctx.stroke(); + } + ctx.restore(); + } + } + drawBorder() {} + drawLabels() { + const ctx = this.ctx; + const opts = this.options; + const tickOpts = opts.ticks; + if (!tickOpts.display) { + return; + } + const startAngle = this.getIndexAngle(0); + let offset, width; + ctx.save(); + ctx.translate(this.xCenter, this.yCenter); + ctx.rotate(startAngle); + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + this.ticks.forEach((tick, index)=>{ + if (index === 0 && this.min >= 0 && !opts.reverse) { + return; + } + const optsAtIndex = tickOpts.setContext(this.getContext(index)); + const tickFont = helpers_segment.toFont(optsAtIndex.font); + offset = this.getDistanceFromCenterForValue(this.ticks[index].value); + if (optsAtIndex.showLabelBackdrop) { + ctx.font = tickFont.string; + width = ctx.measureText(tick.label).width; + ctx.fillStyle = optsAtIndex.backdropColor; + const padding = helpers_segment.toPadding(optsAtIndex.backdropPadding); + ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height); + } + helpers_segment.renderText(ctx, tick.label, 0, -offset, tickFont, { + color: optsAtIndex.color, + strokeColor: optsAtIndex.textStrokeColor, + strokeWidth: optsAtIndex.textStrokeWidth + }); + }); + ctx.restore(); + } + drawTitle() {} +} + +const INTERVALS = { + millisecond: { + common: true, + size: 1, + steps: 1000 + }, + second: { + common: true, + size: 1000, + steps: 60 + }, + minute: { + common: true, + size: 60000, + steps: 60 + }, + hour: { + common: true, + size: 3600000, + steps: 24 + }, + day: { + common: true, + size: 86400000, + steps: 30 + }, + week: { + common: false, + size: 604800000, + steps: 4 + }, + month: { + common: true, + size: 2.628e9, + steps: 12 + }, + quarter: { + common: false, + size: 7.884e9, + steps: 4 + }, + year: { + common: true, + size: 3.154e10 + } +}; + const UNITS = /* #__PURE__ */ Object.keys(INTERVALS); + function sorter(a, b) { + return a - b; +} + function parse(scale, input) { + if (helpers_segment.isNullOrUndef(input)) { + return null; + } + const adapter = scale._adapter; + const { parser , round , isoWeekday } = scale._parseOpts; + let value = input; + if (typeof parser === 'function') { + value = parser(value); + } + if (!helpers_segment.isNumberFinite(value)) { + value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value); + } + if (value === null) { + return null; + } + if (round) { + value = round === 'week' && (helpers_segment.isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round); + } + return +value; +} + function determineUnitForAutoTicks(minUnit, min, max, capacity) { + const ilen = UNITS.length; + for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){ + const interval = INTERVALS[UNITS[i]]; + const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER; + if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) { + return UNITS[i]; + } + } + return UNITS[ilen - 1]; +} + function determineUnitForFormatting(scale, numTicks, minUnit, min, max) { + for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){ + const unit = UNITS[i]; + if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) { + return unit; + } + } + return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0]; +} + function determineMajorUnit(unit) { + for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){ + if (INTERVALS[UNITS[i]].common) { + return UNITS[i]; + } + } +} + function addTick(ticks, time, timestamps) { + if (!timestamps) { + ticks[time] = true; + } else if (timestamps.length) { + const { lo , hi } = helpers_segment._lookup(timestamps, time); + const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi]; + ticks[timestamp] = true; + } +} + function setMajorTicks(scale, ticks, map, majorUnit) { + const adapter = scale._adapter; + const first = +adapter.startOf(ticks[0].value, majorUnit); + const last = ticks[ticks.length - 1].value; + let major, index; + for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){ + index = map[major]; + if (index >= 0) { + ticks[index].major = true; + } + } + return ticks; +} + function ticksFromTimestamps(scale, values, majorUnit) { + const ticks = []; + const map = {}; + const ilen = values.length; + let i, value; + for(i = 0; i < ilen; ++i){ + value = values[i]; + map[value] = i; + ticks.push({ + value, + major: false + }); + } + return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit); +} +class TimeScale extends Scale { + static id = 'time'; + static defaults = { + bounds: 'data', + adapters: {}, + time: { + parser: false, + unit: false, + round: false, + isoWeekday: false, + minUnit: 'millisecond', + displayFormats: {} + }, + ticks: { + source: 'auto', + callback: false, + major: { + enabled: false + } + } + }; + constructor(props){ + super(props); + this._cache = { + data: [], + labels: [], + all: [] + }; + this._unit = 'day'; + this._majorUnit = undefined; + this._offsets = {}; + this._normalized = false; + this._parseOpts = undefined; + } + init(scaleOpts, opts = {}) { + const time = scaleOpts.time || (scaleOpts.time = {}); + const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date); + adapter.init(opts); + helpers_segment.mergeIf(time.displayFormats, adapter.formats()); + this._parseOpts = { + parser: time.parser, + round: time.round, + isoWeekday: time.isoWeekday + }; + super.init(scaleOpts); + this._normalized = opts.normalized; + } + parse(raw, index) { + if (raw === undefined) { + return null; + } + return parse(this, raw); + } + beforeLayout() { + super.beforeLayout(); + this._cache = { + data: [], + labels: [], + all: [] + }; + } + determineDataLimits() { + const options = this.options; + const adapter = this._adapter; + const unit = options.time.unit || 'day'; + let { min , max , minDefined , maxDefined } = this.getUserBounds(); + function _applyBounds(bounds) { + if (!minDefined && !isNaN(bounds.min)) { + min = Math.min(min, bounds.min); + } + if (!maxDefined && !isNaN(bounds.max)) { + max = Math.max(max, bounds.max); + } + } + if (!minDefined || !maxDefined) { + _applyBounds(this._getLabelBounds()); + if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') { + _applyBounds(this.getMinMax(false)); + } + } + min = helpers_segment.isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit); + max = helpers_segment.isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1; + this.min = Math.min(min, max - 1); + this.max = Math.max(min + 1, max); + } + _getLabelBounds() { + const arr = this.getLabelTimestamps(); + let min = Number.POSITIVE_INFINITY; + let max = Number.NEGATIVE_INFINITY; + if (arr.length) { + min = arr[0]; + max = arr[arr.length - 1]; + } + return { + min, + max + }; + } + buildTicks() { + const options = this.options; + const timeOpts = options.time; + const tickOpts = options.ticks; + const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate(); + if (options.bounds === 'ticks' && timestamps.length) { + this.min = this._userMin || timestamps[0]; + this.max = this._userMax || timestamps[timestamps.length - 1]; + } + const min = this.min; + const max = this.max; + const ticks = helpers_segment._filterBetween(timestamps, min, max); + this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max)); + this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit); + this.initOffsets(timestamps); + if (options.reverse) { + ticks.reverse(); + } + return ticksFromTimestamps(this, ticks, this._majorUnit); + } + afterAutoSkip() { + if (this.options.offsetAfterAutoskip) { + this.initOffsets(this.ticks.map((tick)=>+tick.value)); + } + } + initOffsets(timestamps = []) { + let start = 0; + let end = 0; + let first, last; + if (this.options.offset && timestamps.length) { + first = this.getDecimalForValue(timestamps[0]); + if (timestamps.length === 1) { + start = 1 - first; + } else { + start = (this.getDecimalForValue(timestamps[1]) - first) / 2; + } + last = this.getDecimalForValue(timestamps[timestamps.length - 1]); + if (timestamps.length === 1) { + end = last; + } else { + end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2; + } + } + const limit = timestamps.length < 3 ? 0.5 : 0.25; + start = helpers_segment._limitValue(start, 0, limit); + end = helpers_segment._limitValue(end, 0, limit); + this._offsets = { + start, + end, + factor: 1 / (start + 1 + end) + }; + } + _generate() { + const adapter = this._adapter; + const min = this.min; + const max = this.max; + const options = this.options; + const timeOpts = options.time; + const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min)); + const stepSize = helpers_segment.valueOrDefault(options.ticks.stepSize, 1); + const weekday = minor === 'week' ? timeOpts.isoWeekday : false; + const hasWeekday = helpers_segment.isNumber(weekday) || weekday === true; + const ticks = {}; + let first = min; + let time, count; + if (hasWeekday) { + first = +adapter.startOf(first, 'isoWeek', weekday); + } + first = +adapter.startOf(first, hasWeekday ? 'day' : minor); + if (adapter.diff(max, min, minor) > 100000 * stepSize) { + throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor); + } + const timestamps = options.ticks.source === 'data' && this.getDataTimestamps(); + for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){ + addTick(ticks, time, timestamps); + } + if (time === max || options.bounds === 'ticks' || count === 1) { + addTick(ticks, time, timestamps); + } + return Object.keys(ticks).sort(sorter).map((x)=>+x); + } + getLabelForValue(value) { + const adapter = this._adapter; + const timeOpts = this.options.time; + if (timeOpts.tooltipFormat) { + return adapter.format(value, timeOpts.tooltipFormat); + } + return adapter.format(value, timeOpts.displayFormats.datetime); + } + format(value, format) { + const options = this.options; + const formats = options.time.displayFormats; + const unit = this._unit; + const fmt = format || formats[unit]; + return this._adapter.format(value, fmt); + } + _tickFormatFunction(time, index, ticks, format) { + const options = this.options; + const formatter = options.ticks.callback; + if (formatter) { + return helpers_segment.callback(formatter, [ + time, + index, + ticks + ], this); + } + const formats = options.time.displayFormats; + const unit = this._unit; + const majorUnit = this._majorUnit; + const minorFormat = unit && formats[unit]; + const majorFormat = majorUnit && formats[majorUnit]; + const tick = ticks[index]; + const major = majorUnit && majorFormat && tick && tick.major; + return this._adapter.format(time, format || (major ? majorFormat : minorFormat)); + } + generateTickLabels(ticks) { + let i, ilen, tick; + for(i = 0, ilen = ticks.length; i < ilen; ++i){ + tick = ticks[i]; + tick.label = this._tickFormatFunction(tick.value, i, ticks); + } + } + getDecimalForValue(value) { + return value === null ? NaN : (value - this.min) / (this.max - this.min); + } + getPixelForValue(value) { + const offsets = this._offsets; + const pos = this.getDecimalForValue(value); + return this.getPixelForDecimal((offsets.start + pos) * offsets.factor); + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return this.min + pos * (this.max - this.min); + } + _getLabelSize(label) { + const ticksOpts = this.options.ticks; + const tickLabelWidth = this.ctx.measureText(label).width; + const angle = helpers_segment.toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation); + const cosRotation = Math.cos(angle); + const sinRotation = Math.sin(angle); + const tickFontSize = this._resolveTickFontOptions(0).size; + return { + w: tickLabelWidth * cosRotation + tickFontSize * sinRotation, + h: tickLabelWidth * sinRotation + tickFontSize * cosRotation + }; + } + _getLabelCapacity(exampleTime) { + const timeOpts = this.options.time; + const displayFormats = timeOpts.displayFormats; + const format = displayFormats[timeOpts.unit] || displayFormats.millisecond; + const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [ + exampleTime + ], this._majorUnit), format); + const size = this._getLabelSize(exampleLabel); + const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1; + return capacity > 0 ? capacity : 1; + } + getDataTimestamps() { + let timestamps = this._cache.data || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const metas = this.getMatchingVisibleMetas(); + if (this._normalized && metas.length) { + return this._cache.data = metas[0].controller.getAllParsedValues(this); + } + for(i = 0, ilen = metas.length; i < ilen; ++i){ + timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this)); + } + return this._cache.data = this.normalize(timestamps); + } + getLabelTimestamps() { + const timestamps = this._cache.labels || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const labels = this.getLabels(); + for(i = 0, ilen = labels.length; i < ilen; ++i){ + timestamps.push(parse(this, labels[i])); + } + return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps); + } + normalize(values) { + return helpers_segment._arrayUnique(values.sort(sorter)); + } +} + +function interpolate(table, val, reverse) { + let lo = 0; + let hi = table.length - 1; + let prevSource, nextSource, prevTarget, nextTarget; + if (reverse) { + if (val >= table[lo].pos && val <= table[hi].pos) { + ({ lo , hi } = helpers_segment._lookupByKey(table, 'pos', val)); + } + ({ pos: prevSource , time: prevTarget } = table[lo]); + ({ pos: nextSource , time: nextTarget } = table[hi]); + } else { + if (val >= table[lo].time && val <= table[hi].time) { + ({ lo , hi } = helpers_segment._lookupByKey(table, 'time', val)); + } + ({ time: prevSource , pos: prevTarget } = table[lo]); + ({ time: nextSource , pos: nextTarget } = table[hi]); + } + const span = nextSource - prevSource; + return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget; +} +class TimeSeriesScale extends TimeScale { + static id = 'timeseries'; + static defaults = TimeScale.defaults; + constructor(props){ + super(props); + this._table = []; + this._minPos = undefined; + this._tableRange = undefined; + } + initOffsets() { + const timestamps = this._getTimestampsForTable(); + const table = this._table = this.buildLookupTable(timestamps); + this._minPos = interpolate(table, this.min); + this._tableRange = interpolate(table, this.max) - this._minPos; + super.initOffsets(timestamps); + } + buildLookupTable(timestamps) { + const { min , max } = this; + const items = []; + const table = []; + let i, ilen, prev, curr, next; + for(i = 0, ilen = timestamps.length; i < ilen; ++i){ + curr = timestamps[i]; + if (curr >= min && curr <= max) { + items.push(curr); + } + } + if (items.length < 2) { + return [ + { + time: min, + pos: 0 + }, + { + time: max, + pos: 1 + } + ]; + } + for(i = 0, ilen = items.length; i < ilen; ++i){ + next = items[i + 1]; + prev = items[i - 1]; + curr = items[i]; + if (Math.round((next + prev) / 2) !== curr) { + table.push({ + time: curr, + pos: i / (ilen - 1) + }); + } + } + return table; + } + _generate() { + const min = this.min; + const max = this.max; + let timestamps = super.getDataTimestamps(); + if (!timestamps.includes(min) || !timestamps.length) { + timestamps.splice(0, 0, min); + } + if (!timestamps.includes(max) || timestamps.length === 1) { + timestamps.push(max); + } + return timestamps.sort((a, b)=>a - b); + } + _getTimestampsForTable() { + let timestamps = this._cache.all || []; + if (timestamps.length) { + return timestamps; + } + const data = this.getDataTimestamps(); + const label = this.getLabelTimestamps(); + if (data.length && label.length) { + timestamps = this.normalize(data.concat(label)); + } else { + timestamps = data.length ? data : label; + } + timestamps = this._cache.all = timestamps; + return timestamps; + } + getDecimalForValue(value) { + return (interpolate(this._table, value) - this._minPos) / this._tableRange; + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return interpolate(this._table, decimal * this._tableRange + this._minPos, true); + } +} + +var scales = /*#__PURE__*/Object.freeze({ +__proto__: null, +CategoryScale: CategoryScale, +LinearScale: LinearScale, +LogarithmicScale: LogarithmicScale, +RadialLinearScale: RadialLinearScale, +TimeScale: TimeScale, +TimeSeriesScale: TimeSeriesScale +}); + +const registerables = [ + controllers, + elements, + plugins, + scales +]; + +exports.Ticks = helpers_segment.Ticks; +exports.defaults = helpers_segment.defaults; +exports.Animation = Animation; +exports.Animations = Animations; +exports.ArcElement = ArcElement; +exports.BarController = BarController; +exports.BarElement = BarElement; +exports.BasePlatform = BasePlatform; +exports.BasicPlatform = BasicPlatform; +exports.BubbleController = BubbleController; +exports.CategoryScale = CategoryScale; +exports.Chart = Chart; +exports.Colors = plugin_colors; +exports.DatasetController = DatasetController; +exports.Decimation = plugin_decimation; +exports.DomPlatform = DomPlatform; +exports.DoughnutController = DoughnutController; +exports.Element = Element; +exports.Filler = index; +exports.Interaction = Interaction; +exports.Legend = plugin_legend; +exports.LineController = LineController; +exports.LineElement = LineElement; +exports.LinearScale = LinearScale; +exports.LogarithmicScale = LogarithmicScale; +exports.PieController = PieController; +exports.PointElement = PointElement; +exports.PolarAreaController = PolarAreaController; +exports.RadarController = RadarController; +exports.RadialLinearScale = RadialLinearScale; +exports.Scale = Scale; +exports.ScatterController = ScatterController; +exports.SubTitle = plugin_subtitle; +exports.TimeScale = TimeScale; +exports.TimeSeriesScale = TimeSeriesScale; +exports.Title = plugin_title; +exports.Tooltip = plugin_tooltip; +exports._adapters = adapters; +exports._detectPlatform = _detectPlatform; +exports.animator = animator; +exports.controllers = controllers; +exports.elements = elements; +exports.layouts = layouts; +exports.plugins = plugins; +exports.registerables = registerables; +exports.registry = registry; +exports.scales = scales; +//# sourceMappingURL=chart.cjs.map diff --git a/seller_1/node_modules/chart.js/dist/chart.cjs.map b/seller_1/node_modules/chart.js/dist/chart.cjs.map new file mode 100644 index 0000000..d09c616 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"chart.cjs","sources":["../src/core/core.animator.js","../src/core/core.animation.js","../src/core/core.animations.js","../src/core/core.datasetController.js","../src/controllers/controller.bar.js","../src/controllers/controller.bubble.js","../src/controllers/controller.doughnut.js","../src/controllers/controller.line.js","../src/controllers/controller.polarArea.js","../src/controllers/controller.pie.js","../src/controllers/controller.radar.js","../src/controllers/controller.scatter.js","../src/core/core.adapters.ts","../src/core/core.interaction.js","../src/core/core.layouts.js","../src/platform/platform.base.js","../src/platform/platform.basic.js","../src/platform/platform.dom.js","../src/platform/index.js","../src/core/core.element.ts","../src/core/core.scale.autoskip.js","../src/core/core.scale.js","../src/core/core.typedRegistry.js","../src/core/core.registry.js","../src/core/core.plugins.js","../src/core/core.config.js","../src/core/core.controller.js","../src/elements/element.arc.ts","../src/elements/element.line.js","../src/elements/element.point.ts","../src/elements/element.bar.js","../src/plugins/plugin.colors.ts","../src/plugins/plugin.decimation.js","../src/plugins/plugin.filler/filler.segment.js","../src/plugins/plugin.filler/filler.helper.js","../src/plugins/plugin.filler/filler.options.js","../src/plugins/plugin.filler/filler.target.stack.js","../src/plugins/plugin.filler/simpleArc.js","../src/plugins/plugin.filler/filler.target.js","../src/plugins/plugin.filler/filler.drawing.js","../src/plugins/plugin.filler/index.js","../src/plugins/plugin.legend.js","../src/plugins/plugin.title.js","../src/plugins/plugin.subtitle.js","../src/plugins/plugin.tooltip.js","../src/scales/scale.category.js","../src/scales/scale.linearbase.js","../src/scales/scale.linear.js","../src/scales/scale.logarithmic.js","../src/scales/scale.radialLinear.js","../src/scales/scale.time.js","../src/scales/scale.timeseries.js","../src/index.ts"],"sourcesContent":["import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n let found = false;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n found = true;\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n\n if (!found && !options.all) {\n return 0;\n }\n\n return value;\n}\n\nfunction convertObjectDataToArray(data, meta) {\n const {iScale, vScale} = meta;\n const iAxisKey = iScale.axis === 'x' ? 'x' : 'y';\n const vAxisKey = vScale.axis === 'x' ? 'x' : 'y';\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n [iAxisKey]: key,\n [vAxisKey]: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n const meta = this._cachedMeta;\n this._data = convertObjectDataToArray(data, meta);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n meta._stacked = isStacked(meta.vScale, meta);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const currentParsed = this._cachedMeta.controller.getParsed(dataIndex);\n const iScaleValue = currentParsed && currentParsed[iScale.axis];\n\n const skipNull = (meta) => {\n const parsed = meta._parsed.find(item => item[iScale.axis] === iScaleValue);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter<T extends AnyObject = AnyObject> {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter<T>, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter<T>): Record<string, string>;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract<T = void>(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override<T extends AnyObject = AnyObject>(\n members: Partial<Omit<DateAdapter<T>, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record<string, string> {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n if (node) {\n node.addEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction removeListener(chart, type, listener) {\n if (chart && chart.canvas) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = canvas && _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element<T = AnyObject, O = AnyObject> {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record<keyof T, Animation>;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;\n getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;\n getProps(props: string[], final?: boolean): Partial<Record<string, unknown>> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record<string, unknown>;\n }\n const ret: Record<string, unknown> = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n case 'inner':\n if (i === ilen - 1) {\n left -= width;\n } else if (i > 0) {\n left -= width / 2;\n }\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n // Unset pending resize request now to avoid possible recursion within _resize\n this._resizeBeforeDraw = null;\n this._resize(width, height);\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the event inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element<ArcProps, ArcOptions> {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle;\n const betweenAngles = _circumference >= TAU || nonZeroBetween;\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial<PointOptions & PointHoverOptions>) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController, defaults} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record<string, ColorsDescriptor>\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nfunction containsDefaultColorsDefenitions() {\n return defaults.borderColor !== 'rgba(0,0,0,0.1)' || defaults.backgroundColor !== 'rgba(0,0,0,0.1)';\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n const containsColorDefenition = (\n containsColorsDefinitions(datasets) ||\n containsColorsDefinition(chartOptions) ||\n (elements && containsColorsDefinitions(elements)) ||\n containsDefaultColorsDefenitions());\n\n if (!options.forceOverride && containsColorDefenition) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let xSet = new Set();\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n xSet.add(pos.x);\n y += pos.y;\n ++count;\n }\n }\n\n // No visible items where found, return false so we don't have to divide by 0 which reduces in NaN\n if (count === 0 || xSet.size === 0) {\n return false;\n }\n\n const xAverage = [...xSet].reduce((a, b) => a + b) / xSet.size;\n\n return {\n x: xAverage,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record<keyof typeof defaultCallbacks, Function>} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n // But make sure that active elements are still valid.\n return lastActive.filter(i =>\n this.chart.data.datasets[i.datasetIndex] &&\n this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined\n );\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash || []);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0 || (index === 0 && this.min < 0)) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if ((index === 0 && this.min >= 0) && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object<Unit, Interval>}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object<number,object>} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n"],"names":["Animator","constructor","_request","_charts","Map","_running","_lastDate","undefined","_notify","chart","anims","date","type","callbacks","listeners","numSteps","duration","forEach","fn","initial","currentStep","Math","min","start","_refresh","requestAnimFrame","call","window","_update","Date","now","remaining","running","items","length","i","draw","item","_active","_total","tick","pop","_getAnims","charts","get","complete","progress","set","listen","event","cb","push","add","has","reduce","acc","cur","max","_duration","stop","cancel","remove","delete","transparent","interpolators","boolean","from","to","factor","color","c0","helpersColor","c1","valid","mix","hexString","number","Animation","cfg","target","prop","currentValue","resolve","_fn","_easing","effects","easing","linear","_start","floor","delay","_loop","loop","_target","_prop","_from","_to","_promises","active","update","elapsed","remain","wait","promises","Promise","res","rej","resolved","method","Animations","config","_chart","_properties","configure","isObject","animationOptions","Object","keys","defaults","animation","animatedProps","getOwnPropertyNames","key","option","isArray","properties","_animateOptions","values","newOptions","options","resolveTargetOptions","animations","_createAnimations","$shared","awaitAll","$animations","then","props","charAt","value","size","assign","animator","anim","all","scaleClip","scale","allowedOverflow","opts","reverse","end","defaultClip","xScale","yScale","x","y","top","right","bottom","left","toClip","t","r","b","l","disabled","getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","ilen","index","applyStack","stack","dsIndex","singleMode","mode","datasetIndex","otherValue","found","isFinite","sign","convertObjectDataToArray","data","meta","iScale","vScale","iAxisKey","axis","vAxisKey","adata","Array","isStacked","stacked","getStackKey","indexScale","valueScale","id","getUserBounds","minDefined","maxDefined","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","getOrCreateStack","stacks","stackKey","indexValue","subStack","getLastIndexInStack","positive","getMatchingVisibleMetas","updateStacks","controller","parsed","_cachedMeta","_stacks","iAxis","vAxis","itemStacks","_top","_bottom","visualValues","_visualValues","getFirstScaleId","scales","filter","shift","createDatasetContext","parent","createContext","dataset","createDataContext","element","dataIndex","raw","clearStacks","_parsed","isDirectUpdateMode","cloneIfNotShared","cached","shared","createStack","canStack","hidden","_stacked","DatasetController","datasetElementType","dataElementType","_ctx","ctx","_cachedDataOpts","getMeta","_type","_parsing","_data","_objectData","_sharedOptions","_drawStart","_drawCount","enableOptionSharing","supportsDecimation","$context","_syncList","initialize","linkScales","addElements","fill","isPluginEnabled","console","warn","updateIndex","getDataset","chooseId","xid","xAxisID","valueOrDefault","yid","yAxisID","rid","rAxisID","indexAxis","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","datasets","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","unlistenArrayEvents","_dataCheck","isExtensible","listenArrayEvents","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","scopes","getOptionScopes","createResolver","getContext","parsing","parse","count","sorted","_sorted","prev","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","resolveObjectKey","getParsed","getDataElement","updateRangeFromParsed","range","parsedValue","NaN","getMinMax","otherScale","otherMin","otherMax","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","clip","elements","area","chartArea","drawActiveElementsOnTop","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","context","_resolveElementOptions","elementType","cache","cacheKey","sharing","defined","datasetElementScopeKeys","prefixes","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","_cacheable","getSharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","arg1","arg2","numMeta","numData","_insertElements","_removeElements","move","arr","updateElements","removed","splice","_sync","args","_dataChanges","_onDataPush","arguments","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","getAllScaleValues","_cache","$bar","visibleMetas","concat","_arrayUnique","sort","a","computeMinSampleSize","_length","curr","updateMinAndPrev","abs","getPixelForValue","ticks","getPixelForTick","computeFitCategoryTraits","ruler","stackCount","thickness","barThickness","ratio","isNullOrUndef","categoryPercentage","barPercentage","chunk","pixels","computeFlexCategoryTraits","next","percent","parseFloatBar","entry","startValue","endValue","barStart","barEnd","_custom","parseValue","parseArrayOrPrimitive","isFloatBar","custom","barSign","actualBase","isHorizontal","borderProps","horizontal","base","setBorderSkipped","edge","borderSkipped","enableBorderRadius","parseEdge","swap","startEnd","orig","v1","v2","v","setInflateAmount","inflateAmount","BarController","grouped","numbers","overrides","_index_","offset","grid","_value_","beginAtZero","obj","bars","getBasePixel","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","center","height","width","_getStacks","last","currentParsed","iScaleValue","skipNull","find","val","isNaN","indexOf","_getStackCount","_getStackIndex","name","_startPixel","_endPixel","baseValue","minBarLength","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","Infinity","stackIndex","rects","BubbleController","radius","points","point","iPixel","vPixel","skip","getRatioAndOffset","rotation","circumference","cutout","ratioX","ratioY","offsetX","offsetY","TAU","startAngle","endAngle","startX","cos","startY","sin","endX","endY","calcMax","angle","_angleBetween","calcMin","maxX","maxY","HALF_PI","minX","PI","minY","DoughnutController","animateRotate","animateScale","spacing","descriptors","_scriptable","_indexable","startsWith","aspectRatio","plugins","legend","generateLabels","pointStyle","map","style","text","fillStyle","backgroundColor","strokeStyle","borderColor","fontColor","lineWidth","borderWidth","onClick","e","legendItem","toggleDataVisibility","innerRadius","outerRadius","getter","_getRotation","toRadians","_getCircumference","_getRotationExtents","isDatasetVisible","arcs","getMaxBorderWidth","getMaxOffset","maxSize","toPercentage","chartWeight","_getRingWeight","maxWidth","maxHeight","maxRadius","toDimension","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","calculateCircumference","animationOpts","centerX","centerY","arc","metaData","formatNumber","locale","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","weight","LineController","showLine","spanGaps","line","_dataset","animationsDisabled","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_datasetIndex","_decimated","segment","animated","maxGapLength","isNumber","directUpdate","pointsCount","prevParsed","nullData","border","firstPoint","lastPoint","updateControlPoints","PolarAreaController","angleLines","display","circular","pointLabels","_parseObjectDataRadialScale","bind","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","PieController","RadarController","_fullLoop","pointPosition","getPointPositionForValue","ScatterController","interaction","registry","getElement","abstract","Error","DateAdapterBase","override","members","prototype","init","formats","format","diff","startOf","endOf","_date","binarySearch","metaset","intersect","lookupMethod","_reversePixels","_rlookupByKey","_lookupByKey","el","getRange","lo","hi","evaluateInteractionItems","position","handler","getSortedVisibleDatasetMetas","j","getDistanceMetricForAxis","useX","useY","pt1","pt2","deltaX","deltaY","sqrt","pow","getIntersectItems","useFinalPosition","includeInvisible","isPointInArea","evaluationFunc","_isPointInArea","inRange","getNearestRadialItems","getProps","getAngleFromPoint","getNearestCartesianItems","distanceMetric","minDistance","getCenterPoint","pointInArea","distance","getNearestItems","getAxisItems","rangeMethod","intersectsItem","modes","getRelativePosition","nearest","STATIC_POSITIONS","filterByPosition","array","pos","filterDynamicPositionByAxis","box","sortByWeight","v0","wrapBoxes","boxes","layoutBoxes","stackWeight","buildStacks","layouts","wrap","includes","_stack","placed","setLayoutDims","params","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","availableWidth","availableHeight","buildLayoutBoxes","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","getCombinedMax","maxPadding","updateMaxPadding","boxPadding","updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","w","heightChanged","h","same","other","handleMaxPadding","updatePos","change","getMargins","marginForPositions","positions","margin","fitBoxes","refitBoxes","refit","changed","setBoxDims","placeBoxes","userPadding","padding","addBox","_layers","z","removeBox","layoutItem","minPadding","toPadding","verticalBoxes","horizontalBoxes","each","beforeLayout","visibleVerticalBoxCount","BasePlatform","acquireContext","canvas","releaseContext","addEventListener","listener","removeEventListener","getDevicePixelRatio","getMaximumSize","isAttached","updateConfig","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","isNullOrEmpty","initCanvas","renderHeight","getAttribute","renderWidth","boxSizing","displayWidth","readUsedSize","displayHeight","eventListenerOptions","supportsEventListenerOptions","passive","addListener","node","removeListener","fromNativeEvent","native","nodeListContains","nodeList","contains","createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","document","childList","subtree","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","devicePixelRatio","resize","currentDevicePixelRatio","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","container","_getParentNode","throttled","clientWidth","ResizeObserver","contentRect","releaseObserver","disconnect","createProxyAndListen","proxy","DomPlatform","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","isConnected","_detectPlatform","_isDomSupported","OffscreenCanvas","Element","defaultRoutes","tooltipPosition","hasValue","final","ret","autoSkip","tickOpts","determinedMaxTicks","determineMaxTicks","ticksLimit","maxTicksLimit","majorIndices","major","enabled","getMajorIndices","numMajorIndices","first","newTicks","skipMajors","calculateSpacing","avgMajorSpacing","round","tickLength","_tickSize","maxScale","maxChart","_maxLength","evenMajorSpacing","getEvenSpacing","factors","_factorize","result","ceil","majorStart","majorEnd","len","reverseAlign","align","offsetFromEdge","getTicksLimit","ticksLength","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","epsilon","lineValue","garbageCollect","caches","gc","gcLen","getTickMarkLength","drawTicks","getTitleHeight","fallback","font","toFont","lines","lineHeight","createScaleContext","createTickContext","titleAlign","_toLeftRightCenter","titleArgs","titleX","titleY","_alignStartEnd","positionAxisID","Scale","_margins","paddingTop","paddingBottom","paddingLeft","paddingRight","labelRotation","_range","_gridLineItems","_labelItems","_labelSizes","_longestTextCache","_userMax","_userMin","_suggestedMax","_suggestedMin","_ticksLength","_borderValue","_dataLimitsCached","setContext","suggestedMin","suggestedMax","finiteOrDefault","metas","getTicks","xLabels","yLabels","getLabelItems","_computeLabelItems","beforeUpdate","margins","grace","sampleSize","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","_addGrace","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","source","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","callback","afterTickToLabelConversion","numTicks","minRotation","maxRotation","tickWidth","maxLabelDiagonal","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","_limitValue","title","toDegrees","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","mirror","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","widths","heights","widestLabelSize","highestLabelSize","jlen","tickFont","fontString","nestedLabel","_resolveTickFontOptions","string","_measureText","valueAt","idx","pixel","decimal","_int16Range","_alignPixel","getDecimalForPixel","getBaseValue","optionTicks","rot","autoSkipPadding","_computeGridLineItems","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","limit","step","optsAtIndex","optsAtIndexBorder","lineColor","borderDash","dash","borderDashOffset","dashOffset","tickColor","tickBorderDash","tickBorderDashOffset","crossAlign","tickAndPadding","hTickAndPadding","textAlign","lineCount","textOffset","textBaseline","_getXAxisLabelAlignment","_getYAxisLabelAlignment","labelOffset","halfCount","strokeColor","textStrokeColor","strokeWidth","textStrokeWidth","tickTextAlign","showLabelBackdrop","backdrop","labelPadding","backdropPadding","backdropColor","translation","_computeLabelArea","drawBackground","save","fillRect","restore","findIndex","drawGrid","drawLine","p1","p2","setLineDash","lineDashOffset","beginPath","moveTo","lineTo","stroke","drawOnChartArea","drawBorder","lastLineWidth","drawLabels","clipArea","renderTextOptions","renderText","unclipArea","drawTitle","tz","gz","bz","axisID","_maxDigits","fontSize","TypedRegistry","scope","create","isForType","isPrototypeOf","register","proto","getPrototypeOf","parentScope","isIChartComponent","registerDefaults","unregister","itemDefaults","merge","routeDefaults","describe","routes","property","propertyParts","split","sourceName","sourceScope","join","parts","targetName","targetScope","route","Registry","controllers","_typedRegistries","_each","addControllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","arg","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_capitalize","PluginService","_init","notify","hook","_createDescriptors","_descriptors","descriptor","plugin","callCallback","cancelable","invalidate","_oldCache","_notifyStateChanges","allPlugins","createDescriptors","previousDescriptors","some","localIds","local","getOpts","pluginOpts","pluginScopeKeys","scriptable","indexable","allKeys","getIndexAxis","datasetDefaults","datasetOptions","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","scaleOptions","toLowerCase","getAxisFromDataset","retrieveAxisFromDatasets","boundDs","d","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","error","_proxy","defaultId","defaultScaleOptions","mergeIf","defaultID","initOptions","initData","initConfig","keyCache","keysCached","Set","cachedKeys","generate","addIfFound","Config","_config","_scopeCache","_resolverCache","platform","clearCache","clear","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","resolver","subPrefixes","getResolver","needContext","isFunction","subResolver","_attachContext","descriptorDefaults","resolverCache","_createResolver","p","hasFunction","isScriptable","isIndexable","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onComplete","onAnimationProgress","onProgress","getCanvas","getElementById","instances","getChart","c","moveNumericKeys","intKey","determineLastEvent","lastEvent","inChartArea","isClick","getSizeForArea","field","getDatasetArea","Chart","version","invalidatePlugins","userConfig","initialCanvas","existingChart","uid","_options","_aspectRatio","_metasets","_lastEvent","_listeners","_responsiveListeners","_sortedMetasets","_plugins","_hiddenIndices","attached","_doResize","debounce","resizeDelay","_initialize","maintainAspectRatio","responsive","retinaScale","bindEvents","clearCanvas","_resize","_resizeBeforeDraw","newSize","newRatio","onResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_destroyDatasetMeta","slice","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","visible","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_minPadding","autoPadding","_updateLayout","_updateDatasets","_eventHandler","_updateHoverStyles","existingEvents","newEvents","events","setsEqual","unbindEvents","changes","_getUniformDataChanges","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","getElementsAtEventForMode","Interaction","setDatasetVisibility","_updateVisibility","hide","show","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","_remove","detached","updateHoverStyle","prefix","getActiveElements","setActiveElements","activeElements","lastActive","_elementsEqual","pluginId","replay","hoverOptions","hover","deactivated","activated","eventFilter","_handleEvent","_getActiveElements","_isClickEvent","onHover","clipArc","pixelMargin","angleMargin","closePath","toRadiusCorners","_readValueToProps","parseBorderRadius","angleDelta","o","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStart","outerEnd","innerStart","innerEnd","rThetaToXY","theta","pathArc","innerR","spacingOffset","alpha","noSpacingInnerRadius","noSpacingOuterRadius","avNogSpacingRadius","adjustedAngle","beta","angleOffset","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","drawArc","fullCircles","borderJoinStyle","inner","lineJoin","ArcElement","chartX","chartY","rAdjust","nonZeroBetween","betweenAngles","withinRadius","_isBetween","halfAngle","halfRadius","translate","fix","radiusOffset","setStyle","lineCap","borderCapStyle","previous","getLineMethod","stepped","_steppedLineTo","tension","cubicInterpolationMode","_bezierCurveTo","pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","outside","pathSegment","lineMethod","fastPathSegment","avgX","countX","prevX","lastY","pointIndex","drawX","truncX","_getSegmentMethod","useFastPath","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","path","_path","Path2D","strokePathDirect","segments","segmentMethod","usePath2D","LineElement","capBezierPoints","_points","_segments","_pointsUpdated","_updateBezierControlPoints","_computeSegments","interpolate","_boundSegments","_interpolate","interpolated","hitRadius","PointElement","hoverRadius","mouseX","mouseY","inXRange","inYRange","drawPoint","getBarBounds","bar","half","skipOrLimit","parseBorderWidth","maxW","maxH","toTRBL","toTRBLCorners","maxR","enableBorder","topLeft","topRight","bottomLeft","bottomRight","boundingRects","bounds","outer","skipX","skipY","skipBoth","hasRadius","addNormalRectPath","rect","inflateRect","amount","refRect","BarElement","addRectPath","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","replace","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","k","containsColorsDefinition","containsDefaultColorsDefenitions","forceOverride","_args","chartOptions","containsColorDefenition","colorizer","lttbDecimation","samples","decimated","bucketWidth","sampledIndex","endIndex","maxAreaPoint","maxArea","nextA","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","cleanDecimatedDataset","defineProperty","configurable","enumerable","writable","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","pointCount","algorithm","beforeElementsUpdate","xAxis","threshold","tpoints","_findSegmentEnd","_getBounds","targetSegments","tgt","subBounds","fillSources","_boundSegment","fillSource","_getEdge","_normalizeAngle","_pointsFromSegments","boundary","linePoints","_createBoundaryLine","_shouldApplyFill","_resolveTarget","sources","propagate","visited","_decodeFill","parseFillOption","parseFloat","decodeTargetIndex","firstCh","_getTargetPixel","_getTargetValue","fillOption","_buildStackLine","sourcePoints","linesBelow","getLinesBelow","addPointsBelow","below","unshift","sourcePoint","postponed","findPoint","pointValue","firstValue","lastValue","simpleArc","_getTarget","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","lineOpts","above","doFill","clipVertical","clipY","lineLoop","src","notShape","clipBounds","interpolatedLineTo","targetLoop","interpolatedPoint","afterDatasetsUpdate","$filler","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","itemsEqual","Legend","_added","legendHitBoxes","_hoveredItem","doughnutMode","legendItems","columnSizes","lineWidths","buildLabels","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","totalHeight","row","itemWidth","measureText","_itemHeight","heightLimit","totalWidth","currentColWidth","currentColHeight","col","calculateItemSize","adjustHitBoxes","rtl","rtlHelper","getRtlAdapter","hitbox","leftForLtr","_draw","defaultColor","halfFontSize","cursor","drawLegendBox","lineDash","drawOptions","SQRT2","xPlus","drawPointLegend","yBoxTop","xBoxLeft","fillText","strikethrough","overrideTextDirection","textDirection","textWidth","setWidth","realX","_textX","fontLineHeight","calculateLegendItemHeight","restoreTextDirection","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","isListened","hoveredItem","sameItem","onLeave","calculateItemWidth","calculateItemHeight","legendItemText","_element","afterEvent","ci","useBorderRadius","Title","_padding","textSize","_drawArgs","fontOpts","createTitle","titleBlock","WeakMap","positioners","average","xSet","xAverage","eventPosition","nearestElement","distanceBetweenPoints","tp","pushOrConcat","toPush","apply","splitNewlines","str","String","createTooltipItem","formattedValue","getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","determineYAlign","doesNotFitWithAlign","xAlign","caret","caretSize","caretPadding","determineXAlign","yAlign","chartWidth","determineAlignment","alignX","alignY","paddingAndSize","getBackgroundPoint","alignment","cornerRadius","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","tooltipItems","overrideCallbacks","defaultCallbacks","beforeTitle","noop","labelCount","afterTitle","beforeLabel","tooltipItem","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","invokeCallbackWithFallback","Tooltip","opacity","_eventPosition","_size","_cachedAnimations","_tooltipItems","dataPoints","caretX","caretY","labelColors","labelPointStyles","labelTextColors","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","itemSort","positionAndSize","backgroundPoint","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","pt","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","afterInit","afterDraw","_fallback","addIfString","addedLabels","findOrAddLabel","lastIndexOf","_getLabelForValue","CategoryScale","_startValue","_valueRange","_addedLabels","added","generateTicks","generationOptions","dataRange","MIN_SPACING","precision","maxTicks","maxDigits","includeBounds","unit","maxSpaces","rmin","rmax","countDefined","minSpacing","niceNum","niceMin","niceMax","numSpaces","almostWhole","almostEquals","decimalPlaces","_decimalPlaces","relativeLabelSize","tickValue","rad","LinearScaleBase","_endValue","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","stepSize","computeTickLimit","numericGeneratorOptions","_setMinAndMaxByKey","LinearScale","Ticks","formatters","numeric","log10Floor","log10","changeExponent","m","isMajor","tickVal","steps","rangeExp","rangeStep","startExp","minExp","exp","significand","lastTick","LogarithmicScale","logarithmic","_zero","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","limits","valueCount","_pointLabels","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","getPointPosition","drawingArea","plFont","hLimits","vLimits","updateLimits","setCenterPoint","_pointLabelItems","buildPointLabelItems","createPointLabelItem","itemOpts","outerDistance","extra","pointLabelPosition","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","apexesInArea","drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","drawPointLabels","pathRadiusLine","drawRadiusLine","gridLineOpts","createPointLabelContext","RadialLinearScale","animate","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","rotate","INTERVALS","millisecond","common","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","input","adapter","_adapter","parser","isoWeekday","_parseOpts","determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","determineUnitForFormatting","determineMajorUnit","addTick","time","timestamps","_lookup","timestamp","setMajorTicks","majorUnit","ticksFromTimestamps","TimeScale","adapters","displayFormats","_unit","_majorUnit","_offsets","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_filterBetween","_getLabelCapacity","initOffsets","offsetAfterAutoskip","getDecimalForValue","minor","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","formatter","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","normalize","table","prevSource","nextSource","prevTarget","nextTarget","span","TimeSeriesScale","_table","_minPos","_tableRange","_getTimestampsForTable","buildLookupTable","registerables"],"mappings":";;;;;;;;;;;AAWO,MAAMA,QAAAA,CAAAA;IACXC,WAAc,EAAA;QACZ,IAAI,CAACC,QAAQ,GAAG,IAAI,CAAA;QACpB,IAAI,CAACC,OAAO,GAAG,IAAIC,GAAAA,EAAAA,CAAAA;QACnB,IAAI,CAACC,QAAQ,GAAG,KAAK,CAAA;QACrB,IAAI,CAACC,SAAS,GAAGC,SAAAA,CAAAA;AACnB,KAAA;AAKAC,CAAAA,OAAAA,CAAQC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAE;AAChC,QAAA,MAAMC,SAAYH,GAAAA,KAAAA,CAAMI,SAAS,CAACF,IAAK,CAAA,CAAA;QACvC,MAAMG,QAAAA,GAAWL,MAAMM,QAAQ,CAAA;AAE/BH,QAAAA,SAAAA,CAAUI,OAAO,CAACC,CAAAA,EAAAA,GAAMA,EAAG,CAAA;AACzBT,gBAAAA,KAAAA;AACAU,gBAAAA,OAAAA,EAAST,MAAMS,OAAO;AACtBJ,gBAAAA,QAAAA;AACAK,gBAAAA,WAAAA,EAAaC,KAAKC,GAAG,CAACX,IAAOD,GAAAA,KAAAA,CAAMa,KAAK,EAAER,QAAAA,CAAAA;AAC5C,aAAA,CAAA,CAAA,CAAA;AACF,KAAA;AAIA,CACAS,QAAW,GAAA;QACT,IAAI,IAAI,CAACtB,QAAQ,EAAE;AACjB,YAAA,OAAA;SACD;QACD,IAAI,CAACG,QAAQ,GAAG,IAAI,CAAA;AAEpB,QAAA,IAAI,CAACH,QAAQ,GAAGuB,iCAAiBC,IAAI,CAACC,QAAQ,IAAM;A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ACT,KAAA;AAMAuB,CAAAA,kBAAAA,CAAmBj7D,KAAK,EAAE;AACxB,QAAA,OAAO,CAACu3C,WAAY,CAAA,IAAI,CAACulB,MAAM,EAAE98D,KAAS,CAAA,GAAA,IAAI,CAAC+8D,OAAM,IAAK,IAAI,CAACC,WAAW,CAAA;AAC5E,KAAA;AAMApmD,CAAAA,gBAAAA,CAAiB8iB,KAAK,EAAE;QACtB,MAAMmiC,OAAAA,GAAU,IAAI,CAACxB,QAAQ,CAAA;QAC7B,MAAM1gC,OAAAA,GAAU,IAAI,CAACG,kBAAkB,CAACJ,SAASmiC,OAAQpgE,CAAAA,MAAM,GAAGogE,OAAAA,CAAQl7D,GAAG,CAAA;AAC7E,QAAA,OAAO42C,WAAY,CAAA,IAAI,CAACulB,MAAM,EAAEnjC,OAAU,GAAA,IAAI,CAACqjC,WAAW,GAAG,IAAI,CAACD,OAAO,EAAE,IAAI,CAAA,CAAA;AACjF,KAAA;AACF;;;;;;;;;;;;MC3JaI,aAAgB,GAAA;AAC3Bn8B,IAAAA,WAAAA;AACAp0B,IAAAA,QAAAA;AACAkN,IAAAA,OAAAA;AACAxU,IAAAA,MAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/chart.js b/seller_1/node_modules/chart.js/dist/chart.js new file mode 100644 index 0000000..b539aa5 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.js @@ -0,0 +1,11482 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +import { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js'; +import '@kurkle/color'; + +class Animator { + constructor(){ + this._request = null; + this._charts = new Map(); + this._running = false; + this._lastDate = undefined; + } + _notify(chart, anims, date, type) { + const callbacks = anims.listeners[type]; + const numSteps = anims.duration; + callbacks.forEach((fn)=>fn({ + chart, + initial: anims.initial, + numSteps, + currentStep: Math.min(date - anims.start, numSteps) + })); + } + _refresh() { + if (this._request) { + return; + } + this._running = true; + this._request = requestAnimFrame.call(window, ()=>{ + this._update(); + this._request = null; + if (this._running) { + this._refresh(); + } + }); + } + _update(date = Date.now()) { + let remaining = 0; + this._charts.forEach((anims, chart)=>{ + if (!anims.running || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + let draw = false; + let item; + for(; i >= 0; --i){ + item = items[i]; + if (item._active) { + if (item._total > anims.duration) { + anims.duration = item._total; + } + item.tick(date); + draw = true; + } else { + items[i] = items[items.length - 1]; + items.pop(); + } + } + if (draw) { + chart.draw(); + this._notify(chart, anims, date, 'progress'); + } + if (!items.length) { + anims.running = false; + this._notify(chart, anims, date, 'complete'); + anims.initial = false; + } + remaining += items.length; + }); + this._lastDate = date; + if (remaining === 0) { + this._running = false; + } + } + _getAnims(chart) { + const charts = this._charts; + let anims = charts.get(chart); + if (!anims) { + anims = { + running: false, + initial: true, + items: [], + listeners: { + complete: [], + progress: [] + } + }; + charts.set(chart, anims); + } + return anims; + } + listen(chart, event, cb) { + this._getAnims(chart).listeners[event].push(cb); + } + add(chart, items) { + if (!items || !items.length) { + return; + } + this._getAnims(chart).items.push(...items); + } + has(chart) { + return this._getAnims(chart).items.length > 0; + } + start(chart) { + const anims = this._charts.get(chart); + if (!anims) { + return; + } + anims.running = true; + anims.start = Date.now(); + anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0); + this._refresh(); + } + running(chart) { + if (!this._running) { + return false; + } + const anims = this._charts.get(chart); + if (!anims || !anims.running || !anims.items.length) { + return false; + } + return true; + } + stop(chart) { + const anims = this._charts.get(chart); + if (!anims || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + for(; i >= 0; --i){ + items[i].cancel(); + } + anims.items = []; + this._notify(chart, anims, Date.now(), 'complete'); + } + remove(chart) { + return this._charts.delete(chart); + } +} +var animator = /* #__PURE__ */ new Animator(); + +const transparent = 'transparent'; +const interpolators = { + boolean (from, to, factor) { + return factor > 0.5 ? to : from; + }, + color (from, to, factor) { + const c0 = color(from || transparent); + const c1 = c0.valid && color(to || transparent); + return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to; + }, + number (from, to, factor) { + return from + (to - from) * factor; + } +}; +class Animation { + constructor(cfg, target, prop, to){ + const currentValue = target[prop]; + to = resolve([ + cfg.to, + to, + currentValue, + cfg.from + ]); + const from = resolve([ + cfg.from, + currentValue, + to + ]); + this._active = true; + this._fn = cfg.fn || interpolators[cfg.type || typeof from]; + this._easing = effects[cfg.easing] || effects.linear; + this._start = Math.floor(Date.now() + (cfg.delay || 0)); + this._duration = this._total = Math.floor(cfg.duration); + this._loop = !!cfg.loop; + this._target = target; + this._prop = prop; + this._from = from; + this._to = to; + this._promises = undefined; + } + active() { + return this._active; + } + update(cfg, to, date) { + if (this._active) { + this._notify(false); + const currentValue = this._target[this._prop]; + const elapsed = date - this._start; + const remain = this._duration - elapsed; + this._start = date; + this._duration = Math.floor(Math.max(remain, cfg.duration)); + this._total += elapsed; + this._loop = !!cfg.loop; + this._to = resolve([ + cfg.to, + to, + currentValue, + cfg.from + ]); + this._from = resolve([ + cfg.from, + currentValue, + to + ]); + } + } + cancel() { + if (this._active) { + this.tick(Date.now()); + this._active = false; + this._notify(false); + } + } + tick(date) { + const elapsed = date - this._start; + const duration = this._duration; + const prop = this._prop; + const from = this._from; + const loop = this._loop; + const to = this._to; + let factor; + this._active = from !== to && (loop || elapsed < duration); + if (!this._active) { + this._target[prop] = to; + this._notify(true); + return; + } + if (elapsed < 0) { + this._target[prop] = from; + return; + } + factor = elapsed / duration % 2; + factor = loop && factor > 1 ? 2 - factor : factor; + factor = this._easing(Math.min(1, Math.max(0, factor))); + this._target[prop] = this._fn(from, to, factor); + } + wait() { + const promises = this._promises || (this._promises = []); + return new Promise((res, rej)=>{ + promises.push({ + res, + rej + }); + }); + } + _notify(resolved) { + const method = resolved ? 'res' : 'rej'; + const promises = this._promises || []; + for(let i = 0; i < promises.length; i++){ + promises[i][method](); + } + } +} + +class Animations { + constructor(chart, config){ + this._chart = chart; + this._properties = new Map(); + this.configure(config); + } + configure(config) { + if (!isObject(config)) { + return; + } + const animationOptions = Object.keys(defaults.animation); + const animatedProps = this._properties; + Object.getOwnPropertyNames(config).forEach((key)=>{ + const cfg = config[key]; + if (!isObject(cfg)) { + return; + } + const resolved = {}; + for (const option of animationOptions){ + resolved[option] = cfg[option]; + } + (isArray(cfg.properties) && cfg.properties || [ + key + ]).forEach((prop)=>{ + if (prop === key || !animatedProps.has(prop)) { + animatedProps.set(prop, resolved); + } + }); + }); + } + _animateOptions(target, values) { + const newOptions = values.options; + const options = resolveTargetOptions(target, newOptions); + if (!options) { + return []; + } + const animations = this._createAnimations(options, newOptions); + if (newOptions.$shared) { + awaitAll(target.options.$animations, newOptions).then(()=>{ + target.options = newOptions; + }, ()=>{ + }); + } + return animations; + } + _createAnimations(target, values) { + const animatedProps = this._properties; + const animations = []; + const running = target.$animations || (target.$animations = {}); + const props = Object.keys(values); + const date = Date.now(); + let i; + for(i = props.length - 1; i >= 0; --i){ + const prop = props[i]; + if (prop.charAt(0) === '$') { + continue; + } + if (prop === 'options') { + animations.push(...this._animateOptions(target, values)); + continue; + } + const value = values[prop]; + let animation = running[prop]; + const cfg = animatedProps.get(prop); + if (animation) { + if (cfg && animation.active()) { + animation.update(cfg, value, date); + continue; + } else { + animation.cancel(); + } + } + if (!cfg || !cfg.duration) { + target[prop] = value; + continue; + } + running[prop] = animation = new Animation(cfg, target, prop, value); + animations.push(animation); + } + return animations; + } + update(target, values) { + if (this._properties.size === 0) { + Object.assign(target, values); + return; + } + const animations = this._createAnimations(target, values); + if (animations.length) { + animator.add(this._chart, animations); + return true; + } + } +} +function awaitAll(animations, properties) { + const running = []; + const keys = Object.keys(properties); + for(let i = 0; i < keys.length; i++){ + const anim = animations[keys[i]]; + if (anim && anim.active()) { + running.push(anim.wait()); + } + } + return Promise.all(running); +} +function resolveTargetOptions(target, newOptions) { + if (!newOptions) { + return; + } + let options = target.options; + if (!options) { + target.options = newOptions; + return; + } + if (options.$shared) { + target.options = options = Object.assign({}, options, { + $shared: false, + $animations: {} + }); + } + return options; +} + +function scaleClip(scale, allowedOverflow) { + const opts = scale && scale.options || {}; + const reverse = opts.reverse; + const min = opts.min === undefined ? allowedOverflow : 0; + const max = opts.max === undefined ? allowedOverflow : 0; + return { + start: reverse ? max : min, + end: reverse ? min : max + }; +} +function defaultClip(xScale, yScale, allowedOverflow) { + if (allowedOverflow === false) { + return false; + } + const x = scaleClip(xScale, allowedOverflow); + const y = scaleClip(yScale, allowedOverflow); + return { + top: y.end, + right: x.end, + bottom: y.start, + left: x.start + }; +} +function toClip(value) { + let t, r, b, l; + if (isObject(value)) { + t = value.top; + r = value.right; + b = value.bottom; + l = value.left; + } else { + t = r = b = l = value; + } + return { + top: t, + right: r, + bottom: b, + left: l, + disabled: value === false + }; +} +function getSortedDatasetIndices(chart, filterVisible) { + const keys = []; + const metasets = chart._getSortedDatasetMetas(filterVisible); + let i, ilen; + for(i = 0, ilen = metasets.length; i < ilen; ++i){ + keys.push(metasets[i].index); + } + return keys; +} +function applyStack(stack, value, dsIndex, options = {}) { + const keys = stack.keys; + const singleMode = options.mode === 'single'; + let i, ilen, datasetIndex, otherValue; + if (value === null) { + return; + } + let found = false; + for(i = 0, ilen = keys.length; i < ilen; ++i){ + datasetIndex = +keys[i]; + if (datasetIndex === dsIndex) { + found = true; + if (options.all) { + continue; + } + break; + } + otherValue = stack.values[datasetIndex]; + if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) { + value += otherValue; + } + } + if (!found && !options.all) { + return 0; + } + return value; +} +function convertObjectDataToArray(data, meta) { + const { iScale , vScale } = meta; + const iAxisKey = iScale.axis === 'x' ? 'x' : 'y'; + const vAxisKey = vScale.axis === 'x' ? 'x' : 'y'; + const keys = Object.keys(data); + const adata = new Array(keys.length); + let i, ilen, key; + for(i = 0, ilen = keys.length; i < ilen; ++i){ + key = keys[i]; + adata[i] = { + [iAxisKey]: key, + [vAxisKey]: data[key] + }; + } + return adata; +} +function isStacked(scale, meta) { + const stacked = scale && scale.options.stacked; + return stacked || stacked === undefined && meta.stack !== undefined; +} +function getStackKey(indexScale, valueScale, meta) { + return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`; +} +function getUserBounds(scale) { + const { min , max , minDefined , maxDefined } = scale.getUserBounds(); + return { + min: minDefined ? min : Number.NEGATIVE_INFINITY, + max: maxDefined ? max : Number.POSITIVE_INFINITY + }; +} +function getOrCreateStack(stacks, stackKey, indexValue) { + const subStack = stacks[stackKey] || (stacks[stackKey] = {}); + return subStack[indexValue] || (subStack[indexValue] = {}); +} +function getLastIndexInStack(stack, vScale, positive, type) { + for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){ + const value = stack[meta.index]; + if (positive && value > 0 || !positive && value < 0) { + return meta.index; + } + } + return null; +} +function updateStacks(controller, parsed) { + const { chart , _cachedMeta: meta } = controller; + const stacks = chart._stacks || (chart._stacks = {}); + const { iScale , vScale , index: datasetIndex } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const key = getStackKey(iScale, vScale, meta); + const ilen = parsed.length; + let stack; + for(let i = 0; i < ilen; ++i){ + const item = parsed[i]; + const { [iAxis]: index , [vAxis]: value } = item; + const itemStacks = item._stacks || (item._stacks = {}); + stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index); + stack[datasetIndex] = value; + stack._top = getLastIndexInStack(stack, vScale, true, meta.type); + stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type); + const visualValues = stack._visualValues || (stack._visualValues = {}); + visualValues[datasetIndex] = value; + } +} +function getFirstScaleId(chart, axis) { + const scales = chart.scales; + return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift(); +} +function createDatasetContext(parent, index) { + return createContext(parent, { + active: false, + dataset: undefined, + datasetIndex: index, + index, + mode: 'default', + type: 'dataset' + }); +} +function createDataContext(parent, index, element) { + return createContext(parent, { + active: false, + dataIndex: index, + parsed: undefined, + raw: undefined, + element, + index, + mode: 'default', + type: 'data' + }); +} +function clearStacks(meta, items) { + const datasetIndex = meta.controller.index; + const axis = meta.vScale && meta.vScale.axis; + if (!axis) { + return; + } + items = items || meta._parsed; + for (const parsed of items){ + const stacks = parsed._stacks; + if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) { + return; + } + delete stacks[axis][datasetIndex]; + if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) { + delete stacks[axis]._visualValues[datasetIndex]; + } + } +} +const isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none'; +const cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached); +const createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && { + keys: getSortedDatasetIndices(chart, true), + values: null + }; +class DatasetController { + static defaults = {}; + static datasetElementType = null; + static dataElementType = null; + constructor(chart, datasetIndex){ + this.chart = chart; + this._ctx = chart.ctx; + this.index = datasetIndex; + this._cachedDataOpts = {}; + this._cachedMeta = this.getMeta(); + this._type = this._cachedMeta.type; + this.options = undefined; + this._parsing = false; + this._data = undefined; + this._objectData = undefined; + this._sharedOptions = undefined; + this._drawStart = undefined; + this._drawCount = undefined; + this.enableOptionSharing = false; + this.supportsDecimation = false; + this.$context = undefined; + this._syncList = []; + this.datasetElementType = new.target.datasetElementType; + this.dataElementType = new.target.dataElementType; + this.initialize(); + } + initialize() { + const meta = this._cachedMeta; + this.configure(); + this.linkScales(); + meta._stacked = isStacked(meta.vScale, meta); + this.addElements(); + if (this.options.fill && !this.chart.isPluginEnabled('filler')) { + console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options"); + } + } + updateIndex(datasetIndex) { + if (this.index !== datasetIndex) { + clearStacks(this._cachedMeta); + } + this.index = datasetIndex; + } + linkScales() { + const chart = this.chart; + const meta = this._cachedMeta; + const dataset = this.getDataset(); + const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y; + const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x')); + const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y')); + const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r')); + const indexAxis = meta.indexAxis; + const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid); + const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid); + meta.xScale = this.getScaleForId(xid); + meta.yScale = this.getScaleForId(yid); + meta.rScale = this.getScaleForId(rid); + meta.iScale = this.getScaleForId(iid); + meta.vScale = this.getScaleForId(vid); + } + getDataset() { + return this.chart.data.datasets[this.index]; + } + getMeta() { + return this.chart.getDatasetMeta(this.index); + } + getScaleForId(scaleID) { + return this.chart.scales[scaleID]; + } + _getOtherScale(scale) { + const meta = this._cachedMeta; + return scale === meta.iScale ? meta.vScale : meta.iScale; + } + reset() { + this._update('reset'); + } + _destroy() { + const meta = this._cachedMeta; + if (this._data) { + unlistenArrayEvents(this._data, this); + } + if (meta._stacked) { + clearStacks(meta); + } + } + _dataCheck() { + const dataset = this.getDataset(); + const data = dataset.data || (dataset.data = []); + const _data = this._data; + if (isObject(data)) { + const meta = this._cachedMeta; + this._data = convertObjectDataToArray(data, meta); + } else if (_data !== data) { + if (_data) { + unlistenArrayEvents(_data, this); + const meta = this._cachedMeta; + clearStacks(meta); + meta._parsed = []; + } + if (data && Object.isExtensible(data)) { + listenArrayEvents(data, this); + } + this._syncList = []; + this._data = data; + } + } + addElements() { + const meta = this._cachedMeta; + this._dataCheck(); + if (this.datasetElementType) { + meta.dataset = new this.datasetElementType(); + } + } + buildOrUpdateElements(resetNewElements) { + const meta = this._cachedMeta; + const dataset = this.getDataset(); + let stackChanged = false; + this._dataCheck(); + const oldStacked = meta._stacked; + meta._stacked = isStacked(meta.vScale, meta); + if (meta.stack !== dataset.stack) { + stackChanged = true; + clearStacks(meta); + meta.stack = dataset.stack; + } + this._resyncElements(resetNewElements); + if (stackChanged || oldStacked !== meta._stacked) { + updateStacks(this, meta._parsed); + meta._stacked = isStacked(meta.vScale, meta); + } + } + configure() { + const config = this.chart.config; + const scopeKeys = config.datasetScopeKeys(this._type); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true); + this.options = config.createResolver(scopes, this.getContext()); + this._parsing = this.options.parsing; + this._cachedDataOpts = {}; + } + parse(start, count) { + const { _cachedMeta: meta , _data: data } = this; + const { iScale , _stacked } = meta; + const iAxis = iScale.axis; + let sorted = start === 0 && count === data.length ? true : meta._sorted; + let prev = start > 0 && meta._parsed[start - 1]; + let i, cur, parsed; + if (this._parsing === false) { + meta._parsed = data; + meta._sorted = true; + parsed = data; + } else { + if (isArray(data[start])) { + parsed = this.parseArrayData(meta, data, start, count); + } else if (isObject(data[start])) { + parsed = this.parseObjectData(meta, data, start, count); + } else { + parsed = this.parsePrimitiveData(meta, data, start, count); + } + const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis]; + for(i = 0; i < count; ++i){ + meta._parsed[i + start] = cur = parsed[i]; + if (sorted) { + if (isNotInOrderComparedToPrev()) { + sorted = false; + } + prev = cur; + } + } + meta._sorted = sorted; + } + if (_stacked) { + updateStacks(this, parsed); + } + } + parsePrimitiveData(meta, data, start, count) { + const { iScale , vScale } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = new Array(count); + let i, ilen, index; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + parsed[i] = { + [iAxis]: singleScale || iScale.parse(labels[index], index), + [vAxis]: vScale.parse(data[index], index) + }; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const { xScale , yScale } = meta; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + x: xScale.parse(item[0], index), + y: yScale.parse(item[1], index) + }; + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const { xScale , yScale } = meta; + const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + x: xScale.parse(resolveObjectKey(item, xAxisKey), index), + y: yScale.parse(resolveObjectKey(item, yAxisKey), index) + }; + } + return parsed; + } + getParsed(index) { + return this._cachedMeta._parsed[index]; + } + getDataElement(index) { + return this._cachedMeta.data[index]; + } + applyStack(scale, parsed, mode) { + const chart = this.chart; + const meta = this._cachedMeta; + const value = parsed[scale.axis]; + const stack = { + keys: getSortedDatasetIndices(chart, true), + values: parsed._stacks[scale.axis]._visualValues + }; + return applyStack(stack, value, meta.index, { + mode + }); + } + updateRangeFromParsed(range, scale, parsed, stack) { + const parsedValue = parsed[scale.axis]; + let value = parsedValue === null ? NaN : parsedValue; + const values = stack && parsed._stacks[scale.axis]; + if (stack && values) { + stack.values = values; + value = applyStack(stack, parsedValue, this._cachedMeta.index); + } + range.min = Math.min(range.min, value); + range.max = Math.max(range.max, value); + } + getMinMax(scale, canStack) { + const meta = this._cachedMeta; + const _parsed = meta._parsed; + const sorted = meta._sorted && scale === meta.iScale; + const ilen = _parsed.length; + const otherScale = this._getOtherScale(scale); + const stack = createStack(canStack, meta, this.chart); + const range = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + const { min: otherMin , max: otherMax } = getUserBounds(otherScale); + let i, parsed; + function _skip() { + parsed = _parsed[i]; + const otherValue = parsed[otherScale.axis]; + return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue; + } + for(i = 0; i < ilen; ++i){ + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range, scale, parsed, stack); + if (sorted) { + break; + } + } + if (sorted) { + for(i = ilen - 1; i >= 0; --i){ + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range, scale, parsed, stack); + break; + } + } + return range; + } + getAllParsedValues(scale) { + const parsed = this._cachedMeta._parsed; + const values = []; + let i, ilen, value; + for(i = 0, ilen = parsed.length; i < ilen; ++i){ + value = parsed[i][scale.axis]; + if (isNumberFinite(value)) { + values.push(value); + } + } + return values; + } + getMaxOverflow() { + return false; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const iScale = meta.iScale; + const vScale = meta.vScale; + const parsed = this.getParsed(index); + return { + label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '', + value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : '' + }; + } + _update(mode) { + const meta = this._cachedMeta; + this.update(mode || 'default'); + meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow()))); + } + update(mode) {} + draw() { + const ctx = this._ctx; + const chart = this.chart; + const meta = this._cachedMeta; + const elements = meta.data || []; + const area = chart.chartArea; + const active = []; + const start = this._drawStart || 0; + const count = this._drawCount || elements.length - start; + const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop; + let i; + if (meta.dataset) { + meta.dataset.draw(ctx, area, start, count); + } + for(i = start; i < start + count; ++i){ + const element = elements[i]; + if (element.hidden) { + continue; + } + if (element.active && drawActiveElementsOnTop) { + active.push(element); + } else { + element.draw(ctx, area); + } + } + for(i = 0; i < active.length; ++i){ + active[i].draw(ctx, area); + } + } + getStyle(index, active) { + const mode = active ? 'active' : 'default'; + return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode); + } + getContext(index, active, mode) { + const dataset = this.getDataset(); + let context; + if (index >= 0 && index < this._cachedMeta.data.length) { + const element = this._cachedMeta.data[index]; + context = element.$context || (element.$context = createDataContext(this.getContext(), index, element)); + context.parsed = this.getParsed(index); + context.raw = dataset.data[index]; + context.index = context.dataIndex = index; + } else { + context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index)); + context.dataset = dataset; + context.index = context.datasetIndex = this.index; + } + context.active = !!active; + context.mode = mode; + return context; + } + resolveDatasetElementOptions(mode) { + return this._resolveElementOptions(this.datasetElementType.id, mode); + } + resolveDataElementOptions(index, mode) { + return this._resolveElementOptions(this.dataElementType.id, mode, index); + } + _resolveElementOptions(elementType, mode = 'default', index) { + const active = mode === 'active'; + const cache = this._cachedDataOpts; + const cacheKey = elementType + '-' + mode; + const cached = cache[cacheKey]; + const sharing = this.enableOptionSharing && defined(index); + if (cached) { + return cloneIfNotShared(cached, sharing); + } + const config = this.chart.config; + const scopeKeys = config.datasetElementScopeKeys(this._type, elementType); + const prefixes = active ? [ + `${elementType}Hover`, + 'hover', + elementType, + '' + ] : [ + elementType, + '' + ]; + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + const names = Object.keys(defaults.elements[elementType]); + const context = ()=>this.getContext(index, active, mode); + const values = config.resolveNamedOptions(scopes, names, context, prefixes); + if (values.$shared) { + values.$shared = sharing; + cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing)); + } + return values; + } + _resolveAnimations(index, transition, active) { + const chart = this.chart; + const cache = this._cachedDataOpts; + const cacheKey = `animation-${transition}`; + const cached = cache[cacheKey]; + if (cached) { + return cached; + } + let options; + if (chart.options.animation !== false) { + const config = this.chart.config; + const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + options = config.createResolver(scopes, this.getContext(index, active, transition)); + } + const animations = new Animations(chart, options && options.animations); + if (options && options._cacheable) { + cache[cacheKey] = Object.freeze(animations); + } + return animations; + } + getSharedOptions(options) { + if (!options.$shared) { + return; + } + return this._sharedOptions || (this._sharedOptions = Object.assign({}, options)); + } + includeOptions(mode, sharedOptions) { + return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled; + } + _getSharedOptions(start, mode) { + const firstOpts = this.resolveDataElementOptions(start, mode); + const previouslySharedOptions = this._sharedOptions; + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions; + this.updateSharedOptions(sharedOptions, mode, firstOpts); + return { + sharedOptions, + includeOptions + }; + } + updateElement(element, index, properties, mode) { + if (isDirectUpdateMode(mode)) { + Object.assign(element, properties); + } else { + this._resolveAnimations(index, mode).update(element, properties); + } + } + updateSharedOptions(sharedOptions, mode, newOptions) { + if (sharedOptions && !isDirectUpdateMode(mode)) { + this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions); + } + } + _setStyle(element, index, mode, active) { + element.active = active; + const options = this.getStyle(index, active); + this._resolveAnimations(index, mode, active).update(element, { + options: !active && this.getSharedOptions(options) || options + }); + } + removeHoverStyle(element, datasetIndex, index) { + this._setStyle(element, index, 'active', false); + } + setHoverStyle(element, datasetIndex, index) { + this._setStyle(element, index, 'active', true); + } + _removeDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, undefined, 'active', false); + } + } + _setDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, undefined, 'active', true); + } + } + _resyncElements(resetNewElements) { + const data = this._data; + const elements = this._cachedMeta.data; + for (const [method, arg1, arg2] of this._syncList){ + this[method](arg1, arg2); + } + this._syncList = []; + const numMeta = elements.length; + const numData = data.length; + const count = Math.min(numData, numMeta); + if (count) { + this.parse(0, count); + } + if (numData > numMeta) { + this._insertElements(numMeta, numData - numMeta, resetNewElements); + } else if (numData < numMeta) { + this._removeElements(numData, numMeta - numData); + } + } + _insertElements(start, count, resetNewElements = true) { + const meta = this._cachedMeta; + const data = meta.data; + const end = start + count; + let i; + const move = (arr)=>{ + arr.length += count; + for(i = arr.length - 1; i >= end; i--){ + arr[i] = arr[i - count]; + } + }; + move(data); + for(i = start; i < end; ++i){ + data[i] = new this.dataElementType(); + } + if (this._parsing) { + move(meta._parsed); + } + this.parse(start, count); + if (resetNewElements) { + this.updateElements(data, start, count, 'reset'); + } + } + updateElements(element, start, count, mode) {} + _removeElements(start, count) { + const meta = this._cachedMeta; + if (this._parsing) { + const removed = meta._parsed.splice(start, count); + if (meta._stacked) { + clearStacks(meta, removed); + } + } + meta.data.splice(start, count); + } + _sync(args) { + if (this._parsing) { + this._syncList.push(args); + } else { + const [method, arg1, arg2] = args; + this[method](arg1, arg2); + } + this.chart._dataChanges.push([ + this.index, + ...args + ]); + } + _onDataPush() { + const count = arguments.length; + this._sync([ + '_insertElements', + this.getDataset().data.length - count, + count + ]); + } + _onDataPop() { + this._sync([ + '_removeElements', + this._cachedMeta.data.length - 1, + 1 + ]); + } + _onDataShift() { + this._sync([ + '_removeElements', + 0, + 1 + ]); + } + _onDataSplice(start, count) { + if (count) { + this._sync([ + '_removeElements', + start, + count + ]); + } + const newCount = arguments.length - 2; + if (newCount) { + this._sync([ + '_insertElements', + start, + newCount + ]); + } + } + _onDataUnshift() { + this._sync([ + '_insertElements', + 0, + arguments.length + ]); + } +} + +function getAllScaleValues(scale, type) { + if (!scale._cache.$bar) { + const visibleMetas = scale.getMatchingVisibleMetas(type); + let values = []; + for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){ + values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale)); + } + scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b)); + } + return scale._cache.$bar; +} + function computeMinSampleSize(meta) { + const scale = meta.iScale; + const values = getAllScaleValues(scale, meta.type); + let min = scale._length; + let i, ilen, curr, prev; + const updateMinAndPrev = ()=>{ + if (curr === 32767 || curr === -32768) { + return; + } + if (defined(prev)) { + min = Math.min(min, Math.abs(curr - prev) || min); + } + prev = curr; + }; + for(i = 0, ilen = values.length; i < ilen; ++i){ + curr = scale.getPixelForValue(values[i]); + updateMinAndPrev(); + } + prev = undefined; + for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){ + curr = scale.getPixelForTick(i); + updateMinAndPrev(); + } + return min; +} + function computeFitCategoryTraits(index, ruler, options, stackCount) { + const thickness = options.barThickness; + let size, ratio; + if (isNullOrUndef(thickness)) { + size = ruler.min * options.categoryPercentage; + ratio = options.barPercentage; + } else { + size = thickness * stackCount; + ratio = 1; + } + return { + chunk: size / stackCount, + ratio, + start: ruler.pixels[index] - size / 2 + }; +} + function computeFlexCategoryTraits(index, ruler, options, stackCount) { + const pixels = ruler.pixels; + const curr = pixels[index]; + let prev = index > 0 ? pixels[index - 1] : null; + let next = index < pixels.length - 1 ? pixels[index + 1] : null; + const percent = options.categoryPercentage; + if (prev === null) { + prev = curr - (next === null ? ruler.end - ruler.start : next - curr); + } + if (next === null) { + next = curr + curr - prev; + } + const start = curr - (curr - Math.min(prev, next)) / 2 * percent; + const size = Math.abs(next - prev) / 2 * percent; + return { + chunk: size / stackCount, + ratio: options.barPercentage, + start + }; +} +function parseFloatBar(entry, item, vScale, i) { + const startValue = vScale.parse(entry[0], i); + const endValue = vScale.parse(entry[1], i); + const min = Math.min(startValue, endValue); + const max = Math.max(startValue, endValue); + let barStart = min; + let barEnd = max; + if (Math.abs(min) > Math.abs(max)) { + barStart = max; + barEnd = min; + } + item[vScale.axis] = barEnd; + item._custom = { + barStart, + barEnd, + start: startValue, + end: endValue, + min, + max + }; +} +function parseValue(entry, item, vScale, i) { + if (isArray(entry)) { + parseFloatBar(entry, item, vScale, i); + } else { + item[vScale.axis] = vScale.parse(entry, i); + } + return item; +} +function parseArrayOrPrimitive(meta, data, start, count) { + const iScale = meta.iScale; + const vScale = meta.vScale; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = []; + let i, ilen, item, entry; + for(i = start, ilen = start + count; i < ilen; ++i){ + entry = data[i]; + item = {}; + item[iScale.axis] = singleScale || iScale.parse(labels[i], i); + parsed.push(parseValue(entry, item, vScale, i)); + } + return parsed; +} +function isFloatBar(custom) { + return custom && custom.barStart !== undefined && custom.barEnd !== undefined; +} +function barSign(size, vScale, actualBase) { + if (size !== 0) { + return sign(size); + } + return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1); +} +function borderProps(properties) { + let reverse, start, end, top, bottom; + if (properties.horizontal) { + reverse = properties.base > properties.x; + start = 'left'; + end = 'right'; + } else { + reverse = properties.base < properties.y; + start = 'bottom'; + end = 'top'; + } + if (reverse) { + top = 'end'; + bottom = 'start'; + } else { + top = 'start'; + bottom = 'end'; + } + return { + start, + end, + reverse, + top, + bottom + }; +} +function setBorderSkipped(properties, options, stack, index) { + let edge = options.borderSkipped; + const res = {}; + if (!edge) { + properties.borderSkipped = res; + return; + } + if (edge === true) { + properties.borderSkipped = { + top: true, + right: true, + bottom: true, + left: true + }; + return; + } + const { start , end , reverse , top , bottom } = borderProps(properties); + if (edge === 'middle' && stack) { + properties.enableBorderRadius = true; + if ((stack._top || 0) === index) { + edge = top; + } else if ((stack._bottom || 0) === index) { + edge = bottom; + } else { + res[parseEdge(bottom, start, end, reverse)] = true; + edge = top; + } + } + res[parseEdge(edge, start, end, reverse)] = true; + properties.borderSkipped = res; +} +function parseEdge(edge, a, b, reverse) { + if (reverse) { + edge = swap(edge, a, b); + edge = startEnd(edge, b, a); + } else { + edge = startEnd(edge, a, b); + } + return edge; +} +function swap(orig, v1, v2) { + return orig === v1 ? v2 : orig === v2 ? v1 : orig; +} +function startEnd(v, start, end) { + return v === 'start' ? start : v === 'end' ? end : v; +} +function setInflateAmount(properties, { inflateAmount }, ratio) { + properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount; +} +class BarController extends DatasetController { + static id = 'bar'; + static defaults = { + datasetElementType: false, + dataElementType: 'bar', + categoryPercentage: 0.8, + barPercentage: 0.9, + grouped: true, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'base', + 'width', + 'height' + ] + } + } + }; + static overrides = { + scales: { + _index_: { + type: 'category', + offset: true, + grid: { + offset: true + } + }, + _value_: { + type: 'linear', + beginAtZero: true + } + } + }; + parsePrimitiveData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseArrayData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseObjectData(meta, data, start, count) { + const { iScale , vScale } = meta; + const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing; + const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey; + const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey; + const parsed = []; + let i, ilen, item, obj; + for(i = start, ilen = start + count; i < ilen; ++i){ + obj = data[i]; + item = {}; + item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i); + parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i)); + } + return parsed; + } + updateRangeFromParsed(range, scale, parsed, stack) { + super.updateRangeFromParsed(range, scale, parsed, stack); + const custom = parsed._custom; + if (custom && scale === this._cachedMeta.vScale) { + range.min = Math.min(range.min, custom.min); + range.max = Math.max(range.max, custom.max); + } + } + getMaxOverflow() { + return 0; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const { iScale , vScale } = meta; + const parsed = this.getParsed(index); + const custom = parsed._custom; + const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]); + return { + label: '' + iScale.getLabelForValue(parsed[iScale.axis]), + value + }; + } + initialize() { + this.enableOptionSharing = true; + super.initialize(); + const meta = this._cachedMeta; + meta.stack = this.getDataset().stack; + } + update(mode) { + const meta = this._cachedMeta; + this.updateElements(meta.data, 0, meta.data.length, mode); + } + updateElements(bars, start, count, mode) { + const reset = mode === 'reset'; + const { index , _cachedMeta: { vScale } } = this; + const base = vScale.getBasePixel(); + const horizontal = vScale.isHorizontal(); + const ruler = this._getRuler(); + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + for(let i = start; i < start + count; i++){ + const parsed = this.getParsed(i); + const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? { + base, + head: base + } : this._calculateBarValuePixels(i); + const ipixels = this._calculateBarIndexPixels(i, ruler); + const stack = (parsed._stacks || {})[vScale.axis]; + const properties = { + horizontal, + base: vpixels.base, + enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom, + x: horizontal ? vpixels.head : ipixels.center, + y: horizontal ? ipixels.center : vpixels.head, + height: horizontal ? ipixels.size : Math.abs(vpixels.size), + width: horizontal ? Math.abs(vpixels.size) : ipixels.size + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode); + } + const options = properties.options || bars[i].options; + setBorderSkipped(properties, options, stack, index); + setInflateAmount(properties, options, ruler.ratio); + this.updateElement(bars[i], i, properties, mode); + } + } + _getStacks(last, dataIndex) { + const { iScale } = this._cachedMeta; + const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped); + const stacked = iScale.options.stacked; + const stacks = []; + const currentParsed = this._cachedMeta.controller.getParsed(dataIndex); + const iScaleValue = currentParsed && currentParsed[iScale.axis]; + const skipNull = (meta)=>{ + const parsed = meta._parsed.find((item)=>item[iScale.axis] === iScaleValue); + const val = parsed && parsed[meta.vScale.axis]; + if (isNullOrUndef(val) || isNaN(val)) { + return true; + } + }; + for (const meta of metasets){ + if (dataIndex !== undefined && skipNull(meta)) { + continue; + } + if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) { + stacks.push(meta.stack); + } + if (meta.index === last) { + break; + } + } + if (!stacks.length) { + stacks.push(undefined); + } + return stacks; + } + _getStackCount(index) { + return this._getStacks(undefined, index).length; + } + _getStackIndex(datasetIndex, name, dataIndex) { + const stacks = this._getStacks(datasetIndex, dataIndex); + const index = name !== undefined ? stacks.indexOf(name) : -1; + return index === -1 ? stacks.length - 1 : index; + } + _getRuler() { + const opts = this.options; + const meta = this._cachedMeta; + const iScale = meta.iScale; + const pixels = []; + let i, ilen; + for(i = 0, ilen = meta.data.length; i < ilen; ++i){ + pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i)); + } + const barThickness = opts.barThickness; + const min = barThickness || computeMinSampleSize(meta); + return { + min, + pixels, + start: iScale._startPixel, + end: iScale._endPixel, + stackCount: this._getStackCount(), + scale: iScale, + grouped: opts.grouped, + ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage + }; + } + _calculateBarValuePixels(index) { + const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this; + const actualBase = baseValue || 0; + const parsed = this.getParsed(index); + const custom = parsed._custom; + const floating = isFloatBar(custom); + let value = parsed[vScale.axis]; + let start = 0; + let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value; + let head, size; + if (length !== value) { + start = length - value; + length = value; + } + if (floating) { + value = custom.barStart; + length = custom.barEnd - custom.barStart; + if (value !== 0 && sign(value) !== sign(custom.barEnd)) { + start = 0; + } + start += value; + } + const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start; + let base = vScale.getPixelForValue(startValue); + if (this.chart.getDataVisibility(index)) { + head = vScale.getPixelForValue(start + length); + } else { + head = base; + } + size = head - base; + if (Math.abs(size) < minBarLength) { + size = barSign(size, vScale, actualBase) * minBarLength; + if (value === actualBase) { + base -= size / 2; + } + const startPixel = vScale.getPixelForDecimal(0); + const endPixel = vScale.getPixelForDecimal(1); + const min = Math.min(startPixel, endPixel); + const max = Math.max(startPixel, endPixel); + base = Math.max(Math.min(base, max), min); + head = base + size; + if (_stacked && !floating) { + parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base); + } + } + if (base === vScale.getPixelForValue(actualBase)) { + const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2; + base += halfGrid; + size -= halfGrid; + } + return { + size, + base, + head, + center: head + size / 2 + }; + } + _calculateBarIndexPixels(index, ruler) { + const scale = ruler.scale; + const options = this.options; + const skipNull = options.skipNull; + const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity); + let center, size; + if (ruler.grouped) { + const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount; + const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount); + const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined); + center = range.start + range.chunk * stackIndex + range.chunk / 2; + size = Math.min(maxBarThickness, range.chunk * range.ratio); + } else { + center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index); + size = Math.min(maxBarThickness, ruler.min * ruler.ratio); + } + return { + base: center - size / 2, + head: center + size / 2, + center, + size + }; + } + draw() { + const meta = this._cachedMeta; + const vScale = meta.vScale; + const rects = meta.data; + const ilen = rects.length; + let i = 0; + for(; i < ilen; ++i){ + if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) { + rects[i].draw(this._ctx); + } + } + } +} + +class BubbleController extends DatasetController { + static id = 'bubble'; + static defaults = { + datasetElementType: false, + dataElementType: 'point', + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'borderWidth', + 'radius' + ] + } + } + }; + static overrides = { + scales: { + x: { + type: 'linear' + }, + y: { + type: 'linear' + } + } + }; + initialize() { + this.enableOptionSharing = true; + super.initialize(); + } + parsePrimitiveData(meta, data, start, count) { + const parsed = super.parsePrimitiveData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + parsed[i]._custom = this.resolveDataElementOptions(i + start).radius; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const parsed = super.parseArrayData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + const item = data[start + i]; + parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const parsed = super.parseObjectData(meta, data, start, count); + for(let i = 0; i < parsed.length; i++){ + const item = data[start + i]; + parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + getMaxOverflow() { + const data = this._cachedMeta.data; + let max = 0; + for(let i = data.length - 1; i >= 0; --i){ + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale , yScale } = meta; + const parsed = this.getParsed(index); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + const r = parsed._custom; + return { + label: labels[index] || '', + value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')' + }; + } + update(mode) { + const points = this._cachedMeta.data; + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale } = this._cachedMeta; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + for(let i = start; i < start + count; i++){ + const point = points[i]; + const parsed = !reset && this.getParsed(i); + const properties = {}; + const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]); + const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]); + properties.skip = isNaN(iPixel) || isNaN(vPixel); + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + if (reset) { + properties.options.radius = 0; + } + } + this.updateElement(point, i, properties, mode); + } + } + resolveDataElementOptions(index, mode) { + const parsed = this.getParsed(index); + let values = super.resolveDataElementOptions(index, mode); + if (values.$shared) { + values = Object.assign({}, values, { + $shared: false + }); + } + const radius = values.radius; + if (mode !== 'active') { + values.radius = 0; + } + values.radius += valueOrDefault(parsed && parsed._custom, radius); + return values; + } +} + +function getRatioAndOffset(rotation, circumference, cutout) { + let ratioX = 1; + let ratioY = 1; + let offsetX = 0; + let offsetY = 0; + if (circumference < TAU) { + const startAngle = rotation; + const endAngle = startAngle + circumference; + const startX = Math.cos(startAngle); + const startY = Math.sin(startAngle); + const endX = Math.cos(endAngle); + const endY = Math.sin(endAngle); + const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout); + const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout); + const maxX = calcMax(0, startX, endX); + const maxY = calcMax(HALF_PI, startY, endY); + const minX = calcMin(PI, startX, endX); + const minY = calcMin(PI + HALF_PI, startY, endY); + ratioX = (maxX - minX) / 2; + ratioY = (maxY - minY) / 2; + offsetX = -(maxX + minX) / 2; + offsetY = -(maxY + minY) / 2; + } + return { + ratioX, + ratioY, + offsetX, + offsetY + }; +} +class DoughnutController extends DatasetController { + static id = 'doughnut'; + static defaults = { + datasetElementType: false, + dataElementType: 'arc', + animation: { + animateRotate: true, + animateScale: false + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'circumference', + 'endAngle', + 'innerRadius', + 'outerRadius', + 'startAngle', + 'x', + 'y', + 'offset', + 'borderWidth', + 'spacing' + ] + } + }, + cutout: '50%', + rotation: 0, + circumference: 360, + radius: '100%', + spacing: 0, + indexAxis: 'r' + }; + static descriptors = { + _scriptable: (name)=>name !== 'spacing', + _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash') + }; + static overrides = { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels (chart) { + const data = chart.data; + if (data.labels.length && data.datasets.length) { + const { labels: { pointStyle , color } } = chart.legend.options; + return data.labels.map((label, i)=>{ + const meta = chart.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + fontColor: color, + lineWidth: style.borderWidth, + pointStyle: pointStyle, + hidden: !chart.getDataVisibility(i), + index: i + }; + }); + } + return []; + } + }, + onClick (e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + } + }; + constructor(chart, datasetIndex){ + super(chart, datasetIndex); + this.enableOptionSharing = true; + this.innerRadius = undefined; + this.outerRadius = undefined; + this.offsetX = undefined; + this.offsetY = undefined; + } + linkScales() {} + parse(start, count) { + const data = this.getDataset().data; + const meta = this._cachedMeta; + if (this._parsing === false) { + meta._parsed = data; + } else { + let getter = (i)=>+data[i]; + if (isObject(data[start])) { + const { key ='value' } = this._parsing; + getter = (i)=>+resolveObjectKey(data[i], key); + } + let i, ilen; + for(i = start, ilen = start + count; i < ilen; ++i){ + meta._parsed[i] = getter(i); + } + } + } + _getRotation() { + return toRadians(this.options.rotation - 90); + } + _getCircumference() { + return toRadians(this.options.circumference); + } + _getRotationExtents() { + let min = TAU; + let max = -TAU; + for(let i = 0; i < this.chart.data.datasets.length; ++i){ + if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) { + const controller = this.chart.getDatasetMeta(i).controller; + const rotation = controller._getRotation(); + const circumference = controller._getCircumference(); + min = Math.min(min, rotation); + max = Math.max(max, rotation + circumference); + } + } + return { + rotation: min, + circumference: max - min + }; + } + update(mode) { + const chart = this.chart; + const { chartArea } = chart; + const meta = this._cachedMeta; + const arcs = meta.data; + const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing; + const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0); + const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1); + const chartWeight = this._getRingWeight(this.index); + const { circumference , rotation } = this._getRotationExtents(); + const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout); + const maxWidth = (chartArea.width - spacing) / ratioX; + const maxHeight = (chartArea.height - spacing) / ratioY; + const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0); + const outerRadius = toDimension(this.options.radius, maxRadius); + const innerRadius = Math.max(outerRadius * cutout, 0); + const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal(); + this.offsetX = offsetX * outerRadius; + this.offsetY = offsetY * outerRadius; + meta.total = this.calculateTotal(); + this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index); + this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0); + this.updateElements(arcs, 0, arcs.length, mode); + } + _circumference(i, reset) { + const opts = this.options; + const meta = this._cachedMeta; + const circumference = this._getCircumference(); + if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) { + return 0; + } + return this.calculateCircumference(meta._parsed[i] * circumference / TAU); + } + updateElements(arcs, start, count, mode) { + const reset = mode === 'reset'; + const chart = this.chart; + const chartArea = chart.chartArea; + const opts = chart.options; + const animationOpts = opts.animation; + const centerX = (chartArea.left + chartArea.right) / 2; + const centerY = (chartArea.top + chartArea.bottom) / 2; + const animateScale = reset && animationOpts.animateScale; + const innerRadius = animateScale ? 0 : this.innerRadius; + const outerRadius = animateScale ? 0 : this.outerRadius; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + let startAngle = this._getRotation(); + let i; + for(i = 0; i < start; ++i){ + startAngle += this._circumference(i, reset); + } + for(i = start; i < start + count; ++i){ + const circumference = this._circumference(i, reset); + const arc = arcs[i]; + const properties = { + x: centerX + this.offsetX, + y: centerY + this.offsetY, + startAngle, + endAngle: startAngle + circumference, + circumference, + outerRadius, + innerRadius + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode); + } + startAngle += circumference; + this.updateElement(arc, i, properties, mode); + } + } + calculateTotal() { + const meta = this._cachedMeta; + const metaData = meta.data; + let total = 0; + let i; + for(i = 0; i < metaData.length; i++){ + const value = meta._parsed[i]; + if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) { + total += Math.abs(value); + } + } + return total; + } + calculateCircumference(value) { + const total = this._cachedMeta.total; + if (total > 0 && !isNaN(value)) { + return TAU * (Math.abs(value) / total); + } + return 0; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const chart = this.chart; + const labels = chart.data.labels || []; + const value = formatNumber(meta._parsed[index], chart.options.locale); + return { + label: labels[index] || '', + value + }; + } + getMaxBorderWidth(arcs) { + let max = 0; + const chart = this.chart; + let i, ilen, meta, controller, options; + if (!arcs) { + for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){ + if (chart.isDatasetVisible(i)) { + meta = chart.getDatasetMeta(i); + arcs = meta.data; + controller = meta.controller; + break; + } + } + } + if (!arcs) { + return 0; + } + for(i = 0, ilen = arcs.length; i < ilen; ++i){ + options = controller.resolveDataElementOptions(i); + if (options.borderAlign !== 'inner') { + max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0); + } + } + return max; + } + getMaxOffset(arcs) { + let max = 0; + for(let i = 0, ilen = arcs.length; i < ilen; ++i){ + const options = this.resolveDataElementOptions(i); + max = Math.max(max, options.offset || 0, options.hoverOffset || 0); + } + return max; + } + _getRingWeightOffset(datasetIndex) { + let ringWeightOffset = 0; + for(let i = 0; i < datasetIndex; ++i){ + if (this.chart.isDatasetVisible(i)) { + ringWeightOffset += this._getRingWeight(i); + } + } + return ringWeightOffset; + } + _getRingWeight(datasetIndex) { + return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0); + } + _getVisibleDatasetWeightTotal() { + return this._getRingWeightOffset(this.chart.data.datasets.length) || 1; + } +} + +class LineController extends DatasetController { + static id = 'line'; + static defaults = { + datasetElementType: 'line', + dataElementType: 'point', + showLine: true, + spanGaps: false + }; + static overrides = { + scales: { + _index_: { + type: 'category' + }, + _value_: { + type: 'linear' + } + } + }; + initialize() { + this.enableOptionSharing = true; + this.supportsDecimation = true; + super.initialize(); + } + update(mode) { + const meta = this._cachedMeta; + const { dataset: line , data: points = [] , _dataset } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (_scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + options.segment = this.options.segment; + this.updateElement(line, undefined, { + animated: !animationsDisabled, + options + }, mode); + this.updateElements(points, start, count, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale , _stacked , _dataset } = this._cachedMeta; + const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps , segment } = this.options; + const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === 'none'; + const end = start + count; + const pointsCount = points.length; + let prevParsed = start > 0 && this.getParsed(start - 1); + for(let i = 0; i < pointsCount; ++i){ + const point = points[i]; + const properties = directUpdate ? point : {}; + if (i < start || i >= end) { + properties.skip = true; + continue; + } + const parsed = this.getParsed(i); + const nullData = isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + } + getMaxOverflow() { + const meta = this._cachedMeta; + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + const data = meta.data || []; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } + draw() { + const meta = this._cachedMeta; + meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis); + super.draw(); + } +} + +class PolarAreaController extends DatasetController { + static id = 'polarArea'; + static defaults = { + dataElementType: 'arc', + animation: { + animateRotate: true, + animateScale: true + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius' + ] + } + }, + indexAxis: 'r', + startAngle: 0 + }; + static overrides = { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels (chart) { + const data = chart.data; + if (data.labels.length && data.datasets.length) { + const { labels: { pointStyle , color } } = chart.legend.options; + return data.labels.map((label, i)=>{ + const meta = chart.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + fontColor: color, + lineWidth: style.borderWidth, + pointStyle: pointStyle, + hidden: !chart.getDataVisibility(i), + index: i + }; + }); + } + return []; + } + }, + onClick (e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + }, + scales: { + r: { + type: 'radialLinear', + angleLines: { + display: false + }, + beginAtZero: true, + grid: { + circular: true + }, + pointLabels: { + display: false + }, + startAngle: 0 + } + } + }; + constructor(chart, datasetIndex){ + super(chart, datasetIndex); + this.innerRadius = undefined; + this.outerRadius = undefined; + } + getLabelAndValue(index) { + const meta = this._cachedMeta; + const chart = this.chart; + const labels = chart.data.labels || []; + const value = formatNumber(meta._parsed[index].r, chart.options.locale); + return { + label: labels[index] || '', + value + }; + } + parseObjectData(meta, data, start, count) { + return _parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const arcs = this._cachedMeta.data; + this._updateRadius(); + this.updateElements(arcs, 0, arcs.length, mode); + } + getMinMax() { + const meta = this._cachedMeta; + const range = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + meta.data.forEach((element, index)=>{ + const parsed = this.getParsed(index).r; + if (!isNaN(parsed) && this.chart.getDataVisibility(index)) { + if (parsed < range.min) { + range.min = parsed; + } + if (parsed > range.max) { + range.max = parsed; + } + } + }); + return range; + } + _updateRadius() { + const chart = this.chart; + const chartArea = chart.chartArea; + const opts = chart.options; + const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top); + const outerRadius = Math.max(minSize / 2, 0); + const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0); + const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount(); + this.outerRadius = outerRadius - radiusLength * this.index; + this.innerRadius = this.outerRadius - radiusLength; + } + updateElements(arcs, start, count, mode) { + const reset = mode === 'reset'; + const chart = this.chart; + const opts = chart.options; + const animationOpts = opts.animation; + const scale = this._cachedMeta.rScale; + const centerX = scale.xCenter; + const centerY = scale.yCenter; + const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI; + let angle = datasetStartAngle; + let i; + const defaultAngle = 360 / this.countVisibleElements(); + for(i = 0; i < start; ++i){ + angle += this._computeAngle(i, mode, defaultAngle); + } + for(i = start; i < start + count; i++){ + const arc = arcs[i]; + let startAngle = angle; + let endAngle = angle + this._computeAngle(i, mode, defaultAngle); + let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0; + angle = endAngle; + if (reset) { + if (animationOpts.animateScale) { + outerRadius = 0; + } + if (animationOpts.animateRotate) { + startAngle = endAngle = datasetStartAngle; + } + } + const properties = { + x: centerX, + y: centerY, + innerRadius: 0, + outerRadius, + startAngle, + endAngle, + options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode) + }; + this.updateElement(arc, i, properties, mode); + } + } + countVisibleElements() { + const meta = this._cachedMeta; + let count = 0; + meta.data.forEach((element, index)=>{ + if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) { + count++; + } + }); + return count; + } + _computeAngle(index, mode, defaultAngle) { + return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0; + } +} + +class PieController extends DoughnutController { + static id = 'pie'; + static defaults = { + cutout: 0, + rotation: 0, + circumference: 360, + radius: '100%' + }; +} + +class RadarController extends DatasetController { + static id = 'radar'; + static defaults = { + datasetElementType: 'line', + dataElementType: 'point', + indexAxis: 'r', + showLine: true, + elements: { + line: { + fill: 'start' + } + } + }; + static overrides = { + aspectRatio: 1, + scales: { + r: { + type: 'radialLinear' + } + } + }; + getLabelAndValue(index) { + const vScale = this._cachedMeta.vScale; + const parsed = this.getParsed(index); + return { + label: vScale.getLabels()[index], + value: '' + vScale.getLabelForValue(parsed[vScale.axis]) + }; + } + parseObjectData(meta, data, start, count) { + return _parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const meta = this._cachedMeta; + const line = meta.dataset; + const points = meta.data || []; + const labels = meta.iScale.getLabels(); + line.points = points; + if (mode !== 'resize') { + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + const properties = { + _loop: true, + _fullLoop: labels.length === points.length, + options + }; + this.updateElement(line, undefined, properties, mode); + } + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const scale = this._cachedMeta.rScale; + const reset = mode === 'reset'; + for(let i = start; i < start + count; i++){ + const point = points[i]; + const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode); + const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r); + const x = reset ? scale.xCenter : pointPosition.x; + const y = reset ? scale.yCenter : pointPosition.y; + const properties = { + x, + y, + angle: pointPosition.angle, + skip: isNaN(x) || isNaN(y), + options + }; + this.updateElement(point, i, properties, mode); + } + } +} + +class ScatterController extends DatasetController { + static id = 'scatter'; + static defaults = { + datasetElementType: false, + dataElementType: 'point', + showLine: false, + fill: false + }; + static overrides = { + interaction: { + mode: 'point' + }, + scales: { + x: { + type: 'linear' + }, + y: { + type: 'linear' + } + } + }; + getLabelAndValue(index) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale , yScale } = meta; + const parsed = this.getParsed(index); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + return { + label: labels[index] || '', + value: '(' + x + ', ' + y + ')' + }; + } + update(mode) { + const meta = this._cachedMeta; + const { data: points = [] } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (_scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + if (this.options.showLine) { + if (!this.datasetElementType) { + this.addElements(); + } + const { dataset: line , _dataset } = meta; + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + options.segment = this.options.segment; + this.updateElement(line, undefined, { + animated: !animationsDisabled, + options + }, mode); + } else if (this.datasetElementType) { + delete meta.dataset; + this.datasetElementType = false; + } + this.updateElements(points, start, count, mode); + } + addElements() { + const { showLine } = this.options; + if (!this.datasetElementType && showLine) { + this.datasetElementType = this.chart.registry.getElement('line'); + } + super.addElements(); + } + updateElements(points, start, count, mode) { + const reset = mode === 'reset'; + const { iScale , vScale , _stacked , _dataset } = this._cachedMeta; + const firstOpts = this.resolveDataElementOptions(start, mode); + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps , segment } = this.options; + const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === 'none'; + let prevParsed = start > 0 && this.getParsed(start - 1); + for(let i = start; i < start + count; ++i){ + const point = points[i]; + const parsed = this.getParsed(i); + const properties = directUpdate ? point : {}; + const nullData = isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + this.updateSharedOptions(sharedOptions, mode, firstOpts); + } + getMaxOverflow() { + const meta = this._cachedMeta; + const data = meta.data || []; + if (!this.options.showLine) { + let max = 0; + for(let i = data.length - 1; i >= 0; --i){ + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } +} + +var controllers = /*#__PURE__*/Object.freeze({ +__proto__: null, +BarController: BarController, +BubbleController: BubbleController, +DoughnutController: DoughnutController, +LineController: LineController, +PieController: PieController, +PolarAreaController: PolarAreaController, +RadarController: RadarController, +ScatterController: ScatterController +}); + +/** + * @namespace Chart._adapters + * @since 2.8.0 + * @private + */ function abstract() { + throw new Error('This method is not implemented: Check that a complete date adapter is provided.'); +} +/** + * Date adapter (current used by the time scale) + * @namespace Chart._adapters._date + * @memberof Chart._adapters + * @private + */ class DateAdapterBase { + /** + * Override default date adapter methods. + * Accepts type parameter to define options type. + * @example + * Chart._adapters._date.override<{myAdapterOption: string}>({ + * init() { + * console.log(this.options.myAdapterOption); + * } + * }) + */ static override(members) { + Object.assign(DateAdapterBase.prototype, members); + } + options; + constructor(options){ + this.options = options || {}; + } + // eslint-disable-next-line @typescript-eslint/no-empty-function + init() {} + formats() { + return abstract(); + } + parse() { + return abstract(); + } + format() { + return abstract(); + } + add() { + return abstract(); + } + diff() { + return abstract(); + } + startOf() { + return abstract(); + } + endOf() { + return abstract(); + } +} +var adapters = { + _date: DateAdapterBase +}; + +function binarySearch(metaset, axis, value, intersect) { + const { controller , data , _sorted } = metaset; + const iScale = controller._cachedMeta.iScale; + if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) { + const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey; + if (!intersect) { + return lookupMethod(data, axis, value); + } else if (controller._sharedOptions) { + const el = data[0]; + const range = typeof el.getRange === 'function' && el.getRange(axis); + if (range) { + const start = lookupMethod(data, axis, value - range); + const end = lookupMethod(data, axis, value + range); + return { + lo: start.lo, + hi: end.hi + }; + } + } + } + return { + lo: 0, + hi: data.length - 1 + }; +} + function evaluateInteractionItems(chart, axis, position, handler, intersect) { + const metasets = chart.getSortedVisibleDatasetMetas(); + const value = position[axis]; + for(let i = 0, ilen = metasets.length; i < ilen; ++i){ + const { index , data } = metasets[i]; + const { lo , hi } = binarySearch(metasets[i], axis, value, intersect); + for(let j = lo; j <= hi; ++j){ + const element = data[j]; + if (!element.skip) { + handler(element, index, j); + } + } + } +} + function getDistanceMetricForAxis(axis) { + const useX = axis.indexOf('x') !== -1; + const useY = axis.indexOf('y') !== -1; + return function(pt1, pt2) { + const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0; + const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0; + return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)); + }; +} + function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) { + const items = []; + if (!includeInvisible && !chart.isPointInArea(position)) { + return items; + } + const evaluationFunc = function(element, datasetIndex, index) { + if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) { + return; + } + if (element.inRange(position.x, position.y, useFinalPosition)) { + items.push({ + element, + datasetIndex, + index + }); + } + }; + evaluateInteractionItems(chart, axis, position, evaluationFunc, true); + return items; +} + function getNearestRadialItems(chart, position, axis, useFinalPosition) { + let items = []; + function evaluationFunc(element, datasetIndex, index) { + const { startAngle , endAngle } = element.getProps([ + 'startAngle', + 'endAngle' + ], useFinalPosition); + const { angle } = getAngleFromPoint(element, { + x: position.x, + y: position.y + }); + if (_angleBetween(angle, startAngle, endAngle)) { + items.push({ + element, + datasetIndex, + index + }); + } + } + evaluateInteractionItems(chart, axis, position, evaluationFunc); + return items; +} + function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) { + let items = []; + const distanceMetric = getDistanceMetricForAxis(axis); + let minDistance = Number.POSITIVE_INFINITY; + function evaluationFunc(element, datasetIndex, index) { + const inRange = element.inRange(position.x, position.y, useFinalPosition); + if (intersect && !inRange) { + return; + } + const center = element.getCenterPoint(useFinalPosition); + const pointInArea = !!includeInvisible || chart.isPointInArea(center); + if (!pointInArea && !inRange) { + return; + } + const distance = distanceMetric(position, center); + if (distance < minDistance) { + items = [ + { + element, + datasetIndex, + index + } + ]; + minDistance = distance; + } else if (distance === minDistance) { + items.push({ + element, + datasetIndex, + index + }); + } + } + evaluateInteractionItems(chart, axis, position, evaluationFunc); + return items; +} + function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) { + if (!includeInvisible && !chart.isPointInArea(position)) { + return []; + } + return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible); +} + function getAxisItems(chart, position, axis, intersect, useFinalPosition) { + const items = []; + const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange'; + let intersectsItem = false; + evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{ + if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) { + items.push({ + element, + datasetIndex, + index + }); + intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition); + } + }); + if (intersect && !intersectsItem) { + return []; + } + return items; +} + var Interaction = { + evaluateInteractionItems, + modes: { + index (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + const axis = options.axis || 'x'; + const includeInvisible = options.includeInvisible || false; + const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible); + const elements = []; + if (!items.length) { + return []; + } + chart.getSortedVisibleDatasetMetas().forEach((meta)=>{ + const index = items[0].index; + const element = meta.data[index]; + if (element && !element.skip) { + elements.push({ + element, + datasetIndex: meta.index, + index + }); + } + }); + return elements; + }, + dataset (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible); + if (items.length > 0) { + const datasetIndex = items[0].datasetIndex; + const data = chart.getDatasetMeta(datasetIndex).data; + items = []; + for(let i = 0; i < data.length; ++i){ + items.push({ + element: data[i], + datasetIndex, + index: i + }); + } + } + return items; + }, + point (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible); + }, + nearest (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + const axis = options.axis || 'xy'; + const includeInvisible = options.includeInvisible || false; + return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible); + }, + x (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition); + }, + y (chart, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart); + return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition); + } + } +}; + +const STATIC_POSITIONS = [ + 'left', + 'top', + 'right', + 'bottom' +]; +function filterByPosition(array, position) { + return array.filter((v)=>v.pos === position); +} +function filterDynamicPositionByAxis(array, axis) { + return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis); +} +function sortByWeight(array, reverse) { + return array.sort((a, b)=>{ + const v0 = reverse ? b : a; + const v1 = reverse ? a : b; + return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight; + }); +} +function wrapBoxes(boxes) { + const layoutBoxes = []; + let i, ilen, box, pos, stack, stackWeight; + for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){ + box = boxes[i]; + ({ position: pos , options: { stack , stackWeight =1 } } = box); + layoutBoxes.push({ + index: i, + box, + pos, + horizontal: box.isHorizontal(), + weight: box.weight, + stack: stack && pos + stack, + stackWeight + }); + } + return layoutBoxes; +} +function buildStacks(layouts) { + const stacks = {}; + for (const wrap of layouts){ + const { stack , pos , stackWeight } = wrap; + if (!stack || !STATIC_POSITIONS.includes(pos)) { + continue; + } + const _stack = stacks[stack] || (stacks[stack] = { + count: 0, + placed: 0, + weight: 0, + size: 0 + }); + _stack.count++; + _stack.weight += stackWeight; + } + return stacks; +} + function setLayoutDims(layouts, params) { + const stacks = buildStacks(layouts); + const { vBoxMaxWidth , hBoxMaxHeight } = params; + let i, ilen, layout; + for(i = 0, ilen = layouts.length; i < ilen; ++i){ + layout = layouts[i]; + const { fullSize } = layout.box; + const stack = stacks[layout.stack]; + const factor = stack && layout.stackWeight / stack.weight; + if (layout.horizontal) { + layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth; + layout.height = hBoxMaxHeight; + } else { + layout.width = vBoxMaxWidth; + layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight; + } + } + return stacks; +} +function buildLayoutBoxes(boxes) { + const layoutBoxes = wrapBoxes(boxes); + const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true); + const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true); + const right = sortByWeight(filterByPosition(layoutBoxes, 'right')); + const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true); + const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom')); + const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x'); + const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y'); + return { + fullSize, + leftAndTop: left.concat(top), + rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal), + chartArea: filterByPosition(layoutBoxes, 'chartArea'), + vertical: left.concat(right).concat(centerVertical), + horizontal: top.concat(bottom).concat(centerHorizontal) + }; +} +function getCombinedMax(maxPadding, chartArea, a, b) { + return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]); +} +function updateMaxPadding(maxPadding, boxPadding) { + maxPadding.top = Math.max(maxPadding.top, boxPadding.top); + maxPadding.left = Math.max(maxPadding.left, boxPadding.left); + maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom); + maxPadding.right = Math.max(maxPadding.right, boxPadding.right); +} +function updateDims(chartArea, params, layout, stacks) { + const { pos , box } = layout; + const maxPadding = chartArea.maxPadding; + if (!isObject(pos)) { + if (layout.size) { + chartArea[pos] -= layout.size; + } + const stack = stacks[layout.stack] || { + size: 0, + count: 1 + }; + stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width); + layout.size = stack.size / stack.count; + chartArea[pos] += layout.size; + } + if (box.getPadding) { + updateMaxPadding(maxPadding, box.getPadding()); + } + const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right')); + const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom')); + const widthChanged = newWidth !== chartArea.w; + const heightChanged = newHeight !== chartArea.h; + chartArea.w = newWidth; + chartArea.h = newHeight; + return layout.horizontal ? { + same: widthChanged, + other: heightChanged + } : { + same: heightChanged, + other: widthChanged + }; +} +function handleMaxPadding(chartArea) { + const maxPadding = chartArea.maxPadding; + function updatePos(pos) { + const change = Math.max(maxPadding[pos] - chartArea[pos], 0); + chartArea[pos] += change; + return change; + } + chartArea.y += updatePos('top'); + chartArea.x += updatePos('left'); + updatePos('right'); + updatePos('bottom'); +} +function getMargins(horizontal, chartArea) { + const maxPadding = chartArea.maxPadding; + function marginForPositions(positions) { + const margin = { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + positions.forEach((pos)=>{ + margin[pos] = Math.max(chartArea[pos], maxPadding[pos]); + }); + return margin; + } + return horizontal ? marginForPositions([ + 'left', + 'right' + ]) : marginForPositions([ + 'top', + 'bottom' + ]); +} +function fitBoxes(boxes, chartArea, params, stacks) { + const refitBoxes = []; + let i, ilen, layout, box, refit, changed; + for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){ + layout = boxes[i]; + box = layout.box; + box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea)); + const { same , other } = updateDims(chartArea, params, layout, stacks); + refit |= same && refitBoxes.length; + changed = changed || other; + if (!box.fullSize) { + refitBoxes.push(layout); + } + } + return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed; +} +function setBoxDims(box, left, top, width, height) { + box.top = top; + box.left = left; + box.right = left + width; + box.bottom = top + height; + box.width = width; + box.height = height; +} +function placeBoxes(boxes, chartArea, params, stacks) { + const userPadding = params.padding; + let { x , y } = chartArea; + for (const layout of boxes){ + const box = layout.box; + const stack = stacks[layout.stack] || { + count: 1, + placed: 0, + weight: 1 + }; + const weight = layout.stackWeight / stack.weight || 1; + if (layout.horizontal) { + const width = chartArea.w * weight; + const height = stack.size || box.height; + if (defined(stack.start)) { + y = stack.start; + } + if (box.fullSize) { + setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height); + } else { + setBoxDims(box, chartArea.left + stack.placed, y, width, height); + } + stack.start = y; + stack.placed += width; + y = box.bottom; + } else { + const height = chartArea.h * weight; + const width = stack.size || box.width; + if (defined(stack.start)) { + x = stack.start; + } + if (box.fullSize) { + setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top); + } else { + setBoxDims(box, x, chartArea.top + stack.placed, width, height); + } + stack.start = x; + stack.placed += height; + x = box.right; + } + } + chartArea.x = x; + chartArea.y = y; +} +var layouts = { + addBox (chart, item) { + if (!chart.boxes) { + chart.boxes = []; + } + item.fullSize = item.fullSize || false; + item.position = item.position || 'top'; + item.weight = item.weight || 0; + item._layers = item._layers || function() { + return [ + { + z: 0, + draw (chartArea) { + item.draw(chartArea); + } + } + ]; + }; + chart.boxes.push(item); + }, + removeBox (chart, layoutItem) { + const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1; + if (index !== -1) { + chart.boxes.splice(index, 1); + } + }, + configure (chart, item, options) { + item.fullSize = options.fullSize; + item.position = options.position; + item.weight = options.weight; + }, + update (chart, width, height, minPadding) { + if (!chart) { + return; + } + const padding = toPadding(chart.options.layout.padding); + const availableWidth = Math.max(width - padding.width, 0); + const availableHeight = Math.max(height - padding.height, 0); + const boxes = buildLayoutBoxes(chart.boxes); + const verticalBoxes = boxes.vertical; + const horizontalBoxes = boxes.horizontal; + each(chart.boxes, (box)=>{ + if (typeof box.beforeLayout === 'function') { + box.beforeLayout(); + } + }); + const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1; + const params = Object.freeze({ + outerWidth: width, + outerHeight: height, + padding, + availableWidth, + availableHeight, + vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount, + hBoxMaxHeight: availableHeight / 2 + }); + const maxPadding = Object.assign({}, padding); + updateMaxPadding(maxPadding, toPadding(minPadding)); + const chartArea = Object.assign({ + maxPadding, + w: availableWidth, + h: availableHeight, + x: padding.left, + y: padding.top + }, padding); + const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params); + fitBoxes(boxes.fullSize, chartArea, params, stacks); + fitBoxes(verticalBoxes, chartArea, params, stacks); + if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) { + fitBoxes(verticalBoxes, chartArea, params, stacks); + } + handleMaxPadding(chartArea); + placeBoxes(boxes.leftAndTop, chartArea, params, stacks); + chartArea.x += chartArea.w; + chartArea.y += chartArea.h; + placeBoxes(boxes.rightAndBottom, chartArea, params, stacks); + chart.chartArea = { + left: chartArea.left, + top: chartArea.top, + right: chartArea.left + chartArea.w, + bottom: chartArea.top + chartArea.h, + height: chartArea.h, + width: chartArea.w + }; + each(boxes.chartArea, (layout)=>{ + const box = layout.box; + Object.assign(box, chart.chartArea); + box.update(chartArea.w, chartArea.h, { + left: 0, + top: 0, + right: 0, + bottom: 0 + }); + }); + } +}; + +class BasePlatform { + acquireContext(canvas, aspectRatio) {} + releaseContext(context) { + return false; + } + addEventListener(chart, type, listener) {} + removeEventListener(chart, type, listener) {} + getDevicePixelRatio() { + return 1; + } + getMaximumSize(element, width, height, aspectRatio) { + width = Math.max(0, width || element.width); + height = height || element.height; + return { + width, + height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height) + }; + } + isAttached(canvas) { + return true; + } + updateConfig(config) { + } +} + +class BasicPlatform extends BasePlatform { + acquireContext(item) { + return item && item.getContext && item.getContext('2d') || null; + } + updateConfig(config) { + config.options.animation = false; + } +} + +const EXPANDO_KEY = '$chartjs'; + const EVENT_TYPES = { + touchstart: 'mousedown', + touchmove: 'mousemove', + touchend: 'mouseup', + pointerenter: 'mouseenter', + pointerdown: 'mousedown', + pointermove: 'mousemove', + pointerup: 'mouseup', + pointerleave: 'mouseout', + pointerout: 'mouseout' +}; +const isNullOrEmpty = (value)=>value === null || value === ''; + function initCanvas(canvas, aspectRatio) { + const style = canvas.style; + const renderHeight = canvas.getAttribute('height'); + const renderWidth = canvas.getAttribute('width'); + canvas[EXPANDO_KEY] = { + initial: { + height: renderHeight, + width: renderWidth, + style: { + display: style.display, + height: style.height, + width: style.width + } + } + }; + style.display = style.display || 'block'; + style.boxSizing = style.boxSizing || 'border-box'; + if (isNullOrEmpty(renderWidth)) { + const displayWidth = readUsedSize(canvas, 'width'); + if (displayWidth !== undefined) { + canvas.width = displayWidth; + } + } + if (isNullOrEmpty(renderHeight)) { + if (canvas.style.height === '') { + canvas.height = canvas.width / (aspectRatio || 2); + } else { + const displayHeight = readUsedSize(canvas, 'height'); + if (displayHeight !== undefined) { + canvas.height = displayHeight; + } + } + } + return canvas; +} +const eventListenerOptions = supportsEventListenerOptions ? { + passive: true +} : false; +function addListener(node, type, listener) { + if (node) { + node.addEventListener(type, listener, eventListenerOptions); + } +} +function removeListener(chart, type, listener) { + if (chart && chart.canvas) { + chart.canvas.removeEventListener(type, listener, eventListenerOptions); + } +} +function fromNativeEvent(event, chart) { + const type = EVENT_TYPES[event.type] || event.type; + const { x , y } = getRelativePosition(event, chart); + return { + type, + chart, + native: event, + x: x !== undefined ? x : null, + y: y !== undefined ? y : null + }; +} +function nodeListContains(nodeList, canvas) { + for (const node of nodeList){ + if (node === canvas || node.contains(canvas)) { + return true; + } + } +} +function createAttachObserver(chart, type, listener) { + const canvas = chart.canvas; + const observer = new MutationObserver((entries)=>{ + let trigger = false; + for (const entry of entries){ + trigger = trigger || nodeListContains(entry.addedNodes, canvas); + trigger = trigger && !nodeListContains(entry.removedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; +} +function createDetachObserver(chart, type, listener) { + const canvas = chart.canvas; + const observer = new MutationObserver((entries)=>{ + let trigger = false; + for (const entry of entries){ + trigger = trigger || nodeListContains(entry.removedNodes, canvas); + trigger = trigger && !nodeListContains(entry.addedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; +} +const drpListeningCharts = new Map(); +let oldDevicePixelRatio = 0; +function onWindowResize() { + const dpr = window.devicePixelRatio; + if (dpr === oldDevicePixelRatio) { + return; + } + oldDevicePixelRatio = dpr; + drpListeningCharts.forEach((resize, chart)=>{ + if (chart.currentDevicePixelRatio !== dpr) { + resize(); + } + }); +} +function listenDevicePixelRatioChanges(chart, resize) { + if (!drpListeningCharts.size) { + window.addEventListener('resize', onWindowResize); + } + drpListeningCharts.set(chart, resize); +} +function unlistenDevicePixelRatioChanges(chart) { + drpListeningCharts.delete(chart); + if (!drpListeningCharts.size) { + window.removeEventListener('resize', onWindowResize); + } +} +function createResizeObserver(chart, type, listener) { + const canvas = chart.canvas; + const container = canvas && _getParentNode(canvas); + if (!container) { + return; + } + const resize = throttled((width, height)=>{ + const w = container.clientWidth; + listener(width, height); + if (w < container.clientWidth) { + listener(); + } + }, window); + const observer = new ResizeObserver((entries)=>{ + const entry = entries[0]; + const width = entry.contentRect.width; + const height = entry.contentRect.height; + if (width === 0 && height === 0) { + return; + } + resize(width, height); + }); + observer.observe(container); + listenDevicePixelRatioChanges(chart, resize); + return observer; +} +function releaseObserver(chart, type, observer) { + if (observer) { + observer.disconnect(); + } + if (type === 'resize') { + unlistenDevicePixelRatioChanges(chart); + } +} +function createProxyAndListen(chart, type, listener) { + const canvas = chart.canvas; + const proxy = throttled((event)=>{ + if (chart.ctx !== null) { + listener(fromNativeEvent(event, chart)); + } + }, chart); + addListener(canvas, type, proxy); + return proxy; +} + class DomPlatform extends BasePlatform { + acquireContext(canvas, aspectRatio) { + const context = canvas && canvas.getContext && canvas.getContext('2d'); + if (context && context.canvas === canvas) { + initCanvas(canvas, aspectRatio); + return context; + } + return null; + } + releaseContext(context) { + const canvas = context.canvas; + if (!canvas[EXPANDO_KEY]) { + return false; + } + const initial = canvas[EXPANDO_KEY].initial; + [ + 'height', + 'width' + ].forEach((prop)=>{ + const value = initial[prop]; + if (isNullOrUndef(value)) { + canvas.removeAttribute(prop); + } else { + canvas.setAttribute(prop, value); + } + }); + const style = initial.style || {}; + Object.keys(style).forEach((key)=>{ + canvas.style[key] = style[key]; + }); + canvas.width = canvas.width; + delete canvas[EXPANDO_KEY]; + return true; + } + addEventListener(chart, type, listener) { + this.removeEventListener(chart, type); + const proxies = chart.$proxies || (chart.$proxies = {}); + const handlers = { + attach: createAttachObserver, + detach: createDetachObserver, + resize: createResizeObserver + }; + const handler = handlers[type] || createProxyAndListen; + proxies[type] = handler(chart, type, listener); + } + removeEventListener(chart, type) { + const proxies = chart.$proxies || (chart.$proxies = {}); + const proxy = proxies[type]; + if (!proxy) { + return; + } + const handlers = { + attach: releaseObserver, + detach: releaseObserver, + resize: releaseObserver + }; + const handler = handlers[type] || removeListener; + handler(chart, type, proxy); + proxies[type] = undefined; + } + getDevicePixelRatio() { + return window.devicePixelRatio; + } + getMaximumSize(canvas, width, height, aspectRatio) { + return getMaximumSize(canvas, width, height, aspectRatio); + } + isAttached(canvas) { + const container = canvas && _getParentNode(canvas); + return !!(container && container.isConnected); + } +} + +function _detectPlatform(canvas) { + if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) { + return BasicPlatform; + } + return DomPlatform; +} + +class Element { + static defaults = {}; + static defaultRoutes = undefined; + x; + y; + active = false; + options; + $animations; + tooltipPosition(useFinalPosition) { + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return { + x, + y + }; + } + hasValue() { + return isNumber(this.x) && isNumber(this.y); + } + getProps(props, final) { + const anims = this.$animations; + if (!final || !anims) { + // let's not create an object, if not needed + return this; + } + const ret = {}; + props.forEach((prop)=>{ + ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop]; + }); + return ret; + } +} + +function autoSkip(scale, ticks) { + const tickOpts = scale.options.ticks; + const determinedMaxTicks = determineMaxTicks(scale); + const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks); + const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : []; + const numMajorIndices = majorIndices.length; + const first = majorIndices[0]; + const last = majorIndices[numMajorIndices - 1]; + const newTicks = []; + if (numMajorIndices > ticksLimit) { + skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit); + return newTicks; + } + const spacing = calculateSpacing(majorIndices, ticks, ticksLimit); + if (numMajorIndices > 0) { + let i, ilen; + const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null; + skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first); + for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){ + skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]); + } + skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing); + return newTicks; + } + skip(ticks, newTicks, spacing); + return newTicks; +} +function determineMaxTicks(scale) { + const offset = scale.options.offset; + const tickLength = scale._tickSize(); + const maxScale = scale._length / tickLength + (offset ? 0 : 1); + const maxChart = scale._maxLength / tickLength; + return Math.floor(Math.min(maxScale, maxChart)); +} + function calculateSpacing(majorIndices, ticks, ticksLimit) { + const evenMajorSpacing = getEvenSpacing(majorIndices); + const spacing = ticks.length / ticksLimit; + if (!evenMajorSpacing) { + return Math.max(spacing, 1); + } + const factors = _factorize(evenMajorSpacing); + for(let i = 0, ilen = factors.length - 1; i < ilen; i++){ + const factor = factors[i]; + if (factor > spacing) { + return factor; + } + } + return Math.max(spacing, 1); +} + function getMajorIndices(ticks) { + const result = []; + let i, ilen; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + if (ticks[i].major) { + result.push(i); + } + } + return result; +} + function skipMajors(ticks, newTicks, majorIndices, spacing) { + let count = 0; + let next = majorIndices[0]; + let i; + spacing = Math.ceil(spacing); + for(i = 0; i < ticks.length; i++){ + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = majorIndices[count * spacing]; + } + } +} + function skip(ticks, newTicks, spacing, majorStart, majorEnd) { + const start = valueOrDefault(majorStart, 0); + const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length); + let count = 0; + let length, i, next; + spacing = Math.ceil(spacing); + if (majorEnd) { + length = majorEnd - majorStart; + spacing = length / Math.floor(length / spacing); + } + next = start; + while(next < 0){ + count++; + next = Math.round(start + count * spacing); + } + for(i = Math.max(start, 0); i < end; i++){ + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = Math.round(start + count * spacing); + } + } +} + function getEvenSpacing(arr) { + const len = arr.length; + let i, diff; + if (len < 2) { + return false; + } + for(diff = arr[0], i = 1; i < len; ++i){ + if (arr[i] - arr[i - 1] !== diff) { + return false; + } + } + return diff; +} + +const reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align; +const offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset; +const getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength); + function sample(arr, numItems) { + const result = []; + const increment = arr.length / numItems; + const len = arr.length; + let i = 0; + for(; i < len; i += increment){ + result.push(arr[Math.floor(i)]); + } + return result; +} + function getPixelForGridLine(scale, index, offsetGridLines) { + const length = scale.ticks.length; + const validIndex = Math.min(index, length - 1); + const start = scale._startPixel; + const end = scale._endPixel; + const epsilon = 1e-6; + let lineValue = scale.getPixelForTick(validIndex); + let offset; + if (offsetGridLines) { + if (length === 1) { + offset = Math.max(lineValue - start, end - lineValue); + } else if (index === 0) { + offset = (scale.getPixelForTick(1) - lineValue) / 2; + } else { + offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2; + } + lineValue += validIndex < index ? offset : -offset; + if (lineValue < start - epsilon || lineValue > end + epsilon) { + return; + } + } + return lineValue; +} + function garbageCollect(caches, length) { + each(caches, (cache)=>{ + const gc = cache.gc; + const gcLen = gc.length / 2; + let i; + if (gcLen > length) { + for(i = 0; i < gcLen; ++i){ + delete cache.data[gc[i]]; + } + gc.splice(0, gcLen); + } + }); +} + function getTickMarkLength(options) { + return options.drawTicks ? options.tickLength : 0; +} + function getTitleHeight(options, fallback) { + if (!options.display) { + return 0; + } + const font = toFont(options.font, fallback); + const padding = toPadding(options.padding); + const lines = isArray(options.text) ? options.text.length : 1; + return lines * font.lineHeight + padding.height; +} +function createScaleContext(parent, scale) { + return createContext(parent, { + scale, + type: 'scale' + }); +} +function createTickContext(parent, index, tick) { + return createContext(parent, { + tick, + index, + type: 'tick' + }); +} +function titleAlign(align, position, reverse) { + let ret = _toLeftRightCenter(align); + if (reverse && position !== 'right' || !reverse && position === 'right') { + ret = reverseAlign(ret); + } + return ret; +} +function titleArgs(scale, offset, position, align) { + const { top , left , bottom , right , chart } = scale; + const { chartArea , scales } = chart; + let rotation = 0; + let maxWidth, titleX, titleY; + const height = bottom - top; + const width = right - left; + if (scale.isHorizontal()) { + titleX = _alignStartEnd(align, left, right); + if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleY = scales[positionAxisID].getPixelForValue(value) + height - offset; + } else if (position === 'center') { + titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset; + } else { + titleY = offsetFromEdge(scale, position, offset); + } + maxWidth = right - left; + } else { + if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleX = scales[positionAxisID].getPixelForValue(value) - width + offset; + } else if (position === 'center') { + titleX = (chartArea.left + chartArea.right) / 2 - width + offset; + } else { + titleX = offsetFromEdge(scale, position, offset); + } + titleY = _alignStartEnd(align, bottom, top); + rotation = position === 'left' ? -HALF_PI : HALF_PI; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; +} +class Scale extends Element { + constructor(cfg){ + super(); + this.id = cfg.id; + this.type = cfg.type; + this.options = undefined; + this.ctx = cfg.ctx; + this.chart = cfg.chart; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.width = undefined; + this.height = undefined; + this._margins = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + this.maxWidth = undefined; + this.maxHeight = undefined; + this.paddingTop = undefined; + this.paddingBottom = undefined; + this.paddingLeft = undefined; + this.paddingRight = undefined; + this.axis = undefined; + this.labelRotation = undefined; + this.min = undefined; + this.max = undefined; + this._range = undefined; + this.ticks = []; + this._gridLineItems = null; + this._labelItems = null; + this._labelSizes = null; + this._length = 0; + this._maxLength = 0; + this._longestTextCache = {}; + this._startPixel = undefined; + this._endPixel = undefined; + this._reversePixels = false; + this._userMax = undefined; + this._userMin = undefined; + this._suggestedMax = undefined; + this._suggestedMin = undefined; + this._ticksLength = 0; + this._borderValue = 0; + this._cache = {}; + this._dataLimitsCached = false; + this.$context = undefined; + } + init(options) { + this.options = options.setContext(this.getContext()); + this.axis = options.axis; + this._userMin = this.parse(options.min); + this._userMax = this.parse(options.max); + this._suggestedMin = this.parse(options.suggestedMin); + this._suggestedMax = this.parse(options.suggestedMax); + } + parse(raw, index) { + return raw; + } + getUserBounds() { + let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this; + _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY); + _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY); + _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY); + _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY); + return { + min: finiteOrDefault(_userMin, _suggestedMin), + max: finiteOrDefault(_userMax, _suggestedMax), + minDefined: isNumberFinite(_userMin), + maxDefined: isNumberFinite(_userMax) + }; + } + getMinMax(canStack) { + let { min , max , minDefined , maxDefined } = this.getUserBounds(); + let range; + if (minDefined && maxDefined) { + return { + min, + max + }; + } + const metas = this.getMatchingVisibleMetas(); + for(let i = 0, ilen = metas.length; i < ilen; ++i){ + range = metas[i].controller.getMinMax(this, canStack); + if (!minDefined) { + min = Math.min(min, range.min); + } + if (!maxDefined) { + max = Math.max(max, range.max); + } + } + min = maxDefined && min > max ? max : min; + max = minDefined && min > max ? min : max; + return { + min: finiteOrDefault(min, finiteOrDefault(max, min)), + max: finiteOrDefault(max, finiteOrDefault(min, max)) + }; + } + getPadding() { + return { + left: this.paddingLeft || 0, + top: this.paddingTop || 0, + right: this.paddingRight || 0, + bottom: this.paddingBottom || 0 + }; + } + getTicks() { + return this.ticks; + } + getLabels() { + const data = this.chart.data; + return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || []; + } + getLabelItems(chartArea = this.chart.chartArea) { + const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea)); + return items; + } + beforeLayout() { + this._cache = {}; + this._dataLimitsCached = false; + } + beforeUpdate() { + callback(this.options.beforeUpdate, [ + this + ]); + } + update(maxWidth, maxHeight, margins) { + const { beginAtZero , grace , ticks: tickOpts } = this.options; + const sampleSize = tickOpts.sampleSize; + this.beforeUpdate(); + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins = Object.assign({ + left: 0, + right: 0, + top: 0, + bottom: 0 + }, margins); + this.ticks = null; + this._labelSizes = null; + this._gridLineItems = null; + this._labelItems = null; + this.beforeSetDimensions(); + this.setDimensions(); + this.afterSetDimensions(); + this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom; + if (!this._dataLimitsCached) { + this.beforeDataLimits(); + this.determineDataLimits(); + this.afterDataLimits(); + this._range = _addGrace(this, grace, beginAtZero); + this._dataLimitsCached = true; + } + this.beforeBuildTicks(); + this.ticks = this.buildTicks() || []; + this.afterBuildTicks(); + const samplingEnabled = sampleSize < this.ticks.length; + this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks); + this.configure(); + this.beforeCalculateLabelRotation(); + this.calculateLabelRotation(); + this.afterCalculateLabelRotation(); + if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) { + this.ticks = autoSkip(this, this.ticks); + this._labelSizes = null; + this.afterAutoSkip(); + } + if (samplingEnabled) { + this._convertTicksToLabels(this.ticks); + } + this.beforeFit(); + this.fit(); + this.afterFit(); + this.afterUpdate(); + } + configure() { + let reversePixels = this.options.reverse; + let startPixel, endPixel; + if (this.isHorizontal()) { + startPixel = this.left; + endPixel = this.right; + } else { + startPixel = this.top; + endPixel = this.bottom; + reversePixels = !reversePixels; + } + this._startPixel = startPixel; + this._endPixel = endPixel; + this._reversePixels = reversePixels; + this._length = endPixel - startPixel; + this._alignToPixels = this.options.alignToPixels; + } + afterUpdate() { + callback(this.options.afterUpdate, [ + this + ]); + } + beforeSetDimensions() { + callback(this.options.beforeSetDimensions, [ + this + ]); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = 0; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = 0; + this.bottom = this.height; + } + this.paddingLeft = 0; + this.paddingTop = 0; + this.paddingRight = 0; + this.paddingBottom = 0; + } + afterSetDimensions() { + callback(this.options.afterSetDimensions, [ + this + ]); + } + _callHooks(name) { + this.chart.notifyPlugins(name, this.getContext()); + callback(this.options[name], [ + this + ]); + } + beforeDataLimits() { + this._callHooks('beforeDataLimits'); + } + determineDataLimits() {} + afterDataLimits() { + this._callHooks('afterDataLimits'); + } + beforeBuildTicks() { + this._callHooks('beforeBuildTicks'); + } + buildTicks() { + return []; + } + afterBuildTicks() { + this._callHooks('afterBuildTicks'); + } + beforeTickToLabelConversion() { + callback(this.options.beforeTickToLabelConversion, [ + this + ]); + } + generateTickLabels(ticks) { + const tickOpts = this.options.ticks; + let i, ilen, tick; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + tick = ticks[i]; + tick.label = callback(tickOpts.callback, [ + tick.value, + i, + ticks + ], this); + } + } + afterTickToLabelConversion() { + callback(this.options.afterTickToLabelConversion, [ + this + ]); + } + beforeCalculateLabelRotation() { + callback(this.options.beforeCalculateLabelRotation, [ + this + ]); + } + calculateLabelRotation() { + const options = this.options; + const tickOpts = options.ticks; + const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit); + const minRotation = tickOpts.minRotation || 0; + const maxRotation = tickOpts.maxRotation; + let labelRotation = minRotation; + let tickWidth, maxHeight, maxLabelDiagonal; + if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) { + this.labelRotation = minRotation; + return; + } + const labelSizes = this._getLabelSizes(); + const maxLabelWidth = labelSizes.widest.width; + const maxLabelHeight = labelSizes.highest.height; + const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth); + tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1); + if (maxLabelWidth + 6 > tickWidth) { + tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1)); + maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font); + maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight); + labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1)))); + labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation)); + } + this.labelRotation = labelRotation; + } + afterCalculateLabelRotation() { + callback(this.options.afterCalculateLabelRotation, [ + this + ]); + } + afterAutoSkip() {} + beforeFit() { + callback(this.options.beforeFit, [ + this + ]); + } + fit() { + const minSize = { + width: 0, + height: 0 + }; + const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this; + const display = this._isVisible(); + const isHorizontal = this.isHorizontal(); + if (display) { + const titleHeight = getTitleHeight(titleOpts, chart.options.font); + if (isHorizontal) { + minSize.width = this.maxWidth; + minSize.height = getTickMarkLength(gridOpts) + titleHeight; + } else { + minSize.height = this.maxHeight; + minSize.width = getTickMarkLength(gridOpts) + titleHeight; + } + if (tickOpts.display && this.ticks.length) { + const { first , last , widest , highest } = this._getLabelSizes(); + const tickPadding = tickOpts.padding * 2; + const angleRadians = toRadians(this.labelRotation); + const cos = Math.cos(angleRadians); + const sin = Math.sin(angleRadians); + if (isHorizontal) { + const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height; + minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding); + } else { + const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height; + minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding); + } + this._calculatePadding(first, last, sin, cos); + } + } + this._handleMargins(); + if (isHorizontal) { + this.width = this._length = chart.width - this._margins.left - this._margins.right; + this.height = minSize.height; + } else { + this.width = minSize.width; + this.height = this._length = chart.height - this._margins.top - this._margins.bottom; + } + } + _calculatePadding(first, last, sin, cos) { + const { ticks: { align , padding } , position } = this.options; + const isRotated = this.labelRotation !== 0; + const labelsBelowTicks = position !== 'top' && this.axis === 'x'; + if (this.isHorizontal()) { + const offsetLeft = this.getPixelForTick(0) - this.left; + const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1); + let paddingLeft = 0; + let paddingRight = 0; + if (isRotated) { + if (labelsBelowTicks) { + paddingLeft = cos * first.width; + paddingRight = sin * last.height; + } else { + paddingLeft = sin * first.height; + paddingRight = cos * last.width; + } + } else if (align === 'start') { + paddingRight = last.width; + } else if (align === 'end') { + paddingLeft = first.width; + } else if (align !== 'inner') { + paddingLeft = first.width / 2; + paddingRight = last.width / 2; + } + this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0); + this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0); + } else { + let paddingTop = last.height / 2; + let paddingBottom = first.height / 2; + if (align === 'start') { + paddingTop = 0; + paddingBottom = first.height; + } else if (align === 'end') { + paddingTop = last.height; + paddingBottom = 0; + } + this.paddingTop = paddingTop + padding; + this.paddingBottom = paddingBottom + padding; + } + } + _handleMargins() { + if (this._margins) { + this._margins.left = Math.max(this.paddingLeft, this._margins.left); + this._margins.top = Math.max(this.paddingTop, this._margins.top); + this._margins.right = Math.max(this.paddingRight, this._margins.right); + this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom); + } + } + afterFit() { + callback(this.options.afterFit, [ + this + ]); + } + isHorizontal() { + const { axis , position } = this.options; + return position === 'top' || position === 'bottom' || axis === 'x'; + } + isFullSize() { + return this.options.fullSize; + } + _convertTicksToLabels(ticks) { + this.beforeTickToLabelConversion(); + this.generateTickLabels(ticks); + let i, ilen; + for(i = 0, ilen = ticks.length; i < ilen; i++){ + if (isNullOrUndef(ticks[i].label)) { + ticks.splice(i, 1); + ilen--; + i--; + } + } + this.afterTickToLabelConversion(); + } + _getLabelSizes() { + let labelSizes = this._labelSizes; + if (!labelSizes) { + const sampleSize = this.options.ticks.sampleSize; + let ticks = this.ticks; + if (sampleSize < ticks.length) { + ticks = sample(ticks, sampleSize); + } + this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit); + } + return labelSizes; + } + _computeLabelSizes(ticks, length, maxTicksLimit) { + const { ctx , _longestTextCache: caches } = this; + const widths = []; + const heights = []; + const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit)); + let widestLabelSize = 0; + let highestLabelSize = 0; + let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel; + for(i = 0; i < length; i += increment){ + label = ticks[i].label; + tickFont = this._resolveTickFontOptions(i); + ctx.font = fontString = tickFont.string; + cache = caches[fontString] = caches[fontString] || { + data: {}, + gc: [] + }; + lineHeight = tickFont.lineHeight; + width = height = 0; + if (!isNullOrUndef(label) && !isArray(label)) { + width = _measureText(ctx, cache.data, cache.gc, width, label); + height = lineHeight; + } else if (isArray(label)) { + for(j = 0, jlen = label.length; j < jlen; ++j){ + nestedLabel = label[j]; + if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) { + width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel); + height += lineHeight; + } + } + } + widths.push(width); + heights.push(height); + widestLabelSize = Math.max(width, widestLabelSize); + highestLabelSize = Math.max(height, highestLabelSize); + } + garbageCollect(caches, length); + const widest = widths.indexOf(widestLabelSize); + const highest = heights.indexOf(highestLabelSize); + const valueAt = (idx)=>({ + width: widths[idx] || 0, + height: heights[idx] || 0 + }); + return { + first: valueAt(0), + last: valueAt(length - 1), + widest: valueAt(widest), + highest: valueAt(highest), + widths, + heights + }; + } + getLabelForValue(value) { + return value; + } + getPixelForValue(value, index) { + return NaN; + } + getValueForPixel(pixel) {} + getPixelForTick(index) { + const ticks = this.ticks; + if (index < 0 || index > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index].value); + } + getPixelForDecimal(decimal) { + if (this._reversePixels) { + decimal = 1 - decimal; + } + const pixel = this._startPixel + decimal * this._length; + return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel); + } + getDecimalForPixel(pixel) { + const decimal = (pixel - this._startPixel) / this._length; + return this._reversePixels ? 1 - decimal : decimal; + } + getBasePixel() { + return this.getPixelForValue(this.getBaseValue()); + } + getBaseValue() { + const { min , max } = this; + return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0; + } + getContext(index) { + const ticks = this.ticks || []; + if (index >= 0 && index < ticks.length) { + const tick = ticks[index]; + return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick)); + } + return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this)); + } + _tickSize() { + const optionTicks = this.options.ticks; + const rot = toRadians(this.labelRotation); + const cos = Math.abs(Math.cos(rot)); + const sin = Math.abs(Math.sin(rot)); + const labelSizes = this._getLabelSizes(); + const padding = optionTicks.autoSkipPadding || 0; + const w = labelSizes ? labelSizes.widest.width + padding : 0; + const h = labelSizes ? labelSizes.highest.height + padding : 0; + return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin; + } + _isVisible() { + const display = this.options.display; + if (display !== 'auto') { + return !!display; + } + return this.getMatchingVisibleMetas().length > 0; + } + _computeGridLineItems(chartArea) { + const axis = this.axis; + const chart = this.chart; + const options = this.options; + const { grid , position , border } = options; + const offset = grid.offset; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const ticksLength = ticks.length + (offset ? 1 : 0); + const tl = getTickMarkLength(grid); + const items = []; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = borderOpts.display ? borderOpts.width : 0; + const axisHalfWidth = axisWidth / 2; + const alignBorderValue = function(pixel) { + return _alignPixel(chart, pixel, axisWidth); + }; + let borderValue, i, lineValue, alignedLineValue; + let tx1, ty1, tx2, ty2, x1, y1, x2, y2; + if (position === 'top') { + borderValue = alignBorderValue(this.bottom); + ty1 = this.bottom - tl; + ty2 = borderValue - axisHalfWidth; + y1 = alignBorderValue(chartArea.top) + axisHalfWidth; + y2 = chartArea.bottom; + } else if (position === 'bottom') { + borderValue = alignBorderValue(this.top); + y1 = chartArea.top; + y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth; + ty1 = borderValue + axisHalfWidth; + ty2 = this.top + tl; + } else if (position === 'left') { + borderValue = alignBorderValue(this.right); + tx1 = this.right - tl; + tx2 = borderValue - axisHalfWidth; + x1 = alignBorderValue(chartArea.left) + axisHalfWidth; + x2 = chartArea.right; + } else if (position === 'right') { + borderValue = alignBorderValue(this.left); + x1 = chartArea.left; + x2 = alignBorderValue(chartArea.right) - axisHalfWidth; + tx1 = borderValue + axisHalfWidth; + tx2 = this.left + tl; + } else if (axis === 'x') { + if (position === 'center') { + borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5); + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + y1 = chartArea.top; + y2 = chartArea.bottom; + ty1 = borderValue + axisHalfWidth; + ty2 = ty1 + tl; + } else if (axis === 'y') { + if (position === 'center') { + borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2); + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + tx1 = borderValue - axisHalfWidth; + tx2 = tx1 - tl; + x1 = chartArea.left; + x2 = chartArea.right; + } + const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength); + const step = Math.max(1, Math.ceil(ticksLength / limit)); + for(i = 0; i < ticksLength; i += step){ + const context = this.getContext(i); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + const lineWidth = optsAtIndex.lineWidth; + const lineColor = optsAtIndex.color; + const borderDash = optsAtIndexBorder.dash || []; + const borderDashOffset = optsAtIndexBorder.dashOffset; + const tickWidth = optsAtIndex.tickWidth; + const tickColor = optsAtIndex.tickColor; + const tickBorderDash = optsAtIndex.tickBorderDash || []; + const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset; + lineValue = getPixelForGridLine(this, i, offset); + if (lineValue === undefined) { + continue; + } + alignedLineValue = _alignPixel(chart, lineValue, lineWidth); + if (isHorizontal) { + tx1 = tx2 = x1 = x2 = alignedLineValue; + } else { + ty1 = ty2 = y1 = y2 = alignedLineValue; + } + items.push({ + tx1, + ty1, + tx2, + ty2, + x1, + y1, + x2, + y2, + width: lineWidth, + color: lineColor, + borderDash, + borderDashOffset, + tickWidth, + tickColor, + tickBorderDash, + tickBorderDashOffset + }); + } + this._ticksLength = ticksLength; + this._borderValue = borderValue; + return items; + } + _computeLabelItems(chartArea) { + const axis = this.axis; + const options = this.options; + const { position , ticks: optionTicks } = options; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const { align , crossAlign , padding , mirror } = optionTicks; + const tl = getTickMarkLength(options.grid); + const tickAndPadding = tl + padding; + const hTickAndPadding = mirror ? -padding : tickAndPadding; + const rotation = -toRadians(this.labelRotation); + const items = []; + let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset; + let textBaseline = 'middle'; + if (position === 'top') { + y = this.bottom - hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === 'bottom') { + y = this.top + hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === 'left') { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (position === 'right') { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (axis === 'x') { + if (position === 'center') { + y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding; + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding; + } + textAlign = this._getXAxisLabelAlignment(); + } else if (axis === 'y') { + if (position === 'center') { + x = (chartArea.left + chartArea.right) / 2 - tickAndPadding; + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + x = this.chart.scales[positionAxisID].getPixelForValue(value); + } + textAlign = this._getYAxisLabelAlignment(tl).textAlign; + } + if (axis === 'y') { + if (align === 'start') { + textBaseline = 'top'; + } else if (align === 'end') { + textBaseline = 'bottom'; + } + } + const labelSizes = this._getLabelSizes(); + for(i = 0, ilen = ticks.length; i < ilen; ++i){ + tick = ticks[i]; + label = tick.label; + const optsAtIndex = optionTicks.setContext(this.getContext(i)); + pixel = this.getPixelForTick(i) + optionTicks.labelOffset; + font = this._resolveTickFontOptions(i); + lineHeight = font.lineHeight; + lineCount = isArray(label) ? label.length : 1; + const halfCount = lineCount / 2; + const color = optsAtIndex.color; + const strokeColor = optsAtIndex.textStrokeColor; + const strokeWidth = optsAtIndex.textStrokeWidth; + let tickTextAlign = textAlign; + if (isHorizontal) { + x = pixel; + if (textAlign === 'inner') { + if (i === ilen - 1) { + tickTextAlign = !this.options.reverse ? 'right' : 'left'; + } else if (i === 0) { + tickTextAlign = !this.options.reverse ? 'left' : 'right'; + } else { + tickTextAlign = 'center'; + } + } + if (position === 'top') { + if (crossAlign === 'near' || rotation !== 0) { + textOffset = -lineCount * lineHeight + lineHeight / 2; + } else if (crossAlign === 'center') { + textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight; + } else { + textOffset = -labelSizes.highest.height + lineHeight / 2; + } + } else { + if (crossAlign === 'near' || rotation !== 0) { + textOffset = lineHeight / 2; + } else if (crossAlign === 'center') { + textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight; + } else { + textOffset = labelSizes.highest.height - lineCount * lineHeight; + } + } + if (mirror) { + textOffset *= -1; + } + if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) { + x += lineHeight / 2 * Math.sin(rotation); + } + } else { + y = pixel; + textOffset = (1 - lineCount) * lineHeight / 2; + } + let backdrop; + if (optsAtIndex.showLabelBackdrop) { + const labelPadding = toPadding(optsAtIndex.backdropPadding); + const height = labelSizes.heights[i]; + const width = labelSizes.widths[i]; + let top = textOffset - labelPadding.top; + let left = 0 - labelPadding.left; + switch(textBaseline){ + case 'middle': + top -= height / 2; + break; + case 'bottom': + top -= height; + break; + } + switch(textAlign){ + case 'center': + left -= width / 2; + break; + case 'right': + left -= width; + break; + case 'inner': + if (i === ilen - 1) { + left -= width; + } else if (i > 0) { + left -= width / 2; + } + break; + } + backdrop = { + left, + top, + width: width + labelPadding.width, + height: height + labelPadding.height, + color: optsAtIndex.backdropColor + }; + } + items.push({ + label, + font, + textOffset, + options: { + rotation, + color, + strokeColor, + strokeWidth, + textAlign: tickTextAlign, + textBaseline, + translation: [ + x, + y + ], + backdrop + } + }); + } + return items; + } + _getXAxisLabelAlignment() { + const { position , ticks } = this.options; + const rotation = -toRadians(this.labelRotation); + if (rotation) { + return position === 'top' ? 'left' : 'right'; + } + let align = 'center'; + if (ticks.align === 'start') { + align = 'left'; + } else if (ticks.align === 'end') { + align = 'right'; + } else if (ticks.align === 'inner') { + align = 'inner'; + } + return align; + } + _getYAxisLabelAlignment(tl) { + const { position , ticks: { crossAlign , mirror , padding } } = this.options; + const labelSizes = this._getLabelSizes(); + const tickAndPadding = tl + padding; + const widest = labelSizes.widest.width; + let textAlign; + let x; + if (position === 'left') { + if (mirror) { + x = this.right + padding; + if (crossAlign === 'near') { + textAlign = 'left'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x += widest / 2; + } else { + textAlign = 'right'; + x += widest; + } + } else { + x = this.right - tickAndPadding; + if (crossAlign === 'near') { + textAlign = 'right'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x -= widest / 2; + } else { + textAlign = 'left'; + x = this.left; + } + } + } else if (position === 'right') { + if (mirror) { + x = this.left + padding; + if (crossAlign === 'near') { + textAlign = 'right'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x -= widest / 2; + } else { + textAlign = 'left'; + x -= widest; + } + } else { + x = this.left + tickAndPadding; + if (crossAlign === 'near') { + textAlign = 'left'; + } else if (crossAlign === 'center') { + textAlign = 'center'; + x += widest / 2; + } else { + textAlign = 'right'; + x = this.right; + } + } + } else { + textAlign = 'right'; + } + return { + textAlign, + x + }; + } + _computeLabelArea() { + if (this.options.ticks.mirror) { + return; + } + const chart = this.chart; + const position = this.options.position; + if (position === 'left' || position === 'right') { + return { + top: 0, + left: this.left, + bottom: chart.height, + right: this.right + }; + } + if (position === 'top' || position === 'bottom') { + return { + top: this.top, + left: 0, + bottom: this.bottom, + right: chart.width + }; + } + } + drawBackground() { + const { ctx , options: { backgroundColor } , left , top , width , height } = this; + if (backgroundColor) { + ctx.save(); + ctx.fillStyle = backgroundColor; + ctx.fillRect(left, top, width, height); + ctx.restore(); + } + } + getLineWidthForValue(value) { + const grid = this.options.grid; + if (!this._isVisible() || !grid.display) { + return 0; + } + const ticks = this.ticks; + const index = ticks.findIndex((t)=>t.value === value); + if (index >= 0) { + const opts = grid.setContext(this.getContext(index)); + return opts.lineWidth; + } + return 0; + } + drawGrid(chartArea) { + const grid = this.options.grid; + const ctx = this.ctx; + const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea)); + let i, ilen; + const drawLine = (p1, p2, style)=>{ + if (!style.width || !style.color) { + return; + } + ctx.save(); + ctx.lineWidth = style.width; + ctx.strokeStyle = style.color; + ctx.setLineDash(style.borderDash || []); + ctx.lineDashOffset = style.borderDashOffset; + ctx.beginPath(); + ctx.moveTo(p1.x, p1.y); + ctx.lineTo(p2.x, p2.y); + ctx.stroke(); + ctx.restore(); + }; + if (grid.display) { + for(i = 0, ilen = items.length; i < ilen; ++i){ + const item = items[i]; + if (grid.drawOnChartArea) { + drawLine({ + x: item.x1, + y: item.y1 + }, { + x: item.x2, + y: item.y2 + }, item); + } + if (grid.drawTicks) { + drawLine({ + x: item.tx1, + y: item.ty1 + }, { + x: item.tx2, + y: item.ty2 + }, { + color: item.tickColor, + width: item.tickWidth, + borderDash: item.tickBorderDash, + borderDashOffset: item.tickBorderDashOffset + }); + } + } + } + } + drawBorder() { + const { chart , ctx , options: { border , grid } } = this; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = border.display ? borderOpts.width : 0; + if (!axisWidth) { + return; + } + const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth; + const borderValue = this._borderValue; + let x1, x2, y1, y2; + if (this.isHorizontal()) { + x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2; + x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2; + y1 = y2 = borderValue; + } else { + y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2; + y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2; + x1 = x2 = borderValue; + } + ctx.save(); + ctx.lineWidth = borderOpts.width; + ctx.strokeStyle = borderOpts.color; + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + ctx.restore(); + } + drawLabels(chartArea) { + const optionTicks = this.options.ticks; + if (!optionTicks.display) { + return; + } + const ctx = this.ctx; + const area = this._computeLabelArea(); + if (area) { + clipArea(ctx, area); + } + const items = this.getLabelItems(chartArea); + for (const item of items){ + const renderTextOptions = item.options; + const tickFont = item.font; + const label = item.label; + const y = item.textOffset; + renderText(ctx, label, 0, y, tickFont, renderTextOptions); + } + if (area) { + unclipArea(ctx); + } + } + drawTitle() { + const { ctx , options: { position , title , reverse } } = this; + if (!title.display) { + return; + } + const font = toFont(title.font); + const padding = toPadding(title.padding); + const align = title.align; + let offset = font.lineHeight / 2; + if (position === 'bottom' || position === 'center' || isObject(position)) { + offset += padding.bottom; + if (isArray(title.text)) { + offset += font.lineHeight * (title.text.length - 1); + } + } else { + offset += padding.top; + } + const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align); + renderText(ctx, title.text, 0, 0, font, { + color: title.color, + maxWidth, + rotation, + textAlign: titleAlign(align, position, reverse), + textBaseline: 'middle', + translation: [ + titleX, + titleY + ] + }); + } + draw(chartArea) { + if (!this._isVisible()) { + return; + } + this.drawBackground(); + this.drawGrid(chartArea); + this.drawBorder(); + this.drawTitle(); + this.drawLabels(chartArea); + } + _layers() { + const opts = this.options; + const tz = opts.ticks && opts.ticks.z || 0; + const gz = valueOrDefault(opts.grid && opts.grid.z, -1); + const bz = valueOrDefault(opts.border && opts.border.z, 0); + if (!this._isVisible() || this.draw !== Scale.prototype.draw) { + return [ + { + z: tz, + draw: (chartArea)=>{ + this.draw(chartArea); + } + } + ]; + } + return [ + { + z: gz, + draw: (chartArea)=>{ + this.drawBackground(); + this.drawGrid(chartArea); + this.drawTitle(); + } + }, + { + z: bz, + draw: ()=>{ + this.drawBorder(); + } + }, + { + z: tz, + draw: (chartArea)=>{ + this.drawLabels(chartArea); + } + } + ]; + } + getMatchingVisibleMetas(type) { + const metas = this.chart.getSortedVisibleDatasetMetas(); + const axisID = this.axis + 'AxisID'; + const result = []; + let i, ilen; + for(i = 0, ilen = metas.length; i < ilen; ++i){ + const meta = metas[i]; + if (meta[axisID] === this.id && (!type || meta.type === type)) { + result.push(meta); + } + } + return result; + } + _resolveTickFontOptions(index) { + const opts = this.options.ticks.setContext(this.getContext(index)); + return toFont(opts.font); + } + _maxDigits() { + const fontSize = this._resolveTickFontOptions(0).lineHeight; + return (this.isHorizontal() ? this.width : this.height) / fontSize; + } +} + +class TypedRegistry { + constructor(type, scope, override){ + this.type = type; + this.scope = scope; + this.override = override; + this.items = Object.create(null); + } + isForType(type) { + return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype); + } + register(item) { + const proto = Object.getPrototypeOf(item); + let parentScope; + if (isIChartComponent(proto)) { + parentScope = this.register(proto); + } + const items = this.items; + const id = item.id; + const scope = this.scope + '.' + id; + if (!id) { + throw new Error('class does not have id: ' + item); + } + if (id in items) { + return scope; + } + items[id] = item; + registerDefaults(item, scope, parentScope); + if (this.override) { + defaults.override(item.id, item.overrides); + } + return scope; + } + get(id) { + return this.items[id]; + } + unregister(item) { + const items = this.items; + const id = item.id; + const scope = this.scope; + if (id in items) { + delete items[id]; + } + if (scope && id in defaults[scope]) { + delete defaults[scope][id]; + if (this.override) { + delete overrides[id]; + } + } + } +} +function registerDefaults(item, scope, parentScope) { + const itemDefaults = merge(Object.create(null), [ + parentScope ? defaults.get(parentScope) : {}, + defaults.get(scope), + item.defaults + ]); + defaults.set(scope, itemDefaults); + if (item.defaultRoutes) { + routeDefaults(scope, item.defaultRoutes); + } + if (item.descriptors) { + defaults.describe(scope, item.descriptors); + } +} +function routeDefaults(scope, routes) { + Object.keys(routes).forEach((property)=>{ + const propertyParts = property.split('.'); + const sourceName = propertyParts.pop(); + const sourceScope = [ + scope + ].concat(propertyParts).join('.'); + const parts = routes[property].split('.'); + const targetName = parts.pop(); + const targetScope = parts.join('.'); + defaults.route(sourceScope, sourceName, targetScope, targetName); + }); +} +function isIChartComponent(proto) { + return 'id' in proto && 'defaults' in proto; +} + +class Registry { + constructor(){ + this.controllers = new TypedRegistry(DatasetController, 'datasets', true); + this.elements = new TypedRegistry(Element, 'elements'); + this.plugins = new TypedRegistry(Object, 'plugins'); + this.scales = new TypedRegistry(Scale, 'scales'); + this._typedRegistries = [ + this.controllers, + this.scales, + this.elements + ]; + } + add(...args) { + this._each('register', args); + } + remove(...args) { + this._each('unregister', args); + } + addControllers(...args) { + this._each('register', args, this.controllers); + } + addElements(...args) { + this._each('register', args, this.elements); + } + addPlugins(...args) { + this._each('register', args, this.plugins); + } + addScales(...args) { + this._each('register', args, this.scales); + } + getController(id) { + return this._get(id, this.controllers, 'controller'); + } + getElement(id) { + return this._get(id, this.elements, 'element'); + } + getPlugin(id) { + return this._get(id, this.plugins, 'plugin'); + } + getScale(id) { + return this._get(id, this.scales, 'scale'); + } + removeControllers(...args) { + this._each('unregister', args, this.controllers); + } + removeElements(...args) { + this._each('unregister', args, this.elements); + } + removePlugins(...args) { + this._each('unregister', args, this.plugins); + } + removeScales(...args) { + this._each('unregister', args, this.scales); + } + _each(method, args, typedRegistry) { + [ + ...args + ].forEach((arg)=>{ + const reg = typedRegistry || this._getRegistryForType(arg); + if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) { + this._exec(method, reg, arg); + } else { + each(arg, (item)=>{ + const itemReg = typedRegistry || this._getRegistryForType(item); + this._exec(method, itemReg, item); + }); + } + }); + } + _exec(method, registry, component) { + const camelMethod = _capitalize(method); + callback(component['before' + camelMethod], [], component); + registry[method](component); + callback(component['after' + camelMethod], [], component); + } + _getRegistryForType(type) { + for(let i = 0; i < this._typedRegistries.length; i++){ + const reg = this._typedRegistries[i]; + if (reg.isForType(type)) { + return reg; + } + } + return this.plugins; + } + _get(id, typedRegistry, type) { + const item = typedRegistry.get(id); + if (item === undefined) { + throw new Error('"' + id + '" is not a registered ' + type + '.'); + } + return item; + } +} +var registry = /* #__PURE__ */ new Registry(); + +class PluginService { + constructor(){ + this._init = []; + } + notify(chart, hook, args, filter) { + if (hook === 'beforeInit') { + this._init = this._createDescriptors(chart, true); + this._notify(this._init, chart, 'install'); + } + const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart); + const result = this._notify(descriptors, chart, hook, args); + if (hook === 'afterDestroy') { + this._notify(descriptors, chart, 'stop'); + this._notify(this._init, chart, 'uninstall'); + } + return result; + } + _notify(descriptors, chart, hook, args) { + args = args || {}; + for (const descriptor of descriptors){ + const plugin = descriptor.plugin; + const method = plugin[hook]; + const params = [ + chart, + args, + descriptor.options + ]; + if (callback(method, params, plugin) === false && args.cancelable) { + return false; + } + } + return true; + } + invalidate() { + if (!isNullOrUndef(this._cache)) { + this._oldCache = this._cache; + this._cache = undefined; + } + } + _descriptors(chart) { + if (this._cache) { + return this._cache; + } + const descriptors = this._cache = this._createDescriptors(chart); + this._notifyStateChanges(chart); + return descriptors; + } + _createDescriptors(chart, all) { + const config = chart && chart.config; + const options = valueOrDefault(config.options && config.options.plugins, {}); + const plugins = allPlugins(config); + return options === false && !all ? [] : createDescriptors(chart, plugins, options, all); + } + _notifyStateChanges(chart) { + const previousDescriptors = this._oldCache || []; + const descriptors = this._cache; + const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id)); + this._notify(diff(previousDescriptors, descriptors), chart, 'stop'); + this._notify(diff(descriptors, previousDescriptors), chart, 'start'); + } +} + function allPlugins(config) { + const localIds = {}; + const plugins = []; + const keys = Object.keys(registry.plugins.items); + for(let i = 0; i < keys.length; i++){ + plugins.push(registry.getPlugin(keys[i])); + } + const local = config.plugins || []; + for(let i = 0; i < local.length; i++){ + const plugin = local[i]; + if (plugins.indexOf(plugin) === -1) { + plugins.push(plugin); + localIds[plugin.id] = true; + } + } + return { + plugins, + localIds + }; +} +function getOpts(options, all) { + if (!all && options === false) { + return null; + } + if (options === true) { + return {}; + } + return options; +} +function createDescriptors(chart, { plugins , localIds }, options, all) { + const result = []; + const context = chart.getContext(); + for (const plugin of plugins){ + const id = plugin.id; + const opts = getOpts(options[id], all); + if (opts === null) { + continue; + } + result.push({ + plugin, + options: pluginOpts(chart.config, { + plugin, + local: localIds[id] + }, opts, context) + }); + } + return result; +} +function pluginOpts(config, { plugin , local }, opts, context) { + const keys = config.pluginScopeKeys(plugin); + const scopes = config.getOptionScopes(opts, keys); + if (local && plugin.defaults) { + scopes.push(plugin.defaults); + } + return config.createResolver(scopes, context, [ + '' + ], { + scriptable: false, + indexable: false, + allKeys: true + }); +} + +function getIndexAxis(type, options) { + const datasetDefaults = defaults.datasets[type] || {}; + const datasetOptions = (options.datasets || {})[type] || {}; + return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x'; +} +function getAxisFromDefaultScaleID(id, indexAxis) { + let axis = id; + if (id === '_index_') { + axis = indexAxis; + } else if (id === '_value_') { + axis = indexAxis === 'x' ? 'y' : 'x'; + } + return axis; +} +function getDefaultScaleIDFromAxis(axis, indexAxis) { + return axis === indexAxis ? '_index_' : '_value_'; +} +function idMatchesAxis(id) { + if (id === 'x' || id === 'y' || id === 'r') { + return id; + } +} +function axisFromPosition(position) { + if (position === 'top' || position === 'bottom') { + return 'x'; + } + if (position === 'left' || position === 'right') { + return 'y'; + } +} +function determineAxis(id, ...scaleOptions) { + if (idMatchesAxis(id)) { + return id; + } + for (const opts of scaleOptions){ + const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase()); + if (axis) { + return axis; + } + } + throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`); +} +function getAxisFromDataset(id, axis, dataset) { + if (dataset[axis + 'AxisID'] === id) { + return { + axis + }; + } +} +function retrieveAxisFromDatasets(id, config) { + if (config.data && config.data.datasets) { + const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id); + if (boundDs.length) { + return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]); + } + } + return {}; +} +function mergeScaleConfig(config, options) { + const chartDefaults = overrides[config.type] || { + scales: {} + }; + const configScales = options.scales || {}; + const chartIndexAxis = getIndexAxis(config.type, options); + const scales = Object.create(null); + Object.keys(configScales).forEach((id)=>{ + const scaleConf = configScales[id]; + if (!isObject(scaleConf)) { + return console.error(`Invalid scale configuration for scale: ${id}`); + } + if (scaleConf._proxy) { + return console.warn(`Ignoring resolver passed as options for scale: ${id}`); + } + const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]); + const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis); + const defaultScaleOptions = chartDefaults.scales || {}; + scales[id] = mergeIf(Object.create(null), [ + { + axis + }, + scaleConf, + defaultScaleOptions[axis], + defaultScaleOptions[defaultId] + ]); + }); + config.data.datasets.forEach((dataset)=>{ + const type = dataset.type || config.type; + const indexAxis = dataset.indexAxis || getIndexAxis(type, options); + const datasetDefaults = overrides[type] || {}; + const defaultScaleOptions = datasetDefaults.scales || {}; + Object.keys(defaultScaleOptions).forEach((defaultID)=>{ + const axis = getAxisFromDefaultScaleID(defaultID, indexAxis); + const id = dataset[axis + 'AxisID'] || axis; + scales[id] = scales[id] || Object.create(null); + mergeIf(scales[id], [ + { + axis + }, + configScales[id], + defaultScaleOptions[defaultID] + ]); + }); + }); + Object.keys(scales).forEach((key)=>{ + const scale = scales[key]; + mergeIf(scale, [ + defaults.scales[scale.type], + defaults.scale + ]); + }); + return scales; +} +function initOptions(config) { + const options = config.options || (config.options = {}); + options.plugins = valueOrDefault(options.plugins, {}); + options.scales = mergeScaleConfig(config, options); +} +function initData(data) { + data = data || {}; + data.datasets = data.datasets || []; + data.labels = data.labels || []; + return data; +} +function initConfig(config) { + config = config || {}; + config.data = initData(config.data); + initOptions(config); + return config; +} +const keyCache = new Map(); +const keysCached = new Set(); +function cachedKeys(cacheKey, generate) { + let keys = keyCache.get(cacheKey); + if (!keys) { + keys = generate(); + keyCache.set(cacheKey, keys); + keysCached.add(keys); + } + return keys; +} +const addIfFound = (set, obj, key)=>{ + const opts = resolveObjectKey(obj, key); + if (opts !== undefined) { + set.add(opts); + } +}; +class Config { + constructor(config){ + this._config = initConfig(config); + this._scopeCache = new Map(); + this._resolverCache = new Map(); + } + get platform() { + return this._config.platform; + } + get type() { + return this._config.type; + } + set type(type) { + this._config.type = type; + } + get data() { + return this._config.data; + } + set data(data) { + this._config.data = initData(data); + } + get options() { + return this._config.options; + } + set options(options) { + this._config.options = options; + } + get plugins() { + return this._config.plugins; + } + update() { + const config = this._config; + this.clearCache(); + initOptions(config); + } + clearCache() { + this._scopeCache.clear(); + this._resolverCache.clear(); + } + datasetScopeKeys(datasetType) { + return cachedKeys(datasetType, ()=>[ + [ + `datasets.${datasetType}`, + '' + ] + ]); + } + datasetAnimationScopeKeys(datasetType, transition) { + return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[ + [ + `datasets.${datasetType}.transitions.${transition}`, + `transitions.${transition}` + ], + [ + `datasets.${datasetType}`, + '' + ] + ]); + } + datasetElementScopeKeys(datasetType, elementType) { + return cachedKeys(`${datasetType}-${elementType}`, ()=>[ + [ + `datasets.${datasetType}.elements.${elementType}`, + `datasets.${datasetType}`, + `elements.${elementType}`, + '' + ] + ]); + } + pluginScopeKeys(plugin) { + const id = plugin.id; + const type = this.type; + return cachedKeys(`${type}-plugin-${id}`, ()=>[ + [ + `plugins.${id}`, + ...plugin.additionalOptionScopes || [] + ] + ]); + } + _cachedScopes(mainScope, resetCache) { + const _scopeCache = this._scopeCache; + let cache = _scopeCache.get(mainScope); + if (!cache || resetCache) { + cache = new Map(); + _scopeCache.set(mainScope, cache); + } + return cache; + } + getOptionScopes(mainScope, keyLists, resetCache) { + const { options , type } = this; + const cache = this._cachedScopes(mainScope, resetCache); + const cached = cache.get(keyLists); + if (cached) { + return cached; + } + const scopes = new Set(); + keyLists.forEach((keys)=>{ + if (mainScope) { + scopes.add(mainScope); + keys.forEach((key)=>addIfFound(scopes, mainScope, key)); + } + keys.forEach((key)=>addIfFound(scopes, options, key)); + keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key)); + keys.forEach((key)=>addIfFound(scopes, defaults, key)); + keys.forEach((key)=>addIfFound(scopes, descriptors, key)); + }); + const array = Array.from(scopes); + if (array.length === 0) { + array.push(Object.create(null)); + } + if (keysCached.has(keyLists)) { + cache.set(keyLists, array); + } + return array; + } + chartOptionScopes() { + const { options , type } = this; + return [ + options, + overrides[type] || {}, + defaults.datasets[type] || {}, + { + type + }, + defaults, + descriptors + ]; + } + resolveNamedOptions(scopes, names, context, prefixes = [ + '' + ]) { + const result = { + $shared: true + }; + const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes); + let options = resolver; + if (needContext(resolver, names)) { + result.$shared = false; + context = isFunction(context) ? context() : context; + const subResolver = this.createResolver(scopes, context, subPrefixes); + options = _attachContext(resolver, context, subResolver); + } + for (const prop of names){ + result[prop] = options[prop]; + } + return result; + } + createResolver(scopes, context, prefixes = [ + '' + ], descriptorDefaults) { + const { resolver } = getResolver(this._resolverCache, scopes, prefixes); + return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver; + } +} +function getResolver(resolverCache, scopes, prefixes) { + let cache = resolverCache.get(scopes); + if (!cache) { + cache = new Map(); + resolverCache.set(scopes, cache); + } + const cacheKey = prefixes.join(); + let cached = cache.get(cacheKey); + if (!cached) { + const resolver = _createResolver(scopes, prefixes); + cached = { + resolver, + subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover')) + }; + cache.set(cacheKey, cached); + } + return cached; +} +const hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).some((key)=>isFunction(value[key])); +function needContext(proxy, names) { + const { isScriptable , isIndexable } = _descriptors(proxy); + for (const prop of names){ + const scriptable = isScriptable(prop); + const indexable = isIndexable(prop); + const value = (indexable || scriptable) && proxy[prop]; + if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) { + return true; + } + } + return false; +} + +var version = "4.4.7"; + +const KNOWN_POSITIONS = [ + 'top', + 'bottom', + 'left', + 'right', + 'chartArea' +]; +function positionIsHorizontal(position, axis) { + return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x'; +} +function compare2Level(l1, l2) { + return function(a, b) { + return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1]; + }; +} +function onAnimationsComplete(context) { + const chart = context.chart; + const animationOptions = chart.options.animation; + chart.notifyPlugins('afterRender'); + callback(animationOptions && animationOptions.onComplete, [ + context + ], chart); +} +function onAnimationProgress(context) { + const chart = context.chart; + const animationOptions = chart.options.animation; + callback(animationOptions && animationOptions.onProgress, [ + context + ], chart); +} + function getCanvas(item) { + if (_isDomSupported() && typeof item === 'string') { + item = document.getElementById(item); + } else if (item && item.length) { + item = item[0]; + } + if (item && item.canvas) { + item = item.canvas; + } + return item; +} +const instances = {}; +const getChart = (key)=>{ + const canvas = getCanvas(key); + return Object.values(instances).filter((c)=>c.canvas === canvas).pop(); +}; +function moveNumericKeys(obj, start, move) { + const keys = Object.keys(obj); + for (const key of keys){ + const intKey = +key; + if (intKey >= start) { + const value = obj[key]; + delete obj[key]; + if (move > 0 || intKey > start) { + obj[intKey + move] = value; + } + } + } +} + function determineLastEvent(e, lastEvent, inChartArea, isClick) { + if (!inChartArea || e.type === 'mouseout') { + return null; + } + if (isClick) { + return lastEvent; + } + return e; +} +function getSizeForArea(scale, chartArea, field) { + return scale.options.clip ? scale[field] : chartArea[field]; +} +function getDatasetArea(meta, chartArea) { + const { xScale , yScale } = meta; + if (xScale && yScale) { + return { + left: getSizeForArea(xScale, chartArea, 'left'), + right: getSizeForArea(xScale, chartArea, 'right'), + top: getSizeForArea(yScale, chartArea, 'top'), + bottom: getSizeForArea(yScale, chartArea, 'bottom') + }; + } + return chartArea; +} +class Chart { + static defaults = defaults; + static instances = instances; + static overrides = overrides; + static registry = registry; + static version = version; + static getChart = getChart; + static register(...items) { + registry.add(...items); + invalidatePlugins(); + } + static unregister(...items) { + registry.remove(...items); + invalidatePlugins(); + } + constructor(item, userConfig){ + const config = this.config = new Config(userConfig); + const initialCanvas = getCanvas(item); + const existingChart = getChart(initialCanvas); + if (existingChart) { + throw new Error('Canvas is already in use. Chart with ID \'' + existingChart.id + '\'' + ' must be destroyed before the canvas with ID \'' + existingChart.canvas.id + '\' can be reused.'); + } + const options = config.createResolver(config.chartOptionScopes(), this.getContext()); + this.platform = new (config.platform || _detectPlatform(initialCanvas))(); + this.platform.updateConfig(config); + const context = this.platform.acquireContext(initialCanvas, options.aspectRatio); + const canvas = context && context.canvas; + const height = canvas && canvas.height; + const width = canvas && canvas.width; + this.id = uid(); + this.ctx = context; + this.canvas = canvas; + this.width = width; + this.height = height; + this._options = options; + this._aspectRatio = this.aspectRatio; + this._layers = []; + this._metasets = []; + this._stacks = undefined; + this.boxes = []; + this.currentDevicePixelRatio = undefined; + this.chartArea = undefined; + this._active = []; + this._lastEvent = undefined; + this._listeners = {}; + this._responsiveListeners = undefined; + this._sortedMetasets = []; + this.scales = {}; + this._plugins = new PluginService(); + this.$proxies = {}; + this._hiddenIndices = {}; + this.attached = false; + this._animationsDisabled = undefined; + this.$context = undefined; + this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0); + this._dataChanges = []; + instances[this.id] = this; + if (!context || !canvas) { + console.error("Failed to create chart: can't acquire context from the given item"); + return; + } + animator.listen(this, 'complete', onAnimationsComplete); + animator.listen(this, 'progress', onAnimationProgress); + this._initialize(); + if (this.attached) { + this.update(); + } + } + get aspectRatio() { + const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this; + if (!isNullOrUndef(aspectRatio)) { + return aspectRatio; + } + if (maintainAspectRatio && _aspectRatio) { + return _aspectRatio; + } + return height ? width / height : null; + } + get data() { + return this.config.data; + } + set data(data) { + this.config.data = data; + } + get options() { + return this._options; + } + set options(options) { + this.config.options = options; + } + get registry() { + return registry; + } + _initialize() { + this.notifyPlugins('beforeInit'); + if (this.options.responsive) { + this.resize(); + } else { + retinaScale(this, this.options.devicePixelRatio); + } + this.bindEvents(); + this.notifyPlugins('afterInit'); + return this; + } + clear() { + clearCanvas(this.canvas, this.ctx); + return this; + } + stop() { + animator.stop(this); + return this; + } + resize(width, height) { + if (!animator.running(this)) { + this._resize(width, height); + } else { + this._resizeBeforeDraw = { + width, + height + }; + } + } + _resize(width, height) { + const options = this.options; + const canvas = this.canvas; + const aspectRatio = options.maintainAspectRatio && this.aspectRatio; + const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio); + const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio(); + const mode = this.width ? 'resize' : 'attach'; + this.width = newSize.width; + this.height = newSize.height; + this._aspectRatio = this.aspectRatio; + if (!retinaScale(this, newRatio, true)) { + return; + } + this.notifyPlugins('resize', { + size: newSize + }); + callback(options.onResize, [ + this, + newSize + ], this); + if (this.attached) { + if (this._doResize(mode)) { + this.render(); + } + } + } + ensureScalesHaveIDs() { + const options = this.options; + const scalesOptions = options.scales || {}; + each(scalesOptions, (axisOptions, axisID)=>{ + axisOptions.id = axisID; + }); + } + buildOrUpdateScales() { + const options = this.options; + const scaleOpts = options.scales; + const scales = this.scales; + const updated = Object.keys(scales).reduce((obj, id)=>{ + obj[id] = false; + return obj; + }, {}); + let items = []; + if (scaleOpts) { + items = items.concat(Object.keys(scaleOpts).map((id)=>{ + const scaleOptions = scaleOpts[id]; + const axis = determineAxis(id, scaleOptions); + const isRadial = axis === 'r'; + const isHorizontal = axis === 'x'; + return { + options: scaleOptions, + dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left', + dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear' + }; + })); + } + each(items, (item)=>{ + const scaleOptions = item.options; + const id = scaleOptions.id; + const axis = determineAxis(id, scaleOptions); + const scaleType = valueOrDefault(scaleOptions.type, item.dtype); + if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) { + scaleOptions.position = item.dposition; + } + updated[id] = true; + let scale = null; + if (id in scales && scales[id].type === scaleType) { + scale = scales[id]; + } else { + const scaleClass = registry.getScale(scaleType); + scale = new scaleClass({ + id, + type: scaleType, + ctx: this.ctx, + chart: this + }); + scales[scale.id] = scale; + } + scale.init(scaleOptions, options); + }); + each(updated, (hasUpdated, id)=>{ + if (!hasUpdated) { + delete scales[id]; + } + }); + each(scales, (scale)=>{ + layouts.configure(this, scale, scale.options); + layouts.addBox(this, scale); + }); + } + _updateMetasets() { + const metasets = this._metasets; + const numData = this.data.datasets.length; + const numMeta = metasets.length; + metasets.sort((a, b)=>a.index - b.index); + if (numMeta > numData) { + for(let i = numData; i < numMeta; ++i){ + this._destroyDatasetMeta(i); + } + metasets.splice(numData, numMeta - numData); + } + this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index')); + } + _removeUnreferencedMetasets() { + const { _metasets: metasets , data: { datasets } } = this; + if (metasets.length > datasets.length) { + delete this._stacks; + } + metasets.forEach((meta, index)=>{ + if (datasets.filter((x)=>x === meta._dataset).length === 0) { + this._destroyDatasetMeta(index); + } + }); + } + buildOrUpdateControllers() { + const newControllers = []; + const datasets = this.data.datasets; + let i, ilen; + this._removeUnreferencedMetasets(); + for(i = 0, ilen = datasets.length; i < ilen; i++){ + const dataset = datasets[i]; + let meta = this.getDatasetMeta(i); + const type = dataset.type || this.config.type; + if (meta.type && meta.type !== type) { + this._destroyDatasetMeta(i); + meta = this.getDatasetMeta(i); + } + meta.type = type; + meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options); + meta.order = dataset.order || 0; + meta.index = i; + meta.label = '' + dataset.label; + meta.visible = this.isDatasetVisible(i); + if (meta.controller) { + meta.controller.updateIndex(i); + meta.controller.linkScales(); + } else { + const ControllerClass = registry.getController(type); + const { datasetElementType , dataElementType } = defaults.datasets[type]; + Object.assign(ControllerClass, { + dataElementType: registry.getElement(dataElementType), + datasetElementType: datasetElementType && registry.getElement(datasetElementType) + }); + meta.controller = new ControllerClass(this, i); + newControllers.push(meta.controller); + } + } + this._updateMetasets(); + return newControllers; + } + _resetElements() { + each(this.data.datasets, (dataset, datasetIndex)=>{ + this.getDatasetMeta(datasetIndex).controller.reset(); + }, this); + } + reset() { + this._resetElements(); + this.notifyPlugins('reset'); + } + update(mode) { + const config = this.config; + config.update(); + const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext()); + const animsDisabled = this._animationsDisabled = !options.animation; + this._updateScales(); + this._checkEventBindings(); + this._updateHiddenIndices(); + this._plugins.invalidate(); + if (this.notifyPlugins('beforeUpdate', { + mode, + cancelable: true + }) === false) { + return; + } + const newControllers = this.buildOrUpdateControllers(); + this.notifyPlugins('beforeElementsUpdate'); + let minPadding = 0; + for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){ + const { controller } = this.getDatasetMeta(i); + const reset = !animsDisabled && newControllers.indexOf(controller) === -1; + controller.buildOrUpdateElements(reset); + minPadding = Math.max(+controller.getMaxOverflow(), minPadding); + } + minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0; + this._updateLayout(minPadding); + if (!animsDisabled) { + each(newControllers, (controller)=>{ + controller.reset(); + }); + } + this._updateDatasets(mode); + this.notifyPlugins('afterUpdate', { + mode + }); + this._layers.sort(compare2Level('z', '_idx')); + const { _active , _lastEvent } = this; + if (_lastEvent) { + this._eventHandler(_lastEvent, true); + } else if (_active.length) { + this._updateHoverStyles(_active, _active, true); + } + this.render(); + } + _updateScales() { + each(this.scales, (scale)=>{ + layouts.removeBox(this, scale); + }); + this.ensureScalesHaveIDs(); + this.buildOrUpdateScales(); + } + _checkEventBindings() { + const options = this.options; + const existingEvents = new Set(Object.keys(this._listeners)); + const newEvents = new Set(options.events); + if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) { + this.unbindEvents(); + this.bindEvents(); + } + } + _updateHiddenIndices() { + const { _hiddenIndices } = this; + const changes = this._getUniformDataChanges() || []; + for (const { method , start , count } of changes){ + const move = method === '_removeElements' ? -count : count; + moveNumericKeys(_hiddenIndices, start, move); + } + } + _getUniformDataChanges() { + const _dataChanges = this._dataChanges; + if (!_dataChanges || !_dataChanges.length) { + return; + } + this._dataChanges = []; + const datasetCount = this.data.datasets.length; + const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(','))); + const changeSet = makeSet(0); + for(let i = 1; i < datasetCount; i++){ + if (!setsEqual(changeSet, makeSet(i))) { + return; + } + } + return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({ + method: a[1], + start: +a[2], + count: +a[3] + })); + } + _updateLayout(minPadding) { + if (this.notifyPlugins('beforeLayout', { + cancelable: true + }) === false) { + return; + } + layouts.update(this, this.width, this.height, minPadding); + const area = this.chartArea; + const noArea = area.width <= 0 || area.height <= 0; + this._layers = []; + each(this.boxes, (box)=>{ + if (noArea && box.position === 'chartArea') { + return; + } + if (box.configure) { + box.configure(); + } + this._layers.push(...box._layers()); + }, this); + this._layers.forEach((item, index)=>{ + item._idx = index; + }); + this.notifyPlugins('afterLayout'); + } + _updateDatasets(mode) { + if (this.notifyPlugins('beforeDatasetsUpdate', { + mode, + cancelable: true + }) === false) { + return; + } + for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this.getDatasetMeta(i).controller.configure(); + } + for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this._updateDataset(i, isFunction(mode) ? mode({ + datasetIndex: i + }) : mode); + } + this.notifyPlugins('afterDatasetsUpdate', { + mode + }); + } + _updateDataset(index, mode) { + const meta = this.getDatasetMeta(index); + const args = { + meta, + index, + mode, + cancelable: true + }; + if (this.notifyPlugins('beforeDatasetUpdate', args) === false) { + return; + } + meta.controller._update(mode); + args.cancelable = false; + this.notifyPlugins('afterDatasetUpdate', args); + } + render() { + if (this.notifyPlugins('beforeRender', { + cancelable: true + }) === false) { + return; + } + if (animator.has(this)) { + if (this.attached && !animator.running(this)) { + animator.start(this); + } + } else { + this.draw(); + onAnimationsComplete({ + chart: this + }); + } + } + draw() { + let i; + if (this._resizeBeforeDraw) { + const { width , height } = this._resizeBeforeDraw; + this._resizeBeforeDraw = null; + this._resize(width, height); + } + this.clear(); + if (this.width <= 0 || this.height <= 0) { + return; + } + if (this.notifyPlugins('beforeDraw', { + cancelable: true + }) === false) { + return; + } + const layers = this._layers; + for(i = 0; i < layers.length && layers[i].z <= 0; ++i){ + layers[i].draw(this.chartArea); + } + this._drawDatasets(); + for(; i < layers.length; ++i){ + layers[i].draw(this.chartArea); + } + this.notifyPlugins('afterDraw'); + } + _getSortedDatasetMetas(filterVisible) { + const metasets = this._sortedMetasets; + const result = []; + let i, ilen; + for(i = 0, ilen = metasets.length; i < ilen; ++i){ + const meta = metasets[i]; + if (!filterVisible || meta.visible) { + result.push(meta); + } + } + return result; + } + getSortedVisibleDatasetMetas() { + return this._getSortedDatasetMetas(true); + } + _drawDatasets() { + if (this.notifyPlugins('beforeDatasetsDraw', { + cancelable: true + }) === false) { + return; + } + const metasets = this.getSortedVisibleDatasetMetas(); + for(let i = metasets.length - 1; i >= 0; --i){ + this._drawDataset(metasets[i]); + } + this.notifyPlugins('afterDatasetsDraw'); + } + _drawDataset(meta) { + const ctx = this.ctx; + const clip = meta._clip; + const useClip = !clip.disabled; + const area = getDatasetArea(meta, this.chartArea); + const args = { + meta, + index: meta.index, + cancelable: true + }; + if (this.notifyPlugins('beforeDatasetDraw', args) === false) { + return; + } + if (useClip) { + clipArea(ctx, { + left: clip.left === false ? 0 : area.left - clip.left, + right: clip.right === false ? this.width : area.right + clip.right, + top: clip.top === false ? 0 : area.top - clip.top, + bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom + }); + } + meta.controller.draw(); + if (useClip) { + unclipArea(ctx); + } + args.cancelable = false; + this.notifyPlugins('afterDatasetDraw', args); + } + isPointInArea(point) { + return _isPointInArea(point, this.chartArea, this._minPadding); + } + getElementsAtEventForMode(e, mode, options, useFinalPosition) { + const method = Interaction.modes[mode]; + if (typeof method === 'function') { + return method(this, e, options, useFinalPosition); + } + return []; + } + getDatasetMeta(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + const metasets = this._metasets; + let meta = metasets.filter((x)=>x && x._dataset === dataset).pop(); + if (!meta) { + meta = { + type: null, + data: [], + dataset: null, + controller: null, + hidden: null, + xAxisID: null, + yAxisID: null, + order: dataset && dataset.order || 0, + index: datasetIndex, + _dataset: dataset, + _parsed: [], + _sorted: false + }; + metasets.push(meta); + } + return meta; + } + getContext() { + return this.$context || (this.$context = createContext(null, { + chart: this, + type: 'chart' + })); + } + getVisibleDatasetCount() { + return this.getSortedVisibleDatasetMetas().length; + } + isDatasetVisible(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + if (!dataset) { + return false; + } + const meta = this.getDatasetMeta(datasetIndex); + return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden; + } + setDatasetVisibility(datasetIndex, visible) { + const meta = this.getDatasetMeta(datasetIndex); + meta.hidden = !visible; + } + toggleDataVisibility(index) { + this._hiddenIndices[index] = !this._hiddenIndices[index]; + } + getDataVisibility(index) { + return !this._hiddenIndices[index]; + } + _updateVisibility(datasetIndex, dataIndex, visible) { + const mode = visible ? 'show' : 'hide'; + const meta = this.getDatasetMeta(datasetIndex); + const anims = meta.controller._resolveAnimations(undefined, mode); + if (defined(dataIndex)) { + meta.data[dataIndex].hidden = !visible; + this.update(); + } else { + this.setDatasetVisibility(datasetIndex, visible); + anims.update(meta, { + visible + }); + this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined); + } + } + hide(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, false); + } + show(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, true); + } + _destroyDatasetMeta(datasetIndex) { + const meta = this._metasets[datasetIndex]; + if (meta && meta.controller) { + meta.controller._destroy(); + } + delete this._metasets[datasetIndex]; + } + _stop() { + let i, ilen; + this.stop(); + animator.remove(this); + for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){ + this._destroyDatasetMeta(i); + } + } + destroy() { + this.notifyPlugins('beforeDestroy'); + const { canvas , ctx } = this; + this._stop(); + this.config.clearCache(); + if (canvas) { + this.unbindEvents(); + clearCanvas(canvas, ctx); + this.platform.releaseContext(ctx); + this.canvas = null; + this.ctx = null; + } + delete instances[this.id]; + this.notifyPlugins('afterDestroy'); + } + toBase64Image(...args) { + return this.canvas.toDataURL(...args); + } + bindEvents() { + this.bindUserEvents(); + if (this.options.responsive) { + this.bindResponsiveEvents(); + } else { + this.attached = true; + } + } + bindUserEvents() { + const listeners = this._listeners; + const platform = this.platform; + const _add = (type, listener)=>{ + platform.addEventListener(this, type, listener); + listeners[type] = listener; + }; + const listener = (e, x, y)=>{ + e.offsetX = x; + e.offsetY = y; + this._eventHandler(e); + }; + each(this.options.events, (type)=>_add(type, listener)); + } + bindResponsiveEvents() { + if (!this._responsiveListeners) { + this._responsiveListeners = {}; + } + const listeners = this._responsiveListeners; + const platform = this.platform; + const _add = (type, listener)=>{ + platform.addEventListener(this, type, listener); + listeners[type] = listener; + }; + const _remove = (type, listener)=>{ + if (listeners[type]) { + platform.removeEventListener(this, type, listener); + delete listeners[type]; + } + }; + const listener = (width, height)=>{ + if (this.canvas) { + this.resize(width, height); + } + }; + let detached; + const attached = ()=>{ + _remove('attach', attached); + this.attached = true; + this.resize(); + _add('resize', listener); + _add('detach', detached); + }; + detached = ()=>{ + this.attached = false; + _remove('resize', listener); + this._stop(); + this._resize(0, 0); + _add('attach', attached); + }; + if (platform.isAttached(this.canvas)) { + attached(); + } else { + detached(); + } + } + unbindEvents() { + each(this._listeners, (listener, type)=>{ + this.platform.removeEventListener(this, type, listener); + }); + this._listeners = {}; + each(this._responsiveListeners, (listener, type)=>{ + this.platform.removeEventListener(this, type, listener); + }); + this._responsiveListeners = undefined; + } + updateHoverStyle(items, mode, enabled) { + const prefix = enabled ? 'set' : 'remove'; + let meta, item, i, ilen; + if (mode === 'dataset') { + meta = this.getDatasetMeta(items[0].datasetIndex); + meta.controller['_' + prefix + 'DatasetHoverStyle'](); + } + for(i = 0, ilen = items.length; i < ilen; ++i){ + item = items[i]; + const controller = item && this.getDatasetMeta(item.datasetIndex).controller; + if (controller) { + controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index); + } + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements) { + const lastActive = this._active || []; + const active = activeElements.map(({ datasetIndex , index })=>{ + const meta = this.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error('No dataset found at index ' + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index], + index + }; + }); + const changed = !_elementsEqual(active, lastActive); + if (changed) { + this._active = active; + this._lastEvent = null; + this._updateHoverStyles(active, lastActive); + } + } + notifyPlugins(hook, args, filter) { + return this._plugins.notify(this, hook, args, filter); + } + isPluginEnabled(pluginId) { + return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1; + } + _updateHoverStyles(active, lastActive, replay) { + const hoverOptions = this.options.hover; + const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index)); + const deactivated = diff(lastActive, active); + const activated = replay ? active : diff(active, lastActive); + if (deactivated.length) { + this.updateHoverStyle(deactivated, hoverOptions.mode, false); + } + if (activated.length && hoverOptions.mode) { + this.updateHoverStyle(activated, hoverOptions.mode, true); + } + } + _eventHandler(e, replay) { + const args = { + event: e, + replay, + cancelable: true, + inChartArea: this.isPointInArea(e) + }; + const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type); + if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) { + return; + } + const changed = this._handleEvent(e, replay, args.inChartArea); + args.cancelable = false; + this.notifyPlugins('afterEvent', args, eventFilter); + if (changed || args.changed) { + this.render(); + } + return this; + } + _handleEvent(e, replay, inChartArea) { + const { _active: lastActive = [] , options } = this; + const useFinalPosition = replay; + const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition); + const isClick = _isClickEvent(e); + const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick); + if (inChartArea) { + this._lastEvent = null; + callback(options.onHover, [ + e, + active, + this + ], this); + if (isClick) { + callback(options.onClick, [ + e, + active, + this + ], this); + } + } + const changed = !_elementsEqual(active, lastActive); + if (changed || replay) { + this._active = active; + this._updateHoverStyles(active, lastActive, replay); + } + this._lastEvent = lastEvent; + return changed; + } + _getActiveElements(e, lastActive, inChartArea, useFinalPosition) { + if (e.type === 'mouseout') { + return []; + } + if (!inChartArea) { + return lastActive; + } + const hoverOptions = this.options.hover; + return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition); + } +} +function invalidatePlugins() { + return each(Chart.instances, (chart)=>chart._plugins.invalidate()); +} + +function clipArc(ctx, element, endAngle) { + const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element; + let angleMargin = pixelMargin / outerRadius; + // Draw an inner border by clipping the arc and drawing a double-width border + // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders + ctx.beginPath(); + ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin); + if (innerRadius > pixelMargin) { + angleMargin = pixelMargin / innerRadius; + ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true); + } else { + ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI); + } + ctx.closePath(); + ctx.clip(); +} +function toRadiusCorners(value) { + return _readValueToProps(value, [ + 'outerStart', + 'outerEnd', + 'innerStart', + 'innerEnd' + ]); +} +/** + * Parse border radius from the provided options + */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) { + const o = toRadiusCorners(arc.options.borderRadius); + const halfThickness = (outerRadius - innerRadius) / 2; + const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2); + // Outer limits are complicated. We want to compute the available angular distance at + // a radius of outerRadius - borderRadius because for small angular distances, this term limits. + // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners. + // + // If the borderRadius is large, that value can become negative. + // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius + // we know that the thickness term will dominate and compute the limits at that point + const computeOuterLimit = (val)=>{ + const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2; + return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit)); + }; + return { + outerStart: computeOuterLimit(o.outerStart), + outerEnd: computeOuterLimit(o.outerEnd), + innerStart: _limitValue(o.innerStart, 0, innerLimit), + innerEnd: _limitValue(o.innerEnd, 0, innerLimit) + }; +} +/** + * Convert (r, 𝜃) to (x, y) + */ function rThetaToXY(r, theta, x, y) { + return { + x: x + r * Math.cos(theta), + y: y + r * Math.sin(theta) + }; +} +/** + * Path the arc, respecting border radius by separating into left and right halves. + * + * Start End + * + * 1--->a--->2 Outer + * / \ + * 8 3 + * | | + * | | + * 7 4 + * \ / + * 6<---b<---5 Inner + */ function pathArc(ctx, element, offset, spacing, end, circular) { + const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element; + const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0); + const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0; + let spacingOffset = 0; + const alpha = end - start; + if (spacing) { + // When spacing is present, it is the same for all items + // So we adjust the start and end angle of the arc such that + // the distance is the same as it would be without the spacing + const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0; + const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0; + const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2; + const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha; + spacingOffset = (alpha - adjustedAngle) / 2; + } + const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius; + const angleOffset = (alpha - beta) / 2; + const startAngle = start + angleOffset + spacingOffset; + const endAngle = end - angleOffset - spacingOffset; + const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle); + const outerStartAdjustedRadius = outerRadius - outerStart; + const outerEndAdjustedRadius = outerRadius - outerEnd; + const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius; + const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius; + const innerStartAdjustedRadius = innerRadius + innerStart; + const innerEndAdjustedRadius = innerRadius + innerEnd; + const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius; + const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius; + ctx.beginPath(); + if (circular) { + // The first arc segments from point 1 to point a to point 2 + const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2; + ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle); + ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle); + // The corner segment from point 2 to point 3 + if (outerEnd > 0) { + const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI); + } + // The line from point 3 to point 4 + const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y); + ctx.lineTo(p4.x, p4.y); + // The corner segment from point 4 to point 5 + if (innerEnd > 0) { + const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI); + } + // The inner arc from point 5 to point b to point 6 + const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2; + ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true); + ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true); + // The corner segment from point 6 to point 7 + if (innerStart > 0) { + const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI); + } + // The line from point 7 to point 8 + const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y); + ctx.lineTo(p8.x, p8.y); + // The corner segment from point 8 to point 1 + if (outerStart > 0) { + const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle); + } + } else { + ctx.moveTo(x, y); + const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x; + const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerStartX, outerStartY); + const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x; + const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerEndX, outerEndY); + } + ctx.closePath(); +} +function drawArc(ctx, element, offset, spacing, circular) { + const { fullCircles , startAngle , circumference } = element; + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for(let i = 0; i < fullCircles; ++i){ + ctx.fill(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % TAU || TAU); + } + } + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.fill(); + return endAngle; +} +function drawBorder(ctx, element, offset, spacing, circular) { + const { fullCircles , startAngle , circumference , options } = element; + const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options; + const inner = options.borderAlign === 'inner'; + if (!borderWidth) { + return; + } + ctx.setLineDash(borderDash || []); + ctx.lineDashOffset = borderDashOffset; + if (inner) { + ctx.lineWidth = borderWidth * 2; + ctx.lineJoin = borderJoinStyle || 'round'; + } else { + ctx.lineWidth = borderWidth; + ctx.lineJoin = borderJoinStyle || 'bevel'; + } + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for(let i = 0; i < fullCircles; ++i){ + ctx.stroke(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % TAU || TAU); + } + } + if (inner) { + clipArc(ctx, element, endAngle); + } + if (!fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.stroke(); + } +} +class ArcElement extends Element { + static id = 'arc'; + static defaults = { + borderAlign: 'center', + borderColor: '#fff', + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: undefined, + borderRadius: 0, + borderWidth: 2, + offset: 0, + spacing: 0, + angle: undefined, + circular: true + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor' + }; + static descriptors = { + _scriptable: true, + _indexable: (name)=>name !== 'borderDash' + }; + circumference; + endAngle; + fullCircles; + innerRadius; + outerRadius; + pixelMargin; + startAngle; + constructor(cfg){ + super(); + this.options = undefined; + this.circumference = undefined; + this.startAngle = undefined; + this.endAngle = undefined; + this.innerRadius = undefined; + this.outerRadius = undefined; + this.pixelMargin = 0; + this.fullCircles = 0; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(chartX, chartY, useFinalPosition) { + const point = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + const { angle , distance } = getAngleFromPoint(point, { + x: chartX, + y: chartY + }); + const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([ + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius', + 'circumference' + ], useFinalPosition); + const rAdjust = (this.options.spacing + this.options.borderWidth) / 2; + const _circumference = valueOrDefault(circumference, endAngle - startAngle); + const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle; + const betweenAngles = _circumference >= TAU || nonZeroBetween; + const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust); + return betweenAngles && withinRadius; + } + getCenterPoint(useFinalPosition) { + const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([ + 'x', + 'y', + 'startAngle', + 'endAngle', + 'innerRadius', + 'outerRadius' + ], useFinalPosition); + const { offset , spacing } = this.options; + const halfAngle = (startAngle + endAngle) / 2; + const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2; + return { + x: x + Math.cos(halfAngle) * halfRadius, + y: y + Math.sin(halfAngle) * halfRadius + }; + } + tooltipPosition(useFinalPosition) { + return this.getCenterPoint(useFinalPosition); + } + draw(ctx) { + const { options , circumference } = this; + const offset = (options.offset || 0) / 4; + const spacing = (options.spacing || 0) / 2; + const circular = options.circular; + this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0; + this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0; + if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) { + return; + } + ctx.save(); + const halfAngle = (this.startAngle + this.endAngle) / 2; + ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset); + const fix = 1 - Math.sin(Math.min(PI, circumference || 0)); + const radiusOffset = offset * fix; + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + drawArc(ctx, this, radiusOffset, spacing, circular); + drawBorder(ctx, this, radiusOffset, spacing, circular); + ctx.restore(); + } +} + +function setStyle(ctx, options, style = options) { + ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle); + ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash)); + ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset); + ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle); + ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth); + ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor); +} +function lineTo(ctx, previous, target) { + ctx.lineTo(target.x, target.y); +} + function getLineMethod(options) { + if (options.stepped) { + return _steppedLineTo; + } + if (options.tension || options.cubicInterpolationMode === 'monotone') { + return _bezierCurveTo; + } + return lineTo; +} +function pathVars(points, segment, params = {}) { + const count = points.length; + const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params; + const { start: segmentStart , end: segmentEnd } = segment; + const start = Math.max(paramsStart, segmentStart); + const end = Math.min(paramsEnd, segmentEnd); + const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd; + return { + count, + start, + loop: segment.loop, + ilen: end < start && !outside ? count + end - start : end - start + }; +} + function pathSegment(ctx, line, segment, params) { + const { points , options } = line; + const { count , start , loop , ilen } = pathVars(points, segment, params); + const lineMethod = getLineMethod(options); + let { move =true , reverse } = params || {}; + let i, point, prev; + for(i = 0; i <= ilen; ++i){ + point = points[(start + (reverse ? ilen - i : i)) % count]; + if (point.skip) { + continue; + } else if (move) { + ctx.moveTo(point.x, point.y); + move = false; + } else { + lineMethod(ctx, prev, point, reverse, options.stepped); + } + prev = point; + } + if (loop) { + point = points[(start + (reverse ? ilen : 0)) % count]; + lineMethod(ctx, prev, point, reverse, options.stepped); + } + return !!loop; +} + function fastPathSegment(ctx, line, segment, params) { + const points = line.points; + const { count , start , ilen } = pathVars(points, segment, params); + const { move =true , reverse } = params || {}; + let avgX = 0; + let countX = 0; + let i, point, prevX, minY, maxY, lastY; + const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count; + const drawX = ()=>{ + if (minY !== maxY) { + ctx.lineTo(avgX, maxY); + ctx.lineTo(avgX, minY); + ctx.lineTo(avgX, lastY); + } + }; + if (move) { + point = points[pointIndex(0)]; + ctx.moveTo(point.x, point.y); + } + for(i = 0; i <= ilen; ++i){ + point = points[pointIndex(i)]; + if (point.skip) { + continue; + } + const x = point.x; + const y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + } else if (y > maxY) { + maxY = y; + } + avgX = (countX * avgX + x) / ++countX; + } else { + drawX(); + ctx.lineTo(x, y); + prevX = truncX; + countX = 0; + minY = maxY = y; + } + lastY = y; + } + drawX(); +} + function _getSegmentMethod(line) { + const opts = line.options; + const borderDash = opts.borderDash && opts.borderDash.length; + const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash; + return useFastPath ? fastPathSegment : pathSegment; +} + function _getInterpolationMethod(options) { + if (options.stepped) { + return _steppedInterpolation; + } + if (options.tension || options.cubicInterpolationMode === 'monotone') { + return _bezierInterpolation; + } + return _pointInLine; +} +function strokePathWithCache(ctx, line, start, count) { + let path = line._path; + if (!path) { + path = line._path = new Path2D(); + if (line.path(path, start, count)) { + path.closePath(); + } + } + setStyle(ctx, line.options); + ctx.stroke(path); +} +function strokePathDirect(ctx, line, start, count) { + const { segments , options } = line; + const segmentMethod = _getSegmentMethod(line); + for (const segment of segments){ + setStyle(ctx, options, segment.style); + ctx.beginPath(); + if (segmentMethod(ctx, line, segment, { + start, + end: start + count - 1 + })) { + ctx.closePath(); + } + ctx.stroke(); + } +} +const usePath2D = typeof Path2D === 'function'; +function draw(ctx, line, start, count) { + if (usePath2D && !line.options.segment) { + strokePathWithCache(ctx, line, start, count); + } else { + strokePathDirect(ctx, line, start, count); + } +} +class LineElement extends Element { + static id = 'line'; + static defaults = { + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: 'miter', + borderWidth: 3, + capBezierPoints: true, + cubicInterpolationMode: 'default', + fill: false, + spanGaps: false, + stepped: false, + tension: 0 + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + static descriptors = { + _scriptable: true, + _indexable: (name)=>name !== 'borderDash' && name !== 'fill' + }; + constructor(cfg){ + super(); + this.animated = true; + this.options = undefined; + this._chart = undefined; + this._loop = undefined; + this._fullLoop = undefined; + this._path = undefined; + this._points = undefined; + this._segments = undefined; + this._decimated = false; + this._pointsUpdated = false; + this._datasetIndex = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + updateControlPoints(chartArea, indexAxis) { + const options = this.options; + if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) { + const loop = options.spanGaps ? this._loop : this._fullLoop; + _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis); + this._pointsUpdated = true; + } + } + set points(points) { + this._points = points; + delete this._segments; + delete this._path; + this._pointsUpdated = false; + } + get points() { + return this._points; + } + get segments() { + return this._segments || (this._segments = _computeSegments(this, this.options.segment)); + } + first() { + const segments = this.segments; + const points = this.points; + return segments.length && points[segments[0].start]; + } + last() { + const segments = this.segments; + const points = this.points; + const count = segments.length; + return count && points[segments[count - 1].end]; + } + interpolate(point, property) { + const options = this.options; + const value = point[property]; + const points = this.points; + const segments = _boundSegments(this, { + property, + start: value, + end: value + }); + if (!segments.length) { + return; + } + const result = []; + const _interpolate = _getInterpolationMethod(options); + let i, ilen; + for(i = 0, ilen = segments.length; i < ilen; ++i){ + const { start , end } = segments[i]; + const p1 = points[start]; + const p2 = points[end]; + if (p1 === p2) { + result.push(p1); + continue; + } + const t = Math.abs((value - p1[property]) / (p2[property] - p1[property])); + const interpolated = _interpolate(p1, p2, t, options.stepped); + interpolated[property] = point[property]; + result.push(interpolated); + } + return result.length === 1 ? result[0] : result; + } + pathSegment(ctx, segment, params) { + const segmentMethod = _getSegmentMethod(this); + return segmentMethod(ctx, this, segment, params); + } + path(ctx, start, count) { + const segments = this.segments; + const segmentMethod = _getSegmentMethod(this); + let loop = this._loop; + start = start || 0; + count = count || this.points.length - start; + for (const segment of segments){ + loop &= segmentMethod(ctx, this, segment, { + start, + end: start + count - 1 + }); + } + return !!loop; + } + draw(ctx, chartArea, start, count) { + const options = this.options || {}; + const points = this.points || []; + if (points.length && options.borderWidth) { + ctx.save(); + draw(ctx, this, start, count); + ctx.restore(); + } + if (this.animated) { + this._pointsUpdated = false; + this._path = undefined; + } + } +} + +function inRange$1(el, pos, axis, useFinalPosition) { + const options = el.options; + const { [axis]: value } = el.getProps([ + axis + ], useFinalPosition); + return Math.abs(pos - value) < options.radius + options.hitRadius; +} +class PointElement extends Element { + static id = 'point'; + parsed; + skip; + stop; + /** + * @type {any} + */ static defaults = { + borderWidth: 1, + hitRadius: 1, + hoverBorderWidth: 1, + hoverRadius: 4, + pointStyle: 'circle', + radius: 3, + rotation: 0 + }; + /** + * @type {any} + */ static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + constructor(cfg){ + super(); + this.options = undefined; + this.parsed = undefined; + this.skip = undefined; + this.stop = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(mouseX, mouseY, useFinalPosition) { + const options = this.options; + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2); + } + inXRange(mouseX, useFinalPosition) { + return inRange$1(this, mouseX, 'x', useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange$1(this, mouseY, 'y', useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x , y } = this.getProps([ + 'x', + 'y' + ], useFinalPosition); + return { + x, + y + }; + } + size(options) { + options = options || this.options || {}; + let radius = options.radius || 0; + radius = Math.max(radius, radius && options.hoverRadius || 0); + const borderWidth = radius && options.borderWidth || 0; + return (radius + borderWidth) * 2; + } + draw(ctx, area) { + const options = this.options; + if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) { + return; + } + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.fillStyle = options.backgroundColor; + drawPoint(ctx, options, this.x, this.y); + } + getRange() { + const options = this.options || {}; + // @ts-expect-error Fallbacks should never be hit in practice + return options.radius + options.hitRadius; + } +} + +function getBarBounds(bar, useFinalPosition) { + const { x , y , base , width , height } = bar.getProps([ + 'x', + 'y', + 'base', + 'width', + 'height' + ], useFinalPosition); + let left, right, top, bottom, half; + if (bar.horizontal) { + half = height / 2; + left = Math.min(x, base); + right = Math.max(x, base); + top = y - half; + bottom = y + half; + } else { + half = width / 2; + left = x - half; + right = x + half; + top = Math.min(y, base); + bottom = Math.max(y, base); + } + return { + left, + top, + right, + bottom + }; +} +function skipOrLimit(skip, value, min, max) { + return skip ? 0 : _limitValue(value, min, max); +} +function parseBorderWidth(bar, maxW, maxH) { + const value = bar.options.borderWidth; + const skip = bar.borderSkipped; + const o = toTRBL(value); + return { + t: skipOrLimit(skip.top, o.top, 0, maxH), + r: skipOrLimit(skip.right, o.right, 0, maxW), + b: skipOrLimit(skip.bottom, o.bottom, 0, maxH), + l: skipOrLimit(skip.left, o.left, 0, maxW) + }; +} +function parseBorderRadius(bar, maxW, maxH) { + const { enableBorderRadius } = bar.getProps([ + 'enableBorderRadius' + ]); + const value = bar.options.borderRadius; + const o = toTRBLCorners(value); + const maxR = Math.min(maxW, maxH); + const skip = bar.borderSkipped; + const enableBorder = enableBorderRadius || isObject(value); + return { + topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR), + topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR), + bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR), + bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR) + }; +} +function boundingRects(bar) { + const bounds = getBarBounds(bar); + const width = bounds.right - bounds.left; + const height = bounds.bottom - bounds.top; + const border = parseBorderWidth(bar, width / 2, height / 2); + const radius = parseBorderRadius(bar, width / 2, height / 2); + return { + outer: { + x: bounds.left, + y: bounds.top, + w: width, + h: height, + radius + }, + inner: { + x: bounds.left + border.l, + y: bounds.top + border.t, + w: width - border.l - border.r, + h: height - border.t - border.b, + radius: { + topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)), + topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)), + bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)), + bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)) + } + } + }; +} +function inRange(bar, x, y, useFinalPosition) { + const skipX = x === null; + const skipY = y === null; + const skipBoth = skipX && skipY; + const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition); + return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom)); +} +function hasRadius(radius) { + return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight; +} + function addNormalRectPath(ctx, rect) { + ctx.rect(rect.x, rect.y, rect.w, rect.h); +} +function inflateRect(rect, amount, refRect = {}) { + const x = rect.x !== refRect.x ? -amount : 0; + const y = rect.y !== refRect.y ? -amount : 0; + const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x; + const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y; + return { + x: rect.x + x, + y: rect.y + y, + w: rect.w + w, + h: rect.h + h, + radius: rect.radius + }; +} +class BarElement extends Element { + static id = 'bar'; + static defaults = { + borderSkipped: 'start', + borderWidth: 0, + borderRadius: 0, + inflateAmount: 'auto', + pointStyle: undefined + }; + static defaultRoutes = { + backgroundColor: 'backgroundColor', + borderColor: 'borderColor' + }; + constructor(cfg){ + super(); + this.options = undefined; + this.horizontal = undefined; + this.base = undefined; + this.width = undefined; + this.height = undefined; + this.inflateAmount = undefined; + if (cfg) { + Object.assign(this, cfg); + } + } + draw(ctx) { + const { inflateAmount , options: { borderColor , backgroundColor } } = this; + const { inner , outer } = boundingRects(this); + const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath; + ctx.save(); + if (outer.w !== inner.w || outer.h !== inner.h) { + ctx.beginPath(); + addRectPath(ctx, inflateRect(outer, inflateAmount, inner)); + ctx.clip(); + addRectPath(ctx, inflateRect(inner, -inflateAmount, outer)); + ctx.fillStyle = borderColor; + ctx.fill('evenodd'); + } + ctx.beginPath(); + addRectPath(ctx, inflateRect(inner, inflateAmount)); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + inRange(mouseX, mouseY, useFinalPosition) { + return inRange(this, mouseX, mouseY, useFinalPosition); + } + inXRange(mouseX, useFinalPosition) { + return inRange(this, mouseX, null, useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange(this, null, mouseY, useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x , y , base , horizontal } = this.getProps([ + 'x', + 'y', + 'base', + 'horizontal' + ], useFinalPosition); + return { + x: horizontal ? (x + base) / 2 : x, + y: horizontal ? y : (y + base) / 2 + }; + } + getRange(axis) { + return axis === 'x' ? this.width / 2 : this.height / 2; + } +} + +var elements = /*#__PURE__*/Object.freeze({ +__proto__: null, +ArcElement: ArcElement, +BarElement: BarElement, +LineElement: LineElement, +PointElement: PointElement +}); + +const BORDER_COLORS = [ + 'rgb(54, 162, 235)', + 'rgb(255, 99, 132)', + 'rgb(255, 159, 64)', + 'rgb(255, 205, 86)', + 'rgb(75, 192, 192)', + 'rgb(153, 102, 255)', + 'rgb(201, 203, 207)' // grey +]; +// Border colors with 50% transparency +const BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)')); +function getBorderColor(i) { + return BORDER_COLORS[i % BORDER_COLORS.length]; +} +function getBackgroundColor(i) { + return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length]; +} +function colorizeDefaultDataset(dataset, i) { + dataset.borderColor = getBorderColor(i); + dataset.backgroundColor = getBackgroundColor(i); + return ++i; +} +function colorizeDoughnutDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++)); + return i; +} +function colorizePolarAreaDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++)); + return i; +} +function getColorizer(chart) { + let i = 0; + return (dataset, datasetIndex)=>{ + const controller = chart.getDatasetMeta(datasetIndex).controller; + if (controller instanceof DoughnutController) { + i = colorizeDoughnutDataset(dataset, i); + } else if (controller instanceof PolarAreaController) { + i = colorizePolarAreaDataset(dataset, i); + } else if (controller) { + i = colorizeDefaultDataset(dataset, i); + } + }; +} +function containsColorsDefinitions(descriptors) { + let k; + for(k in descriptors){ + if (descriptors[k].borderColor || descriptors[k].backgroundColor) { + return true; + } + } + return false; +} +function containsColorsDefinition(descriptor) { + return descriptor && (descriptor.borderColor || descriptor.backgroundColor); +} +function containsDefaultColorsDefenitions() { + return defaults.borderColor !== 'rgba(0,0,0,0.1)' || defaults.backgroundColor !== 'rgba(0,0,0,0.1)'; +} +var plugin_colors = { + id: 'colors', + defaults: { + enabled: true, + forceOverride: false + }, + beforeLayout (chart, _args, options) { + if (!options.enabled) { + return; + } + const { data: { datasets } , options: chartOptions } = chart.config; + const { elements } = chartOptions; + const containsColorDefenition = containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements) || containsDefaultColorsDefenitions(); + if (!options.forceOverride && containsColorDefenition) { + return; + } + const colorizer = getColorizer(chart); + datasets.forEach(colorizer); + } +}; + +function lttbDecimation(data, start, count, availableWidth, options) { + const samples = options.samples || availableWidth; + if (samples >= count) { + return data.slice(start, start + count); + } + const decimated = []; + const bucketWidth = (count - 2) / (samples - 2); + let sampledIndex = 0; + const endIndex = start + count - 1; + let a = start; + let i, maxAreaPoint, maxArea, area, nextA; + decimated[sampledIndex++] = data[a]; + for(i = 0; i < samples - 2; i++){ + let avgX = 0; + let avgY = 0; + let j; + const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start; + const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start; + const avgRangeLength = avgRangeEnd - avgRangeStart; + for(j = avgRangeStart; j < avgRangeEnd; j++){ + avgX += data[j].x; + avgY += data[j].y; + } + avgX /= avgRangeLength; + avgY /= avgRangeLength; + const rangeOffs = Math.floor(i * bucketWidth) + 1 + start; + const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start; + const { x: pointAx , y: pointAy } = data[a]; + maxArea = area = -1; + for(j = rangeOffs; j < rangeTo; j++){ + area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy)); + if (area > maxArea) { + maxArea = area; + maxAreaPoint = data[j]; + nextA = j; + } + } + decimated[sampledIndex++] = maxAreaPoint; + a = nextA; + } + decimated[sampledIndex++] = data[endIndex]; + return decimated; +} +function minMaxDecimation(data, start, count, availableWidth) { + let avgX = 0; + let countX = 0; + let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY; + const decimated = []; + const endIndex = start + count - 1; + const xMin = data[start].x; + const xMax = data[endIndex].x; + const dx = xMax - xMin; + for(i = start; i < start + count; ++i){ + point = data[i]; + x = (point.x - xMin) / dx * availableWidth; + y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + minIndex = i; + } else if (y > maxY) { + maxY = y; + maxIndex = i; + } + avgX = (countX * avgX + point.x) / ++countX; + } else { + const lastIndex = i - 1; + if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) { + const intermediateIndex1 = Math.min(minIndex, maxIndex); + const intermediateIndex2 = Math.max(minIndex, maxIndex); + if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex1], + x: avgX + }); + } + if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex2], + x: avgX + }); + } + } + if (i > 0 && lastIndex !== startIndex) { + decimated.push(data[lastIndex]); + } + decimated.push(point); + prevX = truncX; + countX = 0; + minY = maxY = y; + minIndex = maxIndex = startIndex = i; + } + } + return decimated; +} +function cleanDecimatedDataset(dataset) { + if (dataset._decimated) { + const data = dataset._data; + delete dataset._decimated; + delete dataset._data; + Object.defineProperty(dataset, 'data', { + configurable: true, + enumerable: true, + writable: true, + value: data + }); + } +} +function cleanDecimatedData(chart) { + chart.data.datasets.forEach((dataset)=>{ + cleanDecimatedDataset(dataset); + }); +} +function getStartAndCountOfVisiblePointsSimplified(meta, points) { + const pointCount = points.length; + let start = 0; + let count; + const { iScale } = meta; + const { min , max , minDefined , maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1); + } + if (maxDefined) { + count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start; + } else { + count = pointCount - start; + } + return { + start, + count + }; +} +var plugin_decimation = { + id: 'decimation', + defaults: { + algorithm: 'min-max', + enabled: false + }, + beforeElementsUpdate: (chart, args, options)=>{ + if (!options.enabled) { + cleanDecimatedData(chart); + return; + } + const availableWidth = chart.width; + chart.data.datasets.forEach((dataset, datasetIndex)=>{ + const { _data , indexAxis } = dataset; + const meta = chart.getDatasetMeta(datasetIndex); + const data = _data || dataset.data; + if (resolve([ + indexAxis, + chart.options.indexAxis + ]) === 'y') { + return; + } + if (!meta.controller.supportsDecimation) { + return; + } + const xAxis = chart.scales[meta.xAxisID]; + if (xAxis.type !== 'linear' && xAxis.type !== 'time') { + return; + } + if (chart.options.parsing) { + return; + } + let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data); + const threshold = options.threshold || 4 * availableWidth; + if (count <= threshold) { + cleanDecimatedDataset(dataset); + return; + } + if (isNullOrUndef(_data)) { + dataset._data = data; + delete dataset.data; + Object.defineProperty(dataset, 'data', { + configurable: true, + enumerable: true, + get: function() { + return this._decimated; + }, + set: function(d) { + this._data = d; + } + }); + } + let decimated; + switch(options.algorithm){ + case 'lttb': + decimated = lttbDecimation(data, start, count, availableWidth, options); + break; + case 'min-max': + decimated = minMaxDecimation(data, start, count, availableWidth); + break; + default: + throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`); + } + dataset._decimated = decimated; + }); + }, + destroy (chart) { + cleanDecimatedData(chart); + } +}; + +function _segments(line, target, property) { + const segments = line.segments; + const points = line.points; + const tpoints = target.points; + const parts = []; + for (const segment of segments){ + let { start , end } = segment; + end = _findSegmentEnd(start, end, points); + const bounds = _getBounds(property, points[start], points[end], segment.loop); + if (!target.segments) { + parts.push({ + source: segment, + target: bounds, + start: points[start], + end: points[end] + }); + continue; + } + const targetSegments = _boundSegments(target, bounds); + for (const tgt of targetSegments){ + const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop); + const fillSources = _boundSegment(segment, points, subBounds); + for (const fillSource of fillSources){ + parts.push({ + source: fillSource, + target: tgt, + start: { + [property]: _getEdge(bounds, subBounds, 'start', Math.max) + }, + end: { + [property]: _getEdge(bounds, subBounds, 'end', Math.min) + } + }); + } + } + } + return parts; +} +function _getBounds(property, first, last, loop) { + if (loop) { + return; + } + let start = first[property]; + let end = last[property]; + if (property === 'angle') { + start = _normalizeAngle(start); + end = _normalizeAngle(end); + } + return { + property, + start, + end + }; +} +function _pointsFromSegments(boundary, line) { + const { x =null , y =null } = boundary || {}; + const linePoints = line.points; + const points = []; + line.segments.forEach(({ start , end })=>{ + end = _findSegmentEnd(start, end, linePoints); + const first = linePoints[start]; + const last = linePoints[end]; + if (y !== null) { + points.push({ + x: first.x, + y + }); + points.push({ + x: last.x, + y + }); + } else if (x !== null) { + points.push({ + x, + y: first.y + }); + points.push({ + x, + y: last.y + }); + } + }); + return points; +} +function _findSegmentEnd(start, end, points) { + for(; end > start; end--){ + const point = points[end]; + if (!isNaN(point.x) && !isNaN(point.y)) { + break; + } + } + return end; +} +function _getEdge(a, b, prop, fn) { + if (a && b) { + return fn(a[prop], b[prop]); + } + return a ? a[prop] : b ? b[prop] : 0; +} + +function _createBoundaryLine(boundary, line) { + let points = []; + let _loop = false; + if (isArray(boundary)) { + _loop = true; + points = boundary; + } else { + points = _pointsFromSegments(boundary, line); + } + return points.length ? new LineElement({ + points, + options: { + tension: 0 + }, + _loop, + _fullLoop: _loop + }) : null; +} +function _shouldApplyFill(source) { + return source && source.fill !== false; +} + +function _resolveTarget(sources, index, propagate) { + const source = sources[index]; + let fill = source.fill; + const visited = [ + index + ]; + let target; + if (!propagate) { + return fill; + } + while(fill !== false && visited.indexOf(fill) === -1){ + if (!isNumberFinite(fill)) { + return fill; + } + target = sources[fill]; + if (!target) { + return false; + } + if (target.visible) { + return fill; + } + visited.push(fill); + fill = target.fill; + } + return false; +} + function _decodeFill(line, index, count) { + const fill = parseFillOption(line); + if (isObject(fill)) { + return isNaN(fill.value) ? false : fill; + } + let target = parseFloat(fill); + if (isNumberFinite(target) && Math.floor(target) === target) { + return decodeTargetIndex(fill[0], index, target, count); + } + return [ + 'origin', + 'start', + 'end', + 'stack', + 'shape' + ].indexOf(fill) >= 0 && fill; +} +function decodeTargetIndex(firstCh, index, target, count) { + if (firstCh === '-' || firstCh === '+') { + target = index + target; + } + if (target === index || target < 0 || target >= count) { + return false; + } + return target; +} + function _getTargetPixel(fill, scale) { + let pixel = null; + if (fill === 'start') { + pixel = scale.bottom; + } else if (fill === 'end') { + pixel = scale.top; + } else if (isObject(fill)) { + pixel = scale.getPixelForValue(fill.value); + } else if (scale.getBasePixel) { + pixel = scale.getBasePixel(); + } + return pixel; +} + function _getTargetValue(fill, scale, startValue) { + let value; + if (fill === 'start') { + value = startValue; + } else if (fill === 'end') { + value = scale.options.reverse ? scale.min : scale.max; + } else if (isObject(fill)) { + value = fill.value; + } else { + value = scale.getBaseValue(); + } + return value; +} + function parseFillOption(line) { + const options = line.options; + const fillOption = options.fill; + let fill = valueOrDefault(fillOption && fillOption.target, fillOption); + if (fill === undefined) { + fill = !!options.backgroundColor; + } + if (fill === false || fill === null) { + return false; + } + if (fill === true) { + return 'origin'; + } + return fill; +} + +function _buildStackLine(source) { + const { scale , index , line } = source; + const points = []; + const segments = line.segments; + const sourcePoints = line.points; + const linesBelow = getLinesBelow(scale, index); + linesBelow.push(_createBoundaryLine({ + x: null, + y: scale.bottom + }, line)); + for(let i = 0; i < segments.length; i++){ + const segment = segments[i]; + for(let j = segment.start; j <= segment.end; j++){ + addPointsBelow(points, sourcePoints[j], linesBelow); + } + } + return new LineElement({ + points, + options: {} + }); +} + function getLinesBelow(scale, index) { + const below = []; + const metas = scale.getMatchingVisibleMetas('line'); + for(let i = 0; i < metas.length; i++){ + const meta = metas[i]; + if (meta.index === index) { + break; + } + if (!meta.hidden) { + below.unshift(meta.dataset); + } + } + return below; +} + function addPointsBelow(points, sourcePoint, linesBelow) { + const postponed = []; + for(let j = 0; j < linesBelow.length; j++){ + const line = linesBelow[j]; + const { first , last , point } = findPoint(line, sourcePoint, 'x'); + if (!point || first && last) { + continue; + } + if (first) { + postponed.unshift(point); + } else { + points.push(point); + if (!last) { + break; + } + } + } + points.push(...postponed); +} + function findPoint(line, sourcePoint, property) { + const point = line.interpolate(sourcePoint, property); + if (!point) { + return {}; + } + const pointValue = point[property]; + const segments = line.segments; + const linePoints = line.points; + let first = false; + let last = false; + for(let i = 0; i < segments.length; i++){ + const segment = segments[i]; + const firstValue = linePoints[segment.start][property]; + const lastValue = linePoints[segment.end][property]; + if (_isBetween(pointValue, firstValue, lastValue)) { + first = pointValue === firstValue; + last = pointValue === lastValue; + break; + } + } + return { + first, + last, + point + }; +} + +class simpleArc { + constructor(opts){ + this.x = opts.x; + this.y = opts.y; + this.radius = opts.radius; + } + pathSegment(ctx, bounds, opts) { + const { x , y , radius } = this; + bounds = bounds || { + start: 0, + end: TAU + }; + ctx.arc(x, y, radius, bounds.end, bounds.start, true); + return !opts.bounds; + } + interpolate(point) { + const { x , y , radius } = this; + const angle = point.angle; + return { + x: x + Math.cos(angle) * radius, + y: y + Math.sin(angle) * radius, + angle + }; + } +} + +function _getTarget(source) { + const { chart , fill , line } = source; + if (isNumberFinite(fill)) { + return getLineByIndex(chart, fill); + } + if (fill === 'stack') { + return _buildStackLine(source); + } + if (fill === 'shape') { + return true; + } + const boundary = computeBoundary(source); + if (boundary instanceof simpleArc) { + return boundary; + } + return _createBoundaryLine(boundary, line); +} + function getLineByIndex(chart, index) { + const meta = chart.getDatasetMeta(index); + const visible = meta && chart.isDatasetVisible(index); + return visible ? meta.dataset : null; +} +function computeBoundary(source) { + const scale = source.scale || {}; + if (scale.getPointPositionForValue) { + return computeCircularBoundary(source); + } + return computeLinearBoundary(source); +} +function computeLinearBoundary(source) { + const { scale ={} , fill } = source; + const pixel = _getTargetPixel(fill, scale); + if (isNumberFinite(pixel)) { + const horizontal = scale.isHorizontal(); + return { + x: horizontal ? pixel : null, + y: horizontal ? null : pixel + }; + } + return null; +} +function computeCircularBoundary(source) { + const { scale , fill } = source; + const options = scale.options; + const length = scale.getLabels().length; + const start = options.reverse ? scale.max : scale.min; + const value = _getTargetValue(fill, scale, start); + const target = []; + if (options.grid.circular) { + const center = scale.getPointPositionForValue(0, start); + return new simpleArc({ + x: center.x, + y: center.y, + radius: scale.getDistanceFromCenterForValue(value) + }); + } + for(let i = 0; i < length; ++i){ + target.push(scale.getPointPositionForValue(i, value)); + } + return target; +} + +function _drawfill(ctx, source, area) { + const target = _getTarget(source); + const { line , scale , axis } = source; + const lineOpts = line.options; + const fillOption = lineOpts.fill; + const color = lineOpts.backgroundColor; + const { above =color , below =color } = fillOption || {}; + if (target && line.points.length) { + clipArea(ctx, area); + doFill(ctx, { + line, + target, + above, + below, + area, + scale, + axis + }); + unclipArea(ctx); + } +} +function doFill(ctx, cfg) { + const { line , target , above , below , area , scale } = cfg; + const property = line._loop ? 'angle' : cfg.axis; + ctx.save(); + if (property === 'x' && below !== above) { + clipVertical(ctx, target, area.top); + fill(ctx, { + line, + target, + color: above, + scale, + property + }); + ctx.restore(); + ctx.save(); + clipVertical(ctx, target, area.bottom); + } + fill(ctx, { + line, + target, + color: below, + scale, + property + }); + ctx.restore(); +} +function clipVertical(ctx, target, clipY) { + const { segments , points } = target; + let first = true; + let lineLoop = false; + ctx.beginPath(); + for (const segment of segments){ + const { start , end } = segment; + const firstPoint = points[start]; + const lastPoint = points[_findSegmentEnd(start, end, points)]; + if (first) { + ctx.moveTo(firstPoint.x, firstPoint.y); + first = false; + } else { + ctx.lineTo(firstPoint.x, clipY); + ctx.lineTo(firstPoint.x, firstPoint.y); + } + lineLoop = !!target.pathSegment(ctx, segment, { + move: lineLoop + }); + if (lineLoop) { + ctx.closePath(); + } else { + ctx.lineTo(lastPoint.x, clipY); + } + } + ctx.lineTo(target.first().x, clipY); + ctx.closePath(); + ctx.clip(); +} +function fill(ctx, cfg) { + const { line , target , property , color , scale } = cfg; + const segments = _segments(line, target, property); + for (const { source: src , target: tgt , start , end } of segments){ + const { style: { backgroundColor =color } = {} } = src; + const notShape = target !== true; + ctx.save(); + ctx.fillStyle = backgroundColor; + clipBounds(ctx, scale, notShape && _getBounds(property, start, end)); + ctx.beginPath(); + const lineLoop = !!line.pathSegment(ctx, src); + let loop; + if (notShape) { + if (lineLoop) { + ctx.closePath(); + } else { + interpolatedLineTo(ctx, target, end, property); + } + const targetLoop = !!target.pathSegment(ctx, tgt, { + move: lineLoop, + reverse: true + }); + loop = lineLoop && targetLoop; + if (!loop) { + interpolatedLineTo(ctx, target, start, property); + } + } + ctx.closePath(); + ctx.fill(loop ? 'evenodd' : 'nonzero'); + ctx.restore(); + } +} +function clipBounds(ctx, scale, bounds) { + const { top , bottom } = scale.chart.chartArea; + const { property , start , end } = bounds || {}; + if (property === 'x') { + ctx.beginPath(); + ctx.rect(start, top, end - start, bottom - top); + ctx.clip(); + } +} +function interpolatedLineTo(ctx, target, point, property) { + const interpolatedPoint = target.interpolate(point, property); + if (interpolatedPoint) { + ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y); + } +} + +var index = { + id: 'filler', + afterDatasetsUpdate (chart, _args, options) { + const count = (chart.data.datasets || []).length; + const sources = []; + let meta, i, line, source; + for(i = 0; i < count; ++i){ + meta = chart.getDatasetMeta(i); + line = meta.dataset; + source = null; + if (line && line.options && line instanceof LineElement) { + source = { + visible: chart.isDatasetVisible(i), + index: i, + fill: _decodeFill(line, i, count), + chart, + axis: meta.controller.options.indexAxis, + scale: meta.vScale, + line + }; + } + meta.$filler = source; + sources.push(source); + } + for(i = 0; i < count; ++i){ + source = sources[i]; + if (!source || source.fill === false) { + continue; + } + source.fill = _resolveTarget(sources, i, options.propagate); + } + }, + beforeDraw (chart, _args, options) { + const draw = options.drawTime === 'beforeDraw'; + const metasets = chart.getSortedVisibleDatasetMetas(); + const area = chart.chartArea; + for(let i = metasets.length - 1; i >= 0; --i){ + const source = metasets[i].$filler; + if (!source) { + continue; + } + source.line.updateControlPoints(area, source.axis); + if (draw && source.fill) { + _drawfill(chart.ctx, source, area); + } + } + }, + beforeDatasetsDraw (chart, _args, options) { + if (options.drawTime !== 'beforeDatasetsDraw') { + return; + } + const metasets = chart.getSortedVisibleDatasetMetas(); + for(let i = metasets.length - 1; i >= 0; --i){ + const source = metasets[i].$filler; + if (_shouldApplyFill(source)) { + _drawfill(chart.ctx, source, chart.chartArea); + } + } + }, + beforeDatasetDraw (chart, args, options) { + const source = args.meta.$filler; + if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') { + return; + } + _drawfill(chart.ctx, source, chart.chartArea); + }, + defaults: { + propagate: true, + drawTime: 'beforeDatasetDraw' + } +}; + +const getBoxSize = (labelOpts, fontSize)=>{ + let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts; + if (labelOpts.usePointStyle) { + boxHeight = Math.min(boxHeight, fontSize); + boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize); + } + return { + boxWidth, + boxHeight, + itemHeight: Math.max(fontSize, boxHeight) + }; +}; +const itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index; +class Legend extends Element { + constructor(config){ + super(); + this._added = false; + this.legendHitBoxes = []; + this._hoveredItem = null; + this.doughnutMode = false; + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this.legendItems = undefined; + this.columnSizes = undefined; + this.lineWidths = undefined; + this.maxHeight = undefined; + this.maxWidth = undefined; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.height = undefined; + this.width = undefined; + this._margins = undefined; + this.position = undefined; + this.weight = undefined; + this.fullSize = undefined; + } + update(maxWidth, maxHeight, margins) { + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins; + this.setDimensions(); + this.buildLabels(); + this.fit(); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = this._margins.left; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = this._margins.top; + this.bottom = this.height; + } + } + buildLabels() { + const labelOpts = this.options.labels || {}; + let legendItems = callback(labelOpts.generateLabels, [ + this.chart + ], this) || []; + if (labelOpts.filter) { + legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data)); + } + if (labelOpts.sort) { + legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data)); + } + if (this.options.reverse) { + legendItems.reverse(); + } + this.legendItems = legendItems; + } + fit() { + const { options , ctx } = this; + if (!options.display) { + this.width = this.height = 0; + return; + } + const labelOpts = options.labels; + const labelFont = toFont(labelOpts.font); + const fontSize = labelFont.size; + const titleHeight = this._computeTitleHeight(); + const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize); + let width, height; + ctx.font = labelFont.string; + if (this.isHorizontal()) { + width = this.maxWidth; + height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10; + } else { + height = this.maxHeight; + width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10; + } + this.width = Math.min(width, options.maxWidth || this.maxWidth); + this.height = Math.min(height, options.maxHeight || this.maxHeight); + } + _fitRows(titleHeight, fontSize, boxWidth, itemHeight) { + const { ctx , maxWidth , options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const lineWidths = this.lineWidths = [ + 0 + ]; + const lineHeight = itemHeight + padding; + let totalHeight = titleHeight; + ctx.textAlign = 'left'; + ctx.textBaseline = 'middle'; + let row = -1; + let top = -lineHeight; + this.legendItems.forEach((legendItem, i)=>{ + const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width; + if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) { + totalHeight += lineHeight; + lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0; + top += lineHeight; + row++; + } + hitboxes[i] = { + left: 0, + top, + row, + width: itemWidth, + height: itemHeight + }; + lineWidths[lineWidths.length - 1] += itemWidth + padding; + }); + return totalHeight; + } + _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) { + const { ctx , maxHeight , options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const columnSizes = this.columnSizes = []; + const heightLimit = maxHeight - titleHeight; + let totalWidth = padding; + let currentColWidth = 0; + let currentColHeight = 0; + let left = 0; + let col = 0; + this.legendItems.forEach((legendItem, i)=>{ + const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight); + if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) { + totalWidth += currentColWidth + padding; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + left += currentColWidth + padding; + col++; + currentColWidth = currentColHeight = 0; + } + hitboxes[i] = { + left, + top: currentColHeight, + col, + width: itemWidth, + height: itemHeight + }; + currentColWidth = Math.max(currentColWidth, itemWidth); + currentColHeight += itemHeight + padding; + }); + totalWidth += currentColWidth; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + return totalWidth; + } + adjustHitBoxes() { + if (!this.options.display) { + return; + } + const titleHeight = this._computeTitleHeight(); + const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this; + const rtlHelper = getRtlAdapter(rtl, this.left, this.width); + if (this.isHorizontal()) { + let row = 0; + let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + for (const hitbox of hitboxes){ + if (row !== hitbox.row) { + row = hitbox.row; + left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + } + hitbox.top += this.top + titleHeight + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width); + left += hitbox.width + padding; + } + } else { + let col = 0; + let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + for (const hitbox of hitboxes){ + if (hitbox.col !== col) { + col = hitbox.col; + top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + } + hitbox.top = top; + hitbox.left += this.left + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width); + top += hitbox.height + padding; + } + } + } + isHorizontal() { + return this.options.position === 'top' || this.options.position === 'bottom'; + } + draw() { + if (this.options.display) { + const ctx = this.ctx; + clipArea(ctx, this); + this._draw(); + unclipArea(ctx); + } + } + _draw() { + const { options: opts , columnSizes , lineWidths , ctx } = this; + const { align , labels: labelOpts } = opts; + const defaultColor = defaults.color; + const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width); + const labelFont = toFont(labelOpts.font); + const { padding } = labelOpts; + const fontSize = labelFont.size; + const halfFontSize = fontSize / 2; + let cursor; + this.drawTitle(); + ctx.textAlign = rtlHelper.textAlign('left'); + ctx.textBaseline = 'middle'; + ctx.lineWidth = 0.5; + ctx.font = labelFont.string; + const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize); + const drawLegendBox = function(x, y, legendItem) { + if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) { + return; + } + ctx.save(); + const lineWidth = valueOrDefault(legendItem.lineWidth, 1); + ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor); + ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt'); + ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0); + ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter'); + ctx.lineWidth = lineWidth; + ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor); + ctx.setLineDash(valueOrDefault(legendItem.lineDash, [])); + if (labelOpts.usePointStyle) { + const drawOptions = { + radius: boxHeight * Math.SQRT2 / 2, + pointStyle: legendItem.pointStyle, + rotation: legendItem.rotation, + borderWidth: lineWidth + }; + const centerX = rtlHelper.xPlus(x, boxWidth / 2); + const centerY = y + halfFontSize; + drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth); + } else { + const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0); + const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth); + const borderRadius = toTRBLCorners(legendItem.borderRadius); + ctx.beginPath(); + if (Object.values(borderRadius).some((v)=>v !== 0)) { + addRoundedRectPath(ctx, { + x: xBoxLeft, + y: yBoxTop, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + } else { + ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight); + } + ctx.fill(); + if (lineWidth !== 0) { + ctx.stroke(); + } + } + ctx.restore(); + }; + const fillText = function(x, y, legendItem) { + renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, { + strikethrough: legendItem.hidden, + textAlign: rtlHelper.textAlign(legendItem.textAlign) + }); + }; + const isHorizontal = this.isHorizontal(); + const titleHeight = this._computeTitleHeight(); + if (isHorizontal) { + cursor = { + x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]), + y: this.top + padding + titleHeight, + line: 0 + }; + } else { + cursor = { + x: this.left + padding, + y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height), + line: 0 + }; + } + overrideTextDirection(this.ctx, opts.textDirection); + const lineHeight = itemHeight + padding; + this.legendItems.forEach((legendItem, i)=>{ + ctx.strokeStyle = legendItem.fontColor; + ctx.fillStyle = legendItem.fontColor; + const textWidth = ctx.measureText(legendItem.text).width; + const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign)); + const width = boxWidth + halfFontSize + textWidth; + let x = cursor.x; + let y = cursor.y; + rtlHelper.setWidth(this.width); + if (isHorizontal) { + if (i > 0 && x + width + padding > this.right) { + y = cursor.y += lineHeight; + cursor.line++; + x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]); + } + } else if (i > 0 && y + lineHeight > this.bottom) { + x = cursor.x = x + columnSizes[cursor.line].width + padding; + cursor.line++; + y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height); + } + const realX = rtlHelper.x(x); + drawLegendBox(realX, y, legendItem); + x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl); + fillText(rtlHelper.x(x), y, legendItem); + if (isHorizontal) { + cursor.x += width + padding; + } else if (typeof legendItem.text !== 'string') { + const fontLineHeight = labelFont.lineHeight; + cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding; + } else { + cursor.y += lineHeight; + } + }); + restoreTextDirection(this.ctx, opts.textDirection); + } + drawTitle() { + const opts = this.options; + const titleOpts = opts.title; + const titleFont = toFont(titleOpts.font); + const titlePadding = toPadding(titleOpts.padding); + if (!titleOpts.display) { + return; + } + const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width); + const ctx = this.ctx; + const position = titleOpts.position; + const halfFontSize = titleFont.size / 2; + const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize; + let y; + let left = this.left; + let maxWidth = this.width; + if (this.isHorizontal()) { + maxWidth = Math.max(...this.lineWidths); + y = this.top + topPaddingPlusHalfFontSize; + left = _alignStartEnd(opts.align, left, this.right - maxWidth); + } else { + const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0); + y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight()); + } + const x = _alignStartEnd(position, left, left + maxWidth); + ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position)); + ctx.textBaseline = 'middle'; + ctx.strokeStyle = titleOpts.color; + ctx.fillStyle = titleOpts.color; + ctx.font = titleFont.string; + renderText(ctx, titleOpts.text, x, y, titleFont); + } + _computeTitleHeight() { + const titleOpts = this.options.title; + const titleFont = toFont(titleOpts.font); + const titlePadding = toPadding(titleOpts.padding); + return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0; + } + _getLegendItemAt(x, y) { + let i, hitBox, lh; + if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) { + lh = this.legendHitBoxes; + for(i = 0; i < lh.length; ++i){ + hitBox = lh[i]; + if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) { + return this.legendItems[i]; + } + } + } + return null; + } + handleEvent(e) { + const opts = this.options; + if (!isListened(e.type, opts)) { + return; + } + const hoveredItem = this._getLegendItemAt(e.x, e.y); + if (e.type === 'mousemove' || e.type === 'mouseout') { + const previous = this._hoveredItem; + const sameItem = itemsEqual(previous, hoveredItem); + if (previous && !sameItem) { + callback(opts.onLeave, [ + e, + previous, + this + ], this); + } + this._hoveredItem = hoveredItem; + if (hoveredItem && !sameItem) { + callback(opts.onHover, [ + e, + hoveredItem, + this + ], this); + } + } else if (hoveredItem) { + callback(opts.onClick, [ + e, + hoveredItem, + this + ], this); + } + } +} +function calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) { + const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx); + const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight); + return { + itemWidth, + itemHeight + }; +} +function calculateItemWidth(legendItem, boxWidth, labelFont, ctx) { + let legendItemText = legendItem.text; + if (legendItemText && typeof legendItemText !== 'string') { + legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b); + } + return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width; +} +function calculateItemHeight(_itemHeight, legendItem, fontLineHeight) { + let itemHeight = _itemHeight; + if (typeof legendItem.text !== 'string') { + itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight); + } + return itemHeight; +} +function calculateLegendItemHeight(legendItem, fontLineHeight) { + const labelHeight = legendItem.text ? legendItem.text.length : 0; + return fontLineHeight * labelHeight; +} +function isListened(type, opts) { + if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) { + return true; + } + if (opts.onClick && (type === 'click' || type === 'mouseup')) { + return true; + } + return false; +} +var plugin_legend = { + id: 'legend', + _element: Legend, + start (chart, _args, options) { + const legend = chart.legend = new Legend({ + ctx: chart.ctx, + options, + chart + }); + layouts.configure(chart, legend, options); + layouts.addBox(chart, legend); + }, + stop (chart) { + layouts.removeBox(chart, chart.legend); + delete chart.legend; + }, + beforeUpdate (chart, _args, options) { + const legend = chart.legend; + layouts.configure(chart, legend, options); + legend.options = options; + }, + afterUpdate (chart) { + const legend = chart.legend; + legend.buildLabels(); + legend.adjustHitBoxes(); + }, + afterEvent (chart, args) { + if (!args.replay) { + chart.legend.handleEvent(args.event); + } + }, + defaults: { + display: true, + position: 'top', + align: 'center', + fullSize: true, + reverse: false, + weight: 1000, + onClick (e, legendItem, legend) { + const index = legendItem.datasetIndex; + const ci = legend.chart; + if (ci.isDatasetVisible(index)) { + ci.hide(index); + legendItem.hidden = true; + } else { + ci.show(index); + legendItem.hidden = false; + } + }, + onHover: null, + onLeave: null, + labels: { + color: (ctx)=>ctx.chart.options.color, + boxWidth: 40, + padding: 10, + generateLabels (chart) { + const datasets = chart.data.datasets; + const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options; + return chart._getSortedDatasetMetas().map((meta)=>{ + const style = meta.controller.getStyle(usePointStyle ? 0 : undefined); + const borderWidth = toPadding(style.borderWidth); + return { + text: datasets[meta.index].label, + fillStyle: style.backgroundColor, + fontColor: color, + hidden: !meta.visible, + lineCap: style.borderCapStyle, + lineDash: style.borderDash, + lineDashOffset: style.borderDashOffset, + lineJoin: style.borderJoinStyle, + lineWidth: (borderWidth.width + borderWidth.height) / 4, + strokeStyle: style.borderColor, + pointStyle: pointStyle || style.pointStyle, + rotation: style.rotation, + textAlign: textAlign || style.textAlign, + borderRadius: useBorderRadius && (borderRadius || style.borderRadius), + datasetIndex: meta.index + }; + }, this); + } + }, + title: { + color: (ctx)=>ctx.chart.options.color, + display: false, + position: 'center', + text: '' + } + }, + descriptors: { + _scriptable: (name)=>!name.startsWith('on'), + labels: { + _scriptable: (name)=>![ + 'generateLabels', + 'filter', + 'sort' + ].includes(name) + } + } +}; + +class Title extends Element { + constructor(config){ + super(); + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this._padding = undefined; + this.top = undefined; + this.bottom = undefined; + this.left = undefined; + this.right = undefined; + this.width = undefined; + this.height = undefined; + this.position = undefined; + this.weight = undefined; + this.fullSize = undefined; + } + update(maxWidth, maxHeight) { + const opts = this.options; + this.left = 0; + this.top = 0; + if (!opts.display) { + this.width = this.height = this.right = this.bottom = 0; + return; + } + this.width = this.right = maxWidth; + this.height = this.bottom = maxHeight; + const lineCount = isArray(opts.text) ? opts.text.length : 1; + this._padding = toPadding(opts.padding); + const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height; + if (this.isHorizontal()) { + this.height = textSize; + } else { + this.width = textSize; + } + } + isHorizontal() { + const pos = this.options.position; + return pos === 'top' || pos === 'bottom'; + } + _drawArgs(offset) { + const { top , left , bottom , right , options } = this; + const align = options.align; + let rotation = 0; + let maxWidth, titleX, titleY; + if (this.isHorizontal()) { + titleX = _alignStartEnd(align, left, right); + titleY = top + offset; + maxWidth = right - left; + } else { + if (options.position === 'left') { + titleX = left + offset; + titleY = _alignStartEnd(align, bottom, top); + rotation = PI * -0.5; + } else { + titleX = right - offset; + titleY = _alignStartEnd(align, top, bottom); + rotation = PI * 0.5; + } + maxWidth = bottom - top; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; + } + draw() { + const ctx = this.ctx; + const opts = this.options; + if (!opts.display) { + return; + } + const fontOpts = toFont(opts.font); + const lineHeight = fontOpts.lineHeight; + const offset = lineHeight / 2 + this._padding.top; + const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset); + renderText(ctx, opts.text, 0, 0, fontOpts, { + color: opts.color, + maxWidth, + rotation, + textAlign: _toLeftRightCenter(opts.align), + textBaseline: 'middle', + translation: [ + titleX, + titleY + ] + }); + } +} +function createTitle(chart, titleOpts) { + const title = new Title({ + ctx: chart.ctx, + options: titleOpts, + chart + }); + layouts.configure(chart, title, titleOpts); + layouts.addBox(chart, title); + chart.titleBlock = title; +} +var plugin_title = { + id: 'title', + _element: Title, + start (chart, _args, options) { + createTitle(chart, options); + }, + stop (chart) { + const titleBlock = chart.titleBlock; + layouts.removeBox(chart, titleBlock); + delete chart.titleBlock; + }, + beforeUpdate (chart, _args, options) { + const title = chart.titleBlock; + layouts.configure(chart, title, options); + title.options = options; + }, + defaults: { + align: 'center', + display: false, + font: { + weight: 'bold' + }, + fullSize: true, + padding: 10, + position: 'top', + text: '', + weight: 2000 + }, + defaultRoutes: { + color: 'color' + }, + descriptors: { + _scriptable: true, + _indexable: false + } +}; + +const map = new WeakMap(); +var plugin_subtitle = { + id: 'subtitle', + start (chart, _args, options) { + const title = new Title({ + ctx: chart.ctx, + options, + chart + }); + layouts.configure(chart, title, options); + layouts.addBox(chart, title); + map.set(chart, title); + }, + stop (chart) { + layouts.removeBox(chart, map.get(chart)); + map.delete(chart); + }, + beforeUpdate (chart, _args, options) { + const title = map.get(chart); + layouts.configure(chart, title, options); + title.options = options; + }, + defaults: { + align: 'center', + display: false, + font: { + weight: 'normal' + }, + fullSize: true, + padding: 0, + position: 'top', + text: '', + weight: 1500 + }, + defaultRoutes: { + color: 'color' + }, + descriptors: { + _scriptable: true, + _indexable: false + } +}; + +const positioners = { + average (items) { + if (!items.length) { + return false; + } + let i, len; + let xSet = new Set(); + let y = 0; + let count = 0; + for(i = 0, len = items.length; i < len; ++i){ + const el = items[i].element; + if (el && el.hasValue()) { + const pos = el.tooltipPosition(); + xSet.add(pos.x); + y += pos.y; + ++count; + } + } + if (count === 0 || xSet.size === 0) { + return false; + } + const xAverage = [ + ...xSet + ].reduce((a, b)=>a + b) / xSet.size; + return { + x: xAverage, + y: y / count + }; + }, + nearest (items, eventPosition) { + if (!items.length) { + return false; + } + let x = eventPosition.x; + let y = eventPosition.y; + let minDistance = Number.POSITIVE_INFINITY; + let i, len, nearestElement; + for(i = 0, len = items.length; i < len; ++i){ + const el = items[i].element; + if (el && el.hasValue()) { + const center = el.getCenterPoint(); + const d = distanceBetweenPoints(eventPosition, center); + if (d < minDistance) { + minDistance = d; + nearestElement = el; + } + } + } + if (nearestElement) { + const tp = nearestElement.tooltipPosition(); + x = tp.x; + y = tp.y; + } + return { + x, + y + }; + } +}; +function pushOrConcat(base, toPush) { + if (toPush) { + if (isArray(toPush)) { + Array.prototype.push.apply(base, toPush); + } else { + base.push(toPush); + } + } + return base; +} + function splitNewlines(str) { + if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) { + return str.split('\n'); + } + return str; +} + function createTooltipItem(chart, item) { + const { element , datasetIndex , index } = item; + const controller = chart.getDatasetMeta(datasetIndex).controller; + const { label , value } = controller.getLabelAndValue(index); + return { + chart, + label, + parsed: controller.getParsed(index), + raw: chart.data.datasets[datasetIndex].data[index], + formattedValue: value, + dataset: controller.getDataset(), + dataIndex: index, + datasetIndex, + element + }; +} + function getTooltipSize(tooltip, options) { + const ctx = tooltip.chart.ctx; + const { body , footer , title } = tooltip; + const { boxWidth , boxHeight } = options; + const bodyFont = toFont(options.bodyFont); + const titleFont = toFont(options.titleFont); + const footerFont = toFont(options.footerFont); + const titleLineCount = title.length; + const footerLineCount = footer.length; + const bodyLineItemCount = body.length; + const padding = toPadding(options.padding); + let height = padding.height; + let width = 0; + let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0); + combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length; + if (titleLineCount) { + height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom; + } + if (combinedBodyLength) { + const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight; + height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing; + } + if (footerLineCount) { + height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing; + } + let widthPadding = 0; + const maxLineWidth = function(line) { + width = Math.max(width, ctx.measureText(line).width + widthPadding); + }; + ctx.save(); + ctx.font = titleFont.string; + each(tooltip.title, maxLineWidth); + ctx.font = bodyFont.string; + each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth); + widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0; + each(body, (bodyItem)=>{ + each(bodyItem.before, maxLineWidth); + each(bodyItem.lines, maxLineWidth); + each(bodyItem.after, maxLineWidth); + }); + widthPadding = 0; + ctx.font = footerFont.string; + each(tooltip.footer, maxLineWidth); + ctx.restore(); + width += padding.width; + return { + width, + height + }; +} +function determineYAlign(chart, size) { + const { y , height } = size; + if (y < height / 2) { + return 'top'; + } else if (y > chart.height - height / 2) { + return 'bottom'; + } + return 'center'; +} +function doesNotFitWithAlign(xAlign, chart, options, size) { + const { x , width } = size; + const caret = options.caretSize + options.caretPadding; + if (xAlign === 'left' && x + width + caret > chart.width) { + return true; + } + if (xAlign === 'right' && x - width - caret < 0) { + return true; + } +} +function determineXAlign(chart, options, size, yAlign) { + const { x , width } = size; + const { width: chartWidth , chartArea: { left , right } } = chart; + let xAlign = 'center'; + if (yAlign === 'center') { + xAlign = x <= (left + right) / 2 ? 'left' : 'right'; + } else if (x <= width / 2) { + xAlign = 'left'; + } else if (x >= chartWidth - width / 2) { + xAlign = 'right'; + } + if (doesNotFitWithAlign(xAlign, chart, options, size)) { + xAlign = 'center'; + } + return xAlign; +} + function determineAlignment(chart, options, size) { + const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size); + return { + xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign), + yAlign + }; +} +function alignX(size, xAlign) { + let { x , width } = size; + if (xAlign === 'right') { + x -= width; + } else if (xAlign === 'center') { + x -= width / 2; + } + return x; +} +function alignY(size, yAlign, paddingAndSize) { + let { y , height } = size; + if (yAlign === 'top') { + y += paddingAndSize; + } else if (yAlign === 'bottom') { + y -= height + paddingAndSize; + } else { + y -= height / 2; + } + return y; +} + function getBackgroundPoint(options, size, alignment, chart) { + const { caretSize , caretPadding , cornerRadius } = options; + const { xAlign , yAlign } = alignment; + const paddingAndSize = caretSize + caretPadding; + const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius); + let x = alignX(size, xAlign); + const y = alignY(size, yAlign, paddingAndSize); + if (yAlign === 'center') { + if (xAlign === 'left') { + x += paddingAndSize; + } else if (xAlign === 'right') { + x -= paddingAndSize; + } + } else if (xAlign === 'left') { + x -= Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === 'right') { + x += Math.max(topRight, bottomRight) + caretSize; + } + return { + x: _limitValue(x, 0, chart.width - size.width), + y: _limitValue(y, 0, chart.height - size.height) + }; +} +function getAlignedX(tooltip, align, options) { + const padding = toPadding(options.padding); + return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left; +} + function getBeforeAfterBodyLines(callback) { + return pushOrConcat([], splitNewlines(callback)); +} +function createTooltipContext(parent, tooltip, tooltipItems) { + return createContext(parent, { + tooltip, + tooltipItems, + type: 'tooltip' + }); +} +function overrideCallbacks(callbacks, context) { + const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks; + return override ? callbacks.override(override) : callbacks; +} +const defaultCallbacks = { + beforeTitle: noop, + title (tooltipItems) { + if (tooltipItems.length > 0) { + const item = tooltipItems[0]; + const labels = item.chart.data.labels; + const labelCount = labels ? labels.length : 0; + if (this && this.options && this.options.mode === 'dataset') { + return item.dataset.label || ''; + } else if (item.label) { + return item.label; + } else if (labelCount > 0 && item.dataIndex < labelCount) { + return labels[item.dataIndex]; + } + } + return ''; + }, + afterTitle: noop, + beforeBody: noop, + beforeLabel: noop, + label (tooltipItem) { + if (this && this.options && this.options.mode === 'dataset') { + return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue; + } + let label = tooltipItem.dataset.label || ''; + if (label) { + label += ': '; + } + const value = tooltipItem.formattedValue; + if (!isNullOrUndef(value)) { + label += value; + } + return label; + }, + labelColor (tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + borderColor: options.borderColor, + backgroundColor: options.backgroundColor, + borderWidth: options.borderWidth, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderRadius: 0 + }; + }, + labelTextColor () { + return this.options.bodyColor; + }, + labelPointStyle (tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + pointStyle: options.pointStyle, + rotation: options.rotation + }; + }, + afterLabel: noop, + afterBody: noop, + beforeFooter: noop, + footer: noop, + afterFooter: noop +}; + function invokeCallbackWithFallback(callbacks, name, ctx, arg) { + const result = callbacks[name].call(ctx, arg); + if (typeof result === 'undefined') { + return defaultCallbacks[name].call(ctx, arg); + } + return result; +} +class Tooltip extends Element { + static positioners = positioners; + constructor(config){ + super(); + this.opacity = 0; + this._active = []; + this._eventPosition = undefined; + this._size = undefined; + this._cachedAnimations = undefined; + this._tooltipItems = []; + this.$animations = undefined; + this.$context = undefined; + this.chart = config.chart; + this.options = config.options; + this.dataPoints = undefined; + this.title = undefined; + this.beforeBody = undefined; + this.body = undefined; + this.afterBody = undefined; + this.footer = undefined; + this.xAlign = undefined; + this.yAlign = undefined; + this.x = undefined; + this.y = undefined; + this.height = undefined; + this.width = undefined; + this.caretX = undefined; + this.caretY = undefined; + this.labelColors = undefined; + this.labelPointStyles = undefined; + this.labelTextColors = undefined; + } + initialize(options) { + this.options = options; + this._cachedAnimations = undefined; + this.$context = undefined; + } + _resolveAnimations() { + const cached = this._cachedAnimations; + if (cached) { + return cached; + } + const chart = this.chart; + const options = this.options.setContext(this.getContext()); + const opts = options.enabled && chart.options.animation && options.animations; + const animations = new Animations(this.chart, opts); + if (opts._cacheable) { + this._cachedAnimations = Object.freeze(animations); + } + return animations; + } + getContext() { + return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems)); + } + getTitle(context, options) { + const { callbacks } = options; + const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context); + const title = invokeCallbackWithFallback(callbacks, 'title', this, context); + const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeTitle)); + lines = pushOrConcat(lines, splitNewlines(title)); + lines = pushOrConcat(lines, splitNewlines(afterTitle)); + return lines; + } + getBeforeBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)); + } + getBody(tooltipItems, options) { + const { callbacks } = options; + const bodyItems = []; + each(tooltipItems, (context)=>{ + const bodyItem = { + before: [], + lines: [], + after: [] + }; + const scoped = overrideCallbacks(callbacks, context); + pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context))); + pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context)); + pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context))); + bodyItems.push(bodyItem); + }); + return bodyItems; + } + getAfterBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)); + } + getFooter(tooltipItems, options) { + const { callbacks } = options; + const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems); + const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems); + const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeFooter)); + lines = pushOrConcat(lines, splitNewlines(footer)); + lines = pushOrConcat(lines, splitNewlines(afterFooter)); + return lines; + } + _createItems(options) { + const active = this._active; + const data = this.chart.data; + const labelColors = []; + const labelPointStyles = []; + const labelTextColors = []; + let tooltipItems = []; + let i, len; + for(i = 0, len = active.length; i < len; ++i){ + tooltipItems.push(createTooltipItem(this.chart, active[i])); + } + if (options.filter) { + tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data)); + } + if (options.itemSort) { + tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data)); + } + each(tooltipItems, (context)=>{ + const scoped = overrideCallbacks(options.callbacks, context); + labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context)); + labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context)); + labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context)); + }); + this.labelColors = labelColors; + this.labelPointStyles = labelPointStyles; + this.labelTextColors = labelTextColors; + this.dataPoints = tooltipItems; + return tooltipItems; + } + update(changed, replay) { + const options = this.options.setContext(this.getContext()); + const active = this._active; + let properties; + let tooltipItems = []; + if (!active.length) { + if (this.opacity !== 0) { + properties = { + opacity: 0 + }; + } + } else { + const position = positioners[options.position].call(this, active, this._eventPosition); + tooltipItems = this._createItems(options); + this.title = this.getTitle(tooltipItems, options); + this.beforeBody = this.getBeforeBody(tooltipItems, options); + this.body = this.getBody(tooltipItems, options); + this.afterBody = this.getAfterBody(tooltipItems, options); + this.footer = this.getFooter(tooltipItems, options); + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, size); + const alignment = determineAlignment(this.chart, options, positionAndSize); + const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart); + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + properties = { + opacity: 1, + x: backgroundPoint.x, + y: backgroundPoint.y, + width: size.width, + height: size.height, + caretX: position.x, + caretY: position.y + }; + } + this._tooltipItems = tooltipItems; + this.$context = undefined; + if (properties) { + this._resolveAnimations().update(this, properties); + } + if (changed && options.external) { + options.external.call(this, { + chart: this.chart, + tooltip: this, + replay + }); + } + } + drawCaret(tooltipPoint, ctx, size, options) { + const caretPosition = this.getCaretPosition(tooltipPoint, size, options); + ctx.lineTo(caretPosition.x1, caretPosition.y1); + ctx.lineTo(caretPosition.x2, caretPosition.y2); + ctx.lineTo(caretPosition.x3, caretPosition.y3); + } + getCaretPosition(tooltipPoint, size, options) { + const { xAlign , yAlign } = this; + const { caretSize , cornerRadius } = options; + const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius); + const { x: ptX , y: ptY } = tooltipPoint; + const { width , height } = size; + let x1, x2, x3, y1, y2, y3; + if (yAlign === 'center') { + y2 = ptY + height / 2; + if (xAlign === 'left') { + x1 = ptX; + x2 = x1 - caretSize; + y1 = y2 + caretSize; + y3 = y2 - caretSize; + } else { + x1 = ptX + width; + x2 = x1 + caretSize; + y1 = y2 - caretSize; + y3 = y2 + caretSize; + } + x3 = x1; + } else { + if (xAlign === 'left') { + x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === 'right') { + x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize; + } else { + x2 = this.caretX; + } + if (yAlign === 'top') { + y1 = ptY; + y2 = y1 - caretSize; + x1 = x2 - caretSize; + x3 = x2 + caretSize; + } else { + y1 = ptY + height; + y2 = y1 + caretSize; + x1 = x2 + caretSize; + x3 = x2 - caretSize; + } + y3 = y1; + } + return { + x1, + x2, + x3, + y1, + y2, + y3 + }; + } + drawTitle(pt, ctx, options) { + const title = this.title; + const length = title.length; + let titleFont, titleSpacing, i; + if (length) { + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.titleAlign, options); + ctx.textAlign = rtlHelper.textAlign(options.titleAlign); + ctx.textBaseline = 'middle'; + titleFont = toFont(options.titleFont); + titleSpacing = options.titleSpacing; + ctx.fillStyle = options.titleColor; + ctx.font = titleFont.string; + for(i = 0; i < length; ++i){ + ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2); + pt.y += titleFont.lineHeight + titleSpacing; + if (i + 1 === length) { + pt.y += options.titleMarginBottom - titleSpacing; + } + } + } + } + _drawColorBox(ctx, pt, i, rtlHelper, options) { + const labelColor = this.labelColors[i]; + const labelPointStyle = this.labelPointStyles[i]; + const { boxHeight , boxWidth } = options; + const bodyFont = toFont(options.bodyFont); + const colorX = getAlignedX(this, 'left', options); + const rtlColorX = rtlHelper.x(colorX); + const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0; + const colorY = pt.y + yOffSet; + if (options.usePointStyle) { + const drawOptions = { + radius: Math.min(boxWidth, boxHeight) / 2, + pointStyle: labelPointStyle.pointStyle, + rotation: labelPointStyle.rotation, + borderWidth: 1 + }; + const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2; + const centerY = colorY + boxHeight / 2; + ctx.strokeStyle = options.multiKeyBackground; + ctx.fillStyle = options.multiKeyBackground; + drawPoint(ctx, drawOptions, centerX, centerY); + ctx.strokeStyle = labelColor.borderColor; + ctx.fillStyle = labelColor.backgroundColor; + drawPoint(ctx, drawOptions, centerX, centerY); + } else { + ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1; + ctx.strokeStyle = labelColor.borderColor; + ctx.setLineDash(labelColor.borderDash || []); + ctx.lineDashOffset = labelColor.borderDashOffset || 0; + const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth); + const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2); + const borderRadius = toTRBLCorners(labelColor.borderRadius); + if (Object.values(borderRadius).some((v)=>v !== 0)) { + ctx.beginPath(); + ctx.fillStyle = options.multiKeyBackground; + addRoundedRectPath(ctx, { + x: outerX, + y: colorY, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + ctx.fill(); + ctx.stroke(); + ctx.fillStyle = labelColor.backgroundColor; + ctx.beginPath(); + addRoundedRectPath(ctx, { + x: innerX, + y: colorY + 1, + w: boxWidth - 2, + h: boxHeight - 2, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillStyle = options.multiKeyBackground; + ctx.fillRect(outerX, colorY, boxWidth, boxHeight); + ctx.strokeRect(outerX, colorY, boxWidth, boxHeight); + ctx.fillStyle = labelColor.backgroundColor; + ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2); + } + } + ctx.fillStyle = this.labelTextColors[i]; + } + drawBody(pt, ctx, options) { + const { body } = this; + const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options; + const bodyFont = toFont(options.bodyFont); + let bodyLineHeight = bodyFont.lineHeight; + let xLinePadding = 0; + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + const fillLineOfText = function(line) { + ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2); + pt.y += bodyLineHeight + bodySpacing; + }; + const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign); + let bodyItem, textColor, lines, i, j, ilen, jlen; + ctx.textAlign = bodyAlign; + ctx.textBaseline = 'middle'; + ctx.font = bodyFont.string; + pt.x = getAlignedX(this, bodyAlignForCalculation, options); + ctx.fillStyle = options.bodyColor; + each(this.beforeBody, fillLineOfText); + xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0; + for(i = 0, ilen = body.length; i < ilen; ++i){ + bodyItem = body[i]; + textColor = this.labelTextColors[i]; + ctx.fillStyle = textColor; + each(bodyItem.before, fillLineOfText); + lines = bodyItem.lines; + if (displayColors && lines.length) { + this._drawColorBox(ctx, pt, i, rtlHelper, options); + bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight); + } + for(j = 0, jlen = lines.length; j < jlen; ++j){ + fillLineOfText(lines[j]); + bodyLineHeight = bodyFont.lineHeight; + } + each(bodyItem.after, fillLineOfText); + } + xLinePadding = 0; + bodyLineHeight = bodyFont.lineHeight; + each(this.afterBody, fillLineOfText); + pt.y -= bodySpacing; + } + drawFooter(pt, ctx, options) { + const footer = this.footer; + const length = footer.length; + let footerFont, i; + if (length) { + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.footerAlign, options); + pt.y += options.footerMarginTop; + ctx.textAlign = rtlHelper.textAlign(options.footerAlign); + ctx.textBaseline = 'middle'; + footerFont = toFont(options.footerFont); + ctx.fillStyle = options.footerColor; + ctx.font = footerFont.string; + for(i = 0; i < length; ++i){ + ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2); + pt.y += footerFont.lineHeight + options.footerSpacing; + } + } + } + drawBackground(pt, ctx, tooltipSize, options) { + const { xAlign , yAlign } = this; + const { x , y } = pt; + const { width , height } = tooltipSize; + const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius); + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.beginPath(); + ctx.moveTo(x + topLeft, y); + if (yAlign === 'top') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width - topRight, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + topRight); + if (yAlign === 'center' && xAlign === 'right') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width, y + height - bottomRight); + ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height); + if (yAlign === 'bottom') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + bottomLeft, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft); + if (yAlign === 'center' && xAlign === 'left') { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x, y + topLeft); + ctx.quadraticCurveTo(x, y, x + topLeft, y); + ctx.closePath(); + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } + } + _updateAnimationTarget(options) { + const chart = this.chart; + const anims = this.$animations; + const animX = anims && anims.x; + const animY = anims && anims.y; + if (animX || animY) { + const position = positioners[options.position].call(this, this._active, this._eventPosition); + if (!position) { + return; + } + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, this._size); + const alignment = determineAlignment(chart, options, positionAndSize); + const point = getBackgroundPoint(options, positionAndSize, alignment, chart); + if (animX._to !== point.x || animY._to !== point.y) { + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + this.width = size.width; + this.height = size.height; + this.caretX = position.x; + this.caretY = position.y; + this._resolveAnimations().update(this, point); + } + } + } + _willRender() { + return !!this.opacity; + } + draw(ctx) { + const options = this.options.setContext(this.getContext()); + let opacity = this.opacity; + if (!opacity) { + return; + } + this._updateAnimationTarget(options); + const tooltipSize = { + width: this.width, + height: this.height + }; + const pt = { + x: this.x, + y: this.y + }; + opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity; + const padding = toPadding(options.padding); + const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length; + if (options.enabled && hasTooltipContent) { + ctx.save(); + ctx.globalAlpha = opacity; + this.drawBackground(pt, ctx, tooltipSize, options); + overrideTextDirection(ctx, options.textDirection); + pt.y += padding.top; + this.drawTitle(pt, ctx, options); + this.drawBody(pt, ctx, options); + this.drawFooter(pt, ctx, options); + restoreTextDirection(ctx, options.textDirection); + ctx.restore(); + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements, eventPosition) { + const lastActive = this._active; + const active = activeElements.map(({ datasetIndex , index })=>{ + const meta = this.chart.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error('Cannot find a dataset at index ' + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index], + index + }; + }); + const changed = !_elementsEqual(lastActive, active); + const positionChanged = this._positionChanged(active, eventPosition); + if (changed || positionChanged) { + this._active = active; + this._eventPosition = eventPosition; + this._ignoreReplayEvents = true; + this.update(true); + } + } + handleEvent(e, replay, inChartArea = true) { + if (replay && this._ignoreReplayEvents) { + return false; + } + this._ignoreReplayEvents = false; + const options = this.options; + const lastActive = this._active || []; + const active = this._getActiveElements(e, lastActive, replay, inChartArea); + const positionChanged = this._positionChanged(active, e); + const changed = replay || !_elementsEqual(active, lastActive) || positionChanged; + if (changed) { + this._active = active; + if (options.enabled || options.external) { + this._eventPosition = { + x: e.x, + y: e.y + }; + this.update(true, replay); + } + } + return changed; + } + _getActiveElements(e, lastActive, replay, inChartArea) { + const options = this.options; + if (e.type === 'mouseout') { + return []; + } + if (!inChartArea) { + return lastActive.filter((i)=>this.chart.data.datasets[i.datasetIndex] && this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined); + } + const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay); + if (options.reverse) { + active.reverse(); + } + return active; + } + _positionChanged(active, e) { + const { caretX , caretY , options } = this; + const position = positioners[options.position].call(this, active, e); + return position !== false && (caretX !== position.x || caretY !== position.y); + } +} +var plugin_tooltip = { + id: 'tooltip', + _element: Tooltip, + positioners, + afterInit (chart, _args, options) { + if (options) { + chart.tooltip = new Tooltip({ + chart, + options + }); + } + }, + beforeUpdate (chart, _args, options) { + if (chart.tooltip) { + chart.tooltip.initialize(options); + } + }, + reset (chart, _args, options) { + if (chart.tooltip) { + chart.tooltip.initialize(options); + } + }, + afterDraw (chart) { + const tooltip = chart.tooltip; + if (tooltip && tooltip._willRender()) { + const args = { + tooltip + }; + if (chart.notifyPlugins('beforeTooltipDraw', { + ...args, + cancelable: true + }) === false) { + return; + } + tooltip.draw(chart.ctx); + chart.notifyPlugins('afterTooltipDraw', args); + } + }, + afterEvent (chart, args) { + if (chart.tooltip) { + const useFinalPosition = args.replay; + if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) { + args.changed = true; + } + } + }, + defaults: { + enabled: true, + external: null, + position: 'average', + backgroundColor: 'rgba(0,0,0,0.8)', + titleColor: '#fff', + titleFont: { + weight: 'bold' + }, + titleSpacing: 2, + titleMarginBottom: 6, + titleAlign: 'left', + bodyColor: '#fff', + bodySpacing: 2, + bodyFont: {}, + bodyAlign: 'left', + footerColor: '#fff', + footerSpacing: 2, + footerMarginTop: 6, + footerFont: { + weight: 'bold' + }, + footerAlign: 'left', + padding: 6, + caretPadding: 2, + caretSize: 5, + cornerRadius: 6, + boxHeight: (ctx, opts)=>opts.bodyFont.size, + boxWidth: (ctx, opts)=>opts.bodyFont.size, + multiKeyBackground: '#fff', + displayColors: true, + boxPadding: 0, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 0, + animation: { + duration: 400, + easing: 'easeOutQuart' + }, + animations: { + numbers: { + type: 'number', + properties: [ + 'x', + 'y', + 'width', + 'height', + 'caretX', + 'caretY' + ] + }, + opacity: { + easing: 'linear', + duration: 200 + } + }, + callbacks: defaultCallbacks + }, + defaultRoutes: { + bodyFont: 'font', + footerFont: 'font', + titleFont: 'font' + }, + descriptors: { + _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external', + _indexable: false, + callbacks: { + _scriptable: false, + _indexable: false + }, + animation: { + _fallback: false + }, + animations: { + _fallback: 'animation' + } + }, + additionalOptionScopes: [ + 'interaction' + ] +}; + +var plugins = /*#__PURE__*/Object.freeze({ +__proto__: null, +Colors: plugin_colors, +Decimation: plugin_decimation, +Filler: index, +Legend: plugin_legend, +SubTitle: plugin_subtitle, +Title: plugin_title, +Tooltip: plugin_tooltip +}); + +const addIfString = (labels, raw, index, addedLabels)=>{ + if (typeof raw === 'string') { + index = labels.push(raw) - 1; + addedLabels.unshift({ + index, + label: raw + }); + } else if (isNaN(raw)) { + index = null; + } + return index; +}; +function findOrAddLabel(labels, raw, index, addedLabels) { + const first = labels.indexOf(raw); + if (first === -1) { + return addIfString(labels, raw, index, addedLabels); + } + const last = labels.lastIndexOf(raw); + return first !== last ? index : first; +} +const validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max); +function _getLabelForValue(value) { + const labels = this.getLabels(); + if (value >= 0 && value < labels.length) { + return labels[value]; + } + return value; +} +class CategoryScale extends Scale { + static id = 'category'; + static defaults = { + ticks: { + callback: _getLabelForValue + } + }; + constructor(cfg){ + super(cfg); + this._startValue = undefined; + this._valueRange = 0; + this._addedLabels = []; + } + init(scaleOptions) { + const added = this._addedLabels; + if (added.length) { + const labels = this.getLabels(); + for (const { index , label } of added){ + if (labels[index] === label) { + labels.splice(index, 1); + } + } + this._addedLabels = []; + } + super.init(scaleOptions); + } + parse(raw, index) { + if (isNullOrUndef(raw)) { + return null; + } + const labels = this.getLabels(); + index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels); + return validIndex(index, labels.length - 1); + } + determineDataLimits() { + const { minDefined , maxDefined } = this.getUserBounds(); + let { min , max } = this.getMinMax(true); + if (this.options.bounds === 'ticks') { + if (!minDefined) { + min = 0; + } + if (!maxDefined) { + max = this.getLabels().length - 1; + } + } + this.min = min; + this.max = max; + } + buildTicks() { + const min = this.min; + const max = this.max; + const offset = this.options.offset; + const ticks = []; + let labels = this.getLabels(); + labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1); + this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1); + this._startValue = this.min - (offset ? 0.5 : 0); + for(let value = min; value <= max; value++){ + ticks.push({ + value + }); + } + return ticks; + } + getLabelForValue(value) { + return _getLabelForValue.call(this, value); + } + configure() { + super.configure(); + if (!this.isHorizontal()) { + this._reversePixels = !this._reversePixels; + } + } + getPixelForValue(value) { + if (typeof value !== 'number') { + value = this.parse(value); + } + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getPixelForTick(index) { + const ticks = this.ticks; + if (index < 0 || index > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index].value); + } + getValueForPixel(pixel) { + return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange); + } + getBasePixel() { + return this.bottom; + } +} + +function generateTicks$1(generationOptions, dataRange) { + const ticks = []; + const MIN_SPACING = 1e-14; + const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions; + const unit = step || 1; + const maxSpaces = maxTicks - 1; + const { min: rmin , max: rmax } = dataRange; + const minDefined = !isNullOrUndef(min); + const maxDefined = !isNullOrUndef(max); + const countDefined = !isNullOrUndef(count); + const minSpacing = (rmax - rmin) / (maxDigits + 1); + let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit; + let factor, niceMin, niceMax, numSpaces; + if (spacing < MIN_SPACING && !minDefined && !maxDefined) { + return [ + { + value: rmin + }, + { + value: rmax + } + ]; + } + numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing); + if (numSpaces > maxSpaces) { + spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit; + } + if (!isNullOrUndef(precision)) { + factor = Math.pow(10, precision); + spacing = Math.ceil(spacing * factor) / factor; + } + if (bounds === 'ticks') { + niceMin = Math.floor(rmin / spacing) * spacing; + niceMax = Math.ceil(rmax / spacing) * spacing; + } else { + niceMin = rmin; + niceMax = rmax; + } + if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) { + numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks)); + spacing = (max - min) / numSpaces; + niceMin = min; + niceMax = max; + } else if (countDefined) { + niceMin = minDefined ? min : niceMin; + niceMax = maxDefined ? max : niceMax; + numSpaces = count - 1; + spacing = (niceMax - niceMin) / numSpaces; + } else { + numSpaces = (niceMax - niceMin) / spacing; + if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) { + numSpaces = Math.round(numSpaces); + } else { + numSpaces = Math.ceil(numSpaces); + } + } + const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin)); + factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision); + niceMin = Math.round(niceMin * factor) / factor; + niceMax = Math.round(niceMax * factor) / factor; + let j = 0; + if (minDefined) { + if (includeBounds && niceMin !== min) { + ticks.push({ + value: min + }); + if (niceMin < min) { + j++; + } + if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) { + j++; + } + } else if (niceMin < min) { + j++; + } + } + for(; j < numSpaces; ++j){ + const tickValue = Math.round((niceMin + j * spacing) * factor) / factor; + if (maxDefined && tickValue > max) { + break; + } + ticks.push({ + value: tickValue + }); + } + if (maxDefined && includeBounds && niceMax !== max) { + if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) { + ticks[ticks.length - 1].value = max; + } else { + ticks.push({ + value: max + }); + } + } else if (!maxDefined || niceMax === max) { + ticks.push({ + value: niceMax + }); + } + return ticks; +} +function relativeLabelSize(value, minSpacing, { horizontal , minRotation }) { + const rad = toRadians(minRotation); + const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001; + const length = 0.75 * minSpacing * ('' + value).length; + return Math.min(minSpacing / ratio, length); +} +class LinearScaleBase extends Scale { + constructor(cfg){ + super(cfg); + this.start = undefined; + this.end = undefined; + this._startValue = undefined; + this._endValue = undefined; + this._valueRange = 0; + } + parse(raw, index) { + if (isNullOrUndef(raw)) { + return null; + } + if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) { + return null; + } + return +raw; + } + handleTickRangeOptions() { + const { beginAtZero } = this.options; + const { minDefined , maxDefined } = this.getUserBounds(); + let { min , max } = this; + const setMin = (v)=>min = minDefined ? min : v; + const setMax = (v)=>max = maxDefined ? max : v; + if (beginAtZero) { + const minSign = sign(min); + const maxSign = sign(max); + if (minSign < 0 && maxSign < 0) { + setMax(0); + } else if (minSign > 0 && maxSign > 0) { + setMin(0); + } + } + if (min === max) { + let offset = max === 0 ? 1 : Math.abs(max * 0.05); + setMax(max + offset); + if (!beginAtZero) { + setMin(min - offset); + } + } + this.min = min; + this.max = max; + } + getTickLimit() { + const tickOpts = this.options.ticks; + let { maxTicksLimit , stepSize } = tickOpts; + let maxTicks; + if (stepSize) { + maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1; + if (maxTicks > 1000) { + console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`); + maxTicks = 1000; + } + } else { + maxTicks = this.computeTickLimit(); + maxTicksLimit = maxTicksLimit || 11; + } + if (maxTicksLimit) { + maxTicks = Math.min(maxTicksLimit, maxTicks); + } + return maxTicks; + } + computeTickLimit() { + return Number.POSITIVE_INFINITY; + } + buildTicks() { + const opts = this.options; + const tickOpts = opts.ticks; + let maxTicks = this.getTickLimit(); + maxTicks = Math.max(2, maxTicks); + const numericGeneratorOptions = { + maxTicks, + bounds: opts.bounds, + min: opts.min, + max: opts.max, + precision: tickOpts.precision, + step: tickOpts.stepSize, + count: tickOpts.count, + maxDigits: this._maxDigits(), + horizontal: this.isHorizontal(), + minRotation: tickOpts.minRotation || 0, + includeBounds: tickOpts.includeBounds !== false + }; + const dataRange = this._range || this; + const ticks = generateTicks$1(numericGeneratorOptions, dataRange); + if (opts.bounds === 'ticks') { + _setMinAndMaxByKey(ticks, this, 'value'); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + configure() { + const ticks = this.ticks; + let start = this.min; + let end = this.max; + super.configure(); + if (this.options.offset && ticks.length) { + const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2; + start -= offset; + end += offset; + } + this._startValue = start; + this._endValue = end; + this._valueRange = end - start; + } + getLabelForValue(value) { + return formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } +} + +class LinearScale extends LinearScaleBase { + static id = 'linear'; + static defaults = { + ticks: { + callback: Ticks.formatters.numeric + } + }; + determineDataLimits() { + const { min , max } = this.getMinMax(true); + this.min = isNumberFinite(min) ? min : 0; + this.max = isNumberFinite(max) ? max : 1; + this.handleTickRangeOptions(); + } + computeTickLimit() { + const horizontal = this.isHorizontal(); + const length = horizontal ? this.width : this.height; + const minRotation = toRadians(this.options.ticks.minRotation); + const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001; + const tickFont = this._resolveTickFontOptions(0); + return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio)); + } + getPixelForValue(value) { + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange; + } +} + +const log10Floor = (v)=>Math.floor(log10(v)); +const changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m); +function isMajor(tickVal) { + const remain = tickVal / Math.pow(10, log10Floor(tickVal)); + return remain === 1; +} +function steps(min, max, rangeExp) { + const rangeStep = Math.pow(10, rangeExp); + const start = Math.floor(min / rangeStep); + const end = Math.ceil(max / rangeStep); + return end - start; +} +function startExp(min, max) { + const range = max - min; + let rangeExp = log10Floor(range); + while(steps(min, max, rangeExp) > 10){ + rangeExp++; + } + while(steps(min, max, rangeExp) < 10){ + rangeExp--; + } + return Math.min(rangeExp, log10Floor(min)); +} + function generateTicks(generationOptions, { min , max }) { + min = finiteOrDefault(generationOptions.min, min); + const ticks = []; + const minExp = log10Floor(min); + let exp = startExp(min, max); + let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1; + const stepSize = Math.pow(10, exp); + const base = minExp > exp ? Math.pow(10, minExp) : 0; + const start = Math.round((min - base) * precision) / precision; + const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10; + let significand = Math.floor((start - offset) / Math.pow(10, exp)); + let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision); + while(value < max){ + ticks.push({ + value, + major: isMajor(value), + significand + }); + if (significand >= 10) { + significand = significand < 15 ? 15 : 20; + } else { + significand++; + } + if (significand >= 20) { + exp++; + significand = 2; + precision = exp >= 0 ? 1 : precision; + } + value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision; + } + const lastTick = finiteOrDefault(generationOptions.max, value); + ticks.push({ + value: lastTick, + major: isMajor(lastTick), + significand + }); + return ticks; +} +class LogarithmicScale extends Scale { + static id = 'logarithmic'; + static defaults = { + ticks: { + callback: Ticks.formatters.logarithmic, + major: { + enabled: true + } + } + }; + constructor(cfg){ + super(cfg); + this.start = undefined; + this.end = undefined; + this._startValue = undefined; + this._valueRange = 0; + } + parse(raw, index) { + const value = LinearScaleBase.prototype.parse.apply(this, [ + raw, + index + ]); + if (value === 0) { + this._zero = true; + return undefined; + } + return isNumberFinite(value) && value > 0 ? value : null; + } + determineDataLimits() { + const { min , max } = this.getMinMax(true); + this.min = isNumberFinite(min) ? Math.max(0, min) : null; + this.max = isNumberFinite(max) ? Math.max(0, max) : null; + if (this.options.beginAtZero) { + this._zero = true; + } + if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) { + this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0); + } + this.handleTickRangeOptions(); + } + handleTickRangeOptions() { + const { minDefined , maxDefined } = this.getUserBounds(); + let min = this.min; + let max = this.max; + const setMin = (v)=>min = minDefined ? min : v; + const setMax = (v)=>max = maxDefined ? max : v; + if (min === max) { + if (min <= 0) { + setMin(1); + setMax(10); + } else { + setMin(changeExponent(min, -1)); + setMax(changeExponent(max, +1)); + } + } + if (min <= 0) { + setMin(changeExponent(max, -1)); + } + if (max <= 0) { + setMax(changeExponent(min, +1)); + } + this.min = min; + this.max = max; + } + buildTicks() { + const opts = this.options; + const generationOptions = { + min: this._userMin, + max: this._userMax + }; + const ticks = generateTicks(generationOptions, this); + if (opts.bounds === 'ticks') { + _setMinAndMaxByKey(ticks, this, 'value'); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + getLabelForValue(value) { + return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } + configure() { + const start = this.min; + super.configure(); + this._startValue = log10(start); + this._valueRange = log10(this.max) - log10(start); + } + getPixelForValue(value) { + if (value === undefined || value === 0) { + value = this.min; + } + if (value === null || isNaN(value)) { + return NaN; + } + return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + const decimal = this.getDecimalForPixel(pixel); + return Math.pow(10, this._startValue + decimal * this._valueRange); + } +} + +function getTickBackdropHeight(opts) { + const tickOpts = opts.ticks; + if (tickOpts.display && opts.display) { + const padding = toPadding(tickOpts.backdropPadding); + return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height; + } + return 0; +} +function measureLabelSize(ctx, font, label) { + label = isArray(label) ? label : [ + label + ]; + return { + w: _longestText(ctx, font.string, label), + h: label.length * font.lineHeight + }; +} +function determineLimits(angle, pos, size, min, max) { + if (angle === min || angle === max) { + return { + start: pos - size / 2, + end: pos + size / 2 + }; + } else if (angle < min || angle > max) { + return { + start: pos - size, + end: pos + }; + } + return { + start: pos, + end: pos + size + }; +} + function fitWithPointLabels(scale) { + const orig = { + l: scale.left + scale._padding.left, + r: scale.right - scale._padding.right, + t: scale.top + scale._padding.top, + b: scale.bottom - scale._padding.bottom + }; + const limits = Object.assign({}, orig); + const labelSizes = []; + const padding = []; + const valueCount = scale._pointLabels.length; + const pointLabelOpts = scale.options.pointLabels; + const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0; + for(let i = 0; i < valueCount; i++){ + const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i)); + padding[i] = opts.padding; + const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle); + const plFont = toFont(opts.font); + const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]); + labelSizes[i] = textSize; + const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle); + const angle = Math.round(toDegrees(angleRadians)); + const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180); + const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270); + updateLimits(limits, orig, angleRadians, hLimits, vLimits); + } + scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b); + scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding); +} +function updateLimits(limits, orig, angle, hLimits, vLimits) { + const sin = Math.abs(Math.sin(angle)); + const cos = Math.abs(Math.cos(angle)); + let x = 0; + let y = 0; + if (hLimits.start < orig.l) { + x = (orig.l - hLimits.start) / sin; + limits.l = Math.min(limits.l, orig.l - x); + } else if (hLimits.end > orig.r) { + x = (hLimits.end - orig.r) / sin; + limits.r = Math.max(limits.r, orig.r + x); + } + if (vLimits.start < orig.t) { + y = (orig.t - vLimits.start) / cos; + limits.t = Math.min(limits.t, orig.t - y); + } else if (vLimits.end > orig.b) { + y = (vLimits.end - orig.b) / cos; + limits.b = Math.max(limits.b, orig.b + y); + } +} +function createPointLabelItem(scale, index, itemOpts) { + const outerDistance = scale.drawingArea; + const { extra , additionalAngle , padding , size } = itemOpts; + const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle); + const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI))); + const y = yForAngle(pointLabelPosition.y, size.h, angle); + const textAlign = getTextAlignForAngle(angle); + const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign); + return { + visible: true, + x: pointLabelPosition.x, + y, + textAlign, + left, + top: y, + right: left + size.w, + bottom: y + size.h + }; +} +function isNotOverlapped(item, area) { + if (!area) { + return true; + } + const { left , top , right , bottom } = item; + const apexesInArea = _isPointInArea({ + x: left, + y: top + }, area) || _isPointInArea({ + x: left, + y: bottom + }, area) || _isPointInArea({ + x: right, + y: top + }, area) || _isPointInArea({ + x: right, + y: bottom + }, area); + return !apexesInArea; +} +function buildPointLabelItems(scale, labelSizes, padding) { + const items = []; + const valueCount = scale._pointLabels.length; + const opts = scale.options; + const { centerPointLabels , display } = opts.pointLabels; + const itemOpts = { + extra: getTickBackdropHeight(opts) / 2, + additionalAngle: centerPointLabels ? PI / valueCount : 0 + }; + let area; + for(let i = 0; i < valueCount; i++){ + itemOpts.padding = padding[i]; + itemOpts.size = labelSizes[i]; + const item = createPointLabelItem(scale, i, itemOpts); + items.push(item); + if (display === 'auto') { + item.visible = isNotOverlapped(item, area); + if (item.visible) { + area = item; + } + } + } + return items; +} +function getTextAlignForAngle(angle) { + if (angle === 0 || angle === 180) { + return 'center'; + } else if (angle < 180) { + return 'left'; + } + return 'right'; +} +function leftForTextAlign(x, w, align) { + if (align === 'right') { + x -= w; + } else if (align === 'center') { + x -= w / 2; + } + return x; +} +function yForAngle(y, h, angle) { + if (angle === 90 || angle === 270) { + y -= h / 2; + } else if (angle > 270 || angle < 90) { + y -= h; + } + return y; +} +function drawPointLabelBox(ctx, opts, item) { + const { left , top , right , bottom } = item; + const { backdropColor } = opts; + if (!isNullOrUndef(backdropColor)) { + const borderRadius = toTRBLCorners(opts.borderRadius); + const padding = toPadding(opts.backdropPadding); + ctx.fillStyle = backdropColor; + const backdropLeft = left - padding.left; + const backdropTop = top - padding.top; + const backdropWidth = right - left + padding.width; + const backdropHeight = bottom - top + padding.height; + if (Object.values(borderRadius).some((v)=>v !== 0)) { + ctx.beginPath(); + addRoundedRectPath(ctx, { + x: backdropLeft, + y: backdropTop, + w: backdropWidth, + h: backdropHeight, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight); + } + } +} +function drawPointLabels(scale, labelCount) { + const { ctx , options: { pointLabels } } = scale; + for(let i = labelCount - 1; i >= 0; i--){ + const item = scale._pointLabelItems[i]; + if (!item.visible) { + continue; + } + const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i)); + drawPointLabelBox(ctx, optsAtIndex, item); + const plFont = toFont(optsAtIndex.font); + const { x , y , textAlign } = item; + renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, { + color: optsAtIndex.color, + textAlign: textAlign, + textBaseline: 'middle' + }); + } +} +function pathRadiusLine(scale, radius, circular, labelCount) { + const { ctx } = scale; + if (circular) { + ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU); + } else { + let pointPosition = scale.getPointPosition(0, radius); + ctx.moveTo(pointPosition.x, pointPosition.y); + for(let i = 1; i < labelCount; i++){ + pointPosition = scale.getPointPosition(i, radius); + ctx.lineTo(pointPosition.x, pointPosition.y); + } + } +} +function drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) { + const ctx = scale.ctx; + const circular = gridLineOpts.circular; + const { color , lineWidth } = gridLineOpts; + if (!circular && !labelCount || !color || !lineWidth || radius < 0) { + return; + } + ctx.save(); + ctx.strokeStyle = color; + ctx.lineWidth = lineWidth; + ctx.setLineDash(borderOpts.dash || []); + ctx.lineDashOffset = borderOpts.dashOffset; + ctx.beginPath(); + pathRadiusLine(scale, radius, circular, labelCount); + ctx.closePath(); + ctx.stroke(); + ctx.restore(); +} +function createPointLabelContext(parent, index, label) { + return createContext(parent, { + label, + index, + type: 'pointLabel' + }); +} +class RadialLinearScale extends LinearScaleBase { + static id = 'radialLinear'; + static defaults = { + display: true, + animate: true, + position: 'chartArea', + angleLines: { + display: true, + lineWidth: 1, + borderDash: [], + borderDashOffset: 0.0 + }, + grid: { + circular: false + }, + startAngle: 0, + ticks: { + showLabelBackdrop: true, + callback: Ticks.formatters.numeric + }, + pointLabels: { + backdropColor: undefined, + backdropPadding: 2, + display: true, + font: { + size: 10 + }, + callback (label) { + return label; + }, + padding: 5, + centerPointLabels: false + } + }; + static defaultRoutes = { + 'angleLines.color': 'borderColor', + 'pointLabels.color': 'color', + 'ticks.color': 'color' + }; + static descriptors = { + angleLines: { + _fallback: 'grid' + } + }; + constructor(cfg){ + super(cfg); + this.xCenter = undefined; + this.yCenter = undefined; + this.drawingArea = undefined; + this._pointLabels = []; + this._pointLabelItems = []; + } + setDimensions() { + const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2); + const w = this.width = this.maxWidth - padding.width; + const h = this.height = this.maxHeight - padding.height; + this.xCenter = Math.floor(this.left + w / 2 + padding.left); + this.yCenter = Math.floor(this.top + h / 2 + padding.top); + this.drawingArea = Math.floor(Math.min(w, h) / 2); + } + determineDataLimits() { + const { min , max } = this.getMinMax(false); + this.min = isNumberFinite(min) && !isNaN(min) ? min : 0; + this.max = isNumberFinite(max) && !isNaN(max) ? max : 0; + this.handleTickRangeOptions(); + } + computeTickLimit() { + return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options)); + } + generateTickLabels(ticks) { + LinearScaleBase.prototype.generateTickLabels.call(this, ticks); + this._pointLabels = this.getLabels().map((value, index)=>{ + const label = callback(this.options.pointLabels.callback, [ + value, + index + ], this); + return label || label === 0 ? label : ''; + }).filter((v, i)=>this.chart.getDataVisibility(i)); + } + fit() { + const opts = this.options; + if (opts.display && opts.pointLabels.display) { + fitWithPointLabels(this); + } else { + this.setCenterPoint(0, 0, 0, 0); + } + } + setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) { + this.xCenter += Math.floor((leftMovement - rightMovement) / 2); + this.yCenter += Math.floor((topMovement - bottomMovement) / 2); + this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement)); + } + getIndexAngle(index) { + const angleMultiplier = TAU / (this._pointLabels.length || 1); + const startAngle = this.options.startAngle || 0; + return _normalizeAngle(index * angleMultiplier + toRadians(startAngle)); + } + getDistanceFromCenterForValue(value) { + if (isNullOrUndef(value)) { + return NaN; + } + const scalingFactor = this.drawingArea / (this.max - this.min); + if (this.options.reverse) { + return (this.max - value) * scalingFactor; + } + return (value - this.min) * scalingFactor; + } + getValueForDistanceFromCenter(distance) { + if (isNullOrUndef(distance)) { + return NaN; + } + const scaledDistance = distance / (this.drawingArea / (this.max - this.min)); + return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance; + } + getPointLabelContext(index) { + const pointLabels = this._pointLabels || []; + if (index >= 0 && index < pointLabels.length) { + const pointLabel = pointLabels[index]; + return createPointLabelContext(this.getContext(), index, pointLabel); + } + } + getPointPosition(index, distanceFromCenter, additionalAngle = 0) { + const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle; + return { + x: Math.cos(angle) * distanceFromCenter + this.xCenter, + y: Math.sin(angle) * distanceFromCenter + this.yCenter, + angle + }; + } + getPointPositionForValue(index, value) { + return this.getPointPosition(index, this.getDistanceFromCenterForValue(value)); + } + getBasePosition(index) { + return this.getPointPositionForValue(index || 0, this.getBaseValue()); + } + getPointLabelPosition(index) { + const { left , top , right , bottom } = this._pointLabelItems[index]; + return { + left, + top, + right, + bottom + }; + } + drawBackground() { + const { backgroundColor , grid: { circular } } = this.options; + if (backgroundColor) { + const ctx = this.ctx; + ctx.save(); + ctx.beginPath(); + pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length); + ctx.closePath(); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + } + drawGrid() { + const ctx = this.ctx; + const opts = this.options; + const { angleLines , grid , border } = opts; + const labelCount = this._pointLabels.length; + let i, offset, position; + if (opts.pointLabels.display) { + drawPointLabels(this, labelCount); + } + if (grid.display) { + this.ticks.forEach((tick, index)=>{ + if (index !== 0 || index === 0 && this.min < 0) { + offset = this.getDistanceFromCenterForValue(tick.value); + const context = this.getContext(index); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder); + } + }); + } + if (angleLines.display) { + ctx.save(); + for(i = labelCount - 1; i >= 0; i--){ + const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i)); + const { color , lineWidth } = optsAtIndex; + if (!lineWidth || !color) { + continue; + } + ctx.lineWidth = lineWidth; + ctx.strokeStyle = color; + ctx.setLineDash(optsAtIndex.borderDash); + ctx.lineDashOffset = optsAtIndex.borderDashOffset; + offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max); + position = this.getPointPosition(i, offset); + ctx.beginPath(); + ctx.moveTo(this.xCenter, this.yCenter); + ctx.lineTo(position.x, position.y); + ctx.stroke(); + } + ctx.restore(); + } + } + drawBorder() {} + drawLabels() { + const ctx = this.ctx; + const opts = this.options; + const tickOpts = opts.ticks; + if (!tickOpts.display) { + return; + } + const startAngle = this.getIndexAngle(0); + let offset, width; + ctx.save(); + ctx.translate(this.xCenter, this.yCenter); + ctx.rotate(startAngle); + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + this.ticks.forEach((tick, index)=>{ + if (index === 0 && this.min >= 0 && !opts.reverse) { + return; + } + const optsAtIndex = tickOpts.setContext(this.getContext(index)); + const tickFont = toFont(optsAtIndex.font); + offset = this.getDistanceFromCenterForValue(this.ticks[index].value); + if (optsAtIndex.showLabelBackdrop) { + ctx.font = tickFont.string; + width = ctx.measureText(tick.label).width; + ctx.fillStyle = optsAtIndex.backdropColor; + const padding = toPadding(optsAtIndex.backdropPadding); + ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height); + } + renderText(ctx, tick.label, 0, -offset, tickFont, { + color: optsAtIndex.color, + strokeColor: optsAtIndex.textStrokeColor, + strokeWidth: optsAtIndex.textStrokeWidth + }); + }); + ctx.restore(); + } + drawTitle() {} +} + +const INTERVALS = { + millisecond: { + common: true, + size: 1, + steps: 1000 + }, + second: { + common: true, + size: 1000, + steps: 60 + }, + minute: { + common: true, + size: 60000, + steps: 60 + }, + hour: { + common: true, + size: 3600000, + steps: 24 + }, + day: { + common: true, + size: 86400000, + steps: 30 + }, + week: { + common: false, + size: 604800000, + steps: 4 + }, + month: { + common: true, + size: 2.628e9, + steps: 12 + }, + quarter: { + common: false, + size: 7.884e9, + steps: 4 + }, + year: { + common: true, + size: 3.154e10 + } +}; + const UNITS = /* #__PURE__ */ Object.keys(INTERVALS); + function sorter(a, b) { + return a - b; +} + function parse(scale, input) { + if (isNullOrUndef(input)) { + return null; + } + const adapter = scale._adapter; + const { parser , round , isoWeekday } = scale._parseOpts; + let value = input; + if (typeof parser === 'function') { + value = parser(value); + } + if (!isNumberFinite(value)) { + value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value); + } + if (value === null) { + return null; + } + if (round) { + value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round); + } + return +value; +} + function determineUnitForAutoTicks(minUnit, min, max, capacity) { + const ilen = UNITS.length; + for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){ + const interval = INTERVALS[UNITS[i]]; + const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER; + if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) { + return UNITS[i]; + } + } + return UNITS[ilen - 1]; +} + function determineUnitForFormatting(scale, numTicks, minUnit, min, max) { + for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){ + const unit = UNITS[i]; + if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) { + return unit; + } + } + return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0]; +} + function determineMajorUnit(unit) { + for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){ + if (INTERVALS[UNITS[i]].common) { + return UNITS[i]; + } + } +} + function addTick(ticks, time, timestamps) { + if (!timestamps) { + ticks[time] = true; + } else if (timestamps.length) { + const { lo , hi } = _lookup(timestamps, time); + const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi]; + ticks[timestamp] = true; + } +} + function setMajorTicks(scale, ticks, map, majorUnit) { + const adapter = scale._adapter; + const first = +adapter.startOf(ticks[0].value, majorUnit); + const last = ticks[ticks.length - 1].value; + let major, index; + for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){ + index = map[major]; + if (index >= 0) { + ticks[index].major = true; + } + } + return ticks; +} + function ticksFromTimestamps(scale, values, majorUnit) { + const ticks = []; + const map = {}; + const ilen = values.length; + let i, value; + for(i = 0; i < ilen; ++i){ + value = values[i]; + map[value] = i; + ticks.push({ + value, + major: false + }); + } + return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit); +} +class TimeScale extends Scale { + static id = 'time'; + static defaults = { + bounds: 'data', + adapters: {}, + time: { + parser: false, + unit: false, + round: false, + isoWeekday: false, + minUnit: 'millisecond', + displayFormats: {} + }, + ticks: { + source: 'auto', + callback: false, + major: { + enabled: false + } + } + }; + constructor(props){ + super(props); + this._cache = { + data: [], + labels: [], + all: [] + }; + this._unit = 'day'; + this._majorUnit = undefined; + this._offsets = {}; + this._normalized = false; + this._parseOpts = undefined; + } + init(scaleOpts, opts = {}) { + const time = scaleOpts.time || (scaleOpts.time = {}); + const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date); + adapter.init(opts); + mergeIf(time.displayFormats, adapter.formats()); + this._parseOpts = { + parser: time.parser, + round: time.round, + isoWeekday: time.isoWeekday + }; + super.init(scaleOpts); + this._normalized = opts.normalized; + } + parse(raw, index) { + if (raw === undefined) { + return null; + } + return parse(this, raw); + } + beforeLayout() { + super.beforeLayout(); + this._cache = { + data: [], + labels: [], + all: [] + }; + } + determineDataLimits() { + const options = this.options; + const adapter = this._adapter; + const unit = options.time.unit || 'day'; + let { min , max , minDefined , maxDefined } = this.getUserBounds(); + function _applyBounds(bounds) { + if (!minDefined && !isNaN(bounds.min)) { + min = Math.min(min, bounds.min); + } + if (!maxDefined && !isNaN(bounds.max)) { + max = Math.max(max, bounds.max); + } + } + if (!minDefined || !maxDefined) { + _applyBounds(this._getLabelBounds()); + if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') { + _applyBounds(this.getMinMax(false)); + } + } + min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit); + max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1; + this.min = Math.min(min, max - 1); + this.max = Math.max(min + 1, max); + } + _getLabelBounds() { + const arr = this.getLabelTimestamps(); + let min = Number.POSITIVE_INFINITY; + let max = Number.NEGATIVE_INFINITY; + if (arr.length) { + min = arr[0]; + max = arr[arr.length - 1]; + } + return { + min, + max + }; + } + buildTicks() { + const options = this.options; + const timeOpts = options.time; + const tickOpts = options.ticks; + const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate(); + if (options.bounds === 'ticks' && timestamps.length) { + this.min = this._userMin || timestamps[0]; + this.max = this._userMax || timestamps[timestamps.length - 1]; + } + const min = this.min; + const max = this.max; + const ticks = _filterBetween(timestamps, min, max); + this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max)); + this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit); + this.initOffsets(timestamps); + if (options.reverse) { + ticks.reverse(); + } + return ticksFromTimestamps(this, ticks, this._majorUnit); + } + afterAutoSkip() { + if (this.options.offsetAfterAutoskip) { + this.initOffsets(this.ticks.map((tick)=>+tick.value)); + } + } + initOffsets(timestamps = []) { + let start = 0; + let end = 0; + let first, last; + if (this.options.offset && timestamps.length) { + first = this.getDecimalForValue(timestamps[0]); + if (timestamps.length === 1) { + start = 1 - first; + } else { + start = (this.getDecimalForValue(timestamps[1]) - first) / 2; + } + last = this.getDecimalForValue(timestamps[timestamps.length - 1]); + if (timestamps.length === 1) { + end = last; + } else { + end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2; + } + } + const limit = timestamps.length < 3 ? 0.5 : 0.25; + start = _limitValue(start, 0, limit); + end = _limitValue(end, 0, limit); + this._offsets = { + start, + end, + factor: 1 / (start + 1 + end) + }; + } + _generate() { + const adapter = this._adapter; + const min = this.min; + const max = this.max; + const options = this.options; + const timeOpts = options.time; + const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min)); + const stepSize = valueOrDefault(options.ticks.stepSize, 1); + const weekday = minor === 'week' ? timeOpts.isoWeekday : false; + const hasWeekday = isNumber(weekday) || weekday === true; + const ticks = {}; + let first = min; + let time, count; + if (hasWeekday) { + first = +adapter.startOf(first, 'isoWeek', weekday); + } + first = +adapter.startOf(first, hasWeekday ? 'day' : minor); + if (adapter.diff(max, min, minor) > 100000 * stepSize) { + throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor); + } + const timestamps = options.ticks.source === 'data' && this.getDataTimestamps(); + for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){ + addTick(ticks, time, timestamps); + } + if (time === max || options.bounds === 'ticks' || count === 1) { + addTick(ticks, time, timestamps); + } + return Object.keys(ticks).sort(sorter).map((x)=>+x); + } + getLabelForValue(value) { + const adapter = this._adapter; + const timeOpts = this.options.time; + if (timeOpts.tooltipFormat) { + return adapter.format(value, timeOpts.tooltipFormat); + } + return adapter.format(value, timeOpts.displayFormats.datetime); + } + format(value, format) { + const options = this.options; + const formats = options.time.displayFormats; + const unit = this._unit; + const fmt = format || formats[unit]; + return this._adapter.format(value, fmt); + } + _tickFormatFunction(time, index, ticks, format) { + const options = this.options; + const formatter = options.ticks.callback; + if (formatter) { + return callback(formatter, [ + time, + index, + ticks + ], this); + } + const formats = options.time.displayFormats; + const unit = this._unit; + const majorUnit = this._majorUnit; + const minorFormat = unit && formats[unit]; + const majorFormat = majorUnit && formats[majorUnit]; + const tick = ticks[index]; + const major = majorUnit && majorFormat && tick && tick.major; + return this._adapter.format(time, format || (major ? majorFormat : minorFormat)); + } + generateTickLabels(ticks) { + let i, ilen, tick; + for(i = 0, ilen = ticks.length; i < ilen; ++i){ + tick = ticks[i]; + tick.label = this._tickFormatFunction(tick.value, i, ticks); + } + } + getDecimalForValue(value) { + return value === null ? NaN : (value - this.min) / (this.max - this.min); + } + getPixelForValue(value) { + const offsets = this._offsets; + const pos = this.getDecimalForValue(value); + return this.getPixelForDecimal((offsets.start + pos) * offsets.factor); + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return this.min + pos * (this.max - this.min); + } + _getLabelSize(label) { + const ticksOpts = this.options.ticks; + const tickLabelWidth = this.ctx.measureText(label).width; + const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation); + const cosRotation = Math.cos(angle); + const sinRotation = Math.sin(angle); + const tickFontSize = this._resolveTickFontOptions(0).size; + return { + w: tickLabelWidth * cosRotation + tickFontSize * sinRotation, + h: tickLabelWidth * sinRotation + tickFontSize * cosRotation + }; + } + _getLabelCapacity(exampleTime) { + const timeOpts = this.options.time; + const displayFormats = timeOpts.displayFormats; + const format = displayFormats[timeOpts.unit] || displayFormats.millisecond; + const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [ + exampleTime + ], this._majorUnit), format); + const size = this._getLabelSize(exampleLabel); + const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1; + return capacity > 0 ? capacity : 1; + } + getDataTimestamps() { + let timestamps = this._cache.data || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const metas = this.getMatchingVisibleMetas(); + if (this._normalized && metas.length) { + return this._cache.data = metas[0].controller.getAllParsedValues(this); + } + for(i = 0, ilen = metas.length; i < ilen; ++i){ + timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this)); + } + return this._cache.data = this.normalize(timestamps); + } + getLabelTimestamps() { + const timestamps = this._cache.labels || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const labels = this.getLabels(); + for(i = 0, ilen = labels.length; i < ilen; ++i){ + timestamps.push(parse(this, labels[i])); + } + return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps); + } + normalize(values) { + return _arrayUnique(values.sort(sorter)); + } +} + +function interpolate(table, val, reverse) { + let lo = 0; + let hi = table.length - 1; + let prevSource, nextSource, prevTarget, nextTarget; + if (reverse) { + if (val >= table[lo].pos && val <= table[hi].pos) { + ({ lo , hi } = _lookupByKey(table, 'pos', val)); + } + ({ pos: prevSource , time: prevTarget } = table[lo]); + ({ pos: nextSource , time: nextTarget } = table[hi]); + } else { + if (val >= table[lo].time && val <= table[hi].time) { + ({ lo , hi } = _lookupByKey(table, 'time', val)); + } + ({ time: prevSource , pos: prevTarget } = table[lo]); + ({ time: nextSource , pos: nextTarget } = table[hi]); + } + const span = nextSource - prevSource; + return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget; +} +class TimeSeriesScale extends TimeScale { + static id = 'timeseries'; + static defaults = TimeScale.defaults; + constructor(props){ + super(props); + this._table = []; + this._minPos = undefined; + this._tableRange = undefined; + } + initOffsets() { + const timestamps = this._getTimestampsForTable(); + const table = this._table = this.buildLookupTable(timestamps); + this._minPos = interpolate(table, this.min); + this._tableRange = interpolate(table, this.max) - this._minPos; + super.initOffsets(timestamps); + } + buildLookupTable(timestamps) { + const { min , max } = this; + const items = []; + const table = []; + let i, ilen, prev, curr, next; + for(i = 0, ilen = timestamps.length; i < ilen; ++i){ + curr = timestamps[i]; + if (curr >= min && curr <= max) { + items.push(curr); + } + } + if (items.length < 2) { + return [ + { + time: min, + pos: 0 + }, + { + time: max, + pos: 1 + } + ]; + } + for(i = 0, ilen = items.length; i < ilen; ++i){ + next = items[i + 1]; + prev = items[i - 1]; + curr = items[i]; + if (Math.round((next + prev) / 2) !== curr) { + table.push({ + time: curr, + pos: i / (ilen - 1) + }); + } + } + return table; + } + _generate() { + const min = this.min; + const max = this.max; + let timestamps = super.getDataTimestamps(); + if (!timestamps.includes(min) || !timestamps.length) { + timestamps.splice(0, 0, min); + } + if (!timestamps.includes(max) || timestamps.length === 1) { + timestamps.push(max); + } + return timestamps.sort((a, b)=>a - b); + } + _getTimestampsForTable() { + let timestamps = this._cache.all || []; + if (timestamps.length) { + return timestamps; + } + const data = this.getDataTimestamps(); + const label = this.getLabelTimestamps(); + if (data.length && label.length) { + timestamps = this.normalize(data.concat(label)); + } else { + timestamps = data.length ? data : label; + } + timestamps = this._cache.all = timestamps; + return timestamps; + } + getDecimalForValue(value) { + return (interpolate(this._table, value) - this._minPos) / this._tableRange; + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return interpolate(this._table, decimal * this._tableRange + this._minPos, true); + } +} + +var scales = /*#__PURE__*/Object.freeze({ +__proto__: null, +CategoryScale: CategoryScale, +LinearScale: LinearScale, +LogarithmicScale: LogarithmicScale, +RadialLinearScale: RadialLinearScale, +TimeScale: TimeScale, +TimeSeriesScale: TimeSeriesScale +}); + +const registerables = [ + controllers, + elements, + plugins, + scales +]; + +export { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales }; +//# sourceMappingURL=chart.js.map diff --git a/seller_1/node_modules/chart.js/dist/chart.js.map b/seller_1/node_modules/chart.js/dist/chart.js.map new file mode 100644 index 0000000..a629484 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chart.js","sources":["../src/core/core.animator.js","../src/core/core.animation.js","../src/core/core.animations.js","../src/core/core.datasetController.js","../src/controllers/controller.bar.js","../src/controllers/controller.bubble.js","../src/controllers/controller.doughnut.js","../src/controllers/controller.line.js","../src/controllers/controller.polarArea.js","../src/controllers/controller.pie.js","../src/controllers/controller.radar.js","../src/controllers/controller.scatter.js","../src/core/core.adapters.ts","../src/core/core.interaction.js","../src/core/core.layouts.js","../src/platform/platform.base.js","../src/platform/platform.basic.js","../src/platform/platform.dom.js","../src/platform/index.js","../src/core/core.element.ts","../src/core/core.scale.autoskip.js","../src/core/core.scale.js","../src/core/core.typedRegistry.js","../src/core/core.registry.js","../src/core/core.plugins.js","../src/core/core.config.js","../src/core/core.controller.js","../src/elements/element.arc.ts","../src/elements/element.line.js","../src/elements/element.point.ts","../src/elements/element.bar.js","../src/plugins/plugin.colors.ts","../src/plugins/plugin.decimation.js","../src/plugins/plugin.filler/filler.segment.js","../src/plugins/plugin.filler/filler.helper.js","../src/plugins/plugin.filler/filler.options.js","../src/plugins/plugin.filler/filler.target.stack.js","../src/plugins/plugin.filler/simpleArc.js","../src/plugins/plugin.filler/filler.target.js","../src/plugins/plugin.filler/filler.drawing.js","../src/plugins/plugin.filler/index.js","../src/plugins/plugin.legend.js","../src/plugins/plugin.title.js","../src/plugins/plugin.subtitle.js","../src/plugins/plugin.tooltip.js","../src/scales/scale.category.js","../src/scales/scale.linearbase.js","../src/scales/scale.linear.js","../src/scales/scale.logarithmic.js","../src/scales/scale.radialLinear.js","../src/scales/scale.time.js","../src/scales/scale.timeseries.js","../src/index.ts"],"sourcesContent":["import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n let found = false;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n found = true;\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n\n if (!found && !options.all) {\n return 0;\n }\n\n return value;\n}\n\nfunction convertObjectDataToArray(data, meta) {\n const {iScale, vScale} = meta;\n const iAxisKey = iScale.axis === 'x' ? 'x' : 'y';\n const vAxisKey = vScale.axis === 'x' ? 'x' : 'y';\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n [iAxisKey]: key,\n [vAxisKey]: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n const meta = this._cachedMeta;\n this._data = convertObjectDataToArray(data, meta);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n meta._stacked = isStacked(meta.vScale, meta);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const currentParsed = this._cachedMeta.controller.getParsed(dataIndex);\n const iScaleValue = currentParsed && currentParsed[iScale.axis];\n\n const skipNull = (meta) => {\n const parsed = meta._parsed.find(item => item[iScale.axis] === iScaleValue);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter<T extends AnyObject = AnyObject> {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter<T>, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter<T>): Record<string, string>;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract<T = void>(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override<T extends AnyObject = AnyObject>(\n members: Partial<Omit<DateAdapter<T>, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record<string, string> {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n if (node) {\n node.addEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction removeListener(chart, type, listener) {\n if (chart && chart.canvas) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = canvas && _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element<T = AnyObject, O = AnyObject> {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record<keyof T, Animation>;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;\n getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;\n getProps(props: string[], final?: boolean): Partial<Record<string, unknown>> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record<string, unknown>;\n }\n const ret: Record<string, unknown> = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n case 'inner':\n if (i === ilen - 1) {\n left -= width;\n } else if (i > 0) {\n left -= width / 2;\n }\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n // Unset pending resize request now to avoid possible recursion within _resize\n this._resizeBeforeDraw = null;\n this._resize(width, height);\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the event inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element<ArcProps, ArcOptions> {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle;\n const betweenAngles = _circumference >= TAU || nonZeroBetween;\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial<PointOptions & PointHoverOptions>) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import {DoughnutController, PolarAreaController, defaults} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record<string, ColorsDescriptor>\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nfunction containsDefaultColorsDefenitions() {\n return defaults.borderColor !== 'rgba(0,0,0,0.1)' || defaults.backgroundColor !== 'rgba(0,0,0,0.1)';\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n const containsColorDefenition = (\n containsColorsDefinitions(datasets) ||\n containsColorsDefinition(chartOptions) ||\n (elements && containsColorsDefinitions(elements)) ||\n containsDefaultColorsDefenitions());\n\n if (!options.forceOverride && containsColorDefenition) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let xSet = new Set();\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n xSet.add(pos.x);\n y += pos.y;\n ++count;\n }\n }\n\n // No visible items where found, return false so we don't have to divide by 0 which reduces in NaN\n if (count === 0 || xSet.size === 0) {\n return false;\n }\n\n const xAverage = [...xSet].reduce((a, b) => a + b) / xSet.size;\n\n return {\n x: xAverage,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record<keyof typeof defaultCallbacks, Function>} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n // But make sure that active elements are still valid.\n return lastActive.filter(i =>\n this.chart.data.datasets[i.datasetIndex] &&\n this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined\n );\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash || []);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0 || (index === 0 && this.min < 0)) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if ((index === 0 && this.min >= 0) && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object<Unit, Interval>}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object<number,object>} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n controllers,\n elements,\n plugins,\n scales,\n};\n\nexport const registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n"],"names":["Animator","constructor","_request","_charts","Map","_running","_lastDate","undefined","_notify","chart","anims","date","type","callbacks","listeners","numSteps","duration","forEach","fn","initial","currentStep","Math","min","start","_refresh","requestAnimFrame","call","window","_update","Date","now","remaining","running","items","length","i","draw","item","_active","_total","tick","pop","_getAnims","charts","get","complete","progress","set","listen","event","cb","push","add","has","reduce","acc","cur","max","_duration","stop","cancel","remove","delete","transparent","interpolators","boolean","from","to","factor","color","c0","helpersColor","c1","valid","mix","hexString","number","Animation","cfg","target","prop","currentValue","resolve","_fn","_easing","effects","easing","linear","_start","floor","delay","_loop","loop","_target","_prop","_from","_to","_promises","active","update","elapsed","remain","wait","promises","Promise","res","rej","resolved","method","Animations","config","_chart","_properties","configure","isObject","animationOptions","Object","keys","defaults","animation","animatedProps","getOwnPropertyNames","key","option","isArray","properties","_animateOptions","values","newOptions","options","resolveTargetOptions","animations","_createAnimations","$shared","awaitAll","$animations","then","props","charAt","value","size","assign","animator","anim","all","scaleClip","scale","allowedOverflow","opts","reverse","end","defaultClip","xScale","yScale","x","y","top","right","bottom","left","toClip","t","r","b","l","disabled","getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","ilen","index","applyStack","stack","dsIndex","singleMode","mode","datasetIndex","otherValue","found","isFinite","sign","convertObjectDataToArray","data","meta","iScale","vScale","iAxisKey","axis","vAxisKey","adata","Array","isStacked","stacked","getStackKey","indexScale","valueScale","id","getUserBounds","minDefined","maxDefined","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","getOrCreateStack","stacks","stackKey","indexValue","subStack","getLastIndexInStack","positive","getMatchingVisibleMetas","updateStacks","controller","parsed","_cachedMeta","_stacks","iAxis","vAxis","itemStacks","_top","_bottom","visualValues","_visualValues","getFirstScaleId","scales","filter","shift","createDatasetContext","parent","createContext","dataset","createDataContext","element","dataIndex","raw","clearStacks","_parsed","isDirectUpdateMode","cloneIfNotShared","cached","shared","createStack","canStack","hidden","_stacked","DatasetController","datasetElementType","dataElementType","_ctx","ctx","_cachedDataOpts","getMeta","_type","_parsing","_data","_objectData","_sharedOptions","_drawStart","_drawCount","enableOptionSharing","supportsDecimation","$context","_syncList","initialize","linkScales","addElements","fill","isPluginEnabled","console","warn","updateIndex","getDataset","chooseId","xid","xAxisID","valueOrDefault","yid","yAxisID","rid","rAxisID","indexAxis","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","datasets","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","unlistenArrayEvents","_dataCheck","isExtensible","listenArrayEvents","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","scopes","getOptionScopes","createResolver","getContext","parsing","parse","count","sorted","_sorted","prev","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","resolveObjectKey","getParsed","getDataElement","updateRangeFromParsed","range","parsedValue","NaN","getMinMax","otherScale","otherMin","otherMax","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","clip","elements","area","chartArea","drawActiveElementsOnTop","getStyle","resolveDatasetElementOptions","resolveDataElementOptions","context","_resolveElementOptions","elementType","cache","cacheKey","sharing","defined","datasetElementScopeKeys","prefixes","names","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","_cacheable","getSharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","arg1","arg2","numMeta","numData","_insertElements","_removeElements","move","arr","updateElements","removed","splice","_sync","args","_dataChanges","_onDataPush","arguments","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","getAllScaleValues","_cache","$bar","visibleMetas","concat","_arrayUnique","sort","a","computeMinSampleSize","_length","curr","updateMinAndPrev","abs","getPixelForValue","ticks","getPixelForTick","computeFitCategoryTraits","ruler","stackCount","thickness","barThickness","ratio","isNullOrUndef","categoryPercentage","barPercentage","chunk","pixels","computeFlexCategoryTraits","next","percent","parseFloatBar","entry","startValue","endValue","barStart","barEnd","_custom","parseValue","parseArrayOrPrimitive","isFloatBar","custom","barSign","actualBase","isHorizontal","borderProps","horizontal","base","setBorderSkipped","edge","borderSkipped","enableBorderRadius","parseEdge","swap","startEnd","orig","v1","v2","v","setInflateAmount","inflateAmount","BarController","grouped","numbers","overrides","_index_","offset","grid","_value_","beginAtZero","obj","bars","getBasePixel","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","center","height","width","_getStacks","last","currentParsed","iScaleValue","skipNull","find","val","isNaN","indexOf","_getStackCount","_getStackIndex","name","_startPixel","_endPixel","baseValue","minBarLength","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","Infinity","stackIndex","rects","BubbleController","radius","points","point","iPixel","vPixel","skip","getRatioAndOffset","rotation","circumference","cutout","ratioX","ratioY","offsetX","offsetY","TAU","startAngle","endAngle","startX","cos","startY","sin","endX","endY","calcMax","angle","_angleBetween","calcMin","maxX","maxY","HALF_PI","minX","PI","minY","DoughnutController","animateRotate","animateScale","spacing","descriptors","_scriptable","_indexable","startsWith","aspectRatio","plugins","legend","generateLabels","pointStyle","map","style","text","fillStyle","backgroundColor","strokeStyle","borderColor","fontColor","lineWidth","borderWidth","onClick","e","legendItem","toggleDataVisibility","innerRadius","outerRadius","getter","_getRotation","toRadians","_getCircumference","_getRotationExtents","isDatasetVisible","arcs","getMaxBorderWidth","getMaxOffset","maxSize","toPercentage","chartWeight","_getRingWeight","maxWidth","maxHeight","maxRadius","toDimension","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","calculateCircumference","animationOpts","centerX","centerY","arc","metaData","formatNumber","locale","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","weight","LineController","showLine","spanGaps","line","_dataset","animationsDisabled","_getStartAndCountOfVisiblePoints","_scaleRangesChanged","_datasetIndex","_decimated","segment","animated","maxGapLength","isNumber","directUpdate","pointsCount","prevParsed","nullData","border","firstPoint","lastPoint","updateControlPoints","PolarAreaController","angleLines","display","circular","pointLabels","_parseObjectDataRadialScale","bind","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","PieController","RadarController","_fullLoop","pointPosition","getPointPositionForValue","ScatterController","interaction","registry","getElement","abstract","Error","DateAdapterBase","override","members","prototype","init","formats","format","diff","startOf","endOf","_date","binarySearch","metaset","intersect","lookupMethod","_reversePixels","_rlookupByKey","_lookupByKey","el","getRange","lo","hi","evaluateInteractionItems","position","handler","getSortedVisibleDatasetMetas","j","getDistanceMetricForAxis","useX","useY","pt1","pt2","deltaX","deltaY","sqrt","pow","getIntersectItems","useFinalPosition","includeInvisible","isPointInArea","evaluationFunc","_isPointInArea","inRange","getNearestRadialItems","getProps","getAngleFromPoint","getNearestCartesianItems","distanceMetric","minDistance","getCenterPoint","pointInArea","distance","getNearestItems","getAxisItems","rangeMethod","intersectsItem","modes","getRelativePosition","nearest","STATIC_POSITIONS","filterByPosition","array","pos","filterDynamicPositionByAxis","box","sortByWeight","v0","wrapBoxes","boxes","layoutBoxes","stackWeight","buildStacks","layouts","wrap","includes","_stack","placed","setLayoutDims","params","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","availableWidth","availableHeight","buildLayoutBoxes","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","getCombinedMax","maxPadding","updateMaxPadding","boxPadding","updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","w","heightChanged","h","same","other","handleMaxPadding","updatePos","change","getMargins","marginForPositions","positions","margin","fitBoxes","refitBoxes","refit","changed","setBoxDims","placeBoxes","userPadding","padding","addBox","_layers","z","removeBox","layoutItem","minPadding","toPadding","verticalBoxes","horizontalBoxes","each","beforeLayout","visibleVerticalBoxCount","BasePlatform","acquireContext","canvas","releaseContext","addEventListener","listener","removeEventListener","getDevicePixelRatio","getMaximumSize","isAttached","updateConfig","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","isNullOrEmpty","initCanvas","renderHeight","getAttribute","renderWidth","boxSizing","displayWidth","readUsedSize","displayHeight","eventListenerOptions","supportsEventListenerOptions","passive","addListener","node","removeListener","fromNativeEvent","native","nodeListContains","nodeList","contains","createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","document","childList","subtree","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","devicePixelRatio","resize","currentDevicePixelRatio","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","container","_getParentNode","throttled","clientWidth","ResizeObserver","contentRect","releaseObserver","disconnect","createProxyAndListen","proxy","DomPlatform","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","isConnected","_detectPlatform","_isDomSupported","OffscreenCanvas","Element","defaultRoutes","tooltipPosition","hasValue","final","ret","autoSkip","tickOpts","determinedMaxTicks","determineMaxTicks","ticksLimit","maxTicksLimit","majorIndices","major","enabled","getMajorIndices","numMajorIndices","first","newTicks","skipMajors","calculateSpacing","avgMajorSpacing","round","tickLength","_tickSize","maxScale","maxChart","_maxLength","evenMajorSpacing","getEvenSpacing","factors","_factorize","result","ceil","majorStart","majorEnd","len","reverseAlign","align","offsetFromEdge","getTicksLimit","ticksLength","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","epsilon","lineValue","garbageCollect","caches","gc","gcLen","getTickMarkLength","drawTicks","getTitleHeight","fallback","font","toFont","lines","lineHeight","createScaleContext","createTickContext","titleAlign","_toLeftRightCenter","titleArgs","titleX","titleY","_alignStartEnd","positionAxisID","Scale","_margins","paddingTop","paddingBottom","paddingLeft","paddingRight","labelRotation","_range","_gridLineItems","_labelItems","_labelSizes","_longestTextCache","_userMax","_userMin","_suggestedMax","_suggestedMin","_ticksLength","_borderValue","_dataLimitsCached","setContext","suggestedMin","suggestedMax","finiteOrDefault","metas","getTicks","xLabels","yLabels","getLabelItems","_computeLabelItems","beforeUpdate","margins","grace","sampleSize","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","_addGrace","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","source","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","callback","afterTickToLabelConversion","numTicks","minRotation","maxRotation","tickWidth","maxLabelDiagonal","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","_limitValue","title","toDegrees","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","mirror","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","widths","heights","widestLabelSize","highestLabelSize","jlen","tickFont","fontString","nestedLabel","_resolveTickFontOptions","string","_measureText","valueAt","idx","pixel","decimal","_int16Range","_alignPixel","getDecimalForPixel","getBaseValue","optionTicks","rot","autoSkipPadding","_computeGridLineItems","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","limit","step","optsAtIndex","optsAtIndexBorder","lineColor","borderDash","dash","borderDashOffset","dashOffset","tickColor","tickBorderDash","tickBorderDashOffset","crossAlign","tickAndPadding","hTickAndPadding","textAlign","lineCount","textOffset","textBaseline","_getXAxisLabelAlignment","_getYAxisLabelAlignment","labelOffset","halfCount","strokeColor","textStrokeColor","strokeWidth","textStrokeWidth","tickTextAlign","showLabelBackdrop","backdrop","labelPadding","backdropPadding","backdropColor","translation","_computeLabelArea","drawBackground","save","fillRect","restore","findIndex","drawGrid","drawLine","p1","p2","setLineDash","lineDashOffset","beginPath","moveTo","lineTo","stroke","drawOnChartArea","drawBorder","lastLineWidth","drawLabels","clipArea","renderTextOptions","renderText","unclipArea","drawTitle","tz","gz","bz","axisID","_maxDigits","fontSize","TypedRegistry","scope","create","isForType","isPrototypeOf","register","proto","getPrototypeOf","parentScope","isIChartComponent","registerDefaults","unregister","itemDefaults","merge","routeDefaults","describe","routes","property","propertyParts","split","sourceName","sourceScope","join","parts","targetName","targetScope","route","Registry","controllers","_typedRegistries","_each","addControllers","addPlugins","addScales","getController","_get","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","arg","reg","_getRegistryForType","_exec","itemReg","component","camelMethod","_capitalize","PluginService","_init","notify","hook","_createDescriptors","_descriptors","descriptor","plugin","callCallback","cancelable","invalidate","_oldCache","_notifyStateChanges","allPlugins","createDescriptors","previousDescriptors","some","localIds","local","getOpts","pluginOpts","pluginScopeKeys","scriptable","indexable","allKeys","getIndexAxis","datasetDefaults","datasetOptions","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","scaleOptions","toLowerCase","getAxisFromDataset","retrieveAxisFromDatasets","boundDs","d","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","error","_proxy","defaultId","defaultScaleOptions","mergeIf","defaultID","initOptions","initData","initConfig","keyCache","keysCached","Set","cachedKeys","generate","addIfFound","Config","_config","_scopeCache","_resolverCache","platform","clearCache","clear","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","resolver","subPrefixes","getResolver","needContext","isFunction","subResolver","_attachContext","descriptorDefaults","resolverCache","_createResolver","p","hasFunction","isScriptable","isIndexable","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onComplete","onAnimationProgress","onProgress","getCanvas","getElementById","instances","getChart","c","moveNumericKeys","intKey","determineLastEvent","lastEvent","inChartArea","isClick","getSizeForArea","field","getDatasetArea","Chart","version","invalidatePlugins","userConfig","initialCanvas","existingChart","uid","_options","_aspectRatio","_metasets","_lastEvent","_listeners","_responsiveListeners","_sortedMetasets","_plugins","_hiddenIndices","attached","_doResize","debounce","resizeDelay","_initialize","maintainAspectRatio","responsive","retinaScale","bindEvents","clearCanvas","_resize","_resizeBeforeDraw","newSize","newRatio","onResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_destroyDatasetMeta","slice","_removeUnreferencedMetasets","buildOrUpdateControllers","newControllers","order","visible","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_minPadding","autoPadding","_updateLayout","_updateDatasets","_eventHandler","_updateHoverStyles","existingEvents","newEvents","events","setsEqual","unbindEvents","changes","_getUniformDataChanges","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","getElementsAtEventForMode","Interaction","setDatasetVisibility","_updateVisibility","hide","show","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","_remove","detached","updateHoverStyle","prefix","getActiveElements","setActiveElements","activeElements","lastActive","_elementsEqual","pluginId","replay","hoverOptions","hover","deactivated","activated","eventFilter","_handleEvent","_getActiveElements","_isClickEvent","onHover","clipArc","pixelMargin","angleMargin","closePath","toRadiusCorners","_readValueToProps","parseBorderRadius","angleDelta","o","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStart","outerEnd","innerStart","innerEnd","rThetaToXY","theta","pathArc","innerR","spacingOffset","alpha","noSpacingInnerRadius","noSpacingOuterRadius","avNogSpacingRadius","adjustedAngle","beta","angleOffset","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","drawArc","fullCircles","borderJoinStyle","inner","lineJoin","ArcElement","chartX","chartY","rAdjust","nonZeroBetween","betweenAngles","withinRadius","_isBetween","halfAngle","halfRadius","translate","fix","radiusOffset","setStyle","lineCap","borderCapStyle","previous","getLineMethod","stepped","_steppedLineTo","tension","cubicInterpolationMode","_bezierCurveTo","pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","outside","pathSegment","lineMethod","fastPathSegment","avgX","countX","prevX","lastY","pointIndex","drawX","truncX","_getSegmentMethod","useFastPath","_getInterpolationMethod","_steppedInterpolation","_bezierInterpolation","_pointInLine","strokePathWithCache","path","_path","Path2D","strokePathDirect","segments","segmentMethod","usePath2D","LineElement","capBezierPoints","_points","_segments","_pointsUpdated","_updateBezierControlPoints","_computeSegments","interpolate","_boundSegments","_interpolate","interpolated","hitRadius","PointElement","hoverRadius","mouseX","mouseY","inXRange","inYRange","drawPoint","getBarBounds","bar","half","skipOrLimit","parseBorderWidth","maxW","maxH","toTRBL","toTRBLCorners","maxR","enableBorder","topLeft","topRight","bottomLeft","bottomRight","boundingRects","bounds","outer","skipX","skipY","skipBoth","hasRadius","addNormalRectPath","rect","inflateRect","amount","refRect","BarElement","addRectPath","addRoundedRectPath","BORDER_COLORS","BACKGROUND_COLORS","replace","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","k","containsColorsDefinition","containsDefaultColorsDefenitions","forceOverride","_args","chartOptions","containsColorDefenition","colorizer","lttbDecimation","samples","decimated","bucketWidth","sampledIndex","endIndex","maxAreaPoint","maxArea","nextA","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","minMaxDecimation","minIndex","maxIndex","startIndex","xMin","xMax","dx","lastIndex","intermediateIndex1","intermediateIndex2","cleanDecimatedDataset","defineProperty","configurable","enumerable","writable","cleanDecimatedData","getStartAndCountOfVisiblePointsSimplified","pointCount","algorithm","beforeElementsUpdate","xAxis","threshold","tpoints","_findSegmentEnd","_getBounds","targetSegments","tgt","subBounds","fillSources","_boundSegment","fillSource","_getEdge","_normalizeAngle","_pointsFromSegments","boundary","linePoints","_createBoundaryLine","_shouldApplyFill","_resolveTarget","sources","propagate","visited","_decodeFill","parseFillOption","parseFloat","decodeTargetIndex","firstCh","_getTargetPixel","_getTargetValue","fillOption","_buildStackLine","sourcePoints","linesBelow","getLinesBelow","addPointsBelow","below","unshift","sourcePoint","postponed","findPoint","pointValue","firstValue","lastValue","simpleArc","_getTarget","getLineByIndex","computeBoundary","computeCircularBoundary","computeLinearBoundary","_drawfill","lineOpts","above","doFill","clipVertical","clipY","lineLoop","src","notShape","clipBounds","interpolatedLineTo","targetLoop","interpolatedPoint","afterDatasetsUpdate","$filler","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","itemsEqual","Legend","_added","legendHitBoxes","_hoveredItem","doughnutMode","legendItems","columnSizes","lineWidths","buildLabels","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","totalHeight","row","itemWidth","measureText","_itemHeight","heightLimit","totalWidth","currentColWidth","currentColHeight","col","calculateItemSize","adjustHitBoxes","rtl","rtlHelper","getRtlAdapter","hitbox","leftForLtr","_draw","defaultColor","halfFontSize","cursor","drawLegendBox","lineDash","drawOptions","SQRT2","xPlus","drawPointLegend","yBoxTop","xBoxLeft","fillText","strikethrough","overrideTextDirection","textDirection","textWidth","setWidth","realX","_textX","fontLineHeight","calculateLegendItemHeight","restoreTextDirection","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","isListened","hoveredItem","sameItem","onLeave","calculateItemWidth","calculateItemHeight","legendItemText","_element","afterEvent","ci","useBorderRadius","Title","_padding","textSize","_drawArgs","fontOpts","createTitle","titleBlock","WeakMap","positioners","average","xSet","xAverage","eventPosition","nearestElement","distanceBetweenPoints","tp","pushOrConcat","toPush","apply","splitNewlines","str","String","createTooltipItem","formattedValue","getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","determineYAlign","doesNotFitWithAlign","xAlign","caret","caretSize","caretPadding","determineXAlign","yAlign","chartWidth","determineAlignment","alignX","alignY","paddingAndSize","getBackgroundPoint","alignment","cornerRadius","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","tooltipItems","overrideCallbacks","defaultCallbacks","beforeTitle","noop","labelCount","afterTitle","beforeLabel","tooltipItem","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","invokeCallbackWithFallback","Tooltip","opacity","_eventPosition","_size","_cachedAnimations","_tooltipItems","dataPoints","caretX","caretY","labelColors","labelPointStyles","labelTextColors","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","itemSort","positionAndSize","backgroundPoint","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","pt","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","afterInit","afterDraw","_fallback","addIfString","addedLabels","findOrAddLabel","lastIndexOf","_getLabelForValue","CategoryScale","_startValue","_valueRange","_addedLabels","added","generateTicks","generationOptions","dataRange","MIN_SPACING","precision","maxTicks","maxDigits","includeBounds","unit","maxSpaces","rmin","rmax","countDefined","minSpacing","niceNum","niceMin","niceMax","numSpaces","almostWhole","almostEquals","decimalPlaces","_decimalPlaces","relativeLabelSize","tickValue","rad","LinearScaleBase","_endValue","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","stepSize","computeTickLimit","numericGeneratorOptions","_setMinAndMaxByKey","LinearScale","Ticks","formatters","numeric","log10Floor","log10","changeExponent","m","isMajor","tickVal","steps","rangeExp","rangeStep","startExp","minExp","exp","significand","lastTick","LogarithmicScale","logarithmic","_zero","getTickBackdropHeight","measureLabelSize","_longestText","determineLimits","fitWithPointLabels","limits","valueCount","_pointLabels","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","getPointPosition","drawingArea","plFont","hLimits","vLimits","updateLimits","setCenterPoint","_pointLabelItems","buildPointLabelItems","createPointLabelItem","itemOpts","outerDistance","extra","pointLabelPosition","yForAngle","getTextAlignForAngle","leftForTextAlign","isNotOverlapped","apexesInArea","drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","drawPointLabels","pathRadiusLine","drawRadiusLine","gridLineOpts","createPointLabelContext","RadialLinearScale","animate","leftMovement","rightMovement","topMovement","bottomMovement","angleMultiplier","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","distanceFromCenter","getBasePosition","getPointLabelPosition","rotate","INTERVALS","millisecond","common","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","input","adapter","_adapter","parser","isoWeekday","_parseOpts","determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","determineUnitForFormatting","determineMajorUnit","addTick","time","timestamps","_lookup","timestamp","setMajorTicks","majorUnit","ticksFromTimestamps","TimeScale","adapters","displayFormats","_unit","_majorUnit","_offsets","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_filterBetween","_getLabelCapacity","initOffsets","offsetAfterAutoskip","getDecimalForValue","minor","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","formatter","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","normalize","table","prevSource","nextSource","prevTarget","nextTarget","span","TimeSeriesScale","_table","_minPos","_tableRange","_getTimestampsForTable","buildLookupTable","registerables"],"mappings":";;;;;;;;;AAWO,MAAMA,QAAAA,CAAAA;IACXC,WAAc,EAAA;QACZ,IAAI,CAACC,QAAQ,GAAG,IAAI,CAAA;QACpB,IAAI,CAACC,OAAO,GAAG,IAAIC,GAAAA,EAAAA,CAAAA;QACnB,IAAI,CAACC,QAAQ,GAAG,KAAK,CAAA;QACrB,IAAI,CAACC,SAAS,GAAGC,SAAAA,CAAAA;AACnB,KAAA;AAKAC,CAAAA,OAAAA,CAAQC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAE;AAChC,QAAA,MAAMC,SAAYH,GAAAA,KAAAA,CAAMI,SAAS,CAACF,IAAK,CAAA,CAAA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AAA,WAAAA;AACAp0B,IAAAA,QAAAA;AACAkN,IAAAA,OAAAA;AACAxU,IAAAA,MAAAA;;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/chart.umd.js b/seller_1/node_modules/chart.js/dist/chart.umd.js new file mode 100644 index 0000000..d9fd6ec --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.umd.js @@ -0,0 +1,14 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";var t=Object.freeze({__proto__:null,get Colors(){return Go},get Decimation(){return Qo},get Filler(){return ma},get Legend(){return ya},get SubTitle(){return ka},get Title(){return Ma},get Tooltip(){return Ba}});function e(){}const i=(()=>{let t=0;return()=>t++})();function s(t){return null==t}function n(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function o(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function r(t,e){return a(t)?t:e}function l(t,e){return void 0===t?e:t}const h=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,c=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function d(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function u(t,e,i,s){let a,r,l;if(n(t))if(r=t.length,s)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(o(t))for(l=Object.keys(t),r=l.length,a=0;a<r;a++)e.call(i,t[l[a]],l[a])}function f(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function g(t){if(n(t))return t.map(g);if(o(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=g(t[i[n]]);return e}return t}function p(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function m(t,e,i,s){if(!p(t))return;const n=e[t],a=i[t];o(n)&&o(a)?b(n,a,s):e[t]=g(a)}function b(t,e,i){const s=n(e)?e:[e],a=s.length;if(!o(t))return t;const r=(i=i||{}).merger||m;let l;for(let e=0;e<a;++e){if(l=s[e],!o(l))continue;const n=Object.keys(l);for(let e=0,s=n.length;e<s;++e)r(n[e],t,l,i)}return t}function x(t,e){return b(t,e,{merger:_})}function _(t,e,i){if(!p(t))return;const s=e[t],n=i[t];o(s)&&o(n)?x(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=g(n))}const y={"":t=>t,x:t=>t.x,y:t=>t.y};function v(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function M(t,e){const i=y[e]||(y[e]=function(t){const e=v(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}const k=t=>void 0!==t,S=t=>"function"==typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function D(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const C=Math.PI,O=2*C,A=O+C,T=Number.POSITIVE_INFINITY,L=C/180,E=C/2,R=C/4,I=2*C/3,z=Math.log10,F=Math.sign;function V(t,e,i){return Math.abs(t-e)<i}function B(t){const e=Math.round(t);t=V(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(z(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function W(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function N(t){return!isNaN(parseFloat(t))&&isFinite(t)}function H(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function j(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function $(t){return t*(C/180)}function Y(t){return t*(180/C)}function U(t){if(!a(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function X(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*C&&(o+=O),{angle:o,distance:n}}function q(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function K(t,e){return(t-e+A)%O-C}function G(t){return(t%O+O)%O}function Z(t,e,i,s){const n=G(t),o=G(e),a=G(i),r=G(o-n),l=G(a-n),h=G(n-o),c=G(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function J(t,e,i){return Math.max(e,Math.min(i,t))}function Q(t){return J(t,-32768,32767)}function tt(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function et(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const it=(t,e,i,s)=>et(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),st=(t,e,i)=>et(t,i,(s=>t[s][e]>=i));function nt(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const ot=["push","pop","shift","splice","unshift"];function at(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ot.forEach((e=>{const i="_onData"+w(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function rt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(ot.forEach((e=>{delete t[e]})),delete t._chartjs)}function lt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ht="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ct(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ht.call(window,(()=>{s=!1,t.apply(e,i)})))}}function dt(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const ut=t=>"start"===t?"left":"end"===t?"right":"center",ft=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,gt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function pt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=J(Math.min(it(r,l,h).lo,i?s:it(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?J(Math.max(it(r,a.axis,c,!0).hi+1,i?0:it(e,l,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}function mt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}class bt{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=ht.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var xt=new bt; +/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e);function vt(t){return yt(_t(2.55*t),0,255)}function Mt(t){return yt(_t(255*t),0,255)}function wt(t){return yt(_t(t/2.55)/100,0,1)}function kt(t){return yt(_t(100*t),0,100)}const St={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Pt=[..."0123456789ABCDEF"],Dt=t=>Pt[15&t],Ct=t=>Pt[(240&t)>>4]+Pt[15&t],Ot=t=>(240&t)>>4==(15&t);function At(t){var e=(t=>Ot(t.r)&&Ot(t.g)&&Ot(t.b)&&Ot(t.a))(t)?Dt:Ct;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Tt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Lt(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Et(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Rt(t,e,i){const s=Lt(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function It(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function zt(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(Mt)}function Ft(t,e,i){return zt(Lt,t,e,i)}function Vt(t){return(t%360+360)%360}function Bt(t){const e=Tt.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?vt(+e[5]):Mt(+e[5]));const n=Vt(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return zt(Rt,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return zt(Et,t,e,i)}(n,o,a):Ft(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}const Wt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Ht;function jt(t){Ht||(Ht=function(){const t={},e=Object.keys(Nt),i=Object.keys(Wt);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,Wt[o]);o=parseInt(Nt[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),Ht.transparent=[0,0,0,0]);const e=Ht[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const $t=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Yt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Ut=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xt(t,e,i){if(t){let s=It(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Ft(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function qt(t,e){return t?Object.assign(e||{},t):t}function Kt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Mt(t[3]))):(e=qt(t,{r:0,g:0,b:0,a:1})).a=Mt(e.a),e}function Gt(t){return"r"===t.charAt(0)?function(t){const e=$t.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?vt(t):yt(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?vt(i):yt(i,0,255)),s=255&(e[4]?vt(s):yt(s,0,255)),n=255&(e[6]?vt(n):yt(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):Bt(t)}class Zt{constructor(t){if(t instanceof Zt)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=Kt(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*St[s[1]],g:255&17*St[s[2]],b:255&17*St[s[3]],a:5===o?17*St[s[4]]:255}:7!==o&&9!==o||(n={r:St[s[1]]<<4|St[s[2]],g:St[s[3]]<<4|St[s[4]],b:St[s[5]]<<4|St[s[6]],a:9===o?St[s[7]]<<4|St[s[8]]:255})),i=n||jt(t)||Gt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qt(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=Kt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?At(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=It(t),i=e[0],s=kt(e[1]),n=kt(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${wt(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=Ut(wt(t.r)),n=Ut(wt(t.g)),o=Ut(wt(t.b));return{r:Mt(Yt(s+i*(Ut(wt(e.r))-s))),g:Mt(Yt(n+i*(Ut(wt(e.g))-n))),b:Mt(Yt(o+i*(Ut(wt(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Zt(this.rgb)}alpha(t){return this._rgb.a=Mt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=_t(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Xt(this._rgb,2,t),this}darken(t){return Xt(this._rgb,2,-t),this}saturate(t){return Xt(this._rgb,1,t),this}desaturate(t){return Xt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=It(t);i[0]=Vt(i[0]+e),i=Ft(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Jt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Qt(t){return Jt(t)?t:new Zt(t)}function te(t){return Jt(t)?t:new Zt(t).saturate(.5).darken(.1).hexString()}const ee=["x","y","borderWidth","radius","tension"],ie=["color","borderColor","backgroundColor"];const se=new Map;function ne(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=se.get(i);return s||(s=new Intl.NumberFormat(t,e),se.set(i,s)),s}(e,i).format(t)}const oe={values:t=>n(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=z(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ne(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(z(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?oe.numeric.call(this,t,e,i):""}};var ae={formatters:oe};const re=Object.create(null),le=Object.create(null);function he(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function ce(t,e,i){return"string"==typeof e?b(he(t,e),i):b(he(t,""),e)}class de{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>te(e.backgroundColor),this.hoverBorderColor=(t,e)=>te(e.borderColor),this.hoverColor=(t,e)=>te(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ce(this,t,e)}get(t){return he(this,t)}describe(t,e){return ce(le,t,e)}override(t,e){return ce(re,t,e)}route(t,e,i,s){const n=he(this,t),a=he(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=a[s];return o(t)?Object.assign({},e,t):l(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}var ue=new de({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:ie},numbers:{type:"number",properties:ee}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ae.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function fe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ge(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function pe(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const me=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function be(t,e){return me(t).getPropertyValue(e)}const xe=["top","right","bottom","left"];function _e(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=xe[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const ye=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ve(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=me(i),o="border-box"===n.boxSizing,a=_e(n,"padding"),r=_e(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(ye(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const Me=t=>Math.round(10*t)/10;function we(t,e,i,s){const n=me(t),o=_e(n,"margin"),a=pe(n.maxWidth,t,"clientWidth")||T,r=pe(n.maxHeight,t,"clientHeight")||T,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&ge(t);if(o){const t=o.getBoundingClientRect(),a=me(o),r=_e(a,"border","width"),l=_e(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=pe(a.maxWidth,o,"clientWidth"),n=pe(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||T,maxHeight:n||T}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=_e(n,"border","width"),e=_e(n,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=Me(Math.min(h,a,l.maxWidth)),c=Me(Math.min(c,r,l.maxHeight)),h&&!c&&(c=Me(h/2));return(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=Me(Math.floor(c*s))),{width:h,height:c}}function ke(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Se=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};fe()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Pe(t,e){const i=be(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function De(t){return!t||s(t.size)||s(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Ce(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Oe(t,e,i,s){let o=(s=s||{}).data=s.data||{},a=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(o=s.data={},a=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let r=0;const l=i.length;let h,c,d,u,f;for(h=0;h<l;h++)if(u=i[h],null==u||n(u)){if(n(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||n(f)||(r=Ce(t,o,a,r,f))}else r=Ce(t,o,a,r,u);t.restore();const g=a.length/2;if(g>i.length){for(h=0;h<g;h++)delete o[a[h]];a.splice(0,g)}return r}function Ae(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Te(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Le(t,e,i,s){Ee(t,e,i,s,null)}function Ee(t,e,i,s,n){let o,a,r,l,h,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let m=(g||0)*L;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,O):t.arc(i,s,p,0,O),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=I,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=I,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":h=.516*p,l=p-h,a=Math.cos(m+R)*l,d=Math.cos(m+R)*(n?n/2-h:l),r=Math.sin(m+R)*l,u=Math.sin(m+R)*(n?n/2-h:l),t.arc(i-d,s-r,h,m-C,m-E),t.arc(i+u,s-a,h,m-E,m),t.arc(i+d,s+r,h,m,m+E),t.arc(i-u,s+a,h,m+E,m+C),t.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}m+=R;case"rectRot":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=R;case"cross":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=R,d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*p,r=Math.sin(m)*p,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Re(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ie(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ze(t){t.restore()}function Fe(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ve(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Be(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function We(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Ne(t,e,i,o,a,r={}){const l=n(e)?e:[e],h=r.strokeWidth>0&&""!==r.strokeColor;let c,d;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),s(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),c=0;c<l.length;++c)d=l[c],r.backdrop&&We(t,r.backdrop),h&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),s(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(d,i,o,r.maxWidth)),t.fillText(d,i,o,r.maxWidth),Be(t,i,o,d,r),o+=Number(a.lineHeight);t.restore()}function He(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,1.5*C,C,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,C,E,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,E,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-E,!0),t.lineTo(i+a.topLeft,s)}function je(t,e=[""],i,s,n=(()=>t[0])){const o=i||t;void 0===s&&(s=ti("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>je([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>qe(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=ti(Ue(o,t),i),void 0!==n)return Xe(t,n)?Je(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ei(t).includes(e),ownKeys:t=>ei(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function $e(t,e,i,s){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ye(t,s),setContext:e=>$e(t,e,i,s),override:n=>$e(t.override(n),e,i,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>qe(t,e,(()=>function(t,e,i){const{_proxy:s,_context:a,_subProxy:r,_descriptors:l}=t;let h=s[e];S(h)&&l.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||s);r.delete(t),Xe(t,l)&&(l=Je(n._scopes,n,t,l));return l}(e,h,t,i));n(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:n,_context:a,_subProxy:r,_descriptors:l}=i;if(void 0!==a.index&&s(t))return e[a.index%e.length];if(o(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const o of i){const i=Je(s,n,t,o);e.push($e(i,a,r&&r[t],l))}}return e}(e,h,t,l.isIndexable));Xe(e,h)&&(h=$e(h,a,r&&r[e],l));return h}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Ye(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:S(i)?i:()=>i,isIndexable:S(s)?s:()=>s}}const Ue=(t,e)=>t?t+w(e):e,Xe=(t,e)=>o(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function qe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Ke(t,e,i){return S(t)?t(e,i):t}const Ge=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function Ze(t,e,i,s,n){for(const o of e){const e=Ge(i,o);if(e){t.add(e);const o=Ke(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Je(t,e,i,s){const a=e._rootScopes,r=Ke(e._fallback,i,s),l=[...t,...a],h=new Set;h.add(s);let c=Qe(h,l,i,r||i,s);return null!==c&&((void 0===r||r===i||(c=Qe(h,l,r,c,s),null!==c))&&je(Array.from(h),[""],a,r,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const a=s[e];if(n(a)&&o(i))return i;return a||{}}(e,i,s))))}function Qe(t,e,i,s,n){for(;i;)i=Ze(t,e,i,s,n);return i}function ti(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function ei(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function ii(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(M(c,o),h)};return a}const si=Number.EPSILON||1e-14,ni=(t,e)=>e<t.length&&!t[e].skip&&t[e],oi=t=>"x"===t?"y":"x";function ai(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=q(o,n),l=q(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function ri(t,e="x"){const i=oi(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=ni(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=ni(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?F(n[a-1])!==F(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=ni(t,0);for(let c=0;c<s-1;++c)l=h,h=ni(t,c+1),l&&h&&(V(e[c],0,si)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=oi(i),n=t.length;let o,a,r,l=ni(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=ni(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}function li(t,e,i){return Math.max(Math.min(t,i),e)}function hi(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)ri(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=ai(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=Re(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&Re(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=li(n.cp1x,e.left,e.right),n.cp1y=li(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=li(n.cp2x,e.left,e.right),n.cp2y=li(n.cp2y,e.top,e.bottom)))}(t,i)}const ci=t=>0===t||1===t,di=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/i),ui=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/i)+1,fi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*E),easeOutSine:t=>Math.sin(t*E),easeInOutSine:t=>-.5*(Math.cos(C*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ci(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ci(t)?t:di(t,.075,.3),easeOutElastic:t=>ci(t)?t:ui(t,.075,.3),easeInOutElastic(t){const e=.1125;return ci(t)?t:t<.5?.5*di(2*t,e,.45):.5+.5*ui(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-fi.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*fi.easeInBounce(2*t):.5*fi.easeOutBounce(2*t-1)+.5};function gi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function mi(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=gi(t,n,i),r=gi(n,o,i),l=gi(o,e,i),h=gi(a,r,i),c=gi(r,l,i);return gi(h,c,i)}const bi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _i(t,e){const i=(""+t).match(bi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const yi=t=>+t||0;function vi(t,e){const i={},s=o(e),n=s?Object.keys(e):e,a=o(t)?s?i=>l(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=yi(a(t));return i}function Mi(t){return vi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function wi(t){return vi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ki(t){const e=Mi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(t,e){t=t||{},e=e||ue.font;let i=l(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=l(t.style,e.style);s&&!(""+s).match(xi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:l(t.family,e.family),lineHeight:_i(l(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:l(t.weight,e.weight),string:""};return n.string=De(n),n}function Pi(t,e,i,s){let o,a,r,l=!0;for(o=0,a=t.length;o<a;++o)if(r=t[o],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),l=!1),void 0!==i&&n(r)&&(r=r[i%r.length],l=!1),void 0!==r))return s&&!l&&(s.cacheable=!1),r}function Di(t,e,i){const{min:s,max:n}=t,o=c(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ci(t,e){return Object.assign(Object.create(t),e)}function Oi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ai(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ti(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Li(t){return"angle"===t?{between:Z,compare:K,normalize:G}:{between:tt,compare:(t,e)=>t-e,normalize:t=>t}}function Ei({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Ri(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Li(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Li(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,m,b,x=!1,_=null;const y=()=>x||l(n,b,p)&&0!==r(n,b),v=()=>!x||0===r(o,p)||l(o,b,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==b&&(x=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(Ei({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,b=p));return null!==_&&g.push(Ei({start:_,end:d,loop:u,count:a,style:f})),g}function Ii(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=Ri(s[n],t.points,e);o.length&&i.push(...o)}return i}function zi(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return Fi(t,[{start:a,end:r,loop:o}],i,e);return Fi(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function Fi(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=Vi(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Vi(s.setContext(Ci(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Bi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function Vi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Bi(t,e){if(!e)return!1;const i=[],s=function(t,e){return Jt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}var Wi=Object.freeze({__proto__:null,HALF_PI:E,INFINITY:T,PI:C,PITAU:A,QUARTER_PI:R,RAD_PER_DEG:L,TAU:O,TWO_THIRDS_PI:I,_addGrace:Di,_alignPixel:Ae,_alignStartEnd:ft,_angleBetween:Z,_angleDiff:K,_arrayUnique:lt,_attachContext:$e,_bezierCurveTo:Ve,_bezierInterpolation:mi,_boundSegment:Ri,_boundSegments:Ii,_capitalize:w,_computeSegments:zi,_createResolver:je,_decimalPlaces:U,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},_descriptors:Ye,_elementsEqual:f,_factorize:W,_filterBetween:nt,_getParentNode:ge,_getStartAndCountOfVisiblePoints:pt,_int16Range:Q,_isBetween:tt,_isClickEvent:D,_isDomSupported:fe,_isPointInArea:Re,_limitValue:J,_longestText:Oe,_lookup:et,_lookupByKey:it,_measureText:Ce,_merger:m,_mergerIf:_,_normalizeAngle:G,_parseObjectDataRadialScale:ii,_pointInLine:gi,_readValueToProps:vi,_rlookupByKey:st,_scaleRangesChanged:mt,_setMinAndMaxByKey:j,_splitKey:v,_steppedInterpolation:pi,_steppedLineTo:Fe,_textX:gt,_toLeftRightCenter:ut,_updateBezierControlPoints:hi,addRoundedRectPath:He,almostEquals:V,almostWhole:H,callback:d,clearCanvas:Te,clipArea:Ie,clone:g,color:Qt,createContext:Ci,debounce:dt,defined:k,distanceBetweenPoints:q,drawPoint:Le,drawPointLegend:Ee,each:u,easingEffects:fi,finiteOrDefault:r,fontString:function(t,e,i){return e+" "+t+"px "+i},formatNumber:ne,getAngleFromPoint:X,getHoverColor:te,getMaximumSize:we,getRelativePosition:ve,getRtlAdapter:Oi,getStyle:be,isArray:n,isFinite:a,isFunction:S,isNullOrUndef:s,isNumber:N,isObject:o,isPatternOrGradient:Jt,listenArrayEvents:at,log10:z,merge:b,mergeIf:x,niceNum:B,noop:e,overrideTextDirection:Ai,readUsedSize:Pe,renderText:Ne,requestAnimFrame:ht,resolve:Pi,resolveObjectKey:M,restoreTextDirection:Ti,retinaScale:ke,setsEqual:P,sign:F,splineCurve:ai,splineCurveMonotone:ri,supportsEventListenerOptions:Se,throttled:ct,toDegrees:Y,toDimension:c,toFont:Si,toFontString:De,toLineHeight:_i,toPadding:ki,toPercentage:h,toRadians:$,toTRBL:Mi,toTRBLCorners:wi,uid:i,unclipArea:ze,unlistenArrayEvents:rt,valueOrDefault:l});function Ni(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?st:it;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Hi(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=Ni(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function ji(t,e,i,s,n){const o=[];if(!n&&!t.isPointInArea(e))return o;return Hi(t,i,e,(function(i,a,r){(n||Re(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:a,index:r})}),!0),o}function $i(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return Hi(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})})),a}function Yi(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?$i(t,e,i,s,n,o):function(t,e,i,s){let n=[];return Hi(t,i,e,(function(t,i,o){const{startAngle:a,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=X(t,{x:e.x,y:e.y});Z(l,a,r)&&n.push({element:t,datasetIndex:i,index:o})})),n}(t,e,i,n):[]}function Ui(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return Hi(t,i,e,((t,s,l)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Xi={evaluateInteractionItems:Hi,modes:{index(t,e,i,s){const n=ve(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?ji(t,n,o,s,a):Yi(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=ve(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?ji(t,n,o,s,a):Yi(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>ji(t,ve(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ve(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return Yi(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Ui(t,ve(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Ui(t,ve(e,t),"y",i.intersect,s)}};const qi=["left","top","right","bottom"];function Ki(t,e){return t.filter((t=>t.pos===e))}function Gi(t,e){return t.filter((t=>-1===qi.indexOf(t.pos)&&t.box.axis===e))}function Zi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ji(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!qi.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}function Qi(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function ts(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function es(t,e,i,s){const{pos:n,box:a}=i,r=t.maxPadding;if(!o(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[n]+=i.size}a.getPadding&&ts(r,a.getPadding());const l=Math.max(0,e.outerWidth-Qi(r,t,"left","right")),h=Math.max(0,e.outerHeight-Qi(r,t,"top","bottom")),c=l!==t.w,d=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:c,other:d}:{same:d,other:c}}function is(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function ss(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,is(r.horizontal,e));const{same:a,other:d}=es(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&ss(n,e,i,s)||c}function ns(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function os(t,e,i,s){const n=i.padding;let{x:o,y:a}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,o=l.size||t.height;k(l.start)&&(a=l.start),t.fullSize?ns(t,n.left,a,i.outerWidth-n.right-n.left,o):ns(t,e.left+l.placed,a,s,o),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*h,a=l.size||t.width;k(l.start)&&(o=l.start),t.fullSize?ns(t,o,n.top,a,i.outerHeight-n.bottom-n.top):ns(t,o,e.top+l.placed,a,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=a}var as={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=ki(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=Zi(e.filter((t=>t.box.fullSize)),!0),s=Zi(Ki(e,"left"),!0),n=Zi(Ki(e,"right")),o=Zi(Ki(e,"top"),!0),a=Zi(Ki(e,"bottom")),r=Gi(e,"x"),l=Gi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Ki(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;u(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),f=Object.assign({},n);ts(f,ki(s));const g=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),p=Ji(l.concat(h),d);ss(r.fullSize,g,d,p),ss(l,g,d,p),ss(h,g,d,p)&&ss(l,g,d,p),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(g),os(r.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,os(r.rightAndBottom,g,d,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},u(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})}))}};class rs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ls extends rs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const hs="$chartjs",cs={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ds=t=>null===t||""===t;const us=!!Se&&{passive:!0};function fs(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,us)}function gs(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ps(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gs(i.addedNodes,s),e=e&&!gs(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function ms(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gs(i.removedNodes,s),e=e&&!gs(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const bs=new Map;let xs=0;function _s(){const t=window.devicePixelRatio;t!==xs&&(xs=t,bs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function ys(t,e,i){const s=t.canvas,n=s&&ge(s);if(!n)return;const o=ct(((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()}),window),a=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){bs.size||window.addEventListener("resize",_s),bs.set(t,e)}(t,o),a}function vs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){bs.delete(t),bs.size||window.removeEventListener("resize",_s)}(t)}function Ms(t,e,i){const s=t.canvas,n=ct((e=>{null!==t.ctx&&i(function(t,e){const i=cs[t.type]||t.type,{x:s,y:n}=ve(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,us)}(s,e,n),n}class ws extends rs{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[hs]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ds(n)){const e=Pe(t,"width");void 0!==e&&(t.width=e)}if(ds(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Pe(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[hs])return!1;const i=e[hs].initial;["height","width"].forEach((t=>{const n=i[t];s(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[hs],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ps,detach:ms,resize:ys}[e]||Ms;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:vs,detach:vs,resize:vs}[e]||fs)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return we(t,e,i,s)}isAttached(t){const e=t&&ge(t);return!(!e||!e.isConnected)}}function ks(t){return!fe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ls:ws}var Ss=Object.freeze({__proto__:null,BasePlatform:rs,BasicPlatform:ls,DomPlatform:ws,_detectPlatform:ks});const Ps="transparent",Ds={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Qt(t||Ps),n=s.valid&&Qt(e||Ps);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Cs{constructor(t,e,i,s){const n=e[i];s=Pi([t.to,s,n,t.from]);const o=Pi([t.from,n,s]);this._active=!0,this._fn=t.fn||Ds[t.type||typeof o],this._easing=fi[t.easing]||fi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Pi([t.to,e,s,t.from]),this._from=Pi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Os{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!o(t))return;const e=Object.keys(ue.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const a=t[s];if(!o(a))return;const r={};for(const t of e)r[t]=a[t];(n(a.properties)&&a.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,r)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new Cs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(xt.add(this._chart,i),!0):void 0}}function As(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function Ts(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function Ls(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let r,l,h,c;if(null===e)return;let d=!1;for(r=0,l=n.length;r<l;++r){if(h=+n[r],h===i){if(d=!0,s.all)continue;break}c=t.values[h],a(c)&&(o||0===e||F(e)===F(c))&&(e+=c)}return d||s.all?e:0}function Es(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Rs(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function Is(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function zs(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Rs(n,c,o),u[r]=d,u._top=Is(u,a,!0,s.type),u._bottom=Is(u,a,!1,s.type);(u._visualValues||(u._visualValues={}))[r]=d}}function Fs(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Vs(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const Bs=t=>"reset"===t||"none"===t,Ws=(t,e)=>e?t:Object.assign({},t);class Ns{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Es(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Vs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=l(i.xAxisID,Fs(t,"x")),o=e.yAxisID=l(i.yAxisID,Fs(t,"y")),a=e.rAxisID=l(i.rAxisID,Fs(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),c=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&rt(this._data,this),t._stacked&&Vs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(o(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l<h;++l)c=a[l],r[l]={[n]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){rt(i,this);const t=this._cachedMeta;Vs(t),t._parsed=[]}e&&Object.isExtensible(e)&&at(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=Es(e.vScale,e),e.stack!==i.stack&&(s=!0,Vs(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(zs(this,e._parsed),e._stacked=Es(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:a,_stacked:r}=i,l=a.axis;let h,c,d,u=0===t&&e===s.length||i._sorted,f=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,d=s;else{d=n(s[t])?this.parseArrayData(i,s,t,e):o(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const a=()=>null===c[l]||f&&c[l]<f[l];for(h=0;h<e;++h)i._parsed[h+t]=c=d[h],u&&(a()&&(u=!1),f=c);i._sorted=u}r&&zs(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(M(u,a),d),y:o.parse(M(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return Ls({keys:Ts(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=Ls(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,r=this._getOtherScale(t),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Ts(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let u,f;function g(){f=s[u];const e=f[r.axis];return!a(f[t.axis])||c>e||d<e}for(u=0;u<o&&(g()||(this.updateRangeFromParsed(h,t,f,l),!n));++u);if(n)for(u=o-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(h,t,f,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],a(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return o(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(l(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=As(t,i),n=As(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return Ci(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Ci(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,a=n[o],r=this.enableOptionSharing&&k(i);if(a)return Ws(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(ue.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s,e)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ws(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new Os(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Bs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){Bs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Bs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Vs(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class Hs{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return N(this.x)&&N(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function js(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=a.length,l=a[0],h=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,c,a,r/o),c;const d=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=W(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(a,e,o);if(r>0){let t,i;const n=r>1?Math.round((h-l)/(r-1)):null;for($s(e,c,d,s(n)?0:l-n,l),t=0,i=r-1;t<i;t++)$s(e,c,d,a[t],a[t+1]);return $s(e,c,d,h,s(n)?e.length:h+n),c}return $s(e,c,d),c}function $s(t,e,i,s,n){const o=l(s,0),a=Math.min(l(n,t.length),t.length);let r,h,c,d=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),c=o;c<0;)d++,c=Math.round(o+d*i);for(h=Math.max(o,0);h<a;h++)h===c&&(e.push(t[h]),d++,c=Math.round(o+d*i))}const Ys=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Us=(t,e)=>Math.min(e||t,t);function Xs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function qs(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function Ks(t){return t.drawTicks?t.tickLength:0}function Gs(t,e){if(!t.display)return 0;const i=Si(t.font,e),s=ki(t.padding);return(n(t.text)?t.text.length:1)*i.lineHeight+s.height}function Zs(t,e,i){let s=ut(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Js extends Hs{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=r(t,Number.POSITIVE_INFINITY),e=r(e,Number.NEGATIVE_INFINITY),i=r(i,Number.POSITIVE_INFINITY),s=r(s,Number.NEGATIVE_INFINITY),{min:r(t,i),max:r(e,s),minDefined:a(t),maxDefined:a(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;r<l;++r)e=a[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:r(i,r(s,i)),max:r(s,r(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){d(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Di(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Xs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=js(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){d(this.options.afterUpdate,[this])}beforeSetDimensions(){d(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){d(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),d(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){d(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=d(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){d(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){d(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Us(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,n=e.maxRotation;let o,a,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=J(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Ks(t.grid)-e.padding-Gs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Y(Math.min(Math.asin(J((h.highest.height+6)/o,-1,1)),Math.asin(J(a/r,-1,1))-Math.asin(J(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){d(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){d(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Gs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ks(n)+o):(t.height=this.maxHeight,t.width=Ks(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=$(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){d(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)s(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Xs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:o,_longestTextCache:a}=this,r=[],l=[],h=Math.floor(e/Us(e,i));let c,d,f,g,p,m,b,x,_,y,v,M=0,w=0;for(c=0;c<e;c+=h){if(g=t[c].label,p=this._resolveTickFontOptions(c),o.font=m=p.string,b=a[m]=a[m]||{data:{},gc:[]},x=p.lineHeight,_=y=0,s(g)||n(g)){if(n(g))for(d=0,f=g.length;d<f;++d)v=g[d],s(v)||n(v)||(_=Ce(o,b.data,b.gc,_,v),y+=x)}else _=Ce(o,b.data,b.gc,_,g),y=x;r.push(_),l.push(y),M=Math.max(_,M),w=Math.max(y,w)}!function(t,e){u(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(a,e);const k=r.indexOf(M),S=l.indexOf(w),P=t=>({width:r[t]||0,height:l[t]||0});return{first:P(0),last:P(e-1),widest:P(k),highest:P(S),widths:r,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Q(this._alignToPixels?Ae(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Ci(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Ci(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=$(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:a,border:r}=s,h=n.offset,c=this.isHorizontal(),d=this.ticks.length+(h?1:0),u=Ks(n),f=[],g=r.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(t){return Ae(i,t,p)};let x,_,y,v,M,w,k,S,P,D,C,O;if("top"===a)x=b(this.bottom),w=this.bottom-u,S=x-m,D=b(t.top)+m,O=t.bottom;else if("bottom"===a)x=b(this.top),D=t.top,O=b(t.bottom)-m,w=x+m,S=this.top+u;else if("left"===a)x=b(this.right),M=this.right-u,k=x-m,P=b(t.left)+m,C=t.right;else if("right"===a)x=b(this.left),P=t.left,C=b(t.right)-m,M=x+m,k=this.left+u;else if("x"===e){if("center"===a)x=b((t.top+t.bottom)/2+.5);else if(o(a)){const t=Object.keys(a)[0],e=a[t];x=b(this.chart.scales[t].getPixelForValue(e))}D=t.top,O=t.bottom,w=x+m,S=w+u}else if("y"===e){if("center"===a)x=b((t.left+t.right)/2);else if(o(a)){const t=Object.keys(a)[0],e=a[t];x=b(this.chart.scales[t].getPixelForValue(e))}M=x-m,k=M-u,P=t.left,C=t.right}const A=l(s.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/A));for(_=0;_<d;_+=T){const t=this.getContext(_),e=n.setContext(t),s=r.setContext(t),o=e.lineWidth,a=e.color,l=s.dash||[],d=s.dashOffset,u=e.tickWidth,g=e.tickColor,p=e.tickBorderDash||[],m=e.tickBorderDashOffset;y=qs(this,_,h),void 0!==y&&(v=Ae(i,y,o),c?M=k=P=C=v:w=S=D=O=v,f.push({tx1:M,ty1:w,tx2:k,ty2:S,x1:P,y1:D,x2:C,y2:O,width:o,color:a,borderDash:l,borderDashOffset:d,tickWidth:u,tickColor:g,tickBorderDash:p,tickBorderDashOffset:m}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:a}=i,r=this.isHorizontal(),l=this.ticks,{align:h,crossAlign:c,padding:d,mirror:u}=a,f=Ks(i.grid),g=f+d,p=u?-d:g,m=-$(this.labelRotation),b=[];let x,_,y,v,M,w,k,S,P,D,C,O,A="middle";if("top"===s)w=this.bottom-p,k=this._getXAxisLabelAlignment();else if("bottom"===s)w=this.top+p,k=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,M=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,M=t.x}else if("x"===e){if("center"===s)w=(t.top+t.bottom)/2+g;else if(o(s)){const t=Object.keys(s)[0],e=s[t];w=this.chart.scales[t].getPixelForValue(e)+g}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)M=(t.left+t.right)/2-g;else if(o(s)){const t=Object.keys(s)[0],e=s[t];M=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(f).textAlign}"y"===e&&("start"===h?A="top":"end"===h&&(A="bottom"));const T=this._getLabelSizes();for(x=0,_=l.length;x<_;++x){y=l[x],v=y.label;const t=a.setContext(this.getContext(x));S=this.getPixelForTick(x)+a.labelOffset,P=this._resolveTickFontOptions(x),D=P.lineHeight,C=n(v)?v.length:1;const e=C/2,i=t.color,o=t.textStrokeColor,h=t.textStrokeWidth;let d,f=k;if(r?(M=S,"inner"===k&&(f=x===_-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),O="top"===s?"near"===c||0!==m?-C*D+D/2:"center"===c?-T.highest.height/2-e*D+D:-T.highest.height+D/2:"near"===c||0!==m?D/2:"center"===c?T.highest.height/2-e*D:T.highest.height-C*D,u&&(O*=-1),0===m||t.showLabelBackdrop||(M+=D/2*Math.sin(m))):(w=S,O=(1-C)*D/2),t.showLabelBackdrop){const e=ki(t.backdropPadding),i=T.heights[x],s=T.widths[x];let n=O-e.top,o=0-e.left;switch(A){case"middle":n-=i/2;break;case"bottom":n-=i}switch(k){case"center":o-=s/2;break;case"right":o-=s;break;case"inner":x===_-1?o-=s:x>0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}b.push({label:v,font:P,textOffset:O,options:{rotation:m,color:i,strokeColor:o,strokeWidth:h,textAlign:f,textBaseline:A,translation:[M,w],backdrop:d}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,n=i.setContext(this.getContext()),o=i.display?n.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=Ae(t,this.left,o)-o/2,h=Ae(t,this.right,a)+a/2,c=d=r):(c=Ae(t,this.top,o)-o/2,d=Ae(t,this.bottom,a)+a/2,l=h=r),e.save(),e.lineWidth=n.width,e.strokeStyle=n.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Ie(e,i);const s=this.getLabelItems(t);for(const t of s){const i=t.options,s=t.font;Ne(e,t.label,0,t.textOffset,s,i)}i&&ze(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const a=Si(i.font),r=ki(i.padding),l=i.align;let h=a.lineHeight/2;"bottom"===e||"center"===e||o(e)?(h+=r.bottom,n(i.text)&&(h+=a.lineHeight*(i.text.length-1))):h+=r.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=function(t,e,i,s){const{top:n,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,g,p=0;const m=r-n,b=l-a;if(t.isHorizontal()){if(f=ft(s,a,l),o(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)+m-e}else g="center"===i?(c.bottom+c.top)/2+m-e:Ys(t,i,e);u=l-a}else{if(o(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-b+e}else f="center"===i?(c.left+c.right)/2-b+e:Ys(t,i,e);g=ft(s,r,n),p="left"===i?-E:E}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,h,e,l);Ne(t,i.text,0,0,a,{color:i.color,maxWidth:u,rotation:f,textAlign:Zs(l,e,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=l(t.grid&&t.grid.z,-1),s=l(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Js.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return Si(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Qs{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=b(Object.create(null),[i?ue.get(i):{},ue.get(e),t.defaults]);ue.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");ue.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&ue.describe(e,t.descriptors)}(t,o,i),this.override&&ue.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in ue[s]&&(delete ue[s][i],this.override&&delete re[i])}}class tn{constructor(){this.controllers=new Qs(Ns,"datasets",!0),this.elements=new Qs(Hs,"elements"),this.plugins=new Qs(Object,"plugins"),this.scales=new Qs(Js,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):u(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=w(t);d(i["before"+s],[],i),e[t](i),d(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var en=new tn;class sn{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===d(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){s(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=l(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(en.plugins.items);for(let t=0;t<s.length;t++)i.push(en.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,l=nn(s[e],n);null!==l&&o.push({plugin:r,options:on(t.config,{plugin:r,local:i[e]},l,a)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function nn(t,e){return e||!1!==t?!0===t?{}:t:null}function on(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function an(t,e){const i=ue.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function rn(t){if("x"===t||"y"===t||"r"===t)return t}function ln(t,...e){if(rn(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rn(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function hn(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function cn(t,e){const i=re[t.type]||{scales:{}},s=e.scales||{},n=an(t.type,e),a=Object.create(null);return Object.keys(s).forEach((e=>{const r=s[e];if(!o(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=ln(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return hn(t,"x",i[0])||hn(t,"y",i[0])}return{}}(e,t),ue.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(l,n),c=i.scales||{};a[e]=x(Object.create(null),[{axis:l},r,c[l],c[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,o=i.indexAxis||an(n,e),r=(re[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),n=i[e+"AxisID"]||e;a[n]=a[n]||Object.create(null),x(a[n],[{axis:e},s[n],r[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];x(e,[ue.scales[e.type],ue.scale])})),a}function dn(t){const e=t.options||(t.options={});e.plugins=l(e.plugins,{}),e.scales=cn(t,e)}function un(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const fn=new Map,gn=new Set;function pn(t,e){let i=fn.get(t);return i||(i=e(),fn.set(t,i),gn.add(i)),i}const mn=(t,e,i)=>{const s=M(e,i);void 0!==s&&t.add(s)};class bn{constructor(t){this._config=function(t){return(t=t||{}).data=un(t.data),dn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=un(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),dn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return pn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return pn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return pn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>mn(r,t,e)))),e.forEach((t=>mn(r,s,t))),e.forEach((t=>mn(r,re[n]||{},t))),e.forEach((t=>mn(r,ue,t))),e.forEach((t=>mn(r,le,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),gn.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,re[e]||{},ue.datasets[e]||{},{type:e},ue,le]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=xn(this._resolverCache,t,s);let l=a;if(function(t,e){const{isScriptable:i,isIndexable:s}=Ye(t);for(const o of e){const e=i(o),a=s(o),r=(a||e)&&t[o];if(e&&(S(r)||_n(r))||a&&n(r))return!0}return!1}(a,e)){o.$shared=!1;l=$e(a,i=S(i)?i():i,this.createResolver(t,i,r))}for(const t of e)o[t]=l[t];return o}createResolver(t,e,i=[""],s){const{resolver:n}=xn(this._resolverCache,t,i);return o(e)?$e(n,e,void 0,s):n}}function xn(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:je(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const _n=t=>o(t)&&Object.getOwnPropertyNames(t).some((e=>S(t[e])));const yn=["top","bottom","left","right","chartArea"];function vn(t,e){return"top"===t||"bottom"===t||-1===yn.indexOf(t)&&"x"===e}function Mn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function wn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),d(i&&i.onComplete,[t],e)}function kn(t){const e=t.chart,i=e.options.animation;d(i&&i.onProgress,[t],e)}function Sn(t){return fe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Pn={},Dn=t=>{const e=Sn(t);return Object.values(Pn).filter((t=>t.canvas===e)).pop()};function Cn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function On(t,e,i){return t.options.clip?t[i]:e[i]}class An{static defaults=ue;static instances=Pn;static overrides=re;static registry=en;static version="4.4.7";static getChart=Dn;static register(...t){en.add(...t),Tn()}static unregister(...t){en.remove(...t),Tn()}constructor(t,e){const s=this.config=new bn(e),n=Sn(t),o=Dn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||ks(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,h=l&&l.height,c=l&&l.width;this.id=i(),this.ctx=r,this.canvas=l,this.width=c,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new sn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=dt((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],Pn[this.id]=this,r&&l?(xt.listen(this,"complete",wn),xt.listen(this,"progress",kn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return s(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return en}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ke(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Te(this.canvas,this.ctx),this}stop(){return xt.stop(this),this}resize(t,e){xt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ke(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),d(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){u(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=ln(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),u(n,(e=>{const n=e.options,o=n.id,a=ln(o,n),r=l(n.type,e.dtype);void 0!==n.position&&vn(n.position,a)===vn(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===r)h=i[o];else{h=new(en.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)})),u(s,((t,e)=>{t||delete i[e]})),u(i,(t=>{as.configure(this,t,t.options),as.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Mn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||an(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=en.getController(o),{datasetElementType:s,dataElementType:a}=ue.datasets[o];Object.assign(e,{dataElementType:en.getElement(a),datasetElementType:s&&en.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){u(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||u(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){u(this.scales,(t=>{as.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);P(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){Cn(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!P(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;as.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],u(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,S(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(xt.has(this)?this.attached&&!xt.running(this)&&xt.start(this):(this.draw(),wn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:On(i,e,"left"),right:On(i,e,"right"),top:On(s,e,"top"),bottom:On(s,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Ie(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&ze(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Re(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Xi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ci(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);k(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),xt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Te(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Pn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};u(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){u(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},u(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!f(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=D(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,d(n.onHover,[t,a,this],this),r&&d(n.onClick,[t,a,this],this));const h=!f(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Tn(){return u(An.instances,(t=>t._plugins.invalidate()))}function Ln(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class En{static override(t){Object.assign(En.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ln()}parse(){return Ln()}format(){return Ln()}add(){return Ln()}diff(){return Ln()}startOf(){return Ln()}endOf(){return Ln()}}var Rn={_date:En};function In(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=lt(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(k(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return r}function zn(t,e,i,s){return n(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,h=r;Math.abs(a)>Math.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Fn(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(a[h],h),l.push(zn(u,d,o,h));return l}function Vn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Bn(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[Wn(c,a,r,l)]=!0,n=h)),o[Wn(n,a,r,l)]=!0,t.borderSkipped=o}function Wn(t,e,i,s){var n,o,a;return s?(a=i,t=Nn(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=Nn(t,e,i),t}function Nn(t,e,i){return"start"===t?e:"end"===t?i:t}function Hn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class jn extends Ns{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,a,r=t=>+i[t];if(o(i[t])){const{key:t="value"}=this._parsing;r=e=>+M(i[e],t)}for(n=t,a=t+e;n<a;++n)s._parsed[n]=r(n)}}_getRotation(){return $(this.options.rotation-90)}_getCircumference(){return $(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min(h(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=function(t,e,i){let s=1,n=1,o=0,a=0;if(e<O){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>Z(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Z(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(E,c,u),b=g(C,h,d),x=g(C+E,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(u,d,r),b=(i.width-o)/f,x=(i.height-o)/g,_=Math.max(Math.min(b,x)/2,0),y=c(this.options.radius,_),v=(y-Math.max(y*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/O)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,s);let p,m=this._getRotation();for(p=0;p<e;++p)m+=this._circumference(p,n);for(p=e;p<e+i;++p){const e=this._circumference(p,n),i=t[p],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};g&&(o.options=f||this.resolveDataElementOptions(p,i.active?"active":s)),m+=e,this.updateElement(i,p,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ne(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(l(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class $n extends Ns{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ne(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return ii.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*C;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,g=u+this._computeAngle(d,s,f),p=o.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=g,n&&(a.animateScale&&(p=0),a.animateRotate&&(i=g=c));const m={x:l,y:h,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$(this.resolveDataElementOptions(t,e).angle||i):0}}var Yn=Object.freeze({__proto__:null,BarController:class extends Ns{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Fn(t,e,i,s)}parseArrayData(t,e,i,s){return Fn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,f,g;for(d=i,u=i+s;d<u;++d)g=e[d],f={},f[n.axis]=n.parse(M(g,l),d),c.push(zn(M(g,h),f,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=Vn(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const o="reset"===n,{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),h=r.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=o||s(e[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,c),p=(e._stacks||{})[r.axis],m={horizontal:h,base:i.base,enableBorderRadius:!p||Vn(e._custom)||a===p._top||a===p._bottom,x:h?i.head:g.center,y:h?g.center:i.head,height:h?g.size:Math.abs(i.size),width:h?Math.abs(i.size):g.size};u&&(m.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const b=m.options||t[f].options;Bn(m,b,p,a),Hn(m,b,c.ratio),this.updateElement(t[f],f,m,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[i.axis],h=t=>{const e=t._parsed.find((t=>t[i.axis]===l)),n=e&&e[t.vScale.axis];if(s(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!h(i))&&((!1===o||-1===a.indexOf(i.stack)||void 0===o&&void 0===i.stack)&&a.push(i.stack),i.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||In(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),h=l._custom,c=Vn(h);let d,u,f=l[e.axis],g=0,p=i?this.applyStack(e,l,i):f;p!==f&&(g=p-f,p=f),c&&(f=h.barStart,p=h.barEnd-h.barStart,0!==f&&F(f)!==F(h.barEnd)&&(g=0),g+=f);const m=s(o)||c?g:o;let b=e.getPixelForValue(m);if(d=this.chart.getDataVisibility(t)?e.getPixelForValue(g+p):b,u=d-b,Math.abs(u)<a){u=function(t,e,i){return 0!==t?F(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,r)*a,f===r&&(b-=u/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),o=Math.min(t,s),h=Math.max(t,s);b=Math.max(Math.min(b,h),o),d=b+u,i&&!c&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(d)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const t=F(u)*e.getLineWidthForValue(r)/2;b+=t,u-=t}return{size:u,base:b,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,a=l(n.maxBarThickness,1/0);let r,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const h=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const o=i.barThickness;let a,r;return s(o)?(a=e.min*i.categoryPercentage,r=i.barPercentage):(a=o*n,r=1),{chunk:a/n,ratio:r,start:e.pixels[t]-a/2}}(t,e,n,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=l.start+l.chunk*c+l.chunk/2,h=Math.min(a,l.chunk*l.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),h=Math.min(a,e.min*e.ratio);return{base:r-h/2,head:r+h/2,center:r,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}},BubbleController:class extends Ns{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=l(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=l(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,s),h=o.axis,c=a.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},f=u[h]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[h]),g=u[c]=n?a.getBasePixel():a.getPixelForValue(i[c]);u.skip=isNaN(f)||isNaN(g),l&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=l(i&&i._custom,n),s}},DoughnutController:jn,LineController:class extends Ns{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=pt(e,s,o);this._drawStart=a,this._drawCount=r,mt(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,m=N(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===n,x=e+i,_=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){const g=t[i],_=b?g:{};if(i<e||i>=x){_.skip=!0;continue}const v=this.getParsed(i),M=s(v[f]),w=_[u]=a.getPixelForValue(v[u],i),k=_[f]=o||M?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(w)||isNaN(k)||M,_.stop=i>0&&Math.abs(v[u]-y[u])>m,p&&(_.parsed=v,_.raw=h.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,g.active?"active":n)),b||this.updateElement(g,i,_,n),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends jn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:$n,RadarController:class extends Ns{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ii.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),l=o?n.xCenter:r.x,h=o?n.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,c,s)}}},ScatterController:class extends Ns{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+r+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:n,count:o}=pt(e,i,s);if(this._drawStart=n,this._drawCount=o,mt(e)&&(n=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,n,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),f=a.axis,g=r.axis,{spanGaps:p,segment:m}=this.options,b=N(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===n;let _=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),p=x?e:{},y=s(i[g]),v=p[f]=a.getPixelForValue(i[f],c),M=p[g]=o||y?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,i,l):i[g],c);p.skip=isNaN(v)||isNaN(M)||y,p.stop=c>0&&Math.abs(i[f]-_[f])>b,m&&(p.parsed=i,p.raw=h.data[c]),u&&(p.options=d||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,p,n),_=i}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}});function Un(t,e,i,s){const n=vi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return J(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:J(n.innerStart,0,a),innerEnd:J(n.innerEnd,0,a)}}function Xn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function qn(t,e,i,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const g=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(g-(0!==t?g*t/(t+s):g))/2}const p=(g-Math.max(.001,g*d-i/C)/d)/2,m=l+p+f,b=n-p-f,{outerStart:x,outerEnd:_,innerStart:y,innerEnd:v}=Un(e,u,d,b-m),M=d-x,w=d-_,k=m+x/M,S=b-_/w,P=u+y,D=u+v,O=m+y/P,A=b-v/D;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(a,r,d,k,e),t.arc(a,r,d,e,S),_>0){const e=Xn(w,S,a,r);t.arc(e.x,e.y,_,S,b+E)}const i=Xn(D,b,a,r);if(t.lineTo(i.x,i.y),v>0){const e=Xn(D,A,a,r);t.arc(e.x,e.y,v,b+E,A+Math.PI)}const s=(b-v/u+(m+y/u))/2;if(t.arc(a,r,u,b-v/u,s,!0),t.arc(a,r,u,s,m+y/u,!0),y>0){const e=Xn(P,O,a,r);t.arc(e.x,e.y,y,O+Math.PI,m-E)}const n=Xn(M,m,a,r);if(t.lineTo(n.x,n.y),x>0){const e=Xn(M,k,a,r);t.arc(e.x,e.y,x,m-E,k)}}else{t.moveTo(a,r);const e=Math.cos(k)*d+a,i=Math.sin(k)*d+r;t.lineTo(e,i);const s=Math.cos(S)*d+a,n=Math.sin(S)*d+r;t.lineTo(s,n)}t.closePath()}function Kn(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,f?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let g=e.endAngle;if(o){qn(t,e,i,s,g,n);for(let e=0;e<o;++e)t.stroke();isNaN(r)||(g=a+(r%O||O))}f&&function(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(o,a,r,s-h,i+h),l>n?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+E,s-E),t.closePath(),t.clip()}(t,e,g),o||(qn(t,e,i,s,g,n),t.stroke())}function Gn(t,e,i=e){t.lineCap=l(i.borderCapStyle,e.borderCapStyle),t.setLineDash(l(i.borderDash,e.borderDash)),t.lineDashOffset=l(i.borderDashOffset,e.borderDashOffset),t.lineJoin=l(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=l(i.borderWidth,e.borderWidth),t.strokeStyle=l(i.borderColor,e.borderColor)}function Zn(t,e,i){t.lineTo(i.x,i.y)}function Jn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Qn(t,e,i,s){const{points:n,options:o}=e,{count:a,start:r,loop:l,ilen:h}=Jn(n,i,s),c=function(t){return t.stepped?Fe:t.tension||"monotone"===t.cubicInterpolationMode?Ve:Zn}(o);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=h;++d)u=n[(r+(p?h-d:d))%a],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,o.stepped),f=u);return l&&(u=n[(r+(p?h:0))%a],c(t,f,u,p,o.stepped)),!!l}function to(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=Jn(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,g,p,m=0,b=0;const x=t=>(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=g=i),p=i}_()}function eo(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?to:Qn}const io="function"==typeof Path2D;function so(t,e,i,s){io&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Gn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=eo(e);for(const r of n)Gn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class no extends Hs{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;hi(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=Ii(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?pi:t.tension||"monotone"===t.cubicInterpolationMode?mi:gi}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){a.push(d);continue}const f=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return eo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=eo(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),so(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function oo(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}function ao(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function ro(t,e,i,s){return t?0:J(e,i,s)}function lo(t){const e=ao(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Mi(s);return{t:ro(n.top,o.top,0,i),r:ro(n.right,o.right,0,e),b:ro(n.bottom,o.bottom,0,i),l:ro(n.left,o.left,0,e)}}(t,i/2,s/2),a=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,a=wi(n),r=Math.min(e,i),l=t.borderSkipped,h=s||o(n);return{topLeft:ro(!h||l.top||l.left,a.topLeft,0,r),topRight:ro(!h||l.top||l.right,a.topRight,0,r),bottomLeft:ro(!h||l.bottom||l.left,a.bottomLeft,0,r),bottomRight:ro(!h||l.bottom||l.right,a.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:a},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,a.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(n.b,n.r))}}}}function ho(t,e,i,s){const n=null===e,o=null===i,a=t&&!(n&&o)&&ao(t,s);return a&&(n||tt(e,a.left,a.right))&&(o||tt(i,a.top,a.bottom))}function co(t,e){t.rect(e.x,e.y,e.w,e.h)}function uo(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}var fo=Object.freeze({__proto__:null,ArcElement:class extends Hs{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=X(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:h,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=l(d,r-a),g=Z(n,a,r)&&a!==r,p=f>=O||g,m=tt(o,h+u,c+u);return p&&m}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>O?Math.floor(i/O):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=s*(1-Math.sin(Math.min(C,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let l=e.endAngle;if(o){qn(t,e,i,s,l,n);for(let e=0;e<o;++e)t.fill();isNaN(r)||(l=a+(r%O||O))}qn(t,e,i,s,l,n),t.fill()}(t,this,r,n,o),Kn(t,this,r,n,o),t.restore()}},BarElement:class extends Hs{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=lo(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?He:co;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,uo(o,e,n)),t.clip(),a(t,uo(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,uo(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ho(this,t,e,i)}inXRange(t,e){return ho(this,t,null,e)}inYRange(t,e){return ho(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:no,PointElement:class extends Hs{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return oo(this,t,"x",e)}inYRange(t,e){return oo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Re(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Le(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});function go(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}function po(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function mo(t,e,{horizontal:i,minRotation:s}){const n=$(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class bo extends Js{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return s(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=F(s),e=F(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,b=!s(a),x=!s(r),_=!s(h),y=(m-p)/(d+1);let v,M,w,k,S=B((m-p)/g/f)*f;if(S<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/S)-Math.floor(p/S),k>g&&(S=B(k*S/g/f)*f),s(l)||(v=Math.pow(10,l),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(p/S)*S,w=Math.ceil(m/S)*S):(M=p,w=m),b&&x&&o&&H((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=b?a:M,w=x?r:w,k=h-1,S=(w-M)/k):(k=(w-M)/S,k=V(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(U(S),U(M));v=Math.pow(10,s(l)?P:l),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let D=0;for(b&&(u&&M!==a?(i.push({value:a}),M<a&&D++,V(Math.round((M+D*S)*v)/v,a,mo(a,y,t))&&D++):M<a&&D++);D<k;++D){const t=Math.round((M+D*S)*v)/v;if(x&&t>r)break;i.push({value:t})}return x&&u&&w!==r?i.length&&V(i[i.length-1].value,r,mo(r,y,t))?i[i.length-1].value=r:i.push({value:r}):x&&w!==r||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&j(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ne(t,this.chart.options.locale,this.options.ticks.format)}}class xo extends bo{static id="linear";static defaults={ticks:{callback:ae.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=a(t)?t:0,this.max=a(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _o=t=>Math.floor(z(t)),yo=(t,e)=>Math.pow(10,_o(t)+e);function vo(t){return 1===t/Math.pow(10,_o(t))}function Mo(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}function wo(t,{min:e,max:i}){e=r(t.min,e);const s=[],n=_o(e);let o=function(t,e){let i=_o(e-t);for(;Mo(t,e,i)>10;)i++;for(;Mo(t,e,i)<10;)i--;return Math.min(i,_o(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),h=n>o?Math.pow(10,n):0,c=Math.round((e-h)*a)/a,d=Math.floor((e-h)/l/10)*l*10;let u=Math.floor((c-d)/Math.pow(10,o)),f=r(t.min,Math.round((h+d+u*Math.pow(10,o))*a)/a);for(;f<i;)s.push({value:f,major:vo(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,a=o>=0?1:a),f=Math.round((h+d+u*Math.pow(10,o))*a)/a;const g=r(t.max,f);return s.push({value:g,major:vo(g),significand:u}),s}class ko extends Js{static id="logarithmic";static defaults={ticks:{callback:ae.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=bo.prototype.parse.apply(this,[t,e]);if(0!==i)return a(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=a(t)?Math.max(0,t):null,this.max=a(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!a(this._userMin)&&(this.min=t===yo(this.min,0)?yo(this.min,-1):yo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(yo(i,-1)),o(yo(s,1)))),i<=0&&n(yo(s,-1)),s<=0&&o(yo(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=wo({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&j(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ne(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=z(t),this._valueRange=z(this.max)-z(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(z(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function So(t){const e=t.ticks;if(e.display&&t.display){const t=ki(e.backdropPadding);return l(e.font&&e.font.size,ue.font.size)+t.height}return 0}function Po(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function Do(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],o=[],a=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?C/a:0;for(let u=0;u<a;u++){const a=r.setContext(t.getPointLabelContext(u));o[u]=a.padding;const f=t.getPointPosition(u,t.drawingArea+o[u],l),g=Si(a.font),p=(h=t.ctx,c=g,d=n(d=t._pointLabels[u])?d:[d],{w:Oe(h,c.string,d),h:d.length*c.lineHeight});s[u]=p;const m=G(t.getIndexAngle(u)+l),b=Math.round(Y(m));Co(i,e,m,Po(b,f.x,p.w,0,180),Po(b,f.y,p.h,90,270))}var h,c,d;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:So(o)/2,additionalAngle:a?C/n:0};let h;for(let o=0;o<n;o++){l.padding=i[o],l.size=e[o];const n=Oo(t,o,l);s.push(n),"auto"===r&&(n.visible=Ao(n,h),n.visible&&(h=n))}return s}(t,s,o)}function Co(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function Oo(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=i,l=t.getPointPosition(e,s+n+a,o),h=Math.round(Y(G(l.angle+E))),c=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,r.h,h),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(h),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,r.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function Ao(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:o}=t;return!(Re({x:i,y:s},e)||Re({x:i,y:o},e)||Re({x:n,y:s},e)||Re({x:n,y:o},e))}function To(t,e,i){const{left:n,top:o,right:a,bottom:r}=i,{backdropColor:l}=e;if(!s(l)){const i=wi(e.borderRadius),s=ki(e.backdropPadding);t.fillStyle=l;const h=n-s.left,c=o-s.top,d=a-n+s.width,u=r-o+s.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),He(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function Lo(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,O);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}class Eo extends bo{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ae.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ki(So(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=a(t)&&!isNaN(t)?t:0,this.max=a(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/So(this.options))}generateTickLabels(t){bo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=d(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Do(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return G(t*(O/(this._pointLabels.length||1))+$(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(s(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(s(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return Ci(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-E+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Lo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:n}=e,o=this._pointLabels.length;let a,r,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const o=s.setContext(t.getPointLabelContext(n));To(i,o,e);const a=Si(o.font),{x:r,y:l,textAlign:h}=e;Ne(i,t._pointLabels[n],r,l+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),a=s.setContext(i),l=n.setContext(i);!function(t,e,i,s,n){const o=t.ctx,a=e.circular,{color:r,lineWidth:l}=e;!a&&!s||!r||!l||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),Lo(t,i,a,s),o.closePath(),o.stroke(),o.restore())}(this,a,r,o,l)}})),i.display){for(t.save(),a=o-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=Si(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=ki(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Ne(t,s.label,0,-n,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})})),t.restore()}drawTitle(){}}const Ro={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Io=Object.keys(Ro);function zo(t,e){return t-e}function Fo(t,e){if(s(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:r}=t._parseOpts;let l=e;return"function"==typeof n&&(l=n(l)),a(l)||(l="string"==typeof n?i.parse(l,n):i.parse(l)),null===l?null:(o&&(l="week"!==o||!N(r)&&!0!==r?i.startOf(l,o):i.startOf(l,"isoWeek",r)),+l)}function Vo(t,e,i,s){const n=Io.length;for(let o=Io.indexOf(t);o<n-1;++o){const t=Ro[Io[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return Io[o]}return Io[n-1]}function Bo(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=et(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function Wo(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class No extends Js{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Rn._date(t.adapters.date);s.init(e),x(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Fo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function l(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),s=a(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=a(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=nt(s,n,this.max);return this._unit=e.unit||(i.autoSkip?Vo(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=Io.length-1;o>=Io.indexOf(i);o--){const i=Io[o];if(Ro[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return Io[i?Io.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Io.indexOf(t)+1,i=Io.length;e<i;++e)if(Ro[Io[e]].common)return Io[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),Wo(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=J(s,0,o),n=J(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||Vo(n.minUnit,e,i,this._getLabelCapacity(e)),a=l(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,h=N(r)||!0===r,c={};let d,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",r)),f=+t.startOf(f,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,a,o),u++)Bo(c,d,g);return d!==i&&"ticks"!==s.bounds&&1!==u||Bo(c,d,g),Object.keys(c).sort(zo).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return d(o,[t,e,i],this);const a=n.time.displayFormats,r=this._unit,l=this._majorUnit,h=r&&a[r],c=l&&a[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,s||(f?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*n+a*o,h:i*o+a*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,Wo(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Fo(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return lt(t.sort(zo))}}function Ho(t,e,i){let s,n,o,a,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=it(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=it(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}var jo=Object.freeze({__proto__:null,CategoryScale:class extends Js{static id="category";static defaults={ticks:{callback:po}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(s(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:J(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:go(i,t,l(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return po.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:xo,LogarithmicScale:ko,RadialLinearScale:Eo,TimeScale:No,TimeSeriesScale:class extends No{static id="timeseries";static defaults=No.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ho(e,this.min),this._tableRange=Ho(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],r=s[o-1],l=s[o],Math.round((h+r)/2)!==l&&n.push({time:l,pos:o/(a-1)});return n}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ho(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ho(this._table,i*this._tableRange+this._minPos,!0)}}});const $o=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Yo=$o.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Uo(t){return $o[t%$o.length]}function Xo(t){return Yo[t%Yo.length]}function qo(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof jn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Uo(e++))),e}(i,e):n instanceof $n?e=function(t,e){return t.backgroundColor=t.data.map((()=>Xo(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=Uo(e),t.backgroundColor=Xo(e),++e}(i,e))}}function Ko(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Go={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n,a=Ko(s)||(r=n)&&(r.borderColor||r.backgroundColor)||o&&Ko(o)||"rgba(0,0,0,0.1)"!==ue.borderColor||"rgba(0,0,0,0.1)"!==ue.backgroundColor;var r;if(!i.forceOverride&&a)return;const l=qo(t);s.forEach(l)}};function Zo(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Jo(t){t.data.datasets.forEach((t=>{Zo(t)}))}var Qo={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Jo(t);const n=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,l=t.getDatasetMeta(o),h=a||e.data;if("y"===Pi([r,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=J(it(e,o.axis,a).lo,0,i-1)),s=h?J(it(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(l,h);if(u<=(i.threshold||4*n))return void Zo(e);let f;switch(s(a)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":f=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;c<o-2;c++){let s,n=0,o=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,o+=t[s].y;n/=b,o/=b;const x=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[p];for(u=f=-1,s=x;s<_;s++)f=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),f>u&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(h,d,u,n,i);break;case"min-max":f=function(t,e,i,n){let o,a,r,l,h,c,d,u,f,g,p=0,m=0;const b=[],x=e+i-1,_=t[e].x,y=t[x].x-_;for(o=e;o<e+i;++o){a=t[o],r=(a.x-_)/y*n,l=a.y;const e=0|r;if(e===h)l<f?(f=l,c=o):l>g&&(g=l,d=o),p=(m*p+a.x)/++m;else{const i=o-1;if(!s(c)&&!s(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&b.push({...t[e],x:p}),s!==u&&s!==i&&b.push({...t[s],x:p})}o>0&&i!==u&&b.push(t[i]),b.push(a),h=e,m=0,f=g=l,c=d=u=o}}return b}(h,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=f}))},destroy(t){Jo(t)}};function ta(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=G(n),o=G(o)),{property:t,start:n,end:o}}function ea(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ia(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function sa(t,e){let i=[],s=!1;return n(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=ea(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new no({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function na(t){return t&&!1!==t.fill}function oa(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!a(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function aa(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=l(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(o(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return a(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ra(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=la(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function la(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,a=t.points;let r=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=a[e.start][i],h=a[e.end][i];if(tt(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class ha{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:O},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function ca(t){const{chart:e,fill:i,line:s}=t;if(a(i))return function(t,e){const i=t.getDatasetMeta(e),s=i&&t.isDatasetVisible(e);return s?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(sa({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)ra(n,a[t],r)}return new no({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,a=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:o(t)?t.value:e.getBaseValue(),s}(i,e,a),l=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,a);return new ha({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<n;++t)l.push(e.getPointPositionForValue(t,r));return l}(t);return function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:o(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(a(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof ha?n:sa(n,s)}function da(t,e,i){const s=ca(e),{line:n,scale:o,axis:a}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(Ie(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==n&&(ua(t,s,a.top),fa(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),ua(t,s,a.bottom));fa(t,{line:i,target:s,color:o,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:o,axis:a}),ze(t))}function ua(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[ea(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function fa(t,e){const{line:i,target:s,property:n,color:o,scale:a}=e,r=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=ea(s,r,n);const l=ta(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=Ii(e,l);for(const e of h){const s=ta(i,o[e.start],o[e.end],e.loop),r=Ri(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:ia(l,s,"start",Math.max)},end:{[i]:ia(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=o}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,ga(t,a,d&&ta(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():pa(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||pa(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function ga(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function pa(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var ma={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof no&&(l={visible:t.isDatasetVisible(a),index:a,fill:aa(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=oa(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&da(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;na(i)&&da(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;na(s)&&"beforeDatasetDraw"===i.drawTime&&da(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ba=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class xa extends Hs{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=d(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Si(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=ba(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,s,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:p,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;"string"!=typeof e.text&&(s=_a(e,i));return s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:m},d=Math.max(d,p),u+=m+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=Oi(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=ft(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,a=ft(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,a=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Ie(t,this),this._draw(),ze(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,a=ue.color,r=Oi(t.rtl,this.left,this.width),h=Si(o.font),{padding:c}=o,d=h.size,u=d/2;let f;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=ba(o,d),b=this.isHorizontal(),x=this._computeTitleHeight();f=b?{x:ft(n,this.left+c,this.right-i[0]),y:this.top+c+x,line:0}:{x:this.left+c,y:ft(n,this.top+x+c,this.bottom-e[0].height),line:0},Ai(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach(((y,v)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const M=s.measureText(y.text).width,w=r.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=g+u+M;let S=f.x,P=f.y;r.setWidth(this.width),b?v>0&&S+k+c>this.right&&(P=f.y+=_,f.line++,S=f.x=ft(n,this.left+c,this.right-i[f.line])):v>0&&P+_>this.bottom&&(S=f.x=S+e[f.line].width+c,f.line++,P=f.y=ft(n,this.top+x+c,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const n=l(i.lineWidth,1);if(s.fillStyle=l(i.fillStyle,a),s.lineCap=l(i.lineCap,"butt"),s.lineDashOffset=l(i.lineDashOffset,0),s.lineJoin=l(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=l(i.strokeStyle,a),s.setLineDash(l(i.lineDash,[])),o.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(t,g/2);Ee(s,a,l,e+u,o.pointStyleWidth&&g)}else{const o=e+Math.max((d-p)/2,0),a=r.leftForLtr(t,g),l=wi(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?He(s,{x:a,y:o,w:g,h:p,radius:l}):s.rect(a,o,g,p),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(S),P,y),S=gt(w,S+g+u,b?S+k:this.right,t.rtl),function(t,e,i){Ne(s,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(S),P,y),b)f.x+=k+c;else if("string"!=typeof y.text){const t=h.lineHeight;f.y+=_a(y,t)+c}else f.y+=_})),Ti(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Si(e.font),s=ki(e.padding);if(!e.display)return;const n=Oi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=ft(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ft(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=ft(a,c,c+d);o.textAlign=n.textAlign(ut(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Ne(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Si(t.font),i=ki(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(tt(t,this.left,this.right)&&tt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],tt(t,s.left,s.left+s.width)&&tt(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&d(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&d(e.onHover,[t,i,this],this)}else i&&d(e.onClick,[t,i,this],this);var s,n}}function _a(t,e){return e*(t.text?t.text.length:0)}var ya={id:"legend",_element:xa,start(t,e,i){const s=t.legend=new xa({ctx:t.ctx,options:i,chart:t});as.configure(t,s,i),as.addBox(t,s)},stop(t){as.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;as.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=ki(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class va extends Hs{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=n(i.text)?i.text.length:1;this._padding=ki(i.padding);const o=s*Si(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,l,h,c=0;return this.isHorizontal()?(l=ft(a,i,n),h=e+t,r=n-i):("left"===o.position?(l=i+t,h=ft(a,s,e),c=-.5*C):(l=n-t,h=ft(a,e,s),c=.5*C),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Si(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:a,rotation:r}=this._drawArgs(s);Ne(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:r,textAlign:ut(e.align),textBaseline:"middle",translation:[n,o]})}}var Ma={id:"title",_element:va,start(t,e,i){!function(t,e){const i=new va({ctx:t.ctx,options:e,chart:t});as.configure(t,i,e),as.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;as.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;as.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const wa=new WeakMap;var ka={id:"subtitle",start(t,e,i){const s=new va({ctx:t.ctx,options:i,chart:t});as.configure(t,s,i),as.addBox(t,s),wa.set(t,s)},stop(t){as.removeBox(t,wa.get(t)),wa.delete(t)},beforeUpdate(t,e,i){const s=wa.get(t);as.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sa={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}if(0===o||0===s.size)return!1;return{x:[...s].reduce(((t,e)=>t+e))/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=q(e,s.getCenterPoint());t<r&&(r=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Pa(t,e){return e&&(n(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Da(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ca(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Oa(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=Si(e.bodyFont),h=Si(e.titleFont),c=Si(e.footerFont),d=o.length,f=n.length,g=s.length,p=ki(e.padding);let m=p.height,b=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){m+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){b=Math.max(b,i.measureText(t).width+_)};return i.save(),i.font=h.string,u(t.title,y),i.font=l.string,u(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,u(s,(t=>{u(t.before,y),u(t.lines,y),u(t.after,y)})),_=0,i.font=c.string,u(t.footer,y),i.restore(),b+=p.width,{width:b,height:m}}function Aa(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function Ta(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Aa(t,e,i,s),yAlign:s}}function La(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=wi(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:J(g,0,s.width-e.width),y:J(p,0,s.height-e.height)}}function Ea(t,e,i){const s=ki(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Ra(t){return Pa([],Da(t))}function Ia(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const za={beforeTitle:e,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:e,beforeBody:e,beforeLabel:e,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return s(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:e,afterBody:e,beforeFooter:e,footer:e,afterFooter:e};function Fa(t,e,i,s){const n=t[e].call(i,s);return void 0===n?za[e].call(i,s):n}class Va extends Hs{static positioners=Sa;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new Os(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Ci(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=Fa(i,"beforeTitle",this,t),n=Fa(i,"title",this,t),o=Fa(i,"afterTitle",this,t);let a=[];return a=Pa(a,Da(s)),a=Pa(a,Da(n)),a=Pa(a,Da(o)),a}getBeforeBody(t,e){return Ra(Fa(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return u(t,(t=>{const e={before:[],lines:[],after:[]},n=Ia(i,t);Pa(e.before,Da(Fa(n,"beforeLabel",this,t))),Pa(e.lines,Fa(n,"label",this,t)),Pa(e.after,Da(Fa(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Ra(Fa(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Fa(i,"beforeFooter",this,t),n=Fa(i,"footer",this,t),o=Fa(i,"afterFooter",this,t);let a=[];return a=Pa(a,Da(s)),a=Pa(a,Da(n)),a=Pa(a,Da(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;a<r;++a)l.push(Ca(this.chart,e[a]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),u(l,(e=>{const i=Ia(t.callbacks,e);s.push(Fa(i,"labelColor",this,e)),n.push(Fa(i,"labelPointStyle",this,e)),o.push(Fa(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Sa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Oa(this,i),a=Object.assign({},t,e),r=Ta(this.chart,i,a),l=La(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=wi(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=Oi(i.rtl,this.x,this.width);for(t.x=Ea(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Si(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,r+1===n&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,n){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:h}=n,c=Si(n.bodyFont),d=Ea(this,"left",n),u=s.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,g=e.y+f;if(n.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(u,h)+h/2,o=g+l/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,Le(t,e,i,o),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Le(t,e,i,o)}else{t.lineWidth=o(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=s.leftForLtr(u,h),i=s.leftForLtr(s.xPlus(u,1),h-2),r=wi(a.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,He(t,{x:e,y:g,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),He(t,{x:i,y:g+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,h,l),t.strokeRect(e,g,h,l),t.fillStyle=a.backgroundColor,t.fillRect(i,g+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Si(i.bodyFont);let d=c.lineHeight,f=0;const g=Oi(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+f),t.y+d/2),t.y+=d+n},m=g.textAlign(o);let b,x,_,y,v,M,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ea(this,m,i),e.fillStyle=i.bodyColor,u(this.beforeBody,p),f=a&&"right"!==m?"center"===o?l/2+h:l+2+h:0,y=0,M=s.length;y<M;++y){for(b=s[y],x=this.labelTextColors[y],e.fillStyle=x,u(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,y,g,i),d=Math.max(c.lineHeight,r)),v=0,w=_.length;v<w;++v)p(_[v]),d=c.lineHeight;u(b.after,p)}f=0,d=c.lineHeight,u(this.afterBody,p),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,a;if(n){const r=Oi(i.rtl,this.x,this.width);for(t.x=Ea(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",o=Si(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],r.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=wi(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+c,r),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,r),e.quadraticCurveTo(a+l,r,a+l,r+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(a+l,r+h-f),e.quadraticCurveTo(a+l,r+h,a+l-f,r+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+u,r+h),e.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(a,r+c),e.quadraticCurveTo(a,r,a+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Sa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Oa(this,t),a=Object.assign({},i,this._size),r=Ta(e,t,a),l=La(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ki(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Ai(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Ti(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!f(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!f(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Sa[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Ba={id:"tooltip",_element:Va,positioners:Sa,afterInit(t,e,i){i&&(t.tooltip=new Va({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:za},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return An.register(Yn,jo,fo,t),An.helpers={...Wi},An._adapters=Rn,An.Animation=Cs,An.Animations=Os,An.animator=xt,An.controllers=en.controllers.items,An.DatasetController=Ns,An.Element=Hs,An.elements=fo,An.Interaction=Xi,An.layouts=as,An.platforms=Ss,An.Scale=Js,An.Ticks=ae,Object.assign(An,Yn,jo,fo,t,Ss),An.Chart=An,"undefined"!=typeof window&&(window.Chart=An),An})); +//# sourceMappingURL=chart.umd.js.map diff --git a/seller_1/node_modules/chart.js/dist/chart.umd.js.map b/seller_1/node_modules/chart.js/dist/chart.umd.js.map new file mode 100644 index 0000000..e5c38ac --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chart.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chart.umd.js","sources":["../src/helpers/helpers.core.ts","../src/helpers/helpers.math.ts","../src/helpers/helpers.collection.ts","../src/helpers/helpers.extras.ts","../src/core/core.animator.js","../node_modules/.pnpm/@kurkle+color@0.3.2/node_modules/@kurkle/color/dist/color.esm.js","../src/helpers/helpers.color.ts","../src/core/core.animations.defaults.js","../src/helpers/helpers.intl.ts","../src/core/core.ticks.js","../src/core/core.defaults.js","../src/core/core.layouts.defaults.js","../src/core/core.scale.defaults.js","../src/helpers/helpers.dom.ts","../src/helpers/helpers.canvas.ts","../src/helpers/helpers.config.ts","../src/helpers/helpers.curve.ts","../src/helpers/helpers.easing.ts","../src/helpers/helpers.interpolation.ts","../src/helpers/helpers.options.ts","../src/helpers/helpers.rtl.ts","../src/helpers/helpers.segment.js","../src/core/core.interaction.js","../src/core/core.layouts.js","../src/platform/platform.base.js","../src/platform/platform.basic.js","../src/platform/platform.dom.js","../src/platform/index.js","../src/core/core.animation.js","../src/core/core.animations.js","../src/core/core.datasetController.js","../src/core/core.element.ts","../src/core/core.scale.autoskip.js","../src/core/core.scale.js","../src/core/core.typedRegistry.js","../src/core/core.registry.js","../src/core/core.plugins.js","../src/core/core.config.js","../src/core/core.controller.js","../src/core/core.adapters.ts","../src/controllers/controller.bar.js","../src/controllers/controller.doughnut.js","../src/controllers/controller.polarArea.js","../src/controllers/controller.bubble.js","../src/controllers/controller.line.js","../src/controllers/controller.pie.js","../src/controllers/controller.radar.js","../src/controllers/controller.scatter.js","../src/elements/element.arc.ts","../src/elements/element.line.js","../src/elements/element.point.ts","../src/elements/element.bar.js","../src/scales/scale.category.js","../src/scales/scale.linearbase.js","../src/scales/scale.linear.js","../src/scales/scale.logarithmic.js","../src/scales/scale.radialLinear.js","../src/scales/scale.time.js","../src/scales/scale.timeseries.js","../src/plugins/plugin.colors.ts","../src/plugins/plugin.decimation.js","../src/plugins/plugin.filler/filler.segment.js","../src/plugins/plugin.filler/filler.helper.js","../src/plugins/plugin.filler/filler.options.js","../src/plugins/plugin.filler/filler.target.stack.js","../src/plugins/plugin.filler/simpleArc.js","../src/plugins/plugin.filler/filler.target.js","../src/plugins/plugin.filler/filler.drawing.js","../src/plugins/plugin.filler/index.js","../src/plugins/plugin.legend.js","../src/plugins/plugin.title.js","../src/plugins/plugin.subtitle.js","../src/plugins/plugin.tooltip.js","../src/index.umd.ts"],"sourcesContent":["/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || value === undefined;\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray<T = unknown>(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault<T>(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each<T, TA>(\n loopable: Record<string, T>,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[] | Record<string, T>,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone<T>(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge<T>(target: T, source: [], options?: MergeOptions): T;\nexport function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge<T, S1, S2, S3, S4>(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf<T>(target: T, source: []): T;\nexport function mergeIf<T, S1>(target: T, source: S1): T & S1;\nexport function mergeIf<T, S1>(target: T, source: [S1]): T & S1;\nexport function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge<T>(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = <T>(a: Set<T>, b: Set<T>) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record<string, number>[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup<T>(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener<T> {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique<T>(items: T[]) {\n const set = new Set<T>(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled<TArgs extends Array<any>>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n\n /**\n\t * @private\n\t */\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n\n /**\n\t * @private\n\t */\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n\n if (this._running) {\n this._refresh();\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _update(date = Date.now()) {\n let remaining = 0;\n\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n\n for (; i >= 0; --i) {\n item = items[i];\n\n if (item._active) {\n if (item._total > anims.duration) {\n // if the animation has been updated and its duration prolonged,\n // update to total duration of current animations run (for progress event)\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n // Remove the item by replacing it with last item and removing the last\n // A lot faster than splice.\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n\n remaining += items.length;\n });\n\n this._lastDate = date;\n\n if (remaining === 0) {\n this._running = false;\n }\n }\n\n /**\n\t * @private\n\t */\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n\n /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n\n /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n\n /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n\n /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n\n /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n","/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","\nconst intlCache = new Map<string, Intl.NumberFormat>();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial<Scale> {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n if (_isDomSupported()) {\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n }\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record<string, number>,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record<string, number>, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n if (!ctx && !canvas) {\n return;\n }\n\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache<T, R> = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy<T, R>;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy<T, R>,\n context: AnyObject,\n subProxy?: ResolverProxy<T, R>,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache<T, R> = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy<T, R>;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set<AnyObject>,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set<AnyObject>();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set<AnyObject>,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set<string>();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType<typeof splineCurve>;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;\nexport function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;\nexport function _readValueToProps(value: number | Record<string, number>, props: string[] | Record<string, string>) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext<T extends object>(parentContext: null, context: T): T;\nexport function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n","import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n // _sharedOptions indicates that each element has equal options -> equal proportions\n // So we can do a ranged binary search based on the range of first element and\n // be confident to get the full range of indices that can intersect with the value.\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n // Default to all elements, when binary search can not be used.\n return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n items.push({element, datasetIndex, index});\n }\n }\n\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n // Part of the public API to facilitate developers creating their own modes\n evaluateInteractionItems,\n\n // Helper function for different modes\n modes: {\n /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n\n // don't count items that are skipped (null data)\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n\n return elements;\n },\n\n /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n\n return items;\n },\n\n /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n\n /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n x(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n\n /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n y(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n","import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\n\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n\n // dynamically placed boxes size is not considered\n if (!isObject(pos)) {\n if (layout.size) {\n // this layout was already counted for, lets first reduce old size\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n\n // return booleans on the changes per direction\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n // Dimensions changed and there were non full width boxes before this\n // -> we have to refit those\n refit |= same && refitBoxes.length;\n\n // Chart area changed in the opposite direction\n changed = changed || other;\n\n if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n refitBoxes.push(layout);\n }\n }\n\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n\n chartArea.x = x;\n chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] - Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n // @ts-ignore\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n\n chart.boxes.push(item);\n },\n\n /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n\n /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n\n // Before any changes are made, notify boxes that an update is about to being\n // This is used to clear any cached data (e.g. scale limits)\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n // First fit the fullSize boxes, to reduce probability of re-fitting.\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n // Then fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n // Then fit horizontal boxes\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n // if the area changed, re-fit vertical boxes\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n\n handleMaxPadding(chartArea);\n\n // Finally place the boxes to correct coordinates\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n // Move to opposite side of chart\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n\n // Finally update boxes in chartArea (radial scale for example)\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n","\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n releaseContext(context) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n getDevicePixelRatio() {\n return 1;\n }\n\n /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n isAttached(canvas) { // eslint-disable-line no-unused-vars\n return true;\n }\n\n /**\n * Updates config with platform specific requirements\n * @param {import('../core/core.config.js').default} config\n */\n updateConfig(config) { // eslint-disable-line no-unused-vars\n // no-op\n }\n}\n","/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n acquireContext(item) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n","/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n // Include possible borders in the size\n style.boxSizing = style.boxSizing || 'border-box';\n\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n if (node) {\n node.addEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction removeListener(chart, type, listener) {\n if (chart && chart.canvas) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n }\n}\n\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n // If the container size shrank during chart resize, let's assume\n // scrollbar appeared. So we resize again with the scrollbar visible -\n // effectively making chart smaller and the scrollbar hidden again.\n // Because we are inside `throttled`, and currently `ticking`, scroll\n // events are ignored during this whole 2 resize process.\n // If we assumed wrong and something else happened, we are resizing\n // twice in a frame (potential performance issue)\n listener();\n }\n }, window);\n\n // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n // When its container's display is set to 'none' the callback will be called with a\n // size of (0, 0), which will cause the chart to lose its original height, so skip\n // resizing in such case.\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n\n return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n // This case can occur if the chart is destroyed while waiting\n // for the throttled function to occur. We prevent crashes by checking\n // for a destroyed chart\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n\n addListener(canvas, type, proxy);\n\n return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n acquireContext(canvas, aspectRatio) {\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === canvas) {\n // Load platform resources on first chart creation, to make it possible to\n // import the library before setting platform options.\n initCanvas(canvas, aspectRatio);\n return context;\n }\n\n return null;\n }\n\n /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n // eslint-disable-next-line no-self-assign\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n return true;\n }\n\n /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n addEventListener(chart, type, listener) {\n // Can have only one listener per type, so make sure previous is removed\n this.removeEventListener(chart, type);\n\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n\n\n /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n\n if (!proxy) {\n return;\n }\n\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n\n /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n isAttached(canvas) {\n const container = canvas && _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n","import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n","import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n /**\n * @param {string} from\n * @param {string} to\n * @param {number} factor\n */\n color(from, to, factor) {\n const c0 = helpersColor(from || transparent);\n const c1 = c0.valid && helpersColor(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\n\nexport default class Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n\n active() {\n return this._active;\n }\n\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n\n cancel() {\n if (this._active) {\n // update current evaluated value, for smoother animations\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n\n this._active = from !== to && (loop || (elapsed < duration));\n\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n this._target[prop] = this._fn(from, to, factor);\n }\n\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n","import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n\n /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n // Going to shared options:\n // After all animations are done, assign the shared options object to the element\n // So any new updates to the shared options are observed\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n // rejected, noop\n });\n }\n\n return animations;\n }\n\n /**\n\t * @private\n\t */\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n\n if (animation) {\n if (cfg && animation.active()) {\n // There is an existing active animation, let's update that\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n // not animated, set directly to new value\n target[prop] = value;\n continue;\n }\n\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n\n\n /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n update(target, values) {\n if (this._properties.size === 0) {\n // Nothing is animated, just apply the new values.\n Object.assign(target, values);\n return;\n }\n\n const animations = this._createAnimations(target, values);\n\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\n\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n // @ts-ignore\n return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n // Going from shared options to distinct one:\n // Create new options object containing the old shared values and start updating that.\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n","import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\n\nfunction toClip(value) {\n let t, r, b, l;\n\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n\n if (value === null) {\n return;\n }\n\n let found = false;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n found = true;\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n\n if (!found && !options.all) {\n return 0;\n }\n\n return value;\n}\n\nfunction convertObjectDataToArray(data, meta) {\n const {iScale, vScale} = meta;\n const iAxisKey = iScale.axis === 'x' ? 'x' : 'y';\n const vAxisKey = vScale.axis === 'x' ? 'x' : 'y';\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n [iAxisKey]: key,\n [vAxisKey]: data[key]\n };\n }\n return adata;\n}\n\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n\n return null;\n}\n\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\n\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\n\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\n\nfunction clearStacks(meta, items) {\n // Not using meta.index here, because it might be already updated if the dataset changed location\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n /**\n * @type {any}\n */\n static defaults = {};\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n */\n static datasetElementType = null;\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n */\n static dataElementType = null;\n\n /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n /** @type {boolean | object} */\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n\n this.initialize();\n }\n\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n }\n }\n\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n\n /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n\n /**\n\t * @private\n\t */\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n\n reset() {\n this._update('reset');\n }\n\n /**\n\t * @private\n\t */\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n\n /**\n\t * @private\n\t */\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n\n // In order to correctly handle data addition/deletion animation (and thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal metadata accordingly.\n\n if (isObject(data)) {\n const meta = this._cachedMeta;\n this._data = convertObjectDataToArray(data, meta);\n } else if (_data !== data) {\n if (_data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(_data, this);\n // Discard old parsed data and stacks\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n\n addElements() {\n const meta = this._cachedMeta;\n\n this._dataCheck();\n\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n\n this._dataCheck();\n\n // make sure cached _stacked status is current\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n\n // detect change in stack option\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n // remove values from old stack\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n this._resyncElements(resetNewElements);\n\n // if stack changed, update stack values for the whole dataset\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n meta._stacked = isStacked(meta.vScale, meta);\n }\n }\n\n /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n\n /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n\n /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n\n /**\n\t * @protected\n\t */\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n\n /**\n\t * @protected\n\t */\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n\n /**\n\t * @protected\n\t */\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n // if the data is sorted, we don't need to check further from this end of array\n break;\n }\n }\n if (sorted) {\n // in the sorted case, find first non-skipped value from other end of array\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return false;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n\n /**\n\t * @private\n\t */\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {} // eslint-disable-line no-unused-vars\n\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n\n /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n\n /**\n\t * @protected\n\t */\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n\n /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n\n /**\n\t * @private\n\t */\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n // context is provided as a function, and is called only if needed,\n // so we don't create a context for each element if not needed.\n const context = () => this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n if (values.$shared) {\n // `$shared` indicates this set of options can be shared between multiple elements.\n // Sharing is used to reduce number of properties to change during animation.\n values.$shared = sharing;\n\n // We cache options by `mode`, which can be 'active' for example. This enables us\n // to have the 'active' element options and 'default' options to switch between\n // when interacting.\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n\n return values;\n }\n\n\n /**\n\t * @private\n\t */\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n\n /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n\n /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n\n /**\n * @todo v4, rename to getSharedOptions and remove excess functions\n */\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {sharedOptions, includeOptions};\n }\n\n /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n\n /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n\n /**\n\t * @private\n\t */\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n // When going from active to inactive, we need to update to the shared options.\n // This way the once hovered element will end up with the same original shared options instance, after animation.\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n\n /**\n\t * @private\n\t */\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n\n /**\n\t * @private\n\t */\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n\n /**\n\t * @private\n\t */\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n\n // Apply changes detected through array listeners\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n\n if (count) {\n // TODO: It is not optimal to always parse the old data\n // This is done because we are not detecting direct assignments:\n // chart.data.datasets[0].data[5] = 10;\n // chart.data.datasets[0].data[5].y = 10;\n this.parse(0, count);\n }\n\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n\n /**\n\t * @private\n\t */\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n\n updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * @private\n\t */\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n\n /**\n\t * @private\n */\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\n","import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element<T = AnyObject, O = AnyObject> {\n\n static defaults = {};\n static defaultRoutes = undefined;\n\n x: number;\n y: number;\n active = false;\n options: O;\n $animations: Record<keyof T, Animation>;\n\n tooltipPosition(useFinalPosition: boolean): Point {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y} as Point;\n }\n\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n\n /**\n * Gets the current or final value of each prop. Can return extra properties (whole object).\n * @param props - properties to get\n * @param [final] - get the final value (animation target)\n */\n getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;\n getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;\n getProps(props: string[], final?: boolean): Partial<Record<string, unknown>> {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this as Record<string, unknown>;\n }\n const ret: Record<string, unknown> = {};\n props.forEach((prop) => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n });\n return ret;\n }\n}\n","import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n\n // If there are too many major ticks to display them all\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n\n // If the major ticks are evenly spaced apart, place the minor ticks\n // so that they divide the major ticks into even chunks\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n\n next = start;\n\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n\n if (len < 2) {\n return false;\n }\n\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n","import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n\n // Return undefined if the pixel is out of the range\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n\n return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\n\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\n\nfunction titleAlign(align, position, reverse) {\n /** @type {CanvasTextAlign} */\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n // eslint-disable-next-line max-statements\n constructor(cfg) {\n super();\n\n /** @type {string} */\n this.id = cfg.id;\n /** @type {string} */\n this.type = cfg.type;\n /** @type {any} */\n this.options = undefined;\n /** @type {CanvasRenderingContext2D} */\n this.ctx = cfg.ctx;\n /** @type {Chart} */\n this.chart = cfg.chart;\n\n // implements box\n /** @type {number} */\n this.top = undefined;\n /** @type {number} */\n this.bottom = undefined;\n /** @type {number} */\n this.left = undefined;\n /** @type {number} */\n this.right = undefined;\n /** @type {number} */\n this.width = undefined;\n /** @type {number} */\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n /** @type {number} */\n this.maxWidth = undefined;\n /** @type {number} */\n this.maxHeight = undefined;\n /** @type {number} */\n this.paddingTop = undefined;\n /** @type {number} */\n this.paddingBottom = undefined;\n /** @type {number} */\n this.paddingLeft = undefined;\n /** @type {number} */\n this.paddingRight = undefined;\n\n // scale-specific properties\n /** @type {string=} */\n this.axis = undefined;\n /** @type {number=} */\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n /** @type {Tick[]} */\n this.ticks = [];\n /** @type {object[]|null} */\n this._gridLineItems = null;\n /** @type {object[]|null} */\n this._labelItems = null;\n /** @type {object|null} */\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n /** @type {number} */\n this._startPixel = undefined;\n /** @type {number} */\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n\n /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n init(options) {\n this.options = options.setContext(this.getContext());\n\n this.axis = options.axis;\n\n // parse min/max value, so we can properly determine min/max for other scales\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n\n /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n return raw;\n }\n\n /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isFinite(_userMin),\n maxDefined: isFinite(_userMax)\n };\n }\n\n /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n getMinMax(canStack) {\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n\n if (minDefined && maxDefined) {\n return {min, max};\n }\n\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n\n // Make sure min <= max when only min or max is defined by user and the data is outside that range\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n\n /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n\n /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n getTicks() {\n return this.ticks;\n }\n\n /**\n\t * @return {string[]}\n\t */\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n\n /**\n * @return {import('../types.js').LabelItem[]}\n */\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n\n // When a new layout is created, reset the data limits cache\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n beforeUpdate() {\n call(this.options.beforeUpdate, [this]);\n }\n\n /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t * This space comes from two sources:\n\t * - padding - space that's required to show the labels at the edges of the scale\n\t * - thickness of scales or legends in another orientation\n\t */\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n this.beforeUpdate();\n\n // Absorb the master measurements\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n\n // Dimensions\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n\n // Data min/max\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n\n this.beforeBuildTicks();\n\n this.ticks = this.buildTicks() || [];\n\n // Allow modification of ticks in callback.\n this.afterBuildTicks();\n\n // Compute tick rotation and fit using a sampled subset of labels\n // We generally don't need to compute the size of every single label for determining scale size\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n // configure is called twice, once here, once from core.controller.updateLayout.\n // Here we haven't been positioned yet, but dimensions are correct.\n // Variables set in configure are needed for calculateLabelRotation, and\n // it's ok that coordinates are not correct there, only dimensions matter.\n this.configure();\n\n // Tick Rotation\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n this.afterCalculateLabelRotation();\n\n // Auto-skip\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n\n if (samplingEnabled) {\n // Generate labels using all non-skipped ticks\n this._convertTicksToLabels(this.ticks);\n }\n\n this.beforeFit();\n this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n this.afterFit();\n\n // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n this.afterUpdate();\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n // by default vertical scales are from bottom to top, so pixels are reversed\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n\n afterUpdate() {\n call(this.options.afterUpdate, [this]);\n }\n\n //\n\n beforeSetDimensions() {\n call(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n if (this.isHorizontal()) {\n // Reset position before calculating rotation\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n\n // Reset position before calculating rotation\n this.top = 0;\n this.bottom = this.height;\n }\n\n // Reset padding\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n call(this.options.afterSetDimensions, [this]);\n }\n\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n call(this.options[name], [this]);\n }\n\n // Data limits\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n\n //\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n /**\n\t * @return {object[]} the ticks\n\t */\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n\n beforeTickToLabelConversion() {\n call(this.options.beforeTickToLabelConversion, [this]);\n }\n /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n call(this.options.afterTickToLabelConversion, [this]);\n }\n\n //\n\n beforeCalculateLabelRotation() {\n call(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n\n // Estimate the width of each grid based on the canvas width, the maximum\n // label width and the number of tick intervals\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n // Allow 3 pixels x2 padding either side for label readability\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n call(this.options.afterCalculateLabelRotation, [this]);\n }\n afterAutoSkip() {}\n\n //\n\n beforeFit() {\n call(this.options.beforeFit, [this]);\n }\n fit() {\n // Reset\n const minSize = {\n width: 0,\n height: 0\n };\n\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight; // fill all the height\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n\n // Don't bother fitting the ticks if we are not showing the labels\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n\n this._handleMargins();\n\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n\n // Adjust padding taking into account changes in offsets\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n\n /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n\n afterFit() {\n call(this.options.afterFit, [this]);\n }\n\n // Shared Methods\n /**\n\t * @return {boolean}\n\t */\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n /**\n\t * @return {boolean}\n\t */\n isFullSize() {\n return this.options.fullSize;\n }\n\n /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n\n this.generateTickLabels(ticks);\n\n // Ticks should be skipped when callback returns null or undef, so lets remove those.\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n\n this.afterTickToLabelConversion();\n }\n\n /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n\n return labelSizes;\n }\n\n /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n for (i = 0; i < length; i += increment) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n // if it is an array let's measure each element\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = /** @type {string} */ (label[j]);\n // Undefined labels and arrays should not be measured\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n\n /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value;\n }\n\n /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n return NaN;\n }\n\n /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n\n /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n\n /**\n\t * @return {number}\n\t */\n getBaseValue() {\n const {min, max} = this;\n\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n\n /**\n\t * @protected\n\t */\n getContext(index) {\n const ticks = this.ticks || [];\n\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n\n /**\n\t * @return {number}\n\t * @private\n\t */\n _tickSize() {\n const optionTicks = this.options.ticks;\n\n // Calculate space needed by label in axis direction.\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n // Calculate space needed for 1 tick in axis direction.\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n\n /**\n\t * @return {boolean}\n\t * @private\n\t */\n _isVisible() {\n const display = this.options.display;\n\n if (display !== 'auto') {\n return !!display;\n }\n\n return this.getMatchingVisibleMetas().length > 0;\n }\n\n /**\n\t * @private\n\t */\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position, border} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n lineValue = getPixelForGridLine(this, i, offset);\n\n // Skip if the pixel is out of the range\n if (lineValue === undefined) {\n continue;\n }\n\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n\n return items;\n }\n\n /**\n\t * @private\n\t */\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n\n if (isHorizontal) {\n x = pixel;\n\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += (lineHeight / 2) * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n\n let backdrop;\n\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n default:\n break;\n }\n\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n case 'inner':\n if (i === ilen - 1) {\n left -= width;\n } else if (i > 0) {\n left -= width / 2;\n }\n break;\n default:\n break;\n }\n\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n\n color: optsAtIndex.backdropColor,\n };\n }\n\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n }\n });\n }\n\n return items;\n }\n\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n\n let align = 'center';\n\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n\n return align;\n }\n\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n\n let textAlign;\n let x;\n\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n\n return {textAlign, x};\n }\n\n /**\n\t * @private\n\t */\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n\n const chart = this.chart;\n const position = this.options.position;\n\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n\n /**\n * @protected\n */\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {\n const {chart, ctx, options: {border, grid}} = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n\n if (!optionTicks.display) {\n return;\n }\n\n const ctx = this.ctx;\n\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n\n const items = this.getLabelItems(chartArea);\n for (const item of items) {\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n\n if (area) {\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n\n if (!title.display) {\n return;\n }\n\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n\n /**\n\t * @return {object[]}\n\t * @private\n\t */\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n // backward compatibility: draw has been overridden by custom scale\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: bz,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n\n /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n\n /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n\n /**\n * @protected\n */\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n","import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n\n /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n\n if (isIChartComponent(proto)) {\n // Make sure the parent is registered and note the scope where its defaults are.\n parentScope = this.register(proto);\n }\n\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n\n if (id in items) {\n // already registered\n return scope;\n }\n\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n\n return scope;\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n get(id) {\n return this.items[id];\n }\n\n /**\n\t * @param {IChartComponent} item\n\t */\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n\n if (id in items) {\n delete items[id];\n }\n\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n // Inherit the parent's defaults and keep existing defaults\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n\n defaults.set(scope, itemDefaults);\n\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\n\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\n\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n","import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n // Order is important, Scale has Element in prototype chain,\n // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n\n /**\n\t * @param {...any} args\n\t */\n add(...args) {\n this._each('register', args);\n }\n\n remove(...args) {\n this._each('unregister', args);\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n\n /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n\n /**\n\t * @param {...typeof DatasetController} args\n\t */\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n\n /**\n\t * @param {...typeof Element} args\n\t */\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n\n /**\n\t * @param {...any} args\n\t */\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n\n /**\n\t * @param {...typeof Scale} args\n\t */\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n\n /**\n\t * @private\n\t */\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n // Handle loopable args\n // Use case:\n // import * as plugins from './plugins.js';\n // Chart.register(plugins);\n each(arg, item => {\n // If there are mixed types in the loopable, make sure those are\n // registered in correct registry\n // Use case: (treemap exporting controller, elements etc)\n // import * as treemap from 'chartjs-chart-treemap.js';\n // Chart.register(treemap);\n\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n\n /**\n\t * @private\n\t */\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n registry[method](component);\n call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n }\n\n /**\n\t * @private\n\t */\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n // plugins is the fallback registry\n return this.plugins;\n }\n\n /**\n\t * @private\n\t */\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n","import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n constructor() {\n this._init = [];\n }\n\n /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n\n /**\n\t * @private\n\t */\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callCallback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n\n return true;\n }\n\n invalidate() {\n // When plugins are registered, there is the possibility of a double\n // invalidate situation. In this case, we only want to invalidate once.\n // If we invalidate multiple times, the `_oldCache` is lost and all of the\n // plugins are restarted without being correctly stopped.\n // See https://github.com/chartjs/Chart.js/issues/8147\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n\n const descriptors = this._cache = this._createDescriptors(chart);\n\n this._notifyStateChanges(chart);\n\n return descriptors;\n }\n\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n // options === false => all plugins are disabled\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n\n /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n\n return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n const result = [];\n const context = chart.getContext();\n\n for (const plugin of plugins) {\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n });\n }\n\n return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n // make sure plugin defaults are in scopes for local (not registered) plugins\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [''], {\n // These are just defaults that plugins can override\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n","import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\n\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions) {\n const axis = opts.axis\n || axisFromPosition(opts.position)\n || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {axis};\n }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n\n // First figure out first scale id's per axis.\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n\n // Then merge dataset defaults to scale configs\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n\n // apply scale defaults, if not overridden by dataset defaults\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n\n return scales;\n}\n\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\n\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n\n initOptions(config);\n\n return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\n\nexport default class Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n\n get platform() {\n return this._config.platform;\n }\n\n get type() {\n return this._config.type;\n }\n\n set type(type) {\n this._config.type = type;\n }\n\n get data() {\n return this._config.data;\n }\n\n set data(data) {\n this._config.data = initData(data);\n }\n\n get options() {\n return this._config.options;\n }\n\n set options(options) {\n this._config.options = options;\n }\n\n get plugins() {\n return this._config.plugins;\n }\n\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n\n /**\n * Returns the option scope keys for resolving dataset options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @return {string[][]}\n */\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the option scope keys for resolving dataset animation options.\n * These keys do not include the dataset itself, because it is not under options.\n * @param {string} datasetType\n * @param {string} transition\n * @return {string[][]}\n */\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n // The following are used for looking up the `animations` and `animation` keys\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n\n /**\n * Returns the options scope keys for resolving element options that belong\n * to an dataset. These keys do not include the dataset itself, because it\n * is not under options.\n * @param {string} datasetType\n * @param {string} elementType\n * @return {string[][]}\n */\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n\n /**\n * Returns the options scope keys for resolving plugin options.\n * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n * @return {string[][]}\n */\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n\n /**\n * @private\n */\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n\n /**\n * Resolves the objects from options and defaults for option value resolution.\n * @param {object} mainScope - The main scope object for options\n * @param {string[][]} keyLists - The arrays of keys in resolution order\n * @param {boolean} [resetCache] - reset the cache for this mainScope\n */\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n\n const scopes = new Set();\n\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n\n /**\n * Returns the option scopes for resolving chart options\n * @return {object[]}\n */\n chartOptionScopes() {\n const {options, type} = this;\n\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n {type},\n defaults,\n descriptors\n ];\n }\n\n /**\n * @param {object[]} scopes\n * @param {string[]} names\n * @param {function|object} context\n * @param {string[]} [prefixes]\n * @return {object}\n */\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n // subResolver is passed to scriptable options. It should not resolve to hover options.\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n\n /**\n * @param {object[]} scopes\n * @param {object} [context]\n * @param {string[]} [prefixes]\n * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n */\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\n\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));\n\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n","import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\n\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n\n chart.notifyPlugins('afterRender');\n callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n const {xScale, yScale} = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\n\nclass Chart {\n\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n\n // eslint-disable-next-line max-statements\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n );\n }\n\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n // Store the previously used aspect ratio to determine if a resize\n // is needed during updates. Do this after _options is set since\n // aspectRatio uses a getter\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n /** @type {?{attach?: function, detach?: function, resize?: function}} */\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n\n // Add the chart instance to the global namespace\n instances[this.id] = this;\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n // If aspectRatio is defined in options, use that.\n return aspectRatio;\n }\n\n if (maintainAspectRatio && _aspectRatio) {\n // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n return _aspectRatio;\n }\n\n // Calculate\n return height ? width / height : null;\n }\n\n get data() {\n return this.config.data;\n }\n\n set data(data) {\n this.config.data = data;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options) {\n this.config.options = options;\n }\n\n get registry() {\n return registry;\n }\n\n /**\n\t * @private\n\t */\n _initialize() {\n // Before init plugin notification\n this.notifyPlugins('beforeInit');\n\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n\n this.bindEvents();\n\n // After init plugin notification\n this.notifyPlugins('afterInit');\n\n return this;\n }\n\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n\n stop() {\n animator.stop(this);\n return this;\n }\n\n /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n\n this.notifyPlugins('resize', {size: newSize});\n\n callCallback(options.onResize, [this, newSize], this);\n\n if (this.attached) {\n if (this._doResize(mode)) {\n // The resize update is delayed, only draw without updating.\n this.render();\n }\n }\n }\n\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n\n /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n\n scale.init(scaleOptions, options);\n });\n // clear up discarded scales\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n\n /**\n\t * @private\n\t */\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n\n /**\n\t * @private\n\t */\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n\n this._removeUnreferencedMetasets();\n\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n\n this._updateMetasets();\n return newControllers;\n }\n\n /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n\n /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n\n update(mode) {\n const config = this.config;\n\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n\n // plugins options references might have change, let's invalidate the cache\n // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n this._plugins.invalidate();\n\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n // Make sure dataset controllers are updated and new controllers are reset\n const newControllers = this.buildOrUpdateControllers();\n\n this.notifyPlugins('beforeElementsUpdate');\n\n // Make sure all dataset controllers have correct meta data counts\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n // New controllers will be reset after the layout pass, so we only want to modify\n // elements added to new datasets\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n\n // Only reset the controllers if we have animations\n if (!animsDisabled) {\n // Can only reset the new controllers after the scales have been updated\n // Reset is done to get the starting point for the initial animation\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n\n this._updateDatasets(mode);\n\n // Do this before render so that any plugins that need final scale updates can use it\n this.notifyPlugins('afterUpdate', {mode});\n\n this._layers.sort(compare2Level('z', '_idx'));\n\n // Replay last event from before update, or set hover styles on active elements\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n\n this.render();\n }\n\n /**\n * @private\n */\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n\n /**\n * @private\n */\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n // The configured events have changed. Rebind.\n this.unbindEvents();\n this.bindEvents();\n }\n }\n\n /**\n * @private\n */\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n\n /**\n * @private\n */\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n\n /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n\n layouts.update(this, this.width, this.height, minPadding);\n\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n return;\n }\n\n // configure is called twice, once in core.scale.update and once here.\n // Here the boxes are fully updated and at their final positions.\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n\n this.notifyPlugins('afterLayout');\n }\n\n /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n\n /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n\n meta.controller._update(mode);\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n // Unset pending resize request now to avoid possible recursion within _resize\n this._resizeBeforeDraw = null;\n this._resize(width, height);\n }\n this.clear();\n\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n\n // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n // currently be part of layers. Instead, we draw\n // layers <= 0 before(default, backward compat), and the rest after\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this._drawDatasets();\n\n // Rest of layers\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n\n this.notifyPlugins('afterDraw');\n }\n\n /**\n\t * @private\n\t */\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n\n return result;\n }\n\n /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n\n /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n\n this.notifyPlugins('afterDatasetsDraw');\n }\n\n /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n\n meta.controller.draw();\n\n if (useClip) {\n unclipArea(ctx);\n }\n\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n\n /**\n * Checks whether the given point is in the chart area.\n * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n * @returns {boolean}\n */\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n\n return [];\n }\n\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n\n return meta;\n }\n\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n\n const meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n\n /**\n\t * @private\n\t */\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n\n /**\n\t * @private\n\t */\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n\n this._stop();\n this.config.clearCache();\n\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n\n delete instances[this.id];\n\n this.notifyPlugins('afterDestroy');\n }\n\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n\n /**\n\t * @private\n\t */\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n\n /**\n * @private\n */\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n\n each(this.options.events, (type) => _add(type, listener));\n }\n\n /**\n * @private\n */\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n\n let detached; // eslint-disable-line prefer-const\n const attached = () => {\n _remove('attach', attached);\n\n this.attached = true;\n this.resize();\n\n _add('resize', listener);\n _add('detach', detached);\n };\n\n detached = () => {\n this.attached = false;\n\n _remove('resize', listener);\n\n // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n this._stop();\n this._resize(0, 0);\n\n _add('attach', attached);\n };\n\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n\n /**\n\t * @private\n\t */\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n\n /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n\n if (changed) {\n this._active = active;\n // Make sure we don't use the previous mouse event to override the active elements in update.\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n\n /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n\n /**\n * Check if a plugin with the specific ID is registered and enabled\n * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n * @returns {boolean}\n */\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n }\n\n /**\n\t * @private\n\t */\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n\n /**\n\t * @private\n\t */\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n\n const changed = this._handleEvent(e, replay, args.inChartArea);\n\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n\n if (changed || args.changed) {\n this.render();\n }\n\n return this;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n\n // If the event is replayed from `update`, we should evaluate with the final positions.\n //\n // The `replay`:\n // It's the last event (excluding click) that has occurred before `update`.\n // So mouse has not moved. It's also over the chart, because there is a `replay`.\n //\n // The why:\n // If animations are active, the elements haven't moved yet compared to state before update.\n // But if they will, we are activating the elements that would be active, if this check\n // was done after the animations have completed. => \"final positions\".\n // If there is no animations, the \"final\" and \"current\" positions are equal.\n // This is done so we do not have to evaluate the active elements each animation frame\n // - it would be expensive.\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n if (inChartArea) {\n // Set _lastEvent to null while we are processing the event handlers.\n // This prevents recursion if the handler calls chart.update()\n this._lastEvent = null;\n\n // Invoke onHover hook\n callCallback(options.onHover, [e, active, this], this);\n\n if (isClick) {\n callCallback(options.onClick, [e, active, this], this);\n }\n }\n\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n\n this._lastEvent = lastEvent;\n\n return changed;\n }\n\n /**\n * @param {ChartEvent} e - The event\n * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n * @param {boolean} inChartArea - Is the event inside chartArea\n * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n * @pravate\n */\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n return lastActive;\n }\n\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n","/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter<T extends AnyObject = AnyObject> {\n readonly options: T;\n /**\n * Will called with chart options after adapter creation.\n */\n init(this: DateAdapter<T>, chartOptions: ChartOptions): void;\n /**\n * Returns a map of time formats for the supported formatting units defined\n * in Unit as well as 'datetime' representing a detailed date/time string.\n */\n formats(this: DateAdapter<T>): Record<string, string>;\n /**\n * Parses the given `value` and return the associated timestamp.\n * @param value - the value to parse (usually comes from the data)\n * @param [format] - the expected data format\n */\n parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null;\n /**\n * Returns the formatted date in the specified `format` for a given `timestamp`.\n * @param timestamp - the timestamp to format\n * @param format - the date/time token\n */\n format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string;\n /**\n * Adds the specified `amount` of `unit` to the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param amount - the amount to add\n * @param unit - the unit as string\n */\n add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number;\n /**\n * Returns the number of `unit` between the given timestamps.\n * @param a - the input timestamp (reference)\n * @param b - the timestamp to subtract\n * @param unit - the unit as string\n */\n diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number;\n /**\n * Returns start of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n * @param [weekday] - the ISO day of the week with 1 being Monday\n * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n */\n startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n /**\n * Returns end of `unit` for the given `timestamp`.\n * @param timestamp - the input timestamp\n * @param unit - the unit as string\n */\n endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract<T = void>(): T {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */\n static override<T extends AnyObject = AnyObject>(\n members: Partial<Omit<DateAdapter<T>, 'options'>>\n ) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n\n readonly options: AnyObject;\n\n constructor(options: AnyObject) {\n this.options = options || {};\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n\n formats(): Record<string, string> {\n return abstract();\n }\n\n parse(): number | null {\n return abstract();\n }\n\n format(): string {\n return abstract();\n }\n\n add(): number {\n return abstract();\n }\n\n diff(): number {\n return abstract();\n }\n\n startOf(): number {\n return abstract();\n }\n\n endOf(): number {\n return abstract();\n }\n}\n\nexport default {\n _date: DateAdapterBase\n};\n","import DatasetController from '../core/core.datasetController.js';\nimport {\n _arrayUnique, isArray, isNullOrUndef,\n valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n // Ignore truncated pixels\n return;\n }\n if (defined(prev)) {\n // curr - prev === 0 is ignored\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n\n return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n // When bar thickness is enforced, category and bar percentages are ignored.\n // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n // and deprecate barPercentage since this value is ignored when thickness is absolute.\n size = thickness * stackCount;\n ratio = 1;\n }\n\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n\n if (prev === null) {\n // first data: its size is double based on the next point or,\n // if it's also the last data, we use the scale size.\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n\n if (next === null) {\n // last data: its size is also double based on the previous point.\n next = curr + curr - prev;\n }\n\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n\n // Store `barEnd` (furthest away from origin) as parsed value,\n // to make stacking straight forward\n item[vScale.axis] = barEnd;\n\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\n\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n\n if (edge === true) {\n properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n return;\n }\n\n const {start, end, reverse, top, bottom} = borderProps(properties);\n\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\n\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n };\n\n\n /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n\n /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n // float bar: only one end of the bar is considered by `super`\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n\n /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n getMaxOverflow() {\n return 0;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n\n initialize() {\n this.enableOptionSharing = true;\n\n super.initialize();\n\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n\n /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n _getStacks(last, dataIndex) {\n const {iScale} = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type)\n .filter(meta => meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const currentParsed = this._cachedMeta.controller.getParsed(dataIndex);\n const iScaleValue = currentParsed && currentParsed[iScale.axis];\n\n const skipNull = (meta) => {\n const parsed = meta._parsed.find(item => item[iScale.axis] === iScaleValue);\n const val = parsed && parsed[meta.vScale.axis];\n\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n\n for (const meta of metasets) {\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n\n // stacked | meta.stack\n // | found | not found | undefined\n // false | x | x | x\n // true | | x |\n // undefined | | x | x\n if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n\n // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n // stack where possible invisible bars will be located.\n // https://github.com/chartjs/Chart.js/issues/6368\n if (!stacks.length) {\n stacks.push(undefined);\n }\n\n return stacks;\n }\n\n /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n\n /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1; // indexOf returns -1 if element is not present\n\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n\n /**\n\t * @private\n\t */\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n // bar thickness ratio used for non-grouped bars\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n\n /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n\n if (length !== value) {\n start = length - value;\n length = value;\n }\n\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n // bars crossing origin are not stacked\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n // When not visible, no height\n head = base;\n }\n\n size = head - base;\n\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n\n if (_stacked && !floating) {\n // visual data coordinates after applying minBarLength\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n\n /**\n\t * @private\n\t */\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n // For non-grouped bar charts, exact pixel values are used\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) {\n rects[i].draw(this._ctx);\n }\n }\n }\n\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n static id = 'doughnut';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n // The percentage of the chart that we cut out of the middle.\n cutout: '50%',\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%',\n\n // Spacing between arcs\n spacing: 0,\n\n indexAxis: 'r',\n };\n\n static descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n // Need to override these to give a nice default\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n\n linkScales() {}\n\n /**\n\t * Override data parsing, since we are not using scales\n\t */\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n\n /**\n\t * @private\n\t */\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n\n /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n\n /**\n\t * @param {string} mode\n\t */\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n\n // Compute the maximal rotation & circumference limits.\n // If we only consider our dataset, this can cause problems when two datasets\n // are both less than a circle with different rotations (starting angles)\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n\n meta.total = this.calculateTotal();\n\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @private\n */\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n\n return total;\n }\n\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n\n if (!arcs) {\n // Find the outmost visible dataset\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n\n if (!arcs) {\n return 0;\n }\n\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n\n getMaxOffset(arcs) {\n let max = 0;\n\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n\n /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n\n return ringWeightOffset;\n }\n\n /**\n\t * @private\n\t */\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n\n /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n static id = 'polarArea';\n\n /**\n * @type {any}\n */\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle, color}} = chart.legend.options;\n\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n return {\n label: labels[index] || '',\n value,\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const arcs = this._cachedMeta.data;\n\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n\n /**\n * @protected\n */\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n meta.data.forEach((element, index) => {\n const parsed = this.getParsed(index).r;\n\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n\n return range;\n }\n\n /**\n\t * @private\n\t */\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n\n const defaultAngle = 360 / this.countVisibleElements();\n\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n\n this.updateElement(arc, i, properties, mode);\n }\n }\n\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n\n meta.data.forEach((element, index) => {\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n\n return count;\n }\n\n /**\n\t * @private\n\t */\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n static id = 'bubble';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n\n /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n\n /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * Parse array of objects\n\t * @protected\n\t */\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n\n update(mode) {\n const points = this._cachedMeta.data;\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n if (reset) {\n properties.options.radius = 0;\n }\n }\n\n this.updateElement(point, i, properties, mode);\n }\n }\n\n /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n\n // In case values were cached (and thus frozen), we need to clone the values\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n\n // Custom radius resolution\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n return values;\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n\n showLine: true,\n spanGaps: false,\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n };\n\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = 0; i < pointsCount; ++i) {\n const point = points[i];\n const properties = directUpdate ? point : {};\n\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n","import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n static id = 'pie';\n\n /**\n * @type {any}\n */\n static defaults = {\n // The percentage of the chart that we cut out of the middle.\n cutout: 0,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: 0,\n\n // The total circumference of the chart.\n circumference: 360,\n\n // The outer radius of the chart\n radius: '100%'\n };\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n static id = 'radar';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n aspectRatio: 1,\n\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n\n // Update Line\n line.points = points;\n // In resize mode only point locations change, so no need to set the points or options.\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n\n this.updateElement(line, undefined, properties, mode);\n }\n\n // Update Points\n this.updateElements(points, 0, points.length, mode);\n }\n\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n","import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n static id = 'scatter';\n\n /**\n * @type {any}\n */\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n\n /**\n * @type {any}\n */\n static overrides = {\n\n interaction: {\n mode: 'point'\n },\n\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n\n /**\n\t * @protected\n\t */\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n\n update(mode) {\n const meta = this._cachedMeta;\n const {data: points = []} = meta;\n // @ts-ignore\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n this._drawStart = start;\n this._drawCount = count;\n\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n\n if (this.options.showLine) {\n\n // https://github.com/chartjs/Chart.js/issues/11333\n if (!this.datasetElementType) {\n this.addElements();\n }\n const {dataset: line, _dataset} = meta;\n\n // Update Line\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n // https://github.com/chartjs/Chart.js/issues/11333\n delete meta.dataset;\n this.datasetElementType = false;\n }\n\n // Update Points\n this.updateElements(points, start, count, mode);\n }\n\n addElements() {\n const {showLine} = this.options;\n\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n\n super.addElements();\n }\n\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n\n prevParsed = parsed;\n }\n\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n\n /**\n\t * @protected\n\t */\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n\n if (!this.options.showLine) {\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n\n if (!data.length) {\n return border;\n }\n\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n","import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */\nfunction pathArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n end: number,\n circular: boolean,\n) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n let spacingOffset = 0;\n const alpha = end - start;\n\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n ctx.beginPath();\n\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n\n ctx.closePath();\n}\n\nfunction drawArc(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\n\nfunction drawBorder(\n ctx: CanvasRenderingContext2D,\n element: ArcElement,\n offset: number,\n spacing: number,\n circular: boolean,\n) {\n const {fullCircles, startAngle, circumference, options} = element;\n const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n const inner = options.borderAlign === 'inner';\n\n if (!borderWidth) {\n return;\n }\n\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\n\nexport interface ArcProps extends Point {\n startAngle: number;\n endAngle: number;\n innerRadius: number;\n outerRadius: number;\n circumference: number;\n}\n\nexport default class ArcElement extends Element<ArcProps, ArcOptions> {\n\n static id = 'arc';\n\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true,\n };\n\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash'\n };\n\n circumference: number;\n endAngle: number;\n fullCircles: number;\n innerRadius: number;\n outerRadius: number;\n pixelMargin: number;\n startAngle: number;\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle;\n const betweenAngles = _circumference >= TAU || nonZeroBetween;\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n return (betweenAngles && withinRadius);\n }\n\n getCenterPoint(useFinalPosition: boolean) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n\n tooltipPosition(useFinalPosition: boolean) {\n return this.getCenterPoint(useFinalPosition);\n }\n\n draw(ctx: CanvasRenderingContext2D) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n\n ctx.save();\n\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n ctx.restore();\n }\n}\n","import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n\n return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n // eslint-disable-next-line prefer-const\n let {move = true, reverse} = params || {};\n let i, point, prev;\n\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n prev = point;\n }\n\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n\n return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n // Draw line to maxY and minY, using the average x-coordinate\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n // Line to y-value of last point in group. So the line continues\n // from correct position. Not using move, to have solid path.\n ctx.lineTo(avgX, lastY);\n }\n };\n\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n\n if (point.skip) {\n // If there is a skipped point inside a segment, spanGaps must be true\n continue;\n }\n\n const x = point.x;\n const y = point.y;\n const truncX = x | 0; // truncated x-coordinate\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n // Draw line to next x-position, using the first (or only)\n // y-value in that group\n ctx.lineTo(x, y);\n\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n // Keep track of the last y-value in group\n lastY = y;\n }\n drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n\n return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\n\nexport default class LineElement extends Element {\n\n static id = 'line';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n\n static descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n };\n\n\n constructor(cfg) {\n super();\n\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n\n get points() {\n return this._points;\n }\n\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n\n /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n\n /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n\n /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n\n if (!segments.length) {\n return;\n }\n\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n\n /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n\n /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n\n start = start || 0;\n count = count || (this.points.length - start);\n\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n\n /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n\n if (points.length && options.borderWidth) {\n ctx.save();\n\n draw(ctx, this, start, count);\n\n ctx.restore();\n }\n\n if (this.animated) {\n // When line is animated, the control points and path are not cached.\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n","import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n CartesianParsedData,\n ChartArea,\n Point,\n PointHoverOptions,\n PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> {\n\n static id = 'point';\n\n parsed: CartesianParsedData;\n skip?: boolean;\n stop?: boolean;\n\n /**\n * @type {any}\n */\n static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n\n inXRange(mouseX: number, useFinalPosition?: boolean) {\n return inRange(this, mouseX, 'x', useFinalPosition);\n }\n\n inYRange(mouseY: number, useFinalPosition?: boolean) {\n return inRange(this, mouseY, 'y', useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition?: boolean) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n\n size(options?: Partial<PointOptions & PointHoverOptions>) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n\n draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n const options = this.options;\n\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n","import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n let left, right, top, bottom, half;\n\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n\n return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n\n // If the value is an object, assume the user knows what they are doing\n // and apply as directed.\n const enableBorder = enableBorderRadius || isObject(value);\n\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\n\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\n\nexport default class BarElement extends Element {\n\n static id = 'bar';\n\n /**\n * @type {any}\n */\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n\n /**\n * @type {any}\n */\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n\n constructor(cfg) {\n super();\n\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n ctx.save();\n\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n\n ctx.restore();\n }\n\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n","import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n static id = 'category';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n\n // If we are viewing some subset of labels, slice the original array\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n super.configure();\n\n if (!this.isHorizontal()) {\n // For backward compatibility, vertical category scale reverse is inverted.\n this._reversePixels = !this._reversePixels;\n }\n }\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n // Must override base implementation because it calls getPixelForValue\n // and category scale can have duplicate values\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n\n getBasePixel() {\n return this.bottom;\n }\n}\n","import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n * if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n * Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n * spacing = (max - min) / count\n * Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n * spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n const ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n\n // Beyond MIN_SPACING floating point numbers being to lose precision\n // such that we can't do the math necessary to generate ticks\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n\n if (!isNullOrUndef(precision)) {\n // If the user specified a precision, round to that number of decimal places\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n // spacing = step;\n // numSpaces = (max - min) / spacing;\n // Note that we round here to handle the case where almostWhole translated an FP error\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n // Sometimes these are no-ops, but it makes the code a lot clearer\n // and when a user defined range is specified, we want the correct ticks\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n // Case 4\n numSpaces = (niceMax - niceMin) / spacing;\n\n // If very close to our rounded value, use it.\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n\n // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n // until this point\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n\n if (niceMin < min) {\n j++; // Skip niceMin\n }\n // If the next nice tick is close to min, skip it\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n\n for (; j < numSpaces; ++j) {\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({value: tickValue});\n }\n\n if (maxDefined && includeBounds && niceMax !== max) {\n // If the previous tick is too close to max, replace it with max, else add max\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n\n return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n /** @type {number} */\n this._endValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n\n return +raw;\n }\n\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n setMax(max + offset);\n\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n\n getTickLimit() {\n const tickOpts = this.options.ticks;\n // eslint-disable-next-line prefer-const\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n\n return maxTicks;\n }\n\n /**\n\t * @protected\n\t */\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n\n super.configure();\n\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n","import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n static id = 'linear';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? min : 0;\n this.max = isFinite(max) ? max : 1;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n\n // Utils\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n","import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\n\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while (steps(min, max, rangeExp) > 10) {\n rangeExp++;\n }\n while (steps(min, max, rangeExp) < 10) {\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while (value < max) {\n ticks.push({value, major: isMajor(value), significand});\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n static id = 'logarithmic';\n\n /**\n * @type {any}\n */\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.start = undefined;\n /** @type {number} */\n this.end = undefined;\n /** @type {number} */\n this._startValue = undefined;\n this._valueRange = 0;\n }\n\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isFinite(value) && value > 0 ? value : null;\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n\n this.min = isFinite(min) ? Math.max(0, min) : null;\n this.max = isFinite(max) ? Math.max(0, max) : null;\n\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n\n // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n\n this.handleTickRangeOptions();\n }\n\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n\n if (min === max) {\n if (min <= 0) { // includes null\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n\n setMax(changeExponent(min, +1));\n }\n\n this.min = min;\n this.max = max;\n }\n\n buildTicks() {\n const opts = this.options;\n\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n\n // At this point, we need to update our max and min given the tick values,\n // since we probably have expanded the range of the scale\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n\n if (opts.reverse) {\n ticks.reverse();\n\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n\n return ticks;\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n\n /**\n\t * @protected\n\t */\n configure() {\n const start = this.min;\n\n super.configure();\n\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n","import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size\n };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n // Right, this is really confusing and there is a lot of maths going on here\n // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n //\n // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n //\n // Solution:\n //\n // We assume the radius of the polygon is half the size of the canvas at first\n // at each index we check if the text overlaps.\n //\n // Where it does, we store that angle and that index.\n //\n // After finding the largest index and angle we calculate how much we need to remove\n // from the shape radius to move the point inwards by that x.\n //\n // We average the left and right distances to get the maximum shape radius that can fit in the box\n // along with labels.\n //\n // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n // on each side, removing that from the size, halving it and adding the left x protrusion width.\n //\n // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n // and position it in the most space efficient manner\n //\n // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n\n // Now that text size is determined, compute the full positions\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const {extra, additionalAngle, padding, size} = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n // if to draw or overlapped\n visible: true,\n\n // Text position\n x: pointLabelPosition.x,\n y,\n\n // Text rendering data\n textAlign,\n\n // Bounding box\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\n\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const {left, top, right, bottom} = item;\n const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const {centerPointLabels, display} = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n\n for (let i = 0; i < valueCount; i++) {\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\n\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n const {left, top, right, bottom} = item;\n const {backdropColor} = opts;\n\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n\n for (let i = labelCount - 1; i >= 0; i--) {\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n // overlapping\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign} = item;\n\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n // Draw circular arcs between the points\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n // Draw straight lines connecting each index\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n\n const {color, lineWidth} = gridLineOpts;\n\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash || []);\n ctx.lineDashOffset = borderOpts.dashOffset;\n\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n static id = 'radialLinear';\n\n /**\n * @type {any}\n */\n static defaults = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n grid: {\n circular: false\n },\n\n startAngle: 0,\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n callback: Ticks.formatters.numeric\n },\n\n pointLabels: {\n backdropColor: undefined,\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPadding: 2,\n\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n font: {\n size: 10\n },\n\n // Function - Used to convert point labels\n callback(label) {\n return label;\n },\n\n // Number - Additionl padding between scale and pointLabel\n padding: 5,\n\n // Boolean - if true, center point labels to slices in polar chart\n centerPointLabels: false\n }\n };\n\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n\n constructor(cfg) {\n super(cfg);\n\n /** @type {number} */\n this.xCenter = undefined;\n /** @type {number} */\n this.yCenter = undefined;\n /** @type {number} */\n this.drawingArea = undefined;\n /** @type {string[]} */\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n\n setDimensions() {\n // Set the unconstrained dimension before label rotation\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n\n this.min = isFinite(min) && !isNaN(min) ? min : 0;\n this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n // Common base implementation to handle min, max, beginAtZero\n this.handleTickRangeOptions();\n }\n\n /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n // Point labels\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n\n fit() {\n const opts = this.options;\n\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n\n // Take into account half font size + the yPadding of the top value\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n\n /**\n\t * @protected\n\t */\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid, border} = opts;\n const labelCount = this._pointLabels.length;\n\n let i, offset, position;\n\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0 || (index === 0 && this.min < 0)) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n\n if (angleLines.display) {\n ctx.save();\n\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n\n if (!lineWidth || !color) {\n continue;\n }\n\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n\n ctx.restore();\n }\n }\n\n /**\n\t * @protected\n\t */\n drawBorder() {}\n\n /**\n\t * @protected\n\t */\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n\n if (!tickOpts.display) {\n return;\n }\n\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n this.ticks.forEach((tick, index) => {\n if ((index === 0 && this.min >= 0) && !opts.reverse) {\n return;\n }\n\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth,\n });\n });\n\n ctx.restore();\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {}\n}\n","import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object<Unit, Interval>}\n */\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n\n if (typeof parser === 'function') {\n value = parser(value);\n }\n\n // Only parse if it's not a timestamp already\n if (!isFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, /** @type {Unit} */ (parser))\n : adapter.parse(value);\n }\n\n if (value === null) {\n return null;\n }\n\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n\n return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n /** @type {Object<number,object>} */\n const map = {};\n const ilen = values.length;\n let i, value;\n\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n\n ticks.push({\n value,\n major: false\n });\n }\n\n // We set the major ticks separately from the above loop because calling startOf for every tick\n // is expensive when there is a large number of ticks\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n static id = 'time';\n\n /**\n * @type {any}\n */\n static defaults = {\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n adapters: {},\n time: {\n parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n isoWeekday: false, // override week start day\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n callback: false,\n\n major: {\n enabled: false\n }\n }\n };\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {{data: number[], labels: number[], all: number[]}} */\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n\n /** @type {Unit} */\n this._unit = 'day';\n /** @type {Unit=} */\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n /** @type {DateAdapter} */\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n adapter.init(opts);\n\n // Backward compatibility: before introducing adapter, `displayFormats` was\n // supposed to contain *all* unit/string pairs but this can't be resolved\n // when loading the scale (adapters are loaded afterward), so let's populate\n // missing formats on update\n mergeIf(time.displayFormats, adapter.formats());\n\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n\n super.init(scaleOpts);\n\n this._normalized = opts.normalized;\n }\n\n /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n parse(raw, index) { // eslint-disable-line no-unused-vars\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n // eslint-disable-next-line prefer-const\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n /**\n\t\t * @param {object} bounds\n\t\t */\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n\n // If we have user provided `min` and `max` labels / data bounds can be ignored\n if (!minDefined || !maxDefined) {\n // Labels are always considered, when user did not force bounds\n _applyBounds(this._getLabelBounds());\n\n // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n // data bounds are ignored (and don't need to be determined)\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n\n min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n\n /**\n\t * @private\n\t */\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n\n /**\n\t * @return {object[]}\n\t */\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n\n const min = this.min;\n const max = this.max;\n\n const ticks = _filterBetween(timestamps, min, max);\n\n // PRIVATE\n // determineUnitForFormatting relies on the number of ticks so we don't use it when\n // autoSkip is enabled because we don't yet know what the final number of ticks will be\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n\n if (options.reverse) {\n ticks.reverse();\n }\n\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n\n afterAutoSkip() {\n // Offsets for bar charts need to be handled with the auto skipped\n // ticks. Once ticks have been skipped, we re-compute the offsets.\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map(tick => +tick.value));\n }\n }\n\n /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n\n /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n // @ts-ignore\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n\n // For 'week' unit, handle the first day of week option\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n\n // Align first ticks on unit\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n // Prevent browser from freezing in case user options request millions of milliseconds\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n\n // @ts-ignore\n return Object.keys(ticks).sort(sorter).map(x => +x);\n }\n\n /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n\n /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n\n /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n\n if (formatter) {\n return call(formatter, [time, index, ticks], this);\n }\n\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n\n /**\n\t * @param {object[]} ticks\n\t */\n generateTickLabels(ticks) {\n let i, ilen, tick;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n\n /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n\n /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n\n // pick the longest format (milliseconds) for guesstimation\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n // subtract 1 - if offset then there's one less label than tick\n // if not offset then one half label padding is added to each end leaving room for one less label\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n\n /**\n\t * @protected\n\t */\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const metas = this.getMatchingVisibleMetas();\n\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n\n return (this._cache.data = this.normalize(timestamps));\n }\n\n /**\n\t * @protected\n\t */\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n\n /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n normalize(values) {\n // It seems to be somewhat faster to do sorting first\n return _arrayUnique(values.sort(sorter));\n }\n}\n","import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n static id = 'timeseries';\n\n /**\n * @type {any}\n */\n static defaults = TimeScale.defaults;\n\n /**\n\t * @param {object} props\n\t */\n constructor(props) {\n super(props);\n\n /** @type {object[]} */\n this._table = [];\n /** @type {number} */\n this._minPos = undefined;\n /** @type {number} */\n this._tableRange = undefined;\n }\n\n /**\n\t * @protected\n\t */\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n\n /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n\n if (items.length < 2) {\n // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n\n /**\n * Generates all timestamps defined in the data.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n * @protected\n */\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b) => a - b);\n }\n\n /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n\n if (timestamps.length) {\n return timestamps;\n }\n\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n // If combining labels and data (data might not contain all labels),\n // we need to recheck uniqueness and sort\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n\n return timestamps;\n }\n\n /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n\n /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nexport default TimeSeriesScale;\n","import {DoughnutController, PolarAreaController, defaults} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n enabled?: boolean;\n forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n backgroundColor?: unknown;\n borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)', // blue\n 'rgb(255, 99, 132)', // red\n 'rgb(255, 159, 64)', // orange\n 'rgb(255, 205, 86)', // yellow\n 'rgb(75, 192, 192)', // green\n 'rgb(153, 102, 255)', // purple\n 'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n\n return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n return i;\n}\n\nfunction getColorizer(chart: Chart) {\n let i = 0;\n\n return (dataset: ChartDataset, datasetIndex: number) => {\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\n\nfunction containsColorsDefinitions(\n descriptors: ColorsDescriptor[] | Record<string, ColorsDescriptor>\n) {\n let k: number | string;\n\n for (k in descriptors) {\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction containsColorsDefinition(\n descriptor: ColorsDescriptor\n) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nfunction containsDefaultColorsDefenitions() {\n return defaults.borderColor !== 'rgba(0,0,0,0.1)' || defaults.backgroundColor !== 'rgba(0,0,0,0.1)';\n}\n\nexport default {\n id: 'colors',\n\n defaults: {\n enabled: true,\n forceOverride: false\n } as ColorsPluginOptions,\n\n beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n if (!options.enabled) {\n return;\n }\n\n const {\n data: {datasets},\n options: chartOptions\n } = chart.config;\n const {elements} = chartOptions;\n\n const containsColorDefenition = (\n containsColorsDefinitions(datasets) ||\n containsColorsDefinition(chartOptions) ||\n (elements && containsColorsDefinitions(elements)) ||\n containsDefaultColorsDefenitions());\n\n if (!options.forceOverride && containsColorDefenition) {\n return;\n }\n\n const colorizer = getColorizer(chart);\n\n datasets.forEach(colorizer);\n }\n};\n","import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n /**\n * Implementation of the Largest Triangle Three Buckets algorithm.\n *\n * This implementation is based on the original implementation by Sveinn Steinarsson\n * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n *\n * The original implementation is MIT licensed.\n */\n const samples = options.samples || availableWidth;\n // There are less points than the threshold, returning the whole array\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n\n const decimated = [];\n\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n // Starting from offset\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n\n decimated[sampledIndex++] = data[a];\n\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n\n // Adding offset\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Adding offset\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n\n // Note that this is changed from the original algorithm which initializes these\n // values to 1. The reason for this change is that if the area is small, nextA\n // would never be set and thus a crash would occur in the next loop as `a` would become\n // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n // initializing with a negative number is the correct solution.\n maxArea = area = -1;\n\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n\n // Include the last point\n decimated[sampledIndex++] = data[endIndex];\n\n return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n\n if (truncX === prevX) {\n // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n // For first point in group, countX is `0`, so average will be `x` / 1.\n // Use point.x here because we're computing the average data `x` value\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n // Push up to 4 points, 3 for the last interval and the first point for this interval\n const lastIndex = i - 1;\n\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n // The interval is defined by 4 points: start, min, max, end.\n // The starting point is already considered at this point, so we need to determine which\n // of the other points to add. We need to sort these points to ensure the decimated data\n // is still sorted and then ensure there are no duplicates.\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n\n // lastIndex === startIndex will occur when a range has only 1 point which could\n // happen with very uneven data\n if (i > 0 && lastIndex !== startIndex) {\n // Last point in the previous interval\n decimated.push(data[lastIndex]);\n }\n\n // Start of the new interval\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n\n return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data,\n });\n }\n}\n\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n\n let start = 0;\n let count;\n\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n\n return {start, count};\n}\n\nexport default {\n id: 'decimation',\n\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n cleanDecimatedData(chart);\n return;\n }\n\n // Assume the entire chart is available to show a few more points than needed\n const availableWidth = chart.width;\n\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n // Decimation is only supported for lines that have an X indexAxis\n return;\n }\n\n if (!meta.controller.supportsDecimation) {\n // Only line datasets are supported\n return;\n }\n\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n // Only linear interpolation is supported\n return;\n }\n\n if (chart.options.parsing) {\n // Plugin only supports data that does not need parsing\n return;\n }\n\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n // No decimation is required until we are above this threshold\n cleanDecimatedDataset(dataset);\n return;\n }\n\n if (isNullOrUndef(_data)) {\n // First time we are seeing this dataset\n // We override the 'data' property with a setter that stores the\n // raw data in _data, but reads the decimated data from _decimated\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n\n // Point the chart to the decimated data\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n\n dataset._decimated = decimated;\n });\n },\n\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n","import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n\n for (const segment of segments) {\n let {start, end} = segment;\n end = _findSegmentEnd(start, end, points);\n\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n if (!target.segments) {\n // Special case for boundary not supporting `segments` (simpleArc)\n // Bounds are provided as `target` for partial circle, or undefined for full circle\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n\n // Get all segments from `target` that intersect the bounds of current segment of `line`\n const targetSegments = _boundSegments(target, bounds);\n\n for (const tgt of targetSegments) {\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n\n if (isArray(boundary)) {\n _loop = true;\n // @ts-ignore\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n","import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n /** @type {string | {value: number}} */\n const fill = parseFillOption(line);\n\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n\n let target = parseFloat(fill);\n\n if (isFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n // @ts-ignore\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n let value;\n\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n // @ts-ignore\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n","/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n // First point of an segment -> need to add another point before this,\n // from next line below.\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n // In the middle of an segment, no need to add more points.\n break;\n }\n }\n }\n points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\n","import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n","import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n const {chart, fill, line} = source;\n\n if (isFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n\n if (fill === 'shape') {\n return true;\n }\n\n const boundary = computeBoundary(source);\n\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n\n return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n const pixel = _getTargetPixel(fill, scale);\n\n if (isFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n\n return null;\n}\n\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n\n for (let i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\n","import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\n\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n\n ctx.save();\n\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {line, target, color: below, scale, property});\n\n ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n\n ctx.save();\n ctx.fillStyle = backgroundColor;\n\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n ctx.beginPath();\n\n const lineLoop = !!line.pathSegment(ctx, src);\n\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n ctx.restore();\n }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\n","/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n id: 'filler',\n\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n","import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n _isBetween,\n callback as call,\n clipArea,\n getRtlAdapter,\n overrideTextDirection,\n restoreTextDirection,\n toFont,\n toPadding,\n unclipArea,\n valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this._added = false;\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n /**\n \t\t * @private\n \t\t */\n this._hoveredItem = null;\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n\n if (this.options.reverse) {\n legendItems.reverse();\n }\n\n this.legendItems = legendItems;\n }\n\n fit() {\n const {options, ctx} = this;\n\n // The legend may not be displayed for a variety of reasons including\n // the fact that the defaults got set to `false`.\n // When the legend is not displayed, there are no guarantees that the options\n // are correctly formatted so we need to bail out as early as possible.\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n let width, height;\n\n ctx.font = labelFont.string;\n\n if (this.isHorizontal()) {\n width = this.maxWidth; // fill all the width\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight; // fill all the height\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n\n /**\n\t * @private\n\t */\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n\n return totalHeight;\n }\n\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n\n let left = 0;\n let col = 0;\n\n this.legendItems.forEach((legendItem, i) => {\n const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n // If too tall, go to new column\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n return totalWidth;\n }\n\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n\n this._draw();\n\n unclipArea(ctx);\n }\n }\n\n /**\n\t * @private\n\t */\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n\n this.drawTitle();\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n // current position\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n if (labelOpts.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n\n // Draw pointStyle as legend symbol\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n // Draw box as legend symbol\n // Adjust position when boxHeight < fontSize (want it centered)\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n ctx.beginPath();\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n\n ctx.restore();\n };\n\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n\n // Horizontal\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n\n overrideTextDirection(this.ctx, opts.textDirection);\n\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n\n rtlHelper.setWidth(this.width);\n\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n\n const realX = rtlHelper.x(x);\n\n drawLegendBox(realX, y, legendItem);\n\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n // Fill the actual label\n fillText(rtlHelper.x(x), y, legendItem);\n\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n\n /**\n\t * @protected\n\t */\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n\n if (!titleOpts.display) {\n return;\n }\n\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n\n // These defaults are used when the legend is vertical.\n // When horizontal, they are computed below.\n let left = this.left;\n let maxWidth = this.width;\n\n if (this.isHorizontal()) {\n // Move left / right so that the title is above the legend lines\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n // Move down so that the title is above the legend stack in every alignment\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n\n // Now that we know the left edge of the inner legend box, compute the correct\n // X coordinate from the title alignment\n const x = _alignStartEnd(position, left, left + maxWidth);\n\n // Canvas setup\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n\n /**\n\t * @private\n\t */\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n\n /**\n\t * @private\n\t */\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n // See if we are touching one of the dataset boxes\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n // Touching an element\n return this.legendItems[i];\n }\n }\n }\n\n return null;\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n\n // Chart event already has relative position in it\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n call(opts.onLeave, [e, previous, this], this);\n }\n\n this._hoveredItem = hoveredItem;\n\n if (hoveredItem && !sameItem) {\n call(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n call(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n }\n return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\n\nexport default {\n id: 'legend',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Legend,\n\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n\n // During the beforeUpdate step, the layout configuration needs to run\n // This ensures that if the legend position changes (via an option update)\n // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n\n // The labels need to be built after datasets are updated to ensure that colors\n // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n\n\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n\n onHover: null,\n onLeave: null,\n\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n // Below is extra data used for toggling the datasets\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n","import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n constructor(config) {\n super();\n\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n\n update(maxWidth, maxHeight) {\n const opts = this.options;\n\n this.left = 0;\n this.top = 0;\n\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n\n if (!opts.display) {\n return;\n }\n\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\n\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\n\nexport default {\n id: 'title',\n\n /**\n\t * For tests\n\t * @private\n\t */\n _element: Title,\n\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n id: 'subtitle',\n\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500 // by default greater than legend (1000) and smaller than title (2000)\n },\n\n defaultRoutes: {\n color: 'color'\n },\n\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n","import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n average(items) {\n if (!items.length) {\n return false;\n }\n\n let i, len;\n let xSet = new Set();\n let y = 0;\n let count = 0;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n xSet.add(pos.x);\n y += pos.y;\n ++count;\n }\n }\n\n // No visible items where found, return false so we don't have to divide by 0 which reduces in NaN\n if (count === 0 || xSet.size === 0) {\n return false;\n }\n\n const xAverage = [...xSet].reduce((a, b) => a + b) / xSet.size;\n\n return {\n x: xAverage,\n y: y / count\n };\n },\n\n /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x,\n y\n };\n }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n\n // Count of all lines in the body\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n // Body lines may include some extra height depending on boxHeight\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n\n // Title width\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.save();\n\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n\n // Body width\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n\n ctx.restore();\n\n // Add padding\n width += padding.width;\n\n return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n\n return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\n\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n // eslint-disable-next-line prefer-const\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n // Args are: (tooltipItems, data)\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n\n return '';\n },\n afterTitle: noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n\n let label = tooltipItem.dataset.label || '';\n\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n\n // Args are: (tooltipItems, data)\n afterBody: noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record<keyof typeof defaultCallbacks, Function>} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n\n return result;\n}\n\nexport class Tooltip extends Element {\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n static positioners = positioners;\n\n constructor(config) {\n super();\n\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n // and `labelTextColors` to create a single variable\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n\n /**\n\t * @private\n\t */\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n\n if (cached) {\n return cached;\n }\n\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n\n return animations;\n }\n\n /**\n\t * @protected\n\t */\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n\n getTitle(context, options) {\n const {callbacks} = options;\n\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n return lines;\n }\n\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n );\n }\n\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n }\n\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(\n invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n );\n }\n\n // Get the footer and beforeFooter and afterFooter lines\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n return lines;\n }\n\n /**\n\t * @private\n\t */\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n\n // Determine colors for boxes\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n\n // Left draws bottom -> top, this y1 is on the bottom\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n\n // Right draws top -> bottom, thus y1 is on the top\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n\n // Top draws left -> right, thus x1 is on the left\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n\n // Bottom draws right -> left, thus x1 is on the right\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.titleAlign, options);\n\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n }\n\n /**\n\t * @private\n\t */\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n\n // Fill the point with white so that colours merge nicely if the opacity is < 1\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n\n // Draw the point\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n // Border\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n // Normal rect\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n // Inner square\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n\n // restore fillStyle\n ctx.fillStyle = this.labelTextColors[i];\n }\n\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n // Before body lines\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n\n // Draw body lines now\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n\n lines = bodyItem.lines;\n // Draw Legend-like boxes if needed\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n // Reset for any lines that don't include colorbox\n bodyLineHeight = bodyFont.lineHeight;\n }\n\n each(bodyItem.after, fillLineOfText);\n }\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n\n // After body lines\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n }\n\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n\n footerFont = toFont(options.footerFont);\n\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n\n /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n\n /**\n * Determine if the tooltip will draw anything\n * @returns {boolean} True if the tooltip will render\n */\n _willRender() {\n return !!this.opacity;\n }\n\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n\n if (!opacity) {\n return;\n }\n\n this._updateAnimationTarget(options);\n\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n const padding = toPadding(options.padding);\n\n // Truthy/falsey value for empty tooltip\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n\n // Draw Background\n this.drawBackground(pt, ctx, tooltipSize, options);\n\n overrideTextDirection(ctx, options.textDirection);\n\n pt.y += padding.top;\n\n // Titles\n this.drawTitle(pt, ctx, options);\n\n // Body\n this.drawBody(pt, ctx, options);\n\n // Footer\n this.drawFooter(pt, ctx, options);\n\n restoreTextDirection(ctx, options.textDirection);\n\n ctx.restore();\n }\n }\n\n /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n getActiveElements() {\n return this._active || [];\n }\n\n /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n\n /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n // When there are multiple items shown, but the tooltip position is nearest mode\n // an update may need to be made because our position may have changed even though\n // the items are the same as before.\n const positionChanged = this._positionChanged(active, e);\n\n // Remember Last Actives\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n // Only handle target event on tooltip change\n if (changed) {\n this._active = active;\n\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n this.update(true, replay);\n }\n }\n\n return changed;\n }\n\n /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n\n if (e.type === 'mouseout') {\n return [];\n }\n\n if (!inChartArea) {\n // Let user control the active elements outside chartArea. Eg. using Legend.\n // But make sure that active elements are still valid.\n return lastActive.filter(i =>\n this.chart.data.datasets[i.datasetIndex] &&\n this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined\n );\n }\n\n // Find Active Elements for tooltips\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n if (options.reverse) {\n active.reverse();\n }\n\n return active;\n }\n\n /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\n\nexport default {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n\n if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n return;\n }\n\n tooltip.draw(chart.ctx);\n\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n\n afterEvent(chart, args) {\n if (chart.tooltip) {\n // If the event is replayed from `update`, we should evaluate with the final positions.\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n // notify chart about the change, so it will render\n args.changed = true;\n }\n }\n },\n\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n\n // Resolve additionally from `interaction` options and defaults.\n additionalOptionScopes: ['interaction']\n};\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\n/**\n * @namespace Chart\n */\nimport Chart from './core/core.controller.js';\n\nimport * as helpers from './helpers/index.js';\nimport _adapters from './core/core.adapters.js';\nimport Animation from './core/core.animation.js';\nimport animator from './core/core.animator.js';\nimport Animations from './core/core.animations.js';\nimport * as controllers from './controllers/index.js';\nimport DatasetController from './core/core.datasetController.js';\nimport Element from './core/core.element.js';\nimport * as elements from './elements/index.js';\nimport Interaction from './core/core.interaction.js';\nimport layouts from './core/core.layouts.js';\nimport * as platforms from './platform/index.js';\nimport * as plugins from './plugins/index.js';\nimport registry from './core/core.registry.js';\nimport Scale from './core/core.scale.js';\nimport * as scales from './scales/index.js';\nimport Ticks from './core/core.ticks.js';\n\n// Register built-ins\nChart.register(controllers, scales, elements, plugins);\n\nChart.helpers = {...helpers};\nChart._adapters = _adapters;\nChart.Animation = Animation;\nChart.Animations = Animations;\nChart.animator = animator;\nChart.controllers = registry.controllers.items;\nChart.DatasetController = DatasetController;\nChart.Element = Element;\nChart.elements = elements;\nChart.Interaction = Interaction;\nChart.layouts = layouts;\nChart.platforms = platforms;\nChart.Scale = Scale;\nChart.Ticks = Ticks;\n\n// Compatibility with ESM extensions\nObject.assign(Chart, controllers, scales, elements, plugins, platforms);\nChart.Chart = Chart;\n\nif (typeof window !== 'undefined') {\n window.Chart = Chart;\n}\n\nexport default Chart;\n\n"],"names":["noop","uid","id","isNullOrUndef","value","isArray","Array","type","Object","prototype","toString","call","slice","isObject","isNumberFinite","Number","isFinite","finiteOrDefault","defaultValue","valueOrDefault","toPercentage","dimension","endsWith","parseFloat","toDimension","callback","fn","args","thisArg","apply","each","loopable","reverse","i","len","keys","length","_elementsEqual","a0","a1","ilen","v0","v1","datasetIndex","index","clone","source","map","target","create","klen","k","isValidKey","key","indexOf","_merger","options","tval","sval","merge","sources","merger","current","mergeIf","_mergerIf","hasOwnProperty","keyResolvers","v","x","o","y","_splitKey","parts","split","tmp","part","push","resolveObjectKey","obj","resolver","_getKeyResolver","_capitalize","str","charAt","toUpperCase","defined","isFunction","setsEqual","a","b","size","item","has","_isClickEvent","e","PI","Math","TAU","PITAU","INFINITY","POSITIVE_INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","abs","niceNum","range","roundedRange","round","niceRange","pow","floor","fraction","_factorize","result","sqrt","sort","pop","isNumber","n","isNaN","almostWhole","rounded","_setMinAndMaxByKey","array","property","min","max","toRadians","degrees","toDegrees","radians","_decimalPlaces","isFiniteNumber","p","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","atan2","distance","distanceBetweenPoints","pt1","pt2","_angleDiff","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","s","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","table","cmp","mid","hi","lo","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","values","arrayEvents","listenArrayEvents","listener","_chartjs","listeners","defineProperty","configurable","enumerable","forEach","method","base","res","this","object","unlistenArrayEvents","stub","splice","_arrayUnique","items","set","Set","from","requestAnimFrame","window","requestAnimationFrame","throttled","argsToUse","ticking","debounce","delay","timeout","clearTimeout","setTimeout","_toLeftRightCenter","align","_alignStartEnd","_textX","left","right","rtl","_getStartAndCountOfVisiblePoints","meta","points","animationsDisabled","pointCount","count","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","_scaleRangesChanged","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","assign","Animator","constructor","_request","_charts","Map","_running","_lastDate","undefined","_notify","chart","anims","date","callbacks","numSteps","duration","initial","currentStep","_refresh","_update","Date","now","remaining","running","draw","_active","_total","tick","_getAnims","charts","get","complete","progress","listen","event","cb","add","reduce","acc","cur","_duration","stop","cancel","remove","delete","animator","lim","l","h","p2b","n2b","b2n","n2p","map$1","A","B","C","D","E","F","c","d","f","hex","h1","h2","eq","hexString","r","g","isShort","alpha","HUE_RE","hsl2rgbn","hsv2rgbn","hwb2rgbn","w","rgb","rgb2hsl","hueValue","calln","hsl2rgb","hue","hueParse","m","exec","p1","p2","hwb2rgb","hsv2rgb","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","names","nameParse","unpacked","tkeys","j","ok","nk","replace","parseInt","unpack","transparent","toLowerCase","RGB_RE","to","modHSL","ratio","proto","fromObject","input","functionParse","rgbParse","Color","ret","_rgb","_valid","valid","rgbString","hslString","mix","color","weight","c1","c2","w2","w1","interpolate","t","rgb1","rgb2","clearer","greyscale","val","opaquer","negate","lighten","darken","saturate","desaturate","rotate","deg","isPatternOrGradient","getHoverColor","numbers","colors","intlCache","formatNumber","num","locale","cacheKey","JSON","stringify","formatter","Intl","NumberFormat","getNumberFormat","format","formatters","numeric","tickValue","ticks","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","Ticks","overrides","descriptors","getScope","node","root","scope","Defaults","_descriptors","_appliers","animation","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","style","lineHeight","hover","hoverBackgroundColor","ctx","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","describe","override","route","name","targetScope","targetName","scopeObject","targetScopeObject","privateName","defineProperties","writable","local","appliers","defaults","_scriptable","startsWith","_indexable","_fallback","easing","loop","properties","active","resize","show","animations","visible","hide","autoPadding","padding","top","bottom","display","offset","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","title","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","_isDomSupported","document","_getParentNode","domNode","parent","parentNode","host","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","ownerDocument","defaultView","getStyle","el","getPropertyValue","positions","getPositionedStyle","styles","suffix","pos","height","useOffsetPos","shadowRoot","getRelativePosition","canvas","currentDevicePixelRatio","borderBox","boxSizing","paddings","borders","box","touches","offsetX","offsetY","rect","getBoundingClientRect","clientX","clientY","getCanvasPosition","xOffset","yOffset","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","maxWidth","maxHeight","containerSize","container","containerStyle","containerBorder","containerPadding","clientWidth","clientHeight","getContainerSize","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","supportsEventListenerOptions","passiveSupported","passive","addEventListener","removeEventListener","readUsedSize","matches","match","toFontString","_measureText","data","gc","longest","string","textWidth","measureText","_longestText","arrayOfThings","cache","garbageCollect","save","jlen","thing","nestedThing","restore","gcLen","_alignPixel","pixel","halfWidth","clearCanvas","getContext","resetTransform","clearRect","drawPoint","drawPointLegend","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","sin","cos","lineTo","SQRT1_2","fill","borderWidth","stroke","_isPointInArea","point","area","margin","clipArea","unclipArea","_steppedLineTo","previous","flip","midpoint","_bezierCurveTo","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","decorateText","line","opts","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","strokeStyle","fillStyle","decorationWidth","drawBackdrop","oldColor","fillRect","renderText","lines","strokeWidth","strokeColor","translation","textAlign","textBaseline","setRenderOpts","backdrop","strokeText","fillText","addRoundedRectPath","topLeft","bottomLeft","bottomRight","topRight","_createResolver","scopes","prefixes","rootScopes","fallback","getTarget","finalRootScopes","_resolve","Symbol","toStringTag","_cacheable","_scopes","_rootScopes","_getTarget","Proxy","deleteProperty","prop","_keys","_cached","proxy","prefix","readKey","needsSubResolver","createSubResolver","_resolveWithPrefixes","getOwnPropertyDescriptor","Reflect","getPrototypeOf","getKeysFromAllScopes","ownKeys","storage","_storage","_attachContext","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","setContext","receiver","isScriptable","getValue","Error","join","_resolveScriptable","isIndexable","arr","filter","_resolveArray","_resolveWithContext","allKeys","scriptable","indexable","_allKeys","resolve","resolveFallback","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","_parseObjectDataRadialScale","_parsing","parsed","parse","EPSILON","getPoint","skip","getValueAxis","splineCurve","firstPoint","middlePoint","afterPoint","next","d01","d12","s01","s12","fa","fb","splineCurveMonotone","valueAxis","pointsLen","deltaK","mK","pointBefore","pointCurrent","pointAfter","slopeDelta","alphaK","betaK","tauK","squaredMagnitude","monotoneAdjust","iPixel","vPixel","monotoneCompute","capControlPoint","pt","_updateBezierControlPoints","controlPoints","spanGaps","cubicInterpolationMode","prev","tension","capBezierPoints","inArea","inAreaPrev","inAreaNext","atEdge","elasticIn","elasticOut","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","_pointInLine","_steppedInterpolation","_bezierInterpolation","cp1","cp2","LINE_HEIGHT","FONT_STYLE","toLineHeight","numberOrZero","_readValueToProps","props","objProps","read","toTRBL","toTRBLCorners","toPadding","toFont","console","warn","inputs","info","cacheable","_addGrace","minmax","change","keepZero","createContext","parentContext","getRtlAdapter","rectX","setWidth","xPlus","leftForLtr","itemWidth","getRightToLeftAdapter","_itemWidth","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","propertyFn","between","compare","normalize","normalizeSegment","_boundSegment","segment","startBound","endBound","getSegment","prevValue","inside","subStart","shouldStart","shouldStop","_boundSegments","segments","sub","_computeSegments","segmentOptions","_loop","findStartAndEnd","splitByStyles","solidSegments","_fullLoop","chartContext","_chart","baseStyle","readStyle","_datasetIndex","prevStyle","addStyle","st","dir","p0","p0DataIndex","p1DataIndex","styleChanged","doSplitByStyles","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","replacer","pixelSize","fontStyle","fontFamily","binarySearch","metaset","controller","_cachedMeta","lookupMethod","_reversePixels","_sharedOptions","getRange","evaluateInteractionItems","position","handler","metasets","getSortedVisibleDatasetMetas","getIntersectItems","useFinalPosition","isPointInArea","chartArea","inRange","getNearestCartesianItems","distanceMetric","useX","useY","deltaX","deltaY","getDistanceMetricForAxis","minDistance","center","getCenterPoint","getNearestItems","startAngle","endAngle","getProps","getNearestRadialItems","getAxisItems","rangeMethod","intersectsItem","Interaction","modes","dataset","getDatasetMeta","nearest","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","setLayoutDims","layouts","params","stacks","wrap","stack","stackWeight","placed","buildStacks","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","factor","horizontal","availableWidth","availableHeight","getCombinedMax","maxPadding","updateMaxPadding","boxPadding","updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","same","other","getMargins","marginForPositions","fitBoxes","boxes","refitBoxes","refit","update","setBoxDims","placeBoxes","userPadding","addBox","_layers","z","removeBox","layoutItem","configure","minPadding","layoutBoxes","isHorizontal","wrapBoxes","centerHorizontal","centerVertical","leftAndTop","concat","rightAndBottom","vertical","buildLayoutBoxes","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","total","freeze","updatePos","handleMaxPadding","BasePlatform","acquireContext","releaseContext","isAttached","updateConfig","config","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","isNullOrEmpty","eventListenerOptions","removeListener","nodeListContains","nodeList","contains","createAttachObserver","observer","MutationObserver","entries","trigger","entry","addedNodes","removedNodes","observe","childList","subtree","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","createResizeObserver","ResizeObserver","contentRect","listenDevicePixelRatioChanges","releaseObserver","disconnect","unlistenDevicePixelRatioChanges","createProxyAndListen","native","fromNativeEvent","addListener","DomPlatform","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","initCanvas","removeAttribute","setAttribute","proxies","$proxies","attach","detach","isConnected","_detectPlatform","OffscreenCanvas","interpolators","boolean","c0","helpersColor","number","Animation","cfg","currentValue","_fn","_easing","_start","_target","_prop","_from","_to","_promises","elapsed","wait","promises","Promise","rej","resolved","Animations","_properties","animationOptions","animatedProps","getOwnPropertyNames","option","_animateOptions","newOptions","$shared","$animations","resolveTargetOptions","_createAnimations","anim","all","awaitAll","then","scaleClip","allowedOverflow","getSortedDatasetIndices","filterVisible","_getSortedDatasetMetas","applyStack","dsIndex","singleMode","otherValue","found","isStacked","stacked","getOrCreateStack","stackKey","indexValue","subStack","getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","updateStacks","_stacks","iAxis","vAxis","indexScale","valueScale","getStackKey","_top","_bottom","_visualValues","getFirstScaleId","shift","clearStacks","isDirectUpdateMode","cloneIfNotShared","cached","shared","DatasetController","static","_cachedDataOpts","getMeta","_type","_data","_objectData","_drawStart","_drawCount","enableOptionSharing","supportsDecimation","$context","_syncList","datasetElementType","dataElementType","initialize","linkScales","_stacked","addElements","isPluginEnabled","updateIndex","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","scaleID","_getOtherScale","reset","_destroy","_dataCheck","iAxisKey","vAxisKey","adata","convertObjectDataToArray","isExtensible","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","getOptionScopes","createResolver","sorted","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","updateRangeFromParsed","parsedValue","NaN","getMinMax","canStack","otherScale","hidden","createStack","NEGATIVE_INFINITY","otherMin","otherMax","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","disabled","toClip","defaultClip","resolveDatasetElementOptions","resolveDataElementOptions","dataIndex","raw","createDataContext","createDatasetContext","_resolveElementOptions","elementType","sharing","datasetElementScopeKeys","resolveNamedOptions","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","arg1","arg2","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","arguments","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","Element","tooltipPosition","hasValue","final","tickOpts","determinedMaxTicks","_tickSize","maxScale","_length","maxChart","_maxLength","determineMaxTicks","ticksLimit","maxTicksLimit","majorIndices","enabled","getMajorIndices","numMajorIndices","first","newTicks","spacing","ceil","skipMajors","evenMajorSpacing","diff","getEvenSpacing","factors","calculateSpacing","avgMajorSpacing","majorStart","majorEnd","offsetFromEdge","edge","getTicksLimit","ticksLength","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","_startPixel","_endPixel","lineValue","getPixelForTick","getTickMarkLength","getTitleHeight","titleAlign","reverseAlign","Scale","super","_margins","paddingTop","paddingBottom","paddingLeft","paddingRight","labelRotation","_range","_gridLineItems","_labelItems","_labelSizes","_longestTextCache","_userMax","_userMin","_suggestedMax","_suggestedMin","_ticksLength","_borderValue","_cache","_dataLimitsCached","init","suggestedMin","suggestedMax","metas","getTicks","xLabels","yLabels","getLabelItems","_computeLabelItems","beforeUpdate","sampleSize","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","startPixel","endPixel","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","numTicks","maxLabelDiagonal","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","asin","minSize","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","caches","widths","heights","tickFont","fontString","nestedLabel","widestLabelSize","highestLabelSize","_resolveTickFontOptions","valueAt","idx","getValueForPixel","getPixelForDecimal","decimal","getDecimalForPixel","getBasePixel","getBaseValue","createTickContext","optionTicks","rot","_computeGridLineItems","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","positionAxisID","limit","step","optsAtIndex","optsAtIndexBorder","lineColor","tickBorderDash","tickBorderDashOffset","tickAndPadding","hTickAndPadding","lineCount","textOffset","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","getLineWidthForValue","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","titleX","titleY","titleArgs","tz","gz","bz","axisID","_maxDigits","fontSize","TypedRegistry","isForType","isPrototypeOf","register","parentScope","isIChartComponent","itemDefaults","defaultRoutes","routes","propertyParts","sourceName","sourceScope","routeDefaults","registerDefaults","unregister","Registry","controllers","_typedRegistries","_each","addControllers","addPlugins","addScales","getController","_get","getElement","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","arg","reg","_getRegistryForType","_exec","itemReg","registry","component","camelMethod","PluginService","_init","notify","hook","_createDescriptors","descriptor","plugin","callCallback","cancelable","invalidate","_oldCache","_notifyStateChanges","localIds","allPlugins","getOpts","pluginOpts","createDescriptors","previousDescriptors","some","pluginScopeKeys","getIndexAxis","datasetDefaults","idMatchesAxis","determineAxis","scaleOptions","getAxisFromDataset","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","error","boundDs","retrieveAxisFromDatasets","defaultId","getDefaultScaleIDFromAxis","defaultScaleOptions","defaultID","getAxisFromDefaultScaleID","initOptions","initData","keyCache","keysCached","cachedKeys","generate","addIfFound","Config","_config","initConfig","_scopeCache","_resolverCache","clearCache","clear","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","getResolver","hasFunction","needContext","resolverCache","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onComplete","onAnimationProgress","onProgress","getCanvas","getElementById","instances","getChart","moveNumericKeys","intKey","getSizeForArea","field","Chart","invalidatePlugins","userConfig","initialCanvas","existingChart","_options","_aspectRatio","_metasets","_lastEvent","_listeners","_responsiveListeners","_sortedMetasets","_plugins","_hiddenIndices","attached","_doResize","resizeDelay","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","render","ensureScalesHaveIDs","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","hasUpdated","_updateMetasets","_destroyDatasetMeta","_removeUnreferencedMetasets","_dataset","buildOrUpdateControllers","newControllers","order","isDatasetVisible","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_minPadding","_updateLayout","_updateDatasets","_eventHandler","_updateHoverStyles","existingEvents","newEvents","unbindEvents","changes","_getUniformDataChanges","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","getDatasetArea","getElementsAtEventForMode","getVisibleDatasetCount","setDatasetVisibility","toggleDataVisibility","getDataVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","_remove","detached","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","inChartArea","eventFilter","_handleEvent","_getActiveElements","isClick","lastEvent","determineLastEvent","abstract","DateAdapterBase","members","formats","startOf","endOf","_adapters","_date","computeMinSampleSize","$bar","visibleMetas","getAllScaleValues","curr","updateMinAndPrev","parseValue","startValue","endValue","barStart","barEnd","_custom","parseFloatBar","parseArrayOrPrimitive","isFloatBar","custom","setBorderSkipped","borderSkipped","borderProps","enableBorderRadius","parseEdge","orig","v2","startEnd","setInflateAmount","inflateAmount","DoughnutController","animateRotate","animateScale","cutout","circumference","legend","generateLabels","fontColor","legendItem","innerRadius","outerRadius","getter","_getRotation","_getCircumference","_getRotationExtents","arcs","getMaxBorderWidth","getMaxOffset","maxSize","chartWeight","_getRingWeight","ratioX","ratioY","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","getRatioAndOffset","maxRadius","radiusLength","_getVisibleDatasetWeightTotal","calculateTotal","_getRingWeightOffset","_circumference","calculateCircumference","animationOpts","centerX","centerY","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","PolarAreaController","angleLines","circular","pointLabels","bind","_updateRadius","cutoutPercentage","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","categoryPercentage","barPercentage","grouped","_index_","_value_","bars","ruler","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","_getStacks","currentParsed","iScaleValue","skipNull","find","_getStackCount","_getStackIndex","pixels","barThickness","stackCount","baseValue","minBarLength","actualBase","floating","barSign","halfGrid","maxBarThickness","Infinity","percent","chunk","computeFlexCategoryTraits","thickness","computeFitCategoryTraits","stackIndex","rects","_decimated","animated","maxGapLength","directUpdate","pointsCount","prevParsed","nullData","lastPoint","updateControlPoints","pointPosition","getPointPositionForValue","parseBorderRadius","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStart","outerEnd","innerStart","innerEnd","rThetaToXY","theta","pathArc","pixelMargin","innerR","spacingOffset","avNogSpacingRadius","angleOffset","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","fullCircles","inner","lineJoin","angleMargin","clipArc","setStyle","lineCap","pathVars","paramsStart","paramsEnd","segmentStart","segmentEnd","outside","pathSegment","lineMethod","stepped","getLineMethod","fastPathSegment","prevX","lastY","avgX","countX","pointIndex","drawX","truncX","_getSegmentMethod","usePath2D","Path2D","path","_path","strokePathWithCache","segmentMethod","strokePathDirect","LineElement","_points","_segments","_pointsUpdated","_interpolate","_getInterpolationMethod","interpolated","hitRadius","getBarBounds","bar","half","skipOrLimit","boundingRects","maxW","maxH","parseBorderWidth","maxR","enableBorder","outer","skipX","skipY","addNormalRectPath","inflateRect","amount","refRect","chartX","chartY","rAdjust","nonZeroBetween","betweenAngles","withinRadius","halfAngle","halfRadius","radiusOffset","drawArc","addRectPath","mouseX","mouseY","inXRange","inYRange","hoverRadius","findOrAddLabel","addedLabels","unshift","addIfString","lastIndexOf","_getLabelForValue","relativeLabelSize","minSpacing","LinearScaleBase","_startValue","_endValue","_valueRange","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","maxTicks","stepSize","computeTickLimit","generationOptions","dataRange","precision","maxDigits","includeBounds","unit","maxSpaces","rmin","rmax","countDefined","niceMin","niceMax","numSpaces","decimalPlaces","generateTicks","LinearScale","log10Floor","changeExponent","isMajor","tickVal","steps","rangeExp","rangeStep","minExp","exp","startExp","lastTick","LogarithmicScale","_zero","getTickBackdropHeight","determineLimits","fitWithPointLabels","_padding","limits","valueCount","_pointLabels","pointLabelOpts","additionalAngle","centerPointLabels","getPointLabelContext","getPointPosition","drawingArea","plFont","textSize","updateLimits","setCenterPoint","_pointLabelItems","itemOpts","extra","createPointLabelItem","isNotOverlapped","buildPointLabelItems","hLimits","vLimits","outerDistance","pointLabelPosition","yForAngle","getTextAlignForAngle","leftForTextAlign","drawPointLabelBox","backdropLeft","backdropTop","backdropWidth","backdropHeight","pathRadiusLine","labelCount","RadialLinearScale","animate","leftMovement","rightMovement","topMovement","bottomMovement","scalingFactor","getValueForDistanceFromCenter","scaledDistance","pointLabel","createPointLabelContext","distanceFromCenter","getBasePosition","getPointLabelPosition","drawPointLabels","gridLineOpts","drawRadiusLine","INTERVALS","millisecond","common","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","adapter","_adapter","parser","isoWeekday","_parseOpts","determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","addTick","time","timestamps","ticksFromTimestamps","majorUnit","setMajorTicks","TimeScale","adapters","displayFormats","_unit","_majorUnit","_offsets","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_getLabelCapacity","determineUnitForFormatting","determineMajorUnit","initOffsets","offsetAfterAutoskip","getDecimalForValue","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","prevSource","nextSource","prevTarget","nextTarget","span","_addedLabels","added","_table","_minPos","_tableRange","_getTimestampsForTable","buildLookupTable","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","getColorizer","colorizeDoughnutDataset","colorizePolarAreaDataset","colorizeDefaultDataset","containsColorsDefinitions","plugin_colors","forceOverride","_args","chartOptions","containsColorDefenition","colorizer","cleanDecimatedDataset","cleanDecimatedData","plugin_decimation","algorithm","beforeElementsUpdate","xAxis","getStartAndCountOfVisiblePointsSimplified","threshold","decimated","samples","bucketWidth","sampledIndex","endIndex","maxAreaPoint","maxArea","nextA","avgY","avgRangeStart","avgRangeEnd","avgRangeLength","rangeOffs","rangeTo","pointAx","pointAy","lttbDecimation","minIndex","maxIndex","startIndex","xMin","dx","lastIndex","intermediateIndex1","intermediateIndex2","minMaxDecimation","_getBounds","_findSegmentEnd","_getEdge","_createBoundaryLine","boundary","linePoints","_pointsFromSegments","_shouldApplyFill","_resolveTarget","propagate","visited","_decodeFill","fillOption","parseFillOption","firstCh","decodeTargetIndex","addPointsBelow","sourcePoint","linesBelow","postponed","findPoint","pointValue","firstValue","lastValue","simpleArc","getLineByIndex","sourcePoints","below","getLinesBelow","_buildStackLine","_getTargetValue","computeCircularBoundary","_getTargetPixel","computeLinearBoundary","computeBoundary","_drawfill","lineOpts","above","clipVertical","doFill","clipY","lineLoop","tpoints","targetSegments","tgt","subBounds","fillSources","fillSource","src","notShape","clipBounds","interpolatedLineTo","targetLoop","interpolatedPoint","afterDatasetsUpdate","$filler","beforeDraw","drawTime","beforeDatasetsDraw","beforeDatasetDraw","getBoxSize","labelOpts","boxHeight","boxWidth","usePointStyle","pointStyleWidth","itemHeight","Legend","_added","legendHitBoxes","_hoveredItem","doughnutMode","legendItems","columnSizes","lineWidths","buildLabels","labelFont","_computeTitleHeight","_fitRows","_fitCols","hitboxes","totalHeight","row","_itemHeight","heightLimit","totalWidth","currentColWidth","currentColHeight","col","legendItemText","calculateItemWidth","fontLineHeight","calculateLegendItemHeight","calculateItemHeight","calculateItemSize","adjustHitBoxes","rtlHelper","hitbox","_draw","defaultColor","halfFontSize","cursor","textDirection","lineDash","drawOptions","SQRT2","yBoxTop","xBoxLeft","drawLegendBox","titleFont","titlePadding","topPaddingPlusHalfFontSize","_getLegendItemAt","hitBox","lh","handleEvent","onLeave","isListened","hoveredItem","sameItem","plugin_legend","_element","afterEvent","ci","useBorderRadius","Title","_drawArgs","fontOpts","plugin_title","titleBlock","createTitle","WeakMap","plugin_subtitle","positioners","average","xSet","eventPosition","nearestElement","tp","pushOrConcat","toPush","splitNewlines","String","createTooltipItem","formattedValue","getTooltipSize","tooltip","body","footer","bodyFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","determineXAlign","yAlign","chartWidth","xAlign","caret","caretSize","caretPadding","doesNotFitWithAlign","determineAlignment","determineYAlign","getBackgroundPoint","alignment","paddingAndSize","alignX","alignY","getAlignedX","getBeforeAfterBodyLines","overrideCallbacks","defaultCallbacks","beforeTitle","tooltipItems","afterTitle","beforeLabel","tooltipItem","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","invokeCallbackWithFallback","Tooltip","opacity","_eventPosition","_size","_cachedAnimations","_tooltipItems","dataPoints","caretX","caretY","labelColors","labelPointStyles","labelTextColors","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","itemSort","positionAndSize","backgroundPoint","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","multiKeyBackground","outerX","innerX","strokeRect","drawBody","bodyAlign","bodyLineHeight","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","positionChanged","_positionChanged","_ignoreReplayEvents","plugin_tooltip","afterInit","afterDraw","helpers","platforms"],"mappings":";;;;;;0bAUO,SAASA,IAEf,CAKM,MAAMC,EAAO,MAClB,IAAIC,EAAK,EACT,MAAO,IAAMA,GACf,EAHoB,GA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 No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs new file mode 100644 index 0000000..0bfcce3 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs @@ -0,0 +1,2875 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +'use strict'; + +var color$1 = require('@kurkle/color'); + +/** + * @namespace Chart.helpers + */ /** + * An empty function that can be used, for example, for optional callback. + */ function noop() { +/* noop */ } +/** + * Returns a unique id, sequentially generated from a global variable. + */ const uid = (()=>{ + let id = 0; + return ()=>id++; +})(); +/** + * Returns true if `value` is neither null nor undefined, else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ function isNullOrUndef(value) { + return value === null || value === undefined; +} +/** + * Returns true if `value` is an array (including typed arrays), else returns false. + * @param value - The value to test. + * @function + */ function isArray(value) { + if (Array.isArray && Array.isArray(value)) { + return true; + } + const type = Object.prototype.toString.call(value); + if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') { + return true; + } + return false; +} +/** + * Returns true if `value` is an object (excluding null), else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ function isObject(value) { + return value !== null && Object.prototype.toString.call(value) === '[object Object]'; +} +/** + * Returns true if `value` is a finite number, else returns false + * @param value - The value to test. + */ function isNumberFinite(value) { + return (typeof value === 'number' || value instanceof Number) && isFinite(+value); +} +/** + * Returns `value` if finite, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is not finite. + */ function finiteOrDefault(value, defaultValue) { + return isNumberFinite(value) ? value : defaultValue; +} +/** + * Returns `value` if defined, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is undefined. + */ function valueOrDefault(value, defaultValue) { + return typeof value === 'undefined' ? defaultValue : value; +} +const toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension; +const toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value; +/** + * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the + * value returned by `fn`. If `fn` is not a function, this method returns undefined. + * @param fn - The function to call. + * @param args - The arguments with which `fn` should be called. + * @param [thisArg] - The value of `this` provided for the call to `fn`. + */ function callback(fn, args, thisArg) { + if (fn && typeof fn.call === 'function') { + return fn.apply(thisArg, args); + } +} +function each(loopable, fn, thisArg, reverse) { + let i, len, keys; + if (isArray(loopable)) { + len = loopable.length; + if (reverse) { + for(i = len - 1; i >= 0; i--){ + fn.call(thisArg, loopable[i], i); + } + } else { + for(i = 0; i < len; i++){ + fn.call(thisArg, loopable[i], i); + } + } + } else if (isObject(loopable)) { + keys = Object.keys(loopable); + len = keys.length; + for(i = 0; i < len; i++){ + fn.call(thisArg, loopable[keys[i]], keys[i]); + } + } +} +/** + * Returns true if the `a0` and `a1` arrays have the same content, else returns false. + * @param a0 - The array to compare + * @param a1 - The array to compare + * @private + */ function _elementsEqual(a0, a1) { + let i, ilen, v0, v1; + if (!a0 || !a1 || a0.length !== a1.length) { + return false; + } + for(i = 0, ilen = a0.length; i < ilen; ++i){ + v0 = a0[i]; + v1 = a1[i]; + if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) { + return false; + } + } + return true; +} +/** + * Returns a deep copy of `source` without keeping references on objects and arrays. + * @param source - The value to clone. + */ function clone(source) { + if (isArray(source)) { + return source.map(clone); + } + if (isObject(source)) { + const target = Object.create(null); + const keys = Object.keys(source); + const klen = keys.length; + let k = 0; + for(; k < klen; ++k){ + target[keys[k]] = clone(source[keys[k]]); + } + return target; + } + return source; +} +function isValidKey(key) { + return [ + '__proto__', + 'prototype', + 'constructor' + ].indexOf(key) === -1; +} +/** + * The default merger when Chart.helpers.merge is called without merger option. + * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback. + * @private + */ function _merger(key, target, source, options) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + merge(tval, sval, options); + } else { + target[key] = clone(sval); + } +} +function merge(target, source, options) { + const sources = isArray(source) ? source : [ + source + ]; + const ilen = sources.length; + if (!isObject(target)) { + return target; + } + options = options || {}; + const merger = options.merger || _merger; + let current; + for(let i = 0; i < ilen; ++i){ + current = sources[i]; + if (!isObject(current)) { + continue; + } + const keys = Object.keys(current); + for(let k = 0, klen = keys.length; k < klen; ++k){ + merger(keys[k], target, current, options); + } + } + return target; +} +function mergeIf(target, source) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + return merge(target, source, { + merger: _mergerIf + }); +} +/** + * Merges source[key] in target[key] only if target[key] is undefined. + * @private + */ function _mergerIf(key, target, source) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + mergeIf(tval, sval); + } else if (!Object.prototype.hasOwnProperty.call(target, key)) { + target[key] = clone(sval); + } +} +/** + * @private + */ function _deprecated(scope, value, previous, current) { + if (value !== undefined) { + console.warn(scope + ': "' + previous + '" is deprecated. Please use "' + current + '" instead'); + } +} +// resolveObjectKey resolver cache +const keyResolvers = { + // Chart.helpers.core resolveObjectKey should resolve empty key to root object + '': (v)=>v, + // default resolvers + x: (o)=>o.x, + y: (o)=>o.y +}; +/** + * @private + */ function _splitKey(key) { + const parts = key.split('.'); + const keys = []; + let tmp = ''; + for (const part of parts){ + tmp += part; + if (tmp.endsWith('\\')) { + tmp = tmp.slice(0, -1) + '.'; + } else { + keys.push(tmp); + tmp = ''; + } + } + return keys; +} +function _getKeyResolver(key) { + const keys = _splitKey(key); + return (obj)=>{ + for (const k of keys){ + if (k === '') { + break; + } + obj = obj && obj[k]; + } + return obj; + }; +} +function resolveObjectKey(obj, key) { + const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key)); + return resolver(obj); +} +/** + * @private + */ function _capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +const defined = (value)=>typeof value !== 'undefined'; +const isFunction = (value)=>typeof value === 'function'; +// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384 +const setsEqual = (a, b)=>{ + if (a.size !== b.size) { + return false; + } + for (const item of a){ + if (!b.has(item)) { + return false; + } + } + return true; +}; +/** + * @param e - The event + * @private + */ function _isClickEvent(e) { + return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu'; +} + +/** + * @alias Chart.helpers.math + * @namespace + */ const PI = Math.PI; +const TAU = 2 * PI; +const PITAU = TAU + PI; +const INFINITY = Number.POSITIVE_INFINITY; +const RAD_PER_DEG = PI / 180; +const HALF_PI = PI / 2; +const QUARTER_PI = PI / 4; +const TWO_THIRDS_PI = PI * 2 / 3; +const log10 = Math.log10; +const sign = Math.sign; +function almostEquals(x, y, epsilon) { + return Math.abs(x - y) < epsilon; +} +/** + * Implementation of the nice number algorithm used in determining where axis labels will go + */ function niceNum(range) { + const roundedRange = Math.round(range); + range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range; + const niceRange = Math.pow(10, Math.floor(log10(range))); + const fraction = range / niceRange; + const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10; + return niceFraction * niceRange; +} +/** + * Returns an array of factors sorted from 1 to sqrt(value) + * @private + */ function _factorize(value) { + const result = []; + const sqrt = Math.sqrt(value); + let i; + for(i = 1; i < sqrt; i++){ + if (value % i === 0) { + result.push(i); + result.push(value / i); + } + } + if (sqrt === (sqrt | 0)) { + result.push(sqrt); + } + result.sort((a, b)=>a - b).pop(); + return result; +} +function isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +function almostWhole(x, epsilon) { + const rounded = Math.round(x); + return rounded - epsilon <= x && rounded + epsilon >= x; +} +/** + * @private + */ function _setMinAndMaxByKey(array, target, property) { + let i, ilen, value; + for(i = 0, ilen = array.length; i < ilen; i++){ + value = array[i][property]; + if (!isNaN(value)) { + target.min = Math.min(target.min, value); + target.max = Math.max(target.max, value); + } + } +} +function toRadians(degrees) { + return degrees * (PI / 180); +} +function toDegrees(radians) { + return radians * (180 / PI); +} +/** + * Returns the number of decimal places + * i.e. the number of digits after the decimal point, of the value of this Number. + * @param x - A number. + * @returns The number of decimal places. + * @private + */ function _decimalPlaces(x) { + if (!isNumberFinite(x)) { + return; + } + let e = 1; + let p = 0; + while(Math.round(x * e) / e !== x){ + e *= 10; + p++; + } + return p; +} +// Gets the angle from vertical upright to the point about a centre. +function getAngleFromPoint(centrePoint, anglePoint) { + const distanceFromXCenter = anglePoint.x - centrePoint.x; + const distanceFromYCenter = anglePoint.y - centrePoint.y; + const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter); + let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter); + if (angle < -0.5 * PI) { + angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2] + } + return { + angle, + distance: radialDistanceFromCenter + }; +} +function distanceBetweenPoints(pt1, pt2) { + return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2)); +} +/** + * Shortest distance between angles, in either direction. + * @private + */ function _angleDiff(a, b) { + return (a - b + PITAU) % TAU - PI; +} +/** + * Normalize angle to be between 0 and 2*PI + * @private + */ function _normalizeAngle(a) { + return (a % TAU + TAU) % TAU; +} +/** + * @private + */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) { + const a = _normalizeAngle(angle); + const s = _normalizeAngle(start); + const e = _normalizeAngle(end); + const angleToStart = _normalizeAngle(s - a); + const angleToEnd = _normalizeAngle(e - a); + const startToAngle = _normalizeAngle(a - s); + const endToAngle = _normalizeAngle(a - e); + return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle; +} +/** + * Limit `value` between `min` and `max` + * @param value + * @param min + * @param max + * @private + */ function _limitValue(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +/** + * @param {number} value + * @private + */ function _int16Range(value) { + return _limitValue(value, -32768, 32767); +} +/** + * @param value + * @param start + * @param end + * @param [epsilon] + * @private + */ function _isBetween(value, start, end, epsilon = 1e-6) { + return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon; +} + +function _lookup(table, value, cmp) { + cmp = cmp || ((index)=>table[index] < value); + let hi = table.length - 1; + let lo = 0; + let mid; + while(hi - lo > 1){ + mid = lo + hi >> 1; + if (cmp(mid)) { + lo = mid; + } else { + hi = mid; + } + } + return { + lo, + hi + }; +} +/** + * Binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @param last - lookup last index + * @private + */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{ + const ti = table[index][key]; + return ti < value || ti === value && table[index + 1][key] === value; + } : (index)=>table[index][key] < value); +/** + * Reverse binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @private + */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value); +/** + * Return subset of `values` between `min` and `max` inclusive. + * Values are assumed to be in sorted order. + * @param values - sorted array of values + * @param min - min value + * @param max - max value + */ function _filterBetween(values, min, max) { + let start = 0; + let end = values.length; + while(start < end && values[start] < min){ + start++; + } + while(end > start && values[end - 1] > max){ + end--; + } + return start > 0 || end < values.length ? values.slice(start, end) : values; +} +const arrayEvents = [ + 'push', + 'pop', + 'shift', + 'splice', + 'unshift' +]; +function listenArrayEvents(array, listener) { + if (array._chartjs) { + array._chartjs.listeners.push(listener); + return; + } + Object.defineProperty(array, '_chartjs', { + configurable: true, + enumerable: false, + value: { + listeners: [ + listener + ] + } + }); + arrayEvents.forEach((key)=>{ + const method = '_onData' + _capitalize(key); + const base = array[key]; + Object.defineProperty(array, key, { + configurable: true, + enumerable: false, + value (...args) { + const res = base.apply(this, args); + array._chartjs.listeners.forEach((object)=>{ + if (typeof object[method] === 'function') { + object[method](...args); + } + }); + return res; + } + }); + }); +} +function unlistenArrayEvents(array, listener) { + const stub = array._chartjs; + if (!stub) { + return; + } + const listeners = stub.listeners; + const index = listeners.indexOf(listener); + if (index !== -1) { + listeners.splice(index, 1); + } + if (listeners.length > 0) { + return; + } + arrayEvents.forEach((key)=>{ + delete array[key]; + }); + delete array._chartjs; +} +/** + * @param items + */ function _arrayUnique(items) { + const set = new Set(items); + if (set.size === items.length) { + return items; + } + return Array.from(set); +} + +function fontString(pixelSize, fontStyle, fontFamily) { + return fontStyle + ' ' + pixelSize + 'px ' + fontFamily; +} +/** +* Request animation polyfill +*/ const requestAnimFrame = function() { + if (typeof window === 'undefined') { + return function(callback) { + return callback(); + }; + } + return window.requestAnimationFrame; +}(); +/** + * Throttles calling `fn` once per animation frame + * Latest arguments are used on the actual call + */ function throttled(fn, thisArg) { + let argsToUse = []; + let ticking = false; + return function(...args) { + // Save the args for use later + argsToUse = args; + if (!ticking) { + ticking = true; + requestAnimFrame.call(window, ()=>{ + ticking = false; + fn.apply(thisArg, argsToUse); + }); + } + }; +} +/** + * Debounces calling `fn` for `delay` ms + */ function debounce(fn, delay) { + let timeout; + return function(...args) { + if (delay) { + clearTimeout(timeout); + timeout = setTimeout(fn, delay, args); + } else { + fn.apply(this, args); + } + return delay; + }; +} +/** + * Converts 'start' to 'left', 'end' to 'right' and others to 'center' + * @private + */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center'; +/** + * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center` + * @private + */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2; +/** + * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left` + * @private + */ const _textX = (align, left, right, rtl)=>{ + const check = rtl ? 'left' : 'right'; + return align === check ? right : align === 'center' ? (left + right) / 2 : left; +}; +/** + * Return start and count of visible points. + * @private + */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) { + const pointCount = points.length; + let start = 0; + let count = pointCount; + if (meta._sorted) { + const { iScale , _parsed } = meta; + const axis = iScale.axis; + const { min , max , minDefined , maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1); + } + if (maxDefined) { + count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start; + } else { + count = pointCount - start; + } + } + return { + start, + count + }; +} +/** + * Checks if the scale ranges have changed. + * @param {object} meta - dataset meta. + * @returns {boolean} + * @private + */ function _scaleRangesChanged(meta) { + const { xScale , yScale , _scaleRanges } = meta; + const newRanges = { + xmin: xScale.min, + xmax: xScale.max, + ymin: yScale.min, + ymax: yScale.max + }; + if (!_scaleRanges) { + meta._scaleRanges = newRanges; + return true; + } + const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max; + Object.assign(_scaleRanges, newRanges); + return changed; +} + +const atEdge = (t)=>t === 0 || t === 1; +const elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p)); +const elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1; +/** + * Easing functions adapted from Robert Penner's easing equations. + * @namespace Chart.helpers.easing.effects + * @see http://www.robertpenner.com/easing/ + */ const effects = { + linear: (t)=>t, + easeInQuad: (t)=>t * t, + easeOutQuad: (t)=>-t * (t - 2), + easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1), + easeInCubic: (t)=>t * t * t, + easeOutCubic: (t)=>(t -= 1) * t * t + 1, + easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2), + easeInQuart: (t)=>t * t * t * t, + easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1), + easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2), + easeInQuint: (t)=>t * t * t * t * t, + easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1, + easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2), + easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1, + easeOutSine: (t)=>Math.sin(t * HALF_PI), + easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1), + easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)), + easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1, + easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2), + easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1), + easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t), + easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1), + easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3), + easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3), + easeInOutElastic (t) { + const s = 0.1125; + const p = 0.45; + return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p); + }, + easeInBack (t) { + const s = 1.70158; + return t * t * ((s + 1) * t - s); + }, + easeOutBack (t) { + const s = 1.70158; + return (t -= 1) * t * ((s + 1) * t + s) + 1; + }, + easeInOutBack (t) { + let s = 1.70158; + if ((t /= 0.5) < 1) { + return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s)); + } + return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2); + }, + easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t), + easeOutBounce (t) { + const m = 7.5625; + const d = 2.75; + if (t < 1 / d) { + return m * t * t; + } + if (t < 2 / d) { + return m * (t -= 1.5 / d) * t + 0.75; + } + if (t < 2.5 / d) { + return m * (t -= 2.25 / d) * t + 0.9375; + } + return m * (t -= 2.625 / d) * t + 0.984375; + }, + easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5 +}; + +function isPatternOrGradient(value) { + if (value && typeof value === 'object') { + const type = value.toString(); + return type === '[object CanvasPattern]' || type === '[object CanvasGradient]'; + } + return false; +} +function color(value) { + return isPatternOrGradient(value) ? value : new color$1.Color(value); +} +function getHoverColor(value) { + return isPatternOrGradient(value) ? value : new color$1.Color(value).saturate(0.5).darken(0.1).hexString(); +} + +const numbers = [ + 'x', + 'y', + 'borderWidth', + 'radius', + 'tension' +]; +const colors = [ + 'color', + 'borderColor', + 'backgroundColor' +]; +function applyAnimationsDefaults(defaults) { + defaults.set('animation', { + delay: undefined, + duration: 1000, + easing: 'easeOutQuart', + fn: undefined, + from: undefined, + loop: undefined, + to: undefined, + type: undefined + }); + defaults.describe('animation', { + _fallback: false, + _indexable: false, + _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn' + }); + defaults.set('animations', { + colors: { + type: 'color', + properties: colors + }, + numbers: { + type: 'number', + properties: numbers + } + }); + defaults.describe('animations', { + _fallback: 'animation' + }); + defaults.set('transitions', { + active: { + animation: { + duration: 400 + } + }, + resize: { + animation: { + duration: 0 + } + }, + show: { + animations: { + colors: { + from: 'transparent' + }, + visible: { + type: 'boolean', + duration: 0 + } + } + }, + hide: { + animations: { + colors: { + to: 'transparent' + }, + visible: { + type: 'boolean', + easing: 'linear', + fn: (v)=>v | 0 + } + } + } + }); +} + +function applyLayoutsDefaults(defaults) { + defaults.set('layout', { + autoPadding: true, + padding: { + top: 0, + right: 0, + bottom: 0, + left: 0 + } + }); +} + +const intlCache = new Map(); +function getNumberFormat(locale, options) { + options = options || {}; + const cacheKey = locale + JSON.stringify(options); + let formatter = intlCache.get(cacheKey); + if (!formatter) { + formatter = new Intl.NumberFormat(locale, options); + intlCache.set(cacheKey, formatter); + } + return formatter; +} +function formatNumber(num, locale, options) { + return getNumberFormat(locale, options).format(num); +} + +const formatters = { + values (value) { + return isArray(value) ? value : '' + value; + }, + numeric (tickValue, index, ticks) { + if (tickValue === 0) { + return '0'; + } + const locale = this.chart.options.locale; + let notation; + let delta = tickValue; + if (ticks.length > 1) { + const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value)); + if (maxTick < 1e-4 || maxTick > 1e+15) { + notation = 'scientific'; + } + delta = calculateDelta(tickValue, ticks); + } + const logDelta = log10(Math.abs(delta)); + const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0); + const options = { + notation, + minimumFractionDigits: numDecimal, + maximumFractionDigits: numDecimal + }; + Object.assign(options, this.options.ticks.format); + return formatNumber(tickValue, locale, options); + }, + logarithmic (tickValue, index, ticks) { + if (tickValue === 0) { + return '0'; + } + const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue))); + if ([ + 1, + 2, + 3, + 5, + 10, + 15 + ].includes(remain) || index > 0.8 * ticks.length) { + return formatters.numeric.call(this, tickValue, index, ticks); + } + return ''; + } +}; +function calculateDelta(tickValue, ticks) { + let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value; + if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) { + delta = tickValue - Math.floor(tickValue); + } + return delta; +} + var Ticks = { + formatters +}; + +function applyScaleDefaults(defaults) { + defaults.set('scale', { + display: true, + offset: false, + reverse: false, + beginAtZero: false, + bounds: 'ticks', + clip: true, + grace: 0, + grid: { + display: true, + lineWidth: 1, + drawOnChartArea: true, + drawTicks: true, + tickLength: 8, + tickWidth: (_ctx, options)=>options.lineWidth, + tickColor: (_ctx, options)=>options.color, + offset: false + }, + border: { + display: true, + dash: [], + dashOffset: 0.0, + width: 1 + }, + title: { + display: false, + text: '', + padding: { + top: 4, + bottom: 4 + } + }, + ticks: { + minRotation: 0, + maxRotation: 50, + mirror: false, + textStrokeWidth: 0, + textStrokeColor: '', + padding: 3, + display: true, + autoSkip: true, + autoSkipPadding: 3, + labelOffset: 0, + callback: Ticks.formatters.values, + minor: {}, + major: {}, + align: 'center', + crossAlign: 'near', + showLabelBackdrop: false, + backdropColor: 'rgba(255, 255, 255, 0.75)', + backdropPadding: 2 + } + }); + defaults.route('scale.ticks', 'color', '', 'color'); + defaults.route('scale.grid', 'color', '', 'borderColor'); + defaults.route('scale.border', 'color', '', 'borderColor'); + defaults.route('scale.title', 'color', '', 'color'); + defaults.describe('scale', { + _fallback: false, + _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser', + _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash' + }); + defaults.describe('scales', { + _fallback: 'scale' + }); + defaults.describe('scale.ticks', { + _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback', + _indexable: (name)=>name !== 'backdropPadding' + }); +} + +const overrides = Object.create(null); +const descriptors = Object.create(null); + function getScope$1(node, key) { + if (!key) { + return node; + } + const keys = key.split('.'); + for(let i = 0, n = keys.length; i < n; ++i){ + const k = keys[i]; + node = node[k] || (node[k] = Object.create(null)); + } + return node; +} +function set(root, scope, values) { + if (typeof scope === 'string') { + return merge(getScope$1(root, scope), values); + } + return merge(getScope$1(root, ''), scope); +} + class Defaults { + constructor(_descriptors, _appliers){ + this.animation = undefined; + this.backgroundColor = 'rgba(0,0,0,0.1)'; + this.borderColor = 'rgba(0,0,0,0.1)'; + this.color = '#666'; + this.datasets = {}; + this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio(); + this.elements = {}; + this.events = [ + 'mousemove', + 'mouseout', + 'click', + 'touchstart', + 'touchmove' + ]; + this.font = { + family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + size: 12, + style: 'normal', + lineHeight: 1.2, + weight: null + }; + this.hover = {}; + this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor); + this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor); + this.hoverColor = (ctx, options)=>getHoverColor(options.color); + this.indexAxis = 'x'; + this.interaction = { + mode: 'nearest', + intersect: true, + includeInvisible: false + }; + this.maintainAspectRatio = true; + this.onHover = null; + this.onClick = null; + this.parsing = true; + this.plugins = {}; + this.responsive = true; + this.scale = undefined; + this.scales = {}; + this.showLine = true; + this.drawActiveElementsOnTop = true; + this.describe(_descriptors); + this.apply(_appliers); + } + set(scope, values) { + return set(this, scope, values); + } + get(scope) { + return getScope$1(this, scope); + } + describe(scope, values) { + return set(descriptors, scope, values); + } + override(scope, values) { + return set(overrides, scope, values); + } + route(scope, name, targetScope, targetName) { + const scopeObject = getScope$1(this, scope); + const targetScopeObject = getScope$1(this, targetScope); + const privateName = '_' + name; + Object.defineProperties(scopeObject, { + [privateName]: { + value: scopeObject[name], + writable: true + }, + [name]: { + enumerable: true, + get () { + const local = this[privateName]; + const target = targetScopeObject[targetName]; + if (isObject(local)) { + return Object.assign({}, target, local); + } + return valueOrDefault(local, target); + }, + set (value) { + this[privateName] = value; + } + } + }); + } + apply(appliers) { + appliers.forEach((apply)=>apply(this)); + } +} +var defaults = /* #__PURE__ */ new Defaults({ + _scriptable: (name)=>!name.startsWith('on'), + _indexable: (name)=>name !== 'events', + hover: { + _fallback: 'interaction' + }, + interaction: { + _scriptable: false, + _indexable: false + } +}, [ + applyAnimationsDefaults, + applyLayoutsDefaults, + applyScaleDefaults +]); + +/** + * Converts the given font object into a CSS font string. + * @param font - A font object. + * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font + * @private + */ function toFontString(font) { + if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) { + return null; + } + return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family; +} +/** + * @private + */ function _measureText(ctx, data, gc, longest, string) { + let textWidth = data[string]; + if (!textWidth) { + textWidth = data[string] = ctx.measureText(string).width; + gc.push(string); + } + if (textWidth > longest) { + longest = textWidth; + } + return longest; +} +/** + * @private + */ // eslint-disable-next-line complexity +function _longestText(ctx, font, arrayOfThings, cache) { + cache = cache || {}; + let data = cache.data = cache.data || {}; + let gc = cache.garbageCollect = cache.garbageCollect || []; + if (cache.font !== font) { + data = cache.data = {}; + gc = cache.garbageCollect = []; + cache.font = font; + } + ctx.save(); + ctx.font = font; + let longest = 0; + const ilen = arrayOfThings.length; + let i, j, jlen, thing, nestedThing; + for(i = 0; i < ilen; i++){ + thing = arrayOfThings[i]; + // Undefined strings and arrays should not be measured + if (thing !== undefined && thing !== null && !isArray(thing)) { + longest = _measureText(ctx, data, gc, longest, thing); + } else if (isArray(thing)) { + // if it is an array lets measure each element + // to do maybe simplify this function a bit so we can do this more recursively? + for(j = 0, jlen = thing.length; j < jlen; j++){ + nestedThing = thing[j]; + // Undefined strings and arrays should not be measured + if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) { + longest = _measureText(ctx, data, gc, longest, nestedThing); + } + } + } + } + ctx.restore(); + const gcLen = gc.length / 2; + if (gcLen > arrayOfThings.length) { + for(i = 0; i < gcLen; i++){ + delete data[gc[i]]; + } + gc.splice(0, gcLen); + } + return longest; +} +/** + * Returns the aligned pixel value to avoid anti-aliasing blur + * @param chart - The chart instance. + * @param pixel - A pixel value. + * @param width - The width of the element. + * @returns The aligned pixel value. + * @private + */ function _alignPixel(chart, pixel, width) { + const devicePixelRatio = chart.currentDevicePixelRatio; + const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0; + return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth; +} +/** + * Clears the entire canvas. + */ function clearCanvas(canvas, ctx) { + if (!ctx && !canvas) { + return; + } + ctx = ctx || canvas.getContext('2d'); + ctx.save(); + // canvas.width and canvas.height do not consider the canvas transform, + // while clearRect does + ctx.resetTransform(); + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.restore(); +} +function drawPoint(ctx, options, x, y) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + drawPointLegend(ctx, options, x, y, null); +} +// eslint-disable-next-line complexity +function drawPointLegend(ctx, options, x, y, w) { + let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW; + const style = options.pointStyle; + const rotation = options.rotation; + const radius = options.radius; + let rad = (rotation || 0) * RAD_PER_DEG; + if (style && typeof style === 'object') { + type = style.toString(); + if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') { + ctx.save(); + ctx.translate(x, y); + ctx.rotate(rad); + ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height); + ctx.restore(); + return; + } + } + if (isNaN(radius) || radius <= 0) { + return; + } + ctx.beginPath(); + switch(style){ + // Default includes circle + default: + if (w) { + ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU); + } else { + ctx.arc(x, y, radius, 0, TAU); + } + ctx.closePath(); + break; + case 'triangle': + width = w ? w / 2 : radius; + ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + ctx.closePath(); + break; + case 'rectRounded': + // NOTE: the rounded rect implementation changed to use `arc` instead of + // `quadraticCurveTo` since it generates better results when rect is + // almost a circle. 0.516 (instead of 0.5) produces results with visually + // closer proportion to the previous impl and it is inscribed in the + // circle with `radius`. For more details, see the following PRs: + // https://github.com/chartjs/Chart.js/issues/5597 + // https://github.com/chartjs/Chart.js/issues/5858 + cornerRadius = radius * 0.516; + size = radius - cornerRadius; + xOffset = Math.cos(rad + QUARTER_PI) * size; + xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size); + yOffset = Math.sin(rad + QUARTER_PI) * size; + yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size); + ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI); + ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad); + ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI); + ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI); + ctx.closePath(); + break; + case 'rect': + if (!rotation) { + size = Math.SQRT1_2 * radius; + width = w ? w / 2 : size; + ctx.rect(x - width, y - size, 2 * width, 2 * size); + break; + } + rad += QUARTER_PI; + /* falls through */ case 'rectRot': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + ctx.closePath(); + break; + case 'crossRot': + rad += QUARTER_PI; + /* falls through */ case 'cross': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case 'star': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + rad += QUARTER_PI; + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case 'line': + xOffset = w ? w / 2 : Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + break; + case 'dash': + ctx.moveTo(x, y); + ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius); + break; + case false: + ctx.closePath(); + break; + } + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } +} +/** + * Returns true if the point is inside the rectangle + * @param point - The point to test + * @param area - The rectangle + * @param margin - allowed margin + * @private + */ function _isPointInArea(point, area, margin) { + margin = margin || 0.5; // margin - default is to match rounded decimals + return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin; +} +function clipArea(ctx, area) { + ctx.save(); + ctx.beginPath(); + ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top); + ctx.clip(); +} +function unclipArea(ctx) { + ctx.restore(); +} +/** + * @private + */ function _steppedLineTo(ctx, previous, target, flip, mode) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + if (mode === 'middle') { + const midpoint = (previous.x + target.x) / 2.0; + ctx.lineTo(midpoint, previous.y); + ctx.lineTo(midpoint, target.y); + } else if (mode === 'after' !== !!flip) { + ctx.lineTo(previous.x, target.y); + } else { + ctx.lineTo(target.x, previous.y); + } + ctx.lineTo(target.x, target.y); +} +/** + * @private + */ function _bezierCurveTo(ctx, previous, target, flip) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y); +} +function setRenderOpts(ctx, opts) { + if (opts.translation) { + ctx.translate(opts.translation[0], opts.translation[1]); + } + if (!isNullOrUndef(opts.rotation)) { + ctx.rotate(opts.rotation); + } + if (opts.color) { + ctx.fillStyle = opts.color; + } + if (opts.textAlign) { + ctx.textAlign = opts.textAlign; + } + if (opts.textBaseline) { + ctx.textBaseline = opts.textBaseline; + } +} +function decorateText(ctx, x, y, line, opts) { + if (opts.strikethrough || opts.underline) { + /** + * Now that IE11 support has been dropped, we can use more + * of the TextMetrics object. The actual bounding boxes + * are unflagged in Chrome, Firefox, Edge, and Safari so they + * can be safely used. + * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility + */ const metrics = ctx.measureText(line); + const left = x - metrics.actualBoundingBoxLeft; + const right = x + metrics.actualBoundingBoxRight; + const top = y - metrics.actualBoundingBoxAscent; + const bottom = y + metrics.actualBoundingBoxDescent; + const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom; + ctx.strokeStyle = ctx.fillStyle; + ctx.beginPath(); + ctx.lineWidth = opts.decorationWidth || 2; + ctx.moveTo(left, yDecoration); + ctx.lineTo(right, yDecoration); + ctx.stroke(); + } +} +function drawBackdrop(ctx, opts) { + const oldColor = ctx.fillStyle; + ctx.fillStyle = opts.color; + ctx.fillRect(opts.left, opts.top, opts.width, opts.height); + ctx.fillStyle = oldColor; +} +/** + * Render text onto the canvas + */ function renderText(ctx, text, x, y, font, opts = {}) { + const lines = isArray(text) ? text : [ + text + ]; + const stroke = opts.strokeWidth > 0 && opts.strokeColor !== ''; + let i, line; + ctx.save(); + ctx.font = font.string; + setRenderOpts(ctx, opts); + for(i = 0; i < lines.length; ++i){ + line = lines[i]; + if (opts.backdrop) { + drawBackdrop(ctx, opts.backdrop); + } + if (stroke) { + if (opts.strokeColor) { + ctx.strokeStyle = opts.strokeColor; + } + if (!isNullOrUndef(opts.strokeWidth)) { + ctx.lineWidth = opts.strokeWidth; + } + ctx.strokeText(line, x, y, opts.maxWidth); + } + ctx.fillText(line, x, y, opts.maxWidth); + decorateText(ctx, x, y, line, opts); + y += Number(font.lineHeight); + } + ctx.restore(); +} +/** + * Add a path of a rectangle with rounded corners to the current sub-path + * @param ctx - Context + * @param rect - Bounding rect + */ function addRoundedRectPath(ctx, rect) { + const { x , y , w , h , radius } = rect; + // top left arc + ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true); + // line from top left to bottom left + ctx.lineTo(x, y + h - radius.bottomLeft); + // bottom left arc + ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true); + // line from bottom left to bottom right + ctx.lineTo(x + w - radius.bottomRight, y + h); + // bottom right arc + ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true); + // line from bottom right to top right + ctx.lineTo(x + w, y + radius.topRight); + // top right arc + ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true); + // line from top right to top left + ctx.lineTo(x + radius.topLeft, y); +} + +const LINE_HEIGHT = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/; +const FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/; +/** + * @alias Chart.helpers.options + * @namespace + */ /** + * Converts the given line height `value` in pixels for a specific font `size`. + * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em'). + * @param size - The font size (in pixels) used to resolve relative `value`. + * @returns The effective line height in pixels (size * 1.2 if value is invalid). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height + * @since 2.7.0 + */ function toLineHeight(value, size) { + const matches = ('' + value).match(LINE_HEIGHT); + if (!matches || matches[1] === 'normal') { + return size * 1.2; + } + value = +matches[2]; + switch(matches[3]){ + case 'px': + return value; + case '%': + value /= 100; + break; + } + return size * value; +} +const numberOrZero = (v)=>+v || 0; +function _readValueToProps(value, props) { + const ret = {}; + const objProps = isObject(props); + const keys = objProps ? Object.keys(props) : props; + const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value; + for (const prop of keys){ + ret[prop] = numberOrZero(read(prop)); + } + return ret; +} +/** + * Converts the given value into a TRBL object. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left) + * @since 3.0.0 + */ function toTRBL(value) { + return _readValueToProps(value, { + top: 'y', + right: 'x', + bottom: 'y', + left: 'x' + }); +} +/** + * Converts the given value into a TRBL corners object (similar with css border-radius). + * @param value - If a number, set the value to all TRBL corner components, + * else, if an object, use defined properties and sets undefined ones to 0. + * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight) + * @since 3.0.0 + */ function toTRBLCorners(value) { + return _readValueToProps(value, [ + 'topLeft', + 'topRight', + 'bottomLeft', + 'bottomRight' + ]); +} +/** + * Converts the given value into a padding object with pre-computed width/height. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left, width, height) + * @since 2.7.0 + */ function toPadding(value) { + const obj = toTRBL(value); + obj.width = obj.left + obj.right; + obj.height = obj.top + obj.bottom; + return obj; +} +/** + * Parses font options and returns the font object. + * @param options - A object that contains font options to be parsed. + * @param fallback - A object that contains fallback font options. + * @return The font object. + * @private + */ function toFont(options, fallback) { + options = options || {}; + fallback = fallback || defaults.font; + let size = valueOrDefault(options.size, fallback.size); + if (typeof size === 'string') { + size = parseInt(size, 10); + } + let style = valueOrDefault(options.style, fallback.style); + if (style && !('' + style).match(FONT_STYLE)) { + console.warn('Invalid font style specified: "' + style + '"'); + style = undefined; + } + const font = { + family: valueOrDefault(options.family, fallback.family), + lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size), + size, + style, + weight: valueOrDefault(options.weight, fallback.weight), + string: '' + }; + font.string = toFontString(font); + return font; +} +/** + * Evaluates the given `inputs` sequentially and returns the first defined value. + * @param inputs - An array of values, falling back to the last value. + * @param context - If defined and the current value is a function, the value + * is called with `context` as first argument and the result becomes the new input. + * @param index - If defined and the current value is an array, the value + * at `index` become the new input. + * @param info - object to return information about resolution in + * @param info.cacheable - Will be set to `false` if option is not cacheable. + * @since 2.7.0 + */ function resolve(inputs, context, index, info) { + let cacheable = true; + let i, ilen, value; + for(i = 0, ilen = inputs.length; i < ilen; ++i){ + value = inputs[i]; + if (value === undefined) { + continue; + } + if (context !== undefined && typeof value === 'function') { + value = value(context); + cacheable = false; + } + if (index !== undefined && isArray(value)) { + value = value[index % value.length]; + cacheable = false; + } + if (value !== undefined) { + if (info && !cacheable) { + info.cacheable = false; + } + return value; + } + } +} +/** + * @param minmax + * @param grace + * @param beginAtZero + * @private + */ function _addGrace(minmax, grace, beginAtZero) { + const { min , max } = minmax; + const change = toDimension(grace, (max - min) / 2); + const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add; + return { + min: keepZero(min, -Math.abs(change)), + max: keepZero(max, change) + }; +} +function createContext(parentContext, context) { + return Object.assign(Object.create(parentContext), context); +} + +/** + * Creates a Proxy for resolving raw values for options. + * @param scopes - The option scopes to look for values, in resolution order + * @param prefixes - The prefixes for values, in resolution order. + * @param rootScopes - The root option scopes + * @param fallback - Parent scopes fallback + * @param getTarget - callback for getting the target for changed values + * @returns Proxy + * @private + */ function _createResolver(scopes, prefixes = [ + '' +], rootScopes, fallback, getTarget = ()=>scopes[0]) { + const finalRootScopes = rootScopes || scopes; + if (typeof fallback === 'undefined') { + fallback = _resolve('_fallback', scopes); + } + const cache = { + [Symbol.toStringTag]: 'Object', + _cacheable: true, + _scopes: scopes, + _rootScopes: finalRootScopes, + _fallback: fallback, + _getTarget: getTarget, + override: (scope)=>_createResolver([ + scope, + ...scopes + ], prefixes, finalRootScopes, fallback) + }; + return new Proxy(cache, { + /** + * A trap for the delete operator. + */ deleteProperty (target, prop) { + delete target[prop]; // remove from cache + delete target._keys; // remove cached keys + delete scopes[0][prop]; // remove from top level scope + return true; + }, + /** + * A trap for getting property values. + */ get (target, prop) { + return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ getOwnPropertyDescriptor (target, prop) { + return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ getPrototypeOf () { + return Reflect.getPrototypeOf(scopes[0]); + }, + /** + * A trap for the in operator. + */ has (target, prop) { + return getKeysFromAllScopes(target).includes(prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ ownKeys (target) { + return getKeysFromAllScopes(target); + }, + /** + * A trap for setting property values. + */ set (target, prop, value) { + const storage = target._storage || (target._storage = getTarget()); + target[prop] = storage[prop] = value; // set to top level scope + cache + delete target._keys; // remove cached keys + return true; + } + }); +} +/** + * Returns an Proxy for resolving option values with context. + * @param proxy - The Proxy returned by `_createResolver` + * @param context - Context object for scriptable/indexable options + * @param subProxy - The proxy provided for scriptable options + * @param descriptorDefaults - Defaults for descriptors + * @private + */ function _attachContext(proxy, context, subProxy, descriptorDefaults) { + const cache = { + _cacheable: false, + _proxy: proxy, + _context: context, + _subProxy: subProxy, + _stack: new Set(), + _descriptors: _descriptors(proxy, descriptorDefaults), + setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults), + override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults) + }; + return new Proxy(cache, { + /** + * A trap for the delete operator. + */ deleteProperty (target, prop) { + delete target[prop]; // remove from cache + delete proxy[prop]; // remove from proxy + return true; + }, + /** + * A trap for getting property values. + */ get (target, prop, receiver) { + return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ getOwnPropertyDescriptor (target, prop) { + return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? { + enumerable: true, + configurable: true + } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ getPrototypeOf () { + return Reflect.getPrototypeOf(proxy); + }, + /** + * A trap for the in operator. + */ has (target, prop) { + return Reflect.has(proxy, prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ ownKeys () { + return Reflect.ownKeys(proxy); + }, + /** + * A trap for setting property values. + */ set (target, prop, value) { + proxy[prop] = value; // set to proxy + delete target[prop]; // remove from cache + return true; + } + }); +} +/** + * @private + */ function _descriptors(proxy, defaults = { + scriptable: true, + indexable: true +}) { + const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy; + return { + allKeys: _allKeys, + scriptable: _scriptable, + indexable: _indexable, + isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable, + isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable + }; +} +const readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name; +const needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object); +function _cached(target, prop, resolve) { + if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') { + return target[prop]; + } + const value = resolve(); + // cache the resolved value + target[prop] = value; + return value; +} +function _resolveWithContext(target, prop, receiver) { + const { _proxy , _context , _subProxy , _descriptors: descriptors } = target; + let value = _proxy[prop]; // resolve from proxy + // resolve with context + if (isFunction(value) && descriptors.isScriptable(prop)) { + value = _resolveScriptable(prop, value, target, receiver); + } + if (isArray(value) && value.length) { + value = _resolveArray(prop, value, target, descriptors.isIndexable); + } + if (needsSubResolver(prop, value)) { + // if the resolved value is an object, create a sub resolver for it + value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors); + } + return value; +} +function _resolveScriptable(prop, getValue, target, receiver) { + const { _proxy , _context , _subProxy , _stack } = target; + if (_stack.has(prop)) { + throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop); + } + _stack.add(prop); + let value = getValue(_context, _subProxy || receiver); + _stack.delete(prop); + if (needsSubResolver(prop, value)) { + // When scriptable option returns an object, create a resolver on that. + value = createSubResolver(_proxy._scopes, _proxy, prop, value); + } + return value; +} +function _resolveArray(prop, value, target, isIndexable) { + const { _proxy , _context , _subProxy , _descriptors: descriptors } = target; + if (typeof _context.index !== 'undefined' && isIndexable(prop)) { + return value[_context.index % value.length]; + } else if (isObject(value[0])) { + // Array of objects, return array or resolvers + const arr = value; + const scopes = _proxy._scopes.filter((s)=>s !== arr); + value = []; + for (const item of arr){ + const resolver = createSubResolver(scopes, _proxy, prop, item); + value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors)); + } + } + return value; +} +function resolveFallback(fallback, prop, value) { + return isFunction(fallback) ? fallback(prop, value) : fallback; +} +const getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined; +function addScopes(set, parentScopes, key, parentFallback, value) { + for (const parent of parentScopes){ + const scope = getScope(key, parent); + if (scope) { + set.add(scope); + const fallback = resolveFallback(scope._fallback, key, value); + if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) { + // When we reach the descriptor that defines a new _fallback, return that. + // The fallback will resume to that new scope. + return fallback; + } + } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) { + // Fallback to `false` results to `false`, when falling back to different key. + // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations` + return null; + } + } + return false; +} +function createSubResolver(parentScopes, resolver, prop, value) { + const rootScopes = resolver._rootScopes; + const fallback = resolveFallback(resolver._fallback, prop, value); + const allScopes = [ + ...parentScopes, + ...rootScopes + ]; + const set = new Set(); + set.add(value); + let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value); + if (key === null) { + return false; + } + if (typeof fallback !== 'undefined' && fallback !== prop) { + key = addScopesFromKey(set, allScopes, fallback, key, value); + if (key === null) { + return false; + } + } + return _createResolver(Array.from(set), [ + '' + ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value)); +} +function addScopesFromKey(set, allScopes, key, fallback, item) { + while(key){ + key = addScopes(set, allScopes, key, fallback, item); + } + return key; +} +function subGetTarget(resolver, prop, value) { + const parent = resolver._getTarget(); + if (!(prop in parent)) { + parent[prop] = {}; + } + const target = parent[prop]; + if (isArray(target) && isObject(value)) { + // For array of objects, the object is used to store updated values + return value; + } + return target || {}; +} +function _resolveWithPrefixes(prop, prefixes, scopes, proxy) { + let value; + for (const prefix of prefixes){ + value = _resolve(readKey(prefix, prop), scopes); + if (typeof value !== 'undefined') { + return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value; + } + } +} +function _resolve(key, scopes) { + for (const scope of scopes){ + if (!scope) { + continue; + } + const value = scope[key]; + if (typeof value !== 'undefined') { + return value; + } + } +} +function getKeysFromAllScopes(target) { + let keys = target._keys; + if (!keys) { + keys = target._keys = resolveKeysFromAllScopes(target._scopes); + } + return keys; +} +function resolveKeysFromAllScopes(scopes) { + const set = new Set(); + for (const scope of scopes){ + for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){ + set.add(key); + } + } + return Array.from(set); +} +function _parseObjectDataRadialScale(meta, data, start, count) { + const { iScale } = meta; + const { key ='r' } = this._parsing; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + r: iScale.parse(resolveObjectKey(item, key), index) + }; + } + return parsed; +} + +const EPSILON = Number.EPSILON || 1e-14; +const getPoint = (points, i)=>i < points.length && !points[i].skip && points[i]; +const getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x'; +function splineCurve(firstPoint, middlePoint, afterPoint, t) { + // Props to Rob Spencer at scaled innovation for his post on splining between points + // http://scaledinnovation.com/analytics/splines/aboutSplines.html + // This function must also respect "skipped" points + const previous = firstPoint.skip ? middlePoint : firstPoint; + const current = middlePoint; + const next = afterPoint.skip ? middlePoint : afterPoint; + const d01 = distanceBetweenPoints(current, previous); + const d12 = distanceBetweenPoints(next, current); + let s01 = d01 / (d01 + d12); + let s12 = d12 / (d01 + d12); + // If all points are the same, s01 & s02 will be inf + s01 = isNaN(s01) ? 0 : s01; + s12 = isNaN(s12) ? 0 : s12; + const fa = t * s01; // scaling factor for triangle Ta + const fb = t * s12; + return { + previous: { + x: current.x - fa * (next.x - previous.x), + y: current.y - fa * (next.y - previous.y) + }, + next: { + x: current.x + fb * (next.x - previous.x), + y: current.y + fb * (next.y - previous.y) + } + }; +} +/** + * Adjust tangents to ensure monotonic properties + */ function monotoneAdjust(points, deltaK, mK) { + const pointsLen = points.length; + let alphaK, betaK, tauK, squaredMagnitude, pointCurrent; + let pointAfter = getPoint(points, 0); + for(let i = 0; i < pointsLen - 1; ++i){ + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent || !pointAfter) { + continue; + } + if (almostEquals(deltaK[i], 0, EPSILON)) { + mK[i] = mK[i + 1] = 0; + continue; + } + alphaK = mK[i] / deltaK[i]; + betaK = mK[i + 1] / deltaK[i]; + squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2); + if (squaredMagnitude <= 9) { + continue; + } + tauK = 3 / Math.sqrt(squaredMagnitude); + mK[i] = alphaK * tauK * deltaK[i]; + mK[i + 1] = betaK * tauK * deltaK[i]; + } +} +function monotoneCompute(points, mK, indexAxis = 'x') { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + let delta, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for(let i = 0; i < pointsLen; ++i){ + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + const iPixel = pointCurrent[indexAxis]; + const vPixel = pointCurrent[valueAxis]; + if (pointBefore) { + delta = (iPixel - pointBefore[indexAxis]) / 3; + pointCurrent[`cp1${indexAxis}`] = iPixel - delta; + pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i]; + } + if (pointAfter) { + delta = (pointAfter[indexAxis] - iPixel) / 3; + pointCurrent[`cp2${indexAxis}`] = iPixel + delta; + pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i]; + } + } +} +/** + * This function calculates Bézier control points in a similar way than |splineCurve|, + * but preserves monotonicity of the provided data and ensures no local extremums are added + * between the dataset discrete points due to the interpolation. + * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation + */ function splineCurveMonotone(points, indexAxis = 'x') { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + const deltaK = Array(pointsLen).fill(0); + const mK = Array(pointsLen); + // Calculate slopes (deltaK) and initialize tangents (mK) + let i, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for(i = 0; i < pointsLen; ++i){ + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + if (pointAfter) { + const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis]; + // In the case of two points that appear at the same x pixel, slopeDeltaX is 0 + deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0; + } + mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2; + } + monotoneAdjust(points, deltaK, mK); + monotoneCompute(points, mK, indexAxis); +} +function capControlPoint(pt, min, max) { + return Math.max(Math.min(pt, max), min); +} +function capBezierPoints(points, area) { + let i, ilen, point, inArea, inAreaPrev; + let inAreaNext = _isPointInArea(points[0], area); + for(i = 0, ilen = points.length; i < ilen; ++i){ + inAreaPrev = inArea; + inArea = inAreaNext; + inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area); + if (!inArea) { + continue; + } + point = points[i]; + if (inAreaPrev) { + point.cp1x = capControlPoint(point.cp1x, area.left, area.right); + point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom); + } + if (inAreaNext) { + point.cp2x = capControlPoint(point.cp2x, area.left, area.right); + point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom); + } + } +} +/** + * @private + */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) { + let i, ilen, point, controlPoints; + // Only consider points that are drawn in case the spanGaps option is used + if (options.spanGaps) { + points = points.filter((pt)=>!pt.skip); + } + if (options.cubicInterpolationMode === 'monotone') { + splineCurveMonotone(points, indexAxis); + } else { + let prev = loop ? points[points.length - 1] : points[0]; + for(i = 0, ilen = points.length; i < ilen; ++i){ + point = points[i]; + controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension); + point.cp1x = controlPoints.previous.x; + point.cp1y = controlPoints.previous.y; + point.cp2x = controlPoints.next.x; + point.cp2y = controlPoints.next.y; + prev = point; + } + } + if (options.capBezierPoints) { + capBezierPoints(points, area); + } +} + +/** + * Note: typedefs are auto-exported, so use a made-up `dom` namespace where + * necessary to avoid duplicates with `export * from './helpers`; see + * https://github.com/microsoft/TypeScript/issues/46011 + * @typedef { import('../core/core.controller.js').default } dom.Chart + * @typedef { import('../../types').ChartEvent } ChartEvent + */ /** + * @private + */ function _isDomSupported() { + return typeof window !== 'undefined' && typeof document !== 'undefined'; +} +/** + * @private + */ function _getParentNode(domNode) { + let parent = domNode.parentNode; + if (parent && parent.toString() === '[object ShadowRoot]') { + parent = parent.host; + } + return parent; +} +/** + * convert max-width/max-height values that may be percentages into a number + * @private + */ function parseMaxStyle(styleValue, node, parentProperty) { + let valueInPixels; + if (typeof styleValue === 'string') { + valueInPixels = parseInt(styleValue, 10); + if (styleValue.indexOf('%') !== -1) { + // percentage * size in dimension + valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty]; + } + } else { + valueInPixels = styleValue; + } + return valueInPixels; +} +const getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null); +function getStyle(el, property) { + return getComputedStyle(el).getPropertyValue(property); +} +const positions = [ + 'top', + 'right', + 'bottom', + 'left' +]; +function getPositionedStyle(styles, style, suffix) { + const result = {}; + suffix = suffix ? '-' + suffix : ''; + for(let i = 0; i < 4; i++){ + const pos = positions[i]; + result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0; + } + result.width = result.left + result.right; + result.height = result.top + result.bottom; + return result; +} +const useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot); +/** + * @param e + * @param canvas + * @returns Canvas position + */ function getCanvasPosition(e, canvas) { + const touches = e.touches; + const source = touches && touches.length ? touches[0] : e; + const { offsetX , offsetY } = source; + let box = false; + let x, y; + if (useOffsetPos(offsetX, offsetY, e.target)) { + x = offsetX; + y = offsetY; + } else { + const rect = canvas.getBoundingClientRect(); + x = source.clientX - rect.left; + y = source.clientY - rect.top; + box = true; + } + return { + x, + y, + box + }; +} +/** + * Gets an event's x, y coordinates, relative to the chart area + * @param event + * @param chart + * @returns x and y coordinates of the event + */ function getRelativePosition(event, chart) { + if ('native' in event) { + return event; + } + const { canvas , currentDevicePixelRatio } = chart; + const style = getComputedStyle(canvas); + const borderBox = style.boxSizing === 'border-box'; + const paddings = getPositionedStyle(style, 'padding'); + const borders = getPositionedStyle(style, 'border', 'width'); + const { x , y , box } = getCanvasPosition(event, canvas); + const xOffset = paddings.left + (box && borders.left); + const yOffset = paddings.top + (box && borders.top); + let { width , height } = chart; + if (borderBox) { + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + return { + x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio), + y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio) + }; +} +function getContainerSize(canvas, width, height) { + let maxWidth, maxHeight; + if (width === undefined || height === undefined) { + const container = canvas && _getParentNode(canvas); + if (!container) { + width = canvas.clientWidth; + height = canvas.clientHeight; + } else { + const rect = container.getBoundingClientRect(); // this is the border box of the container + const containerStyle = getComputedStyle(container); + const containerBorder = getPositionedStyle(containerStyle, 'border', 'width'); + const containerPadding = getPositionedStyle(containerStyle, 'padding'); + width = rect.width - containerPadding.width - containerBorder.width; + height = rect.height - containerPadding.height - containerBorder.height; + maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth'); + maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight'); + } + } + return { + width, + height, + maxWidth: maxWidth || INFINITY, + maxHeight: maxHeight || INFINITY + }; +} +const round1 = (v)=>Math.round(v * 10) / 10; +// eslint-disable-next-line complexity +function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) { + const style = getComputedStyle(canvas); + const margins = getPositionedStyle(style, 'margin'); + const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY; + const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY; + const containerSize = getContainerSize(canvas, bbWidth, bbHeight); + let { width , height } = containerSize; + if (style.boxSizing === 'content-box') { + const borders = getPositionedStyle(style, 'border', 'width'); + const paddings = getPositionedStyle(style, 'padding'); + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + width = Math.max(0, width - margins.width); + height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height); + width = round1(Math.min(width, maxWidth, containerSize.maxWidth)); + height = round1(Math.min(height, maxHeight, containerSize.maxHeight)); + if (width && !height) { + // https://github.com/chartjs/Chart.js/issues/4659 + // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default) + height = round1(width / 2); + } + const maintainHeight = bbWidth !== undefined || bbHeight !== undefined; + if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) { + height = containerSize.height; + width = round1(Math.floor(height * aspectRatio)); + } + return { + width, + height + }; +} +/** + * @param chart + * @param forceRatio + * @param forceStyle + * @returns True if the canvas context size or transformation has changed. + */ function retinaScale(chart, forceRatio, forceStyle) { + const pixelRatio = forceRatio || 1; + const deviceHeight = Math.floor(chart.height * pixelRatio); + const deviceWidth = Math.floor(chart.width * pixelRatio); + chart.height = Math.floor(chart.height); + chart.width = Math.floor(chart.width); + const canvas = chart.canvas; + // If no style has been set on the canvas, the render size is used as display size, + // making the chart visually bigger, so let's enforce it to the "correct" values. + // See https://github.com/chartjs/Chart.js/issues/3575 + if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) { + canvas.style.height = `${chart.height}px`; + canvas.style.width = `${chart.width}px`; + } + if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) { + chart.currentDevicePixelRatio = pixelRatio; + canvas.height = deviceHeight; + canvas.width = deviceWidth; + chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); + return true; + } + return false; +} +/** + * Detects support for options object argument in addEventListener. + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support + * @private + */ const supportsEventListenerOptions = function() { + let passiveSupported = false; + try { + const options = { + get passive () { + passiveSupported = true; + return false; + } + }; + if (_isDomSupported()) { + window.addEventListener('test', null, options); + window.removeEventListener('test', null, options); + } + } catch (e) { + // continue regardless of error + } + return passiveSupported; +}(); +/** + * The "used" size is the final value of a dimension property after all calculations have + * been performed. This method uses the computed style of `element` but returns undefined + * if the computed style is not expressed in pixels. That can happen in some cases where + * `element` has a size relative to its parent and this last one is not yet displayed, + * for example because of `display: none` on a parent node. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value + * @returns Size in pixels or undefined if unknown. + */ function readUsedSize(element, property) { + const value = getStyle(element, property); + const matches = value && value.match(/^(\d+)(\.\d+)?px$/); + return matches ? +matches[1] : undefined; +} + +/** + * @private + */ function _pointInLine(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: p1.y + t * (p2.y - p1.y) + }; +} +/** + * @private + */ function _steppedInterpolation(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y + }; +} +/** + * @private + */ function _bezierInterpolation(p1, p2, t, mode) { + const cp1 = { + x: p1.cp2x, + y: p1.cp2y + }; + const cp2 = { + x: p2.cp1x, + y: p2.cp1y + }; + const a = _pointInLine(p1, cp1, t); + const b = _pointInLine(cp1, cp2, t); + const c = _pointInLine(cp2, p2, t); + const d = _pointInLine(a, b, t); + const e = _pointInLine(b, c, t); + return _pointInLine(d, e, t); +} + +const getRightToLeftAdapter = function(rectX, width) { + return { + x (x) { + return rectX + rectX + width - x; + }, + setWidth (w) { + width = w; + }, + textAlign (align) { + if (align === 'center') { + return align; + } + return align === 'right' ? 'left' : 'right'; + }, + xPlus (x, value) { + return x - value; + }, + leftForLtr (x, itemWidth) { + return x - itemWidth; + } + }; +}; +const getLeftToRightAdapter = function() { + return { + x (x) { + return x; + }, + setWidth (w) {}, + textAlign (align) { + return align; + }, + xPlus (x, value) { + return x + value; + }, + leftForLtr (x, _itemWidth) { + return x; + } + }; +}; +function getRtlAdapter(rtl, rectX, width) { + return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter(); +} +function overrideTextDirection(ctx, direction) { + let style, original; + if (direction === 'ltr' || direction === 'rtl') { + style = ctx.canvas.style; + original = [ + style.getPropertyValue('direction'), + style.getPropertyPriority('direction') + ]; + style.setProperty('direction', direction, 'important'); + ctx.prevTextDirection = original; + } +} +function restoreTextDirection(ctx, original) { + if (original !== undefined) { + delete ctx.prevTextDirection; + ctx.canvas.style.setProperty('direction', original[0], original[1]); + } +} + +function propertyFn(property) { + if (property === 'angle') { + return { + between: _angleBetween, + compare: _angleDiff, + normalize: _normalizeAngle + }; + } + return { + between: _isBetween, + compare: (a, b)=>a - b, + normalize: (x)=>x + }; +} +function normalizeSegment({ start , end , count , loop , style }) { + return { + start: start % count, + end: end % count, + loop: loop && (end - start + 1) % count === 0, + style + }; +} +function getSegment(segment, points, bounds) { + const { property , start: startBound , end: endBound } = bounds; + const { between , normalize } = propertyFn(property); + const count = points.length; + let { start , end , loop } = segment; + let i, ilen; + if (loop) { + start += count; + end += count; + for(i = 0, ilen = count; i < ilen; ++i){ + if (!between(normalize(points[start % count][property]), startBound, endBound)) { + break; + } + start--; + end--; + } + start %= count; + end %= count; + } + if (end < start) { + end += count; + } + return { + start, + end, + loop, + style: segment.style + }; +} + function _boundSegment(segment, points, bounds) { + if (!bounds) { + return [ + segment + ]; + } + const { property , start: startBound , end: endBound } = bounds; + const count = points.length; + const { compare , between , normalize } = propertyFn(property); + const { start , end , loop , style } = getSegment(segment, points, bounds); + const result = []; + let inside = false; + let subStart = null; + let value, point, prevValue; + const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0; + const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value); + const shouldStart = ()=>inside || startIsBefore(); + const shouldStop = ()=>!inside || endIsBefore(); + for(let i = start, prev = start; i <= end; ++i){ + point = points[i % count]; + if (point.skip) { + continue; + } + value = normalize(point[property]); + if (value === prevValue) { + continue; + } + inside = between(value, startBound, endBound); + if (subStart === null && shouldStart()) { + subStart = compare(value, startBound) === 0 ? i : prev; + } + if (subStart !== null && shouldStop()) { + result.push(normalizeSegment({ + start: subStart, + end: i, + loop, + count, + style + })); + subStart = null; + } + prev = i; + prevValue = value; + } + if (subStart !== null) { + result.push(normalizeSegment({ + start: subStart, + end, + loop, + count, + style + })); + } + return result; +} + function _boundSegments(line, bounds) { + const result = []; + const segments = line.segments; + for(let i = 0; i < segments.length; i++){ + const sub = _boundSegment(segments[i], line.points, bounds); + if (sub.length) { + result.push(...sub); + } + } + return result; +} + function findStartAndEnd(points, count, loop, spanGaps) { + let start = 0; + let end = count - 1; + if (loop && !spanGaps) { + while(start < count && !points[start].skip){ + start++; + } + } + while(start < count && points[start].skip){ + start++; + } + start %= count; + if (loop) { + end += start; + } + while(end > start && points[end % count].skip){ + end--; + } + end %= count; + return { + start, + end + }; +} + function solidSegments(points, start, max, loop) { + const count = points.length; + const result = []; + let last = start; + let prev = points[start]; + let end; + for(end = start + 1; end <= max; ++end){ + const cur = points[end % count]; + if (cur.skip || cur.stop) { + if (!prev.skip) { + loop = false; + result.push({ + start: start % count, + end: (end - 1) % count, + loop + }); + start = last = cur.stop ? end : null; + } + } else { + last = end; + if (prev.skip) { + start = end; + } + } + prev = cur; + } + if (last !== null) { + result.push({ + start: start % count, + end: last % count, + loop + }); + } + return result; +} + function _computeSegments(line, segmentOptions) { + const points = line.points; + const spanGaps = line.options.spanGaps; + const count = points.length; + if (!count) { + return []; + } + const loop = !!line._loop; + const { start , end } = findStartAndEnd(points, count, loop, spanGaps); + if (spanGaps === true) { + return splitByStyles(line, [ + { + start, + end, + loop + } + ], points, segmentOptions); + } + const max = end < start ? end + count : end; + const completeLoop = !!line._fullLoop && start === 0 && end === count - 1; + return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions); +} + function splitByStyles(line, segments, points, segmentOptions) { + if (!segmentOptions || !segmentOptions.setContext || !points) { + return segments; + } + return doSplitByStyles(line, segments, points, segmentOptions); +} + function doSplitByStyles(line, segments, points, segmentOptions) { + const chartContext = line._chart.getContext(); + const baseStyle = readStyle(line.options); + const { _datasetIndex: datasetIndex , options: { spanGaps } } = line; + const count = points.length; + const result = []; + let prevStyle = baseStyle; + let start = segments[0].start; + let i = start; + function addStyle(s, e, l, st) { + const dir = spanGaps ? -1 : 1; + if (s === e) { + return; + } + s += count; + while(points[s % count].skip){ + s -= dir; + } + while(points[e % count].skip){ + e += dir; + } + if (s % count !== e % count) { + result.push({ + start: s % count, + end: e % count, + loop: l, + style: st + }); + prevStyle = st; + start = e % count; + } + } + for (const segment of segments){ + start = spanGaps ? start : segment.start; + let prev = points[start % count]; + let style; + for(i = start + 1; i <= segment.end; i++){ + const pt = points[i % count]; + style = readStyle(segmentOptions.setContext(createContext(chartContext, { + type: 'segment', + p0: prev, + p1: pt, + p0DataIndex: (i - 1) % count, + p1DataIndex: i % count, + datasetIndex + }))); + if (styleChanged(style, prevStyle)) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + prev = pt; + prevStyle = style; + } + if (start < i - 1) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + } + return result; +} +function readStyle(options) { + return { + backgroundColor: options.backgroundColor, + borderCapStyle: options.borderCapStyle, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderJoinStyle: options.borderJoinStyle, + borderWidth: options.borderWidth, + borderColor: options.borderColor + }; +} +function styleChanged(style, prevStyle) { + if (!prevStyle) { + return false; + } + const cache = []; + const replacer = function(key, value) { + if (!isPatternOrGradient(value)) { + return value; + } + if (!cache.includes(value)) { + cache.push(value); + } + return cache.indexOf(value); + }; + return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer); +} + +exports.HALF_PI = HALF_PI; +exports.INFINITY = INFINITY; +exports.PI = PI; +exports.PITAU = PITAU; +exports.QUARTER_PI = QUARTER_PI; +exports.RAD_PER_DEG = RAD_PER_DEG; +exports.TAU = TAU; +exports.TWO_THIRDS_PI = TWO_THIRDS_PI; +exports.Ticks = Ticks; +exports._addGrace = _addGrace; +exports._alignPixel = _alignPixel; +exports._alignStartEnd = _alignStartEnd; +exports._angleBetween = _angleBetween; +exports._angleDiff = _angleDiff; +exports._arrayUnique = _arrayUnique; +exports._attachContext = _attachContext; +exports._bezierCurveTo = _bezierCurveTo; +exports._bezierInterpolation = _bezierInterpolation; +exports._boundSegment = _boundSegment; +exports._boundSegments = _boundSegments; +exports._capitalize = _capitalize; +exports._computeSegments = _computeSegments; +exports._createResolver = _createResolver; +exports._decimalPlaces = _decimalPlaces; +exports._deprecated = _deprecated; +exports._descriptors = _descriptors; +exports._elementsEqual = _elementsEqual; +exports._factorize = _factorize; +exports._filterBetween = _filterBetween; +exports._getParentNode = _getParentNode; +exports._getStartAndCountOfVisiblePoints = _getStartAndCountOfVisiblePoints; +exports._int16Range = _int16Range; +exports._isBetween = _isBetween; +exports._isClickEvent = _isClickEvent; +exports._isDomSupported = _isDomSupported; +exports._isPointInArea = _isPointInArea; +exports._limitValue = _limitValue; +exports._longestText = _longestText; +exports._lookup = _lookup; +exports._lookupByKey = _lookupByKey; +exports._measureText = _measureText; +exports._merger = _merger; +exports._mergerIf = _mergerIf; +exports._normalizeAngle = _normalizeAngle; +exports._parseObjectDataRadialScale = _parseObjectDataRadialScale; +exports._pointInLine = _pointInLine; +exports._readValueToProps = _readValueToProps; +exports._rlookupByKey = _rlookupByKey; +exports._scaleRangesChanged = _scaleRangesChanged; +exports._setMinAndMaxByKey = _setMinAndMaxByKey; +exports._splitKey = _splitKey; +exports._steppedInterpolation = _steppedInterpolation; +exports._steppedLineTo = _steppedLineTo; +exports._textX = _textX; +exports._toLeftRightCenter = _toLeftRightCenter; +exports._updateBezierControlPoints = _updateBezierControlPoints; +exports.addRoundedRectPath = addRoundedRectPath; +exports.almostEquals = almostEquals; +exports.almostWhole = almostWhole; +exports.callback = callback; +exports.clearCanvas = clearCanvas; +exports.clipArea = clipArea; +exports.clone = clone; +exports.color = color; +exports.createContext = createContext; +exports.debounce = debounce; +exports.defaults = defaults; +exports.defined = defined; +exports.descriptors = descriptors; +exports.distanceBetweenPoints = distanceBetweenPoints; +exports.drawPoint = drawPoint; +exports.drawPointLegend = drawPointLegend; +exports.each = each; +exports.effects = effects; +exports.finiteOrDefault = finiteOrDefault; +exports.fontString = fontString; +exports.formatNumber = formatNumber; +exports.getAngleFromPoint = getAngleFromPoint; +exports.getHoverColor = getHoverColor; +exports.getMaximumSize = getMaximumSize; +exports.getRelativePosition = getRelativePosition; +exports.getRtlAdapter = getRtlAdapter; +exports.getStyle = getStyle; +exports.isArray = isArray; +exports.isFunction = isFunction; +exports.isNullOrUndef = isNullOrUndef; +exports.isNumber = isNumber; +exports.isNumberFinite = isNumberFinite; +exports.isObject = isObject; +exports.isPatternOrGradient = isPatternOrGradient; +exports.listenArrayEvents = listenArrayEvents; +exports.log10 = log10; +exports.merge = merge; +exports.mergeIf = mergeIf; +exports.niceNum = niceNum; +exports.noop = noop; +exports.overrideTextDirection = overrideTextDirection; +exports.overrides = overrides; +exports.readUsedSize = readUsedSize; +exports.renderText = renderText; +exports.requestAnimFrame = requestAnimFrame; +exports.resolve = resolve; +exports.resolveObjectKey = resolveObjectKey; +exports.restoreTextDirection = restoreTextDirection; +exports.retinaScale = retinaScale; +exports.setsEqual = setsEqual; +exports.sign = sign; +exports.splineCurve = splineCurve; +exports.splineCurveMonotone = splineCurveMonotone; +exports.supportsEventListenerOptions = supportsEventListenerOptions; +exports.throttled = throttled; +exports.toDegrees = toDegrees; +exports.toDimension = toDimension; +exports.toFont = toFont; +exports.toFontString = toFontString; +exports.toLineHeight = toLineHeight; +exports.toPadding = toPadding; +exports.toPercentage = toPercentage; +exports.toRadians = toRadians; +exports.toTRBL = toTRBL; +exports.toTRBLCorners = toTRBLCorners; +exports.uid = uid; +exports.unclipArea = unclipArea; +exports.unlistenArrayEvents = unlistenArrayEvents; +exports.valueOrDefault = valueOrDefault; +//# sourceMappingURL=helpers.segment.cjs.map diff --git a/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs.map b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs.map new file mode 100644 index 0000000..fb810e2 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.segment.cjs","sources":["../../src/helpers/helpers.core.ts","../../src/helpers/helpers.math.ts","../../src/helpers/helpers.collection.ts","../../src/helpers/helpers.extras.ts","../../src/helpers/helpers.easing.ts","../../src/helpers/helpers.color.ts","../../src/core/core.animations.defaults.js","../../src/core/core.layouts.defaults.js","../../src/helpers/helpers.intl.ts","../../src/core/core.ticks.js","../../src/core/core.scale.defaults.js","../../src/core/core.defaults.js","../../src/helpers/helpers.canvas.ts","../../src/helpers/helpers.options.ts","../../src/helpers/helpers.config.ts","../../src/helpers/helpers.curve.ts","../../src/helpers/helpers.dom.ts","../../src/helpers/helpers.interpolation.ts","../../src/helpers/helpers.rtl.ts","../../src/helpers/helpers.segment.js"],"sourcesContent":["/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || value === undefined;\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray<T = unknown>(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault<T>(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each<T, TA>(\n loopable: Record<string, T>,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[] | Record<string, T>,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone<T>(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge<T>(target: T, source: [], options?: MergeOptions): T;\nexport function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge<T, S1, S2, S3, S4>(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf<T>(target: T, source: []): T;\nexport function mergeIf<T, S1>(target: T, source: S1): T & S1;\nexport function mergeIf<T, S1>(target: T, source: [S1]): T & S1;\nexport function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge<T>(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = <T>(a: Set<T>, b: Set<T>) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record<string, number>[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup<T>(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener<T> {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique<T>(items: T[]) {\n const set = new Set<T>(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled<TArgs extends Array<any>>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map<string, Intl.NumberFormat>();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record<string, number>,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record<string, number>, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n if (!ctx && !canvas) {\n return;\n }\n\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;\nexport function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;\nexport function _readValueToProps(value: number | Record<string, number>, props: string[] | Record<string, string>) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext<T extends object>(parentContext: null, context: T): T;\nexport function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache<T, R> = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy<T, R>;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy<T, R>,\n context: AnyObject,\n subProxy?: ResolverProxy<T, R>,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache<T, R> = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy<T, R>;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set<AnyObject>,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set<AnyObject>();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set<AnyObject>,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set<string>();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType<typeof splineCurve>;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial<Scale> {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n if (_isDomSupported()) {\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n }\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n"],"names":["noop","uid","id","isNullOrUndef","value","undefined","isArray","Array","type","Object","prototype","toString","call","slice","isObject","isNumberFinite","Number","isFinite","finiteOrDefault","defaultValue","valueOrDefault","toPercentage","dimension","endsWith","parseFloat","toDimension","callback","fn","args","thisArg","apply","each","loopable","reverse","i","len","keys","length","_elementsEqual","a0","a1","ilen","v0","v1","datasetIndex","index","clone","source","map","target","create","klen","k","isValidKey","key","indexOf","_merger","options","tval","sval","merge","sources","merger","current","mergeIf","_mergerIf","hasOwnProperty","_deprecated","scope","previous","console","warn","keyResolvers","v","x","o","y","_splitKey","parts","split","tmp","part","push","_getKeyResolver","obj","resolveObjectKey","resolver","_capitalize","str","charAt","toUpperCase","defined","isFunction","setsEqual","a","b","size","item","has","_isClickEvent","e","PI","Math","TAU","PITAU","INFINITY","POSITIVE_INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","abs","niceNum","range","roundedRange","round","niceRange","pow","floor","fraction","niceFraction","_factorize","result","sqrt","sort","pop","isNumber","n","isNaN","almostWhole","rounded","_setMinAndMaxByKey","array","property","min","max","toRadians","degrees","toDegrees","radians","_decimalPlaces","isFiniteNumber","p","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","atan2","distance","distanceBetweenPoints","pt1","pt2","_angleDiff","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","s","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","table","cmp","hi","lo","mid","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","values","arrayEvents","listenArrayEvents","listener","_chartjs","listeners","defineProperty","configurable","enumerable","forEach","method","base","res","object","unlistenArrayEvents","stub","splice","_arrayUnique","items","set","Set","from","fontString","pixelSize","fontStyle","fontFamily","requestAnimFrame","window","requestAnimationFrame","throttled","argsToUse","ticking","debounce","delay","timeout","clearTimeout","setTimeout","_toLeftRightCenter","align","_alignStartEnd","_textX","left","right","rtl","check","_getStartAndCountOfVisiblePoints","meta","points","animationsDisabled","pointCount","count","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","_scaleRangesChanged","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","assign","atEdge","t","elasticIn","sin","elasticOut","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","m","d","easeInOutBounce","isPatternOrGradient","color","Color","getHoverColor","saturate","darken","hexString","numbers","colors","applyAnimationsDefaults","defaults","duration","easing","loop","to","describe","_fallback","_indexable","_scriptable","name","properties","active","animation","resize","show","animations","visible","hide","applyLayoutsDefaults","autoPadding","padding","top","bottom","intlCache","Map","getNumberFormat","locale","cacheKey","JSON","stringify","formatter","get","Intl","NumberFormat","formatNumber","num","format","formatters","numeric","tickValue","ticks","chart","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","applyScaleDefaults","display","offset","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","title","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","Ticks","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","route","startsWith","overrides","descriptors","getScope","node","root","Defaults","constructor","_descriptors","_appliers","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","style","lineHeight","weight","hover","hoverBackgroundColor","ctx","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","override","targetScope","targetName","scopeObject","targetScopeObject","privateName","defineProperties","writable","local","appliers","toFontString","_measureText","data","gc","longest","string","textWidth","measureText","_longestText","arrayOfThings","cache","garbageCollect","save","j","jlen","thing","nestedThing","restore","gcLen","_alignPixel","pixel","currentDevicePixelRatio","halfWidth","clearCanvas","canvas","getContext","resetTransform","clearRect","height","drawPoint","drawPointLegend","w","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","rotate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","fill","borderWidth","stroke","_isPointInArea","point","area","margin","clipArea","unclipArea","_steppedLineTo","flip","midpoint","_bezierCurveTo","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","setRenderOpts","opts","translation","fillStyle","textAlign","textBaseline","decorateText","line","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","strokeStyle","decorationWidth","drawBackdrop","oldColor","fillRect","renderText","lines","strokeWidth","strokeColor","backdrop","strokeText","maxWidth","fillText","addRoundedRectPath","h","topLeft","bottomLeft","bottomRight","topRight","LINE_HEIGHT","FONT_STYLE","toLineHeight","matches","match","numberOrZero","_readValueToProps","props","ret","objProps","read","prop","toTRBL","toTRBLCorners","toPadding","toFont","fallback","parseInt","resolve","inputs","info","cacheable","_addGrace","minmax","change","keepZero","add","createContext","parentContext","_createResolver","scopes","prefixes","rootScopes","getTarget","finalRootScopes","_resolve","Symbol","toStringTag","_cacheable","_scopes","_rootScopes","_getTarget","Proxy","deleteProperty","_keys","_cached","_resolveWithPrefixes","getOwnPropertyDescriptor","Reflect","getPrototypeOf","getKeysFromAllScopes","ownKeys","storage","_storage","_attachContext","proxy","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","setContext","receiver","_resolveWithContext","allKeys","scriptable","indexable","_allKeys","isScriptable","isIndexable","readKey","prefix","needsSubResolver","_resolveScriptable","_resolveArray","getValue","Error","join","delete","createSubResolver","arr","filter","resolveFallback","parent","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","_parseObjectDataRadialScale","_parsing","parsed","r","parse","EPSILON","getPoint","skip","getValueAxis","splineCurve","firstPoint","middlePoint","afterPoint","next","d01","d12","s01","s12","fa","fb","monotoneAdjust","deltaK","mK","pointsLen","alphaK","betaK","tauK","squaredMagnitude","pointCurrent","pointAfter","monotoneCompute","valueAxis","pointBefore","iPixel","vPixel","splineCurveMonotone","slopeDelta","capControlPoint","pt","capBezierPoints","inArea","inAreaPrev","inAreaNext","_updateBezierControlPoints","controlPoints","spanGaps","cubicInterpolationMode","prev","tension","_isDomSupported","document","_getParentNode","domNode","parentNode","host","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","ownerDocument","defaultView","getStyle","el","getPropertyValue","positions","getPositionedStyle","styles","suffix","pos","useOffsetPos","shadowRoot","getCanvasPosition","touches","offsetX","offsetY","box","getBoundingClientRect","clientX","clientY","getRelativePosition","event","borderBox","boxSizing","paddings","borders","getContainerSize","maxHeight","container","clientWidth","clientHeight","containerStyle","containerBorder","containerPadding","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","containerSize","maintainHeight","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","supportsEventListenerOptions","passiveSupported","passive","addEventListener","removeEventListener","readUsedSize","_pointInLine","p1","p2","_steppedInterpolation","_bezierInterpolation","cp1","cp2","c","getRightToLeftAdapter","rectX","setWidth","xPlus","leftForLtr","itemWidth","getLeftToRightAdapter","_itemWidth","getRtlAdapter","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","propertyFn","between","compare","normalize","normalizeSegment","getSegment","segment","startBound","endBound","_boundSegment","inside","subStart","prevValue","startIsBefore","endIsBefore","shouldStart","shouldStop","_boundSegments","segments","sub","findStartAndEnd","solidSegments","cur","stop","_computeSegments","segmentOptions","_loop","splitByStyles","completeLoop","_fullLoop","doSplitByStyles","chartContext","_chart","baseStyle","readStyle","_datasetIndex","prevStyle","addStyle","l","st","dir","p0","p0DataIndex","p1DataIndex","styleChanged","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","replacer"],"mappings":";;;;;;;;;;AAAA;;;;IAUO,SAASA,IAAO,GAAA;AACrB,YACD;AAED;;AAEC,IACM,MAAMC,GAAM,GAAC,CAAA,IAAM;AACxB,IAAA,IAAIC,EAAK,GAAA,CAAA,CAAA;AACT,IAAA,OAAO,IAAMA,EAAAA,EAAAA,CAAAA;AACf,CAAA,IAAK;AAEL;;;;AAIC,IACM,SAASC,aAAcC,CAAAA,KAAc,EAA6B;IACvE,OAAOA,KAAAA,KAAU,IAAI,IAAIA,KAAUC,KAAAA,SAAAA,CAAAA;AACrC,CAAC;AAED;;;;AAIC,IACM,SAASC,OAAqBF,CAAAA,KAAc,EAAgB;AACjE,IAAA,IAAIG,MAAMD,OAAO,IAAIC,KAAMD,CAAAA,OAAO,CAACF,KAAQ,CAAA,EAAA;AACzC,QAAA,OAAO,IAAI,CAAA;KACZ;AACD,IAAA,MAAMI,OAAOC,MAAOC,CAAAA,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACR,KAAAA,CAAAA,CAAAA;IAC5C,IAAII,IAAAA,CAAKK,KAAK,CAAC,CAAG,EAAA,CAAA,CAAA,KAAO,SAAaL,IAAAA,IAAAA,CAAKK,KAAK,CAAC,CAAC,CAAA,CAAA,KAAO,QAAU,EAAA;AACjE,QAAA,OAAO,IAAI,CAAA;KACZ;AACD,IAAA,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;AAIC,IACM,SA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A,KAAAA,CAAAA;SACR;AACD,QAAA,IAAI,CAACuc,KAAAA,CAAMtG,QAAQ,CAACjW,KAAQ,CAAA,EAAA;AAC1Buc,YAAAA,KAAAA,CAAMzX,IAAI,CAAC9E,KAAAA,CAAAA,CAAAA;SACZ;QACD,OAAOuc,KAAAA,CAAMpZ,OAAO,CAACnD,KAAAA,CAAAA,CAAAA;AACvB,KAAA,CAAA;IACA,OAAOwU,IAAAA,CAAKC,SAAS,CAACmF,KAAAA,EAAOma,cAAcvf,IAAKC,CAAAA,SAAS,CAACye,SAAWa,EAAAA,QAAAA,CAAAA,CAAAA;AACvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js new file mode 100644 index 0000000..3db4db2 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js @@ -0,0 +1,2749 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +import { Color } from '@kurkle/color'; + +/** + * @namespace Chart.helpers + */ /** + * An empty function that can be used, for example, for optional callback. + */ function noop() { +/* noop */ } +/** + * Returns a unique id, sequentially generated from a global variable. + */ const uid = (()=>{ + let id = 0; + return ()=>id++; +})(); +/** + * Returns true if `value` is neither null nor undefined, else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ function isNullOrUndef(value) { + return value === null || value === undefined; +} +/** + * Returns true if `value` is an array (including typed arrays), else returns false. + * @param value - The value to test. + * @function + */ function isArray(value) { + if (Array.isArray && Array.isArray(value)) { + return true; + } + const type = Object.prototype.toString.call(value); + if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') { + return true; + } + return false; +} +/** + * Returns true if `value` is an object (excluding null), else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ function isObject(value) { + return value !== null && Object.prototype.toString.call(value) === '[object Object]'; +} +/** + * Returns true if `value` is a finite number, else returns false + * @param value - The value to test. + */ function isNumberFinite(value) { + return (typeof value === 'number' || value instanceof Number) && isFinite(+value); +} +/** + * Returns `value` if finite, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is not finite. + */ function finiteOrDefault(value, defaultValue) { + return isNumberFinite(value) ? value : defaultValue; +} +/** + * Returns `value` if defined, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is undefined. + */ function valueOrDefault(value, defaultValue) { + return typeof value === 'undefined' ? defaultValue : value; +} +const toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension; +const toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value; +/** + * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the + * value returned by `fn`. If `fn` is not a function, this method returns undefined. + * @param fn - The function to call. + * @param args - The arguments with which `fn` should be called. + * @param [thisArg] - The value of `this` provided for the call to `fn`. + */ function callback(fn, args, thisArg) { + if (fn && typeof fn.call === 'function') { + return fn.apply(thisArg, args); + } +} +function each(loopable, fn, thisArg, reverse) { + let i, len, keys; + if (isArray(loopable)) { + len = loopable.length; + if (reverse) { + for(i = len - 1; i >= 0; i--){ + fn.call(thisArg, loopable[i], i); + } + } else { + for(i = 0; i < len; i++){ + fn.call(thisArg, loopable[i], i); + } + } + } else if (isObject(loopable)) { + keys = Object.keys(loopable); + len = keys.length; + for(i = 0; i < len; i++){ + fn.call(thisArg, loopable[keys[i]], keys[i]); + } + } +} +/** + * Returns true if the `a0` and `a1` arrays have the same content, else returns false. + * @param a0 - The array to compare + * @param a1 - The array to compare + * @private + */ function _elementsEqual(a0, a1) { + let i, ilen, v0, v1; + if (!a0 || !a1 || a0.length !== a1.length) { + return false; + } + for(i = 0, ilen = a0.length; i < ilen; ++i){ + v0 = a0[i]; + v1 = a1[i]; + if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) { + return false; + } + } + return true; +} +/** + * Returns a deep copy of `source` without keeping references on objects and arrays. + * @param source - The value to clone. + */ function clone(source) { + if (isArray(source)) { + return source.map(clone); + } + if (isObject(source)) { + const target = Object.create(null); + const keys = Object.keys(source); + const klen = keys.length; + let k = 0; + for(; k < klen; ++k){ + target[keys[k]] = clone(source[keys[k]]); + } + return target; + } + return source; +} +function isValidKey(key) { + return [ + '__proto__', + 'prototype', + 'constructor' + ].indexOf(key) === -1; +} +/** + * The default merger when Chart.helpers.merge is called without merger option. + * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback. + * @private + */ function _merger(key, target, source, options) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + merge(tval, sval, options); + } else { + target[key] = clone(sval); + } +} +function merge(target, source, options) { + const sources = isArray(source) ? source : [ + source + ]; + const ilen = sources.length; + if (!isObject(target)) { + return target; + } + options = options || {}; + const merger = options.merger || _merger; + let current; + for(let i = 0; i < ilen; ++i){ + current = sources[i]; + if (!isObject(current)) { + continue; + } + const keys = Object.keys(current); + for(let k = 0, klen = keys.length; k < klen; ++k){ + merger(keys[k], target, current, options); + } + } + return target; +} +function mergeIf(target, source) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + return merge(target, source, { + merger: _mergerIf + }); +} +/** + * Merges source[key] in target[key] only if target[key] is undefined. + * @private + */ function _mergerIf(key, target, source) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + mergeIf(tval, sval); + } else if (!Object.prototype.hasOwnProperty.call(target, key)) { + target[key] = clone(sval); + } +} +/** + * @private + */ function _deprecated(scope, value, previous, current) { + if (value !== undefined) { + console.warn(scope + ': "' + previous + '" is deprecated. Please use "' + current + '" instead'); + } +} +// resolveObjectKey resolver cache +const keyResolvers = { + // Chart.helpers.core resolveObjectKey should resolve empty key to root object + '': (v)=>v, + // default resolvers + x: (o)=>o.x, + y: (o)=>o.y +}; +/** + * @private + */ function _splitKey(key) { + const parts = key.split('.'); + const keys = []; + let tmp = ''; + for (const part of parts){ + tmp += part; + if (tmp.endsWith('\\')) { + tmp = tmp.slice(0, -1) + '.'; + } else { + keys.push(tmp); + tmp = ''; + } + } + return keys; +} +function _getKeyResolver(key) { + const keys = _splitKey(key); + return (obj)=>{ + for (const k of keys){ + if (k === '') { + break; + } + obj = obj && obj[k]; + } + return obj; + }; +} +function resolveObjectKey(obj, key) { + const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key)); + return resolver(obj); +} +/** + * @private + */ function _capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +const defined = (value)=>typeof value !== 'undefined'; +const isFunction = (value)=>typeof value === 'function'; +// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384 +const setsEqual = (a, b)=>{ + if (a.size !== b.size) { + return false; + } + for (const item of a){ + if (!b.has(item)) { + return false; + } + } + return true; +}; +/** + * @param e - The event + * @private + */ function _isClickEvent(e) { + return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu'; +} + +/** + * @alias Chart.helpers.math + * @namespace + */ const PI = Math.PI; +const TAU = 2 * PI; +const PITAU = TAU + PI; +const INFINITY = Number.POSITIVE_INFINITY; +const RAD_PER_DEG = PI / 180; +const HALF_PI = PI / 2; +const QUARTER_PI = PI / 4; +const TWO_THIRDS_PI = PI * 2 / 3; +const log10 = Math.log10; +const sign = Math.sign; +function almostEquals(x, y, epsilon) { + return Math.abs(x - y) < epsilon; +} +/** + * Implementation of the nice number algorithm used in determining where axis labels will go + */ function niceNum(range) { + const roundedRange = Math.round(range); + range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range; + const niceRange = Math.pow(10, Math.floor(log10(range))); + const fraction = range / niceRange; + const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10; + return niceFraction * niceRange; +} +/** + * Returns an array of factors sorted from 1 to sqrt(value) + * @private + */ function _factorize(value) { + const result = []; + const sqrt = Math.sqrt(value); + let i; + for(i = 1; i < sqrt; i++){ + if (value % i === 0) { + result.push(i); + result.push(value / i); + } + } + if (sqrt === (sqrt | 0)) { + result.push(sqrt); + } + result.sort((a, b)=>a - b).pop(); + return result; +} +function isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +function almostWhole(x, epsilon) { + const rounded = Math.round(x); + return rounded - epsilon <= x && rounded + epsilon >= x; +} +/** + * @private + */ function _setMinAndMaxByKey(array, target, property) { + let i, ilen, value; + for(i = 0, ilen = array.length; i < ilen; i++){ + value = array[i][property]; + if (!isNaN(value)) { + target.min = Math.min(target.min, value); + target.max = Math.max(target.max, value); + } + } +} +function toRadians(degrees) { + return degrees * (PI / 180); +} +function toDegrees(radians) { + return radians * (180 / PI); +} +/** + * Returns the number of decimal places + * i.e. the number of digits after the decimal point, of the value of this Number. + * @param x - A number. + * @returns The number of decimal places. + * @private + */ function _decimalPlaces(x) { + if (!isNumberFinite(x)) { + return; + } + let e = 1; + let p = 0; + while(Math.round(x * e) / e !== x){ + e *= 10; + p++; + } + return p; +} +// Gets the angle from vertical upright to the point about a centre. +function getAngleFromPoint(centrePoint, anglePoint) { + const distanceFromXCenter = anglePoint.x - centrePoint.x; + const distanceFromYCenter = anglePoint.y - centrePoint.y; + const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter); + let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter); + if (angle < -0.5 * PI) { + angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2] + } + return { + angle, + distance: radialDistanceFromCenter + }; +} +function distanceBetweenPoints(pt1, pt2) { + return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2)); +} +/** + * Shortest distance between angles, in either direction. + * @private + */ function _angleDiff(a, b) { + return (a - b + PITAU) % TAU - PI; +} +/** + * Normalize angle to be between 0 and 2*PI + * @private + */ function _normalizeAngle(a) { + return (a % TAU + TAU) % TAU; +} +/** + * @private + */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) { + const a = _normalizeAngle(angle); + const s = _normalizeAngle(start); + const e = _normalizeAngle(end); + const angleToStart = _normalizeAngle(s - a); + const angleToEnd = _normalizeAngle(e - a); + const startToAngle = _normalizeAngle(a - s); + const endToAngle = _normalizeAngle(a - e); + return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle; +} +/** + * Limit `value` between `min` and `max` + * @param value + * @param min + * @param max + * @private + */ function _limitValue(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +/** + * @param {number} value + * @private + */ function _int16Range(value) { + return _limitValue(value, -32768, 32767); +} +/** + * @param value + * @param start + * @param end + * @param [epsilon] + * @private + */ function _isBetween(value, start, end, epsilon = 1e-6) { + return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon; +} + +function _lookup(table, value, cmp) { + cmp = cmp || ((index)=>table[index] < value); + let hi = table.length - 1; + let lo = 0; + let mid; + while(hi - lo > 1){ + mid = lo + hi >> 1; + if (cmp(mid)) { + lo = mid; + } else { + hi = mid; + } + } + return { + lo, + hi + }; +} +/** + * Binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @param last - lookup last index + * @private + */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{ + const ti = table[index][key]; + return ti < value || ti === value && table[index + 1][key] === value; + } : (index)=>table[index][key] < value); +/** + * Reverse binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @private + */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value); +/** + * Return subset of `values` between `min` and `max` inclusive. + * Values are assumed to be in sorted order. + * @param values - sorted array of values + * @param min - min value + * @param max - max value + */ function _filterBetween(values, min, max) { + let start = 0; + let end = values.length; + while(start < end && values[start] < min){ + start++; + } + while(end > start && values[end - 1] > max){ + end--; + } + return start > 0 || end < values.length ? values.slice(start, end) : values; +} +const arrayEvents = [ + 'push', + 'pop', + 'shift', + 'splice', + 'unshift' +]; +function listenArrayEvents(array, listener) { + if (array._chartjs) { + array._chartjs.listeners.push(listener); + return; + } + Object.defineProperty(array, '_chartjs', { + configurable: true, + enumerable: false, + value: { + listeners: [ + listener + ] + } + }); + arrayEvents.forEach((key)=>{ + const method = '_onData' + _capitalize(key); + const base = array[key]; + Object.defineProperty(array, key, { + configurable: true, + enumerable: false, + value (...args) { + const res = base.apply(this, args); + array._chartjs.listeners.forEach((object)=>{ + if (typeof object[method] === 'function') { + object[method](...args); + } + }); + return res; + } + }); + }); +} +function unlistenArrayEvents(array, listener) { + const stub = array._chartjs; + if (!stub) { + return; + } + const listeners = stub.listeners; + const index = listeners.indexOf(listener); + if (index !== -1) { + listeners.splice(index, 1); + } + if (listeners.length > 0) { + return; + } + arrayEvents.forEach((key)=>{ + delete array[key]; + }); + delete array._chartjs; +} +/** + * @param items + */ function _arrayUnique(items) { + const set = new Set(items); + if (set.size === items.length) { + return items; + } + return Array.from(set); +} + +function fontString(pixelSize, fontStyle, fontFamily) { + return fontStyle + ' ' + pixelSize + 'px ' + fontFamily; +} +/** +* Request animation polyfill +*/ const requestAnimFrame = function() { + if (typeof window === 'undefined') { + return function(callback) { + return callback(); + }; + } + return window.requestAnimationFrame; +}(); +/** + * Throttles calling `fn` once per animation frame + * Latest arguments are used on the actual call + */ function throttled(fn, thisArg) { + let argsToUse = []; + let ticking = false; + return function(...args) { + // Save the args for use later + argsToUse = args; + if (!ticking) { + ticking = true; + requestAnimFrame.call(window, ()=>{ + ticking = false; + fn.apply(thisArg, argsToUse); + }); + } + }; +} +/** + * Debounces calling `fn` for `delay` ms + */ function debounce(fn, delay) { + let timeout; + return function(...args) { + if (delay) { + clearTimeout(timeout); + timeout = setTimeout(fn, delay, args); + } else { + fn.apply(this, args); + } + return delay; + }; +} +/** + * Converts 'start' to 'left', 'end' to 'right' and others to 'center' + * @private + */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center'; +/** + * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center` + * @private + */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2; +/** + * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left` + * @private + */ const _textX = (align, left, right, rtl)=>{ + const check = rtl ? 'left' : 'right'; + return align === check ? right : align === 'center' ? (left + right) / 2 : left; +}; +/** + * Return start and count of visible points. + * @private + */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) { + const pointCount = points.length; + let start = 0; + let count = pointCount; + if (meta._sorted) { + const { iScale , _parsed } = meta; + const axis = iScale.axis; + const { min , max , minDefined , maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1); + } + if (maxDefined) { + count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start; + } else { + count = pointCount - start; + } + } + return { + start, + count + }; +} +/** + * Checks if the scale ranges have changed. + * @param {object} meta - dataset meta. + * @returns {boolean} + * @private + */ function _scaleRangesChanged(meta) { + const { xScale , yScale , _scaleRanges } = meta; + const newRanges = { + xmin: xScale.min, + xmax: xScale.max, + ymin: yScale.min, + ymax: yScale.max + }; + if (!_scaleRanges) { + meta._scaleRanges = newRanges; + return true; + } + const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max; + Object.assign(_scaleRanges, newRanges); + return changed; +} + +const atEdge = (t)=>t === 0 || t === 1; +const elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p)); +const elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1; +/** + * Easing functions adapted from Robert Penner's easing equations. + * @namespace Chart.helpers.easing.effects + * @see http://www.robertpenner.com/easing/ + */ const effects = { + linear: (t)=>t, + easeInQuad: (t)=>t * t, + easeOutQuad: (t)=>-t * (t - 2), + easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1), + easeInCubic: (t)=>t * t * t, + easeOutCubic: (t)=>(t -= 1) * t * t + 1, + easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2), + easeInQuart: (t)=>t * t * t * t, + easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1), + easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2), + easeInQuint: (t)=>t * t * t * t * t, + easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1, + easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2), + easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1, + easeOutSine: (t)=>Math.sin(t * HALF_PI), + easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1), + easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)), + easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1, + easeInOutExpo: (t)=>atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2), + easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1), + easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t), + easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1), + easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3), + easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3), + easeInOutElastic (t) { + const s = 0.1125; + const p = 0.45; + return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p); + }, + easeInBack (t) { + const s = 1.70158; + return t * t * ((s + 1) * t - s); + }, + easeOutBack (t) { + const s = 1.70158; + return (t -= 1) * t * ((s + 1) * t + s) + 1; + }, + easeInOutBack (t) { + let s = 1.70158; + if ((t /= 0.5) < 1) { + return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s)); + } + return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2); + }, + easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t), + easeOutBounce (t) { + const m = 7.5625; + const d = 2.75; + if (t < 1 / d) { + return m * t * t; + } + if (t < 2 / d) { + return m * (t -= 1.5 / d) * t + 0.75; + } + if (t < 2.5 / d) { + return m * (t -= 2.25 / d) * t + 0.9375; + } + return m * (t -= 2.625 / d) * t + 0.984375; + }, + easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5 +}; + +function isPatternOrGradient(value) { + if (value && typeof value === 'object') { + const type = value.toString(); + return type === '[object CanvasPattern]' || type === '[object CanvasGradient]'; + } + return false; +} +function color(value) { + return isPatternOrGradient(value) ? value : new Color(value); +} +function getHoverColor(value) { + return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString(); +} + +const numbers = [ + 'x', + 'y', + 'borderWidth', + 'radius', + 'tension' +]; +const colors = [ + 'color', + 'borderColor', + 'backgroundColor' +]; +function applyAnimationsDefaults(defaults) { + defaults.set('animation', { + delay: undefined, + duration: 1000, + easing: 'easeOutQuart', + fn: undefined, + from: undefined, + loop: undefined, + to: undefined, + type: undefined + }); + defaults.describe('animation', { + _fallback: false, + _indexable: false, + _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn' + }); + defaults.set('animations', { + colors: { + type: 'color', + properties: colors + }, + numbers: { + type: 'number', + properties: numbers + } + }); + defaults.describe('animations', { + _fallback: 'animation' + }); + defaults.set('transitions', { + active: { + animation: { + duration: 400 + } + }, + resize: { + animation: { + duration: 0 + } + }, + show: { + animations: { + colors: { + from: 'transparent' + }, + visible: { + type: 'boolean', + duration: 0 + } + } + }, + hide: { + animations: { + colors: { + to: 'transparent' + }, + visible: { + type: 'boolean', + easing: 'linear', + fn: (v)=>v | 0 + } + } + } + }); +} + +function applyLayoutsDefaults(defaults) { + defaults.set('layout', { + autoPadding: true, + padding: { + top: 0, + right: 0, + bottom: 0, + left: 0 + } + }); +} + +const intlCache = new Map(); +function getNumberFormat(locale, options) { + options = options || {}; + const cacheKey = locale + JSON.stringify(options); + let formatter = intlCache.get(cacheKey); + if (!formatter) { + formatter = new Intl.NumberFormat(locale, options); + intlCache.set(cacheKey, formatter); + } + return formatter; +} +function formatNumber(num, locale, options) { + return getNumberFormat(locale, options).format(num); +} + +const formatters = { + values (value) { + return isArray(value) ? value : '' + value; + }, + numeric (tickValue, index, ticks) { + if (tickValue === 0) { + return '0'; + } + const locale = this.chart.options.locale; + let notation; + let delta = tickValue; + if (ticks.length > 1) { + const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value)); + if (maxTick < 1e-4 || maxTick > 1e+15) { + notation = 'scientific'; + } + delta = calculateDelta(tickValue, ticks); + } + const logDelta = log10(Math.abs(delta)); + const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0); + const options = { + notation, + minimumFractionDigits: numDecimal, + maximumFractionDigits: numDecimal + }; + Object.assign(options, this.options.ticks.format); + return formatNumber(tickValue, locale, options); + }, + logarithmic (tickValue, index, ticks) { + if (tickValue === 0) { + return '0'; + } + const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue))); + if ([ + 1, + 2, + 3, + 5, + 10, + 15 + ].includes(remain) || index > 0.8 * ticks.length) { + return formatters.numeric.call(this, tickValue, index, ticks); + } + return ''; + } +}; +function calculateDelta(tickValue, ticks) { + let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value; + if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) { + delta = tickValue - Math.floor(tickValue); + } + return delta; +} + var Ticks = { + formatters +}; + +function applyScaleDefaults(defaults) { + defaults.set('scale', { + display: true, + offset: false, + reverse: false, + beginAtZero: false, + bounds: 'ticks', + clip: true, + grace: 0, + grid: { + display: true, + lineWidth: 1, + drawOnChartArea: true, + drawTicks: true, + tickLength: 8, + tickWidth: (_ctx, options)=>options.lineWidth, + tickColor: (_ctx, options)=>options.color, + offset: false + }, + border: { + display: true, + dash: [], + dashOffset: 0.0, + width: 1 + }, + title: { + display: false, + text: '', + padding: { + top: 4, + bottom: 4 + } + }, + ticks: { + minRotation: 0, + maxRotation: 50, + mirror: false, + textStrokeWidth: 0, + textStrokeColor: '', + padding: 3, + display: true, + autoSkip: true, + autoSkipPadding: 3, + labelOffset: 0, + callback: Ticks.formatters.values, + minor: {}, + major: {}, + align: 'center', + crossAlign: 'near', + showLabelBackdrop: false, + backdropColor: 'rgba(255, 255, 255, 0.75)', + backdropPadding: 2 + } + }); + defaults.route('scale.ticks', 'color', '', 'color'); + defaults.route('scale.grid', 'color', '', 'borderColor'); + defaults.route('scale.border', 'color', '', 'borderColor'); + defaults.route('scale.title', 'color', '', 'color'); + defaults.describe('scale', { + _fallback: false, + _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser', + _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash' + }); + defaults.describe('scales', { + _fallback: 'scale' + }); + defaults.describe('scale.ticks', { + _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback', + _indexable: (name)=>name !== 'backdropPadding' + }); +} + +const overrides = Object.create(null); +const descriptors = Object.create(null); + function getScope$1(node, key) { + if (!key) { + return node; + } + const keys = key.split('.'); + for(let i = 0, n = keys.length; i < n; ++i){ + const k = keys[i]; + node = node[k] || (node[k] = Object.create(null)); + } + return node; +} +function set(root, scope, values) { + if (typeof scope === 'string') { + return merge(getScope$1(root, scope), values); + } + return merge(getScope$1(root, ''), scope); +} + class Defaults { + constructor(_descriptors, _appliers){ + this.animation = undefined; + this.backgroundColor = 'rgba(0,0,0,0.1)'; + this.borderColor = 'rgba(0,0,0,0.1)'; + this.color = '#666'; + this.datasets = {}; + this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio(); + this.elements = {}; + this.events = [ + 'mousemove', + 'mouseout', + 'click', + 'touchstart', + 'touchmove' + ]; + this.font = { + family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + size: 12, + style: 'normal', + lineHeight: 1.2, + weight: null + }; + this.hover = {}; + this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor); + this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor); + this.hoverColor = (ctx, options)=>getHoverColor(options.color); + this.indexAxis = 'x'; + this.interaction = { + mode: 'nearest', + intersect: true, + includeInvisible: false + }; + this.maintainAspectRatio = true; + this.onHover = null; + this.onClick = null; + this.parsing = true; + this.plugins = {}; + this.responsive = true; + this.scale = undefined; + this.scales = {}; + this.showLine = true; + this.drawActiveElementsOnTop = true; + this.describe(_descriptors); + this.apply(_appliers); + } + set(scope, values) { + return set(this, scope, values); + } + get(scope) { + return getScope$1(this, scope); + } + describe(scope, values) { + return set(descriptors, scope, values); + } + override(scope, values) { + return set(overrides, scope, values); + } + route(scope, name, targetScope, targetName) { + const scopeObject = getScope$1(this, scope); + const targetScopeObject = getScope$1(this, targetScope); + const privateName = '_' + name; + Object.defineProperties(scopeObject, { + [privateName]: { + value: scopeObject[name], + writable: true + }, + [name]: { + enumerable: true, + get () { + const local = this[privateName]; + const target = targetScopeObject[targetName]; + if (isObject(local)) { + return Object.assign({}, target, local); + } + return valueOrDefault(local, target); + }, + set (value) { + this[privateName] = value; + } + } + }); + } + apply(appliers) { + appliers.forEach((apply)=>apply(this)); + } +} +var defaults = /* #__PURE__ */ new Defaults({ + _scriptable: (name)=>!name.startsWith('on'), + _indexable: (name)=>name !== 'events', + hover: { + _fallback: 'interaction' + }, + interaction: { + _scriptable: false, + _indexable: false + } +}, [ + applyAnimationsDefaults, + applyLayoutsDefaults, + applyScaleDefaults +]); + +/** + * Converts the given font object into a CSS font string. + * @param font - A font object. + * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font + * @private + */ function toFontString(font) { + if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) { + return null; + } + return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family; +} +/** + * @private + */ function _measureText(ctx, data, gc, longest, string) { + let textWidth = data[string]; + if (!textWidth) { + textWidth = data[string] = ctx.measureText(string).width; + gc.push(string); + } + if (textWidth > longest) { + longest = textWidth; + } + return longest; +} +/** + * @private + */ // eslint-disable-next-line complexity +function _longestText(ctx, font, arrayOfThings, cache) { + cache = cache || {}; + let data = cache.data = cache.data || {}; + let gc = cache.garbageCollect = cache.garbageCollect || []; + if (cache.font !== font) { + data = cache.data = {}; + gc = cache.garbageCollect = []; + cache.font = font; + } + ctx.save(); + ctx.font = font; + let longest = 0; + const ilen = arrayOfThings.length; + let i, j, jlen, thing, nestedThing; + for(i = 0; i < ilen; i++){ + thing = arrayOfThings[i]; + // Undefined strings and arrays should not be measured + if (thing !== undefined && thing !== null && !isArray(thing)) { + longest = _measureText(ctx, data, gc, longest, thing); + } else if (isArray(thing)) { + // if it is an array lets measure each element + // to do maybe simplify this function a bit so we can do this more recursively? + for(j = 0, jlen = thing.length; j < jlen; j++){ + nestedThing = thing[j]; + // Undefined strings and arrays should not be measured + if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) { + longest = _measureText(ctx, data, gc, longest, nestedThing); + } + } + } + } + ctx.restore(); + const gcLen = gc.length / 2; + if (gcLen > arrayOfThings.length) { + for(i = 0; i < gcLen; i++){ + delete data[gc[i]]; + } + gc.splice(0, gcLen); + } + return longest; +} +/** + * Returns the aligned pixel value to avoid anti-aliasing blur + * @param chart - The chart instance. + * @param pixel - A pixel value. + * @param width - The width of the element. + * @returns The aligned pixel value. + * @private + */ function _alignPixel(chart, pixel, width) { + const devicePixelRatio = chart.currentDevicePixelRatio; + const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0; + return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth; +} +/** + * Clears the entire canvas. + */ function clearCanvas(canvas, ctx) { + if (!ctx && !canvas) { + return; + } + ctx = ctx || canvas.getContext('2d'); + ctx.save(); + // canvas.width and canvas.height do not consider the canvas transform, + // while clearRect does + ctx.resetTransform(); + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.restore(); +} +function drawPoint(ctx, options, x, y) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + drawPointLegend(ctx, options, x, y, null); +} +// eslint-disable-next-line complexity +function drawPointLegend(ctx, options, x, y, w) { + let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW; + const style = options.pointStyle; + const rotation = options.rotation; + const radius = options.radius; + let rad = (rotation || 0) * RAD_PER_DEG; + if (style && typeof style === 'object') { + type = style.toString(); + if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') { + ctx.save(); + ctx.translate(x, y); + ctx.rotate(rad); + ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height); + ctx.restore(); + return; + } + } + if (isNaN(radius) || radius <= 0) { + return; + } + ctx.beginPath(); + switch(style){ + // Default includes circle + default: + if (w) { + ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU); + } else { + ctx.arc(x, y, radius, 0, TAU); + } + ctx.closePath(); + break; + case 'triangle': + width = w ? w / 2 : radius; + ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + ctx.closePath(); + break; + case 'rectRounded': + // NOTE: the rounded rect implementation changed to use `arc` instead of + // `quadraticCurveTo` since it generates better results when rect is + // almost a circle. 0.516 (instead of 0.5) produces results with visually + // closer proportion to the previous impl and it is inscribed in the + // circle with `radius`. For more details, see the following PRs: + // https://github.com/chartjs/Chart.js/issues/5597 + // https://github.com/chartjs/Chart.js/issues/5858 + cornerRadius = radius * 0.516; + size = radius - cornerRadius; + xOffset = Math.cos(rad + QUARTER_PI) * size; + xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size); + yOffset = Math.sin(rad + QUARTER_PI) * size; + yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size); + ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI); + ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad); + ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI); + ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI); + ctx.closePath(); + break; + case 'rect': + if (!rotation) { + size = Math.SQRT1_2 * radius; + width = w ? w / 2 : size; + ctx.rect(x - width, y - size, 2 * width, 2 * size); + break; + } + rad += QUARTER_PI; + /* falls through */ case 'rectRot': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + ctx.closePath(); + break; + case 'crossRot': + rad += QUARTER_PI; + /* falls through */ case 'cross': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case 'star': + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + rad += QUARTER_PI; + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case 'line': + xOffset = w ? w / 2 : Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + break; + case 'dash': + ctx.moveTo(x, y); + ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius); + break; + case false: + ctx.closePath(); + break; + } + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } +} +/** + * Returns true if the point is inside the rectangle + * @param point - The point to test + * @param area - The rectangle + * @param margin - allowed margin + * @private + */ function _isPointInArea(point, area, margin) { + margin = margin || 0.5; // margin - default is to match rounded decimals + return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin; +} +function clipArea(ctx, area) { + ctx.save(); + ctx.beginPath(); + ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top); + ctx.clip(); +} +function unclipArea(ctx) { + ctx.restore(); +} +/** + * @private + */ function _steppedLineTo(ctx, previous, target, flip, mode) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + if (mode === 'middle') { + const midpoint = (previous.x + target.x) / 2.0; + ctx.lineTo(midpoint, previous.y); + ctx.lineTo(midpoint, target.y); + } else if (mode === 'after' !== !!flip) { + ctx.lineTo(previous.x, target.y); + } else { + ctx.lineTo(target.x, previous.y); + } + ctx.lineTo(target.x, target.y); +} +/** + * @private + */ function _bezierCurveTo(ctx, previous, target, flip) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y); +} +function setRenderOpts(ctx, opts) { + if (opts.translation) { + ctx.translate(opts.translation[0], opts.translation[1]); + } + if (!isNullOrUndef(opts.rotation)) { + ctx.rotate(opts.rotation); + } + if (opts.color) { + ctx.fillStyle = opts.color; + } + if (opts.textAlign) { + ctx.textAlign = opts.textAlign; + } + if (opts.textBaseline) { + ctx.textBaseline = opts.textBaseline; + } +} +function decorateText(ctx, x, y, line, opts) { + if (opts.strikethrough || opts.underline) { + /** + * Now that IE11 support has been dropped, we can use more + * of the TextMetrics object. The actual bounding boxes + * are unflagged in Chrome, Firefox, Edge, and Safari so they + * can be safely used. + * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility + */ const metrics = ctx.measureText(line); + const left = x - metrics.actualBoundingBoxLeft; + const right = x + metrics.actualBoundingBoxRight; + const top = y - metrics.actualBoundingBoxAscent; + const bottom = y + metrics.actualBoundingBoxDescent; + const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom; + ctx.strokeStyle = ctx.fillStyle; + ctx.beginPath(); + ctx.lineWidth = opts.decorationWidth || 2; + ctx.moveTo(left, yDecoration); + ctx.lineTo(right, yDecoration); + ctx.stroke(); + } +} +function drawBackdrop(ctx, opts) { + const oldColor = ctx.fillStyle; + ctx.fillStyle = opts.color; + ctx.fillRect(opts.left, opts.top, opts.width, opts.height); + ctx.fillStyle = oldColor; +} +/** + * Render text onto the canvas + */ function renderText(ctx, text, x, y, font, opts = {}) { + const lines = isArray(text) ? text : [ + text + ]; + const stroke = opts.strokeWidth > 0 && opts.strokeColor !== ''; + let i, line; + ctx.save(); + ctx.font = font.string; + setRenderOpts(ctx, opts); + for(i = 0; i < lines.length; ++i){ + line = lines[i]; + if (opts.backdrop) { + drawBackdrop(ctx, opts.backdrop); + } + if (stroke) { + if (opts.strokeColor) { + ctx.strokeStyle = opts.strokeColor; + } + if (!isNullOrUndef(opts.strokeWidth)) { + ctx.lineWidth = opts.strokeWidth; + } + ctx.strokeText(line, x, y, opts.maxWidth); + } + ctx.fillText(line, x, y, opts.maxWidth); + decorateText(ctx, x, y, line, opts); + y += Number(font.lineHeight); + } + ctx.restore(); +} +/** + * Add a path of a rectangle with rounded corners to the current sub-path + * @param ctx - Context + * @param rect - Bounding rect + */ function addRoundedRectPath(ctx, rect) { + const { x , y , w , h , radius } = rect; + // top left arc + ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true); + // line from top left to bottom left + ctx.lineTo(x, y + h - radius.bottomLeft); + // bottom left arc + ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true); + // line from bottom left to bottom right + ctx.lineTo(x + w - radius.bottomRight, y + h); + // bottom right arc + ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true); + // line from bottom right to top right + ctx.lineTo(x + w, y + radius.topRight); + // top right arc + ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true); + // line from top right to top left + ctx.lineTo(x + radius.topLeft, y); +} + +const LINE_HEIGHT = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/; +const FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/; +/** + * @alias Chart.helpers.options + * @namespace + */ /** + * Converts the given line height `value` in pixels for a specific font `size`. + * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em'). + * @param size - The font size (in pixels) used to resolve relative `value`. + * @returns The effective line height in pixels (size * 1.2 if value is invalid). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height + * @since 2.7.0 + */ function toLineHeight(value, size) { + const matches = ('' + value).match(LINE_HEIGHT); + if (!matches || matches[1] === 'normal') { + return size * 1.2; + } + value = +matches[2]; + switch(matches[3]){ + case 'px': + return value; + case '%': + value /= 100; + break; + } + return size * value; +} +const numberOrZero = (v)=>+v || 0; +function _readValueToProps(value, props) { + const ret = {}; + const objProps = isObject(props); + const keys = objProps ? Object.keys(props) : props; + const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value; + for (const prop of keys){ + ret[prop] = numberOrZero(read(prop)); + } + return ret; +} +/** + * Converts the given value into a TRBL object. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left) + * @since 3.0.0 + */ function toTRBL(value) { + return _readValueToProps(value, { + top: 'y', + right: 'x', + bottom: 'y', + left: 'x' + }); +} +/** + * Converts the given value into a TRBL corners object (similar with css border-radius). + * @param value - If a number, set the value to all TRBL corner components, + * else, if an object, use defined properties and sets undefined ones to 0. + * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight) + * @since 3.0.0 + */ function toTRBLCorners(value) { + return _readValueToProps(value, [ + 'topLeft', + 'topRight', + 'bottomLeft', + 'bottomRight' + ]); +} +/** + * Converts the given value into a padding object with pre-computed width/height. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left, width, height) + * @since 2.7.0 + */ function toPadding(value) { + const obj = toTRBL(value); + obj.width = obj.left + obj.right; + obj.height = obj.top + obj.bottom; + return obj; +} +/** + * Parses font options and returns the font object. + * @param options - A object that contains font options to be parsed. + * @param fallback - A object that contains fallback font options. + * @return The font object. + * @private + */ function toFont(options, fallback) { + options = options || {}; + fallback = fallback || defaults.font; + let size = valueOrDefault(options.size, fallback.size); + if (typeof size === 'string') { + size = parseInt(size, 10); + } + let style = valueOrDefault(options.style, fallback.style); + if (style && !('' + style).match(FONT_STYLE)) { + console.warn('Invalid font style specified: "' + style + '"'); + style = undefined; + } + const font = { + family: valueOrDefault(options.family, fallback.family), + lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size), + size, + style, + weight: valueOrDefault(options.weight, fallback.weight), + string: '' + }; + font.string = toFontString(font); + return font; +} +/** + * Evaluates the given `inputs` sequentially and returns the first defined value. + * @param inputs - An array of values, falling back to the last value. + * @param context - If defined and the current value is a function, the value + * is called with `context` as first argument and the result becomes the new input. + * @param index - If defined and the current value is an array, the value + * at `index` become the new input. + * @param info - object to return information about resolution in + * @param info.cacheable - Will be set to `false` if option is not cacheable. + * @since 2.7.0 + */ function resolve(inputs, context, index, info) { + let cacheable = true; + let i, ilen, value; + for(i = 0, ilen = inputs.length; i < ilen; ++i){ + value = inputs[i]; + if (value === undefined) { + continue; + } + if (context !== undefined && typeof value === 'function') { + value = value(context); + cacheable = false; + } + if (index !== undefined && isArray(value)) { + value = value[index % value.length]; + cacheable = false; + } + if (value !== undefined) { + if (info && !cacheable) { + info.cacheable = false; + } + return value; + } + } +} +/** + * @param minmax + * @param grace + * @param beginAtZero + * @private + */ function _addGrace(minmax, grace, beginAtZero) { + const { min , max } = minmax; + const change = toDimension(grace, (max - min) / 2); + const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add; + return { + min: keepZero(min, -Math.abs(change)), + max: keepZero(max, change) + }; +} +function createContext(parentContext, context) { + return Object.assign(Object.create(parentContext), context); +} + +/** + * Creates a Proxy for resolving raw values for options. + * @param scopes - The option scopes to look for values, in resolution order + * @param prefixes - The prefixes for values, in resolution order. + * @param rootScopes - The root option scopes + * @param fallback - Parent scopes fallback + * @param getTarget - callback for getting the target for changed values + * @returns Proxy + * @private + */ function _createResolver(scopes, prefixes = [ + '' +], rootScopes, fallback, getTarget = ()=>scopes[0]) { + const finalRootScopes = rootScopes || scopes; + if (typeof fallback === 'undefined') { + fallback = _resolve('_fallback', scopes); + } + const cache = { + [Symbol.toStringTag]: 'Object', + _cacheable: true, + _scopes: scopes, + _rootScopes: finalRootScopes, + _fallback: fallback, + _getTarget: getTarget, + override: (scope)=>_createResolver([ + scope, + ...scopes + ], prefixes, finalRootScopes, fallback) + }; + return new Proxy(cache, { + /** + * A trap for the delete operator. + */ deleteProperty (target, prop) { + delete target[prop]; // remove from cache + delete target._keys; // remove cached keys + delete scopes[0][prop]; // remove from top level scope + return true; + }, + /** + * A trap for getting property values. + */ get (target, prop) { + return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ getOwnPropertyDescriptor (target, prop) { + return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ getPrototypeOf () { + return Reflect.getPrototypeOf(scopes[0]); + }, + /** + * A trap for the in operator. + */ has (target, prop) { + return getKeysFromAllScopes(target).includes(prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ ownKeys (target) { + return getKeysFromAllScopes(target); + }, + /** + * A trap for setting property values. + */ set (target, prop, value) { + const storage = target._storage || (target._storage = getTarget()); + target[prop] = storage[prop] = value; // set to top level scope + cache + delete target._keys; // remove cached keys + return true; + } + }); +} +/** + * Returns an Proxy for resolving option values with context. + * @param proxy - The Proxy returned by `_createResolver` + * @param context - Context object for scriptable/indexable options + * @param subProxy - The proxy provided for scriptable options + * @param descriptorDefaults - Defaults for descriptors + * @private + */ function _attachContext(proxy, context, subProxy, descriptorDefaults) { + const cache = { + _cacheable: false, + _proxy: proxy, + _context: context, + _subProxy: subProxy, + _stack: new Set(), + _descriptors: _descriptors(proxy, descriptorDefaults), + setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults), + override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults) + }; + return new Proxy(cache, { + /** + * A trap for the delete operator. + */ deleteProperty (target, prop) { + delete target[prop]; // remove from cache + delete proxy[prop]; // remove from proxy + return true; + }, + /** + * A trap for getting property values. + */ get (target, prop, receiver) { + return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ getOwnPropertyDescriptor (target, prop) { + return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? { + enumerable: true, + configurable: true + } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ getPrototypeOf () { + return Reflect.getPrototypeOf(proxy); + }, + /** + * A trap for the in operator. + */ has (target, prop) { + return Reflect.has(proxy, prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ ownKeys () { + return Reflect.ownKeys(proxy); + }, + /** + * A trap for setting property values. + */ set (target, prop, value) { + proxy[prop] = value; // set to proxy + delete target[prop]; // remove from cache + return true; + } + }); +} +/** + * @private + */ function _descriptors(proxy, defaults = { + scriptable: true, + indexable: true +}) { + const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy; + return { + allKeys: _allKeys, + scriptable: _scriptable, + indexable: _indexable, + isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable, + isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable + }; +} +const readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name; +const needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object); +function _cached(target, prop, resolve) { + if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') { + return target[prop]; + } + const value = resolve(); + // cache the resolved value + target[prop] = value; + return value; +} +function _resolveWithContext(target, prop, receiver) { + const { _proxy , _context , _subProxy , _descriptors: descriptors } = target; + let value = _proxy[prop]; // resolve from proxy + // resolve with context + if (isFunction(value) && descriptors.isScriptable(prop)) { + value = _resolveScriptable(prop, value, target, receiver); + } + if (isArray(value) && value.length) { + value = _resolveArray(prop, value, target, descriptors.isIndexable); + } + if (needsSubResolver(prop, value)) { + // if the resolved value is an object, create a sub resolver for it + value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors); + } + return value; +} +function _resolveScriptable(prop, getValue, target, receiver) { + const { _proxy , _context , _subProxy , _stack } = target; + if (_stack.has(prop)) { + throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop); + } + _stack.add(prop); + let value = getValue(_context, _subProxy || receiver); + _stack.delete(prop); + if (needsSubResolver(prop, value)) { + // When scriptable option returns an object, create a resolver on that. + value = createSubResolver(_proxy._scopes, _proxy, prop, value); + } + return value; +} +function _resolveArray(prop, value, target, isIndexable) { + const { _proxy , _context , _subProxy , _descriptors: descriptors } = target; + if (typeof _context.index !== 'undefined' && isIndexable(prop)) { + return value[_context.index % value.length]; + } else if (isObject(value[0])) { + // Array of objects, return array or resolvers + const arr = value; + const scopes = _proxy._scopes.filter((s)=>s !== arr); + value = []; + for (const item of arr){ + const resolver = createSubResolver(scopes, _proxy, prop, item); + value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors)); + } + } + return value; +} +function resolveFallback(fallback, prop, value) { + return isFunction(fallback) ? fallback(prop, value) : fallback; +} +const getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined; +function addScopes(set, parentScopes, key, parentFallback, value) { + for (const parent of parentScopes){ + const scope = getScope(key, parent); + if (scope) { + set.add(scope); + const fallback = resolveFallback(scope._fallback, key, value); + if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) { + // When we reach the descriptor that defines a new _fallback, return that. + // The fallback will resume to that new scope. + return fallback; + } + } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) { + // Fallback to `false` results to `false`, when falling back to different key. + // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations` + return null; + } + } + return false; +} +function createSubResolver(parentScopes, resolver, prop, value) { + const rootScopes = resolver._rootScopes; + const fallback = resolveFallback(resolver._fallback, prop, value); + const allScopes = [ + ...parentScopes, + ...rootScopes + ]; + const set = new Set(); + set.add(value); + let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value); + if (key === null) { + return false; + } + if (typeof fallback !== 'undefined' && fallback !== prop) { + key = addScopesFromKey(set, allScopes, fallback, key, value); + if (key === null) { + return false; + } + } + return _createResolver(Array.from(set), [ + '' + ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value)); +} +function addScopesFromKey(set, allScopes, key, fallback, item) { + while(key){ + key = addScopes(set, allScopes, key, fallback, item); + } + return key; +} +function subGetTarget(resolver, prop, value) { + const parent = resolver._getTarget(); + if (!(prop in parent)) { + parent[prop] = {}; + } + const target = parent[prop]; + if (isArray(target) && isObject(value)) { + // For array of objects, the object is used to store updated values + return value; + } + return target || {}; +} +function _resolveWithPrefixes(prop, prefixes, scopes, proxy) { + let value; + for (const prefix of prefixes){ + value = _resolve(readKey(prefix, prop), scopes); + if (typeof value !== 'undefined') { + return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value; + } + } +} +function _resolve(key, scopes) { + for (const scope of scopes){ + if (!scope) { + continue; + } + const value = scope[key]; + if (typeof value !== 'undefined') { + return value; + } + } +} +function getKeysFromAllScopes(target) { + let keys = target._keys; + if (!keys) { + keys = target._keys = resolveKeysFromAllScopes(target._scopes); + } + return keys; +} +function resolveKeysFromAllScopes(scopes) { + const set = new Set(); + for (const scope of scopes){ + for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){ + set.add(key); + } + } + return Array.from(set); +} +function _parseObjectDataRadialScale(meta, data, start, count) { + const { iScale } = meta; + const { key ='r' } = this._parsing; + const parsed = new Array(count); + let i, ilen, index, item; + for(i = 0, ilen = count; i < ilen; ++i){ + index = i + start; + item = data[index]; + parsed[i] = { + r: iScale.parse(resolveObjectKey(item, key), index) + }; + } + return parsed; +} + +const EPSILON = Number.EPSILON || 1e-14; +const getPoint = (points, i)=>i < points.length && !points[i].skip && points[i]; +const getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x'; +function splineCurve(firstPoint, middlePoint, afterPoint, t) { + // Props to Rob Spencer at scaled innovation for his post on splining between points + // http://scaledinnovation.com/analytics/splines/aboutSplines.html + // This function must also respect "skipped" points + const previous = firstPoint.skip ? middlePoint : firstPoint; + const current = middlePoint; + const next = afterPoint.skip ? middlePoint : afterPoint; + const d01 = distanceBetweenPoints(current, previous); + const d12 = distanceBetweenPoints(next, current); + let s01 = d01 / (d01 + d12); + let s12 = d12 / (d01 + d12); + // If all points are the same, s01 & s02 will be inf + s01 = isNaN(s01) ? 0 : s01; + s12 = isNaN(s12) ? 0 : s12; + const fa = t * s01; // scaling factor for triangle Ta + const fb = t * s12; + return { + previous: { + x: current.x - fa * (next.x - previous.x), + y: current.y - fa * (next.y - previous.y) + }, + next: { + x: current.x + fb * (next.x - previous.x), + y: current.y + fb * (next.y - previous.y) + } + }; +} +/** + * Adjust tangents to ensure monotonic properties + */ function monotoneAdjust(points, deltaK, mK) { + const pointsLen = points.length; + let alphaK, betaK, tauK, squaredMagnitude, pointCurrent; + let pointAfter = getPoint(points, 0); + for(let i = 0; i < pointsLen - 1; ++i){ + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent || !pointAfter) { + continue; + } + if (almostEquals(deltaK[i], 0, EPSILON)) { + mK[i] = mK[i + 1] = 0; + continue; + } + alphaK = mK[i] / deltaK[i]; + betaK = mK[i + 1] / deltaK[i]; + squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2); + if (squaredMagnitude <= 9) { + continue; + } + tauK = 3 / Math.sqrt(squaredMagnitude); + mK[i] = alphaK * tauK * deltaK[i]; + mK[i + 1] = betaK * tauK * deltaK[i]; + } +} +function monotoneCompute(points, mK, indexAxis = 'x') { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + let delta, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for(let i = 0; i < pointsLen; ++i){ + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + const iPixel = pointCurrent[indexAxis]; + const vPixel = pointCurrent[valueAxis]; + if (pointBefore) { + delta = (iPixel - pointBefore[indexAxis]) / 3; + pointCurrent[`cp1${indexAxis}`] = iPixel - delta; + pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i]; + } + if (pointAfter) { + delta = (pointAfter[indexAxis] - iPixel) / 3; + pointCurrent[`cp2${indexAxis}`] = iPixel + delta; + pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i]; + } + } +} +/** + * This function calculates Bézier control points in a similar way than |splineCurve|, + * but preserves monotonicity of the provided data and ensures no local extremums are added + * between the dataset discrete points due to the interpolation. + * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation + */ function splineCurveMonotone(points, indexAxis = 'x') { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + const deltaK = Array(pointsLen).fill(0); + const mK = Array(pointsLen); + // Calculate slopes (deltaK) and initialize tangents (mK) + let i, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for(i = 0; i < pointsLen; ++i){ + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + if (pointAfter) { + const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis]; + // In the case of two points that appear at the same x pixel, slopeDeltaX is 0 + deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0; + } + mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2; + } + monotoneAdjust(points, deltaK, mK); + monotoneCompute(points, mK, indexAxis); +} +function capControlPoint(pt, min, max) { + return Math.max(Math.min(pt, max), min); +} +function capBezierPoints(points, area) { + let i, ilen, point, inArea, inAreaPrev; + let inAreaNext = _isPointInArea(points[0], area); + for(i = 0, ilen = points.length; i < ilen; ++i){ + inAreaPrev = inArea; + inArea = inAreaNext; + inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area); + if (!inArea) { + continue; + } + point = points[i]; + if (inAreaPrev) { + point.cp1x = capControlPoint(point.cp1x, area.left, area.right); + point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom); + } + if (inAreaNext) { + point.cp2x = capControlPoint(point.cp2x, area.left, area.right); + point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom); + } + } +} +/** + * @private + */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) { + let i, ilen, point, controlPoints; + // Only consider points that are drawn in case the spanGaps option is used + if (options.spanGaps) { + points = points.filter((pt)=>!pt.skip); + } + if (options.cubicInterpolationMode === 'monotone') { + splineCurveMonotone(points, indexAxis); + } else { + let prev = loop ? points[points.length - 1] : points[0]; + for(i = 0, ilen = points.length; i < ilen; ++i){ + point = points[i]; + controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension); + point.cp1x = controlPoints.previous.x; + point.cp1y = controlPoints.previous.y; + point.cp2x = controlPoints.next.x; + point.cp2y = controlPoints.next.y; + prev = point; + } + } + if (options.capBezierPoints) { + capBezierPoints(points, area); + } +} + +/** + * Note: typedefs are auto-exported, so use a made-up `dom` namespace where + * necessary to avoid duplicates with `export * from './helpers`; see + * https://github.com/microsoft/TypeScript/issues/46011 + * @typedef { import('../core/core.controller.js').default } dom.Chart + * @typedef { import('../../types').ChartEvent } ChartEvent + */ /** + * @private + */ function _isDomSupported() { + return typeof window !== 'undefined' && typeof document !== 'undefined'; +} +/** + * @private + */ function _getParentNode(domNode) { + let parent = domNode.parentNode; + if (parent && parent.toString() === '[object ShadowRoot]') { + parent = parent.host; + } + return parent; +} +/** + * convert max-width/max-height values that may be percentages into a number + * @private + */ function parseMaxStyle(styleValue, node, parentProperty) { + let valueInPixels; + if (typeof styleValue === 'string') { + valueInPixels = parseInt(styleValue, 10); + if (styleValue.indexOf('%') !== -1) { + // percentage * size in dimension + valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty]; + } + } else { + valueInPixels = styleValue; + } + return valueInPixels; +} +const getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null); +function getStyle(el, property) { + return getComputedStyle(el).getPropertyValue(property); +} +const positions = [ + 'top', + 'right', + 'bottom', + 'left' +]; +function getPositionedStyle(styles, style, suffix) { + const result = {}; + suffix = suffix ? '-' + suffix : ''; + for(let i = 0; i < 4; i++){ + const pos = positions[i]; + result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0; + } + result.width = result.left + result.right; + result.height = result.top + result.bottom; + return result; +} +const useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot); +/** + * @param e + * @param canvas + * @returns Canvas position + */ function getCanvasPosition(e, canvas) { + const touches = e.touches; + const source = touches && touches.length ? touches[0] : e; + const { offsetX , offsetY } = source; + let box = false; + let x, y; + if (useOffsetPos(offsetX, offsetY, e.target)) { + x = offsetX; + y = offsetY; + } else { + const rect = canvas.getBoundingClientRect(); + x = source.clientX - rect.left; + y = source.clientY - rect.top; + box = true; + } + return { + x, + y, + box + }; +} +/** + * Gets an event's x, y coordinates, relative to the chart area + * @param event + * @param chart + * @returns x and y coordinates of the event + */ function getRelativePosition(event, chart) { + if ('native' in event) { + return event; + } + const { canvas , currentDevicePixelRatio } = chart; + const style = getComputedStyle(canvas); + const borderBox = style.boxSizing === 'border-box'; + const paddings = getPositionedStyle(style, 'padding'); + const borders = getPositionedStyle(style, 'border', 'width'); + const { x , y , box } = getCanvasPosition(event, canvas); + const xOffset = paddings.left + (box && borders.left); + const yOffset = paddings.top + (box && borders.top); + let { width , height } = chart; + if (borderBox) { + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + return { + x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio), + y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio) + }; +} +function getContainerSize(canvas, width, height) { + let maxWidth, maxHeight; + if (width === undefined || height === undefined) { + const container = canvas && _getParentNode(canvas); + if (!container) { + width = canvas.clientWidth; + height = canvas.clientHeight; + } else { + const rect = container.getBoundingClientRect(); // this is the border box of the container + const containerStyle = getComputedStyle(container); + const containerBorder = getPositionedStyle(containerStyle, 'border', 'width'); + const containerPadding = getPositionedStyle(containerStyle, 'padding'); + width = rect.width - containerPadding.width - containerBorder.width; + height = rect.height - containerPadding.height - containerBorder.height; + maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth'); + maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight'); + } + } + return { + width, + height, + maxWidth: maxWidth || INFINITY, + maxHeight: maxHeight || INFINITY + }; +} +const round1 = (v)=>Math.round(v * 10) / 10; +// eslint-disable-next-line complexity +function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) { + const style = getComputedStyle(canvas); + const margins = getPositionedStyle(style, 'margin'); + const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY; + const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY; + const containerSize = getContainerSize(canvas, bbWidth, bbHeight); + let { width , height } = containerSize; + if (style.boxSizing === 'content-box') { + const borders = getPositionedStyle(style, 'border', 'width'); + const paddings = getPositionedStyle(style, 'padding'); + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + width = Math.max(0, width - margins.width); + height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height); + width = round1(Math.min(width, maxWidth, containerSize.maxWidth)); + height = round1(Math.min(height, maxHeight, containerSize.maxHeight)); + if (width && !height) { + // https://github.com/chartjs/Chart.js/issues/4659 + // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default) + height = round1(width / 2); + } + const maintainHeight = bbWidth !== undefined || bbHeight !== undefined; + if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) { + height = containerSize.height; + width = round1(Math.floor(height * aspectRatio)); + } + return { + width, + height + }; +} +/** + * @param chart + * @param forceRatio + * @param forceStyle + * @returns True if the canvas context size or transformation has changed. + */ function retinaScale(chart, forceRatio, forceStyle) { + const pixelRatio = forceRatio || 1; + const deviceHeight = Math.floor(chart.height * pixelRatio); + const deviceWidth = Math.floor(chart.width * pixelRatio); + chart.height = Math.floor(chart.height); + chart.width = Math.floor(chart.width); + const canvas = chart.canvas; + // If no style has been set on the canvas, the render size is used as display size, + // making the chart visually bigger, so let's enforce it to the "correct" values. + // See https://github.com/chartjs/Chart.js/issues/3575 + if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) { + canvas.style.height = `${chart.height}px`; + canvas.style.width = `${chart.width}px`; + } + if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) { + chart.currentDevicePixelRatio = pixelRatio; + canvas.height = deviceHeight; + canvas.width = deviceWidth; + chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); + return true; + } + return false; +} +/** + * Detects support for options object argument in addEventListener. + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support + * @private + */ const supportsEventListenerOptions = function() { + let passiveSupported = false; + try { + const options = { + get passive () { + passiveSupported = true; + return false; + } + }; + if (_isDomSupported()) { + window.addEventListener('test', null, options); + window.removeEventListener('test', null, options); + } + } catch (e) { + // continue regardless of error + } + return passiveSupported; +}(); +/** + * The "used" size is the final value of a dimension property after all calculations have + * been performed. This method uses the computed style of `element` but returns undefined + * if the computed style is not expressed in pixels. That can happen in some cases where + * `element` has a size relative to its parent and this last one is not yet displayed, + * for example because of `display: none` on a parent node. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value + * @returns Size in pixels or undefined if unknown. + */ function readUsedSize(element, property) { + const value = getStyle(element, property); + const matches = value && value.match(/^(\d+)(\.\d+)?px$/); + return matches ? +matches[1] : undefined; +} + +/** + * @private + */ function _pointInLine(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: p1.y + t * (p2.y - p1.y) + }; +} +/** + * @private + */ function _steppedInterpolation(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y + }; +} +/** + * @private + */ function _bezierInterpolation(p1, p2, t, mode) { + const cp1 = { + x: p1.cp2x, + y: p1.cp2y + }; + const cp2 = { + x: p2.cp1x, + y: p2.cp1y + }; + const a = _pointInLine(p1, cp1, t); + const b = _pointInLine(cp1, cp2, t); + const c = _pointInLine(cp2, p2, t); + const d = _pointInLine(a, b, t); + const e = _pointInLine(b, c, t); + return _pointInLine(d, e, t); +} + +const getRightToLeftAdapter = function(rectX, width) { + return { + x (x) { + return rectX + rectX + width - x; + }, + setWidth (w) { + width = w; + }, + textAlign (align) { + if (align === 'center') { + return align; + } + return align === 'right' ? 'left' : 'right'; + }, + xPlus (x, value) { + return x - value; + }, + leftForLtr (x, itemWidth) { + return x - itemWidth; + } + }; +}; +const getLeftToRightAdapter = function() { + return { + x (x) { + return x; + }, + setWidth (w) {}, + textAlign (align) { + return align; + }, + xPlus (x, value) { + return x + value; + }, + leftForLtr (x, _itemWidth) { + return x; + } + }; +}; +function getRtlAdapter(rtl, rectX, width) { + return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter(); +} +function overrideTextDirection(ctx, direction) { + let style, original; + if (direction === 'ltr' || direction === 'rtl') { + style = ctx.canvas.style; + original = [ + style.getPropertyValue('direction'), + style.getPropertyPriority('direction') + ]; + style.setProperty('direction', direction, 'important'); + ctx.prevTextDirection = original; + } +} +function restoreTextDirection(ctx, original) { + if (original !== undefined) { + delete ctx.prevTextDirection; + ctx.canvas.style.setProperty('direction', original[0], original[1]); + } +} + +function propertyFn(property) { + if (property === 'angle') { + return { + between: _angleBetween, + compare: _angleDiff, + normalize: _normalizeAngle + }; + } + return { + between: _isBetween, + compare: (a, b)=>a - b, + normalize: (x)=>x + }; +} +function normalizeSegment({ start , end , count , loop , style }) { + return { + start: start % count, + end: end % count, + loop: loop && (end - start + 1) % count === 0, + style + }; +} +function getSegment(segment, points, bounds) { + const { property , start: startBound , end: endBound } = bounds; + const { between , normalize } = propertyFn(property); + const count = points.length; + let { start , end , loop } = segment; + let i, ilen; + if (loop) { + start += count; + end += count; + for(i = 0, ilen = count; i < ilen; ++i){ + if (!between(normalize(points[start % count][property]), startBound, endBound)) { + break; + } + start--; + end--; + } + start %= count; + end %= count; + } + if (end < start) { + end += count; + } + return { + start, + end, + loop, + style: segment.style + }; +} + function _boundSegment(segment, points, bounds) { + if (!bounds) { + return [ + segment + ]; + } + const { property , start: startBound , end: endBound } = bounds; + const count = points.length; + const { compare , between , normalize } = propertyFn(property); + const { start , end , loop , style } = getSegment(segment, points, bounds); + const result = []; + let inside = false; + let subStart = null; + let value, point, prevValue; + const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0; + const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value); + const shouldStart = ()=>inside || startIsBefore(); + const shouldStop = ()=>!inside || endIsBefore(); + for(let i = start, prev = start; i <= end; ++i){ + point = points[i % count]; + if (point.skip) { + continue; + } + value = normalize(point[property]); + if (value === prevValue) { + continue; + } + inside = between(value, startBound, endBound); + if (subStart === null && shouldStart()) { + subStart = compare(value, startBound) === 0 ? i : prev; + } + if (subStart !== null && shouldStop()) { + result.push(normalizeSegment({ + start: subStart, + end: i, + loop, + count, + style + })); + subStart = null; + } + prev = i; + prevValue = value; + } + if (subStart !== null) { + result.push(normalizeSegment({ + start: subStart, + end, + loop, + count, + style + })); + } + return result; +} + function _boundSegments(line, bounds) { + const result = []; + const segments = line.segments; + for(let i = 0; i < segments.length; i++){ + const sub = _boundSegment(segments[i], line.points, bounds); + if (sub.length) { + result.push(...sub); + } + } + return result; +} + function findStartAndEnd(points, count, loop, spanGaps) { + let start = 0; + let end = count - 1; + if (loop && !spanGaps) { + while(start < count && !points[start].skip){ + start++; + } + } + while(start < count && points[start].skip){ + start++; + } + start %= count; + if (loop) { + end += start; + } + while(end > start && points[end % count].skip){ + end--; + } + end %= count; + return { + start, + end + }; +} + function solidSegments(points, start, max, loop) { + const count = points.length; + const result = []; + let last = start; + let prev = points[start]; + let end; + for(end = start + 1; end <= max; ++end){ + const cur = points[end % count]; + if (cur.skip || cur.stop) { + if (!prev.skip) { + loop = false; + result.push({ + start: start % count, + end: (end - 1) % count, + loop + }); + start = last = cur.stop ? end : null; + } + } else { + last = end; + if (prev.skip) { + start = end; + } + } + prev = cur; + } + if (last !== null) { + result.push({ + start: start % count, + end: last % count, + loop + }); + } + return result; +} + function _computeSegments(line, segmentOptions) { + const points = line.points; + const spanGaps = line.options.spanGaps; + const count = points.length; + if (!count) { + return []; + } + const loop = !!line._loop; + const { start , end } = findStartAndEnd(points, count, loop, spanGaps); + if (spanGaps === true) { + return splitByStyles(line, [ + { + start, + end, + loop + } + ], points, segmentOptions); + } + const max = end < start ? end + count : end; + const completeLoop = !!line._fullLoop && start === 0 && end === count - 1; + return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions); +} + function splitByStyles(line, segments, points, segmentOptions) { + if (!segmentOptions || !segmentOptions.setContext || !points) { + return segments; + } + return doSplitByStyles(line, segments, points, segmentOptions); +} + function doSplitByStyles(line, segments, points, segmentOptions) { + const chartContext = line._chart.getContext(); + const baseStyle = readStyle(line.options); + const { _datasetIndex: datasetIndex , options: { spanGaps } } = line; + const count = points.length; + const result = []; + let prevStyle = baseStyle; + let start = segments[0].start; + let i = start; + function addStyle(s, e, l, st) { + const dir = spanGaps ? -1 : 1; + if (s === e) { + return; + } + s += count; + while(points[s % count].skip){ + s -= dir; + } + while(points[e % count].skip){ + e += dir; + } + if (s % count !== e % count) { + result.push({ + start: s % count, + end: e % count, + loop: l, + style: st + }); + prevStyle = st; + start = e % count; + } + } + for (const segment of segments){ + start = spanGaps ? start : segment.start; + let prev = points[start % count]; + let style; + for(i = start + 1; i <= segment.end; i++){ + const pt = points[i % count]; + style = readStyle(segmentOptions.setContext(createContext(chartContext, { + type: 'segment', + p0: prev, + p1: pt, + p0DataIndex: (i - 1) % count, + p1DataIndex: i % count, + datasetIndex + }))); + if (styleChanged(style, prevStyle)) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + prev = pt; + prevStyle = style; + } + if (start < i - 1) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + } + return result; +} +function readStyle(options) { + return { + backgroundColor: options.backgroundColor, + borderCapStyle: options.borderCapStyle, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderJoinStyle: options.borderJoinStyle, + borderWidth: options.borderWidth, + borderColor: options.borderColor + }; +} +function styleChanged(style, prevStyle) { + if (!prevStyle) { + return false; + } + const cache = []; + const replacer = function(key, value) { + if (!isPatternOrGradient(value)) { + return value; + } + if (!cache.includes(value)) { + cache.push(value); + } + return cache.indexOf(value); + }; + return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer); +} + +export { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z }; +//# sourceMappingURL=helpers.segment.js.map diff --git a/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js.map b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js.map new file mode 100644 index 0000000..42921f6 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/chunks/helpers.segment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.segment.js","sources":["../../src/helpers/helpers.core.ts","../../src/helpers/helpers.math.ts","../../src/helpers/helpers.collection.ts","../../src/helpers/helpers.extras.ts","../../src/helpers/helpers.easing.ts","../../src/helpers/helpers.color.ts","../../src/core/core.animations.defaults.js","../../src/core/core.layouts.defaults.js","../../src/helpers/helpers.intl.ts","../../src/core/core.ticks.js","../../src/core/core.scale.defaults.js","../../src/core/core.defaults.js","../../src/helpers/helpers.canvas.ts","../../src/helpers/helpers.options.ts","../../src/helpers/helpers.config.ts","../../src/helpers/helpers.curve.ts","../../src/helpers/helpers.dom.ts","../../src/helpers/helpers.interpolation.ts","../../src/helpers/helpers.rtl.ts","../../src/helpers/helpers.segment.js"],"sourcesContent":["/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n let id = 0;\n return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n return value === null || value === undefined;\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray<T = unknown>(value: unknown): value is T[] {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault<T>(value: T | undefined, defaultValue: T) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(\n fn: T | undefined,\n args: unknown[],\n thisArg?: TA\n): R | undefined {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each<T, TA>(\n loopable: Record<string, T>,\n fn: (this: TA, v: T, i: string) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[],\n fn: (this: TA, v: T, i: number) => void,\n thisArg?: TA,\n reverse?: boolean\n): void;\nexport function each<T, TA>(\n loopable: T[] | Record<string, T>,\n fn: (this: TA, v: T, i: any) => void,\n thisArg?: TA,\n reverse?: boolean\n) {\n let i: number, len: number, keys: string[];\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone<T>(source: T): T {\n if (isArray(source)) {\n return source.map(clone) as unknown as T;\n }\n\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n}\n\nfunction isValidKey(key: string) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\n\nexport interface MergeOptions {\n merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge<T>(target: T, source: [], options?: MergeOptions): T;\nexport function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge<T, S1, S2, S3, S4>(\n target: T,\n source: [S1, S2, S3, S4],\n options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n\n if (!isObject(target)) {\n return target as AnyObject;\n }\n\n options = options || {};\n const merger = options.merger || _merger;\n let current: AnyObject;\n\n for (let i = 0; i < ilen; ++i) {\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n\n const keys = Object.keys(current);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, current, options as AnyObject);\n }\n }\n\n return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf<T>(target: T, source: []): T;\nexport function mergeIf<T, S1>(target: T, source: S1): T & S1;\nexport function mergeIf<T, S1>(target: T, source: [S1]): T & S1;\nexport function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge<T>(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n if (!isValidKey(key)) {\n return;\n }\n\n const tval = target[key];\n const sval = source[key];\n\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': v => v,\n // default resolvers\n x: o => o.x,\n y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n const parts = key.split('.');\n const keys: string[] = [];\n let tmp = '';\n for (const part of parts) {\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n const keys = _splitKey(key);\n return obj => {\n for (const k of keys) {\n if (k === '') {\n // For backward compatibility:\n // Chart.helpers.core resolveObjectKey should break at empty key\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = <T>(a: Set<T>, b: Set<T>) => {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n","import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n const result: number[] = [];\n const sqrt = Math.sqrt(value);\n let i: number;\n\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) { // if value is a square number\n result.push(sqrt);\n }\n\n result.sort((a, b) => a - b).pop();\n return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n array: Record<string, number>[],\n target: { min: number, max: number },\n property: string\n) {\n let i: number, ilen: number, value: number;\n\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\n\nexport function toRadians(degrees: number) {\n return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n if (!isFiniteNumber(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n centrePoint: Point,\n anglePoint: Point\n) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * PI)) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n","import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n table: number[],\n value: number,\n cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup<T>(\n table: T[],\n value: number,\n cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n table: unknown[],\n value: number,\n cmp?: (value: number) => boolean\n) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid: number;\n\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n\n return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number,\n last?: boolean\n) =>\n _lookup(table, value, last\n ? index => {\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n }\n : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n table: Record<string, number>[],\n key: string,\n value: number\n) =>\n _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n let start = 0;\n let end = values.length;\n\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener<T> {\n _onDataPush?(...item: T[]): void;\n _onDataPop?(): void;\n _onDataShift?(): void;\n _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n\n return res;\n }\n });\n });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n\n delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique<T>(items: T[]) {\n const set = new Set<T>(items);\n\n if (set.size === items.length) {\n return items;\n }\n\n return Array.from(set);\n}\n","import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled<TArgs extends Array<any>>(\n fn: (...args: TArgs) => void,\n thisArg: any,\n) {\n let argsToUse = [] as TArgs;\n let ticking = false;\n\n return function(...args: TArgs) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number) {\n let timeout;\n return function(...args: TArgs) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n const pointCount = points.length;\n\n let start = 0;\n let count = pointCount;\n\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n if (minDefined) {\n start = _limitValue(Math.min(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n // @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n\n return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n","import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n linear: (t: number) => t,\n\n easeInQuad: (t: number) => t * t,\n\n easeOutQuad: (t: number) => -t * (t - 2),\n\n easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n\n easeInCubic: (t: number) => t * t * t,\n\n easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n\n easeInQuart: (t: number) => t * t * t * t,\n\n easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n\n easeInQuint: (t: number) => t * t * t * t * t,\n\n easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n easeInOutElastic(t: number) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n\n easeInBack(t: number) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack(t: number) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack(t: number) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n easeOutBounce(t: number) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n\n easeInOutBounce: (t: number) => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n","import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n\n return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n value:\n | string\n | { r: number; g: number; b: number; a: number }\n | [number, number, number]\n | [number, number, number, number]\n): Color;\nexport function color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n","const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n });\n\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n });\n\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n });\n\n defaults.describe('animations', {\n _fallback: 'animation',\n });\n\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0 // show immediately\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n },\n }\n }\n });\n}\n","export function applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n","\nconst intlCache = new Map<string, Intl.NumberFormat>();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n return getNumberFormat(locale, options).format(num);\n}\n","import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {string|string[]} the label to display\n */\n values(value) {\n return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n },\n\n /**\n * Formatter for numeric ticks\n * @method Chart.Ticks.formatters.numeric\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0'; // never show decimal places for 0\n }\n\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n if (ticks.length > 1) {\n // all ticks are small or there huge numbers; use scientific notation\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n\n delta = calculateDelta(tickValue, ticks);\n }\n\n const logDelta = log10(Math.abs(delta));\n\n // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n //\n // toFixed has a max of 20 decimal places\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n\n return formatNumber(tickValue, locale, options);\n },\n\n\n /**\n * Formatter for logarithmic ticks\n * @method Chart.Ticks.formatters.logarithmic\n * @param tickValue {number} the value to be formatted\n * @param index {number} the position of the tickValue parameter in the ticks array\n * @param ticks {object[]} the list of ticks being converted\n * @return {string} string representation of the tickValue parameter\n */\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n // Figure out how many digits to show\n // The space between the first two ticks might be smaller than normal spacing\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n","import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 3.0.0\n */\n bounds: 'ticks',\n\n clip: true,\n\n /**\n * Addition grace added to max and reduced from min data value.\n * @since 3.0.0\n */\n grace: 0,\n\n // grid line settings\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n },\n\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n\n // scale title\n title: {\n // display property\n display: false,\n\n // actual label\n text: '',\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n });\n\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n });\n\n defaults.describe('scales', {\n _fallback: 'scale',\n });\n\n defaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n });\n}\n","import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\n\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope(root, scope), values);\n }\n return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n constructor(_descriptors, _appliers) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n set(scope, values) {\n return set(this, scope, values);\n }\n\n /**\n\t * @param {string} scope\n\t */\n get(scope) {\n return getScope(this, scope);\n }\n\n /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n\n override(scope, values) {\n return set(overrides, scope, values);\n }\n\n /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t * - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope(this, scope);\n const targetScopeObject = getScope(this, targetScope);\n const privateName = '_' + name;\n\n Object.defineProperties(scopeObject, {\n // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n\n apply(appliers) {\n appliers.forEach((apply) => apply(this));\n }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n","import type {\n Chart,\n Point,\n FontSpec,\n CanvasFontSpec,\n PointStyle,\n RenderTextOpts,\n BackdropOptions\n} from '../types/index.js';\nimport type {\n TRBL,\n SplinePoint,\n RoundedRect,\n TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n ctx: CanvasRenderingContext2D,\n data: Record<string, number>,\n gc: string[],\n longest: number,\n string: string\n) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n ctx: CanvasRenderingContext2D,\n font: string,\n arrayOfThings: Things,\n cache?: {data?: Record<string, number>, garbageCollect?: string[], font?: string}\n) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.save();\n\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n\n ctx.restore();\n\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n if (!ctx && !canvas) {\n return;\n }\n\n ctx = ctx || canvas.getContext('2d');\n\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\n\nexport interface DrawPointOptions {\n pointStyle: PointStyle;\n rotation?: number;\n radius: number;\n borderWidth: number;\n}\n\nexport function drawPoint(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number\n) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n ctx: CanvasRenderingContext2D,\n options: DrawPointOptions,\n x: number,\n y: number,\n w: number\n) {\n let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n ctx.beginPath();\n\n switch (style) {\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */\n case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */\n case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n point: Point,\n area: TRBL,\n margin?: number\n) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n ctx: CanvasRenderingContext2D,\n previous: Point,\n target: Point,\n flip?: boolean,\n mode?: string\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n ctx: CanvasRenderingContext2D,\n previous: SplinePoint,\n target: SplinePoint,\n flip?: boolean\n) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\n\nfunction decorateText(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n line: string,\n opts: RenderTextOpts\n) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n const oldColor = ctx.fillStyle;\n\n ctx.fillStyle = opts.color as string;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string | string[],\n x: number,\n y: number,\n font: CanvasFontSpec,\n opts: RenderTextOpts = {}\n) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i: number, line: string;\n\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n\n y += Number(font.lineHeight);\n }\n\n ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n ctx: CanvasRenderingContext2D,\n rect: RoundedRect & { radius: TRBLCorners }\n) {\n const {x, y, w, h, radius} = rect;\n\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n","import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;\nexport function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;\nexport function _readValueToProps(value: number | Record<string, number>, props: string[] | Record<string, string>) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n const obj = toTRBL(value) as ChartArea;\n\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n\n return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>) {\n options = options || {};\n fallback = fallback || defaults.font as FontSpec;\n\n let size = valueOrDefault(options.size, fallback.size);\n\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n\n font.string = toFontString(font);\n return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: { cacheable: boolean }) {\n let cacheable = true;\n let i: number, ilen: number, value: unknown;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext<T extends object>(parentContext: null, context: T): T;\nexport function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n return Object.assign(Object.create(parentContext), context);\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n ResolverObjectKey,\n ResolverCache,\n ResolverProxy,\n DescriptorDefaults,\n Descriptor,\n ContextCache,\n ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n scopes: T,\n prefixes = [''],\n rootScopes?: R,\n fallback?: ResolverObjectKey,\n getTarget = () => scopes[0]\n) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache: ResolverCache<T, R> = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop: string) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop: string) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop: string, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n }) as ResolverProxy<T, R>;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n T extends AnyObject[] = AnyObject[],\n R extends AnyObject[] = T\n>(\n proxy: ResolverProxy<T, R>,\n context: AnyObject,\n subProxy?: ResolverProxy<T, R>,\n descriptorDefaults?: DescriptorDefaults\n) {\n const cache: ContextCache<T, R> = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */\n deleteProperty(target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n\n /**\n * A trap for getting property values.\n */\n get(target, prop: string, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n\n /**\n * A trap for Object.getPrototypeOf.\n */\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n\n /**\n * A trap for the in operator.\n */\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n\n /**\n * A trap for setting property values.\n */\n set(target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n }) as ContextProxy<T, R>;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n proxy: ResolverCache,\n defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n target: AnyObject,\n prop: string,\n resolve: () => unknown\n) {\n if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') {\n return target[prop];\n }\n\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\n\nfunction _resolveWithContext(\n target: ContextCache,\n prop: string,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop]; // resolve from proxy\n\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\n\nfunction _resolveScriptable(\n prop: string,\n getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n target: ContextCache,\n receiver: AnyObject\n) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\n\nfunction _resolveArray(\n prop: string,\n value: unknown[],\n target: ContextCache,\n isIndexable: (key: string) => boolean\n) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\n\nfunction resolveFallback(\n fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n prop: ResolverObjectKey,\n value: unknown\n) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n set: Set<AnyObject>,\n parentScopes: AnyObject[],\n key: ResolverObjectKey,\n parentFallback: ResolverObjectKey,\n value: unknown\n) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\n\nfunction createSubResolver(\n parentScopes: AnyObject[],\n resolver: ResolverCache,\n prop: ResolverObjectKey,\n value: unknown\n) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set<AnyObject>();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n set: Set<AnyObject>,\n allScopes: AnyObject[],\n key: ResolverObjectKey,\n fallback: ResolverObjectKey,\n item: unknown\n) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\n\nfunction subGetTarget(\n resolver: ResolverCache,\n prop: string,\n value: unknown\n) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\n\nfunction _resolveWithPrefixes(\n prop: string,\n prefixes: string[],\n scopes: AnyObject[],\n proxy: ResolverProxy\n) {\n let value: unknown;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n const set = new Set<string>();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n meta: ChartMeta<'line' | 'scatter'>,\n data: AnyObject[],\n start: number,\n count: number\n) {\n const {iScale} = meta;\n const {key = 'r'} = this._parsing;\n const parsed = new Array<{r: unknown}>(count);\n let i: number, ilen: number, index: number, item: AnyObject;\n\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n","import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n firstPoint: SplinePoint,\n middlePoint: SplinePoint,\n afterPoint: SplinePoint,\n t: number\n): {\n previous: SplinePoint\n next: SplinePoint\n } {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n const pointsLen = points.length;\n\n let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK: number[] = Array(pointsLen).fill(0);\n const mK: number[] = Array(pointsLen);\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n let pointAfter = getPoint(points, 0);\n\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n\n monotoneAdjust(points, deltaK, mK);\n\n monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n points: SplinePoint[],\n options,\n area: ChartArea,\n loop: boolean,\n indexAxis: 'x' | 'y'\n) {\n let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType<typeof splineCurve>;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n","import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = (parent as ShadowRoot).host;\n }\n return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n let valueInPixels: number;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n const result = {} as ChartArea;\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n e: Event | TouchEvent | MouseEvent,\n canvas: HTMLCanvasElement\n): {\n x: number;\n y: number;\n box: boolean;\n } {\n const touches = (e as TouchEvent).touches;\n const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n const {offsetX, offsetY} = source as MouseEvent;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n event: Event | ChartEvent | TouchEvent | MouseEvent,\n chart: Chart\n): { x: number; y: number } {\n if ('native' in event) {\n return event;\n }\n\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial<Scale> {\n let maxWidth: number, maxHeight: number;\n\n if (width === undefined || height === undefined) {\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n canvas: HTMLCanvasElement,\n bbWidth?: number,\n bbHeight?: number,\n aspectRatio?: number\n): { width: number; height: number } {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n\n return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n chart: Chart,\n forceRatio: number,\n forceStyle?: boolean\n): boolean | void {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n\n const canvas = chart.canvas;\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() { // This function will be called when the browser attempts to access the passive property.\n passiveSupported = true;\n return false;\n }\n } as EventListenerOptions;\n\n if (_isDomSupported()) {\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n }\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n element: HTMLElement,\n property: 'width' | 'height'\n): number | undefined {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n","import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n p1: Point,\n p2: Point,\n t: number, mode: 'middle' | 'after' | unknown\n) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n","export interface RTLAdapter {\n x(x: number): number;\n setWidth(w: number): void;\n textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n xPlus(x: number, value: number): number;\n leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n return {\n x(x) {\n return x;\n },\n setWidth(w) { // eslint-disable-line no-unused-vars\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n return x;\n },\n };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n let style: CSSStyleDeclaration, original: [string, string];\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n\n style.setProperty('direction', direction, 'important');\n (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n if (original !== undefined) {\n delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n","import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\n\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n // eslint-disable-next-line prefer-const\n let {start, end, loop} = segment;\n let i, ilen;\n\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n\n if (point.skip) {\n continue;\n }\n\n value = normalize(point[property]);\n\n if (value === prevValue) {\n continue;\n }\n\n inside = between(value, startBound, endBound);\n\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n\n return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n\n if (loop && !spanGaps) {\n // loop and not spanning gaps, first find a gap to start from\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n\n // find first non skipped point (after the first gap possibly)\n while (start < count && points[start].skip) {\n start++;\n }\n\n // if we looped to count, start needs to be 0\n start %= count;\n\n if (loop) {\n // loop will go past count, if start > 0\n end += start;\n }\n\n while (end > start && points[end % count].skip) {\n end--;\n }\n\n // end could be more than count, normalize\n end %= count;\n\n return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n // @ts-ignore\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n\n return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n\n if (!count) {\n return [];\n }\n\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n // Style can not start/end on a skipped point, adjust indices accordingly\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n\n return result;\n}\n\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\n\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n"],"names":["noop","uid","id","isNullOrUndef","value","undefined","isArray","Array","type","Object","prototype","toString","call","slice","isObject","isNumberFinite","Number","isFinite","finiteOrDefault","defaultValue","valueOrDefault","toPercentage","dimension","endsWith","parseFloat","toDimension","callback","fn","args","thisArg","apply","each","loopable","reverse","i","len","keys","length","_elementsEqual","a0","a1","ilen","v0","v1","datasetIndex","index","clone","source","map","target","create","klen","k","isValidKey","key","indexOf","_merger","options","tval","sval","merge","sources","merger","current","mergeIf","_mergerIf","hasOwnProperty","_deprecated","scope","previous","console","warn","keyResolvers","v","x","o","y","_splitKey","parts","split","tmp","part","push","_getKeyResolver","obj","resolveObjectKey","resolver","_capitalize","str","charAt","toUpperCase","defined","isFunction","setsEqual","a","b","size","item","has","_isClickEvent","e","PI","Math","TAU","PITAU","INFINITY","POSITIVE_INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","abs","niceNum","range","roundedRange","round","niceRange","pow","floor","fraction","niceFraction","_factorize","result","sqrt","sort","pop","isNumber","n","isNaN","almostWhole","rounded","_setMinAndMaxByKey","array","property","min","max","toRadians","degrees","toDegrees","radians","_decimalPlaces","isFiniteNumber","p","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","atan2","distance","distanceBetweenPoints","pt1","pt2","_angleDiff","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","s","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","table","cmp","hi","lo","mid","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","values","arrayEvents","listenArrayEvents","listener","_chartjs","listeners","defineProperty","configurable","enumerable","forEach","method","base","res","object","unlistenArrayEvents","stub","splice","_arrayUnique","items","set","Set","from","fontString","pixelSize","fontStyle","fontFamily","requestAnimFrame","window","requestAnimationFrame","throttled","argsToUse","ticking","debounce","delay","timeout","clearTimeout","setTimeout","_toLeftRightCenter","align","_alignStartEnd","_textX","left","right","rtl","check","_getStartAndCountOfVisiblePoints","meta","points","animationsDisabled","pointCount","count","_sorted","iScale","_parsed","axis","minDefined","maxDefined","getUserBounds","getPixelForValue","_scaleRangesChanged","xScale","yScale","_scaleRanges","newRanges","xmin","xmax","ymin","ymax","changed","assign","atEdge","t","elasticIn","sin","elasticOut","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","m","d","easeInOutBounce","isPatternOrGradient","color","Color","getHoverColor","saturate","darken","hexString","numbers","colors","applyAnimationsDefaults","defaults","duration","easing","loop","to","describe","_fallback","_indexable","_scriptable","name","properties","active","animation","resize","show","animations","visible","hide","applyLayoutsDefaults","autoPadding","padding","top","bottom","intlCache","Map","getNumberFormat","locale","cacheKey","JSON","stringify","formatter","get","Intl","NumberFormat","formatNumber","num","format","formatters","numeric","tickValue","ticks","chart","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","applyScaleDefaults","display","offset","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","title","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","Ticks","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","route","startsWith","overrides","descriptors","getScope","node","root","Defaults","constructor","_descriptors","_appliers","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","style","lineHeight","weight","hover","hoverBackgroundColor","ctx","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","override","targetScope","targetName","scopeObject","targetScopeObject","privateName","defineProperties","writable","local","appliers","toFontString","_measureText","data","gc","longest","string","textWidth","measureText","_longestText","arrayOfThings","cache","garbageCollect","save","j","jlen","thing","nestedThing","restore","gcLen","_alignPixel","pixel","currentDevicePixelRatio","halfWidth","clearCanvas","canvas","getContext","resetTransform","clearRect","height","drawPoint","drawPointLegend","w","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","rotate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","fill","borderWidth","stroke","_isPointInArea","point","area","margin","clipArea","unclipArea","_steppedLineTo","flip","midpoint","_bezierCurveTo","bezierCurveTo","cp1x","cp2x","cp1y","cp2y","setRenderOpts","opts","translation","fillStyle","textAlign","textBaseline","decorateText","line","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","strokeStyle","decorationWidth","drawBackdrop","oldColor","fillRect","renderText","lines","strokeWidth","strokeColor","backdrop","strokeText","maxWidth","fillText","addRoundedRectPath","h","topLeft","bottomLeft","bottomRight","topRight","LINE_HEIGHT","FONT_STYLE","toLineHeight","matches","match","numberOrZero","_readValueToProps","props","ret","objProps","read","prop","toTRBL","toTRBLCorners","toPadding","toFont","fallback","parseInt","resolve","inputs","info","cacheable","_addGrace","minmax","change","keepZero","add","createContext","parentContext","_createResolver","scopes","prefixes","rootScopes","getTarget","finalRootScopes","_resolve","Symbol","toStringTag","_cacheable","_scopes","_rootScopes","_getTarget","Proxy","deleteProperty","_keys","_cached","_resolveWithPrefixes","getOwnPropertyDescriptor","Reflect","getPrototypeOf","getKeysFromAllScopes","ownKeys","storage","_storage","_attachContext","proxy","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","setContext","receiver","_resolveWithContext","allKeys","scriptable","indexable","_allKeys","isScriptable","isIndexable","readKey","prefix","needsSubResolver","_resolveScriptable","_resolveArray","getValue","Error","join","delete","createSubResolver","arr","filter","resolveFallback","parent","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","_parseObjectDataRadialScale","_parsing","parsed","r","parse","EPSILON","getPoint","skip","getValueAxis","splineCurve","firstPoint","middlePoint","afterPoint","next","d01","d12","s01","s12","fa","fb","monotoneAdjust","deltaK","mK","pointsLen","alphaK","betaK","tauK","squaredMagnitude","pointCurrent","pointAfter","monotoneCompute","valueAxis","pointBefore","iPixel","vPixel","splineCurveMonotone","slopeDelta","capControlPoint","pt","capBezierPoints","inArea","inAreaPrev","inAreaNext","_updateBezierControlPoints","controlPoints","spanGaps","cubicInterpolationMode","prev","tension","_isDomSupported","document","_getParentNode","domNode","parentNode","host","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","ownerDocument","defaultView","getStyle","el","getPropertyValue","positions","getPositionedStyle","styles","suffix","pos","useOffsetPos","shadowRoot","getCanvasPosition","touches","offsetX","offsetY","box","getBoundingClientRect","clientX","clientY","getRelativePosition","event","borderBox","boxSizing","paddings","borders","getContainerSize","maxHeight","container","clientWidth","clientHeight","containerStyle","containerBorder","containerPadding","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","containerSize","maintainHeight","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","supportsEventListenerOptions","passiveSupported","passive","addEventListener","removeEventListener","readUsedSize","_pointInLine","p1","p2","_steppedInterpolation","_bezierInterpolation","cp1","cp2","c","getRightToLeftAdapter","rectX","setWidth","xPlus","leftForLtr","itemWidth","getLeftToRightAdapter","_itemWidth","getRtlAdapter","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","propertyFn","between","compare","normalize","normalizeSegment","getSegment","segment","startBound","endBound","_boundSegment","inside","subStart","prevValue","startIsBefore","endIsBefore","shouldStart","shouldStop","_boundSegments","segments","sub","findStartAndEnd","solidSegments","cur","stop","_computeSegments","segmentOptions","_loop","splitByStyles","completeLoop","_fullLoop","doSplitByStyles","chartContext","_chart","baseStyle","readStyle","_datasetIndex","prevStyle","addStyle","l","st","dir","p0","p0DataIndex","p1DataIndex","styleChanged","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","replacer"],"mappings":";;;;;;;;AAAA;;;;IAUO,SAASA,IAAO,GAAA;AACrB,YACD;AAED;;AAEC,IACM,MAAMC,GAAM,GAAC,CAAA,IAAM;AACxB,IAAA,IAAIC,EAAK,GAAA,CAAA,CAAA;AACT,IAAA,OAAO,IAAMA,EAAAA,EAAAA,CAAAA;AACf,CAAA,IAAK;AAEL;;;;AAIC,IACM,SAASC,aAAcC,CAAAA,KAAc,EAA6B;IACvE,OAAOA,KAAAA,KAAU,IAAI,IAAIA,KAAUC,KAAA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AAA,EAAYvwB,QAAQuwB,UAAU;AAC9BC,QAAAA,gBAAAA,EAAkBxwB,QAAQwwB,gBAAgB;AAC1CC,QAAAA,eAAAA,EAAiBzwB,QAAQywB,eAAe;AACxC5U,QAAAA,WAAAA,EAAa7b,QAAQ6b,WAAW;AAChChG,QAAAA,WAAAA,EAAa7V,QAAQ6V,WAAW;AAClC,KAAA,CAAA;AACF,CAAA;AAEA,SAASwa,YAAa9Z,CAAAA,KAAK,EAAEsZ,SAAS,EAAE;AACtC,IAAA,IAAI,CAACA,SAAW,EAAA;AACd,QAAA,OAAO,KAAK,CAAA;KACb;AACD,IAAA,MAAM3W,QAAQ,EAAE,CAAA;AAChB,IAAA,MAAMwX,QAAW,GAAA,SAAS7wB,GAAG,EAAElD,KAAK,EAAE;QACpC,IAAI,CAACkS,oBAAoBlS,KAAQ,CAAA,EAAA;YAC/B,OAAOA,KAAAA,CAAAA;SACR;AACD,QAAA,IAAI,CAACuc,KAAAA,CAAMtG,QAAQ,CAACjW,KAAQ,CAAA,EAAA;AAC1Buc,YAAAA,KAAAA,CAAMzX,IAAI,CAAC9E,KAAAA,CAAAA,CAAAA;SACZ;QACD,OAAOuc,KAAAA,CAAMpZ,OAAO,CAACnD,KAAAA,CAAAA,CAAAA;AACvB,KAAA,CAAA;IACA,OAAOwU,IAAAA,CAAKC,SAAS,CAACmF,KAAAA,EAAOma,cAAcvf,IAAKC,CAAAA,SAAS,CAACye,SAAWa,EAAAA,QAAAA,CAAAA,CAAAA;AACvE;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.bar.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.bar.d.ts new file mode 100644 index 0000000..52dcc56 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.bar.d.ts @@ -0,0 +1,62 @@ +export default class BarController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + /** + * Overriding primitive data parsing since we support mixed primitive/array + * data for float bars + * @protected + */ + protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any[]; + /** + * Overriding array data parsing since we support mixed primitive/array + * data for float bars + * @protected + */ + protected parseArrayData(meta: any, data: any, start: any, count: any): any[]; + /** + * Overriding object data parsing since we support mixed primitive/array + * value-scale data for float bars + * @protected + */ + protected parseObjectData(meta: any, data: any, start: any, count: any): any[]; + update(mode: any): void; + /** + * Returns the stacks based on groups and bar visibility. + * @param {number} [last] - The dataset index + * @param {number} [dataIndex] - The data index of the ruler + * @returns {string[]} The list of stack IDs + * @private + */ + private _getStacks; + /** + * Returns the effective number of stacks based on groups and bar visibility. + * @private + */ + private _getStackCount; + /** + * Returns the stack index for the given dataset based on groups and bar visibility. + * @param {number} [datasetIndex] - The dataset index + * @param {string} [name] - The stack name to find + * @param {number} [dataIndex] + * @returns {number} The stack index + * @private + */ + private _getStackIndex; + /** + * @private + */ + private _getRuler; + /** + * Note: pixel values are not clamped to the scale area. + * @private + */ + private _calculateBarValuePixels; + /** + * @private + */ + private _calculateBarIndexPixels; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.bubble.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.bubble.d.ts new file mode 100644 index 0000000..fd1c798 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.bubble.d.ts @@ -0,0 +1,35 @@ +export default class BubbleController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + /** + * Parse array of primitive values + * @protected + */ + protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any; + /** + * Parse array of arrays + * @protected + */ + protected parseArrayData(meta: any, data: any, start: any, count: any): any; + /** + * Parse array of objects + * @protected + */ + protected parseObjectData(meta: any, data: any, start: any, count: any): any; + /** + * @protected + */ + protected getMaxOverflow(): number; + /** + * @protected + */ + protected getLabelAndValue(index: any): { + label: any; + value: string; + }; + update(mode: any): void; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.doughnut.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.doughnut.d.ts new file mode 100644 index 0000000..8510ed9 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.doughnut.d.ts @@ -0,0 +1,64 @@ +export default class DoughnutController extends DatasetController { + static id: string; + static descriptors: { + _scriptable: (name: any) => boolean; + _indexable: (name: any) => boolean; + }; + /** + * @type {any} + */ + static overrides: any; + constructor(chart: any, datasetIndex: any); + innerRadius: number; + outerRadius: number; + offsetX: number; + offsetY: number; + /** + * Override data parsing, since we are not using scales + */ + parse(start: any, count: any): void; + /** + * @private + */ + private _getRotation; + /** + * @private + */ + private _getCircumference; + /** + * Get the maximal rotation & circumference extents + * across all visible datasets. + */ + _getRotationExtents(): { + rotation: number; + circumference: number; + }; + /** + * @private + */ + private _circumference; + calculateTotal(): number; + calculateCircumference(value: any): number; + getLabelAndValue(index: any): { + label: any; + value: string; + }; + getMaxBorderWidth(arcs: any): number; + getMaxOffset(arcs: any): number; + /** + * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly + * @private + */ + private _getRingWeightOffset; + /** + * @private + */ + private _getRingWeight; + /** + * Returns the sum of all visible data set weights. + * @private + */ + private _getVisibleDatasetWeightTotal; +} +export type Chart = import('../core/core.controller.js').default; +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.line.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.line.d.ts new file mode 100644 index 0000000..82bc42c --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.line.d.ts @@ -0,0 +1,13 @@ +export default class LineController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + update(mode: any): void; + /** + * @protected + */ + protected getMaxOverflow(): any; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.pie.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.pie.d.ts new file mode 100644 index 0000000..fcb0a24 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.pie.d.ts @@ -0,0 +1,3 @@ +export default class PieController extends DoughnutController { +} +import DoughnutController from "./controller.doughnut.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.polarArea.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.polarArea.d.ts new file mode 100644 index 0000000..b27ddf9 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.polarArea.d.ts @@ -0,0 +1,35 @@ +export default class PolarAreaController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + constructor(chart: any, datasetIndex: any); + innerRadius: number; + outerRadius: number; + getLabelAndValue(index: any): { + label: any; + value: string; + }; + parseObjectData(meta: any, data: any, start: any, count: any): { + r: unknown; + }[]; + update(mode: any): void; + /** + * @protected + */ + protected getMinMax(): { + min: number; + max: number; + }; + /** + * @private + */ + private _updateRadius; + countVisibleElements(): number; + /** + * @private + */ + private _computeAngle; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.radar.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.radar.d.ts new file mode 100644 index 0000000..9a06593 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.radar.d.ts @@ -0,0 +1,19 @@ +export default class RadarController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + /** + * @protected + */ + protected getLabelAndValue(index: any): { + label: any; + value: string; + }; + parseObjectData(meta: any, data: any, start: any, count: any): { + r: unknown; + }[]; + update(mode: any): void; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/controller.scatter.d.ts b/seller_1/node_modules/chart.js/dist/controllers/controller.scatter.d.ts new file mode 100644 index 0000000..bf5cde6 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/controller.scatter.d.ts @@ -0,0 +1,20 @@ +export default class ScatterController extends DatasetController { + static id: string; + /** + * @type {any} + */ + static overrides: any; + /** + * @protected + */ + protected getLabelAndValue(index: any): { + label: any; + value: string; + }; + update(mode: any): void; + /** + * @protected + */ + protected getMaxOverflow(): any; +} +import DatasetController from "../core/core.datasetController.js"; diff --git a/seller_1/node_modules/chart.js/dist/controllers/index.d.ts b/seller_1/node_modules/chart.js/dist/controllers/index.d.ts new file mode 100644 index 0000000..ff3fdc6 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/controllers/index.d.ts @@ -0,0 +1,8 @@ +export { default as BarController } from "./controller.bar.js"; +export { default as BubbleController } from "./controller.bubble.js"; +export { default as DoughnutController } from "./controller.doughnut.js"; +export { default as LineController } from "./controller.line.js"; +export { default as PolarAreaController } from "./controller.polarArea.js"; +export { default as PieController } from "./controller.pie.js"; +export { default as RadarController } from "./controller.radar.js"; +export { default as ScatterController } from "./controller.scatter.js"; diff --git a/seller_1/node_modules/chart.js/dist/core/core.adapters.d.ts b/seller_1/node_modules/chart.js/dist/core/core.adapters.d.ts new file mode 100644 index 0000000..bd88a0f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.adapters.d.ts @@ -0,0 +1,93 @@ +/** + * @namespace Chart._adapters + * @since 2.8.0 + * @private + */ +import type { AnyObject } from '../types/basic.js'; +import type { ChartOptions } from '../types/index.js'; +export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; +export interface DateAdapter<T extends AnyObject = AnyObject> { + readonly options: T; + /** + * Will called with chart options after adapter creation. + */ + init(this: DateAdapter<T>, chartOptions: ChartOptions): void; + /** + * Returns a map of time formats for the supported formatting units defined + * in Unit as well as 'datetime' representing a detailed date/time string. + */ + formats(this: DateAdapter<T>): Record<string, string>; + /** + * Parses the given `value` and return the associated timestamp. + * @param value - the value to parse (usually comes from the data) + * @param [format] - the expected data format + */ + parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null; + /** + * Returns the formatted date in the specified `format` for a given `timestamp`. + * @param timestamp - the timestamp to format + * @param format - the date/time token + */ + format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string; + /** + * Adds the specified `amount` of `unit` to the given `timestamp`. + * @param timestamp - the input timestamp + * @param amount - the amount to add + * @param unit - the unit as string + */ + add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number; + /** + * Returns the number of `unit` between the given timestamps. + * @param a - the input timestamp (reference) + * @param b - the timestamp to subtract + * @param unit - the unit as string + */ + diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number; + /** + * Returns start of `unit` for the given `timestamp`. + * @param timestamp - the input timestamp + * @param unit - the unit as string + * @param [weekday] - the ISO day of the week with 1 being Monday + * and 7 being Sunday (only needed if param *unit* is `isoWeek`). + */ + startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number; + /** + * Returns end of `unit` for the given `timestamp`. + * @param timestamp - the input timestamp + * @param unit - the unit as string + */ + endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number; +} +/** + * Date adapter (current used by the time scale) + * @namespace Chart._adapters._date + * @memberof Chart._adapters + * @private + */ +declare class DateAdapterBase implements DateAdapter { + /** + * Override default date adapter methods. + * Accepts type parameter to define options type. + * @example + * Chart._adapters._date.override<{myAdapterOption: string}>({ + * init() { + * console.log(this.options.myAdapterOption); + * } + * }) + */ + static override<T extends AnyObject = AnyObject>(members: Partial<Omit<DateAdapter<T>, 'options'>>): void; + readonly options: AnyObject; + constructor(options: AnyObject); + init(): void; + formats(): Record<string, string>; + parse(): number | null; + format(): string; + add(): number; + diff(): number; + startOf(): number; + endOf(): number; +} +declare const _default: { + _date: typeof DateAdapterBase; +}; +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/core/core.animation.d.ts b/seller_1/node_modules/chart.js/dist/core/core.animation.d.ts new file mode 100644 index 0000000..f5a1308 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.animation.d.ts @@ -0,0 +1,21 @@ +export default class Animation { + constructor(cfg: any, target: any, prop: any, to: any); + _active: boolean; + _fn: any; + _easing: any; + _start: number; + _duration: number; + _total: number; + _loop: boolean; + _target: any; + _prop: any; + _from: unknown; + _to: any; + _promises: any[]; + active(): boolean; + update(cfg: any, to: any, date: any): void; + cancel(): void; + tick(date: any): void; + wait(): Promise<any>; + _notify(resolved: any): void; +} diff --git a/seller_1/node_modules/chart.js/dist/core/core.animations.d.ts b/seller_1/node_modules/chart.js/dist/core/core.animations.d.ts new file mode 100644 index 0000000..40d11f8 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.animations.d.ts @@ -0,0 +1,22 @@ +export default class Animations { + constructor(chart: any, config: any); + _chart: any; + _properties: Map<any, any>; + configure(config: any): void; + /** + * Utility to handle animation of `options`. + * @private + */ + private _animateOptions; + /** + * @private + */ + private _createAnimations; + /** + * Update `target` properties to new values, using configured animations + * @param {object} target - object to update + * @param {object} values - new target properties + * @returns {boolean|undefined} - `true` if animations were started + **/ + update(target: object, values: object): boolean | undefined; +} diff --git a/seller_1/node_modules/chart.js/dist/core/core.animations.defaults.d.ts b/seller_1/node_modules/chart.js/dist/core/core.animations.defaults.d.ts new file mode 100644 index 0000000..25f588c --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.animations.defaults.d.ts @@ -0,0 +1 @@ +export function applyAnimationsDefaults(defaults: any): void; diff --git a/seller_1/node_modules/chart.js/dist/core/core.animator.d.ts b/seller_1/node_modules/chart.js/dist/core/core.animator.d.ts new file mode 100644 index 0000000..8f0d065 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.animator.d.ts @@ -0,0 +1,67 @@ +/** + * @typedef { import('./core.animation.js').default } Animation + * @typedef { import('./core.controller.js').default } Chart + */ +/** + * Please use the module's default export which provides a singleton instance + * Note: class is export for typedoc + */ +export class Animator { + _request: any; + _charts: Map<any, any>; + _running: boolean; + _lastDate: number; + /** + * @private + */ + private _notify; + /** + * @private + */ + private _refresh; + /** + * @private + */ + private _update; + /** + * @private + */ + private _getAnims; + /** + * @param {Chart} chart + * @param {string} event - event name + * @param {Function} cb - callback + */ + listen(chart: Chart, event: string, cb: Function): void; + /** + * Add animations + * @param {Chart} chart + * @param {Animation[]} items - animations + */ + add(chart: Chart, items: Animation[]): void; + /** + * Counts number of active animations for the chart + * @param {Chart} chart + */ + has(chart: Chart): boolean; + /** + * Start animating (all charts) + * @param {Chart} chart + */ + start(chart: Chart): void; + running(chart: any): boolean; + /** + * Stop all animations for the chart + * @param {Chart} chart + */ + stop(chart: Chart): void; + /** + * Remove chart from Animator + * @param {Chart} chart + */ + remove(chart: Chart): boolean; +} +declare const _default: Animator; +export default _default; +export type Animation = import('./core.animation.js').default; +export type Chart = import('./core.controller.js').default; diff --git a/seller_1/node_modules/chart.js/dist/core/core.config.d.ts b/seller_1/node_modules/chart.js/dist/core/core.config.d.ts new file mode 100644 index 0000000..3d2631d --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.config.d.ts @@ -0,0 +1,86 @@ +export function getIndexAxis(type: any, options: any): any; +export function determineAxis(id: any, ...scaleOptions: any[]): any; +export default class Config { + constructor(config: any); + _config: any; + _scopeCache: Map<any, any>; + _resolverCache: Map<any, any>; + get platform(): any; + set type(arg: any); + get type(): any; + set data(arg: any); + get data(): any; + set options(arg: any); + get options(): any; + get plugins(): any; + update(): void; + clearCache(): void; + /** + * Returns the option scope keys for resolving dataset options. + * These keys do not include the dataset itself, because it is not under options. + * @param {string} datasetType + * @return {string[][]} + */ + datasetScopeKeys(datasetType: string): string[][]; + /** + * Returns the option scope keys for resolving dataset animation options. + * These keys do not include the dataset itself, because it is not under options. + * @param {string} datasetType + * @param {string} transition + * @return {string[][]} + */ + datasetAnimationScopeKeys(datasetType: string, transition: string): string[][]; + /** + * Returns the options scope keys for resolving element options that belong + * to an dataset. These keys do not include the dataset itself, because it + * is not under options. + * @param {string} datasetType + * @param {string} elementType + * @return {string[][]} + */ + datasetElementScopeKeys(datasetType: string, elementType: string): string[][]; + /** + * Returns the options scope keys for resolving plugin options. + * @param {{id: string, additionalOptionScopes?: string[]}} plugin + * @return {string[][]} + */ + pluginScopeKeys(plugin: { + id: string; + additionalOptionScopes?: string[]; + }): string[][]; + /** + * @private + */ + private _cachedScopes; + /** + * Resolves the objects from options and defaults for option value resolution. + * @param {object} mainScope - The main scope object for options + * @param {string[][]} keyLists - The arrays of keys in resolution order + * @param {boolean} [resetCache] - reset the cache for this mainScope + */ + getOptionScopes(mainScope: object, keyLists: string[][], resetCache?: boolean): any; + /** + * Returns the option scopes for resolving chart options + * @return {object[]} + */ + chartOptionScopes(): object[]; + /** + * @param {object[]} scopes + * @param {string[]} names + * @param {function|object} context + * @param {string[]} [prefixes] + * @return {object} + */ + resolveNamedOptions(scopes: object[], names: string[], context: Function | object, prefixes?: string[]): object; + /** + * @param {object[]} scopes + * @param {object} [context] + * @param {string[]} [prefixes] + * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults] + */ + createResolver(scopes: object[], context?: object, prefixes?: string[], descriptorDefaults?: { + scriptable: boolean; + indexable: boolean; + allKeys?: boolean; + }): any; +} diff --git a/seller_1/node_modules/chart.js/dist/core/core.controller.d.ts b/seller_1/node_modules/chart.js/dist/core/core.controller.d.ts new file mode 100644 index 0000000..1e64eaf --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.controller.d.ts @@ -0,0 +1,257 @@ +export default Chart; +export type ChartEvent = import('../types/index.js').ChartEvent; +export type Point = import('../types/index.js').Point; +declare class Chart { + static defaults: import("./core.defaults.js").Defaults; + static instances: {}; + static overrides: any; + static registry: import("./core.registry.js").Registry; + static version: string; + static getChart: (key: any) => any; + static register(...items: any[]): void; + static unregister(...items: any[]): void; + constructor(item: any, userConfig: any); + config: Config; + platform: any; + id: number; + ctx: any; + canvas: any; + width: any; + height: any; + _options: any; + _aspectRatio: any; + _layers: any[]; + _metasets: any[]; + _stacks: any; + boxes: any[]; + currentDevicePixelRatio: any; + chartArea: any; + _active: any[]; + _lastEvent: import("../types/index.js").ChartEvent; + _listeners: {}; + /** @type {?{attach?: function, detach?: function, resize?: function}} */ + _responsiveListeners: { + attach?: Function; + detach?: Function; + resize?: Function; + }; + _sortedMetasets: any[]; + scales: {}; + _plugins: PluginService; + $proxies: {}; + _hiddenIndices: {}; + attached: boolean; + _animationsDisabled: boolean; + $context: { + chart: Chart; + type: string; + }; + _doResize: (mode?: any) => number; + _dataChanges: any[]; + get aspectRatio(): any; + set data(arg: any); + get data(): any; + set options(arg: any); + get options(): any; + get registry(): import("./core.registry.js").Registry; + /** + * @private + */ + private _initialize; + clear(): Chart; + stop(): Chart; + /** + * Resize the chart to its container or to explicit dimensions. + * @param {number} [width] + * @param {number} [height] + */ + resize(width?: number, height?: number): void; + _resizeBeforeDraw: { + width: number; + height: number; + }; + _resize(width: any, height: any): void; + ensureScalesHaveIDs(): void; + /** + * Builds a map of scale ID to scale object for future lookup. + */ + buildOrUpdateScales(): void; + /** + * @private + */ + private _updateMetasets; + /** + * @private + */ + private _removeUnreferencedMetasets; + buildOrUpdateControllers(): any[]; + /** + * Reset the elements of all datasets + * @private + */ + private _resetElements; + /** + * Resets the chart back to its state before the initial animation + */ + reset(): void; + update(mode: any): void; + _minPadding: number; + /** + * @private + */ + private _updateScales; + /** + * @private + */ + private _checkEventBindings; + /** + * @private + */ + private _updateHiddenIndices; + /** + * @private + */ + private _getUniformDataChanges; + /** + * Updates the chart layout unless a plugin returns `false` to the `beforeLayout` + * hook, in which case, plugins will not be called on `afterLayout`. + * @private + */ + private _updateLayout; + /** + * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate` + * hook, in which case, plugins will not be called on `afterDatasetsUpdate`. + * @private + */ + private _updateDatasets; + /** + * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate` + * hook, in which case, plugins will not be called on `afterDatasetUpdate`. + * @private + */ + private _updateDataset; + render(): void; + draw(): void; + /** + * @private + */ + private _getSortedDatasetMetas; + /** + * Gets the visible dataset metas in drawing order + * @return {object[]} + */ + getSortedVisibleDatasetMetas(): object[]; + /** + * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw` + * hook, in which case, plugins will not be called on `afterDatasetsDraw`. + * @private + */ + private _drawDatasets; + /** + * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw` + * hook, in which case, plugins will not be called on `afterDatasetDraw`. + * @private + */ + private _drawDataset; + /** + * Checks whether the given point is in the chart area. + * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition) + * @returns {boolean} + */ + isPointInArea(point: Point): boolean; + getElementsAtEventForMode(e: any, mode: any, options: any, useFinalPosition: any): any; + getDatasetMeta(datasetIndex: any): any; + getContext(): { + chart: Chart; + type: string; + }; + getVisibleDatasetCount(): number; + isDatasetVisible(datasetIndex: any): boolean; + setDatasetVisibility(datasetIndex: any, visible: any): void; + toggleDataVisibility(index: any): void; + getDataVisibility(index: any): boolean; + /** + * @private + */ + private _updateVisibility; + hide(datasetIndex: any, dataIndex: any): void; + show(datasetIndex: any, dataIndex: any): void; + /** + * @private + */ + private _destroyDatasetMeta; + _stop(): void; + destroy(): void; + toBase64Image(...args: any[]): any; + /** + * @private + */ + private bindEvents; + /** + * @private + */ + private bindUserEvents; + /** + * @private + */ + private bindResponsiveEvents; + /** + * @private + */ + private unbindEvents; + updateHoverStyle(items: any, mode: any, enabled: any): void; + /** + * Get active (hovered) elements + * @returns array + */ + getActiveElements(): any[]; + /** + * Set active (hovered) elements + * @param {array} activeElements New active data points + */ + setActiveElements(activeElements: any[]): void; + /** + * Calls enabled plugins on the specified hook and with the given args. + * This method immediately returns as soon as a plugin explicitly returns false. The + * returned value can be used, for instance, to interrupt the current action. + * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate'). + * @param {Object} [args] - Extra arguments to apply to the hook call. + * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified + * @returns {boolean} false if any of the plugins return false, else returns true. + */ + notifyPlugins(hook: string, args?: any, filter?: import('./core.plugins.js').filterCallback): boolean; + /** + * Check if a plugin with the specific ID is registered and enabled + * @param {string} pluginId - The ID of the plugin of which to check if it is enabled + * @returns {boolean} + */ + isPluginEnabled(pluginId: string): boolean; + /** + * @private + */ + private _updateHoverStyles; + /** + * @private + */ + private _eventHandler; + /** + * Handle an event + * @param {ChartEvent} e the event to handle + * @param {boolean} [replay] - true if the event was replayed by `update` + * @param {boolean} [inChartArea] - true if the event is inside chartArea + * @return {boolean} true if the chart needs to re-render + * @private + */ + private _handleEvent; + /** + * @param {ChartEvent} e - The event + * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements + * @param {boolean} inChartArea - Is the event inside chartArea + * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions + * @returns {import('../types/index.js').ActiveElement[]} - The active elements + * @pravate + */ + _getActiveElements(e: ChartEvent, lastActive: import('../types/index.js').ActiveElement[], inChartArea: boolean, useFinalPosition: boolean): import('../types/index.js').ActiveElement[]; +} +import Config from "./core.config.js"; +import PluginService from "./core.plugins.js"; diff --git a/seller_1/node_modules/chart.js/dist/core/core.datasetController.d.ts b/seller_1/node_modules/chart.js/dist/core/core.datasetController.d.ts new file mode 100644 index 0000000..98395e0 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.datasetController.d.ts @@ -0,0 +1,251 @@ +export default class DatasetController { + /** + * @type {any} + */ + static defaults: any; + /** + * Element type used to generate a meta dataset (e.g. Chart.element.LineElement). + */ + static datasetElementType: any; + /** + * Element type used to generate a meta data (e.g. Chart.element.PointElement). + */ + static dataElementType: any; + /** + * @param {Chart} chart + * @param {number} datasetIndex + */ + constructor(chart: Chart, datasetIndex: number); + chart: import("./core.controller.js").default; + _ctx: any; + index: number; + _cachedDataOpts: {}; + _cachedMeta: any; + _type: any; + options: any; + /** @type {boolean | object} */ + _parsing: boolean | object; + _data: any; + _objectData: any; + _sharedOptions: any; + _drawStart: any; + _drawCount: any; + enableOptionSharing: boolean; + supportsDecimation: boolean; + $context: any; + _syncList: any[]; + datasetElementType: any; + dataElementType: any; + initialize(): void; + updateIndex(datasetIndex: any): void; + linkScales(): void; + getDataset(): any; + getMeta(): any; + /** + * @param {string} scaleID + * @return {Scale} + */ + getScaleForId(scaleID: string): Scale; + /** + * @private + */ + private _getOtherScale; + reset(): void; + /** + * @private + */ + private _destroy; + /** + * @private + */ + private _dataCheck; + addElements(): void; + buildOrUpdateElements(resetNewElements: any): void; + /** + * Merges user-supplied and default dataset-level options + * @private + */ + private configure; + /** + * @param {number} start + * @param {number} count + */ + parse(start: number, count: number): void; + /** + * Parse array of primitive values + * @param {object} meta - dataset meta + * @param {array} data - data array. Example [1,3,4] + * @param {number} start - start index + * @param {number} count - number of items to parse + * @returns {object} parsed item - item containing index and a parsed value + * for each scale id. + * Example: {xScale0: 0, yScale0: 1} + * @protected + */ + protected parsePrimitiveData(meta: object, data: any[], start: number, count: number): object; + /** + * Parse array of arrays + * @param {object} meta - dataset meta + * @param {array} data - data array. Example [[1,2],[3,4]] + * @param {number} start - start index + * @param {number} count - number of items to parse + * @returns {object} parsed item - item containing index and a parsed value + * for each scale id. + * Example: {x: 0, y: 1} + * @protected + */ + protected parseArrayData(meta: object, data: any[], start: number, count: number): object; + /** + * Parse array of objects + * @param {object} meta - dataset meta + * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}] + * @param {number} start - start index + * @param {number} count - number of items to parse + * @returns {object} parsed item - item containing index and a parsed value + * for each scale id. _custom is optional + * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}} + * @protected + */ + protected parseObjectData(meta: object, data: any[], start: number, count: number): object; + /** + * @protected + */ + protected getParsed(index: any): any; + /** + * @protected + */ + protected getDataElement(index: any): any; + /** + * @protected + */ + protected applyStack(scale: any, parsed: any, mode: any): any; + /** + * @protected + */ + protected updateRangeFromParsed(range: any, scale: any, parsed: any, stack: any): void; + /** + * @protected + */ + protected getMinMax(scale: any, canStack: any): { + min: number; + max: number; + }; + getAllParsedValues(scale: any): number[]; + /** + * @return {number|boolean} + * @protected + */ + protected getMaxOverflow(): number | boolean; + /** + * @protected + */ + protected getLabelAndValue(index: any): { + label: string; + value: string; + }; + /** + * @private + */ + private _update; + /** + * @param {string} mode + */ + update(mode: string): void; + draw(): void; + /** + * Returns a set of predefined style properties that should be used to represent the dataset + * or the data if the index is specified + * @param {number} index - data index + * @param {boolean} [active] - true if hover + * @return {object} style object + */ + getStyle(index: number, active?: boolean): object; + /** + * @protected + */ + protected getContext(index: any, active: any, mode: any): any; + /** + * @param {string} [mode] + * @protected + */ + protected resolveDatasetElementOptions(mode?: string): any; + /** + * @param {number} index + * @param {string} [mode] + * @protected + */ + protected resolveDataElementOptions(index: number, mode?: string): any; + /** + * @private + */ + private _resolveElementOptions; + /** + * @private + */ + private _resolveAnimations; + /** + * Utility for getting the options object shared between elements + * @protected + */ + protected getSharedOptions(options: any): any; + /** + * Utility for determining if `options` should be included in the updated properties + * @protected + */ + protected includeOptions(mode: any, sharedOptions: any): boolean; + /** + * @todo v4, rename to getSharedOptions and remove excess functions + */ + _getSharedOptions(start: any, mode: any): { + sharedOptions: any; + includeOptions: boolean; + }; + /** + * Utility for updating an element with new properties, using animations when appropriate. + * @protected + */ + protected updateElement(element: any, index: any, properties: any, mode: any): void; + /** + * Utility to animate the shared options, that are potentially affecting multiple elements. + * @protected + */ + protected updateSharedOptions(sharedOptions: any, mode: any, newOptions: any): void; + /** + * @private + */ + private _setStyle; + removeHoverStyle(element: any, datasetIndex: any, index: any): void; + setHoverStyle(element: any, datasetIndex: any, index: any): void; + /** + * @private + */ + private _removeDatasetHoverStyle; + /** + * @private + */ + private _setDatasetHoverStyle; + /** + * @private + */ + private _resyncElements; + /** + * @private + */ + private _insertElements; + updateElements(element: any, start: any, count: any, mode: any): void; + /** + * @private + */ + private _removeElements; + /** + * @private + */ + private _sync; + _onDataPush(...args: any[]): void; + _onDataPop(): void; + _onDataShift(): void; + _onDataSplice(start: any, count: any, ...args: any[]): void; + _onDataUnshift(...args: any[]): void; +} +export type Chart = import('./core.controller.js').default; +export type Scale = import('./core.scale.js').default; diff --git a/seller_1/node_modules/chart.js/dist/core/core.defaults.d.ts b/seller_1/node_modules/chart.js/dist/core/core.defaults.d.ts new file mode 100644 index 0000000..e6b7cb3 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.defaults.d.ts @@ -0,0 +1,80 @@ +export const overrides: any; +export const descriptors: any; +/** + * Please use the module's default export which provides a singleton instance + * Note: class is exported for typedoc + */ +export class Defaults { + constructor(_descriptors: any, _appliers: any); + animation: any; + backgroundColor: string; + borderColor: string; + color: string; + datasets: {}; + devicePixelRatio: (context: any) => any; + elements: {}; + events: string[]; + font: { + family: string; + size: number; + style: string; + lineHeight: number; + weight: any; + }; + hover: {}; + hoverBackgroundColor: (ctx: any, options: any) => CanvasGradient; + hoverBorderColor: (ctx: any, options: any) => CanvasGradient; + hoverColor: (ctx: any, options: any) => CanvasGradient; + indexAxis: string; + interaction: { + mode: string; + intersect: boolean; + includeInvisible: boolean; + }; + maintainAspectRatio: boolean; + onHover: any; + onClick: any; + parsing: boolean; + plugins: {}; + responsive: boolean; + scale: any; + scales: {}; + showLine: boolean; + drawActiveElementsOnTop: boolean; + /** + * @param {string|object} scope + * @param {object} [values] + */ + set(scope: string | object, values?: object): any; + /** + * @param {string} scope + */ + get(scope: string): any; + /** + * @param {string|object} scope + * @param {object} [values] + */ + describe(scope: string | object, values?: object): any; + override(scope: any, values: any): any; + /** + * Routes the named defaults to fallback to another scope/name. + * This routing is useful when those target values, like defaults.color, are changed runtime. + * If the values would be copied, the runtime change would not take effect. By routing, the + * fallback is evaluated at each access, so its always up to date. + * + * Example: + * + * defaults.route('elements.arc', 'backgroundColor', '', 'color') + * - reads the backgroundColor from defaults.color when undefined locally + * + * @param {string} scope Scope this route applies to. + * @param {string} name Property name that should be routed to different namespace when not defined here. + * @param {string} targetScope The namespace where those properties should be routed to. + * Empty string ('') is the root of defaults. + * @param {string} targetName The target name in the target scope the property should be routed to. + */ + route(scope: string, name: string, targetScope: string, targetName: string): void; + apply(appliers: any): void; +} +declare const _default: Defaults; +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/core/core.element.d.ts b/seller_1/node_modules/chart.js/dist/core/core.element.d.ts new file mode 100644 index 0000000..25ef0b2 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.element.d.ts @@ -0,0 +1,21 @@ +import type { AnyObject } from '../types/basic.js'; +import type { Point } from '../types/geometric.js'; +import type { Animation } from '../types/animation.js'; +export default class Element<T = AnyObject, O = AnyObject> { + static defaults: {}; + static defaultRoutes: any; + x: number; + y: number; + active: boolean; + options: O; + $animations: Record<keyof T, Animation>; + tooltipPosition(useFinalPosition: boolean): Point; + hasValue(): boolean; + /** + * Gets the current or final value of each prop. Can return extra properties (whole object). + * @param props - properties to get + * @param [final] - get the final value (animation target) + */ + getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>; + getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>; +} diff --git a/seller_1/node_modules/chart.js/dist/core/core.interaction.d.ts b/seller_1/node_modules/chart.js/dist/core/core.interaction.d.ts new file mode 100644 index 0000000..1468fbf --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.interaction.d.ts @@ -0,0 +1,92 @@ +declare namespace _default { + export { evaluateInteractionItems }; + export namespace modes { + /** + * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item + * @function Chart.Interaction.modes.index + * @since v2.4.0 + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function index(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + /** + * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect is false, we find the nearest item and return the items in that dataset + * @function Chart.Interaction.modes.dataset + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function dataset(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + /** + * Point mode returns all elements that hit test based on the event position + * of the event + * @function Chart.Interaction.modes.intersect + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function point(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + /** + * nearest mode returns the element closest to the point + * @function Chart.Interaction.modes.intersect + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function nearest(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + /** + * x mode returns the elements that hit-test at the current x coordinate + * @function Chart.Interaction.modes.x + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function x(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + /** + * y mode returns the elements that hit-test at the current y coordinate + * @function Chart.Interaction.modes.y + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {InteractionOptions} options - options to use + * @param {boolean} [useFinalPosition] - use final element position (animation target) + * @return {InteractionItem[]} - items that are found + */ + function y(chart: import("./core.controller.js").default, e: Event, options: InteractionOptions, useFinalPosition?: boolean): InteractionItem[]; + } +} +export default _default; +export type Chart = import('./core.controller.js').default; +export type ChartEvent = import('../types/index.js').ChartEvent; +export type InteractionOptions = { + axis?: string; + intersect?: boolean; + includeInvisible?: boolean; +}; +export type InteractionItem = { + datasetIndex: number; + index: number; + element: import('./core.element.js').default; +}; +export type Point = import('../types/index.js').Point; +/** + * Helper function to select candidate elements for interaction + * @param {Chart} chart - the chart + * @param {string} axis - the axis mode. x|y|xy|r + * @param {Point} position - the point to be nearest to, in relative coordinates + * @param {function} handler - the callback to execute for each visible item + * @param {boolean} [intersect] - consider intersecting items + */ +declare function evaluateInteractionItems(chart: Chart, axis: string, position: Point, handler: Function, intersect?: boolean): void; diff --git a/seller_1/node_modules/chart.js/dist/core/core.layouts.d.ts b/seller_1/node_modules/chart.js/dist/core/core.layouts.d.ts new file mode 100644 index 0000000..f6f6d7d --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.layouts.d.ts @@ -0,0 +1,88 @@ +declare namespace _default { + /** + * Register a box to a chart. + * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title. + * @param {Chart} chart - the chart to use + * @param {LayoutItem} item - the item to add to be laid out + */ + function addBox(chart: import("./core.controller.js").default, item: LayoutItem): void; + /** + * Remove a layoutItem from a chart + * @param {Chart} chart - the chart to remove the box from + * @param {LayoutItem} layoutItem - the item to remove from the layout + */ + function removeBox(chart: import("./core.controller.js").default, layoutItem: LayoutItem): void; + /** + * Sets (or updates) options on the given `item`. + * @param {Chart} chart - the chart in which the item lives (or will be added to) + * @param {LayoutItem} item - the item to configure with the given options + * @param {object} options - the new item options. + */ + function configure(chart: import("./core.controller.js").default, item: LayoutItem, options: any): void; + /** + * Fits boxes of the given chart into the given size by having each box measure itself + * then running a fitting algorithm + * @param {Chart} chart - the chart + * @param {number} width - the width to fit into + * @param {number} height - the height to fit into + * @param {number} minPadding - minimum padding required for each side of chart area + */ + function update(chart: import("./core.controller.js").default, width: number, height: number, minPadding: number): void; +} +export default _default; +export type Chart = import('./core.controller.js').default; +export type LayoutItem = { + /** + * - The position of the item in the chart layout. Possible values are + * 'left', 'top', 'right', 'bottom', and 'chartArea' + */ + position: string; + /** + * - The weight used to sort the item. Higher weights are further away from the chart area + */ + weight: number; + /** + * - if true, and the item is horizontal, then push vertical boxes down + */ + fullSize: boolean; + /** + * - returns true if the layout item is horizontal (ie. top or bottom) + */ + isHorizontal: Function; + /** + * - Takes two parameters: width and height. Returns size of item + */ + update: Function; + /** + * - Draws the element + */ + draw: Function; + /** + * - Returns an object with padding on the edges + */ + getPadding?: Function; + /** + * - Width of item. Must be valid after update() + */ + width: number; + /** + * - Height of item. Must be valid after update() + */ + height: number; + /** + * - Left edge of the item. Set by layout system and cannot be used in update + */ + left: number; + /** + * - Top edge of the item. Set by layout system and cannot be used in update + */ + top: number; + /** + * - Right edge of the item. Set by layout system and cannot be used in update + */ + right: number; + /** + * - Bottom edge of the item. Set by layout system and cannot be used in update + */ + bottom: number; +}; diff --git a/seller_1/node_modules/chart.js/dist/core/core.layouts.defaults.d.ts b/seller_1/node_modules/chart.js/dist/core/core.layouts.defaults.d.ts new file mode 100644 index 0000000..4462f38 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.layouts.defaults.d.ts @@ -0,0 +1 @@ +export function applyLayoutsDefaults(defaults: any): void; diff --git a/seller_1/node_modules/chart.js/dist/core/core.plugins.d.ts b/seller_1/node_modules/chart.js/dist/core/core.plugins.d.ts new file mode 100644 index 0000000..379153f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.plugins.d.ts @@ -0,0 +1,61 @@ +/** + * @typedef { import('./core.controller.js').default } Chart + * @typedef { import('../types/index.js').ChartEvent } ChartEvent + * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip + */ +/** + * @callback filterCallback + * @param {{plugin: object, options: object}} value + * @param {number} [index] + * @param {array} [array] + * @param {object} [thisArg] + * @return {boolean} + */ +export default class PluginService { + _init: any[]; + /** + * Calls enabled plugins for `chart` on the specified hook and with the given args. + * This method immediately returns as soon as a plugin explicitly returns false. The + * returned value can be used, for instance, to interrupt the current action. + * @param {Chart} chart - The chart instance for which plugins should be called. + * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate'). + * @param {object} [args] - Extra arguments to apply to the hook call. + * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified + * @returns {boolean} false if any of the plugins return false, else returns true. + */ + notify(chart: Chart, hook: string, args?: object, filter?: filterCallback): boolean; + /** + * @private + */ + private _notify; + invalidate(): void; + _oldCache: { + plugin: any; + options: any; + }[]; + _cache: { + plugin: any; + options: any; + }[]; + /** + * @param {Chart} chart + * @private + */ + private _descriptors; + _createDescriptors(chart: any, all: any): { + plugin: any; + options: any; + }[]; + /** + * @param {Chart} chart + * @private + */ + private _notifyStateChanges; +} +export type Chart = import('./core.controller.js').default; +export type ChartEvent = import('../types/index.js').ChartEvent; +export type Tooltip = any; +export type filterCallback = (value: { + plugin: object; + options: object; +}, index?: number, array?: any[], thisArg?: object) => boolean; diff --git a/seller_1/node_modules/chart.js/dist/core/core.registry.d.ts b/seller_1/node_modules/chart.js/dist/core/core.registry.d.ts new file mode 100644 index 0000000..8452add --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.registry.d.ts @@ -0,0 +1,90 @@ +/** + * Please use the module's default export which provides a singleton instance + * Note: class is exported for typedoc + */ +export class Registry { + controllers: TypedRegistry; + elements: TypedRegistry; + plugins: TypedRegistry; + scales: TypedRegistry; + _typedRegistries: TypedRegistry[]; + /** + * @param {...any} args + */ + add(...args: any[]): void; + remove(...args: any[]): void; + /** + * @param {...typeof DatasetController} args + */ + addControllers(...args: (typeof DatasetController)[]): void; + /** + * @param {...typeof Element} args + */ + addElements(...args: (typeof Element)[]): void; + /** + * @param {...any} args + */ + addPlugins(...args: any[]): void; + /** + * @param {...typeof Scale} args + */ + addScales(...args: (typeof Scale)[]): void; + /** + * @param {string} id + * @returns {typeof DatasetController} + */ + getController(id: string): typeof DatasetController; + /** + * @param {string} id + * @returns {typeof Element} + */ + getElement(id: string): typeof Element; + /** + * @param {string} id + * @returns {object} + */ + getPlugin(id: string): object; + /** + * @param {string} id + * @returns {typeof Scale} + */ + getScale(id: string): typeof Scale; + /** + * @param {...typeof DatasetController} args + */ + removeControllers(...args: (typeof DatasetController)[]): void; + /** + * @param {...typeof Element} args + */ + removeElements(...args: (typeof Element)[]): void; + /** + * @param {...any} args + */ + removePlugins(...args: any[]): void; + /** + * @param {...typeof Scale} args + */ + removeScales(...args: (typeof Scale)[]): void; + /** + * @private + */ + private _each; + /** + * @private + */ + private _exec; + /** + * @private + */ + private _getRegistryForType; + /** + * @private + */ + private _get; +} +declare const _default: Registry; +export default _default; +import TypedRegistry from "./core.typedRegistry.js"; +import DatasetController from "./core.datasetController.js"; +import Element from "./core.element.js"; +import Scale from "./core.scale.js"; diff --git a/seller_1/node_modules/chart.js/dist/core/core.scale.autoskip.d.ts b/seller_1/node_modules/chart.js/dist/core/core.scale.autoskip.d.ts new file mode 100644 index 0000000..972eaae --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.scale.autoskip.d.ts @@ -0,0 +1,19 @@ +/** + * @typedef { import('./core.controller.js').default } Chart + * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick + */ +/** + * Returns a subset of ticks to be plotted to avoid overlapping labels. + * @param {import('./core.scale.js').default} scale + * @param {Tick[]} ticks + * @return {Tick[]} + * @private + */ +export function autoSkip(scale: import('./core.scale.js').default, ticks: Tick[]): Tick[]; +export type Chart = import('./core.controller.js').default; +export type Tick = { + value: number | string; + label?: string; + major?: boolean; + $context?: any; +}; diff --git a/seller_1/node_modules/chart.js/dist/core/core.scale.d.ts b/seller_1/node_modules/chart.js/dist/core/core.scale.d.ts new file mode 100644 index 0000000..ca85bba --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.scale.d.ts @@ -0,0 +1,343 @@ +export default class Scale extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + constructor(cfg: any); + /** @type {string} */ + id: string; + /** @type {string} */ + type: string; + /** @type {any} */ + options: any; + /** @type {CanvasRenderingContext2D} */ + ctx: CanvasRenderingContext2D; + /** @type {Chart} */ + chart: Chart; + /** @type {number} */ + top: number; + /** @type {number} */ + bottom: number; + /** @type {number} */ + left: number; + /** @type {number} */ + right: number; + /** @type {number} */ + width: number; + /** @type {number} */ + height: number; + _margins: { + left: number; + right: number; + top: number; + bottom: number; + }; + /** @type {number} */ + maxWidth: number; + /** @type {number} */ + maxHeight: number; + /** @type {number} */ + paddingTop: number; + /** @type {number} */ + paddingBottom: number; + /** @type {number} */ + paddingLeft: number; + /** @type {number} */ + paddingRight: number; + /** @type {string=} */ + axis: string | undefined; + /** @type {number=} */ + labelRotation: number | undefined; + min: any; + max: any; + _range: { + min: number; + max: number; + }; + /** @type {Tick[]} */ + ticks: Tick[]; + /** @type {object[]|null} */ + _gridLineItems: object[] | null; + /** @type {object[]|null} */ + _labelItems: object[] | null; + /** @type {object|null} */ + _labelSizes: object | null; + _length: number; + _maxLength: number; + _longestTextCache: {}; + /** @type {number} */ + _startPixel: number; + /** @type {number} */ + _endPixel: number; + _reversePixels: boolean; + _userMax: any; + _userMin: any; + _suggestedMax: any; + _suggestedMin: any; + _ticksLength: number; + _borderValue: number; + _cache: {}; + _dataLimitsCached: boolean; + $context: any; + /** + * @param {any} options + * @since 3.0 + */ + init(options: any): void; + /** + * Parse a supported input value to internal representation. + * @param {*} raw + * @param {number} [index] + * @since 3.0 + */ + parse(raw: any, index?: number): any; + /** + * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}} + * @protected + * @since 3.0 + */ + protected getUserBounds(): { + min: number; + max: number; + minDefined: boolean; + maxDefined: boolean; + }; + /** + * @param {boolean} canStack + * @return {{min: number, max: number}} + * @protected + * @since 3.0 + */ + protected getMinMax(canStack: boolean): { + min: number; + max: number; + }; + /** + * Get the padding needed for the scale + * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding + * @private + */ + private getPadding; + /** + * Returns the scale tick objects + * @return {Tick[]} + * @since 2.7 + */ + getTicks(): Tick[]; + /** + * @return {string[]} + */ + getLabels(): string[]; + /** + * @return {import('../types.js').LabelItem[]} + */ + getLabelItems(chartArea?: import("../types.js").ChartArea): import('../types.js').LabelItem[]; + beforeLayout(): void; + beforeUpdate(): void; + /** + * @param {number} maxWidth - the max width in pixels + * @param {number} maxHeight - the max height in pixels + * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart + * This space comes from two sources: + * - padding - space that's required to show the labels at the edges of the scale + * - thickness of scales or legends in another orientation + */ + update(maxWidth: number, maxHeight: number, margins: { + top: number; + left: number; + bottom: number; + right: number; + }): void; + /** + * @protected + */ + protected configure(): void; + _alignToPixels: any; + afterUpdate(): void; + beforeSetDimensions(): void; + setDimensions(): void; + afterSetDimensions(): void; + _callHooks(name: any): void; + beforeDataLimits(): void; + determineDataLimits(): void; + afterDataLimits(): void; + beforeBuildTicks(): void; + /** + * @return {object[]} the ticks + */ + buildTicks(): object[]; + afterBuildTicks(): void; + beforeTickToLabelConversion(): void; + /** + * Convert ticks to label strings + * @param {Tick[]} ticks + */ + generateTickLabels(ticks: Tick[]): void; + afterTickToLabelConversion(): void; + beforeCalculateLabelRotation(): void; + calculateLabelRotation(): void; + afterCalculateLabelRotation(): void; + afterAutoSkip(): void; + beforeFit(): void; + fit(): void; + _calculatePadding(first: any, last: any, sin: any, cos: any): void; + /** + * Handle margins and padding interactions + * @private + */ + private _handleMargins; + afterFit(): void; + /** + * @return {boolean} + */ + isHorizontal(): boolean; + /** + * @return {boolean} + */ + isFullSize(): boolean; + /** + * @param {Tick[]} ticks + * @private + */ + private _convertTicksToLabels; + /** + * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }} + * @private + */ + private _getLabelSizes; + /** + * Returns {width, height, offset} objects for the first, last, widest, highest tick + * labels where offset indicates the anchor point offset from the top in pixels. + * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }} + * @private + */ + private _computeLabelSizes; + /** + * Used to get the label to display in the tooltip for the given value + * @param {*} value + * @return {string} + */ + getLabelForValue(value: any): string; + /** + * Returns the location of the given data point. Value can either be an index or a numerical value + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {*} value + * @param {number} [index] + * @return {number} + */ + getPixelForValue(value: any, index?: number): number; + /** + * Used to get the data value from a given pixel. This is the inverse of getPixelForValue + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} pixel + * @return {*} + */ + getValueForPixel(pixel: number): any; + /** + * Returns the location of the tick at the given index + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} index + * @return {number} + */ + getPixelForTick(index: number): number; + /** + * Utility for getting the pixel location of a percentage of scale + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} decimal + * @return {number} + */ + getPixelForDecimal(decimal: number): number; + /** + * @param {number} pixel + * @return {number} + */ + getDecimalForPixel(pixel: number): number; + /** + * Returns the pixel for the minimum chart value + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @return {number} + */ + getBasePixel(): number; + /** + * @return {number} + */ + getBaseValue(): number; + /** + * @protected + */ + protected getContext(index: any): any; + /** + * @return {number} + * @private + */ + private _tickSize; + /** + * @return {boolean} + * @private + */ + private _isVisible; + /** + * @private + */ + private _computeGridLineItems; + /** + * @private + */ + private _computeLabelItems; + _getXAxisLabelAlignment(): string; + _getYAxisLabelAlignment(tl: any): { + textAlign: string; + x: any; + }; + /** + * @private + */ + private _computeLabelArea; + /** + * @protected + */ + protected drawBackground(): void; + getLineWidthForValue(value: any): any; + /** + * @protected + */ + protected drawGrid(chartArea: any): void; + /** + * @protected + */ + protected drawBorder(): void; + /** + * @protected + */ + protected drawLabels(chartArea: any): void; + /** + * @protected + */ + protected drawTitle(): void; + draw(chartArea: any): void; + /** + * @return {object[]} + * @private + */ + private _layers; + /** + * Returns visible dataset metas that are attached to this scale + * @param {string} [type] - if specified, also filter by dataset type + * @return {object[]} + */ + getMatchingVisibleMetas(type?: string): object[]; + /** + * @param {number} index + * @return {object} + * @protected + */ + protected _resolveTickFontOptions(index: number): object; + /** + * @protected + */ + protected _maxDigits(): number; +} +export type Chart = import('../types/index.js').Chart; +export type Tick = { + value: number | string; + label?: string; + major?: boolean; + $context?: any; +}; +import Element from "./core.element.js"; diff --git a/seller_1/node_modules/chart.js/dist/core/core.scale.defaults.d.ts b/seller_1/node_modules/chart.js/dist/core/core.scale.defaults.d.ts new file mode 100644 index 0000000..f747e8b --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.scale.defaults.d.ts @@ -0,0 +1 @@ +export function applyScaleDefaults(defaults: any): void; diff --git a/seller_1/node_modules/chart.js/dist/core/core.ticks.d.ts b/seller_1/node_modules/chart.js/dist/core/core.ticks.d.ts new file mode 100644 index 0000000..fc99f1d --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.ticks.d.ts @@ -0,0 +1,31 @@ +declare namespace _default { + export { formatters }; +} +export default _default; +declare namespace formatters { + /** + * Formatter for value labels + * @method Chart.Ticks.formatters.values + * @param value the value to display + * @return {string|string[]} the label to display + */ + function values(value: any): string | string[]; + /** + * Formatter for numeric ticks + * @method Chart.Ticks.formatters.numeric + * @param tickValue {number} the value to be formatted + * @param index {number} the position of the tickValue parameter in the ticks array + * @param ticks {object[]} the list of ticks being converted + * @return {string} string representation of the tickValue parameter + */ + function numeric(tickValue: number, index: number, ticks: any[]): string; + /** + * Formatter for logarithmic ticks + * @method Chart.Ticks.formatters.logarithmic + * @param tickValue {number} the value to be formatted + * @param index {number} the position of the tickValue parameter in the ticks array + * @param ticks {object[]} the list of ticks being converted + * @return {string} string representation of the tickValue parameter + */ + function logarithmic(tickValue: number, index: number, ticks: any[]): string; +} diff --git a/seller_1/node_modules/chart.js/dist/core/core.typedRegistry.d.ts b/seller_1/node_modules/chart.js/dist/core/core.typedRegistry.d.ts new file mode 100644 index 0000000..ac1bf25 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/core.typedRegistry.d.ts @@ -0,0 +1,33 @@ +/** + * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent + */ +export default class TypedRegistry { + constructor(type: any, scope: any, override: any); + type: any; + scope: any; + override: any; + items: any; + isForType(type: any): boolean; + /** + * @param {IChartComponent} item + * @returns {string} The scope where items defaults were registered to. + */ + register(item: IChartComponent): string; + /** + * @param {string} id + * @returns {object?} + */ + get(id: string): object | null; + /** + * @param {IChartComponent} item + */ + unregister(item: IChartComponent): void; +} +export type IChartComponent = { + id: string; + defaults: any; + overrides?: any; + defaultRoutes: any; +}; +import defaults from "./core.defaults.js"; +import { overrides } from "./core.defaults.js"; diff --git a/seller_1/node_modules/chart.js/dist/core/index.d.ts b/seller_1/node_modules/chart.js/dist/core/index.d.ts new file mode 100644 index 0000000..e9b3771 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/core/index.d.ts @@ -0,0 +1,15 @@ +export type { DateAdapter, TimeUnit } from './core.adapters.js'; +export { default as _adapters } from './core.adapters.js'; +export { default as Animation } from './core.animation.js'; +export { default as Animations } from './core.animations.js'; +export { default as animator } from './core.animator.js'; +export { default as Chart } from './core.controller.js'; +export { default as DatasetController } from './core.datasetController.js'; +export { default as defaults } from './core.defaults.js'; +export { default as Element } from './core.element.js'; +export { default as Interaction } from './core.interaction.js'; +export { default as layouts } from './core.layouts.js'; +export { default as plugins } from './core.plugins.js'; +export { default as registry } from './core.registry.js'; +export { default as Scale } from './core.scale.js'; +export { default as Ticks } from './core.ticks.js'; diff --git a/seller_1/node_modules/chart.js/dist/elements/element.arc.d.ts b/seller_1/node_modules/chart.js/dist/elements/element.arc.d.ts new file mode 100644 index 0000000..cdd274f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/elements/element.arc.d.ts @@ -0,0 +1,50 @@ +import Element from '../core/core.element.js'; +import type { ArcOptions, Point } from '../types/index.js'; +export interface ArcProps extends Point { + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + circumference: number; +} +export default class ArcElement extends Element<ArcProps, ArcOptions> { + static id: string; + static defaults: { + borderAlign: string; + borderColor: string; + borderDash: any[]; + borderDashOffset: number; + borderJoinStyle: any; + borderRadius: number; + borderWidth: number; + offset: number; + spacing: number; + angle: any; + circular: boolean; + }; + static defaultRoutes: { + backgroundColor: string; + }; + static descriptors: { + _scriptable: boolean; + _indexable: (name: any) => boolean; + }; + circumference: number; + endAngle: number; + fullCircles: number; + innerRadius: number; + outerRadius: number; + pixelMargin: number; + startAngle: number; + constructor(cfg: any); + inRange(chartX: number, chartY: number, useFinalPosition: boolean): boolean; + getCenterPoint(useFinalPosition: boolean): { + x: number; + y: number; + }; + tooltipPosition(useFinalPosition: boolean): { + x: number; + y: number; + }; + draw(ctx: CanvasRenderingContext2D): void; +} diff --git a/seller_1/node_modules/chart.js/dist/elements/element.bar.d.ts b/seller_1/node_modules/chart.js/dist/elements/element.bar.d.ts new file mode 100644 index 0000000..f650e32 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/elements/element.bar.d.ts @@ -0,0 +1,32 @@ +export default class BarElement extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + static id: string; + /** + * @type {any} + */ + static defaults: any; + constructor(cfg: any); + options: any; + horizontal: any; + base: any; + width: any; + height: any; + inflateAmount: any; + draw(ctx: any): void; + inRange(mouseX: any, mouseY: any, useFinalPosition: any): boolean; + inXRange(mouseX: any, useFinalPosition: any): boolean; + inYRange(mouseY: any, useFinalPosition: any): boolean; + getCenterPoint(useFinalPosition: any): { + x: number; + y: number; + }; + getRange(axis: any): number; +} +export type BarProps = { + x: number; + y: number; + base: number; + horizontal: boolean; + width: number; + height: number; +}; +import Element from "../core/core.element.js"; diff --git a/seller_1/node_modules/chart.js/dist/elements/element.line.d.ts b/seller_1/node_modules/chart.js/dist/elements/element.line.d.ts new file mode 100644 index 0000000..a5fe47d --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/elements/element.line.d.ts @@ -0,0 +1,87 @@ +export default class LineElement extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + static id: string; + /** + * @type {any} + */ + static defaults: any; + static descriptors: { + _scriptable: boolean; + _indexable: (name: any) => boolean; + }; + constructor(cfg: any); + animated: boolean; + options: any; + _chart: any; + _loop: any; + _fullLoop: any; + _path: any; + _points: any; + _segments: import("../helpers/helpers.segment.js").Segment[]; + _decimated: boolean; + _pointsUpdated: boolean; + _datasetIndex: any; + updateControlPoints(chartArea: any, indexAxis: any): void; + set points(arg: any); + get points(): any; + get segments(): import("../helpers/helpers.segment.js").Segment[]; + /** + * First non-skipped point on this line + * @returns {PointElement|undefined} + */ + first(): PointElement | undefined; + /** + * Last non-skipped point on this line + * @returns {PointElement|undefined} + */ + last(): PointElement | undefined; + /** + * Interpolate a point in this line at the same value on `property` as + * the reference `point` provided + * @param {PointElement} point - the reference point + * @param {string} property - the property to match on + * @returns {PointElement|undefined} + */ + interpolate(point: PointElement, property: string): PointElement | undefined; + /** + * Append a segment of this line to current path. + * @param {CanvasRenderingContext2D} ctx + * @param {object} segment + * @param {number} segment.start - start index of the segment, referring the points array + * @param {number} segment.end - end index of the segment, referring the points array + * @param {boolean} segment.loop - indicates that the segment is a loop + * @param {object} params + * @param {boolean} params.move - move to starting point (vs line to it) + * @param {boolean} params.reverse - path the segment from end to start + * @param {number} params.start - limit segment to points starting from `start` index + * @param {number} params.end - limit segment to points ending at `start` + `count` index + * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed) + */ + pathSegment(ctx: CanvasRenderingContext2D, segment: { + start: number; + end: number; + loop: boolean; + }, params: { + move: boolean; + reverse: boolean; + start: number; + end: number; + }): undefined | boolean; + /** + * Append all segments of this line to current path. + * @param {CanvasRenderingContext2D|Path2D} ctx + * @param {number} [start] + * @param {number} [count] + * @returns {undefined|boolean} - true if line is a full loop (path should be closed) + */ + path(ctx: CanvasRenderingContext2D | Path2D, start?: number, count?: number): undefined | boolean; + /** + * Draw + * @param {CanvasRenderingContext2D} ctx + * @param {object} chartArea + * @param {number} [start] + * @param {number} [count] + */ + draw(ctx: CanvasRenderingContext2D, chartArea: object, start?: number, count?: number): void; +} +export type PointElement = import('./element.point.js').default; +import Element from "../core/core.element.js"; diff --git a/seller_1/node_modules/chart.js/dist/elements/element.point.d.ts b/seller_1/node_modules/chart.js/dist/elements/element.point.d.ts new file mode 100644 index 0000000..584b277 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/elements/element.point.d.ts @@ -0,0 +1,39 @@ +import Element from '../core/core.element.js'; +import type { CartesianParsedData, ChartArea, Point, PointHoverOptions, PointOptions } from '../types/index.js'; +export type PointProps = Point; +export default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> { + static id: string; + parsed: CartesianParsedData; + skip?: boolean; + stop?: boolean; + /** + * @type {any} + */ + static defaults: { + borderWidth: number; + hitRadius: number; + hoverBorderWidth: number; + hoverRadius: number; + pointStyle: string; + radius: number; + rotation: number; + }; + /** + * @type {any} + */ + static defaultRoutes: { + backgroundColor: string; + borderColor: string; + }; + constructor(cfg: any); + inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean): boolean; + inXRange(mouseX: number, useFinalPosition?: boolean): boolean; + inYRange(mouseY: number, useFinalPosition?: boolean): boolean; + getCenterPoint(useFinalPosition?: boolean): { + x: number; + y: number; + }; + size(options?: Partial<PointOptions & PointHoverOptions>): number; + draw(ctx: CanvasRenderingContext2D, area: ChartArea): void; + getRange(): any; +} diff --git a/seller_1/node_modules/chart.js/dist/elements/index.d.ts b/seller_1/node_modules/chart.js/dist/elements/index.d.ts new file mode 100644 index 0000000..3db94cc --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/elements/index.d.ts @@ -0,0 +1,4 @@ +export { default as ArcElement } from "./element.arc.js"; +export { default as LineElement } from "./element.line.js"; +export { default as PointElement } from "./element.point.js"; +export { default as BarElement } from "./element.bar.js"; diff --git a/seller_1/node_modules/chart.js/dist/helpers.cjs b/seller_1/node_modules/chart.js/dist/helpers.cjs new file mode 100644 index 0000000..6021871 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers.cjs @@ -0,0 +1,135 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +'use strict'; + +var helpers_segment = require('./chunks/helpers.segment.cjs'); +require('@kurkle/color'); + + + +exports.HALF_PI = helpers_segment.HALF_PI; +exports.INFINITY = helpers_segment.INFINITY; +exports.PI = helpers_segment.PI; +exports.PITAU = helpers_segment.PITAU; +exports.QUARTER_PI = helpers_segment.QUARTER_PI; +exports.RAD_PER_DEG = helpers_segment.RAD_PER_DEG; +exports.TAU = helpers_segment.TAU; +exports.TWO_THIRDS_PI = helpers_segment.TWO_THIRDS_PI; +exports._addGrace = helpers_segment._addGrace; +exports._alignPixel = helpers_segment._alignPixel; +exports._alignStartEnd = helpers_segment._alignStartEnd; +exports._angleBetween = helpers_segment._angleBetween; +exports._angleDiff = helpers_segment._angleDiff; +exports._arrayUnique = helpers_segment._arrayUnique; +exports._attachContext = helpers_segment._attachContext; +exports._bezierCurveTo = helpers_segment._bezierCurveTo; +exports._bezierInterpolation = helpers_segment._bezierInterpolation; +exports._boundSegment = helpers_segment._boundSegment; +exports._boundSegments = helpers_segment._boundSegments; +exports._capitalize = helpers_segment._capitalize; +exports._computeSegments = helpers_segment._computeSegments; +exports._createResolver = helpers_segment._createResolver; +exports._decimalPlaces = helpers_segment._decimalPlaces; +exports._deprecated = helpers_segment._deprecated; +exports._descriptors = helpers_segment._descriptors; +exports._elementsEqual = helpers_segment._elementsEqual; +exports._factorize = helpers_segment._factorize; +exports._filterBetween = helpers_segment._filterBetween; +exports._getParentNode = helpers_segment._getParentNode; +exports._getStartAndCountOfVisiblePoints = helpers_segment._getStartAndCountOfVisiblePoints; +exports._int16Range = helpers_segment._int16Range; +exports._isBetween = helpers_segment._isBetween; +exports._isClickEvent = helpers_segment._isClickEvent; +exports._isDomSupported = helpers_segment._isDomSupported; +exports._isPointInArea = helpers_segment._isPointInArea; +exports._limitValue = helpers_segment._limitValue; +exports._longestText = helpers_segment._longestText; +exports._lookup = helpers_segment._lookup; +exports._lookupByKey = helpers_segment._lookupByKey; +exports._measureText = helpers_segment._measureText; +exports._merger = helpers_segment._merger; +exports._mergerIf = helpers_segment._mergerIf; +exports._normalizeAngle = helpers_segment._normalizeAngle; +exports._parseObjectDataRadialScale = helpers_segment._parseObjectDataRadialScale; +exports._pointInLine = helpers_segment._pointInLine; +exports._readValueToProps = helpers_segment._readValueToProps; +exports._rlookupByKey = helpers_segment._rlookupByKey; +exports._scaleRangesChanged = helpers_segment._scaleRangesChanged; +exports._setMinAndMaxByKey = helpers_segment._setMinAndMaxByKey; +exports._splitKey = helpers_segment._splitKey; +exports._steppedInterpolation = helpers_segment._steppedInterpolation; +exports._steppedLineTo = helpers_segment._steppedLineTo; +exports._textX = helpers_segment._textX; +exports._toLeftRightCenter = helpers_segment._toLeftRightCenter; +exports._updateBezierControlPoints = helpers_segment._updateBezierControlPoints; +exports.addRoundedRectPath = helpers_segment.addRoundedRectPath; +exports.almostEquals = helpers_segment.almostEquals; +exports.almostWhole = helpers_segment.almostWhole; +exports.callback = helpers_segment.callback; +exports.clearCanvas = helpers_segment.clearCanvas; +exports.clipArea = helpers_segment.clipArea; +exports.clone = helpers_segment.clone; +exports.color = helpers_segment.color; +exports.createContext = helpers_segment.createContext; +exports.debounce = helpers_segment.debounce; +exports.defined = helpers_segment.defined; +exports.distanceBetweenPoints = helpers_segment.distanceBetweenPoints; +exports.drawPoint = helpers_segment.drawPoint; +exports.drawPointLegend = helpers_segment.drawPointLegend; +exports.each = helpers_segment.each; +exports.easingEffects = helpers_segment.effects; +exports.finiteOrDefault = helpers_segment.finiteOrDefault; +exports.fontString = helpers_segment.fontString; +exports.formatNumber = helpers_segment.formatNumber; +exports.getAngleFromPoint = helpers_segment.getAngleFromPoint; +exports.getHoverColor = helpers_segment.getHoverColor; +exports.getMaximumSize = helpers_segment.getMaximumSize; +exports.getRelativePosition = helpers_segment.getRelativePosition; +exports.getRtlAdapter = helpers_segment.getRtlAdapter; +exports.getStyle = helpers_segment.getStyle; +exports.isArray = helpers_segment.isArray; +exports.isFinite = helpers_segment.isNumberFinite; +exports.isFunction = helpers_segment.isFunction; +exports.isNullOrUndef = helpers_segment.isNullOrUndef; +exports.isNumber = helpers_segment.isNumber; +exports.isObject = helpers_segment.isObject; +exports.isPatternOrGradient = helpers_segment.isPatternOrGradient; +exports.listenArrayEvents = helpers_segment.listenArrayEvents; +exports.log10 = helpers_segment.log10; +exports.merge = helpers_segment.merge; +exports.mergeIf = helpers_segment.mergeIf; +exports.niceNum = helpers_segment.niceNum; +exports.noop = helpers_segment.noop; +exports.overrideTextDirection = helpers_segment.overrideTextDirection; +exports.readUsedSize = helpers_segment.readUsedSize; +exports.renderText = helpers_segment.renderText; +exports.requestAnimFrame = helpers_segment.requestAnimFrame; +exports.resolve = helpers_segment.resolve; +exports.resolveObjectKey = helpers_segment.resolveObjectKey; +exports.restoreTextDirection = helpers_segment.restoreTextDirection; +exports.retinaScale = helpers_segment.retinaScale; +exports.setsEqual = helpers_segment.setsEqual; +exports.sign = helpers_segment.sign; +exports.splineCurve = helpers_segment.splineCurve; +exports.splineCurveMonotone = helpers_segment.splineCurveMonotone; +exports.supportsEventListenerOptions = helpers_segment.supportsEventListenerOptions; +exports.throttled = helpers_segment.throttled; +exports.toDegrees = helpers_segment.toDegrees; +exports.toDimension = helpers_segment.toDimension; +exports.toFont = helpers_segment.toFont; +exports.toFontString = helpers_segment.toFontString; +exports.toLineHeight = helpers_segment.toLineHeight; +exports.toPadding = helpers_segment.toPadding; +exports.toPercentage = helpers_segment.toPercentage; +exports.toRadians = helpers_segment.toRadians; +exports.toTRBL = helpers_segment.toTRBL; +exports.toTRBLCorners = helpers_segment.toTRBLCorners; +exports.uid = helpers_segment.uid; +exports.unclipArea = helpers_segment.unclipArea; +exports.unlistenArrayEvents = helpers_segment.unlistenArrayEvents; +exports.valueOrDefault = helpers_segment.valueOrDefault; +//# sourceMappingURL=helpers.cjs.map diff --git a/seller_1/node_modules/chart.js/dist/helpers.cjs.map b/seller_1/node_modules/chart.js/dist/helpers.cjs.map new file mode 100644 index 0000000..0bf0063 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/helpers.js b/seller_1/node_modules/chart.js/dist/helpers.js new file mode 100644 index 0000000..3f5e1f1 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers.js @@ -0,0 +1,9 @@ +/*! + * Chart.js v4.4.7 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +export { H as HALF_PI, b2 as INFINITY, P as PI, b1 as PITAU, b4 as QUARTER_PI, b3 as RAD_PER_DEG, T as TAU, b5 as TWO_THIRDS_PI, R as _addGrace, X as _alignPixel, a2 as _alignStartEnd, p as _angleBetween, b6 as _angleDiff, _ as _arrayUnique, a8 as _attachContext, as as _bezierCurveTo, ap as _bezierInterpolation, ax as _boundSegment, an as _boundSegments, a5 as _capitalize, am as _computeSegments, a9 as _createResolver, aK as _decimalPlaces, aV as _deprecated, aa as _descriptors, ah as _elementsEqual, N as _factorize, aO as _filterBetween, I as _getParentNode, q as _getStartAndCountOfVisiblePoints, W as _int16Range, aj as _isBetween, ai as _isClickEvent, M as _isDomSupported, C as _isPointInArea, S as _limitValue, aN as _longestText, aP as _lookup, B as _lookupByKey, V as _measureText, aT as _merger, aU as _mergerIf, ay as _normalizeAngle, y as _parseObjectDataRadialScale, aq as _pointInLine, ak as _readValueToProps, A as _rlookupByKey, w as _scaleRangesChanged, aG as _setMinAndMaxByKey, aW as _splitKey, ao as _steppedInterpolation, ar as _steppedLineTo, aB as _textX, a1 as _toLeftRightCenter, al as _updateBezierControlPoints, au as addRoundedRectPath, aJ as almostEquals, aI as almostWhole, Q as callback, af as clearCanvas, Y as clipArea, aS as clone, c as color, j as createContext, ad as debounce, h as defined, aE as distanceBetweenPoints, at as drawPoint, aD as drawPointLegend, F as each, e as easingEffects, O as finiteOrDefault, a$ as fontString, o as formatNumber, D as getAngleFromPoint, aR as getHoverColor, G as getMaximumSize, z as getRelativePosition, az as getRtlAdapter, a_ as getStyle, b as isArray, g as isFinite, a7 as isFunction, k as isNullOrUndef, x as isNumber, i as isObject, aQ as isPatternOrGradient, l as listenArrayEvents, aM as log10, a4 as merge, ab as mergeIf, aH as niceNum, aF as noop, aA as overrideTextDirection, J as readUsedSize, Z as renderText, r as requestAnimFrame, a as resolve, f as resolveObjectKey, aC as restoreTextDirection, ae as retinaScale, ag as setsEqual, s as sign, aY as splineCurve, aZ as splineCurveMonotone, K as supportsEventListenerOptions, L as throttled, U as toDegrees, n as toDimension, a0 as toFont, aX as toFontString, b0 as toLineHeight, E as toPadding, m as toPercentage, t as toRadians, av as toTRBL, aw as toTRBLCorners, ac as uid, $ as unclipArea, u as unlistenArrayEvents, v as valueOrDefault } from './chunks/helpers.segment.js'; +import '@kurkle/color'; +//# sourceMappingURL=helpers.js.map diff --git a/seller_1/node_modules/chart.js/dist/helpers.js.map b/seller_1/node_modules/chart.js/dist/helpers.js.map new file mode 100644 index 0000000..de14c42 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.canvas.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.canvas.d.ts new file mode 100644 index 0000000..ff83b28 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.canvas.d.ts @@ -0,0 +1,75 @@ +import type { Chart, Point, FontSpec, CanvasFontSpec, PointStyle, RenderTextOpts } from '../types/index.js'; +import type { TRBL, SplinePoint, RoundedRect, TRBLCorners } from '../types/geometric.js'; +/** + * Converts the given font object into a CSS font string. + * @param font - A font object. + * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font + * @private + */ +export declare function toFontString(font: FontSpec): string; +/** + * @private + */ +export declare function _measureText(ctx: CanvasRenderingContext2D, data: Record<string, number>, gc: string[], longest: number, string: string): number; +type Thing = string | undefined | null; +type Things = (Thing | Thing[])[]; +/** + * @private + */ +export declare function _longestText(ctx: CanvasRenderingContext2D, font: string, arrayOfThings: Things, cache?: { + data?: Record<string, number>; + garbageCollect?: string[]; + font?: string; +}): number; +/** + * Returns the aligned pixel value to avoid anti-aliasing blur + * @param chart - The chart instance. + * @param pixel - A pixel value. + * @param width - The width of the element. + * @returns The aligned pixel value. + * @private + */ +export declare function _alignPixel(chart: Chart, pixel: number, width: number): number; +/** + * Clears the entire canvas. + */ +export declare function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D): void; +export interface DrawPointOptions { + pointStyle: PointStyle; + rotation?: number; + radius: number; + borderWidth: number; +} +export declare function drawPoint(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number): void; +export declare function drawPointLegend(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number, w: number): void; +/** + * Returns true if the point is inside the rectangle + * @param point - The point to test + * @param area - The rectangle + * @param margin - allowed margin + * @private + */ +export declare function _isPointInArea(point: Point, area: TRBL, margin?: number): boolean; +export declare function clipArea(ctx: CanvasRenderingContext2D, area: TRBL): void; +export declare function unclipArea(ctx: CanvasRenderingContext2D): void; +/** + * @private + */ +export declare function _steppedLineTo(ctx: CanvasRenderingContext2D, previous: Point, target: Point, flip?: boolean, mode?: string): void; +/** + * @private + */ +export declare function _bezierCurveTo(ctx: CanvasRenderingContext2D, previous: SplinePoint, target: SplinePoint, flip?: boolean): void; +/** + * Render text onto the canvas + */ +export declare function renderText(ctx: CanvasRenderingContext2D, text: string | string[], x: number, y: number, font: CanvasFontSpec, opts?: RenderTextOpts): void; +/** + * Add a path of a rectangle with rounded corners to the current sub-path + * @param ctx - Context + * @param rect - Bounding rect + */ +export declare function addRoundedRectPath(ctx: CanvasRenderingContext2D, rect: RoundedRect & { + radius: TRBLCorners; +}): void; +export {}; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.collection.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.collection.d.ts new file mode 100644 index 0000000..94d1589 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.collection.d.ts @@ -0,0 +1,68 @@ +/** + * Binary search + * @param table - the table search. must be sorted! + * @param value - value to find + * @param cmp + * @private + */ +export declare function _lookup(table: number[], value: number, cmp?: (value: number) => boolean): { + lo: number; + hi: number; +}; +export declare function _lookup<T>(table: T[], value: number, cmp: (value: number) => boolean): { + lo: number; + hi: number; +}; +/** + * Binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @param last - lookup last index + * @private + */ +export declare const _lookupByKey: (table: Record<string, number>[], key: string, value: number, last?: boolean) => { + lo: number; + hi: number; +}; +/** + * Reverse binary search + * @param table - the table search. must be sorted! + * @param key - property name for the value in each entry + * @param value - value to find + * @private + */ +export declare const _rlookupByKey: (table: Record<string, number>[], key: string, value: number) => { + lo: number; + hi: number; +}; +/** + * Return subset of `values` between `min` and `max` inclusive. + * Values are assumed to be in sorted order. + * @param values - sorted array of values + * @param min - min value + * @param max - max value + */ +export declare function _filterBetween(values: number[], min: number, max: number): number[]; +export interface ArrayListener<T> { + _onDataPush?(...item: T[]): void; + _onDataPop?(): void; + _onDataShift?(): void; + _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void; + _onDataUnshift?(...item: T[]): void; +} +/** + * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice', + * 'unshift') and notify the listener AFTER the array has been altered. Listeners are + * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments. + */ +export declare function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void; +/** + * Removes the given array event listener and cleanup extra attached properties (such as + * the _chartjs stub and overridden methods) if array doesn't have any more listeners. + */ +export declare function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void; +/** + * @param items + */ +export declare function _arrayUnique<T>(items: T[]): T[]; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.color.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.color.d.ts new file mode 100644 index 0000000..b4d7c70 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.color.d.ts @@ -0,0 +1,13 @@ +import { Color } from '@kurkle/color'; +export declare function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient; +export declare function color(value: CanvasGradient): CanvasGradient; +export declare function color(value: CanvasPattern): CanvasPattern; +export declare function color(value: string | { + r: number; + g: number; + b: number; + a: number; +} | [number, number, number] | [number, number, number, number]): Color; +export declare function getHoverColor(value: CanvasGradient): CanvasGradient; +export declare function getHoverColor(value: CanvasPattern): CanvasPattern; +export declare function getHoverColor(value: string): string; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.config.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.config.d.ts new file mode 100644 index 0000000..daaf4a0 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.config.d.ts @@ -0,0 +1,31 @@ +import type { AnyObject } from '../types/basic.js'; +import type { ChartMeta } from '../types/index.js'; +import type { ResolverObjectKey, ResolverCache, ResolverProxy, DescriptorDefaults, Descriptor, ContextProxy } from './helpers.config.types.js'; +export * from './helpers.config.types.js'; +/** + * Creates a Proxy for resolving raw values for options. + * @param scopes - The option scopes to look for values, in resolution order + * @param prefixes - The prefixes for values, in resolution order. + * @param rootScopes - The root option scopes + * @param fallback - Parent scopes fallback + * @param getTarget - callback for getting the target for changed values + * @returns Proxy + * @private + */ +export declare function _createResolver<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(scopes: T, prefixes?: string[], rootScopes?: R, fallback?: ResolverObjectKey, getTarget?: () => AnyObject): any; +/** + * Returns an Proxy for resolving option values with context. + * @param proxy - The Proxy returned by `_createResolver` + * @param context - Context object for scriptable/indexable options + * @param subProxy - The proxy provided for scriptable options + * @param descriptorDefaults - Defaults for descriptors + * @private + */ +export declare function _attachContext<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(proxy: ResolverProxy<T, R>, context: AnyObject, subProxy?: ResolverProxy<T, R>, descriptorDefaults?: DescriptorDefaults): ContextProxy<T, R>; +/** + * @private + */ +export declare function _descriptors(proxy: ResolverCache, defaults?: DescriptorDefaults): Descriptor; +export declare function _parseObjectDataRadialScale(meta: ChartMeta<'line' | 'scatter'>, data: AnyObject[], start: number, count: number): { + r: unknown; +}[]; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.config.types.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.config.types.d.ts new file mode 100644 index 0000000..328ae73 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.config.types.d.ts @@ -0,0 +1,41 @@ +import type { AnyObject } from '../types/basic.js'; +import type { Merge } from '../types/utils.js'; +export type ResolverObjectKey = string | boolean; +export interface ResolverCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> { + [Symbol.toStringTag]: 'Object'; + _cacheable: boolean; + _scopes: T; + _rootScopes: T | R; + _fallback: ResolverObjectKey; + _keys?: string[]; + _scriptable?: boolean; + _indexable?: boolean; + _allKeys?: boolean; + _storage?: T[number]; + _getTarget(): T[number]; + override<S extends AnyObject>(scope: S): ResolverProxy<(T[number] | S)[], T | R>; +} +export type ResolverProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ResolverCache<T, R>; +export interface DescriptorDefaults { + scriptable: boolean; + indexable: boolean; + allKeys?: boolean; +} +export interface Descriptor { + allKeys: boolean; + scriptable: boolean; + indexable: boolean; + isScriptable(key: string): boolean; + isIndexable(key: string): boolean; +} +export interface ContextCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> { + _cacheable: boolean; + _proxy: ResolverProxy<T, R>; + _context: AnyObject; + _subProxy: ResolverProxy<T, R>; + _stack: Set<string>; + _descriptors: Descriptor; + setContext(ctx: AnyObject): ContextProxy<T, R>; + override<S extends AnyObject>(scope: S): ContextProxy<(T[number] | S)[], T | R>; +} +export type ContextProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ContextCache<T, R>; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.core.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.core.d.ts new file mode 100644 index 0000000..448f178 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.core.d.ts @@ -0,0 +1,147 @@ +/** + * @namespace Chart.helpers + */ +import type { AnyObject } from '../types/basic.js'; +import type { ActiveDataPoint, ChartEvent } from '../types/index.js'; +/** + * An empty function that can be used, for example, for optional callback. + */ +export declare function noop(): void; +/** + * Returns a unique id, sequentially generated from a global variable. + */ +export declare const uid: () => number; +/** + * Returns true if `value` is neither null nor undefined, else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ +export declare function isNullOrUndef(value: unknown): value is null | undefined; +/** + * Returns true if `value` is an array (including typed arrays), else returns false. + * @param value - The value to test. + * @function + */ +export declare function isArray<T = unknown>(value: unknown): value is T[]; +/** + * Returns true if `value` is an object (excluding null), else returns false. + * @param value - The value to test. + * @since 2.7.0 + */ +export declare function isObject(value: unknown): value is AnyObject; +/** + * Returns true if `value` is a finite number, else returns false + * @param value - The value to test. + */ +declare function isNumberFinite(value: unknown): value is number; +export { isNumberFinite as isFinite, }; +/** + * Returns `value` if finite, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is not finite. + */ +export declare function finiteOrDefault(value: unknown, defaultValue: number): number; +/** + * Returns `value` if defined, else returns `defaultValue`. + * @param value - The value to return if defined. + * @param defaultValue - The value to return if `value` is undefined. + */ +export declare function valueOrDefault<T>(value: T | undefined, defaultValue: T): T; +export declare const toPercentage: (value: number | string, dimension: number) => number; +export declare const toDimension: (value: number | string, dimension: number) => number; +/** + * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the + * value returned by `fn`. If `fn` is not a function, this method returns undefined. + * @param fn - The function to call. + * @param args - The arguments with which `fn` should be called. + * @param [thisArg] - The value of `this` provided for the call to `fn`. + */ +export declare function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(fn: T | undefined, args: unknown[], thisArg?: TA): R | undefined; +/** + * Note(SB) for performance sake, this method should only be used when loopable type + * is unknown or in none intensive code (not called often and small loopable). Else + * it's preferable to use a regular for() loop and save extra function calls. + * @param loopable - The object or array to be iterated. + * @param fn - The function to call for each item. + * @param [thisArg] - The value of `this` provided for the call to `fn`. + * @param [reverse] - If true, iterates backward on the loopable. + */ +export declare function each<T, TA>(loopable: Record<string, T>, fn: (this: TA, v: T, i: string) => void, thisArg?: TA, reverse?: boolean): void; +export declare function each<T, TA>(loopable: T[], fn: (this: TA, v: T, i: number) => void, thisArg?: TA, reverse?: boolean): void; +/** + * Returns true if the `a0` and `a1` arrays have the same content, else returns false. + * @param a0 - The array to compare + * @param a1 - The array to compare + * @private + */ +export declare function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]): boolean; +/** + * Returns a deep copy of `source` without keeping references on objects and arrays. + * @param source - The value to clone. + */ +export declare function clone<T>(source: T): T; +/** + * The default merger when Chart.helpers.merge is called without merger option. + * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback. + * @private + */ +export declare function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject): void; +export interface MergeOptions { + merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void; +} +/** + * Recursively deep copies `source` properties into `target` with the given `options`. + * IMPORTANT: `target` is not cloned and will be updated with `source` properties. + * @param target - The target object in which all sources are merged into. + * @param source - Object(s) to merge into `target`. + * @param [options] - Merging options: + * @param [options.merger] - The merge method (key, target, source, options) + * @returns The `target` object. + */ +export declare function merge<T>(target: T, source: [], options?: MergeOptions): T; +export declare function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1; +export declare function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1; +export declare function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2; +export declare function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3; +export declare function merge<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4], options?: MergeOptions): T & S1 & S2 & S3 & S4; +export declare function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject; +/** + * Recursively deep copies `source` properties into `target` *only* if not defined in target. + * IMPORTANT: `target` is not cloned and will be updated with `source` properties. + * @param target - The target object in which all sources are merged into. + * @param source - Object(s) to merge into `target`. + * @returns The `target` object. + */ +export declare function mergeIf<T>(target: T, source: []): T; +export declare function mergeIf<T, S1>(target: T, source: S1): T & S1; +export declare function mergeIf<T, S1>(target: T, source: [S1]): T & S1; +export declare function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2; +export declare function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3; +export declare function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4; +export declare function mergeIf<T>(target: T, source: AnyObject[]): AnyObject; +/** + * Merges source[key] in target[key] only if target[key] is undefined. + * @private + */ +export declare function _mergerIf(key: string, target: AnyObject, source: AnyObject): void; +/** + * @private + */ +export declare function _deprecated(scope: string, value: unknown, previous: string, current: string): void; +/** + * @private + */ +export declare function _splitKey(key: string): string[]; +export declare function resolveObjectKey(obj: AnyObject, key: string): any; +/** + * @private + */ +export declare function _capitalize(str: string): string; +export declare const defined: (value: unknown) => boolean; +export declare const isFunction: (value: unknown) => value is (...args: any[]) => any; +export declare const setsEqual: <T>(a: Set<T>, b: Set<T>) => boolean; +/** + * @param e - The event + * @private + */ +export declare function _isClickEvent(e: ChartEvent): boolean; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.curve.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.curve.d.ts new file mode 100644 index 0000000..e6357cb --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.curve.d.ts @@ -0,0 +1,17 @@ +import type { ChartArea } from '../types/index.js'; +import type { SplinePoint } from '../types/geometric.js'; +export declare function splineCurve(firstPoint: SplinePoint, middlePoint: SplinePoint, afterPoint: SplinePoint, t: number): { + previous: SplinePoint; + next: SplinePoint; +}; +/** + * This function calculates Bézier control points in a similar way than |splineCurve|, + * but preserves monotonicity of the provided data and ensures no local extremums are added + * between the dataset discrete points due to the interpolation. + * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation + */ +export declare function splineCurveMonotone(points: SplinePoint[], indexAxis?: 'x' | 'y'): void; +/** + * @private + */ +export declare function _updateBezierControlPoints(points: SplinePoint[], options: any, area: ChartArea, loop: boolean, indexAxis: 'x' | 'y'): void; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.dom.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.dom.d.ts new file mode 100644 index 0000000..1678b18 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.dom.d.ts @@ -0,0 +1,55 @@ +import type Chart from '../core/core.controller.js'; +import type { ChartEvent } from '../types.js'; +/** + * Note: typedefs are auto-exported, so use a made-up `dom` namespace where + * necessary to avoid duplicates with `export * from './helpers`; see + * https://github.com/microsoft/TypeScript/issues/46011 + * @typedef { import('../core/core.controller.js').default } dom.Chart + * @typedef { import('../../types').ChartEvent } ChartEvent + */ +/** + * @private + */ +export declare function _isDomSupported(): boolean; +/** + * @private + */ +export declare function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement; +export declare function getStyle(el: HTMLElement, property: string): string; +/** + * Gets an event's x, y coordinates, relative to the chart area + * @param event + * @param chart + * @returns x and y coordinates of the event + */ +export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart): { + x: number; + y: number; +}; +export declare function getMaximumSize(canvas: HTMLCanvasElement, bbWidth?: number, bbHeight?: number, aspectRatio?: number): { + width: number; + height: number; +}; +/** + * @param chart + * @param forceRatio + * @param forceStyle + * @returns True if the canvas context size or transformation has changed. + */ +export declare function retinaScale(chart: Chart, forceRatio: number, forceStyle?: boolean): boolean | void; +/** + * Detects support for options object argument in addEventListener. + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support + * @private + */ +export declare const supportsEventListenerOptions: boolean; +/** + * The "used" size is the final value of a dimension property after all calculations have + * been performed. This method uses the computed style of `element` but returns undefined + * if the computed style is not expressed in pixels. That can happen in some cases where + * `element` has a size relative to its parent and this last one is not yet displayed, + * for example because of `display: none` on a parent node. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value + * @returns Size in pixels or undefined if unknown. + */ +export declare function readUsedSize(element: HTMLElement, property: 'width' | 'height'): number | undefined; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.easing.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.easing.d.ts new file mode 100644 index 0000000..4b9f559 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.easing.d.ts @@ -0,0 +1,40 @@ +/** + * Easing functions adapted from Robert Penner's easing equations. + * @namespace Chart.helpers.easing.effects + * @see http://www.robertpenner.com/easing/ + */ +declare const effects: { + readonly linear: (t: number) => number; + readonly easeInQuad: (t: number) => number; + readonly easeOutQuad: (t: number) => number; + readonly easeInOutQuad: (t: number) => number; + readonly easeInCubic: (t: number) => number; + readonly easeOutCubic: (t: number) => number; + readonly easeInOutCubic: (t: number) => number; + readonly easeInQuart: (t: number) => number; + readonly easeOutQuart: (t: number) => number; + readonly easeInOutQuart: (t: number) => number; + readonly easeInQuint: (t: number) => number; + readonly easeOutQuint: (t: number) => number; + readonly easeInOutQuint: (t: number) => number; + readonly easeInSine: (t: number) => number; + readonly easeOutSine: (t: number) => number; + readonly easeInOutSine: (t: number) => number; + readonly easeInExpo: (t: number) => number; + readonly easeOutExpo: (t: number) => number; + readonly easeInOutExpo: (t: number) => number; + readonly easeInCirc: (t: number) => number; + readonly easeOutCirc: (t: number) => number; + readonly easeInOutCirc: (t: number) => number; + readonly easeInElastic: (t: number) => number; + readonly easeOutElastic: (t: number) => number; + readonly easeInOutElastic: (t: number) => number; + readonly easeInBack: (t: number) => number; + readonly easeOutBack: (t: number) => number; + readonly easeInOutBack: (t: number) => number; + readonly easeInBounce: (t: number) => number; + readonly easeOutBounce: (t: number) => number; + readonly easeInOutBounce: (t: number) => number; +}; +export type EasingFunction = keyof typeof effects; +export default effects; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.extras.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.extras.d.ts new file mode 100644 index 0000000..fc95895 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.extras.d.ts @@ -0,0 +1,45 @@ +import type { ChartMeta, PointElement } from '../types/index.js'; +export declare function fontString(pixelSize: number, fontStyle: string, fontFamily: string): string; +/** +* Request animation polyfill +*/ +export declare const requestAnimFrame: (((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame) | ((callback: any) => any); +/** + * Throttles calling `fn` once per animation frame + * Latest arguments are used on the actual call + */ +export declare function throttled<TArgs extends Array<any>>(fn: (...args: TArgs) => void, thisArg: any): (...args: TArgs) => void; +/** + * Debounces calling `fn` for `delay` ms + */ +export declare function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number): (...args: TArgs) => number; +/** + * Converts 'start' to 'left', 'end' to 'right' and others to 'center' + * @private + */ +export declare const _toLeftRightCenter: (align: 'start' | 'end' | 'center') => "center" | "left" | "right"; +/** + * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center` + * @private + */ +export declare const _alignStartEnd: (align: 'start' | 'end' | 'center', start: number, end: number) => number; +/** + * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left` + * @private + */ +export declare const _textX: (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => number; +/** + * Return start and count of visible points. + * @private + */ +export declare function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean): { + start: number; + count: number; +}; +/** + * Checks if the scale ranges have changed. + * @param {object} meta - dataset meta. + * @returns {boolean} + * @private + */ +export declare function _scaleRangesChanged(meta: any): boolean; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.interpolation.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.interpolation.d.ts new file mode 100644 index 0000000..d0b6d9b --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.interpolation.d.ts @@ -0,0 +1,22 @@ +import type { Point, SplinePoint } from '../types/geometric.js'; +/** + * @private + */ +export declare function _pointInLine(p1: Point, p2: Point, t: number, mode?: any): { + x: number; + y: number; +}; +/** + * @private + */ +export declare function _steppedInterpolation(p1: Point, p2: Point, t: number, mode: 'middle' | 'after' | unknown): { + x: number; + y: number; +}; +/** + * @private + */ +export declare function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?: any): { + x: number; + y: number; +}; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.intl.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.intl.d.ts new file mode 100644 index 0000000..288f8cf --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.intl.d.ts @@ -0,0 +1 @@ +export declare function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions): string; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.math.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.math.d.ts new file mode 100644 index 0000000..c7b5549 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.math.d.ts @@ -0,0 +1,84 @@ +import type { Point } from '../types/geometric.js'; +/** + * @alias Chart.helpers.math + * @namespace + */ +export declare const PI: number; +export declare const TAU: number; +export declare const PITAU: number; +export declare const INFINITY: number; +export declare const RAD_PER_DEG: number; +export declare const HALF_PI: number; +export declare const QUARTER_PI: number; +export declare const TWO_THIRDS_PI: number; +export declare const log10: (x: number) => number; +export declare const sign: (x: number) => number; +export declare function almostEquals(x: number, y: number, epsilon: number): boolean; +/** + * Implementation of the nice number algorithm used in determining where axis labels will go + */ +export declare function niceNum(range: number): number; +/** + * Returns an array of factors sorted from 1 to sqrt(value) + * @private + */ +export declare function _factorize(value: number): number[]; +export declare function isNumber(n: unknown): n is number; +export declare function almostWhole(x: number, epsilon: number): boolean; +/** + * @private + */ +export declare function _setMinAndMaxByKey(array: Record<string, number>[], target: { + min: number; + max: number; +}, property: string): void; +export declare function toRadians(degrees: number): number; +export declare function toDegrees(radians: number): number; +/** + * Returns the number of decimal places + * i.e. the number of digits after the decimal point, of the value of this Number. + * @param x - A number. + * @returns The number of decimal places. + * @private + */ +export declare function _decimalPlaces(x: number): number; +export declare function getAngleFromPoint(centrePoint: Point, anglePoint: Point): { + angle: number; + distance: number; +}; +export declare function distanceBetweenPoints(pt1: Point, pt2: Point): number; +/** + * Shortest distance between angles, in either direction. + * @private + */ +export declare function _angleDiff(a: number, b: number): number; +/** + * Normalize angle to be between 0 and 2*PI + * @private + */ +export declare function _normalizeAngle(a: number): number; +/** + * @private + */ +export declare function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean): boolean; +/** + * Limit `value` between `min` and `max` + * @param value + * @param min + * @param max + * @private + */ +export declare function _limitValue(value: number, min: number, max: number): number; +/** + * @param {number} value + * @private + */ +export declare function _int16Range(value: number): number; +/** + * @param value + * @param start + * @param end + * @param [epsilon] + * @private + */ +export declare function _isBetween(value: number, start: number, end: number, epsilon?: number): boolean; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.options.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.options.d.ts new file mode 100644 index 0000000..0aae90a --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.options.d.ts @@ -0,0 +1,97 @@ +import type { ChartArea, FontSpec, Point } from '../types/index.js'; +import type { TRBL, TRBLCorners } from '../types/geometric.js'; +/** + * @alias Chart.helpers.options + * @namespace + */ +/** + * Converts the given line height `value` in pixels for a specific font `size`. + * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em'). + * @param size - The font size (in pixels) used to resolve relative `value`. + * @returns The effective line height in pixels (size * 1.2 if value is invalid). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height + * @since 2.7.0 + */ +export declare function toLineHeight(value: number | string, size: number): number; +/** + * @param value + * @param props + */ +export declare function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>; +export declare function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>; +/** + * Converts the given value into a TRBL object. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left) + * @since 3.0.0 + */ +export declare function toTRBL(value: number | TRBL | Point): Record<"left" | "top" | "bottom" | "right", number>; +/** + * Converts the given value into a TRBL corners object (similar with css border-radius). + * @param value - If a number, set the value to all TRBL corner components, + * else, if an object, use defined properties and sets undefined ones to 0. + * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight) + * @since 3.0.0 + */ +export declare function toTRBLCorners(value: number | TRBLCorners): Record<"topLeft" | "topRight" | "bottomLeft" | "bottomRight", number>; +/** + * Converts the given value into a padding object with pre-computed width/height. + * @param value - If a number, set the value to all TRBL component, + * else, if an object, use defined properties and sets undefined ones to 0. + * x / y are shorthands for same value for left/right and top/bottom. + * @returns The padding values (top, right, bottom, left, width, height) + * @since 2.7.0 + */ +export declare function toPadding(value?: number | TRBL): ChartArea; +/** + * Parses font options and returns the font object. + * @param options - A object that contains font options to be parsed. + * @param fallback - A object that contains fallback font options. + * @return The font object. + * @private + */ +export declare function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>): { + family: string; + lineHeight: number; + size: number; + style: "normal" | "inherit" | "italic" | "oblique" | "initial"; + weight: number | "bold" | "normal" | "lighter" | "bolder"; + string: string; +}; +/** + * Evaluates the given `inputs` sequentially and returns the first defined value. + * @param inputs - An array of values, falling back to the last value. + * @param context - If defined and the current value is a function, the value + * is called with `context` as first argument and the result becomes the new input. + * @param index - If defined and the current value is an array, the value + * at `index` become the new input. + * @param info - object to return information about resolution in + * @param info.cacheable - Will be set to `false` if option is not cacheable. + * @since 2.7.0 + */ +export declare function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: { + cacheable: boolean; +}): unknown; +/** + * @param minmax + * @param grace + * @param beginAtZero + * @private + */ +export declare function _addGrace(minmax: { + min: number; + max: number; +}, grace: number | string, beginAtZero: boolean): { + min: number; + max: number; +}; +/** + * Create a context inheriting parentContext + * @param parentContext + * @param context + * @returns + */ +export declare function createContext<T extends object>(parentContext: null, context: T): T; +export declare function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.rtl.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.rtl.d.ts new file mode 100644 index 0000000..93ceb1c --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.rtl.d.ts @@ -0,0 +1,10 @@ +export interface RTLAdapter { + x(x: number): number; + setWidth(w: number): void; + textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right'; + xPlus(x: number, value: number): number; + leftForLtr(x: number, itemWidth: number): number; +} +export declare function getRtlAdapter(rtl: boolean, rectX: number, width: number): RTLAdapter; +export declare function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl'): void; +export declare function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]): void; diff --git a/seller_1/node_modules/chart.js/dist/helpers/helpers.segment.d.ts b/seller_1/node_modules/chart.js/dist/helpers/helpers.segment.d.ts new file mode 100644 index 0000000..20f19c4 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/helpers.segment.d.ts @@ -0,0 +1,65 @@ +/** + * Returns the sub-segment(s) of a line segment that fall in the given bounds + * @param {object} segment + * @param {number} segment.start - start index of the segment, referring the points array + * @param {number} segment.end - end index of the segment, referring the points array + * @param {boolean} segment.loop - indicates that the segment is a loop + * @param {object} [segment.style] - segment style + * @param {PointElement[]} points - the points that this segment refers to + * @param {object} [bounds] + * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`. + * @param {number} bounds.start - start value of the property + * @param {number} bounds.end - end value of the property + * @private + **/ +export function _boundSegment(segment: { + start: number; + end: number; + loop: boolean; + style?: object; +}, points: PointElement[], bounds?: { + property: string; + start: number; + end: number; +}): { + start: number; + end: number; + loop: boolean; + style?: object; +}[]; +/** + * Returns the segments of the line that are inside given bounds + * @param {LineElement} line + * @param {object} [bounds] + * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`. + * @param {number} bounds.start - start value of the `property` + * @param {number} bounds.end - end value of the `property` + * @private + */ +export function _boundSegments(line: LineElement, bounds?: { + property: string; + start: number; + end: number; +}): { + start: number; + end: number; + loop: boolean; + style?: object; +}[]; +/** + * Compute the continuous segments that define the whole line + * There can be skipped points within a segment, if spanGaps is true. + * @param {LineElement} line + * @param {object} [segmentOptions] + * @return {Segment[]} + * @private + */ +export function _computeSegments(line: LineElement, segmentOptions?: object): Segment[]; +export type LineElement = import('../elements/element.line.js').default; +export type PointElement = import('../elements/element.point.js').default; +export type Segment = { + start: number; + end: number; + loop: boolean; + style?: any; +}; diff --git a/seller_1/node_modules/chart.js/dist/helpers/index.d.ts b/seller_1/node_modules/chart.js/dist/helpers/index.d.ts new file mode 100644 index 0000000..d43469e --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/helpers/index.d.ts @@ -0,0 +1,15 @@ +export * from './helpers.color.js'; +export * from './helpers.core.js'; +export * from './helpers.canvas.js'; +export * from './helpers.collection.js'; +export * from './helpers.config.js'; +export * from './helpers.curve.js'; +export * from './helpers.dom.js'; +export { default as easingEffects } from './helpers.easing.js'; +export * from './helpers.extras.js'; +export * from './helpers.interpolation.js'; +export * from './helpers.intl.js'; +export * from './helpers.options.js'; +export * from './helpers.math.js'; +export * from './helpers.rtl.js'; +export * from './helpers.segment.js'; diff --git a/seller_1/node_modules/chart.js/dist/index.d.ts b/seller_1/node_modules/chart.js/dist/index.d.ts new file mode 100644 index 0000000..bc74802 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/index.d.ts @@ -0,0 +1,12 @@ +export * from './controllers/index.js'; +export * from './core/index.js'; +export * from './elements/index.js'; +export * from './platform/index.js'; +export * from './plugins/index.js'; +export * from './scales/index.js'; +import * as controllers from './controllers/index.js'; +import * as elements from './elements/index.js'; +import * as plugins from './plugins/index.js'; +import * as scales from './scales/index.js'; +export { controllers, elements, plugins, scales, }; +export declare const registerables: (typeof controllers | typeof elements | typeof plugins | typeof scales)[]; diff --git a/seller_1/node_modules/chart.js/dist/index.umd.d.ts b/seller_1/node_modules/chart.js/dist/index.umd.d.ts new file mode 100644 index 0000000..58e390f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/index.umd.d.ts @@ -0,0 +1,5 @@ +/** + * @namespace Chart + */ +import Chart from './core/core.controller.js'; +export default Chart; diff --git a/seller_1/node_modules/chart.js/dist/platform/index.d.ts b/seller_1/node_modules/chart.js/dist/platform/index.d.ts new file mode 100644 index 0000000..0ad1283 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/platform/index.d.ts @@ -0,0 +1,5 @@ +export function _detectPlatform(canvas: any): typeof BasicPlatform | typeof DomPlatform; +import BasicPlatform from "./platform.basic.js"; +import DomPlatform from "./platform.dom.js"; +import BasePlatform from "./platform.base.js"; +export { BasePlatform, BasicPlatform, DomPlatform }; diff --git a/seller_1/node_modules/chart.js/dist/platform/platform.base.d.ts b/seller_1/node_modules/chart.js/dist/platform/platform.base.d.ts new file mode 100644 index 0000000..34bc9ae --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/platform/platform.base.d.ts @@ -0,0 +1,63 @@ +/** + * @typedef { import('../core/core.controller.js').default } Chart + */ +/** + * Abstract class that allows abstracting platform dependencies away from the chart. + */ +export default class BasePlatform { + /** + * Called at chart construction time, returns a context2d instance implementing + * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}. + * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific) + * @param {number} [aspectRatio] - The chart options + */ + acquireContext(canvas: HTMLCanvasElement, aspectRatio?: number): void; + /** + * Called at chart destruction time, releases any resources associated to the context + * previously returned by the acquireContext() method. + * @param {CanvasRenderingContext2D} context - The context2d instance + * @returns {boolean} true if the method succeeded, else false + */ + releaseContext(context: CanvasRenderingContext2D): boolean; + /** + * Registers the specified listener on the given chart. + * @param {Chart} chart - Chart from which to listen for event + * @param {string} type - The ({@link ChartEvent}) type to listen for + * @param {function} listener - Receives a notification (an object that implements + * the {@link ChartEvent} interface) when an event of the specified type occurs. + */ + addEventListener(chart: Chart, type: string, listener: Function): void; + /** + * Removes the specified listener previously registered with addEventListener. + * @param {Chart} chart - Chart from which to remove the listener + * @param {string} type - The ({@link ChartEvent}) type to remove + * @param {function} listener - The listener function to remove from the event target. + */ + removeEventListener(chart: Chart, type: string, listener: Function): void; + /** + * @returns {number} the current devicePixelRatio of the device this platform is connected to. + */ + getDevicePixelRatio(): number; + /** + * Returns the maximum size in pixels of given canvas element. + * @param {HTMLCanvasElement} element + * @param {number} [width] - content width of parent element + * @param {number} [height] - content height of parent element + * @param {number} [aspectRatio] - aspect ratio to maintain + */ + getMaximumSize(element: HTMLCanvasElement, width?: number, height?: number, aspectRatio?: number): { + width: number; + height: number; + }; + /** + * @param {HTMLCanvasElement} canvas + * @returns {boolean} true if the canvas is attached to the platform, false if not. + */ + isAttached(canvas: HTMLCanvasElement): boolean; + /** + * Updates config with platform specific requirements + * @param {import('../core/core.config.js').default} config + */ + updateConfig(config: import('../core/core.config.js').default): void; +} +export type Chart = import('../core/core.controller.js').default; diff --git a/seller_1/node_modules/chart.js/dist/platform/platform.basic.d.ts b/seller_1/node_modules/chart.js/dist/platform/platform.basic.d.ts new file mode 100644 index 0000000..929c373 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/platform/platform.basic.d.ts @@ -0,0 +1,10 @@ +/** + * Platform class for charts without access to the DOM or to many element properties + * This platform is used by default for any chart passed an OffscreenCanvas. + * @extends BasePlatform + */ +export default class BasicPlatform extends BasePlatform { + acquireContext(item: any): any; + updateConfig(config: any): void; +} +import BasePlatform from "./platform.base.js"; diff --git a/seller_1/node_modules/chart.js/dist/platform/platform.dom.d.ts b/seller_1/node_modules/chart.js/dist/platform/platform.dom.d.ts new file mode 100644 index 0000000..c82f4ed --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/platform/platform.dom.d.ts @@ -0,0 +1,19 @@ +/** + * Platform class for charts that can access the DOM and global window/document properties + * @extends BasePlatform + */ +export default class DomPlatform extends BasePlatform { + /** + * @param {HTMLCanvasElement} canvas + * @param {number} [aspectRatio] + * @return {CanvasRenderingContext2D|null} + */ + acquireContext(canvas: HTMLCanvasElement, aspectRatio?: number): CanvasRenderingContext2D | null; + /** + * @param {Chart} chart + * @param {string} type + */ + removeEventListener(chart: Chart, type: string): void; +} +export type Chart = import('../core/core.controller.js').default; +import BasePlatform from "./platform.base.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/index.d.ts b/seller_1/node_modules/chart.js/dist/plugins/index.d.ts new file mode 100644 index 0000000..39043cf --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/index.d.ts @@ -0,0 +1,7 @@ +export { default as Colors } from "./plugin.colors.js"; +export { default as Decimation } from "./plugin.decimation.js"; +export { default as Filler } from "./plugin.filler/index.js"; +export { default as Legend } from "./plugin.legend.js"; +export { default as SubTitle } from "./plugin.subtitle.js"; +export { default as Title } from "./plugin.title.js"; +export { default as Tooltip } from "./plugin.tooltip.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.colors.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.colors.d.ts new file mode 100644 index 0000000..d445b8a --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.colors.d.ts @@ -0,0 +1,11 @@ +import type { Chart } from '../types.js'; +export interface ColorsPluginOptions { + enabled?: boolean; + forceOverride?: boolean; +} +declare const _default: { + id: string; + defaults: ColorsPluginOptions; + beforeLayout(chart: Chart, _args: any, options: ColorsPluginOptions): void; +}; +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.decimation.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.decimation.d.ts new file mode 100644 index 0000000..8d94db9 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.decimation.d.ts @@ -0,0 +1,10 @@ +declare namespace _default { + const id: string; + namespace defaults { + const algorithm: string; + const enabled: boolean; + } + function beforeElementsUpdate(chart: any, args: any, options: any): void; + function destroy(chart: any): void; +} +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.drawing.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.drawing.d.ts new file mode 100644 index 0000000..a89b48e --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.drawing.d.ts @@ -0,0 +1 @@ +export function _drawfill(ctx: any, source: any, area: any): void; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.helper.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.helper.d.ts new file mode 100644 index 0000000..fbccfa7 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.helper.d.ts @@ -0,0 +1,14 @@ +/** + * @param {PointElement[] | { x: number; y: number; }} boundary + * @param {LineElement} line + * @return {LineElement?} + */ +export function _createBoundaryLine(boundary: PointElement[] | { + x: number; + y: number; +}, line: LineElement): LineElement | null; +export function _shouldApplyFill(source: any): boolean; +export type Chart = import('../../core/core.controller.js').default; +export type Scale = import('../../core/core.scale.js').default; +export type PointElement = import('../../elements/element.point.js').default; +import { LineElement } from "../../elements/index.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.options.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.options.d.ts new file mode 100644 index 0000000..f3d218b --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.options.d.ts @@ -0,0 +1,30 @@ +/** + * @typedef { import('../../core/core.scale.js').default } Scale + * @typedef { import('../../elements/element.line.js').default } LineElement + * @typedef { import('../../types/index.js').FillTarget } FillTarget + * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget + */ +export function _resolveTarget(sources: any, index: any, propagate: any): any; +/** + * @param {LineElement} line + * @param {number} index + * @param {number} count + */ +export function _decodeFill(line: LineElement, index: number, count: number): any; +/** + * @param {FillTarget | ComplexFillTarget} fill + * @param {Scale} scale + * @returns {number | null} + */ +export function _getTargetPixel(fill: FillTarget | ComplexFillTarget, scale: Scale): number | null; +/** + * @param {FillTarget | ComplexFillTarget} fill + * @param {Scale} scale + * @param {number} startValue + * @returns {number | undefined} + */ +export function _getTargetValue(fill: FillTarget | ComplexFillTarget, scale: Scale, startValue: number): number | undefined; +export type Scale = import('../../core/core.scale.js').default; +export type LineElement = import('../../elements/element.line.js').default; +export type FillTarget = import('../../types/index.js').FillTarget; +export type ComplexFillTarget = import('../../types/index.js').ComplexFillTarget; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.segment.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.segment.d.ts new file mode 100644 index 0000000..41552ec --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.segment.d.ts @@ -0,0 +1,36 @@ +export function _segments(line: any, target: any, property: any): ({ + source: any; + target: { + property: any; + start: any; + end: any; + }; + start: any; + end: any; +} | { + source: { + start: number; + end: number; + loop: boolean; + style?: any; + }; + target: { + start: number; + end: number; + loop: boolean; + style?: any; + }; + start: { + [x: number]: any; + }; + end: { + [x: number]: any; + }; +})[]; +export function _getBounds(property: any, first: any, last: any, loop: any): { + property: any; + start: any; + end: any; +}; +export function _pointsFromSegments(boundary: any, line: any): any[]; +export function _findSegmentEnd(start: any, end: any, points: any): any; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.d.ts new file mode 100644 index 0000000..90656c9 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.d.ts @@ -0,0 +1,9 @@ +/** + * @typedef { import('../../core/core.controller.js').default } Chart + * @typedef { import('../../core/core.scale.js').default } Scale + * @typedef { import('../../elements/element.point.js').default } PointElement + */ +export function _getTarget(source: any): any; +export type Chart = import('../../core/core.controller.js').default; +export type Scale = import('../../core/core.scale.js').default; +export type PointElement = import('../../elements/element.point.js').default; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.stack.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.stack.d.ts new file mode 100644 index 0000000..be2625f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/filler.target.stack.d.ts @@ -0,0 +1,14 @@ +/** + * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source + * @return {LineElement} + */ +export function _buildStackLine(source: { + chart: Chart; + scale: Scale; + index: number; + line: LineElement; +}): LineElement; +export type Chart = import('../../core/core.controller.js').default; +export type Scale = import('../../core/core.scale.js').default; +export type PointElement = import('../../elements/element.point.js').default; +import { LineElement } from "../../elements/index.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/index.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/index.d.ts new file mode 100644 index 0000000..3c8e36a --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/index.d.ts @@ -0,0 +1,12 @@ +declare namespace _default { + const id: string; + function afterDatasetsUpdate(chart: any, _args: any, options: any): void; + function beforeDraw(chart: any, _args: any, options: any): void; + function beforeDatasetsDraw(chart: any, _args: any, options: any): void; + function beforeDatasetDraw(chart: any, args: any, options: any): void; + namespace defaults { + const propagate: boolean; + const drawTime: string; + } +} +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/simpleArc.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/simpleArc.d.ts new file mode 100644 index 0000000..91f9d7d --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.filler/simpleArc.d.ts @@ -0,0 +1,12 @@ +export class simpleArc { + constructor(opts: any); + x: any; + y: any; + radius: any; + pathSegment(ctx: any, bounds: any, opts: any): boolean; + interpolate(point: any): { + x: any; + y: any; + angle: any; + }; +} diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.legend.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.legend.d.ts new file mode 100644 index 0000000..a9827ce --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.legend.d.ts @@ -0,0 +1,114 @@ +export class Legend extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + /** + * @param {{ ctx: any; options: any; chart: any; }} config + */ + constructor(config: { + ctx: any; + options: any; + chart: any; + }); + _added: boolean; + legendHitBoxes: any[]; + /** + * @private + */ + private _hoveredItem; + doughnutMode: boolean; + chart: any; + options: any; + ctx: any; + legendItems: any; + columnSizes: any[]; + lineWidths: number[]; + maxHeight: any; + maxWidth: any; + top: any; + bottom: any; + left: any; + right: any; + height: any; + width: any; + _margins: any; + position: any; + weight: any; + fullSize: any; + update(maxWidth: any, maxHeight: any, margins: any): void; + setDimensions(): void; + buildLabels(): void; + fit(): void; + /** + * @private + */ + private _fitRows; + _fitCols(titleHeight: any, labelFont: any, boxWidth: any, _itemHeight: any): any; + adjustHitBoxes(): void; + isHorizontal(): boolean; + draw(): void; + /** + * @private + */ + private _draw; + /** + * @protected + */ + protected drawTitle(): void; + /** + * @private + */ + private _computeTitleHeight; + /** + * @private + */ + private _getLegendItemAt; + /** + * Handle an event + * @param {ChartEvent} e - The event to handle + */ + handleEvent(e: ChartEvent): void; +} +declare namespace _default { + export const id: string; + export { Legend as _element }; + export function start(chart: any, _args: any, options: any): void; + export function stop(chart: any): void; + export function beforeUpdate(chart: any, _args: any, options: any): void; + export function afterUpdate(chart: any): void; + export function afterEvent(chart: any, args: any): void; + export namespace defaults { + const display: boolean; + const position: string; + const align: string; + const fullSize: boolean; + const reverse: boolean; + const weight: number; + function onClick(e: any, legendItem: any, legend: any): void; + const onHover: any; + const onLeave: any; + namespace labels { + function color(ctx: any): any; + const boxWidth: number; + const padding: number; + function generateLabels(chart: any): any; + } + namespace title { + export function color_1(ctx: any): any; + export { color_1 as color }; + const display_1: boolean; + export { display_1 as display }; + const position_1: string; + export { position_1 as position }; + export const text: string; + } + } + export namespace descriptors { + export function _scriptable(name: any): boolean; + export namespace labels_1 { + export function _scriptable_1(name: any): boolean; + export { _scriptable_1 as _scriptable }; + } + export { labels_1 as labels }; + } +} +export default _default; +export type ChartEvent = import('../types/index.js').ChartEvent; +import Element from "../core/core.element.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.subtitle.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.subtitle.d.ts new file mode 100644 index 0000000..1a94905 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.subtitle.d.ts @@ -0,0 +1,27 @@ +declare namespace _default { + const id: string; + function start(chart: any, _args: any, options: any): void; + function stop(chart: any): void; + function beforeUpdate(chart: any, _args: any, options: any): void; + namespace defaults { + export const align: string; + export const display: boolean; + export namespace font { + const weight: string; + } + export const fullSize: boolean; + export const padding: number; + export const position: string; + export const text: string; + const weight_1: number; + export { weight_1 as weight }; + } + namespace defaultRoutes { + const color: string; + } + namespace descriptors { + const _scriptable: boolean; + const _indexable: boolean; + } +} +export default _default; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.title.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.title.d.ts new file mode 100644 index 0000000..c2e73bc --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.title.d.ts @@ -0,0 +1,61 @@ +export class Title extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + /** + * @param {{ ctx: any; options: any; chart: any; }} config + */ + constructor(config: { + ctx: any; + options: any; + chart: any; + }); + chart: any; + options: any; + ctx: any; + _padding: import("../types.js").ChartArea; + top: number; + bottom: any; + left: number; + right: any; + width: any; + height: any; + position: any; + weight: any; + fullSize: any; + update(maxWidth: any, maxHeight: any): void; + isHorizontal(): boolean; + _drawArgs(offset: any): { + titleX: any; + titleY: any; + maxWidth: number; + rotation: number; + }; + draw(): void; +} +declare namespace _default { + export const id: string; + export { Title as _element }; + export function start(chart: any, _args: any, options: any): void; + export function stop(chart: any): void; + export function beforeUpdate(chart: any, _args: any, options: any): void; + export namespace defaults { + export const align: string; + export const display: boolean; + export namespace font { + const weight: string; + } + export const fullSize: boolean; + export const padding: number; + export const position: string; + export const text: string; + const weight_1: number; + export { weight_1 as weight }; + } + export namespace defaultRoutes { + const color: string; + } + export namespace descriptors { + const _scriptable: boolean; + const _indexable: boolean; + } +} +export default _default; +import Element from "../core/core.element.js"; diff --git a/seller_1/node_modules/chart.js/dist/plugins/plugin.tooltip.d.ts b/seller_1/node_modules/chart.js/dist/plugins/plugin.tooltip.d.ts new file mode 100644 index 0000000..7731503 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/plugins/plugin.tooltip.d.ts @@ -0,0 +1,288 @@ +export class Tooltip extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { + /** + * @namespace Chart.Tooltip.positioners + */ + static positioners: { + /** + * Average mode places the tooltip at the average position of the elements shown + */ + average(items: any): false | { + x: number; + y: number; + }; + /** + * Gets the tooltip position nearest of the item nearest to the event position + */ + nearest(items: any, eventPosition: any): false | { + x: any; + y: any; + }; + }; + constructor(config: any); + opacity: number; + _active: any[]; + _eventPosition: any; + _size: { + width: number; + height: number; + }; + _cachedAnimations: Readonly<Animations>; + _tooltipItems: any[]; + $animations: any; + $context: any; + chart: any; + options: any; + dataPoints: { + chart: import("../core/core.controller.js").default; + label: any; + parsed: any; + raw: any; + formattedValue: any; + dataset: any; + dataIndex: number; + datasetIndex: number; + element: Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject>; + }[]; + title: any; + beforeBody: any; + body: any[]; + afterBody: any; + footer: any; + xAlign: any; + yAlign: any; + x: any; + y: any; + height: number; + width: number; + caretX: any; + caretY: any; + labelColors: any[]; + labelPointStyles: any[]; + labelTextColors: any[]; + initialize(options: any): void; + /** + * @private + */ + private _resolveAnimations; + /** + * @protected + */ + protected getContext(): any; + getTitle(context: any, options: any): any; + getBeforeBody(tooltipItems: any, options: any): any; + getBody(tooltipItems: any, options: any): any[]; + getAfterBody(tooltipItems: any, options: any): any; + getFooter(tooltipItems: any, options: any): any; + /** + * @private + */ + private _createItems; + update(changed: any, replay: any): void; + drawCaret(tooltipPoint: any, ctx: any, size: any, options: any): void; + getCaretPosition(tooltipPoint: any, size: any, options: any): { + x1: any; + x2: any; + x3: any; + y1: any; + y2: any; + y3: any; + }; + drawTitle(pt: any, ctx: any, options: any): void; + /** + * @private + */ + private _drawColorBox; + drawBody(pt: any, ctx: any, options: any): void; + drawFooter(pt: any, ctx: any, options: any): void; + drawBackground(pt: any, ctx: any, tooltipSize: any, options: any): void; + /** + * Update x/y animation targets when _active elements are animating too + * @private + */ + private _updateAnimationTarget; + /** + * Determine if the tooltip will draw anything + * @returns {boolean} True if the tooltip will render + */ + _willRender(): boolean; + draw(ctx: any): void; + /** + * Get active elements in the tooltip + * @returns {Array} Array of elements that are active in the tooltip + */ + getActiveElements(): any[]; + /** + * Set active elements in the tooltip + * @param {array} activeElements Array of active datasetIndex/index pairs. + * @param {object} eventPosition Synthetic event position used in positioning + */ + setActiveElements(activeElements: any[], eventPosition: object): void; + _ignoreReplayEvents: boolean; + /** + * Handle an event + * @param {ChartEvent} e - The event to handle + * @param {boolean} [replay] - This is a replayed event (from update) + * @param {boolean} [inChartArea] - The event is inside chartArea + * @returns {boolean} true if the tooltip changed + */ + handleEvent(e: ChartEvent, replay?: boolean, inChartArea?: boolean): boolean; + /** + * Helper for determining the active elements for event + * @param {ChartEvent} e - The event to handle + * @param {InteractionItem[]} lastActive - Previously active elements + * @param {boolean} [replay] - This is a replayed event (from update) + * @param {boolean} [inChartArea] - The event is inside chartArea + * @returns {InteractionItem[]} - Active elements + * @private + */ + private _getActiveElements; + /** + * Determine if the active elements + event combination changes the + * tooltip position + * @param {array} active - Active elements + * @param {ChartEvent} e - Event that triggered the position change + * @returns {boolean} True if the position has changed + */ + _positionChanged(active: any[], e: ChartEvent): boolean; +} +declare namespace _default { + export const id: string; + export { Tooltip as _element }; + export { positioners }; + export function afterInit(chart: any, _args: any, options: any): void; + export function beforeUpdate(chart: any, _args: any, options: any): void; + export function reset(chart: any, _args: any, options: any): void; + export function afterDraw(chart: any): void; + export function afterEvent(chart: any, args: any): void; + export namespace defaults { + export const enabled: boolean; + export const external: any; + export const position: string; + export const backgroundColor: string; + export const titleColor: string; + export namespace titleFont { + const weight: string; + } + export const titleSpacing: number; + export const titleMarginBottom: number; + export const titleAlign: string; + export const bodyColor: string; + export const bodySpacing: number; + export const bodyFont: {}; + export const bodyAlign: string; + export const footerColor: string; + export const footerSpacing: number; + export const footerMarginTop: number; + export namespace footerFont { + const weight_1: string; + export { weight_1 as weight }; + } + export const footerAlign: string; + export const padding: number; + export const caretPadding: number; + export const caretSize: number; + export const cornerRadius: number; + export function boxHeight(ctx: any, opts: any): any; + export function boxWidth(ctx: any, opts: any): any; + export const multiKeyBackground: string; + export const displayColors: boolean; + export const boxPadding: number; + export const borderColor: string; + export const borderWidth: number; + export namespace animation { + const duration: number; + const easing: string; + } + export namespace animations { + namespace numbers { + const type: string; + const properties: string[]; + } + namespace opacity { + const easing_1: string; + export { easing_1 as easing }; + const duration_1: number; + export { duration_1 as duration }; + } + } + export { defaultCallbacks as callbacks }; + } + export namespace defaultRoutes { + const bodyFont_1: string; + export { bodyFont_1 as bodyFont }; + const footerFont_1: string; + export { footerFont_1 as footerFont }; + const titleFont_1: string; + export { titleFont_1 as titleFont }; + } + export namespace descriptors { + export function _scriptable(name: any): boolean; + export const _indexable: boolean; + export namespace callbacks { + const _scriptable_1: boolean; + export { _scriptable_1 as _scriptable }; + const _indexable_1: boolean; + export { _indexable_1 as _indexable }; + } + export namespace animation_1 { + const _fallback: boolean; + } + export { animation_1 as animation }; + export namespace animations_1 { + const _fallback_1: string; + export { _fallback_1 as _fallback }; + } + export { animations_1 as animations }; + } + export const additionalOptionScopes: string[]; +} +export default _default; +export type Chart = import('../platform/platform.base.js').Chart; +export type ChartEvent = import('../types/index.js').ChartEvent; +export type ActiveElement = import('../types/index.js').ActiveElement; +export type InteractionItem = import('../core/core.interaction.js').InteractionItem; +import Element from "../core/core.element.js"; +import Animations from "../core/core.animations.js"; +declare namespace positioners { + /** + * Average mode places the tooltip at the average position of the elements shown + */ + function average(items: any): false | { + x: number; + y: number; + }; + /** + * Gets the tooltip position nearest of the item nearest to the event position + */ + function nearest(items: any, eventPosition: any): false | { + x: any; + y: any; + }; +} +declare namespace defaultCallbacks { + export { noop as beforeTitle }; + export function title(tooltipItems: any): any; + export { noop as afterTitle }; + export { noop as beforeBody }; + export { noop as beforeLabel }; + export function label(tooltipItem: any): any; + export function labelColor(tooltipItem: any): { + borderColor: any; + backgroundColor: any; + borderWidth: any; + borderDash: any; + borderDashOffset: any; + borderRadius: number; + }; + export function labelTextColor(): any; + export function labelPointStyle(tooltipItem: any): { + pointStyle: any; + rotation: any; + }; + export { noop as afterLabel }; + export { noop as afterBody }; + export { noop as beforeFooter }; + export { noop as footer }; + export { noop as afterFooter }; +} +import { noop } from "../helpers/helpers.core.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/index.d.ts b/seller_1/node_modules/chart.js/dist/scales/index.d.ts new file mode 100644 index 0000000..a6b28f9 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/index.d.ts @@ -0,0 +1,6 @@ +export { default as CategoryScale } from "./scale.category.js"; +export { default as LinearScale } from "./scale.linear.js"; +export { default as LogarithmicScale } from "./scale.logarithmic.js"; +export { default as RadialLinearScale } from "./scale.radialLinear.js"; +export { default as TimeScale } from "./scale.time.js"; +export { default as TimeSeriesScale } from "./scale.timeseries.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.category.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.category.d.ts new file mode 100644 index 0000000..85af4c5 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.category.d.ts @@ -0,0 +1,21 @@ +export default class CategoryScale extends Scale { + static id: string; + /** + * @type {any} + */ + static defaults: any; + /** @type {number} */ + _startValue: number; + _valueRange: number; + _addedLabels: any[]; + init(scaleOptions: any): void; + parse(raw: any, index: any): number; + buildTicks(): { + value: any; + }[]; + getLabelForValue(value: any): any; + getPixelForValue(value: any): number; + getPixelForTick(index: any): number; + getValueForPixel(pixel: any): number; +} +import Scale from "../core/core.scale.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.linear.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.linear.d.ts new file mode 100644 index 0000000..3a71744 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.linear.d.ts @@ -0,0 +1,10 @@ +export default class LinearScale extends LinearScaleBase { + static id: string; + /** + * @type {any} + */ + static defaults: any; + getPixelForValue(value: any): number; + getValueForPixel(pixel: any): number; +} +import LinearScaleBase from "./scale.linearbase.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.linearbase.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.linearbase.d.ts new file mode 100644 index 0000000..39f264b --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.linearbase.d.ts @@ -0,0 +1,20 @@ +export default class LinearScaleBase extends Scale { + /** @type {number} */ + start: number; + /** @type {number} */ + end: number; + /** @type {number} */ + _startValue: number; + /** @type {number} */ + _endValue: number; + _valueRange: number; + parse(raw: any, index: any): number; + handleTickRangeOptions(): void; + getTickLimit(): number; + /** + * @protected + */ + protected computeTickLimit(): number; + getLabelForValue(value: any): string; +} +import Scale from "../core/core.scale.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.logarithmic.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.logarithmic.d.ts new file mode 100644 index 0000000..32ce9c6 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.logarithmic.d.ts @@ -0,0 +1,25 @@ +export default class LogarithmicScale extends Scale { + static id: string; + /** + * @type {any} + */ + static defaults: any; + /** @type {number} */ + start: number; + /** @type {number} */ + end: number; + /** @type {number} */ + _startValue: number; + _valueRange: number; + parse(raw: any, index: any): number; + _zero: boolean; + handleTickRangeOptions(): void; + /** + * @param {number} value + * @return {string} + */ + getLabelForValue(value: number): string; + getPixelForValue(value: any): number; + getValueForPixel(pixel: any): number; +} +import Scale from "../core/core.scale.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.radialLinear.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.radialLinear.d.ts new file mode 100644 index 0000000..a34fa8f --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.radialLinear.d.ts @@ -0,0 +1,63 @@ +export default class RadialLinearScale extends LinearScaleBase { + static id: string; + /** + * @type {any} + */ + static defaults: any; + static defaultRoutes: { + 'angleLines.color': string; + 'pointLabels.color': string; + 'ticks.color': string; + }; + static descriptors: { + angleLines: { + _fallback: string; + }; + }; + /** @type {number} */ + xCenter: number; + /** @type {number} */ + yCenter: number; + /** @type {number} */ + drawingArea: number; + /** @type {string[]} */ + _pointLabels: string[]; + _pointLabelItems: any[]; + _padding: import("../types.js").ChartArea; + generateTickLabels(ticks: any): void; + setCenterPoint(leftMovement: any, rightMovement: any, topMovement: any, bottomMovement: any): void; + getIndexAngle(index: any): number; + getDistanceFromCenterForValue(value: any): number; + getValueForDistanceFromCenter(distance: any): any; + getPointLabelContext(index: any): any; + getPointPosition(index: any, distanceFromCenter: any, additionalAngle?: number): { + x: number; + y: number; + angle: number; + }; + getPointPositionForValue(index: any, value: any): { + x: number; + y: number; + angle: number; + }; + getBasePosition(index: any): { + x: number; + y: number; + angle: number; + }; + getPointLabelPosition(index: any): { + left: any; + top: any; + right: any; + bottom: any; + }; + /** + * @protected + */ + protected drawGrid(): void; + /** + * @protected + */ + protected drawLabels(): void; +} +import LinearScaleBase from "./scale.linearbase.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.time.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.time.d.ts new file mode 100644 index 0000000..6bdaeeb --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.time.d.ts @@ -0,0 +1,130 @@ +export default class TimeScale extends Scale { + static id: string; + /** + * @type {any} + */ + static defaults: any; + /** + * @param {object} props + */ + constructor(props: object); + /** @type {{data: number[], labels: number[], all: number[]}} */ + _cache: { + data: number[]; + labels: number[]; + all: number[]; + }; + /** @type {Unit} */ + _unit: Unit; + /** @type {Unit=} */ + _majorUnit: Unit | undefined; + _offsets: {}; + _normalized: boolean; + _parseOpts: { + parser: any; + round: any; + isoWeekday: any; + }; + init(scaleOpts: any, opts?: {}): void; + _adapter: DateAdapter; + /** + * @param {*} raw + * @param {number?} [index] + * @return {number} + */ + parse(raw: any, index?: number | null): number; + /** + * @private + */ + private _getLabelBounds; + /** + * Returns the start and end offsets from edges in the form of {start, end} + * where each value is a relative width to the scale and ranges between 0 and 1. + * They add extra margins on the both sides by scaling down the original scale. + * Offsets are added when the `offset` option is true. + * @param {number[]} timestamps + * @protected + */ + protected initOffsets(timestamps?: number[]): void; + /** + * Generates a maximum of `capacity` timestamps between min and max, rounded to the + * `minor` unit using the given scale time `options`. + * Important: this method can return ticks outside the min and max range, it's the + * responsibility of the calling code to clamp values if needed. + * @protected + */ + protected _generate(): number[]; + /** + * @param {number} value + * @return {string} + */ + getLabelForValue(value: number): string; + /** + * @param {number} value + * @param {string|undefined} format + * @return {string} + */ + format(value: number, format: string | undefined): string; + /** + * Function to format an individual tick mark + * @param {number} time + * @param {number} index + * @param {object[]} ticks + * @param {string|undefined} [format] + * @return {string} + * @private + */ + private _tickFormatFunction; + /** + * @param {object[]} ticks + */ + generateTickLabels(ticks: object[]): void; + /** + * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC) + * @return {number} + */ + getDecimalForValue(value: number): number; + /** + * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC) + * @return {number} + */ + getPixelForValue(value: number): number; + /** + * @param {number} pixel + * @return {number} + */ + getValueForPixel(pixel: number): number; + /** + * @param {string} label + * @return {{w:number, h:number}} + * @private + */ + private _getLabelSize; + /** + * @param {number} exampleTime + * @return {number} + * @private + */ + private _getLabelCapacity; + /** + * @protected + */ + protected getDataTimestamps(): any; + /** + * @protected + */ + protected getLabelTimestamps(): number[]; + /** + * @param {number[]} values + * @protected + */ + protected normalize(values: number[]): number[]; +} +export type Unit = import('../core/core.adapters.js').TimeUnit; +export type Interval = { + common: boolean; + size: number; + steps?: number; +}; +export type DateAdapter = import('../core/core.adapters.js').DateAdapter; +import Scale from "../core/core.scale.js"; diff --git a/seller_1/node_modules/chart.js/dist/scales/scale.timeseries.d.ts b/seller_1/node_modules/chart.js/dist/scales/scale.timeseries.d.ts new file mode 100644 index 0000000..0afa061 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/scales/scale.timeseries.d.ts @@ -0,0 +1,39 @@ +export default TimeSeriesScale; +declare class TimeSeriesScale extends TimeScale { + /** @type {object[]} */ + _table: object[]; + /** @type {number} */ + _minPos: number; + /** @type {number} */ + _tableRange: number; + /** + * @protected + */ + protected initOffsets(): void; + /** + * Returns an array of {time, pos} objects used to interpolate a specific `time` or position + * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is + * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other + * extremity (left + width or top + height). Note that it would be more optimized to directly + * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need + * to create the lookup table. The table ALWAYS contains at least two items: min and max. + * @param {number[]} timestamps + * @return {object[]} + * @protected + */ + protected buildLookupTable(timestamps: number[]): object[]; + /** + * Generates all timestamps defined in the data. + * Important: this method can return ticks outside the min and max range, it's the + * responsibility of the calling code to clamp values if needed. + * @protected + */ + protected _generate(): any; + /** + * Returns all timestamps + * @return {number[]} + * @private + */ + private _getTimestampsForTable; +} +import TimeScale from "./scale.time.js"; diff --git a/seller_1/node_modules/chart.js/dist/types.d.ts b/seller_1/node_modules/chart.js/dist/types.d.ts new file mode 100644 index 0000000..f3d8392 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types.d.ts @@ -0,0 +1,10 @@ +/** + * Temporary entry point of the types at the time of the transition. + * After transition done need to remove it in favor of index.ts + */ +export * from './index.js'; +/** + * Explicitly re-exporting to resolve the ambiguity. + */ +export { BarController, BubbleController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, ScatterController, Animation, Animations, Chart, DatasetController, Interaction, Scale, Ticks, defaults, layouts, registry, ArcElement, BarElement, LineElement, PointElement, BasePlatform, BasicPlatform, DomPlatform, Decimation, Filler, Legend, SubTitle, Title, Tooltip, CategoryScale, LinearScale, LogarithmicScale, RadialLinearScale, TimeScale, TimeSeriesScale, PluginOptionsByType, ElementOptionsByType, ChartDatasetProperties, UpdateModeEnum, registerables } from './types/index.js'; +export * from './types/index.js'; diff --git a/seller_1/node_modules/chart.js/dist/types/animation.d.ts b/seller_1/node_modules/chart.js/dist/types/animation.d.ts new file mode 100644 index 0000000..4189512 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/animation.d.ts @@ -0,0 +1,34 @@ +import {Chart} from './index.js'; +import {AnyObject} from './basic.js'; + +export declare class Animation { + constructor(cfg: AnyObject, target: AnyObject, prop: string, to?: unknown); + active(): boolean; + update(cfg: AnyObject, to: unknown, date: number): void; + cancel(): void; + tick(date: number): void; + readonly _to: unknown; +} + +export interface AnimationEvent { + chart: Chart; + numSteps: number; + initial: boolean; + currentStep: number; +} + +export declare class Animator { + listen(chart: Chart, event: 'complete' | 'progress', cb: (event: AnimationEvent) => void): void; + add(chart: Chart, items: readonly Animation[]): void; + has(chart: Chart): boolean; + start(chart: Chart): void; + running(chart: Chart): boolean; + stop(chart: Chart): void; + remove(chart: Chart): boolean; +} + +export declare class Animations { + constructor(chart: Chart, animations: AnyObject); + configure(animations: AnyObject): void; + update(target: AnyObject, values: AnyObject): undefined | boolean; +} diff --git a/seller_1/node_modules/chart.js/dist/types/basic.d.ts b/seller_1/node_modules/chart.js/dist/types/basic.d.ts new file mode 100644 index 0000000..2f48ee2 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/basic.d.ts @@ -0,0 +1,3 @@ + +export type AnyObject = Record<string, any>; +export type EmptyObject = Record<string, never>; diff --git a/seller_1/node_modules/chart.js/dist/types/color.d.ts b/seller_1/node_modules/chart.js/dist/types/color.d.ts new file mode 100644 index 0000000..4a68f98 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/color.d.ts @@ -0,0 +1 @@ +export type Color = string | CanvasGradient | CanvasPattern; diff --git a/seller_1/node_modules/chart.js/dist/types/geometric.d.ts b/seller_1/node_modules/chart.js/dist/types/geometric.d.ts new file mode 100644 index 0000000..9df01f1 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/geometric.d.ts @@ -0,0 +1,52 @@ +export interface ChartArea { + top: number; + left: number; + right: number; + bottom: number; + width: number; + height: number; +} + +export interface Point { + x: number; + y: number; +} + +export type TRBL = { + top: number; + right: number; + bottom: number; + left: number; +} + +export type TRBLCorners = { + topLeft: number; + topRight: number; + bottomLeft: number; + bottomRight: number; +}; + +export type CornerRadius = number | Partial<TRBLCorners>; + +export type RoundedRect = { + x: number; + y: number; + w: number; + h: number; + radius?: CornerRadius +} + +export type Padding = Partial<TRBL> | number | Point; + +export interface SplinePoint { + x: number; + y: number; + skip?: boolean; + + // Both Bezier and monotone interpolations have these fields + // but they are added in different spots + cp1x?: number; + cp1y?: number; + cp2x?: number; + cp2y?: number; +} diff --git a/seller_1/node_modules/chart.js/dist/types/index.d.ts b/seller_1/node_modules/chart.js/dist/types/index.d.ts new file mode 100644 index 0000000..c59a39c --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/index.d.ts @@ -0,0 +1,3842 @@ +/* eslint-disable @typescript-eslint/ban-types */ +import {DeepPartial, DistributiveArray, UnionToIntersection} from './utils.js'; + +import {TimeUnit} from '../core/core.adapters.js'; +import PointElement from '../elements/element.point.js'; +import {EasingFunction} from '../helpers/helpers.easing.js'; +import {AnimationEvent} from './animation.js'; +import {AnyObject, EmptyObject} from './basic.js'; +import {Color} from './color.js'; +import Element from '../core/core.element.js'; +import {ChartArea, Padding, Point} from './geometric.js'; +import {LayoutItem, LayoutPosition} from './layout.js'; +import {ColorsPluginOptions} from '../plugins/plugin.colors.js'; + +export {EasingFunction} from '../helpers/helpers.easing.js'; +export {default as ArcElement, ArcProps} from '../elements/element.arc.js'; +export {default as PointElement, PointProps} from '../elements/element.point.js'; +export {Animation, Animations, Animator, AnimationEvent} from './animation.js'; +export {Color} from './color.js'; +export {ChartArea, Point, TRBL} from './geometric.js'; +export {LayoutItem, LayoutPosition} from './layout.js'; + +export interface ScriptableContext<TType extends ChartType> { + active: boolean; + chart: Chart; + dataIndex: number; + dataset: UnionToIntersection<ChartDataset<TType>>; + datasetIndex: number; + type: string; + mode: string; + parsed: UnionToIntersection<ParsedDataType<TType>>; + raw: unknown; +} + +export interface ScriptableLineSegmentContext { + type: 'segment', + p0: PointElement, + p1: PointElement, + p0DataIndex: number, + p1DataIndex: number, + datasetIndex: number +} + +export type Scriptable<T, TContext> = T | ((ctx: TContext, options: AnyObject) => T | undefined); +export type ScriptableOptions<T, TContext> = { [P in keyof T]: Scriptable<T[P], TContext> }; +export type ScriptableAndScriptableOptions<T, TContext> = Scriptable<T, TContext> | ScriptableOptions<T, TContext>; +export type ScriptableAndArray<T, TContext> = readonly T[] | Scriptable<T, TContext>; +export type ScriptableAndArrayOptions<T, TContext> = { [P in keyof T]: ScriptableAndArray<T[P], TContext> }; + +export interface ParsingOptions { + /** + * How to parse the dataset. The parsing can be disabled by specifying parsing: false at chart options or dataset. If parsing is disabled, data must be sorted and in the formats the associated chart type and scales use internally. + */ + parsing: + { + [key: string]: string; + } + | false; + + /** + * Chart.js is fastest if you provide data with indices that are unique, sorted, and consistent across datasets and provide the normalized: true option to let Chart.js know that you have done so. + */ + normalized: boolean; +} + +export interface ControllerDatasetOptions extends ParsingOptions { + /** + * The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. + * @default 'x' + */ + indexAxis: 'x' | 'y'; + /** + * How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}` + */ + clip: number | ChartArea | false; + /** + * The label for the dataset which appears in the legend and tooltips. + */ + label: string; + /** + * The drawing order of dataset. Also affects order for stacking, tooltip and legend. + */ + order: number; + + /** + * The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack). + */ + stack: string; + /** + * Configures the visibility state of the dataset. Set it to true, to hide the dataset from the chart. + * @default false + */ + hidden: boolean; +} + +export interface BarControllerDatasetOptions + extends ControllerDatasetOptions, + ScriptableAndArrayOptions<BarOptions, ScriptableContext<'bar'>>, + ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'bar'>>, + AnimationOptions<'bar'> { + /** + * The ID of the x axis to plot this dataset on. + */ + xAxisID: string; + /** + * The ID of the y axis to plot this dataset on. + */ + yAxisID: string; + + /** + * Percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other. + * @default 0.9 + */ + barPercentage: number; + /** + * Percent (0-1) of the available width each category should be within the sample width. + * @default 0.8 + */ + categoryPercentage: number; + + /** + * Manually set width of each bar in pixels. If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side. If not set (default), bars are equally sized based on the smallest interval. + */ + barThickness: number | 'flex'; + + /** + * Set this to ensure that bars are not sized thicker than this. + */ + maxBarThickness: number; + + /** + * Set this to ensure that bars have a minimum length in pixels. + */ + minBarLength: number; + + /** + * Point style for the legend + * @default 'circle; + */ + pointStyle: PointStyle; + + /** + * Should the bars be grouped on index axis + * @default true + */ + grouped: boolean; +} + +export interface BarControllerChartOptions { + /** + * Should null or undefined values be omitted from drawing + */ + skipNull?: boolean; +} + +export type BarController = DatasetController +export declare const BarController: ChartComponent & { + prototype: BarController; + new (chart: Chart, datasetIndex: number): BarController; +}; + +export interface BubbleControllerDatasetOptions + extends ControllerDatasetOptions, + ScriptableAndArrayOptions<PointOptions, ScriptableContext<'bubble'>>, + ScriptableAndArrayOptions<PointHoverOptions, ScriptableContext<'bubble'>> { + /** + * The ID of the x axis to plot this dataset on. + */ + xAxisID: string; + /** + * The ID of the y axis to plot this dataset on. + */ + yAxisID: string; +} + +export interface BubbleDataPoint extends Point { + /** + * Bubble radius in pixels (not scaled). + */ + r?: number; +} + +export type BubbleController = DatasetController +export declare const BubbleController: ChartComponent & { + prototype: BubbleController; + new (chart: Chart, datasetIndex: number): BubbleController; +}; + +export interface LineControllerDatasetOptions + extends ControllerDatasetOptions, + ScriptableAndArrayOptions<PointPrefixedOptions, ScriptableContext<'line'>>, + ScriptableAndArrayOptions<PointPrefixedHoverOptions, ScriptableContext<'line'>>, + ScriptableOptions<Omit<LineOptions, keyof CommonElementOptions>, ScriptableContext<'line'>>, + ScriptableAndArrayOptions<CommonElementOptions, ScriptableContext<'line'>>, + ScriptableOptions<Omit<LineHoverOptions, keyof CommonHoverOptions>, ScriptableContext<'line'>>, + ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'line'>>, + AnimationOptions<'line'> { + /** + * The ID of the x axis to plot this dataset on. + */ + xAxisID: string; + /** + * The ID of the y axis to plot this dataset on. + */ + yAxisID: string; + + /** + * If true, lines will be drawn between points with no or null data. If false, points with NaN data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used. + * @default false + */ + spanGaps: boolean | number; + + showLine: boolean; +} + +export interface LineControllerChartOptions { + /** + * If true, lines will be drawn between points with no or null data. If false, points with NaN data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used. + * @default false + */ + spanGaps: boolean | number; + /** + * If false, the lines between points are not drawn. + * @default true + */ + showLine: boolean; +} + +export type LineController = DatasetController +export declare const LineController: ChartComponent & { + prototype: LineController; + new (chart: Chart, datasetIndex: number): LineController; +}; + +export type ScatterControllerDatasetOptions = LineControllerDatasetOptions; + +export type ScatterDataPoint = Point + +export type ScatterControllerChartOptions = LineControllerChartOptions; + +export type ScatterController = LineController +export declare const ScatterController: ChartComponent & { + prototype: ScatterController; + new (chart: Chart, datasetIndex: number): ScatterController; +}; + +export interface DoughnutControllerDatasetOptions + extends ControllerDatasetOptions, + ScriptableAndArrayOptions<ArcOptions, ScriptableContext<'doughnut'>>, + ScriptableAndArrayOptions<ArcHoverOptions, ScriptableContext<'doughnut'>>, + AnimationOptions<'doughnut'> { + + /** + * Sweep to allow arcs to cover. + * @default 360 + */ + circumference: number; + + /** + * Arc offset (in pixels). + */ + offset: number | number[]; + + /** + * Starting angle to draw this dataset from. + * @default 0 + */ + rotation: number; + + /** + * The relative thickness of the dataset. Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values. + * @default 1 + */ + weight: number; + + /** + * Similar to the `offset` option, but applies to all arcs. This can be used to to add spaces + * between arcs + * @default 0 + */ + spacing: number; +} + +export interface DoughnutAnimationOptions extends AnimationSpec<'doughnut'> { + /** + * If true, the chart will animate in with a rotation animation. This property is in the options.animation object. + * @default true + */ + animateRotate: boolean; + + /** + * If true, will animate scaling the chart from the center outwards. + * @default false + */ + animateScale: boolean; +} + +export interface DoughnutControllerChartOptions { + /** + * Sweep to allow arcs to cover. + * @default 360 + */ + circumference: number; + + /** + * The portion of the chart that is cut out of the middle. ('50%' - for doughnut, 0 - for pie) + * String ending with '%' means percentage, number means pixels. + * @default 50 + */ + cutout: Scriptable<number | string, ScriptableContext<'doughnut'>>; + + /** + * Arc offset (in pixels). + */ + offset: number | number[]; + + /** + * The outer radius of the chart. String ending with '%' means percentage of maximum radius, number means pixels. + * @default '100%' + */ + radius: Scriptable<number | string, ScriptableContext<'doughnut'>>; + + /** + * Starting angle to draw arcs from. + * @default 0 + */ + rotation: number; + + /** + * Spacing between the arcs + * @default 0 + */ + spacing: number; + + animation: false | DoughnutAnimationOptions; +} + +export type DoughnutDataPoint = number; + +export interface DoughnutController extends DatasetController { + readonly innerRadius: number; + readonly outerRadius: number; + readonly offsetX: number; + readonly offsetY: number; + + calculateTotal(): number; + calculateCircumference(value: number): number; +} + +export declare const DoughnutController: ChartComponent & { + prototype: DoughnutController; + new (chart: Chart, datasetIndex: number): DoughnutController; +}; + +export interface DoughnutMetaExtensions { + total: number; +} + +export type PieControllerDatasetOptions = DoughnutControllerDatasetOptions; +export type PieControllerChartOptions = DoughnutControllerChartOptions; +export type PieAnimationOptions = DoughnutAnimationOptions; + +export type PieDataPoint = DoughnutDataPoint; +export type PieMetaExtensions = DoughnutMetaExtensions; + +export type PieController = DoughnutController +export declare const PieController: ChartComponent & { + prototype: PieController; + new (chart: Chart, datasetIndex: number): PieController; +}; + +export interface PolarAreaControllerDatasetOptions extends DoughnutControllerDatasetOptions { + /** + * Arc angle to cover. - for polar only + * @default circumference / (arc count) + */ + angle: number; +} + +export type PolarAreaAnimationOptions = DoughnutAnimationOptions; + +export interface PolarAreaControllerChartOptions { + /** + * Starting angle to draw arcs for the first item in a dataset. In degrees, 0 is at top. + * @default 0 + */ + startAngle: number; + + animation: false | PolarAreaAnimationOptions; +} + +export interface PolarAreaController extends DoughnutController { + countVisibleElements(): number; +} +export declare const PolarAreaController: ChartComponent & { + prototype: PolarAreaController; + new (chart: Chart, datasetIndex: number): PolarAreaController; +}; + +export interface RadarControllerDatasetOptions + extends ControllerDatasetOptions, + ScriptableAndArrayOptions<PointOptions & PointHoverOptions & PointPrefixedOptions & PointPrefixedHoverOptions, ScriptableContext<'radar'>>, + ScriptableAndArrayOptions<LineOptions & LineHoverOptions, ScriptableContext<'radar'>>, + AnimationOptions<'radar'> { + /** + * The ID of the x axis to plot this dataset on. + */ + xAxisID: string; + /** + * The ID of the y axis to plot this dataset on. + */ + yAxisID: string; + + /** + * If true, lines will be drawn between points with no or null data. If false, points with NaN data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used. + */ + spanGaps: boolean | number; + + /** + * If false, the line is not drawn for this dataset. + */ + showLine: boolean; +} + +export type RadarControllerChartOptions = LineControllerChartOptions; + +export type RadarController = DatasetController +export declare const RadarController: ChartComponent & { + prototype: RadarController; + new (chart: Chart, datasetIndex: number): RadarController; +}; +interface ChartMetaCommon<TElement extends Element = Element, TDatasetElement extends Element = Element> { + type: string; + controller: DatasetController; + order: number; + + label: string; + index: number; + visible: boolean; + + stack: number; + + indexAxis: 'x' | 'y'; + + data: TElement[]; + dataset?: TDatasetElement; + + hidden: boolean; + + xAxisID?: string; + yAxisID?: string; + rAxisID?: string; + iAxisID: string; + vAxisID: string; + + xScale?: Scale; + yScale?: Scale; + rScale?: Scale; + iScale?: Scale; + vScale?: Scale; + + _sorted: boolean; + _stacked: boolean | 'single'; + _parsed: unknown[]; +} + +export type ChartMeta< + TType extends ChartType = ChartType, + TElement extends Element = Element, + TDatasetElement extends Element = Element, +> = DeepPartial< +{ [key in ChartType]: ChartTypeRegistry[key]['metaExtensions'] }[TType] +> & ChartMetaCommon<TElement, TDatasetElement>; + +export interface ActiveDataPoint { + datasetIndex: number; + index: number; +} + +export interface ActiveElement extends ActiveDataPoint { + element: Element; +} + +export declare class Chart< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType>, + TLabel = unknown +> { + readonly platform: BasePlatform; + readonly id: string; + readonly canvas: HTMLCanvasElement; + readonly ctx: CanvasRenderingContext2D; + readonly config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>; + readonly width: number; + readonly height: number; + readonly aspectRatio: number; + readonly boxes: LayoutItem[]; + readonly currentDevicePixelRatio: number; + readonly chartArea: ChartArea; + readonly scales: { [key: string]: Scale }; + readonly attached: boolean; + + readonly legend?: LegendElement<TType>; // Only available if legend plugin is registered and enabled + readonly tooltip?: TooltipModel<TType>; // Only available if tooltip plugin is registered and enabled + + data: ChartData<TType, TData, TLabel>; + options: ChartOptions<TType>; + + constructor(item: ChartItem, config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>); + + clear(): this; + stop(): this; + + resize(width?: number, height?: number): void; + ensureScalesHaveIDs(): void; + buildOrUpdateScales(): void; + buildOrUpdateControllers(): void; + reset(): void; + update(mode?: UpdateMode | ((ctx: { datasetIndex: number }) => UpdateMode)): void; + render(): void; + draw(): void; + + isPointInArea(point: Point): boolean; + getElementsAtEventForMode(e: Event, mode: string, options: InteractionOptions, useFinalPosition: boolean): InteractionItem[]; + + getSortedVisibleDatasetMetas(): ChartMeta[]; + getDatasetMeta(datasetIndex: number): ChartMeta; + getVisibleDatasetCount(): number; + isDatasetVisible(datasetIndex: number): boolean; + setDatasetVisibility(datasetIndex: number, visible: boolean): void; + toggleDataVisibility(index: number): void; + getDataVisibility(index: number): boolean; + hide(datasetIndex: number, dataIndex?: number): void; + show(datasetIndex: number, dataIndex?: number): void; + + getActiveElements(): ActiveElement[]; + setActiveElements(active: ActiveDataPoint[]): void; + + destroy(): void; + toBase64Image(type?: string, quality?: unknown): string; + bindEvents(): void; + unbindEvents(): void; + updateHoverStyle(items: InteractionItem[], mode: 'dataset', enabled: boolean): void; + + notifyPlugins(hook: string, args?: AnyObject): boolean | void; + + isPluginEnabled(pluginId: string): boolean; + + getContext(): { chart: Chart, type: string }; + + static readonly defaults: Defaults; + static readonly overrides: Overrides; + static readonly version: string; + static readonly instances: { [key: string]: Chart }; + static readonly registry: Registry; + static getChart(key: string | CanvasRenderingContext2D | HTMLCanvasElement): Chart | undefined; + static register(...items: ChartComponentLike[]): void; + static unregister(...items: ChartComponentLike[]): void; +} + +export declare const registerables: readonly ChartComponentLike[]; + +export declare type ChartItem = + | string + | CanvasRenderingContext2D + | HTMLCanvasElement + | { canvas: HTMLCanvasElement } + | ArrayLike<CanvasRenderingContext2D | HTMLCanvasElement>; + +export declare enum UpdateModeEnum { + resize = 'resize', + reset = 'reset', + none = 'none', + hide = 'hide', + show = 'show', + default = 'default', + active = 'active' +} + +export type UpdateMode = keyof typeof UpdateModeEnum; + +export declare class DatasetController< + TType extends ChartType = ChartType, + TElement extends Element = Element, + TDatasetElement extends Element = Element, + TParsedData = ParsedDataType<TType>, +> { + constructor(chart: Chart, datasetIndex: number); + + readonly chart: Chart; + readonly index: number; + readonly _cachedMeta: ChartMeta<TType, TElement, TDatasetElement>; + enableOptionSharing: boolean; + // If true, the controller supports the decimation + // plugin. Defaults to `false` for all controllers + // except the LineController + supportsDecimation: boolean; + + linkScales(): void; + getAllParsedValues(scale: Scale): number[]; + protected getLabelAndValue(index: number): { label: string; value: string }; + updateElements(elements: TElement[], start: number, count: number, mode: UpdateMode): void; + update(mode: UpdateMode): void; + updateIndex(datasetIndex: number): void; + protected getMaxOverflow(): boolean | number; + draw(): void; + reset(): void; + getDataset(): ChartDataset; + getMeta(): ChartMeta<TType, TElement, TDatasetElement>; + getScaleForId(scaleID: string): Scale | undefined; + configure(): void; + initialize(): void; + addElements(): void; + buildOrUpdateElements(resetNewElements?: boolean): void; + + getStyle(index: number, active: boolean): AnyObject; + protected resolveDatasetElementOptions(mode: UpdateMode): AnyObject; + protected resolveDataElementOptions(index: number, mode: UpdateMode): AnyObject; + /** + * Utility for checking if the options are shared and should be animated separately. + * @protected + */ + protected getSharedOptions(options: AnyObject): undefined | AnyObject; + /** + * Utility for determining if `options` should be included in the updated properties + * @protected + */ + protected includeOptions(mode: UpdateMode, sharedOptions: AnyObject): boolean; + /** + * Utility for updating an element with new properties, using animations when appropriate. + * @protected + */ + + protected updateElement(element: TElement | TDatasetElement, index: number | undefined, properties: AnyObject, mode: UpdateMode): void; + /** + * Utility to animate the shared options, that are potentially affecting multiple elements. + * @protected + */ + + protected updateSharedOptions(sharedOptions: AnyObject, mode: UpdateMode, newOptions: AnyObject): void; + removeHoverStyle(element: TElement, datasetIndex: number, index: number): void; + setHoverStyle(element: TElement, datasetIndex: number, index: number): void; + + parse(start: number, count: number): void; + protected parsePrimitiveData(meta: ChartMeta<TType, TElement, TDatasetElement>, data: AnyObject[], start: number, count: number): AnyObject[]; + protected parseArrayData(meta: ChartMeta<TType, TElement, TDatasetElement>, data: AnyObject[], start: number, count: number): AnyObject[]; + protected parseObjectData(meta: ChartMeta<TType, TElement, TDatasetElement>, data: AnyObject[], start: number, count: number): AnyObject[]; + protected getParsed(index: number): TParsedData; + protected applyStack(scale: Scale, parsed: unknown[]): number; + protected updateRangeFromParsed( + range: { min: number; max: number }, + scale: Scale, + parsed: unknown[], + stack: boolean | string + ): void; + protected getMinMax(scale: Scale, canStack?: boolean): { min: number; max: number }; +} + +export interface DatasetControllerChartComponent extends ChartComponent { + defaults: { + datasetElementType?: string | null | false; + dataElementType?: string | null | false; + }; +} + +export interface Defaults extends CoreChartOptions<ChartType>, ElementChartOptions<ChartType>, PluginChartOptions<ChartType> { + + scale: ScaleOptionsByType; + scales: { + [key in ScaleType]: ScaleOptionsByType<key>; + }; + + set(values: AnyObject): AnyObject; + set(scope: string, values: AnyObject): AnyObject; + get(scope: string): AnyObject; + + describe(scope: string, values: AnyObject): AnyObject; + override(scope: string, values: AnyObject): AnyObject; + + /** + * Routes the named defaults to fallback to another scope/name. + * This routing is useful when those target values, like defaults.color, are changed runtime. + * If the values would be copied, the runtime change would not take effect. By routing, the + * fallback is evaluated at each access, so its always up to date. + * + * Example: + * + * defaults.route('elements.arc', 'backgroundColor', '', 'color') + * - reads the backgroundColor from defaults.color when undefined locally + * + * @param scope Scope this route applies to. + * @param name Property name that should be routed to different namespace when not defined here. + * @param targetScope The namespace where those properties should be routed to. + * Empty string ('') is the root of defaults. + * @param targetName The target name in the target scope the property should be routed to. + */ + route(scope: string, name: string, targetScope: string, targetName: string): void; +} + +export type Overrides = { + [key in ChartType]: + CoreChartOptions<key> & + ElementChartOptions<key> & + PluginChartOptions<key> & + DatasetChartOptions<ChartType> & + ScaleChartOptions<key> & + ChartTypeRegistry[key]['chartOptions']; +} + +export declare const defaults: Defaults; +export interface InteractionOptions { + axis?: string; + intersect?: boolean; + includeInvisible?: boolean; +} + +export interface InteractionItem { + element: Element; + datasetIndex: number; + index: number; +} + +export type InteractionModeFunction = ( + chart: Chart, + e: ChartEvent, + options: InteractionOptions, + useFinalPosition?: boolean +) => InteractionItem[]; + +export interface InteractionModeMap { + /** + * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item + */ + index: InteractionModeFunction; + + /** + * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect is false, we find the nearest item and return the items in that dataset + */ + dataset: InteractionModeFunction; + /** + * Point mode returns all elements that hit test based on the event position + * of the event + */ + point: InteractionModeFunction; + /** + * nearest mode returns the element closest to the point + */ + nearest: InteractionModeFunction; + /** + * x mode returns the elements that hit-test at the current x coordinate + */ + x: InteractionModeFunction; + /** + * y mode returns the elements that hit-test at the current y coordinate + */ + y: InteractionModeFunction; +} + +export type InteractionMode = keyof InteractionModeMap; + +export declare const Interaction: { + modes: InteractionModeMap; + + /** + * Helper function to select candidate elements for interaction + */ + evaluateInteractionItems( + chart: Chart, + axis: InteractionAxis, + position: Point, + handler: (element: Element & VisualElement, datasetIndex: number, index: number) => void, + intersect?: boolean + ): InteractionItem[]; +}; + +export declare const layouts: { + /** + * Register a box to a chart. + * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title. + * @param {Chart} chart - the chart to use + * @param {LayoutItem} item - the item to add to be laid out + */ + addBox(chart: Chart, item: LayoutItem): void; + + /** + * Remove a layoutItem from a chart + * @param {Chart} chart - the chart to remove the box from + * @param {LayoutItem} layoutItem - the item to remove from the layout + */ + removeBox(chart: Chart, layoutItem: LayoutItem): void; + + /** + * Sets (or updates) options on the given `item`. + * @param {Chart} chart - the chart in which the item lives (or will be added to) + * @param {LayoutItem} item - the item to configure with the given options + * @param options - the new item options. + */ + configure( + chart: Chart, + item: LayoutItem, + options: { fullSize?: number; position?: LayoutPosition; weight?: number } + ): void; + + /** + * Fits boxes of the given chart into the given size by having each box measure itself + * then running a fitting algorithm + * @param {Chart} chart - the chart + * @param {number} width - the width to fit into + * @param {number} height - the height to fit into + */ + update(chart: Chart, width: number, height: number): void; +}; + +export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> extends ExtendedPlugin<TType, O> { + id: string; + + /** + * The events option defines the browser events that the plugin should listen. + * @default ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'] + */ + events?: (keyof HTMLElementEventMap)[] + + /** + * @desc Called when plugin is installed for this chart instance. This hook is also invoked for disabled plugins (options === false). + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @since 3.0.0 + */ + install?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called when a plugin is starting. This happens when chart is created or plugin is enabled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @since 3.0.0 + */ + start?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called when a plugin stopping. This happens when chart is destroyed or plugin is disabled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @since 3.0.0 + */ + stop?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before initializing `chart`. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + beforeInit?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called after `chart` has been initialized and before the first update. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterInit?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before updating `chart`. If any plugin returns `false`, the update + * is cancelled (and thus subsequent render(s)) until another `update` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {UpdateMode} args.mode - The update mode + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart update. + */ + beforeUpdate?(chart: Chart<TType>, args: { mode: UpdateMode, cancelable: true }, options: O): boolean | void; + /** + * @desc Called after `chart` has been updated and before rendering. Note that this + * hook will not be called if the chart update has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {UpdateMode} args.mode - The update mode + * @param {object} options - The plugin options. + */ + afterUpdate?(chart: Chart<TType>, args: { mode: UpdateMode }, options: O): void; + /** + * @desc Called during the update process, before any chart elements have been created. + * This can be used for data decimation by changing the data array inside a dataset. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + beforeElementsUpdate?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called during chart reset + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @since version 3.0.0 + */ + reset?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before updating the `chart` datasets. If any plugin returns `false`, + * the datasets update is cancelled until another `update` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {UpdateMode} args.mode - The update mode. + * @param {object} options - The plugin options. + * @returns {boolean} false to cancel the datasets update. + * @since version 2.1.5 + */ + beforeDatasetsUpdate?(chart: Chart<TType>, args: { mode: UpdateMode }, options: O): boolean | void; + /** + * @desc Called after the `chart` datasets have been updated. Note that this hook + * will not be called if the datasets update has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {UpdateMode} args.mode - The update mode. + * @param {object} options - The plugin options. + * @since version 2.1.5 + */ + afterDatasetsUpdate?(chart: Chart<TType>, args: { mode: UpdateMode, cancelable: true }, options: O): void; + /** + * @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin + * returns `false`, the datasets update is cancelled until another `update` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {number} args.index - The dataset index. + * @param {object} args.meta - The dataset metadata. + * @param {UpdateMode} args.mode - The update mode. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart datasets drawing. + */ + beforeDatasetUpdate?(chart: Chart<TType>, args: { index: number; meta: ChartMeta, mode: UpdateMode, cancelable: true }, options: O): boolean | void; + /** + * @desc Called after the `chart` datasets at the given `args.index` has been updated. Note + * that this hook will not be called if the datasets update has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {number} args.index - The dataset index. + * @param {object} args.meta - The dataset metadata. + * @param {UpdateMode} args.mode - The update mode. + * @param {object} options - The plugin options. + */ + afterDatasetUpdate?(chart: Chart<TType>, args: { index: number; meta: ChartMeta, mode: UpdateMode, cancelable: false }, options: O): void; + /** + * @desc Called before laying out `chart`. If any plugin returns `false`, + * the layout update is cancelled until another `update` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart layout. + */ + beforeLayout?(chart: Chart<TType>, args: { cancelable: true }, options: O): boolean | void; + /** + * @desc Called before scale data limits are calculated. This hook is called separately for each scale in the chart. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Scale} args.scale - The scale. + * @param {object} options - The plugin options. + */ + beforeDataLimits?(chart: Chart<TType>, args: { scale: Scale }, options: O): void; + /** + * @desc Called after scale data limits are calculated. This hook is called separately for each scale in the chart. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Scale} args.scale - The scale. + * @param {object} options - The plugin options. + */ + afterDataLimits?(chart: Chart<TType>, args: { scale: Scale }, options: O): void; + /** + * @desc Called before scale builds its ticks. This hook is called separately for each scale in the chart. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Scale} args.scale - The scale. + * @param {object} options - The plugin options. + */ + beforeBuildTicks?(chart: Chart<TType>, args: { scale: Scale }, options: O): void; + /** + * @desc Called after scale has build its ticks. This hook is called separately for each scale in the chart. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Scale} args.scale - The scale. + * @param {object} options - The plugin options. + */ + afterBuildTicks?(chart: Chart<TType>, args: { scale: Scale }, options: O): void; + /** + * @desc Called after the `chart` has been laid out. Note that this hook will not + * be called if the layout update has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterLayout?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before rendering `chart`. If any plugin returns `false`, + * the rendering is cancelled until another `render` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart rendering. + */ + beforeRender?(chart: Chart<TType>, args: { cancelable: true }, options: O): boolean | void; + /** + * @desc Called after the `chart` has been fully rendered (and animation completed). Note + * that this hook will not be called if the rendering has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterRender?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before drawing `chart` at every animation frame. If any plugin returns `false`, + * the frame drawing is cancelled untilanother `render` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart drawing. + */ + beforeDraw?(chart: Chart<TType>, args: { cancelable: true }, options: O): boolean | void; + /** + * @desc Called after the `chart` has been drawn. Note that this hook will not be called + * if the drawing has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterDraw?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * @desc Called before drawing the `chart` datasets. If any plugin returns `false`, + * the datasets drawing is cancelled until another `render` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart datasets drawing. + */ + beforeDatasetsDraw?(chart: Chart<TType>, args: { cancelable: true }, options: O): boolean | void; + /** + * @desc Called after the `chart` datasets have been drawn. Note that this hook + * will not be called if the datasets drawing has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterDatasetsDraw?(chart: Chart<TType>, args: EmptyObject, options: O, cancelable: false): void; + /** + * @desc Called before drawing the `chart` dataset at the given `args.index` (datasets + * are drawn in the reverse order). If any plugin returns `false`, the datasets drawing + * is cancelled until another `render` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {number} args.index - The dataset index. + * @param {object} args.meta - The dataset metadata. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart datasets drawing. + */ + beforeDatasetDraw?(chart: Chart<TType>, args: { index: number; meta: ChartMeta }, options: O): boolean | void; + /** + * @desc Called after the `chart` datasets at the given `args.index` have been drawn + * (datasets are drawn in the reverse order). Note that this hook will not be called + * if the datasets drawing has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {number} args.index - The dataset index. + * @param {object} args.meta - The dataset metadata. + * @param {object} options - The plugin options. + */ + afterDatasetDraw?(chart: Chart<TType>, args: { index: number; meta: ChartMeta }, options: O): void; + /** + * @desc Called before processing the specified `event`. If any plugin returns `false`, + * the event will be discarded. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {ChartEvent} args.event - The event object. + * @param {boolean} args.replay - True if this event is replayed from `Chart.update` + * @param {boolean} args.inChartArea - The event position is inside chartArea + * @param {object} options - The plugin options. + */ + beforeEvent?(chart: Chart<TType>, args: { event: ChartEvent, replay: boolean, cancelable: true, inChartArea: boolean }, options: O): boolean | void; + /** + * @desc Called after the `event` has been consumed. Note that this hook + * will not be called if the `event` has been previously discarded. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {ChartEvent} args.event - The event object. + * @param {boolean} args.replay - True if this event is replayed from `Chart.update` + * @param {boolean} args.inChartArea - The event position is inside chartArea + * @param {boolean} [args.changed] - Set to true if the plugin needs a render. Should only be changed to true, because this args object is passed through all plugins. + * @param {object} options - The plugin options. + */ + afterEvent?(chart: Chart<TType>, args: { event: ChartEvent, replay: boolean, changed?: boolean, cancelable: false, inChartArea: boolean }, options: O): void; + /** + * @desc Called after the chart as been resized. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {number} args.size - The new canvas display size (eq. canvas.style width & height). + * @param {object} options - The plugin options. + */ + resize?(chart: Chart<TType>, args: { size: { width: number, height: number } }, options: O): void; + /** + * Called before the chart is being destroyed. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + beforeDestroy?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * Called after the chart has been destroyed. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + */ + afterDestroy?(chart: Chart<TType>, args: EmptyObject, options: O): void; + /** + * Called after chart is destroyed on all plugins that were installed for that chart. This hook is also invoked for disabled plugins (options === false). + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {object} options - The plugin options. + * @since 3.0.0 + */ + uninstall?(chart: Chart<TType>, args: EmptyObject, options: O): void; + + /** + * Default options used in the plugin + */ + defaults?: Partial<O>; +} + +export declare type ChartComponentLike = ChartComponent | ChartComponent[] | { [key: string]: ChartComponent } | Plugin | Plugin[]; + +/** + * Please use the module's default export which provides a singleton instance + * Note: class is exported for typedoc + */ +export interface Registry { + readonly controllers: TypedRegistry<DatasetController>; + readonly elements: TypedRegistry<Element>; + readonly plugins: TypedRegistry<Plugin>; + readonly scales: TypedRegistry<Scale>; + + add(...args: ChartComponentLike[]): void; + remove(...args: ChartComponentLike[]): void; + + addControllers(...args: ChartComponentLike[]): void; + addElements(...args: ChartComponentLike[]): void; + addPlugins(...args: ChartComponentLike[]): void; + addScales(...args: ChartComponentLike[]): void; + + getController(id: string): DatasetController | undefined; + getElement(id: string): Element | undefined; + getPlugin(id: string): Plugin | undefined; + getScale(id: string): Scale | undefined; +} + +export declare const registry: Registry; + +export interface Tick { + value: number; + label?: string | string[]; + major?: boolean; +} + +export interface CoreScaleOptions { + /** + * Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the axis is visible only if at least one associated dataset is visible. + * @default true + */ + display: boolean | 'auto'; + /** + * Align pixel values to device pixels + */ + alignToPixels: boolean; + /** + * Background color of the scale area. + */ + backgroundColor: Color; + /** + * Reverse the scale. + * @default false + */ + reverse: boolean; + /** + * Clip the dataset drawing against the size of the scale instead of chart area. + * @default true + */ + clip: boolean; + /** + * The weight used to sort the axis. Higher weights are further away from the chart area. + * @default true + */ + weight: number; + /** + * User defined minimum value for the scale, overrides minimum value from data. + */ + min: unknown; + /** + * User defined maximum value for the scale, overrides maximum value from data. + */ + max: unknown; + /** + * Adjustment used when calculating the maximum data value. + */ + suggestedMin: unknown; + /** + * Adjustment used when calculating the minimum data value. + */ + suggestedMax: unknown; + /** + * Callback called before the update process starts. + */ + beforeUpdate(axis: Scale): void; + /** + * Callback that runs before dimensions are set. + */ + beforeSetDimensions(axis: Scale): void; + /** + * Callback that runs after dimensions are set. + */ + afterSetDimensions(axis: Scale): void; + /** + * Callback that runs before data limits are determined. + */ + beforeDataLimits(axis: Scale): void; + /** + * Callback that runs after data limits are determined. + */ + afterDataLimits(axis: Scale): void; + /** + * Callback that runs before ticks are created. + */ + beforeBuildTicks(axis: Scale): void; + /** + * Callback that runs after ticks are created. Useful for filtering ticks. + */ + afterBuildTicks(axis: Scale): void; + /** + * Callback that runs before ticks are converted into strings. + */ + beforeTickToLabelConversion(axis: Scale): void; + /** + * Callback that runs after ticks are converted into strings. + */ + afterTickToLabelConversion(axis: Scale): void; + /** + * Callback that runs before tick rotation is determined. + */ + beforeCalculateLabelRotation(axis: Scale): void; + /** + * Callback that runs after tick rotation is determined. + */ + afterCalculateLabelRotation(axis: Scale): void; + /** + * Callback that runs before the scale fits to the canvas. + */ + beforeFit(axis: Scale): void; + /** + * Callback that runs after the scale fits to the canvas. + */ + afterFit(axis: Scale): void; + /** + * Callback that runs at the end of the update process. + */ + afterUpdate(axis: Scale): void; +} + +export interface Scale<O extends CoreScaleOptions = CoreScaleOptions> extends Element<unknown, O>, LayoutItem { + readonly id: string; + readonly type: string; + readonly ctx: CanvasRenderingContext2D; + readonly chart: Chart; + + maxWidth: number; + maxHeight: number; + + paddingTop: number; + paddingBottom: number; + paddingLeft: number; + paddingRight: number; + + axis: string; + labelRotation: number; + min: number; + max: number; + ticks: Tick[]; + getMatchingVisibleMetas(type?: string): ChartMeta[]; + + drawTitle(chartArea: ChartArea): void; + drawLabels(chartArea: ChartArea): void; + drawGrid(chartArea: ChartArea): void; + + /** + * @param {number} pixel + * @return {number} + */ + getDecimalForPixel(pixel: number): number; + /** + * Utility for getting the pixel location of a percentage of scale + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} decimal + * @return {number} + */ + getPixelForDecimal(decimal: number): number; + /** + * Returns the location of the tick at the given index + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} index + * @return {number} + */ + getPixelForTick(index: number): number; + /** + * Used to get the label to display in the tooltip for the given value + * @param {*} value + * @return {string} + */ + getLabelForValue(value: number): string; + + /** + * Returns the grid line width at given value + */ + getLineWidthForValue(value: number): number; + + /** + * Returns the location of the given data point. Value can either be an index or a numerical value + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {*} value + * @param {number} [index] + * @return {number} + */ + getPixelForValue(value: number, index?: number): number; + + /** + * Used to get the data value from a given pixel. This is the inverse of getPixelForValue + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @param {number} pixel + * @return {*} + */ + getValueForPixel(pixel: number): number | undefined; + + getBaseValue(): number; + /** + * Returns the pixel for the minimum chart value + * The coordinate (0, 0) is at the upper-left corner of the canvas + * @return {number} + */ + getBasePixel(): number; + + init(options: O): void; + parse(raw: unknown, index?: number): unknown; + getUserBounds(): { min: number; max: number; minDefined: boolean; maxDefined: boolean }; + getMinMax(canStack: boolean): { min: number; max: number }; + getTicks(): Tick[]; + getLabels(): string[]; + getLabelItems(chartArea?: ChartArea): LabelItem[]; + beforeUpdate(): void; + configure(): void; + afterUpdate(): void; + beforeSetDimensions(): void; + setDimensions(): void; + afterSetDimensions(): void; + beforeDataLimits(): void; + determineDataLimits(): void; + afterDataLimits(): void; + beforeBuildTicks(): void; + buildTicks(): Tick[]; + afterBuildTicks(): void; + beforeTickToLabelConversion(): void; + generateTickLabels(ticks: Tick[]): void; + afterTickToLabelConversion(): void; + beforeCalculateLabelRotation(): void; + calculateLabelRotation(): void; + afterCalculateLabelRotation(): void; + beforeFit(): void; + fit(): void; + afterFit(): void; + + isFullSize(): boolean; +} +export declare class Scale { + constructor(cfg: {id: string, type: string, ctx: CanvasRenderingContext2D, chart: Chart}); +} + +export interface ScriptableScaleContext { + chart: Chart; + scale: Scale; + index: number; + tick: Tick; +} + +export interface ScriptableScalePointLabelContext { + chart: Chart; + scale: Scale; + index: number; + label: string; + type: string; +} + +export interface RenderTextOpts { + /** + * The fill color of the text. If unset, the existing + * fillStyle property of the canvas is unchanged. + */ + color?: Color; + + /** + * The width of the strikethrough / underline + * @default 2 + */ + decorationWidth?: number; + + /** + * The max width of the text in pixels + */ + maxWidth?: number; + + /** + * A rotation to be applied to the canvas + * This is applied after the translation is applied + */ + rotation?: number; + + /** + * Apply a strikethrough effect to the text + */ + strikethrough?: boolean; + + /** + * The color of the text stroke. If unset, the existing + * strokeStyle property of the context is unchanged + */ + strokeColor?: Color; + + /** + * The text stroke width. If unset, the existing + * lineWidth property of the context is unchanged + */ + strokeWidth?: number; + + /** + * The text alignment to use. If unset, the existing + * textAlign property of the context is unchanged + */ + textAlign?: CanvasTextAlign; + + /** + * The text baseline to use. If unset, the existing + * textBaseline property of the context is unchanged + */ + textBaseline?: CanvasTextBaseline; + + /** + * If specified, a translation to apply to the context + */ + translation?: [number, number]; + + /** + * Underline the text + */ + underline?: boolean; + + /** + * Dimensions for drawing the label backdrop + */ + backdrop?: BackdropOptions; +} + +export interface BackdropOptions { + /** + * Left position of backdrop as pixel + */ + left: number; + + /** + * Top position of backdrop as pixel + */ + top: number; + + /** + * Width of backdrop in pixels + */ + width: number; + + /** + * Height of backdrop in pixels + */ + height: number; + + /** + * Color of label backdrops. + */ + color: Scriptable<Color, ScriptableScaleContext>; +} + +export interface LabelItem { + label: string | string[]; + font: CanvasFontSpec; + textOffset: number; + options: RenderTextOpts; +} + +export declare const Ticks: { + formatters: { + /** + * Formatter for value labels + * @param value the value to display + * @return {string|string[]} the label to display + */ + values(value: unknown): string | string[]; + /** + * Formatter for numeric ticks + * @param tickValue the value to be formatted + * @param index the position of the tickValue parameter in the ticks array + * @param ticks the list of ticks being converted + * @return string representation of the tickValue parameter + */ + numeric(tickValue: number, index: number, ticks: { value: number }[]): string; + /** + * Formatter for logarithmic ticks + * @param tickValue the value to be formatted + * @param index the position of the tickValue parameter in the ticks array + * @param ticks the list of ticks being converted + * @return string representation of the tickValue parameter + */ + logarithmic(tickValue: number, index: number, ticks: { value: number }[]): string; + }; +}; + +export interface TypedRegistry<T> { + /** + * @param {ChartComponent} item + * @returns {string} The scope where items defaults were registered to. + */ + register(item: ChartComponent): string; + get(id: string): T | undefined; + unregister(item: ChartComponent): void; +} + +export interface ChartEvent { + type: + | 'contextmenu' + | 'mouseenter' + | 'mousedown' + | 'mousemove' + | 'mouseup' + | 'mouseout' + | 'click' + | 'dblclick' + | 'keydown' + | 'keypress' + | 'keyup' + | 'resize'; + native: Event | null; + x: number | null; + y: number | null; +} +export interface ChartComponent { + id: string; + defaults?: AnyObject; + defaultRoutes?: { [property: string]: string }; + + beforeRegister?(): void; + afterRegister?(): void; + beforeUnregister?(): void; + afterUnregister?(): void; +} + +export type InteractionAxis = 'x' | 'y' | 'xy' | 'r'; + +export interface CoreInteractionOptions { + /** + * Sets which elements appear in the tooltip. See Interaction Modes for details. + * @default 'nearest' + */ + mode: InteractionMode; + /** + * if true, the hover mode only applies when the mouse position intersects an item on the chart. + * @default true + */ + intersect: boolean; + + /** + * Defines which directions are used in calculating distances. Defaults to 'x' for 'index' mode and 'xy' in dataset and 'nearest' modes. + */ + axis: InteractionAxis; + + /** + * if true, the invisible points that are outside of the chart area will also be included when evaluating interactions. + * @default false + */ + includeInvisible: boolean; +} + +export interface CoreChartOptions<TType extends ChartType> extends ParsingOptions, AnimationOptions<TType> { + + datasets: { + [key in ChartType]: ChartTypeRegistry[key]['datasetOptions'] + } + + /** + * The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. + * @default 'x' + */ + indexAxis: 'x' | 'y'; + + /** + * How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}` + */ + clip: number | ChartArea | false; + + /** + * base color + * @see Defaults.color + */ + color: Scriptable<Color, ScriptableContext<TType>>; + /** + * base background color + * @see Defaults.backgroundColor + */ + backgroundColor: ScriptableAndArray<Color, ScriptableContext<TType>>; + /** + * base hover background color + * @see Defaults.hoverBackgroundColor + */ + hoverBackgroundColor: ScriptableAndArray<Color, ScriptableContext<TType>>; + /** + * base border color + * @see Defaults.borderColor + */ + borderColor: ScriptableAndArray<Color, ScriptableContext<TType>>; + /** + * base hover border color + * @see Defaults.hoverBorderColor + */ + hoverBorderColor: ScriptableAndArray<Color, ScriptableContext<TType>>; + /** + * base font + * @see Defaults.font + */ + font: Partial<FontSpec>; + /** + * Resizes the chart canvas when its container does (important note...). + * @default true + */ + responsive: boolean; + /** + * Maintain the original canvas aspect ratio (width / height) when resizing. For this option to work properly the chart must be in its own dedicated container. + * @default true + */ + maintainAspectRatio: boolean; + /** + * Delay the resize update by give amount of milliseconds. This can ease the resize process by debouncing update of the elements. + * @default 0 + */ + resizeDelay: number; + + /** + * Canvas aspect ratio (i.e. width / height, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style. + * @default 2 + */ + aspectRatio: number; + + /** + * Locale used for number formatting (using `Intl.NumberFormat`). + * @default user's browser setting + */ + locale: string; + + /** + * Called when a resize occurs. Gets passed two arguments: the chart instance and the new size. + */ + onResize(chart: Chart, size: { width: number; height: number }): void; + + /** + * Override the window's default devicePixelRatio. + * @default window.devicePixelRatio + */ + devicePixelRatio: number; + + interaction: CoreInteractionOptions; + + hover: CoreInteractionOptions; + + /** + * The events option defines the browser events that the chart should listen to for tooltips and hovering. + * @default ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'] + */ + events: (keyof HTMLElementEventMap)[] + + /** + * Called when any of the events fire. Passed the event, an array of active elements (bars, points, etc), and the chart. + */ + onHover(event: ChartEvent, elements: ActiveElement[], chart: Chart): void; + + /** + * Called if the event is of type 'mouseup' or 'click'. Passed the event, an array of active elements, and the chart. + */ + onClick(event: ChartEvent, elements: ActiveElement[], chart: Chart): void; + + layout: Partial<{ + autoPadding: boolean; + padding: Scriptable<Padding, ScriptableContext<TType>>; + }>; +} + +export type AnimationSpec<TType extends ChartType> = { + /** + * The number of milliseconds an animation takes. + * @default 1000 + */ + duration?: Scriptable<number, ScriptableContext<TType>>; + /** + * Easing function to use + * @default 'easeOutQuart' + */ + easing?: Scriptable<EasingFunction, ScriptableContext<TType>>; + + /** + * Delay before starting the animations. + * @default 0 + */ + delay?: Scriptable<number, ScriptableContext<TType>>; + + /** + * If set to true, the animations loop endlessly. + * @default false + */ + loop?: Scriptable<boolean, ScriptableContext<TType>>; +} + +export type AnimationsSpec<TType extends ChartType> = { + [name: string]: false | AnimationSpec<TType> & { + properties: string[]; + + /** + * Type of property, determines the interpolator used. Possible values: 'number', 'color' and 'boolean'. Only really needed for 'color', because typeof does not get that right. + */ + type: 'color' | 'number' | 'boolean'; + + fn: <T>(from: T, to: T, factor: number) => T; + + /** + * Start value for the animation. Current value is used when undefined + */ + from: Scriptable<Color | number | boolean, ScriptableContext<TType>>; + /** + * + */ + to: Scriptable<Color | number | boolean, ScriptableContext<TType>>; + } +} + +export type TransitionSpec<TType extends ChartType> = { + animation: AnimationSpec<TType>; + animations: AnimationsSpec<TType>; +} + +export type TransitionsSpec<TType extends ChartType> = { + [mode: string]: TransitionSpec<TType> +} + +export type AnimationOptions<TType extends ChartType> = { + animation: false | AnimationSpec<TType> & { + /** + * Callback called on each step of an animation. + */ + onProgress?: (this: Chart, event: AnimationEvent) => void; + /** + * Callback called when all animations are completed. + */ + onComplete?: (this: Chart, event: AnimationEvent) => void; + }; + animations: AnimationsSpec<TType>; + transitions: TransitionsSpec<TType>; +}; + +export interface FontSpec { + /** + * Default font family for all text, follows CSS font-family options. + * @default "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" + */ + family: string; + /** + * Default font size (in px) for text. Does not apply to radialLinear scale point labels. + * @default 12 + */ + size: number; + /** + * Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit) + * @default 'normal' + */ + style: 'normal' | 'italic' | 'oblique' | 'initial' | 'inherit'; + /** + * Default font weight (boldness). (see MDN). + */ + weight: 'normal' | 'bold' | 'lighter' | 'bolder' | number | null; + /** + * Height of an individual line of text (see MDN). + * @default 1.2 + */ + lineHeight: number | string; +} + +export interface CanvasFontSpec extends FontSpec { + string: string; +} + +export type TextAlign = 'left' | 'center' | 'right'; +export type Align = 'start' | 'center' | 'end'; + +export interface VisualElement { + draw(ctx: CanvasRenderingContext2D, area?: ChartArea): void; + inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean): boolean; + inXRange(mouseX: number, useFinalPosition?: boolean): boolean; + inYRange(mouseY: number, useFinalPosition?: boolean): boolean; + getCenterPoint(useFinalPosition?: boolean): Point; + getRange?(axis: 'x' | 'y'): number; +} + +export interface CommonElementOptions { + borderWidth: number; + borderColor: Color; + backgroundColor: Color; +} + +export interface CommonHoverOptions { + hoverBorderWidth: number; + hoverBorderColor: Color; + hoverBackgroundColor: Color; +} + +export interface Segment { + start: number; + end: number; + loop: boolean; +} + +export interface ArcBorderRadius { + outerStart: number; + outerEnd: number; + innerStart: number; + innerEnd: number; +} + +export interface ArcOptions extends CommonElementOptions { + /** + * Arc stroke alignment. + */ + borderAlign: 'center' | 'inner'; + /** + * Line dash. See MDN. + * @default [] + */ + borderDash: number[]; + /** + * Line dash offset. See MDN. + * @default 0.0 + */ + borderDashOffset: number; + /** + * Line join style. See MDN. Default is 'round' when `borderAlign` is 'inner', else 'bevel'. + */ + borderJoinStyle: CanvasLineJoin; + + /** + * Sets the border radius for arcs + * @default 0 + */ + borderRadius: number | ArcBorderRadius; + + /** + * Arc offset (in pixels). + */ + offset: number; + + /** + * If false, Arc will be flat. + * @default true + */ + circular: boolean; + + /** + * Spacing between arcs + */ + spacing: number +} + +export interface ArcHoverOptions extends CommonHoverOptions { + hoverBorderDash: number[]; + hoverBorderDashOffset: number; + hoverOffset: number; +} + +export interface LineProps { + points: Point[] +} + +export interface LineOptions extends CommonElementOptions { + /** + * Line cap style. See MDN. + * @default 'butt' + */ + borderCapStyle: CanvasLineCap; + /** + * Line dash. See MDN. + * @default [] + */ + borderDash: number[]; + /** + * Line dash offset. See MDN. + * @default 0.0 + */ + borderDashOffset: number; + /** + * Line join style. See MDN. + * @default 'miter' + */ + borderJoinStyle: CanvasLineJoin; + /** + * true to keep Bézier control inside the chart, false for no restriction. + * @default true + */ + capBezierPoints: boolean; + /** + * Interpolation mode to apply. + * @default 'default' + */ + cubicInterpolationMode: 'default' | 'monotone'; + /** + * Bézier curve tension (0 for no Bézier curves). + * @default 0 + */ + tension: number; + /** + * true to show the line as a stepped line (tension will be ignored). + * @default false + */ + stepped: 'before' | 'after' | 'middle' | boolean; + /** + * Both line and radar charts support a fill option on the dataset object which can be used to create area between two datasets or a dataset and a boundary, i.e. the scale origin, start or end + */ + fill: FillTarget | ComplexFillTarget; + /** + * If true, lines will be drawn between points with no or null data. If false, points with NaN data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used. + */ + spanGaps: boolean | number; + + segment: { + backgroundColor: Scriptable<Color|undefined, ScriptableLineSegmentContext>, + borderColor: Scriptable<Color|undefined, ScriptableLineSegmentContext>, + borderCapStyle: Scriptable<CanvasLineCap|undefined, ScriptableLineSegmentContext>; + borderDash: Scriptable<number[]|undefined, ScriptableLineSegmentContext>; + borderDashOffset: Scriptable<number|undefined, ScriptableLineSegmentContext>; + borderJoinStyle: Scriptable<CanvasLineJoin|undefined, ScriptableLineSegmentContext>; + borderWidth: Scriptable<number|undefined, ScriptableLineSegmentContext>; + }; +} + +export interface LineHoverOptions extends CommonHoverOptions { + hoverBorderCapStyle: CanvasLineCap; + hoverBorderDash: number[]; + hoverBorderDashOffset: number; + hoverBorderJoinStyle: CanvasLineJoin; +} + +export interface LineElement<T extends LineProps = LineProps, O extends LineOptions = LineOptions> + extends Element<T, O>, + VisualElement { + updateControlPoints(chartArea: ChartArea, indexAxis?: 'x' | 'y'): void; + points: Point[]; + readonly segments: Segment[]; + first(): Point | false; + last(): Point | false; + interpolate(point: Point, property: 'x' | 'y'): undefined | Point | Point[]; + pathSegment(ctx: CanvasRenderingContext2D, segment: Segment, params: AnyObject): undefined | boolean; + path(ctx: CanvasRenderingContext2D): boolean; +} + +export declare const LineElement: ChartComponent & { + prototype: LineElement; + new (cfg: AnyObject): LineElement; +}; + +export type PointStyle = + | 'circle' + | 'cross' + | 'crossRot' + | 'dash' + | 'line' + | 'rect' + | 'rectRounded' + | 'rectRot' + | 'star' + | 'triangle' + | false + | HTMLImageElement + | HTMLCanvasElement; + +export interface PointOptions extends CommonElementOptions { + /** + * Point radius + * @default 3 + */ + radius: number; + /** + * Extra radius added to point radius for hit detection. + * @default 1 + */ + hitRadius: number; + /** + * Point style + * @default 'circle; + */ + pointStyle: PointStyle; + /** + * Point rotation (in degrees). + * @default 0 + */ + rotation: number; + /** + * Draw the active elements over the other elements of the dataset, + * @default true + */ + drawActiveElementsOnTop: boolean; +} + +export interface PointHoverOptions extends CommonHoverOptions { + /** + * Point radius when hovered. + * @default 4 + */ + hoverRadius: number; +} + +export interface PointPrefixedOptions { + /** + * The fill color for points. + */ + pointBackgroundColor: Color; + /** + * The border color for points. + */ + pointBorderColor: Color; + /** + * The width of the point border in pixels. + */ + pointBorderWidth: number; + /** + * The pixel size of the non-displayed point that reacts to mouse events. + */ + pointHitRadius: number; + /** + * The radius of the point shape. If set to 0, the point is not rendered. + */ + pointRadius: number; + /** + * The rotation of the point in degrees. + */ + pointRotation: number; + /** + * Style of the point. + */ + pointStyle: PointStyle; +} + +export interface PointPrefixedHoverOptions { + /** + * Point background color when hovered. + */ + pointHoverBackgroundColor: Color; + /** + * Point border color when hovered. + */ + pointHoverBorderColor: Color; + /** + * Border width of point when hovered. + */ + pointHoverBorderWidth: number; + /** + * The radius of the point when hovered. + */ + pointHoverRadius: number; +} + +export interface BarProps extends Point { + base: number; + horizontal: boolean; + width: number; + height: number; +} + +export interface BarOptions extends Omit<CommonElementOptions, 'borderWidth'> { + /** + * The base value for the bar in data units along the value axis. + */ + base: number; + + /** + * Skipped (excluded) border: 'start', 'end', 'left', 'right', 'bottom', 'top', 'middle', false (none) or true (all). + * @default 'start' + */ + borderSkipped: 'start' | 'end' | 'left' | 'right' | 'bottom' | 'top' | 'middle' | boolean; + + /** + * Border radius + * @default 0 + */ + borderRadius: number | BorderRadius; + + /** + * Amount to inflate the rectangle(s). This can be used to hide artifacts between bars. + * Unit is pixels. 'auto' translates to 0.33 pixels when barPercentage * categoryPercentage is 1, else 0. + * @default 'auto' + */ + inflateAmount: number | 'auto'; + + /** + * Width of the border, number for all sides, object to specify width for each side specifically + * @default 0 + */ + borderWidth: number | { top?: number, right?: number, bottom?: number, left?: number }; +} + +export interface BorderRadius { + topLeft: number; + topRight: number; + bottomLeft: number; + bottomRight: number; +} + +export interface BarHoverOptions extends CommonHoverOptions { + hoverBorderRadius: number | BorderRadius; +} + +export interface BarElement< + T extends BarProps = BarProps, + O extends BarOptions = BarOptions +> extends Element<T, O>, VisualElement {} + +export declare const BarElement: ChartComponent & { + prototype: BarElement; + new (cfg: AnyObject): BarElement; +}; + +export interface ElementOptionsByType<TType extends ChartType> { + arc: ScriptableAndArrayOptions<ArcOptions & ArcHoverOptions, ScriptableContext<TType>>; + bar: ScriptableAndArrayOptions<BarOptions & BarHoverOptions, ScriptableContext<TType>>; + line: ScriptableAndArrayOptions<LineOptions & LineHoverOptions, ScriptableContext<TType>>; + point: ScriptableAndArrayOptions<PointOptions & PointHoverOptions, ScriptableContext<TType>>; +} + +export type ElementChartOptions<TType extends ChartType = ChartType> = { + elements: ElementOptionsByType<TType> +}; + +export declare class BasePlatform { + /** + * Called at chart construction time, returns a context2d instance implementing + * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}. + * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific) + * @param options - The chart options + */ + acquireContext( + canvas: HTMLCanvasElement, + options?: CanvasRenderingContext2DSettings + ): CanvasRenderingContext2D | null; + /** + * Called at chart destruction time, releases any resources associated to the context + * previously returned by the acquireContext() method. + * @param {CanvasRenderingContext2D} context - The context2d instance + * @returns {boolean} true if the method succeeded, else false + */ + releaseContext(context: CanvasRenderingContext2D): boolean; + /** + * Registers the specified listener on the given chart. + * @param {Chart} chart - Chart from which to listen for event + * @param {string} type - The ({@link ChartEvent}) type to listen for + * @param listener - Receives a notification (an object that implements + * the {@link ChartEvent} interface) when an event of the specified type occurs. + */ + addEventListener(chart: Chart, type: string, listener: (e: ChartEvent) => void): void; + /** + * Removes the specified listener previously registered with addEventListener. + * @param {Chart} chart - Chart from which to remove the listener + * @param {string} type - The ({@link ChartEvent}) type to remove + * @param listener - The listener function to remove from the event target. + */ + removeEventListener(chart: Chart, type: string, listener: (e: ChartEvent) => void): void; + /** + * @returns {number} the current devicePixelRatio of the device this platform is connected to. + */ + getDevicePixelRatio(): number; + /** + * @param {HTMLCanvasElement} canvas - The canvas for which to calculate the maximum size + * @param {number} [width] - Parent element's content width + * @param {number} [height] - Parent element's content height + * @param {number} [aspectRatio] - The aspect ratio to maintain + * @returns { width: number, height: number } the maximum size available. + */ + getMaximumSize(canvas: HTMLCanvasElement, width?: number, height?: number, aspectRatio?: number): { width: number, height: number }; + /** + * @param {HTMLCanvasElement} canvas + * @returns {boolean} true if the canvas is attached to the platform, false if not. + */ + isAttached(canvas: HTMLCanvasElement): boolean; + /** + * Updates config with platform specific requirements + * @param {ChartConfiguration | ChartConfigurationCustomTypes} config + */ + updateConfig(config: ChartConfiguration | ChartConfigurationCustomTypesPerDataset): void; +} + +export declare class BasicPlatform extends BasePlatform {} +export declare class DomPlatform extends BasePlatform {} + +export declare const Decimation: Plugin; + +export declare const enum DecimationAlgorithm { + lttb = 'lttb', + minmax = 'min-max', +} +interface BaseDecimationOptions { + enabled: boolean; + threshold?: number; +} + +interface LttbDecimationOptions extends BaseDecimationOptions { + algorithm: DecimationAlgorithm.lttb | 'lttb'; + samples?: number; +} + +interface MinMaxDecimationOptions extends BaseDecimationOptions { + algorithm: DecimationAlgorithm.minmax | 'min-max'; +} + +export type DecimationOptions = LttbDecimationOptions | MinMaxDecimationOptions; + +export declare const Filler: Plugin; +export interface FillerOptions { + drawTime: 'beforeDraw' | 'beforeDatasetDraw' | 'beforeDatasetsDraw'; + propagate: boolean; +} + +export type FillTarget = number | string | { value: number } | 'start' | 'end' | 'origin' | 'stack' | 'shape' | boolean; + +export interface ComplexFillTarget { + /** + * The accepted values are the same as the filling mode values, so you may use absolute and relative dataset indexes and/or boundaries. + */ + target: FillTarget; + /** + * If no color is set, the default color will be the background color of the chart. + */ + above: Color; + /** + * Same as the above. + */ + below: Color; +} + +export interface FillerControllerDatasetOptions { + /** + * Both line and radar charts support a fill option on the dataset object which can be used to create area between two datasets or a dataset and a boundary, i.e. the scale origin, start or end + */ + fill: FillTarget | ComplexFillTarget; +} + +export declare const Legend: Plugin; + +export interface LegendItem { + /** + * Label that will be displayed + */ + text: string; + + /** + * Border radius of the legend box + * @since 3.1.0 + */ + borderRadius?: number | BorderRadius; + + /** + * Index of the associated dataset + */ + datasetIndex?: number; + + /** + * Index the associated label in the labels array + */ + index?: number + + /** + * Fill style of the legend box + */ + fillStyle?: Color; + + /** + * Font color for the text + * Defaults to LegendOptions.labels.color + */ + fontColor?: Color; + + /** + * If true, this item represents a hidden dataset. Label will be rendered with a strike-through effect + */ + hidden?: boolean; + + /** + * For box border. + * @see https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap + */ + lineCap?: CanvasLineCap; + + /** + * For box border. + * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash + */ + lineDash?: number[]; + + /** + * For box border. + * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset + */ + lineDashOffset?: number; + + /** + * For box border. + * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin + */ + lineJoin?: CanvasLineJoin; + + /** + * Width of box border + */ + lineWidth?: number; + + /** + * Stroke style of the legend box + */ + strokeStyle?: Color; + + /** + * Point style of the legend box (only used if usePointStyle is true) + */ + pointStyle?: PointStyle; + + /** + * Rotation of the point in degrees (only used if usePointStyle is true) + */ + rotation?: number; + + /** + * Text alignment + */ + textAlign?: TextAlign; +} + +export interface LegendElement<TType extends ChartType> extends Element<AnyObject, LegendOptions<TType>>, LayoutItem { + chart: Chart<TType>; + ctx: CanvasRenderingContext2D; + legendItems?: LegendItem[]; + options: LegendOptions<TType>; + fit(): void; +} + +export interface LegendOptions<TType extends ChartType> { + /** + * Is the legend shown? + * @default true + */ + display: boolean; + /** + * Position of the legend. + * @default 'top' + */ + position: LayoutPosition; + /** + * Alignment of the legend. + * @default 'center' + */ + align: Align; + /** + * Maximum height of the legend, in pixels + */ + maxHeight: number; + /** + * Maximum width of the legend, in pixels + */ + maxWidth: number; + /** + * Marks that this box should take the full width/height of the canvas (moving other boxes). This is unlikely to need to be changed in day-to-day use. + * @default true + */ + fullSize: boolean; + /** + * Legend will show datasets in reverse order. + * @default false + */ + reverse: boolean; + /** + * A callback that is called when a click event is registered on a label item. + */ + onClick(this: LegendElement<TType>, e: ChartEvent, legendItem: LegendItem, legend: LegendElement<TType>): void; + /** + * A callback that is called when a 'mousemove' event is registered on top of a label item + */ + onHover(this: LegendElement<TType>, e: ChartEvent, legendItem: LegendItem, legend: LegendElement<TType>): void; + /** + * A callback that is called when a 'mousemove' event is registered outside of a previously hovered label item. + */ + onLeave(this: LegendElement<TType>, e: ChartEvent, legendItem: LegendItem, legend: LegendElement<TType>): void; + + labels: { + /** + * Width of colored box. + * @default 40 + */ + boxWidth: number; + /** + * Height of the coloured box. + * @default fontSize + */ + boxHeight: number; + /** + * Color of label + * @see Defaults.color + */ + color: Color; + /** + * Font of label + * @see Defaults.font + */ + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableChartContext>; + /** + * Padding between rows of colored boxes. + * @default 10 + */ + padding: number; + /** + * If usePointStyle is true, the width of the point style used for the legend. + */ + pointStyleWidth: number; + /** + * Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See Legend Item for details. + */ + generateLabels(chart: Chart): LegendItem[]; + + /** + * Filters legend items out of the legend. Receives 2 parameters, a Legend Item and the chart data + */ + filter(item: LegendItem, data: ChartData): boolean; + + /** + * Sorts the legend items + */ + sort(a: LegendItem, b: LegendItem, data: ChartData): number; + + /** + * Override point style for the legend. Only applies if usePointStyle is true + */ + pointStyle: PointStyle; + + /** + * Text alignment + */ + textAlign?: TextAlign; + + /** + * Label style will match corresponding point style (size is based on the minimum value between boxWidth and font.size). + * @default false + */ + usePointStyle: boolean; + + /** + * Label borderRadius will match corresponding borderRadius. + * @default false + */ + useBorderRadius: boolean; + + /** + * Override the borderRadius to use. + * @default undefined + */ + borderRadius: number; + }; + /** + * true for rendering the legends from right to left. + */ + rtl: boolean; + /** + * This will force the text direction 'rtl' or 'ltr' on the canvas for rendering the legend, regardless of the css specified on the canvas + * @default canvas's default + */ + textDirection: string; + + title: { + /** + * Is the legend title displayed. + * @default false + */ + display: boolean; + /** + * Color of title + * @see Defaults.color + */ + color: Color; + /** + * see Fonts + */ + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableChartContext>; + position: 'center' | 'start' | 'end'; + padding?: number | ChartArea; + /** + * The string title. + */ + text: string; + }; +} + +export declare const SubTitle: Plugin; +export declare const Title: Plugin; + +export interface TitleOptions { + /** + * Alignment of the title. + * @default 'center' + */ + align: Align; + /** + * Is the title shown? + * @default false + */ + display: boolean; + /** + * Position of title + * @default 'top' + */ + position: 'top' | 'left' | 'bottom' | 'right'; + /** + * Color of text + * @see Defaults.color + */ + color: Color; + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableChartContext>; + + /** + * Marks that this box should take the full width/height of the canvas (moving other boxes). If set to `false`, places the box above/beside the + * chart area + * @default true + */ + fullSize: boolean; + /** + * Adds padding above and below the title text if a single number is specified. It is also possible to change top and bottom padding separately. + */ + padding: number | { top: number; bottom: number }; + /** + * Title text to display. If specified as an array, text is rendered on multiple lines. + */ + text: string | string[]; +} + +export type TooltipXAlignment = 'left' | 'center' | 'right'; +export type TooltipYAlignment = 'top' | 'center' | 'bottom'; +export interface TooltipLabelStyle { + borderColor: Color; + backgroundColor: Color; + + /** + * Width of border line + * @since 3.1.0 + */ + borderWidth?: number; + + /** + * Border dash + * @since 3.1.0 + */ + borderDash?: [number, number]; + + /** + * Border dash offset + * @since 3.1.0 + */ + borderDashOffset?: number; + + /** + * borderRadius + * @since 3.1.0 + */ + borderRadius?: number | BorderRadius; +} +export interface TooltipModel<TType extends ChartType> extends Element<AnyObject, TooltipOptions<TType>> { + readonly chart: Chart<TType>; + + // The items that we are rendering in the tooltip. See Tooltip Item Interface section + dataPoints: TooltipItem<TType>[]; + + // Positioning + xAlign: TooltipXAlignment; + yAlign: TooltipYAlignment; + + // X and Y properties are the top left of the tooltip + x: number; + y: number; + width: number; + height: number; + // Where the tooltip points to + caretX: number; + caretY: number; + + // Body + // The body lines that need to be rendered + // Each object contains 3 parameters + // before: string[] // lines of text before the line with the color square + // lines: string[]; // lines of text to render as the main item with color square + // after: string[]; // lines of text to render after the main lines + body: { before: string[]; lines: string[]; after: string[] }[]; + // lines of text that appear after the title but before the body + beforeBody: string[]; + // line of text that appear after the body and before the footer + afterBody: string[]; + + // Title + // lines of text that form the title + title: string[]; + + // Footer + // lines of text that form the footer + footer: string[]; + + // Styles to render for each item in body[]. This is the styling of the squares in the tooltip + labelColors: TooltipLabelStyle[]; + labelTextColors: Color[]; + labelPointStyles: { pointStyle: PointStyle; rotation: number }[]; + + // 0 opacity is a hidden tooltip + opacity: number; + + // tooltip options + options: TooltipOptions<TType>; + + getActiveElements(): ActiveElement[]; + setActiveElements(active: ActiveDataPoint[], eventPosition: Point): void; +} + +export interface TooltipPosition extends Point { + xAlign?: TooltipXAlignment; + yAlign?: TooltipYAlignment; +} + +export type TooltipPositionerFunction<TType extends ChartType> = ( + this: TooltipModel<TType>, + items: readonly ActiveElement[], + eventPosition: Point +) => TooltipPosition | false; + +export interface TooltipPositionerMap { + average: TooltipPositionerFunction<ChartType>; + nearest: TooltipPositionerFunction<ChartType>; +} + +export type TooltipPositioner = keyof TooltipPositionerMap; + +export interface Tooltip extends Plugin { + readonly positioners: TooltipPositionerMap; +} + +export declare const Tooltip: Tooltip; + +export interface TooltipCallbacks< + TType extends ChartType, + Model = TooltipModel<TType>, + Item = TooltipItem<TType>> { + + beforeTitle(this: Model, tooltipItems: Item[]): string | string[] | void; + title(this: Model, tooltipItems: Item[]): string | string[] | void; + afterTitle(this: Model, tooltipItems: Item[]): string | string[] | void; + + beforeBody(this: Model, tooltipItems: Item[]): string | string[] | void; + afterBody(this: Model, tooltipItems: Item[]): string | string[] | void; + + beforeLabel(this: Model, tooltipItem: Item): string | string[] | void; + label(this: Model, tooltipItem: Item): string | string[] | void; + afterLabel(this: Model, tooltipItem: Item): string | string[] | void; + + labelColor(this: Model, tooltipItem: Item): TooltipLabelStyle | void; + labelTextColor(this: Model, tooltipItem: Item): Color | void; + labelPointStyle(this: Model, tooltipItem: Item): { pointStyle: PointStyle; rotation: number } | void; + + beforeFooter(this: Model, tooltipItems: Item[]): string | string[] | void; + footer(this: Model, tooltipItems: Item[]): string | string[] | void; + afterFooter(this: Model, tooltipItems: Item[]): string | string[] | void; +} + +export interface ExtendedPlugin< + TType extends ChartType, + O = AnyObject, + Model = TooltipModel<TType>> { + /** + * @desc Called before drawing the `tooltip`. If any plugin returns `false`, + * the tooltip drawing is cancelled until another `render` is triggered. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Tooltip} args.tooltip - The tooltip. + * @param {object} options - The plugin options. + * @returns {boolean} `false` to cancel the chart tooltip drawing. + */ + beforeTooltipDraw?(chart: Chart, args: { tooltip: Model, cancelable: true }, options: O): boolean | void; + /** + * @desc Called after drawing the `tooltip`. Note that this hook will not + * be called if the tooltip drawing has been previously cancelled. + * @param {Chart} chart - The chart instance. + * @param {object} args - The call arguments. + * @param {Tooltip} args.tooltip - The tooltip. + * @param {object} options - The plugin options. + */ + afterTooltipDraw?(chart: Chart, args: { tooltip: Model }, options: O): void; +} + +export interface ScriptableTooltipContext<TType extends ChartType> { + chart: UnionToIntersection<Chart<TType>>; + tooltip: UnionToIntersection<TooltipModel<TType>>; + tooltipItems: TooltipItem<TType>[]; +} + +export interface TooltipOptions<TType extends ChartType = ChartType> extends CoreInteractionOptions { + /** + * Are on-canvas tooltips enabled? + * @default true + */ + enabled: Scriptable<boolean, ScriptableTooltipContext<TType>>; + /** + * See external tooltip section. + */ + external(this: TooltipModel<TType>, args: { chart: Chart; tooltip: TooltipModel<TType> }): void; + /** + * The mode for positioning the tooltip + */ + position: Scriptable<TooltipPositioner, ScriptableTooltipContext<TType>> + + /** + * Override the tooltip alignment calculations + */ + xAlign: Scriptable<TooltipXAlignment, ScriptableTooltipContext<TType>>; + yAlign: Scriptable<TooltipYAlignment, ScriptableTooltipContext<TType>>; + + /** + * Sort tooltip items. + */ + itemSort: (a: TooltipItem<TType>, b: TooltipItem<TType>, data: ChartData) => number; + + filter: (e: TooltipItem<TType>, index: number, array: TooltipItem<TType>[], data: ChartData) => boolean; + + /** + * Background color of the tooltip. + * @default 'rgba(0, 0, 0, 0.8)' + */ + backgroundColor: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * Padding between the color box and the text. + * @default 1 + */ + boxPadding: number; + /** + * Color of title + * @default '#fff' + */ + titleColor: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * See Fonts + * @default {weight: 'bold'} + */ + titleFont: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableTooltipContext<TType>>; + /** + * Spacing to add to top and bottom of each title line. + * @default 2 + */ + titleSpacing: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Margin to add on bottom of title section. + * @default 6 + */ + titleMarginBottom: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Horizontal alignment of the title text lines. + * @default 'left' + */ + titleAlign: Scriptable<TextAlign, ScriptableTooltipContext<TType>>; + /** + * Spacing to add to top and bottom of each tooltip item. + * @default 2 + */ + bodySpacing: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Color of body + * @default '#fff' + */ + bodyColor: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * See Fonts. + * @default {} + */ + bodyFont: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableTooltipContext<TType>>; + /** + * Horizontal alignment of the body text lines. + * @default 'left' + */ + bodyAlign: Scriptable<TextAlign, ScriptableTooltipContext<TType>>; + /** + * Spacing to add to top and bottom of each footer line. + * @default 2 + */ + footerSpacing: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Margin to add before drawing the footer. + * @default 6 + */ + footerMarginTop: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Color of footer + * @default '#fff' + */ + footerColor: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * See Fonts + * @default {weight: 'bold'} + */ + footerFont: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableTooltipContext<TType>>; + /** + * Horizontal alignment of the footer text lines. + * @default 'left' + */ + footerAlign: Scriptable<TextAlign, ScriptableTooltipContext<TType>>; + /** + * Padding to add to the tooltip + * @default 6 + */ + padding: Scriptable<Padding, ScriptableTooltipContext<TType>>; + /** + * Extra distance to move the end of the tooltip arrow away from the tooltip point. + * @default 2 + */ + caretPadding: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Size, in px, of the tooltip arrow. + * @default 5 + */ + caretSize: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Radius of tooltip corner curves. + * @default 6 + */ + cornerRadius: Scriptable<number | BorderRadius, ScriptableTooltipContext<TType>>; + /** + * Color to draw behind the colored boxes when multiple items are in the tooltip. + * @default '#fff' + */ + multiKeyBackground: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * If true, color boxes are shown in the tooltip. + * @default true + */ + displayColors: Scriptable<boolean, ScriptableTooltipContext<TType>>; + /** + * Width of the color box if displayColors is true. + * @default bodyFont.size + */ + boxWidth: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Height of the color box if displayColors is true. + * @default bodyFont.size + */ + boxHeight: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * Use the corresponding point style (from dataset options) instead of color boxes, ex: star, triangle etc. (size is based on the minimum value between boxWidth and boxHeight) + * @default false + */ + usePointStyle: Scriptable<boolean, ScriptableTooltipContext<TType>>; + /** + * Color of the border. + * @default 'rgba(0, 0, 0, 0)' + */ + borderColor: Scriptable<Color, ScriptableTooltipContext<TType>>; + /** + * Size of the border. + * @default 0 + */ + borderWidth: Scriptable<number, ScriptableTooltipContext<TType>>; + /** + * true for rendering the legends from right to left. + */ + rtl: Scriptable<boolean, ScriptableTooltipContext<TType>>; + + /** + * This will force the text direction 'rtl' or 'ltr on the canvas for rendering the tooltips, regardless of the css specified on the canvas + * @default canvas's default + */ + textDirection: Scriptable<string, ScriptableTooltipContext<TType>>; + + animation: AnimationSpec<TType> | false; + animations: AnimationsSpec<TType> | false; + callbacks: TooltipCallbacks<TType>; +} + +export interface TooltipItem<TType extends ChartType> { + /** + * The chart the tooltip is being shown on + */ + chart: Chart; + + /** + * Label for the tooltip + */ + label: string; + + /** + * Parsed data values for the given `dataIndex` and `datasetIndex` + */ + parsed: UnionToIntersection<ParsedDataType<TType>>; + + /** + * Raw data values for the given `dataIndex` and `datasetIndex` + */ + raw: unknown; + + /** + * Formatted value for the tooltip + */ + formattedValue: string; + + /** + * The dataset the item comes from + */ + dataset: UnionToIntersection<ChartDataset<TType>>; + + /** + * Index of the dataset the item comes from + */ + datasetIndex: number; + + /** + * Index of this data item in the dataset + */ + dataIndex: number; + + /** + * The chart element (point, arc, bar, etc.) for this tooltip item + */ + element: Element; +} + +export interface PluginOptionsByType<TType extends ChartType> { + colors: ColorsPluginOptions; + decimation: DecimationOptions; + filler: FillerOptions; + legend: LegendOptions<TType>; + subtitle: TitleOptions; + title: TitleOptions; + tooltip: TooltipOptions<TType>; +} +export interface PluginChartOptions<TType extends ChartType> { + plugins: PluginOptionsByType<TType>; +} + +export interface BorderOptions { + /** + * @default true + */ + display: boolean + /** + * @default [] + */ + dash: Scriptable<number[], ScriptableScaleContext>; + /** + * @default 0 + */ + dashOffset: Scriptable<number, ScriptableScaleContext>; + color: Color; + width: number; + z: number; +} + +export interface GridLineOptions { + /** + * @default true + */ + display: boolean; + /** + * @default false + */ + circular: boolean; + /** + * @default 'rgba(0, 0, 0, 0.1)' + */ + color: ScriptableAndArray<Color, ScriptableScaleContext>; + /** + * @default 1 + */ + lineWidth: ScriptableAndArray<number, ScriptableScaleContext>; + /** + * @default true + */ + drawOnChartArea: boolean; + /** + * @default true + */ + drawTicks: boolean; + /** + * @default [] + */ + tickBorderDash: Scriptable<number[], ScriptableScaleContext>; + /** + * @default 0 + */ + tickBorderDashOffset: Scriptable<number, ScriptableScaleContext>; + /** + * @default 'rgba(0, 0, 0, 0.1)' + */ + tickColor: ScriptableAndArray<Color, ScriptableScaleContext>; + /** + * @default 10 + */ + tickLength: number; + /** + * @default 1 + */ + tickWidth: number; + /** + * @default false + */ + offset: boolean; + /** + * @default 0 + */ + z: number; +} + +export interface TickOptions { + /** + * Color of label backdrops. + * @default 'rgba(255, 255, 255, 0.75)' + */ + backdropColor: Scriptable<Color, ScriptableScaleContext>; + /** + * Padding of tick backdrop. + * @default 2 + */ + backdropPadding: number | ChartArea; + + /** + * Returns the string representation of the tick value as it should be displayed on the chart. See callback. + */ + callback: (this: Scale, tickValue: number | string, index: number, ticks: Tick[]) => string | string[] | number | number[] | null | undefined; + /** + * If true, show tick labels. + * @default true + */ + display: boolean; + /** + * Color of tick + * @see Defaults.color + */ + color: ScriptableAndArray<Color, ScriptableScaleContext>; + /** + * see Fonts + */ + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableScaleContext>; + /** + * Sets the offset of the tick labels from the axis + */ + padding: number; + /** + * If true, draw a background behind the tick labels. + * @default false + */ + showLabelBackdrop: Scriptable<boolean, ScriptableScaleContext>; + /** + * The color of the stroke around the text. + * @default undefined + */ + textStrokeColor: Scriptable<Color, ScriptableScaleContext>; + /** + * Stroke width around the text. + * @default 0 + */ + textStrokeWidth: Scriptable<number, ScriptableScaleContext>; + /** + * z-index of tick layer. Useful when ticks are drawn on chart area. Values <= 0 are drawn under datasets, > 0 on top. + * @default 0 + */ + z: number; + + major: { + /** + * If true, major ticks are generated. A major tick will affect autoskipping and major will be defined on ticks in the scriptable options context. + * @default false + */ + enabled: boolean; + }; +} + +export type CartesianTickOptions = TickOptions & { + /** + * The number of ticks to examine when deciding how many labels will fit. Setting a smaller value will be faster, but may be less accurate when there is large variability in label length. + * @default ticks.length + */ + sampleSize: number; + /** + * The label alignment + * @default 'center' + */ + align: Align | 'inner'; + /** + * If true, automatically calculates how many labels can be shown and hides labels accordingly. Labels will be rotated up to maxRotation before skipping any. Turn autoSkip off to show all labels no matter what. + * @default true + */ + autoSkip: boolean; + /** + * Padding between the ticks on the horizontal axis when autoSkip is enabled. + * @default 0 + */ + autoSkipPadding: number; + + /** + * How is the label positioned perpendicular to the axis direction. + * This only applies when the rotation is 0 and the axis position is one of "top", "left", "right", or "bottom" + * @default 'near' + */ + crossAlign: 'near' | 'center' | 'far'; + + /** + * Should the defined `min` and `max` values be presented as ticks even if they are not "nice". + * @default: true + */ + includeBounds: boolean; + + /** + * Distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). Note: this can cause labels at the edges to be cropped by the edge of the canvas + * @default 0 + */ + labelOffset: number; + + /** + * Minimum rotation for tick labels. Note: Only applicable to horizontal scales. + * @default 0 + */ + minRotation: number; + /** + * Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales. + * @default 50 + */ + maxRotation: number; + /** + * Flips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales. + * @default false + */ + mirror: boolean; + /** + * Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction. + * @default 0 + */ + padding: number; + /** + * Maximum number of ticks and gridlines to show. + * @default 11 + */ + maxTicksLimit: number; +} + +export interface ScriptableCartesianScaleContext { + scale: keyof CartesianScaleTypeRegistry; + type: string; +} + +export interface ScriptableChartContext { + chart: Chart; + type: string; +} + +export interface CartesianScaleOptions extends CoreScaleOptions { + /** + * Scale boundary strategy (bypassed by min/max time options) + * - `data`: make sure data are fully visible, ticks outside are removed + * - `ticks`: make sure ticks are fully visible, data outside are truncated + * @since 2.7.0 + * @default 'ticks' + */ + bounds: 'ticks' | 'data'; + + /** + * Position of the axis. + */ + position: 'left' | 'top' | 'right' | 'bottom' | 'center' | { [scale: string]: number }; + + /** + * Stack group. Axes at the same `position` with same `stack` are stacked. + */ + stack?: string; + + /** + * Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group. + * @default 1 + */ + stackWeight?: number; + + /** + * Which type of axis this is. Possible values are: 'x', 'y', 'r'. If not set, this is inferred from the first character of the ID which should be 'x', 'y' or 'r'. + */ + axis: 'x' | 'y' | 'r'; + + /** + * User defined minimum value for the scale, overrides minimum value from data. + */ + min: number; + + /** + * User defined maximum value for the scale, overrides maximum value from data. + */ + max: number; + + /** + * If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default. + * @default false + */ + offset: boolean; + + grid: Partial<GridLineOptions>; + + border: BorderOptions; + + /** Options for the scale title. */ + title: { + /** If true, displays the axis title. */ + display: boolean; + /** Alignment of the axis title. */ + align: Align; + /** The text for the title, e.g. "# of People" or "Response Choices". */ + text: string | string[]; + /** Color of the axis label. */ + color: Color; + /** Information about the axis title font. */ + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableCartesianScaleContext>; + /** Padding to apply around scale labels. */ + padding: number | { + /** Padding on the (relative) top side of this axis label. */ + top: number; + /** Padding on the (relative) bottom side of this axis label. */ + bottom: number; + /** This is a shorthand for defining top/bottom to the same values. */ + y: number; + }; + }; + + /** + * If true, data will be comprised between datasets of data + * @default false + */ + stacked?: boolean | 'single'; + + ticks: CartesianTickOptions; +} + +export type CategoryScaleOptions = Omit<CartesianScaleOptions, 'min' | 'max'> & { + min: string | number; + max: string | number; + labels: string[] | string[][]; +}; + +export type CategoryScale<O extends CategoryScaleOptions = CategoryScaleOptions> = Scale<O> +export declare const CategoryScale: ChartComponent & { + prototype: CategoryScale; + new <O extends CategoryScaleOptions = CategoryScaleOptions>(cfg: AnyObject): CategoryScale<O>; +}; + +export type LinearScaleOptions = CartesianScaleOptions & { + + /** + * if true, scale will include 0 if it is not already included. + * @default true + */ + beginAtZero: boolean; + /** + * Adjustment used when calculating the minimum data value. + */ + suggestedMin?: number; + /** + * Adjustment used when calculating the maximum data value. + */ + suggestedMax?: number; + /** + * Percentage (string ending with %) or amount (number) for added room in the scale range above and below data. + */ + grace?: string | number; + + ticks: { + /** + * The Intl.NumberFormat options used by the default label formatter + */ + format: Intl.NumberFormatOptions; + + /** + * if defined and stepSize is not specified, the step size will be rounded to this many decimal places. + */ + precision: number; + + /** + * User defined fixed step size for the scale + */ + stepSize: number; + + /** + * User defined count of ticks + */ + count: number; + }; +}; + +export type LinearScale<O extends LinearScaleOptions = LinearScaleOptions> = Scale<O> +export declare const LinearScale: ChartComponent & { + prototype: LinearScale; + new <O extends LinearScaleOptions = LinearScaleOptions>(cfg: AnyObject): LinearScale<O>; +}; + +export type LogarithmicScaleOptions = CartesianScaleOptions & { + /** + * Adjustment used when calculating the maximum data value. + */ + suggestedMin?: number; + /** + * Adjustment used when calculating the minimum data value. + */ + suggestedMax?: number; + + ticks: { + /** + * The Intl.NumberFormat options used by the default label formatter + */ + format: Intl.NumberFormatOptions; + }; +}; + +export type LogarithmicScale<O extends LogarithmicScaleOptions = LogarithmicScaleOptions> = Scale<O> +export declare const LogarithmicScale: ChartComponent & { + prototype: LogarithmicScale; + new <O extends LogarithmicScaleOptions = LogarithmicScaleOptions>(cfg: AnyObject): LogarithmicScale<O>; +}; + +export type TimeScaleTimeOptions = { + /** + * Custom parser for dates. + */ + parser: string | ((v: unknown) => number); + /** + * If defined, dates will be rounded to the start of this unit. See Time Units below for the allowed units. + */ + round: false | TimeUnit; + /** + * If boolean and true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday. + * If `number`, the index of the first day of the week (0 - Sunday, 6 - Saturday). + * @default false + */ + isoWeekday: boolean | number; + /** + * Sets how different time units are displayed. + */ + displayFormats: { + [key: string]: string; + }; + /** + * The format string to use for the tooltip. + */ + tooltipFormat: string; + /** + * If defined, will force the unit to be a certain type. See Time Units section below for details. + * @default false + */ + unit: false | TimeUnit; + /** + * The minimum display format to be used for a time unit. + * @default 'millisecond' + */ + minUnit: TimeUnit; +}; + +export type TimeScaleTickOptions = { + /** + * Ticks generation input values: + * - 'auto': generates "optimal" ticks based on scale size and time options. + * - 'data': generates ticks from data (including labels from data `{t|x|y}` objects). + * - 'labels': generates ticks from user given `data.labels` values ONLY. + * @see https://github.com/chartjs/Chart.js/pull/4507 + * @since 2.7.0 + * @default 'auto' + */ + source: 'labels' | 'auto' | 'data'; + /** + * The number of units between grid lines. + * @default 1 + */ + stepSize: number; +}; + +export type TimeScaleOptions = Omit<CartesianScaleOptions, 'min' | 'max'> & { + min: string | number; + max: string | number; + suggestedMin: string | number; + suggestedMax: string | number; + /** + * Scale boundary strategy (bypassed by min/max time options) + * - `data`: make sure data are fully visible, ticks outside are removed + * - `ticks`: make sure ticks are fully visible, data outside are truncated + * @since 2.7.0 + * @default 'data' + */ + bounds: 'ticks' | 'data'; + + /** + * If true, bar chart offsets are computed with skipped tick sizes + * @since 3.8.0 + * @default false + */ + offsetAfterAutoskip: boolean; + + /** + * options for creating a new adapter instance + */ + adapters: { + date: unknown; + }; + + time: TimeScaleTimeOptions; + + ticks: TimeScaleTickOptions; +}; + +export interface TimeScale<O extends TimeScaleOptions = TimeScaleOptions> extends Scale<O> { + format(value: number, format?: string): string; + getDataTimestamps(): number[]; + getLabelTimestamps(): string[]; + normalize(values: number[]): number[]; +} + +export declare const TimeScale: ChartComponent & { + prototype: TimeScale; + new <O extends TimeScaleOptions = TimeScaleOptions>(cfg: AnyObject): TimeScale<O>; +}; + +export type TimeSeriesScale<O extends TimeScaleOptions = TimeScaleOptions> = TimeScale<O> +export declare const TimeSeriesScale: ChartComponent & { + prototype: TimeSeriesScale; + new <O extends TimeScaleOptions = TimeScaleOptions>(cfg: AnyObject): TimeSeriesScale<O>; +}; + +export type RadialTickOptions = TickOptions & { + /** + * The Intl.NumberFormat options used by the default label formatter + */ + format: Intl.NumberFormatOptions; + + /** + * Maximum number of ticks and gridlines to show. + * @default 11 + */ + maxTicksLimit: number; + + /** + * if defined and stepSize is not specified, the step size will be rounded to this many decimal places. + */ + precision: number; + + /** + * User defined fixed step size for the scale. + */ + stepSize: number; + + /** + * User defined number of ticks + */ + count: number; +} + +export type RadialLinearScaleOptions = CoreScaleOptions & { + animate: boolean; + + startAngle: number; + + angleLines: { + /** + * if true, angle lines are shown. + * @default true + */ + display: boolean; + /** + * Color of angled lines. + * @default 'rgba(0, 0, 0, 0.1)' + */ + color: Scriptable<Color, ScriptableScaleContext>; + /** + * Width of angled lines. + * @default 1 + */ + lineWidth: Scriptable<number, ScriptableScaleContext>; + /** + * Length and spacing of dashes on angled lines. See MDN. + * @default [] + */ + borderDash: Scriptable<number[], ScriptableScaleContext>; + /** + * Offset for line dashes. See MDN. + * @default 0 + */ + borderDashOffset: Scriptable<number, ScriptableScaleContext>; + }; + + /** + * if true, scale will include 0 if it is not already included. + * @default false + */ + beginAtZero: boolean; + + grid: Partial<GridLineOptions>; + + /** + * User defined minimum number for the scale, overrides minimum value from data. + */ + min: number; + /** + * User defined maximum number for the scale, overrides maximum value from data. + */ + max: number; + + pointLabels: { + /** + * Background color of the point label. + * @default undefined + */ + backdropColor: Scriptable<Color, ScriptableScalePointLabelContext>; + /** + * Padding of label backdrop. + * @default 2 + */ + backdropPadding: Scriptable<number | ChartArea, ScriptableScalePointLabelContext>; + + /** + * Border radius + * @default 0 + * @since 3.8.0 + */ + borderRadius: Scriptable<number | BorderRadius, ScriptableScalePointLabelContext>; + + /** + * if true, point labels are shown. When `display: 'auto'`, the label is hidden if it overlaps with another label. + * @default true + */ + display: boolean | 'auto'; + /** + * Color of label + * @see Defaults.color + */ + color: Scriptable<Color, ScriptableScalePointLabelContext>; + /** + */ + font: ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableScalePointLabelContext>; + + /** + * Callback function to transform data labels to point labels. The default implementation simply returns the current string. + */ + callback: (label: string, index: number) => string | string[] | number | number[]; + + /** + * Padding around the pointLabels + * @default 5 + */ + padding: Scriptable<number, ScriptableScalePointLabelContext>; + + /** + * if true, point labels are centered. + * @default false + */ + centerPointLabels: boolean; + }; + + /** + * Adjustment used when calculating the maximum data value. + */ + suggestedMax: number; + /** + * Adjustment used when calculating the minimum data value. + */ + suggestedMin: number; + + ticks: RadialTickOptions; +}; + +export interface RadialLinearScale<O extends RadialLinearScaleOptions = RadialLinearScaleOptions> extends Scale<O> { + xCenter: number; + yCenter: number; + setCenterPoint(leftMovement: number, rightMovement: number, topMovement: number, bottomMovement: number): void; + getIndexAngle(index: number): number; + getDistanceFromCenterForValue(value: number): number; + getValueForDistanceFromCenter(distance: number): number; + getPointPosition(index: number, distanceFromCenter: number): { x: number; y: number; angle: number }; + getPointPositionForValue(index: number, value: number): { x: number; y: number; angle: number }; + getPointLabelPosition(index: number): ChartArea; + getBasePosition(index: number): { x: number; y: number; angle: number }; +} +export declare const RadialLinearScale: ChartComponent & { + prototype: RadialLinearScale; + new <O extends RadialLinearScaleOptions = RadialLinearScaleOptions>(cfg: AnyObject): RadialLinearScale<O>; +}; + +export interface CartesianScaleTypeRegistry { + linear: { + options: LinearScaleOptions; + }; + logarithmic: { + options: LogarithmicScaleOptions; + }; + category: { + options: CategoryScaleOptions; + }; + time: { + options: TimeScaleOptions; + }; + timeseries: { + options: TimeScaleOptions; + }; +} + +export interface RadialScaleTypeRegistry { + radialLinear: { + options: RadialLinearScaleOptions; + }; +} + +export interface ScaleTypeRegistry extends CartesianScaleTypeRegistry, RadialScaleTypeRegistry { +} + +export type ScaleType = keyof ScaleTypeRegistry; + +export interface CartesianParsedData extends Point { + // Only specified when stacked bars are enabled + _stacks?: { + // Key is the stack ID which is generally the axis ID + [key: string]: { + // Inner key is the datasetIndex + [key: number]: number; + } + } +} + +interface BarParsedData extends CartesianParsedData { + // Only specified if floating bars are show + _custom?: { + barStart: number; + barEnd: number; + start: number; + end: number; + min: number; + max: number; + } +} + +interface BubbleParsedData extends CartesianParsedData { + // The bubble radius value + _custom: number; +} + +interface RadialParsedData { + r: number; +} + +export interface ChartTypeRegistry { + bar: { + chartOptions: BarControllerChartOptions; + datasetOptions: BarControllerDatasetOptions; + defaultDataPoint: number | [number, number] | null; + metaExtensions: {}; + parsedDataType: BarParsedData, + scales: keyof CartesianScaleTypeRegistry; + }; + line: { + chartOptions: LineControllerChartOptions; + datasetOptions: LineControllerDatasetOptions & FillerControllerDatasetOptions; + defaultDataPoint: ScatterDataPoint | number | null; + metaExtensions: {}; + parsedDataType: CartesianParsedData; + scales: keyof CartesianScaleTypeRegistry; + }; + scatter: { + chartOptions: ScatterControllerChartOptions; + datasetOptions: ScatterControllerDatasetOptions; + defaultDataPoint: ScatterDataPoint | number | null; + metaExtensions: {}; + parsedDataType: CartesianParsedData; + scales: keyof CartesianScaleTypeRegistry; + }; + bubble: { + chartOptions: unknown; + datasetOptions: BubbleControllerDatasetOptions; + defaultDataPoint: BubbleDataPoint; + metaExtensions: {}; + parsedDataType: BubbleParsedData; + scales: keyof CartesianScaleTypeRegistry; + }; + pie: { + chartOptions: PieControllerChartOptions; + datasetOptions: PieControllerDatasetOptions; + defaultDataPoint: PieDataPoint; + metaExtensions: PieMetaExtensions; + parsedDataType: number; + scales: keyof CartesianScaleTypeRegistry; + }; + doughnut: { + chartOptions: DoughnutControllerChartOptions; + datasetOptions: DoughnutControllerDatasetOptions; + defaultDataPoint: DoughnutDataPoint; + metaExtensions: DoughnutMetaExtensions; + parsedDataType: number; + scales: keyof CartesianScaleTypeRegistry; + }; + polarArea: { + chartOptions: PolarAreaControllerChartOptions; + datasetOptions: PolarAreaControllerDatasetOptions; + defaultDataPoint: number; + metaExtensions: {}; + parsedDataType: RadialParsedData; + scales: keyof RadialScaleTypeRegistry; + }; + radar: { + chartOptions: RadarControllerChartOptions; + datasetOptions: RadarControllerDatasetOptions & FillerControllerDatasetOptions; + defaultDataPoint: number | null; + metaExtensions: {}; + parsedDataType: RadialParsedData; + scales: keyof RadialScaleTypeRegistry; + }; +} + +export type ChartType = keyof ChartTypeRegistry; + +export type ScaleOptionsByType<TScale extends ScaleType = ScaleType> = + { [key in ScaleType]: { type: key } & ScaleTypeRegistry[key]['options'] }[TScale] +; + +// Convenience alias for creating and manipulating scale options in user code +export type ScaleOptions<TScale extends ScaleType = ScaleType> = DeepPartial<ScaleOptionsByType<TScale>>; + +export type DatasetChartOptions<TType extends ChartType = ChartType> = { + [key in TType]: { + datasets: ChartTypeRegistry[key]['datasetOptions']; + }; +}; + +export type ScaleChartOptions<TType extends ChartType = ChartType> = { + scales: { + [key: string]: ScaleOptionsByType<ChartTypeRegistry[TType]['scales']>; + }; +}; + +export type ChartOptions<TType extends ChartType = ChartType> = Exclude< +DeepPartial< +CoreChartOptions<TType> & +ElementChartOptions<TType> & +PluginChartOptions<TType> & +DatasetChartOptions<TType> & +ScaleChartOptions<TType> & +ChartTypeRegistry[TType]['chartOptions'] +>, +DeepPartial<unknown[]> +>; + +export type DefaultDataPoint<TType extends ChartType> = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>; + +export type ParsedDataType<TType extends ChartType = ChartType> = ChartTypeRegistry[TType]['parsedDataType']; + +export interface ChartDatasetProperties<TType extends ChartType, TData> { + type?: TType; + data: TData; +} + +export interface ChartDatasetPropertiesCustomTypesPerDataset<TType extends ChartType, TData> { + type: TType; + data: TData; +} + +export type ChartDataset< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType> +> = DeepPartial< +{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType] +> & ChartDatasetProperties<TType, TData>; + +export type ChartDatasetCustomTypesPerDataset< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType> +> = DeepPartial< +{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType] +> & ChartDatasetPropertiesCustomTypesPerDataset<TType, TData>; + +/** + * TData represents the data point type. If unspecified, a default is provided + * based on the chart type. + * TLabel represents the label type + */ +export interface ChartData< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType>, + TLabel = unknown +> { + labels?: TLabel[]; + xLabels?: TLabel[]; + yLabels?: TLabel[]; + datasets: ChartDataset<TType, TData>[]; +} + +export interface ChartDataCustomTypesPerDataset< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType>, + TLabel = unknown +> { + labels?: TLabel[]; + xLabels?: TLabel[]; + yLabels?: TLabel[]; + datasets: ChartDatasetCustomTypesPerDataset<TType, TData>[]; +} + +export interface ChartConfiguration< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType>, + TLabel = unknown +> { + type: TType; + data: ChartData<TType, TData, TLabel>; + options?: ChartOptions<TType> | undefined; + plugins?: Plugin<TType>[]; + platform?: typeof BasePlatform; +} + +export interface ChartConfigurationCustomTypesPerDataset< + TType extends ChartType = ChartType, + TData = DefaultDataPoint<TType>, + TLabel = unknown +> { + data: ChartDataCustomTypesPerDataset<TType, TData, TLabel>; + options?: ChartOptions<TType> | undefined; + plugins?: Plugin<TType>[]; +} diff --git a/seller_1/node_modules/chart.js/dist/types/layout.d.ts b/seller_1/node_modules/chart.js/dist/types/layout.d.ts new file mode 100644 index 0000000..39ddc13 --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/layout.d.ts @@ -0,0 +1,65 @@ +import {ChartArea} from './geometric.js'; + +export type LayoutPosition = 'left' | 'top' | 'right' | 'bottom' | 'center' | 'chartArea' | {[scaleId: string]: number}; + +export interface LayoutItem { + /** + * The position of the item in the chart layout. Possible values are + */ + position: LayoutPosition; + /** + * The weight used to sort the item. Higher weights are further away from the chart area + */ + weight: number; + /** + * if true, and the item is horizontal, then push vertical boxes down + */ + fullSize: boolean; + /** + * Width of item. Must be valid after update() + */ + width: number; + /** + * Height of item. Must be valid after update() + */ + height: number; + /** + * Left edge of the item. Set by layout system and cannot be used in update + */ + left: number; + /** + * Top edge of the item. Set by layout system and cannot be used in update + */ + top: number; + /** + * Right edge of the item. Set by layout system and cannot be used in update + */ + right: number; + /** + * Bottom edge of the item. Set by layout system and cannot be used in update + */ + bottom: number; + + /** + * Called before the layout process starts + */ + beforeLayout?(): void; + /** + * Draws the element + */ + draw(chartArea: ChartArea): void; + /** + * Returns an object with padding on the edges + */ + getPadding?(): ChartArea; + /** + * returns true if the layout item is horizontal (ie. top or bottom) + */ + isHorizontal(): boolean; + /** + * Takes two parameters: width and height. + * @param width + * @param height + */ + update(width: number, height: number, margins?: ChartArea): void; +} diff --git a/seller_1/node_modules/chart.js/dist/types/utils.d.ts b/seller_1/node_modules/chart.js/dist/types/utils.d.ts new file mode 100644 index 0000000..17b1cbd --- /dev/null +++ b/seller_1/node_modules/chart.js/dist/types/utils.d.ts @@ -0,0 +1,30 @@ +/* eslint-disable @typescript-eslint/ban-types */ + +// DeepPartial implementation taken from the utility-types NPM package, which is +// Copyright (c) 2016 Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io) +// and used under the terms of the MIT license +export type DeepPartial<T> = T extends Function + ? T + : T extends Array<infer U> + ? _DeepPartialArray<U> + : T extends object + ? _DeepPartialObject<T> + : T | undefined; + +type _DeepPartialArray<T> = Array<DeepPartial<T>> +type _DeepPartialObject<T> = { [P in keyof T]?: DeepPartial<T[P]> }; + +export type DistributiveArray<T> = [T] extends [unknown] ? Array<T> : never + +// https://stackoverflow.com/a/50375286 +export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; + +export type AllKeys<T> = T extends any ? keyof T : never; + +export type PickType<T, K extends AllKeys<T>> = T extends { [k in K]?: any } + ? T[K] + : undefined; + +export type Merge<T extends object> = { + [k in AllKeys<T>]: PickType<T, k>; +}; diff --git a/seller_1/node_modules/chart.js/helpers/helpers.cjs b/seller_1/node_modules/chart.js/helpers/helpers.cjs new file mode 100644 index 0000000..d476848 --- /dev/null +++ b/seller_1/node_modules/chart.js/helpers/helpers.cjs @@ -0,0 +1 @@ +module.exports = require('../dist/helpers.cjs'); diff --git a/seller_1/node_modules/chart.js/helpers/helpers.d.ts b/seller_1/node_modules/chart.js/helpers/helpers.d.ts new file mode 100644 index 0000000..3870461 --- /dev/null +++ b/seller_1/node_modules/chart.js/helpers/helpers.d.ts @@ -0,0 +1 @@ +export * from '../dist/helpers/index.js'; diff --git a/seller_1/node_modules/chart.js/helpers/helpers.js b/seller_1/node_modules/chart.js/helpers/helpers.js new file mode 100644 index 0000000..451fa58 --- /dev/null +++ b/seller_1/node_modules/chart.js/helpers/helpers.js @@ -0,0 +1 @@ +export * from '../dist/helpers.js'; diff --git a/seller_1/node_modules/chart.js/helpers/package.json b/seller_1/node_modules/chart.js/helpers/package.json new file mode 100644 index 0000000..b856155 --- /dev/null +++ b/seller_1/node_modules/chart.js/helpers/package.json @@ -0,0 +1,14 @@ +{ + "name": "chart.js-helpers", + "private": true, + "description": "Helpers package. Exists to support bundlers without exports support such as webpack 4.", + "type": "module", + "main": "./helpers.cjs", + "module": "./helpers.js", + "exports": { + "types": "./helpers.d.ts", + "import": "./helpers.js", + "require": "./helpers.cjs" + }, + "types": "./helpers.d.ts" +} diff --git a/seller_1/node_modules/chart.js/package.json b/seller_1/node_modules/chart.js/package.json new file mode 100644 index 0000000..fcf19e7 --- /dev/null +++ b/seller_1/node_modules/chart.js/package.json @@ -0,0 +1,138 @@ +{ + "name": "chart.js", + "homepage": "https://www.chartjs.org", + "description": "Simple HTML5 charts using the canvas element.", + "version": "4.4.7", + "license": "MIT", + "type": "module", + "sideEffects": [ + "./auto/auto.js", + "./auto/auto.cjs", + "./dist/chart.umd.js" + ], + "jsdelivr": "./dist/chart.umd.js", + "unpkg": "./dist/chart.umd.js", + "main": "./dist/chart.cjs", + "module": "./dist/chart.js", + "exports": { + ".": { + "types": "./dist/types.d.ts", + "import": "./dist/chart.js", + "require": "./dist/chart.cjs" + }, + "./auto": { + "types": "./auto/auto.d.ts", + "import": "./auto/auto.js", + "require": "./auto/auto.cjs" + }, + "./helpers": { + "types": "./helpers/helpers.d.ts", + "import": "./helpers/helpers.js", + "require": "./helpers/helpers.cjs" + } + }, + "types": "./dist/types.d.ts", + "keywords": [ + "canvas", + "charts", + "data", + "graphs", + "html5", + "responsive" + ], + "repository": { + "type": "git", + "url": "https://github.com/chartjs/Chart.js.git" + }, + "bugs": { + "url": "https://github.com/chartjs/Chart.js/issues" + }, + "files": [ + "auto/**", + "dist/**", + "!dist/docs/**", + "helpers/**" + ], + "scripts": { + "autobuild": "rollup -c -w", + "copyDeclarations": "node -e \"fs.cpSync('./src/types/', './dist/types/', {recursive:true})\"", + "emitDeclarations": "tsc --emitDeclarationOnly && pnpm copyDeclarations", + "build": "rollup -c && pnpm emitDeclarations", + "dev": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers chrome --grep", + "dev:ff": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers firefox --grep", + "docs": "pnpm run build && pnpm --filter \"./docs/**\" build", + "docs:dev": "pnpm run build && pnpm --filter \"./docs/**\" dev", + "lint-js": "eslint \"src/**/*.{js,ts}\" \"test/**/*.js\" \"docs/**/*.js\" --cache", + "lint-md": "eslint \"**/*.md\" --cache", + "lint-types": "pnpm build && node test/types/autogen.js && tsc -p test/types", + "lint": "concurrently \"pnpm:lint-*\"", + "test": "pnpm lint && pnpm test-ci", + "test-ci": "concurrently \"pnpm:test-ci-*\"", + "test-ci-karma": "cross-env NODE_ENV=test karma start ./karma.conf.cjs --auto-watch --single-run --coverage --grep", + "test-ci-integration": "pnpm --filter \"./test/integration/**\" test" + }, + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-inject": "^5.0.2", + "@rollup/plugin-json": "^5.0.1", + "@rollup/plugin-node-resolve": "^15.0.1", + "@swc/core": "^1.3.18", + "@types/estree": "^1.0.0", + "@types/offscreencanvas": "^2019.7.0", + "@typescript-eslint/eslint-plugin": "^5.32.0", + "@typescript-eslint/parser": "^5.32.0", + "chartjs-adapter-luxon": "^1.2.0", + "chartjs-adapter-moment": "^1.0.0", + "chartjs-test-utils": "^0.4.0", + "concurrently": "^7.3.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "eslint": "^8.21.0", + "eslint-config-chartjs": "^0.3.0", + "eslint-plugin-es": "^4.1.0", + "eslint-plugin-html": "^7.1.0", + "eslint-plugin-markdown": "^3.0.0", + "esm": "^3.2.25", + "glob": "^8.0.3", + "jasmine": "^3.7.0", + "jasmine-core": "^3.7.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-coverage": "^2.0.3", + "karma-edge-launcher": "^0.4.2", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^4.0.1", + "karma-jasmine-html-reporter": "^1.5.4", + "karma-rollup-preprocessor": "7.0.7", + "karma-safari-private-launcher": "^1.0.0", + "karma-spec-reporter": "0.0.32", + "luxon": "^3.0.1", + "moment": "^2.29.4", + "moment-timezone": "^0.5.34", + "pixelmatch": "^5.3.0", + "rollup": "^3.3.0", + "rollup-plugin-cleanup": "^3.2.1", + "rollup-plugin-istanbul": "^4.0.0", + "rollup-plugin-swc3": "^0.7.0", + "rollup-plugin-terser": "^7.0.2", + "typescript": "^4.7.4", + "yargs": "^17.5.1" + }, + "engines": { + "pnpm": ">=8" + }, + "packageManager": "pnpm@8.13.0", + "pnpm": { + "overrides": { + "html-entities": "1.4.0" + }, + "peerDependencyRules": { + "ignoreMissing": [ + "chart.js" + ] + } + } +} diff --git a/seller_1/node_modules/csstype/LICENSE b/seller_1/node_modules/csstype/LICENSE new file mode 100644 index 0000000..ac06f62 --- /dev/null +++ b/seller_1/node_modules/csstype/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017-2018 Fredrik Nicol + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/seller_1/node_modules/csstype/README.md b/seller_1/node_modules/csstype/README.md new file mode 100644 index 0000000..75947e1 --- /dev/null +++ b/seller_1/node_modules/csstype/README.md @@ -0,0 +1,277 @@ +# CSSType + +[![npm](https://img.shields.io/npm/v/csstype.svg)](https://www.npmjs.com/package/csstype) + +TypeScript and Flow definitions for CSS, generated by [data from MDN](https://github.com/mdn/data). It provides autocompletion and type checking for CSS properties and values. + +**TypeScript** + +```ts +import type * as CSS from 'csstype'; + +const style: CSS.Properties = { + colour: 'white', // Type error on property + textAlign: 'middle', // Type error on value +}; +``` + +**Flow** + +```js +// @flow strict +import * as CSS from 'csstype'; + +const style: CSS.Properties<> = { + colour: 'white', // Type error on property + textAlign: 'middle', // Type error on value +}; +``` + +_Further examples below will be in TypeScript!_ + +## Getting started + +```sh +$ npm install csstype +``` + +## Table of content + +- [Style types](#style-types) +- [At-rule types](#at-rule-types) +- [Pseudo types](#pseudo-types) +- [Generics](#generics) +- [Usage](#usage) +- [What should I do when I get type errors?](#what-should-i-do-when-i-get-type-errors) +- [Version 3.0](#version-30) +- [Contributing](#contributing) + +## Style types + +Properties are categorized in different uses and in several technical variations to provide typings that suits as many as possible. + +| | Default | `Hyphen` | `Fallback` | `HyphenFallback` | +| -------------- | -------------------- | -------------------------- | ---------------------------- | ---------------------------------- | +| **All** | `Properties` | `PropertiesHyphen` | `PropertiesFallback` | `PropertiesHyphenFallback` | +| **`Standard`** | `StandardProperties` | `StandardPropertiesHyphen` | `StandardPropertiesFallback` | `StandardPropertiesHyphenFallback` | +| **`Vendor`** | `VendorProperties` | `VendorPropertiesHyphen` | `VendorPropertiesFallback` | `VendorPropertiesHyphenFallback` | +| **`Obsolete`** | `ObsoleteProperties` | `ObsoletePropertiesHyphen` | `ObsoletePropertiesFallback` | `ObsoletePropertiesHyphenFallback` | +| **`Svg`** | `SvgProperties` | `SvgPropertiesHyphen` | `SvgPropertiesFallback` | `SvgPropertiesHyphenFallback` | + +Categories: + +- **All** - Includes `Standard`, `Vendor`, `Obsolete` and `Svg` +- **`Standard`** - Current properties and extends subcategories `StandardLonghand` and `StandardShorthand` _(e.g. `StandardShorthandProperties`)_ +- **`Vendor`** - Vendor prefixed properties and extends subcategories `VendorLonghand` and `VendorShorthand` _(e.g. `VendorShorthandProperties`)_ +- **`Obsolete`** - Removed or deprecated properties +- **`Svg`** - SVG-specific properties + +Variations: + +- **Default** - JavaScript (camel) cased property names +- **`Hyphen`** - CSS (kebab) cased property names +- **`Fallback`** - Also accepts array of values e.g. `string | string[]` + +## At-rule types + +At-rule interfaces with descriptors. + +**TypeScript**: These will be found in the `AtRule` namespace, e.g. `AtRule.Viewport`. +**Flow**: These will be prefixed with `AtRule$`, e.g. `AtRule$Viewport`. + +| | Default | `Hyphen` | `Fallback` | `HyphenFallback` | +| -------------------- | -------------- | -------------------- | ---------------------- | ---------------------------- | +| **`@counter-style`** | `CounterStyle` | `CounterStyleHyphen` | `CounterStyleFallback` | `CounterStyleHyphenFallback` | +| **`@font-face`** | `FontFace` | `FontFaceHyphen` | `FontFaceFallback` | `FontFaceHyphenFallback` | +| **`@viewport`** | `Viewport` | `ViewportHyphen` | `ViewportFallback` | `ViewportHyphenFallback` | + +## Pseudo types + +String literals of pseudo classes and pseudo elements + +- `Pseudos` + + Extends: + + - `AdvancedPseudos` + + Function-like pseudos e.g. `:not(:first-child)`. The string literal contains the value excluding the parenthesis: `:not`. These are separated because they require an argument that results in infinite number of variations. + + - `SimplePseudos` + + Plain pseudos e.g. `:hover` that can only be **one** variation. + +## Generics + +All interfaces has two optional generic argument to define length and time: `CSS.Properties<TLength = string | 0, TTime = string>` + +- **Length** is the first generic parameter and defaults to `string | 0` because `0` is the only [length where the unit identifier is optional](https://drafts.csswg.org/css-values-3/#lengths). You can specify this, e.g. `string | number`, for platforms and libraries that accepts any numeric value as length with a specific unit. + ```tsx + const style: CSS.Properties<string | number> = { + width: 100, + }; + ``` +- **Time** is the second generic argument and defaults to `string`. You can specify this, e.g. `string | number`, for platforms and libraries that accepts any numeric value as length with a specific unit. + ```tsx + const style: CSS.Properties<string | number, number> = { + transitionDuration: 1000, + }; + ``` + +## Usage + +```ts +import type * as CSS from 'csstype'; + +const style: CSS.Properties = { + width: '10px', + margin: '1em', +}; +``` + +In some cases, like for CSS-in-JS libraries, an array of values is a way to provide fallback values in CSS. Using `CSS.PropertiesFallback` instead of `CSS.Properties` will add the possibility to use any property value as an array of values. + +```ts +import type * as CSS from 'csstype'; + +const style: CSS.PropertiesFallback = { + display: ['-webkit-flex', 'flex'], + color: 'white', +}; +``` + +There's even string literals for pseudo selectors and elements. + +```ts +import type * as CSS from 'csstype'; + +const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = { + ':hover': { + display: 'flex', + }, +}; +``` + +Hyphen cased (kebab cased) properties are provided in `CSS.PropertiesHyphen` and `CSS.PropertiesHyphenFallback`. It's not **not** added by default in `CSS.Properties`. To allow both of them, you can simply extend with `CSS.PropertiesHyphen` or/and `CSS.PropertiesHyphenFallback`. + +```ts +import type * as CSS from 'csstype'; + +interface Style extends CSS.Properties, CSS.PropertiesHyphen {} + +const style: Style = { + 'flex-grow': 1, + 'flex-shrink': 0, + 'font-weight': 'normal', + backgroundColor: 'white', +}; +``` + +Adding type checked CSS properties to a `HTMLElement`. + +```ts +import type * as CSS from 'csstype'; + +const style: CSS.Properties = { + color: 'red', + margin: '1em', +}; + +let button = document.createElement('button'); + +Object.assign(button.style, style); +``` + +## What should I do when I get type errors? + +The goal is to have as perfect types as possible and we're trying to do our best. But with CSS Custom Properties, the CSS specification changing frequently and vendors implementing their own specifications with new releases sometimes causes type errors even if it should work. Here's some steps you could take to get it fixed: + +_If you're using CSS Custom Properties you can step directly to step 3._ + +1. **First of all, make sure you're doing it right.** A type error could also indicate that you're not :wink: + + - Some CSS specs that some vendors has implemented could have been officially rejected or haven't yet received any official acceptance and are therefor not included + - If you're using TypeScript, [type widening](https://blog.mariusschulz.com/2017/02/04/TypeScript-2-1-literal-type-widening) could be the reason you get `Type 'string' is not assignable to...` errors + +2. **Have a look in [issues](https://github.com/frenic/csstype/issues) to see if an issue already has been filed. If not, create a new one.** To help us out, please refer to any information you have found. +3. Fix the issue locally with **TypeScript** (Flow further down): + + - The recommended way is to use **module augmentation**. Here's a few examples: + + ```ts + // My css.d.ts file + import type * as CSS from 'csstype'; + + declare module 'csstype' { + interface Properties { + // Add a missing property + WebkitRocketLauncher?: string; + + // Add a CSS Custom Property + '--theme-color'?: 'black' | 'white'; + + // Allow namespaced CSS Custom Properties + [index: `--theme-${string}`]: any; + + // Allow any CSS Custom Properties + [index: `--${string}`]: any; + + // ...or allow any other property + [index: string]: any; + } + } + ``` + + - The alternative way is to use **type assertion**. Here's a few examples: + + ```ts + const style: CSS.Properties = { + // Add a missing property + ['WebkitRocketLauncher' as any]: 'launching', + + // Add a CSS Custom Property + ['--theme-color' as any]: 'black', + }; + ``` + + Fix the issue locally with **Flow**: + + - Use **type assertion**. Here's a few examples: + + ```js + const style: $Exact<CSS.Properties<*>> = { + // Add a missing property + [('WebkitRocketLauncher': any)]: 'launching', + + // Add a CSS Custom Property + [('--theme-color': any)]: 'black', + }; + ``` + +## Version 3.0 + +- **All property types are exposed with namespace** + TypeScript: `Property.AlignContent` (was `AlignContentProperty` before) + Flow: `Property$AlignContent` +- **All at-rules are exposed with namespace** + TypeScript: `AtRule.FontFace` (was `FontFace` before) + Flow: `AtRule$FontFace` +- **Data types are NOT exposed** + E.g. `Color` and `Box`. Because the generation of data types may suddenly be removed or renamed. +- **TypeScript hack for autocompletion** + Uses `(string & {})` for literal string unions and `(number & {})` for literal number unions ([related issue](https://github.com/microsoft/TypeScript/issues/29729)). Utilize `PropertyValue<T>` to unpack types from e.g. `(string & {})` to `string`. +- **New generic for time** + Read more on the ["Generics"](#generics) section. +- **Flow types improvements** + Flow Strict enabled and exact types are used. + +## Contributing + +**Never modify `index.d.ts` and `index.js.flow` directly. They are generated automatically and committed so that we can easily follow any change it results in.** Therefor it's important that you run `$ git config merge.ours.driver true` after you've forked and cloned. That setting prevents merge conflicts when doing rebase. + +### Commands + +- `npm run build` Generates typings and type checks them +- `npm run watch` Runs build on each save +- `npm run test` Runs the tests +- `npm run lazy` Type checks, lints and formats everything diff --git a/seller_1/node_modules/csstype/index.d.ts b/seller_1/node_modules/csstype/index.d.ts new file mode 100644 index 0000000..b466d21 --- /dev/null +++ b/seller_1/node_modules/csstype/index.d.ts @@ -0,0 +1,21297 @@ +export {}; + +export type PropertyValue<TValue> = TValue extends Array<infer AValue> + ? Array<AValue extends infer TUnpacked & {} ? TUnpacked : AValue> + : TValue extends infer TUnpacked & {} + ? TUnpacked + : TValue; + +export type Fallback<T> = { [P in keyof T]: T[P] | readonly NonNullable<T[P]>[] }; + +export interface StandardLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`accent-color`** CSS property sets the accent color for user-interface controls generated by some elements. + * + * **Syntax**: `auto | <color>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **93** | **92** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/accent-color + */ + accentColor?: Property.AccentColor | undefined; + /** + * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. + * + * **Syntax**: `normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-content + */ + alignContent?: Property.AlignContent | undefined; + /** + * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. + * + * **Syntax**: `normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-items + */ + alignItems?: Property.AlignItems | undefined; + /** + * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **10** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-self + */ + alignSelf?: Property.AlignSelf | undefined; + /** + * The **`align-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their block axis. + * + * **Syntax**: `[ normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position> ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-tracks + */ + alignTracks?: Property.AlignTracks | undefined; + /** + * The **`animation-composition`** CSS property specifies the composite operation to use when multiple animations affect the same property simultaneously. + * + * **Syntax**: `<single-animation-composition>#` + * + * **Initial value**: `replace` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **112** | **115** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-composition + */ + animationComposition?: Property.AnimationComposition | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-delay + */ + animationDelay?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-direction + */ + animationDirection?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-duration + */ + animationDuration?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 5 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode + */ + animationFillMode?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count + */ + animationIterationCount?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-name + */ + animationName?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-play-state + */ + animationPlayState?: Property.AnimationPlayState | undefined; + /** + * The **`animation-range-end`** CSS property is used to set the end of an animation's attachment range along its timeline, i.e. where along the timeline an animation will end. + * + * **Syntax**: `[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range-end + */ + animationRangeEnd?: Property.AnimationRangeEnd<TLength> | undefined; + /** + * The **`animation-range-start`** CSS property is used to set the start of an animation's attachment range along its timeline, i.e. where along the timeline an animation will start. + * + * **Syntax**: `[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range-start + */ + animationRangeStart?: Property.AnimationRangeStart<TLength> | undefined; + /** + * The **`animation-timeline`** CSS property specifies the timeline that is used to control the progress of an animation. + * + * **Syntax**: `<single-animation-timeline>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-timeline + */ + animationTimeline?: Property.AnimationTimeline | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-timing-function + */ + animationTimingFunction?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | auto | textfield | menulist-button | <compat-auto>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :------: | :-: | + * | **84** | **80** | **15.4** | **84** | No | + * | 1 _-x-_ | 1 _-x-_ | 3 _-x-_ | 12 _-x-_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/appearance + */ + appearance?: Property.Appearance | undefined; + /** + * The **`aspect-ratio`** CSS property sets a **preferred aspect ratio** for the box, which will be used in the calculation of auto sizes and some other layout functions. + * + * **Syntax**: `auto | <ratio>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **88** | **89** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/aspect-ratio + */ + aspectRatio?: Property.AspectRatio | undefined; + /** + * The **`backdrop-filter`** CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything _behind_ the element, to see the effect you must make the element or its background at least partially transparent. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------: | :----: | :-: | + * | **76** | **103** | **9** _-x-_ | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/backdrop-filter + */ + backdropFilter?: Property.BackdropFilter | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :----: | :----: | + * | **36** | **16** | **15.4** | **12** | **10** | + * | 12 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/backface-visibility + */ + backfaceVisibility?: Property.BackfaceVisibility | undefined; + /** + * The **`background-attachment`** CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block. + * + * **Syntax**: `<attachment>#` + * + * **Initial value**: `scroll` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-attachment + */ + backgroundAttachment?: Property.BackgroundAttachment | undefined; + /** + * The **`background-blend-mode`** CSS property sets how an element's background images should blend with each other and with the element's background color. + * + * **Syntax**: `<blend-mode>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **35** | **30** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-blend-mode + */ + backgroundBlendMode?: Property.BackgroundBlendMode | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **4** | **5** | **12** | **9** | + * | | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-clip + */ + backgroundClip?: Property.BackgroundClip | undefined; + /** + * The **`background-color`** CSS property sets the background color of an element. + * + * **Syntax**: `<color>` + * + * **Initial value**: `transparent` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-color + */ + backgroundColor?: Property.BackgroundColor | undefined; + /** + * The **`background-image`** CSS property sets one or more background images on an element. + * + * **Syntax**: `<bg-image>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-image + */ + backgroundImage?: Property.BackgroundImage | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **4** | **3** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-origin + */ + backgroundOrigin?: Property.BackgroundOrigin | undefined; + /** + * The **`background-position-x`** CSS property sets the initial horizontal position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `[ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#` + * + * **Initial value**: `0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **49** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position-x + */ + backgroundPositionX?: Property.BackgroundPositionX<TLength> | undefined; + /** + * The **`background-position-y`** CSS property sets the initial vertical position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `[ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#` + * + * **Initial value**: `0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **49** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position-y + */ + backgroundPositionY?: Property.BackgroundPositionY<TLength> | undefined; + /** + * The **`background-repeat`** CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-repeat + */ + backgroundRepeat?: Property.BackgroundRepeat | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **3** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-size + */ + backgroundSize?: Property.BackgroundSize<TLength> | undefined; + /** + * **Syntax**: `clip | ellipsis | <string>` + * + * **Initial value**: `clip` + */ + blockOverflow?: Property.BlockOverflow | undefined; + /** + * The **`block-size`** CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `width` or the `height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/block-size + */ + blockSize?: Property.BlockSize<TLength> | undefined; + /** + * The **`border-block-color`** CSS property defines the color of the logical block borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>{1,2}` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-color + */ + borderBlockColor?: Property.BorderBlockColor | undefined; + /** + * The **`border-block-end-color`** CSS property defines the color of the logical block-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-color + */ + borderBlockEndColor?: Property.BorderBlockEndColor | undefined; + /** + * The **`border-block-end-style`** CSS property defines the style of the logical block-end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-style + */ + borderBlockEndStyle?: Property.BorderBlockEndStyle | undefined; + /** + * The **`border-block-end-width`** CSS property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-width + */ + borderBlockEndWidth?: Property.BorderBlockEndWidth<TLength> | undefined; + /** + * The **`border-block-start-color`** CSS property defines the color of the logical block-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-color + */ + borderBlockStartColor?: Property.BorderBlockStartColor | undefined; + /** + * The **`border-block-start-style`** CSS property defines the style of the logical block start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-style + */ + borderBlockStartStyle?: Property.BorderBlockStartStyle | undefined; + /** + * The **`border-block-start-width`** CSS property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-width + */ + borderBlockStartWidth?: Property.BorderBlockStartWidth<TLength> | undefined; + /** + * The **`border-block-style`** CSS property defines the style of the logical block borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-style + */ + borderBlockStyle?: Property.BorderBlockStyle | undefined; + /** + * The **`border-block-width`** CSS property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-width + */ + borderBlockWidth?: Property.BorderBlockWidth<TLength> | undefined; + /** + * The **`border-bottom-color`** CSS property sets the color of an element's bottom border. It can also be set with the shorthand CSS properties `border-color` or `border-bottom`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-color + */ + borderBottomColor?: Property.BorderBottomColor | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius + */ + borderBottomLeftRadius?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius + */ + borderBottomRightRadius?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-bottom-style`** CSS property sets the line style of an element's bottom `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-style + */ + borderBottomStyle?: Property.BorderBottomStyle | undefined; + /** + * The **`border-bottom-width`** CSS property sets the width of the bottom border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-width + */ + borderBottomWidth?: Property.BorderBottomWidth<TLength> | undefined; + /** + * The **`border-collapse`** CSS property sets whether cells inside a `<table>` have shared or separate borders. + * + * **Syntax**: `collapse | separate` + * + * **Initial value**: `separate` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-collapse + */ + borderCollapse?: Property.BorderCollapse | undefined; + /** + * The **`border-end-end-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius + */ + borderEndEndRadius?: Property.BorderEndEndRadius<TLength> | undefined; + /** + * The **`border-end-start-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius + */ + borderEndStartRadius?: Property.BorderEndStartRadius<TLength> | undefined; + /** + * The **`border-image-outset`** CSS property sets the distance by which an element's border image is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-outset + */ + borderImageOutset?: Property.BorderImageOutset<TLength> | undefined; + /** + * The **`border-image-repeat`** CSS property defines how the edge regions and middle region of a source image are adjusted to fit the dimensions of an element's border image. The middle region can be displayed by using the keyword "fill" in the border-image-slice property. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-repeat + */ + borderImageRepeat?: Property.BorderImageRepeat | undefined; + /** + * The **`border-image-slice`** CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image. + * + * **Syntax**: `<number-percentage>{1,4} && fill?` + * + * **Initial value**: `100%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-slice + */ + borderImageSlice?: Property.BorderImageSlice | undefined; + /** + * The **`border-image-source`** CSS property sets the source image used to create an element's border image. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-source + */ + borderImageSource?: Property.BorderImageSource | undefined; + /** + * The **`border-image-width`** CSS property sets the width of an element's border image. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **13** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-width + */ + borderImageWidth?: Property.BorderImageWidth<TLength> | undefined; + /** + * The **`border-inline-color`** CSS property defines the color of the logical inline borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>{1,2}` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-color + */ + borderInlineColor?: Property.BorderInlineColor | undefined; + /** + * The **`border-inline-end-color`** CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-color)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color + */ + borderInlineEndColor?: Property.BorderInlineEndColor | undefined; + /** + * The **`border-inline-end-style`** CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-style)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style + */ + borderInlineEndStyle?: Property.BorderInlineEndStyle | undefined; + /** + * The **`border-inline-end-width`** CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-width)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width + */ + borderInlineEndWidth?: Property.BorderInlineEndWidth<TLength> | undefined; + /** + * The **`border-inline-start-color`** CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-start-color)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color + */ + borderInlineStartColor?: Property.BorderInlineStartColor | undefined; + /** + * The **`border-inline-start-style`** CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-start-style)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style + */ + borderInlineStartStyle?: Property.BorderInlineStartStyle | undefined; + /** + * The **`border-inline-start-width`** CSS property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width + */ + borderInlineStartWidth?: Property.BorderInlineStartWidth<TLength> | undefined; + /** + * The **`border-inline-style`** CSS property defines the style of the logical inline borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-style + */ + borderInlineStyle?: Property.BorderInlineStyle | undefined; + /** + * The **`border-inline-width`** CSS property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-width + */ + borderInlineWidth?: Property.BorderInlineWidth<TLength> | undefined; + /** + * The **`border-left-color`** CSS property sets the color of an element's left border. It can also be set with the shorthand CSS properties `border-color` or `border-left`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-color + */ + borderLeftColor?: Property.BorderLeftColor | undefined; + /** + * The **`border-left-style`** CSS property sets the line style of an element's left `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-style + */ + borderLeftStyle?: Property.BorderLeftStyle | undefined; + /** + * The **`border-left-width`** CSS property sets the width of the left border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-width + */ + borderLeftWidth?: Property.BorderLeftWidth<TLength> | undefined; + /** + * The **`border-right-color`** CSS property sets the color of an element's right border. It can also be set with the shorthand CSS properties `border-color` or `border-right`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-color + */ + borderRightColor?: Property.BorderRightColor | undefined; + /** + * The **`border-right-style`** CSS property sets the line style of an element's right `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-style + */ + borderRightStyle?: Property.BorderRightStyle | undefined; + /** + * The **`border-right-width`** CSS property sets the width of the right border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-width + */ + borderRightWidth?: Property.BorderRightWidth<TLength> | undefined; + /** + * The **`border-spacing`** CSS property sets the distance between the borders of adjacent cells in a `<table>`. This property applies only when `border-collapse` is `separate`. + * + * **Syntax**: `<length> <length>?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-spacing + */ + borderSpacing?: Property.BorderSpacing<TLength> | undefined; + /** + * The **`border-start-end-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-start-end-radius + */ + borderStartEndRadius?: Property.BorderStartEndRadius<TLength> | undefined; + /** + * The **`border-start-start-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-start-start-radius + */ + borderStartStartRadius?: Property.BorderStartStartRadius<TLength> | undefined; + /** + * The **`border-top-color`** CSS property sets the color of an element's top border. It can also be set with the shorthand CSS properties `border-color` or `border-top`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-color + */ + borderTopColor?: Property.BorderTopColor | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius + */ + borderTopLeftRadius?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius + */ + borderTopRightRadius?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`border-top-style`** CSS property sets the line style of an element's top `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-style + */ + borderTopStyle?: Property.BorderTopStyle | undefined; + /** + * The **`border-top-width`** CSS property sets the width of the top border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-width + */ + borderTopWidth?: Property.BorderTopWidth<TLength> | undefined; + /** + * The **`bottom`** CSS property participates in setting the vertical position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/bottom + */ + bottom?: Property.Bottom<TLength> | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----: | :---------: | :--: | :-: | + * | **22** _-x-_ | **32** | **7** _-x-_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-decoration-break + */ + boxDecorationBreak?: Property.BoxDecorationBreak | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **10** | **4** | **5.1** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-shadow + */ + boxShadow?: Property.BoxShadow | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **10** | **29** | **5.1** | **12** | **8** | + * | 1 _-x-_ | 1 _-x-_ | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-sizing + */ + boxSizing?: Property.BoxSizing | undefined; + /** + * The **`break-after`** CSS property sets how page, column, or region breaks should behave after a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-after + */ + breakAfter?: Property.BreakAfter | undefined; + /** + * The **`break-before`** CSS property sets how page, column, or region breaks should behave before a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-before + */ + breakBefore?: Property.BreakBefore | undefined; + /** + * The **`break-inside`** CSS property sets how page, column, or region breaks should behave inside a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | avoid-page | avoid-column | avoid-region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-inside + */ + breakInside?: Property.BreakInside | undefined; + /** + * The **`caption-side`** CSS property puts the content of a table's `<caption>` on the specified side. The values are relative to the `writing-mode` of the table. + * + * **Syntax**: `top | bottom | block-start | block-end | inline-start | inline-end` + * + * **Initial value**: `top` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/caption-side + */ + captionSide?: Property.CaptionSide | undefined; + /** + * The **`caret-color`** CSS property sets the color of the **insertion caret**, the visible marker where the next character typed will be inserted. This is sometimes referred to as the **text input cursor**. The caret appears in elements such as `<input>` or those with the `contenteditable` attribute. The caret is typically a thin vertical line that flashes to help make it more noticeable. By default, it is black, but its color can be altered with this property. + * + * **Syntax**: `auto | <color>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **53** | **11.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/caret-color + */ + caretColor?: Property.CaretColor | undefined; + /** + * **Syntax**: `auto | bar | block | underscore` + * + * **Initial value**: `auto` + */ + caretShape?: Property.CaretShape | undefined; + /** + * The **`clear`** CSS property sets whether an element must be moved below (cleared) floating elements that precede it. The `clear` property applies to floating and non-floating elements. + * + * **Syntax**: `none | left | right | both | inline-start | inline-end` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/clear + */ + clear?: Property.Clear | undefined; + /** + * The **`clip-path`** CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. + * + * **Syntax**: `<clip-source> | [ <basic-shape> || <geometry-box> ] | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **55** | **3.5** | **9.1** | **79** | **10** | + * | 23 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/clip-path + */ + clipPath?: Property.ClipPath | undefined; + /** + * The **`color`** CSS property sets the foreground color value of an element's text and text decorations, and sets the `currentcolor` value. `currentcolor` may be used as an indirect value on _other_ properties and is the default for other color properties, such as `border-color`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `canvastext` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/color + */ + color?: Property.Color | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----------------: | :------: | :----------: | :-: | + * | **17** _-x-_ | **97** | **15.4** | **79** _-x-_ | No | + * | | 48 _(color-adjust)_ | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/print-color-adjust + */ + colorAdjust?: Property.PrintColorAdjust | undefined; + /** + * The **`color-scheme`** CSS property allows an element to indicate which color schemes it can comfortably be rendered in. + * + * **Syntax**: `normal | [ light | dark | <custom-ident> ]+ && only?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **81** | **96** | **13** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/color-scheme + */ + colorScheme?: Property.ColorScheme | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-count + */ + columnCount?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-fill + */ + columnFill?: Property.ColumnFill | undefined; + /** + * The **`column-gap`** CSS property sets the size of the gap (gutter) between an element's columns. + * + * **Syntax**: `normal | <length-percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **1** | **1.5** | **3** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-gap + */ + columnGap?: Property.ColumnGap<TLength> | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-color + */ + columnRuleColor?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-style + */ + columnRuleStyle?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-width + */ + columnRuleWidth?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-span`** CSS property makes it possible for an element to span across all columns when its value is set to `all`. + * + * **Syntax**: `none | all` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **50** | **71** | **9** | **12** | **10** | + * | 6 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-span + */ + columnSpan?: Property.ColumnSpan | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **50** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-width + */ + columnWidth?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`contain`** CSS property indicates that an element and its contents are, as much as possible, independent from the rest of the document tree. Containment enables isolating a subsection of the DOM, providing performance benefits by limiting calculations of layout, style, paint, size, or any combination to a DOM subtree rather than the entire page. Containment can also be used to scope CSS counters and quotes. + * + * **Syntax**: `none | strict | content | [ [ size || inline-size ] || layout || style || paint ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **52** | **69** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain + */ + contain?: Property.Contain | undefined; + /** + * The **`contain-intrinsic-block-size`** CSS logical property defines the block size of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-block-size + */ + containIntrinsicBlockSize?: Property.ContainIntrinsicBlockSize<TLength> | undefined; + /** + * The **`contain-intrinsic-length`** CSS property sets the height of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-height + */ + containIntrinsicHeight?: Property.ContainIntrinsicHeight<TLength> | undefined; + /** + * The **`contain-intrinsic-inline-size`** CSS logical property defines the inline-size of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-inline-size + */ + containIntrinsicInlineSize?: Property.ContainIntrinsicInlineSize<TLength> | undefined; + /** + * The **`contain-intrinsic-width`** CSS property sets the width of an element that a browser will use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-width + */ + containIntrinsicWidth?: Property.ContainIntrinsicWidth<TLength> | undefined; + /** + * The **container-name** CSS property specifies a list of query container names used by the @container at-rule in a container query. A container query will apply styles to elements based on the size of the nearest ancestor with a containment context. When a containment context is given a name, it can be specifically targeted using the `@container` at-rule instead of the nearest ancestor with containment. + * + * **Syntax**: `none | <custom-ident>+` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container-name + */ + containerName?: Property.ContainerName | undefined; + /** + * The **container-type** CSS property is used to define the type of containment used in a container query. + * + * **Syntax**: `normal | size | inline-size` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container-type + */ + containerType?: Property.ContainerType | undefined; + /** + * The **`content`** CSS property replaces an element with a generated value. Objects inserted using the `content` property are **anonymous replaced elements**. + * + * **Syntax**: `normal | none | [ <content-replacement> | <content-list> ] [/ [ <string> | <counter> ]+ ]?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/content + */ + content?: Property.Content | undefined; + /** + * The **`content-visibility`** CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed. It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster. + * + * **Syntax**: `visible | auto | hidden` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------: | :----: | :--: | :-: | + * | **85** | **preview** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/content-visibility + */ + contentVisibility?: Property.ContentVisibility | undefined; + /** + * The **`counter-increment`** CSS property increases or decreases the value of a CSS counter by a given value. + * + * **Syntax**: `[ <counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-increment + */ + counterIncrement?: Property.CounterIncrement | undefined; + /** + * The **`counter-reset`** CSS property resets a CSS counter to a given value. This property will create a new counter or reversed counter with the given name on the specified element. + * + * **Syntax**: `[ <counter-name> <integer>? | <reversed-counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-reset + */ + counterReset?: Property.CounterReset | undefined; + /** + * The **`counter-set`** CSS property sets a CSS counter to a given value. It manipulates the value of existing counters, and will only create new counters if there isn't already a counter of the given name on the element. + * + * **Syntax**: `[ <counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **85** | **68** | **17.2** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-set + */ + counterSet?: Property.CounterSet | undefined; + /** + * The **`cursor`** CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element. + * + * **Syntax**: `[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/cursor + */ + cursor?: Property.Cursor | undefined; + /** + * The **`direction`** CSS property sets the direction of text, table columns, and horizontal overflow. Use `rtl` for languages written from right to left (like Hebrew or Arabic), and `ltr` for those written from left to right (like English and most other languages). + * + * **Syntax**: `ltr | rtl` + * + * **Initial value**: `ltr` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **2** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/direction + */ + direction?: Property.Direction | undefined; + /** + * The **`display`** CSS property sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex. + * + * **Syntax**: `[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>` + * + * **Initial value**: `inline` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/display + */ + display?: Property.Display | undefined; + /** + * The **`empty-cells`** CSS property sets whether borders and backgrounds appear around `<table>` cells that have no visible content. + * + * **Syntax**: `show | hide` + * + * **Initial value**: `show` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/empty-cells + */ + emptyCells?: Property.EmptyCells | undefined; + /** + * The **`filter`** CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :-: | + * | **53** | **35** | **9.1** | **12** | No | + * | 18 _-x-_ | | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/filter + */ + filter?: Property.Filter | undefined; + /** + * The **`flex-basis`** CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with `box-sizing`. + * + * **Syntax**: `content | <'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **22** | **9** | **12** | **11** | + * | 22 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-basis + */ + flexBasis?: Property.FlexBasis<TLength> | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :------: | :-----: | :----: | :------: | + * | **29** | **81** | **9** | **12** | **11** | + * | 21 _-x-_ | 49 _-x-_ | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-direction + */ + flexDirection?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----------------------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 22 _-x-_ | | 7 _-x-_ | | 10 _(-ms-flex-positive)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-grow + */ + flexGrow?: Property.FlexGrow | undefined; + /** + * The **`flex-shrink`** CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to `flex-shrink`. + * + * **Syntax**: `<number>` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **10** | + * | 22 _-x-_ | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-shrink + */ + flexShrink?: Property.FlexShrink | undefined; + /** + * The **`flex-wrap`** CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. + * + * **Syntax**: `nowrap | wrap | wrap-reverse` + * + * **Initial value**: `nowrap` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-wrap + */ + flexWrap?: Property.FlexWrap | undefined; + /** + * The **`float`** CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning). + * + * **Syntax**: `left | right | none | inline-start | inline-end` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/float + */ + float?: Property.Float | undefined; + /** + * The **`font-family`** CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected element. + * + * **Syntax**: `[ <family-name> | <generic-family> ]#` + * + * **Initial value**: depends on user agent + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-family + */ + fontFamily?: Property.FontFamily | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :------: | :-----: | :----: | :----: | + * | **48** | **34** | **9.1** | **15** | **10** | + * | 16 _-x-_ | 15 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-feature-settings + */ + fontFeatureSettings?: Property.FontFeatureSettings | undefined; + /** + * The **`font-kerning`** CSS property sets the use of the kerning information stored in a font. + * + * **Syntax**: `auto | normal | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **33** | **32** | **9** | n/a | No | + * | | | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-kerning + */ + fontKerning?: Property.FontKerning | undefined; + /** + * The **`font-language-override`** CSS property controls the use of language-specific glyphs in a typeface. + * + * **Syntax**: `normal | <string>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **34** | No | n/a | No | + * | | 4 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-language-override + */ + fontLanguageOverride?: Property.FontLanguageOverride | undefined; + /** + * The **`font-optical-sizing`** CSS property sets whether text rendering is optimized for viewing at different sizes. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **79** | **62** | **11** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-optical-sizing + */ + fontOpticalSizing?: Property.FontOpticalSizing | undefined; + /** + * **Syntax**: `normal | light | dark | <palette-identifier>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **101** | **107** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-palette + */ + fontPalette?: Property.FontPalette | undefined; + /** + * The **`font-size`** CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative `<length>` units, such as `em`, `ex`, and so forth. + * + * **Syntax**: `<absolute-size> | <relative-size> | <length-percentage>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-size + */ + fontSize?: Property.FontSize<TLength> | undefined; + /** + * The **`font-size-adjust`** CSS property sets the size of lower-case letters relative to the current font size (which defines the size of upper-case letters). + * + * **Syntax**: `none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | <number> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | No | **3** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-size-adjust + */ + fontSizeAdjust?: Property.FontSizeAdjust | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------: | :--------------------------------: | :------------------------------: | :--: | :-: | + * | **5** _(-webkit-font-smoothing)_ | **25** _(-moz-osx-font-smoothing)_ | **4** _(-webkit-font-smoothing)_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-smooth + */ + fontSmooth?: Property.FontSmooth<TLength> | undefined; + /** + * The **`font-stretch`** CSS property selects a normal, condensed, or expanded face from a font. + * + * **Syntax**: `<font-stretch-absolute>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **60** | **9** | **11** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-stretch + */ + fontStretch?: Property.FontStretch | undefined; + /** + * The **`font-style`** CSS property sets whether a font should be styled with a normal, italic, or oblique face from its `font-family`. + * + * **Syntax**: `normal | italic | oblique <angle>?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-style + */ + fontStyle?: Property.FontStyle | undefined; + /** + * The **`font-synthesis`** CSS property controls which missing typefaces, bold, italic, or small-caps, may be synthesized by the browser. + * + * **Syntax**: `none | [ weight || style || small-caps || position]` + * + * **Initial value**: `weight style small-caps position ` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **97** | **34** | **9** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis + */ + fontSynthesis?: Property.FontSynthesis | undefined; + /** + * The **`font-synthesis-position`** CSS property lets you specify whether or not a browser may synthesize the subscript and superscript "position" typefaces when they are missing in a font family, while using `font-variant-position` to set the positions. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **118** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-position + */ + fontSynthesisPosition?: Property.FontSynthesisPosition | undefined; + /** + * The **`font-synthesis-small-caps`** CSS property lets you specify whether or not the browser may synthesize small-caps typeface when it is missing in a font family. Small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-small-caps + */ + fontSynthesisSmallCaps?: Property.FontSynthesisSmallCaps | undefined; + /** + * The **`font-synthesis-style`** CSS property lets you specify whether or not the browser may synthesize the oblique typeface when it is missing in a font family. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-style + */ + fontSynthesisStyle?: Property.FontSynthesisStyle | undefined; + /** + * The **`font-synthesis-weight`** CSS property lets you specify whether or not the browser may synthesize the bold typeface when it is missing in a font family. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-weight + */ + fontSynthesisWeight?: Property.FontSynthesisWeight | undefined; + /** + * The **`font-variant`** CSS shorthand property allows you to set all the font variants for a font. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant + */ + fontVariant?: Property.FontVariant | undefined; + /** + * The **`font-variant-alternates`** CSS property controls the usage of alternate glyphs. These alternate glyphs may be referenced by alternative names defined in `@font-feature-values`. + * + * **Syntax**: `normal | [ stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :--: | :-: | + * | **111** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-alternates + */ + fontVariantAlternates?: Property.FontVariantAlternates | undefined; + /** + * The **`font-variant-caps`** CSS property controls the use of alternate glyphs for capital letters. + * + * **Syntax**: `normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **52** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-caps + */ + fontVariantCaps?: Property.FontVariantCaps | undefined; + /** + * The **`font-variant-east-asian`** CSS property controls the use of alternate glyphs for East Asian scripts, like Japanese and Chinese. + * + * **Syntax**: `normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **63** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-east-asian + */ + fontVariantEastAsian?: Property.FontVariantEastAsian | undefined; + /** + * **Syntax**: `normal | text | emoji | unicode` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-emoji + */ + fontVariantEmoji?: Property.FontVariantEmoji | undefined; + /** + * The **`font-variant-ligatures`** CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :--: | :-: | + * | **34** | **34** | **9.1** | n/a | No | + * | 31 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-ligatures + */ + fontVariantLigatures?: Property.FontVariantLigatures | undefined; + /** + * The **`font-variant-numeric`** CSS property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers. + * + * **Syntax**: `normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **52** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-numeric + */ + fontVariantNumeric?: Property.FontVariantNumeric | undefined; + /** + * The **`font-variant-position`** CSS property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript. + * + * **Syntax**: `normal | sub | super` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :--: | :-: | + * | **117** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-position + */ + fontVariantPosition?: Property.FontVariantPosition | undefined; + /** + * The **`font-variation-settings`** CSS property provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values. + * + * **Syntax**: `normal | [ <string> <number> ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **62** | **62** | **11** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variation-settings + */ + fontVariationSettings?: Property.FontVariationSettings | undefined; + /** + * The **`font-weight`** CSS property sets the weight (or boldness) of the font. The weights available depend on the `font-family` that is currently set. + * + * **Syntax**: `<font-weight-absolute> | bolder | lighter` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-weight + */ + fontWeight?: Property.FontWeight | undefined; + /** + * The **`forced-color-adjust`** CSS property allows authors to opt certain elements out of forced colors mode. This then restores the control of those values to CSS. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :-----------------------------: | :---------------------------------: | + * | **89** | **113** | No | **79** | **10** _(-ms-high-contrast-adjust)_ | + * | | | | 12 _(-ms-high-contrast-adjust)_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/forced-color-adjust + */ + forcedColorAdjust?: Property.ForcedColorAdjust | undefined; + /** + * The **`grid-auto-columns`** CSS property specifies the size of an implicitly-created grid column track or pattern of tracks. + * + * **Syntax**: `<track-size>+` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-------------------------: | + * | **57** | **70** | **10.1** | **16** | **10** _(-ms-grid-columns)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-columns + */ + gridAutoColumns?: Property.GridAutoColumns<TLength> | undefined; + /** + * The **`grid-auto-flow`** CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. + * + * **Syntax**: `[ row | column ] || dense` + * + * **Initial value**: `row` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow + */ + gridAutoFlow?: Property.GridAutoFlow | undefined; + /** + * The **`grid-auto-rows`** CSS property specifies the size of an implicitly-created grid row track or pattern of tracks. + * + * **Syntax**: `<track-size>+` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----------------------: | + * | **57** | **70** | **10.1** | **16** | **10** _(-ms-grid-rows)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-rows + */ + gridAutoRows?: Property.GridAutoRows<TLength> | undefined; + /** + * The **`grid-column-end`** CSS property specifies a grid item's end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column-end + */ + gridColumnEnd?: Property.GridColumnEnd | undefined; + /** + * The **`grid-column-start`** CSS property specifies a grid item's start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement. This start position defines the block-start edge of the grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column-start + */ + gridColumnStart?: Property.GridColumnStart | undefined; + /** + * The **`grid-row-end`** CSS property specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row-end + */ + gridRowEnd?: Property.GridRowEnd | undefined; + /** + * The **`grid-row-start`** CSS property specifies a grid item's start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row-start + */ + gridRowStart?: Property.GridRowStart | undefined; + /** + * The **`grid-template-areas`** CSS property specifies named grid areas, establishing the cells in the grid and assigning them names. + * + * **Syntax**: `none | <string>+` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-areas + */ + gridTemplateAreas?: Property.GridTemplateAreas | undefined; + /** + * The **`grid-template-columns`** CSS property defines the line names and track sizing functions of the grid columns. + * + * **Syntax**: `none | <track-list> | <auto-track-list> | subgrid <line-name-list>?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-------------------------: | + * | **57** | **52** | **10.1** | **16** | **10** _(-ms-grid-columns)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-columns + */ + gridTemplateColumns?: Property.GridTemplateColumns<TLength> | undefined; + /** + * The **`grid-template-rows`** CSS property defines the line names and track sizing functions of the grid rows. + * + * **Syntax**: `none | <track-list> | <auto-track-list> | subgrid <line-name-list>?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----------------------: | + * | **57** | **52** | **10.1** | **16** | **10** _(-ms-grid-rows)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-rows + */ + gridTemplateRows?: Property.GridTemplateRows<TLength> | undefined; + /** + * The **`hanging-punctuation`** CSS property specifies whether a punctuation mark should hang at the start or end of a line of text. Hanging punctuation may be placed outside the line box. + * + * **Syntax**: `none | [ first || [ force-end | allow-end ] || last ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | No | **10** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hanging-punctuation + */ + hangingPunctuation?: Property.HangingPunctuation | undefined; + /** + * The **`height`** CSS property specifies the height of an element. By default, the property defines the height of the content area. If `box-sizing` is set to `border-box`, however, it instead determines the height of the border area. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/height + */ + height?: Property.Height<TLength> | undefined; + /** + * The **`hyphenate-character`** CSS property sets the character (or string) used at the end of a line before a hyphenation break. + * + * **Syntax**: `auto | <string>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :--: | :-: | + * | **106** | **98** | **17** | n/a | No | + * | 6 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hyphenate-character + */ + hyphenateCharacter?: Property.HyphenateCharacter | undefined; + /** + * The **`hyphenate-limit-chars`** CSS property specifies the minimum word length to allow hyphenation of words as well as the the minimum number of characters before and after the hyphen. + * + * **Syntax**: `[ auto | <integer> ]{1,3}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | No | No | n/a | No | + */ + hyphenateLimitChars?: Property.HyphenateLimitChars | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :----: | :----------: | + * | **55** | **43** | **17** | **79** | **10** _-x-_ | + * | 13 _-x-_ | 6 _-x-_ | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hyphens + */ + hyphens?: Property.Hyphens | undefined; + /** + * The **`image-orientation`** CSS property specifies a layout-independent correction to the orientation of an image. + * + * **Syntax**: `from-image | <angle> | [ <angle>? flip ]` + * + * **Initial value**: `from-image` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **81** | **26** | **13.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/image-orientation + */ + imageOrientation?: Property.ImageOrientation | undefined; + /** + * The **`image-rendering`** CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other properties, and to its descendants. + * + * **Syntax**: `auto | crisp-edges | pixelated` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **13** | **3.6** | **6** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/image-rendering + */ + imageRendering?: Property.ImageRendering | undefined; + /** + * **Syntax**: `[ from-image || <resolution> ] && snap?` + * + * **Initial value**: `1dppx` + */ + imageResolution?: Property.ImageResolution | undefined; + /** + * The `initial-letter` CSS property sets styling for dropped, raised, and sunken initial letters. + * + * **Syntax**: `normal | [ <number> <integer>? ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :--: | :-: | + * | **110** | No | **9** _-x-_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/initial-letter + */ + initialLetter?: Property.InitialLetter | undefined; + /** + * The **`inline-size`** CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `width` or the `height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inline-size + */ + inlineSize?: Property.InlineSize<TLength> | undefined; + /** + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + */ + inputSecurity?: Property.InputSecurity | undefined; + /** + * The **`inset-block-end`** CSS property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block-end + */ + insetBlockEnd?: Property.InsetBlockEnd<TLength> | undefined; + /** + * The **`inset-block-start`** CSS property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block-start + */ + insetBlockStart?: Property.InsetBlockStart<TLength> | undefined; + /** + * The **`inset-inline-end`** CSS property defines the logical inline end inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline-end + */ + insetInlineEnd?: Property.InsetInlineEnd<TLength> | undefined; + /** + * The **`inset-inline-start`** CSS property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline-start + */ + insetInlineStart?: Property.InsetInlineStart<TLength> | undefined; + /** + * The **`isolation`** CSS property determines whether an element must create a new stacking context. + * + * **Syntax**: `auto | isolate` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **41** | **36** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/isolation + */ + isolation?: Property.Isolation | undefined; + /** + * The CSS **`justify-content`** property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. + * + * **Syntax**: `normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-content + */ + justifyContent?: Property.JustifyContent | undefined; + /** + * The CSS **`justify-items`** property defines the default `justify-self` for all items of the box, giving them all a default way of justifying each box along the appropriate axis. + * + * **Syntax**: `normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]` + * + * **Initial value**: `legacy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **52** | **20** | **9** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-items + */ + justifyItems?: Property.JustifyItems | undefined; + /** + * The CSS **`justify-self`** property sets the way a box is justified inside its alignment container along the appropriate axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----: | + * | **57** | **45** | **10.1** | **16** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-self + */ + justifySelf?: Property.JustifySelf | undefined; + /** + * The **`justify-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their inline axis. + * + * **Syntax**: `[ normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ] ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-tracks + */ + justifyTracks?: Property.JustifyTracks | undefined; + /** + * The **`left`** CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/left + */ + left?: Property.Left<TLength> | undefined; + /** + * The **`letter-spacing`** CSS property sets the horizontal spacing behavior between text characters. This value is added to the natural spacing between characters while rendering the text. Positive values of `letter-spacing` causes characters to spread farther apart, while negative values of `letter-spacing` bring characters closer together. + * + * **Syntax**: `normal | <length>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/letter-spacing + */ + letterSpacing?: Property.LetterSpacing<TLength> | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :-----: | + * | **58** | **69** | **11** | **14** | **5.5** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-break + */ + lineBreak?: Property.LineBreak | undefined; + /** + * The **`line-height`** CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element. On non-replaced inline elements, it specifies the height that is used to calculate line box height. + * + * **Syntax**: `normal | <number> | <length> | <percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-height + */ + lineHeight?: Property.LineHeight<TLength> | undefined; + /** + * The **`line-height-step`** CSS property sets the step unit for line box heights. When the property is set, line box heights are rounded up to the closest multiple of the unit. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | n/a | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-height-step + */ + lineHeightStep?: Property.LineHeightStep<TLength> | undefined; + /** + * The **`list-style-image`** CSS property sets an image to be used as the list item marker. + * + * **Syntax**: `<image> | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-image + */ + listStyleImage?: Property.ListStyleImage | undefined; + /** + * The **`list-style-position`** CSS property sets the position of the `::marker` relative to a list item. + * + * **Syntax**: `inside | outside` + * + * **Initial value**: `outside` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-position + */ + listStylePosition?: Property.ListStylePosition | undefined; + /** + * The **`list-style-type`** CSS property sets the marker (such as a disc, character, or custom counter style) of a list item element. + * + * **Syntax**: `<counter-style> | <string> | none` + * + * **Initial value**: `disc` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-type + */ + listStyleType?: Property.ListStyleType | undefined; + /** + * The **`margin-block-end`** CSS property defines the logical block end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block-end + */ + marginBlockEnd?: Property.MarginBlockEnd<TLength> | undefined; + /** + * The **`margin-block-start`** CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block-start + */ + marginBlockStart?: Property.MarginBlockStart<TLength> | undefined; + /** + * The **`margin-bottom`** CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-bottom + */ + marginBottom?: Property.MarginBottom<TLength> | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------------: | :-------------------: | :----------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-margin-end)_ | 3 _(-moz-margin-end)_ | 3 _(-webkit-margin-end)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline-end + */ + marginInlineEnd?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------: | :---------------------: | :------------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-margin-start)_ | 3 _(-moz-margin-start)_ | 3 _(-webkit-margin-start)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline-start + */ + marginInlineStart?: Property.MarginInlineStart<TLength> | undefined; + /** + * The **`margin-left`** CSS property sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-left + */ + marginLeft?: Property.MarginLeft<TLength> | undefined; + /** + * The **`margin-right`** CSS property sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-right + */ + marginRight?: Property.MarginRight<TLength> | undefined; + /** + * The **`margin-top`** CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-top + */ + marginTop?: Property.MarginTop<TLength> | undefined; + /** + * The `margin-trim` property allows the container to trim the margins of its children where they adjoin the container's edges. + * + * **Syntax**: `none | in-flow | all` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | No | No | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-trim + */ + marginTrim?: Property.MarginTrim | undefined; + /** + * The **`mask-border-mode`** CSS property specifies the blending mode used in a mask border. + * + * **Syntax**: `luminance | alpha` + * + * **Initial value**: `alpha` + */ + maskBorderMode?: Property.MaskBorderMode | undefined; + /** + * The **`mask-border-outset`** CSS property specifies the distance by which an element's mask border is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-outset)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-outset)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-outset + */ + maskBorderOutset?: Property.MaskBorderOutset<TLength> | undefined; + /** + * The **`mask-border-repeat`** CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-repeat)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-repeat)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat + */ + maskBorderRepeat?: Property.MaskBorderRepeat | undefined; + /** + * The **`mask-border-slice`** CSS property divides the image set by `mask-border-source` into regions. These regions are used to form the components of an element's mask border. + * + * **Syntax**: `<number-percentage>{1,4} fill?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------------: | :-----: | :----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-slice)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-slice)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-slice + */ + maskBorderSlice?: Property.MaskBorderSlice | undefined; + /** + * The **`mask-border-source`** CSS property sets the source image used to create an element's mask border. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-source)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-source)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-source + */ + maskBorderSource?: Property.MaskBorderSource | undefined; + /** + * The **`mask-border-width`** CSS property sets the width of an element's mask border. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------------: | :-----: | :----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-width)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-width)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-width + */ + maskBorderWidth?: Property.MaskBorderWidth<TLength> | undefined; + /** + * The **`mask-clip`** CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area. + * + * **Syntax**: `[ <geometry-box> | no-clip ]#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-clip + */ + maskClip?: Property.MaskClip | undefined; + /** + * The **`mask-composite`** CSS property represents a compositing operation used on the current mask layer with the mask layers below it. + * + * **Syntax**: `<compositing-operator>#` + * + * **Initial value**: `add` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-composite + */ + maskComposite?: Property.MaskComposite | undefined; + /** + * The **`mask-image`** CSS property sets the image that is used as mask layer for an element. By default this means the alpha channel of the mask image will be multiplied with the alpha channel of the element. This can be controlled with the `mask-mode` property. + * + * **Syntax**: `<mask-reference>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 16-79 | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-image + */ + maskImage?: Property.MaskImage | undefined; + /** + * The **`mask-mode`** CSS property sets whether the mask reference defined by `mask-image` is treated as a luminance or alpha mask. + * + * **Syntax**: `<masking-mode>#` + * + * **Initial value**: `match-source` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-mode + */ + maskMode?: Property.MaskMode | undefined; + /** + * The **`mask-origin`** CSS property sets the origin of a mask. + * + * **Syntax**: `<geometry-box>#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-origin + */ + maskOrigin?: Property.MaskOrigin | undefined; + /** + * The **`mask-position`** CSS property sets the initial position, relative to the mask position layer set by `mask-origin`, for each defined mask image. + * + * **Syntax**: `<position>#` + * + * **Initial value**: `center` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-position + */ + maskPosition?: Property.MaskPosition<TLength> | undefined; + /** + * The **`mask-repeat`** CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-repeat + */ + maskRepeat?: Property.MaskRepeat | undefined; + /** + * The **`mask-size`** CSS property specifies the sizes of the mask images. The size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 4 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-size + */ + maskSize?: Property.MaskSize<TLength> | undefined; + /** + * The **`mask-type`** CSS property sets whether an SVG `<mask>` element is used as a _luminance_ or an _alpha_ mask. It applies to the `<mask>` element itself. + * + * **Syntax**: `luminance | alpha` + * + * **Initial value**: `luminance` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **24** | **35** | **7** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-type + */ + maskType?: Property.MaskType | undefined; + /** + * This feature is not Baseline because it does not work in some of the most widely-used browsers. + * + * **Syntax**: `[ pack | next ] || [ definite-first | ordered ]` + * + * **Initial value**: `pack` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------: | :--: | :-: | + * | No | No | **preview** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/masonry-auto-flow + */ + masonryAutoFlow?: Property.MasonryAutoFlow | undefined; + /** + * The **`math-depth`** property describes a notion of _depth_ for each element of a mathematical formula, with respect to the top-level container of that formula. Concretely, this is used to determine the computed value of the font-size property when its specified value is `math`. + * + * **Syntax**: `auto-add | add(<integer>) | <integer>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | **117** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-depth + */ + mathDepth?: Property.MathDepth | undefined; + /** + * The `math-shift` property indicates whether superscripts inside MathML formulas should be raised by a normal or compact shift. + * + * **Syntax**: `normal | compact` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-shift + */ + mathShift?: Property.MathShift | undefined; + /** + * The `math-style` property indicates whether MathML equations should render with normal or compact height. + * + * **Syntax**: `normal | compact` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **109** | **117** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-style + */ + mathStyle?: Property.MathStyle | undefined; + /** + * The **`max-block-size`** CSS property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by `writing-mode`. That is, if the writing direction is horizontal, then `max-block-size` is equivalent to `max-height`; if the writing direction is vertical, `max-block-size` is the same as `max-width`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-block-size + */ + maxBlockSize?: Property.MaxBlockSize<TLength> | undefined; + /** + * The **`max-height`** CSS property sets the maximum height of an element. It prevents the used value of the `height` property from becoming larger than the value specified for `max-height`. + * + * **Syntax**: `none | <length-percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **18** | **1** | **1.3** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-height + */ + maxHeight?: Property.MaxHeight<TLength> | undefined; + /** + * The **`max-inline-size`** CSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the `max-width` or the `max-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :--------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * | | | 10.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-inline-size + */ + maxInlineSize?: Property.MaxInlineSize<TLength> | undefined; + /** + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + maxLines?: Property.MaxLines | undefined; + /** + * The **`max-width`** CSS property sets the maximum width of an element. It prevents the used value of the `width` property from becoming larger than the value specified by `max-width`. + * + * **Syntax**: `none | <length-percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-width + */ + maxWidth?: Property.MaxWidth<TLength> | undefined; + /** + * The **`min-block-size`** CSS property defines the minimum horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'min-width'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-block-size + */ + minBlockSize?: Property.MinBlockSize<TLength> | undefined; + /** + * The **`min-height`** CSS property sets the minimum height of an element. It prevents the used value of the `height` property from becoming smaller than the value specified for `min-height`. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **3** | **1.3** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-height + */ + minHeight?: Property.MinHeight<TLength> | undefined; + /** + * The **`min-inline-size`** CSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'min-width'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-inline-size + */ + minInlineSize?: Property.MinInlineSize<TLength> | undefined; + /** + * The **`min-width`** CSS property sets the minimum width of an element. It prevents the used value of the `width` property from becoming smaller than the value specified for `min-width`. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-width + */ + minWidth?: Property.MinWidth<TLength> | undefined; + /** + * The **`mix-blend-mode`** CSS property sets how an element's content should blend with the content of the element's parent and the element's background. + * + * **Syntax**: `<blend-mode> | plus-lighter` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **41** | **32** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mix-blend-mode + */ + mixBlendMode?: Property.MixBlendMode | undefined; + /** + * The **`offset-distance`** CSS property specifies a position along an `offset-path` for an element to be placed. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion-distance)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-distance + */ + motionDistance?: Property.OffsetDistance<TLength> | undefined; + /** + * The **`offset-path`** CSS property specifies a motion path for an element to follow and defines the element's positioning within the parent container or SVG coordinate system. + * + * **Syntax**: `none | <offset-path> || <coord-box>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------: | :-----: | :------: | :--: | :-: | + * | **55** | **72** | **15.4** | n/a | No | + * | 46 _(motion-path)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-path + */ + motionPath?: Property.OffsetPath | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + motionRotation?: Property.OffsetRotate | undefined; + /** + * The **`object-fit`** CSS property sets how the content of a replaced element, such as an `<img>` or `<video>`, should be resized to fit its container. + * + * **Syntax**: `fill | contain | cover | none | scale-down` + * + * **Initial value**: `fill` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **32** | **36** | **10** | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/object-fit + */ + objectFit?: Property.ObjectFit | undefined; + /** + * The **`object-position`** CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **32** | **36** | **10** | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/object-position + */ + objectPosition?: Property.ObjectPosition<TLength> | undefined; + /** + * **Syntax**: `auto | <position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | **72** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-anchor + */ + offsetAnchor?: Property.OffsetAnchor<TLength> | undefined; + /** + * The **`offset-distance`** CSS property specifies a position along an `offset-path` for an element to be placed. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion-distance)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-distance + */ + offsetDistance?: Property.OffsetDistance<TLength> | undefined; + /** + * The **`offset-path`** CSS property specifies a motion path for an element to follow and defines the element's positioning within the parent container or SVG coordinate system. + * + * **Syntax**: `none | <offset-path> || <coord-box>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------: | :-----: | :------: | :--: | :-: | + * | **55** | **72** | **15.4** | n/a | No | + * | 46 _(motion-path)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-path + */ + offsetPath?: Property.OffsetPath | undefined; + /** + * **Syntax**: `normal | auto | <position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | n/a | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-position + */ + offsetPosition?: Property.OffsetPosition<TLength> | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + offsetRotate?: Property.OffsetRotate | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + offsetRotation?: Property.OffsetRotate | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **2** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/opacity + */ + opacity?: Property.Opacity | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/order + */ + order?: Property.Order | undefined; + /** + * The **`orphans`** CSS property sets the minimum number of lines in a block container that must be shown at the _bottom_ of a page, region, or column. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `2` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **25** | No | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/orphans + */ + orphans?: Property.Orphans | undefined; + /** + * The **`outline-color`** CSS property sets the color of an element's outline. + * + * **Syntax**: `<color> | invert` + * + * **Initial value**: `invert`, for browsers supporting it, `currentColor` for the other + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-color + */ + outlineColor?: Property.OutlineColor | undefined; + /** + * The **`outline-offset`** CSS property sets the amount of space between an outline and the edge or border of an element. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-: | + * | **1** | **1.5** | **1.2** | **15** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-offset + */ + outlineOffset?: Property.OutlineOffset<TLength> | undefined; + /** + * The **`outline-style`** CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `auto | <'border-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-style + */ + outlineStyle?: Property.OutlineStyle | undefined; + /** + * The CSS **`outline-width`** property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-width + */ + outlineWidth?: Property.OutlineWidth<TLength> | undefined; + /** + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **56** | **66** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-anchor + */ + overflowAnchor?: Property.OverflowAnchor | undefined; + /** + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **69** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-block + */ + overflowBlock?: Property.OverflowBlock | undefined; + /** + * The **`overflow-clip-box`** CSS property specifies relative to which box the clipping happens when there is an overflow. It is short hand for the `overflow-clip-box-inline` and `overflow-clip-box-block` properties. + * + * **Syntax**: `padding-box | content-box` + * + * **Initial value**: `padding-box` + */ + overflowClipBox?: Property.OverflowClipBox | undefined; + /** + * **Syntax**: `<visual-box> || <length [0,∞]>` + * + * **Initial value**: `0px` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **90** | **102** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin + */ + overflowClipMargin?: Property.OverflowClipMargin<TLength> | undefined; + /** + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **69** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-inline + */ + overflowInline?: Property.OverflowInline | undefined; + /** + * The **`overflow-wrap`** CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box. + * + * **Syntax**: `normal | break-word | anywhere` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------: | :---------------: | :-------------: | :--------------: | :-------------------: | + * | **23** | **49** | **7** | **18** | **5.5** _(word-wrap)_ | + * | 1 _(word-wrap)_ | 3.5 _(word-wrap)_ | 1 _(word-wrap)_ | 12 _(word-wrap)_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-wrap + */ + overflowWrap?: Property.OverflowWrap | undefined; + /** + * The **`overflow-x`** CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **3.5** | **3** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-x + */ + overflowX?: Property.OverflowX | undefined; + /** + * The **`overflow-y`** CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **3.5** | **3** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-y + */ + overflowY?: Property.OverflowY | undefined; + /** + * The **`overlay`** CSS property specifies whether an element appearing in the top layer (for example, a shown popover or modal `<dialog>` element) is actually rendered in the top layer. This property is only relevant within a list of `transition-property` values, and only if `allow-discrete` is set as the `transition-behavior`. + * + * **Syntax**: `none | auto` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **117** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overlay + */ + overlay?: Property.Overlay | undefined; + /** + * The **`overscroll-behavior-block`** CSS property sets the browser's behavior when the block direction boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **77** | **73** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block + */ + overscrollBehaviorBlock?: Property.OverscrollBehaviorBlock | undefined; + /** + * The **`overscroll-behavior-inline`** CSS property sets the browser's behavior when the inline direction boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **77** | **73** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline + */ + overscrollBehaviorInline?: Property.OverscrollBehaviorInline | undefined; + /** + * The **`overscroll-behavior-x`** CSS property sets the browser's behavior when the horizontal boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x + */ + overscrollBehaviorX?: Property.OverscrollBehaviorX | undefined; + /** + * The **`overscroll-behavior-y`** CSS property sets the browser's behavior when the vertical boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y + */ + overscrollBehaviorY?: Property.OverscrollBehaviorY | undefined; + /** + * The **`padding-block-end`** CSS property defines the logical block end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block-end + */ + paddingBlockEnd?: Property.PaddingBlockEnd<TLength> | undefined; + /** + * The **`padding-block-start`** CSS property defines the logical block start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block-start + */ + paddingBlockStart?: Property.PaddingBlockStart<TLength> | undefined; + /** + * The **`padding-bottom`** CSS property sets the height of the padding area on the bottom of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-bottom + */ + paddingBottom?: Property.PaddingBottom<TLength> | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------------------: | :--------------------: | :-----------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-padding-end)_ | 3 _(-moz-padding-end)_ | 3 _(-webkit-padding-end)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline-end + */ + paddingInlineEnd?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------: | :----------------------: | :-------------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-padding-start)_ | 3 _(-moz-padding-start)_ | 3 _(-webkit-padding-start)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline-start + */ + paddingInlineStart?: Property.PaddingInlineStart<TLength> | undefined; + /** + * The **`padding-left`** CSS property sets the width of the padding area to the left of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-left + */ + paddingLeft?: Property.PaddingLeft<TLength> | undefined; + /** + * The **`padding-right`** CSS property sets the width of the padding area on the right of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-right + */ + paddingRight?: Property.PaddingRight<TLength> | undefined; + /** + * The **`padding-top`** CSS property sets the height of the padding area on the top of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-top + */ + paddingTop?: Property.PaddingTop<TLength> | undefined; + /** + * The **`page`** CSS property is used to specify the named page, a specific type of page defined by the `@page` at-rule. + * + * **Syntax**: `auto | <custom-ident>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-------: | :--: | :-: | + * | **85** | **110** | **≤13.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page + */ + page?: Property.Page | undefined; + /** + * The **`page-break-after`** CSS property adjusts page breaks _after_ the current element. + * + * **Syntax**: `auto | always | avoid | left | right | recto | verso` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-after + */ + pageBreakAfter?: Property.PageBreakAfter | undefined; + /** + * The **`page-break-before`** CSS property adjusts page breaks _before_ the current element. + * + * **Syntax**: `auto | always | avoid | left | right | recto | verso` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-before + */ + pageBreakBefore?: Property.PageBreakBefore | undefined; + /** + * The **`page-break-inside`** CSS property adjusts page breaks _inside_ the current element. + * + * **Syntax**: `auto | avoid` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **19** | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-inside + */ + pageBreakInside?: Property.PageBreakInside | undefined; + /** + * The **`paint-order`** CSS property lets you control the order in which the fill and stroke (and painting markers) of text content and shapes are drawn. + * + * **Syntax**: `normal | [ fill || stroke || markers ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **35** | **60** | **8** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/paint-order + */ + paintOrder?: Property.PaintOrder | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/perspective + */ + perspective?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/perspective-origin + */ + perspectiveOrigin?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`pointer-events`** CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events. + * + * **Syntax**: `auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **1** | **1.5** | **4** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/pointer-events + */ + pointerEvents?: Property.PointerEvents | undefined; + /** + * The **`position`** CSS property sets how an element is positioned in a document. The `top`, `right`, `bottom`, and `left` properties determine the final location of positioned elements. + * + * **Syntax**: `static | relative | absolute | sticky | fixed` + * + * **Initial value**: `static` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/position + */ + position?: Property.Position | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----------------: | :------: | :----------: | :-: | + * | **17** _-x-_ | **97** | **15.4** | **79** _-x-_ | No | + * | | 48 _(color-adjust)_ | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/print-color-adjust + */ + printColorAdjust?: Property.PrintColorAdjust | undefined; + /** + * The **`quotes`** CSS property sets how the browser should render quotation marks that are added using the `open-quotes` or `close-quotes` values of the CSS `content` property. + * + * **Syntax**: `none | auto | [ <string> <string> ]+` + * + * **Initial value**: depends on user agent + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **11** | **1.5** | **9** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/quotes + */ + quotes?: Property.Quotes | undefined; + /** + * The **`resize`** CSS property sets whether an element is resizable, and if so, in which directions. + * + * **Syntax**: `none | both | horizontal | vertical | block | inline` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **1** | **4** | **3** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/resize + */ + resize?: Property.Resize | undefined; + /** + * The **`right`** CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/right + */ + right?: Property.Right<TLength> | undefined; + /** + * The **`rotate`** CSS property allows you to specify rotation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` property. + * + * **Syntax**: `none | <angle> | [ x | y | z | <number>{3} ] && <angle>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/rotate + */ + rotate?: Property.Rotate | undefined; + /** + * The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows. + * + * **Syntax**: `normal | <length-percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **47** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/row-gap + */ + rowGap?: Property.RowGap<TLength> | undefined; + /** + * The **`ruby-align`** CSS property defines the distribution of the different ruby elements over the base. + * + * **Syntax**: `start | center | space-between | space-around` + * + * **Initial value**: `space-around` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **38** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/ruby-align + */ + rubyAlign?: Property.RubyAlign | undefined; + /** + * **Syntax**: `separate | collapse | auto` + * + * **Initial value**: `separate` + */ + rubyMerge?: Property.RubyMerge | undefined; + /** + * The **`ruby-position`** CSS property defines the position of a ruby element relatives to its base element. It can be positioned over the element (`over`), under it (`under`), or between the characters on their right side (`inter-character`). + * + * **Syntax**: `[ alternate || [ over | under ] ] | inter-character` + * + * **Initial value**: `alternate` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :---: | :-: | + * | **84** | **38** | **7** _-x-_ | 12-79 | No | + * | 1 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/ruby-position + */ + rubyPosition?: Property.RubyPosition | undefined; + /** + * The **`scale`** CSS property allows you to specify scale transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value. + * + * **Syntax**: `none | <number>{1,3}` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scale + */ + scale?: Property.Scale | undefined; + /** + * The **`scroll-behavior`** CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs. + * + * **Syntax**: `auto | smooth` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **61** | **36** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-behavior + */ + scrollBehavior?: Property.ScrollBehavior | undefined; + /** + * The `scroll-margin-block-end` property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-end + */ + scrollMarginBlockEnd?: Property.ScrollMarginBlockEnd<TLength> | undefined; + /** + * The `scroll-margin-block-start` property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-start + */ + scrollMarginBlockStart?: Property.ScrollMarginBlockStart<TLength> | undefined; + /** + * The `scroll-margin-bottom` property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-bottom)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom + */ + scrollMarginBottom?: Property.ScrollMarginBottom<TLength> | undefined; + /** + * The `scroll-margin-inline-end` property defines the margin of the scroll snap area at the end of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-end + */ + scrollMarginInlineEnd?: Property.ScrollMarginInlineEnd<TLength> | undefined; + /** + * The `scroll-margin-inline-start` property defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-start + */ + scrollMarginInlineStart?: Property.ScrollMarginInlineStart<TLength> | undefined; + /** + * The `scroll-margin-left` property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-left)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left + */ + scrollMarginLeft?: Property.ScrollMarginLeft<TLength> | undefined; + /** + * The `scroll-margin-right` property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-right)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right + */ + scrollMarginRight?: Property.ScrollMarginRight<TLength> | undefined; + /** + * The `scroll-margin-top` property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-top)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top + */ + scrollMarginTop?: Property.ScrollMarginTop<TLength> | undefined; + /** + * The `scroll-padding-block-end` property defines offsets for the end edge in the block dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-end + */ + scrollPaddingBlockEnd?: Property.ScrollPaddingBlockEnd<TLength> | undefined; + /** + * The `scroll-padding-block-start` property defines offsets for the start edge in the block dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-start + */ + scrollPaddingBlockStart?: Property.ScrollPaddingBlockStart<TLength> | undefined; + /** + * The `scroll-padding-bottom` property defines offsets for the bottom of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-bottom + */ + scrollPaddingBottom?: Property.ScrollPaddingBottom<TLength> | undefined; + /** + * The `scroll-padding-inline-end` property defines offsets for the end edge in the inline dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-end + */ + scrollPaddingInlineEnd?: Property.ScrollPaddingInlineEnd<TLength> | undefined; + /** + * The `scroll-padding-inline-start` property defines offsets for the start edge in the inline dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-start + */ + scrollPaddingInlineStart?: Property.ScrollPaddingInlineStart<TLength> | undefined; + /** + * The `scroll-padding-left` property defines offsets for the left of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-left + */ + scrollPaddingLeft?: Property.ScrollPaddingLeft<TLength> | undefined; + /** + * The `scroll-padding-right` property defines offsets for the right of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-right + */ + scrollPaddingRight?: Property.ScrollPaddingRight<TLength> | undefined; + /** + * The **`scroll-padding-top`** property defines offsets for the top of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-top + */ + scrollPaddingTop?: Property.ScrollPaddingTop<TLength> | undefined; + /** + * The `scroll-snap-align` property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snapport (as the alignment container). The two values specify the snapping alignment in the block axis and inline axis, respectively. If only one value is specified, the second value defaults to the same value. + * + * **Syntax**: `[ none | start | end | center ]{1,2}` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-align + */ + scrollSnapAlign?: Property.ScrollSnapAlign | undefined; + /** + * The `scroll-margin-bottom` property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-bottom)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom + */ + scrollSnapMarginBottom?: Property.ScrollMarginBottom<TLength> | undefined; + /** + * The `scroll-margin-left` property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-left)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left + */ + scrollSnapMarginLeft?: Property.ScrollMarginLeft<TLength> | undefined; + /** + * The `scroll-margin-right` property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-right)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right + */ + scrollSnapMarginRight?: Property.ScrollMarginRight<TLength> | undefined; + /** + * The `scroll-margin-top` property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-top)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top + */ + scrollSnapMarginTop?: Property.ScrollMarginTop<TLength> | undefined; + /** + * The **`scroll-snap-stop`** CSS property defines whether or not the scroll container is allowed to "pass over" possible snap positions. + * + * **Syntax**: `normal | always` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **75** | **103** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-stop + */ + scrollSnapStop?: Property.ScrollSnapStop | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | [ x | y | block | inline | both ] [ mandatory | proximity ]?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----------: | + * | **69** | 39-68 | **11** | **79** | **10** _-x-_ | + * | | | 9 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-type + */ + scrollSnapType?: Property.ScrollSnapType | undefined; + /** + * The **`scroll-timeline-axis`** CSS property can be used to specify the scrollbar that will be used to provide the timeline for a scroll-timeline animation. + * + * **Syntax**: `[ block | inline | x | y ]#` + * + * **Initial value**: `block` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-axis + */ + scrollTimelineAxis?: Property.ScrollTimelineAxis | undefined; + /** + * The **`scroll-timeline-name`** CSS property defines a name that can be used to identify an element as the source of a scroll timeline for an animation. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-name + */ + scrollTimelineName?: Property.ScrollTimelineName | undefined; + /** + * The **`scrollbar-color`** CSS property sets the color of the scrollbar track and thumb. + * + * **Syntax**: `auto | <color>{2}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **121** | **64** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-color + */ + scrollbarColor?: Property.ScrollbarColor | undefined; + /** + * The **`scrollbar-gutter`** CSS property allows authors to reserve space for the scrollbar, preventing unwanted layout changes as the content grows while also avoiding unnecessary visuals when scrolling isn't needed. + * + * **Syntax**: `auto | stable && both-edges?` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **94** | **97** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter + */ + scrollbarGutter?: Property.ScrollbarGutter | undefined; + /** + * The **`scrollbar-width`** property allows the author to set the maximum thickness of an element's scrollbars when they are shown. + * + * **Syntax**: `auto | thin | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **121** | **64** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-width + */ + scrollbarWidth?: Property.ScrollbarWidth | undefined; + /** + * The **`shape-image-threshold`** CSS property sets the alpha channel threshold used to extract the shape using an image as the value for `shape-outside`. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `0.0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-image-threshold + */ + shapeImageThreshold?: Property.ShapeImageThreshold | undefined; + /** + * The **`shape-margin`** CSS property sets a margin for a CSS shape created using `shape-outside`. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-margin + */ + shapeMargin?: Property.ShapeMargin<TLength> | undefined; + /** + * The **`shape-outside`** CSS property defines a shape—which may be non-rectangular—around which adjacent inline content should wrap. By default, inline content wraps around its margin box; `shape-outside` provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes. + * + * **Syntax**: `none | [ <shape-box> || <basic-shape> ] | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-outside + */ + shapeOutside?: Property.ShapeOutside | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **21** | **91** | **7** | n/a | No | + * | | 4 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/tab-size + */ + tabSize?: Property.TabSize<TLength> | undefined; + /** + * The **`table-layout`** CSS property sets the algorithm used to lay out `<table>` cells, rows, and columns. + * + * **Syntax**: `auto | fixed` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **14** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/table-layout + */ + tableLayout?: Property.TableLayout | undefined; + /** + * The **`text-align`** CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box. This means it works like `vertical-align` but in the horizontal direction. + * + * **Syntax**: `start | end | left | right | center | justify | match-parent` + * + * **Initial value**: `start`, or a nameless value that acts as `left` if _direction_ is `ltr`, `right` if _direction_ is `rtl` if `start` is not supported by the browser. + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-align + */ + textAlign?: Property.TextAlign | undefined; + /** + * The **`text-align-last`** CSS property sets how the last line of a block or a line, right before a forced line break, is aligned. + * + * **Syntax**: `auto | start | end | left | right | center | justify` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **47** | **49** | **16** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-align-last + */ + textAlignLast?: Property.TextAlignLast | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------: | :-----: | :--------------------------: | :----: | :------------------------------------: | + * | **48** | **48** | **15.4** | **79** | **11** _(-ms-text-combine-horizontal)_ | + * | 9 _(-webkit-text-combine)_ | | 5.1 _(-webkit-text-combine)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-combine-upright + */ + textCombineUpright?: Property.TextCombineUpright | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-color + */ + textDecorationColor?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-line + */ + textDecorationLine?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-skip`** CSS property sets what parts of an element's content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors. + * + * **Syntax**: `none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]` + * + * **Initial value**: `objects` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | 57-64 | No | **12.1** | n/a | No | + * | | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip + */ + textDecorationSkip?: Property.TextDecorationSkip | undefined; + /** + * The **`text-decoration-skip-ink`** CSS property specifies how overlines and underlines are drawn when they pass over glyph ascenders and descenders. + * + * **Syntax**: `auto | all | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **64** | **70** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink + */ + textDecorationSkipInk?: Property.TextDecorationSkipInk | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-style + */ + textDecorationStyle?: Property.TextDecorationStyle | undefined; + /** + * The **`text-decoration-thickness`** CSS property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline. + * + * **Syntax**: `auto | from-font | <length> | <percentage> ` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **89** | **70** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness + */ + textDecorationThickness?: Property.TextDecorationThickness<TLength> | undefined; + /** + * The **`text-emphasis-color`** CSS property sets the color of emphasis marks. This value can also be set using the `text-emphasis` shorthand. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color + */ + textEmphasisColor?: Property.TextEmphasisColor | undefined; + /** + * The **`text-emphasis-position`** CSS property sets where emphasis marks are drawn. Like ruby text, if there isn't enough room for emphasis marks, the line height is increased. + * + * **Syntax**: `[ over | under ] && [ right | left ]` + * + * **Initial value**: `over right` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position + */ + textEmphasisPosition?: Property.TextEmphasisPosition | undefined; + /** + * The **`text-emphasis-style`** CSS property sets the appearance of emphasis marks. It can also be set, and reset, using the `text-emphasis` shorthand. + * + * **Syntax**: `none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style + */ + textEmphasisStyle?: Property.TextEmphasisStyle | undefined; + /** + * The **`text-indent`** CSS property sets the length of empty space (indentation) that is put before lines of text in a block. + * + * **Syntax**: `<length-percentage> && hanging? && each-line?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-indent + */ + textIndent?: Property.TextIndent<TLength> | undefined; + /** + * The **`text-justify`** CSS property sets what type of justification should be applied to text when `text-align``: justify;` is set on an element. + * + * **Syntax**: `auto | inter-character | inter-word | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :---: | :----: | + * | n/a | **55** | No | 12-79 | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-justify + */ + textJustify?: Property.TextJustify | undefined; + /** + * The **`text-orientation`** CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when `writing-mode` is not `horizontal-tb`). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers. + * + * **Syntax**: `mixed | upright | sideways` + * + * **Initial value**: `mixed` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :--: | :-: | + * | **48** | **41** | **14** | n/a | No | + * | 11 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-orientation + */ + textOrientation?: Property.TextOrientation | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **7** | **1.3** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-overflow + */ + textOverflow?: Property.TextOverflow | undefined; + /** + * The **`text-rendering`** CSS property provides information to the rendering engine about what to optimize for when rendering text. + * + * **Syntax**: `auto | optimizeSpeed | optimizeLegibility | geometricPrecision` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **4** | **1** | **5** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-rendering + */ + textRendering?: Property.TextRendering | undefined; + /** + * The **`text-shadow`** CSS property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and any of its `decorations`. Each shadow is described by some combination of X and Y offsets from the element, blur radius, and color. + * + * **Syntax**: `none | <shadow-t>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **2** | **3.5** | **1.1** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-shadow + */ + textShadow?: Property.TextShadow | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **54** | No | No | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-size-adjust + */ + textSizeAdjust?: Property.TextSizeAdjust | undefined; + /** + * The **`text-transform`** CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby. + * + * **Syntax**: `none | capitalize | uppercase | lowercase | full-width | full-size-kana` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-transform + */ + textTransform?: Property.TextTransform | undefined; + /** + * The **`text-underline-offset`** CSS property sets the offset distance of an underline text decoration line (applied using `text-decoration`) from its original position. + * + * **Syntax**: `auto | <length> | <percentage> ` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **70** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-underline-offset + */ + textUnderlineOffset?: Property.TextUnderlineOffset<TLength> | undefined; + /** + * The **`text-underline-position`** CSS property specifies the position of the underline which is set using the `text-decoration` property's `underline` value. + * + * **Syntax**: `auto | from-font | [ under || [ left | right ] ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :---: | + * | **33** | **74** | **12.1** | **12** | **6** | + * | | | 9 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-underline-position + */ + textUnderlinePosition?: Property.TextUnderlinePosition | undefined; + /** + * The **`text-wrap`** CSS property controls how text inside an element is wrapped. The different values provide: + * + * **Syntax**: `wrap | nowrap | balance | stable | pretty` + * + * **Initial value**: `wrap` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **114** | **121** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-wrap + */ + textWrap?: Property.TextWrap | undefined; + /** + * The **`timeline-scope`** CSS property modifies the scope of a named animation timeline. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/timeline-scope + */ + timelineScope?: Property.TimelineScope | undefined; + /** + * The **`top`** CSS property participates in specifying the vertical position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/top + */ + top?: Property.Top<TLength> | undefined; + /** + * The **`touch-action`** CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser). + * + * **Syntax**: `auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :------: | + * | **36** | **52** | **13** | **12** | **11** | + * | | | | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/touch-action + */ + touchAction?: Property.TouchAction | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :-----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | 9 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform + */ + transform?: Property.Transform | undefined; + /** + * The **`transform-box`** CSS property defines the layout box to which the `transform`, individual transform properties `translate`,`scale`, and `rotate`, and `transform-origin` properties relate. + * + * **Syntax**: `content-box | border-box | fill-box | stroke-box | view-box` + * + * **Initial value**: `view-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **64** | **55** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-box + */ + transformBox?: Property.TransformBox | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :-----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 2 _-x-_ | | 9 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-origin + */ + transformOrigin?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :-: | + * | **36** | **16** | **9** | **12** | No | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-style + */ + transformStyle?: Property.TransformStyle | undefined; + /** + * The **`transition-behavior`** CSS property specifies whether transitions will be started for properties whose animation behavior is discrete. + * + * **Syntax**: `<transition-behavior-value>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **117** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-behavior + */ + transitionBehavior?: Property.TransitionBehavior | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-delay + */ + transitionDelay?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-duration + */ + transitionDuration?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-property + */ + transitionProperty?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-timing-function + */ + transitionTimingFunction?: Property.TransitionTimingFunction | undefined; + /** + * The **`translate`** CSS property allows you to specify translation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value. + * + * **Syntax**: `none | <length-percentage> [ <length-percentage> <length>? ]?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/translate + */ + translate?: Property.Translate<TLength> | undefined; + /** + * The **`unicode-bidi`** CSS property, together with the `direction` property, determines how bidirectional text in a document is handled. For example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The `unicode-bidi` property overrides this algorithm and allows the developer to control the text embedding. + * + * **Syntax**: `normal | embed | isolate | bidi-override | isolate-override | plaintext` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-----: | + * | **2** | **1** | **1.3** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/unicode-bidi + */ + unicodeBidi?: Property.UnicodeBidi | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :------: | :----------: | + * | **54** | **69** | **3** _-x-_ | **79** | **10** _-x-_ | + * | 1 _-x-_ | 1 _-x-_ | | 12 _-x-_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/user-select + */ + userSelect?: Property.UserSelect | undefined; + /** + * The **`vertical-align`** CSS property sets vertical alignment of an inline, inline-block or table-cell box. + * + * **Syntax**: `baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>` + * + * **Initial value**: `baseline` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/vertical-align + */ + verticalAlign?: Property.VerticalAlign<TLength> | undefined; + /** + * The **`view-timeline-axis`** CSS property is used to specify the scrollbar direction that will be used to provide the timeline for a _named view progress timeline_ animation, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline-axis` is set on the subject. See CSS scroll-driven animations for more details. + * + * **Syntax**: `[ block | inline | x | y ]#` + * + * **Initial value**: `block` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-axis + */ + viewTimelineAxis?: Property.ViewTimelineAxis | undefined; + /** + * The **`view-timeline-inset`** CSS property is used to specify one or two values representing an adjustment to the position of the scrollport (see Scroll container for more details) in which the subject element of a _named view progress timeline_ animation is deemed to be visible. Put another way, this allows you to specify start and/or end inset (or outset) values that offset the position of the timeline. + * + * **Syntax**: `[ [ auto | <length-percentage> ]{1,2} ]#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-inset + */ + viewTimelineInset?: Property.ViewTimelineInset<TLength> | undefined; + /** + * The **`view-timeline-name`** CSS property is used to define the name of a _named view progress timeline_, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline` is set on the subject. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-name + */ + viewTimelineName?: Property.ViewTimelineName | undefined; + /** + * The **`view-transition-name`** CSS property provides the selected element with a distinct identifying name (a `<custom-ident>`) and causes it to participate in a separate view transition from the root view transition — or no view transition if the `none` value is specified. + * + * **Syntax**: `none | <custom-ident>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **111** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-transition-name + */ + viewTransitionName?: Property.ViewTransitionName | undefined; + /** + * The **`visibility`** CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a `<table>`. + * + * **Syntax**: `visible | hidden | collapse` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/visibility + */ + visibility?: Property.Visibility | undefined; + /** + * The **`white-space`** CSS property sets how white space inside an element is handled. + * + * **Syntax**: `normal | pre | nowrap | pre-wrap | pre-line | break-spaces | [ <'white-space-collapse'> || <'text-wrap'> || <'white-space-trim'> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/white-space + */ + whiteSpace?: Property.WhiteSpace | undefined; + /** + * The **`white-space-collapse`** CSS property controls how white space inside an element is collapsed. + * + * **Syntax**: `collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces` + * + * **Initial value**: `collapse` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **114** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/white-space-collapse + */ + whiteSpaceCollapse?: Property.WhiteSpaceCollapse | undefined; + /** + * **Syntax**: `none | discard-before || discard-after || discard-inner` + * + * **Initial value**: `none` + */ + whiteSpaceTrim?: Property.WhiteSpaceTrim | undefined; + /** + * The **`widows`** CSS property sets the minimum number of lines in a block container that must be shown at the _top_ of a page, region, or column. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `2` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **25** | No | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/widows + */ + widows?: Property.Widows | undefined; + /** + * The **`width`** CSS property sets an element's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box`, it sets the width of the border area. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/width + */ + width?: Property.Width<TLength> | undefined; + /** + * The **`will-change`** CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is actually changed. These kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. + * + * **Syntax**: `auto | <animateable-feature>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **36** | **36** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/will-change + */ + willChange?: Property.WillChange | undefined; + /** + * The **`word-break`** CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box. + * + * **Syntax**: `normal | break-all | keep-all | break-word` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **15** | **3** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/word-break + */ + wordBreak?: Property.WordBreak | undefined; + /** + * The **`word-spacing`** CSS property sets the length of space between words and between tags. + * + * **Syntax**: `normal | <length>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/word-spacing + */ + wordSpacing?: Property.WordSpacing<TLength> | undefined; + /** + * The **`overflow-wrap`** CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box. + * + * **Syntax**: `normal | break-word` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :-----: | :-: | + * | **≤80** | **≤72** | **≤13.1** | **≤80** | No | + */ + wordWrap?: Property.WordWrap | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :---: | + * | **48** | **41** | **10.1** | **12** | **9** | + * | 8 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/writing-mode + */ + writingMode?: Property.WritingMode | undefined; + /** + * The **`z-index`** CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one. + * + * **Syntax**: `auto | <integer>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/z-index + */ + zIndex?: Property.ZIndex | undefined; + /** + * The non-standard **`zoom`** CSS property can be used to control the magnification level of an element. `transform: scale()` should be used instead of this property, if possible. However, unlike CSS Transforms, `zoom` affects the layout size of the element. + * + * **Syntax**: `normal | reset | <number> | <percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-----: | + * | **1** | n/a | **3.1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/zoom + */ + zoom?: Property.Zoom | undefined; +} + +export interface StandardShorthandProperties<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`all`** shorthand CSS property resets all of an element's properties except `unicode-bidi`, `direction`, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin. + * + * **Syntax**: `initial | inherit | unset | revert | revert-layer` + * + * **Initial value**: There is no practical initial value for it. + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **37** | **27** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/all + */ + all?: Property.All | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation + */ + animation?: Property.Animation<TTime> | undefined; + /** + * The **`animation-range`** CSS shorthand property is used to set the start and end of an animation's attachment range along its timeline, i.e. where along the timeline an animation will start and end. + * + * **Syntax**: `[ <'animation-range-start'> <'animation-range-end'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range + */ + animationRange?: Property.AnimationRange<TLength> | undefined; + /** + * The **`background`** shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. + * + * **Syntax**: `[ <bg-layer> , ]* <final-bg-layer>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background + */ + background?: Property.Background<TLength> | undefined; + /** + * The **`background-position`** CSS property sets the initial position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `<bg-position>#` + * + * **Initial value**: `0% 0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position + */ + backgroundPosition?: Property.BackgroundPosition<TLength> | undefined; + /** + * The **`border`** shorthand CSS property sets an element's border. It sets the values of `border-width`, `border-style`, and `border-color`. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border + */ + border?: Property.Border<TLength> | undefined; + /** + * The **`border-block`** CSS property is a shorthand property for setting the individual logical block border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block + */ + borderBlock?: Property.BorderBlock<TLength> | undefined; + /** + * The **`border-block-end`** CSS property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end + */ + borderBlockEnd?: Property.BorderBlockEnd<TLength> | undefined; + /** + * The **`border-block-start`** CSS property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start + */ + borderBlockStart?: Property.BorderBlockStart<TLength> | undefined; + /** + * The **`border-bottom`** shorthand CSS property sets an element's bottom border. It sets the values of `border-bottom-width`, `border-bottom-style` and `border-bottom-color`. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom + */ + borderBottom?: Property.BorderBottom<TLength> | undefined; + /** + * The **`border-color`** shorthand CSS property sets the color of an element's border. + * + * **Syntax**: `<color>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-color + */ + borderColor?: Property.BorderColor | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-------: | :-----: | :----: | :----: | + * | **16** | **15** | **6** | **12** | **11** | + * | 7 _-x-_ | 3.5 _-x-_ | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image + */ + borderImage?: Property.BorderImage | undefined; + /** + * The **`border-inline`** CSS property is a shorthand property for setting the individual logical inline border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline + */ + borderInline?: Property.BorderInline<TLength> | undefined; + /** + * The **`border-inline-end`** CSS property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end + */ + borderInlineEnd?: Property.BorderInlineEnd<TLength> | undefined; + /** + * The **`border-inline-start`** CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start + */ + borderInlineStart?: Property.BorderInlineStart<TLength> | undefined; + /** + * The **`border-left`** shorthand CSS property sets all the properties of an element's left border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left + */ + borderLeft?: Property.BorderLeft<TLength> | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-radius + */ + borderRadius?: Property.BorderRadius<TLength> | undefined; + /** + * The **`border-right`** shorthand CSS property sets all the properties of an element's right border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right + */ + borderRight?: Property.BorderRight<TLength> | undefined; + /** + * The **`border-style`** shorthand CSS property sets the line style for all four sides of an element's border. + * + * **Syntax**: `<line-style>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-style + */ + borderStyle?: Property.BorderStyle | undefined; + /** + * The **`border-top`** shorthand CSS property sets all the properties of an element's top border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top + */ + borderTop?: Property.BorderTop<TLength> | undefined; + /** + * The **`border-width`** shorthand CSS property sets the width of an element's border. + * + * **Syntax**: `<line-width>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-width + */ + borderWidth?: Property.BorderWidth<TLength> | undefined; + /** **Syntax**: `<'caret-color'> || <'caret-shape'>` */ + caret?: Property.Caret | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule + */ + columnRule?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/columns + */ + columns?: Property.Columns<TLength> | undefined; + /** + * The **`contain-intrinsic-size`** CSS shorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment. + * + * **Syntax**: `[ auto? [ none | <length> ] ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **83** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-size + */ + containIntrinsicSize?: Property.ContainIntrinsicSize<TLength> | undefined; + /** + * The **container** shorthand CSS property establishes the element as a query container and specifies the name or name for the containment context used in a container query. + * + * **Syntax**: `<'container-name'> [ / <'container-type'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container + */ + container?: Property.Container | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex + */ + flex?: Property.Flex<TLength> | undefined; + /** + * The **`flex-flow`** CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. + * + * **Syntax**: `<'flex-direction'> || <'flex-wrap'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-flow + */ + flexFlow?: Property.FlexFlow | undefined; + /** + * The **`font`** CSS shorthand property sets all the different properties of an element's font. Alternatively, it sets an element's font to a system font. + * + * **Syntax**: `[ [ <'font-style'> || <font-variant-css21> || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font + */ + font?: Property.Font | undefined; + /** + * The **`gap`** CSS property sets the gaps (gutters) between rows and columns. It is a shorthand for `row-gap` and `column-gap`. + * + * **Syntax**: `<'row-gap'> <'column-gap'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/gap + */ + gap?: Property.Gap<TLength> | undefined; + /** + * The **`grid`** CSS property is a shorthand property that sets all of the explicit and implicit grid properties in a single declaration. + * + * **Syntax**: `<'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid + */ + grid?: Property.Grid | undefined; + /** + * The **`grid-area`** CSS shorthand property specifies a grid item's size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]{0,3}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-area + */ + gridArea?: Property.GridArea | undefined; + /** + * The **`grid-column`** CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column + */ + gridColumn?: Property.GridColumn | undefined; + /** + * The **`grid-row`** CSS shorthand property specifies a grid item's size and location within a grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row + */ + gridRow?: Property.GridRow | undefined; + /** + * The **`grid-template`** CSS property is a shorthand property for defining grid columns, grid rows, and grid areas. + * + * **Syntax**: `none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template + */ + gridTemplate?: Property.GridTemplate | undefined; + /** + * The **`inset`** CSS property is a shorthand that corresponds to the `top`, `right`, `bottom`, and/or `left` properties. It has the same multi-value syntax of the `margin` shorthand. + * + * **Syntax**: `<'top'>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset + */ + inset?: Property.Inset<TLength> | undefined; + /** + * The **`inset-block`** CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block + */ + insetBlock?: Property.InsetBlock<TLength> | undefined; + /** + * The **`inset-inline`** CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline + */ + insetInline?: Property.InsetInline<TLength> | undefined; + /** + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + lineClamp?: Property.LineClamp | undefined; + /** + * The **`list-style`** CSS shorthand property allows you to set all the list style properties at once. + * + * **Syntax**: `<'list-style-type'> || <'list-style-position'> || <'list-style-image'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style + */ + listStyle?: Property.ListStyle | undefined; + /** + * The **`margin`** CSS shorthand property sets the margin area on all four sides of an element. + * + * **Syntax**: `[ <length> | <percentage> | auto ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin + */ + margin?: Property.Margin<TLength> | undefined; + /** + * The **`margin-block`** CSS shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block + */ + marginBlock?: Property.MarginBlock<TLength> | undefined; + /** + * The **`margin-inline`** CSS shorthand property is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline + */ + marginInline?: Property.MarginInline<TLength> | undefined; + /** + * The **`mask`** CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points. + * + * **Syntax**: `<mask-layer>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-------: | :---: | :-: | + * | **1** | **53** | **15.4** | 12-79 | No | + * | | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask + */ + mask?: Property.Mask<TLength> | undefined; + /** + * The **`mask-border`** CSS shorthand property lets you create a mask along the edge of an element's border. + * + * **Syntax**: `<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------: | :-----: | :----------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border + */ + maskBorder?: Property.MaskBorder | undefined; + /** + * The **`offset`** CSS shorthand property sets all the properties required for animating an element along a defined path. + * + * **Syntax**: `[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset + */ + motion?: Property.Offset<TLength> | undefined; + /** + * The **`offset`** CSS shorthand property sets all the properties required for animating an element along a defined path. + * + * **Syntax**: `[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset + */ + offset?: Property.Offset<TLength> | undefined; + /** + * The **`outline`** CSS shorthand property sets most of the outline properties in a single declaration. + * + * **Syntax**: `[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :---: | + * | **94** | **88** | **16.4** | **94** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline + */ + outline?: Property.Outline<TLength> | undefined; + /** + * The **`overflow`** CSS shorthand property sets the desired behavior for an element's overflow — i.e. when an element's content is too big to fit in its block formatting context — in both directions. + * + * **Syntax**: `[ visible | hidden | clip | scroll | auto ]{1,2}` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow + */ + overflow?: Property.Overflow | undefined; + /** + * The **`overscroll-behavior`** CSS property sets what a browser does when reaching the boundary of a scrolling area. It's a shorthand for `overscroll-behavior-x` and `overscroll-behavior-y`. + * + * **Syntax**: `[ contain | none | auto ]{1,2}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior + */ + overscrollBehavior?: Property.OverscrollBehavior | undefined; + /** + * The **`padding`** CSS shorthand property sets the padding area on all four sides of an element at once. + * + * **Syntax**: `[ <length> | <percentage> ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding + */ + padding?: Property.Padding<TLength> | undefined; + /** + * The **`padding-block`** CSS shorthand property defines the logical block start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block + */ + paddingBlock?: Property.PaddingBlock<TLength> | undefined; + /** + * The **`padding-inline`** CSS shorthand property defines the logical inline start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline + */ + paddingInline?: Property.PaddingInline<TLength> | undefined; + /** + * The **`place-content`** CSS shorthand property allows you to align content along both the block and inline directions at once (i.e. the `align-content` and `justify-content` properties) in a relevant layout system such as Grid or Flexbox. + * + * **Syntax**: `<'align-content'> <'justify-content'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **9** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-content + */ + placeContent?: Property.PlaceContent | undefined; + /** + * The CSS **`place-items`** shorthand property allows you to align items along both the block and inline directions at once (i.e. the `align-items` and `justify-items` properties) in a relevant layout system such as Grid or Flexbox. If the second value is not set, the first value is also used for it. + * + * **Syntax**: `<'align-items'> <'justify-items'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-items + */ + placeItems?: Property.PlaceItems | undefined; + /** + * The **`place-self`** CSS shorthand property allows you to align an individual item in both the block and inline directions at once (i.e. the `align-self` and `justify-self` properties) in a relevant layout system such as Grid or Flexbox. If the second value is not present, the first value is also used for it. + * + * **Syntax**: `<'align-self'> <'justify-self'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-self + */ + placeSelf?: Property.PlaceSelf | undefined; + /** + * The **`scroll-margin`** shorthand property sets all of the scroll margins of an element at once, assigning values much like the `margin` property does for margins of an element. + * + * **Syntax**: `<length>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------: | :--: | :-: | + * | **69** | **90** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin + */ + scrollMargin?: Property.ScrollMargin<TLength> | undefined; + /** + * The `scroll-margin-block` shorthand property sets the scroll margins of an element in the block dimension. + * + * **Syntax**: `<length>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block + */ + scrollMarginBlock?: Property.ScrollMarginBlock<TLength> | undefined; + /** + * The `scroll-margin-inline` shorthand property sets the scroll margins of an element in the inline dimension. + * + * **Syntax**: `<length>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline + */ + scrollMarginInline?: Property.ScrollMarginInline<TLength> | undefined; + /** + * The **`scroll-padding`** shorthand property sets scroll padding on all sides of an element at once, much like the `padding` property does for padding on an element. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding + */ + scrollPadding?: Property.ScrollPadding<TLength> | undefined; + /** + * The `scroll-padding-block` shorthand property sets the scroll padding of an element in the block dimension. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block + */ + scrollPaddingBlock?: Property.ScrollPaddingBlock<TLength> | undefined; + /** + * The `scroll-padding-inline` shorthand property sets the scroll padding of an element in the inline dimension. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline + */ + scrollPaddingInline?: Property.ScrollPaddingInline<TLength> | undefined; + /** + * The **`scroll-margin`** shorthand property sets all of the scroll margins of an element at once, assigning values much like the `margin` property does for margins of an element. + * + * **Syntax**: `<length>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------: | :--: | :-: | + * | **69** | 68-90 | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin + */ + scrollSnapMargin?: Property.ScrollMargin<TLength> | undefined; + /** + * The **`scroll-timeline`** CSS shorthand property defines a name that can be used to identify the source element of a scroll timeline, along with the scrollbar axis that should provide the timeline. + * + * **Syntax**: `[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline + */ + scrollTimeline?: Property.ScrollTimeline | undefined; + /** + * The **`text-decoration`** shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for `text-decoration-line`, `text-decoration-color`, `text-decoration-style`, and the newer `text-decoration-thickness` property. + * + * **Syntax**: `<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration + */ + textDecoration?: Property.TextDecoration<TLength> | undefined; + /** + * The **`text-emphasis`** CSS property applies emphasis marks to text (except spaces and control characters). It is a shorthand for `text-emphasis-style` and `text-emphasis-color`. + * + * **Syntax**: `<'text-emphasis-style'> || <'text-emphasis-color'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis + */ + textEmphasis?: Property.TextEmphasis | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition + */ + transition?: Property.Transition<TTime> | undefined; + /** + * The **`view-timeline`** CSS shorthand property is used to define a _named view progress timeline_, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline` is set on the subject. + * + * **Syntax**: `[ <'view-timeline-name'> <'view-timeline-axis'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline + */ + viewTimeline?: Property.ViewTimeline | undefined; +} + +export interface StandardProperties<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardLonghandProperties<TLength, TTime>, + StandardShorthandProperties<TLength, TTime> {} + +export interface VendorLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + MozAnimationDelay?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + */ + MozAnimationDirection?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + MozAnimationDuration?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + */ + MozAnimationFillMode?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + */ + MozAnimationIterationCount?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + */ + MozAnimationName?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + */ + MozAnimationPlayState?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + MozAnimationTimingFunction?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | button | button-arrow-down | button-arrow-next | button-arrow-previous | button-arrow-up | button-bevel | button-focus | caret | checkbox | checkbox-container | checkbox-label | checkmenuitem | dualbutton | groupbox | listbox | listitem | menuarrow | menubar | menucheckbox | menuimage | menuitem | menuitemtext | menulist | menulist-button | menulist-text | menulist-textfield | menupopup | menuradio | menuseparator | meterbar | meterchunk | progressbar | progressbar-vertical | progresschunk | progresschunk-vertical | radio | radio-container | radio-label | radiomenuitem | range | range-thumb | resizer | resizerpanel | scale-horizontal | scalethumbend | scalethumb-horizontal | scalethumbstart | scalethumbtick | scalethumb-vertical | scale-vertical | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | separator | sheet | spinner | spinner-downbutton | spinner-textfield | spinner-upbutton | splitter | statusbar | statusbarpanel | tab | tabpanel | tabpanels | tab-scroll-arrow-back | tab-scroll-arrow-forward | textfield | textfield-multiline | toolbar | toolbarbutton | toolbarbutton-dropdown | toolbargripper | toolbox | tooltip | treeheader | treeheadercell | treeheadersortarrow | treeitem | treeline | treetwisty | treetwistyopen | treeview | -moz-mac-unified-toolbar | -moz-win-borderless-glass | -moz-win-browsertabbar-toolbox | -moz-win-communicationstext | -moz-win-communications-toolbox | -moz-win-exclude-glass | -moz-win-glass | -moz-win-mediatext | -moz-win-media-toolbox | -moz-window-button-box | -moz-window-button-box-maximized | -moz-window-button-close | -moz-window-button-maximize | -moz-window-button-minimize | -moz-window-button-restore | -moz-window-frame-bottom | -moz-window-frame-left | -moz-window-frame-right | -moz-window-titlebar | -moz-window-titlebar-maximized` + * + * **Initial value**: `none` (but this value is overridden in the user agent CSS) + */ + MozAppearance?: Property.MozAppearance | undefined; + /** + * The **`-moz-binding`** CSS property is used by Mozilla-based applications to attach an XBL binding to a DOM element. + * + * **Syntax**: `<url> | none` + * + * **Initial value**: `none` + */ + MozBinding?: Property.MozBinding | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-bottom-colors`** CSS property sets a list of colors for the bottom border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + MozBorderBottomColors?: Property.MozBorderBottomColors | undefined; + /** + * The **`border-inline-end-color`** CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + */ + MozBorderEndColor?: Property.BorderInlineEndColor | undefined; + /** + * The **`border-inline-end-style`** CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + */ + MozBorderEndStyle?: Property.BorderInlineEndStyle | undefined; + /** + * The **`border-inline-end-width`** CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + */ + MozBorderEndWidth?: Property.BorderInlineEndWidth<TLength> | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-left-colors`** CSS property sets a list of colors for the left border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + MozBorderLeftColors?: Property.MozBorderLeftColors | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-right-colors`** CSS property sets a list of colors for the right border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + MozBorderRightColors?: Property.MozBorderRightColors | undefined; + /** + * The **`border-inline-start-color`** CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + */ + MozBorderStartColor?: Property.BorderInlineStartColor | undefined; + /** + * The **`border-inline-start-style`** CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + */ + MozBorderStartStyle?: Property.BorderInlineStartStyle | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-top-colors`** CSS property sets a list of colors for the top border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + MozBorderTopColors?: Property.MozBorderTopColors | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + */ + MozBoxSizing?: Property.BoxSizing | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + */ + MozColumnCount?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + */ + MozColumnFill?: Property.ColumnFill | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + MozColumnRuleColor?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + MozColumnRuleStyle?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + MozColumnRuleWidth?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + */ + MozColumnWidth?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`-moz-context-properties`** property can be used within privileged contexts in Firefox to share the values of specified properties of the element with a child SVG image. + * + * **Syntax**: `none | [ fill | fill-opacity | stroke | stroke-opacity ]#` + * + * **Initial value**: `none` + */ + MozContextProperties?: Property.MozContextProperties | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + */ + MozFontFeatureSettings?: Property.FontFeatureSettings | undefined; + /** + * The **`font-language-override`** CSS property controls the use of language-specific glyphs in a typeface. + * + * **Syntax**: `normal | <string>` + * + * **Initial value**: `normal` + */ + MozFontLanguageOverride?: Property.FontLanguageOverride | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + MozHyphens?: Property.Hyphens | undefined; + /** + * For certain XUL elements and pseudo-elements that use an image from the `list-style-image` property, this property specifies a region of the image that is used in place of the whole image. This allows elements to use different pieces of the same image to improve performance. + * + * **Syntax**: `<shape> | auto` + * + * **Initial value**: `auto` + */ + MozImageRegion?: Property.MozImageRegion | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + MozMarginEnd?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + MozMarginStart?: Property.MarginInlineStart<TLength> | undefined; + /** + * The **`-moz-orient`** CSS property specifies the orientation of the element to which it's applied. + * + * **Syntax**: `inline | block | horizontal | vertical` + * + * **Initial value**: `inline` + */ + MozOrient?: Property.MozOrient | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + */ + MozOsxFontSmoothing?: Property.FontSmooth<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-bottomleft`** CSS property can be used to round the bottom-left corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + MozOutlineRadiusBottomleft?: Property.MozOutlineRadiusBottomleft<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-bottomright`** CSS property can be used to round the bottom-right corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + MozOutlineRadiusBottomright?: Property.MozOutlineRadiusBottomright<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-topleft`** CSS property can be used to round the top-left corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + MozOutlineRadiusTopleft?: Property.MozOutlineRadiusTopleft<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-topright`** CSS property can be used to round the top-right corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + MozOutlineRadiusTopright?: Property.MozOutlineRadiusTopright<TLength> | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + MozPaddingEnd?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + MozPaddingStart?: Property.PaddingInlineStart<TLength> | undefined; + /** + * **`-moz-stack-sizing`** is an extended CSS property. Normally, a `<xul:stack>` will change its size so that all of its child elements are completely visible. For example, moving a child of the stack far to the right will widen the stack so the child remains visible. + * + * **Syntax**: `ignore | stretch-to-fit` + * + * **Initial value**: `stretch-to-fit` + */ + MozStackSizing?: Property.MozStackSizing | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + */ + MozTabSize?: Property.TabSize<TLength> | undefined; + /** + * The **`-moz-text-blink`** non-standard Mozilla CSS extension specifies the blink mode. + * + * **Syntax**: `none | blink` + * + * **Initial value**: `none` + */ + MozTextBlink?: Property.MozTextBlink | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + */ + MozTextSizeAdjust?: Property.TextSizeAdjust | undefined; + /** + * The **`-moz-user-focus`** CSS property is used to indicate whether an element can have the focus. + * + * **Syntax**: `ignore | normal | select-after | select-before | select-menu | select-same | select-all | none` + * + * **Initial value**: `none` + */ + MozUserFocus?: Property.MozUserFocus | undefined; + /** + * The **`user-modify`** property has no effect in Firefox. It was originally planned to determine whether or not the content of an element can be edited by a user. + * + * **Syntax**: `read-only | read-write | write-only` + * + * **Initial value**: `read-only` + */ + MozUserModify?: Property.MozUserModify | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + */ + MozUserSelect?: Property.UserSelect | undefined; + /** + * The **`-moz-window-dragging`** CSS property specifies whether a window is draggable or not. It only works in Chrome code, and only on Mac OS X. + * + * **Syntax**: `drag | no-drag` + * + * **Initial value**: `drag` + */ + MozWindowDragging?: Property.MozWindowDragging | undefined; + /** + * The **`-moz-window-shadow`** CSS property specifies whether a window will have a shadow. It only works on Mac OS X. + * + * **Syntax**: `default | menu | tooltip | sheet | none` + * + * **Initial value**: `default` + */ + MozWindowShadow?: Property.MozWindowShadow | undefined; + /** + * The **`-ms-accelerator`** CSS property is a Microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut. + * + * **Syntax**: `false | true` + * + * **Initial value**: `false` + */ + msAccelerator?: Property.MsAccelerator | undefined; + /** + * The **`-ms-block-progression`** CSS property is a Microsoft extension that specifies the block progression and layout orientation. + * + * **Syntax**: `tb | rl | bt | lr` + * + * **Initial value**: `tb` + */ + msBlockProgression?: Property.MsBlockProgression | undefined; + /** + * The **`-ms-content-zoom-chaining`** CSS property is a Microsoft extension specifying the zoom behavior that occurs when a user hits the zoom limit during page manipulation. + * + * **Syntax**: `none | chained` + * + * **Initial value**: `none` + */ + msContentZoomChaining?: Property.MsContentZoomChaining | undefined; + /** + * The **`-ms-content-zoom-limit-max`** CSS property is a Microsoft extension that specifies the selected elements' maximum zoom factor. + * + * **Syntax**: `<percentage>` + * + * **Initial value**: `400%` + */ + msContentZoomLimitMax?: Property.MsContentZoomLimitMax | undefined; + /** + * The **`-ms-content-zoom-limit-min`** CSS property is a Microsoft extension that specifies the minimum zoom factor. + * + * **Syntax**: `<percentage>` + * + * **Initial value**: `100%` + */ + msContentZoomLimitMin?: Property.MsContentZoomLimitMin | undefined; + /** + * The **`-ms-content-zoom-snap-points`** CSS property is a Microsoft extension that specifies where zoom snap-points are located. + * + * **Syntax**: `snapInterval( <percentage>, <percentage> ) | snapList( <percentage># )` + * + * **Initial value**: `snapInterval(0%, 100%)` + */ + msContentZoomSnapPoints?: Property.MsContentZoomSnapPoints | undefined; + /** + * The **`-ms-content-zoom-snap-type`** CSS property is a Microsoft extension that specifies how zooming is affected by defined snap-points. + * + * **Syntax**: `none | proximity | mandatory` + * + * **Initial value**: `none` + */ + msContentZoomSnapType?: Property.MsContentZoomSnapType | undefined; + /** + * The **`-ms-content-zooming`** CSS property is a Microsoft extension that specifies whether zooming is enabled. + * + * **Syntax**: `none | zoom` + * + * **Initial value**: zoom for the top level element, none for all other elements + */ + msContentZooming?: Property.MsContentZooming | undefined; + /** + * The `-ms-filter` CSS property is a Microsoft extension that sets or retrieves the filter or collection of filters applied to an object. + * + * **Syntax**: `<string>` + * + * **Initial value**: "" (the empty string) + */ + msFilter?: Property.MsFilter | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + */ + msFlexDirection?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + */ + msFlexPositive?: Property.FlexGrow | undefined; + /** + * The **`-ms-flow-from`** CSS property is a Microsoft extension that gets or sets a value identifying a region container in the document that accepts the content flow from the data source. + * + * **Syntax**: `[ none | <custom-ident> ]#` + * + * **Initial value**: `none` + */ + msFlowFrom?: Property.MsFlowFrom | undefined; + /** + * The **`-ms-flow-into`** CSS property is a Microsoft extension that gets or sets a value identifying an iframe container in the document that serves as the region's data source. + * + * **Syntax**: `[ none | <custom-ident> ]#` + * + * **Initial value**: `none` + */ + msFlowInto?: Property.MsFlowInto | undefined; + /** + * The **`grid-template-columns`** CSS property defines the line names and track sizing functions of the grid columns. + * + * **Syntax**: `none | <track-list> | <auto-track-list>` + * + * **Initial value**: `none` + */ + msGridColumns?: Property.MsGridColumns<TLength> | undefined; + /** + * The **`grid-template-rows`** CSS property defines the line names and track sizing functions of the grid rows. + * + * **Syntax**: `none | <track-list> | <auto-track-list>` + * + * **Initial value**: `none` + */ + msGridRows?: Property.MsGridRows<TLength> | undefined; + /** + * The **`-ms-high-contrast-adjust`** CSS property is a Microsoft extension that gets or sets a value indicating whether to override any CSS properties that would have been set in high contrast mode. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + */ + msHighContrastAdjust?: Property.MsHighContrastAdjust | undefined; + /** + * The **`-ms-hyphenate-limit-chars`** CSS property is a Microsoft extension that specifies one to three values indicating the minimum number of characters in a hyphenated word. If the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated. + * + * **Syntax**: `auto | <integer>{1,3}` + * + * **Initial value**: `auto` + */ + msHyphenateLimitChars?: Property.MsHyphenateLimitChars | undefined; + /** + * The **`-ms-hyphenate-limit-lines`** CSS property is a Microsoft extension specifying the maximum number of consecutive lines in an element that may be ended with a hyphenated word. + * + * **Syntax**: `no-limit | <integer>` + * + * **Initial value**: `no-limit` + */ + msHyphenateLimitLines?: Property.MsHyphenateLimitLines | undefined; + /** + * The `**-ms-hyphenate-limit-zone**` CSS property is a Microsoft extension specifying the width of the hyphenation zone. + * + * **Syntax**: `<percentage> | <length>` + * + * **Initial value**: `0` + */ + msHyphenateLimitZone?: Property.MsHyphenateLimitZone<TLength> | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + msHyphens?: Property.Hyphens | undefined; + /** + * The **`-ms-ime-align`** CSS property is a Microsoft extension aligning the Input Method Editor (IME) candidate window box relative to the element on which the IME composition is active. The extension is implemented in Microsoft Edge and Internet Explorer 11. + * + * **Syntax**: `auto | after` + * + * **Initial value**: `auto` + */ + msImeAlign?: Property.MsImeAlign | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + */ + msLineBreak?: Property.LineBreak | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + */ + msOrder?: Property.Order | undefined; + /** + * The **`-ms-overflow-style`** CSS property is a Microsoft extension controlling the behavior of scrollbars when the content of an element overflows. + * + * **Syntax**: `auto | none | scrollbar | -ms-autohiding-scrollbar` + * + * **Initial value**: `auto` + */ + msOverflowStyle?: Property.MsOverflowStyle | undefined; + /** + * The **`overflow-x`** CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + */ + msOverflowX?: Property.OverflowX | undefined; + /** + * The **`overflow-y`** CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + */ + msOverflowY?: Property.OverflowY | undefined; + /** + * The `**-ms-scroll-chaining**` CSS property is a Microsoft extension that specifies the scrolling behavior that occurs when a user hits the scroll limit during a manipulation. + * + * **Syntax**: `chained | none` + * + * **Initial value**: `chained` + */ + msScrollChaining?: Property.MsScrollChaining | undefined; + /** + * The `**-ms-scroll-limit-x-max**` CSS property is a Microsoft extension that specifies the maximum value for the `Element.scrollLeft` property. + * + * **Syntax**: `auto | <length>` + * + * **Initial value**: `auto` + */ + msScrollLimitXMax?: Property.MsScrollLimitXMax<TLength> | undefined; + /** + * The **`-ms-scroll-limit-x-min`** CSS property is a Microsoft extension that specifies the minimum value for the `Element.scrollLeft` property. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + msScrollLimitXMin?: Property.MsScrollLimitXMin<TLength> | undefined; + /** + * The **`-ms-scroll-limit-y-max`** CSS property is a Microsoft extension that specifies the maximum value for the `Element.scrollTop` property. + * + * **Syntax**: `auto | <length>` + * + * **Initial value**: `auto` + */ + msScrollLimitYMax?: Property.MsScrollLimitYMax<TLength> | undefined; + /** + * The **`-ms-scroll-limit-y-min`** CSS property is a Microsoft extension that specifies the minimum value for the `Element.scrollTop` property. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + msScrollLimitYMin?: Property.MsScrollLimitYMin<TLength> | undefined; + /** + * The **`-ms-scroll-rails`** CSS property is a Microsoft extension that specifies whether scrolling locks to the primary axis of motion. + * + * **Syntax**: `none | railed` + * + * **Initial value**: `railed` + */ + msScrollRails?: Property.MsScrollRails | undefined; + /** + * The **`-ms-scroll-snap-points-x`** CSS property is a Microsoft extension that specifies where snap-points will be located along the x-axis. + * + * **Syntax**: `snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )` + * + * **Initial value**: `snapInterval(0px, 100%)` + */ + msScrollSnapPointsX?: Property.MsScrollSnapPointsX | undefined; + /** + * The **`-ms-scroll-snap-points-y`** CSS property is a Microsoft extension that specifies where snap-points will be located along the y-axis. + * + * **Syntax**: `snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )` + * + * **Initial value**: `snapInterval(0px, 100%)` + */ + msScrollSnapPointsY?: Property.MsScrollSnapPointsY | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | proximity | mandatory` + * + * **Initial value**: `none` + */ + msScrollSnapType?: Property.MsScrollSnapType | undefined; + /** + * The **`-ms-scroll-translation`** CSS property is a Microsoft extension that specifies whether vertical-to-horizontal scroll wheel translation occurs on the specified element. + * + * **Syntax**: `none | vertical-to-horizontal` + * + * **Initial value**: `none` + */ + msScrollTranslation?: Property.MsScrollTranslation | undefined; + /** + * The **`-ms-scrollbar-3dlight-color`** CSS property is a Microsoft extension specifying the color of the top and left edges of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: depends on user agent + */ + msScrollbar3dlightColor?: Property.MsScrollbar3dlightColor | undefined; + /** + * The **`-ms-scrollbar-arrow-color`** CSS property is a Microsoft extension that specifies the color of the arrow elements of a scroll arrow. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ButtonText` + */ + msScrollbarArrowColor?: Property.MsScrollbarArrowColor | undefined; + /** + * The `**-ms-scrollbar-base-color**` CSS property is a Microsoft extension that specifies the base color of the main elements of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: depends on user agent + */ + msScrollbarBaseColor?: Property.MsScrollbarBaseColor | undefined; + /** + * The **`-ms-scrollbar-darkshadow-color`** CSS property is a Microsoft extension that specifies the color of a scroll bar's gutter. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDDarkShadow` + */ + msScrollbarDarkshadowColor?: Property.MsScrollbarDarkshadowColor | undefined; + /** + * The `**-ms-scrollbar-face-color**` CSS property is a Microsoft extension that specifies the color of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDFace` + */ + msScrollbarFaceColor?: Property.MsScrollbarFaceColor | undefined; + /** + * The `**-ms-scrollbar-highlight-color**` CSS property is a Microsoft extension that specifies the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDHighlight` + */ + msScrollbarHighlightColor?: Property.MsScrollbarHighlightColor | undefined; + /** + * The **`-ms-scrollbar-shadow-color`** CSS property is a Microsoft extension that specifies the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDDarkShadow` + */ + msScrollbarShadowColor?: Property.MsScrollbarShadowColor | undefined; + /** + * The **`-ms-scrollbar-track-color`** CSS property is a Microsoft extension that specifies the color of the track element of a scrollbar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `Scrollbar` + */ + msScrollbarTrackColor?: Property.MsScrollbarTrackColor | undefined; + /** + * The **`-ms-text-autospace`** CSS property is a Microsoft extension that specifies the autospacing and narrow space width adjustment of text. + * + * **Syntax**: `none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space` + * + * **Initial value**: `none` + */ + msTextAutospace?: Property.MsTextAutospace | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + */ + msTextCombineHorizontal?: Property.TextCombineUpright | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + */ + msTextOverflow?: Property.TextOverflow | undefined; + /** + * The **`touch-action`** CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser). + * + * **Syntax**: `auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation` + * + * **Initial value**: `auto` + */ + msTouchAction?: Property.TouchAction | undefined; + /** + * The **`-ms-touch-select`** CSS property is a Microsoft extension that toggles the gripper visual elements that enable touch text selection. + * + * **Syntax**: `grippers | none` + * + * **Initial value**: `grippers` + */ + msTouchSelect?: Property.MsTouchSelect | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + */ + msTransform?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + */ + msTransformOrigin?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + msTransitionDelay?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + msTransitionDuration?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + */ + msTransitionProperty?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + msTransitionTimingFunction?: Property.TransitionTimingFunction | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `none | element | text` + * + * **Initial value**: `text` + */ + msUserSelect?: Property.MsUserSelect | undefined; + /** + * The **`word-break`** CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box. + * + * **Syntax**: `normal | break-all | keep-all | break-word` + * + * **Initial value**: `normal` + */ + msWordBreak?: Property.WordBreak | undefined; + /** + * The **`-ms-wrap-flow`** CSS property is a Microsoft extension that specifies how exclusions impact inline content within block-level elements. + * + * **Syntax**: `auto | both | start | end | maximum | clear` + * + * **Initial value**: `auto` + */ + msWrapFlow?: Property.MsWrapFlow | undefined; + /** + * The **`-ms-wrap-margin`** CSS property is a Microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + msWrapMargin?: Property.MsWrapMargin<TLength> | undefined; + /** + * The **`-ms-wrap-through`** CSS property is a Microsoft extension that specifies how content should wrap around an exclusion element. + * + * **Syntax**: `wrap | none` + * + * **Initial value**: `wrap` + */ + msWrapThrough?: Property.MsWrapThrough | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + */ + msWritingMode?: Property.WritingMode | undefined; + /** + * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. + * + * **Syntax**: `normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>` + * + * **Initial value**: `normal` + */ + WebkitAlignContent?: Property.AlignContent | undefined; + /** + * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. + * + * **Syntax**: `normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]` + * + * **Initial value**: `normal` + */ + WebkitAlignItems?: Property.AlignItems | undefined; + /** + * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>` + * + * **Initial value**: `auto` + */ + WebkitAlignSelf?: Property.AlignSelf | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + WebkitAnimationDelay?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + */ + WebkitAnimationDirection?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + WebkitAnimationDuration?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + */ + WebkitAnimationFillMode?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + */ + WebkitAnimationIterationCount?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + */ + WebkitAnimationName?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + */ + WebkitAnimationPlayState?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + WebkitAnimationTimingFunction?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button` + * + * **Initial value**: `none` (but this value is overridden in the user agent CSS) + */ + WebkitAppearance?: Property.WebkitAppearance | undefined; + /** + * The **`backdrop-filter`** CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything _behind_ the element, to see the effect you must make the element or its background at least partially transparent. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + */ + WebkitBackdropFilter?: Property.BackdropFilter | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + */ + WebkitBackfaceVisibility?: Property.BackfaceVisibility | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + */ + WebkitBackgroundClip?: Property.BackgroundClip | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + */ + WebkitBackgroundOrigin?: Property.BackgroundOrigin | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + */ + WebkitBackgroundSize?: Property.BackgroundSize<TLength> | undefined; + /** + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitBorderBeforeColor?: Property.WebkitBorderBeforeColor | undefined; + /** + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + WebkitBorderBeforeStyle?: Property.WebkitBorderBeforeStyle | undefined; + /** + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + WebkitBorderBeforeWidth?: Property.WebkitBorderBeforeWidth<TLength> | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + WebkitBorderBottomLeftRadius?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + WebkitBorderBottomRightRadius?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-image-slice`** CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image. + * + * **Syntax**: `<number-percentage>{1,4} && fill?` + * + * **Initial value**: `100%` + */ + WebkitBorderImageSlice?: Property.BorderImageSlice | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + WebkitBorderTopLeftRadius?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + WebkitBorderTopRightRadius?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + */ + WebkitBoxDecorationBreak?: Property.BoxDecorationBreak | undefined; + /** + * The **`-webkit-box-reflect`** CSS property lets you reflect the content of an element in one specific direction. + * + * **Syntax**: `[ above | below | right | left ]? <length>? <image>?` + * + * **Initial value**: `none` + */ + WebkitBoxReflect?: Property.WebkitBoxReflect<TLength> | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + */ + WebkitBoxShadow?: Property.BoxShadow | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + */ + WebkitBoxSizing?: Property.BoxSizing | undefined; + /** + * The **`clip-path`** CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. + * + * **Syntax**: `<clip-source> | [ <basic-shape> || <geometry-box> ] | none` + * + * **Initial value**: `none` + */ + WebkitClipPath?: Property.ClipPath | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + */ + WebkitColumnCount?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + */ + WebkitColumnFill?: Property.ColumnFill | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitColumnRuleColor?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + WebkitColumnRuleStyle?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + WebkitColumnRuleWidth?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-span`** CSS property makes it possible for an element to span across all columns when its value is set to `all`. + * + * **Syntax**: `none | all` + * + * **Initial value**: `none` + */ + WebkitColumnSpan?: Property.ColumnSpan | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + */ + WebkitColumnWidth?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`filter`** CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + */ + WebkitFilter?: Property.Filter | undefined; + /** + * The **`flex-basis`** CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with `box-sizing`. + * + * **Syntax**: `content | <'width'>` + * + * **Initial value**: `auto` + */ + WebkitFlexBasis?: Property.FlexBasis<TLength> | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + */ + WebkitFlexDirection?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + */ + WebkitFlexGrow?: Property.FlexGrow | undefined; + /** + * The **`flex-shrink`** CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to `flex-shrink`. + * + * **Syntax**: `<number>` + * + * **Initial value**: `1` + */ + WebkitFlexShrink?: Property.FlexShrink | undefined; + /** + * The **`flex-wrap`** CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. + * + * **Syntax**: `nowrap | wrap | wrap-reverse` + * + * **Initial value**: `nowrap` + */ + WebkitFlexWrap?: Property.FlexWrap | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + */ + WebkitFontFeatureSettings?: Property.FontFeatureSettings | undefined; + /** + * The **`font-kerning`** CSS property sets the use of the kerning information stored in a font. + * + * **Syntax**: `auto | normal | none` + * + * **Initial value**: `auto` + */ + WebkitFontKerning?: Property.FontKerning | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + */ + WebkitFontSmoothing?: Property.FontSmooth<TLength> | undefined; + /** + * The **`font-variant-ligatures`** CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]` + * + * **Initial value**: `normal` + */ + WebkitFontVariantLigatures?: Property.FontVariantLigatures | undefined; + /** + * The **`hyphenate-character`** CSS property sets the character (or string) used at the end of a line before a hyphenation break. + * + * **Syntax**: `auto | <string>` + * + * **Initial value**: `auto` + */ + WebkitHyphenateCharacter?: Property.HyphenateCharacter | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + WebkitHyphens?: Property.Hyphens | undefined; + /** + * The `initial-letter` CSS property sets styling for dropped, raised, and sunken initial letters. + * + * **Syntax**: `normal | [ <number> <integer>? ]` + * + * **Initial value**: `normal` + */ + WebkitInitialLetter?: Property.InitialLetter | undefined; + /** + * The CSS **`justify-content`** property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. + * + * **Syntax**: `normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]` + * + * **Initial value**: `normal` + */ + WebkitJustifyContent?: Property.JustifyContent | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + */ + WebkitLineBreak?: Property.LineBreak | undefined; + /** + * The **`-webkit-line-clamp`** CSS property allows limiting of the contents of a block to the specified number of lines. + * + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + WebkitLineClamp?: Property.WebkitLineClamp | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + WebkitMarginEnd?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + WebkitMarginStart?: Property.MarginInlineStart<TLength> | undefined; + /** + * If a `mask-image` is specified, `-webkit-mask-attachment` determines whether the mask image's position is fixed within the viewport, or scrolls along with its containing block. + * + * **Syntax**: `<attachment>#` + * + * **Initial value**: `scroll` + */ + WebkitMaskAttachment?: Property.WebkitMaskAttachment | undefined; + /** + * The **`mask-border-outset`** CSS property specifies the distance by which an element's mask border is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + */ + WebkitMaskBoxImageOutset?: Property.MaskBorderOutset<TLength> | undefined; + /** + * The **`mask-border-repeat`** CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + */ + WebkitMaskBoxImageRepeat?: Property.MaskBorderRepeat | undefined; + /** + * The **`mask-border-slice`** CSS property divides the image set by `mask-border-source` into regions. These regions are used to form the components of an element's mask border. + * + * **Syntax**: `<number-percentage>{1,4} fill?` + * + * **Initial value**: `0` + */ + WebkitMaskBoxImageSlice?: Property.MaskBorderSlice | undefined; + /** + * The **`mask-border-source`** CSS property sets the source image used to create an element's mask border. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + */ + WebkitMaskBoxImageSource?: Property.MaskBorderSource | undefined; + /** + * The **`mask-border-width`** CSS property sets the width of an element's mask border. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `auto` + */ + WebkitMaskBoxImageWidth?: Property.MaskBorderWidth<TLength> | undefined; + /** + * The **`mask-clip`** CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area. + * + * **Syntax**: `[ <box> | border | padding | content | text ]#` + * + * **Initial value**: `border` + */ + WebkitMaskClip?: Property.WebkitMaskClip | undefined; + /** + * The **`-webkit-mask-composite`** property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the `-webkit-mask-image` property. + * + * **Syntax**: `<composite-style>#` + * + * **Initial value**: `source-over` + */ + WebkitMaskComposite?: Property.WebkitMaskComposite | undefined; + /** + * The **`mask-image`** CSS property sets the image that is used as mask layer for an element. By default this means the alpha channel of the mask image will be multiplied with the alpha channel of the element. This can be controlled with the `mask-mode` property. + * + * **Syntax**: `<mask-reference>#` + * + * **Initial value**: `none` + */ + WebkitMaskImage?: Property.WebkitMaskImage | undefined; + /** + * The **`mask-origin`** CSS property sets the origin of a mask. + * + * **Syntax**: `[ <box> | border | padding | content ]#` + * + * **Initial value**: `padding` + */ + WebkitMaskOrigin?: Property.WebkitMaskOrigin | undefined; + /** + * The **`mask-position`** CSS property sets the initial position, relative to the mask position layer set by `mask-origin`, for each defined mask image. + * + * **Syntax**: `<position>#` + * + * **Initial value**: `0% 0%` + */ + WebkitMaskPosition?: Property.WebkitMaskPosition<TLength> | undefined; + /** + * The `-webkit-mask-position-x` CSS property sets the initial horizontal position of a mask image. + * + * **Syntax**: `[ <length-percentage> | left | center | right ]#` + * + * **Initial value**: `0%` + */ + WebkitMaskPositionX?: Property.WebkitMaskPositionX<TLength> | undefined; + /** + * The `-webkit-mask-position-y` CSS property sets the initial vertical position of a mask image. + * + * **Syntax**: `[ <length-percentage> | top | center | bottom ]#` + * + * **Initial value**: `0%` + */ + WebkitMaskPositionY?: Property.WebkitMaskPositionY<TLength> | undefined; + /** + * The **`mask-repeat`** CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + */ + WebkitMaskRepeat?: Property.WebkitMaskRepeat | undefined; + /** + * The `-webkit-mask-repeat-x` property specifies whether and how a mask image is repeated (tiled) horizontally. + * + * **Syntax**: `repeat | no-repeat | space | round` + * + * **Initial value**: `repeat` + */ + WebkitMaskRepeatX?: Property.WebkitMaskRepeatX | undefined; + /** + * The `-webkit-mask-repeat-y` property sets whether and how a mask image is repeated (tiled) vertically. + * + * **Syntax**: `repeat | no-repeat | space | round` + * + * **Initial value**: `repeat` + */ + WebkitMaskRepeatY?: Property.WebkitMaskRepeatY | undefined; + /** + * The **`mask-size`** CSS property specifies the sizes of the mask images. The size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + */ + WebkitMaskSize?: Property.WebkitMaskSize<TLength> | undefined; + /** + * The **`max-inline-size`** CSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the `max-width` or the `max-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + */ + WebkitMaxInlineSize?: Property.MaxInlineSize<TLength> | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + */ + WebkitOrder?: Property.Order | undefined; + /** + * The `-webkit-overflow-scrolling` CSS property controls whether or not touch devices use momentum-based scrolling for a given element. + * + * **Syntax**: `auto | touch` + * + * **Initial value**: `auto` + */ + WebkitOverflowScrolling?: Property.WebkitOverflowScrolling | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + WebkitPaddingEnd?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + WebkitPaddingStart?: Property.PaddingInlineStart<TLength> | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + */ + WebkitPerspective?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + */ + WebkitPerspectiveOrigin?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + */ + WebkitPrintColorAdjust?: Property.PrintColorAdjust | undefined; + /** + * The **`ruby-position`** CSS property defines the position of a ruby element relatives to its base element. It can be positioned over the element (`over`), under it (`under`), or between the characters on their right side (`inter-character`). + * + * **Syntax**: `[ alternate || [ over | under ] ] | inter-character` + * + * **Initial value**: `alternate` + */ + WebkitRubyPosition?: Property.RubyPosition | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | [ x | y | block | inline | both ] [ mandatory | proximity ]?` + * + * **Initial value**: `none` + */ + WebkitScrollSnapType?: Property.ScrollSnapType | undefined; + /** + * The **`shape-margin`** CSS property sets a margin for a CSS shape created using `shape-outside`. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + */ + WebkitShapeMargin?: Property.ShapeMargin<TLength> | undefined; + /** + * **`-webkit-tap-highlight-color`** is a non-standard CSS property that sets the color of the highlight that appears over a link while it's being tapped. The highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. + * + * **Syntax**: `<color>` + * + * **Initial value**: `black` + */ + WebkitTapHighlightColor?: Property.WebkitTapHighlightColor | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + */ + WebkitTextCombine?: Property.TextCombineUpright | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitTextDecorationColor?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + */ + WebkitTextDecorationLine?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-skip`** CSS property sets what parts of an element's content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors. + * + * **Syntax**: `none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]` + * + * **Initial value**: `objects` + */ + WebkitTextDecorationSkip?: Property.TextDecorationSkip | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + */ + WebkitTextDecorationStyle?: Property.TextDecorationStyle | undefined; + /** + * The **`text-emphasis-color`** CSS property sets the color of emphasis marks. This value can also be set using the `text-emphasis` shorthand. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitTextEmphasisColor?: Property.TextEmphasisColor | undefined; + /** + * The **`text-emphasis-position`** CSS property sets where emphasis marks are drawn. Like ruby text, if there isn't enough room for emphasis marks, the line height is increased. + * + * **Syntax**: `[ over | under ] && [ right | left ]` + * + * **Initial value**: `over right` + */ + WebkitTextEmphasisPosition?: Property.TextEmphasisPosition | undefined; + /** + * The **`text-emphasis-style`** CSS property sets the appearance of emphasis marks. It can also be set, and reset, using the `text-emphasis` shorthand. + * + * **Syntax**: `none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>` + * + * **Initial value**: `none` + */ + WebkitTextEmphasisStyle?: Property.TextEmphasisStyle | undefined; + /** + * The **`-webkit-text-fill-color`** CSS property specifies the fill color of characters of text. If this property is not set, the value of the `color` property is used. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitTextFillColor?: Property.WebkitTextFillColor | undefined; + /** + * The **`text-orientation`** CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when `writing-mode` is not `horizontal-tb`). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers. + * + * **Syntax**: `mixed | upright | sideways` + * + * **Initial value**: `mixed` + */ + WebkitTextOrientation?: Property.TextOrientation | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + */ + WebkitTextSizeAdjust?: Property.TextSizeAdjust | undefined; + /** + * The **`-webkit-text-stroke-color`** CSS property specifies the stroke color of characters of text. If this property is not set, the value of the `color` property is used. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + WebkitTextStrokeColor?: Property.WebkitTextStrokeColor | undefined; + /** + * The **`-webkit-text-stroke-width`** CSS property specifies the width of the stroke for text. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + WebkitTextStrokeWidth?: Property.WebkitTextStrokeWidth<TLength> | undefined; + /** + * The **`text-underline-position`** CSS property specifies the position of the underline which is set using the `text-decoration` property's `underline` value. + * + * **Syntax**: `auto | from-font | [ under || [ left | right ] ]` + * + * **Initial value**: `auto` + */ + WebkitTextUnderlinePosition?: Property.TextUnderlinePosition | undefined; + /** + * The `-webkit-touch-callout` CSS property controls the display of the default callout shown when you touch and hold a touch target. + * + * **Syntax**: `default | none` + * + * **Initial value**: `default` + */ + WebkitTouchCallout?: Property.WebkitTouchCallout | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + */ + WebkitTransform?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + */ + WebkitTransformOrigin?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + */ + WebkitTransformStyle?: Property.TransformStyle | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + WebkitTransitionDelay?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + WebkitTransitionDuration?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + */ + WebkitTransitionProperty?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + WebkitTransitionTimingFunction?: Property.TransitionTimingFunction | undefined; + /** + * **Syntax**: `read-only | read-write | read-write-plaintext-only` + * + * **Initial value**: `read-only` + */ + WebkitUserModify?: Property.WebkitUserModify | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + */ + WebkitUserSelect?: Property.UserSelect | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + */ + WebkitWritingMode?: Property.WritingMode | undefined; +} + +export interface VendorShorthandProperties<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + */ + MozAnimation?: Property.Animation<TTime> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + */ + MozBorderImage?: Property.BorderImage | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + */ + MozColumnRule?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + */ + MozColumns?: Property.Columns<TLength> | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-outline-radius`** CSS shorthand property can be used to give an element's `outline` rounded corners. + * + * **Syntax**: `<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?` + */ + MozOutlineRadius?: Property.MozOutlineRadius<TLength> | undefined; + /** + * The **`-ms-content-zoom-limit`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-content-zoom-limit-min` and `-ms-content-zoom-limit-max` properties. + * + * **Syntax**: `<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>` + */ + msContentZoomLimit?: Property.MsContentZoomLimit | undefined; + /** + * The **`-ms-content-zoom-snap`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-content-zoom-snap-type` and `-ms-content-zoom-snap-points` properties. + * + * **Syntax**: `<'-ms-content-zoom-snap-type'> || <'-ms-content-zoom-snap-points'>` + */ + msContentZoomSnap?: Property.MsContentZoomSnap | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + */ + msFlex?: Property.Flex<TLength> | undefined; + /** + * The **\-ms-scroll-limit** CSS property is a Microsoft extension that specifies values for the `-ms-scroll-limit-x-min`, `-ms-scroll-limit-y-min`, `-ms-scroll-limit-x-max`, and `-ms-scroll-limit-y-max` properties. + * + * **Syntax**: `<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>` + */ + msScrollLimit?: Property.MsScrollLimit | undefined; + /** + * The **`-ms-scroll-snap-x`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-scroll-snap-type` and `-ms-scroll-snap-points-x` properties. + * + * **Syntax**: `<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>` + */ + msScrollSnapX?: Property.MsScrollSnapX | undefined; + /** + * The **`-ms-scroll-snap-x`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-scroll-snap-type` and `-ms-scroll-snap-points-y` properties. + * + * **Syntax**: `<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>` + */ + msScrollSnapY?: Property.MsScrollSnapY | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + */ + msTransition?: Property.Transition<TTime> | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + */ + WebkitAnimation?: Property.Animation<TTime> | undefined; + /** + * The **`-webkit-border-before`** CSS property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-width'> || <'border-style'> || <color>` + */ + WebkitBorderBefore?: Property.WebkitBorderBefore<TLength> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + */ + WebkitBorderImage?: Property.BorderImage | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + */ + WebkitBorderRadius?: Property.BorderRadius<TLength> | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + */ + WebkitColumnRule?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + */ + WebkitColumns?: Property.Columns<TLength> | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + */ + WebkitFlex?: Property.Flex<TLength> | undefined; + /** + * The **`flex-flow`** CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. + * + * **Syntax**: `<'flex-direction'> || <'flex-wrap'>` + */ + WebkitFlexFlow?: Property.FlexFlow | undefined; + /** + * The **`mask`** CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points. + * + * **Syntax**: `[ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#` + */ + WebkitMask?: Property.WebkitMask<TLength> | undefined; + /** + * The **`mask-border`** CSS shorthand property lets you create a mask along the edge of an element's border. + * + * **Syntax**: `<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>` + */ + WebkitMaskBoxImage?: Property.MaskBorder | undefined; + /** + * The **`text-emphasis`** CSS property applies emphasis marks to text (except spaces and control characters). It is a shorthand for `text-emphasis-style` and `text-emphasis-color`. + * + * **Syntax**: `<'text-emphasis-style'> || <'text-emphasis-color'>` + */ + WebkitTextEmphasis?: Property.TextEmphasis | undefined; + /** + * The **`-webkit-text-stroke`** CSS property specifies the width and color of strokes for text characters. This is a shorthand property for the longhand properties `-webkit-text-stroke-width` and `-webkit-text-stroke-color`. + * + * **Syntax**: `<length> || <color>` + */ + WebkitTextStroke?: Property.WebkitTextStroke<TLength> | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + */ + WebkitTransition?: Property.Transition<TTime> | undefined; +} + +export interface VendorProperties<TLength = (string & {}) | 0, TTime = string & {}> extends VendorLonghandProperties<TLength, TTime>, VendorShorthandProperties<TLength, TTime> {} + +export interface ObsoleteProperties<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * In combination with `elevation`, the **`azimuth`** CSS property enables different audio sources to be positioned spatially for aural presentation. This is important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage. Stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage. + * + * **Syntax**: `<angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards` + * + * **Initial value**: `center` + * + * @deprecated + */ + azimuth?: Property.Azimuth | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + boxAlign?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + boxDirection?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + boxFlex?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + boxFlexGroup?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + boxLines?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + boxOrdinalGroup?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + boxOrient?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + boxPack?: Property.BoxPack | undefined; + /** + * The **`clip`** CSS property defines a visible portion of an element. The `clip` property applies only to absolutely positioned elements — that is, elements with `position:absolute` or `position:fixed`. + * + * **Syntax**: `<shape> | auto` + * + * **Initial value**: `auto` + * + * @deprecated + */ + clip?: Property.Clip | undefined; + /** + * The **`column-gap`** CSS property sets the size of the gap (gutter) between an element's columns. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * @deprecated + */ + gridColumnGap?: Property.GridColumnGap<TLength> | undefined; + /** + * The **`gap`** CSS property sets the gaps (gutters) between rows and columns. It is a shorthand for `row-gap` and `column-gap`. + * + * **Syntax**: `<'grid-row-gap'> <'grid-column-gap'>?` + * + * @deprecated + */ + gridGap?: Property.GridGap<TLength> | undefined; + /** + * The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * @deprecated + */ + gridRowGap?: Property.GridRowGap<TLength> | undefined; + /** + * The **`ime-mode`** CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete. + * + * **Syntax**: `auto | normal | active | inactive | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + imeMode?: Property.ImeMode | undefined; + /** + * The **`inset-block`** CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * @deprecated + */ + offsetBlock?: Property.InsetBlock<TLength> | undefined; + /** + * The **`inset-block-end`** CSS property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + offsetBlockEnd?: Property.InsetBlockEnd<TLength> | undefined; + /** + * The **`inset-block-start`** CSS property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + offsetBlockStart?: Property.InsetBlockStart<TLength> | undefined; + /** + * The **`inset-inline`** CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * @deprecated + */ + offsetInline?: Property.InsetInline<TLength> | undefined; + /** + * The **`inset-inline-end`** CSS property defines the logical inline end inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + offsetInlineEnd?: Property.InsetInlineEnd<TLength> | undefined; + /** + * The **`inset-inline-start`** CSS property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + offsetInlineStart?: Property.InsetInlineStart<TLength> | undefined; + /** + * The **`scroll-snap-coordinate`** CSS property defines the x and y coordinate positions within an element that will align with its nearest ancestor scroll container's `scroll-snap-destination` for each respective axis. + * + * **Syntax**: `none | <position>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + scrollSnapCoordinate?: Property.ScrollSnapCoordinate<TLength> | undefined; + /** + * The **`scroll-snap-destination`** CSS property defines the position in x and y coordinates within the scroll container's visual viewport which element snap points align with. + * + * **Syntax**: `<position>` + * + * **Initial value**: `0px 0px` + * + * @deprecated + */ + scrollSnapDestination?: Property.ScrollSnapDestination<TLength> | undefined; + /** + * The **`scroll-snap-points-x`** CSS property defines the horizontal positioning of snap points within the content of the scroll container they are applied to. + * + * **Syntax**: `none | repeat( <length-percentage> )` + * + * **Initial value**: `none` + * + * @deprecated + */ + scrollSnapPointsX?: Property.ScrollSnapPointsX | undefined; + /** + * The **`scroll-snap-points-y`** CSS property defines the vertical positioning of snap points within the content of the scroll container they are applied to. + * + * **Syntax**: `none | repeat( <length-percentage> )` + * + * **Initial value**: `none` + * + * @deprecated + */ + scrollSnapPointsY?: Property.ScrollSnapPointsY | undefined; + /** + * The **`scroll-snap-type-x`** CSS property defines how strictly snap points are enforced on the horizontal axis of the scroll container in case there is one. + * + * **Syntax**: `none | mandatory | proximity` + * + * **Initial value**: `none` + * + * @deprecated + */ + scrollSnapTypeX?: Property.ScrollSnapTypeX | undefined; + /** + * The **`scroll-snap-type-y`** CSS property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one. + * + * **Syntax**: `none | mandatory | proximity` + * + * **Initial value**: `none` + * + * @deprecated + */ + scrollSnapTypeY?: Property.ScrollSnapTypeY | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + KhtmlBoxAlign?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + KhtmlBoxDirection?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + KhtmlBoxFlex?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + KhtmlBoxFlexGroup?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + KhtmlBoxLines?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + KhtmlBoxOrdinalGroup?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + KhtmlBoxOrient?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + KhtmlBoxPack?: Property.BoxPack | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + * + * @deprecated + */ + KhtmlLineBreak?: Property.LineBreak | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * @deprecated + */ + KhtmlOpacity?: Property.Opacity | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + * + * @deprecated + */ + KhtmlUserSelect?: Property.UserSelect | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + * + * @deprecated + */ + MozBackfaceVisibility?: Property.BackfaceVisibility | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + * + * @deprecated + */ + MozBackgroundClip?: Property.BackgroundClip | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + * + * @deprecated + */ + MozBackgroundInlinePolicy?: Property.BoxDecorationBreak | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + * + * @deprecated + */ + MozBackgroundOrigin?: Property.BackgroundOrigin | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * @deprecated + */ + MozBackgroundSize?: Property.BackgroundSize<TLength> | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + * + * @deprecated + */ + MozBorderRadius?: Property.BorderRadius<TLength> | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozBorderRadiusBottomleft?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozBorderRadiusBottomright?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozBorderRadiusTopleft?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozBorderRadiusTopright?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + MozBoxAlign?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + MozBoxDirection?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozBoxFlex?: Property.BoxFlex | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + MozBoxOrdinalGroup?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + MozBoxOrient?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + MozBoxPack?: Property.BoxPack | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + MozBoxShadow?: Property.BoxShadow | undefined; + /** + * The non-standard **`-moz-float-edge`** CSS property specifies whether the height and width properties of the element include the margin, border, or padding thickness. + * + * **Syntax**: `border-box | content-box | margin-box | padding-box` + * + * **Initial value**: `content-box` + * + * @deprecated + */ + MozFloatEdge?: Property.MozFloatEdge | undefined; + /** + * The **`-moz-force-broken-image-icon`** extended CSS property can be used to force the broken image icon to be shown even when a broken image has an `alt` attribute. + * + * **Syntax**: `0 | 1` + * + * **Initial value**: `0` + * + * @deprecated + */ + MozForceBrokenImageIcon?: Property.MozForceBrokenImageIcon | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * @deprecated + */ + MozOpacity?: Property.Opacity | undefined; + /** + * The **`outline`** CSS shorthand property sets most of the outline properties in a single declaration. + * + * **Syntax**: `[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]` + * + * @deprecated + */ + MozOutline?: Property.Outline<TLength> | undefined; + /** + * The **`outline-color`** CSS property sets the color of an element's outline. + * + * **Syntax**: `<color> | invert` + * + * **Initial value**: `invert`, for browsers supporting it, `currentColor` for the other + * + * @deprecated + */ + MozOutlineColor?: Property.OutlineColor | undefined; + /** + * The **`outline-style`** CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `auto | <'border-style'>` + * + * **Initial value**: `none` + * + * @deprecated + */ + MozOutlineStyle?: Property.OutlineStyle | undefined; + /** + * The CSS **`outline-width`** property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * @deprecated + */ + MozOutlineWidth?: Property.OutlineWidth<TLength> | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + * + * @deprecated + */ + MozPerspective?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * @deprecated + */ + MozPerspectiveOrigin?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`text-align-last`** CSS property sets how the last line of a block or a line, right before a forced line break, is aligned. + * + * **Syntax**: `auto | start | end | left | right | center | justify` + * + * **Initial value**: `auto` + * + * @deprecated + */ + MozTextAlignLast?: Property.TextAlignLast | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * @deprecated + */ + MozTextDecorationColor?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + * + * @deprecated + */ + MozTextDecorationLine?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + * + * @deprecated + */ + MozTextDecorationStyle?: Property.TextDecorationStyle | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * @deprecated + */ + MozTransform?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * @deprecated + */ + MozTransformOrigin?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + * + * @deprecated + */ + MozTransformStyle?: Property.TransformStyle | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * @deprecated + */ + MozTransition?: Property.Transition<TTime> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + MozTransitionDelay?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + MozTransitionDuration?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * @deprecated + */ + MozTransitionProperty?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + MozTransitionTimingFunction?: Property.TransitionTimingFunction | undefined; + /** + * In Mozilla applications, **`-moz-user-input`** determines if an element will accept user input. + * + * **Syntax**: `auto | none | enabled | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + MozUserInput?: Property.MozUserInput | undefined; + /** + * The **`ime-mode`** CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete. + * + * **Syntax**: `auto | normal | active | inactive | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + msImeMode?: Property.ImeMode | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + * + * @deprecated + */ + OAnimation?: Property.Animation<TTime> | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + OAnimationDelay?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + * + * @deprecated + */ + OAnimationDirection?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + OAnimationDuration?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + OAnimationFillMode?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + * + * @deprecated + */ + OAnimationIterationCount?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + * + * @deprecated + */ + OAnimationName?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + * + * @deprecated + */ + OAnimationPlayState?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + OAnimationTimingFunction?: Property.AnimationTimingFunction | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * @deprecated + */ + OBackgroundSize?: Property.BackgroundSize<TLength> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + * + * @deprecated + */ + OBorderImage?: Property.BorderImage | undefined; + /** + * The **`object-fit`** CSS property sets how the content of a replaced element, such as an `<img>` or `<video>`, should be resized to fit its container. + * + * **Syntax**: `fill | contain | cover | none | scale-down` + * + * **Initial value**: `fill` + * + * @deprecated + */ + OObjectFit?: Property.ObjectFit | undefined; + /** + * The **`object-position`** CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * @deprecated + */ + OObjectPosition?: Property.ObjectPosition<TLength> | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + * + * @deprecated + */ + OTabSize?: Property.TabSize<TLength> | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + * + * @deprecated + */ + OTextOverflow?: Property.TextOverflow | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * @deprecated + */ + OTransform?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * @deprecated + */ + OTransformOrigin?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * @deprecated + */ + OTransition?: Property.Transition<TTime> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + OTransitionDelay?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + OTransitionDuration?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * @deprecated + */ + OTransitionProperty?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + OTransitionTimingFunction?: Property.TransitionTimingFunction | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + WebkitBoxAlign?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + WebkitBoxDirection?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + WebkitBoxFlex?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + WebkitBoxFlexGroup?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + WebkitBoxLines?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + WebkitBoxOrdinalGroup?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + WebkitBoxOrient?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + WebkitBoxPack?: Property.BoxPack | undefined; +} + +export interface SvgProperties<TLength = (string & {}) | 0, TTime = string & {}> { + alignmentBaseline?: Property.AlignmentBaseline | undefined; + baselineShift?: Property.BaselineShift<TLength> | undefined; + clip?: Property.Clip | undefined; + clipPath?: Property.ClipPath | undefined; + clipRule?: Property.ClipRule | undefined; + color?: Property.Color | undefined; + colorInterpolation?: Property.ColorInterpolation | undefined; + colorRendering?: Property.ColorRendering | undefined; + cursor?: Property.Cursor | undefined; + direction?: Property.Direction | undefined; + display?: Property.Display | undefined; + dominantBaseline?: Property.DominantBaseline | undefined; + fill?: Property.Fill | undefined; + fillOpacity?: Property.FillOpacity | undefined; + fillRule?: Property.FillRule | undefined; + filter?: Property.Filter | undefined; + floodColor?: Property.FloodColor | undefined; + floodOpacity?: Property.FloodOpacity | undefined; + font?: Property.Font | undefined; + fontFamily?: Property.FontFamily | undefined; + fontSize?: Property.FontSize<TLength> | undefined; + fontSizeAdjust?: Property.FontSizeAdjust | undefined; + fontStretch?: Property.FontStretch | undefined; + fontStyle?: Property.FontStyle | undefined; + fontVariant?: Property.FontVariant | undefined; + fontWeight?: Property.FontWeight | undefined; + glyphOrientationVertical?: Property.GlyphOrientationVertical | undefined; + imageRendering?: Property.ImageRendering | undefined; + letterSpacing?: Property.LetterSpacing<TLength> | undefined; + lightingColor?: Property.LightingColor | undefined; + lineHeight?: Property.LineHeight<TLength> | undefined; + marker?: Property.Marker | undefined; + markerEnd?: Property.MarkerEnd | undefined; + markerMid?: Property.MarkerMid | undefined; + markerStart?: Property.MarkerStart | undefined; + mask?: Property.Mask<TLength> | undefined; + opacity?: Property.Opacity | undefined; + overflow?: Property.Overflow | undefined; + paintOrder?: Property.PaintOrder | undefined; + pointerEvents?: Property.PointerEvents | undefined; + shapeRendering?: Property.ShapeRendering | undefined; + stopColor?: Property.StopColor | undefined; + stopOpacity?: Property.StopOpacity | undefined; + stroke?: Property.Stroke | undefined; + strokeDasharray?: Property.StrokeDasharray<TLength> | undefined; + strokeDashoffset?: Property.StrokeDashoffset<TLength> | undefined; + strokeLinecap?: Property.StrokeLinecap | undefined; + strokeLinejoin?: Property.StrokeLinejoin | undefined; + strokeMiterlimit?: Property.StrokeMiterlimit | undefined; + strokeOpacity?: Property.StrokeOpacity | undefined; + strokeWidth?: Property.StrokeWidth<TLength> | undefined; + textAnchor?: Property.TextAnchor | undefined; + textDecoration?: Property.TextDecoration<TLength> | undefined; + textRendering?: Property.TextRendering | undefined; + unicodeBidi?: Property.UnicodeBidi | undefined; + vectorEffect?: Property.VectorEffect | undefined; + visibility?: Property.Visibility | undefined; + whiteSpace?: Property.WhiteSpace | undefined; + wordSpacing?: Property.WordSpacing<TLength> | undefined; + writingMode?: Property.WritingMode | undefined; +} + +export interface Properties<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardProperties<TLength, TTime>, + VendorProperties<TLength, TTime>, + ObsoleteProperties<TLength, TTime>, + SvgProperties<TLength, TTime> {} + +export interface StandardLonghandPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`accent-color`** CSS property sets the accent color for user-interface controls generated by some elements. + * + * **Syntax**: `auto | <color>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **93** | **92** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/accent-color + */ + "accent-color"?: Property.AccentColor | undefined; + /** + * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. + * + * **Syntax**: `normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-content + */ + "align-content"?: Property.AlignContent | undefined; + /** + * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. + * + * **Syntax**: `normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-items + */ + "align-items"?: Property.AlignItems | undefined; + /** + * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **10** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-self + */ + "align-self"?: Property.AlignSelf | undefined; + /** + * The **`align-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their block axis. + * + * **Syntax**: `[ normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position> ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/align-tracks + */ + "align-tracks"?: Property.AlignTracks | undefined; + /** + * The **`animation-composition`** CSS property specifies the composite operation to use when multiple animations affect the same property simultaneously. + * + * **Syntax**: `<single-animation-composition>#` + * + * **Initial value**: `replace` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **112** | **115** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-composition + */ + "animation-composition"?: Property.AnimationComposition | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-delay + */ + "animation-delay"?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-direction + */ + "animation-direction"?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-duration + */ + "animation-duration"?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 5 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode + */ + "animation-fill-mode"?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count + */ + "animation-iteration-count"?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-name + */ + "animation-name"?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-play-state + */ + "animation-play-state"?: Property.AnimationPlayState | undefined; + /** + * The **`animation-range-end`** CSS property is used to set the end of an animation's attachment range along its timeline, i.e. where along the timeline an animation will end. + * + * **Syntax**: `[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range-end + */ + "animation-range-end"?: Property.AnimationRangeEnd<TLength> | undefined; + /** + * The **`animation-range-start`** CSS property is used to set the start of an animation's attachment range along its timeline, i.e. where along the timeline an animation will start. + * + * **Syntax**: `[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range-start + */ + "animation-range-start"?: Property.AnimationRangeStart<TLength> | undefined; + /** + * The **`animation-timeline`** CSS property specifies the timeline that is used to control the progress of an animation. + * + * **Syntax**: `<single-animation-timeline>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-timeline + */ + "animation-timeline"?: Property.AnimationTimeline | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-timing-function + */ + "animation-timing-function"?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | auto | textfield | menulist-button | <compat-auto>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :------: | :-: | + * | **84** | **80** | **15.4** | **84** | No | + * | 1 _-x-_ | 1 _-x-_ | 3 _-x-_ | 12 _-x-_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/appearance + */ + appearance?: Property.Appearance | undefined; + /** + * The **`aspect-ratio`** CSS property sets a **preferred aspect ratio** for the box, which will be used in the calculation of auto sizes and some other layout functions. + * + * **Syntax**: `auto | <ratio>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **88** | **89** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/aspect-ratio + */ + "aspect-ratio"?: Property.AspectRatio | undefined; + /** + * The **`backdrop-filter`** CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything _behind_ the element, to see the effect you must make the element or its background at least partially transparent. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------: | :----: | :-: | + * | **76** | **103** | **9** _-x-_ | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/backdrop-filter + */ + "backdrop-filter"?: Property.BackdropFilter | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :----: | :----: | + * | **36** | **16** | **15.4** | **12** | **10** | + * | 12 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/backface-visibility + */ + "backface-visibility"?: Property.BackfaceVisibility | undefined; + /** + * The **`background-attachment`** CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block. + * + * **Syntax**: `<attachment>#` + * + * **Initial value**: `scroll` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-attachment + */ + "background-attachment"?: Property.BackgroundAttachment | undefined; + /** + * The **`background-blend-mode`** CSS property sets how an element's background images should blend with each other and with the element's background color. + * + * **Syntax**: `<blend-mode>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **35** | **30** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-blend-mode + */ + "background-blend-mode"?: Property.BackgroundBlendMode | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **4** | **5** | **12** | **9** | + * | | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-clip + */ + "background-clip"?: Property.BackgroundClip | undefined; + /** + * The **`background-color`** CSS property sets the background color of an element. + * + * **Syntax**: `<color>` + * + * **Initial value**: `transparent` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-color + */ + "background-color"?: Property.BackgroundColor | undefined; + /** + * The **`background-image`** CSS property sets one or more background images on an element. + * + * **Syntax**: `<bg-image>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-image + */ + "background-image"?: Property.BackgroundImage | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **4** | **3** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-origin + */ + "background-origin"?: Property.BackgroundOrigin | undefined; + /** + * The **`background-position-x`** CSS property sets the initial horizontal position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `[ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#` + * + * **Initial value**: `0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **49** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position-x + */ + "background-position-x"?: Property.BackgroundPositionX<TLength> | undefined; + /** + * The **`background-position-y`** CSS property sets the initial vertical position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `[ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#` + * + * **Initial value**: `0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **49** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position-y + */ + "background-position-y"?: Property.BackgroundPositionY<TLength> | undefined; + /** + * The **`background-repeat`** CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-repeat + */ + "background-repeat"?: Property.BackgroundRepeat | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **3** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-size + */ + "background-size"?: Property.BackgroundSize<TLength> | undefined; + /** + * **Syntax**: `clip | ellipsis | <string>` + * + * **Initial value**: `clip` + */ + "block-overflow"?: Property.BlockOverflow | undefined; + /** + * The **`block-size`** CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `width` or the `height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/block-size + */ + "block-size"?: Property.BlockSize<TLength> | undefined; + /** + * The **`border-block-color`** CSS property defines the color of the logical block borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>{1,2}` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-color + */ + "border-block-color"?: Property.BorderBlockColor | undefined; + /** + * The **`border-block-end-color`** CSS property defines the color of the logical block-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-color + */ + "border-block-end-color"?: Property.BorderBlockEndColor | undefined; + /** + * The **`border-block-end-style`** CSS property defines the style of the logical block-end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-style + */ + "border-block-end-style"?: Property.BorderBlockEndStyle | undefined; + /** + * The **`border-block-end-width`** CSS property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-width + */ + "border-block-end-width"?: Property.BorderBlockEndWidth<TLength> | undefined; + /** + * The **`border-block-start-color`** CSS property defines the color of the logical block-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-color + */ + "border-block-start-color"?: Property.BorderBlockStartColor | undefined; + /** + * The **`border-block-start-style`** CSS property defines the style of the logical block start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-style + */ + "border-block-start-style"?: Property.BorderBlockStartStyle | undefined; + /** + * The **`border-block-start-width`** CSS property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-width + */ + "border-block-start-width"?: Property.BorderBlockStartWidth<TLength> | undefined; + /** + * The **`border-block-style`** CSS property defines the style of the logical block borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-style + */ + "border-block-style"?: Property.BorderBlockStyle | undefined; + /** + * The **`border-block-width`** CSS property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-width + */ + "border-block-width"?: Property.BorderBlockWidth<TLength> | undefined; + /** + * The **`border-bottom-color`** CSS property sets the color of an element's bottom border. It can also be set with the shorthand CSS properties `border-color` or `border-bottom`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-color + */ + "border-bottom-color"?: Property.BorderBottomColor | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius + */ + "border-bottom-left-radius"?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius + */ + "border-bottom-right-radius"?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-bottom-style`** CSS property sets the line style of an element's bottom `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-style + */ + "border-bottom-style"?: Property.BorderBottomStyle | undefined; + /** + * The **`border-bottom-width`** CSS property sets the width of the bottom border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-width + */ + "border-bottom-width"?: Property.BorderBottomWidth<TLength> | undefined; + /** + * The **`border-collapse`** CSS property sets whether cells inside a `<table>` have shared or separate borders. + * + * **Syntax**: `collapse | separate` + * + * **Initial value**: `separate` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-collapse + */ + "border-collapse"?: Property.BorderCollapse | undefined; + /** + * The **`border-end-end-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius + */ + "border-end-end-radius"?: Property.BorderEndEndRadius<TLength> | undefined; + /** + * The **`border-end-start-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius + */ + "border-end-start-radius"?: Property.BorderEndStartRadius<TLength> | undefined; + /** + * The **`border-image-outset`** CSS property sets the distance by which an element's border image is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-outset + */ + "border-image-outset"?: Property.BorderImageOutset<TLength> | undefined; + /** + * The **`border-image-repeat`** CSS property defines how the edge regions and middle region of a source image are adjusted to fit the dimensions of an element's border image. The middle region can be displayed by using the keyword "fill" in the border-image-slice property. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-repeat + */ + "border-image-repeat"?: Property.BorderImageRepeat | undefined; + /** + * The **`border-image-slice`** CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image. + * + * **Syntax**: `<number-percentage>{1,4} && fill?` + * + * **Initial value**: `100%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-slice + */ + "border-image-slice"?: Property.BorderImageSlice | undefined; + /** + * The **`border-image-source`** CSS property sets the source image used to create an element's border image. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **15** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-source + */ + "border-image-source"?: Property.BorderImageSource | undefined; + /** + * The **`border-image-width`** CSS property sets the width of an element's border image. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **15** | **13** | **6** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image-width + */ + "border-image-width"?: Property.BorderImageWidth<TLength> | undefined; + /** + * The **`border-inline-color`** CSS property defines the color of the logical inline borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>{1,2}` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-color + */ + "border-inline-color"?: Property.BorderInlineColor | undefined; + /** + * The **`border-inline-end-color`** CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-color)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color + */ + "border-inline-end-color"?: Property.BorderInlineEndColor | undefined; + /** + * The **`border-inline-end-style`** CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-style)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style + */ + "border-inline-end-style"?: Property.BorderInlineEndStyle | undefined; + /** + * The **`border-inline-end-width`** CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-end-width)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width + */ + "border-inline-end-width"?: Property.BorderInlineEndWidth<TLength> | undefined; + /** + * The **`border-inline-start-color`** CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-start-color)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color + */ + "border-inline-start-color"?: Property.BorderInlineStartColor | undefined; + /** + * The **`border-inline-start-style`** CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------------------------: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | | 3 _(-moz-border-start-style)_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style + */ + "border-inline-start-style"?: Property.BorderInlineStartStyle | undefined; + /** + * The **`border-inline-start-width`** CSS property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width + */ + "border-inline-start-width"?: Property.BorderInlineStartWidth<TLength> | undefined; + /** + * The **`border-inline-style`** CSS property defines the style of the logical inline borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-style + */ + "border-inline-style"?: Property.BorderInlineStyle | undefined; + /** + * The **`border-inline-width`** CSS property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-width + */ + "border-inline-width"?: Property.BorderInlineWidth<TLength> | undefined; + /** + * The **`border-left-color`** CSS property sets the color of an element's left border. It can also be set with the shorthand CSS properties `border-color` or `border-left`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-color + */ + "border-left-color"?: Property.BorderLeftColor | undefined; + /** + * The **`border-left-style`** CSS property sets the line style of an element's left `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-style + */ + "border-left-style"?: Property.BorderLeftStyle | undefined; + /** + * The **`border-left-width`** CSS property sets the width of the left border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left-width + */ + "border-left-width"?: Property.BorderLeftWidth<TLength> | undefined; + /** + * The **`border-right-color`** CSS property sets the color of an element's right border. It can also be set with the shorthand CSS properties `border-color` or `border-right`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-color + */ + "border-right-color"?: Property.BorderRightColor | undefined; + /** + * The **`border-right-style`** CSS property sets the line style of an element's right `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-style + */ + "border-right-style"?: Property.BorderRightStyle | undefined; + /** + * The **`border-right-width`** CSS property sets the width of the right border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right-width + */ + "border-right-width"?: Property.BorderRightWidth<TLength> | undefined; + /** + * The **`border-spacing`** CSS property sets the distance between the borders of adjacent cells in a `<table>`. This property applies only when `border-collapse` is `separate`. + * + * **Syntax**: `<length> <length>?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-spacing + */ + "border-spacing"?: Property.BorderSpacing<TLength> | undefined; + /** + * The **`border-start-end-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-start-end-radius + */ + "border-start-end-radius"?: Property.BorderStartEndRadius<TLength> | undefined; + /** + * The **`border-start-start-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's `writing-mode`, `direction`, and `text-orientation`. This is useful when building styles to work regardless of the text orientation and writing mode. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **89** | **66** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-start-start-radius + */ + "border-start-start-radius"?: Property.BorderStartStartRadius<TLength> | undefined; + /** + * The **`border-top-color`** CSS property sets the color of an element's top border. It can also be set with the shorthand CSS properties `border-color` or `border-top`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-color + */ + "border-top-color"?: Property.BorderTopColor | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius + */ + "border-top-left-radius"?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius + */ + "border-top-right-radius"?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`border-top-style`** CSS property sets the line style of an element's top `border`. + * + * **Syntax**: `<line-style>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-style + */ + "border-top-style"?: Property.BorderTopStyle | undefined; + /** + * The **`border-top-width`** CSS property sets the width of the top border of an element. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top-width + */ + "border-top-width"?: Property.BorderTopWidth<TLength> | undefined; + /** + * The **`bottom`** CSS property participates in setting the vertical position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/bottom + */ + bottom?: Property.Bottom<TLength> | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----: | :---------: | :--: | :-: | + * | **22** _-x-_ | **32** | **7** _-x-_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-decoration-break + */ + "box-decoration-break"?: Property.BoxDecorationBreak | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **10** | **4** | **5.1** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-shadow + */ + "box-shadow"?: Property.BoxShadow | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **10** | **29** | **5.1** | **12** | **8** | + * | 1 _-x-_ | 1 _-x-_ | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/box-sizing + */ + "box-sizing"?: Property.BoxSizing | undefined; + /** + * The **`break-after`** CSS property sets how page, column, or region breaks should behave after a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-after + */ + "break-after"?: Property.BreakAfter | undefined; + /** + * The **`break-before`** CSS property sets how page, column, or region breaks should behave before a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-before + */ + "break-before"?: Property.BreakBefore | undefined; + /** + * The **`break-inside`** CSS property sets how page, column, or region breaks should behave inside a generated box. If there is no generated box, the property is ignored. + * + * **Syntax**: `auto | avoid | avoid-page | avoid-column | avoid-region` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **50** | **65** | **10** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/break-inside + */ + "break-inside"?: Property.BreakInside | undefined; + /** + * The **`caption-side`** CSS property puts the content of a table's `<caption>` on the specified side. The values are relative to the `writing-mode` of the table. + * + * **Syntax**: `top | bottom | block-start | block-end | inline-start | inline-end` + * + * **Initial value**: `top` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/caption-side + */ + "caption-side"?: Property.CaptionSide | undefined; + /** + * The **`caret-color`** CSS property sets the color of the **insertion caret**, the visible marker where the next character typed will be inserted. This is sometimes referred to as the **text input cursor**. The caret appears in elements such as `<input>` or those with the `contenteditable` attribute. The caret is typically a thin vertical line that flashes to help make it more noticeable. By default, it is black, but its color can be altered with this property. + * + * **Syntax**: `auto | <color>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **53** | **11.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/caret-color + */ + "caret-color"?: Property.CaretColor | undefined; + /** + * **Syntax**: `auto | bar | block | underscore` + * + * **Initial value**: `auto` + */ + "caret-shape"?: Property.CaretShape | undefined; + /** + * The **`clear`** CSS property sets whether an element must be moved below (cleared) floating elements that precede it. The `clear` property applies to floating and non-floating elements. + * + * **Syntax**: `none | left | right | both | inline-start | inline-end` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/clear + */ + clear?: Property.Clear | undefined; + /** + * The **`clip-path`** CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. + * + * **Syntax**: `<clip-source> | [ <basic-shape> || <geometry-box> ] | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **55** | **3.5** | **9.1** | **79** | **10** | + * | 23 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/clip-path + */ + "clip-path"?: Property.ClipPath | undefined; + /** + * The **`color`** CSS property sets the foreground color value of an element's text and text decorations, and sets the `currentcolor` value. `currentcolor` may be used as an indirect value on _other_ properties and is the default for other color properties, such as `border-color`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `canvastext` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/color + */ + color?: Property.Color | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----------------: | :------: | :----------: | :-: | + * | **17** _-x-_ | **97** | **15.4** | **79** _-x-_ | No | + * | | 48 _(color-adjust)_ | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/print-color-adjust + */ + "color-adjust"?: Property.PrintColorAdjust | undefined; + /** + * The **`color-scheme`** CSS property allows an element to indicate which color schemes it can comfortably be rendered in. + * + * **Syntax**: `normal | [ light | dark | <custom-ident> ]+ && only?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **81** | **96** | **13** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/color-scheme + */ + "color-scheme"?: Property.ColorScheme | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-count + */ + "column-count"?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-fill + */ + "column-fill"?: Property.ColumnFill | undefined; + /** + * The **`column-gap`** CSS property sets the size of the gap (gutter) between an element's columns. + * + * **Syntax**: `normal | <length-percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **1** | **1.5** | **3** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-gap + */ + "column-gap"?: Property.ColumnGap<TLength> | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-color + */ + "column-rule-color"?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-style + */ + "column-rule-style"?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule-width + */ + "column-rule-width"?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-span`** CSS property makes it possible for an element to span across all columns when its value is set to `all`. + * + * **Syntax**: `none | all` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **50** | **71** | **9** | **12** | **10** | + * | 6 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-span + */ + "column-span"?: Property.ColumnSpan | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **50** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-width + */ + "column-width"?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`contain`** CSS property indicates that an element and its contents are, as much as possible, independent from the rest of the document tree. Containment enables isolating a subsection of the DOM, providing performance benefits by limiting calculations of layout, style, paint, size, or any combination to a DOM subtree rather than the entire page. Containment can also be used to scope CSS counters and quotes. + * + * **Syntax**: `none | strict | content | [ [ size || inline-size ] || layout || style || paint ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **52** | **69** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain + */ + contain?: Property.Contain | undefined; + /** + * The **`contain-intrinsic-block-size`** CSS logical property defines the block size of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-block-size + */ + "contain-intrinsic-block-size"?: Property.ContainIntrinsicBlockSize<TLength> | undefined; + /** + * The **`contain-intrinsic-length`** CSS property sets the height of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-height + */ + "contain-intrinsic-height"?: Property.ContainIntrinsicHeight<TLength> | undefined; + /** + * The **`contain-intrinsic-inline-size`** CSS logical property defines the inline-size of an element that a browser can use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-inline-size + */ + "contain-intrinsic-inline-size"?: Property.ContainIntrinsicInlineSize<TLength> | undefined; + /** + * The **`contain-intrinsic-width`** CSS property sets the width of an element that a browser will use for layout when the element is subject to size containment. + * + * **Syntax**: `auto? [ none | <length> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **95** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-width + */ + "contain-intrinsic-width"?: Property.ContainIntrinsicWidth<TLength> | undefined; + /** + * The **container-name** CSS property specifies a list of query container names used by the @container at-rule in a container query. A container query will apply styles to elements based on the size of the nearest ancestor with a containment context. When a containment context is given a name, it can be specifically targeted using the `@container` at-rule instead of the nearest ancestor with containment. + * + * **Syntax**: `none | <custom-ident>+` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container-name + */ + "container-name"?: Property.ContainerName | undefined; + /** + * The **container-type** CSS property is used to define the type of containment used in a container query. + * + * **Syntax**: `normal | size | inline-size` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container-type + */ + "container-type"?: Property.ContainerType | undefined; + /** + * The **`content`** CSS property replaces an element with a generated value. Objects inserted using the `content` property are **anonymous replaced elements**. + * + * **Syntax**: `normal | none | [ <content-replacement> | <content-list> ] [/ [ <string> | <counter> ]+ ]?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/content + */ + content?: Property.Content | undefined; + /** + * The **`content-visibility`** CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed. It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster. + * + * **Syntax**: `visible | auto | hidden` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :---------: | :----: | :--: | :-: | + * | **85** | **preview** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/content-visibility + */ + "content-visibility"?: Property.ContentVisibility | undefined; + /** + * The **`counter-increment`** CSS property increases or decreases the value of a CSS counter by a given value. + * + * **Syntax**: `[ <counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-increment + */ + "counter-increment"?: Property.CounterIncrement | undefined; + /** + * The **`counter-reset`** CSS property resets a CSS counter to a given value. This property will create a new counter or reversed counter with the given name on the specified element. + * + * **Syntax**: `[ <counter-name> <integer>? | <reversed-counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-reset + */ + "counter-reset"?: Property.CounterReset | undefined; + /** + * The **`counter-set`** CSS property sets a CSS counter to a given value. It manipulates the value of existing counters, and will only create new counters if there isn't already a counter of the given name on the element. + * + * **Syntax**: `[ <counter-name> <integer>? ]+ | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **85** | **68** | **17.2** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/counter-set + */ + "counter-set"?: Property.CounterSet | undefined; + /** + * The **`cursor`** CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element. + * + * **Syntax**: `[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/cursor + */ + cursor?: Property.Cursor | undefined; + /** + * The **`direction`** CSS property sets the direction of text, table columns, and horizontal overflow. Use `rtl` for languages written from right to left (like Hebrew or Arabic), and `ltr` for those written from left to right (like English and most other languages). + * + * **Syntax**: `ltr | rtl` + * + * **Initial value**: `ltr` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **2** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/direction + */ + direction?: Property.Direction | undefined; + /** + * The **`display`** CSS property sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex. + * + * **Syntax**: `[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>` + * + * **Initial value**: `inline` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/display + */ + display?: Property.Display | undefined; + /** + * The **`empty-cells`** CSS property sets whether borders and backgrounds appear around `<table>` cells that have no visible content. + * + * **Syntax**: `show | hide` + * + * **Initial value**: `show` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/empty-cells + */ + "empty-cells"?: Property.EmptyCells | undefined; + /** + * The **`filter`** CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :-: | + * | **53** | **35** | **9.1** | **12** | No | + * | 18 _-x-_ | | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/filter + */ + filter?: Property.Filter | undefined; + /** + * The **`flex-basis`** CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with `box-sizing`. + * + * **Syntax**: `content | <'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **22** | **9** | **12** | **11** | + * | 22 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-basis + */ + "flex-basis"?: Property.FlexBasis<TLength> | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :------: | :-----: | :----: | :------: | + * | **29** | **81** | **9** | **12** | **11** | + * | 21 _-x-_ | 49 _-x-_ | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-direction + */ + "flex-direction"?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----------------------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 22 _-x-_ | | 7 _-x-_ | | 10 _(-ms-flex-positive)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-grow + */ + "flex-grow"?: Property.FlexGrow | undefined; + /** + * The **`flex-shrink`** CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to `flex-shrink`. + * + * **Syntax**: `<number>` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **10** | + * | 22 _-x-_ | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-shrink + */ + "flex-shrink"?: Property.FlexShrink | undefined; + /** + * The **`flex-wrap`** CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. + * + * **Syntax**: `nowrap | wrap | wrap-reverse` + * + * **Initial value**: `nowrap` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-wrap + */ + "flex-wrap"?: Property.FlexWrap | undefined; + /** + * The **`float`** CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning). + * + * **Syntax**: `left | right | none | inline-start | inline-end` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/float + */ + float?: Property.Float | undefined; + /** + * The **`font-family`** CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected element. + * + * **Syntax**: `[ <family-name> | <generic-family> ]#` + * + * **Initial value**: depends on user agent + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-family + */ + "font-family"?: Property.FontFamily | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :------: | :-----: | :----: | :----: | + * | **48** | **34** | **9.1** | **15** | **10** | + * | 16 _-x-_ | 15 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-feature-settings + */ + "font-feature-settings"?: Property.FontFeatureSettings | undefined; + /** + * The **`font-kerning`** CSS property sets the use of the kerning information stored in a font. + * + * **Syntax**: `auto | normal | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **33** | **32** | **9** | n/a | No | + * | | | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-kerning + */ + "font-kerning"?: Property.FontKerning | undefined; + /** + * The **`font-language-override`** CSS property controls the use of language-specific glyphs in a typeface. + * + * **Syntax**: `normal | <string>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **34** | No | n/a | No | + * | | 4 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-language-override + */ + "font-language-override"?: Property.FontLanguageOverride | undefined; + /** + * The **`font-optical-sizing`** CSS property sets whether text rendering is optimized for viewing at different sizes. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **79** | **62** | **11** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-optical-sizing + */ + "font-optical-sizing"?: Property.FontOpticalSizing | undefined; + /** + * **Syntax**: `normal | light | dark | <palette-identifier>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **101** | **107** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-palette + */ + "font-palette"?: Property.FontPalette | undefined; + /** + * The **`font-size`** CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative `<length>` units, such as `em`, `ex`, and so forth. + * + * **Syntax**: `<absolute-size> | <relative-size> | <length-percentage>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-size + */ + "font-size"?: Property.FontSize<TLength> | undefined; + /** + * The **`font-size-adjust`** CSS property sets the size of lower-case letters relative to the current font size (which defines the size of upper-case letters). + * + * **Syntax**: `none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | <number> ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | No | **3** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-size-adjust + */ + "font-size-adjust"?: Property.FontSizeAdjust | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------: | :--------------------------------: | :------------------------------: | :--: | :-: | + * | **5** _(-webkit-font-smoothing)_ | **25** _(-moz-osx-font-smoothing)_ | **4** _(-webkit-font-smoothing)_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-smooth + */ + "font-smooth"?: Property.FontSmooth<TLength> | undefined; + /** + * The **`font-stretch`** CSS property selects a normal, condensed, or expanded face from a font. + * + * **Syntax**: `<font-stretch-absolute>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **60** | **9** | **11** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-stretch + */ + "font-stretch"?: Property.FontStretch | undefined; + /** + * The **`font-style`** CSS property sets whether a font should be styled with a normal, italic, or oblique face from its `font-family`. + * + * **Syntax**: `normal | italic | oblique <angle>?` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-style + */ + "font-style"?: Property.FontStyle | undefined; + /** + * The **`font-synthesis`** CSS property controls which missing typefaces, bold, italic, or small-caps, may be synthesized by the browser. + * + * **Syntax**: `none | [ weight || style || small-caps || position]` + * + * **Initial value**: `weight style small-caps position ` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **97** | **34** | **9** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis + */ + "font-synthesis"?: Property.FontSynthesis | undefined; + /** + * The **`font-synthesis-position`** CSS property lets you specify whether or not a browser may synthesize the subscript and superscript "position" typefaces when they are missing in a font family, while using `font-variant-position` to set the positions. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **118** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-position + */ + "font-synthesis-position"?: Property.FontSynthesisPosition | undefined; + /** + * The **`font-synthesis-small-caps`** CSS property lets you specify whether or not the browser may synthesize small-caps typeface when it is missing in a font family. Small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-small-caps + */ + "font-synthesis-small-caps"?: Property.FontSynthesisSmallCaps | undefined; + /** + * The **`font-synthesis-style`** CSS property lets you specify whether or not the browser may synthesize the oblique typeface when it is missing in a font family. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-style + */ + "font-synthesis-style"?: Property.FontSynthesisStyle | undefined; + /** + * The **`font-synthesis-weight`** CSS property lets you specify whether or not the browser may synthesize the bold typeface when it is missing in a font family. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **97** | **111** | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-synthesis-weight + */ + "font-synthesis-weight"?: Property.FontSynthesisWeight | undefined; + /** + * The **`font-variant`** CSS shorthand property allows you to set all the font variants for a font. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant + */ + "font-variant"?: Property.FontVariant | undefined; + /** + * The **`font-variant-alternates`** CSS property controls the usage of alternate glyphs. These alternate glyphs may be referenced by alternative names defined in `@font-feature-values`. + * + * **Syntax**: `normal | [ stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :--: | :-: | + * | **111** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-alternates + */ + "font-variant-alternates"?: Property.FontVariantAlternates | undefined; + /** + * The **`font-variant-caps`** CSS property controls the use of alternate glyphs for capital letters. + * + * **Syntax**: `normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **52** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-caps + */ + "font-variant-caps"?: Property.FontVariantCaps | undefined; + /** + * The **`font-variant-east-asian`** CSS property controls the use of alternate glyphs for East Asian scripts, like Japanese and Chinese. + * + * **Syntax**: `normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **63** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-east-asian + */ + "font-variant-east-asian"?: Property.FontVariantEastAsian | undefined; + /** + * **Syntax**: `normal | text | emoji | unicode` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-emoji + */ + "font-variant-emoji"?: Property.FontVariantEmoji | undefined; + /** + * The **`font-variant-ligatures`** CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :--: | :-: | + * | **34** | **34** | **9.1** | n/a | No | + * | 31 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-ligatures + */ + "font-variant-ligatures"?: Property.FontVariantLigatures | undefined; + /** + * The **`font-variant-numeric`** CSS property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers. + * + * **Syntax**: `normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **52** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-numeric + */ + "font-variant-numeric"?: Property.FontVariantNumeric | undefined; + /** + * The **`font-variant-position`** CSS property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript. + * + * **Syntax**: `normal | sub | super` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :--: | :-: | + * | **117** | **34** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variant-position + */ + "font-variant-position"?: Property.FontVariantPosition | undefined; + /** + * The **`font-variation-settings`** CSS property provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values. + * + * **Syntax**: `normal | [ <string> <number> ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **62** | **62** | **11** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-variation-settings + */ + "font-variation-settings"?: Property.FontVariationSettings | undefined; + /** + * The **`font-weight`** CSS property sets the weight (or boldness) of the font. The weights available depend on the `font-family` that is currently set. + * + * **Syntax**: `<font-weight-absolute> | bolder | lighter` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **2** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font-weight + */ + "font-weight"?: Property.FontWeight | undefined; + /** + * The **`forced-color-adjust`** CSS property allows authors to opt certain elements out of forced colors mode. This then restores the control of those values to CSS. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :-----------------------------: | :---------------------------------: | + * | **89** | **113** | No | **79** | **10** _(-ms-high-contrast-adjust)_ | + * | | | | 12 _(-ms-high-contrast-adjust)_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/forced-color-adjust + */ + "forced-color-adjust"?: Property.ForcedColorAdjust | undefined; + /** + * The **`grid-auto-columns`** CSS property specifies the size of an implicitly-created grid column track or pattern of tracks. + * + * **Syntax**: `<track-size>+` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-------------------------: | + * | **57** | **70** | **10.1** | **16** | **10** _(-ms-grid-columns)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-columns + */ + "grid-auto-columns"?: Property.GridAutoColumns<TLength> | undefined; + /** + * The **`grid-auto-flow`** CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. + * + * **Syntax**: `[ row | column ] || dense` + * + * **Initial value**: `row` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow + */ + "grid-auto-flow"?: Property.GridAutoFlow | undefined; + /** + * The **`grid-auto-rows`** CSS property specifies the size of an implicitly-created grid row track or pattern of tracks. + * + * **Syntax**: `<track-size>+` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----------------------: | + * | **57** | **70** | **10.1** | **16** | **10** _(-ms-grid-rows)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-auto-rows + */ + "grid-auto-rows"?: Property.GridAutoRows<TLength> | undefined; + /** + * The **`grid-column-end`** CSS property specifies a grid item's end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column-end + */ + "grid-column-end"?: Property.GridColumnEnd | undefined; + /** + * The **`grid-column-start`** CSS property specifies a grid item's start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement. This start position defines the block-start edge of the grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column-start + */ + "grid-column-start"?: Property.GridColumnStart | undefined; + /** + * The **`grid-row-end`** CSS property specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row-end + */ + "grid-row-end"?: Property.GridRowEnd | undefined; + /** + * The **`grid-row-start`** CSS property specifies a grid item's start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. + * + * **Syntax**: `<grid-line>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row-start + */ + "grid-row-start"?: Property.GridRowStart | undefined; + /** + * The **`grid-template-areas`** CSS property specifies named grid areas, establishing the cells in the grid and assigning them names. + * + * **Syntax**: `none | <string>+` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-areas + */ + "grid-template-areas"?: Property.GridTemplateAreas | undefined; + /** + * The **`grid-template-columns`** CSS property defines the line names and track sizing functions of the grid columns. + * + * **Syntax**: `none | <track-list> | <auto-track-list> | subgrid <line-name-list>?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-------------------------: | + * | **57** | **52** | **10.1** | **16** | **10** _(-ms-grid-columns)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-columns + */ + "grid-template-columns"?: Property.GridTemplateColumns<TLength> | undefined; + /** + * The **`grid-template-rows`** CSS property defines the line names and track sizing functions of the grid rows. + * + * **Syntax**: `none | <track-list> | <auto-track-list> | subgrid <line-name-list>?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----------------------: | + * | **57** | **52** | **10.1** | **16** | **10** _(-ms-grid-rows)_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template-rows + */ + "grid-template-rows"?: Property.GridTemplateRows<TLength> | undefined; + /** + * The **`hanging-punctuation`** CSS property specifies whether a punctuation mark should hang at the start or end of a line of text. Hanging punctuation may be placed outside the line box. + * + * **Syntax**: `none | [ first || [ force-end | allow-end ] || last ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | No | **10** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hanging-punctuation + */ + "hanging-punctuation"?: Property.HangingPunctuation | undefined; + /** + * The **`height`** CSS property specifies the height of an element. By default, the property defines the height of the content area. If `box-sizing` is set to `border-box`, however, it instead determines the height of the border area. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/height + */ + height?: Property.Height<TLength> | undefined; + /** + * The **`hyphenate-character`** CSS property sets the character (or string) used at the end of a line before a hyphenation break. + * + * **Syntax**: `auto | <string>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :--: | :-: | + * | **106** | **98** | **17** | n/a | No | + * | 6 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hyphenate-character + */ + "hyphenate-character"?: Property.HyphenateCharacter | undefined; + /** + * The **`hyphenate-limit-chars`** CSS property specifies the minimum word length to allow hyphenation of words as well as the the minimum number of characters before and after the hyphen. + * + * **Syntax**: `[ auto | <integer> ]{1,3}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | No | No | n/a | No | + */ + "hyphenate-limit-chars"?: Property.HyphenateLimitChars | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :----: | :----------: | + * | **55** | **43** | **17** | **79** | **10** _-x-_ | + * | 13 _-x-_ | 6 _-x-_ | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/hyphens + */ + hyphens?: Property.Hyphens | undefined; + /** + * The **`image-orientation`** CSS property specifies a layout-independent correction to the orientation of an image. + * + * **Syntax**: `from-image | <angle> | [ <angle>? flip ]` + * + * **Initial value**: `from-image` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **81** | **26** | **13.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/image-orientation + */ + "image-orientation"?: Property.ImageOrientation | undefined; + /** + * The **`image-rendering`** CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other properties, and to its descendants. + * + * **Syntax**: `auto | crisp-edges | pixelated` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **13** | **3.6** | **6** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/image-rendering + */ + "image-rendering"?: Property.ImageRendering | undefined; + /** + * **Syntax**: `[ from-image || <resolution> ] && snap?` + * + * **Initial value**: `1dppx` + */ + "image-resolution"?: Property.ImageResolution | undefined; + /** + * The `initial-letter` CSS property sets styling for dropped, raised, and sunken initial letters. + * + * **Syntax**: `normal | [ <number> <integer>? ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :--: | :-: | + * | **110** | No | **9** _-x-_ | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/initial-letter + */ + "initial-letter"?: Property.InitialLetter | undefined; + /** + * The **`inline-size`** CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `width` or the `height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'width'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inline-size + */ + "inline-size"?: Property.InlineSize<TLength> | undefined; + /** + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + */ + "input-security"?: Property.InputSecurity | undefined; + /** + * The **`inset-block-end`** CSS property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block-end + */ + "inset-block-end"?: Property.InsetBlockEnd<TLength> | undefined; + /** + * The **`inset-block-start`** CSS property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block-start + */ + "inset-block-start"?: Property.InsetBlockStart<TLength> | undefined; + /** + * The **`inset-inline-end`** CSS property defines the logical inline end inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline-end + */ + "inset-inline-end"?: Property.InsetInlineEnd<TLength> | undefined; + /** + * The **`inset-inline-start`** CSS property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline-start + */ + "inset-inline-start"?: Property.InsetInlineStart<TLength> | undefined; + /** + * The **`isolation`** CSS property determines whether an element must create a new stacking context. + * + * **Syntax**: `auto | isolate` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **41** | **36** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/isolation + */ + isolation?: Property.Isolation | undefined; + /** + * The CSS **`justify-content`** property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. + * + * **Syntax**: `normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-content + */ + "justify-content"?: Property.JustifyContent | undefined; + /** + * The CSS **`justify-items`** property defines the default `justify-self` for all items of the box, giving them all a default way of justifying each box along the appropriate axis. + * + * **Syntax**: `normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]` + * + * **Initial value**: `legacy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **52** | **20** | **9** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-items + */ + "justify-items"?: Property.JustifyItems | undefined; + /** + * The CSS **`justify-self`** property sets the way a box is justified inside its alignment container along the appropriate axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :----: | + * | **57** | **45** | **10.1** | **16** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-self + */ + "justify-self"?: Property.JustifySelf | undefined; + /** + * The **`justify-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their inline axis. + * + * **Syntax**: `[ normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ] ]#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/justify-tracks + */ + "justify-tracks"?: Property.JustifyTracks | undefined; + /** + * The **`left`** CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/left + */ + left?: Property.Left<TLength> | undefined; + /** + * The **`letter-spacing`** CSS property sets the horizontal spacing behavior between text characters. This value is added to the natural spacing between characters while rendering the text. Positive values of `letter-spacing` causes characters to spread farther apart, while negative values of `letter-spacing` bring characters closer together. + * + * **Syntax**: `normal | <length>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/letter-spacing + */ + "letter-spacing"?: Property.LetterSpacing<TLength> | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :-----: | + * | **58** | **69** | **11** | **14** | **5.5** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-break + */ + "line-break"?: Property.LineBreak | undefined; + /** + * The **`line-height`** CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element. On non-replaced inline elements, it specifies the height that is used to calculate line box height. + * + * **Syntax**: `normal | <number> | <length> | <percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-height + */ + "line-height"?: Property.LineHeight<TLength> | undefined; + /** + * The **`line-height-step`** CSS property sets the step unit for line box heights. When the property is set, line box heights are rounded up to the closest multiple of the unit. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | n/a | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/line-height-step + */ + "line-height-step"?: Property.LineHeightStep<TLength> | undefined; + /** + * The **`list-style-image`** CSS property sets an image to be used as the list item marker. + * + * **Syntax**: `<image> | none` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-image + */ + "list-style-image"?: Property.ListStyleImage | undefined; + /** + * The **`list-style-position`** CSS property sets the position of the `::marker` relative to a list item. + * + * **Syntax**: `inside | outside` + * + * **Initial value**: `outside` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-position + */ + "list-style-position"?: Property.ListStylePosition | undefined; + /** + * The **`list-style-type`** CSS property sets the marker (such as a disc, character, or custom counter style) of a list item element. + * + * **Syntax**: `<counter-style> | <string> | none` + * + * **Initial value**: `disc` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style-type + */ + "list-style-type"?: Property.ListStyleType | undefined; + /** + * The **`margin-block-end`** CSS property defines the logical block end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block-end + */ + "margin-block-end"?: Property.MarginBlockEnd<TLength> | undefined; + /** + * The **`margin-block-start`** CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block-start + */ + "margin-block-start"?: Property.MarginBlockStart<TLength> | undefined; + /** + * The **`margin-bottom`** CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-bottom + */ + "margin-bottom"?: Property.MarginBottom<TLength> | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------------: | :-------------------: | :----------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-margin-end)_ | 3 _(-moz-margin-end)_ | 3 _(-webkit-margin-end)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline-end + */ + "margin-inline-end"?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------: | :---------------------: | :------------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-margin-start)_ | 3 _(-moz-margin-start)_ | 3 _(-webkit-margin-start)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline-start + */ + "margin-inline-start"?: Property.MarginInlineStart<TLength> | undefined; + /** + * The **`margin-left`** CSS property sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-left + */ + "margin-left"?: Property.MarginLeft<TLength> | undefined; + /** + * The **`margin-right`** CSS property sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-right + */ + "margin-right"?: Property.MarginRight<TLength> | undefined; + /** + * The **`margin-top`** CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-top + */ + "margin-top"?: Property.MarginTop<TLength> | undefined; + /** + * The `margin-trim` property allows the container to trim the margins of its children where they adjoin the container's edges. + * + * **Syntax**: `none | in-flow | all` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | No | No | **16.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-trim + */ + "margin-trim"?: Property.MarginTrim | undefined; + /** + * The **`mask-border-mode`** CSS property specifies the blending mode used in a mask border. + * + * **Syntax**: `luminance | alpha` + * + * **Initial value**: `alpha` + */ + "mask-border-mode"?: Property.MaskBorderMode | undefined; + /** + * The **`mask-border-outset`** CSS property specifies the distance by which an element's mask border is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-outset)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-outset)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-outset + */ + "mask-border-outset"?: Property.MaskBorderOutset<TLength> | undefined; + /** + * The **`mask-border-repeat`** CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-repeat)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-repeat)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat + */ + "mask-border-repeat"?: Property.MaskBorderRepeat | undefined; + /** + * The **`mask-border-slice`** CSS property divides the image set by `mask-border-source` into regions. These regions are used to form the components of an element's mask border. + * + * **Syntax**: `<number-percentage>{1,4} fill?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------------: | :-----: | :----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-slice)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-slice)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-slice + */ + "mask-border-slice"?: Property.MaskBorderSlice | undefined; + /** + * The **`mask-border-source`** CSS property sets the source image used to create an element's mask border. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------------------: | :-----: | :-----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-source)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-source)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-source + */ + "mask-border-source"?: Property.MaskBorderSource | undefined; + /** + * The **`mask-border-width`** CSS property sets the width of an element's mask border. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------------: | :-----: | :----------------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image-width)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image-width)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border-width + */ + "mask-border-width"?: Property.MaskBorderWidth<TLength> | undefined; + /** + * The **`mask-clip`** CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area. + * + * **Syntax**: `[ <geometry-box> | no-clip ]#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-clip + */ + "mask-clip"?: Property.MaskClip | undefined; + /** + * The **`mask-composite`** CSS property represents a compositing operation used on the current mask layer with the mask layers below it. + * + * **Syntax**: `<compositing-operator>#` + * + * **Initial value**: `add` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-composite + */ + "mask-composite"?: Property.MaskComposite | undefined; + /** + * The **`mask-image`** CSS property sets the image that is used as mask layer for an element. By default this means the alpha channel of the mask image will be multiplied with the alpha channel of the element. This can be controlled with the `mask-mode` property. + * + * **Syntax**: `<mask-reference>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 16-79 | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-image + */ + "mask-image"?: Property.MaskImage | undefined; + /** + * The **`mask-mode`** CSS property sets whether the mask reference defined by `mask-image` is treated as a luminance or alpha mask. + * + * **Syntax**: `<masking-mode>#` + * + * **Initial value**: `match-source` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-mode + */ + "mask-mode"?: Property.MaskMode | undefined; + /** + * The **`mask-origin`** CSS property sets the origin of a mask. + * + * **Syntax**: `<geometry-box>#` + * + * **Initial value**: `border-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **120** | **53** | **15.4** | n/a | No | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-origin + */ + "mask-origin"?: Property.MaskOrigin | undefined; + /** + * The **`mask-position`** CSS property sets the initial position, relative to the mask position layer set by `mask-origin`, for each defined mask image. + * + * **Syntax**: `<position>#` + * + * **Initial value**: `center` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-position + */ + "mask-position"?: Property.MaskPosition<TLength> | undefined; + /** + * The **`mask-repeat`** CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-repeat + */ + "mask-repeat"?: Property.MaskRepeat | undefined; + /** + * The **`mask-size`** CSS property specifies the sizes of the mask images. The size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :---: | :-: | + * | **120** | **53** | **15.4** | 18-79 | No | + * | 4 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-size + */ + "mask-size"?: Property.MaskSize<TLength> | undefined; + /** + * The **`mask-type`** CSS property sets whether an SVG `<mask>` element is used as a _luminance_ or an _alpha_ mask. It applies to the `<mask>` element itself. + * + * **Syntax**: `luminance | alpha` + * + * **Initial value**: `luminance` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **24** | **35** | **7** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-type + */ + "mask-type"?: Property.MaskType | undefined; + /** + * This feature is not Baseline because it does not work in some of the most widely-used browsers. + * + * **Syntax**: `[ pack | next ] || [ definite-first | ordered ]` + * + * **Initial value**: `pack` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------: | :--: | :-: | + * | No | No | **preview** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/masonry-auto-flow + */ + "masonry-auto-flow"?: Property.MasonryAutoFlow | undefined; + /** + * The **`math-depth`** property describes a notion of _depth_ for each element of a mathematical formula, with respect to the top-level container of that formula. Concretely, this is used to determine the computed value of the font-size property when its specified value is `math`. + * + * **Syntax**: `auto-add | add(<integer>) | <integer>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | **117** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-depth + */ + "math-depth"?: Property.MathDepth | undefined; + /** + * The `math-shift` property indicates whether superscripts inside MathML formulas should be raised by a normal or compact shift. + * + * **Syntax**: `normal | compact` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **109** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-shift + */ + "math-shift"?: Property.MathShift | undefined; + /** + * The `math-style` property indicates whether MathML equations should render with normal or compact height. + * + * **Syntax**: `normal | compact` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **109** | **117** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/math-style + */ + "math-style"?: Property.MathStyle | undefined; + /** + * The **`max-block-size`** CSS property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by `writing-mode`. That is, if the writing direction is horizontal, then `max-block-size` is equivalent to `max-height`; if the writing direction is vertical, `max-block-size` is the same as `max-width`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-block-size + */ + "max-block-size"?: Property.MaxBlockSize<TLength> | undefined; + /** + * The **`max-height`** CSS property sets the maximum height of an element. It prevents the used value of the `height` property from becoming larger than the value specified for `max-height`. + * + * **Syntax**: `none | <length-percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **18** | **1** | **1.3** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-height + */ + "max-height"?: Property.MaxHeight<TLength> | undefined; + /** + * The **`max-inline-size`** CSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the `max-width` or the `max-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :--------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * | | | 10.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-inline-size + */ + "max-inline-size"?: Property.MaxInlineSize<TLength> | undefined; + /** + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + "max-lines"?: Property.MaxLines | undefined; + /** + * The **`max-width`** CSS property sets the maximum width of an element. It prevents the used value of the `width` property from becoming larger than the value specified by `max-width`. + * + * **Syntax**: `none | <length-percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/max-width + */ + "max-width"?: Property.MaxWidth<TLength> | undefined; + /** + * The **`min-block-size`** CSS property defines the minimum horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'min-width'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-block-size + */ + "min-block-size"?: Property.MinBlockSize<TLength> | undefined; + /** + * The **`min-height`** CSS property sets the minimum height of an element. It prevents the used value of the `height` property from becoming smaller than the value specified for `min-height`. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **3** | **1.3** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-height + */ + "min-height"?: Property.MinHeight<TLength> | undefined; + /** + * The **`min-inline-size`** CSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the `min-width` or the `min-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'min-width'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-inline-size + */ + "min-inline-size"?: Property.MinInlineSize<TLength> | undefined; + /** + * The **`min-width`** CSS property sets the minimum width of an element. It prevents the used value of the `width` property from becoming smaller than the value specified for `min-width`. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **7** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/min-width + */ + "min-width"?: Property.MinWidth<TLength> | undefined; + /** + * The **`mix-blend-mode`** CSS property sets how an element's content should blend with the content of the element's parent and the element's background. + * + * **Syntax**: `<blend-mode> | plus-lighter` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **41** | **32** | **8** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mix-blend-mode + */ + "mix-blend-mode"?: Property.MixBlendMode | undefined; + /** + * The **`offset-distance`** CSS property specifies a position along an `offset-path` for an element to be placed. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion-distance)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-distance + */ + "motion-distance"?: Property.OffsetDistance<TLength> | undefined; + /** + * The **`offset-path`** CSS property specifies a motion path for an element to follow and defines the element's positioning within the parent container or SVG coordinate system. + * + * **Syntax**: `none | <offset-path> || <coord-box>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------: | :-----: | :------: | :--: | :-: | + * | **55** | **72** | **15.4** | n/a | No | + * | 46 _(motion-path)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-path + */ + "motion-path"?: Property.OffsetPath | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + "motion-rotation"?: Property.OffsetRotate | undefined; + /** + * The **`object-fit`** CSS property sets how the content of a replaced element, such as an `<img>` or `<video>`, should be resized to fit its container. + * + * **Syntax**: `fill | contain | cover | none | scale-down` + * + * **Initial value**: `fill` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **32** | **36** | **10** | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/object-fit + */ + "object-fit"?: Property.ObjectFit | undefined; + /** + * The **`object-position`** CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **32** | **36** | **10** | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/object-position + */ + "object-position"?: Property.ObjectPosition<TLength> | undefined; + /** + * **Syntax**: `auto | <position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | **72** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-anchor + */ + "offset-anchor"?: Property.OffsetAnchor<TLength> | undefined; + /** + * The **`offset-distance`** CSS property specifies a position along an `offset-path` for an element to be placed. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion-distance)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-distance + */ + "offset-distance"?: Property.OffsetDistance<TLength> | undefined; + /** + * The **`offset-path`** CSS property specifies a motion path for an element to follow and defines the element's positioning within the parent container or SVG coordinate system. + * + * **Syntax**: `none | <offset-path> || <coord-box>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------------: | :-----: | :------: | :--: | :-: | + * | **55** | **72** | **15.4** | n/a | No | + * | 46 _(motion-path)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-path + */ + "offset-path"?: Property.OffsetPath | undefined; + /** + * **Syntax**: `normal | auto | <position>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | n/a | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-position + */ + "offset-position"?: Property.OffsetPosition<TLength> | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + "offset-rotate"?: Property.OffsetRotate | undefined; + /** + * The **`offset-rotate`** CSS property defines the orientation/direction of the element as it is positioned along the `offset-path`. + * + * **Syntax**: `[ auto | reverse ] || <angle>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :--------------------: | :-----: | :----: | :--: | :-: | + * | **56** | **72** | **16** | n/a | No | + * | 46 _(motion-rotation)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset-rotate + */ + "offset-rotation"?: Property.OffsetRotate | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **2** | **12** | **9** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/opacity + */ + opacity?: Property.Opacity | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/order + */ + order?: Property.Order | undefined; + /** + * The **`orphans`** CSS property sets the minimum number of lines in a block container that must be shown at the _bottom_ of a page, region, or column. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `2` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **25** | No | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/orphans + */ + orphans?: Property.Orphans | undefined; + /** + * The **`outline-color`** CSS property sets the color of an element's outline. + * + * **Syntax**: `<color> | invert` + * + * **Initial value**: `invert`, for browsers supporting it, `currentColor` for the other + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-color + */ + "outline-color"?: Property.OutlineColor | undefined; + /** + * The **`outline-offset`** CSS property sets the amount of space between an outline and the edge or border of an element. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-: | + * | **1** | **1.5** | **1.2** | **15** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-offset + */ + "outline-offset"?: Property.OutlineOffset<TLength> | undefined; + /** + * The **`outline-style`** CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `auto | <'border-style'>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-style + */ + "outline-style"?: Property.OutlineStyle | undefined; + /** + * The CSS **`outline-width`** property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1.5** | **1.2** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline-width + */ + "outline-width"?: Property.OutlineWidth<TLength> | undefined; + /** + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **56** | **66** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-anchor + */ + "overflow-anchor"?: Property.OverflowAnchor | undefined; + /** + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **69** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-block + */ + "overflow-block"?: Property.OverflowBlock | undefined; + /** + * The **`overflow-clip-box`** CSS property specifies relative to which box the clipping happens when there is an overflow. It is short hand for the `overflow-clip-box-inline` and `overflow-clip-box-block` properties. + * + * **Syntax**: `padding-box | content-box` + * + * **Initial value**: `padding-box` + */ + "overflow-clip-box"?: Property.OverflowClipBox | undefined; + /** + * **Syntax**: `<visual-box> || <length [0,∞]>` + * + * **Initial value**: `0px` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **90** | **102** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin + */ + "overflow-clip-margin"?: Property.OverflowClipMargin<TLength> | undefined; + /** + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **69** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-inline + */ + "overflow-inline"?: Property.OverflowInline | undefined; + /** + * The **`overflow-wrap`** CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box. + * + * **Syntax**: `normal | break-word | anywhere` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------: | :---------------: | :-------------: | :--------------: | :-------------------: | + * | **23** | **49** | **7** | **18** | **5.5** _(word-wrap)_ | + * | 1 _(word-wrap)_ | 3.5 _(word-wrap)_ | 1 _(word-wrap)_ | 12 _(word-wrap)_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-wrap + */ + "overflow-wrap"?: Property.OverflowWrap | undefined; + /** + * The **`overflow-x`** CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **3.5** | **3** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-x + */ + "overflow-x"?: Property.OverflowX | undefined; + /** + * The **`overflow-y`** CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **3.5** | **3** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow-y + */ + "overflow-y"?: Property.OverflowY | undefined; + /** + * The **`overlay`** CSS property specifies whether an element appearing in the top layer (for example, a shown popover or modal `<dialog>` element) is actually rendered in the top layer. This property is only relevant within a list of `transition-property` values, and only if `allow-discrete` is set as the `transition-behavior`. + * + * **Syntax**: `none | auto` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **117** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overlay + */ + overlay?: Property.Overlay | undefined; + /** + * The **`overscroll-behavior-block`** CSS property sets the browser's behavior when the block direction boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **77** | **73** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block + */ + "overscroll-behavior-block"?: Property.OverscrollBehaviorBlock | undefined; + /** + * The **`overscroll-behavior-inline`** CSS property sets the browser's behavior when the inline direction boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **77** | **73** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline + */ + "overscroll-behavior-inline"?: Property.OverscrollBehaviorInline | undefined; + /** + * The **`overscroll-behavior-x`** CSS property sets the browser's behavior when the horizontal boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x + */ + "overscroll-behavior-x"?: Property.OverscrollBehaviorX | undefined; + /** + * The **`overscroll-behavior-y`** CSS property sets the browser's behavior when the vertical boundary of a scrolling area is reached. + * + * **Syntax**: `contain | none | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y + */ + "overscroll-behavior-y"?: Property.OverscrollBehaviorY | undefined; + /** + * The **`padding-block-end`** CSS property defines the logical block end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block-end + */ + "padding-block-end"?: Property.PaddingBlockEnd<TLength> | undefined; + /** + * The **`padding-block-start`** CSS property defines the logical block start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block-start + */ + "padding-block-start"?: Property.PaddingBlockStart<TLength> | undefined; + /** + * The **`padding-bottom`** CSS property sets the height of the padding area on the bottom of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-bottom + */ + "padding-bottom"?: Property.PaddingBottom<TLength> | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------------------: | :--------------------: | :-----------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-padding-end)_ | 3 _(-moz-padding-end)_ | 3 _(-webkit-padding-end)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline-end + */ + "padding-inline-end"?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-------------------------: | :----------------------: | :-------------------------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * | 2 _(-webkit-padding-start)_ | 3 _(-moz-padding-start)_ | 3 _(-webkit-padding-start)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline-start + */ + "padding-inline-start"?: Property.PaddingInlineStart<TLength> | undefined; + /** + * The **`padding-left`** CSS property sets the width of the padding area to the left of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-left + */ + "padding-left"?: Property.PaddingLeft<TLength> | undefined; + /** + * The **`padding-right`** CSS property sets the width of the padding area on the right of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-right + */ + "padding-right"?: Property.PaddingRight<TLength> | undefined; + /** + * The **`padding-top`** CSS property sets the height of the padding area on the top of an element. + * + * **Syntax**: `<length> | <percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-top + */ + "padding-top"?: Property.PaddingTop<TLength> | undefined; + /** + * The **`page`** CSS property is used to specify the named page, a specific type of page defined by the `@page` at-rule. + * + * **Syntax**: `auto | <custom-ident>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-------: | :--: | :-: | + * | **85** | **110** | **≤13.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page + */ + page?: Property.Page | undefined; + /** + * The **`page-break-after`** CSS property adjusts page breaks _after_ the current element. + * + * **Syntax**: `auto | always | avoid | left | right | recto | verso` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-after + */ + "page-break-after"?: Property.PageBreakAfter | undefined; + /** + * The **`page-break-before`** CSS property adjusts page breaks _before_ the current element. + * + * **Syntax**: `auto | always | avoid | left | right | recto | verso` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **1** | **1.2** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-before + */ + "page-break-before"?: Property.PageBreakBefore | undefined; + /** + * The **`page-break-inside`** CSS property adjusts page breaks _inside_ the current element. + * + * **Syntax**: `auto | avoid` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **19** | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/page-break-inside + */ + "page-break-inside"?: Property.PageBreakInside | undefined; + /** + * The **`paint-order`** CSS property lets you control the order in which the fill and stroke (and painting markers) of text content and shapes are drawn. + * + * **Syntax**: `normal | [ fill || stroke || markers ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **35** | **60** | **8** | **17** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/paint-order + */ + "paint-order"?: Property.PaintOrder | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/perspective + */ + perspective?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/perspective-origin + */ + "perspective-origin"?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`pointer-events`** CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events. + * + * **Syntax**: `auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :----: | + * | **1** | **1.5** | **4** | **12** | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/pointer-events + */ + "pointer-events"?: Property.PointerEvents | undefined; + /** + * The **`position`** CSS property sets how an element is positioned in a document. The `top`, `right`, `bottom`, and `left` properties determine the final location of positioned elements. + * + * **Syntax**: `static | relative | absolute | sticky | fixed` + * + * **Initial value**: `static` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/position + */ + position?: Property.Position | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----------: | :-----------------: | :------: | :----------: | :-: | + * | **17** _-x-_ | **97** | **15.4** | **79** _-x-_ | No | + * | | 48 _(color-adjust)_ | 6 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/print-color-adjust + */ + "print-color-adjust"?: Property.PrintColorAdjust | undefined; + /** + * The **`quotes`** CSS property sets how the browser should render quotation marks that are added using the `open-quotes` or `close-quotes` values of the CSS `content` property. + * + * **Syntax**: `none | auto | [ <string> <string> ]+` + * + * **Initial value**: depends on user agent + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **11** | **1.5** | **9** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/quotes + */ + quotes?: Property.Quotes | undefined; + /** + * The **`resize`** CSS property sets whether an element is resizable, and if so, in which directions. + * + * **Syntax**: `none | both | horizontal | vertical | block | inline` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **1** | **4** | **3** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/resize + */ + resize?: Property.Resize | undefined; + /** + * The **`right`** CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/right + */ + right?: Property.Right<TLength> | undefined; + /** + * The **`rotate`** CSS property allows you to specify rotation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` property. + * + * **Syntax**: `none | <angle> | [ x | y | z | <number>{3} ] && <angle>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/rotate + */ + rotate?: Property.Rotate | undefined; + /** + * The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows. + * + * **Syntax**: `normal | <length-percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **47** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/row-gap + */ + "row-gap"?: Property.RowGap<TLength> | undefined; + /** + * The **`ruby-align`** CSS property defines the distribution of the different ruby elements over the base. + * + * **Syntax**: `start | center | space-between | space-around` + * + * **Initial value**: `space-around` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | No | **38** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/ruby-align + */ + "ruby-align"?: Property.RubyAlign | undefined; + /** + * **Syntax**: `separate | collapse | auto` + * + * **Initial value**: `separate` + */ + "ruby-merge"?: Property.RubyMerge | undefined; + /** + * The **`ruby-position`** CSS property defines the position of a ruby element relatives to its base element. It can be positioned over the element (`over`), under it (`under`), or between the characters on their right side (`inter-character`). + * + * **Syntax**: `[ alternate || [ over | under ] ] | inter-character` + * + * **Initial value**: `alternate` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :---: | :-: | + * | **84** | **38** | **7** _-x-_ | 12-79 | No | + * | 1 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/ruby-position + */ + "ruby-position"?: Property.RubyPosition | undefined; + /** + * The **`scale`** CSS property allows you to specify scale transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value. + * + * **Syntax**: `none | <number>{1,3}` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scale + */ + scale?: Property.Scale | undefined; + /** + * The **`scroll-behavior`** CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs. + * + * **Syntax**: `auto | smooth` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **61** | **36** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-behavior + */ + "scroll-behavior"?: Property.ScrollBehavior | undefined; + /** + * The `scroll-margin-block-end` property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-end + */ + "scroll-margin-block-end"?: Property.ScrollMarginBlockEnd<TLength> | undefined; + /** + * The `scroll-margin-block-start` property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-start + */ + "scroll-margin-block-start"?: Property.ScrollMarginBlockStart<TLength> | undefined; + /** + * The `scroll-margin-bottom` property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-bottom)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom + */ + "scroll-margin-bottom"?: Property.ScrollMarginBottom<TLength> | undefined; + /** + * The `scroll-margin-inline-end` property defines the margin of the scroll snap area at the end of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-end + */ + "scroll-margin-inline-end"?: Property.ScrollMarginInlineEnd<TLength> | undefined; + /** + * The `scroll-margin-inline-start` property defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-start + */ + "scroll-margin-inline-start"?: Property.ScrollMarginInlineStart<TLength> | undefined; + /** + * The `scroll-margin-left` property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-left)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left + */ + "scroll-margin-left"?: Property.ScrollMarginLeft<TLength> | undefined; + /** + * The `scroll-margin-right` property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-right)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right + */ + "scroll-margin-right"?: Property.ScrollMarginRight<TLength> | undefined; + /** + * The `scroll-margin-top` property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-top)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top + */ + "scroll-margin-top"?: Property.ScrollMarginTop<TLength> | undefined; + /** + * The `scroll-padding-block-end` property defines offsets for the end edge in the block dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-end + */ + "scroll-padding-block-end"?: Property.ScrollPaddingBlockEnd<TLength> | undefined; + /** + * The `scroll-padding-block-start` property defines offsets for the start edge in the block dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-start + */ + "scroll-padding-block-start"?: Property.ScrollPaddingBlockStart<TLength> | undefined; + /** + * The `scroll-padding-bottom` property defines offsets for the bottom of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-bottom + */ + "scroll-padding-bottom"?: Property.ScrollPaddingBottom<TLength> | undefined; + /** + * The `scroll-padding-inline-end` property defines offsets for the end edge in the inline dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-end + */ + "scroll-padding-inline-end"?: Property.ScrollPaddingInlineEnd<TLength> | undefined; + /** + * The `scroll-padding-inline-start` property defines offsets for the start edge in the inline dimension of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-start + */ + "scroll-padding-inline-start"?: Property.ScrollPaddingInlineStart<TLength> | undefined; + /** + * The `scroll-padding-left` property defines offsets for the left of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-left + */ + "scroll-padding-left"?: Property.ScrollPaddingLeft<TLength> | undefined; + /** + * The `scroll-padding-right` property defines offsets for the right of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-right + */ + "scroll-padding-right"?: Property.ScrollPaddingRight<TLength> | undefined; + /** + * The **`scroll-padding-top`** property defines offsets for the top of the _optimal viewing region_ of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport. + * + * **Syntax**: `auto | <length-percentage>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-top + */ + "scroll-padding-top"?: Property.ScrollPaddingTop<TLength> | undefined; + /** + * The `scroll-snap-align` property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snapport (as the alignment container). The two values specify the snapping alignment in the block axis and inline axis, respectively. If only one value is specified, the second value defaults to the same value. + * + * **Syntax**: `[ none | start | end | center ]{1,2}` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-align + */ + "scroll-snap-align"?: Property.ScrollSnapAlign | undefined; + /** + * The `scroll-margin-bottom` property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-bottom)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom + */ + "scroll-snap-margin-bottom"?: Property.ScrollMarginBottom<TLength> | undefined; + /** + * The `scroll-margin-left` property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-left)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left + */ + "scroll-snap-margin-left"?: Property.ScrollMarginLeft<TLength> | undefined; + /** + * The `scroll-margin-right` property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-right)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right + */ + "scroll-snap-margin-right"?: Property.ScrollMarginRight<TLength> | undefined; + /** + * The `scroll-margin-top` property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :---------------------------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin-top)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top + */ + "scroll-snap-margin-top"?: Property.ScrollMarginTop<TLength> | undefined; + /** + * The **`scroll-snap-stop`** CSS property defines whether or not the scroll container is allowed to "pass over" possible snap positions. + * + * **Syntax**: `normal | always` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **75** | **103** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-stop + */ + "scroll-snap-stop"?: Property.ScrollSnapStop | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | [ x | y | block | inline | both ] [ mandatory | proximity ]?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----------: | + * | **69** | 39-68 | **11** | **79** | **10** _-x-_ | + * | | | 9 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-snap-type + */ + "scroll-snap-type"?: Property.ScrollSnapType | undefined; + /** + * The **`scroll-timeline-axis`** CSS property can be used to specify the scrollbar that will be used to provide the timeline for a scroll-timeline animation. + * + * **Syntax**: `[ block | inline | x | y ]#` + * + * **Initial value**: `block` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-axis + */ + "scroll-timeline-axis"?: Property.ScrollTimelineAxis | undefined; + /** + * The **`scroll-timeline-name`** CSS property defines a name that can be used to identify an element as the source of a scroll timeline for an animation. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-name + */ + "scroll-timeline-name"?: Property.ScrollTimelineName | undefined; + /** + * The **`scrollbar-color`** CSS property sets the color of the scrollbar track and thumb. + * + * **Syntax**: `auto | <color>{2}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **121** | **64** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-color + */ + "scrollbar-color"?: Property.ScrollbarColor | undefined; + /** + * The **`scrollbar-gutter`** CSS property allows authors to reserve space for the scrollbar, preventing unwanted layout changes as the content grows while also avoiding unnecessary visuals when scrolling isn't needed. + * + * **Syntax**: `auto | stable && both-edges?` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **94** | **97** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter + */ + "scrollbar-gutter"?: Property.ScrollbarGutter | undefined; + /** + * The **`scrollbar-width`** property allows the author to set the maximum thickness of an element's scrollbars when they are shown. + * + * **Syntax**: `auto | thin | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **121** | **64** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scrollbar-width + */ + "scrollbar-width"?: Property.ScrollbarWidth | undefined; + /** + * The **`shape-image-threshold`** CSS property sets the alpha channel threshold used to extract the shape using an image as the value for `shape-outside`. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `0.0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-image-threshold + */ + "shape-image-threshold"?: Property.ShapeImageThreshold | undefined; + /** + * The **`shape-margin`** CSS property sets a margin for a CSS shape created using `shape-outside`. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-margin + */ + "shape-margin"?: Property.ShapeMargin<TLength> | undefined; + /** + * The **`shape-outside`** CSS property defines a shape—which may be non-rectangular—around which adjacent inline content should wrap. By default, inline content wraps around its margin box; `shape-outside` provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes. + * + * **Syntax**: `none | [ <shape-box> || <basic-shape> ] | <image>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **37** | **62** | **10.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/shape-outside + */ + "shape-outside"?: Property.ShapeOutside | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **21** | **91** | **7** | n/a | No | + * | | 4 _-x-_ | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/tab-size + */ + "tab-size"?: Property.TabSize<TLength> | undefined; + /** + * The **`table-layout`** CSS property sets the algorithm used to lay out `<table>` cells, rows, and columns. + * + * **Syntax**: `auto | fixed` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **14** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/table-layout + */ + "table-layout"?: Property.TableLayout | undefined; + /** + * The **`text-align`** CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box. This means it works like `vertical-align` but in the horizontal direction. + * + * **Syntax**: `start | end | left | right | center | justify | match-parent` + * + * **Initial value**: `start`, or a nameless value that acts as `left` if _direction_ is `ltr`, `right` if _direction_ is `rtl` if `start` is not supported by the browser. + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-align + */ + "text-align"?: Property.TextAlign | undefined; + /** + * The **`text-align-last`** CSS property sets how the last line of a block or a line, right before a forced line break, is aligned. + * + * **Syntax**: `auto | start | end | left | right | center | justify` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **47** | **49** | **16** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-align-last + */ + "text-align-last"?: Property.TextAlignLast | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------: | :-----: | :--------------------------: | :----: | :------------------------------------: | + * | **48** | **48** | **15.4** | **79** | **11** _(-ms-text-combine-horizontal)_ | + * | 9 _(-webkit-text-combine)_ | | 5.1 _(-webkit-text-combine)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-combine-upright + */ + "text-combine-upright"?: Property.TextCombineUpright | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-color + */ + "text-decoration-color"?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-line + */ + "text-decoration-line"?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-skip`** CSS property sets what parts of an element's content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors. + * + * **Syntax**: `none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]` + * + * **Initial value**: `objects` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | 57-64 | No | **12.1** | n/a | No | + * | | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip + */ + "text-decoration-skip"?: Property.TextDecorationSkip | undefined; + /** + * The **`text-decoration-skip-ink`** CSS property specifies how overlines and underlines are drawn when they pass over glyph ascenders and descenders. + * + * **Syntax**: `auto | all | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **64** | **70** | **15.4** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink + */ + "text-decoration-skip-ink"?: Property.TextDecorationSkipInk | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **57** | **36** | **12.1** | n/a | No | + * | | | 8 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-style + */ + "text-decoration-style"?: Property.TextDecorationStyle | undefined; + /** + * The **`text-decoration-thickness`** CSS property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline. + * + * **Syntax**: `auto | from-font | <length> | <percentage> ` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **89** | **70** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness + */ + "text-decoration-thickness"?: Property.TextDecorationThickness<TLength> | undefined; + /** + * The **`text-emphasis-color`** CSS property sets the color of emphasis marks. This value can also be set using the `text-emphasis` shorthand. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color + */ + "text-emphasis-color"?: Property.TextEmphasisColor | undefined; + /** + * The **`text-emphasis-position`** CSS property sets where emphasis marks are drawn. Like ruby text, if there isn't enough room for emphasis marks, the line height is increased. + * + * **Syntax**: `[ over | under ] && [ right | left ]` + * + * **Initial value**: `over right` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position + */ + "text-emphasis-position"?: Property.TextEmphasisPosition | undefined; + /** + * The **`text-emphasis-style`** CSS property sets the appearance of emphasis marks. It can also be set, and reset, using the `text-emphasis` shorthand. + * + * **Syntax**: `none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style + */ + "text-emphasis-style"?: Property.TextEmphasisStyle | undefined; + /** + * The **`text-indent`** CSS property sets the length of empty space (indentation) that is put before lines of text in a block. + * + * **Syntax**: `<length-percentage> && hanging? && each-line?` + * + * **Initial value**: `0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-indent + */ + "text-indent"?: Property.TextIndent<TLength> | undefined; + /** + * The **`text-justify`** CSS property sets what type of justification should be applied to text when `text-align``: justify;` is set on an element. + * + * **Syntax**: `auto | inter-character | inter-word | none` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :---: | :----: | + * | n/a | **55** | No | 12-79 | **11** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-justify + */ + "text-justify"?: Property.TextJustify | undefined; + /** + * The **`text-orientation`** CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when `writing-mode` is not `horizontal-tb`). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers. + * + * **Syntax**: `mixed | upright | sideways` + * + * **Initial value**: `mixed` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-------: | :--: | :-: | + * | **48** | **41** | **14** | n/a | No | + * | 11 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-orientation + */ + "text-orientation"?: Property.TextOrientation | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **1** | **7** | **1.3** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-overflow + */ + "text-overflow"?: Property.TextOverflow | undefined; + /** + * The **`text-rendering`** CSS property provides information to the rendering engine about what to optimize for when rendering text. + * + * **Syntax**: `auto | optimizeSpeed | optimizeLegibility | geometricPrecision` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **4** | **1** | **5** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-rendering + */ + "text-rendering"?: Property.TextRendering | undefined; + /** + * The **`text-shadow`** CSS property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and any of its `decorations`. Each shadow is described by some combination of X and Y offsets from the element, blur radius, and color. + * + * **Syntax**: `none | <shadow-t>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **2** | **3.5** | **1.1** | **12** | **10** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-shadow + */ + "text-shadow"?: Property.TextShadow | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **54** | No | No | **79** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-size-adjust + */ + "text-size-adjust"?: Property.TextSizeAdjust | undefined; + /** + * The **`text-transform`** CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby. + * + * **Syntax**: `none | capitalize | uppercase | lowercase | full-width | full-size-kana` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-transform + */ + "text-transform"?: Property.TextTransform | undefined; + /** + * The **`text-underline-offset`** CSS property sets the offset distance of an underline text decoration line (applied using `text-decoration`) from its original position. + * + * **Syntax**: `auto | <length> | <percentage> ` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **70** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-underline-offset + */ + "text-underline-offset"?: Property.TextUnderlineOffset<TLength> | undefined; + /** + * The **`text-underline-position`** CSS property specifies the position of the underline which is set using the `text-decoration` property's `underline` value. + * + * **Syntax**: `auto | from-font | [ under || [ left | right ] ]` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :---: | + * | **33** | **74** | **12.1** | **12** | **6** | + * | | | 9 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-underline-position + */ + "text-underline-position"?: Property.TextUnderlinePosition | undefined; + /** + * The **`text-wrap`** CSS property controls how text inside an element is wrapped. The different values provide: + * + * **Syntax**: `wrap | nowrap | balance | stable | pretty` + * + * **Initial value**: `wrap` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **114** | **121** | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-wrap + */ + "text-wrap"?: Property.TextWrap | undefined; + /** + * The **`timeline-scope`** CSS property modifies the scope of a named animation timeline. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **116** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/timeline-scope + */ + "timeline-scope"?: Property.TimelineScope | undefined; + /** + * The **`top`** CSS property participates in specifying the vertical position of a positioned element. It has no effect on non-positioned elements. + * + * **Syntax**: `<length> | <percentage> | auto` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/top + */ + top?: Property.Top<TLength> | undefined; + /** + * The **`touch-action`** CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser). + * + * **Syntax**: `auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :------: | + * | **36** | **52** | **13** | **12** | **11** | + * | | | | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/touch-action + */ + "touch-action"?: Property.TouchAction | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :-----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | 9 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform + */ + transform?: Property.Transform | undefined; + /** + * The **`transform-box`** CSS property defines the layout box to which the `transform`, individual transform properties `translate`,`scale`, and `rotate`, and `transform-origin` properties relate. + * + * **Syntax**: `content-box | border-box | fill-box | stroke-box | view-box` + * + * **Initial value**: `view-box` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **64** | **55** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-box + */ + "transform-box"?: Property.TransformBox | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :-----: | + * | **36** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 2 _-x-_ | | 9 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-origin + */ + "transform-origin"?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :-: | + * | **36** | **16** | **9** | **12** | No | + * | 12 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transform-style + */ + "transform-style"?: Property.TransformStyle | undefined; + /** + * The **`transition-behavior`** CSS property specifies whether transitions will be started for properties whose animation behavior is discrete. + * + * **Syntax**: `<transition-behavior-value>#` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **117** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-behavior + */ + "transition-behavior"?: Property.TransitionBehavior | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-delay + */ + "transition-delay"?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-duration + */ + "transition-duration"?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-property + */ + "transition-property"?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition-timing-function + */ + "transition-timing-function"?: Property.TransitionTimingFunction | undefined; + /** + * The **`translate`** CSS property allows you to specify translation transforms individually and independently of the `transform` property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the `transform` value. + * + * **Syntax**: `none | <length-percentage> [ <length-percentage> <length>? ]?` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :------: | :--: | :-: | + * | **104** | **72** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/translate + */ + translate?: Property.Translate<TLength> | undefined; + /** + * The **`unicode-bidi`** CSS property, together with the `direction` property, determines how bidirectional text in a document is handled. For example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The `unicode-bidi` property overrides this algorithm and allows the developer to control the text embedding. + * + * **Syntax**: `normal | embed | isolate | bidi-override | isolate-override | plaintext` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-----: | + * | **2** | **1** | **1.3** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/unicode-bidi + */ + "unicode-bidi"?: Property.UnicodeBidi | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :---------: | :------: | :----------: | + * | **54** | **69** | **3** _-x-_ | **79** | **10** _-x-_ | + * | 1 _-x-_ | 1 _-x-_ | | 12 _-x-_ | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/user-select + */ + "user-select"?: Property.UserSelect | undefined; + /** + * The **`vertical-align`** CSS property sets vertical alignment of an inline, inline-block or table-cell box. + * + * **Syntax**: `baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>` + * + * **Initial value**: `baseline` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/vertical-align + */ + "vertical-align"?: Property.VerticalAlign<TLength> | undefined; + /** + * The **`view-timeline-axis`** CSS property is used to specify the scrollbar direction that will be used to provide the timeline for a _named view progress timeline_ animation, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline-axis` is set on the subject. See CSS scroll-driven animations for more details. + * + * **Syntax**: `[ block | inline | x | y ]#` + * + * **Initial value**: `block` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-axis + */ + "view-timeline-axis"?: Property.ViewTimelineAxis | undefined; + /** + * The **`view-timeline-inset`** CSS property is used to specify one or two values representing an adjustment to the position of the scrollport (see Scroll container for more details) in which the subject element of a _named view progress timeline_ animation is deemed to be visible. Put another way, this allows you to specify start and/or end inset (or outset) values that offset the position of the timeline. + * + * **Syntax**: `[ [ auto | <length-percentage> ]{1,2} ]#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-inset + */ + "view-timeline-inset"?: Property.ViewTimelineInset<TLength> | undefined; + /** + * The **`view-timeline-name`** CSS property is used to define the name of a _named view progress timeline_, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline` is set on the subject. + * + * **Syntax**: `none | <dashed-ident>#` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline-name + */ + "view-timeline-name"?: Property.ViewTimelineName | undefined; + /** + * The **`view-transition-name`** CSS property provides the selected element with a distinct identifying name (a `<custom-ident>`) and causes it to participate in a separate view transition from the root view transition — or no view transition if the `none` value is specified. + * + * **Syntax**: `none | <custom-ident>` + * + * **Initial value**: `none` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **111** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-transition-name + */ + "view-transition-name"?: Property.ViewTransitionName | undefined; + /** + * The **`visibility`** CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a `<table>`. + * + * **Syntax**: `visible | hidden | collapse` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/visibility + */ + visibility?: Property.Visibility | undefined; + /** + * The **`white-space`** CSS property sets how white space inside an element is handled. + * + * **Syntax**: `normal | pre | nowrap | pre-wrap | pre-line | break-spaces | [ <'white-space-collapse'> || <'text-wrap'> || <'white-space-trim'> ]` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/white-space + */ + "white-space"?: Property.WhiteSpace | undefined; + /** + * The **`white-space-collapse`** CSS property controls how white space inside an element is collapsed. + * + * **Syntax**: `collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces` + * + * **Initial value**: `collapse` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **114** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/white-space-collapse + */ + "white-space-collapse"?: Property.WhiteSpaceCollapse | undefined; + /** + * **Syntax**: `none | discard-before || discard-after || discard-inner` + * + * **Initial value**: `none` + */ + "white-space-trim"?: Property.WhiteSpaceTrim | undefined; + /** + * The **`widows`** CSS property sets the minimum number of lines in a block container that must be shown at the _top_ of a page, region, or column. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `2` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :---: | + * | **25** | No | **1.3** | **12** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/widows + */ + widows?: Property.Widows | undefined; + /** + * The **`width`** CSS property sets an element's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box`, it sets the width of the border area. + * + * **Syntax**: `auto | <length> | <percentage> | min-content | max-content | fit-content | fit-content(<length-percentage>)` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/width + */ + width?: Property.Width<TLength> | undefined; + /** + * The **`will-change`** CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is actually changed. These kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. + * + * **Syntax**: `auto | <animateable-feature>#` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **36** | **36** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/will-change + */ + "will-change"?: Property.WillChange | undefined; + /** + * The **`word-break`** CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box. + * + * **Syntax**: `normal | break-all | keep-all | break-word` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **15** | **3** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/word-break + */ + "word-break"?: Property.WordBreak | undefined; + /** + * The **`word-spacing`** CSS property sets the length of space between words and between tags. + * + * **Syntax**: `normal | <length>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **6** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/word-spacing + */ + "word-spacing"?: Property.WordSpacing<TLength> | undefined; + /** + * The **`overflow-wrap`** CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box. + * + * **Syntax**: `normal | break-word` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :-----: | :-: | + * | **≤80** | **≤72** | **≤13.1** | **≤80** | No | + */ + "word-wrap"?: Property.WordWrap | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :---: | + * | **48** | **41** | **10.1** | **12** | **9** | + * | 8 _-x-_ | | 5.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/writing-mode + */ + "writing-mode"?: Property.WritingMode | undefined; + /** + * The **`z-index`** CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one. + * + * **Syntax**: `auto | <integer>` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/z-index + */ + "z-index"?: Property.ZIndex | undefined; + /** + * The non-standard **`zoom`** CSS property can be used to control the magnification level of an element. `transform: scale()` should be used instead of this property, if possible. However, unlike CSS Transforms, `zoom` affects the layout size of the element. + * + * **Syntax**: `normal | reset | <number> | <percentage>` + * + * **Initial value**: `normal` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :-----: | + * | **1** | n/a | **3.1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/zoom + */ + zoom?: Property.Zoom | undefined; +} + +export interface StandardShorthandPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`all`** shorthand CSS property resets all of an element's properties except `unicode-bidi`, `direction`, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin. + * + * **Syntax**: `initial | inherit | unset | revert | revert-layer` + * + * **Initial value**: There is no practical initial value for it. + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :--: | :-: | + * | **37** | **27** | **9.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/all + */ + all?: Property.All | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **43** | **16** | **9** | **12** | **10** | + * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation + */ + animation?: Property.Animation<TTime> | undefined; + /** + * The **`animation-range`** CSS shorthand property is used to set the start and end of an animation's attachment range along its timeline, i.e. where along the timeline an animation will start and end. + * + * **Syntax**: `[ <'animation-range-start'> <'animation-range-end'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | No | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/animation-range + */ + "animation-range"?: Property.AnimationRange<TLength> | undefined; + /** + * The **`background`** shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. + * + * **Syntax**: `[ <bg-layer> , ]* <final-bg-layer>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background + */ + background?: Property.Background<TLength> | undefined; + /** + * The **`background-position`** CSS property sets the initial position for each background image. The position is relative to the position layer set by `background-origin`. + * + * **Syntax**: `<bg-position>#` + * + * **Initial value**: `0% 0%` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/background-position + */ + "background-position"?: Property.BackgroundPosition<TLength> | undefined; + /** + * The **`border`** shorthand CSS property sets an element's border. It sets the values of `border-width`, `border-style`, and `border-color`. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border + */ + border?: Property.Border<TLength> | undefined; + /** + * The **`border-block`** CSS property is a shorthand property for setting the individual logical block border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block + */ + "border-block"?: Property.BorderBlock<TLength> | undefined; + /** + * The **`border-block-end`** CSS property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end + */ + "border-block-end"?: Property.BorderBlockEnd<TLength> | undefined; + /** + * The **`border-block-start`** CSS property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start + */ + "border-block-start"?: Property.BorderBlockStart<TLength> | undefined; + /** + * The **`border-bottom`** shorthand CSS property sets an element's bottom border. It sets the values of `border-bottom-width`, `border-bottom-style` and `border-bottom-color`. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom + */ + "border-bottom"?: Property.BorderBottom<TLength> | undefined; + /** + * The **`border-color`** shorthand CSS property sets the color of an element's border. + * + * **Syntax**: `<color>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-color + */ + "border-color"?: Property.BorderColor | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-------: | :-----: | :----: | :----: | + * | **16** | **15** | **6** | **12** | **11** | + * | 7 _-x-_ | 3.5 _-x-_ | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-image + */ + "border-image"?: Property.BorderImage | undefined; + /** + * The **`border-inline`** CSS property is a shorthand property for setting the individual logical inline border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline + */ + "border-inline"?: Property.BorderInline<TLength> | undefined; + /** + * The **`border-inline-end`** CSS property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end + */ + "border-inline-end"?: Property.BorderInlineEnd<TLength> | undefined; + /** + * The **`border-inline-start`** CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-top-width'> || <'border-top-style'> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **41** | **12.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start + */ + "border-inline-start"?: Property.BorderInlineStart<TLength> | undefined; + /** + * The **`border-left`** shorthand CSS property sets all the properties of an element's left border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-left + */ + "border-left"?: Property.BorderLeft<TLength> | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :---: | + * | **4** | **4** | **5** | **12** | **9** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-radius + */ + "border-radius"?: Property.BorderRadius<TLength> | undefined; + /** + * The **`border-right`** shorthand CSS property sets all the properties of an element's right border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-----: | + * | **1** | **1** | **1** | **12** | **5.5** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-right + */ + "border-right"?: Property.BorderRight<TLength> | undefined; + /** + * The **`border-style`** shorthand CSS property sets the line style for all four sides of an element's border. + * + * **Syntax**: `<line-style>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-style + */ + "border-style"?: Property.BorderStyle | undefined; + /** + * The **`border-top`** shorthand CSS property sets all the properties of an element's top border. + * + * **Syntax**: `<line-width> || <line-style> || <color>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-top + */ + "border-top"?: Property.BorderTop<TLength> | undefined; + /** + * The **`border-width`** shorthand CSS property sets the width of an element's border. + * + * **Syntax**: `<line-width>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/border-width + */ + "border-width"?: Property.BorderWidth<TLength> | undefined; + /** **Syntax**: `<'caret-color'> || <'caret-shape'>` */ + caret?: Property.Caret | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/column-rule + */ + "column-rule"?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----: | :----: | :----: | + * | **50** | **52** | **9** | **12** | **10** | + * | | | 3 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/columns + */ + columns?: Property.Columns<TLength> | undefined; + /** + * The **`contain-intrinsic-size`** CSS shorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment. + * + * **Syntax**: `[ auto? [ none | <length> ] ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **83** | **107** | **17** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-size + */ + "contain-intrinsic-size"?: Property.ContainIntrinsicSize<TLength> | undefined; + /** + * The **container** shorthand CSS property establishes the element as a query container and specifies the name or name for the containment context used in a container query. + * + * **Syntax**: `<'container-name'> [ / <'container-type'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **105** | **110** | **16** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/container + */ + container?: Property.Container | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :------: | + * | **29** | **20** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | 10 _-x-_ | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex + */ + flex?: Property.Flex<TLength> | undefined; + /** + * The **`flex-flow`** CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. + * + * **Syntax**: `<'flex-direction'> || <'flex-wrap'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :-----: | :----: | :----: | + * | **29** | **28** | **9** | **12** | **11** | + * | 21 _-x-_ | | 7 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/flex-flow + */ + "flex-flow"?: Property.FlexFlow | undefined; + /** + * The **`font`** CSS shorthand property sets all the different properties of an element's font. Alternatively, it sets an element's font to a system font. + * + * **Syntax**: `[ [ <'font-style'> || <font-variant-css21> || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/font + */ + font?: Property.Font | undefined; + /** + * The **`gap`** CSS property sets the gaps (gutters) between rows and columns. It is a shorthand for `row-gap` and `column-gap`. + * + * **Syntax**: `<'row-gap'> <'column-gap'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/gap + */ + gap?: Property.Gap<TLength> | undefined; + /** + * The **`grid`** CSS property is a shorthand property that sets all of the explicit and implicit grid properties in a single declaration. + * + * **Syntax**: `<'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid + */ + grid?: Property.Grid | undefined; + /** + * The **`grid-area`** CSS shorthand property specifies a grid item's size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]{0,3}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-area + */ + "grid-area"?: Property.GridArea | undefined; + /** + * The **`grid-column`** CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-column + */ + "grid-column"?: Property.GridColumn | undefined; + /** + * The **`grid-row`** CSS shorthand property specifies a grid item's size and location within a grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. + * + * **Syntax**: `<grid-line> [ / <grid-line> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-row + */ + "grid-row"?: Property.GridRow | undefined; + /** + * The **`grid-template`** CSS property is a shorthand property for defining grid columns, grid rows, and grid areas. + * + * **Syntax**: `none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :-: | + * | **57** | **52** | **10.1** | **16** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/grid-template + */ + "grid-template"?: Property.GridTemplate | undefined; + /** + * The **`inset`** CSS property is a shorthand that corresponds to the `top`, `right`, `bottom`, and/or `left` properties. It has the same multi-value syntax of the `margin` shorthand. + * + * **Syntax**: `<'top'>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset + */ + inset?: Property.Inset<TLength> | undefined; + /** + * The **`inset-block`** CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-block + */ + "inset-block"?: Property.InsetBlock<TLength> | undefined; + /** + * The **`inset-inline`** CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **63** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/inset-inline + */ + "inset-inline"?: Property.InsetInline<TLength> | undefined; + /** + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + "line-clamp"?: Property.LineClamp | undefined; + /** + * The **`list-style`** CSS shorthand property allows you to set all the list style properties at once. + * + * **Syntax**: `<'list-style-type'> || <'list-style-position'> || <'list-style-image'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/list-style + */ + "list-style"?: Property.ListStyle | undefined; + /** + * The **`margin`** CSS shorthand property sets the margin area on all four sides of an element. + * + * **Syntax**: `[ <length> | <percentage> | auto ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin + */ + margin?: Property.Margin<TLength> | undefined; + /** + * The **`margin-block`** CSS shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-block + */ + "margin-block"?: Property.MarginBlock<TLength> | undefined; + /** + * The **`margin-inline`** CSS shorthand property is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'margin-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/margin-inline + */ + "margin-inline"?: Property.MarginInline<TLength> | undefined; + /** + * The **`mask`** CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points. + * + * **Syntax**: `<mask-layer>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-------: | :---: | :-: | + * | **1** | **53** | **15.4** | 12-79 | No | + * | | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask + */ + mask?: Property.Mask<TLength> | undefined; + /** + * The **`mask-border`** CSS shorthand property lets you create a mask along the edge of an element's border. + * + * **Syntax**: `<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------------------------------: | :-----: | :----------------------------: | :--: | :-: | + * | **1** _(-webkit-mask-box-image)_ | No | **17.2** | n/a | No | + * | | | 3.1 _(-webkit-mask-box-image)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/mask-border + */ + "mask-border"?: Property.MaskBorder | undefined; + /** + * The **`offset`** CSS shorthand property sets all the properties required for animating an element along a defined path. + * + * **Syntax**: `[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset + */ + motion?: Property.Offset<TLength> | undefined; + /** + * The **`offset`** CSS shorthand property sets all the properties required for animating an element along a defined path. + * + * **Syntax**: `[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----------: | :-----: | :----: | :--: | :-: | + * | **55** | **72** | **16** | n/a | No | + * | 46 _(motion)_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/offset + */ + offset?: Property.Offset<TLength> | undefined; + /** + * The **`outline`** CSS shorthand property sets most of the outline properties in a single declaration. + * + * **Syntax**: `[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :----: | :---: | + * | **94** | **88** | **16.4** | **94** | **8** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/outline + */ + outline?: Property.Outline<TLength> | undefined; + /** + * The **`overflow`** CSS shorthand property sets the desired behavior for an element's overflow — i.e. when an element's content is too big to fit in its block formatting context — in both directions. + * + * **Syntax**: `[ visible | hidden | clip | scroll | auto ]{1,2}` + * + * **Initial value**: `visible` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overflow + */ + overflow?: Property.Overflow | undefined; + /** + * The **`overscroll-behavior`** CSS property sets what a browser does when reaching the boundary of a scrolling area. It's a shorthand for `overscroll-behavior-x` and `overscroll-behavior-y`. + * + * **Syntax**: `[ contain | none | auto ]{1,2}` + * + * **Initial value**: `auto` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :-: | + * | **63** | **59** | **16** | **18** | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior + */ + "overscroll-behavior"?: Property.OverscrollBehavior | undefined; + /** + * The **`padding`** CSS shorthand property sets the padding area on all four sides of an element at once. + * + * **Syntax**: `[ <length> | <percentage> ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **4** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding + */ + padding?: Property.Padding<TLength> | undefined; + /** + * The **`padding-block`** CSS shorthand property defines the logical block start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-block + */ + "padding-block"?: Property.PaddingBlock<TLength> | undefined; + /** + * The **`padding-inline`** CSS shorthand property defines the logical inline start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **87** | **66** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/padding-inline + */ + "padding-inline"?: Property.PaddingInline<TLength> | undefined; + /** + * The **`place-content`** CSS shorthand property allows you to align content along both the block and inline directions at once (i.e. the `align-content` and `justify-content` properties) in a relevant layout system such as Grid or Flexbox. + * + * **Syntax**: `<'align-content'> <'justify-content'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **9** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-content + */ + "place-content"?: Property.PlaceContent | undefined; + /** + * The CSS **`place-items`** shorthand property allows you to align items along both the block and inline directions at once (i.e. the `align-items` and `justify-items` properties) in a relevant layout system such as Grid or Flexbox. If the second value is not set, the first value is also used for it. + * + * **Syntax**: `<'align-items'> <'justify-items'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-items + */ + "place-items"?: Property.PlaceItems | undefined; + /** + * The **`place-self`** CSS shorthand property allows you to align an individual item in both the block and inline directions at once (i.e. the `align-self` and `justify-self` properties) in a relevant layout system such as Grid or Flexbox. If the second value is not present, the first value is also used for it. + * + * **Syntax**: `<'align-self'> <'justify-self'>?` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **59** | **45** | **11** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/place-self + */ + "place-self"?: Property.PlaceSelf | undefined; + /** + * The **`scroll-margin`** shorthand property sets all of the scroll margins of an element at once, assigning values much like the `margin` property does for margins of an element. + * + * **Syntax**: `<length>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------: | :--: | :-: | + * | **69** | **90** | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin + */ + "scroll-margin"?: Property.ScrollMargin<TLength> | undefined; + /** + * The `scroll-margin-block` shorthand property sets the scroll margins of an element in the block dimension. + * + * **Syntax**: `<length>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block + */ + "scroll-margin-block"?: Property.ScrollMarginBlock<TLength> | undefined; + /** + * The `scroll-margin-inline` shorthand property sets the scroll margins of an element in the inline dimension. + * + * **Syntax**: `<length>{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline + */ + "scroll-margin-inline"?: Property.ScrollMarginInline<TLength> | undefined; + /** + * The **`scroll-padding`** shorthand property sets scroll padding on all sides of an element at once, much like the `padding` property does for padding on an element. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :------: | :--: | :-: | + * | **69** | **68** | **14.1** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding + */ + "scroll-padding"?: Property.ScrollPadding<TLength> | undefined; + /** + * The `scroll-padding-block` shorthand property sets the scroll padding of an element in the block dimension. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block + */ + "scroll-padding-block"?: Property.ScrollPaddingBlock<TLength> | undefined; + /** + * The `scroll-padding-inline` shorthand property sets the scroll padding of an element in the inline dimension. + * + * **Syntax**: `[ auto | <length-percentage> ]{1,2}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :--: | :-: | + * | **69** | **68** | **15** | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline + */ + "scroll-padding-inline"?: Property.ScrollPaddingInline<TLength> | undefined; + /** + * The **`scroll-margin`** shorthand property sets all of the scroll margins of an element at once, assigning values much like the `margin` property does for margins of an element. + * + * **Syntax**: `<length>{1,4}` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :-----------------------: | :--: | :-: | + * | **69** | 68-90 | **14.1** | n/a | No | + * | | | 11 _(scroll-snap-margin)_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-margin + */ + "scroll-snap-margin"?: Property.ScrollMargin<TLength> | undefined; + /** + * The **`scroll-timeline`** CSS shorthand property defines a name that can be used to identify the source element of a scroll timeline, along with the scrollbar axis that should provide the timeline. + * + * **Syntax**: `[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/scroll-timeline + */ + "scroll-timeline"?: Property.ScrollTimeline | undefined; + /** + * The **`text-decoration`** shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for `text-decoration-line`, `text-decoration-color`, `text-decoration-style`, and the newer `text-decoration-thickness` property. + * + * **Syntax**: `<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :----: | :-----: | :----: | :----: | :---: | + * | **1** | **1** | **1** | **12** | **3** | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-decoration + */ + "text-decoration"?: Property.TextDecoration<TLength> | undefined; + /** + * The **`text-emphasis`** CSS property applies emphasis marks to text (except spaces and control characters). It is a shorthand for `text-emphasis-style` and `text-emphasis-color`. + * + * **Syntax**: `<'text-emphasis-style'> || <'text-emphasis-color'>` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :------: | :-----: | :----: | :--: | :-: | + * | **99** | **46** | **7** | n/a | No | + * | 25 _-x-_ | | | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/text-emphasis + */ + "text-emphasis"?: Property.TextEmphasis | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :-------: | :----: | :----: | + * | **26** | **16** | **9** | **12** | **10** | + * | 1 _-x-_ | | 3.1 _-x-_ | | | + * + * @see https://developer.mozilla.org/docs/Web/CSS/transition + */ + transition?: Property.Transition<TTime> | undefined; + /** + * The **`view-timeline`** CSS shorthand property is used to define a _named view progress timeline_, which is progressed through based on the change in visibility of an element (known as the _subject_) inside a scrollable element (_scroller_). `view-timeline` is set on the subject. + * + * **Syntax**: `[ <'view-timeline-name'> <'view-timeline-axis'>? ]#` + * + * | Chrome | Firefox | Safari | Edge | IE | + * | :-----: | :-----: | :----: | :--: | :-: | + * | **115** | n/a | No | n/a | No | + * + * @see https://developer.mozilla.org/docs/Web/CSS/view-timeline + */ + "view-timeline"?: Property.ViewTimeline | undefined; +} + +export interface StandardPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardLonghandPropertiesHyphen<TLength, TTime>, + StandardShorthandPropertiesHyphen<TLength, TTime> {} + +export interface VendorLonghandPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-moz-animation-delay"?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + */ + "-moz-animation-direction"?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-moz-animation-duration"?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + */ + "-moz-animation-fill-mode"?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + */ + "-moz-animation-iteration-count"?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + */ + "-moz-animation-name"?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + */ + "-moz-animation-play-state"?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + "-moz-animation-timing-function"?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | button | button-arrow-down | button-arrow-next | button-arrow-previous | button-arrow-up | button-bevel | button-focus | caret | checkbox | checkbox-container | checkbox-label | checkmenuitem | dualbutton | groupbox | listbox | listitem | menuarrow | menubar | menucheckbox | menuimage | menuitem | menuitemtext | menulist | menulist-button | menulist-text | menulist-textfield | menupopup | menuradio | menuseparator | meterbar | meterchunk | progressbar | progressbar-vertical | progresschunk | progresschunk-vertical | radio | radio-container | radio-label | radiomenuitem | range | range-thumb | resizer | resizerpanel | scale-horizontal | scalethumbend | scalethumb-horizontal | scalethumbstart | scalethumbtick | scalethumb-vertical | scale-vertical | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | separator | sheet | spinner | spinner-downbutton | spinner-textfield | spinner-upbutton | splitter | statusbar | statusbarpanel | tab | tabpanel | tabpanels | tab-scroll-arrow-back | tab-scroll-arrow-forward | textfield | textfield-multiline | toolbar | toolbarbutton | toolbarbutton-dropdown | toolbargripper | toolbox | tooltip | treeheader | treeheadercell | treeheadersortarrow | treeitem | treeline | treetwisty | treetwistyopen | treeview | -moz-mac-unified-toolbar | -moz-win-borderless-glass | -moz-win-browsertabbar-toolbox | -moz-win-communicationstext | -moz-win-communications-toolbox | -moz-win-exclude-glass | -moz-win-glass | -moz-win-mediatext | -moz-win-media-toolbox | -moz-window-button-box | -moz-window-button-box-maximized | -moz-window-button-close | -moz-window-button-maximize | -moz-window-button-minimize | -moz-window-button-restore | -moz-window-frame-bottom | -moz-window-frame-left | -moz-window-frame-right | -moz-window-titlebar | -moz-window-titlebar-maximized` + * + * **Initial value**: `none` (but this value is overridden in the user agent CSS) + */ + "-moz-appearance"?: Property.MozAppearance | undefined; + /** + * The **`-moz-binding`** CSS property is used by Mozilla-based applications to attach an XBL binding to a DOM element. + * + * **Syntax**: `<url> | none` + * + * **Initial value**: `none` + */ + "-moz-binding"?: Property.MozBinding | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-bottom-colors`** CSS property sets a list of colors for the bottom border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + "-moz-border-bottom-colors"?: Property.MozBorderBottomColors | undefined; + /** + * The **`border-inline-end-color`** CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + */ + "-moz-border-end-color"?: Property.BorderInlineEndColor | undefined; + /** + * The **`border-inline-end-style`** CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + */ + "-moz-border-end-style"?: Property.BorderInlineEndStyle | undefined; + /** + * The **`border-inline-end-width`** CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-width'>` + * + * **Initial value**: `medium` + */ + "-moz-border-end-width"?: Property.BorderInlineEndWidth<TLength> | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-left-colors`** CSS property sets a list of colors for the left border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + "-moz-border-left-colors"?: Property.MozBorderLeftColors | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-right-colors`** CSS property sets a list of colors for the right border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + "-moz-border-right-colors"?: Property.MozBorderRightColors | undefined; + /** + * The **`border-inline-start-color`** CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-color'>` + * + * **Initial value**: `currentcolor` + */ + "-moz-border-start-color"?: Property.BorderInlineStartColor | undefined; + /** + * The **`border-inline-start-style`** CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'border-top-style'>` + * + * **Initial value**: `none` + */ + "-moz-border-start-style"?: Property.BorderInlineStartStyle | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-border-top-colors`** CSS property sets a list of colors for the top border. + * + * **Syntax**: `<color>+ | none` + * + * **Initial value**: `none` + */ + "-moz-border-top-colors"?: Property.MozBorderTopColors | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + */ + "-moz-box-sizing"?: Property.BoxSizing | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + */ + "-moz-column-count"?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + */ + "-moz-column-fill"?: Property.ColumnFill | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-moz-column-rule-color"?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + "-moz-column-rule-style"?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + "-moz-column-rule-width"?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + */ + "-moz-column-width"?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`-moz-context-properties`** property can be used within privileged contexts in Firefox to share the values of specified properties of the element with a child SVG image. + * + * **Syntax**: `none | [ fill | fill-opacity | stroke | stroke-opacity ]#` + * + * **Initial value**: `none` + */ + "-moz-context-properties"?: Property.MozContextProperties | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + */ + "-moz-font-feature-settings"?: Property.FontFeatureSettings | undefined; + /** + * The **`font-language-override`** CSS property controls the use of language-specific glyphs in a typeface. + * + * **Syntax**: `normal | <string>` + * + * **Initial value**: `normal` + */ + "-moz-font-language-override"?: Property.FontLanguageOverride | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + "-moz-hyphens"?: Property.Hyphens | undefined; + /** + * For certain XUL elements and pseudo-elements that use an image from the `list-style-image` property, this property specifies a region of the image that is used in place of the whole image. This allows elements to use different pieces of the same image to improve performance. + * + * **Syntax**: `<shape> | auto` + * + * **Initial value**: `auto` + */ + "-moz-image-region"?: Property.MozImageRegion | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + "-moz-margin-end"?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + "-moz-margin-start"?: Property.MarginInlineStart<TLength> | undefined; + /** + * The **`-moz-orient`** CSS property specifies the orientation of the element to which it's applied. + * + * **Syntax**: `inline | block | horizontal | vertical` + * + * **Initial value**: `inline` + */ + "-moz-orient"?: Property.MozOrient | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + */ + "-moz-osx-font-smoothing"?: Property.FontSmooth<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-bottomleft`** CSS property can be used to round the bottom-left corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + "-moz-outline-radius-bottomleft"?: Property.MozOutlineRadiusBottomleft<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-bottomright`** CSS property can be used to round the bottom-right corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + "-moz-outline-radius-bottomright"?: Property.MozOutlineRadiusBottomright<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-topleft`** CSS property can be used to round the top-left corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + "-moz-outline-radius-topleft"?: Property.MozOutlineRadiusTopleft<TLength> | undefined; + /** + * In Mozilla applications, the **`-moz-outline-radius-topright`** CSS property can be used to round the top-right corner of an element's `outline`. + * + * **Syntax**: `<outline-radius>` + * + * **Initial value**: `0` + */ + "-moz-outline-radius-topright"?: Property.MozOutlineRadiusTopright<TLength> | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + "-moz-padding-end"?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + "-moz-padding-start"?: Property.PaddingInlineStart<TLength> | undefined; + /** + * **`-moz-stack-sizing`** is an extended CSS property. Normally, a `<xul:stack>` will change its size so that all of its child elements are completely visible. For example, moving a child of the stack far to the right will widen the stack so the child remains visible. + * + * **Syntax**: `ignore | stretch-to-fit` + * + * **Initial value**: `stretch-to-fit` + */ + "-moz-stack-sizing"?: Property.MozStackSizing | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + */ + "-moz-tab-size"?: Property.TabSize<TLength> | undefined; + /** + * The **`-moz-text-blink`** non-standard Mozilla CSS extension specifies the blink mode. + * + * **Syntax**: `none | blink` + * + * **Initial value**: `none` + */ + "-moz-text-blink"?: Property.MozTextBlink | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + */ + "-moz-text-size-adjust"?: Property.TextSizeAdjust | undefined; + /** + * The **`-moz-user-focus`** CSS property is used to indicate whether an element can have the focus. + * + * **Syntax**: `ignore | normal | select-after | select-before | select-menu | select-same | select-all | none` + * + * **Initial value**: `none` + */ + "-moz-user-focus"?: Property.MozUserFocus | undefined; + /** + * The **`user-modify`** property has no effect in Firefox. It was originally planned to determine whether or not the content of an element can be edited by a user. + * + * **Syntax**: `read-only | read-write | write-only` + * + * **Initial value**: `read-only` + */ + "-moz-user-modify"?: Property.MozUserModify | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + */ + "-moz-user-select"?: Property.UserSelect | undefined; + /** + * The **`-moz-window-dragging`** CSS property specifies whether a window is draggable or not. It only works in Chrome code, and only on Mac OS X. + * + * **Syntax**: `drag | no-drag` + * + * **Initial value**: `drag` + */ + "-moz-window-dragging"?: Property.MozWindowDragging | undefined; + /** + * The **`-moz-window-shadow`** CSS property specifies whether a window will have a shadow. It only works on Mac OS X. + * + * **Syntax**: `default | menu | tooltip | sheet | none` + * + * **Initial value**: `default` + */ + "-moz-window-shadow"?: Property.MozWindowShadow | undefined; + /** + * The **`-ms-accelerator`** CSS property is a Microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut. + * + * **Syntax**: `false | true` + * + * **Initial value**: `false` + */ + "-ms-accelerator"?: Property.MsAccelerator | undefined; + /** + * The **`-ms-block-progression`** CSS property is a Microsoft extension that specifies the block progression and layout orientation. + * + * **Syntax**: `tb | rl | bt | lr` + * + * **Initial value**: `tb` + */ + "-ms-block-progression"?: Property.MsBlockProgression | undefined; + /** + * The **`-ms-content-zoom-chaining`** CSS property is a Microsoft extension specifying the zoom behavior that occurs when a user hits the zoom limit during page manipulation. + * + * **Syntax**: `none | chained` + * + * **Initial value**: `none` + */ + "-ms-content-zoom-chaining"?: Property.MsContentZoomChaining | undefined; + /** + * The **`-ms-content-zoom-limit-max`** CSS property is a Microsoft extension that specifies the selected elements' maximum zoom factor. + * + * **Syntax**: `<percentage>` + * + * **Initial value**: `400%` + */ + "-ms-content-zoom-limit-max"?: Property.MsContentZoomLimitMax | undefined; + /** + * The **`-ms-content-zoom-limit-min`** CSS property is a Microsoft extension that specifies the minimum zoom factor. + * + * **Syntax**: `<percentage>` + * + * **Initial value**: `100%` + */ + "-ms-content-zoom-limit-min"?: Property.MsContentZoomLimitMin | undefined; + /** + * The **`-ms-content-zoom-snap-points`** CSS property is a Microsoft extension that specifies where zoom snap-points are located. + * + * **Syntax**: `snapInterval( <percentage>, <percentage> ) | snapList( <percentage># )` + * + * **Initial value**: `snapInterval(0%, 100%)` + */ + "-ms-content-zoom-snap-points"?: Property.MsContentZoomSnapPoints | undefined; + /** + * The **`-ms-content-zoom-snap-type`** CSS property is a Microsoft extension that specifies how zooming is affected by defined snap-points. + * + * **Syntax**: `none | proximity | mandatory` + * + * **Initial value**: `none` + */ + "-ms-content-zoom-snap-type"?: Property.MsContentZoomSnapType | undefined; + /** + * The **`-ms-content-zooming`** CSS property is a Microsoft extension that specifies whether zooming is enabled. + * + * **Syntax**: `none | zoom` + * + * **Initial value**: zoom for the top level element, none for all other elements + */ + "-ms-content-zooming"?: Property.MsContentZooming | undefined; + /** + * The `-ms-filter` CSS property is a Microsoft extension that sets or retrieves the filter or collection of filters applied to an object. + * + * **Syntax**: `<string>` + * + * **Initial value**: "" (the empty string) + */ + "-ms-filter"?: Property.MsFilter | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + */ + "-ms-flex-direction"?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + */ + "-ms-flex-positive"?: Property.FlexGrow | undefined; + /** + * The **`-ms-flow-from`** CSS property is a Microsoft extension that gets or sets a value identifying a region container in the document that accepts the content flow from the data source. + * + * **Syntax**: `[ none | <custom-ident> ]#` + * + * **Initial value**: `none` + */ + "-ms-flow-from"?: Property.MsFlowFrom | undefined; + /** + * The **`-ms-flow-into`** CSS property is a Microsoft extension that gets or sets a value identifying an iframe container in the document that serves as the region's data source. + * + * **Syntax**: `[ none | <custom-ident> ]#` + * + * **Initial value**: `none` + */ + "-ms-flow-into"?: Property.MsFlowInto | undefined; + /** + * The **`grid-template-columns`** CSS property defines the line names and track sizing functions of the grid columns. + * + * **Syntax**: `none | <track-list> | <auto-track-list>` + * + * **Initial value**: `none` + */ + "-ms-grid-columns"?: Property.MsGridColumns<TLength> | undefined; + /** + * The **`grid-template-rows`** CSS property defines the line names and track sizing functions of the grid rows. + * + * **Syntax**: `none | <track-list> | <auto-track-list>` + * + * **Initial value**: `none` + */ + "-ms-grid-rows"?: Property.MsGridRows<TLength> | undefined; + /** + * The **`-ms-high-contrast-adjust`** CSS property is a Microsoft extension that gets or sets a value indicating whether to override any CSS properties that would have been set in high contrast mode. + * + * **Syntax**: `auto | none` + * + * **Initial value**: `auto` + */ + "-ms-high-contrast-adjust"?: Property.MsHighContrastAdjust | undefined; + /** + * The **`-ms-hyphenate-limit-chars`** CSS property is a Microsoft extension that specifies one to three values indicating the minimum number of characters in a hyphenated word. If the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated. + * + * **Syntax**: `auto | <integer>{1,3}` + * + * **Initial value**: `auto` + */ + "-ms-hyphenate-limit-chars"?: Property.MsHyphenateLimitChars | undefined; + /** + * The **`-ms-hyphenate-limit-lines`** CSS property is a Microsoft extension specifying the maximum number of consecutive lines in an element that may be ended with a hyphenated word. + * + * **Syntax**: `no-limit | <integer>` + * + * **Initial value**: `no-limit` + */ + "-ms-hyphenate-limit-lines"?: Property.MsHyphenateLimitLines | undefined; + /** + * The `**-ms-hyphenate-limit-zone**` CSS property is a Microsoft extension specifying the width of the hyphenation zone. + * + * **Syntax**: `<percentage> | <length>` + * + * **Initial value**: `0` + */ + "-ms-hyphenate-limit-zone"?: Property.MsHyphenateLimitZone<TLength> | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + "-ms-hyphens"?: Property.Hyphens | undefined; + /** + * The **`-ms-ime-align`** CSS property is a Microsoft extension aligning the Input Method Editor (IME) candidate window box relative to the element on which the IME composition is active. The extension is implemented in Microsoft Edge and Internet Explorer 11. + * + * **Syntax**: `auto | after` + * + * **Initial value**: `auto` + */ + "-ms-ime-align"?: Property.MsImeAlign | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + */ + "-ms-line-break"?: Property.LineBreak | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + */ + "-ms-order"?: Property.Order | undefined; + /** + * The **`-ms-overflow-style`** CSS property is a Microsoft extension controlling the behavior of scrollbars when the content of an element overflows. + * + * **Syntax**: `auto | none | scrollbar | -ms-autohiding-scrollbar` + * + * **Initial value**: `auto` + */ + "-ms-overflow-style"?: Property.MsOverflowStyle | undefined; + /** + * The **`overflow-x`** CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + */ + "-ms-overflow-x"?: Property.OverflowX | undefined; + /** + * The **`overflow-y`** CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. + * + * **Syntax**: `visible | hidden | clip | scroll | auto` + * + * **Initial value**: `visible` + */ + "-ms-overflow-y"?: Property.OverflowY | undefined; + /** + * The `**-ms-scroll-chaining**` CSS property is a Microsoft extension that specifies the scrolling behavior that occurs when a user hits the scroll limit during a manipulation. + * + * **Syntax**: `chained | none` + * + * **Initial value**: `chained` + */ + "-ms-scroll-chaining"?: Property.MsScrollChaining | undefined; + /** + * The `**-ms-scroll-limit-x-max**` CSS property is a Microsoft extension that specifies the maximum value for the `Element.scrollLeft` property. + * + * **Syntax**: `auto | <length>` + * + * **Initial value**: `auto` + */ + "-ms-scroll-limit-x-max"?: Property.MsScrollLimitXMax<TLength> | undefined; + /** + * The **`-ms-scroll-limit-x-min`** CSS property is a Microsoft extension that specifies the minimum value for the `Element.scrollLeft` property. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + "-ms-scroll-limit-x-min"?: Property.MsScrollLimitXMin<TLength> | undefined; + /** + * The **`-ms-scroll-limit-y-max`** CSS property is a Microsoft extension that specifies the maximum value for the `Element.scrollTop` property. + * + * **Syntax**: `auto | <length>` + * + * **Initial value**: `auto` + */ + "-ms-scroll-limit-y-max"?: Property.MsScrollLimitYMax<TLength> | undefined; + /** + * The **`-ms-scroll-limit-y-min`** CSS property is a Microsoft extension that specifies the minimum value for the `Element.scrollTop` property. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + "-ms-scroll-limit-y-min"?: Property.MsScrollLimitYMin<TLength> | undefined; + /** + * The **`-ms-scroll-rails`** CSS property is a Microsoft extension that specifies whether scrolling locks to the primary axis of motion. + * + * **Syntax**: `none | railed` + * + * **Initial value**: `railed` + */ + "-ms-scroll-rails"?: Property.MsScrollRails | undefined; + /** + * The **`-ms-scroll-snap-points-x`** CSS property is a Microsoft extension that specifies where snap-points will be located along the x-axis. + * + * **Syntax**: `snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )` + * + * **Initial value**: `snapInterval(0px, 100%)` + */ + "-ms-scroll-snap-points-x"?: Property.MsScrollSnapPointsX | undefined; + /** + * The **`-ms-scroll-snap-points-y`** CSS property is a Microsoft extension that specifies where snap-points will be located along the y-axis. + * + * **Syntax**: `snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )` + * + * **Initial value**: `snapInterval(0px, 100%)` + */ + "-ms-scroll-snap-points-y"?: Property.MsScrollSnapPointsY | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | proximity | mandatory` + * + * **Initial value**: `none` + */ + "-ms-scroll-snap-type"?: Property.MsScrollSnapType | undefined; + /** + * The **`-ms-scroll-translation`** CSS property is a Microsoft extension that specifies whether vertical-to-horizontal scroll wheel translation occurs on the specified element. + * + * **Syntax**: `none | vertical-to-horizontal` + * + * **Initial value**: `none` + */ + "-ms-scroll-translation"?: Property.MsScrollTranslation | undefined; + /** + * The **`-ms-scrollbar-3dlight-color`** CSS property is a Microsoft extension specifying the color of the top and left edges of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: depends on user agent + */ + "-ms-scrollbar-3dlight-color"?: Property.MsScrollbar3dlightColor | undefined; + /** + * The **`-ms-scrollbar-arrow-color`** CSS property is a Microsoft extension that specifies the color of the arrow elements of a scroll arrow. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ButtonText` + */ + "-ms-scrollbar-arrow-color"?: Property.MsScrollbarArrowColor | undefined; + /** + * The `**-ms-scrollbar-base-color**` CSS property is a Microsoft extension that specifies the base color of the main elements of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: depends on user agent + */ + "-ms-scrollbar-base-color"?: Property.MsScrollbarBaseColor | undefined; + /** + * The **`-ms-scrollbar-darkshadow-color`** CSS property is a Microsoft extension that specifies the color of a scroll bar's gutter. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDDarkShadow` + */ + "-ms-scrollbar-darkshadow-color"?: Property.MsScrollbarDarkshadowColor | undefined; + /** + * The `**-ms-scrollbar-face-color**` CSS property is a Microsoft extension that specifies the color of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDFace` + */ + "-ms-scrollbar-face-color"?: Property.MsScrollbarFaceColor | undefined; + /** + * The `**-ms-scrollbar-highlight-color**` CSS property is a Microsoft extension that specifies the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDHighlight` + */ + "-ms-scrollbar-highlight-color"?: Property.MsScrollbarHighlightColor | undefined; + /** + * The **`-ms-scrollbar-shadow-color`** CSS property is a Microsoft extension that specifies the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `ThreeDDarkShadow` + */ + "-ms-scrollbar-shadow-color"?: Property.MsScrollbarShadowColor | undefined; + /** + * The **`-ms-scrollbar-track-color`** CSS property is a Microsoft extension that specifies the color of the track element of a scrollbar. + * + * **Syntax**: `<color>` + * + * **Initial value**: `Scrollbar` + */ + "-ms-scrollbar-track-color"?: Property.MsScrollbarTrackColor | undefined; + /** + * The **`-ms-text-autospace`** CSS property is a Microsoft extension that specifies the autospacing and narrow space width adjustment of text. + * + * **Syntax**: `none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space` + * + * **Initial value**: `none` + */ + "-ms-text-autospace"?: Property.MsTextAutospace | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + */ + "-ms-text-combine-horizontal"?: Property.TextCombineUpright | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + */ + "-ms-text-overflow"?: Property.TextOverflow | undefined; + /** + * The **`touch-action`** CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser). + * + * **Syntax**: `auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation` + * + * **Initial value**: `auto` + */ + "-ms-touch-action"?: Property.TouchAction | undefined; + /** + * The **`-ms-touch-select`** CSS property is a Microsoft extension that toggles the gripper visual elements that enable touch text selection. + * + * **Syntax**: `grippers | none` + * + * **Initial value**: `grippers` + */ + "-ms-touch-select"?: Property.MsTouchSelect | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + */ + "-ms-transform"?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + */ + "-ms-transform-origin"?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-ms-transition-delay"?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-ms-transition-duration"?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + */ + "-ms-transition-property"?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + "-ms-transition-timing-function"?: Property.TransitionTimingFunction | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `none | element | text` + * + * **Initial value**: `text` + */ + "-ms-user-select"?: Property.MsUserSelect | undefined; + /** + * The **`word-break`** CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box. + * + * **Syntax**: `normal | break-all | keep-all | break-word` + * + * **Initial value**: `normal` + */ + "-ms-word-break"?: Property.WordBreak | undefined; + /** + * The **`-ms-wrap-flow`** CSS property is a Microsoft extension that specifies how exclusions impact inline content within block-level elements. + * + * **Syntax**: `auto | both | start | end | maximum | clear` + * + * **Initial value**: `auto` + */ + "-ms-wrap-flow"?: Property.MsWrapFlow | undefined; + /** + * The **`-ms-wrap-margin`** CSS property is a Microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + "-ms-wrap-margin"?: Property.MsWrapMargin<TLength> | undefined; + /** + * The **`-ms-wrap-through`** CSS property is a Microsoft extension that specifies how content should wrap around an exclusion element. + * + * **Syntax**: `wrap | none` + * + * **Initial value**: `wrap` + */ + "-ms-wrap-through"?: Property.MsWrapThrough | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + */ + "-ms-writing-mode"?: Property.WritingMode | undefined; + /** + * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. + * + * **Syntax**: `normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>` + * + * **Initial value**: `normal` + */ + "-webkit-align-content"?: Property.AlignContent | undefined; + /** + * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. + * + * **Syntax**: `normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]` + * + * **Initial value**: `normal` + */ + "-webkit-align-items"?: Property.AlignItems | undefined; + /** + * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. + * + * **Syntax**: `auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>` + * + * **Initial value**: `auto` + */ + "-webkit-align-self"?: Property.AlignSelf | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-webkit-animation-delay"?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + */ + "-webkit-animation-direction"?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-webkit-animation-duration"?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + */ + "-webkit-animation-fill-mode"?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + */ + "-webkit-animation-iteration-count"?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + */ + "-webkit-animation-name"?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + */ + "-webkit-animation-play-state"?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + "-webkit-animation-timing-function"?: Property.AnimationTimingFunction | undefined; + /** + * The **`appearance`** CSS property is used to control native appearance of UI controls, that are based on operating system's theme. + * + * **Syntax**: `none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button` + * + * **Initial value**: `none` (but this value is overridden in the user agent CSS) + */ + "-webkit-appearance"?: Property.WebkitAppearance | undefined; + /** + * The **`backdrop-filter`** CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything _behind_ the element, to see the effect you must make the element or its background at least partially transparent. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + */ + "-webkit-backdrop-filter"?: Property.BackdropFilter | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + */ + "-webkit-backface-visibility"?: Property.BackfaceVisibility | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + */ + "-webkit-background-clip"?: Property.BackgroundClip | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + */ + "-webkit-background-origin"?: Property.BackgroundOrigin | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + */ + "-webkit-background-size"?: Property.BackgroundSize<TLength> | undefined; + /** + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-border-before-color"?: Property.WebkitBorderBeforeColor | undefined; + /** + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + "-webkit-border-before-style"?: Property.WebkitBorderBeforeStyle | undefined; + /** + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + "-webkit-border-before-width"?: Property.WebkitBorderBeforeWidth<TLength> | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + "-webkit-border-bottom-left-radius"?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + "-webkit-border-bottom-right-radius"?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-image-slice`** CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image. + * + * **Syntax**: `<number-percentage>{1,4} && fill?` + * + * **Initial value**: `100%` + */ + "-webkit-border-image-slice"?: Property.BorderImageSlice | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + "-webkit-border-top-left-radius"?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + */ + "-webkit-border-top-right-radius"?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + */ + "-webkit-box-decoration-break"?: Property.BoxDecorationBreak | undefined; + /** + * The **`-webkit-box-reflect`** CSS property lets you reflect the content of an element in one specific direction. + * + * **Syntax**: `[ above | below | right | left ]? <length>? <image>?` + * + * **Initial value**: `none` + */ + "-webkit-box-reflect"?: Property.WebkitBoxReflect<TLength> | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + */ + "-webkit-box-shadow"?: Property.BoxShadow | undefined; + /** + * The **`box-sizing`** CSS property sets how the total width and height of an element is calculated. + * + * **Syntax**: `content-box | border-box` + * + * **Initial value**: `content-box` + */ + "-webkit-box-sizing"?: Property.BoxSizing | undefined; + /** + * The **`clip-path`** CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. + * + * **Syntax**: `<clip-source> | [ <basic-shape> || <geometry-box> ] | none` + * + * **Initial value**: `none` + */ + "-webkit-clip-path"?: Property.ClipPath | undefined; + /** + * The **`column-count`** CSS property breaks an element's content into the specified number of columns. + * + * **Syntax**: `<integer> | auto` + * + * **Initial value**: `auto` + */ + "-webkit-column-count"?: Property.ColumnCount | undefined; + /** + * The **`column-fill`** CSS property controls how an element's contents are balanced when broken into columns. + * + * **Syntax**: `auto | balance | balance-all` + * + * **Initial value**: `balance` + */ + "-webkit-column-fill"?: Property.ColumnFill | undefined; + /** + * The **`column-rule-color`** CSS property sets the color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-column-rule-color"?: Property.ColumnRuleColor | undefined; + /** + * The **`column-rule-style`** CSS property sets the style of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-style'>` + * + * **Initial value**: `none` + */ + "-webkit-column-rule-style"?: Property.ColumnRuleStyle | undefined; + /** + * The **`column-rule-width`** CSS property sets the width of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'border-width'>` + * + * **Initial value**: `medium` + */ + "-webkit-column-rule-width"?: Property.ColumnRuleWidth<TLength> | undefined; + /** + * The **`column-span`** CSS property makes it possible for an element to span across all columns when its value is set to `all`. + * + * **Syntax**: `none | all` + * + * **Initial value**: `none` + */ + "-webkit-column-span"?: Property.ColumnSpan | undefined; + /** + * The **`column-width`** CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the `column-width` value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. + * + * **Syntax**: `<length> | auto` + * + * **Initial value**: `auto` + */ + "-webkit-column-width"?: Property.ColumnWidth<TLength> | undefined; + /** + * The **`filter`** CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders. + * + * **Syntax**: `none | <filter-function-list>` + * + * **Initial value**: `none` + */ + "-webkit-filter"?: Property.Filter | undefined; + /** + * The **`flex-basis`** CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with `box-sizing`. + * + * **Syntax**: `content | <'width'>` + * + * **Initial value**: `auto` + */ + "-webkit-flex-basis"?: Property.FlexBasis<TLength> | undefined; + /** + * The **`flex-direction`** CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). + * + * **Syntax**: `row | row-reverse | column | column-reverse` + * + * **Initial value**: `row` + */ + "-webkit-flex-direction"?: Property.FlexDirection | undefined; + /** + * The **`flex-grow`** CSS property sets the flex grow factor of a flex item's main size. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + */ + "-webkit-flex-grow"?: Property.FlexGrow | undefined; + /** + * The **`flex-shrink`** CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to `flex-shrink`. + * + * **Syntax**: `<number>` + * + * **Initial value**: `1` + */ + "-webkit-flex-shrink"?: Property.FlexShrink | undefined; + /** + * The **`flex-wrap`** CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. + * + * **Syntax**: `nowrap | wrap | wrap-reverse` + * + * **Initial value**: `nowrap` + */ + "-webkit-flex-wrap"?: Property.FlexWrap | undefined; + /** + * The **`font-feature-settings`** CSS property controls advanced typographic features in OpenType fonts. + * + * **Syntax**: `normal | <feature-tag-value>#` + * + * **Initial value**: `normal` + */ + "-webkit-font-feature-settings"?: Property.FontFeatureSettings | undefined; + /** + * The **`font-kerning`** CSS property sets the use of the kerning information stored in a font. + * + * **Syntax**: `auto | normal | none` + * + * **Initial value**: `auto` + */ + "-webkit-font-kerning"?: Property.FontKerning | undefined; + /** + * The **`font-smooth`** CSS property controls the application of anti-aliasing when fonts are rendered. + * + * **Syntax**: `auto | never | always | <absolute-size> | <length>` + * + * **Initial value**: `auto` + */ + "-webkit-font-smoothing"?: Property.FontSmooth<TLength> | undefined; + /** + * The **`font-variant-ligatures`** CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text. + * + * **Syntax**: `normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]` + * + * **Initial value**: `normal` + */ + "-webkit-font-variant-ligatures"?: Property.FontVariantLigatures | undefined; + /** + * The **`hyphenate-character`** CSS property sets the character (or string) used at the end of a line before a hyphenation break. + * + * **Syntax**: `auto | <string>` + * + * **Initial value**: `auto` + */ + "-webkit-hyphenate-character"?: Property.HyphenateCharacter | undefined; + /** + * The **`hyphens`** CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. + * + * **Syntax**: `none | manual | auto` + * + * **Initial value**: `manual` + */ + "-webkit-hyphens"?: Property.Hyphens | undefined; + /** + * The `initial-letter` CSS property sets styling for dropped, raised, and sunken initial letters. + * + * **Syntax**: `normal | [ <number> <integer>? ]` + * + * **Initial value**: `normal` + */ + "-webkit-initial-letter"?: Property.InitialLetter | undefined; + /** + * The CSS **`justify-content`** property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. + * + * **Syntax**: `normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]` + * + * **Initial value**: `normal` + */ + "-webkit-justify-content"?: Property.JustifyContent | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + */ + "-webkit-line-break"?: Property.LineBreak | undefined; + /** + * The **`-webkit-line-clamp`** CSS property allows limiting of the contents of a block to the specified number of lines. + * + * **Syntax**: `none | <integer>` + * + * **Initial value**: `none` + */ + "-webkit-line-clamp"?: Property.WebkitLineClamp | undefined; + /** + * The **`margin-inline-end`** CSS property defines the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the `margin-top`, `margin-right`, `margin-bottom` or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + "-webkit-margin-end"?: Property.MarginInlineEnd<TLength> | undefined; + /** + * The **`margin-inline-start`** CSS property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the `margin-top`, `margin-right`, `margin-bottom`, or `margin-left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'margin-left'>` + * + * **Initial value**: `0` + */ + "-webkit-margin-start"?: Property.MarginInlineStart<TLength> | undefined; + /** + * If a `mask-image` is specified, `-webkit-mask-attachment` determines whether the mask image's position is fixed within the viewport, or scrolls along with its containing block. + * + * **Syntax**: `<attachment>#` + * + * **Initial value**: `scroll` + */ + "-webkit-mask-attachment"?: Property.WebkitMaskAttachment | undefined; + /** + * The **`mask-border-outset`** CSS property specifies the distance by which an element's mask border is set out from its border box. + * + * **Syntax**: `[ <length> | <number> ]{1,4}` + * + * **Initial value**: `0` + */ + "-webkit-mask-box-image-outset"?: Property.MaskBorderOutset<TLength> | undefined; + /** + * The **`mask-border-repeat`** CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. + * + * **Syntax**: `[ stretch | repeat | round | space ]{1,2}` + * + * **Initial value**: `stretch` + */ + "-webkit-mask-box-image-repeat"?: Property.MaskBorderRepeat | undefined; + /** + * The **`mask-border-slice`** CSS property divides the image set by `mask-border-source` into regions. These regions are used to form the components of an element's mask border. + * + * **Syntax**: `<number-percentage>{1,4} fill?` + * + * **Initial value**: `0` + */ + "-webkit-mask-box-image-slice"?: Property.MaskBorderSlice | undefined; + /** + * The **`mask-border-source`** CSS property sets the source image used to create an element's mask border. + * + * **Syntax**: `none | <image>` + * + * **Initial value**: `none` + */ + "-webkit-mask-box-image-source"?: Property.MaskBorderSource | undefined; + /** + * The **`mask-border-width`** CSS property sets the width of an element's mask border. + * + * **Syntax**: `[ <length-percentage> | <number> | auto ]{1,4}` + * + * **Initial value**: `auto` + */ + "-webkit-mask-box-image-width"?: Property.MaskBorderWidth<TLength> | undefined; + /** + * The **`mask-clip`** CSS property determines the area which is affected by a mask. The painted content of an element must be restricted to this area. + * + * **Syntax**: `[ <box> | border | padding | content | text ]#` + * + * **Initial value**: `border` + */ + "-webkit-mask-clip"?: Property.WebkitMaskClip | undefined; + /** + * The **`-webkit-mask-composite`** property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the `-webkit-mask-image` property. + * + * **Syntax**: `<composite-style>#` + * + * **Initial value**: `source-over` + */ + "-webkit-mask-composite"?: Property.WebkitMaskComposite | undefined; + /** + * The **`mask-image`** CSS property sets the image that is used as mask layer for an element. By default this means the alpha channel of the mask image will be multiplied with the alpha channel of the element. This can be controlled with the `mask-mode` property. + * + * **Syntax**: `<mask-reference>#` + * + * **Initial value**: `none` + */ + "-webkit-mask-image"?: Property.WebkitMaskImage | undefined; + /** + * The **`mask-origin`** CSS property sets the origin of a mask. + * + * **Syntax**: `[ <box> | border | padding | content ]#` + * + * **Initial value**: `padding` + */ + "-webkit-mask-origin"?: Property.WebkitMaskOrigin | undefined; + /** + * The **`mask-position`** CSS property sets the initial position, relative to the mask position layer set by `mask-origin`, for each defined mask image. + * + * **Syntax**: `<position>#` + * + * **Initial value**: `0% 0%` + */ + "-webkit-mask-position"?: Property.WebkitMaskPosition<TLength> | undefined; + /** + * The `-webkit-mask-position-x` CSS property sets the initial horizontal position of a mask image. + * + * **Syntax**: `[ <length-percentage> | left | center | right ]#` + * + * **Initial value**: `0%` + */ + "-webkit-mask-position-x"?: Property.WebkitMaskPositionX<TLength> | undefined; + /** + * The `-webkit-mask-position-y` CSS property sets the initial vertical position of a mask image. + * + * **Syntax**: `[ <length-percentage> | top | center | bottom ]#` + * + * **Initial value**: `0%` + */ + "-webkit-mask-position-y"?: Property.WebkitMaskPositionY<TLength> | undefined; + /** + * The **`mask-repeat`** CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all. + * + * **Syntax**: `<repeat-style>#` + * + * **Initial value**: `repeat` + */ + "-webkit-mask-repeat"?: Property.WebkitMaskRepeat | undefined; + /** + * The `-webkit-mask-repeat-x` property specifies whether and how a mask image is repeated (tiled) horizontally. + * + * **Syntax**: `repeat | no-repeat | space | round` + * + * **Initial value**: `repeat` + */ + "-webkit-mask-repeat-x"?: Property.WebkitMaskRepeatX | undefined; + /** + * The `-webkit-mask-repeat-y` property sets whether and how a mask image is repeated (tiled) vertically. + * + * **Syntax**: `repeat | no-repeat | space | round` + * + * **Initial value**: `repeat` + */ + "-webkit-mask-repeat-y"?: Property.WebkitMaskRepeatY | undefined; + /** + * The **`mask-size`** CSS property specifies the sizes of the mask images. The size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + */ + "-webkit-mask-size"?: Property.WebkitMaskSize<TLength> | undefined; + /** + * The **`max-inline-size`** CSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the `max-width` or the `max-height` property, depending on the value of `writing-mode`. + * + * **Syntax**: `<'max-width'>` + * + * **Initial value**: `none` + */ + "-webkit-max-inline-size"?: Property.MaxInlineSize<TLength> | undefined; + /** + * The **`order`** CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `0` + */ + "-webkit-order"?: Property.Order | undefined; + /** + * The `-webkit-overflow-scrolling` CSS property controls whether or not touch devices use momentum-based scrolling for a given element. + * + * **Syntax**: `auto | touch` + * + * **Initial value**: `auto` + */ + "-webkit-overflow-scrolling"?: Property.WebkitOverflowScrolling | undefined; + /** + * The **`padding-inline-end`** CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + "-webkit-padding-end"?: Property.PaddingInlineEnd<TLength> | undefined; + /** + * The **`padding-inline-start`** CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. + * + * **Syntax**: `<'padding-left'>` + * + * **Initial value**: `0` + */ + "-webkit-padding-start"?: Property.PaddingInlineStart<TLength> | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + */ + "-webkit-perspective"?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + */ + "-webkit-perspective-origin"?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`print-color-adjust`** CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. + * + * **Syntax**: `economy | exact` + * + * **Initial value**: `economy` + */ + "-webkit-print-color-adjust"?: Property.PrintColorAdjust | undefined; + /** + * The **`ruby-position`** CSS property defines the position of a ruby element relatives to its base element. It can be positioned over the element (`over`), under it (`under`), or between the characters on their right side (`inter-character`). + * + * **Syntax**: `[ alternate || [ over | under ] ] | inter-character` + * + * **Initial value**: `alternate` + */ + "-webkit-ruby-position"?: Property.RubyPosition | undefined; + /** + * The **`scroll-snap-type`** CSS property sets how strictly snap points are enforced on the scroll container in case there is one. + * + * **Syntax**: `none | [ x | y | block | inline | both ] [ mandatory | proximity ]?` + * + * **Initial value**: `none` + */ + "-webkit-scroll-snap-type"?: Property.ScrollSnapType | undefined; + /** + * The **`shape-margin`** CSS property sets a margin for a CSS shape created using `shape-outside`. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + */ + "-webkit-shape-margin"?: Property.ShapeMargin<TLength> | undefined; + /** + * **`-webkit-tap-highlight-color`** is a non-standard CSS property that sets the color of the highlight that appears over a link while it's being tapped. The highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. + * + * **Syntax**: `<color>` + * + * **Initial value**: `black` + */ + "-webkit-tap-highlight-color"?: Property.WebkitTapHighlightColor | undefined; + /** + * The **`text-combine-upright`** CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. + * + * **Syntax**: `none | all | [ digits <integer>? ]` + * + * **Initial value**: `none` + */ + "-webkit-text-combine"?: Property.TextCombineUpright | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-text-decoration-color"?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + */ + "-webkit-text-decoration-line"?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-skip`** CSS property sets what parts of an element's content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors. + * + * **Syntax**: `none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]` + * + * **Initial value**: `objects` + */ + "-webkit-text-decoration-skip"?: Property.TextDecorationSkip | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + */ + "-webkit-text-decoration-style"?: Property.TextDecorationStyle | undefined; + /** + * The **`text-emphasis-color`** CSS property sets the color of emphasis marks. This value can also be set using the `text-emphasis` shorthand. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-text-emphasis-color"?: Property.TextEmphasisColor | undefined; + /** + * The **`text-emphasis-position`** CSS property sets where emphasis marks are drawn. Like ruby text, if there isn't enough room for emphasis marks, the line height is increased. + * + * **Syntax**: `[ over | under ] && [ right | left ]` + * + * **Initial value**: `over right` + */ + "-webkit-text-emphasis-position"?: Property.TextEmphasisPosition | undefined; + /** + * The **`text-emphasis-style`** CSS property sets the appearance of emphasis marks. It can also be set, and reset, using the `text-emphasis` shorthand. + * + * **Syntax**: `none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>` + * + * **Initial value**: `none` + */ + "-webkit-text-emphasis-style"?: Property.TextEmphasisStyle | undefined; + /** + * The **`-webkit-text-fill-color`** CSS property specifies the fill color of characters of text. If this property is not set, the value of the `color` property is used. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-text-fill-color"?: Property.WebkitTextFillColor | undefined; + /** + * The **`text-orientation`** CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when `writing-mode` is not `horizontal-tb`). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers. + * + * **Syntax**: `mixed | upright | sideways` + * + * **Initial value**: `mixed` + */ + "-webkit-text-orientation"?: Property.TextOrientation | undefined; + /** + * The **`text-size-adjust`** CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property. + * + * **Syntax**: `none | auto | <percentage>` + * + * **Initial value**: `auto` for smartphone browsers supporting inflation, `none` in other cases (and then not modifiable). + */ + "-webkit-text-size-adjust"?: Property.TextSizeAdjust | undefined; + /** + * The **`-webkit-text-stroke-color`** CSS property specifies the stroke color of characters of text. If this property is not set, the value of the `color` property is used. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + */ + "-webkit-text-stroke-color"?: Property.WebkitTextStrokeColor | undefined; + /** + * The **`-webkit-text-stroke-width`** CSS property specifies the width of the stroke for text. + * + * **Syntax**: `<length>` + * + * **Initial value**: `0` + */ + "-webkit-text-stroke-width"?: Property.WebkitTextStrokeWidth<TLength> | undefined; + /** + * The **`text-underline-position`** CSS property specifies the position of the underline which is set using the `text-decoration` property's `underline` value. + * + * **Syntax**: `auto | from-font | [ under || [ left | right ] ]` + * + * **Initial value**: `auto` + */ + "-webkit-text-underline-position"?: Property.TextUnderlinePosition | undefined; + /** + * The `-webkit-touch-callout` CSS property controls the display of the default callout shown when you touch and hold a touch target. + * + * **Syntax**: `default | none` + * + * **Initial value**: `default` + */ + "-webkit-touch-callout"?: Property.WebkitTouchCallout | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + */ + "-webkit-transform"?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + */ + "-webkit-transform-origin"?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + */ + "-webkit-transform-style"?: Property.TransformStyle | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-webkit-transition-delay"?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + */ + "-webkit-transition-duration"?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + */ + "-webkit-transition-property"?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + */ + "-webkit-transition-timing-function"?: Property.TransitionTimingFunction | undefined; + /** + * **Syntax**: `read-only | read-write | read-write-plaintext-only` + * + * **Initial value**: `read-only` + */ + "-webkit-user-modify"?: Property.WebkitUserModify | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + */ + "-webkit-user-select"?: Property.UserSelect | undefined; + /** + * The **`writing-mode`** CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (`html` element for HTML documents). + * + * **Syntax**: `horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr` + * + * **Initial value**: `horizontal-tb` + */ + "-webkit-writing-mode"?: Property.WritingMode | undefined; +} + +export interface VendorShorthandPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + */ + "-moz-animation"?: Property.Animation<TTime> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + */ + "-moz-border-image"?: Property.BorderImage | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + */ + "-moz-column-rule"?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + */ + "-moz-columns"?: Property.Columns<TLength> | undefined; + /** + * In Mozilla applications like Firefox, the **`-moz-outline-radius`** CSS shorthand property can be used to give an element's `outline` rounded corners. + * + * **Syntax**: `<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?` + */ + "-moz-outline-radius"?: Property.MozOutlineRadius<TLength> | undefined; + /** + * The **`-ms-content-zoom-limit`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-content-zoom-limit-min` and `-ms-content-zoom-limit-max` properties. + * + * **Syntax**: `<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>` + */ + "-ms-content-zoom-limit"?: Property.MsContentZoomLimit | undefined; + /** + * The **`-ms-content-zoom-snap`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-content-zoom-snap-type` and `-ms-content-zoom-snap-points` properties. + * + * **Syntax**: `<'-ms-content-zoom-snap-type'> || <'-ms-content-zoom-snap-points'>` + */ + "-ms-content-zoom-snap"?: Property.MsContentZoomSnap | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + */ + "-ms-flex"?: Property.Flex<TLength> | undefined; + /** + * The **\-ms-scroll-limit** CSS property is a Microsoft extension that specifies values for the `-ms-scroll-limit-x-min`, `-ms-scroll-limit-y-min`, `-ms-scroll-limit-x-max`, and `-ms-scroll-limit-y-max` properties. + * + * **Syntax**: `<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>` + */ + "-ms-scroll-limit"?: Property.MsScrollLimit | undefined; + /** + * The **`-ms-scroll-snap-x`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-scroll-snap-type` and `-ms-scroll-snap-points-x` properties. + * + * **Syntax**: `<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>` + */ + "-ms-scroll-snap-x"?: Property.MsScrollSnapX | undefined; + /** + * The **`-ms-scroll-snap-x`** CSS shorthand property is a Microsoft extension that specifies values for the `-ms-scroll-snap-type` and `-ms-scroll-snap-points-y` properties. + * + * **Syntax**: `<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>` + */ + "-ms-scroll-snap-y"?: Property.MsScrollSnapY | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + */ + "-ms-transition"?: Property.Transition<TTime> | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + */ + "-webkit-animation"?: Property.Animation<TTime> | undefined; + /** + * The **`-webkit-border-before`** CSS property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet. + * + * **Syntax**: `<'border-width'> || <'border-style'> || <color>` + */ + "-webkit-border-before"?: Property.WebkitBorderBefore<TLength> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + */ + "-webkit-border-image"?: Property.BorderImage | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + */ + "-webkit-border-radius"?: Property.BorderRadius<TLength> | undefined; + /** + * The **`column-rule`** shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout. + * + * **Syntax**: `<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>` + */ + "-webkit-column-rule"?: Property.ColumnRule<TLength> | undefined; + /** + * The **`columns`** CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. + * + * **Syntax**: `<'column-width'> || <'column-count'>` + */ + "-webkit-columns"?: Property.Columns<TLength> | undefined; + /** + * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container. + * + * **Syntax**: `none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]` + */ + "-webkit-flex"?: Property.Flex<TLength> | undefined; + /** + * The **`flex-flow`** CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. + * + * **Syntax**: `<'flex-direction'> || <'flex-wrap'>` + */ + "-webkit-flex-flow"?: Property.FlexFlow | undefined; + /** + * The **`mask`** CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points. + * + * **Syntax**: `[ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#` + */ + "-webkit-mask"?: Property.WebkitMask<TLength> | undefined; + /** + * The **`mask-border`** CSS shorthand property lets you create a mask along the edge of an element's border. + * + * **Syntax**: `<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>` + */ + "-webkit-mask-box-image"?: Property.MaskBorder | undefined; + /** + * The **`text-emphasis`** CSS property applies emphasis marks to text (except spaces and control characters). It is a shorthand for `text-emphasis-style` and `text-emphasis-color`. + * + * **Syntax**: `<'text-emphasis-style'> || <'text-emphasis-color'>` + */ + "-webkit-text-emphasis"?: Property.TextEmphasis | undefined; + /** + * The **`-webkit-text-stroke`** CSS property specifies the width and color of strokes for text characters. This is a shorthand property for the longhand properties `-webkit-text-stroke-width` and `-webkit-text-stroke-color`. + * + * **Syntax**: `<length> || <color>` + */ + "-webkit-text-stroke"?: Property.WebkitTextStroke<TLength> | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + */ + "-webkit-transition"?: Property.Transition<TTime> | undefined; +} + +export interface VendorPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> + extends VendorLonghandPropertiesHyphen<TLength, TTime>, + VendorShorthandPropertiesHyphen<TLength, TTime> {} + +export interface ObsoletePropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + /** + * In combination with `elevation`, the **`azimuth`** CSS property enables different audio sources to be positioned spatially for aural presentation. This is important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage. Stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage. + * + * **Syntax**: `<angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards` + * + * **Initial value**: `center` + * + * @deprecated + */ + azimuth?: Property.Azimuth | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + "box-align"?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + "box-direction"?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "box-flex"?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "box-flex-group"?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + "box-lines"?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "box-ordinal-group"?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + "box-orient"?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + "box-pack"?: Property.BoxPack | undefined; + /** + * The **`clip`** CSS property defines a visible portion of an element. The `clip` property applies only to absolutely positioned elements — that is, elements with `position:absolute` or `position:fixed`. + * + * **Syntax**: `<shape> | auto` + * + * **Initial value**: `auto` + * + * @deprecated + */ + clip?: Property.Clip | undefined; + /** + * The **`column-gap`** CSS property sets the size of the gap (gutter) between an element's columns. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "grid-column-gap"?: Property.GridColumnGap<TLength> | undefined; + /** + * The **`gap`** CSS property sets the gaps (gutters) between rows and columns. It is a shorthand for `row-gap` and `column-gap`. + * + * **Syntax**: `<'grid-row-gap'> <'grid-column-gap'>?` + * + * @deprecated + */ + "grid-gap"?: Property.GridGap<TLength> | undefined; + /** + * The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows. + * + * **Syntax**: `<length-percentage>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "grid-row-gap"?: Property.GridRowGap<TLength> | undefined; + /** + * The **`ime-mode`** CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete. + * + * **Syntax**: `auto | normal | active | inactive | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "ime-mode"?: Property.ImeMode | undefined; + /** + * The **`inset-block`** CSS property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * @deprecated + */ + "offset-block"?: Property.InsetBlock<TLength> | undefined; + /** + * The **`inset-block-end`** CSS property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "offset-block-end"?: Property.InsetBlockEnd<TLength> | undefined; + /** + * The **`inset-block-start`** CSS property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "offset-block-start"?: Property.InsetBlockStart<TLength> | undefined; + /** + * The **`inset-inline`** CSS property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top` and `bottom`, or `right` and `left` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>{1,2}` + * + * @deprecated + */ + "offset-inline"?: Property.InsetInline<TLength> | undefined; + /** + * The **`inset-inline-end`** CSS property defines the logical inline end inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "offset-inline-end"?: Property.InsetInlineEnd<TLength> | undefined; + /** + * The **`inset-inline-start`** CSS property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. It corresponds to the `top`, `right`, `bottom`, or `left` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`. + * + * **Syntax**: `<'top'>` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "offset-inline-start"?: Property.InsetInlineStart<TLength> | undefined; + /** + * The **`scroll-snap-coordinate`** CSS property defines the x and y coordinate positions within an element that will align with its nearest ancestor scroll container's `scroll-snap-destination` for each respective axis. + * + * **Syntax**: `none | <position>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + "scroll-snap-coordinate"?: Property.ScrollSnapCoordinate<TLength> | undefined; + /** + * The **`scroll-snap-destination`** CSS property defines the position in x and y coordinates within the scroll container's visual viewport which element snap points align with. + * + * **Syntax**: `<position>` + * + * **Initial value**: `0px 0px` + * + * @deprecated + */ + "scroll-snap-destination"?: Property.ScrollSnapDestination<TLength> | undefined; + /** + * The **`scroll-snap-points-x`** CSS property defines the horizontal positioning of snap points within the content of the scroll container they are applied to. + * + * **Syntax**: `none | repeat( <length-percentage> )` + * + * **Initial value**: `none` + * + * @deprecated + */ + "scroll-snap-points-x"?: Property.ScrollSnapPointsX | undefined; + /** + * The **`scroll-snap-points-y`** CSS property defines the vertical positioning of snap points within the content of the scroll container they are applied to. + * + * **Syntax**: `none | repeat( <length-percentage> )` + * + * **Initial value**: `none` + * + * @deprecated + */ + "scroll-snap-points-y"?: Property.ScrollSnapPointsY | undefined; + /** + * The **`scroll-snap-type-x`** CSS property defines how strictly snap points are enforced on the horizontal axis of the scroll container in case there is one. + * + * **Syntax**: `none | mandatory | proximity` + * + * **Initial value**: `none` + * + * @deprecated + */ + "scroll-snap-type-x"?: Property.ScrollSnapTypeX | undefined; + /** + * The **`scroll-snap-type-y`** CSS property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one. + * + * **Syntax**: `none | mandatory | proximity` + * + * **Initial value**: `none` + * + * @deprecated + */ + "scroll-snap-type-y"?: Property.ScrollSnapTypeY | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + "-khtml-box-align"?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + "-khtml-box-direction"?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-khtml-box-flex"?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-khtml-box-flex-group"?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + "-khtml-box-lines"?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-khtml-box-ordinal-group"?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + "-khtml-box-orient"?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + "-khtml-box-pack"?: Property.BoxPack | undefined; + /** + * The **`line-break`** CSS property sets how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols. + * + * **Syntax**: `auto | loose | normal | strict | anywhere` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "-khtml-line-break"?: Property.LineBreak | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-khtml-opacity"?: Property.Opacity | undefined; + /** + * The **`user-select`** CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes. + * + * **Syntax**: `auto | text | none | contain | all` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "-khtml-user-select"?: Property.UserSelect | undefined; + /** + * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user. + * + * **Syntax**: `visible | hidden` + * + * **Initial value**: `visible` + * + * @deprecated + */ + "-moz-backface-visibility"?: Property.BackfaceVisibility | undefined; + /** + * The **`background-clip`** CSS property sets whether an element's background extends underneath its border box, padding box, or content box. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `border-box` + * + * @deprecated + */ + "-moz-background-clip"?: Property.BackgroundClip | undefined; + /** + * The **`box-decoration-break`** CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. + * + * **Syntax**: `slice | clone` + * + * **Initial value**: `slice` + * + * @deprecated + */ + "-moz-background-inline-policy"?: Property.BoxDecorationBreak | undefined; + /** + * The **`background-origin`** CSS property sets the background's origin: from the border start, inside the border, or inside the padding. + * + * **Syntax**: `<box>#` + * + * **Initial value**: `padding-box` + * + * @deprecated + */ + "-moz-background-origin"?: Property.BackgroundOrigin | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * @deprecated + */ + "-moz-background-size"?: Property.BackgroundSize<TLength> | undefined; + /** + * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. + * + * **Syntax**: `<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?` + * + * @deprecated + */ + "-moz-border-radius"?: Property.BorderRadius<TLength> | undefined; + /** + * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-border-radius-bottomleft"?: Property.BorderBottomLeftRadius<TLength> | undefined; + /** + * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-border-radius-bottomright"?: Property.BorderBottomRightRadius<TLength> | undefined; + /** + * The **`border-top-left-radius`** CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-border-radius-topleft"?: Property.BorderTopLeftRadius<TLength> | undefined; + /** + * The **`border-top-right-radius`** CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. + * + * **Syntax**: `<length-percentage>{1,2}` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-border-radius-topright"?: Property.BorderTopRightRadius<TLength> | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + "-moz-box-align"?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + "-moz-box-direction"?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-box-flex"?: Property.BoxFlex | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-moz-box-ordinal-group"?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + "-moz-box-orient"?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + "-moz-box-pack"?: Property.BoxPack | undefined; + /** + * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. + * + * **Syntax**: `none | <shadow>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-moz-box-shadow"?: Property.BoxShadow | undefined; + /** + * The non-standard **`-moz-float-edge`** CSS property specifies whether the height and width properties of the element include the margin, border, or padding thickness. + * + * **Syntax**: `border-box | content-box | margin-box | padding-box` + * + * **Initial value**: `content-box` + * + * @deprecated + */ + "-moz-float-edge"?: Property.MozFloatEdge | undefined; + /** + * The **`-moz-force-broken-image-icon`** extended CSS property can be used to force the broken image icon to be shown even when a broken image has an `alt` attribute. + * + * **Syntax**: `0 | 1` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-moz-force-broken-image-icon"?: Property.MozForceBrokenImageIcon | undefined; + /** + * The **`opacity`** CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. + * + * **Syntax**: `<alpha-value>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-moz-opacity"?: Property.Opacity | undefined; + /** + * The **`outline`** CSS shorthand property sets most of the outline properties in a single declaration. + * + * **Syntax**: `[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]` + * + * @deprecated + */ + "-moz-outline"?: Property.Outline<TLength> | undefined; + /** + * The **`outline-color`** CSS property sets the color of an element's outline. + * + * **Syntax**: `<color> | invert` + * + * **Initial value**: `invert`, for browsers supporting it, `currentColor` for the other + * + * @deprecated + */ + "-moz-outline-color"?: Property.OutlineColor | undefined; + /** + * The **`outline-style`** CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `auto | <'border-style'>` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-moz-outline-style"?: Property.OutlineStyle | undefined; + /** + * The CSS **`outline-width`** property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the `border`. + * + * **Syntax**: `<line-width>` + * + * **Initial value**: `medium` + * + * @deprecated + */ + "-moz-outline-width"?: Property.OutlineWidth<TLength> | undefined; + /** + * The **`perspective`** CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. + * + * **Syntax**: `none | <length>` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-moz-perspective"?: Property.Perspective<TLength> | undefined; + /** + * The **`perspective-origin`** CSS property determines the position at which the viewer is looking. It is used as the _vanishing point_ by the `perspective` property. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * @deprecated + */ + "-moz-perspective-origin"?: Property.PerspectiveOrigin<TLength> | undefined; + /** + * The **`text-align-last`** CSS property sets how the last line of a block or a line, right before a forced line break, is aligned. + * + * **Syntax**: `auto | start | end | left | right | center | justify` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "-moz-text-align-last"?: Property.TextAlignLast | undefined; + /** + * The **`text-decoration-color`** CSS property sets the color of decorations added to text by `text-decoration-line`. + * + * **Syntax**: `<color>` + * + * **Initial value**: `currentcolor` + * + * @deprecated + */ + "-moz-text-decoration-color"?: Property.TextDecorationColor | undefined; + /** + * The **`text-decoration-line`** CSS property sets the kind of decoration that is used on text in an element, such as an underline or overline. + * + * **Syntax**: `none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-moz-text-decoration-line"?: Property.TextDecorationLine | undefined; + /** + * The **`text-decoration-style`** CSS property sets the style of the lines specified by `text-decoration-line`. The style applies to all lines that are set with `text-decoration-line`. + * + * **Syntax**: `solid | double | dotted | dashed | wavy` + * + * **Initial value**: `solid` + * + * @deprecated + */ + "-moz-text-decoration-style"?: Property.TextDecorationStyle | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-moz-transform"?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * @deprecated + */ + "-moz-transform-origin"?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transform-style`** CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element. + * + * **Syntax**: `flat | preserve-3d` + * + * **Initial value**: `flat` + * + * @deprecated + */ + "-moz-transform-style"?: Property.TransformStyle | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * @deprecated + */ + "-moz-transition"?: Property.Transition<TTime> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-moz-transition-delay"?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-moz-transition-duration"?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * @deprecated + */ + "-moz-transition-property"?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + "-moz-transition-timing-function"?: Property.TransitionTimingFunction | undefined; + /** + * In Mozilla applications, **`-moz-user-input`** determines if an element will accept user input. + * + * **Syntax**: `auto | none | enabled | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "-moz-user-input"?: Property.MozUserInput | undefined; + /** + * The **`ime-mode`** CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete. + * + * **Syntax**: `auto | normal | active | inactive | disabled` + * + * **Initial value**: `auto` + * + * @deprecated + */ + "-ms-ime-mode"?: Property.ImeMode | undefined; + /** + * The **`animation`** shorthand CSS property applies an animation between styles. It is a shorthand for `animation-name`, `animation-duration`, `animation-timing-function`, `animation-delay`, `animation-iteration-count`, `animation-direction`, `animation-fill-mode`, and `animation-play-state`. + * + * **Syntax**: `<single-animation>#` + * + * @deprecated + */ + "-o-animation"?: Property.Animation<TTime> | undefined; + /** + * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-o-animation-delay"?: Property.AnimationDelay<TTime> | undefined; + /** + * The **`animation-direction`** CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. + * + * **Syntax**: `<single-animation-direction>#` + * + * **Initial value**: `normal` + * + * @deprecated + */ + "-o-animation-direction"?: Property.AnimationDirection | undefined; + /** + * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-o-animation-duration"?: Property.AnimationDuration<TTime> | undefined; + /** + * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution. + * + * **Syntax**: `<single-animation-fill-mode>#` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-o-animation-fill-mode"?: Property.AnimationFillMode | undefined; + /** + * The **`animation-iteration-count`** CSS property sets the number of times an animation sequence should be played before stopping. + * + * **Syntax**: `<single-animation-iteration-count>#` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-o-animation-iteration-count"?: Property.AnimationIterationCount | undefined; + /** + * The **`animation-name`** CSS property specifies the names of one or more `@keyframes` at-rules that describe the animation to apply to an element. Multiple `@keyframe` at-rules are specified as a comma-separated list of names. If the specified name does not match any `@keyframe` at-rule, no properties are animated. + * + * **Syntax**: `[ none | <keyframes-name> ]#` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-o-animation-name"?: Property.AnimationName | undefined; + /** + * The **`animation-play-state`** CSS property sets whether an animation is running or paused. + * + * **Syntax**: `<single-animation-play-state>#` + * + * **Initial value**: `running` + * + * @deprecated + */ + "-o-animation-play-state"?: Property.AnimationPlayState | undefined; + /** + * The **`animation-timing-function`** CSS property sets how an animation progresses through the duration of each cycle. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + "-o-animation-timing-function"?: Property.AnimationTimingFunction | undefined; + /** + * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. + * + * **Syntax**: `<bg-size>#` + * + * **Initial value**: `auto auto` + * + * @deprecated + */ + "-o-background-size"?: Property.BackgroundSize<TLength> | undefined; + /** + * The **`border-image`** CSS property draws an image around a given element. It replaces the element's regular border. + * + * **Syntax**: `<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>` + * + * @deprecated + */ + "-o-border-image"?: Property.BorderImage | undefined; + /** + * The **`object-fit`** CSS property sets how the content of a replaced element, such as an `<img>` or `<video>`, should be resized to fit its container. + * + * **Syntax**: `fill | contain | cover | none | scale-down` + * + * **Initial value**: `fill` + * + * @deprecated + */ + "-o-object-fit"?: Property.ObjectFit | undefined; + /** + * The **`object-position`** CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background. + * + * **Syntax**: `<position>` + * + * **Initial value**: `50% 50%` + * + * @deprecated + */ + "-o-object-position"?: Property.ObjectPosition<TLength> | undefined; + /** + * The **`tab-size`** CSS property is used to customize the width of tab characters (U+0009). + * + * **Syntax**: `<integer> | <length>` + * + * **Initial value**: `8` + * + * @deprecated + */ + "-o-tab-size"?: Property.TabSize<TLength> | undefined; + /** + * The **`text-overflow`** CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('`…`'), or display a custom string. + * + * **Syntax**: `[ clip | ellipsis | <string> ]{1,2}` + * + * **Initial value**: `clip` + * + * @deprecated + */ + "-o-text-overflow"?: Property.TextOverflow | undefined; + /** + * The **`transform`** CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model. + * + * **Syntax**: `none | <transform-list>` + * + * **Initial value**: `none` + * + * @deprecated + */ + "-o-transform"?: Property.Transform | undefined; + /** + * The **`transform-origin`** CSS property sets the origin for an element's transformations. + * + * **Syntax**: `[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?` + * + * **Initial value**: `50% 50% 0` + * + * @deprecated + */ + "-o-transform-origin"?: Property.TransformOrigin<TLength> | undefined; + /** + * The **`transition`** CSS property is a shorthand property for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. + * + * **Syntax**: `<single-transition>#` + * + * @deprecated + */ + "-o-transition"?: Property.Transition<TTime> | undefined; + /** + * The **`transition-delay`** CSS property specifies the duration to wait before starting a property's transition effect when its value changes. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-o-transition-delay"?: Property.TransitionDelay<TTime> | undefined; + /** + * The **`transition-duration`** CSS property sets the length of time a transition animation should take to complete. By default, the value is `0s`, meaning that no animation will occur. + * + * **Syntax**: `<time>#` + * + * **Initial value**: `0s` + * + * @deprecated + */ + "-o-transition-duration"?: Property.TransitionDuration<TTime> | undefined; + /** + * The **`transition-property`** CSS property sets the CSS properties to which a transition effect should be applied. + * + * **Syntax**: `none | <single-transition-property>#` + * + * **Initial value**: all + * + * @deprecated + */ + "-o-transition-property"?: Property.TransitionProperty | undefined; + /** + * The **`transition-timing-function`** CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect. + * + * **Syntax**: `<easing-function>#` + * + * **Initial value**: `ease` + * + * @deprecated + */ + "-o-transition-timing-function"?: Property.TransitionTimingFunction | undefined; + /** + * The **`box-align`** CSS property specifies how an element aligns its contents across its layout in a perpendicular direction. The effect of the property is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | baseline | stretch` + * + * **Initial value**: `stretch` + * + * @deprecated + */ + "-webkit-box-align"?: Property.BoxAlign | undefined; + /** + * The **`box-direction`** CSS property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). + * + * **Syntax**: `normal | reverse | inherit` + * + * **Initial value**: `normal` + * + * @deprecated + */ + "-webkit-box-direction"?: Property.BoxDirection | undefined; + /** + * The **`-moz-box-flex`** and **`-webkit-box-flex`** CSS properties specify how a `-moz-box` or `-webkit-box` grows to fill the box that contains it, in the direction of the containing box's layout. + * + * **Syntax**: `<number>` + * + * **Initial value**: `0` + * + * @deprecated + */ + "-webkit-box-flex"?: Property.BoxFlex | undefined; + /** + * The **`box-flex-group`** CSS property assigns the flexbox's child elements to a flex group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-webkit-box-flex-group"?: Property.BoxFlexGroup | undefined; + /** + * The **`box-lines`** CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). + * + * **Syntax**: `single | multiple` + * + * **Initial value**: `single` + * + * @deprecated + */ + "-webkit-box-lines"?: Property.BoxLines | undefined; + /** + * The **`box-ordinal-group`** CSS property assigns the flexbox's child elements to an ordinal group. + * + * **Syntax**: `<integer>` + * + * **Initial value**: `1` + * + * @deprecated + */ + "-webkit-box-ordinal-group"?: Property.BoxOrdinalGroup | undefined; + /** + * The **`box-orient`** CSS property sets whether an element lays out its contents horizontally or vertically. + * + * **Syntax**: `horizontal | vertical | inline-axis | block-axis | inherit` + * + * **Initial value**: `inline-axis` (`horizontal` in XUL) + * + * @deprecated + */ + "-webkit-box-orient"?: Property.BoxOrient | undefined; + /** + * The **`-moz-box-pack`** and **`-webkit-box-pack`** CSS properties specify how a `-moz-box` or `-webkit-box` packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. + * + * **Syntax**: `start | center | end | justify` + * + * **Initial value**: `start` + * + * @deprecated + */ + "-webkit-box-pack"?: Property.BoxPack | undefined; +} + +export interface SvgPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + "alignment-baseline"?: Property.AlignmentBaseline | undefined; + "baseline-shift"?: Property.BaselineShift<TLength> | undefined; + clip?: Property.Clip | undefined; + "clip-path"?: Property.ClipPath | undefined; + "clip-rule"?: Property.ClipRule | undefined; + color?: Property.Color | undefined; + "color-interpolation"?: Property.ColorInterpolation | undefined; + "color-rendering"?: Property.ColorRendering | undefined; + cursor?: Property.Cursor | undefined; + direction?: Property.Direction | undefined; + display?: Property.Display | undefined; + "dominant-baseline"?: Property.DominantBaseline | undefined; + fill?: Property.Fill | undefined; + "fill-opacity"?: Property.FillOpacity | undefined; + "fill-rule"?: Property.FillRule | undefined; + filter?: Property.Filter | undefined; + "flood-color"?: Property.FloodColor | undefined; + "flood-opacity"?: Property.FloodOpacity | undefined; + font?: Property.Font | undefined; + "font-family"?: Property.FontFamily | undefined; + "font-size"?: Property.FontSize<TLength> | undefined; + "font-size-adjust"?: Property.FontSizeAdjust | undefined; + "font-stretch"?: Property.FontStretch | undefined; + "font-style"?: Property.FontStyle | undefined; + "font-variant"?: Property.FontVariant | undefined; + "font-weight"?: Property.FontWeight | undefined; + "glyph-orientation-vertical"?: Property.GlyphOrientationVertical | undefined; + "image-rendering"?: Property.ImageRendering | undefined; + "letter-spacing"?: Property.LetterSpacing<TLength> | undefined; + "lighting-color"?: Property.LightingColor | undefined; + "line-height"?: Property.LineHeight<TLength> | undefined; + marker?: Property.Marker | undefined; + "marker-end"?: Property.MarkerEnd | undefined; + "marker-mid"?: Property.MarkerMid | undefined; + "marker-start"?: Property.MarkerStart | undefined; + mask?: Property.Mask<TLength> | undefined; + opacity?: Property.Opacity | undefined; + overflow?: Property.Overflow | undefined; + "paint-order"?: Property.PaintOrder | undefined; + "pointer-events"?: Property.PointerEvents | undefined; + "shape-rendering"?: Property.ShapeRendering | undefined; + "stop-color"?: Property.StopColor | undefined; + "stop-opacity"?: Property.StopOpacity | undefined; + stroke?: Property.Stroke | undefined; + "stroke-dasharray"?: Property.StrokeDasharray<TLength> | undefined; + "stroke-dashoffset"?: Property.StrokeDashoffset<TLength> | undefined; + "stroke-linecap"?: Property.StrokeLinecap | undefined; + "stroke-linejoin"?: Property.StrokeLinejoin | undefined; + "stroke-miterlimit"?: Property.StrokeMiterlimit | undefined; + "stroke-opacity"?: Property.StrokeOpacity | undefined; + "stroke-width"?: Property.StrokeWidth<TLength> | undefined; + "text-anchor"?: Property.TextAnchor | undefined; + "text-decoration"?: Property.TextDecoration<TLength> | undefined; + "text-rendering"?: Property.TextRendering | undefined; + "unicode-bidi"?: Property.UnicodeBidi | undefined; + "vector-effect"?: Property.VectorEffect | undefined; + visibility?: Property.Visibility | undefined; + "white-space"?: Property.WhiteSpace | undefined; + "word-spacing"?: Property.WordSpacing<TLength> | undefined; + "writing-mode"?: Property.WritingMode | undefined; +} + +export interface PropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardPropertiesHyphen<TLength, TTime>, + VendorPropertiesHyphen<TLength, TTime>, + ObsoletePropertiesHyphen<TLength, TTime>, + SvgPropertiesHyphen<TLength, TTime> {} + +export type StandardLonghandPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<StandardLonghandProperties<TLength, TTime>>; + +export type StandardShorthandPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<StandardShorthandProperties<TLength, TTime>>; + +export interface StandardPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardLonghandPropertiesFallback<TLength, TTime>, + StandardShorthandPropertiesFallback<TLength, TTime> {} + +export type VendorLonghandPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<VendorLonghandProperties<TLength, TTime>>; + +export type VendorShorthandPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<VendorShorthandProperties<TLength, TTime>>; + +export interface VendorPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends VendorLonghandPropertiesFallback<TLength, TTime>, + VendorShorthandPropertiesFallback<TLength, TTime> {} + +export type ObsoletePropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<ObsoleteProperties<TLength, TTime>>; + +export type SvgPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<SvgProperties<TLength, TTime>>; + +export interface PropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardPropertiesFallback<TLength, TTime>, + VendorPropertiesFallback<TLength, TTime>, + ObsoletePropertiesFallback<TLength, TTime>, + SvgPropertiesFallback<TLength, TTime> {} + +export type StandardLonghandPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<StandardLonghandPropertiesHyphen<TLength, TTime>>; + +export type StandardShorthandPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<StandardShorthandPropertiesHyphen<TLength, TTime>>; + +export interface StandardPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardLonghandPropertiesHyphenFallback<TLength, TTime>, + StandardShorthandPropertiesHyphenFallback<TLength, TTime> {} + +export type VendorLonghandPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<VendorLonghandPropertiesHyphen<TLength, TTime>>; + +export type VendorShorthandPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<VendorShorthandPropertiesHyphen<TLength, TTime>>; + +export interface VendorPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends VendorLonghandPropertiesHyphenFallback<TLength, TTime>, + VendorShorthandPropertiesHyphenFallback<TLength, TTime> {} + +export type ObsoletePropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<ObsoletePropertiesHyphen<TLength, TTime>>; + +export type SvgPropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<SvgPropertiesHyphen<TLength, TTime>>; + +export interface PropertiesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> + extends StandardPropertiesHyphenFallback<TLength, TTime>, + VendorPropertiesHyphenFallback<TLength, TTime>, + ObsoletePropertiesHyphenFallback<TLength, TTime>, + SvgPropertiesHyphenFallback<TLength, TTime> {} + +export type AtRules = + | "@charset" + | "@counter-style" + | "@document" + | "@font-face" + | "@font-feature-values" + | "@font-palette-values" + | "@import" + | "@keyframes" + | "@layer" + | "@media" + | "@namespace" + | "@page" + | "@property" + | "@scope" + | "@scroll-timeline" + | "@starting-style" + | "@supports" + | "@viewport"; + +export type AdvancedPseudos = + | ":-moz-any()" + | ":-moz-dir" + | ":-webkit-any()" + | "::cue" + | "::cue-region" + | "::part" + | "::slotted" + | "::view-transition-group" + | "::view-transition-image-pair" + | "::view-transition-new" + | "::view-transition-old" + | ":dir" + | ":has" + | ":host" + | ":host-context" + | ":is" + | ":lang" + | ":matches()" + | ":not" + | ":nth-child" + | ":nth-last-child" + | ":nth-last-of-type" + | ":nth-of-type" + | ":where"; + +export type SimplePseudos = + | ":-khtml-any-link" + | ":-moz-any-link" + | ":-moz-focusring" + | ":-moz-full-screen" + | ":-moz-placeholder" + | ":-moz-read-only" + | ":-moz-read-write" + | ":-moz-ui-invalid" + | ":-moz-ui-valid" + | ":-ms-fullscreen" + | ":-ms-input-placeholder" + | ":-webkit-any-link" + | ":-webkit-full-screen" + | "::-moz-placeholder" + | "::-moz-progress-bar" + | "::-moz-range-progress" + | "::-moz-range-thumb" + | "::-moz-range-track" + | "::-moz-selection" + | "::-ms-backdrop" + | "::-ms-browse" + | "::-ms-check" + | "::-ms-clear" + | "::-ms-expand" + | "::-ms-fill" + | "::-ms-fill-lower" + | "::-ms-fill-upper" + | "::-ms-input-placeholder" + | "::-ms-reveal" + | "::-ms-thumb" + | "::-ms-ticks-after" + | "::-ms-ticks-before" + | "::-ms-tooltip" + | "::-ms-track" + | "::-ms-value" + | "::-webkit-backdrop" + | "::-webkit-input-placeholder" + | "::-webkit-progress-bar" + | "::-webkit-progress-inner-value" + | "::-webkit-progress-value" + | "::-webkit-slider-runnable-track" + | "::-webkit-slider-thumb" + | "::after" + | "::backdrop" + | "::before" + | "::cue" + | "::cue-region" + | "::first-letter" + | "::first-line" + | "::grammar-error" + | "::marker" + | "::placeholder" + | "::selection" + | "::spelling-error" + | "::target-text" + | "::view-transition" + | ":active" + | ":after" + | ":any-link" + | ":before" + | ":blank" + | ":checked" + | ":current" + | ":default" + | ":defined" + | ":disabled" + | ":empty" + | ":enabled" + | ":first" + | ":first-child" + | ":first-letter" + | ":first-line" + | ":first-of-type" + | ":focus" + | ":focus-visible" + | ":focus-within" + | ":fullscreen" + | ":future" + | ":hover" + | ":in-range" + | ":indeterminate" + | ":invalid" + | ":last-child" + | ":last-of-type" + | ":left" + | ":link" + | ":local-link" + | ":nth-col" + | ":nth-last-col" + | ":only-child" + | ":only-of-type" + | ":optional" + | ":out-of-range" + | ":past" + | ":paused" + | ":picture-in-picture" + | ":placeholder-shown" + | ":playing" + | ":read-only" + | ":read-write" + | ":required" + | ":right" + | ":root" + | ":scope" + | ":target" + | ":target-within" + | ":user-invalid" + | ":user-valid" + | ":valid" + | ":visited"; + +export type Pseudos = AdvancedPseudos | SimplePseudos; + +export type HtmlAttributes = + | "[abbr]" + | "[accept-charset]" + | "[accept]" + | "[accesskey]" + | "[action]" + | "[align]" + | "[alink]" + | "[allow]" + | "[allowfullscreen]" + | "[allowpaymentrequest]" + | "[alt]" + | "[archive]" + | "[async]" + | "[attributionsrc]" + | "[autobuffer]" + | "[autocapitalize]" + | "[autocomplete]" + | "[autofocus]" + | "[autoplay]" + | "[axis]" + | "[background]" + | "[behavior]" + | "[bgcolor]" + | "[blocking]" + | "[border]" + | "[bottommargin]" + | "[browsingtopics]" + | "[capture]" + | "[cellpadding]" + | "[cellspacing]" + | "[char]" + | "[charoff]" + | "[charset]" + | "[checked]" + | "[cite]" + | "[class]" + | "[classid]" + | "[clear]" + | "[codebase]" + | "[codetype]" + | "[color]" + | "[cols]" + | "[colspan]" + | "[compact]" + | "[content]" + | "[contenteditable]" + | "[contextmenu]" + | "[controls]" + | "[coords]" + | "[credentialless]" + | "[crossorigin]" + | "[data]" + | "[datetime]" + | "[declare]" + | "[decoding]" + | "[default]" + | "[defer]" + | "[dir]" + | "[direction]" + | "[dirname]" + | "[disabled]" + | "[download]" + | "[draggable]" + | "[enctype]" + | "[enterkeyhint]" + | "[exportparts]" + | "[face]" + | "[fetchpriority]" + | "[for]" + | "[form]" + | "[formaction]" + | "[formenctype]" + | "[formmethod]" + | "[formnovalidate]" + | "[formtarget]" + | "[frame]" + | "[frameborder]" + | "[headers]" + | "[height]" + | "[hidden]" + | "[high]" + | "[href]" + | "[hreflang]" + | "[hspace]" + | "[http-equiv]" + | "[id]" + | "[imagesizes]" + | "[imagesrcset]" + | "[inert]" + | "[inputmode]" + | "[integrity]" + | "[is]" + | "[ismap]" + | "[itemid]" + | "[itemprop]" + | "[itemref]" + | "[itemscope]" + | "[itemtype]" + | "[kind]" + | "[label]" + | "[lang]" + | "[language]" + | "[leftmargin]" + | "[link]" + | "[list]" + | "[loading]" + | "[longdesc]" + | "[loop]" + | "[low]" + | "[manifest]" + | "[marginheight]" + | "[marginwidth]" + | "[max]" + | "[maxlength]" + | "[media]" + | "[method]" + | "[methods]" + | "[min]" + | "[minlength]" + | "[moz-opaque]" + | "[mozactionhint]" + | "[mozallowfullscreen]" + | "[msallowfullscreen]" + | "[multiple]" + | "[muted]" + | "[name]" + | "[nohref]" + | "[nomodule]" + | "[nonce]" + | "[noresize]" + | "[noshade]" + | "[novalidate]" + | "[nowrap]" + | "[onerror]" + | "[open]" + | "[optimum]" + | "[part]" + | "[pattern]" + | "[ping]" + | "[placeholder]" + | "[popover]" + | "[popovertarget]" + | "[popovertargetaction]" + | "[poster]" + | "[preload]" + | "[profile]" + | "[readonly]" + | "[referrerpolicy]" + | "[rel]" + | "[required]" + | "[rev]" + | "[reversed]" + | "[rightmargin]" + | "[rows]" + | "[rowspan]" + | "[rules]" + | "[sandbox]" + | "[scope]" + | "[scrollamount]" + | "[scrolldelay]" + | "[scrolling]" + | "[selected]" + | "[shadowroot]" + | "[shadowrootmode]" + | "[shape]" + | "[size]" + | "[sizes]" + | "[slot]" + | "[span]" + | "[spellcheck]" + | "[src]" + | "[srcdoc]" + | "[srclang]" + | "[srcset]" + | "[standby]" + | "[start]" + | "[step]" + | "[style]" + | "[summary]" + | "[tabindex]" + | "[target]" + | "[text]" + | "[title]" + | "[topmargin]" + | "[translate]" + | "[truespeed]" + | "[type]" + | "[usemap]" + | "[valign]" + | "[value]" + | "[valuetype]" + | "[version]" + | "[virtualkeyboardpolicy]" + | "[vlink]" + | "[vspace]" + | "[webkitallowfullscreen]" + | "[width]" + | "[wrap]" + | "[x-moz-errormessage]" + | "[xmlns]"; + +export type SvgAttributes = + | "[accent-height]" + | "[alignment-baseline]" + | "[allowReorder]" + | "[alphabetic]" + | "[animation]" + | "[arabic-form]" + | "[ascent]" + | "[async]" + | "[attributeName]" + | "[attributeType]" + | "[azimuth]" + | "[baseFrequency]" + | "[baseProfile]" + | "[baseline-shift]" + | "[bbox]" + | "[bias]" + | "[by]" + | "[calcMode]" + | "[cap-height]" + | "[class]" + | "[clip-path]" + | "[clip-rule]" + | "[clipPathUnits]" + | "[clip]" + | "[color-interpolation-filters]" + | "[color-interpolation]" + | "[color-profile]" + | "[color]" + | "[contentScriptType]" + | "[contentStyleType]" + | "[crossorigin]" + | "[cursor]" + | "[cx]" + | "[cy]" + | "[d]" + | "[decoding]" + | "[defer]" + | "[descent]" + | "[diffuseConstant]" + | "[direction]" + | "[display]" + | "[divisor]" + | "[document]" + | "[dominant-baseline]" + | "[download]" + | "[dur]" + | "[dx]" + | "[dy]" + | "[edgeMode]" + | "[elevation]" + | "[enable-background]" + | "[fill-opacity]" + | "[fill-rule]" + | "[fill]" + | "[filterRes]" + | "[filterUnits]" + | "[filter]" + | "[flood-color]" + | "[flood-opacity]" + | "[font-family]" + | "[font-size-adjust]" + | "[font-size]" + | "[font-stretch]" + | "[font-style]" + | "[font-variant]" + | "[font-weight]" + | "[format]" + | "[fr]" + | "[from]" + | "[fx]" + | "[fy]" + | "[g1]" + | "[g2]" + | "[global]" + | "[glyph-name]" + | "[glyph-orientation-horizontal]" + | "[glyph-orientation-vertical]" + | "[glyphRef]" + | "[gradientTransform]" + | "[gradientUnits]" + | "[graphical]" + | "[hanging]" + | "[height]" + | "[horiz-adv-x]" + | "[horiz-origin-x]" + | "[horiz-origin-y]" + | "[href]" + | "[hreflang]" + | "[id]" + | "[ideographic]" + | "[image-rendering]" + | "[in2]" + | "[in]" + | "[k1]" + | "[k2]" + | "[k3]" + | "[k4]" + | "[k]" + | "[kernelMatrix]" + | "[kernelUnitLength]" + | "[kerning]" + | "[keyPoints]" + | "[lang]" + | "[lengthAdjust]" + | "[letter-spacing]" + | "[lighting-color]" + | "[limitingConeAngle]" + | "[marker-end]" + | "[marker-mid]" + | "[marker-start]" + | "[markerHeight]" + | "[markerUnits]" + | "[markerWidth]" + | "[maskContentUnits]" + | "[maskUnits]" + | "[mask]" + | "[mathematical]" + | "[media]" + | "[mode]" + | "[name]" + | "[numOctaves]" + | "[offset]" + | "[opacity]" + | "[operator]" + | "[order]" + | "[orient]" + | "[orientation]" + | "[origin]" + | "[overflow]" + | "[overline-position]" + | "[overline-thickness]" + | "[paint-order]" + | "[panose-1]" + | "[path]" + | "[patternContentUnits]" + | "[patternTransform]" + | "[patternUnits]" + | "[ping]" + | "[pointer-events]" + | "[pointsAtX]" + | "[pointsAtY]" + | "[pointsAtZ]" + | "[points]" + | "[preserveAlpha]" + | "[preserveAspectRatio]" + | "[primitiveUnits]" + | "[r]" + | "[radius]" + | "[refX]" + | "[refY]" + | "[referrerpolicy]" + | "[rel]" + | "[repeatCount]" + | "[requiredExtensions]" + | "[requiredFeatures]" + | "[rotate]" + | "[rx]" + | "[ry]" + | "[scale]" + | "[seed]" + | "[shape-rendering]" + | "[side]" + | "[slope]" + | "[solid-color]" + | "[solid-opacity]" + | "[spacing]" + | "[specularConstant]" + | "[specularExponent]" + | "[spreadMethod]" + | "[startOffset]" + | "[stdDeviation]" + | "[stemh]" + | "[stemv]" + | "[stitchTiles]" + | "[stop-color]" + | "[stop-opacity]" + | "[strikethrough-position]" + | "[strikethrough-thickness]" + | "[string]" + | "[stroke-dasharray]" + | "[stroke-dashoffset]" + | "[stroke-linecap]" + | "[stroke-linejoin]" + | "[stroke-miterlimit]" + | "[stroke-opacity]" + | "[stroke-width]" + | "[stroke]" + | "[style]" + | "[surfaceScale]" + | "[systemLanguage]" + | "[tabindex]" + | "[targetX]" + | "[targetY]" + | "[target]" + | "[text-anchor]" + | "[text-decoration]" + | "[text-overflow]" + | "[text-rendering]" + | "[textLength]" + | "[title]" + | "[to]" + | "[transform-origin]" + | "[transform]" + | "[type]" + | "[u1]" + | "[u2]" + | "[underline-position]" + | "[underline-thickness]" + | "[unicode-bidi]" + | "[unicode-range]" + | "[unicode]" + | "[units-per-em]" + | "[v-alphabetic]" + | "[v-hanging]" + | "[v-ideographic]" + | "[v-mathematical]" + | "[values]" + | "[vector-effect]" + | "[version]" + | "[vert-adv-y]" + | "[vert-origin-x]" + | "[vert-origin-y]" + | "[viewBox]" + | "[viewTarget]" + | "[visibility]" + | "[white-space]" + | "[width]" + | "[widths]" + | "[word-spacing]" + | "[writing-mode]" + | "[x-height]" + | "[x1]" + | "[x2]" + | "[xChannelSelector]" + | "[x]" + | "[y1]" + | "[y2]" + | "[yChannelSelector]" + | "[y]" + | "[z]" + | "[zoomAndPan]"; + +export type Globals = "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset"; + +export namespace Property { + export type AccentColor = Globals | DataType.Color | "auto"; + + export type AlignContent = Globals | DataType.ContentDistribution | DataType.ContentPosition | "baseline" | "normal" | (string & {}); + + export type AlignItems = Globals | DataType.SelfPosition | "baseline" | "normal" | "stretch" | (string & {}); + + export type AlignSelf = Globals | DataType.SelfPosition | "auto" | "baseline" | "normal" | "stretch" | (string & {}); + + export type AlignTracks = Globals | DataType.ContentDistribution | DataType.ContentPosition | "baseline" | "normal" | (string & {}); + + export type All = Globals; + + export type Animation<TTime = string & {}> = Globals | DataType.SingleAnimation<TTime> | (string & {}); + + export type AnimationComposition = Globals | DataType.SingleAnimationComposition | (string & {}); + + export type AnimationDelay<TTime = string & {}> = Globals | TTime | (string & {}); + + export type AnimationDirection = Globals | DataType.SingleAnimationDirection | (string & {}); + + export type AnimationDuration<TTime = string & {}> = Globals | TTime | (string & {}); + + export type AnimationFillMode = Globals | DataType.SingleAnimationFillMode | (string & {}); + + export type AnimationIterationCount = Globals | "infinite" | (string & {}) | (number & {}); + + export type AnimationName = Globals | "none" | (string & {}); + + export type AnimationPlayState = Globals | "paused" | "running" | (string & {}); + + export type AnimationRange<TLength = (string & {}) | 0> = Globals | DataType.TimelineRangeName | TLength | "normal" | (string & {}); + + export type AnimationRangeEnd<TLength = (string & {}) | 0> = Globals | DataType.TimelineRangeName | TLength | "normal" | (string & {}); + + export type AnimationRangeStart<TLength = (string & {}) | 0> = Globals | DataType.TimelineRangeName | TLength | "normal" | (string & {}); + + export type AnimationTimeline = Globals | DataType.SingleAnimationTimeline | (string & {}); + + export type AnimationTimingFunction = Globals | DataType.EasingFunction | (string & {}); + + export type Appearance = Globals | DataType.CompatAuto | "auto" | "menulist-button" | "none" | "textfield"; + + export type AspectRatio = Globals | "auto" | (string & {}) | (number & {}); + + export type Azimuth = + | Globals + | "behind" + | "center" + | "center-left" + | "center-right" + | "far-left" + | "far-right" + | "left" + | "left-side" + | "leftwards" + | "right" + | "right-side" + | "rightwards" + | (string & {}); + + export type BackdropFilter = Globals | "none" | (string & {}); + + export type BackfaceVisibility = Globals | "hidden" | "visible"; + + export type Background<TLength = (string & {}) | 0> = Globals | DataType.FinalBgLayer<TLength> | (string & {}); + + export type BackgroundAttachment = Globals | DataType.Attachment | (string & {}); + + export type BackgroundBlendMode = Globals | DataType.BlendMode | (string & {}); + + export type BackgroundClip = Globals | DataType.Box | (string & {}); + + export type BackgroundColor = Globals | DataType.Color; + + export type BackgroundImage = Globals | "none" | (string & {}); + + export type BackgroundOrigin = Globals | DataType.Box | (string & {}); + + export type BackgroundPosition<TLength = (string & {}) | 0> = Globals | DataType.BgPosition<TLength> | (string & {}); + + export type BackgroundPositionX<TLength = (string & {}) | 0> = Globals | TLength | "center" | "left" | "right" | "x-end" | "x-start" | (string & {}); + + export type BackgroundPositionY<TLength = (string & {}) | 0> = Globals | TLength | "bottom" | "center" | "top" | "y-end" | "y-start" | (string & {}); + + export type BackgroundRepeat = Globals | DataType.RepeatStyle | (string & {}); + + export type BackgroundSize<TLength = (string & {}) | 0> = Globals | DataType.BgSize<TLength> | (string & {}); + + export type BlockOverflow = Globals | "clip" | "ellipsis" | (string & {}); + + export type BlockSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type Border<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderBlock<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderBlockColor = Globals | DataType.Color | (string & {}); + + export type BorderBlockEnd<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderBlockEndColor = Globals | DataType.Color; + + export type BorderBlockEndStyle = Globals | DataType.LineStyle; + + export type BorderBlockEndWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderBlockStart<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderBlockStartColor = Globals | DataType.Color; + + export type BorderBlockStartStyle = Globals | DataType.LineStyle; + + export type BorderBlockStartWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderBlockStyle = Globals | DataType.LineStyle; + + export type BorderBlockWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderBottom<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderBottomColor = Globals | DataType.Color; + + export type BorderBottomLeftRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderBottomRightRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderBottomStyle = Globals | DataType.LineStyle; + + export type BorderBottomWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderCollapse = Globals | "collapse" | "separate"; + + export type BorderColor = Globals | DataType.Color | (string & {}); + + export type BorderEndEndRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderEndStartRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderImage = Globals | "none" | "repeat" | "round" | "space" | "stretch" | (string & {}) | (number & {}); + + export type BorderImageOutset<TLength = (string & {}) | 0> = Globals | TLength | (string & {}) | (number & {}); + + export type BorderImageRepeat = Globals | "repeat" | "round" | "space" | "stretch" | (string & {}); + + export type BorderImageSlice = Globals | (string & {}) | (number & {}); + + export type BorderImageSource = Globals | "none" | (string & {}); + + export type BorderImageWidth<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}) | (number & {}); + + export type BorderInline<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderInlineColor = Globals | DataType.Color | (string & {}); + + export type BorderInlineEnd<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderInlineEndColor = Globals | DataType.Color; + + export type BorderInlineEndStyle = Globals | DataType.LineStyle; + + export type BorderInlineEndWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderInlineStart<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderInlineStartColor = Globals | DataType.Color; + + export type BorderInlineStartStyle = Globals | DataType.LineStyle; + + export type BorderInlineStartWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderInlineStyle = Globals | DataType.LineStyle; + + export type BorderInlineWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderLeft<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderLeftColor = Globals | DataType.Color; + + export type BorderLeftStyle = Globals | DataType.LineStyle; + + export type BorderLeftWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderRight<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderRightColor = Globals | DataType.Color; + + export type BorderRightStyle = Globals | DataType.LineStyle; + + export type BorderRightWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderSpacing<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderStartEndRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderStartStartRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderStyle = Globals | DataType.LineStyle | (string & {}); + + export type BorderTop<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type BorderTopColor = Globals | DataType.Color; + + export type BorderTopLeftRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderTopRightRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type BorderTopStyle = Globals | DataType.LineStyle; + + export type BorderTopWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type BorderWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | (string & {}); + + export type Bottom<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type BoxAlign = Globals | "baseline" | "center" | "end" | "start" | "stretch"; + + export type BoxDecorationBreak = Globals | "clone" | "slice"; + + export type BoxDirection = Globals | "inherit" | "normal" | "reverse"; + + export type BoxFlex = Globals | (number & {}) | (string & {}); + + export type BoxFlexGroup = Globals | (number & {}) | (string & {}); + + export type BoxLines = Globals | "multiple" | "single"; + + export type BoxOrdinalGroup = Globals | (number & {}) | (string & {}); + + export type BoxOrient = Globals | "block-axis" | "horizontal" | "inherit" | "inline-axis" | "vertical"; + + export type BoxPack = Globals | "center" | "end" | "justify" | "start"; + + export type BoxShadow = Globals | "none" | (string & {}); + + export type BoxSizing = Globals | "border-box" | "content-box"; + + export type BreakAfter = + | Globals + | "all" + | "always" + | "auto" + | "avoid" + | "avoid-column" + | "avoid-page" + | "avoid-region" + | "column" + | "left" + | "page" + | "recto" + | "region" + | "right" + | "verso"; + + export type BreakBefore = + | Globals + | "all" + | "always" + | "auto" + | "avoid" + | "avoid-column" + | "avoid-page" + | "avoid-region" + | "column" + | "left" + | "page" + | "recto" + | "region" + | "right" + | "verso"; + + export type BreakInside = Globals | "auto" | "avoid" | "avoid-column" | "avoid-page" | "avoid-region"; + + export type CaptionSide = Globals | "block-end" | "block-start" | "bottom" | "inline-end" | "inline-start" | "top"; + + export type Caret = Globals | DataType.Color | "auto" | "bar" | "block" | "underscore" | (string & {}); + + export type CaretColor = Globals | DataType.Color | "auto"; + + export type CaretShape = Globals | "auto" | "bar" | "block" | "underscore"; + + export type Clear = Globals | "both" | "inline-end" | "inline-start" | "left" | "none" | "right"; + + export type Clip = Globals | "auto" | (string & {}); + + export type ClipPath = Globals | DataType.GeometryBox | "none" | (string & {}); + + export type Color = Globals | DataType.Color; + + export type PrintColorAdjust = Globals | "economy" | "exact"; + + export type ColorScheme = Globals | "dark" | "light" | "normal" | (string & {}); + + export type ColumnCount = Globals | "auto" | (number & {}) | (string & {}); + + export type ColumnFill = Globals | "auto" | "balance" | "balance-all"; + + export type ColumnGap<TLength = (string & {}) | 0> = Globals | TLength | "normal" | (string & {}); + + export type ColumnRule<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type ColumnRuleColor = Globals | DataType.Color; + + export type ColumnRuleStyle = Globals | DataType.LineStyle | (string & {}); + + export type ColumnRuleWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | (string & {}); + + export type ColumnSpan = Globals | "all" | "none"; + + export type ColumnWidth<TLength = (string & {}) | 0> = Globals | TLength | "auto"; + + export type Columns<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}) | (number & {}); + + export type Contain = Globals | "content" | "inline-size" | "layout" | "none" | "paint" | "size" | "strict" | "style" | (string & {}); + + export type ContainIntrinsicBlockSize<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type ContainIntrinsicHeight<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type ContainIntrinsicInlineSize<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type ContainIntrinsicSize<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type ContainIntrinsicWidth<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type Container = Globals | "none" | (string & {}); + + export type ContainerName = Globals | "none" | (string & {}); + + export type ContainerType = Globals | "inline-size" | "normal" | "size"; + + export type Content = Globals | DataType.ContentList | "none" | "normal" | (string & {}); + + export type ContentVisibility = Globals | "auto" | "hidden" | "visible"; + + export type CounterIncrement = Globals | "none" | (string & {}); + + export type CounterReset = Globals | "none" | (string & {}); + + export type CounterSet = Globals | "none" | (string & {}); + + export type Cursor = + | Globals + | "-moz-grab" + | "-webkit-grab" + | "alias" + | "all-scroll" + | "auto" + | "cell" + | "col-resize" + | "context-menu" + | "copy" + | "crosshair" + | "default" + | "e-resize" + | "ew-resize" + | "grab" + | "grabbing" + | "help" + | "move" + | "n-resize" + | "ne-resize" + | "nesw-resize" + | "no-drop" + | "none" + | "not-allowed" + | "ns-resize" + | "nw-resize" + | "nwse-resize" + | "pointer" + | "progress" + | "row-resize" + | "s-resize" + | "se-resize" + | "sw-resize" + | "text" + | "vertical-text" + | "w-resize" + | "wait" + | "zoom-in" + | "zoom-out" + | (string & {}); + + export type Direction = Globals | "ltr" | "rtl"; + + export type Display = + | Globals + | DataType.DisplayOutside + | DataType.DisplayInside + | DataType.DisplayInternal + | DataType.DisplayLegacy + | "contents" + | "list-item" + | "none" + | (string & {}); + + export type EmptyCells = Globals | "hide" | "show"; + + export type Filter = Globals | "none" | (string & {}); + + export type Flex<TLength = (string & {}) | 0> = Globals | TLength | "auto" | "content" | "fit-content" | "max-content" | "min-content" | "none" | (string & {}) | (number & {}); + + export type FlexBasis<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-auto" + | "auto" + | "content" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type FlexDirection = Globals | "column" | "column-reverse" | "row" | "row-reverse"; + + export type FlexFlow = Globals | "column" | "column-reverse" | "nowrap" | "row" | "row-reverse" | "wrap" | "wrap-reverse" | (string & {}); + + export type FlexGrow = Globals | (number & {}) | (string & {}); + + export type FlexShrink = Globals | (number & {}) | (string & {}); + + export type FlexWrap = Globals | "nowrap" | "wrap" | "wrap-reverse"; + + export type Float = Globals | "inline-end" | "inline-start" | "left" | "none" | "right"; + + export type Font = Globals | "caption" | "icon" | "menu" | "message-box" | "small-caption" | "status-bar" | (string & {}); + + export type FontFamily = Globals | DataType.GenericFamily | (string & {}); + + export type FontFeatureSettings = Globals | "normal" | (string & {}); + + export type FontKerning = Globals | "auto" | "none" | "normal"; + + export type FontLanguageOverride = Globals | "normal" | (string & {}); + + export type FontOpticalSizing = Globals | "auto" | "none"; + + export type FontPalette = Globals | "dark" | "light" | "normal" | (string & {}); + + export type FontSize<TLength = (string & {}) | 0> = Globals | DataType.AbsoluteSize | TLength | "larger" | "smaller" | (string & {}); + + export type FontSizeAdjust = Globals | "from-font" | "none" | (string & {}) | (number & {}); + + export type FontSmooth<TLength = (string & {}) | 0> = Globals | DataType.AbsoluteSize | TLength | "always" | "auto" | "never"; + + export type FontStretch = Globals | DataType.FontStretchAbsolute; + + export type FontStyle = Globals | "italic" | "normal" | "oblique" | (string & {}); + + export type FontSynthesis = Globals | "none" | "position" | "small-caps" | "style" | "weight" | (string & {}); + + export type FontSynthesisPosition = Globals | "auto" | "none"; + + export type FontSynthesisSmallCaps = Globals | "auto" | "none"; + + export type FontSynthesisStyle = Globals | "auto" | "none"; + + export type FontSynthesisWeight = Globals | "auto" | "none"; + + export type FontVariant = + | Globals + | DataType.EastAsianVariantValues + | "all-petite-caps" + | "all-small-caps" + | "common-ligatures" + | "contextual" + | "diagonal-fractions" + | "discretionary-ligatures" + | "full-width" + | "historical-forms" + | "historical-ligatures" + | "lining-nums" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "petite-caps" + | "proportional-nums" + | "proportional-width" + | "ruby" + | "slashed-zero" + | "small-caps" + | "stacked-fractions" + | "tabular-nums" + | "titling-caps" + | "unicase" + | (string & {}); + + export type FontVariantAlternates = Globals | "historical-forms" | "normal" | (string & {}); + + export type FontVariantCaps = Globals | "all-petite-caps" | "all-small-caps" | "normal" | "petite-caps" | "small-caps" | "titling-caps" | "unicase"; + + export type FontVariantEastAsian = Globals | DataType.EastAsianVariantValues | "full-width" | "normal" | "proportional-width" | "ruby" | (string & {}); + + export type FontVariantEmoji = Globals | "emoji" | "normal" | "text" | "unicode"; + + export type FontVariantLigatures = + | Globals + | "common-ligatures" + | "contextual" + | "discretionary-ligatures" + | "historical-ligatures" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | (string & {}); + + export type FontVariantNumeric = + | Globals + | "diagonal-fractions" + | "lining-nums" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "proportional-nums" + | "slashed-zero" + | "stacked-fractions" + | "tabular-nums" + | (string & {}); + + export type FontVariantPosition = Globals | "normal" | "sub" | "super"; + + export type FontVariationSettings = Globals | "normal" | (string & {}); + + export type FontWeight = Globals | DataType.FontWeightAbsolute | "bolder" | "lighter"; + + export type ForcedColorAdjust = Globals | "auto" | "none"; + + export type Gap<TLength = (string & {}) | 0> = Globals | TLength | "normal" | (string & {}); + + export type Grid = Globals | "none" | (string & {}); + + export type GridArea = Globals | DataType.GridLine | (string & {}); + + export type GridAutoColumns<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | (string & {}); + + export type GridAutoFlow = Globals | "column" | "dense" | "row" | (string & {}); + + export type GridAutoRows<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | (string & {}); + + export type GridColumn = Globals | DataType.GridLine | (string & {}); + + export type GridColumnEnd = Globals | DataType.GridLine; + + export type GridColumnGap<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type GridColumnStart = Globals | DataType.GridLine; + + export type GridGap<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type GridRow = Globals | DataType.GridLine | (string & {}); + + export type GridRowEnd = Globals | DataType.GridLine; + + export type GridRowGap<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type GridRowStart = Globals | DataType.GridLine; + + export type GridTemplate = Globals | "none" | (string & {}); + + export type GridTemplateAreas = Globals | "none" | (string & {}); + + export type GridTemplateColumns<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | "none" | "subgrid" | (string & {}); + + export type GridTemplateRows<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | "none" | "subgrid" | (string & {}); + + export type HangingPunctuation = Globals | "allow-end" | "first" | "force-end" | "last" | "none" | (string & {}); + + export type Height<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type HyphenateCharacter = Globals | "auto" | (string & {}); + + export type HyphenateLimitChars = Globals | "auto" | (string & {}) | (number & {}); + + export type Hyphens = Globals | "auto" | "manual" | "none"; + + export type ImageOrientation = Globals | "flip" | "from-image" | (string & {}); + + export type ImageRendering = Globals | "-moz-crisp-edges" | "-webkit-optimize-contrast" | "auto" | "crisp-edges" | "pixelated"; + + export type ImageResolution = Globals | "from-image" | (string & {}); + + export type ImeMode = Globals | "active" | "auto" | "disabled" | "inactive" | "normal"; + + export type InitialLetter = Globals | "normal" | (string & {}) | (number & {}); + + export type InlineSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type InputSecurity = Globals | "auto" | "none"; + + export type Inset<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetBlock<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetBlockEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetBlockStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetInline<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetInlineEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type InsetInlineStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type Isolation = Globals | "auto" | "isolate"; + + export type JustifyContent = Globals | DataType.ContentDistribution | DataType.ContentPosition | "left" | "normal" | "right" | (string & {}); + + export type JustifyItems = Globals | DataType.SelfPosition | "baseline" | "left" | "legacy" | "normal" | "right" | "stretch" | (string & {}); + + export type JustifySelf = Globals | DataType.SelfPosition | "auto" | "baseline" | "left" | "normal" | "right" | "stretch" | (string & {}); + + export type JustifyTracks = Globals | DataType.ContentDistribution | DataType.ContentPosition | "left" | "normal" | "right" | (string & {}); + + export type Left<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type LetterSpacing<TLength = (string & {}) | 0> = Globals | TLength | "normal"; + + export type LineBreak = Globals | "anywhere" | "auto" | "loose" | "normal" | "strict"; + + export type LineClamp = Globals | "none" | (number & {}) | (string & {}); + + export type LineHeight<TLength = (string & {}) | 0> = Globals | TLength | "normal" | (string & {}) | (number & {}); + + export type LineHeightStep<TLength = (string & {}) | 0> = Globals | TLength; + + export type ListStyle = Globals | "inside" | "none" | "outside" | (string & {}); + + export type ListStyleImage = Globals | "none" | (string & {}); + + export type ListStylePosition = Globals | "inside" | "outside"; + + export type ListStyleType = Globals | "none" | (string & {}); + + export type Margin<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginBlock<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginBlockEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginBlockStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginBottom<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginInline<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginInlineEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginInlineStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginLeft<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginRight<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginTop<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type MarginTrim = Globals | "all" | "in-flow" | "none"; + + export type Mask<TLength = (string & {}) | 0> = Globals | DataType.MaskLayer<TLength> | (string & {}); + + export type MaskBorder = Globals | "alpha" | "luminance" | "none" | "repeat" | "round" | "space" | "stretch" | (string & {}) | (number & {}); + + export type MaskBorderMode = Globals | "alpha" | "luminance"; + + export type MaskBorderOutset<TLength = (string & {}) | 0> = Globals | TLength | (string & {}) | (number & {}); + + export type MaskBorderRepeat = Globals | "repeat" | "round" | "space" | "stretch" | (string & {}); + + export type MaskBorderSlice = Globals | (string & {}) | (number & {}); + + export type MaskBorderSource = Globals | "none" | (string & {}); + + export type MaskBorderWidth<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}) | (number & {}); + + export type MaskClip = Globals | DataType.GeometryBox | "no-clip" | (string & {}); + + export type MaskComposite = Globals | DataType.CompositingOperator | (string & {}); + + export type MaskImage = Globals | "none" | (string & {}); + + export type MaskMode = Globals | DataType.MaskingMode | (string & {}); + + export type MaskOrigin = Globals | DataType.GeometryBox | (string & {}); + + export type MaskPosition<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | (string & {}); + + export type MaskRepeat = Globals | DataType.RepeatStyle | (string & {}); + + export type MaskSize<TLength = (string & {}) | 0> = Globals | DataType.BgSize<TLength> | (string & {}); + + export type MaskType = Globals | "alpha" | "luminance"; + + export type MasonryAutoFlow = Globals | "definite-first" | "next" | "ordered" | "pack" | (string & {}); + + export type MathDepth = Globals | "auto-add" | (string & {}) | (number & {}); + + export type MathShift = Globals | "compact" | "normal"; + + export type MathStyle = Globals | "compact" | "normal"; + + export type MaxBlockSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "fit-content" + | "max-content" + | "min-content" + | "none" + | (string & {}); + + export type MaxHeight<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "none" + | (string & {}); + + export type MaxInlineSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "fit-content" + | "max-content" + | "min-content" + | "none" + | (string & {}); + + export type MaxLines = Globals | "none" | (number & {}) | (string & {}); + + export type MaxWidth<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "none" + | (string & {}); + + export type MinBlockSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type MinHeight<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | (string & {}); + + export type MinInlineSize<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | (string & {}); + + export type MinWidth<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "min-intrinsic" + | (string & {}); + + export type MixBlendMode = Globals | DataType.BlendMode | "plus-lighter"; + + export type Offset<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | "auto" | "none" | "normal" | (string & {}); + + export type OffsetDistance<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type OffsetPath = Globals | "none" | (string & {}); + + export type OffsetRotate = Globals | "auto" | "reverse" | (string & {}); + + export type ObjectFit = Globals | "contain" | "cover" | "fill" | "none" | "scale-down"; + + export type ObjectPosition<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength>; + + export type OffsetAnchor<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | "auto"; + + export type OffsetPosition<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | "auto" | "normal"; + + export type Opacity = Globals | (string & {}) | (number & {}); + + export type Order = Globals | (number & {}) | (string & {}); + + export type Orphans = Globals | (number & {}) | (string & {}); + + export type Outline<TLength = (string & {}) | 0> = Globals | DataType.Color | DataType.LineStyle | DataType.LineWidth<TLength> | "auto" | "invert" | (string & {}); + + export type OutlineColor = Globals | DataType.Color | "invert"; + + export type OutlineOffset<TLength = (string & {}) | 0> = Globals | TLength; + + export type OutlineStyle = Globals | DataType.LineStyle | "auto" | (string & {}); + + export type OutlineWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength>; + + export type Overflow = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible" | (string & {}); + + export type OverflowAnchor = Globals | "auto" | "none"; + + export type OverflowBlock = Globals | "auto" | "clip" | "hidden" | "scroll" | "visible"; + + export type OverflowClipBox = Globals | "content-box" | "padding-box"; + + export type OverflowClipMargin<TLength = (string & {}) | 0> = Globals | DataType.VisualBox | TLength | (string & {}); + + export type OverflowInline = Globals | "auto" | "clip" | "hidden" | "scroll" | "visible"; + + export type OverflowWrap = Globals | "anywhere" | "break-word" | "normal"; + + export type OverflowX = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible"; + + export type OverflowY = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible"; + + export type Overlay = Globals | "auto" | "none"; + + export type OverscrollBehavior = Globals | "auto" | "contain" | "none" | (string & {}); + + export type OverscrollBehaviorBlock = Globals | "auto" | "contain" | "none"; + + export type OverscrollBehaviorInline = Globals | "auto" | "contain" | "none"; + + export type OverscrollBehaviorX = Globals | "auto" | "contain" | "none"; + + export type OverscrollBehaviorY = Globals | "auto" | "contain" | "none"; + + export type Padding<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingBlock<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingBlockEnd<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingBlockStart<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingBottom<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingInline<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingInlineEnd<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingInlineStart<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingLeft<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingRight<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type PaddingTop<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type Page = Globals | "auto" | (string & {}); + + export type PageBreakAfter = Globals | "always" | "auto" | "avoid" | "left" | "recto" | "right" | "verso"; + + export type PageBreakBefore = Globals | "always" | "auto" | "avoid" | "left" | "recto" | "right" | "verso"; + + export type PageBreakInside = Globals | "auto" | "avoid"; + + export type PaintOrder = Globals | "fill" | "markers" | "normal" | "stroke" | (string & {}); + + export type Perspective<TLength = (string & {}) | 0> = Globals | TLength | "none"; + + export type PerspectiveOrigin<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength>; + + export type PlaceContent = Globals | DataType.ContentDistribution | DataType.ContentPosition | "baseline" | "normal" | (string & {}); + + export type PlaceItems = Globals | DataType.SelfPosition | "baseline" | "normal" | "stretch" | (string & {}); + + export type PlaceSelf = Globals | DataType.SelfPosition | "auto" | "baseline" | "normal" | "stretch" | (string & {}); + + export type PointerEvents = Globals | "all" | "auto" | "fill" | "inherit" | "none" | "painted" | "stroke" | "visible" | "visibleFill" | "visiblePainted" | "visibleStroke"; + + export type Position = Globals | "-webkit-sticky" | "absolute" | "fixed" | "relative" | "static" | "sticky"; + + export type Quotes = Globals | "auto" | "none" | (string & {}); + + export type Resize = Globals | "block" | "both" | "horizontal" | "inline" | "none" | "vertical"; + + export type Right<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type Rotate = Globals | "none" | (string & {}); + + export type RowGap<TLength = (string & {}) | 0> = Globals | TLength | "normal" | (string & {}); + + export type RubyAlign = Globals | "center" | "space-around" | "space-between" | "start"; + + export type RubyMerge = Globals | "auto" | "collapse" | "separate"; + + export type RubyPosition = Globals | "alternate" | "inter-character" | "over" | "under" | (string & {}); + + export type Scale = Globals | "none" | (string & {}) | (number & {}); + + export type ScrollBehavior = Globals | "auto" | "smooth"; + + export type ScrollMargin<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type ScrollMarginBlock<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type ScrollMarginBlockEnd<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginBlockStart<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginBottom<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginInline<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type ScrollMarginInlineEnd<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginInlineStart<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginLeft<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginRight<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollMarginTop<TLength = (string & {}) | 0> = Globals | TLength; + + export type ScrollPadding<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingBlock<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingBlockEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingBlockStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingBottom<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingInline<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingInlineEnd<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingInlineStart<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingLeft<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingRight<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollPaddingTop<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ScrollSnapAlign = Globals | "center" | "end" | "none" | "start" | (string & {}); + + export type ScrollSnapCoordinate<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | "none" | (string & {}); + + export type ScrollSnapDestination<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength>; + + export type ScrollSnapPointsX = Globals | "none" | (string & {}); + + export type ScrollSnapPointsY = Globals | "none" | (string & {}); + + export type ScrollSnapStop = Globals | "always" | "normal"; + + export type ScrollSnapType = Globals | "block" | "both" | "inline" | "none" | "x" | "y" | (string & {}); + + export type ScrollSnapTypeX = Globals | "mandatory" | "none" | "proximity"; + + export type ScrollSnapTypeY = Globals | "mandatory" | "none" | "proximity"; + + export type ScrollTimeline = Globals | "none" | (string & {}); + + export type ScrollTimelineAxis = Globals | "block" | "inline" | "x" | "y" | (string & {}); + + export type ScrollTimelineName = Globals | "none" | (string & {}); + + export type ScrollbarColor = Globals | "auto" | (string & {}); + + export type ScrollbarGutter = Globals | "auto" | "stable" | (string & {}); + + export type ScrollbarWidth = Globals | "auto" | "none" | "thin"; + + export type ShapeImageThreshold = Globals | (string & {}) | (number & {}); + + export type ShapeMargin<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type ShapeOutside = Globals | DataType.Box | "margin-box" | "none" | (string & {}); + + export type TabSize<TLength = (string & {}) | 0> = Globals | TLength | (number & {}) | (string & {}); + + export type TableLayout = Globals | "auto" | "fixed"; + + export type TextAlign = Globals | "-webkit-match-parent" | "center" | "end" | "justify" | "left" | "match-parent" | "right" | "start"; + + export type TextAlignLast = Globals | "auto" | "center" | "end" | "justify" | "left" | "right" | "start"; + + export type TextCombineUpright = Globals | "all" | "none" | (string & {}); + + export type TextDecoration<TLength = (string & {}) | 0> = + | Globals + | DataType.Color + | TLength + | "auto" + | "blink" + | "dashed" + | "dotted" + | "double" + | "from-font" + | "grammar-error" + | "line-through" + | "none" + | "overline" + | "solid" + | "spelling-error" + | "underline" + | "wavy" + | (string & {}); + + export type TextDecorationColor = Globals | DataType.Color; + + export type TextDecorationLine = Globals | "blink" | "grammar-error" | "line-through" | "none" | "overline" | "spelling-error" | "underline" | (string & {}); + + export type TextDecorationSkip = Globals | "box-decoration" | "edges" | "leading-spaces" | "none" | "objects" | "spaces" | "trailing-spaces" | (string & {}); + + export type TextDecorationSkipInk = Globals | "all" | "auto" | "none"; + + export type TextDecorationStyle = Globals | "dashed" | "dotted" | "double" | "solid" | "wavy"; + + export type TextDecorationThickness<TLength = (string & {}) | 0> = Globals | TLength | "auto" | "from-font" | (string & {}); + + export type TextEmphasis = Globals | DataType.Color | "circle" | "dot" | "double-circle" | "filled" | "none" | "open" | "sesame" | "triangle" | (string & {}); + + export type TextEmphasisColor = Globals | DataType.Color; + + export type TextEmphasisPosition = Globals | (string & {}); + + export type TextEmphasisStyle = Globals | "circle" | "dot" | "double-circle" | "filled" | "none" | "open" | "sesame" | "triangle" | (string & {}); + + export type TextIndent<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type TextJustify = Globals | "auto" | "inter-character" | "inter-word" | "none"; + + export type TextOrientation = Globals | "mixed" | "sideways" | "upright"; + + export type TextOverflow = Globals | "clip" | "ellipsis" | (string & {}); + + export type TextRendering = Globals | "auto" | "geometricPrecision" | "optimizeLegibility" | "optimizeSpeed"; + + export type TextShadow = Globals | "none" | (string & {}); + + export type TextSizeAdjust = Globals | "auto" | "none" | (string & {}); + + export type TextTransform = Globals | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "none" | "uppercase"; + + export type TextUnderlineOffset<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type TextUnderlinePosition = Globals | "auto" | "from-font" | "left" | "right" | "under" | (string & {}); + + export type TextWrap = Globals | "balance" | "nowrap" | "pretty" | "stable" | "wrap"; + + export type TimelineScope = Globals | "none" | (string & {}); + + export type Top<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type TouchAction = + | Globals + | "-ms-manipulation" + | "-ms-none" + | "-ms-pinch-zoom" + | "auto" + | "manipulation" + | "none" + | "pan-down" + | "pan-left" + | "pan-right" + | "pan-up" + | "pan-x" + | "pan-y" + | "pinch-zoom" + | (string & {}); + + export type Transform = Globals | "none" | (string & {}); + + export type TransformBox = Globals | "border-box" | "content-box" | "fill-box" | "stroke-box" | "view-box"; + + export type TransformOrigin<TLength = (string & {}) | 0> = Globals | TLength | "bottom" | "center" | "left" | "right" | "top" | (string & {}); + + export type TransformStyle = Globals | "flat" | "preserve-3d"; + + export type Transition<TTime = string & {}> = Globals | DataType.SingleTransition<TTime> | (string & {}); + + export type TransitionBehavior = Globals | "allow-discrete" | "normal" | (string & {}); + + export type TransitionDelay<TTime = string & {}> = Globals | TTime | (string & {}); + + export type TransitionDuration<TTime = string & {}> = Globals | TTime | (string & {}); + + export type TransitionProperty = Globals | "all" | "none" | (string & {}); + + export type TransitionTimingFunction = Globals | DataType.EasingFunction | (string & {}); + + export type Translate<TLength = (string & {}) | 0> = Globals | TLength | "none" | (string & {}); + + export type UnicodeBidi = + | Globals + | "-moz-isolate" + | "-moz-isolate-override" + | "-moz-plaintext" + | "-webkit-isolate" + | "-webkit-isolate-override" + | "-webkit-plaintext" + | "bidi-override" + | "embed" + | "isolate" + | "isolate-override" + | "normal" + | "plaintext"; + + export type UserSelect = Globals | "-moz-none" | "all" | "auto" | "contain" | "element" | "none" | "text"; + + export type VerticalAlign<TLength = (string & {}) | 0> = + | Globals + | TLength + | "baseline" + | "bottom" + | "middle" + | "sub" + | "super" + | "text-bottom" + | "text-top" + | "top" + | (string & {}); + + export type ViewTimeline = Globals | "none" | (string & {}); + + export type ViewTimelineAxis = Globals | "block" | "inline" | "x" | "y" | (string & {}); + + export type ViewTimelineInset<TLength = (string & {}) | 0> = Globals | TLength | "auto" | (string & {}); + + export type ViewTimelineName = Globals | "none" | (string & {}); + + export type ViewTransitionName = Globals | "none" | (string & {}); + + export type Visibility = Globals | "collapse" | "hidden" | "visible"; + + export type WhiteSpace = + | Globals + | "-moz-pre-wrap" + | "balance" + | "break-spaces" + | "collapse" + | "discard" + | "discard-after" + | "discard-before" + | "discard-inner" + | "none" + | "normal" + | "nowrap" + | "pre" + | "pre-line" + | "pre-wrap" + | "preserve" + | "preserve-breaks" + | "preserve-spaces" + | "pretty" + | "stable" + | "wrap" + | (string & {}); + + export type WhiteSpaceCollapse = Globals | "break-spaces" | "collapse" | "discard" | "preserve" | "preserve-breaks" | "preserve-spaces"; + + export type WhiteSpaceTrim = Globals | "discard-after" | "discard-before" | "discard-inner" | "none" | (string & {}); + + export type Widows = Globals | (number & {}) | (string & {}); + + export type Width<TLength = (string & {}) | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "min-intrinsic" + | (string & {}); + + export type WillChange = Globals | DataType.AnimateableFeature | "auto" | (string & {}); + + export type WordBreak = Globals | "break-all" | "break-word" | "keep-all" | "normal"; + + export type WordSpacing<TLength = (string & {}) | 0> = Globals | TLength | "normal"; + + export type WordWrap = Globals | "break-word" | "normal"; + + export type WritingMode = Globals | "horizontal-tb" | "sideways-lr" | "sideways-rl" | "vertical-lr" | "vertical-rl"; + + export type ZIndex = Globals | "auto" | (number & {}) | (string & {}); + + export type Zoom = Globals | "normal" | "reset" | (string & {}) | (number & {}); + + export type MozAppearance = + | Globals + | "-moz-mac-unified-toolbar" + | "-moz-win-borderless-glass" + | "-moz-win-browsertabbar-toolbox" + | "-moz-win-communications-toolbox" + | "-moz-win-communicationstext" + | "-moz-win-exclude-glass" + | "-moz-win-glass" + | "-moz-win-media-toolbox" + | "-moz-win-mediatext" + | "-moz-window-button-box" + | "-moz-window-button-box-maximized" + | "-moz-window-button-close" + | "-moz-window-button-maximize" + | "-moz-window-button-minimize" + | "-moz-window-button-restore" + | "-moz-window-frame-bottom" + | "-moz-window-frame-left" + | "-moz-window-frame-right" + | "-moz-window-titlebar" + | "-moz-window-titlebar-maximized" + | "button" + | "button-arrow-down" + | "button-arrow-next" + | "button-arrow-previous" + | "button-arrow-up" + | "button-bevel" + | "button-focus" + | "caret" + | "checkbox" + | "checkbox-container" + | "checkbox-label" + | "checkmenuitem" + | "dualbutton" + | "groupbox" + | "listbox" + | "listitem" + | "menuarrow" + | "menubar" + | "menucheckbox" + | "menuimage" + | "menuitem" + | "menuitemtext" + | "menulist" + | "menulist-button" + | "menulist-text" + | "menulist-textfield" + | "menupopup" + | "menuradio" + | "menuseparator" + | "meterbar" + | "meterchunk" + | "none" + | "progressbar" + | "progressbar-vertical" + | "progresschunk" + | "progresschunk-vertical" + | "radio" + | "radio-container" + | "radio-label" + | "radiomenuitem" + | "range" + | "range-thumb" + | "resizer" + | "resizerpanel" + | "scale-horizontal" + | "scale-vertical" + | "scalethumb-horizontal" + | "scalethumb-vertical" + | "scalethumbend" + | "scalethumbstart" + | "scalethumbtick" + | "scrollbarbutton-down" + | "scrollbarbutton-left" + | "scrollbarbutton-right" + | "scrollbarbutton-up" + | "scrollbarthumb-horizontal" + | "scrollbarthumb-vertical" + | "scrollbartrack-horizontal" + | "scrollbartrack-vertical" + | "searchfield" + | "separator" + | "sheet" + | "spinner" + | "spinner-downbutton" + | "spinner-textfield" + | "spinner-upbutton" + | "splitter" + | "statusbar" + | "statusbarpanel" + | "tab" + | "tab-scroll-arrow-back" + | "tab-scroll-arrow-forward" + | "tabpanel" + | "tabpanels" + | "textfield" + | "textfield-multiline" + | "toolbar" + | "toolbarbutton" + | "toolbarbutton-dropdown" + | "toolbargripper" + | "toolbox" + | "tooltip" + | "treeheader" + | "treeheadercell" + | "treeheadersortarrow" + | "treeitem" + | "treeline" + | "treetwisty" + | "treetwistyopen" + | "treeview"; + + export type MozBinding = Globals | "none" | (string & {}); + + export type MozBorderBottomColors = Globals | DataType.Color | "none" | (string & {}); + + export type MozBorderLeftColors = Globals | DataType.Color | "none" | (string & {}); + + export type MozBorderRightColors = Globals | DataType.Color | "none" | (string & {}); + + export type MozBorderTopColors = Globals | DataType.Color | "none" | (string & {}); + + export type MozContextProperties = Globals | "fill" | "fill-opacity" | "none" | "stroke" | "stroke-opacity" | (string & {}); + + export type MozFloatEdge = Globals | "border-box" | "content-box" | "margin-box" | "padding-box"; + + export type MozForceBrokenImageIcon = Globals | 0 | (string & {}) | 1; + + export type MozImageRegion = Globals | "auto" | (string & {}); + + export type MozOrient = Globals | "block" | "horizontal" | "inline" | "vertical"; + + export type MozOutlineRadius<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MozOutlineRadiusBottomleft<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MozOutlineRadiusBottomright<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MozOutlineRadiusTopleft<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MozOutlineRadiusTopright<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MozStackSizing = Globals | "ignore" | "stretch-to-fit"; + + export type MozTextBlink = Globals | "blink" | "none"; + + export type MozUserFocus = Globals | "ignore" | "none" | "normal" | "select-after" | "select-all" | "select-before" | "select-menu" | "select-same"; + + export type MozUserInput = Globals | "auto" | "disabled" | "enabled" | "none"; + + export type MozUserModify = Globals | "read-only" | "read-write" | "write-only"; + + export type MozWindowDragging = Globals | "drag" | "no-drag"; + + export type MozWindowShadow = Globals | "default" | "menu" | "none" | "sheet" | "tooltip"; + + export type MsAccelerator = Globals | "false" | "true"; + + export type MsBlockProgression = Globals | "bt" | "lr" | "rl" | "tb"; + + export type MsContentZoomChaining = Globals | "chained" | "none"; + + export type MsContentZoomLimit = Globals | (string & {}); + + export type MsContentZoomLimitMax = Globals | (string & {}); + + export type MsContentZoomLimitMin = Globals | (string & {}); + + export type MsContentZoomSnap = Globals | "mandatory" | "none" | "proximity" | (string & {}); + + export type MsContentZoomSnapPoints = Globals | (string & {}); + + export type MsContentZoomSnapType = Globals | "mandatory" | "none" | "proximity"; + + export type MsContentZooming = Globals | "none" | "zoom"; + + export type MsFilter = Globals | (string & {}); + + export type MsFlowFrom = Globals | "none" | (string & {}); + + export type MsFlowInto = Globals | "none" | (string & {}); + + export type MsGridColumns<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | "none" | (string & {}); + + export type MsGridRows<TLength = (string & {}) | 0> = Globals | DataType.TrackBreadth<TLength> | "none" | (string & {}); + + export type MsHighContrastAdjust = Globals | "auto" | "none"; + + export type MsHyphenateLimitChars = Globals | "auto" | (string & {}) | (number & {}); + + export type MsHyphenateLimitLines = Globals | "no-limit" | (number & {}) | (string & {}); + + export type MsHyphenateLimitZone<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type MsImeAlign = Globals | "after" | "auto"; + + export type MsOverflowStyle = Globals | "-ms-autohiding-scrollbar" | "auto" | "none" | "scrollbar"; + + export type MsScrollChaining = Globals | "chained" | "none"; + + export type MsScrollLimit = Globals | (string & {}); + + export type MsScrollLimitXMax<TLength = (string & {}) | 0> = Globals | TLength | "auto"; + + export type MsScrollLimitXMin<TLength = (string & {}) | 0> = Globals | TLength; + + export type MsScrollLimitYMax<TLength = (string & {}) | 0> = Globals | TLength | "auto"; + + export type MsScrollLimitYMin<TLength = (string & {}) | 0> = Globals | TLength; + + export type MsScrollRails = Globals | "none" | "railed"; + + export type MsScrollSnapPointsX = Globals | (string & {}); + + export type MsScrollSnapPointsY = Globals | (string & {}); + + export type MsScrollSnapType = Globals | "mandatory" | "none" | "proximity"; + + export type MsScrollSnapX = Globals | (string & {}); + + export type MsScrollSnapY = Globals | (string & {}); + + export type MsScrollTranslation = Globals | "none" | "vertical-to-horizontal"; + + export type MsScrollbar3dlightColor = Globals | DataType.Color; + + export type MsScrollbarArrowColor = Globals | DataType.Color; + + export type MsScrollbarBaseColor = Globals | DataType.Color; + + export type MsScrollbarDarkshadowColor = Globals | DataType.Color; + + export type MsScrollbarFaceColor = Globals | DataType.Color; + + export type MsScrollbarHighlightColor = Globals | DataType.Color; + + export type MsScrollbarShadowColor = Globals | DataType.Color; + + export type MsScrollbarTrackColor = Globals | DataType.Color; + + export type MsTextAutospace = Globals | "ideograph-alpha" | "ideograph-numeric" | "ideograph-parenthesis" | "ideograph-space" | "none"; + + export type MsTouchSelect = Globals | "grippers" | "none"; + + export type MsUserSelect = Globals | "element" | "none" | "text"; + + export type MsWrapFlow = Globals | "auto" | "both" | "clear" | "end" | "maximum" | "start"; + + export type MsWrapMargin<TLength = (string & {}) | 0> = Globals | TLength; + + export type MsWrapThrough = Globals | "none" | "wrap"; + + export type WebkitAppearance = + | Globals + | "-apple-pay-button" + | "button" + | "button-bevel" + | "caret" + | "checkbox" + | "default-button" + | "inner-spin-button" + | "listbox" + | "listitem" + | "media-controls-background" + | "media-controls-fullscreen-background" + | "media-current-time-display" + | "media-enter-fullscreen-button" + | "media-exit-fullscreen-button" + | "media-fullscreen-button" + | "media-mute-button" + | "media-overlay-play-button" + | "media-play-button" + | "media-seek-back-button" + | "media-seek-forward-button" + | "media-slider" + | "media-sliderthumb" + | "media-time-remaining-display" + | "media-toggle-closed-captions-button" + | "media-volume-slider" + | "media-volume-slider-container" + | "media-volume-sliderthumb" + | "menulist" + | "menulist-button" + | "menulist-text" + | "menulist-textfield" + | "meter" + | "none" + | "progress-bar" + | "progress-bar-value" + | "push-button" + | "radio" + | "searchfield" + | "searchfield-cancel-button" + | "searchfield-decoration" + | "searchfield-results-button" + | "searchfield-results-decoration" + | "slider-horizontal" + | "slider-vertical" + | "sliderthumb-horizontal" + | "sliderthumb-vertical" + | "square-button" + | "textarea" + | "textfield"; + + export type WebkitBorderBefore<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | DataType.LineStyle | DataType.Color | (string & {}); + + export type WebkitBorderBeforeColor = Globals | DataType.Color; + + export type WebkitBorderBeforeStyle = Globals | DataType.LineStyle | (string & {}); + + export type WebkitBorderBeforeWidth<TLength = (string & {}) | 0> = Globals | DataType.LineWidth<TLength> | (string & {}); + + export type WebkitBoxReflect<TLength = (string & {}) | 0> = Globals | TLength | "above" | "below" | "left" | "right" | (string & {}); + + export type WebkitLineClamp = Globals | "none" | (number & {}) | (string & {}); + + export type WebkitMask<TLength = (string & {}) | 0> = + | Globals + | DataType.Position<TLength> + | DataType.RepeatStyle + | DataType.Box + | "border" + | "content" + | "none" + | "padding" + | "text" + | (string & {}); + + export type WebkitMaskAttachment = Globals | DataType.Attachment | (string & {}); + + export type WebkitMaskClip = Globals | DataType.Box | "border" | "content" | "padding" | "text" | (string & {}); + + export type WebkitMaskComposite = Globals | DataType.CompositeStyle | (string & {}); + + export type WebkitMaskImage = Globals | "none" | (string & {}); + + export type WebkitMaskOrigin = Globals | DataType.Box | "border" | "content" | "padding" | (string & {}); + + export type WebkitMaskPosition<TLength = (string & {}) | 0> = Globals | DataType.Position<TLength> | (string & {}); + + export type WebkitMaskPositionX<TLength = (string & {}) | 0> = Globals | TLength | "center" | "left" | "right" | (string & {}); + + export type WebkitMaskPositionY<TLength = (string & {}) | 0> = Globals | TLength | "bottom" | "center" | "top" | (string & {}); + + export type WebkitMaskRepeat = Globals | DataType.RepeatStyle | (string & {}); + + export type WebkitMaskRepeatX = Globals | "no-repeat" | "repeat" | "round" | "space"; + + export type WebkitMaskRepeatY = Globals | "no-repeat" | "repeat" | "round" | "space"; + + export type WebkitMaskSize<TLength = (string & {}) | 0> = Globals | DataType.BgSize<TLength> | (string & {}); + + export type WebkitOverflowScrolling = Globals | "auto" | "touch"; + + export type WebkitTapHighlightColor = Globals | DataType.Color; + + export type WebkitTextFillColor = Globals | DataType.Color; + + export type WebkitTextStroke<TLength = (string & {}) | 0> = Globals | DataType.Color | TLength | (string & {}); + + export type WebkitTextStrokeColor = Globals | DataType.Color; + + export type WebkitTextStrokeWidth<TLength = (string & {}) | 0> = Globals | TLength; + + export type WebkitTouchCallout = Globals | "default" | "none"; + + export type WebkitUserModify = Globals | "read-only" | "read-write" | "read-write-plaintext-only"; + + export type AlignmentBaseline = + | Globals + | "after-edge" + | "alphabetic" + | "auto" + | "baseline" + | "before-edge" + | "central" + | "hanging" + | "ideographic" + | "mathematical" + | "middle" + | "text-after-edge" + | "text-before-edge"; + + export type BaselineShift<TLength = (string & {}) | 0> = Globals | TLength | "baseline" | "sub" | "super" | (string & {}); + + export type ClipRule = Globals | "evenodd" | "nonzero"; + + export type ColorInterpolation = Globals | "auto" | "linearRGB" | "sRGB"; + + export type ColorRendering = Globals | "auto" | "optimizeQuality" | "optimizeSpeed"; + + export type DominantBaseline = + | Globals + | "alphabetic" + | "auto" + | "central" + | "hanging" + | "ideographic" + | "mathematical" + | "middle" + | "no-change" + | "reset-size" + | "text-after-edge" + | "text-before-edge" + | "use-script"; + + export type Fill = Globals | DataType.Paint; + + export type FillOpacity = Globals | (number & {}) | (string & {}); + + export type FillRule = Globals | "evenodd" | "nonzero"; + + export type FloodColor = Globals | DataType.Color | "currentColor"; + + export type FloodOpacity = Globals | (number & {}) | (string & {}); + + export type GlyphOrientationVertical = Globals | "auto" | (string & {}) | (number & {}); + + export type LightingColor = Globals | DataType.Color | "currentColor"; + + export type Marker = Globals | "none" | (string & {}); + + export type MarkerEnd = Globals | "none" | (string & {}); + + export type MarkerMid = Globals | "none" | (string & {}); + + export type MarkerStart = Globals | "none" | (string & {}); + + export type ShapeRendering = Globals | "auto" | "crispEdges" | "geometricPrecision" | "optimizeSpeed"; + + export type StopColor = Globals | DataType.Color | "currentColor"; + + export type StopOpacity = Globals | (number & {}) | (string & {}); + + export type Stroke = Globals | DataType.Paint; + + export type StrokeDasharray<TLength = (string & {}) | 0> = Globals | DataType.Dasharray<TLength> | "none"; + + export type StrokeDashoffset<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type StrokeLinecap = Globals | "butt" | "round" | "square"; + + export type StrokeLinejoin = Globals | "bevel" | "miter" | "round"; + + export type StrokeMiterlimit = Globals | (number & {}) | (string & {}); + + export type StrokeOpacity = Globals | (number & {}) | (string & {}); + + export type StrokeWidth<TLength = (string & {}) | 0> = Globals | TLength | (string & {}); + + export type TextAnchor = Globals | "end" | "middle" | "start"; + + export type VectorEffect = Globals | "non-scaling-stroke" | "none"; +} + +export namespace AtRule { + export interface CounterStyle<TLength = (string & {}) | 0, TTime = string & {}> { + additiveSymbols?: string | undefined; + fallback?: string | undefined; + negative?: string | undefined; + pad?: string | undefined; + prefix?: string | undefined; + range?: Range | undefined; + speakAs?: SpeakAs | undefined; + suffix?: string | undefined; + symbols?: string | undefined; + system?: System | undefined; + } + + export interface CounterStyleHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + "additive-symbols"?: string | undefined; + fallback?: string | undefined; + negative?: string | undefined; + pad?: string | undefined; + prefix?: string | undefined; + range?: Range | undefined; + "speak-as"?: SpeakAs | undefined; + suffix?: string | undefined; + symbols?: string | undefined; + system?: System | undefined; + } + + export type CounterStyleFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<CounterStyle<TLength, TTime>>; + + export type CounterStyleHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<CounterStyleHyphen<TLength, TTime>>; + + export interface FontFace<TLength = (string & {}) | 0, TTime = string & {}> { + MozFontFeatureSettings?: FontFeatureSettings | undefined; + ascentOverride?: AscentOverride | undefined; + descentOverride?: DescentOverride | undefined; + fontDisplay?: FontDisplay | undefined; + fontFamily?: string | undefined; + fontFeatureSettings?: FontFeatureSettings | undefined; + fontStretch?: FontStretch | undefined; + fontStyle?: FontStyle | undefined; + fontVariant?: FontVariant | undefined; + fontVariationSettings?: FontVariationSettings | undefined; + fontWeight?: FontWeight | undefined; + lineGapOverride?: LineGapOverride | undefined; + sizeAdjust?: string | undefined; + src?: string | undefined; + unicodeRange?: string | undefined; + } + + export interface FontFaceHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + "-moz-font-feature-settings"?: FontFeatureSettings | undefined; + "ascent-override"?: AscentOverride | undefined; + "descent-override"?: DescentOverride | undefined; + "font-display"?: FontDisplay | undefined; + "font-family"?: string | undefined; + "font-feature-settings"?: FontFeatureSettings | undefined; + "font-stretch"?: FontStretch | undefined; + "font-style"?: FontStyle | undefined; + "font-variant"?: FontVariant | undefined; + "font-variation-settings"?: FontVariationSettings | undefined; + "font-weight"?: FontWeight | undefined; + "line-gap-override"?: LineGapOverride | undefined; + "size-adjust"?: string | undefined; + src?: string | undefined; + "unicode-range"?: string | undefined; + } + + export type FontFaceFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<FontFace<TLength, TTime>>; + + export type FontFaceHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<FontFaceHyphen<TLength, TTime>>; + + export interface FontPaletteValues<TLength = (string & {}) | 0, TTime = string & {}> { + basePalette?: BasePalette | undefined; + fontFamily?: string | undefined; + overrideColors?: string | undefined; + } + + export interface FontPaletteValuesHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + "base-palette"?: BasePalette | undefined; + "font-family"?: string | undefined; + "override-colors"?: string | undefined; + } + + export type FontPaletteValuesFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<FontPaletteValues<TLength, TTime>>; + + export type FontPaletteValuesHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<FontPaletteValuesHyphen<TLength, TTime>>; + + export interface Page<TLength = (string & {}) | 0, TTime = string & {}> { + bleed?: Bleed<TLength> | undefined; + marks?: Marks | undefined; + pageOrientation?: PageOrientation | undefined; + size?: Size<TLength> | undefined; + } + + export interface PageHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + bleed?: Bleed<TLength> | undefined; + marks?: Marks | undefined; + "page-orientation"?: PageOrientation | undefined; + size?: Size<TLength> | undefined; + } + + export type PageFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<Page<TLength, TTime>>; + + export type PageHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<PageHyphen<TLength, TTime>>; + + export interface Property<TLength = (string & {}) | 0, TTime = string & {}> { + inherits?: Inherits | undefined; + initialValue?: string | undefined; + syntax?: string | undefined; + } + + export interface PropertyHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + inherits?: Inherits | undefined; + "initial-value"?: string | undefined; + syntax?: string | undefined; + } + + export type PropertyFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<Property<TLength, TTime>>; + + export type PropertyHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<PropertyHyphen<TLength, TTime>>; + + export interface Viewport<TLength = (string & {}) | 0, TTime = string & {}> { + height?: Height<TLength> | undefined; + maxHeight?: MaxHeight<TLength> | undefined; + maxWidth?: MaxWidth<TLength> | undefined; + maxZoom?: MaxZoom | undefined; + minHeight?: MinHeight<TLength> | undefined; + minWidth?: MinWidth<TLength> | undefined; + minZoom?: MinZoom | undefined; + orientation?: Orientation | undefined; + userZoom?: UserZoom | undefined; + viewportFit?: ViewportFit | undefined; + width?: Width<TLength> | undefined; + zoom?: Zoom | undefined; + } + + export interface ViewportHyphen<TLength = (string & {}) | 0, TTime = string & {}> { + height?: Height<TLength> | undefined; + "max-height"?: MaxHeight<TLength> | undefined; + "max-width"?: MaxWidth<TLength> | undefined; + "max-zoom"?: MaxZoom | undefined; + "min-height"?: MinHeight<TLength> | undefined; + "min-width"?: MinWidth<TLength> | undefined; + "min-zoom"?: MinZoom | undefined; + orientation?: Orientation | undefined; + "user-zoom"?: UserZoom | undefined; + "viewport-fit"?: ViewportFit | undefined; + width?: Width<TLength> | undefined; + zoom?: Zoom | undefined; + } + + export type ViewportFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<Viewport<TLength, TTime>>; + + export type ViewportHyphenFallback<TLength = (string & {}) | 0, TTime = string & {}> = Fallback<ViewportHyphen<TLength, TTime>>; + + type Range = "auto" | (string & {}); + + type SpeakAs = "auto" | "bullets" | "numbers" | "spell-out" | "words" | (string & {}); + + type System = "additive" | "alphabetic" | "cyclic" | "fixed" | "numeric" | "symbolic" | (string & {}); + + type FontFeatureSettings = "normal" | (string & {}); + + type AscentOverride = "normal" | (string & {}); + + type DescentOverride = "normal" | (string & {}); + + type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; + + type FontStretch = DataType.FontStretchAbsolute | (string & {}); + + type FontStyle = "italic" | "normal" | "oblique" | (string & {}); + + type FontVariant = + | DataType.EastAsianVariantValues + | "all-petite-caps" + | "all-small-caps" + | "common-ligatures" + | "contextual" + | "diagonal-fractions" + | "discretionary-ligatures" + | "full-width" + | "historical-forms" + | "historical-ligatures" + | "lining-nums" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "petite-caps" + | "proportional-nums" + | "proportional-width" + | "ruby" + | "slashed-zero" + | "small-caps" + | "stacked-fractions" + | "tabular-nums" + | "titling-caps" + | "unicase" + | (string & {}); + + type FontVariationSettings = "normal" | (string & {}); + + type FontWeight = DataType.FontWeightAbsolute | (string & {}); + + type LineGapOverride = "normal" | (string & {}); + + type BasePalette = "dark" | "light" | (number & {}) | (string & {}); + + type Bleed<TLength> = TLength | "auto"; + + type Marks = "crop" | "cross" | "none" | (string & {}); + + type PageOrientation = "rotate-left" | "rotate-right" | "upright"; + + type Size<TLength> = DataType.PageSize | TLength | "auto" | "landscape" | "portrait" | (string & {}); + + type Inherits = "false" | "true"; + + type Height<TLength> = DataType.ViewportLength<TLength> | (string & {}); + + type MaxHeight<TLength> = DataType.ViewportLength<TLength>; + + type MaxWidth<TLength> = DataType.ViewportLength<TLength>; + + type MaxZoom = "auto" | (string & {}) | (number & {}); + + type MinHeight<TLength> = DataType.ViewportLength<TLength>; + + type MinWidth<TLength> = DataType.ViewportLength<TLength>; + + type MinZoom = "auto" | (string & {}) | (number & {}); + + type Orientation = "auto" | "landscape" | "portrait"; + + type UserZoom = "fixed" | "zoom"; + + type ViewportFit = "auto" | "contain" | "cover"; + + type Width<TLength> = DataType.ViewportLength<TLength> | (string & {}); + + type Zoom = "auto" | (string & {}) | (number & {}); +} + +/** + * **Attention!** Data types receives its name from the spec. E.g. `<color>` becomes `DataType.Color` and + * `<content-distribution>` becomes `DataType.ContentDistribution`. It happens quite frequent that these data types + * are split into several data types or/and name changes as the spec develops. So there's a risk that a minor/patch + * update from `csstype` can break your typing if you're using the `DataType` namespace. + */ +export namespace DataType { + type AbsoluteSize = "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large"; + + type AnimateableFeature = "contents" | "scroll-position" | (string & {}); + + type Attachment = "fixed" | "local" | "scroll"; + + type BgPosition<TLength> = TLength | "bottom" | "center" | "left" | "right" | "top" | (string & {}); + + type BgSize<TLength> = TLength | "auto" | "contain" | "cover" | (string & {}); + + type BlendMode = + | "color" + | "color-burn" + | "color-dodge" + | "darken" + | "difference" + | "exclusion" + | "hard-light" + | "hue" + | "lighten" + | "luminosity" + | "multiply" + | "normal" + | "overlay" + | "saturation" + | "screen" + | "soft-light"; + + type Box = "border-box" | "content-box" | "padding-box"; + + type Color = NamedColor | DeprecatedSystemColor | "currentcolor" | (string & {}); + + type CompatAuto = + | "button" + | "checkbox" + | "listbox" + | "menulist" + | "meter" + | "progress-bar" + | "push-button" + | "radio" + | "searchfield" + | "slider-horizontal" + | "square-button" + | "textarea"; + + type CompositeStyle = + | "clear" + | "copy" + | "destination-atop" + | "destination-in" + | "destination-out" + | "destination-over" + | "source-atop" + | "source-in" + | "source-out" + | "source-over" + | "xor"; + + type CompositingOperator = "add" | "exclude" | "intersect" | "subtract"; + + type ContentDistribution = "space-around" | "space-between" | "space-evenly" | "stretch"; + + type ContentList = Quote | "contents" | (string & {}); + + type ContentPosition = "center" | "end" | "flex-end" | "flex-start" | "start"; + + type CubicBezierTimingFunction = "ease" | "ease-in" | "ease-in-out" | "ease-out" | (string & {}); + + type Dasharray<TLength> = TLength | (string & {}) | (number & {}); + + type DeprecatedSystemColor = + | "ActiveBorder" + | "ActiveCaption" + | "AppWorkspace" + | "Background" + | "ButtonFace" + | "ButtonHighlight" + | "ButtonShadow" + | "ButtonText" + | "CaptionText" + | "GrayText" + | "Highlight" + | "HighlightText" + | "InactiveBorder" + | "InactiveCaption" + | "InactiveCaptionText" + | "InfoBackground" + | "InfoText" + | "Menu" + | "MenuText" + | "Scrollbar" + | "ThreeDDarkShadow" + | "ThreeDFace" + | "ThreeDHighlight" + | "ThreeDLightShadow" + | "ThreeDShadow" + | "Window" + | "WindowFrame" + | "WindowText"; + + type DisplayInside = "-ms-flexbox" | "-ms-grid" | "-webkit-flex" | "flex" | "flow" | "flow-root" | "grid" | "ruby" | "table"; + + type DisplayInternal = + | "ruby-base" + | "ruby-base-container" + | "ruby-text" + | "ruby-text-container" + | "table-caption" + | "table-cell" + | "table-column" + | "table-column-group" + | "table-footer-group" + | "table-header-group" + | "table-row" + | "table-row-group"; + + type DisplayLegacy = "-ms-inline-flexbox" | "-ms-inline-grid" | "-webkit-inline-flex" | "inline-block" | "inline-flex" | "inline-grid" | "inline-list-item" | "inline-table"; + + type DisplayOutside = "block" | "inline" | "run-in"; + + type EasingFunction = CubicBezierTimingFunction | StepTimingFunction | "linear"; + + type EastAsianVariantValues = "jis04" | "jis78" | "jis83" | "jis90" | "simplified" | "traditional"; + + type FinalBgLayer<TLength> = Color | BgPosition<TLength> | RepeatStyle | Attachment | Box | "none" | (string & {}); + + type FontStretchAbsolute = + | "condensed" + | "expanded" + | "extra-condensed" + | "extra-expanded" + | "normal" + | "semi-condensed" + | "semi-expanded" + | "ultra-condensed" + | "ultra-expanded" + | (string & {}); + + type FontWeightAbsolute = "bold" | "normal" | (number & {}) | (string & {}); + + type GenericFamily = "cursive" | "fantasy" | "monospace" | "sans-serif" | "serif"; + + type GeometryBox = Box | "fill-box" | "margin-box" | "stroke-box" | "view-box"; + + type GridLine = "auto" | (string & {}) | (number & {}); + + type LineStyle = "dashed" | "dotted" | "double" | "groove" | "hidden" | "inset" | "none" | "outset" | "ridge" | "solid"; + + type LineWidth<TLength> = TLength | "medium" | "thick" | "thin"; + + type MaskLayer<TLength> = Position<TLength> | RepeatStyle | GeometryBox | CompositingOperator | MaskingMode | "no-clip" | "none" | (string & {}); + + type MaskingMode = "alpha" | "luminance" | "match-source"; + + type NamedColor = + | "aliceblue" + | "antiquewhite" + | "aqua" + | "aquamarine" + | "azure" + | "beige" + | "bisque" + | "black" + | "blanchedalmond" + | "blue" + | "blueviolet" + | "brown" + | "burlywood" + | "cadetblue" + | "chartreuse" + | "chocolate" + | "coral" + | "cornflowerblue" + | "cornsilk" + | "crimson" + | "cyan" + | "darkblue" + | "darkcyan" + | "darkgoldenrod" + | "darkgray" + | "darkgreen" + | "darkgrey" + | "darkkhaki" + | "darkmagenta" + | "darkolivegreen" + | "darkorange" + | "darkorchid" + | "darkred" + | "darksalmon" + | "darkseagreen" + | "darkslateblue" + | "darkslategray" + | "darkslategrey" + | "darkturquoise" + | "darkviolet" + | "deeppink" + | "deepskyblue" + | "dimgray" + | "dimgrey" + | "dodgerblue" + | "firebrick" + | "floralwhite" + | "forestgreen" + | "fuchsia" + | "gainsboro" + | "ghostwhite" + | "gold" + | "goldenrod" + | "gray" + | "green" + | "greenyellow" + | "grey" + | "honeydew" + | "hotpink" + | "indianred" + | "indigo" + | "ivory" + | "khaki" + | "lavender" + | "lavenderblush" + | "lawngreen" + | "lemonchiffon" + | "lightblue" + | "lightcoral" + | "lightcyan" + | "lightgoldenrodyellow" + | "lightgray" + | "lightgreen" + | "lightgrey" + | "lightpink" + | "lightsalmon" + | "lightseagreen" + | "lightskyblue" + | "lightslategray" + | "lightslategrey" + | "lightsteelblue" + | "lightyellow" + | "lime" + | "limegreen" + | "linen" + | "magenta" + | "maroon" + | "mediumaquamarine" + | "mediumblue" + | "mediumorchid" + | "mediumpurple" + | "mediumseagreen" + | "mediumslateblue" + | "mediumspringgreen" + | "mediumturquoise" + | "mediumvioletred" + | "midnightblue" + | "mintcream" + | "mistyrose" + | "moccasin" + | "navajowhite" + | "navy" + | "oldlace" + | "olive" + | "olivedrab" + | "orange" + | "orangered" + | "orchid" + | "palegoldenrod" + | "palegreen" + | "paleturquoise" + | "palevioletred" + | "papayawhip" + | "peachpuff" + | "peru" + | "pink" + | "plum" + | "powderblue" + | "purple" + | "rebeccapurple" + | "red" + | "rosybrown" + | "royalblue" + | "saddlebrown" + | "salmon" + | "sandybrown" + | "seagreen" + | "seashell" + | "sienna" + | "silver" + | "skyblue" + | "slateblue" + | "slategray" + | "slategrey" + | "snow" + | "springgreen" + | "steelblue" + | "tan" + | "teal" + | "thistle" + | "tomato" + | "transparent" + | "turquoise" + | "violet" + | "wheat" + | "white" + | "whitesmoke" + | "yellow" + | "yellowgreen"; + + type PageSize = "A3" | "A4" | "A5" | "B4" | "B5" | "JIS-B4" | "JIS-B5" | "ledger" | "legal" | "letter"; + + type Paint = Color | "child" | "context-fill" | "context-stroke" | "none" | (string & {}); + + type Position<TLength> = TLength | "bottom" | "center" | "left" | "right" | "top" | (string & {}); + + type Quote = "close-quote" | "no-close-quote" | "no-open-quote" | "open-quote"; + + type RepeatStyle = "no-repeat" | "repeat" | "repeat-x" | "repeat-y" | "round" | "space" | (string & {}); + + type SelfPosition = "center" | "end" | "flex-end" | "flex-start" | "self-end" | "self-start" | "start"; + + type SingleAnimation<TTime> = + | EasingFunction + | SingleAnimationDirection + | SingleAnimationFillMode + | SingleAnimationTimeline + | TTime + | "infinite" + | "none" + | "paused" + | "running" + | (string & {}) + | (number & {}); + + type SingleAnimationComposition = "accumulate" | "add" | "replace"; + + type SingleAnimationDirection = "alternate" | "alternate-reverse" | "normal" | "reverse"; + + type SingleAnimationFillMode = "backwards" | "both" | "forwards" | "none"; + + type SingleAnimationTimeline = "auto" | "none" | (string & {}); + + type SingleTransition<TTime> = EasingFunction | TTime | "all" | "allow-discrete" | "none" | "normal" | (string & {}); + + type StepTimingFunction = "step-end" | "step-start" | (string & {}); + + type TimelineRangeName = "contain" | "cover" | "entry" | "entry-crossing" | "exit" | "exit-crossing"; + + type TrackBreadth<TLength> = TLength | "auto" | "max-content" | "min-content" | (string & {}); + + type ViewportLength<TLength> = TLength | "auto" | (string & {}); + + type VisualBox = "border-box" | "content-box" | "padding-box"; +} diff --git a/seller_1/node_modules/csstype/index.js.flow b/seller_1/node_modules/csstype/index.js.flow new file mode 100644 index 0000000..0b45a32 --- /dev/null +++ b/seller_1/node_modules/csstype/index.js.flow @@ -0,0 +1,6612 @@ +// @flow strict + +export type StandardLonghandProperties<TLength = string | 0, TTime = string> = {| + accentColor?: Property$AccentColor, + alignContent?: Property$AlignContent, + alignItems?: Property$AlignItems, + alignSelf?: Property$AlignSelf, + alignTracks?: Property$AlignTracks, + animationComposition?: Property$AnimationComposition, + animationDelay?: Property$AnimationDelay<TTime>, + animationDirection?: Property$AnimationDirection, + animationDuration?: Property$AnimationDuration<TTime>, + animationFillMode?: Property$AnimationFillMode, + animationIterationCount?: Property$AnimationIterationCount, + animationName?: Property$AnimationName, + animationPlayState?: Property$AnimationPlayState, + animationRangeEnd?: Property$AnimationRangeEnd<TLength>, + animationRangeStart?: Property$AnimationRangeStart<TLength>, + animationTimeline?: Property$AnimationTimeline, + animationTimingFunction?: Property$AnimationTimingFunction, + appearance?: Property$Appearance, + aspectRatio?: Property$AspectRatio, + backdropFilter?: Property$BackdropFilter, + backfaceVisibility?: Property$BackfaceVisibility, + backgroundAttachment?: Property$BackgroundAttachment, + backgroundBlendMode?: Property$BackgroundBlendMode, + backgroundClip?: Property$BackgroundClip, + backgroundColor?: Property$BackgroundColor, + backgroundImage?: Property$BackgroundImage, + backgroundOrigin?: Property$BackgroundOrigin, + backgroundPositionX?: Property$BackgroundPositionX<TLength>, + backgroundPositionY?: Property$BackgroundPositionY<TLength>, + backgroundRepeat?: Property$BackgroundRepeat, + backgroundSize?: Property$BackgroundSize<TLength>, + blockOverflow?: Property$BlockOverflow, + blockSize?: Property$BlockSize<TLength>, + borderBlockColor?: Property$BorderBlockColor, + borderBlockEndColor?: Property$BorderBlockEndColor, + borderBlockEndStyle?: Property$BorderBlockEndStyle, + borderBlockEndWidth?: Property$BorderBlockEndWidth<TLength>, + borderBlockStartColor?: Property$BorderBlockStartColor, + borderBlockStartStyle?: Property$BorderBlockStartStyle, + borderBlockStartWidth?: Property$BorderBlockStartWidth<TLength>, + borderBlockStyle?: Property$BorderBlockStyle, + borderBlockWidth?: Property$BorderBlockWidth<TLength>, + borderBottomColor?: Property$BorderBottomColor, + borderBottomLeftRadius?: Property$BorderBottomLeftRadius<TLength>, + borderBottomRightRadius?: Property$BorderBottomRightRadius<TLength>, + borderBottomStyle?: Property$BorderBottomStyle, + borderBottomWidth?: Property$BorderBottomWidth<TLength>, + borderCollapse?: Property$BorderCollapse, + borderEndEndRadius?: Property$BorderEndEndRadius<TLength>, + borderEndStartRadius?: Property$BorderEndStartRadius<TLength>, + borderImageOutset?: Property$BorderImageOutset<TLength>, + borderImageRepeat?: Property$BorderImageRepeat, + borderImageSlice?: Property$BorderImageSlice, + borderImageSource?: Property$BorderImageSource, + borderImageWidth?: Property$BorderImageWidth<TLength>, + borderInlineColor?: Property$BorderInlineColor, + borderInlineEndColor?: Property$BorderInlineEndColor, + borderInlineEndStyle?: Property$BorderInlineEndStyle, + borderInlineEndWidth?: Property$BorderInlineEndWidth<TLength>, + borderInlineStartColor?: Property$BorderInlineStartColor, + borderInlineStartStyle?: Property$BorderInlineStartStyle, + borderInlineStartWidth?: Property$BorderInlineStartWidth<TLength>, + borderInlineStyle?: Property$BorderInlineStyle, + borderInlineWidth?: Property$BorderInlineWidth<TLength>, + borderLeftColor?: Property$BorderLeftColor, + borderLeftStyle?: Property$BorderLeftStyle, + borderLeftWidth?: Property$BorderLeftWidth<TLength>, + borderRightColor?: Property$BorderRightColor, + borderRightStyle?: Property$BorderRightStyle, + borderRightWidth?: Property$BorderRightWidth<TLength>, + borderSpacing?: Property$BorderSpacing<TLength>, + borderStartEndRadius?: Property$BorderStartEndRadius<TLength>, + borderStartStartRadius?: Property$BorderStartStartRadius<TLength>, + borderTopColor?: Property$BorderTopColor, + borderTopLeftRadius?: Property$BorderTopLeftRadius<TLength>, + borderTopRightRadius?: Property$BorderTopRightRadius<TLength>, + borderTopStyle?: Property$BorderTopStyle, + borderTopWidth?: Property$BorderTopWidth<TLength>, + bottom?: Property$Bottom<TLength>, + boxDecorationBreak?: Property$BoxDecorationBreak, + boxShadow?: Property$BoxShadow, + boxSizing?: Property$BoxSizing, + breakAfter?: Property$BreakAfter, + breakBefore?: Property$BreakBefore, + breakInside?: Property$BreakInside, + captionSide?: Property$CaptionSide, + caretColor?: Property$CaretColor, + caretShape?: Property$CaretShape, + clear?: Property$Clear, + clipPath?: Property$ClipPath, + color?: Property$Color, + colorAdjust?: Property$PrintColorAdjust, + colorScheme?: Property$ColorScheme, + columnCount?: Property$ColumnCount, + columnFill?: Property$ColumnFill, + columnGap?: Property$ColumnGap<TLength>, + columnRuleColor?: Property$ColumnRuleColor, + columnRuleStyle?: Property$ColumnRuleStyle, + columnRuleWidth?: Property$ColumnRuleWidth<TLength>, + columnSpan?: Property$ColumnSpan, + columnWidth?: Property$ColumnWidth<TLength>, + contain?: Property$Contain, + containIntrinsicBlockSize?: Property$ContainIntrinsicBlockSize<TLength>, + containIntrinsicHeight?: Property$ContainIntrinsicHeight<TLength>, + containIntrinsicInlineSize?: Property$ContainIntrinsicInlineSize<TLength>, + containIntrinsicWidth?: Property$ContainIntrinsicWidth<TLength>, + containerName?: Property$ContainerName, + containerType?: Property$ContainerType, + content?: Property$Content, + contentVisibility?: Property$ContentVisibility, + counterIncrement?: Property$CounterIncrement, + counterReset?: Property$CounterReset, + counterSet?: Property$CounterSet, + cursor?: Property$Cursor, + direction?: Property$Direction, + display?: Property$Display, + emptyCells?: Property$EmptyCells, + filter?: Property$Filter, + flexBasis?: Property$FlexBasis<TLength>, + flexDirection?: Property$FlexDirection, + flexGrow?: Property$FlexGrow, + flexShrink?: Property$FlexShrink, + flexWrap?: Property$FlexWrap, + float?: Property$Float, + fontFamily?: Property$FontFamily, + fontFeatureSettings?: Property$FontFeatureSettings, + fontKerning?: Property$FontKerning, + fontLanguageOverride?: Property$FontLanguageOverride, + fontOpticalSizing?: Property$FontOpticalSizing, + fontPalette?: Property$FontPalette, + fontSize?: Property$FontSize<TLength>, + fontSizeAdjust?: Property$FontSizeAdjust, + fontSmooth?: Property$FontSmooth<TLength>, + fontStretch?: Property$FontStretch, + fontStyle?: Property$FontStyle, + fontSynthesis?: Property$FontSynthesis, + fontSynthesisPosition?: Property$FontSynthesisPosition, + fontSynthesisSmallCaps?: Property$FontSynthesisSmallCaps, + fontSynthesisStyle?: Property$FontSynthesisStyle, + fontSynthesisWeight?: Property$FontSynthesisWeight, + fontVariant?: Property$FontVariant, + fontVariantAlternates?: Property$FontVariantAlternates, + fontVariantCaps?: Property$FontVariantCaps, + fontVariantEastAsian?: Property$FontVariantEastAsian, + fontVariantEmoji?: Property$FontVariantEmoji, + fontVariantLigatures?: Property$FontVariantLigatures, + fontVariantNumeric?: Property$FontVariantNumeric, + fontVariantPosition?: Property$FontVariantPosition, + fontVariationSettings?: Property$FontVariationSettings, + fontWeight?: Property$FontWeight, + forcedColorAdjust?: Property$ForcedColorAdjust, + gridAutoColumns?: Property$GridAutoColumns<TLength>, + gridAutoFlow?: Property$GridAutoFlow, + gridAutoRows?: Property$GridAutoRows<TLength>, + gridColumnEnd?: Property$GridColumnEnd, + gridColumnStart?: Property$GridColumnStart, + gridRowEnd?: Property$GridRowEnd, + gridRowStart?: Property$GridRowStart, + gridTemplateAreas?: Property$GridTemplateAreas, + gridTemplateColumns?: Property$GridTemplateColumns<TLength>, + gridTemplateRows?: Property$GridTemplateRows<TLength>, + hangingPunctuation?: Property$HangingPunctuation, + height?: Property$Height<TLength>, + hyphenateCharacter?: Property$HyphenateCharacter, + hyphenateLimitChars?: Property$HyphenateLimitChars, + hyphens?: Property$Hyphens, + imageOrientation?: Property$ImageOrientation, + imageRendering?: Property$ImageRendering, + imageResolution?: Property$ImageResolution, + initialLetter?: Property$InitialLetter, + inlineSize?: Property$InlineSize<TLength>, + inputSecurity?: Property$InputSecurity, + insetBlockEnd?: Property$InsetBlockEnd<TLength>, + insetBlockStart?: Property$InsetBlockStart<TLength>, + insetInlineEnd?: Property$InsetInlineEnd<TLength>, + insetInlineStart?: Property$InsetInlineStart<TLength>, + isolation?: Property$Isolation, + justifyContent?: Property$JustifyContent, + justifyItems?: Property$JustifyItems, + justifySelf?: Property$JustifySelf, + justifyTracks?: Property$JustifyTracks, + left?: Property$Left<TLength>, + letterSpacing?: Property$LetterSpacing<TLength>, + lineBreak?: Property$LineBreak, + lineHeight?: Property$LineHeight<TLength>, + lineHeightStep?: Property$LineHeightStep<TLength>, + listStyleImage?: Property$ListStyleImage, + listStylePosition?: Property$ListStylePosition, + listStyleType?: Property$ListStyleType, + marginBlockEnd?: Property$MarginBlockEnd<TLength>, + marginBlockStart?: Property$MarginBlockStart<TLength>, + marginBottom?: Property$MarginBottom<TLength>, + marginInlineEnd?: Property$MarginInlineEnd<TLength>, + marginInlineStart?: Property$MarginInlineStart<TLength>, + marginLeft?: Property$MarginLeft<TLength>, + marginRight?: Property$MarginRight<TLength>, + marginTop?: Property$MarginTop<TLength>, + marginTrim?: Property$MarginTrim, + maskBorderMode?: Property$MaskBorderMode, + maskBorderOutset?: Property$MaskBorderOutset<TLength>, + maskBorderRepeat?: Property$MaskBorderRepeat, + maskBorderSlice?: Property$MaskBorderSlice, + maskBorderSource?: Property$MaskBorderSource, + maskBorderWidth?: Property$MaskBorderWidth<TLength>, + maskClip?: Property$MaskClip, + maskComposite?: Property$MaskComposite, + maskImage?: Property$MaskImage, + maskMode?: Property$MaskMode, + maskOrigin?: Property$MaskOrigin, + maskPosition?: Property$MaskPosition<TLength>, + maskRepeat?: Property$MaskRepeat, + maskSize?: Property$MaskSize<TLength>, + maskType?: Property$MaskType, + masonryAutoFlow?: Property$MasonryAutoFlow, + mathDepth?: Property$MathDepth, + mathShift?: Property$MathShift, + mathStyle?: Property$MathStyle, + maxBlockSize?: Property$MaxBlockSize<TLength>, + maxHeight?: Property$MaxHeight<TLength>, + maxInlineSize?: Property$MaxInlineSize<TLength>, + maxLines?: Property$MaxLines, + maxWidth?: Property$MaxWidth<TLength>, + minBlockSize?: Property$MinBlockSize<TLength>, + minHeight?: Property$MinHeight<TLength>, + minInlineSize?: Property$MinInlineSize<TLength>, + minWidth?: Property$MinWidth<TLength>, + mixBlendMode?: Property$MixBlendMode, + motionDistance?: Property$OffsetDistance<TLength>, + motionPath?: Property$OffsetPath, + motionRotation?: Property$OffsetRotate, + objectFit?: Property$ObjectFit, + objectPosition?: Property$ObjectPosition<TLength>, + offsetAnchor?: Property$OffsetAnchor<TLength>, + offsetDistance?: Property$OffsetDistance<TLength>, + offsetPath?: Property$OffsetPath, + offsetPosition?: Property$OffsetPosition<TLength>, + offsetRotate?: Property$OffsetRotate, + offsetRotation?: Property$OffsetRotate, + opacity?: Property$Opacity, + order?: Property$Order, + orphans?: Property$Orphans, + outlineColor?: Property$OutlineColor, + outlineOffset?: Property$OutlineOffset<TLength>, + outlineStyle?: Property$OutlineStyle, + outlineWidth?: Property$OutlineWidth<TLength>, + overflowAnchor?: Property$OverflowAnchor, + overflowBlock?: Property$OverflowBlock, + overflowClipBox?: Property$OverflowClipBox, + overflowClipMargin?: Property$OverflowClipMargin<TLength>, + overflowInline?: Property$OverflowInline, + overflowWrap?: Property$OverflowWrap, + overflowX?: Property$OverflowX, + overflowY?: Property$OverflowY, + overlay?: Property$Overlay, + overscrollBehaviorBlock?: Property$OverscrollBehaviorBlock, + overscrollBehaviorInline?: Property$OverscrollBehaviorInline, + overscrollBehaviorX?: Property$OverscrollBehaviorX, + overscrollBehaviorY?: Property$OverscrollBehaviorY, + paddingBlockEnd?: Property$PaddingBlockEnd<TLength>, + paddingBlockStart?: Property$PaddingBlockStart<TLength>, + paddingBottom?: Property$PaddingBottom<TLength>, + paddingInlineEnd?: Property$PaddingInlineEnd<TLength>, + paddingInlineStart?: Property$PaddingInlineStart<TLength>, + paddingLeft?: Property$PaddingLeft<TLength>, + paddingRight?: Property$PaddingRight<TLength>, + paddingTop?: Property$PaddingTop<TLength>, + page?: Property$Page, + pageBreakAfter?: Property$PageBreakAfter, + pageBreakBefore?: Property$PageBreakBefore, + pageBreakInside?: Property$PageBreakInside, + paintOrder?: Property$PaintOrder, + perspective?: Property$Perspective<TLength>, + perspectiveOrigin?: Property$PerspectiveOrigin<TLength>, + pointerEvents?: Property$PointerEvents, + position?: Property$Position, + printColorAdjust?: Property$PrintColorAdjust, + quotes?: Property$Quotes, + resize?: Property$Resize, + right?: Property$Right<TLength>, + rotate?: Property$Rotate, + rowGap?: Property$RowGap<TLength>, + rubyAlign?: Property$RubyAlign, + rubyMerge?: Property$RubyMerge, + rubyPosition?: Property$RubyPosition, + scale?: Property$Scale, + scrollBehavior?: Property$ScrollBehavior, + scrollMarginBlockEnd?: Property$ScrollMarginBlockEnd<TLength>, + scrollMarginBlockStart?: Property$ScrollMarginBlockStart<TLength>, + scrollMarginBottom?: Property$ScrollMarginBottom<TLength>, + scrollMarginInlineEnd?: Property$ScrollMarginInlineEnd<TLength>, + scrollMarginInlineStart?: Property$ScrollMarginInlineStart<TLength>, + scrollMarginLeft?: Property$ScrollMarginLeft<TLength>, + scrollMarginRight?: Property$ScrollMarginRight<TLength>, + scrollMarginTop?: Property$ScrollMarginTop<TLength>, + scrollPaddingBlockEnd?: Property$ScrollPaddingBlockEnd<TLength>, + scrollPaddingBlockStart?: Property$ScrollPaddingBlockStart<TLength>, + scrollPaddingBottom?: Property$ScrollPaddingBottom<TLength>, + scrollPaddingInlineEnd?: Property$ScrollPaddingInlineEnd<TLength>, + scrollPaddingInlineStart?: Property$ScrollPaddingInlineStart<TLength>, + scrollPaddingLeft?: Property$ScrollPaddingLeft<TLength>, + scrollPaddingRight?: Property$ScrollPaddingRight<TLength>, + scrollPaddingTop?: Property$ScrollPaddingTop<TLength>, + scrollSnapAlign?: Property$ScrollSnapAlign, + scrollSnapMarginBottom?: Property$ScrollMarginBottom<TLength>, + scrollSnapMarginLeft?: Property$ScrollMarginLeft<TLength>, + scrollSnapMarginRight?: Property$ScrollMarginRight<TLength>, + scrollSnapMarginTop?: Property$ScrollMarginTop<TLength>, + scrollSnapStop?: Property$ScrollSnapStop, + scrollSnapType?: Property$ScrollSnapType, + scrollTimelineAxis?: Property$ScrollTimelineAxis, + scrollTimelineName?: Property$ScrollTimelineName, + scrollbarColor?: Property$ScrollbarColor, + scrollbarGutter?: Property$ScrollbarGutter, + scrollbarWidth?: Property$ScrollbarWidth, + shapeImageThreshold?: Property$ShapeImageThreshold, + shapeMargin?: Property$ShapeMargin<TLength>, + shapeOutside?: Property$ShapeOutside, + tabSize?: Property$TabSize<TLength>, + tableLayout?: Property$TableLayout, + textAlign?: Property$TextAlign, + textAlignLast?: Property$TextAlignLast, + textCombineUpright?: Property$TextCombineUpright, + textDecorationColor?: Property$TextDecorationColor, + textDecorationLine?: Property$TextDecorationLine, + textDecorationSkip?: Property$TextDecorationSkip, + textDecorationSkipInk?: Property$TextDecorationSkipInk, + textDecorationStyle?: Property$TextDecorationStyle, + textDecorationThickness?: Property$TextDecorationThickness<TLength>, + textEmphasisColor?: Property$TextEmphasisColor, + textEmphasisPosition?: Property$TextEmphasisPosition, + textEmphasisStyle?: Property$TextEmphasisStyle, + textIndent?: Property$TextIndent<TLength>, + textJustify?: Property$TextJustify, + textOrientation?: Property$TextOrientation, + textOverflow?: Property$TextOverflow, + textRendering?: Property$TextRendering, + textShadow?: Property$TextShadow, + textSizeAdjust?: Property$TextSizeAdjust, + textTransform?: Property$TextTransform, + textUnderlineOffset?: Property$TextUnderlineOffset<TLength>, + textUnderlinePosition?: Property$TextUnderlinePosition, + textWrap?: Property$TextWrap, + timelineScope?: Property$TimelineScope, + top?: Property$Top<TLength>, + touchAction?: Property$TouchAction, + transform?: Property$Transform, + transformBox?: Property$TransformBox, + transformOrigin?: Property$TransformOrigin<TLength>, + transformStyle?: Property$TransformStyle, + transitionBehavior?: Property$TransitionBehavior, + transitionDelay?: Property$TransitionDelay<TTime>, + transitionDuration?: Property$TransitionDuration<TTime>, + transitionProperty?: Property$TransitionProperty, + transitionTimingFunction?: Property$TransitionTimingFunction, + translate?: Property$Translate<TLength>, + unicodeBidi?: Property$UnicodeBidi, + userSelect?: Property$UserSelect, + verticalAlign?: Property$VerticalAlign<TLength>, + viewTimelineAxis?: Property$ViewTimelineAxis, + viewTimelineInset?: Property$ViewTimelineInset<TLength>, + viewTimelineName?: Property$ViewTimelineName, + viewTransitionName?: Property$ViewTransitionName, + visibility?: Property$Visibility, + whiteSpace?: Property$WhiteSpace, + whiteSpaceCollapse?: Property$WhiteSpaceCollapse, + whiteSpaceTrim?: Property$WhiteSpaceTrim, + widows?: Property$Widows, + width?: Property$Width<TLength>, + willChange?: Property$WillChange, + wordBreak?: Property$WordBreak, + wordSpacing?: Property$WordSpacing<TLength>, + wordWrap?: Property$WordWrap, + writingMode?: Property$WritingMode, + zIndex?: Property$ZIndex, + zoom?: Property$Zoom, +|}; + +export type StandardShorthandProperties<TLength = string | 0, TTime = string> = {| + all?: Property$All, + animation?: Property$Animation<TTime>, + animationRange?: Property$AnimationRange<TLength>, + background?: Property$Background<TLength>, + backgroundPosition?: Property$BackgroundPosition<TLength>, + border?: Property$Border<TLength>, + borderBlock?: Property$BorderBlock<TLength>, + borderBlockEnd?: Property$BorderBlockEnd<TLength>, + borderBlockStart?: Property$BorderBlockStart<TLength>, + borderBottom?: Property$BorderBottom<TLength>, + borderColor?: Property$BorderColor, + borderImage?: Property$BorderImage, + borderInline?: Property$BorderInline<TLength>, + borderInlineEnd?: Property$BorderInlineEnd<TLength>, + borderInlineStart?: Property$BorderInlineStart<TLength>, + borderLeft?: Property$BorderLeft<TLength>, + borderRadius?: Property$BorderRadius<TLength>, + borderRight?: Property$BorderRight<TLength>, + borderStyle?: Property$BorderStyle, + borderTop?: Property$BorderTop<TLength>, + borderWidth?: Property$BorderWidth<TLength>, + caret?: Property$Caret, + columnRule?: Property$ColumnRule<TLength>, + columns?: Property$Columns<TLength>, + containIntrinsicSize?: Property$ContainIntrinsicSize<TLength>, + container?: Property$Container, + flex?: Property$Flex<TLength>, + flexFlow?: Property$FlexFlow, + font?: Property$Font, + gap?: Property$Gap<TLength>, + grid?: Property$Grid, + gridArea?: Property$GridArea, + gridColumn?: Property$GridColumn, + gridRow?: Property$GridRow, + gridTemplate?: Property$GridTemplate, + inset?: Property$Inset<TLength>, + insetBlock?: Property$InsetBlock<TLength>, + insetInline?: Property$InsetInline<TLength>, + lineClamp?: Property$LineClamp, + listStyle?: Property$ListStyle, + margin?: Property$Margin<TLength>, + marginBlock?: Property$MarginBlock<TLength>, + marginInline?: Property$MarginInline<TLength>, + mask?: Property$Mask<TLength>, + maskBorder?: Property$MaskBorder, + motion?: Property$Offset<TLength>, + offset?: Property$Offset<TLength>, + outline?: Property$Outline<TLength>, + overflow?: Property$Overflow, + overscrollBehavior?: Property$OverscrollBehavior, + padding?: Property$Padding<TLength>, + paddingBlock?: Property$PaddingBlock<TLength>, + paddingInline?: Property$PaddingInline<TLength>, + placeContent?: Property$PlaceContent, + placeItems?: Property$PlaceItems, + placeSelf?: Property$PlaceSelf, + scrollMargin?: Property$ScrollMargin<TLength>, + scrollMarginBlock?: Property$ScrollMarginBlock<TLength>, + scrollMarginInline?: Property$ScrollMarginInline<TLength>, + scrollPadding?: Property$ScrollPadding<TLength>, + scrollPaddingBlock?: Property$ScrollPaddingBlock<TLength>, + scrollPaddingInline?: Property$ScrollPaddingInline<TLength>, + scrollSnapMargin?: Property$ScrollMargin<TLength>, + scrollTimeline?: Property$ScrollTimeline, + textDecoration?: Property$TextDecoration<TLength>, + textEmphasis?: Property$TextEmphasis, + transition?: Property$Transition<TTime>, + viewTimeline?: Property$ViewTimeline, +|}; + +export type StandardProperties<TLength = string | 0, TTime = string> = {| ...StandardLonghandProperties<TLength, TTime>, ...StandardShorthandProperties<TLength, TTime> |}; + +export type VendorLonghandProperties<TLength = string | 0, TTime = string> = {| + MozAnimationDelay?: Property$AnimationDelay<TTime>, + MozAnimationDirection?: Property$AnimationDirection, + MozAnimationDuration?: Property$AnimationDuration<TTime>, + MozAnimationFillMode?: Property$AnimationFillMode, + MozAnimationIterationCount?: Property$AnimationIterationCount, + MozAnimationName?: Property$AnimationName, + MozAnimationPlayState?: Property$AnimationPlayState, + MozAnimationTimingFunction?: Property$AnimationTimingFunction, + MozAppearance?: Property$MozAppearance, + MozBinding?: Property$MozBinding, + MozBorderBottomColors?: Property$MozBorderBottomColors, + MozBorderEndColor?: Property$BorderInlineEndColor, + MozBorderEndStyle?: Property$BorderInlineEndStyle, + MozBorderEndWidth?: Property$BorderInlineEndWidth<TLength>, + MozBorderLeftColors?: Property$MozBorderLeftColors, + MozBorderRightColors?: Property$MozBorderRightColors, + MozBorderStartColor?: Property$BorderInlineStartColor, + MozBorderStartStyle?: Property$BorderInlineStartStyle, + MozBorderTopColors?: Property$MozBorderTopColors, + MozBoxSizing?: Property$BoxSizing, + MozColumnCount?: Property$ColumnCount, + MozColumnFill?: Property$ColumnFill, + MozColumnRuleColor?: Property$ColumnRuleColor, + MozColumnRuleStyle?: Property$ColumnRuleStyle, + MozColumnRuleWidth?: Property$ColumnRuleWidth<TLength>, + MozColumnWidth?: Property$ColumnWidth<TLength>, + MozContextProperties?: Property$MozContextProperties, + MozFontFeatureSettings?: Property$FontFeatureSettings, + MozFontLanguageOverride?: Property$FontLanguageOverride, + MozHyphens?: Property$Hyphens, + MozImageRegion?: Property$MozImageRegion, + MozMarginEnd?: Property$MarginInlineEnd<TLength>, + MozMarginStart?: Property$MarginInlineStart<TLength>, + MozOrient?: Property$MozOrient, + MozOsxFontSmoothing?: Property$FontSmooth<TLength>, + MozOutlineRadiusBottomleft?: Property$MozOutlineRadiusBottomleft<TLength>, + MozOutlineRadiusBottomright?: Property$MozOutlineRadiusBottomright<TLength>, + MozOutlineRadiusTopleft?: Property$MozOutlineRadiusTopleft<TLength>, + MozOutlineRadiusTopright?: Property$MozOutlineRadiusTopright<TLength>, + MozPaddingEnd?: Property$PaddingInlineEnd<TLength>, + MozPaddingStart?: Property$PaddingInlineStart<TLength>, + MozStackSizing?: Property$MozStackSizing, + MozTabSize?: Property$TabSize<TLength>, + MozTextBlink?: Property$MozTextBlink, + MozTextSizeAdjust?: Property$TextSizeAdjust, + MozUserFocus?: Property$MozUserFocus, + MozUserModify?: Property$MozUserModify, + MozUserSelect?: Property$UserSelect, + MozWindowDragging?: Property$MozWindowDragging, + MozWindowShadow?: Property$MozWindowShadow, + msAccelerator?: Property$MsAccelerator, + msBlockProgression?: Property$MsBlockProgression, + msContentZoomChaining?: Property$MsContentZoomChaining, + msContentZoomLimitMax?: Property$MsContentZoomLimitMax, + msContentZoomLimitMin?: Property$MsContentZoomLimitMin, + msContentZoomSnapPoints?: Property$MsContentZoomSnapPoints, + msContentZoomSnapType?: Property$MsContentZoomSnapType, + msContentZooming?: Property$MsContentZooming, + msFilter?: Property$MsFilter, + msFlexDirection?: Property$FlexDirection, + msFlexPositive?: Property$FlexGrow, + msFlowFrom?: Property$MsFlowFrom, + msFlowInto?: Property$MsFlowInto, + msGridColumns?: Property$MsGridColumns<TLength>, + msGridRows?: Property$MsGridRows<TLength>, + msHighContrastAdjust?: Property$MsHighContrastAdjust, + msHyphenateLimitChars?: Property$MsHyphenateLimitChars, + msHyphenateLimitLines?: Property$MsHyphenateLimitLines, + msHyphenateLimitZone?: Property$MsHyphenateLimitZone<TLength>, + msHyphens?: Property$Hyphens, + msImeAlign?: Property$MsImeAlign, + msLineBreak?: Property$LineBreak, + msOrder?: Property$Order, + msOverflowStyle?: Property$MsOverflowStyle, + msOverflowX?: Property$OverflowX, + msOverflowY?: Property$OverflowY, + msScrollChaining?: Property$MsScrollChaining, + msScrollLimitXMax?: Property$MsScrollLimitXMax<TLength>, + msScrollLimitXMin?: Property$MsScrollLimitXMin<TLength>, + msScrollLimitYMax?: Property$MsScrollLimitYMax<TLength>, + msScrollLimitYMin?: Property$MsScrollLimitYMin<TLength>, + msScrollRails?: Property$MsScrollRails, + msScrollSnapPointsX?: Property$MsScrollSnapPointsX, + msScrollSnapPointsY?: Property$MsScrollSnapPointsY, + msScrollSnapType?: Property$MsScrollSnapType, + msScrollTranslation?: Property$MsScrollTranslation, + msScrollbar3dlightColor?: Property$MsScrollbar3dlightColor, + msScrollbarArrowColor?: Property$MsScrollbarArrowColor, + msScrollbarBaseColor?: Property$MsScrollbarBaseColor, + msScrollbarDarkshadowColor?: Property$MsScrollbarDarkshadowColor, + msScrollbarFaceColor?: Property$MsScrollbarFaceColor, + msScrollbarHighlightColor?: Property$MsScrollbarHighlightColor, + msScrollbarShadowColor?: Property$MsScrollbarShadowColor, + msScrollbarTrackColor?: Property$MsScrollbarTrackColor, + msTextAutospace?: Property$MsTextAutospace, + msTextCombineHorizontal?: Property$TextCombineUpright, + msTextOverflow?: Property$TextOverflow, + msTouchAction?: Property$TouchAction, + msTouchSelect?: Property$MsTouchSelect, + msTransform?: Property$Transform, + msTransformOrigin?: Property$TransformOrigin<TLength>, + msTransitionDelay?: Property$TransitionDelay<TTime>, + msTransitionDuration?: Property$TransitionDuration<TTime>, + msTransitionProperty?: Property$TransitionProperty, + msTransitionTimingFunction?: Property$TransitionTimingFunction, + msUserSelect?: Property$MsUserSelect, + msWordBreak?: Property$WordBreak, + msWrapFlow?: Property$MsWrapFlow, + msWrapMargin?: Property$MsWrapMargin<TLength>, + msWrapThrough?: Property$MsWrapThrough, + msWritingMode?: Property$WritingMode, + WebkitAlignContent?: Property$AlignContent, + WebkitAlignItems?: Property$AlignItems, + WebkitAlignSelf?: Property$AlignSelf, + WebkitAnimationDelay?: Property$AnimationDelay<TTime>, + WebkitAnimationDirection?: Property$AnimationDirection, + WebkitAnimationDuration?: Property$AnimationDuration<TTime>, + WebkitAnimationFillMode?: Property$AnimationFillMode, + WebkitAnimationIterationCount?: Property$AnimationIterationCount, + WebkitAnimationName?: Property$AnimationName, + WebkitAnimationPlayState?: Property$AnimationPlayState, + WebkitAnimationTimingFunction?: Property$AnimationTimingFunction, + WebkitAppearance?: Property$WebkitAppearance, + WebkitBackdropFilter?: Property$BackdropFilter, + WebkitBackfaceVisibility?: Property$BackfaceVisibility, + WebkitBackgroundClip?: Property$BackgroundClip, + WebkitBackgroundOrigin?: Property$BackgroundOrigin, + WebkitBackgroundSize?: Property$BackgroundSize<TLength>, + WebkitBorderBeforeColor?: Property$WebkitBorderBeforeColor, + WebkitBorderBeforeStyle?: Property$WebkitBorderBeforeStyle, + WebkitBorderBeforeWidth?: Property$WebkitBorderBeforeWidth<TLength>, + WebkitBorderBottomLeftRadius?: Property$BorderBottomLeftRadius<TLength>, + WebkitBorderBottomRightRadius?: Property$BorderBottomRightRadius<TLength>, + WebkitBorderImageSlice?: Property$BorderImageSlice, + WebkitBorderTopLeftRadius?: Property$BorderTopLeftRadius<TLength>, + WebkitBorderTopRightRadius?: Property$BorderTopRightRadius<TLength>, + WebkitBoxDecorationBreak?: Property$BoxDecorationBreak, + WebkitBoxReflect?: Property$WebkitBoxReflect<TLength>, + WebkitBoxShadow?: Property$BoxShadow, + WebkitBoxSizing?: Property$BoxSizing, + WebkitClipPath?: Property$ClipPath, + WebkitColumnCount?: Property$ColumnCount, + WebkitColumnFill?: Property$ColumnFill, + WebkitColumnRuleColor?: Property$ColumnRuleColor, + WebkitColumnRuleStyle?: Property$ColumnRuleStyle, + WebkitColumnRuleWidth?: Property$ColumnRuleWidth<TLength>, + WebkitColumnSpan?: Property$ColumnSpan, + WebkitColumnWidth?: Property$ColumnWidth<TLength>, + WebkitFilter?: Property$Filter, + WebkitFlexBasis?: Property$FlexBasis<TLength>, + WebkitFlexDirection?: Property$FlexDirection, + WebkitFlexGrow?: Property$FlexGrow, + WebkitFlexShrink?: Property$FlexShrink, + WebkitFlexWrap?: Property$FlexWrap, + WebkitFontFeatureSettings?: Property$FontFeatureSettings, + WebkitFontKerning?: Property$FontKerning, + WebkitFontSmoothing?: Property$FontSmooth<TLength>, + WebkitFontVariantLigatures?: Property$FontVariantLigatures, + WebkitHyphenateCharacter?: Property$HyphenateCharacter, + WebkitHyphens?: Property$Hyphens, + WebkitInitialLetter?: Property$InitialLetter, + WebkitJustifyContent?: Property$JustifyContent, + WebkitLineBreak?: Property$LineBreak, + WebkitLineClamp?: Property$WebkitLineClamp, + WebkitMarginEnd?: Property$MarginInlineEnd<TLength>, + WebkitMarginStart?: Property$MarginInlineStart<TLength>, + WebkitMaskAttachment?: Property$WebkitMaskAttachment, + WebkitMaskBoxImageOutset?: Property$MaskBorderOutset<TLength>, + WebkitMaskBoxImageRepeat?: Property$MaskBorderRepeat, + WebkitMaskBoxImageSlice?: Property$MaskBorderSlice, + WebkitMaskBoxImageSource?: Property$MaskBorderSource, + WebkitMaskBoxImageWidth?: Property$MaskBorderWidth<TLength>, + WebkitMaskClip?: Property$WebkitMaskClip, + WebkitMaskComposite?: Property$WebkitMaskComposite, + WebkitMaskImage?: Property$WebkitMaskImage, + WebkitMaskOrigin?: Property$WebkitMaskOrigin, + WebkitMaskPosition?: Property$WebkitMaskPosition<TLength>, + WebkitMaskPositionX?: Property$WebkitMaskPositionX<TLength>, + WebkitMaskPositionY?: Property$WebkitMaskPositionY<TLength>, + WebkitMaskRepeat?: Property$WebkitMaskRepeat, + WebkitMaskRepeatX?: Property$WebkitMaskRepeatX, + WebkitMaskRepeatY?: Property$WebkitMaskRepeatY, + WebkitMaskSize?: Property$WebkitMaskSize<TLength>, + WebkitMaxInlineSize?: Property$MaxInlineSize<TLength>, + WebkitOrder?: Property$Order, + WebkitOverflowScrolling?: Property$WebkitOverflowScrolling, + WebkitPaddingEnd?: Property$PaddingInlineEnd<TLength>, + WebkitPaddingStart?: Property$PaddingInlineStart<TLength>, + WebkitPerspective?: Property$Perspective<TLength>, + WebkitPerspectiveOrigin?: Property$PerspectiveOrigin<TLength>, + WebkitPrintColorAdjust?: Property$PrintColorAdjust, + WebkitRubyPosition?: Property$RubyPosition, + WebkitScrollSnapType?: Property$ScrollSnapType, + WebkitShapeMargin?: Property$ShapeMargin<TLength>, + WebkitTapHighlightColor?: Property$WebkitTapHighlightColor, + WebkitTextCombine?: Property$TextCombineUpright, + WebkitTextDecorationColor?: Property$TextDecorationColor, + WebkitTextDecorationLine?: Property$TextDecorationLine, + WebkitTextDecorationSkip?: Property$TextDecorationSkip, + WebkitTextDecorationStyle?: Property$TextDecorationStyle, + WebkitTextEmphasisColor?: Property$TextEmphasisColor, + WebkitTextEmphasisPosition?: Property$TextEmphasisPosition, + WebkitTextEmphasisStyle?: Property$TextEmphasisStyle, + WebkitTextFillColor?: Property$WebkitTextFillColor, + WebkitTextOrientation?: Property$TextOrientation, + WebkitTextSizeAdjust?: Property$TextSizeAdjust, + WebkitTextStrokeColor?: Property$WebkitTextStrokeColor, + WebkitTextStrokeWidth?: Property$WebkitTextStrokeWidth<TLength>, + WebkitTextUnderlinePosition?: Property$TextUnderlinePosition, + WebkitTouchCallout?: Property$WebkitTouchCallout, + WebkitTransform?: Property$Transform, + WebkitTransformOrigin?: Property$TransformOrigin<TLength>, + WebkitTransformStyle?: Property$TransformStyle, + WebkitTransitionDelay?: Property$TransitionDelay<TTime>, + WebkitTransitionDuration?: Property$TransitionDuration<TTime>, + WebkitTransitionProperty?: Property$TransitionProperty, + WebkitTransitionTimingFunction?: Property$TransitionTimingFunction, + WebkitUserModify?: Property$WebkitUserModify, + WebkitUserSelect?: Property$UserSelect, + WebkitWritingMode?: Property$WritingMode, +|}; + +export type VendorShorthandProperties<TLength = string | 0, TTime = string> = {| + MozAnimation?: Property$Animation<TTime>, + MozBorderImage?: Property$BorderImage, + MozColumnRule?: Property$ColumnRule<TLength>, + MozColumns?: Property$Columns<TLength>, + MozOutlineRadius?: Property$MozOutlineRadius<TLength>, + msContentZoomLimit?: Property$MsContentZoomLimit, + msContentZoomSnap?: Property$MsContentZoomSnap, + msFlex?: Property$Flex<TLength>, + msScrollLimit?: Property$MsScrollLimit, + msScrollSnapX?: Property$MsScrollSnapX, + msScrollSnapY?: Property$MsScrollSnapY, + msTransition?: Property$Transition<TTime>, + WebkitAnimation?: Property$Animation<TTime>, + WebkitBorderBefore?: Property$WebkitBorderBefore<TLength>, + WebkitBorderImage?: Property$BorderImage, + WebkitBorderRadius?: Property$BorderRadius<TLength>, + WebkitColumnRule?: Property$ColumnRule<TLength>, + WebkitColumns?: Property$Columns<TLength>, + WebkitFlex?: Property$Flex<TLength>, + WebkitFlexFlow?: Property$FlexFlow, + WebkitMask?: Property$WebkitMask<TLength>, + WebkitMaskBoxImage?: Property$MaskBorder, + WebkitTextEmphasis?: Property$TextEmphasis, + WebkitTextStroke?: Property$WebkitTextStroke<TLength>, + WebkitTransition?: Property$Transition<TTime>, +|}; + +export type VendorProperties<TLength = string | 0, TTime = string> = {| ...VendorLonghandProperties<TLength, TTime>, ...VendorShorthandProperties<TLength, TTime> |}; + +export type ObsoleteProperties<TLength = string | 0, TTime = string> = {| + azimuth?: Property$Azimuth, + boxAlign?: Property$BoxAlign, + boxDirection?: Property$BoxDirection, + boxFlex?: Property$BoxFlex, + boxFlexGroup?: Property$BoxFlexGroup, + boxLines?: Property$BoxLines, + boxOrdinalGroup?: Property$BoxOrdinalGroup, + boxOrient?: Property$BoxOrient, + boxPack?: Property$BoxPack, + clip?: Property$Clip, + gridColumnGap?: Property$GridColumnGap<TLength>, + gridGap?: Property$GridGap<TLength>, + gridRowGap?: Property$GridRowGap<TLength>, + imeMode?: Property$ImeMode, + offsetBlock?: Property$InsetBlock<TLength>, + offsetBlockEnd?: Property$InsetBlockEnd<TLength>, + offsetBlockStart?: Property$InsetBlockStart<TLength>, + offsetInline?: Property$InsetInline<TLength>, + offsetInlineEnd?: Property$InsetInlineEnd<TLength>, + offsetInlineStart?: Property$InsetInlineStart<TLength>, + scrollSnapCoordinate?: Property$ScrollSnapCoordinate<TLength>, + scrollSnapDestination?: Property$ScrollSnapDestination<TLength>, + scrollSnapPointsX?: Property$ScrollSnapPointsX, + scrollSnapPointsY?: Property$ScrollSnapPointsY, + scrollSnapTypeX?: Property$ScrollSnapTypeX, + scrollSnapTypeY?: Property$ScrollSnapTypeY, + KhtmlBoxAlign?: Property$BoxAlign, + KhtmlBoxDirection?: Property$BoxDirection, + KhtmlBoxFlex?: Property$BoxFlex, + KhtmlBoxFlexGroup?: Property$BoxFlexGroup, + KhtmlBoxLines?: Property$BoxLines, + KhtmlBoxOrdinalGroup?: Property$BoxOrdinalGroup, + KhtmlBoxOrient?: Property$BoxOrient, + KhtmlBoxPack?: Property$BoxPack, + KhtmlLineBreak?: Property$LineBreak, + KhtmlOpacity?: Property$Opacity, + KhtmlUserSelect?: Property$UserSelect, + MozBackfaceVisibility?: Property$BackfaceVisibility, + MozBackgroundClip?: Property$BackgroundClip, + MozBackgroundInlinePolicy?: Property$BoxDecorationBreak, + MozBackgroundOrigin?: Property$BackgroundOrigin, + MozBackgroundSize?: Property$BackgroundSize<TLength>, + MozBorderRadius?: Property$BorderRadius<TLength>, + MozBorderRadiusBottomleft?: Property$BorderBottomLeftRadius<TLength>, + MozBorderRadiusBottomright?: Property$BorderBottomRightRadius<TLength>, + MozBorderRadiusTopleft?: Property$BorderTopLeftRadius<TLength>, + MozBorderRadiusTopright?: Property$BorderTopRightRadius<TLength>, + MozBoxAlign?: Property$BoxAlign, + MozBoxDirection?: Property$BoxDirection, + MozBoxFlex?: Property$BoxFlex, + MozBoxOrdinalGroup?: Property$BoxOrdinalGroup, + MozBoxOrient?: Property$BoxOrient, + MozBoxPack?: Property$BoxPack, + MozBoxShadow?: Property$BoxShadow, + MozFloatEdge?: Property$MozFloatEdge, + MozForceBrokenImageIcon?: Property$MozForceBrokenImageIcon, + MozOpacity?: Property$Opacity, + MozOutline?: Property$Outline<TLength>, + MozOutlineColor?: Property$OutlineColor, + MozOutlineStyle?: Property$OutlineStyle, + MozOutlineWidth?: Property$OutlineWidth<TLength>, + MozPerspective?: Property$Perspective<TLength>, + MozPerspectiveOrigin?: Property$PerspectiveOrigin<TLength>, + MozTextAlignLast?: Property$TextAlignLast, + MozTextDecorationColor?: Property$TextDecorationColor, + MozTextDecorationLine?: Property$TextDecorationLine, + MozTextDecorationStyle?: Property$TextDecorationStyle, + MozTransform?: Property$Transform, + MozTransformOrigin?: Property$TransformOrigin<TLength>, + MozTransformStyle?: Property$TransformStyle, + MozTransition?: Property$Transition<TTime>, + MozTransitionDelay?: Property$TransitionDelay<TTime>, + MozTransitionDuration?: Property$TransitionDuration<TTime>, + MozTransitionProperty?: Property$TransitionProperty, + MozTransitionTimingFunction?: Property$TransitionTimingFunction, + MozUserInput?: Property$MozUserInput, + msImeMode?: Property$ImeMode, + OAnimation?: Property$Animation<TTime>, + OAnimationDelay?: Property$AnimationDelay<TTime>, + OAnimationDirection?: Property$AnimationDirection, + OAnimationDuration?: Property$AnimationDuration<TTime>, + OAnimationFillMode?: Property$AnimationFillMode, + OAnimationIterationCount?: Property$AnimationIterationCount, + OAnimationName?: Property$AnimationName, + OAnimationPlayState?: Property$AnimationPlayState, + OAnimationTimingFunction?: Property$AnimationTimingFunction, + OBackgroundSize?: Property$BackgroundSize<TLength>, + OBorderImage?: Property$BorderImage, + OObjectFit?: Property$ObjectFit, + OObjectPosition?: Property$ObjectPosition<TLength>, + OTabSize?: Property$TabSize<TLength>, + OTextOverflow?: Property$TextOverflow, + OTransform?: Property$Transform, + OTransformOrigin?: Property$TransformOrigin<TLength>, + OTransition?: Property$Transition<TTime>, + OTransitionDelay?: Property$TransitionDelay<TTime>, + OTransitionDuration?: Property$TransitionDuration<TTime>, + OTransitionProperty?: Property$TransitionProperty, + OTransitionTimingFunction?: Property$TransitionTimingFunction, + WebkitBoxAlign?: Property$BoxAlign, + WebkitBoxDirection?: Property$BoxDirection, + WebkitBoxFlex?: Property$BoxFlex, + WebkitBoxFlexGroup?: Property$BoxFlexGroup, + WebkitBoxLines?: Property$BoxLines, + WebkitBoxOrdinalGroup?: Property$BoxOrdinalGroup, + WebkitBoxOrient?: Property$BoxOrient, + WebkitBoxPack?: Property$BoxPack, +|}; + +export type SvgProperties<TLength = string | 0, TTime = string> = {| + alignmentBaseline?: Property$AlignmentBaseline, + baselineShift?: Property$BaselineShift<TLength>, + clip?: Property$Clip, + clipPath?: Property$ClipPath, + clipRule?: Property$ClipRule, + color?: Property$Color, + colorInterpolation?: Property$ColorInterpolation, + colorRendering?: Property$ColorRendering, + cursor?: Property$Cursor, + direction?: Property$Direction, + display?: Property$Display, + dominantBaseline?: Property$DominantBaseline, + fill?: Property$Fill, + fillOpacity?: Property$FillOpacity, + fillRule?: Property$FillRule, + filter?: Property$Filter, + floodColor?: Property$FloodColor, + floodOpacity?: Property$FloodOpacity, + font?: Property$Font, + fontFamily?: Property$FontFamily, + fontSize?: Property$FontSize<TLength>, + fontSizeAdjust?: Property$FontSizeAdjust, + fontStretch?: Property$FontStretch, + fontStyle?: Property$FontStyle, + fontVariant?: Property$FontVariant, + fontWeight?: Property$FontWeight, + glyphOrientationVertical?: Property$GlyphOrientationVertical, + imageRendering?: Property$ImageRendering, + letterSpacing?: Property$LetterSpacing<TLength>, + lightingColor?: Property$LightingColor, + lineHeight?: Property$LineHeight<TLength>, + marker?: Property$Marker, + markerEnd?: Property$MarkerEnd, + markerMid?: Property$MarkerMid, + markerStart?: Property$MarkerStart, + mask?: Property$Mask<TLength>, + opacity?: Property$Opacity, + overflow?: Property$Overflow, + paintOrder?: Property$PaintOrder, + pointerEvents?: Property$PointerEvents, + shapeRendering?: Property$ShapeRendering, + stopColor?: Property$StopColor, + stopOpacity?: Property$StopOpacity, + stroke?: Property$Stroke, + strokeDasharray?: Property$StrokeDasharray<TLength>, + strokeDashoffset?: Property$StrokeDashoffset<TLength>, + strokeLinecap?: Property$StrokeLinecap, + strokeLinejoin?: Property$StrokeLinejoin, + strokeMiterlimit?: Property$StrokeMiterlimit, + strokeOpacity?: Property$StrokeOpacity, + strokeWidth?: Property$StrokeWidth<TLength>, + textAnchor?: Property$TextAnchor, + textDecoration?: Property$TextDecoration<TLength>, + textRendering?: Property$TextRendering, + unicodeBidi?: Property$UnicodeBidi, + vectorEffect?: Property$VectorEffect, + visibility?: Property$Visibility, + whiteSpace?: Property$WhiteSpace, + wordSpacing?: Property$WordSpacing<TLength>, + writingMode?: Property$WritingMode, +|}; + +export type Properties<TLength = string | 0, TTime = string> = {| + ...StandardProperties<TLength, TTime>, + ...VendorProperties<TLength, TTime>, + ...ObsoleteProperties<TLength, TTime>, + ...SvgProperties<TLength, TTime>, +|}; + +export type StandardLonghandPropertiesHyphen<TLength = string | 0, TTime = string> = {| + "accent-color"?: Property$AccentColor, + "align-content"?: Property$AlignContent, + "align-items"?: Property$AlignItems, + "align-self"?: Property$AlignSelf, + "align-tracks"?: Property$AlignTracks, + "animation-composition"?: Property$AnimationComposition, + "animation-delay"?: Property$AnimationDelay<TTime>, + "animation-direction"?: Property$AnimationDirection, + "animation-duration"?: Property$AnimationDuration<TTime>, + "animation-fill-mode"?: Property$AnimationFillMode, + "animation-iteration-count"?: Property$AnimationIterationCount, + "animation-name"?: Property$AnimationName, + "animation-play-state"?: Property$AnimationPlayState, + "animation-range-end"?: Property$AnimationRangeEnd<TLength>, + "animation-range-start"?: Property$AnimationRangeStart<TLength>, + "animation-timeline"?: Property$AnimationTimeline, + "animation-timing-function"?: Property$AnimationTimingFunction, + appearance?: Property$Appearance, + "aspect-ratio"?: Property$AspectRatio, + "backdrop-filter"?: Property$BackdropFilter, + "backface-visibility"?: Property$BackfaceVisibility, + "background-attachment"?: Property$BackgroundAttachment, + "background-blend-mode"?: Property$BackgroundBlendMode, + "background-clip"?: Property$BackgroundClip, + "background-color"?: Property$BackgroundColor, + "background-image"?: Property$BackgroundImage, + "background-origin"?: Property$BackgroundOrigin, + "background-position-x"?: Property$BackgroundPositionX<TLength>, + "background-position-y"?: Property$BackgroundPositionY<TLength>, + "background-repeat"?: Property$BackgroundRepeat, + "background-size"?: Property$BackgroundSize<TLength>, + "block-overflow"?: Property$BlockOverflow, + "block-size"?: Property$BlockSize<TLength>, + "border-block-color"?: Property$BorderBlockColor, + "border-block-end-color"?: Property$BorderBlockEndColor, + "border-block-end-style"?: Property$BorderBlockEndStyle, + "border-block-end-width"?: Property$BorderBlockEndWidth<TLength>, + "border-block-start-color"?: Property$BorderBlockStartColor, + "border-block-start-style"?: Property$BorderBlockStartStyle, + "border-block-start-width"?: Property$BorderBlockStartWidth<TLength>, + "border-block-style"?: Property$BorderBlockStyle, + "border-block-width"?: Property$BorderBlockWidth<TLength>, + "border-bottom-color"?: Property$BorderBottomColor, + "border-bottom-left-radius"?: Property$BorderBottomLeftRadius<TLength>, + "border-bottom-right-radius"?: Property$BorderBottomRightRadius<TLength>, + "border-bottom-style"?: Property$BorderBottomStyle, + "border-bottom-width"?: Property$BorderBottomWidth<TLength>, + "border-collapse"?: Property$BorderCollapse, + "border-end-end-radius"?: Property$BorderEndEndRadius<TLength>, + "border-end-start-radius"?: Property$BorderEndStartRadius<TLength>, + "border-image-outset"?: Property$BorderImageOutset<TLength>, + "border-image-repeat"?: Property$BorderImageRepeat, + "border-image-slice"?: Property$BorderImageSlice, + "border-image-source"?: Property$BorderImageSource, + "border-image-width"?: Property$BorderImageWidth<TLength>, + "border-inline-color"?: Property$BorderInlineColor, + "border-inline-end-color"?: Property$BorderInlineEndColor, + "border-inline-end-style"?: Property$BorderInlineEndStyle, + "border-inline-end-width"?: Property$BorderInlineEndWidth<TLength>, + "border-inline-start-color"?: Property$BorderInlineStartColor, + "border-inline-start-style"?: Property$BorderInlineStartStyle, + "border-inline-start-width"?: Property$BorderInlineStartWidth<TLength>, + "border-inline-style"?: Property$BorderInlineStyle, + "border-inline-width"?: Property$BorderInlineWidth<TLength>, + "border-left-color"?: Property$BorderLeftColor, + "border-left-style"?: Property$BorderLeftStyle, + "border-left-width"?: Property$BorderLeftWidth<TLength>, + "border-right-color"?: Property$BorderRightColor, + "border-right-style"?: Property$BorderRightStyle, + "border-right-width"?: Property$BorderRightWidth<TLength>, + "border-spacing"?: Property$BorderSpacing<TLength>, + "border-start-end-radius"?: Property$BorderStartEndRadius<TLength>, + "border-start-start-radius"?: Property$BorderStartStartRadius<TLength>, + "border-top-color"?: Property$BorderTopColor, + "border-top-left-radius"?: Property$BorderTopLeftRadius<TLength>, + "border-top-right-radius"?: Property$BorderTopRightRadius<TLength>, + "border-top-style"?: Property$BorderTopStyle, + "border-top-width"?: Property$BorderTopWidth<TLength>, + bottom?: Property$Bottom<TLength>, + "box-decoration-break"?: Property$BoxDecorationBreak, + "box-shadow"?: Property$BoxShadow, + "box-sizing"?: Property$BoxSizing, + "break-after"?: Property$BreakAfter, + "break-before"?: Property$BreakBefore, + "break-inside"?: Property$BreakInside, + "caption-side"?: Property$CaptionSide, + "caret-color"?: Property$CaretColor, + "caret-shape"?: Property$CaretShape, + clear?: Property$Clear, + "clip-path"?: Property$ClipPath, + color?: Property$Color, + "color-adjust"?: Property$PrintColorAdjust, + "color-scheme"?: Property$ColorScheme, + "column-count"?: Property$ColumnCount, + "column-fill"?: Property$ColumnFill, + "column-gap"?: Property$ColumnGap<TLength>, + "column-rule-color"?: Property$ColumnRuleColor, + "column-rule-style"?: Property$ColumnRuleStyle, + "column-rule-width"?: Property$ColumnRuleWidth<TLength>, + "column-span"?: Property$ColumnSpan, + "column-width"?: Property$ColumnWidth<TLength>, + contain?: Property$Contain, + "contain-intrinsic-block-size"?: Property$ContainIntrinsicBlockSize<TLength>, + "contain-intrinsic-height"?: Property$ContainIntrinsicHeight<TLength>, + "contain-intrinsic-inline-size"?: Property$ContainIntrinsicInlineSize<TLength>, + "contain-intrinsic-width"?: Property$ContainIntrinsicWidth<TLength>, + "container-name"?: Property$ContainerName, + "container-type"?: Property$ContainerType, + content?: Property$Content, + "content-visibility"?: Property$ContentVisibility, + "counter-increment"?: Property$CounterIncrement, + "counter-reset"?: Property$CounterReset, + "counter-set"?: Property$CounterSet, + cursor?: Property$Cursor, + direction?: Property$Direction, + display?: Property$Display, + "empty-cells"?: Property$EmptyCells, + filter?: Property$Filter, + "flex-basis"?: Property$FlexBasis<TLength>, + "flex-direction"?: Property$FlexDirection, + "flex-grow"?: Property$FlexGrow, + "flex-shrink"?: Property$FlexShrink, + "flex-wrap"?: Property$FlexWrap, + float?: Property$Float, + "font-family"?: Property$FontFamily, + "font-feature-settings"?: Property$FontFeatureSettings, + "font-kerning"?: Property$FontKerning, + "font-language-override"?: Property$FontLanguageOverride, + "font-optical-sizing"?: Property$FontOpticalSizing, + "font-palette"?: Property$FontPalette, + "font-size"?: Property$FontSize<TLength>, + "font-size-adjust"?: Property$FontSizeAdjust, + "font-smooth"?: Property$FontSmooth<TLength>, + "font-stretch"?: Property$FontStretch, + "font-style"?: Property$FontStyle, + "font-synthesis"?: Property$FontSynthesis, + "font-synthesis-position"?: Property$FontSynthesisPosition, + "font-synthesis-small-caps"?: Property$FontSynthesisSmallCaps, + "font-synthesis-style"?: Property$FontSynthesisStyle, + "font-synthesis-weight"?: Property$FontSynthesisWeight, + "font-variant"?: Property$FontVariant, + "font-variant-alternates"?: Property$FontVariantAlternates, + "font-variant-caps"?: Property$FontVariantCaps, + "font-variant-east-asian"?: Property$FontVariantEastAsian, + "font-variant-emoji"?: Property$FontVariantEmoji, + "font-variant-ligatures"?: Property$FontVariantLigatures, + "font-variant-numeric"?: Property$FontVariantNumeric, + "font-variant-position"?: Property$FontVariantPosition, + "font-variation-settings"?: Property$FontVariationSettings, + "font-weight"?: Property$FontWeight, + "forced-color-adjust"?: Property$ForcedColorAdjust, + "grid-auto-columns"?: Property$GridAutoColumns<TLength>, + "grid-auto-flow"?: Property$GridAutoFlow, + "grid-auto-rows"?: Property$GridAutoRows<TLength>, + "grid-column-end"?: Property$GridColumnEnd, + "grid-column-start"?: Property$GridColumnStart, + "grid-row-end"?: Property$GridRowEnd, + "grid-row-start"?: Property$GridRowStart, + "grid-template-areas"?: Property$GridTemplateAreas, + "grid-template-columns"?: Property$GridTemplateColumns<TLength>, + "grid-template-rows"?: Property$GridTemplateRows<TLength>, + "hanging-punctuation"?: Property$HangingPunctuation, + height?: Property$Height<TLength>, + "hyphenate-character"?: Property$HyphenateCharacter, + "hyphenate-limit-chars"?: Property$HyphenateLimitChars, + hyphens?: Property$Hyphens, + "image-orientation"?: Property$ImageOrientation, + "image-rendering"?: Property$ImageRendering, + "image-resolution"?: Property$ImageResolution, + "initial-letter"?: Property$InitialLetter, + "inline-size"?: Property$InlineSize<TLength>, + "input-security"?: Property$InputSecurity, + "inset-block-end"?: Property$InsetBlockEnd<TLength>, + "inset-block-start"?: Property$InsetBlockStart<TLength>, + "inset-inline-end"?: Property$InsetInlineEnd<TLength>, + "inset-inline-start"?: Property$InsetInlineStart<TLength>, + isolation?: Property$Isolation, + "justify-content"?: Property$JustifyContent, + "justify-items"?: Property$JustifyItems, + "justify-self"?: Property$JustifySelf, + "justify-tracks"?: Property$JustifyTracks, + left?: Property$Left<TLength>, + "letter-spacing"?: Property$LetterSpacing<TLength>, + "line-break"?: Property$LineBreak, + "line-height"?: Property$LineHeight<TLength>, + "line-height-step"?: Property$LineHeightStep<TLength>, + "list-style-image"?: Property$ListStyleImage, + "list-style-position"?: Property$ListStylePosition, + "list-style-type"?: Property$ListStyleType, + "margin-block-end"?: Property$MarginBlockEnd<TLength>, + "margin-block-start"?: Property$MarginBlockStart<TLength>, + "margin-bottom"?: Property$MarginBottom<TLength>, + "margin-inline-end"?: Property$MarginInlineEnd<TLength>, + "margin-inline-start"?: Property$MarginInlineStart<TLength>, + "margin-left"?: Property$MarginLeft<TLength>, + "margin-right"?: Property$MarginRight<TLength>, + "margin-top"?: Property$MarginTop<TLength>, + "margin-trim"?: Property$MarginTrim, + "mask-border-mode"?: Property$MaskBorderMode, + "mask-border-outset"?: Property$MaskBorderOutset<TLength>, + "mask-border-repeat"?: Property$MaskBorderRepeat, + "mask-border-slice"?: Property$MaskBorderSlice, + "mask-border-source"?: Property$MaskBorderSource, + "mask-border-width"?: Property$MaskBorderWidth<TLength>, + "mask-clip"?: Property$MaskClip, + "mask-composite"?: Property$MaskComposite, + "mask-image"?: Property$MaskImage, + "mask-mode"?: Property$MaskMode, + "mask-origin"?: Property$MaskOrigin, + "mask-position"?: Property$MaskPosition<TLength>, + "mask-repeat"?: Property$MaskRepeat, + "mask-size"?: Property$MaskSize<TLength>, + "mask-type"?: Property$MaskType, + "masonry-auto-flow"?: Property$MasonryAutoFlow, + "math-depth"?: Property$MathDepth, + "math-shift"?: Property$MathShift, + "math-style"?: Property$MathStyle, + "max-block-size"?: Property$MaxBlockSize<TLength>, + "max-height"?: Property$MaxHeight<TLength>, + "max-inline-size"?: Property$MaxInlineSize<TLength>, + "max-lines"?: Property$MaxLines, + "max-width"?: Property$MaxWidth<TLength>, + "min-block-size"?: Property$MinBlockSize<TLength>, + "min-height"?: Property$MinHeight<TLength>, + "min-inline-size"?: Property$MinInlineSize<TLength>, + "min-width"?: Property$MinWidth<TLength>, + "mix-blend-mode"?: Property$MixBlendMode, + "motion-distance"?: Property$OffsetDistance<TLength>, + "motion-path"?: Property$OffsetPath, + "motion-rotation"?: Property$OffsetRotate, + "object-fit"?: Property$ObjectFit, + "object-position"?: Property$ObjectPosition<TLength>, + "offset-anchor"?: Property$OffsetAnchor<TLength>, + "offset-distance"?: Property$OffsetDistance<TLength>, + "offset-path"?: Property$OffsetPath, + "offset-position"?: Property$OffsetPosition<TLength>, + "offset-rotate"?: Property$OffsetRotate, + "offset-rotation"?: Property$OffsetRotate, + opacity?: Property$Opacity, + order?: Property$Order, + orphans?: Property$Orphans, + "outline-color"?: Property$OutlineColor, + "outline-offset"?: Property$OutlineOffset<TLength>, + "outline-style"?: Property$OutlineStyle, + "outline-width"?: Property$OutlineWidth<TLength>, + "overflow-anchor"?: Property$OverflowAnchor, + "overflow-block"?: Property$OverflowBlock, + "overflow-clip-box"?: Property$OverflowClipBox, + "overflow-clip-margin"?: Property$OverflowClipMargin<TLength>, + "overflow-inline"?: Property$OverflowInline, + "overflow-wrap"?: Property$OverflowWrap, + "overflow-x"?: Property$OverflowX, + "overflow-y"?: Property$OverflowY, + overlay?: Property$Overlay, + "overscroll-behavior-block"?: Property$OverscrollBehaviorBlock, + "overscroll-behavior-inline"?: Property$OverscrollBehaviorInline, + "overscroll-behavior-x"?: Property$OverscrollBehaviorX, + "overscroll-behavior-y"?: Property$OverscrollBehaviorY, + "padding-block-end"?: Property$PaddingBlockEnd<TLength>, + "padding-block-start"?: Property$PaddingBlockStart<TLength>, + "padding-bottom"?: Property$PaddingBottom<TLength>, + "padding-inline-end"?: Property$PaddingInlineEnd<TLength>, + "padding-inline-start"?: Property$PaddingInlineStart<TLength>, + "padding-left"?: Property$PaddingLeft<TLength>, + "padding-right"?: Property$PaddingRight<TLength>, + "padding-top"?: Property$PaddingTop<TLength>, + page?: Property$Page, + "page-break-after"?: Property$PageBreakAfter, + "page-break-before"?: Property$PageBreakBefore, + "page-break-inside"?: Property$PageBreakInside, + "paint-order"?: Property$PaintOrder, + perspective?: Property$Perspective<TLength>, + "perspective-origin"?: Property$PerspectiveOrigin<TLength>, + "pointer-events"?: Property$PointerEvents, + position?: Property$Position, + "print-color-adjust"?: Property$PrintColorAdjust, + quotes?: Property$Quotes, + resize?: Property$Resize, + right?: Property$Right<TLength>, + rotate?: Property$Rotate, + "row-gap"?: Property$RowGap<TLength>, + "ruby-align"?: Property$RubyAlign, + "ruby-merge"?: Property$RubyMerge, + "ruby-position"?: Property$RubyPosition, + scale?: Property$Scale, + "scroll-behavior"?: Property$ScrollBehavior, + "scroll-margin-block-end"?: Property$ScrollMarginBlockEnd<TLength>, + "scroll-margin-block-start"?: Property$ScrollMarginBlockStart<TLength>, + "scroll-margin-bottom"?: Property$ScrollMarginBottom<TLength>, + "scroll-margin-inline-end"?: Property$ScrollMarginInlineEnd<TLength>, + "scroll-margin-inline-start"?: Property$ScrollMarginInlineStart<TLength>, + "scroll-margin-left"?: Property$ScrollMarginLeft<TLength>, + "scroll-margin-right"?: Property$ScrollMarginRight<TLength>, + "scroll-margin-top"?: Property$ScrollMarginTop<TLength>, + "scroll-padding-block-end"?: Property$ScrollPaddingBlockEnd<TLength>, + "scroll-padding-block-start"?: Property$ScrollPaddingBlockStart<TLength>, + "scroll-padding-bottom"?: Property$ScrollPaddingBottom<TLength>, + "scroll-padding-inline-end"?: Property$ScrollPaddingInlineEnd<TLength>, + "scroll-padding-inline-start"?: Property$ScrollPaddingInlineStart<TLength>, + "scroll-padding-left"?: Property$ScrollPaddingLeft<TLength>, + "scroll-padding-right"?: Property$ScrollPaddingRight<TLength>, + "scroll-padding-top"?: Property$ScrollPaddingTop<TLength>, + "scroll-snap-align"?: Property$ScrollSnapAlign, + "scroll-snap-margin-bottom"?: Property$ScrollMarginBottom<TLength>, + "scroll-snap-margin-left"?: Property$ScrollMarginLeft<TLength>, + "scroll-snap-margin-right"?: Property$ScrollMarginRight<TLength>, + "scroll-snap-margin-top"?: Property$ScrollMarginTop<TLength>, + "scroll-snap-stop"?: Property$ScrollSnapStop, + "scroll-snap-type"?: Property$ScrollSnapType, + "scroll-timeline-axis"?: Property$ScrollTimelineAxis, + "scroll-timeline-name"?: Property$ScrollTimelineName, + "scrollbar-color"?: Property$ScrollbarColor, + "scrollbar-gutter"?: Property$ScrollbarGutter, + "scrollbar-width"?: Property$ScrollbarWidth, + "shape-image-threshold"?: Property$ShapeImageThreshold, + "shape-margin"?: Property$ShapeMargin<TLength>, + "shape-outside"?: Property$ShapeOutside, + "tab-size"?: Property$TabSize<TLength>, + "table-layout"?: Property$TableLayout, + "text-align"?: Property$TextAlign, + "text-align-last"?: Property$TextAlignLast, + "text-combine-upright"?: Property$TextCombineUpright, + "text-decoration-color"?: Property$TextDecorationColor, + "text-decoration-line"?: Property$TextDecorationLine, + "text-decoration-skip"?: Property$TextDecorationSkip, + "text-decoration-skip-ink"?: Property$TextDecorationSkipInk, + "text-decoration-style"?: Property$TextDecorationStyle, + "text-decoration-thickness"?: Property$TextDecorationThickness<TLength>, + "text-emphasis-color"?: Property$TextEmphasisColor, + "text-emphasis-position"?: Property$TextEmphasisPosition, + "text-emphasis-style"?: Property$TextEmphasisStyle, + "text-indent"?: Property$TextIndent<TLength>, + "text-justify"?: Property$TextJustify, + "text-orientation"?: Property$TextOrientation, + "text-overflow"?: Property$TextOverflow, + "text-rendering"?: Property$TextRendering, + "text-shadow"?: Property$TextShadow, + "text-size-adjust"?: Property$TextSizeAdjust, + "text-transform"?: Property$TextTransform, + "text-underline-offset"?: Property$TextUnderlineOffset<TLength>, + "text-underline-position"?: Property$TextUnderlinePosition, + "text-wrap"?: Property$TextWrap, + "timeline-scope"?: Property$TimelineScope, + top?: Property$Top<TLength>, + "touch-action"?: Property$TouchAction, + transform?: Property$Transform, + "transform-box"?: Property$TransformBox, + "transform-origin"?: Property$TransformOrigin<TLength>, + "transform-style"?: Property$TransformStyle, + "transition-behavior"?: Property$TransitionBehavior, + "transition-delay"?: Property$TransitionDelay<TTime>, + "transition-duration"?: Property$TransitionDuration<TTime>, + "transition-property"?: Property$TransitionProperty, + "transition-timing-function"?: Property$TransitionTimingFunction, + translate?: Property$Translate<TLength>, + "unicode-bidi"?: Property$UnicodeBidi, + "user-select"?: Property$UserSelect, + "vertical-align"?: Property$VerticalAlign<TLength>, + "view-timeline-axis"?: Property$ViewTimelineAxis, + "view-timeline-inset"?: Property$ViewTimelineInset<TLength>, + "view-timeline-name"?: Property$ViewTimelineName, + "view-transition-name"?: Property$ViewTransitionName, + visibility?: Property$Visibility, + "white-space"?: Property$WhiteSpace, + "white-space-collapse"?: Property$WhiteSpaceCollapse, + "white-space-trim"?: Property$WhiteSpaceTrim, + widows?: Property$Widows, + width?: Property$Width<TLength>, + "will-change"?: Property$WillChange, + "word-break"?: Property$WordBreak, + "word-spacing"?: Property$WordSpacing<TLength>, + "word-wrap"?: Property$WordWrap, + "writing-mode"?: Property$WritingMode, + "z-index"?: Property$ZIndex, + zoom?: Property$Zoom, +|}; + +export type StandardShorthandPropertiesHyphen<TLength = string | 0, TTime = string> = {| + all?: Property$All, + animation?: Property$Animation<TTime>, + "animation-range"?: Property$AnimationRange<TLength>, + background?: Property$Background<TLength>, + "background-position"?: Property$BackgroundPosition<TLength>, + border?: Property$Border<TLength>, + "border-block"?: Property$BorderBlock<TLength>, + "border-block-end"?: Property$BorderBlockEnd<TLength>, + "border-block-start"?: Property$BorderBlockStart<TLength>, + "border-bottom"?: Property$BorderBottom<TLength>, + "border-color"?: Property$BorderColor, + "border-image"?: Property$BorderImage, + "border-inline"?: Property$BorderInline<TLength>, + "border-inline-end"?: Property$BorderInlineEnd<TLength>, + "border-inline-start"?: Property$BorderInlineStart<TLength>, + "border-left"?: Property$BorderLeft<TLength>, + "border-radius"?: Property$BorderRadius<TLength>, + "border-right"?: Property$BorderRight<TLength>, + "border-style"?: Property$BorderStyle, + "border-top"?: Property$BorderTop<TLength>, + "border-width"?: Property$BorderWidth<TLength>, + caret?: Property$Caret, + "column-rule"?: Property$ColumnRule<TLength>, + columns?: Property$Columns<TLength>, + "contain-intrinsic-size"?: Property$ContainIntrinsicSize<TLength>, + container?: Property$Container, + flex?: Property$Flex<TLength>, + "flex-flow"?: Property$FlexFlow, + font?: Property$Font, + gap?: Property$Gap<TLength>, + grid?: Property$Grid, + "grid-area"?: Property$GridArea, + "grid-column"?: Property$GridColumn, + "grid-row"?: Property$GridRow, + "grid-template"?: Property$GridTemplate, + inset?: Property$Inset<TLength>, + "inset-block"?: Property$InsetBlock<TLength>, + "inset-inline"?: Property$InsetInline<TLength>, + "line-clamp"?: Property$LineClamp, + "list-style"?: Property$ListStyle, + margin?: Property$Margin<TLength>, + "margin-block"?: Property$MarginBlock<TLength>, + "margin-inline"?: Property$MarginInline<TLength>, + mask?: Property$Mask<TLength>, + "mask-border"?: Property$MaskBorder, + motion?: Property$Offset<TLength>, + offset?: Property$Offset<TLength>, + outline?: Property$Outline<TLength>, + overflow?: Property$Overflow, + "overscroll-behavior"?: Property$OverscrollBehavior, + padding?: Property$Padding<TLength>, + "padding-block"?: Property$PaddingBlock<TLength>, + "padding-inline"?: Property$PaddingInline<TLength>, + "place-content"?: Property$PlaceContent, + "place-items"?: Property$PlaceItems, + "place-self"?: Property$PlaceSelf, + "scroll-margin"?: Property$ScrollMargin<TLength>, + "scroll-margin-block"?: Property$ScrollMarginBlock<TLength>, + "scroll-margin-inline"?: Property$ScrollMarginInline<TLength>, + "scroll-padding"?: Property$ScrollPadding<TLength>, + "scroll-padding-block"?: Property$ScrollPaddingBlock<TLength>, + "scroll-padding-inline"?: Property$ScrollPaddingInline<TLength>, + "scroll-snap-margin"?: Property$ScrollMargin<TLength>, + "scroll-timeline"?: Property$ScrollTimeline, + "text-decoration"?: Property$TextDecoration<TLength>, + "text-emphasis"?: Property$TextEmphasis, + transition?: Property$Transition<TTime>, + "view-timeline"?: Property$ViewTimeline, +|}; + +export type StandardPropertiesHyphen<TLength = string | 0, TTime = string> = {| + ...StandardLonghandPropertiesHyphen<TLength, TTime>, + ...StandardShorthandPropertiesHyphen<TLength, TTime>, +|}; + +export type VendorLonghandPropertiesHyphen<TLength = string | 0, TTime = string> = {| + "-moz-animation-delay"?: Property$AnimationDelay<TTime>, + "-moz-animation-direction"?: Property$AnimationDirection, + "-moz-animation-duration"?: Property$AnimationDuration<TTime>, + "-moz-animation-fill-mode"?: Property$AnimationFillMode, + "-moz-animation-iteration-count"?: Property$AnimationIterationCount, + "-moz-animation-name"?: Property$AnimationName, + "-moz-animation-play-state"?: Property$AnimationPlayState, + "-moz-animation-timing-function"?: Property$AnimationTimingFunction, + "-moz-appearance"?: Property$MozAppearance, + "-moz-binding"?: Property$MozBinding, + "-moz-border-bottom-colors"?: Property$MozBorderBottomColors, + "-moz-border-end-color"?: Property$BorderInlineEndColor, + "-moz-border-end-style"?: Property$BorderInlineEndStyle, + "-moz-border-end-width"?: Property$BorderInlineEndWidth<TLength>, + "-moz-border-left-colors"?: Property$MozBorderLeftColors, + "-moz-border-right-colors"?: Property$MozBorderRightColors, + "-moz-border-start-color"?: Property$BorderInlineStartColor, + "-moz-border-start-style"?: Property$BorderInlineStartStyle, + "-moz-border-top-colors"?: Property$MozBorderTopColors, + "-moz-box-sizing"?: Property$BoxSizing, + "-moz-column-count"?: Property$ColumnCount, + "-moz-column-fill"?: Property$ColumnFill, + "-moz-column-rule-color"?: Property$ColumnRuleColor, + "-moz-column-rule-style"?: Property$ColumnRuleStyle, + "-moz-column-rule-width"?: Property$ColumnRuleWidth<TLength>, + "-moz-column-width"?: Property$ColumnWidth<TLength>, + "-moz-context-properties"?: Property$MozContextProperties, + "-moz-font-feature-settings"?: Property$FontFeatureSettings, + "-moz-font-language-override"?: Property$FontLanguageOverride, + "-moz-hyphens"?: Property$Hyphens, + "-moz-image-region"?: Property$MozImageRegion, + "-moz-margin-end"?: Property$MarginInlineEnd<TLength>, + "-moz-margin-start"?: Property$MarginInlineStart<TLength>, + "-moz-orient"?: Property$MozOrient, + "-moz-osx-font-smoothing"?: Property$FontSmooth<TLength>, + "-moz-outline-radius-bottomleft"?: Property$MozOutlineRadiusBottomleft<TLength>, + "-moz-outline-radius-bottomright"?: Property$MozOutlineRadiusBottomright<TLength>, + "-moz-outline-radius-topleft"?: Property$MozOutlineRadiusTopleft<TLength>, + "-moz-outline-radius-topright"?: Property$MozOutlineRadiusTopright<TLength>, + "-moz-padding-end"?: Property$PaddingInlineEnd<TLength>, + "-moz-padding-start"?: Property$PaddingInlineStart<TLength>, + "-moz-stack-sizing"?: Property$MozStackSizing, + "-moz-tab-size"?: Property$TabSize<TLength>, + "-moz-text-blink"?: Property$MozTextBlink, + "-moz-text-size-adjust"?: Property$TextSizeAdjust, + "-moz-user-focus"?: Property$MozUserFocus, + "-moz-user-modify"?: Property$MozUserModify, + "-moz-user-select"?: Property$UserSelect, + "-moz-window-dragging"?: Property$MozWindowDragging, + "-moz-window-shadow"?: Property$MozWindowShadow, + "-ms-accelerator"?: Property$MsAccelerator, + "-ms-block-progression"?: Property$MsBlockProgression, + "-ms-content-zoom-chaining"?: Property$MsContentZoomChaining, + "-ms-content-zoom-limit-max"?: Property$MsContentZoomLimitMax, + "-ms-content-zoom-limit-min"?: Property$MsContentZoomLimitMin, + "-ms-content-zoom-snap-points"?: Property$MsContentZoomSnapPoints, + "-ms-content-zoom-snap-type"?: Property$MsContentZoomSnapType, + "-ms-content-zooming"?: Property$MsContentZooming, + "-ms-filter"?: Property$MsFilter, + "-ms-flex-direction"?: Property$FlexDirection, + "-ms-flex-positive"?: Property$FlexGrow, + "-ms-flow-from"?: Property$MsFlowFrom, + "-ms-flow-into"?: Property$MsFlowInto, + "-ms-grid-columns"?: Property$MsGridColumns<TLength>, + "-ms-grid-rows"?: Property$MsGridRows<TLength>, + "-ms-high-contrast-adjust"?: Property$MsHighContrastAdjust, + "-ms-hyphenate-limit-chars"?: Property$MsHyphenateLimitChars, + "-ms-hyphenate-limit-lines"?: Property$MsHyphenateLimitLines, + "-ms-hyphenate-limit-zone"?: Property$MsHyphenateLimitZone<TLength>, + "-ms-hyphens"?: Property$Hyphens, + "-ms-ime-align"?: Property$MsImeAlign, + "-ms-line-break"?: Property$LineBreak, + "-ms-order"?: Property$Order, + "-ms-overflow-style"?: Property$MsOverflowStyle, + "-ms-overflow-x"?: Property$OverflowX, + "-ms-overflow-y"?: Property$OverflowY, + "-ms-scroll-chaining"?: Property$MsScrollChaining, + "-ms-scroll-limit-x-max"?: Property$MsScrollLimitXMax<TLength>, + "-ms-scroll-limit-x-min"?: Property$MsScrollLimitXMin<TLength>, + "-ms-scroll-limit-y-max"?: Property$MsScrollLimitYMax<TLength>, + "-ms-scroll-limit-y-min"?: Property$MsScrollLimitYMin<TLength>, + "-ms-scroll-rails"?: Property$MsScrollRails, + "-ms-scroll-snap-points-x"?: Property$MsScrollSnapPointsX, + "-ms-scroll-snap-points-y"?: Property$MsScrollSnapPointsY, + "-ms-scroll-snap-type"?: Property$MsScrollSnapType, + "-ms-scroll-translation"?: Property$MsScrollTranslation, + "-ms-scrollbar-3dlight-color"?: Property$MsScrollbar3dlightColor, + "-ms-scrollbar-arrow-color"?: Property$MsScrollbarArrowColor, + "-ms-scrollbar-base-color"?: Property$MsScrollbarBaseColor, + "-ms-scrollbar-darkshadow-color"?: Property$MsScrollbarDarkshadowColor, + "-ms-scrollbar-face-color"?: Property$MsScrollbarFaceColor, + "-ms-scrollbar-highlight-color"?: Property$MsScrollbarHighlightColor, + "-ms-scrollbar-shadow-color"?: Property$MsScrollbarShadowColor, + "-ms-scrollbar-track-color"?: Property$MsScrollbarTrackColor, + "-ms-text-autospace"?: Property$MsTextAutospace, + "-ms-text-combine-horizontal"?: Property$TextCombineUpright, + "-ms-text-overflow"?: Property$TextOverflow, + "-ms-touch-action"?: Property$TouchAction, + "-ms-touch-select"?: Property$MsTouchSelect, + "-ms-transform"?: Property$Transform, + "-ms-transform-origin"?: Property$TransformOrigin<TLength>, + "-ms-transition-delay"?: Property$TransitionDelay<TTime>, + "-ms-transition-duration"?: Property$TransitionDuration<TTime>, + "-ms-transition-property"?: Property$TransitionProperty, + "-ms-transition-timing-function"?: Property$TransitionTimingFunction, + "-ms-user-select"?: Property$MsUserSelect, + "-ms-word-break"?: Property$WordBreak, + "-ms-wrap-flow"?: Property$MsWrapFlow, + "-ms-wrap-margin"?: Property$MsWrapMargin<TLength>, + "-ms-wrap-through"?: Property$MsWrapThrough, + "-ms-writing-mode"?: Property$WritingMode, + "-webkit-align-content"?: Property$AlignContent, + "-webkit-align-items"?: Property$AlignItems, + "-webkit-align-self"?: Property$AlignSelf, + "-webkit-animation-delay"?: Property$AnimationDelay<TTime>, + "-webkit-animation-direction"?: Property$AnimationDirection, + "-webkit-animation-duration"?: Property$AnimationDuration<TTime>, + "-webkit-animation-fill-mode"?: Property$AnimationFillMode, + "-webkit-animation-iteration-count"?: Property$AnimationIterationCount, + "-webkit-animation-name"?: Property$AnimationName, + "-webkit-animation-play-state"?: Property$AnimationPlayState, + "-webkit-animation-timing-function"?: Property$AnimationTimingFunction, + "-webkit-appearance"?: Property$WebkitAppearance, + "-webkit-backdrop-filter"?: Property$BackdropFilter, + "-webkit-backface-visibility"?: Property$BackfaceVisibility, + "-webkit-background-clip"?: Property$BackgroundClip, + "-webkit-background-origin"?: Property$BackgroundOrigin, + "-webkit-background-size"?: Property$BackgroundSize<TLength>, + "-webkit-border-before-color"?: Property$WebkitBorderBeforeColor, + "-webkit-border-before-style"?: Property$WebkitBorderBeforeStyle, + "-webkit-border-before-width"?: Property$WebkitBorderBeforeWidth<TLength>, + "-webkit-border-bottom-left-radius"?: Property$BorderBottomLeftRadius<TLength>, + "-webkit-border-bottom-right-radius"?: Property$BorderBottomRightRadius<TLength>, + "-webkit-border-image-slice"?: Property$BorderImageSlice, + "-webkit-border-top-left-radius"?: Property$BorderTopLeftRadius<TLength>, + "-webkit-border-top-right-radius"?: Property$BorderTopRightRadius<TLength>, + "-webkit-box-decoration-break"?: Property$BoxDecorationBreak, + "-webkit-box-reflect"?: Property$WebkitBoxReflect<TLength>, + "-webkit-box-shadow"?: Property$BoxShadow, + "-webkit-box-sizing"?: Property$BoxSizing, + "-webkit-clip-path"?: Property$ClipPath, + "-webkit-column-count"?: Property$ColumnCount, + "-webkit-column-fill"?: Property$ColumnFill, + "-webkit-column-rule-color"?: Property$ColumnRuleColor, + "-webkit-column-rule-style"?: Property$ColumnRuleStyle, + "-webkit-column-rule-width"?: Property$ColumnRuleWidth<TLength>, + "-webkit-column-span"?: Property$ColumnSpan, + "-webkit-column-width"?: Property$ColumnWidth<TLength>, + "-webkit-filter"?: Property$Filter, + "-webkit-flex-basis"?: Property$FlexBasis<TLength>, + "-webkit-flex-direction"?: Property$FlexDirection, + "-webkit-flex-grow"?: Property$FlexGrow, + "-webkit-flex-shrink"?: Property$FlexShrink, + "-webkit-flex-wrap"?: Property$FlexWrap, + "-webkit-font-feature-settings"?: Property$FontFeatureSettings, + "-webkit-font-kerning"?: Property$FontKerning, + "-webkit-font-smoothing"?: Property$FontSmooth<TLength>, + "-webkit-font-variant-ligatures"?: Property$FontVariantLigatures, + "-webkit-hyphenate-character"?: Property$HyphenateCharacter, + "-webkit-hyphens"?: Property$Hyphens, + "-webkit-initial-letter"?: Property$InitialLetter, + "-webkit-justify-content"?: Property$JustifyContent, + "-webkit-line-break"?: Property$LineBreak, + "-webkit-line-clamp"?: Property$WebkitLineClamp, + "-webkit-margin-end"?: Property$MarginInlineEnd<TLength>, + "-webkit-margin-start"?: Property$MarginInlineStart<TLength>, + "-webkit-mask-attachment"?: Property$WebkitMaskAttachment, + "-webkit-mask-box-image-outset"?: Property$MaskBorderOutset<TLength>, + "-webkit-mask-box-image-repeat"?: Property$MaskBorderRepeat, + "-webkit-mask-box-image-slice"?: Property$MaskBorderSlice, + "-webkit-mask-box-image-source"?: Property$MaskBorderSource, + "-webkit-mask-box-image-width"?: Property$MaskBorderWidth<TLength>, + "-webkit-mask-clip"?: Property$WebkitMaskClip, + "-webkit-mask-composite"?: Property$WebkitMaskComposite, + "-webkit-mask-image"?: Property$WebkitMaskImage, + "-webkit-mask-origin"?: Property$WebkitMaskOrigin, + "-webkit-mask-position"?: Property$WebkitMaskPosition<TLength>, + "-webkit-mask-position-x"?: Property$WebkitMaskPositionX<TLength>, + "-webkit-mask-position-y"?: Property$WebkitMaskPositionY<TLength>, + "-webkit-mask-repeat"?: Property$WebkitMaskRepeat, + "-webkit-mask-repeat-x"?: Property$WebkitMaskRepeatX, + "-webkit-mask-repeat-y"?: Property$WebkitMaskRepeatY, + "-webkit-mask-size"?: Property$WebkitMaskSize<TLength>, + "-webkit-max-inline-size"?: Property$MaxInlineSize<TLength>, + "-webkit-order"?: Property$Order, + "-webkit-overflow-scrolling"?: Property$WebkitOverflowScrolling, + "-webkit-padding-end"?: Property$PaddingInlineEnd<TLength>, + "-webkit-padding-start"?: Property$PaddingInlineStart<TLength>, + "-webkit-perspective"?: Property$Perspective<TLength>, + "-webkit-perspective-origin"?: Property$PerspectiveOrigin<TLength>, + "-webkit-print-color-adjust"?: Property$PrintColorAdjust, + "-webkit-ruby-position"?: Property$RubyPosition, + "-webkit-scroll-snap-type"?: Property$ScrollSnapType, + "-webkit-shape-margin"?: Property$ShapeMargin<TLength>, + "-webkit-tap-highlight-color"?: Property$WebkitTapHighlightColor, + "-webkit-text-combine"?: Property$TextCombineUpright, + "-webkit-text-decoration-color"?: Property$TextDecorationColor, + "-webkit-text-decoration-line"?: Property$TextDecorationLine, + "-webkit-text-decoration-skip"?: Property$TextDecorationSkip, + "-webkit-text-decoration-style"?: Property$TextDecorationStyle, + "-webkit-text-emphasis-color"?: Property$TextEmphasisColor, + "-webkit-text-emphasis-position"?: Property$TextEmphasisPosition, + "-webkit-text-emphasis-style"?: Property$TextEmphasisStyle, + "-webkit-text-fill-color"?: Property$WebkitTextFillColor, + "-webkit-text-orientation"?: Property$TextOrientation, + "-webkit-text-size-adjust"?: Property$TextSizeAdjust, + "-webkit-text-stroke-color"?: Property$WebkitTextStrokeColor, + "-webkit-text-stroke-width"?: Property$WebkitTextStrokeWidth<TLength>, + "-webkit-text-underline-position"?: Property$TextUnderlinePosition, + "-webkit-touch-callout"?: Property$WebkitTouchCallout, + "-webkit-transform"?: Property$Transform, + "-webkit-transform-origin"?: Property$TransformOrigin<TLength>, + "-webkit-transform-style"?: Property$TransformStyle, + "-webkit-transition-delay"?: Property$TransitionDelay<TTime>, + "-webkit-transition-duration"?: Property$TransitionDuration<TTime>, + "-webkit-transition-property"?: Property$TransitionProperty, + "-webkit-transition-timing-function"?: Property$TransitionTimingFunction, + "-webkit-user-modify"?: Property$WebkitUserModify, + "-webkit-user-select"?: Property$UserSelect, + "-webkit-writing-mode"?: Property$WritingMode, +|}; + +export type VendorShorthandPropertiesHyphen<TLength = string | 0, TTime = string> = {| + "-moz-animation"?: Property$Animation<TTime>, + "-moz-border-image"?: Property$BorderImage, + "-moz-column-rule"?: Property$ColumnRule<TLength>, + "-moz-columns"?: Property$Columns<TLength>, + "-moz-outline-radius"?: Property$MozOutlineRadius<TLength>, + "-ms-content-zoom-limit"?: Property$MsContentZoomLimit, + "-ms-content-zoom-snap"?: Property$MsContentZoomSnap, + "-ms-flex"?: Property$Flex<TLength>, + "-ms-scroll-limit"?: Property$MsScrollLimit, + "-ms-scroll-snap-x"?: Property$MsScrollSnapX, + "-ms-scroll-snap-y"?: Property$MsScrollSnapY, + "-ms-transition"?: Property$Transition<TTime>, + "-webkit-animation"?: Property$Animation<TTime>, + "-webkit-border-before"?: Property$WebkitBorderBefore<TLength>, + "-webkit-border-image"?: Property$BorderImage, + "-webkit-border-radius"?: Property$BorderRadius<TLength>, + "-webkit-column-rule"?: Property$ColumnRule<TLength>, + "-webkit-columns"?: Property$Columns<TLength>, + "-webkit-flex"?: Property$Flex<TLength>, + "-webkit-flex-flow"?: Property$FlexFlow, + "-webkit-mask"?: Property$WebkitMask<TLength>, + "-webkit-mask-box-image"?: Property$MaskBorder, + "-webkit-text-emphasis"?: Property$TextEmphasis, + "-webkit-text-stroke"?: Property$WebkitTextStroke<TLength>, + "-webkit-transition"?: Property$Transition<TTime>, +|}; + +export type VendorPropertiesHyphen<TLength = string | 0, TTime = string> = {| + ...VendorLonghandPropertiesHyphen<TLength, TTime>, + ...VendorShorthandPropertiesHyphen<TLength, TTime>, +|}; + +export type ObsoletePropertiesHyphen<TLength = string | 0, TTime = string> = {| + azimuth?: Property$Azimuth, + "box-align"?: Property$BoxAlign, + "box-direction"?: Property$BoxDirection, + "box-flex"?: Property$BoxFlex, + "box-flex-group"?: Property$BoxFlexGroup, + "box-lines"?: Property$BoxLines, + "box-ordinal-group"?: Property$BoxOrdinalGroup, + "box-orient"?: Property$BoxOrient, + "box-pack"?: Property$BoxPack, + clip?: Property$Clip, + "grid-column-gap"?: Property$GridColumnGap<TLength>, + "grid-gap"?: Property$GridGap<TLength>, + "grid-row-gap"?: Property$GridRowGap<TLength>, + "ime-mode"?: Property$ImeMode, + "offset-block"?: Property$InsetBlock<TLength>, + "offset-block-end"?: Property$InsetBlockEnd<TLength>, + "offset-block-start"?: Property$InsetBlockStart<TLength>, + "offset-inline"?: Property$InsetInline<TLength>, + "offset-inline-end"?: Property$InsetInlineEnd<TLength>, + "offset-inline-start"?: Property$InsetInlineStart<TLength>, + "scroll-snap-coordinate"?: Property$ScrollSnapCoordinate<TLength>, + "scroll-snap-destination"?: Property$ScrollSnapDestination<TLength>, + "scroll-snap-points-x"?: Property$ScrollSnapPointsX, + "scroll-snap-points-y"?: Property$ScrollSnapPointsY, + "scroll-snap-type-x"?: Property$ScrollSnapTypeX, + "scroll-snap-type-y"?: Property$ScrollSnapTypeY, + "-khtml-box-align"?: Property$BoxAlign, + "-khtml-box-direction"?: Property$BoxDirection, + "-khtml-box-flex"?: Property$BoxFlex, + "-khtml-box-flex-group"?: Property$BoxFlexGroup, + "-khtml-box-lines"?: Property$BoxLines, + "-khtml-box-ordinal-group"?: Property$BoxOrdinalGroup, + "-khtml-box-orient"?: Property$BoxOrient, + "-khtml-box-pack"?: Property$BoxPack, + "-khtml-line-break"?: Property$LineBreak, + "-khtml-opacity"?: Property$Opacity, + "-khtml-user-select"?: Property$UserSelect, + "-moz-backface-visibility"?: Property$BackfaceVisibility, + "-moz-background-clip"?: Property$BackgroundClip, + "-moz-background-inline-policy"?: Property$BoxDecorationBreak, + "-moz-background-origin"?: Property$BackgroundOrigin, + "-moz-background-size"?: Property$BackgroundSize<TLength>, + "-moz-border-radius"?: Property$BorderRadius<TLength>, + "-moz-border-radius-bottomleft"?: Property$BorderBottomLeftRadius<TLength>, + "-moz-border-radius-bottomright"?: Property$BorderBottomRightRadius<TLength>, + "-moz-border-radius-topleft"?: Property$BorderTopLeftRadius<TLength>, + "-moz-border-radius-topright"?: Property$BorderTopRightRadius<TLength>, + "-moz-box-align"?: Property$BoxAlign, + "-moz-box-direction"?: Property$BoxDirection, + "-moz-box-flex"?: Property$BoxFlex, + "-moz-box-ordinal-group"?: Property$BoxOrdinalGroup, + "-moz-box-orient"?: Property$BoxOrient, + "-moz-box-pack"?: Property$BoxPack, + "-moz-box-shadow"?: Property$BoxShadow, + "-moz-float-edge"?: Property$MozFloatEdge, + "-moz-force-broken-image-icon"?: Property$MozForceBrokenImageIcon, + "-moz-opacity"?: Property$Opacity, + "-moz-outline"?: Property$Outline<TLength>, + "-moz-outline-color"?: Property$OutlineColor, + "-moz-outline-style"?: Property$OutlineStyle, + "-moz-outline-width"?: Property$OutlineWidth<TLength>, + "-moz-perspective"?: Property$Perspective<TLength>, + "-moz-perspective-origin"?: Property$PerspectiveOrigin<TLength>, + "-moz-text-align-last"?: Property$TextAlignLast, + "-moz-text-decoration-color"?: Property$TextDecorationColor, + "-moz-text-decoration-line"?: Property$TextDecorationLine, + "-moz-text-decoration-style"?: Property$TextDecorationStyle, + "-moz-transform"?: Property$Transform, + "-moz-transform-origin"?: Property$TransformOrigin<TLength>, + "-moz-transform-style"?: Property$TransformStyle, + "-moz-transition"?: Property$Transition<TTime>, + "-moz-transition-delay"?: Property$TransitionDelay<TTime>, + "-moz-transition-duration"?: Property$TransitionDuration<TTime>, + "-moz-transition-property"?: Property$TransitionProperty, + "-moz-transition-timing-function"?: Property$TransitionTimingFunction, + "-moz-user-input"?: Property$MozUserInput, + "-ms-ime-mode"?: Property$ImeMode, + "-o-animation"?: Property$Animation<TTime>, + "-o-animation-delay"?: Property$AnimationDelay<TTime>, + "-o-animation-direction"?: Property$AnimationDirection, + "-o-animation-duration"?: Property$AnimationDuration<TTime>, + "-o-animation-fill-mode"?: Property$AnimationFillMode, + "-o-animation-iteration-count"?: Property$AnimationIterationCount, + "-o-animation-name"?: Property$AnimationName, + "-o-animation-play-state"?: Property$AnimationPlayState, + "-o-animation-timing-function"?: Property$AnimationTimingFunction, + "-o-background-size"?: Property$BackgroundSize<TLength>, + "-o-border-image"?: Property$BorderImage, + "-o-object-fit"?: Property$ObjectFit, + "-o-object-position"?: Property$ObjectPosition<TLength>, + "-o-tab-size"?: Property$TabSize<TLength>, + "-o-text-overflow"?: Property$TextOverflow, + "-o-transform"?: Property$Transform, + "-o-transform-origin"?: Property$TransformOrigin<TLength>, + "-o-transition"?: Property$Transition<TTime>, + "-o-transition-delay"?: Property$TransitionDelay<TTime>, + "-o-transition-duration"?: Property$TransitionDuration<TTime>, + "-o-transition-property"?: Property$TransitionProperty, + "-o-transition-timing-function"?: Property$TransitionTimingFunction, + "-webkit-box-align"?: Property$BoxAlign, + "-webkit-box-direction"?: Property$BoxDirection, + "-webkit-box-flex"?: Property$BoxFlex, + "-webkit-box-flex-group"?: Property$BoxFlexGroup, + "-webkit-box-lines"?: Property$BoxLines, + "-webkit-box-ordinal-group"?: Property$BoxOrdinalGroup, + "-webkit-box-orient"?: Property$BoxOrient, + "-webkit-box-pack"?: Property$BoxPack, +|}; + +export type SvgPropertiesHyphen<TLength = string | 0, TTime = string> = {| + "alignment-baseline"?: Property$AlignmentBaseline, + "baseline-shift"?: Property$BaselineShift<TLength>, + clip?: Property$Clip, + "clip-path"?: Property$ClipPath, + "clip-rule"?: Property$ClipRule, + color?: Property$Color, + "color-interpolation"?: Property$ColorInterpolation, + "color-rendering"?: Property$ColorRendering, + cursor?: Property$Cursor, + direction?: Property$Direction, + display?: Property$Display, + "dominant-baseline"?: Property$DominantBaseline, + fill?: Property$Fill, + "fill-opacity"?: Property$FillOpacity, + "fill-rule"?: Property$FillRule, + filter?: Property$Filter, + "flood-color"?: Property$FloodColor, + "flood-opacity"?: Property$FloodOpacity, + font?: Property$Font, + "font-family"?: Property$FontFamily, + "font-size"?: Property$FontSize<TLength>, + "font-size-adjust"?: Property$FontSizeAdjust, + "font-stretch"?: Property$FontStretch, + "font-style"?: Property$FontStyle, + "font-variant"?: Property$FontVariant, + "font-weight"?: Property$FontWeight, + "glyph-orientation-vertical"?: Property$GlyphOrientationVertical, + "image-rendering"?: Property$ImageRendering, + "letter-spacing"?: Property$LetterSpacing<TLength>, + "lighting-color"?: Property$LightingColor, + "line-height"?: Property$LineHeight<TLength>, + marker?: Property$Marker, + "marker-end"?: Property$MarkerEnd, + "marker-mid"?: Property$MarkerMid, + "marker-start"?: Property$MarkerStart, + mask?: Property$Mask<TLength>, + opacity?: Property$Opacity, + overflow?: Property$Overflow, + "paint-order"?: Property$PaintOrder, + "pointer-events"?: Property$PointerEvents, + "shape-rendering"?: Property$ShapeRendering, + "stop-color"?: Property$StopColor, + "stop-opacity"?: Property$StopOpacity, + stroke?: Property$Stroke, + "stroke-dasharray"?: Property$StrokeDasharray<TLength>, + "stroke-dashoffset"?: Property$StrokeDashoffset<TLength>, + "stroke-linecap"?: Property$StrokeLinecap, + "stroke-linejoin"?: Property$StrokeLinejoin, + "stroke-miterlimit"?: Property$StrokeMiterlimit, + "stroke-opacity"?: Property$StrokeOpacity, + "stroke-width"?: Property$StrokeWidth<TLength>, + "text-anchor"?: Property$TextAnchor, + "text-decoration"?: Property$TextDecoration<TLength>, + "text-rendering"?: Property$TextRendering, + "unicode-bidi"?: Property$UnicodeBidi, + "vector-effect"?: Property$VectorEffect, + visibility?: Property$Visibility, + "white-space"?: Property$WhiteSpace, + "word-spacing"?: Property$WordSpacing<TLength>, + "writing-mode"?: Property$WritingMode, +|}; + +export type PropertiesHyphen<TLength = string | 0, TTime = string> = {| + ...StandardPropertiesHyphen<TLength, TTime>, + ...VendorPropertiesHyphen<TLength, TTime>, + ...ObsoletePropertiesHyphen<TLength, TTime>, + ...SvgPropertiesHyphen<TLength, TTime>, +|}; + +export type StandardLonghandPropertiesFallback<TLength = string | 0, TTime = string> = {| + accentColor?: Property$AccentColor | Array<Property$AccentColor>, + alignContent?: Property$AlignContent | Array<Property$AlignContent>, + alignItems?: Property$AlignItems | Array<Property$AlignItems>, + alignSelf?: Property$AlignSelf | Array<Property$AlignSelf>, + alignTracks?: Property$AlignTracks | Array<Property$AlignTracks>, + animationComposition?: Property$AnimationComposition | Array<Property$AnimationComposition>, + animationDelay?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + animationDirection?: Property$AnimationDirection | Array<Property$AnimationDirection>, + animationDuration?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + animationFillMode?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + animationIterationCount?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + animationName?: Property$AnimationName | Array<Property$AnimationName>, + animationPlayState?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + animationRangeEnd?: Property$AnimationRangeEnd<TLength> | Array<Property$AnimationRangeEnd<TLength>>, + animationRangeStart?: Property$AnimationRangeStart<TLength> | Array<Property$AnimationRangeStart<TLength>>, + animationTimeline?: Property$AnimationTimeline | Array<Property$AnimationTimeline>, + animationTimingFunction?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + appearance?: Property$Appearance | Array<Property$Appearance>, + aspectRatio?: Property$AspectRatio | Array<Property$AspectRatio>, + backdropFilter?: Property$BackdropFilter | Array<Property$BackdropFilter>, + backfaceVisibility?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + backgroundAttachment?: Property$BackgroundAttachment | Array<Property$BackgroundAttachment>, + backgroundBlendMode?: Property$BackgroundBlendMode | Array<Property$BackgroundBlendMode>, + backgroundClip?: Property$BackgroundClip | Array<Property$BackgroundClip>, + backgroundColor?: Property$BackgroundColor | Array<Property$BackgroundColor>, + backgroundImage?: Property$BackgroundImage | Array<Property$BackgroundImage>, + backgroundOrigin?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + backgroundPositionX?: Property$BackgroundPositionX<TLength> | Array<Property$BackgroundPositionX<TLength>>, + backgroundPositionY?: Property$BackgroundPositionY<TLength> | Array<Property$BackgroundPositionY<TLength>>, + backgroundRepeat?: Property$BackgroundRepeat | Array<Property$BackgroundRepeat>, + backgroundSize?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + blockOverflow?: Property$BlockOverflow | Array<Property$BlockOverflow>, + blockSize?: Property$BlockSize<TLength> | Array<Property$BlockSize<TLength>>, + borderBlockColor?: Property$BorderBlockColor | Array<Property$BorderBlockColor>, + borderBlockEndColor?: Property$BorderBlockEndColor | Array<Property$BorderBlockEndColor>, + borderBlockEndStyle?: Property$BorderBlockEndStyle | Array<Property$BorderBlockEndStyle>, + borderBlockEndWidth?: Property$BorderBlockEndWidth<TLength> | Array<Property$BorderBlockEndWidth<TLength>>, + borderBlockStartColor?: Property$BorderBlockStartColor | Array<Property$BorderBlockStartColor>, + borderBlockStartStyle?: Property$BorderBlockStartStyle | Array<Property$BorderBlockStartStyle>, + borderBlockStartWidth?: Property$BorderBlockStartWidth<TLength> | Array<Property$BorderBlockStartWidth<TLength>>, + borderBlockStyle?: Property$BorderBlockStyle | Array<Property$BorderBlockStyle>, + borderBlockWidth?: Property$BorderBlockWidth<TLength> | Array<Property$BorderBlockWidth<TLength>>, + borderBottomColor?: Property$BorderBottomColor | Array<Property$BorderBottomColor>, + borderBottomLeftRadius?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + borderBottomRightRadius?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + borderBottomStyle?: Property$BorderBottomStyle | Array<Property$BorderBottomStyle>, + borderBottomWidth?: Property$BorderBottomWidth<TLength> | Array<Property$BorderBottomWidth<TLength>>, + borderCollapse?: Property$BorderCollapse | Array<Property$BorderCollapse>, + borderEndEndRadius?: Property$BorderEndEndRadius<TLength> | Array<Property$BorderEndEndRadius<TLength>>, + borderEndStartRadius?: Property$BorderEndStartRadius<TLength> | Array<Property$BorderEndStartRadius<TLength>>, + borderImageOutset?: Property$BorderImageOutset<TLength> | Array<Property$BorderImageOutset<TLength>>, + borderImageRepeat?: Property$BorderImageRepeat | Array<Property$BorderImageRepeat>, + borderImageSlice?: Property$BorderImageSlice | Array<Property$BorderImageSlice>, + borderImageSource?: Property$BorderImageSource | Array<Property$BorderImageSource>, + borderImageWidth?: Property$BorderImageWidth<TLength> | Array<Property$BorderImageWidth<TLength>>, + borderInlineColor?: Property$BorderInlineColor | Array<Property$BorderInlineColor>, + borderInlineEndColor?: Property$BorderInlineEndColor | Array<Property$BorderInlineEndColor>, + borderInlineEndStyle?: Property$BorderInlineEndStyle | Array<Property$BorderInlineEndStyle>, + borderInlineEndWidth?: Property$BorderInlineEndWidth<TLength> | Array<Property$BorderInlineEndWidth<TLength>>, + borderInlineStartColor?: Property$BorderInlineStartColor | Array<Property$BorderInlineStartColor>, + borderInlineStartStyle?: Property$BorderInlineStartStyle | Array<Property$BorderInlineStartStyle>, + borderInlineStartWidth?: Property$BorderInlineStartWidth<TLength> | Array<Property$BorderInlineStartWidth<TLength>>, + borderInlineStyle?: Property$BorderInlineStyle | Array<Property$BorderInlineStyle>, + borderInlineWidth?: Property$BorderInlineWidth<TLength> | Array<Property$BorderInlineWidth<TLength>>, + borderLeftColor?: Property$BorderLeftColor | Array<Property$BorderLeftColor>, + borderLeftStyle?: Property$BorderLeftStyle | Array<Property$BorderLeftStyle>, + borderLeftWidth?: Property$BorderLeftWidth<TLength> | Array<Property$BorderLeftWidth<TLength>>, + borderRightColor?: Property$BorderRightColor | Array<Property$BorderRightColor>, + borderRightStyle?: Property$BorderRightStyle | Array<Property$BorderRightStyle>, + borderRightWidth?: Property$BorderRightWidth<TLength> | Array<Property$BorderRightWidth<TLength>>, + borderSpacing?: Property$BorderSpacing<TLength> | Array<Property$BorderSpacing<TLength>>, + borderStartEndRadius?: Property$BorderStartEndRadius<TLength> | Array<Property$BorderStartEndRadius<TLength>>, + borderStartStartRadius?: Property$BorderStartStartRadius<TLength> | Array<Property$BorderStartStartRadius<TLength>>, + borderTopColor?: Property$BorderTopColor | Array<Property$BorderTopColor>, + borderTopLeftRadius?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + borderTopRightRadius?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + borderTopStyle?: Property$BorderTopStyle | Array<Property$BorderTopStyle>, + borderTopWidth?: Property$BorderTopWidth<TLength> | Array<Property$BorderTopWidth<TLength>>, + bottom?: Property$Bottom<TLength> | Array<Property$Bottom<TLength>>, + boxDecorationBreak?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + boxShadow?: Property$BoxShadow | Array<Property$BoxShadow>, + boxSizing?: Property$BoxSizing | Array<Property$BoxSizing>, + breakAfter?: Property$BreakAfter | Array<Property$BreakAfter>, + breakBefore?: Property$BreakBefore | Array<Property$BreakBefore>, + breakInside?: Property$BreakInside | Array<Property$BreakInside>, + captionSide?: Property$CaptionSide | Array<Property$CaptionSide>, + caretColor?: Property$CaretColor | Array<Property$CaretColor>, + caretShape?: Property$CaretShape | Array<Property$CaretShape>, + clear?: Property$Clear | Array<Property$Clear>, + clipPath?: Property$ClipPath | Array<Property$ClipPath>, + color?: Property$Color | Array<Property$Color>, + colorAdjust?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + colorScheme?: Property$ColorScheme | Array<Property$ColorScheme>, + columnCount?: Property$ColumnCount | Array<Property$ColumnCount>, + columnFill?: Property$ColumnFill | Array<Property$ColumnFill>, + columnGap?: Property$ColumnGap<TLength> | Array<Property$ColumnGap<TLength>>, + columnRuleColor?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + columnRuleStyle?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + columnRuleWidth?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + columnSpan?: Property$ColumnSpan | Array<Property$ColumnSpan>, + columnWidth?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + contain?: Property$Contain | Array<Property$Contain>, + containIntrinsicBlockSize?: Property$ContainIntrinsicBlockSize<TLength> | Array<Property$ContainIntrinsicBlockSize<TLength>>, + containIntrinsicHeight?: Property$ContainIntrinsicHeight<TLength> | Array<Property$ContainIntrinsicHeight<TLength>>, + containIntrinsicInlineSize?: Property$ContainIntrinsicInlineSize<TLength> | Array<Property$ContainIntrinsicInlineSize<TLength>>, + containIntrinsicWidth?: Property$ContainIntrinsicWidth<TLength> | Array<Property$ContainIntrinsicWidth<TLength>>, + containerName?: Property$ContainerName | Array<Property$ContainerName>, + containerType?: Property$ContainerType | Array<Property$ContainerType>, + content?: Property$Content | Array<Property$Content>, + contentVisibility?: Property$ContentVisibility | Array<Property$ContentVisibility>, + counterIncrement?: Property$CounterIncrement | Array<Property$CounterIncrement>, + counterReset?: Property$CounterReset | Array<Property$CounterReset>, + counterSet?: Property$CounterSet | Array<Property$CounterSet>, + cursor?: Property$Cursor | Array<Property$Cursor>, + direction?: Property$Direction | Array<Property$Direction>, + display?: Property$Display | Array<Property$Display>, + emptyCells?: Property$EmptyCells | Array<Property$EmptyCells>, + filter?: Property$Filter | Array<Property$Filter>, + flexBasis?: Property$FlexBasis<TLength> | Array<Property$FlexBasis<TLength>>, + flexDirection?: Property$FlexDirection | Array<Property$FlexDirection>, + flexGrow?: Property$FlexGrow | Array<Property$FlexGrow>, + flexShrink?: Property$FlexShrink | Array<Property$FlexShrink>, + flexWrap?: Property$FlexWrap | Array<Property$FlexWrap>, + float?: Property$Float | Array<Property$Float>, + fontFamily?: Property$FontFamily | Array<Property$FontFamily>, + fontFeatureSettings?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + fontKerning?: Property$FontKerning | Array<Property$FontKerning>, + fontLanguageOverride?: Property$FontLanguageOverride | Array<Property$FontLanguageOverride>, + fontOpticalSizing?: Property$FontOpticalSizing | Array<Property$FontOpticalSizing>, + fontPalette?: Property$FontPalette | Array<Property$FontPalette>, + fontSize?: Property$FontSize<TLength> | Array<Property$FontSize<TLength>>, + fontSizeAdjust?: Property$FontSizeAdjust | Array<Property$FontSizeAdjust>, + fontSmooth?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + fontStretch?: Property$FontStretch | Array<Property$FontStretch>, + fontStyle?: Property$FontStyle | Array<Property$FontStyle>, + fontSynthesis?: Property$FontSynthesis | Array<Property$FontSynthesis>, + fontSynthesisPosition?: Property$FontSynthesisPosition | Array<Property$FontSynthesisPosition>, + fontSynthesisSmallCaps?: Property$FontSynthesisSmallCaps | Array<Property$FontSynthesisSmallCaps>, + fontSynthesisStyle?: Property$FontSynthesisStyle | Array<Property$FontSynthesisStyle>, + fontSynthesisWeight?: Property$FontSynthesisWeight | Array<Property$FontSynthesisWeight>, + fontVariant?: Property$FontVariant | Array<Property$FontVariant>, + fontVariantAlternates?: Property$FontVariantAlternates | Array<Property$FontVariantAlternates>, + fontVariantCaps?: Property$FontVariantCaps | Array<Property$FontVariantCaps>, + fontVariantEastAsian?: Property$FontVariantEastAsian | Array<Property$FontVariantEastAsian>, + fontVariantEmoji?: Property$FontVariantEmoji | Array<Property$FontVariantEmoji>, + fontVariantLigatures?: Property$FontVariantLigatures | Array<Property$FontVariantLigatures>, + fontVariantNumeric?: Property$FontVariantNumeric | Array<Property$FontVariantNumeric>, + fontVariantPosition?: Property$FontVariantPosition | Array<Property$FontVariantPosition>, + fontVariationSettings?: Property$FontVariationSettings | Array<Property$FontVariationSettings>, + fontWeight?: Property$FontWeight | Array<Property$FontWeight>, + forcedColorAdjust?: Property$ForcedColorAdjust | Array<Property$ForcedColorAdjust>, + gridAutoColumns?: Property$GridAutoColumns<TLength> | Array<Property$GridAutoColumns<TLength>>, + gridAutoFlow?: Property$GridAutoFlow | Array<Property$GridAutoFlow>, + gridAutoRows?: Property$GridAutoRows<TLength> | Array<Property$GridAutoRows<TLength>>, + gridColumnEnd?: Property$GridColumnEnd | Array<Property$GridColumnEnd>, + gridColumnStart?: Property$GridColumnStart | Array<Property$GridColumnStart>, + gridRowEnd?: Property$GridRowEnd | Array<Property$GridRowEnd>, + gridRowStart?: Property$GridRowStart | Array<Property$GridRowStart>, + gridTemplateAreas?: Property$GridTemplateAreas | Array<Property$GridTemplateAreas>, + gridTemplateColumns?: Property$GridTemplateColumns<TLength> | Array<Property$GridTemplateColumns<TLength>>, + gridTemplateRows?: Property$GridTemplateRows<TLength> | Array<Property$GridTemplateRows<TLength>>, + hangingPunctuation?: Property$HangingPunctuation | Array<Property$HangingPunctuation>, + height?: Property$Height<TLength> | Array<Property$Height<TLength>>, + hyphenateCharacter?: Property$HyphenateCharacter | Array<Property$HyphenateCharacter>, + hyphenateLimitChars?: Property$HyphenateLimitChars | Array<Property$HyphenateLimitChars>, + hyphens?: Property$Hyphens | Array<Property$Hyphens>, + imageOrientation?: Property$ImageOrientation | Array<Property$ImageOrientation>, + imageRendering?: Property$ImageRendering | Array<Property$ImageRendering>, + imageResolution?: Property$ImageResolution | Array<Property$ImageResolution>, + initialLetter?: Property$InitialLetter | Array<Property$InitialLetter>, + inlineSize?: Property$InlineSize<TLength> | Array<Property$InlineSize<TLength>>, + inputSecurity?: Property$InputSecurity | Array<Property$InputSecurity>, + insetBlockEnd?: Property$InsetBlockEnd<TLength> | Array<Property$InsetBlockEnd<TLength>>, + insetBlockStart?: Property$InsetBlockStart<TLength> | Array<Property$InsetBlockStart<TLength>>, + insetInlineEnd?: Property$InsetInlineEnd<TLength> | Array<Property$InsetInlineEnd<TLength>>, + insetInlineStart?: Property$InsetInlineStart<TLength> | Array<Property$InsetInlineStart<TLength>>, + isolation?: Property$Isolation | Array<Property$Isolation>, + justifyContent?: Property$JustifyContent | Array<Property$JustifyContent>, + justifyItems?: Property$JustifyItems | Array<Property$JustifyItems>, + justifySelf?: Property$JustifySelf | Array<Property$JustifySelf>, + justifyTracks?: Property$JustifyTracks | Array<Property$JustifyTracks>, + left?: Property$Left<TLength> | Array<Property$Left<TLength>>, + letterSpacing?: Property$LetterSpacing<TLength> | Array<Property$LetterSpacing<TLength>>, + lineBreak?: Property$LineBreak | Array<Property$LineBreak>, + lineHeight?: Property$LineHeight<TLength> | Array<Property$LineHeight<TLength>>, + lineHeightStep?: Property$LineHeightStep<TLength> | Array<Property$LineHeightStep<TLength>>, + listStyleImage?: Property$ListStyleImage | Array<Property$ListStyleImage>, + listStylePosition?: Property$ListStylePosition | Array<Property$ListStylePosition>, + listStyleType?: Property$ListStyleType | Array<Property$ListStyleType>, + marginBlockEnd?: Property$MarginBlockEnd<TLength> | Array<Property$MarginBlockEnd<TLength>>, + marginBlockStart?: Property$MarginBlockStart<TLength> | Array<Property$MarginBlockStart<TLength>>, + marginBottom?: Property$MarginBottom<TLength> | Array<Property$MarginBottom<TLength>>, + marginInlineEnd?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + marginInlineStart?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + marginLeft?: Property$MarginLeft<TLength> | Array<Property$MarginLeft<TLength>>, + marginRight?: Property$MarginRight<TLength> | Array<Property$MarginRight<TLength>>, + marginTop?: Property$MarginTop<TLength> | Array<Property$MarginTop<TLength>>, + marginTrim?: Property$MarginTrim | Array<Property$MarginTrim>, + maskBorderMode?: Property$MaskBorderMode | Array<Property$MaskBorderMode>, + maskBorderOutset?: Property$MaskBorderOutset<TLength> | Array<Property$MaskBorderOutset<TLength>>, + maskBorderRepeat?: Property$MaskBorderRepeat | Array<Property$MaskBorderRepeat>, + maskBorderSlice?: Property$MaskBorderSlice | Array<Property$MaskBorderSlice>, + maskBorderSource?: Property$MaskBorderSource | Array<Property$MaskBorderSource>, + maskBorderWidth?: Property$MaskBorderWidth<TLength> | Array<Property$MaskBorderWidth<TLength>>, + maskClip?: Property$MaskClip | Array<Property$MaskClip>, + maskComposite?: Property$MaskComposite | Array<Property$MaskComposite>, + maskImage?: Property$MaskImage | Array<Property$MaskImage>, + maskMode?: Property$MaskMode | Array<Property$MaskMode>, + maskOrigin?: Property$MaskOrigin | Array<Property$MaskOrigin>, + maskPosition?: Property$MaskPosition<TLength> | Array<Property$MaskPosition<TLength>>, + maskRepeat?: Property$MaskRepeat | Array<Property$MaskRepeat>, + maskSize?: Property$MaskSize<TLength> | Array<Property$MaskSize<TLength>>, + maskType?: Property$MaskType | Array<Property$MaskType>, + masonryAutoFlow?: Property$MasonryAutoFlow | Array<Property$MasonryAutoFlow>, + mathDepth?: Property$MathDepth | Array<Property$MathDepth>, + mathShift?: Property$MathShift | Array<Property$MathShift>, + mathStyle?: Property$MathStyle | Array<Property$MathStyle>, + maxBlockSize?: Property$MaxBlockSize<TLength> | Array<Property$MaxBlockSize<TLength>>, + maxHeight?: Property$MaxHeight<TLength> | Array<Property$MaxHeight<TLength>>, + maxInlineSize?: Property$MaxInlineSize<TLength> | Array<Property$MaxInlineSize<TLength>>, + maxLines?: Property$MaxLines | Array<Property$MaxLines>, + maxWidth?: Property$MaxWidth<TLength> | Array<Property$MaxWidth<TLength>>, + minBlockSize?: Property$MinBlockSize<TLength> | Array<Property$MinBlockSize<TLength>>, + minHeight?: Property$MinHeight<TLength> | Array<Property$MinHeight<TLength>>, + minInlineSize?: Property$MinInlineSize<TLength> | Array<Property$MinInlineSize<TLength>>, + minWidth?: Property$MinWidth<TLength> | Array<Property$MinWidth<TLength>>, + mixBlendMode?: Property$MixBlendMode | Array<Property$MixBlendMode>, + motionDistance?: Property$OffsetDistance<TLength> | Array<Property$OffsetDistance<TLength>>, + motionPath?: Property$OffsetPath | Array<Property$OffsetPath>, + motionRotation?: Property$OffsetRotate | Array<Property$OffsetRotate>, + objectFit?: Property$ObjectFit | Array<Property$ObjectFit>, + objectPosition?: Property$ObjectPosition<TLength> | Array<Property$ObjectPosition<TLength>>, + offsetAnchor?: Property$OffsetAnchor<TLength> | Array<Property$OffsetAnchor<TLength>>, + offsetDistance?: Property$OffsetDistance<TLength> | Array<Property$OffsetDistance<TLength>>, + offsetPath?: Property$OffsetPath | Array<Property$OffsetPath>, + offsetPosition?: Property$OffsetPosition<TLength> | Array<Property$OffsetPosition<TLength>>, + offsetRotate?: Property$OffsetRotate | Array<Property$OffsetRotate>, + offsetRotation?: Property$OffsetRotate | Array<Property$OffsetRotate>, + opacity?: Property$Opacity | Array<Property$Opacity>, + order?: Property$Order | Array<Property$Order>, + orphans?: Property$Orphans | Array<Property$Orphans>, + outlineColor?: Property$OutlineColor | Array<Property$OutlineColor>, + outlineOffset?: Property$OutlineOffset<TLength> | Array<Property$OutlineOffset<TLength>>, + outlineStyle?: Property$OutlineStyle | Array<Property$OutlineStyle>, + outlineWidth?: Property$OutlineWidth<TLength> | Array<Property$OutlineWidth<TLength>>, + overflowAnchor?: Property$OverflowAnchor | Array<Property$OverflowAnchor>, + overflowBlock?: Property$OverflowBlock | Array<Property$OverflowBlock>, + overflowClipBox?: Property$OverflowClipBox | Array<Property$OverflowClipBox>, + overflowClipMargin?: Property$OverflowClipMargin<TLength> | Array<Property$OverflowClipMargin<TLength>>, + overflowInline?: Property$OverflowInline | Array<Property$OverflowInline>, + overflowWrap?: Property$OverflowWrap | Array<Property$OverflowWrap>, + overflowX?: Property$OverflowX | Array<Property$OverflowX>, + overflowY?: Property$OverflowY | Array<Property$OverflowY>, + overlay?: Property$Overlay | Array<Property$Overlay>, + overscrollBehaviorBlock?: Property$OverscrollBehaviorBlock | Array<Property$OverscrollBehaviorBlock>, + overscrollBehaviorInline?: Property$OverscrollBehaviorInline | Array<Property$OverscrollBehaviorInline>, + overscrollBehaviorX?: Property$OverscrollBehaviorX | Array<Property$OverscrollBehaviorX>, + overscrollBehaviorY?: Property$OverscrollBehaviorY | Array<Property$OverscrollBehaviorY>, + paddingBlockEnd?: Property$PaddingBlockEnd<TLength> | Array<Property$PaddingBlockEnd<TLength>>, + paddingBlockStart?: Property$PaddingBlockStart<TLength> | Array<Property$PaddingBlockStart<TLength>>, + paddingBottom?: Property$PaddingBottom<TLength> | Array<Property$PaddingBottom<TLength>>, + paddingInlineEnd?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + paddingInlineStart?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + paddingLeft?: Property$PaddingLeft<TLength> | Array<Property$PaddingLeft<TLength>>, + paddingRight?: Property$PaddingRight<TLength> | Array<Property$PaddingRight<TLength>>, + paddingTop?: Property$PaddingTop<TLength> | Array<Property$PaddingTop<TLength>>, + page?: Property$Page | Array<Property$Page>, + pageBreakAfter?: Property$PageBreakAfter | Array<Property$PageBreakAfter>, + pageBreakBefore?: Property$PageBreakBefore | Array<Property$PageBreakBefore>, + pageBreakInside?: Property$PageBreakInside | Array<Property$PageBreakInside>, + paintOrder?: Property$PaintOrder | Array<Property$PaintOrder>, + perspective?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + perspectiveOrigin?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + pointerEvents?: Property$PointerEvents | Array<Property$PointerEvents>, + position?: Property$Position | Array<Property$Position>, + printColorAdjust?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + quotes?: Property$Quotes | Array<Property$Quotes>, + resize?: Property$Resize | Array<Property$Resize>, + right?: Property$Right<TLength> | Array<Property$Right<TLength>>, + rotate?: Property$Rotate | Array<Property$Rotate>, + rowGap?: Property$RowGap<TLength> | Array<Property$RowGap<TLength>>, + rubyAlign?: Property$RubyAlign | Array<Property$RubyAlign>, + rubyMerge?: Property$RubyMerge | Array<Property$RubyMerge>, + rubyPosition?: Property$RubyPosition | Array<Property$RubyPosition>, + scale?: Property$Scale | Array<Property$Scale>, + scrollBehavior?: Property$ScrollBehavior | Array<Property$ScrollBehavior>, + scrollMarginBlockEnd?: Property$ScrollMarginBlockEnd<TLength> | Array<Property$ScrollMarginBlockEnd<TLength>>, + scrollMarginBlockStart?: Property$ScrollMarginBlockStart<TLength> | Array<Property$ScrollMarginBlockStart<TLength>>, + scrollMarginBottom?: Property$ScrollMarginBottom<TLength> | Array<Property$ScrollMarginBottom<TLength>>, + scrollMarginInlineEnd?: Property$ScrollMarginInlineEnd<TLength> | Array<Property$ScrollMarginInlineEnd<TLength>>, + scrollMarginInlineStart?: Property$ScrollMarginInlineStart<TLength> | Array<Property$ScrollMarginInlineStart<TLength>>, + scrollMarginLeft?: Property$ScrollMarginLeft<TLength> | Array<Property$ScrollMarginLeft<TLength>>, + scrollMarginRight?: Property$ScrollMarginRight<TLength> | Array<Property$ScrollMarginRight<TLength>>, + scrollMarginTop?: Property$ScrollMarginTop<TLength> | Array<Property$ScrollMarginTop<TLength>>, + scrollPaddingBlockEnd?: Property$ScrollPaddingBlockEnd<TLength> | Array<Property$ScrollPaddingBlockEnd<TLength>>, + scrollPaddingBlockStart?: Property$ScrollPaddingBlockStart<TLength> | Array<Property$ScrollPaddingBlockStart<TLength>>, + scrollPaddingBottom?: Property$ScrollPaddingBottom<TLength> | Array<Property$ScrollPaddingBottom<TLength>>, + scrollPaddingInlineEnd?: Property$ScrollPaddingInlineEnd<TLength> | Array<Property$ScrollPaddingInlineEnd<TLength>>, + scrollPaddingInlineStart?: Property$ScrollPaddingInlineStart<TLength> | Array<Property$ScrollPaddingInlineStart<TLength>>, + scrollPaddingLeft?: Property$ScrollPaddingLeft<TLength> | Array<Property$ScrollPaddingLeft<TLength>>, + scrollPaddingRight?: Property$ScrollPaddingRight<TLength> | Array<Property$ScrollPaddingRight<TLength>>, + scrollPaddingTop?: Property$ScrollPaddingTop<TLength> | Array<Property$ScrollPaddingTop<TLength>>, + scrollSnapAlign?: Property$ScrollSnapAlign | Array<Property$ScrollSnapAlign>, + scrollSnapMarginBottom?: Property$ScrollMarginBottom<TLength> | Array<Property$ScrollMarginBottom<TLength>>, + scrollSnapMarginLeft?: Property$ScrollMarginLeft<TLength> | Array<Property$ScrollMarginLeft<TLength>>, + scrollSnapMarginRight?: Property$ScrollMarginRight<TLength> | Array<Property$ScrollMarginRight<TLength>>, + scrollSnapMarginTop?: Property$ScrollMarginTop<TLength> | Array<Property$ScrollMarginTop<TLength>>, + scrollSnapStop?: Property$ScrollSnapStop | Array<Property$ScrollSnapStop>, + scrollSnapType?: Property$ScrollSnapType | Array<Property$ScrollSnapType>, + scrollTimelineAxis?: Property$ScrollTimelineAxis | Array<Property$ScrollTimelineAxis>, + scrollTimelineName?: Property$ScrollTimelineName | Array<Property$ScrollTimelineName>, + scrollbarColor?: Property$ScrollbarColor | Array<Property$ScrollbarColor>, + scrollbarGutter?: Property$ScrollbarGutter | Array<Property$ScrollbarGutter>, + scrollbarWidth?: Property$ScrollbarWidth | Array<Property$ScrollbarWidth>, + shapeImageThreshold?: Property$ShapeImageThreshold | Array<Property$ShapeImageThreshold>, + shapeMargin?: Property$ShapeMargin<TLength> | Array<Property$ShapeMargin<TLength>>, + shapeOutside?: Property$ShapeOutside | Array<Property$ShapeOutside>, + tabSize?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + tableLayout?: Property$TableLayout | Array<Property$TableLayout>, + textAlign?: Property$TextAlign | Array<Property$TextAlign>, + textAlignLast?: Property$TextAlignLast | Array<Property$TextAlignLast>, + textCombineUpright?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + textDecorationColor?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + textDecorationLine?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + textDecorationSkip?: Property$TextDecorationSkip | Array<Property$TextDecorationSkip>, + textDecorationSkipInk?: Property$TextDecorationSkipInk | Array<Property$TextDecorationSkipInk>, + textDecorationStyle?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + textDecorationThickness?: Property$TextDecorationThickness<TLength> | Array<Property$TextDecorationThickness<TLength>>, + textEmphasisColor?: Property$TextEmphasisColor | Array<Property$TextEmphasisColor>, + textEmphasisPosition?: Property$TextEmphasisPosition | Array<Property$TextEmphasisPosition>, + textEmphasisStyle?: Property$TextEmphasisStyle | Array<Property$TextEmphasisStyle>, + textIndent?: Property$TextIndent<TLength> | Array<Property$TextIndent<TLength>>, + textJustify?: Property$TextJustify | Array<Property$TextJustify>, + textOrientation?: Property$TextOrientation | Array<Property$TextOrientation>, + textOverflow?: Property$TextOverflow | Array<Property$TextOverflow>, + textRendering?: Property$TextRendering | Array<Property$TextRendering>, + textShadow?: Property$TextShadow | Array<Property$TextShadow>, + textSizeAdjust?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + textTransform?: Property$TextTransform | Array<Property$TextTransform>, + textUnderlineOffset?: Property$TextUnderlineOffset<TLength> | Array<Property$TextUnderlineOffset<TLength>>, + textUnderlinePosition?: Property$TextUnderlinePosition | Array<Property$TextUnderlinePosition>, + textWrap?: Property$TextWrap | Array<Property$TextWrap>, + timelineScope?: Property$TimelineScope | Array<Property$TimelineScope>, + top?: Property$Top<TLength> | Array<Property$Top<TLength>>, + touchAction?: Property$TouchAction | Array<Property$TouchAction>, + transform?: Property$Transform | Array<Property$Transform>, + transformBox?: Property$TransformBox | Array<Property$TransformBox>, + transformOrigin?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + transformStyle?: Property$TransformStyle | Array<Property$TransformStyle>, + transitionBehavior?: Property$TransitionBehavior | Array<Property$TransitionBehavior>, + transitionDelay?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + transitionDuration?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + transitionProperty?: Property$TransitionProperty | Array<Property$TransitionProperty>, + transitionTimingFunction?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + translate?: Property$Translate<TLength> | Array<Property$Translate<TLength>>, + unicodeBidi?: Property$UnicodeBidi | Array<Property$UnicodeBidi>, + userSelect?: Property$UserSelect | Array<Property$UserSelect>, + verticalAlign?: Property$VerticalAlign<TLength> | Array<Property$VerticalAlign<TLength>>, + viewTimelineAxis?: Property$ViewTimelineAxis | Array<Property$ViewTimelineAxis>, + viewTimelineInset?: Property$ViewTimelineInset<TLength> | Array<Property$ViewTimelineInset<TLength>>, + viewTimelineName?: Property$ViewTimelineName | Array<Property$ViewTimelineName>, + viewTransitionName?: Property$ViewTransitionName | Array<Property$ViewTransitionName>, + visibility?: Property$Visibility | Array<Property$Visibility>, + whiteSpace?: Property$WhiteSpace | Array<Property$WhiteSpace>, + whiteSpaceCollapse?: Property$WhiteSpaceCollapse | Array<Property$WhiteSpaceCollapse>, + whiteSpaceTrim?: Property$WhiteSpaceTrim | Array<Property$WhiteSpaceTrim>, + widows?: Property$Widows | Array<Property$Widows>, + width?: Property$Width<TLength> | Array<Property$Width<TLength>>, + willChange?: Property$WillChange | Array<Property$WillChange>, + wordBreak?: Property$WordBreak | Array<Property$WordBreak>, + wordSpacing?: Property$WordSpacing<TLength> | Array<Property$WordSpacing<TLength>>, + wordWrap?: Property$WordWrap | Array<Property$WordWrap>, + writingMode?: Property$WritingMode | Array<Property$WritingMode>, + zIndex?: Property$ZIndex | Array<Property$ZIndex>, + zoom?: Property$Zoom | Array<Property$Zoom>, +|}; + +export type StandardShorthandPropertiesFallback<TLength = string | 0, TTime = string> = {| + all?: Property$All | Array<Property$All>, + animation?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + animationRange?: Property$AnimationRange<TLength> | Array<Property$AnimationRange<TLength>>, + background?: Property$Background<TLength> | Array<Property$Background<TLength>>, + backgroundPosition?: Property$BackgroundPosition<TLength> | Array<Property$BackgroundPosition<TLength>>, + border?: Property$Border<TLength> | Array<Property$Border<TLength>>, + borderBlock?: Property$BorderBlock<TLength> | Array<Property$BorderBlock<TLength>>, + borderBlockEnd?: Property$BorderBlockEnd<TLength> | Array<Property$BorderBlockEnd<TLength>>, + borderBlockStart?: Property$BorderBlockStart<TLength> | Array<Property$BorderBlockStart<TLength>>, + borderBottom?: Property$BorderBottom<TLength> | Array<Property$BorderBottom<TLength>>, + borderColor?: Property$BorderColor | Array<Property$BorderColor>, + borderImage?: Property$BorderImage | Array<Property$BorderImage>, + borderInline?: Property$BorderInline<TLength> | Array<Property$BorderInline<TLength>>, + borderInlineEnd?: Property$BorderInlineEnd<TLength> | Array<Property$BorderInlineEnd<TLength>>, + borderInlineStart?: Property$BorderInlineStart<TLength> | Array<Property$BorderInlineStart<TLength>>, + borderLeft?: Property$BorderLeft<TLength> | Array<Property$BorderLeft<TLength>>, + borderRadius?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + borderRight?: Property$BorderRight<TLength> | Array<Property$BorderRight<TLength>>, + borderStyle?: Property$BorderStyle | Array<Property$BorderStyle>, + borderTop?: Property$BorderTop<TLength> | Array<Property$BorderTop<TLength>>, + borderWidth?: Property$BorderWidth<TLength> | Array<Property$BorderWidth<TLength>>, + caret?: Property$Caret | Array<Property$Caret>, + columnRule?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + columns?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + containIntrinsicSize?: Property$ContainIntrinsicSize<TLength> | Array<Property$ContainIntrinsicSize<TLength>>, + container?: Property$Container | Array<Property$Container>, + flex?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + flexFlow?: Property$FlexFlow | Array<Property$FlexFlow>, + font?: Property$Font | Array<Property$Font>, + gap?: Property$Gap<TLength> | Array<Property$Gap<TLength>>, + grid?: Property$Grid | Array<Property$Grid>, + gridArea?: Property$GridArea | Array<Property$GridArea>, + gridColumn?: Property$GridColumn | Array<Property$GridColumn>, + gridRow?: Property$GridRow | Array<Property$GridRow>, + gridTemplate?: Property$GridTemplate | Array<Property$GridTemplate>, + inset?: Property$Inset<TLength> | Array<Property$Inset<TLength>>, + insetBlock?: Property$InsetBlock<TLength> | Array<Property$InsetBlock<TLength>>, + insetInline?: Property$InsetInline<TLength> | Array<Property$InsetInline<TLength>>, + lineClamp?: Property$LineClamp | Array<Property$LineClamp>, + listStyle?: Property$ListStyle | Array<Property$ListStyle>, + margin?: Property$Margin<TLength> | Array<Property$Margin<TLength>>, + marginBlock?: Property$MarginBlock<TLength> | Array<Property$MarginBlock<TLength>>, + marginInline?: Property$MarginInline<TLength> | Array<Property$MarginInline<TLength>>, + mask?: Property$Mask<TLength> | Array<Property$Mask<TLength>>, + maskBorder?: Property$MaskBorder | Array<Property$MaskBorder>, + motion?: Property$Offset<TLength> | Array<Property$Offset<TLength>>, + offset?: Property$Offset<TLength> | Array<Property$Offset<TLength>>, + outline?: Property$Outline<TLength> | Array<Property$Outline<TLength>>, + overflow?: Property$Overflow | Array<Property$Overflow>, + overscrollBehavior?: Property$OverscrollBehavior | Array<Property$OverscrollBehavior>, + padding?: Property$Padding<TLength> | Array<Property$Padding<TLength>>, + paddingBlock?: Property$PaddingBlock<TLength> | Array<Property$PaddingBlock<TLength>>, + paddingInline?: Property$PaddingInline<TLength> | Array<Property$PaddingInline<TLength>>, + placeContent?: Property$PlaceContent | Array<Property$PlaceContent>, + placeItems?: Property$PlaceItems | Array<Property$PlaceItems>, + placeSelf?: Property$PlaceSelf | Array<Property$PlaceSelf>, + scrollMargin?: Property$ScrollMargin<TLength> | Array<Property$ScrollMargin<TLength>>, + scrollMarginBlock?: Property$ScrollMarginBlock<TLength> | Array<Property$ScrollMarginBlock<TLength>>, + scrollMarginInline?: Property$ScrollMarginInline<TLength> | Array<Property$ScrollMarginInline<TLength>>, + scrollPadding?: Property$ScrollPadding<TLength> | Array<Property$ScrollPadding<TLength>>, + scrollPaddingBlock?: Property$ScrollPaddingBlock<TLength> | Array<Property$ScrollPaddingBlock<TLength>>, + scrollPaddingInline?: Property$ScrollPaddingInline<TLength> | Array<Property$ScrollPaddingInline<TLength>>, + scrollSnapMargin?: Property$ScrollMargin<TLength> | Array<Property$ScrollMargin<TLength>>, + scrollTimeline?: Property$ScrollTimeline | Array<Property$ScrollTimeline>, + textDecoration?: Property$TextDecoration<TLength> | Array<Property$TextDecoration<TLength>>, + textEmphasis?: Property$TextEmphasis | Array<Property$TextEmphasis>, + transition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + viewTimeline?: Property$ViewTimeline | Array<Property$ViewTimeline>, +|}; + +export type StandardPropertiesFallback<TLength = string | 0, TTime = string> = {| + ...StandardLonghandPropertiesFallback<TLength, TTime>, + ...StandardShorthandPropertiesFallback<TLength, TTime>, +|}; + +export type VendorLonghandPropertiesFallback<TLength = string | 0, TTime = string> = {| + MozAnimationDelay?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + MozAnimationDirection?: Property$AnimationDirection | Array<Property$AnimationDirection>, + MozAnimationDuration?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + MozAnimationFillMode?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + MozAnimationIterationCount?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + MozAnimationName?: Property$AnimationName | Array<Property$AnimationName>, + MozAnimationPlayState?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + MozAnimationTimingFunction?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + MozAppearance?: Property$MozAppearance | Array<Property$MozAppearance>, + MozBinding?: Property$MozBinding | Array<Property$MozBinding>, + MozBorderBottomColors?: Property$MozBorderBottomColors | Array<Property$MozBorderBottomColors>, + MozBorderEndColor?: Property$BorderInlineEndColor | Array<Property$BorderInlineEndColor>, + MozBorderEndStyle?: Property$BorderInlineEndStyle | Array<Property$BorderInlineEndStyle>, + MozBorderEndWidth?: Property$BorderInlineEndWidth<TLength> | Array<Property$BorderInlineEndWidth<TLength>>, + MozBorderLeftColors?: Property$MozBorderLeftColors | Array<Property$MozBorderLeftColors>, + MozBorderRightColors?: Property$MozBorderRightColors | Array<Property$MozBorderRightColors>, + MozBorderStartColor?: Property$BorderInlineStartColor | Array<Property$BorderInlineStartColor>, + MozBorderStartStyle?: Property$BorderInlineStartStyle | Array<Property$BorderInlineStartStyle>, + MozBorderTopColors?: Property$MozBorderTopColors | Array<Property$MozBorderTopColors>, + MozBoxSizing?: Property$BoxSizing | Array<Property$BoxSizing>, + MozColumnCount?: Property$ColumnCount | Array<Property$ColumnCount>, + MozColumnFill?: Property$ColumnFill | Array<Property$ColumnFill>, + MozColumnRuleColor?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + MozColumnRuleStyle?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + MozColumnRuleWidth?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + MozColumnWidth?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + MozContextProperties?: Property$MozContextProperties | Array<Property$MozContextProperties>, + MozFontFeatureSettings?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + MozFontLanguageOverride?: Property$FontLanguageOverride | Array<Property$FontLanguageOverride>, + MozHyphens?: Property$Hyphens | Array<Property$Hyphens>, + MozImageRegion?: Property$MozImageRegion | Array<Property$MozImageRegion>, + MozMarginEnd?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + MozMarginStart?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + MozOrient?: Property$MozOrient | Array<Property$MozOrient>, + MozOsxFontSmoothing?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + MozOutlineRadiusBottomleft?: Property$MozOutlineRadiusBottomleft<TLength> | Array<Property$MozOutlineRadiusBottomleft<TLength>>, + MozOutlineRadiusBottomright?: Property$MozOutlineRadiusBottomright<TLength> | Array<Property$MozOutlineRadiusBottomright<TLength>>, + MozOutlineRadiusTopleft?: Property$MozOutlineRadiusTopleft<TLength> | Array<Property$MozOutlineRadiusTopleft<TLength>>, + MozOutlineRadiusTopright?: Property$MozOutlineRadiusTopright<TLength> | Array<Property$MozOutlineRadiusTopright<TLength>>, + MozPaddingEnd?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + MozPaddingStart?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + MozStackSizing?: Property$MozStackSizing | Array<Property$MozStackSizing>, + MozTabSize?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + MozTextBlink?: Property$MozTextBlink | Array<Property$MozTextBlink>, + MozTextSizeAdjust?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + MozUserFocus?: Property$MozUserFocus | Array<Property$MozUserFocus>, + MozUserModify?: Property$MozUserModify | Array<Property$MozUserModify>, + MozUserSelect?: Property$UserSelect | Array<Property$UserSelect>, + MozWindowDragging?: Property$MozWindowDragging | Array<Property$MozWindowDragging>, + MozWindowShadow?: Property$MozWindowShadow | Array<Property$MozWindowShadow>, + msAccelerator?: Property$MsAccelerator | Array<Property$MsAccelerator>, + msBlockProgression?: Property$MsBlockProgression | Array<Property$MsBlockProgression>, + msContentZoomChaining?: Property$MsContentZoomChaining | Array<Property$MsContentZoomChaining>, + msContentZoomLimitMax?: Property$MsContentZoomLimitMax | Array<Property$MsContentZoomLimitMax>, + msContentZoomLimitMin?: Property$MsContentZoomLimitMin | Array<Property$MsContentZoomLimitMin>, + msContentZoomSnapPoints?: Property$MsContentZoomSnapPoints | Array<Property$MsContentZoomSnapPoints>, + msContentZoomSnapType?: Property$MsContentZoomSnapType | Array<Property$MsContentZoomSnapType>, + msContentZooming?: Property$MsContentZooming | Array<Property$MsContentZooming>, + msFilter?: Property$MsFilter | Array<Property$MsFilter>, + msFlexDirection?: Property$FlexDirection | Array<Property$FlexDirection>, + msFlexPositive?: Property$FlexGrow | Array<Property$FlexGrow>, + msFlowFrom?: Property$MsFlowFrom | Array<Property$MsFlowFrom>, + msFlowInto?: Property$MsFlowInto | Array<Property$MsFlowInto>, + msGridColumns?: Property$MsGridColumns<TLength> | Array<Property$MsGridColumns<TLength>>, + msGridRows?: Property$MsGridRows<TLength> | Array<Property$MsGridRows<TLength>>, + msHighContrastAdjust?: Property$MsHighContrastAdjust | Array<Property$MsHighContrastAdjust>, + msHyphenateLimitChars?: Property$MsHyphenateLimitChars | Array<Property$MsHyphenateLimitChars>, + msHyphenateLimitLines?: Property$MsHyphenateLimitLines | Array<Property$MsHyphenateLimitLines>, + msHyphenateLimitZone?: Property$MsHyphenateLimitZone<TLength> | Array<Property$MsHyphenateLimitZone<TLength>>, + msHyphens?: Property$Hyphens | Array<Property$Hyphens>, + msImeAlign?: Property$MsImeAlign | Array<Property$MsImeAlign>, + msLineBreak?: Property$LineBreak | Array<Property$LineBreak>, + msOrder?: Property$Order | Array<Property$Order>, + msOverflowStyle?: Property$MsOverflowStyle | Array<Property$MsOverflowStyle>, + msOverflowX?: Property$OverflowX | Array<Property$OverflowX>, + msOverflowY?: Property$OverflowY | Array<Property$OverflowY>, + msScrollChaining?: Property$MsScrollChaining | Array<Property$MsScrollChaining>, + msScrollLimitXMax?: Property$MsScrollLimitXMax<TLength> | Array<Property$MsScrollLimitXMax<TLength>>, + msScrollLimitXMin?: Property$MsScrollLimitXMin<TLength> | Array<Property$MsScrollLimitXMin<TLength>>, + msScrollLimitYMax?: Property$MsScrollLimitYMax<TLength> | Array<Property$MsScrollLimitYMax<TLength>>, + msScrollLimitYMin?: Property$MsScrollLimitYMin<TLength> | Array<Property$MsScrollLimitYMin<TLength>>, + msScrollRails?: Property$MsScrollRails | Array<Property$MsScrollRails>, + msScrollSnapPointsX?: Property$MsScrollSnapPointsX | Array<Property$MsScrollSnapPointsX>, + msScrollSnapPointsY?: Property$MsScrollSnapPointsY | Array<Property$MsScrollSnapPointsY>, + msScrollSnapType?: Property$MsScrollSnapType | Array<Property$MsScrollSnapType>, + msScrollTranslation?: Property$MsScrollTranslation | Array<Property$MsScrollTranslation>, + msScrollbar3dlightColor?: Property$MsScrollbar3dlightColor | Array<Property$MsScrollbar3dlightColor>, + msScrollbarArrowColor?: Property$MsScrollbarArrowColor | Array<Property$MsScrollbarArrowColor>, + msScrollbarBaseColor?: Property$MsScrollbarBaseColor | Array<Property$MsScrollbarBaseColor>, + msScrollbarDarkshadowColor?: Property$MsScrollbarDarkshadowColor | Array<Property$MsScrollbarDarkshadowColor>, + msScrollbarFaceColor?: Property$MsScrollbarFaceColor | Array<Property$MsScrollbarFaceColor>, + msScrollbarHighlightColor?: Property$MsScrollbarHighlightColor | Array<Property$MsScrollbarHighlightColor>, + msScrollbarShadowColor?: Property$MsScrollbarShadowColor | Array<Property$MsScrollbarShadowColor>, + msScrollbarTrackColor?: Property$MsScrollbarTrackColor | Array<Property$MsScrollbarTrackColor>, + msTextAutospace?: Property$MsTextAutospace | Array<Property$MsTextAutospace>, + msTextCombineHorizontal?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + msTextOverflow?: Property$TextOverflow | Array<Property$TextOverflow>, + msTouchAction?: Property$TouchAction | Array<Property$TouchAction>, + msTouchSelect?: Property$MsTouchSelect | Array<Property$MsTouchSelect>, + msTransform?: Property$Transform | Array<Property$Transform>, + msTransformOrigin?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + msTransitionDelay?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + msTransitionDuration?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + msTransitionProperty?: Property$TransitionProperty | Array<Property$TransitionProperty>, + msTransitionTimingFunction?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + msUserSelect?: Property$MsUserSelect | Array<Property$MsUserSelect>, + msWordBreak?: Property$WordBreak | Array<Property$WordBreak>, + msWrapFlow?: Property$MsWrapFlow | Array<Property$MsWrapFlow>, + msWrapMargin?: Property$MsWrapMargin<TLength> | Array<Property$MsWrapMargin<TLength>>, + msWrapThrough?: Property$MsWrapThrough | Array<Property$MsWrapThrough>, + msWritingMode?: Property$WritingMode | Array<Property$WritingMode>, + WebkitAlignContent?: Property$AlignContent | Array<Property$AlignContent>, + WebkitAlignItems?: Property$AlignItems | Array<Property$AlignItems>, + WebkitAlignSelf?: Property$AlignSelf | Array<Property$AlignSelf>, + WebkitAnimationDelay?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + WebkitAnimationDirection?: Property$AnimationDirection | Array<Property$AnimationDirection>, + WebkitAnimationDuration?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + WebkitAnimationFillMode?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + WebkitAnimationIterationCount?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + WebkitAnimationName?: Property$AnimationName | Array<Property$AnimationName>, + WebkitAnimationPlayState?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + WebkitAnimationTimingFunction?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + WebkitAppearance?: Property$WebkitAppearance | Array<Property$WebkitAppearance>, + WebkitBackdropFilter?: Property$BackdropFilter | Array<Property$BackdropFilter>, + WebkitBackfaceVisibility?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + WebkitBackgroundClip?: Property$BackgroundClip | Array<Property$BackgroundClip>, + WebkitBackgroundOrigin?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + WebkitBackgroundSize?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + WebkitBorderBeforeColor?: Property$WebkitBorderBeforeColor | Array<Property$WebkitBorderBeforeColor>, + WebkitBorderBeforeStyle?: Property$WebkitBorderBeforeStyle | Array<Property$WebkitBorderBeforeStyle>, + WebkitBorderBeforeWidth?: Property$WebkitBorderBeforeWidth<TLength> | Array<Property$WebkitBorderBeforeWidth<TLength>>, + WebkitBorderBottomLeftRadius?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + WebkitBorderBottomRightRadius?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + WebkitBorderImageSlice?: Property$BorderImageSlice | Array<Property$BorderImageSlice>, + WebkitBorderTopLeftRadius?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + WebkitBorderTopRightRadius?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + WebkitBoxDecorationBreak?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + WebkitBoxReflect?: Property$WebkitBoxReflect<TLength> | Array<Property$WebkitBoxReflect<TLength>>, + WebkitBoxShadow?: Property$BoxShadow | Array<Property$BoxShadow>, + WebkitBoxSizing?: Property$BoxSizing | Array<Property$BoxSizing>, + WebkitClipPath?: Property$ClipPath | Array<Property$ClipPath>, + WebkitColumnCount?: Property$ColumnCount | Array<Property$ColumnCount>, + WebkitColumnFill?: Property$ColumnFill | Array<Property$ColumnFill>, + WebkitColumnRuleColor?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + WebkitColumnRuleStyle?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + WebkitColumnRuleWidth?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + WebkitColumnSpan?: Property$ColumnSpan | Array<Property$ColumnSpan>, + WebkitColumnWidth?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + WebkitFilter?: Property$Filter | Array<Property$Filter>, + WebkitFlexBasis?: Property$FlexBasis<TLength> | Array<Property$FlexBasis<TLength>>, + WebkitFlexDirection?: Property$FlexDirection | Array<Property$FlexDirection>, + WebkitFlexGrow?: Property$FlexGrow | Array<Property$FlexGrow>, + WebkitFlexShrink?: Property$FlexShrink | Array<Property$FlexShrink>, + WebkitFlexWrap?: Property$FlexWrap | Array<Property$FlexWrap>, + WebkitFontFeatureSettings?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + WebkitFontKerning?: Property$FontKerning | Array<Property$FontKerning>, + WebkitFontSmoothing?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + WebkitFontVariantLigatures?: Property$FontVariantLigatures | Array<Property$FontVariantLigatures>, + WebkitHyphenateCharacter?: Property$HyphenateCharacter | Array<Property$HyphenateCharacter>, + WebkitHyphens?: Property$Hyphens | Array<Property$Hyphens>, + WebkitInitialLetter?: Property$InitialLetter | Array<Property$InitialLetter>, + WebkitJustifyContent?: Property$JustifyContent | Array<Property$JustifyContent>, + WebkitLineBreak?: Property$LineBreak | Array<Property$LineBreak>, + WebkitLineClamp?: Property$WebkitLineClamp | Array<Property$WebkitLineClamp>, + WebkitMarginEnd?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + WebkitMarginStart?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + WebkitMaskAttachment?: Property$WebkitMaskAttachment | Array<Property$WebkitMaskAttachment>, + WebkitMaskBoxImageOutset?: Property$MaskBorderOutset<TLength> | Array<Property$MaskBorderOutset<TLength>>, + WebkitMaskBoxImageRepeat?: Property$MaskBorderRepeat | Array<Property$MaskBorderRepeat>, + WebkitMaskBoxImageSlice?: Property$MaskBorderSlice | Array<Property$MaskBorderSlice>, + WebkitMaskBoxImageSource?: Property$MaskBorderSource | Array<Property$MaskBorderSource>, + WebkitMaskBoxImageWidth?: Property$MaskBorderWidth<TLength> | Array<Property$MaskBorderWidth<TLength>>, + WebkitMaskClip?: Property$WebkitMaskClip | Array<Property$WebkitMaskClip>, + WebkitMaskComposite?: Property$WebkitMaskComposite | Array<Property$WebkitMaskComposite>, + WebkitMaskImage?: Property$WebkitMaskImage | Array<Property$WebkitMaskImage>, + WebkitMaskOrigin?: Property$WebkitMaskOrigin | Array<Property$WebkitMaskOrigin>, + WebkitMaskPosition?: Property$WebkitMaskPosition<TLength> | Array<Property$WebkitMaskPosition<TLength>>, + WebkitMaskPositionX?: Property$WebkitMaskPositionX<TLength> | Array<Property$WebkitMaskPositionX<TLength>>, + WebkitMaskPositionY?: Property$WebkitMaskPositionY<TLength> | Array<Property$WebkitMaskPositionY<TLength>>, + WebkitMaskRepeat?: Property$WebkitMaskRepeat | Array<Property$WebkitMaskRepeat>, + WebkitMaskRepeatX?: Property$WebkitMaskRepeatX | Array<Property$WebkitMaskRepeatX>, + WebkitMaskRepeatY?: Property$WebkitMaskRepeatY | Array<Property$WebkitMaskRepeatY>, + WebkitMaskSize?: Property$WebkitMaskSize<TLength> | Array<Property$WebkitMaskSize<TLength>>, + WebkitMaxInlineSize?: Property$MaxInlineSize<TLength> | Array<Property$MaxInlineSize<TLength>>, + WebkitOrder?: Property$Order | Array<Property$Order>, + WebkitOverflowScrolling?: Property$WebkitOverflowScrolling | Array<Property$WebkitOverflowScrolling>, + WebkitPaddingEnd?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + WebkitPaddingStart?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + WebkitPerspective?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + WebkitPerspectiveOrigin?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + WebkitPrintColorAdjust?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + WebkitRubyPosition?: Property$RubyPosition | Array<Property$RubyPosition>, + WebkitScrollSnapType?: Property$ScrollSnapType | Array<Property$ScrollSnapType>, + WebkitShapeMargin?: Property$ShapeMargin<TLength> | Array<Property$ShapeMargin<TLength>>, + WebkitTapHighlightColor?: Property$WebkitTapHighlightColor | Array<Property$WebkitTapHighlightColor>, + WebkitTextCombine?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + WebkitTextDecorationColor?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + WebkitTextDecorationLine?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + WebkitTextDecorationSkip?: Property$TextDecorationSkip | Array<Property$TextDecorationSkip>, + WebkitTextDecorationStyle?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + WebkitTextEmphasisColor?: Property$TextEmphasisColor | Array<Property$TextEmphasisColor>, + WebkitTextEmphasisPosition?: Property$TextEmphasisPosition | Array<Property$TextEmphasisPosition>, + WebkitTextEmphasisStyle?: Property$TextEmphasisStyle | Array<Property$TextEmphasisStyle>, + WebkitTextFillColor?: Property$WebkitTextFillColor | Array<Property$WebkitTextFillColor>, + WebkitTextOrientation?: Property$TextOrientation | Array<Property$TextOrientation>, + WebkitTextSizeAdjust?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + WebkitTextStrokeColor?: Property$WebkitTextStrokeColor | Array<Property$WebkitTextStrokeColor>, + WebkitTextStrokeWidth?: Property$WebkitTextStrokeWidth<TLength> | Array<Property$WebkitTextStrokeWidth<TLength>>, + WebkitTextUnderlinePosition?: Property$TextUnderlinePosition | Array<Property$TextUnderlinePosition>, + WebkitTouchCallout?: Property$WebkitTouchCallout | Array<Property$WebkitTouchCallout>, + WebkitTransform?: Property$Transform | Array<Property$Transform>, + WebkitTransformOrigin?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + WebkitTransformStyle?: Property$TransformStyle | Array<Property$TransformStyle>, + WebkitTransitionDelay?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + WebkitTransitionDuration?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + WebkitTransitionProperty?: Property$TransitionProperty | Array<Property$TransitionProperty>, + WebkitTransitionTimingFunction?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + WebkitUserModify?: Property$WebkitUserModify | Array<Property$WebkitUserModify>, + WebkitUserSelect?: Property$UserSelect | Array<Property$UserSelect>, + WebkitWritingMode?: Property$WritingMode | Array<Property$WritingMode>, +|}; + +export type VendorShorthandPropertiesFallback<TLength = string | 0, TTime = string> = {| + MozAnimation?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + MozBorderImage?: Property$BorderImage | Array<Property$BorderImage>, + MozColumnRule?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + MozColumns?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + MozOutlineRadius?: Property$MozOutlineRadius<TLength> | Array<Property$MozOutlineRadius<TLength>>, + msContentZoomLimit?: Property$MsContentZoomLimit | Array<Property$MsContentZoomLimit>, + msContentZoomSnap?: Property$MsContentZoomSnap | Array<Property$MsContentZoomSnap>, + msFlex?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + msScrollLimit?: Property$MsScrollLimit | Array<Property$MsScrollLimit>, + msScrollSnapX?: Property$MsScrollSnapX | Array<Property$MsScrollSnapX>, + msScrollSnapY?: Property$MsScrollSnapY | Array<Property$MsScrollSnapY>, + msTransition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + WebkitAnimation?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + WebkitBorderBefore?: Property$WebkitBorderBefore<TLength> | Array<Property$WebkitBorderBefore<TLength>>, + WebkitBorderImage?: Property$BorderImage | Array<Property$BorderImage>, + WebkitBorderRadius?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + WebkitColumnRule?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + WebkitColumns?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + WebkitFlex?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + WebkitFlexFlow?: Property$FlexFlow | Array<Property$FlexFlow>, + WebkitMask?: Property$WebkitMask<TLength> | Array<Property$WebkitMask<TLength>>, + WebkitMaskBoxImage?: Property$MaskBorder | Array<Property$MaskBorder>, + WebkitTextEmphasis?: Property$TextEmphasis | Array<Property$TextEmphasis>, + WebkitTextStroke?: Property$WebkitTextStroke<TLength> | Array<Property$WebkitTextStroke<TLength>>, + WebkitTransition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, +|}; + +export type VendorPropertiesFallback<TLength = string | 0, TTime = string> = {| + ...VendorLonghandPropertiesFallback<TLength, TTime>, + ...VendorShorthandPropertiesFallback<TLength, TTime>, +|}; + +export type ObsoletePropertiesFallback<TLength = string | 0, TTime = string> = {| + azimuth?: Property$Azimuth | Array<Property$Azimuth>, + boxAlign?: Property$BoxAlign | Array<Property$BoxAlign>, + boxDirection?: Property$BoxDirection | Array<Property$BoxDirection>, + boxFlex?: Property$BoxFlex | Array<Property$BoxFlex>, + boxFlexGroup?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + boxLines?: Property$BoxLines | Array<Property$BoxLines>, + boxOrdinalGroup?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + boxOrient?: Property$BoxOrient | Array<Property$BoxOrient>, + boxPack?: Property$BoxPack | Array<Property$BoxPack>, + clip?: Property$Clip | Array<Property$Clip>, + gridColumnGap?: Property$GridColumnGap<TLength> | Array<Property$GridColumnGap<TLength>>, + gridGap?: Property$GridGap<TLength> | Array<Property$GridGap<TLength>>, + gridRowGap?: Property$GridRowGap<TLength> | Array<Property$GridRowGap<TLength>>, + imeMode?: Property$ImeMode | Array<Property$ImeMode>, + offsetBlock?: Property$InsetBlock<TLength> | Array<Property$InsetBlock<TLength>>, + offsetBlockEnd?: Property$InsetBlockEnd<TLength> | Array<Property$InsetBlockEnd<TLength>>, + offsetBlockStart?: Property$InsetBlockStart<TLength> | Array<Property$InsetBlockStart<TLength>>, + offsetInline?: Property$InsetInline<TLength> | Array<Property$InsetInline<TLength>>, + offsetInlineEnd?: Property$InsetInlineEnd<TLength> | Array<Property$InsetInlineEnd<TLength>>, + offsetInlineStart?: Property$InsetInlineStart<TLength> | Array<Property$InsetInlineStart<TLength>>, + scrollSnapCoordinate?: Property$ScrollSnapCoordinate<TLength> | Array<Property$ScrollSnapCoordinate<TLength>>, + scrollSnapDestination?: Property$ScrollSnapDestination<TLength> | Array<Property$ScrollSnapDestination<TLength>>, + scrollSnapPointsX?: Property$ScrollSnapPointsX | Array<Property$ScrollSnapPointsX>, + scrollSnapPointsY?: Property$ScrollSnapPointsY | Array<Property$ScrollSnapPointsY>, + scrollSnapTypeX?: Property$ScrollSnapTypeX | Array<Property$ScrollSnapTypeX>, + scrollSnapTypeY?: Property$ScrollSnapTypeY | Array<Property$ScrollSnapTypeY>, + KhtmlBoxAlign?: Property$BoxAlign | Array<Property$BoxAlign>, + KhtmlBoxDirection?: Property$BoxDirection | Array<Property$BoxDirection>, + KhtmlBoxFlex?: Property$BoxFlex | Array<Property$BoxFlex>, + KhtmlBoxFlexGroup?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + KhtmlBoxLines?: Property$BoxLines | Array<Property$BoxLines>, + KhtmlBoxOrdinalGroup?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + KhtmlBoxOrient?: Property$BoxOrient | Array<Property$BoxOrient>, + KhtmlBoxPack?: Property$BoxPack | Array<Property$BoxPack>, + KhtmlLineBreak?: Property$LineBreak | Array<Property$LineBreak>, + KhtmlOpacity?: Property$Opacity | Array<Property$Opacity>, + KhtmlUserSelect?: Property$UserSelect | Array<Property$UserSelect>, + MozBackfaceVisibility?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + MozBackgroundClip?: Property$BackgroundClip | Array<Property$BackgroundClip>, + MozBackgroundInlinePolicy?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + MozBackgroundOrigin?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + MozBackgroundSize?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + MozBorderRadius?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + MozBorderRadiusBottomleft?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + MozBorderRadiusBottomright?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + MozBorderRadiusTopleft?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + MozBorderRadiusTopright?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + MozBoxAlign?: Property$BoxAlign | Array<Property$BoxAlign>, + MozBoxDirection?: Property$BoxDirection | Array<Property$BoxDirection>, + MozBoxFlex?: Property$BoxFlex | Array<Property$BoxFlex>, + MozBoxOrdinalGroup?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + MozBoxOrient?: Property$BoxOrient | Array<Property$BoxOrient>, + MozBoxPack?: Property$BoxPack | Array<Property$BoxPack>, + MozBoxShadow?: Property$BoxShadow | Array<Property$BoxShadow>, + MozFloatEdge?: Property$MozFloatEdge | Array<Property$MozFloatEdge>, + MozForceBrokenImageIcon?: Property$MozForceBrokenImageIcon | Array<Property$MozForceBrokenImageIcon>, + MozOpacity?: Property$Opacity | Array<Property$Opacity>, + MozOutline?: Property$Outline<TLength> | Array<Property$Outline<TLength>>, + MozOutlineColor?: Property$OutlineColor | Array<Property$OutlineColor>, + MozOutlineStyle?: Property$OutlineStyle | Array<Property$OutlineStyle>, + MozOutlineWidth?: Property$OutlineWidth<TLength> | Array<Property$OutlineWidth<TLength>>, + MozPerspective?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + MozPerspectiveOrigin?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + MozTextAlignLast?: Property$TextAlignLast | Array<Property$TextAlignLast>, + MozTextDecorationColor?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + MozTextDecorationLine?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + MozTextDecorationStyle?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + MozTransform?: Property$Transform | Array<Property$Transform>, + MozTransformOrigin?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + MozTransformStyle?: Property$TransformStyle | Array<Property$TransformStyle>, + MozTransition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + MozTransitionDelay?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + MozTransitionDuration?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + MozTransitionProperty?: Property$TransitionProperty | Array<Property$TransitionProperty>, + MozTransitionTimingFunction?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + MozUserInput?: Property$MozUserInput | Array<Property$MozUserInput>, + msImeMode?: Property$ImeMode | Array<Property$ImeMode>, + OAnimation?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + OAnimationDelay?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + OAnimationDirection?: Property$AnimationDirection | Array<Property$AnimationDirection>, + OAnimationDuration?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + OAnimationFillMode?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + OAnimationIterationCount?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + OAnimationName?: Property$AnimationName | Array<Property$AnimationName>, + OAnimationPlayState?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + OAnimationTimingFunction?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + OBackgroundSize?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + OBorderImage?: Property$BorderImage | Array<Property$BorderImage>, + OObjectFit?: Property$ObjectFit | Array<Property$ObjectFit>, + OObjectPosition?: Property$ObjectPosition<TLength> | Array<Property$ObjectPosition<TLength>>, + OTabSize?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + OTextOverflow?: Property$TextOverflow | Array<Property$TextOverflow>, + OTransform?: Property$Transform | Array<Property$Transform>, + OTransformOrigin?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + OTransition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + OTransitionDelay?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + OTransitionDuration?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + OTransitionProperty?: Property$TransitionProperty | Array<Property$TransitionProperty>, + OTransitionTimingFunction?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + WebkitBoxAlign?: Property$BoxAlign | Array<Property$BoxAlign>, + WebkitBoxDirection?: Property$BoxDirection | Array<Property$BoxDirection>, + WebkitBoxFlex?: Property$BoxFlex | Array<Property$BoxFlex>, + WebkitBoxFlexGroup?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + WebkitBoxLines?: Property$BoxLines | Array<Property$BoxLines>, + WebkitBoxOrdinalGroup?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + WebkitBoxOrient?: Property$BoxOrient | Array<Property$BoxOrient>, + WebkitBoxPack?: Property$BoxPack | Array<Property$BoxPack>, +|}; + +export type SvgPropertiesFallback<TLength = string | 0, TTime = string> = {| + alignmentBaseline?: Property$AlignmentBaseline | Array<Property$AlignmentBaseline>, + baselineShift?: Property$BaselineShift<TLength> | Array<Property$BaselineShift<TLength>>, + clip?: Property$Clip | Array<Property$Clip>, + clipPath?: Property$ClipPath | Array<Property$ClipPath>, + clipRule?: Property$ClipRule | Array<Property$ClipRule>, + color?: Property$Color | Array<Property$Color>, + colorInterpolation?: Property$ColorInterpolation | Array<Property$ColorInterpolation>, + colorRendering?: Property$ColorRendering | Array<Property$ColorRendering>, + cursor?: Property$Cursor | Array<Property$Cursor>, + direction?: Property$Direction | Array<Property$Direction>, + display?: Property$Display | Array<Property$Display>, + dominantBaseline?: Property$DominantBaseline | Array<Property$DominantBaseline>, + fill?: Property$Fill | Array<Property$Fill>, + fillOpacity?: Property$FillOpacity | Array<Property$FillOpacity>, + fillRule?: Property$FillRule | Array<Property$FillRule>, + filter?: Property$Filter | Array<Property$Filter>, + floodColor?: Property$FloodColor | Array<Property$FloodColor>, + floodOpacity?: Property$FloodOpacity | Array<Property$FloodOpacity>, + font?: Property$Font | Array<Property$Font>, + fontFamily?: Property$FontFamily | Array<Property$FontFamily>, + fontSize?: Property$FontSize<TLength> | Array<Property$FontSize<TLength>>, + fontSizeAdjust?: Property$FontSizeAdjust | Array<Property$FontSizeAdjust>, + fontStretch?: Property$FontStretch | Array<Property$FontStretch>, + fontStyle?: Property$FontStyle | Array<Property$FontStyle>, + fontVariant?: Property$FontVariant | Array<Property$FontVariant>, + fontWeight?: Property$FontWeight | Array<Property$FontWeight>, + glyphOrientationVertical?: Property$GlyphOrientationVertical | Array<Property$GlyphOrientationVertical>, + imageRendering?: Property$ImageRendering | Array<Property$ImageRendering>, + letterSpacing?: Property$LetterSpacing<TLength> | Array<Property$LetterSpacing<TLength>>, + lightingColor?: Property$LightingColor | Array<Property$LightingColor>, + lineHeight?: Property$LineHeight<TLength> | Array<Property$LineHeight<TLength>>, + marker?: Property$Marker | Array<Property$Marker>, + markerEnd?: Property$MarkerEnd | Array<Property$MarkerEnd>, + markerMid?: Property$MarkerMid | Array<Property$MarkerMid>, + markerStart?: Property$MarkerStart | Array<Property$MarkerStart>, + mask?: Property$Mask<TLength> | Array<Property$Mask<TLength>>, + opacity?: Property$Opacity | Array<Property$Opacity>, + overflow?: Property$Overflow | Array<Property$Overflow>, + paintOrder?: Property$PaintOrder | Array<Property$PaintOrder>, + pointerEvents?: Property$PointerEvents | Array<Property$PointerEvents>, + shapeRendering?: Property$ShapeRendering | Array<Property$ShapeRendering>, + stopColor?: Property$StopColor | Array<Property$StopColor>, + stopOpacity?: Property$StopOpacity | Array<Property$StopOpacity>, + stroke?: Property$Stroke | Array<Property$Stroke>, + strokeDasharray?: Property$StrokeDasharray<TLength> | Array<Property$StrokeDasharray<TLength>>, + strokeDashoffset?: Property$StrokeDashoffset<TLength> | Array<Property$StrokeDashoffset<TLength>>, + strokeLinecap?: Property$StrokeLinecap | Array<Property$StrokeLinecap>, + strokeLinejoin?: Property$StrokeLinejoin | Array<Property$StrokeLinejoin>, + strokeMiterlimit?: Property$StrokeMiterlimit | Array<Property$StrokeMiterlimit>, + strokeOpacity?: Property$StrokeOpacity | Array<Property$StrokeOpacity>, + strokeWidth?: Property$StrokeWidth<TLength> | Array<Property$StrokeWidth<TLength>>, + textAnchor?: Property$TextAnchor | Array<Property$TextAnchor>, + textDecoration?: Property$TextDecoration<TLength> | Array<Property$TextDecoration<TLength>>, + textRendering?: Property$TextRendering | Array<Property$TextRendering>, + unicodeBidi?: Property$UnicodeBidi | Array<Property$UnicodeBidi>, + vectorEffect?: Property$VectorEffect | Array<Property$VectorEffect>, + visibility?: Property$Visibility | Array<Property$Visibility>, + whiteSpace?: Property$WhiteSpace | Array<Property$WhiteSpace>, + wordSpacing?: Property$WordSpacing<TLength> | Array<Property$WordSpacing<TLength>>, + writingMode?: Property$WritingMode | Array<Property$WritingMode>, +|}; + +export type PropertiesFallback<TLength = string | 0, TTime = string> = {| + ...StandardPropertiesFallback<TLength, TTime>, + ...VendorPropertiesFallback<TLength, TTime>, + ...ObsoletePropertiesFallback<TLength, TTime>, + ...SvgPropertiesFallback<TLength, TTime>, +|}; + +export type StandardLonghandPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + "accent-color"?: Property$AccentColor | Array<Property$AccentColor>, + "align-content"?: Property$AlignContent | Array<Property$AlignContent>, + "align-items"?: Property$AlignItems | Array<Property$AlignItems>, + "align-self"?: Property$AlignSelf | Array<Property$AlignSelf>, + "align-tracks"?: Property$AlignTracks | Array<Property$AlignTracks>, + "animation-composition"?: Property$AnimationComposition | Array<Property$AnimationComposition>, + "animation-delay"?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + "animation-direction"?: Property$AnimationDirection | Array<Property$AnimationDirection>, + "animation-duration"?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + "animation-fill-mode"?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + "animation-iteration-count"?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + "animation-name"?: Property$AnimationName | Array<Property$AnimationName>, + "animation-play-state"?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + "animation-range-end"?: Property$AnimationRangeEnd<TLength> | Array<Property$AnimationRangeEnd<TLength>>, + "animation-range-start"?: Property$AnimationRangeStart<TLength> | Array<Property$AnimationRangeStart<TLength>>, + "animation-timeline"?: Property$AnimationTimeline | Array<Property$AnimationTimeline>, + "animation-timing-function"?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + appearance?: Property$Appearance | Array<Property$Appearance>, + "aspect-ratio"?: Property$AspectRatio | Array<Property$AspectRatio>, + "backdrop-filter"?: Property$BackdropFilter | Array<Property$BackdropFilter>, + "backface-visibility"?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + "background-attachment"?: Property$BackgroundAttachment | Array<Property$BackgroundAttachment>, + "background-blend-mode"?: Property$BackgroundBlendMode | Array<Property$BackgroundBlendMode>, + "background-clip"?: Property$BackgroundClip | Array<Property$BackgroundClip>, + "background-color"?: Property$BackgroundColor | Array<Property$BackgroundColor>, + "background-image"?: Property$BackgroundImage | Array<Property$BackgroundImage>, + "background-origin"?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + "background-position-x"?: Property$BackgroundPositionX<TLength> | Array<Property$BackgroundPositionX<TLength>>, + "background-position-y"?: Property$BackgroundPositionY<TLength> | Array<Property$BackgroundPositionY<TLength>>, + "background-repeat"?: Property$BackgroundRepeat | Array<Property$BackgroundRepeat>, + "background-size"?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + "block-overflow"?: Property$BlockOverflow | Array<Property$BlockOverflow>, + "block-size"?: Property$BlockSize<TLength> | Array<Property$BlockSize<TLength>>, + "border-block-color"?: Property$BorderBlockColor | Array<Property$BorderBlockColor>, + "border-block-end-color"?: Property$BorderBlockEndColor | Array<Property$BorderBlockEndColor>, + "border-block-end-style"?: Property$BorderBlockEndStyle | Array<Property$BorderBlockEndStyle>, + "border-block-end-width"?: Property$BorderBlockEndWidth<TLength> | Array<Property$BorderBlockEndWidth<TLength>>, + "border-block-start-color"?: Property$BorderBlockStartColor | Array<Property$BorderBlockStartColor>, + "border-block-start-style"?: Property$BorderBlockStartStyle | Array<Property$BorderBlockStartStyle>, + "border-block-start-width"?: Property$BorderBlockStartWidth<TLength> | Array<Property$BorderBlockStartWidth<TLength>>, + "border-block-style"?: Property$BorderBlockStyle | Array<Property$BorderBlockStyle>, + "border-block-width"?: Property$BorderBlockWidth<TLength> | Array<Property$BorderBlockWidth<TLength>>, + "border-bottom-color"?: Property$BorderBottomColor | Array<Property$BorderBottomColor>, + "border-bottom-left-radius"?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + "border-bottom-right-radius"?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + "border-bottom-style"?: Property$BorderBottomStyle | Array<Property$BorderBottomStyle>, + "border-bottom-width"?: Property$BorderBottomWidth<TLength> | Array<Property$BorderBottomWidth<TLength>>, + "border-collapse"?: Property$BorderCollapse | Array<Property$BorderCollapse>, + "border-end-end-radius"?: Property$BorderEndEndRadius<TLength> | Array<Property$BorderEndEndRadius<TLength>>, + "border-end-start-radius"?: Property$BorderEndStartRadius<TLength> | Array<Property$BorderEndStartRadius<TLength>>, + "border-image-outset"?: Property$BorderImageOutset<TLength> | Array<Property$BorderImageOutset<TLength>>, + "border-image-repeat"?: Property$BorderImageRepeat | Array<Property$BorderImageRepeat>, + "border-image-slice"?: Property$BorderImageSlice | Array<Property$BorderImageSlice>, + "border-image-source"?: Property$BorderImageSource | Array<Property$BorderImageSource>, + "border-image-width"?: Property$BorderImageWidth<TLength> | Array<Property$BorderImageWidth<TLength>>, + "border-inline-color"?: Property$BorderInlineColor | Array<Property$BorderInlineColor>, + "border-inline-end-color"?: Property$BorderInlineEndColor | Array<Property$BorderInlineEndColor>, + "border-inline-end-style"?: Property$BorderInlineEndStyle | Array<Property$BorderInlineEndStyle>, + "border-inline-end-width"?: Property$BorderInlineEndWidth<TLength> | Array<Property$BorderInlineEndWidth<TLength>>, + "border-inline-start-color"?: Property$BorderInlineStartColor | Array<Property$BorderInlineStartColor>, + "border-inline-start-style"?: Property$BorderInlineStartStyle | Array<Property$BorderInlineStartStyle>, + "border-inline-start-width"?: Property$BorderInlineStartWidth<TLength> | Array<Property$BorderInlineStartWidth<TLength>>, + "border-inline-style"?: Property$BorderInlineStyle | Array<Property$BorderInlineStyle>, + "border-inline-width"?: Property$BorderInlineWidth<TLength> | Array<Property$BorderInlineWidth<TLength>>, + "border-left-color"?: Property$BorderLeftColor | Array<Property$BorderLeftColor>, + "border-left-style"?: Property$BorderLeftStyle | Array<Property$BorderLeftStyle>, + "border-left-width"?: Property$BorderLeftWidth<TLength> | Array<Property$BorderLeftWidth<TLength>>, + "border-right-color"?: Property$BorderRightColor | Array<Property$BorderRightColor>, + "border-right-style"?: Property$BorderRightStyle | Array<Property$BorderRightStyle>, + "border-right-width"?: Property$BorderRightWidth<TLength> | Array<Property$BorderRightWidth<TLength>>, + "border-spacing"?: Property$BorderSpacing<TLength> | Array<Property$BorderSpacing<TLength>>, + "border-start-end-radius"?: Property$BorderStartEndRadius<TLength> | Array<Property$BorderStartEndRadius<TLength>>, + "border-start-start-radius"?: Property$BorderStartStartRadius<TLength> | Array<Property$BorderStartStartRadius<TLength>>, + "border-top-color"?: Property$BorderTopColor | Array<Property$BorderTopColor>, + "border-top-left-radius"?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + "border-top-right-radius"?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + "border-top-style"?: Property$BorderTopStyle | Array<Property$BorderTopStyle>, + "border-top-width"?: Property$BorderTopWidth<TLength> | Array<Property$BorderTopWidth<TLength>>, + bottom?: Property$Bottom<TLength> | Array<Property$Bottom<TLength>>, + "box-decoration-break"?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + "box-shadow"?: Property$BoxShadow | Array<Property$BoxShadow>, + "box-sizing"?: Property$BoxSizing | Array<Property$BoxSizing>, + "break-after"?: Property$BreakAfter | Array<Property$BreakAfter>, + "break-before"?: Property$BreakBefore | Array<Property$BreakBefore>, + "break-inside"?: Property$BreakInside | Array<Property$BreakInside>, + "caption-side"?: Property$CaptionSide | Array<Property$CaptionSide>, + "caret-color"?: Property$CaretColor | Array<Property$CaretColor>, + "caret-shape"?: Property$CaretShape | Array<Property$CaretShape>, + clear?: Property$Clear | Array<Property$Clear>, + "clip-path"?: Property$ClipPath | Array<Property$ClipPath>, + color?: Property$Color | Array<Property$Color>, + "color-adjust"?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + "color-scheme"?: Property$ColorScheme | Array<Property$ColorScheme>, + "column-count"?: Property$ColumnCount | Array<Property$ColumnCount>, + "column-fill"?: Property$ColumnFill | Array<Property$ColumnFill>, + "column-gap"?: Property$ColumnGap<TLength> | Array<Property$ColumnGap<TLength>>, + "column-rule-color"?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + "column-rule-style"?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + "column-rule-width"?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + "column-span"?: Property$ColumnSpan | Array<Property$ColumnSpan>, + "column-width"?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + contain?: Property$Contain | Array<Property$Contain>, + "contain-intrinsic-block-size"?: Property$ContainIntrinsicBlockSize<TLength> | Array<Property$ContainIntrinsicBlockSize<TLength>>, + "contain-intrinsic-height"?: Property$ContainIntrinsicHeight<TLength> | Array<Property$ContainIntrinsicHeight<TLength>>, + "contain-intrinsic-inline-size"?: Property$ContainIntrinsicInlineSize<TLength> | Array<Property$ContainIntrinsicInlineSize<TLength>>, + "contain-intrinsic-width"?: Property$ContainIntrinsicWidth<TLength> | Array<Property$ContainIntrinsicWidth<TLength>>, + "container-name"?: Property$ContainerName | Array<Property$ContainerName>, + "container-type"?: Property$ContainerType | Array<Property$ContainerType>, + content?: Property$Content | Array<Property$Content>, + "content-visibility"?: Property$ContentVisibility | Array<Property$ContentVisibility>, + "counter-increment"?: Property$CounterIncrement | Array<Property$CounterIncrement>, + "counter-reset"?: Property$CounterReset | Array<Property$CounterReset>, + "counter-set"?: Property$CounterSet | Array<Property$CounterSet>, + cursor?: Property$Cursor | Array<Property$Cursor>, + direction?: Property$Direction | Array<Property$Direction>, + display?: Property$Display | Array<Property$Display>, + "empty-cells"?: Property$EmptyCells | Array<Property$EmptyCells>, + filter?: Property$Filter | Array<Property$Filter>, + "flex-basis"?: Property$FlexBasis<TLength> | Array<Property$FlexBasis<TLength>>, + "flex-direction"?: Property$FlexDirection | Array<Property$FlexDirection>, + "flex-grow"?: Property$FlexGrow | Array<Property$FlexGrow>, + "flex-shrink"?: Property$FlexShrink | Array<Property$FlexShrink>, + "flex-wrap"?: Property$FlexWrap | Array<Property$FlexWrap>, + float?: Property$Float | Array<Property$Float>, + "font-family"?: Property$FontFamily | Array<Property$FontFamily>, + "font-feature-settings"?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + "font-kerning"?: Property$FontKerning | Array<Property$FontKerning>, + "font-language-override"?: Property$FontLanguageOverride | Array<Property$FontLanguageOverride>, + "font-optical-sizing"?: Property$FontOpticalSizing | Array<Property$FontOpticalSizing>, + "font-palette"?: Property$FontPalette | Array<Property$FontPalette>, + "font-size"?: Property$FontSize<TLength> | Array<Property$FontSize<TLength>>, + "font-size-adjust"?: Property$FontSizeAdjust | Array<Property$FontSizeAdjust>, + "font-smooth"?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + "font-stretch"?: Property$FontStretch | Array<Property$FontStretch>, + "font-style"?: Property$FontStyle | Array<Property$FontStyle>, + "font-synthesis"?: Property$FontSynthesis | Array<Property$FontSynthesis>, + "font-synthesis-position"?: Property$FontSynthesisPosition | Array<Property$FontSynthesisPosition>, + "font-synthesis-small-caps"?: Property$FontSynthesisSmallCaps | Array<Property$FontSynthesisSmallCaps>, + "font-synthesis-style"?: Property$FontSynthesisStyle | Array<Property$FontSynthesisStyle>, + "font-synthesis-weight"?: Property$FontSynthesisWeight | Array<Property$FontSynthesisWeight>, + "font-variant"?: Property$FontVariant | Array<Property$FontVariant>, + "font-variant-alternates"?: Property$FontVariantAlternates | Array<Property$FontVariantAlternates>, + "font-variant-caps"?: Property$FontVariantCaps | Array<Property$FontVariantCaps>, + "font-variant-east-asian"?: Property$FontVariantEastAsian | Array<Property$FontVariantEastAsian>, + "font-variant-emoji"?: Property$FontVariantEmoji | Array<Property$FontVariantEmoji>, + "font-variant-ligatures"?: Property$FontVariantLigatures | Array<Property$FontVariantLigatures>, + "font-variant-numeric"?: Property$FontVariantNumeric | Array<Property$FontVariantNumeric>, + "font-variant-position"?: Property$FontVariantPosition | Array<Property$FontVariantPosition>, + "font-variation-settings"?: Property$FontVariationSettings | Array<Property$FontVariationSettings>, + "font-weight"?: Property$FontWeight | Array<Property$FontWeight>, + "forced-color-adjust"?: Property$ForcedColorAdjust | Array<Property$ForcedColorAdjust>, + "grid-auto-columns"?: Property$GridAutoColumns<TLength> | Array<Property$GridAutoColumns<TLength>>, + "grid-auto-flow"?: Property$GridAutoFlow | Array<Property$GridAutoFlow>, + "grid-auto-rows"?: Property$GridAutoRows<TLength> | Array<Property$GridAutoRows<TLength>>, + "grid-column-end"?: Property$GridColumnEnd | Array<Property$GridColumnEnd>, + "grid-column-start"?: Property$GridColumnStart | Array<Property$GridColumnStart>, + "grid-row-end"?: Property$GridRowEnd | Array<Property$GridRowEnd>, + "grid-row-start"?: Property$GridRowStart | Array<Property$GridRowStart>, + "grid-template-areas"?: Property$GridTemplateAreas | Array<Property$GridTemplateAreas>, + "grid-template-columns"?: Property$GridTemplateColumns<TLength> | Array<Property$GridTemplateColumns<TLength>>, + "grid-template-rows"?: Property$GridTemplateRows<TLength> | Array<Property$GridTemplateRows<TLength>>, + "hanging-punctuation"?: Property$HangingPunctuation | Array<Property$HangingPunctuation>, + height?: Property$Height<TLength> | Array<Property$Height<TLength>>, + "hyphenate-character"?: Property$HyphenateCharacter | Array<Property$HyphenateCharacter>, + "hyphenate-limit-chars"?: Property$HyphenateLimitChars | Array<Property$HyphenateLimitChars>, + hyphens?: Property$Hyphens | Array<Property$Hyphens>, + "image-orientation"?: Property$ImageOrientation | Array<Property$ImageOrientation>, + "image-rendering"?: Property$ImageRendering | Array<Property$ImageRendering>, + "image-resolution"?: Property$ImageResolution | Array<Property$ImageResolution>, + "initial-letter"?: Property$InitialLetter | Array<Property$InitialLetter>, + "inline-size"?: Property$InlineSize<TLength> | Array<Property$InlineSize<TLength>>, + "input-security"?: Property$InputSecurity | Array<Property$InputSecurity>, + "inset-block-end"?: Property$InsetBlockEnd<TLength> | Array<Property$InsetBlockEnd<TLength>>, + "inset-block-start"?: Property$InsetBlockStart<TLength> | Array<Property$InsetBlockStart<TLength>>, + "inset-inline-end"?: Property$InsetInlineEnd<TLength> | Array<Property$InsetInlineEnd<TLength>>, + "inset-inline-start"?: Property$InsetInlineStart<TLength> | Array<Property$InsetInlineStart<TLength>>, + isolation?: Property$Isolation | Array<Property$Isolation>, + "justify-content"?: Property$JustifyContent | Array<Property$JustifyContent>, + "justify-items"?: Property$JustifyItems | Array<Property$JustifyItems>, + "justify-self"?: Property$JustifySelf | Array<Property$JustifySelf>, + "justify-tracks"?: Property$JustifyTracks | Array<Property$JustifyTracks>, + left?: Property$Left<TLength> | Array<Property$Left<TLength>>, + "letter-spacing"?: Property$LetterSpacing<TLength> | Array<Property$LetterSpacing<TLength>>, + "line-break"?: Property$LineBreak | Array<Property$LineBreak>, + "line-height"?: Property$LineHeight<TLength> | Array<Property$LineHeight<TLength>>, + "line-height-step"?: Property$LineHeightStep<TLength> | Array<Property$LineHeightStep<TLength>>, + "list-style-image"?: Property$ListStyleImage | Array<Property$ListStyleImage>, + "list-style-position"?: Property$ListStylePosition | Array<Property$ListStylePosition>, + "list-style-type"?: Property$ListStyleType | Array<Property$ListStyleType>, + "margin-block-end"?: Property$MarginBlockEnd<TLength> | Array<Property$MarginBlockEnd<TLength>>, + "margin-block-start"?: Property$MarginBlockStart<TLength> | Array<Property$MarginBlockStart<TLength>>, + "margin-bottom"?: Property$MarginBottom<TLength> | Array<Property$MarginBottom<TLength>>, + "margin-inline-end"?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + "margin-inline-start"?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + "margin-left"?: Property$MarginLeft<TLength> | Array<Property$MarginLeft<TLength>>, + "margin-right"?: Property$MarginRight<TLength> | Array<Property$MarginRight<TLength>>, + "margin-top"?: Property$MarginTop<TLength> | Array<Property$MarginTop<TLength>>, + "margin-trim"?: Property$MarginTrim | Array<Property$MarginTrim>, + "mask-border-mode"?: Property$MaskBorderMode | Array<Property$MaskBorderMode>, + "mask-border-outset"?: Property$MaskBorderOutset<TLength> | Array<Property$MaskBorderOutset<TLength>>, + "mask-border-repeat"?: Property$MaskBorderRepeat | Array<Property$MaskBorderRepeat>, + "mask-border-slice"?: Property$MaskBorderSlice | Array<Property$MaskBorderSlice>, + "mask-border-source"?: Property$MaskBorderSource | Array<Property$MaskBorderSource>, + "mask-border-width"?: Property$MaskBorderWidth<TLength> | Array<Property$MaskBorderWidth<TLength>>, + "mask-clip"?: Property$MaskClip | Array<Property$MaskClip>, + "mask-composite"?: Property$MaskComposite | Array<Property$MaskComposite>, + "mask-image"?: Property$MaskImage | Array<Property$MaskImage>, + "mask-mode"?: Property$MaskMode | Array<Property$MaskMode>, + "mask-origin"?: Property$MaskOrigin | Array<Property$MaskOrigin>, + "mask-position"?: Property$MaskPosition<TLength> | Array<Property$MaskPosition<TLength>>, + "mask-repeat"?: Property$MaskRepeat | Array<Property$MaskRepeat>, + "mask-size"?: Property$MaskSize<TLength> | Array<Property$MaskSize<TLength>>, + "mask-type"?: Property$MaskType | Array<Property$MaskType>, + "masonry-auto-flow"?: Property$MasonryAutoFlow | Array<Property$MasonryAutoFlow>, + "math-depth"?: Property$MathDepth | Array<Property$MathDepth>, + "math-shift"?: Property$MathShift | Array<Property$MathShift>, + "math-style"?: Property$MathStyle | Array<Property$MathStyle>, + "max-block-size"?: Property$MaxBlockSize<TLength> | Array<Property$MaxBlockSize<TLength>>, + "max-height"?: Property$MaxHeight<TLength> | Array<Property$MaxHeight<TLength>>, + "max-inline-size"?: Property$MaxInlineSize<TLength> | Array<Property$MaxInlineSize<TLength>>, + "max-lines"?: Property$MaxLines | Array<Property$MaxLines>, + "max-width"?: Property$MaxWidth<TLength> | Array<Property$MaxWidth<TLength>>, + "min-block-size"?: Property$MinBlockSize<TLength> | Array<Property$MinBlockSize<TLength>>, + "min-height"?: Property$MinHeight<TLength> | Array<Property$MinHeight<TLength>>, + "min-inline-size"?: Property$MinInlineSize<TLength> | Array<Property$MinInlineSize<TLength>>, + "min-width"?: Property$MinWidth<TLength> | Array<Property$MinWidth<TLength>>, + "mix-blend-mode"?: Property$MixBlendMode | Array<Property$MixBlendMode>, + "motion-distance"?: Property$OffsetDistance<TLength> | Array<Property$OffsetDistance<TLength>>, + "motion-path"?: Property$OffsetPath | Array<Property$OffsetPath>, + "motion-rotation"?: Property$OffsetRotate | Array<Property$OffsetRotate>, + "object-fit"?: Property$ObjectFit | Array<Property$ObjectFit>, + "object-position"?: Property$ObjectPosition<TLength> | Array<Property$ObjectPosition<TLength>>, + "offset-anchor"?: Property$OffsetAnchor<TLength> | Array<Property$OffsetAnchor<TLength>>, + "offset-distance"?: Property$OffsetDistance<TLength> | Array<Property$OffsetDistance<TLength>>, + "offset-path"?: Property$OffsetPath | Array<Property$OffsetPath>, + "offset-position"?: Property$OffsetPosition<TLength> | Array<Property$OffsetPosition<TLength>>, + "offset-rotate"?: Property$OffsetRotate | Array<Property$OffsetRotate>, + "offset-rotation"?: Property$OffsetRotate | Array<Property$OffsetRotate>, + opacity?: Property$Opacity | Array<Property$Opacity>, + order?: Property$Order | Array<Property$Order>, + orphans?: Property$Orphans | Array<Property$Orphans>, + "outline-color"?: Property$OutlineColor | Array<Property$OutlineColor>, + "outline-offset"?: Property$OutlineOffset<TLength> | Array<Property$OutlineOffset<TLength>>, + "outline-style"?: Property$OutlineStyle | Array<Property$OutlineStyle>, + "outline-width"?: Property$OutlineWidth<TLength> | Array<Property$OutlineWidth<TLength>>, + "overflow-anchor"?: Property$OverflowAnchor | Array<Property$OverflowAnchor>, + "overflow-block"?: Property$OverflowBlock | Array<Property$OverflowBlock>, + "overflow-clip-box"?: Property$OverflowClipBox | Array<Property$OverflowClipBox>, + "overflow-clip-margin"?: Property$OverflowClipMargin<TLength> | Array<Property$OverflowClipMargin<TLength>>, + "overflow-inline"?: Property$OverflowInline | Array<Property$OverflowInline>, + "overflow-wrap"?: Property$OverflowWrap | Array<Property$OverflowWrap>, + "overflow-x"?: Property$OverflowX | Array<Property$OverflowX>, + "overflow-y"?: Property$OverflowY | Array<Property$OverflowY>, + overlay?: Property$Overlay | Array<Property$Overlay>, + "overscroll-behavior-block"?: Property$OverscrollBehaviorBlock | Array<Property$OverscrollBehaviorBlock>, + "overscroll-behavior-inline"?: Property$OverscrollBehaviorInline | Array<Property$OverscrollBehaviorInline>, + "overscroll-behavior-x"?: Property$OverscrollBehaviorX | Array<Property$OverscrollBehaviorX>, + "overscroll-behavior-y"?: Property$OverscrollBehaviorY | Array<Property$OverscrollBehaviorY>, + "padding-block-end"?: Property$PaddingBlockEnd<TLength> | Array<Property$PaddingBlockEnd<TLength>>, + "padding-block-start"?: Property$PaddingBlockStart<TLength> | Array<Property$PaddingBlockStart<TLength>>, + "padding-bottom"?: Property$PaddingBottom<TLength> | Array<Property$PaddingBottom<TLength>>, + "padding-inline-end"?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + "padding-inline-start"?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + "padding-left"?: Property$PaddingLeft<TLength> | Array<Property$PaddingLeft<TLength>>, + "padding-right"?: Property$PaddingRight<TLength> | Array<Property$PaddingRight<TLength>>, + "padding-top"?: Property$PaddingTop<TLength> | Array<Property$PaddingTop<TLength>>, + page?: Property$Page | Array<Property$Page>, + "page-break-after"?: Property$PageBreakAfter | Array<Property$PageBreakAfter>, + "page-break-before"?: Property$PageBreakBefore | Array<Property$PageBreakBefore>, + "page-break-inside"?: Property$PageBreakInside | Array<Property$PageBreakInside>, + "paint-order"?: Property$PaintOrder | Array<Property$PaintOrder>, + perspective?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + "perspective-origin"?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + "pointer-events"?: Property$PointerEvents | Array<Property$PointerEvents>, + position?: Property$Position | Array<Property$Position>, + "print-color-adjust"?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + quotes?: Property$Quotes | Array<Property$Quotes>, + resize?: Property$Resize | Array<Property$Resize>, + right?: Property$Right<TLength> | Array<Property$Right<TLength>>, + rotate?: Property$Rotate | Array<Property$Rotate>, + "row-gap"?: Property$RowGap<TLength> | Array<Property$RowGap<TLength>>, + "ruby-align"?: Property$RubyAlign | Array<Property$RubyAlign>, + "ruby-merge"?: Property$RubyMerge | Array<Property$RubyMerge>, + "ruby-position"?: Property$RubyPosition | Array<Property$RubyPosition>, + scale?: Property$Scale | Array<Property$Scale>, + "scroll-behavior"?: Property$ScrollBehavior | Array<Property$ScrollBehavior>, + "scroll-margin-block-end"?: Property$ScrollMarginBlockEnd<TLength> | Array<Property$ScrollMarginBlockEnd<TLength>>, + "scroll-margin-block-start"?: Property$ScrollMarginBlockStart<TLength> | Array<Property$ScrollMarginBlockStart<TLength>>, + "scroll-margin-bottom"?: Property$ScrollMarginBottom<TLength> | Array<Property$ScrollMarginBottom<TLength>>, + "scroll-margin-inline-end"?: Property$ScrollMarginInlineEnd<TLength> | Array<Property$ScrollMarginInlineEnd<TLength>>, + "scroll-margin-inline-start"?: Property$ScrollMarginInlineStart<TLength> | Array<Property$ScrollMarginInlineStart<TLength>>, + "scroll-margin-left"?: Property$ScrollMarginLeft<TLength> | Array<Property$ScrollMarginLeft<TLength>>, + "scroll-margin-right"?: Property$ScrollMarginRight<TLength> | Array<Property$ScrollMarginRight<TLength>>, + "scroll-margin-top"?: Property$ScrollMarginTop<TLength> | Array<Property$ScrollMarginTop<TLength>>, + "scroll-padding-block-end"?: Property$ScrollPaddingBlockEnd<TLength> | Array<Property$ScrollPaddingBlockEnd<TLength>>, + "scroll-padding-block-start"?: Property$ScrollPaddingBlockStart<TLength> | Array<Property$ScrollPaddingBlockStart<TLength>>, + "scroll-padding-bottom"?: Property$ScrollPaddingBottom<TLength> | Array<Property$ScrollPaddingBottom<TLength>>, + "scroll-padding-inline-end"?: Property$ScrollPaddingInlineEnd<TLength> | Array<Property$ScrollPaddingInlineEnd<TLength>>, + "scroll-padding-inline-start"?: Property$ScrollPaddingInlineStart<TLength> | Array<Property$ScrollPaddingInlineStart<TLength>>, + "scroll-padding-left"?: Property$ScrollPaddingLeft<TLength> | Array<Property$ScrollPaddingLeft<TLength>>, + "scroll-padding-right"?: Property$ScrollPaddingRight<TLength> | Array<Property$ScrollPaddingRight<TLength>>, + "scroll-padding-top"?: Property$ScrollPaddingTop<TLength> | Array<Property$ScrollPaddingTop<TLength>>, + "scroll-snap-align"?: Property$ScrollSnapAlign | Array<Property$ScrollSnapAlign>, + "scroll-snap-margin-bottom"?: Property$ScrollMarginBottom<TLength> | Array<Property$ScrollMarginBottom<TLength>>, + "scroll-snap-margin-left"?: Property$ScrollMarginLeft<TLength> | Array<Property$ScrollMarginLeft<TLength>>, + "scroll-snap-margin-right"?: Property$ScrollMarginRight<TLength> | Array<Property$ScrollMarginRight<TLength>>, + "scroll-snap-margin-top"?: Property$ScrollMarginTop<TLength> | Array<Property$ScrollMarginTop<TLength>>, + "scroll-snap-stop"?: Property$ScrollSnapStop | Array<Property$ScrollSnapStop>, + "scroll-snap-type"?: Property$ScrollSnapType | Array<Property$ScrollSnapType>, + "scroll-timeline-axis"?: Property$ScrollTimelineAxis | Array<Property$ScrollTimelineAxis>, + "scroll-timeline-name"?: Property$ScrollTimelineName | Array<Property$ScrollTimelineName>, + "scrollbar-color"?: Property$ScrollbarColor | Array<Property$ScrollbarColor>, + "scrollbar-gutter"?: Property$ScrollbarGutter | Array<Property$ScrollbarGutter>, + "scrollbar-width"?: Property$ScrollbarWidth | Array<Property$ScrollbarWidth>, + "shape-image-threshold"?: Property$ShapeImageThreshold | Array<Property$ShapeImageThreshold>, + "shape-margin"?: Property$ShapeMargin<TLength> | Array<Property$ShapeMargin<TLength>>, + "shape-outside"?: Property$ShapeOutside | Array<Property$ShapeOutside>, + "tab-size"?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + "table-layout"?: Property$TableLayout | Array<Property$TableLayout>, + "text-align"?: Property$TextAlign | Array<Property$TextAlign>, + "text-align-last"?: Property$TextAlignLast | Array<Property$TextAlignLast>, + "text-combine-upright"?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + "text-decoration-color"?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + "text-decoration-line"?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + "text-decoration-skip"?: Property$TextDecorationSkip | Array<Property$TextDecorationSkip>, + "text-decoration-skip-ink"?: Property$TextDecorationSkipInk | Array<Property$TextDecorationSkipInk>, + "text-decoration-style"?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + "text-decoration-thickness"?: Property$TextDecorationThickness<TLength> | Array<Property$TextDecorationThickness<TLength>>, + "text-emphasis-color"?: Property$TextEmphasisColor | Array<Property$TextEmphasisColor>, + "text-emphasis-position"?: Property$TextEmphasisPosition | Array<Property$TextEmphasisPosition>, + "text-emphasis-style"?: Property$TextEmphasisStyle | Array<Property$TextEmphasisStyle>, + "text-indent"?: Property$TextIndent<TLength> | Array<Property$TextIndent<TLength>>, + "text-justify"?: Property$TextJustify | Array<Property$TextJustify>, + "text-orientation"?: Property$TextOrientation | Array<Property$TextOrientation>, + "text-overflow"?: Property$TextOverflow | Array<Property$TextOverflow>, + "text-rendering"?: Property$TextRendering | Array<Property$TextRendering>, + "text-shadow"?: Property$TextShadow | Array<Property$TextShadow>, + "text-size-adjust"?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + "text-transform"?: Property$TextTransform | Array<Property$TextTransform>, + "text-underline-offset"?: Property$TextUnderlineOffset<TLength> | Array<Property$TextUnderlineOffset<TLength>>, + "text-underline-position"?: Property$TextUnderlinePosition | Array<Property$TextUnderlinePosition>, + "text-wrap"?: Property$TextWrap | Array<Property$TextWrap>, + "timeline-scope"?: Property$TimelineScope | Array<Property$TimelineScope>, + top?: Property$Top<TLength> | Array<Property$Top<TLength>>, + "touch-action"?: Property$TouchAction | Array<Property$TouchAction>, + transform?: Property$Transform | Array<Property$Transform>, + "transform-box"?: Property$TransformBox | Array<Property$TransformBox>, + "transform-origin"?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + "transform-style"?: Property$TransformStyle | Array<Property$TransformStyle>, + "transition-behavior"?: Property$TransitionBehavior | Array<Property$TransitionBehavior>, + "transition-delay"?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + "transition-duration"?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + "transition-property"?: Property$TransitionProperty | Array<Property$TransitionProperty>, + "transition-timing-function"?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + translate?: Property$Translate<TLength> | Array<Property$Translate<TLength>>, + "unicode-bidi"?: Property$UnicodeBidi | Array<Property$UnicodeBidi>, + "user-select"?: Property$UserSelect | Array<Property$UserSelect>, + "vertical-align"?: Property$VerticalAlign<TLength> | Array<Property$VerticalAlign<TLength>>, + "view-timeline-axis"?: Property$ViewTimelineAxis | Array<Property$ViewTimelineAxis>, + "view-timeline-inset"?: Property$ViewTimelineInset<TLength> | Array<Property$ViewTimelineInset<TLength>>, + "view-timeline-name"?: Property$ViewTimelineName | Array<Property$ViewTimelineName>, + "view-transition-name"?: Property$ViewTransitionName | Array<Property$ViewTransitionName>, + visibility?: Property$Visibility | Array<Property$Visibility>, + "white-space"?: Property$WhiteSpace | Array<Property$WhiteSpace>, + "white-space-collapse"?: Property$WhiteSpaceCollapse | Array<Property$WhiteSpaceCollapse>, + "white-space-trim"?: Property$WhiteSpaceTrim | Array<Property$WhiteSpaceTrim>, + widows?: Property$Widows | Array<Property$Widows>, + width?: Property$Width<TLength> | Array<Property$Width<TLength>>, + "will-change"?: Property$WillChange | Array<Property$WillChange>, + "word-break"?: Property$WordBreak | Array<Property$WordBreak>, + "word-spacing"?: Property$WordSpacing<TLength> | Array<Property$WordSpacing<TLength>>, + "word-wrap"?: Property$WordWrap | Array<Property$WordWrap>, + "writing-mode"?: Property$WritingMode | Array<Property$WritingMode>, + "z-index"?: Property$ZIndex | Array<Property$ZIndex>, + zoom?: Property$Zoom | Array<Property$Zoom>, +|}; + +export type StandardShorthandPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + all?: Property$All | Array<Property$All>, + animation?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + "animation-range"?: Property$AnimationRange<TLength> | Array<Property$AnimationRange<TLength>>, + background?: Property$Background<TLength> | Array<Property$Background<TLength>>, + "background-position"?: Property$BackgroundPosition<TLength> | Array<Property$BackgroundPosition<TLength>>, + border?: Property$Border<TLength> | Array<Property$Border<TLength>>, + "border-block"?: Property$BorderBlock<TLength> | Array<Property$BorderBlock<TLength>>, + "border-block-end"?: Property$BorderBlockEnd<TLength> | Array<Property$BorderBlockEnd<TLength>>, + "border-block-start"?: Property$BorderBlockStart<TLength> | Array<Property$BorderBlockStart<TLength>>, + "border-bottom"?: Property$BorderBottom<TLength> | Array<Property$BorderBottom<TLength>>, + "border-color"?: Property$BorderColor | Array<Property$BorderColor>, + "border-image"?: Property$BorderImage | Array<Property$BorderImage>, + "border-inline"?: Property$BorderInline<TLength> | Array<Property$BorderInline<TLength>>, + "border-inline-end"?: Property$BorderInlineEnd<TLength> | Array<Property$BorderInlineEnd<TLength>>, + "border-inline-start"?: Property$BorderInlineStart<TLength> | Array<Property$BorderInlineStart<TLength>>, + "border-left"?: Property$BorderLeft<TLength> | Array<Property$BorderLeft<TLength>>, + "border-radius"?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + "border-right"?: Property$BorderRight<TLength> | Array<Property$BorderRight<TLength>>, + "border-style"?: Property$BorderStyle | Array<Property$BorderStyle>, + "border-top"?: Property$BorderTop<TLength> | Array<Property$BorderTop<TLength>>, + "border-width"?: Property$BorderWidth<TLength> | Array<Property$BorderWidth<TLength>>, + caret?: Property$Caret | Array<Property$Caret>, + "column-rule"?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + columns?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + "contain-intrinsic-size"?: Property$ContainIntrinsicSize<TLength> | Array<Property$ContainIntrinsicSize<TLength>>, + container?: Property$Container | Array<Property$Container>, + flex?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + "flex-flow"?: Property$FlexFlow | Array<Property$FlexFlow>, + font?: Property$Font | Array<Property$Font>, + gap?: Property$Gap<TLength> | Array<Property$Gap<TLength>>, + grid?: Property$Grid | Array<Property$Grid>, + "grid-area"?: Property$GridArea | Array<Property$GridArea>, + "grid-column"?: Property$GridColumn | Array<Property$GridColumn>, + "grid-row"?: Property$GridRow | Array<Property$GridRow>, + "grid-template"?: Property$GridTemplate | Array<Property$GridTemplate>, + inset?: Property$Inset<TLength> | Array<Property$Inset<TLength>>, + "inset-block"?: Property$InsetBlock<TLength> | Array<Property$InsetBlock<TLength>>, + "inset-inline"?: Property$InsetInline<TLength> | Array<Property$InsetInline<TLength>>, + "line-clamp"?: Property$LineClamp | Array<Property$LineClamp>, + "list-style"?: Property$ListStyle | Array<Property$ListStyle>, + margin?: Property$Margin<TLength> | Array<Property$Margin<TLength>>, + "margin-block"?: Property$MarginBlock<TLength> | Array<Property$MarginBlock<TLength>>, + "margin-inline"?: Property$MarginInline<TLength> | Array<Property$MarginInline<TLength>>, + mask?: Property$Mask<TLength> | Array<Property$Mask<TLength>>, + "mask-border"?: Property$MaskBorder | Array<Property$MaskBorder>, + motion?: Property$Offset<TLength> | Array<Property$Offset<TLength>>, + offset?: Property$Offset<TLength> | Array<Property$Offset<TLength>>, + outline?: Property$Outline<TLength> | Array<Property$Outline<TLength>>, + overflow?: Property$Overflow | Array<Property$Overflow>, + "overscroll-behavior"?: Property$OverscrollBehavior | Array<Property$OverscrollBehavior>, + padding?: Property$Padding<TLength> | Array<Property$Padding<TLength>>, + "padding-block"?: Property$PaddingBlock<TLength> | Array<Property$PaddingBlock<TLength>>, + "padding-inline"?: Property$PaddingInline<TLength> | Array<Property$PaddingInline<TLength>>, + "place-content"?: Property$PlaceContent | Array<Property$PlaceContent>, + "place-items"?: Property$PlaceItems | Array<Property$PlaceItems>, + "place-self"?: Property$PlaceSelf | Array<Property$PlaceSelf>, + "scroll-margin"?: Property$ScrollMargin<TLength> | Array<Property$ScrollMargin<TLength>>, + "scroll-margin-block"?: Property$ScrollMarginBlock<TLength> | Array<Property$ScrollMarginBlock<TLength>>, + "scroll-margin-inline"?: Property$ScrollMarginInline<TLength> | Array<Property$ScrollMarginInline<TLength>>, + "scroll-padding"?: Property$ScrollPadding<TLength> | Array<Property$ScrollPadding<TLength>>, + "scroll-padding-block"?: Property$ScrollPaddingBlock<TLength> | Array<Property$ScrollPaddingBlock<TLength>>, + "scroll-padding-inline"?: Property$ScrollPaddingInline<TLength> | Array<Property$ScrollPaddingInline<TLength>>, + "scroll-snap-margin"?: Property$ScrollMargin<TLength> | Array<Property$ScrollMargin<TLength>>, + "scroll-timeline"?: Property$ScrollTimeline | Array<Property$ScrollTimeline>, + "text-decoration"?: Property$TextDecoration<TLength> | Array<Property$TextDecoration<TLength>>, + "text-emphasis"?: Property$TextEmphasis | Array<Property$TextEmphasis>, + transition?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + "view-timeline"?: Property$ViewTimeline | Array<Property$ViewTimeline>, +|}; + +export type StandardPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + ...StandardLonghandPropertiesHyphenFallback<TLength, TTime>, + ...StandardShorthandPropertiesHyphenFallback<TLength, TTime>, +|}; + +export type VendorLonghandPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + "-moz-animation-delay"?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + "-moz-animation-direction"?: Property$AnimationDirection | Array<Property$AnimationDirection>, + "-moz-animation-duration"?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + "-moz-animation-fill-mode"?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + "-moz-animation-iteration-count"?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + "-moz-animation-name"?: Property$AnimationName | Array<Property$AnimationName>, + "-moz-animation-play-state"?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + "-moz-animation-timing-function"?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + "-moz-appearance"?: Property$MozAppearance | Array<Property$MozAppearance>, + "-moz-binding"?: Property$MozBinding | Array<Property$MozBinding>, + "-moz-border-bottom-colors"?: Property$MozBorderBottomColors | Array<Property$MozBorderBottomColors>, + "-moz-border-end-color"?: Property$BorderInlineEndColor | Array<Property$BorderInlineEndColor>, + "-moz-border-end-style"?: Property$BorderInlineEndStyle | Array<Property$BorderInlineEndStyle>, + "-moz-border-end-width"?: Property$BorderInlineEndWidth<TLength> | Array<Property$BorderInlineEndWidth<TLength>>, + "-moz-border-left-colors"?: Property$MozBorderLeftColors | Array<Property$MozBorderLeftColors>, + "-moz-border-right-colors"?: Property$MozBorderRightColors | Array<Property$MozBorderRightColors>, + "-moz-border-start-color"?: Property$BorderInlineStartColor | Array<Property$BorderInlineStartColor>, + "-moz-border-start-style"?: Property$BorderInlineStartStyle | Array<Property$BorderInlineStartStyle>, + "-moz-border-top-colors"?: Property$MozBorderTopColors | Array<Property$MozBorderTopColors>, + "-moz-box-sizing"?: Property$BoxSizing | Array<Property$BoxSizing>, + "-moz-column-count"?: Property$ColumnCount | Array<Property$ColumnCount>, + "-moz-column-fill"?: Property$ColumnFill | Array<Property$ColumnFill>, + "-moz-column-rule-color"?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + "-moz-column-rule-style"?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + "-moz-column-rule-width"?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + "-moz-column-width"?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + "-moz-context-properties"?: Property$MozContextProperties | Array<Property$MozContextProperties>, + "-moz-font-feature-settings"?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + "-moz-font-language-override"?: Property$FontLanguageOverride | Array<Property$FontLanguageOverride>, + "-moz-hyphens"?: Property$Hyphens | Array<Property$Hyphens>, + "-moz-image-region"?: Property$MozImageRegion | Array<Property$MozImageRegion>, + "-moz-margin-end"?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + "-moz-margin-start"?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + "-moz-orient"?: Property$MozOrient | Array<Property$MozOrient>, + "-moz-osx-font-smoothing"?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + "-moz-outline-radius-bottomleft"?: Property$MozOutlineRadiusBottomleft<TLength> | Array<Property$MozOutlineRadiusBottomleft<TLength>>, + "-moz-outline-radius-bottomright"?: Property$MozOutlineRadiusBottomright<TLength> | Array<Property$MozOutlineRadiusBottomright<TLength>>, + "-moz-outline-radius-topleft"?: Property$MozOutlineRadiusTopleft<TLength> | Array<Property$MozOutlineRadiusTopleft<TLength>>, + "-moz-outline-radius-topright"?: Property$MozOutlineRadiusTopright<TLength> | Array<Property$MozOutlineRadiusTopright<TLength>>, + "-moz-padding-end"?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + "-moz-padding-start"?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + "-moz-stack-sizing"?: Property$MozStackSizing | Array<Property$MozStackSizing>, + "-moz-tab-size"?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + "-moz-text-blink"?: Property$MozTextBlink | Array<Property$MozTextBlink>, + "-moz-text-size-adjust"?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + "-moz-user-focus"?: Property$MozUserFocus | Array<Property$MozUserFocus>, + "-moz-user-modify"?: Property$MozUserModify | Array<Property$MozUserModify>, + "-moz-user-select"?: Property$UserSelect | Array<Property$UserSelect>, + "-moz-window-dragging"?: Property$MozWindowDragging | Array<Property$MozWindowDragging>, + "-moz-window-shadow"?: Property$MozWindowShadow | Array<Property$MozWindowShadow>, + "-ms-accelerator"?: Property$MsAccelerator | Array<Property$MsAccelerator>, + "-ms-block-progression"?: Property$MsBlockProgression | Array<Property$MsBlockProgression>, + "-ms-content-zoom-chaining"?: Property$MsContentZoomChaining | Array<Property$MsContentZoomChaining>, + "-ms-content-zoom-limit-max"?: Property$MsContentZoomLimitMax | Array<Property$MsContentZoomLimitMax>, + "-ms-content-zoom-limit-min"?: Property$MsContentZoomLimitMin | Array<Property$MsContentZoomLimitMin>, + "-ms-content-zoom-snap-points"?: Property$MsContentZoomSnapPoints | Array<Property$MsContentZoomSnapPoints>, + "-ms-content-zoom-snap-type"?: Property$MsContentZoomSnapType | Array<Property$MsContentZoomSnapType>, + "-ms-content-zooming"?: Property$MsContentZooming | Array<Property$MsContentZooming>, + "-ms-filter"?: Property$MsFilter | Array<Property$MsFilter>, + "-ms-flex-direction"?: Property$FlexDirection | Array<Property$FlexDirection>, + "-ms-flex-positive"?: Property$FlexGrow | Array<Property$FlexGrow>, + "-ms-flow-from"?: Property$MsFlowFrom | Array<Property$MsFlowFrom>, + "-ms-flow-into"?: Property$MsFlowInto | Array<Property$MsFlowInto>, + "-ms-grid-columns"?: Property$MsGridColumns<TLength> | Array<Property$MsGridColumns<TLength>>, + "-ms-grid-rows"?: Property$MsGridRows<TLength> | Array<Property$MsGridRows<TLength>>, + "-ms-high-contrast-adjust"?: Property$MsHighContrastAdjust | Array<Property$MsHighContrastAdjust>, + "-ms-hyphenate-limit-chars"?: Property$MsHyphenateLimitChars | Array<Property$MsHyphenateLimitChars>, + "-ms-hyphenate-limit-lines"?: Property$MsHyphenateLimitLines | Array<Property$MsHyphenateLimitLines>, + "-ms-hyphenate-limit-zone"?: Property$MsHyphenateLimitZone<TLength> | Array<Property$MsHyphenateLimitZone<TLength>>, + "-ms-hyphens"?: Property$Hyphens | Array<Property$Hyphens>, + "-ms-ime-align"?: Property$MsImeAlign | Array<Property$MsImeAlign>, + "-ms-line-break"?: Property$LineBreak | Array<Property$LineBreak>, + "-ms-order"?: Property$Order | Array<Property$Order>, + "-ms-overflow-style"?: Property$MsOverflowStyle | Array<Property$MsOverflowStyle>, + "-ms-overflow-x"?: Property$OverflowX | Array<Property$OverflowX>, + "-ms-overflow-y"?: Property$OverflowY | Array<Property$OverflowY>, + "-ms-scroll-chaining"?: Property$MsScrollChaining | Array<Property$MsScrollChaining>, + "-ms-scroll-limit-x-max"?: Property$MsScrollLimitXMax<TLength> | Array<Property$MsScrollLimitXMax<TLength>>, + "-ms-scroll-limit-x-min"?: Property$MsScrollLimitXMin<TLength> | Array<Property$MsScrollLimitXMin<TLength>>, + "-ms-scroll-limit-y-max"?: Property$MsScrollLimitYMax<TLength> | Array<Property$MsScrollLimitYMax<TLength>>, + "-ms-scroll-limit-y-min"?: Property$MsScrollLimitYMin<TLength> | Array<Property$MsScrollLimitYMin<TLength>>, + "-ms-scroll-rails"?: Property$MsScrollRails | Array<Property$MsScrollRails>, + "-ms-scroll-snap-points-x"?: Property$MsScrollSnapPointsX | Array<Property$MsScrollSnapPointsX>, + "-ms-scroll-snap-points-y"?: Property$MsScrollSnapPointsY | Array<Property$MsScrollSnapPointsY>, + "-ms-scroll-snap-type"?: Property$MsScrollSnapType | Array<Property$MsScrollSnapType>, + "-ms-scroll-translation"?: Property$MsScrollTranslation | Array<Property$MsScrollTranslation>, + "-ms-scrollbar-3dlight-color"?: Property$MsScrollbar3dlightColor | Array<Property$MsScrollbar3dlightColor>, + "-ms-scrollbar-arrow-color"?: Property$MsScrollbarArrowColor | Array<Property$MsScrollbarArrowColor>, + "-ms-scrollbar-base-color"?: Property$MsScrollbarBaseColor | Array<Property$MsScrollbarBaseColor>, + "-ms-scrollbar-darkshadow-color"?: Property$MsScrollbarDarkshadowColor | Array<Property$MsScrollbarDarkshadowColor>, + "-ms-scrollbar-face-color"?: Property$MsScrollbarFaceColor | Array<Property$MsScrollbarFaceColor>, + "-ms-scrollbar-highlight-color"?: Property$MsScrollbarHighlightColor | Array<Property$MsScrollbarHighlightColor>, + "-ms-scrollbar-shadow-color"?: Property$MsScrollbarShadowColor | Array<Property$MsScrollbarShadowColor>, + "-ms-scrollbar-track-color"?: Property$MsScrollbarTrackColor | Array<Property$MsScrollbarTrackColor>, + "-ms-text-autospace"?: Property$MsTextAutospace | Array<Property$MsTextAutospace>, + "-ms-text-combine-horizontal"?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + "-ms-text-overflow"?: Property$TextOverflow | Array<Property$TextOverflow>, + "-ms-touch-action"?: Property$TouchAction | Array<Property$TouchAction>, + "-ms-touch-select"?: Property$MsTouchSelect | Array<Property$MsTouchSelect>, + "-ms-transform"?: Property$Transform | Array<Property$Transform>, + "-ms-transform-origin"?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + "-ms-transition-delay"?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + "-ms-transition-duration"?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + "-ms-transition-property"?: Property$TransitionProperty | Array<Property$TransitionProperty>, + "-ms-transition-timing-function"?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + "-ms-user-select"?: Property$MsUserSelect | Array<Property$MsUserSelect>, + "-ms-word-break"?: Property$WordBreak | Array<Property$WordBreak>, + "-ms-wrap-flow"?: Property$MsWrapFlow | Array<Property$MsWrapFlow>, + "-ms-wrap-margin"?: Property$MsWrapMargin<TLength> | Array<Property$MsWrapMargin<TLength>>, + "-ms-wrap-through"?: Property$MsWrapThrough | Array<Property$MsWrapThrough>, + "-ms-writing-mode"?: Property$WritingMode | Array<Property$WritingMode>, + "-webkit-align-content"?: Property$AlignContent | Array<Property$AlignContent>, + "-webkit-align-items"?: Property$AlignItems | Array<Property$AlignItems>, + "-webkit-align-self"?: Property$AlignSelf | Array<Property$AlignSelf>, + "-webkit-animation-delay"?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + "-webkit-animation-direction"?: Property$AnimationDirection | Array<Property$AnimationDirection>, + "-webkit-animation-duration"?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + "-webkit-animation-fill-mode"?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + "-webkit-animation-iteration-count"?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + "-webkit-animation-name"?: Property$AnimationName | Array<Property$AnimationName>, + "-webkit-animation-play-state"?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + "-webkit-animation-timing-function"?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + "-webkit-appearance"?: Property$WebkitAppearance | Array<Property$WebkitAppearance>, + "-webkit-backdrop-filter"?: Property$BackdropFilter | Array<Property$BackdropFilter>, + "-webkit-backface-visibility"?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + "-webkit-background-clip"?: Property$BackgroundClip | Array<Property$BackgroundClip>, + "-webkit-background-origin"?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + "-webkit-background-size"?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + "-webkit-border-before-color"?: Property$WebkitBorderBeforeColor | Array<Property$WebkitBorderBeforeColor>, + "-webkit-border-before-style"?: Property$WebkitBorderBeforeStyle | Array<Property$WebkitBorderBeforeStyle>, + "-webkit-border-before-width"?: Property$WebkitBorderBeforeWidth<TLength> | Array<Property$WebkitBorderBeforeWidth<TLength>>, + "-webkit-border-bottom-left-radius"?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + "-webkit-border-bottom-right-radius"?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + "-webkit-border-image-slice"?: Property$BorderImageSlice | Array<Property$BorderImageSlice>, + "-webkit-border-top-left-radius"?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + "-webkit-border-top-right-radius"?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + "-webkit-box-decoration-break"?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + "-webkit-box-reflect"?: Property$WebkitBoxReflect<TLength> | Array<Property$WebkitBoxReflect<TLength>>, + "-webkit-box-shadow"?: Property$BoxShadow | Array<Property$BoxShadow>, + "-webkit-box-sizing"?: Property$BoxSizing | Array<Property$BoxSizing>, + "-webkit-clip-path"?: Property$ClipPath | Array<Property$ClipPath>, + "-webkit-column-count"?: Property$ColumnCount | Array<Property$ColumnCount>, + "-webkit-column-fill"?: Property$ColumnFill | Array<Property$ColumnFill>, + "-webkit-column-rule-color"?: Property$ColumnRuleColor | Array<Property$ColumnRuleColor>, + "-webkit-column-rule-style"?: Property$ColumnRuleStyle | Array<Property$ColumnRuleStyle>, + "-webkit-column-rule-width"?: Property$ColumnRuleWidth<TLength> | Array<Property$ColumnRuleWidth<TLength>>, + "-webkit-column-span"?: Property$ColumnSpan | Array<Property$ColumnSpan>, + "-webkit-column-width"?: Property$ColumnWidth<TLength> | Array<Property$ColumnWidth<TLength>>, + "-webkit-filter"?: Property$Filter | Array<Property$Filter>, + "-webkit-flex-basis"?: Property$FlexBasis<TLength> | Array<Property$FlexBasis<TLength>>, + "-webkit-flex-direction"?: Property$FlexDirection | Array<Property$FlexDirection>, + "-webkit-flex-grow"?: Property$FlexGrow | Array<Property$FlexGrow>, + "-webkit-flex-shrink"?: Property$FlexShrink | Array<Property$FlexShrink>, + "-webkit-flex-wrap"?: Property$FlexWrap | Array<Property$FlexWrap>, + "-webkit-font-feature-settings"?: Property$FontFeatureSettings | Array<Property$FontFeatureSettings>, + "-webkit-font-kerning"?: Property$FontKerning | Array<Property$FontKerning>, + "-webkit-font-smoothing"?: Property$FontSmooth<TLength> | Array<Property$FontSmooth<TLength>>, + "-webkit-font-variant-ligatures"?: Property$FontVariantLigatures | Array<Property$FontVariantLigatures>, + "-webkit-hyphenate-character"?: Property$HyphenateCharacter | Array<Property$HyphenateCharacter>, + "-webkit-hyphens"?: Property$Hyphens | Array<Property$Hyphens>, + "-webkit-initial-letter"?: Property$InitialLetter | Array<Property$InitialLetter>, + "-webkit-justify-content"?: Property$JustifyContent | Array<Property$JustifyContent>, + "-webkit-line-break"?: Property$LineBreak | Array<Property$LineBreak>, + "-webkit-line-clamp"?: Property$WebkitLineClamp | Array<Property$WebkitLineClamp>, + "-webkit-margin-end"?: Property$MarginInlineEnd<TLength> | Array<Property$MarginInlineEnd<TLength>>, + "-webkit-margin-start"?: Property$MarginInlineStart<TLength> | Array<Property$MarginInlineStart<TLength>>, + "-webkit-mask-attachment"?: Property$WebkitMaskAttachment | Array<Property$WebkitMaskAttachment>, + "-webkit-mask-box-image-outset"?: Property$MaskBorderOutset<TLength> | Array<Property$MaskBorderOutset<TLength>>, + "-webkit-mask-box-image-repeat"?: Property$MaskBorderRepeat | Array<Property$MaskBorderRepeat>, + "-webkit-mask-box-image-slice"?: Property$MaskBorderSlice | Array<Property$MaskBorderSlice>, + "-webkit-mask-box-image-source"?: Property$MaskBorderSource | Array<Property$MaskBorderSource>, + "-webkit-mask-box-image-width"?: Property$MaskBorderWidth<TLength> | Array<Property$MaskBorderWidth<TLength>>, + "-webkit-mask-clip"?: Property$WebkitMaskClip | Array<Property$WebkitMaskClip>, + "-webkit-mask-composite"?: Property$WebkitMaskComposite | Array<Property$WebkitMaskComposite>, + "-webkit-mask-image"?: Property$WebkitMaskImage | Array<Property$WebkitMaskImage>, + "-webkit-mask-origin"?: Property$WebkitMaskOrigin | Array<Property$WebkitMaskOrigin>, + "-webkit-mask-position"?: Property$WebkitMaskPosition<TLength> | Array<Property$WebkitMaskPosition<TLength>>, + "-webkit-mask-position-x"?: Property$WebkitMaskPositionX<TLength> | Array<Property$WebkitMaskPositionX<TLength>>, + "-webkit-mask-position-y"?: Property$WebkitMaskPositionY<TLength> | Array<Property$WebkitMaskPositionY<TLength>>, + "-webkit-mask-repeat"?: Property$WebkitMaskRepeat | Array<Property$WebkitMaskRepeat>, + "-webkit-mask-repeat-x"?: Property$WebkitMaskRepeatX | Array<Property$WebkitMaskRepeatX>, + "-webkit-mask-repeat-y"?: Property$WebkitMaskRepeatY | Array<Property$WebkitMaskRepeatY>, + "-webkit-mask-size"?: Property$WebkitMaskSize<TLength> | Array<Property$WebkitMaskSize<TLength>>, + "-webkit-max-inline-size"?: Property$MaxInlineSize<TLength> | Array<Property$MaxInlineSize<TLength>>, + "-webkit-order"?: Property$Order | Array<Property$Order>, + "-webkit-overflow-scrolling"?: Property$WebkitOverflowScrolling | Array<Property$WebkitOverflowScrolling>, + "-webkit-padding-end"?: Property$PaddingInlineEnd<TLength> | Array<Property$PaddingInlineEnd<TLength>>, + "-webkit-padding-start"?: Property$PaddingInlineStart<TLength> | Array<Property$PaddingInlineStart<TLength>>, + "-webkit-perspective"?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + "-webkit-perspective-origin"?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + "-webkit-print-color-adjust"?: Property$PrintColorAdjust | Array<Property$PrintColorAdjust>, + "-webkit-ruby-position"?: Property$RubyPosition | Array<Property$RubyPosition>, + "-webkit-scroll-snap-type"?: Property$ScrollSnapType | Array<Property$ScrollSnapType>, + "-webkit-shape-margin"?: Property$ShapeMargin<TLength> | Array<Property$ShapeMargin<TLength>>, + "-webkit-tap-highlight-color"?: Property$WebkitTapHighlightColor | Array<Property$WebkitTapHighlightColor>, + "-webkit-text-combine"?: Property$TextCombineUpright | Array<Property$TextCombineUpright>, + "-webkit-text-decoration-color"?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + "-webkit-text-decoration-line"?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + "-webkit-text-decoration-skip"?: Property$TextDecorationSkip | Array<Property$TextDecorationSkip>, + "-webkit-text-decoration-style"?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + "-webkit-text-emphasis-color"?: Property$TextEmphasisColor | Array<Property$TextEmphasisColor>, + "-webkit-text-emphasis-position"?: Property$TextEmphasisPosition | Array<Property$TextEmphasisPosition>, + "-webkit-text-emphasis-style"?: Property$TextEmphasisStyle | Array<Property$TextEmphasisStyle>, + "-webkit-text-fill-color"?: Property$WebkitTextFillColor | Array<Property$WebkitTextFillColor>, + "-webkit-text-orientation"?: Property$TextOrientation | Array<Property$TextOrientation>, + "-webkit-text-size-adjust"?: Property$TextSizeAdjust | Array<Property$TextSizeAdjust>, + "-webkit-text-stroke-color"?: Property$WebkitTextStrokeColor | Array<Property$WebkitTextStrokeColor>, + "-webkit-text-stroke-width"?: Property$WebkitTextStrokeWidth<TLength> | Array<Property$WebkitTextStrokeWidth<TLength>>, + "-webkit-text-underline-position"?: Property$TextUnderlinePosition | Array<Property$TextUnderlinePosition>, + "-webkit-touch-callout"?: Property$WebkitTouchCallout | Array<Property$WebkitTouchCallout>, + "-webkit-transform"?: Property$Transform | Array<Property$Transform>, + "-webkit-transform-origin"?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + "-webkit-transform-style"?: Property$TransformStyle | Array<Property$TransformStyle>, + "-webkit-transition-delay"?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + "-webkit-transition-duration"?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + "-webkit-transition-property"?: Property$TransitionProperty | Array<Property$TransitionProperty>, + "-webkit-transition-timing-function"?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + "-webkit-user-modify"?: Property$WebkitUserModify | Array<Property$WebkitUserModify>, + "-webkit-user-select"?: Property$UserSelect | Array<Property$UserSelect>, + "-webkit-writing-mode"?: Property$WritingMode | Array<Property$WritingMode>, +|}; + +export type VendorShorthandPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + "-moz-animation"?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + "-moz-border-image"?: Property$BorderImage | Array<Property$BorderImage>, + "-moz-column-rule"?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + "-moz-columns"?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + "-moz-outline-radius"?: Property$MozOutlineRadius<TLength> | Array<Property$MozOutlineRadius<TLength>>, + "-ms-content-zoom-limit"?: Property$MsContentZoomLimit | Array<Property$MsContentZoomLimit>, + "-ms-content-zoom-snap"?: Property$MsContentZoomSnap | Array<Property$MsContentZoomSnap>, + "-ms-flex"?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + "-ms-scroll-limit"?: Property$MsScrollLimit | Array<Property$MsScrollLimit>, + "-ms-scroll-snap-x"?: Property$MsScrollSnapX | Array<Property$MsScrollSnapX>, + "-ms-scroll-snap-y"?: Property$MsScrollSnapY | Array<Property$MsScrollSnapY>, + "-ms-transition"?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + "-webkit-animation"?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + "-webkit-border-before"?: Property$WebkitBorderBefore<TLength> | Array<Property$WebkitBorderBefore<TLength>>, + "-webkit-border-image"?: Property$BorderImage | Array<Property$BorderImage>, + "-webkit-border-radius"?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + "-webkit-column-rule"?: Property$ColumnRule<TLength> | Array<Property$ColumnRule<TLength>>, + "-webkit-columns"?: Property$Columns<TLength> | Array<Property$Columns<TLength>>, + "-webkit-flex"?: Property$Flex<TLength> | Array<Property$Flex<TLength>>, + "-webkit-flex-flow"?: Property$FlexFlow | Array<Property$FlexFlow>, + "-webkit-mask"?: Property$WebkitMask<TLength> | Array<Property$WebkitMask<TLength>>, + "-webkit-mask-box-image"?: Property$MaskBorder | Array<Property$MaskBorder>, + "-webkit-text-emphasis"?: Property$TextEmphasis | Array<Property$TextEmphasis>, + "-webkit-text-stroke"?: Property$WebkitTextStroke<TLength> | Array<Property$WebkitTextStroke<TLength>>, + "-webkit-transition"?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, +|}; + +export type VendorPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + ...VendorLonghandPropertiesHyphenFallback<TLength, TTime>, + ...VendorShorthandPropertiesHyphenFallback<TLength, TTime>, +|}; + +export type ObsoletePropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + azimuth?: Property$Azimuth | Array<Property$Azimuth>, + "box-align"?: Property$BoxAlign | Array<Property$BoxAlign>, + "box-direction"?: Property$BoxDirection | Array<Property$BoxDirection>, + "box-flex"?: Property$BoxFlex | Array<Property$BoxFlex>, + "box-flex-group"?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + "box-lines"?: Property$BoxLines | Array<Property$BoxLines>, + "box-ordinal-group"?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + "box-orient"?: Property$BoxOrient | Array<Property$BoxOrient>, + "box-pack"?: Property$BoxPack | Array<Property$BoxPack>, + clip?: Property$Clip | Array<Property$Clip>, + "grid-column-gap"?: Property$GridColumnGap<TLength> | Array<Property$GridColumnGap<TLength>>, + "grid-gap"?: Property$GridGap<TLength> | Array<Property$GridGap<TLength>>, + "grid-row-gap"?: Property$GridRowGap<TLength> | Array<Property$GridRowGap<TLength>>, + "ime-mode"?: Property$ImeMode | Array<Property$ImeMode>, + "offset-block"?: Property$InsetBlock<TLength> | Array<Property$InsetBlock<TLength>>, + "offset-block-end"?: Property$InsetBlockEnd<TLength> | Array<Property$InsetBlockEnd<TLength>>, + "offset-block-start"?: Property$InsetBlockStart<TLength> | Array<Property$InsetBlockStart<TLength>>, + "offset-inline"?: Property$InsetInline<TLength> | Array<Property$InsetInline<TLength>>, + "offset-inline-end"?: Property$InsetInlineEnd<TLength> | Array<Property$InsetInlineEnd<TLength>>, + "offset-inline-start"?: Property$InsetInlineStart<TLength> | Array<Property$InsetInlineStart<TLength>>, + "scroll-snap-coordinate"?: Property$ScrollSnapCoordinate<TLength> | Array<Property$ScrollSnapCoordinate<TLength>>, + "scroll-snap-destination"?: Property$ScrollSnapDestination<TLength> | Array<Property$ScrollSnapDestination<TLength>>, + "scroll-snap-points-x"?: Property$ScrollSnapPointsX | Array<Property$ScrollSnapPointsX>, + "scroll-snap-points-y"?: Property$ScrollSnapPointsY | Array<Property$ScrollSnapPointsY>, + "scroll-snap-type-x"?: Property$ScrollSnapTypeX | Array<Property$ScrollSnapTypeX>, + "scroll-snap-type-y"?: Property$ScrollSnapTypeY | Array<Property$ScrollSnapTypeY>, + "-khtml-box-align"?: Property$BoxAlign | Array<Property$BoxAlign>, + "-khtml-box-direction"?: Property$BoxDirection | Array<Property$BoxDirection>, + "-khtml-box-flex"?: Property$BoxFlex | Array<Property$BoxFlex>, + "-khtml-box-flex-group"?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + "-khtml-box-lines"?: Property$BoxLines | Array<Property$BoxLines>, + "-khtml-box-ordinal-group"?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + "-khtml-box-orient"?: Property$BoxOrient | Array<Property$BoxOrient>, + "-khtml-box-pack"?: Property$BoxPack | Array<Property$BoxPack>, + "-khtml-line-break"?: Property$LineBreak | Array<Property$LineBreak>, + "-khtml-opacity"?: Property$Opacity | Array<Property$Opacity>, + "-khtml-user-select"?: Property$UserSelect | Array<Property$UserSelect>, + "-moz-backface-visibility"?: Property$BackfaceVisibility | Array<Property$BackfaceVisibility>, + "-moz-background-clip"?: Property$BackgroundClip | Array<Property$BackgroundClip>, + "-moz-background-inline-policy"?: Property$BoxDecorationBreak | Array<Property$BoxDecorationBreak>, + "-moz-background-origin"?: Property$BackgroundOrigin | Array<Property$BackgroundOrigin>, + "-moz-background-size"?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + "-moz-border-radius"?: Property$BorderRadius<TLength> | Array<Property$BorderRadius<TLength>>, + "-moz-border-radius-bottomleft"?: Property$BorderBottomLeftRadius<TLength> | Array<Property$BorderBottomLeftRadius<TLength>>, + "-moz-border-radius-bottomright"?: Property$BorderBottomRightRadius<TLength> | Array<Property$BorderBottomRightRadius<TLength>>, + "-moz-border-radius-topleft"?: Property$BorderTopLeftRadius<TLength> | Array<Property$BorderTopLeftRadius<TLength>>, + "-moz-border-radius-topright"?: Property$BorderTopRightRadius<TLength> | Array<Property$BorderTopRightRadius<TLength>>, + "-moz-box-align"?: Property$BoxAlign | Array<Property$BoxAlign>, + "-moz-box-direction"?: Property$BoxDirection | Array<Property$BoxDirection>, + "-moz-box-flex"?: Property$BoxFlex | Array<Property$BoxFlex>, + "-moz-box-ordinal-group"?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + "-moz-box-orient"?: Property$BoxOrient | Array<Property$BoxOrient>, + "-moz-box-pack"?: Property$BoxPack | Array<Property$BoxPack>, + "-moz-box-shadow"?: Property$BoxShadow | Array<Property$BoxShadow>, + "-moz-float-edge"?: Property$MozFloatEdge | Array<Property$MozFloatEdge>, + "-moz-force-broken-image-icon"?: Property$MozForceBrokenImageIcon | Array<Property$MozForceBrokenImageIcon>, + "-moz-opacity"?: Property$Opacity | Array<Property$Opacity>, + "-moz-outline"?: Property$Outline<TLength> | Array<Property$Outline<TLength>>, + "-moz-outline-color"?: Property$OutlineColor | Array<Property$OutlineColor>, + "-moz-outline-style"?: Property$OutlineStyle | Array<Property$OutlineStyle>, + "-moz-outline-width"?: Property$OutlineWidth<TLength> | Array<Property$OutlineWidth<TLength>>, + "-moz-perspective"?: Property$Perspective<TLength> | Array<Property$Perspective<TLength>>, + "-moz-perspective-origin"?: Property$PerspectiveOrigin<TLength> | Array<Property$PerspectiveOrigin<TLength>>, + "-moz-text-align-last"?: Property$TextAlignLast | Array<Property$TextAlignLast>, + "-moz-text-decoration-color"?: Property$TextDecorationColor | Array<Property$TextDecorationColor>, + "-moz-text-decoration-line"?: Property$TextDecorationLine | Array<Property$TextDecorationLine>, + "-moz-text-decoration-style"?: Property$TextDecorationStyle | Array<Property$TextDecorationStyle>, + "-moz-transform"?: Property$Transform | Array<Property$Transform>, + "-moz-transform-origin"?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + "-moz-transform-style"?: Property$TransformStyle | Array<Property$TransformStyle>, + "-moz-transition"?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + "-moz-transition-delay"?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + "-moz-transition-duration"?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + "-moz-transition-property"?: Property$TransitionProperty | Array<Property$TransitionProperty>, + "-moz-transition-timing-function"?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + "-moz-user-input"?: Property$MozUserInput | Array<Property$MozUserInput>, + "-ms-ime-mode"?: Property$ImeMode | Array<Property$ImeMode>, + "-o-animation"?: Property$Animation<TTime> | Array<Property$Animation<TTime>>, + "-o-animation-delay"?: Property$AnimationDelay<TTime> | Array<Property$AnimationDelay<TTime>>, + "-o-animation-direction"?: Property$AnimationDirection | Array<Property$AnimationDirection>, + "-o-animation-duration"?: Property$AnimationDuration<TTime> | Array<Property$AnimationDuration<TTime>>, + "-o-animation-fill-mode"?: Property$AnimationFillMode | Array<Property$AnimationFillMode>, + "-o-animation-iteration-count"?: Property$AnimationIterationCount | Array<Property$AnimationIterationCount>, + "-o-animation-name"?: Property$AnimationName | Array<Property$AnimationName>, + "-o-animation-play-state"?: Property$AnimationPlayState | Array<Property$AnimationPlayState>, + "-o-animation-timing-function"?: Property$AnimationTimingFunction | Array<Property$AnimationTimingFunction>, + "-o-background-size"?: Property$BackgroundSize<TLength> | Array<Property$BackgroundSize<TLength>>, + "-o-border-image"?: Property$BorderImage | Array<Property$BorderImage>, + "-o-object-fit"?: Property$ObjectFit | Array<Property$ObjectFit>, + "-o-object-position"?: Property$ObjectPosition<TLength> | Array<Property$ObjectPosition<TLength>>, + "-o-tab-size"?: Property$TabSize<TLength> | Array<Property$TabSize<TLength>>, + "-o-text-overflow"?: Property$TextOverflow | Array<Property$TextOverflow>, + "-o-transform"?: Property$Transform | Array<Property$Transform>, + "-o-transform-origin"?: Property$TransformOrigin<TLength> | Array<Property$TransformOrigin<TLength>>, + "-o-transition"?: Property$Transition<TTime> | Array<Property$Transition<TTime>>, + "-o-transition-delay"?: Property$TransitionDelay<TTime> | Array<Property$TransitionDelay<TTime>>, + "-o-transition-duration"?: Property$TransitionDuration<TTime> | Array<Property$TransitionDuration<TTime>>, + "-o-transition-property"?: Property$TransitionProperty | Array<Property$TransitionProperty>, + "-o-transition-timing-function"?: Property$TransitionTimingFunction | Array<Property$TransitionTimingFunction>, + "-webkit-box-align"?: Property$BoxAlign | Array<Property$BoxAlign>, + "-webkit-box-direction"?: Property$BoxDirection | Array<Property$BoxDirection>, + "-webkit-box-flex"?: Property$BoxFlex | Array<Property$BoxFlex>, + "-webkit-box-flex-group"?: Property$BoxFlexGroup | Array<Property$BoxFlexGroup>, + "-webkit-box-lines"?: Property$BoxLines | Array<Property$BoxLines>, + "-webkit-box-ordinal-group"?: Property$BoxOrdinalGroup | Array<Property$BoxOrdinalGroup>, + "-webkit-box-orient"?: Property$BoxOrient | Array<Property$BoxOrient>, + "-webkit-box-pack"?: Property$BoxPack | Array<Property$BoxPack>, +|}; + +export type SvgPropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + "alignment-baseline"?: Property$AlignmentBaseline | Array<Property$AlignmentBaseline>, + "baseline-shift"?: Property$BaselineShift<TLength> | Array<Property$BaselineShift<TLength>>, + clip?: Property$Clip | Array<Property$Clip>, + "clip-path"?: Property$ClipPath | Array<Property$ClipPath>, + "clip-rule"?: Property$ClipRule | Array<Property$ClipRule>, + color?: Property$Color | Array<Property$Color>, + "color-interpolation"?: Property$ColorInterpolation | Array<Property$ColorInterpolation>, + "color-rendering"?: Property$ColorRendering | Array<Property$ColorRendering>, + cursor?: Property$Cursor | Array<Property$Cursor>, + direction?: Property$Direction | Array<Property$Direction>, + display?: Property$Display | Array<Property$Display>, + "dominant-baseline"?: Property$DominantBaseline | Array<Property$DominantBaseline>, + fill?: Property$Fill | Array<Property$Fill>, + "fill-opacity"?: Property$FillOpacity | Array<Property$FillOpacity>, + "fill-rule"?: Property$FillRule | Array<Property$FillRule>, + filter?: Property$Filter | Array<Property$Filter>, + "flood-color"?: Property$FloodColor | Array<Property$FloodColor>, + "flood-opacity"?: Property$FloodOpacity | Array<Property$FloodOpacity>, + font?: Property$Font | Array<Property$Font>, + "font-family"?: Property$FontFamily | Array<Property$FontFamily>, + "font-size"?: Property$FontSize<TLength> | Array<Property$FontSize<TLength>>, + "font-size-adjust"?: Property$FontSizeAdjust | Array<Property$FontSizeAdjust>, + "font-stretch"?: Property$FontStretch | Array<Property$FontStretch>, + "font-style"?: Property$FontStyle | Array<Property$FontStyle>, + "font-variant"?: Property$FontVariant | Array<Property$FontVariant>, + "font-weight"?: Property$FontWeight | Array<Property$FontWeight>, + "glyph-orientation-vertical"?: Property$GlyphOrientationVertical | Array<Property$GlyphOrientationVertical>, + "image-rendering"?: Property$ImageRendering | Array<Property$ImageRendering>, + "letter-spacing"?: Property$LetterSpacing<TLength> | Array<Property$LetterSpacing<TLength>>, + "lighting-color"?: Property$LightingColor | Array<Property$LightingColor>, + "line-height"?: Property$LineHeight<TLength> | Array<Property$LineHeight<TLength>>, + marker?: Property$Marker | Array<Property$Marker>, + "marker-end"?: Property$MarkerEnd | Array<Property$MarkerEnd>, + "marker-mid"?: Property$MarkerMid | Array<Property$MarkerMid>, + "marker-start"?: Property$MarkerStart | Array<Property$MarkerStart>, + mask?: Property$Mask<TLength> | Array<Property$Mask<TLength>>, + opacity?: Property$Opacity | Array<Property$Opacity>, + overflow?: Property$Overflow | Array<Property$Overflow>, + "paint-order"?: Property$PaintOrder | Array<Property$PaintOrder>, + "pointer-events"?: Property$PointerEvents | Array<Property$PointerEvents>, + "shape-rendering"?: Property$ShapeRendering | Array<Property$ShapeRendering>, + "stop-color"?: Property$StopColor | Array<Property$StopColor>, + "stop-opacity"?: Property$StopOpacity | Array<Property$StopOpacity>, + stroke?: Property$Stroke | Array<Property$Stroke>, + "stroke-dasharray"?: Property$StrokeDasharray<TLength> | Array<Property$StrokeDasharray<TLength>>, + "stroke-dashoffset"?: Property$StrokeDashoffset<TLength> | Array<Property$StrokeDashoffset<TLength>>, + "stroke-linecap"?: Property$StrokeLinecap | Array<Property$StrokeLinecap>, + "stroke-linejoin"?: Property$StrokeLinejoin | Array<Property$StrokeLinejoin>, + "stroke-miterlimit"?: Property$StrokeMiterlimit | Array<Property$StrokeMiterlimit>, + "stroke-opacity"?: Property$StrokeOpacity | Array<Property$StrokeOpacity>, + "stroke-width"?: Property$StrokeWidth<TLength> | Array<Property$StrokeWidth<TLength>>, + "text-anchor"?: Property$TextAnchor | Array<Property$TextAnchor>, + "text-decoration"?: Property$TextDecoration<TLength> | Array<Property$TextDecoration<TLength>>, + "text-rendering"?: Property$TextRendering | Array<Property$TextRendering>, + "unicode-bidi"?: Property$UnicodeBidi | Array<Property$UnicodeBidi>, + "vector-effect"?: Property$VectorEffect | Array<Property$VectorEffect>, + visibility?: Property$Visibility | Array<Property$Visibility>, + "white-space"?: Property$WhiteSpace | Array<Property$WhiteSpace>, + "word-spacing"?: Property$WordSpacing<TLength> | Array<Property$WordSpacing<TLength>>, + "writing-mode"?: Property$WritingMode | Array<Property$WritingMode>, +|}; + +export type PropertiesHyphenFallback<TLength = string | 0, TTime = string> = {| + ...StandardPropertiesHyphenFallback<TLength, TTime>, + ...VendorPropertiesHyphenFallback<TLength, TTime>, + ...ObsoletePropertiesHyphenFallback<TLength, TTime>, + ...SvgPropertiesHyphenFallback<TLength, TTime>, +|}; + +export type AtRules = + | "@charset" + | "@counter-style" + | "@document" + | "@font-face" + | "@font-feature-values" + | "@font-palette-values" + | "@import" + | "@keyframes" + | "@layer" + | "@media" + | "@namespace" + | "@page" + | "@property" + | "@scope" + | "@scroll-timeline" + | "@starting-style" + | "@supports" + | "@viewport"; + +export type AdvancedPseudos = + | ":-moz-any()" + | ":-moz-dir" + | ":-webkit-any()" + | "::cue" + | "::cue-region" + | "::part" + | "::slotted" + | "::view-transition-group" + | "::view-transition-image-pair" + | "::view-transition-new" + | "::view-transition-old" + | ":dir" + | ":has" + | ":host" + | ":host-context" + | ":is" + | ":lang" + | ":matches()" + | ":not" + | ":nth-child" + | ":nth-last-child" + | ":nth-last-of-type" + | ":nth-of-type" + | ":where"; + +export type SimplePseudos = + | ":-khtml-any-link" + | ":-moz-any-link" + | ":-moz-focusring" + | ":-moz-full-screen" + | ":-moz-placeholder" + | ":-moz-read-only" + | ":-moz-read-write" + | ":-moz-ui-invalid" + | ":-moz-ui-valid" + | ":-ms-fullscreen" + | ":-ms-input-placeholder" + | ":-webkit-any-link" + | ":-webkit-full-screen" + | "::-moz-placeholder" + | "::-moz-progress-bar" + | "::-moz-range-progress" + | "::-moz-range-thumb" + | "::-moz-range-track" + | "::-moz-selection" + | "::-ms-backdrop" + | "::-ms-browse" + | "::-ms-check" + | "::-ms-clear" + | "::-ms-expand" + | "::-ms-fill" + | "::-ms-fill-lower" + | "::-ms-fill-upper" + | "::-ms-input-placeholder" + | "::-ms-reveal" + | "::-ms-thumb" + | "::-ms-ticks-after" + | "::-ms-ticks-before" + | "::-ms-tooltip" + | "::-ms-track" + | "::-ms-value" + | "::-webkit-backdrop" + | "::-webkit-input-placeholder" + | "::-webkit-progress-bar" + | "::-webkit-progress-inner-value" + | "::-webkit-progress-value" + | "::-webkit-slider-runnable-track" + | "::-webkit-slider-thumb" + | "::after" + | "::backdrop" + | "::before" + | "::cue" + | "::cue-region" + | "::first-letter" + | "::first-line" + | "::grammar-error" + | "::marker" + | "::placeholder" + | "::selection" + | "::spelling-error" + | "::target-text" + | "::view-transition" + | ":active" + | ":after" + | ":any-link" + | ":before" + | ":blank" + | ":checked" + | ":current" + | ":default" + | ":defined" + | ":disabled" + | ":empty" + | ":enabled" + | ":first" + | ":first-child" + | ":first-letter" + | ":first-line" + | ":first-of-type" + | ":focus" + | ":focus-visible" + | ":focus-within" + | ":fullscreen" + | ":future" + | ":hover" + | ":in-range" + | ":indeterminate" + | ":invalid" + | ":last-child" + | ":last-of-type" + | ":left" + | ":link" + | ":local-link" + | ":nth-col" + | ":nth-last-col" + | ":only-child" + | ":only-of-type" + | ":optional" + | ":out-of-range" + | ":past" + | ":paused" + | ":picture-in-picture" + | ":placeholder-shown" + | ":playing" + | ":read-only" + | ":read-write" + | ":required" + | ":right" + | ":root" + | ":scope" + | ":target" + | ":target-within" + | ":user-invalid" + | ":user-valid" + | ":valid" + | ":visited"; + +export type Pseudos = AdvancedPseudos | SimplePseudos; + +export type HtmlAttributes = + | "[abbr]" + | "[accept-charset]" + | "[accept]" + | "[accesskey]" + | "[action]" + | "[align]" + | "[alink]" + | "[allow]" + | "[allowfullscreen]" + | "[allowpaymentrequest]" + | "[alt]" + | "[archive]" + | "[async]" + | "[attributionsrc]" + | "[autobuffer]" + | "[autocapitalize]" + | "[autocomplete]" + | "[autofocus]" + | "[autoplay]" + | "[axis]" + | "[background]" + | "[behavior]" + | "[bgcolor]" + | "[blocking]" + | "[border]" + | "[bottommargin]" + | "[browsingtopics]" + | "[capture]" + | "[cellpadding]" + | "[cellspacing]" + | "[char]" + | "[charoff]" + | "[charset]" + | "[checked]" + | "[cite]" + | "[class]" + | "[classid]" + | "[clear]" + | "[codebase]" + | "[codetype]" + | "[color]" + | "[cols]" + | "[colspan]" + | "[compact]" + | "[content]" + | "[contenteditable]" + | "[contextmenu]" + | "[controls]" + | "[coords]" + | "[credentialless]" + | "[crossorigin]" + | "[data]" + | "[datetime]" + | "[declare]" + | "[decoding]" + | "[default]" + | "[defer]" + | "[dir]" + | "[direction]" + | "[dirname]" + | "[disabled]" + | "[download]" + | "[draggable]" + | "[enctype]" + | "[enterkeyhint]" + | "[exportparts]" + | "[face]" + | "[fetchpriority]" + | "[for]" + | "[form]" + | "[formaction]" + | "[formenctype]" + | "[formmethod]" + | "[formnovalidate]" + | "[formtarget]" + | "[frame]" + | "[frameborder]" + | "[headers]" + | "[height]" + | "[hidden]" + | "[high]" + | "[href]" + | "[hreflang]" + | "[hspace]" + | "[http-equiv]" + | "[id]" + | "[imagesizes]" + | "[imagesrcset]" + | "[inert]" + | "[inputmode]" + | "[integrity]" + | "[is]" + | "[ismap]" + | "[itemid]" + | "[itemprop]" + | "[itemref]" + | "[itemscope]" + | "[itemtype]" + | "[kind]" + | "[label]" + | "[lang]" + | "[language]" + | "[leftmargin]" + | "[link]" + | "[list]" + | "[loading]" + | "[longdesc]" + | "[loop]" + | "[low]" + | "[manifest]" + | "[marginheight]" + | "[marginwidth]" + | "[max]" + | "[maxlength]" + | "[media]" + | "[method]" + | "[methods]" + | "[min]" + | "[minlength]" + | "[moz-opaque]" + | "[mozactionhint]" + | "[mozallowfullscreen]" + | "[msallowfullscreen]" + | "[multiple]" + | "[muted]" + | "[name]" + | "[nohref]" + | "[nomodule]" + | "[nonce]" + | "[noresize]" + | "[noshade]" + | "[novalidate]" + | "[nowrap]" + | "[onerror]" + | "[open]" + | "[optimum]" + | "[part]" + | "[pattern]" + | "[ping]" + | "[placeholder]" + | "[popover]" + | "[popovertarget]" + | "[popovertargetaction]" + | "[poster]" + | "[preload]" + | "[profile]" + | "[readonly]" + | "[referrerpolicy]" + | "[rel]" + | "[required]" + | "[rev]" + | "[reversed]" + | "[rightmargin]" + | "[rows]" + | "[rowspan]" + | "[rules]" + | "[sandbox]" + | "[scope]" + | "[scrollamount]" + | "[scrolldelay]" + | "[scrolling]" + | "[selected]" + | "[shadowroot]" + | "[shadowrootmode]" + | "[shape]" + | "[size]" + | "[sizes]" + | "[slot]" + | "[span]" + | "[spellcheck]" + | "[src]" + | "[srcdoc]" + | "[srclang]" + | "[srcset]" + | "[standby]" + | "[start]" + | "[step]" + | "[style]" + | "[summary]" + | "[tabindex]" + | "[target]" + | "[text]" + | "[title]" + | "[topmargin]" + | "[translate]" + | "[truespeed]" + | "[type]" + | "[usemap]" + | "[valign]" + | "[value]" + | "[valuetype]" + | "[version]" + | "[virtualkeyboardpolicy]" + | "[vlink]" + | "[vspace]" + | "[webkitallowfullscreen]" + | "[width]" + | "[wrap]" + | "[x-moz-errormessage]" + | "[xmlns]"; + +export type SvgAttributes = + | "[accent-height]" + | "[alignment-baseline]" + | "[allowReorder]" + | "[alphabetic]" + | "[animation]" + | "[arabic-form]" + | "[ascent]" + | "[async]" + | "[attributeName]" + | "[attributeType]" + | "[azimuth]" + | "[baseFrequency]" + | "[baseProfile]" + | "[baseline-shift]" + | "[bbox]" + | "[bias]" + | "[by]" + | "[calcMode]" + | "[cap-height]" + | "[class]" + | "[clip-path]" + | "[clip-rule]" + | "[clipPathUnits]" + | "[clip]" + | "[color-interpolation-filters]" + | "[color-interpolation]" + | "[color-profile]" + | "[color]" + | "[contentScriptType]" + | "[contentStyleType]" + | "[crossorigin]" + | "[cursor]" + | "[cx]" + | "[cy]" + | "[d]" + | "[decoding]" + | "[defer]" + | "[descent]" + | "[diffuseConstant]" + | "[direction]" + | "[display]" + | "[divisor]" + | "[document]" + | "[dominant-baseline]" + | "[download]" + | "[dur]" + | "[dx]" + | "[dy]" + | "[edgeMode]" + | "[elevation]" + | "[enable-background]" + | "[fill-opacity]" + | "[fill-rule]" + | "[fill]" + | "[filterRes]" + | "[filterUnits]" + | "[filter]" + | "[flood-color]" + | "[flood-opacity]" + | "[font-family]" + | "[font-size-adjust]" + | "[font-size]" + | "[font-stretch]" + | "[font-style]" + | "[font-variant]" + | "[font-weight]" + | "[format]" + | "[fr]" + | "[from]" + | "[fx]" + | "[fy]" + | "[g1]" + | "[g2]" + | "[global]" + | "[glyph-name]" + | "[glyph-orientation-horizontal]" + | "[glyph-orientation-vertical]" + | "[glyphRef]" + | "[gradientTransform]" + | "[gradientUnits]" + | "[graphical]" + | "[hanging]" + | "[height]" + | "[horiz-adv-x]" + | "[horiz-origin-x]" + | "[horiz-origin-y]" + | "[href]" + | "[hreflang]" + | "[id]" + | "[ideographic]" + | "[image-rendering]" + | "[in2]" + | "[in]" + | "[k1]" + | "[k2]" + | "[k3]" + | "[k4]" + | "[k]" + | "[kernelMatrix]" + | "[kernelUnitLength]" + | "[kerning]" + | "[keyPoints]" + | "[lang]" + | "[lengthAdjust]" + | "[letter-spacing]" + | "[lighting-color]" + | "[limitingConeAngle]" + | "[marker-end]" + | "[marker-mid]" + | "[marker-start]" + | "[markerHeight]" + | "[markerUnits]" + | "[markerWidth]" + | "[maskContentUnits]" + | "[maskUnits]" + | "[mask]" + | "[mathematical]" + | "[media]" + | "[mode]" + | "[name]" + | "[numOctaves]" + | "[offset]" + | "[opacity]" + | "[operator]" + | "[order]" + | "[orient]" + | "[orientation]" + | "[origin]" + | "[overflow]" + | "[overline-position]" + | "[overline-thickness]" + | "[paint-order]" + | "[panose-1]" + | "[path]" + | "[patternContentUnits]" + | "[patternTransform]" + | "[patternUnits]" + | "[ping]" + | "[pointer-events]" + | "[pointsAtX]" + | "[pointsAtY]" + | "[pointsAtZ]" + | "[points]" + | "[preserveAlpha]" + | "[preserveAspectRatio]" + | "[primitiveUnits]" + | "[r]" + | "[radius]" + | "[refX]" + | "[refY]" + | "[referrerpolicy]" + | "[rel]" + | "[repeatCount]" + | "[requiredExtensions]" + | "[requiredFeatures]" + | "[rotate]" + | "[rx]" + | "[ry]" + | "[scale]" + | "[seed]" + | "[shape-rendering]" + | "[side]" + | "[slope]" + | "[solid-color]" + | "[solid-opacity]" + | "[spacing]" + | "[specularConstant]" + | "[specularExponent]" + | "[spreadMethod]" + | "[startOffset]" + | "[stdDeviation]" + | "[stemh]" + | "[stemv]" + | "[stitchTiles]" + | "[stop-color]" + | "[stop-opacity]" + | "[strikethrough-position]" + | "[strikethrough-thickness]" + | "[string]" + | "[stroke-dasharray]" + | "[stroke-dashoffset]" + | "[stroke-linecap]" + | "[stroke-linejoin]" + | "[stroke-miterlimit]" + | "[stroke-opacity]" + | "[stroke-width]" + | "[stroke]" + | "[style]" + | "[surfaceScale]" + | "[systemLanguage]" + | "[tabindex]" + | "[targetX]" + | "[targetY]" + | "[target]" + | "[text-anchor]" + | "[text-decoration]" + | "[text-overflow]" + | "[text-rendering]" + | "[textLength]" + | "[title]" + | "[to]" + | "[transform-origin]" + | "[transform]" + | "[type]" + | "[u1]" + | "[u2]" + | "[underline-position]" + | "[underline-thickness]" + | "[unicode-bidi]" + | "[unicode-range]" + | "[unicode]" + | "[units-per-em]" + | "[v-alphabetic]" + | "[v-hanging]" + | "[v-ideographic]" + | "[v-mathematical]" + | "[values]" + | "[vector-effect]" + | "[version]" + | "[vert-adv-y]" + | "[vert-origin-x]" + | "[vert-origin-y]" + | "[viewBox]" + | "[viewTarget]" + | "[visibility]" + | "[white-space]" + | "[width]" + | "[widths]" + | "[word-spacing]" + | "[writing-mode]" + | "[x-height]" + | "[x1]" + | "[x2]" + | "[xChannelSelector]" + | "[x]" + | "[y1]" + | "[y2]" + | "[yChannelSelector]" + | "[y]" + | "[z]" + | "[zoomAndPan]"; + +export type Globals = "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset"; + +export type Property$AccentColor = Globals | DataType$Color | "auto"; + +export type Property$AlignContent = Globals | DataType$ContentDistribution | DataType$ContentPosition | "baseline" | "normal" | string; + +export type Property$AlignItems = Globals | DataType$SelfPosition | "baseline" | "normal" | "stretch" | string; + +export type Property$AlignSelf = Globals | DataType$SelfPosition | "auto" | "baseline" | "normal" | "stretch" | string; + +export type Property$AlignTracks = Globals | DataType$ContentDistribution | DataType$ContentPosition | "baseline" | "normal" | string; + +export type Property$All = Globals; + +export type Property$Animation<TTime = string> = Globals | DataType$SingleAnimation<TTime> | string; + +export type Property$AnimationComposition = Globals | DataType$SingleAnimationComposition | string; + +export type Property$AnimationDelay<TTime = string> = Globals | TTime | string; + +export type Property$AnimationDirection = Globals | DataType$SingleAnimationDirection | string; + +export type Property$AnimationDuration<TTime = string> = Globals | TTime | string; + +export type Property$AnimationFillMode = Globals | DataType$SingleAnimationFillMode | string; + +export type Property$AnimationIterationCount = Globals | "infinite" | string | number; + +export type Property$AnimationName = Globals | "none" | string; + +export type Property$AnimationPlayState = Globals | "paused" | "running" | string; + +export type Property$AnimationRange<TLength = string | 0> = Globals | DataType$TimelineRangeName | TLength | "normal" | string; + +export type Property$AnimationRangeEnd<TLength = string | 0> = Globals | DataType$TimelineRangeName | TLength | "normal" | string; + +export type Property$AnimationRangeStart<TLength = string | 0> = Globals | DataType$TimelineRangeName | TLength | "normal" | string; + +export type Property$AnimationTimeline = Globals | DataType$SingleAnimationTimeline | string; + +export type Property$AnimationTimingFunction = Globals | DataType$EasingFunction | string; + +export type Property$Appearance = Globals | DataType$CompatAuto | "auto" | "menulist-button" | "none" | "textfield"; + +export type Property$AspectRatio = Globals | "auto" | string | number; + +export type Property$Azimuth = + | Globals + | "behind" + | "center" + | "center-left" + | "center-right" + | "far-left" + | "far-right" + | "left" + | "left-side" + | "leftwards" + | "right" + | "right-side" + | "rightwards" + | string; + +export type Property$BackdropFilter = Globals | "none" | string; + +export type Property$BackfaceVisibility = Globals | "hidden" | "visible"; + +export type Property$Background<TLength = string | 0> = Globals | DataType$FinalBgLayer<TLength> | string; + +export type Property$BackgroundAttachment = Globals | DataType$Attachment | string; + +export type Property$BackgroundBlendMode = Globals | DataType$BlendMode | string; + +export type Property$BackgroundClip = Globals | DataType$Box | string; + +export type Property$BackgroundColor = Globals | DataType$Color; + +export type Property$BackgroundImage = Globals | "none" | string; + +export type Property$BackgroundOrigin = Globals | DataType$Box | string; + +export type Property$BackgroundPosition<TLength = string | 0> = Globals | DataType$BgPosition<TLength> | string; + +export type Property$BackgroundPositionX<TLength = string | 0> = Globals | TLength | "center" | "left" | "right" | "x-end" | "x-start" | string; + +export type Property$BackgroundPositionY<TLength = string | 0> = Globals | TLength | "bottom" | "center" | "top" | "y-end" | "y-start" | string; + +export type Property$BackgroundRepeat = Globals | DataType$RepeatStyle | string; + +export type Property$BackgroundSize<TLength = string | 0> = Globals | DataType$BgSize<TLength> | string; + +export type Property$BlockOverflow = Globals | "clip" | "ellipsis" | string; + +export type Property$BlockSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$Border<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderBlock<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderBlockColor = Globals | DataType$Color | string; + +export type Property$BorderBlockEnd<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderBlockEndColor = Globals | DataType$Color; + +export type Property$BorderBlockEndStyle = Globals | DataType$LineStyle; + +export type Property$BorderBlockEndWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderBlockStart<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderBlockStartColor = Globals | DataType$Color; + +export type Property$BorderBlockStartStyle = Globals | DataType$LineStyle; + +export type Property$BorderBlockStartWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderBlockStyle = Globals | DataType$LineStyle; + +export type Property$BorderBlockWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderBottom<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderBottomColor = Globals | DataType$Color; + +export type Property$BorderBottomLeftRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderBottomRightRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderBottomStyle = Globals | DataType$LineStyle; + +export type Property$BorderBottomWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderCollapse = Globals | "collapse" | "separate"; + +export type Property$BorderColor = Globals | DataType$Color | string; + +export type Property$BorderEndEndRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderEndStartRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderImage = Globals | "none" | "repeat" | "round" | "space" | "stretch" | string | number; + +export type Property$BorderImageOutset<TLength = string | 0> = Globals | TLength | string | number; + +export type Property$BorderImageRepeat = Globals | "repeat" | "round" | "space" | "stretch" | string; + +export type Property$BorderImageSlice = Globals | string | number; + +export type Property$BorderImageSource = Globals | "none" | string; + +export type Property$BorderImageWidth<TLength = string | 0> = Globals | TLength | "auto" | string | number; + +export type Property$BorderInline<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderInlineColor = Globals | DataType$Color | string; + +export type Property$BorderInlineEnd<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderInlineEndColor = Globals | DataType$Color; + +export type Property$BorderInlineEndStyle = Globals | DataType$LineStyle; + +export type Property$BorderInlineEndWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderInlineStart<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderInlineStartColor = Globals | DataType$Color; + +export type Property$BorderInlineStartStyle = Globals | DataType$LineStyle; + +export type Property$BorderInlineStartWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderInlineStyle = Globals | DataType$LineStyle; + +export type Property$BorderInlineWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderLeft<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderLeftColor = Globals | DataType$Color; + +export type Property$BorderLeftStyle = Globals | DataType$LineStyle; + +export type Property$BorderLeftWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderRight<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderRightColor = Globals | DataType$Color; + +export type Property$BorderRightStyle = Globals | DataType$LineStyle; + +export type Property$BorderRightWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderSpacing<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderStartEndRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderStartStartRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderStyle = Globals | DataType$LineStyle | string; + +export type Property$BorderTop<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$BorderTopColor = Globals | DataType$Color; + +export type Property$BorderTopLeftRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderTopRightRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$BorderTopStyle = Globals | DataType$LineStyle; + +export type Property$BorderTopWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$BorderWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | string; + +export type Property$Bottom<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$BoxAlign = Globals | "baseline" | "center" | "end" | "start" | "stretch"; + +export type Property$BoxDecorationBreak = Globals | "clone" | "slice"; + +export type Property$BoxDirection = Globals | "inherit" | "normal" | "reverse"; + +export type Property$BoxFlex = Globals | number; + +export type Property$BoxFlexGroup = Globals | number; + +export type Property$BoxLines = Globals | "multiple" | "single"; + +export type Property$BoxOrdinalGroup = Globals | number; + +export type Property$BoxOrient = Globals | "block-axis" | "horizontal" | "inherit" | "inline-axis" | "vertical"; + +export type Property$BoxPack = Globals | "center" | "end" | "justify" | "start"; + +export type Property$BoxShadow = Globals | "none" | string; + +export type Property$BoxSizing = Globals | "border-box" | "content-box"; + +export type Property$BreakAfter = + | Globals + | "all" + | "always" + | "auto" + | "avoid" + | "avoid-column" + | "avoid-page" + | "avoid-region" + | "column" + | "left" + | "page" + | "recto" + | "region" + | "right" + | "verso"; + +export type Property$BreakBefore = + | Globals + | "all" + | "always" + | "auto" + | "avoid" + | "avoid-column" + | "avoid-page" + | "avoid-region" + | "column" + | "left" + | "page" + | "recto" + | "region" + | "right" + | "verso"; + +export type Property$BreakInside = Globals | "auto" | "avoid" | "avoid-column" | "avoid-page" | "avoid-region"; + +export type Property$CaptionSide = Globals | "block-end" | "block-start" | "bottom" | "inline-end" | "inline-start" | "top"; + +export type Property$Caret = Globals | DataType$Color | "auto" | "bar" | "block" | "underscore" | string; + +export type Property$CaretColor = Globals | DataType$Color | "auto"; + +export type Property$CaretShape = Globals | "auto" | "bar" | "block" | "underscore"; + +export type Property$Clear = Globals | "both" | "inline-end" | "inline-start" | "left" | "none" | "right"; + +export type Property$Clip = Globals | "auto" | string; + +export type Property$ClipPath = Globals | DataType$GeometryBox | "none" | string; + +export type Property$Color = Globals | DataType$Color; + +export type Property$PrintColorAdjust = Globals | "economy" | "exact"; + +export type Property$ColorScheme = Globals | "dark" | "light" | "normal" | string; + +export type Property$ColumnCount = Globals | "auto" | number; + +export type Property$ColumnFill = Globals | "auto" | "balance" | "balance-all"; + +export type Property$ColumnGap<TLength = string | 0> = Globals | TLength | "normal" | string; + +export type Property$ColumnRule<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$ColumnRuleColor = Globals | DataType$Color; + +export type Property$ColumnRuleStyle = Globals | DataType$LineStyle | string; + +export type Property$ColumnRuleWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | string; + +export type Property$ColumnSpan = Globals | "all" | "none"; + +export type Property$ColumnWidth<TLength = string | 0> = Globals | TLength | "auto"; + +export type Property$Columns<TLength = string | 0> = Globals | TLength | "auto" | string | number; + +export type Property$Contain = Globals | "content" | "inline-size" | "layout" | "none" | "paint" | "size" | "strict" | "style" | string; + +export type Property$ContainIntrinsicBlockSize<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$ContainIntrinsicHeight<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$ContainIntrinsicInlineSize<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$ContainIntrinsicSize<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$ContainIntrinsicWidth<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$Container = Globals | "none" | string; + +export type Property$ContainerName = Globals | "none" | string; + +export type Property$ContainerType = Globals | "inline-size" | "normal" | "size"; + +export type Property$Content = Globals | DataType$ContentList | "none" | "normal" | string; + +export type Property$ContentVisibility = Globals | "auto" | "hidden" | "visible"; + +export type Property$CounterIncrement = Globals | "none" | string; + +export type Property$CounterReset = Globals | "none" | string; + +export type Property$CounterSet = Globals | "none" | string; + +export type Property$Cursor = + | Globals + | "-moz-grab" + | "-webkit-grab" + | "alias" + | "all-scroll" + | "auto" + | "cell" + | "col-resize" + | "context-menu" + | "copy" + | "crosshair" + | "default" + | "e-resize" + | "ew-resize" + | "grab" + | "grabbing" + | "help" + | "move" + | "n-resize" + | "ne-resize" + | "nesw-resize" + | "no-drop" + | "none" + | "not-allowed" + | "ns-resize" + | "nw-resize" + | "nwse-resize" + | "pointer" + | "progress" + | "row-resize" + | "s-resize" + | "se-resize" + | "sw-resize" + | "text" + | "vertical-text" + | "w-resize" + | "wait" + | "zoom-in" + | "zoom-out" + | string; + +export type Property$Direction = Globals | "ltr" | "rtl"; + +export type Property$Display = + | Globals + | DataType$DisplayOutside + | DataType$DisplayInside + | DataType$DisplayInternal + | DataType$DisplayLegacy + | "contents" + | "list-item" + | "none" + | string; + +export type Property$EmptyCells = Globals | "hide" | "show"; + +export type Property$Filter = Globals | "none" | string; + +export type Property$Flex<TLength = string | 0> = Globals | TLength | "auto" | "content" | "fit-content" | "max-content" | "min-content" | "none" | string | number; + +export type Property$FlexBasis<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-auto" + | "auto" + | "content" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$FlexDirection = Globals | "column" | "column-reverse" | "row" | "row-reverse"; + +export type Property$FlexFlow = Globals | "column" | "column-reverse" | "nowrap" | "row" | "row-reverse" | "wrap" | "wrap-reverse" | string; + +export type Property$FlexGrow = Globals | number; + +export type Property$FlexShrink = Globals | number; + +export type Property$FlexWrap = Globals | "nowrap" | "wrap" | "wrap-reverse"; + +export type Property$Float = Globals | "inline-end" | "inline-start" | "left" | "none" | "right"; + +export type Property$Font = Globals | "caption" | "icon" | "menu" | "message-box" | "small-caption" | "status-bar" | string; + +export type Property$FontFamily = Globals | DataType$GenericFamily | string; + +export type Property$FontFeatureSettings = Globals | "normal" | string; + +export type Property$FontKerning = Globals | "auto" | "none" | "normal"; + +export type Property$FontLanguageOverride = Globals | "normal" | string; + +export type Property$FontOpticalSizing = Globals | "auto" | "none"; + +export type Property$FontPalette = Globals | "dark" | "light" | "normal" | string; + +export type Property$FontSize<TLength = string | 0> = Globals | DataType$AbsoluteSize | TLength | "larger" | "smaller" | string; + +export type Property$FontSizeAdjust = Globals | "from-font" | "none" | string | number; + +export type Property$FontSmooth<TLength = string | 0> = Globals | DataType$AbsoluteSize | TLength | "always" | "auto" | "never"; + +export type Property$FontStretch = Globals | DataType$FontStretchAbsolute; + +export type Property$FontStyle = Globals | "italic" | "normal" | "oblique" | string; + +export type Property$FontSynthesis = Globals | "none" | "position" | "small-caps" | "style" | "weight" | string; + +export type Property$FontSynthesisPosition = Globals | "auto" | "none"; + +export type Property$FontSynthesisSmallCaps = Globals | "auto" | "none"; + +export type Property$FontSynthesisStyle = Globals | "auto" | "none"; + +export type Property$FontSynthesisWeight = Globals | "auto" | "none"; + +export type Property$FontVariant = + | Globals + | DataType$EastAsianVariantValues + | "all-petite-caps" + | "all-small-caps" + | "common-ligatures" + | "contextual" + | "diagonal-fractions" + | "discretionary-ligatures" + | "full-width" + | "historical-forms" + | "historical-ligatures" + | "lining-nums" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "petite-caps" + | "proportional-nums" + | "proportional-width" + | "ruby" + | "slashed-zero" + | "small-caps" + | "stacked-fractions" + | "tabular-nums" + | "titling-caps" + | "unicase" + | string; + +export type Property$FontVariantAlternates = Globals | "historical-forms" | "normal" | string; + +export type Property$FontVariantCaps = Globals | "all-petite-caps" | "all-small-caps" | "normal" | "petite-caps" | "small-caps" | "titling-caps" | "unicase"; + +export type Property$FontVariantEastAsian = Globals | DataType$EastAsianVariantValues | "full-width" | "normal" | "proportional-width" | "ruby" | string; + +export type Property$FontVariantEmoji = Globals | "emoji" | "normal" | "text" | "unicode"; + +export type Property$FontVariantLigatures = + | Globals + | "common-ligatures" + | "contextual" + | "discretionary-ligatures" + | "historical-ligatures" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | string; + +export type Property$FontVariantNumeric = + | Globals + | "diagonal-fractions" + | "lining-nums" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "proportional-nums" + | "slashed-zero" + | "stacked-fractions" + | "tabular-nums" + | string; + +export type Property$FontVariantPosition = Globals | "normal" | "sub" | "super"; + +export type Property$FontVariationSettings = Globals | "normal" | string; + +export type Property$FontWeight = Globals | DataType$FontWeightAbsolute | "bolder" | "lighter"; + +export type Property$ForcedColorAdjust = Globals | "auto" | "none"; + +export type Property$Gap<TLength = string | 0> = Globals | TLength | "normal" | string; + +export type Property$Grid = Globals | "none" | string; + +export type Property$GridArea = Globals | DataType$GridLine | string; + +export type Property$GridAutoColumns<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | string; + +export type Property$GridAutoFlow = Globals | "column" | "dense" | "row" | string; + +export type Property$GridAutoRows<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | string; + +export type Property$GridColumn = Globals | DataType$GridLine | string; + +export type Property$GridColumnEnd = Globals | DataType$GridLine; + +export type Property$GridColumnGap<TLength = string | 0> = Globals | TLength | string; + +export type Property$GridColumnStart = Globals | DataType$GridLine; + +export type Property$GridGap<TLength = string | 0> = Globals | TLength | string; + +export type Property$GridRow = Globals | DataType$GridLine | string; + +export type Property$GridRowEnd = Globals | DataType$GridLine; + +export type Property$GridRowGap<TLength = string | 0> = Globals | TLength | string; + +export type Property$GridRowStart = Globals | DataType$GridLine; + +export type Property$GridTemplate = Globals | "none" | string; + +export type Property$GridTemplateAreas = Globals | "none" | string; + +export type Property$GridTemplateColumns<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | "none" | "subgrid" | string; + +export type Property$GridTemplateRows<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | "none" | "subgrid" | string; + +export type Property$HangingPunctuation = Globals | "allow-end" | "first" | "force-end" | "last" | "none" | string; + +export type Property$Height<TLength = string | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$HyphenateCharacter = Globals | "auto" | string; + +export type Property$HyphenateLimitChars = Globals | "auto" | string | number; + +export type Property$Hyphens = Globals | "auto" | "manual" | "none"; + +export type Property$ImageOrientation = Globals | "flip" | "from-image" | string; + +export type Property$ImageRendering = Globals | "-moz-crisp-edges" | "-webkit-optimize-contrast" | "auto" | "crisp-edges" | "pixelated"; + +export type Property$ImageResolution = Globals | "from-image" | string; + +export type Property$ImeMode = Globals | "active" | "auto" | "disabled" | "inactive" | "normal"; + +export type Property$InitialLetter = Globals | "normal" | string | number; + +export type Property$InlineSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$InputSecurity = Globals | "auto" | "none"; + +export type Property$Inset<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetBlock<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetBlockEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetBlockStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetInline<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetInlineEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$InsetInlineStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$Isolation = Globals | "auto" | "isolate"; + +export type Property$JustifyContent = Globals | DataType$ContentDistribution | DataType$ContentPosition | "left" | "normal" | "right" | string; + +export type Property$JustifyItems = Globals | DataType$SelfPosition | "baseline" | "left" | "legacy" | "normal" | "right" | "stretch" | string; + +export type Property$JustifySelf = Globals | DataType$SelfPosition | "auto" | "baseline" | "left" | "normal" | "right" | "stretch" | string; + +export type Property$JustifyTracks = Globals | DataType$ContentDistribution | DataType$ContentPosition | "left" | "normal" | "right" | string; + +export type Property$Left<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$LetterSpacing<TLength = string | 0> = Globals | TLength | "normal"; + +export type Property$LineBreak = Globals | "anywhere" | "auto" | "loose" | "normal" | "strict"; + +export type Property$LineClamp = Globals | "none" | number; + +export type Property$LineHeight<TLength = string | 0> = Globals | TLength | "normal" | string | number; + +export type Property$LineHeightStep<TLength = string | 0> = Globals | TLength; + +export type Property$ListStyle = Globals | "inside" | "none" | "outside" | string; + +export type Property$ListStyleImage = Globals | "none" | string; + +export type Property$ListStylePosition = Globals | "inside" | "outside"; + +export type Property$ListStyleType = Globals | "none" | string; + +export type Property$Margin<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginBlock<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginBlockEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginBlockStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginBottom<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginInline<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginInlineEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginInlineStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginLeft<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginRight<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginTop<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$MarginTrim = Globals | "all" | "in-flow" | "none"; + +export type Property$Mask<TLength = string | 0> = Globals | DataType$MaskLayer<TLength> | string; + +export type Property$MaskBorder = Globals | "alpha" | "luminance" | "none" | "repeat" | "round" | "space" | "stretch" | string | number; + +export type Property$MaskBorderMode = Globals | "alpha" | "luminance"; + +export type Property$MaskBorderOutset<TLength = string | 0> = Globals | TLength | string | number; + +export type Property$MaskBorderRepeat = Globals | "repeat" | "round" | "space" | "stretch" | string; + +export type Property$MaskBorderSlice = Globals | string | number; + +export type Property$MaskBorderSource = Globals | "none" | string; + +export type Property$MaskBorderWidth<TLength = string | 0> = Globals | TLength | "auto" | string | number; + +export type Property$MaskClip = Globals | DataType$GeometryBox | "no-clip" | string; + +export type Property$MaskComposite = Globals | DataType$CompositingOperator | string; + +export type Property$MaskImage = Globals | "none" | string; + +export type Property$MaskMode = Globals | DataType$MaskingMode | string; + +export type Property$MaskOrigin = Globals | DataType$GeometryBox | string; + +export type Property$MaskPosition<TLength = string | 0> = Globals | DataType$Position<TLength> | string; + +export type Property$MaskRepeat = Globals | DataType$RepeatStyle | string; + +export type Property$MaskSize<TLength = string | 0> = Globals | DataType$BgSize<TLength> | string; + +export type Property$MaskType = Globals | "alpha" | "luminance"; + +export type Property$MasonryAutoFlow = Globals | "definite-first" | "next" | "ordered" | "pack" | string; + +export type Property$MathDepth = Globals | "auto-add" | string | number; + +export type Property$MathShift = Globals | "compact" | "normal"; + +export type Property$MathStyle = Globals | "compact" | "normal"; + +export type Property$MaxBlockSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "fit-content" + | "max-content" + | "min-content" + | "none" + | string; + +export type Property$MaxHeight<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "none" + | string; + +export type Property$MaxInlineSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "fit-content" + | "max-content" + | "min-content" + | "none" + | string; + +export type Property$MaxLines = Globals | "none" | number; + +export type Property$MaxWidth<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "none" + | string; + +export type Property$MinBlockSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$MinHeight<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | string; + +export type Property$MinInlineSize<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "auto" + | "fit-content" + | "max-content" + | "min-content" + | string; + +export type Property$MinWidth<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fill-available" + | "-webkit-fit-content" + | "-webkit-max-content" + | "-webkit-min-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "min-intrinsic" + | string; + +export type Property$MixBlendMode = Globals | DataType$BlendMode | "plus-lighter"; + +export type Property$Offset<TLength = string | 0> = Globals | DataType$Position<TLength> | "auto" | "none" | "normal" | string; + +export type Property$OffsetDistance<TLength = string | 0> = Globals | TLength | string; + +export type Property$OffsetPath = Globals | "none" | string; + +export type Property$OffsetRotate = Globals | "auto" | "reverse" | string; + +export type Property$ObjectFit = Globals | "contain" | "cover" | "fill" | "none" | "scale-down"; + +export type Property$ObjectPosition<TLength = string | 0> = Globals | DataType$Position<TLength>; + +export type Property$OffsetAnchor<TLength = string | 0> = Globals | DataType$Position<TLength> | "auto"; + +export type Property$OffsetPosition<TLength = string | 0> = Globals | DataType$Position<TLength> | "auto" | "normal"; + +export type Property$Opacity = Globals | string | number; + +export type Property$Order = Globals | number; + +export type Property$Orphans = Globals | number; + +export type Property$Outline<TLength = string | 0> = Globals | DataType$Color | DataType$LineStyle | DataType$LineWidth<TLength> | "auto" | "invert" | string; + +export type Property$OutlineColor = Globals | DataType$Color | "invert"; + +export type Property$OutlineOffset<TLength = string | 0> = Globals | TLength; + +export type Property$OutlineStyle = Globals | DataType$LineStyle | "auto" | string; + +export type Property$OutlineWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength>; + +export type Property$Overflow = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible" | string; + +export type Property$OverflowAnchor = Globals | "auto" | "none"; + +export type Property$OverflowBlock = Globals | "auto" | "clip" | "hidden" | "scroll" | "visible"; + +export type Property$OverflowClipBox = Globals | "content-box" | "padding-box"; + +export type Property$OverflowClipMargin<TLength = string | 0> = Globals | DataType$VisualBox | TLength | string; + +export type Property$OverflowInline = Globals | "auto" | "clip" | "hidden" | "scroll" | "visible"; + +export type Property$OverflowWrap = Globals | "anywhere" | "break-word" | "normal"; + +export type Property$OverflowX = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible"; + +export type Property$OverflowY = Globals | "-moz-hidden-unscrollable" | "auto" | "clip" | "hidden" | "scroll" | "visible"; + +export type Property$Overlay = Globals | "auto" | "none"; + +export type Property$OverscrollBehavior = Globals | "auto" | "contain" | "none" | string; + +export type Property$OverscrollBehaviorBlock = Globals | "auto" | "contain" | "none"; + +export type Property$OverscrollBehaviorInline = Globals | "auto" | "contain" | "none"; + +export type Property$OverscrollBehaviorX = Globals | "auto" | "contain" | "none"; + +export type Property$OverscrollBehaviorY = Globals | "auto" | "contain" | "none"; + +export type Property$Padding<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingBlock<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingBlockEnd<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingBlockStart<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingBottom<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingInline<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingInlineEnd<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingInlineStart<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingLeft<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingRight<TLength = string | 0> = Globals | TLength | string; + +export type Property$PaddingTop<TLength = string | 0> = Globals | TLength | string; + +export type Property$Page = Globals | "auto" | string; + +export type Property$PageBreakAfter = Globals | "always" | "auto" | "avoid" | "left" | "recto" | "right" | "verso"; + +export type Property$PageBreakBefore = Globals | "always" | "auto" | "avoid" | "left" | "recto" | "right" | "verso"; + +export type Property$PageBreakInside = Globals | "auto" | "avoid"; + +export type Property$PaintOrder = Globals | "fill" | "markers" | "normal" | "stroke" | string; + +export type Property$Perspective<TLength = string | 0> = Globals | TLength | "none"; + +export type Property$PerspectiveOrigin<TLength = string | 0> = Globals | DataType$Position<TLength>; + +export type Property$PlaceContent = Globals | DataType$ContentDistribution | DataType$ContentPosition | "baseline" | "normal" | string; + +export type Property$PlaceItems = Globals | DataType$SelfPosition | "baseline" | "normal" | "stretch" | string; + +export type Property$PlaceSelf = Globals | DataType$SelfPosition | "auto" | "baseline" | "normal" | "stretch" | string; + +export type Property$PointerEvents = Globals | "all" | "auto" | "fill" | "inherit" | "none" | "painted" | "stroke" | "visible" | "visibleFill" | "visiblePainted" | "visibleStroke"; + +export type Property$Position = Globals | "-webkit-sticky" | "absolute" | "fixed" | "relative" | "static" | "sticky"; + +export type Property$Quotes = Globals | "auto" | "none" | string; + +export type Property$Resize = Globals | "block" | "both" | "horizontal" | "inline" | "none" | "vertical"; + +export type Property$Right<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$Rotate = Globals | "none" | string; + +export type Property$RowGap<TLength = string | 0> = Globals | TLength | "normal" | string; + +export type Property$RubyAlign = Globals | "center" | "space-around" | "space-between" | "start"; + +export type Property$RubyMerge = Globals | "auto" | "collapse" | "separate"; + +export type Property$RubyPosition = Globals | "alternate" | "inter-character" | "over" | "under" | string; + +export type Property$Scale = Globals | "none" | string | number; + +export type Property$ScrollBehavior = Globals | "auto" | "smooth"; + +export type Property$ScrollMargin<TLength = string | 0> = Globals | TLength | string; + +export type Property$ScrollMarginBlock<TLength = string | 0> = Globals | TLength | string; + +export type Property$ScrollMarginBlockEnd<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginBlockStart<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginBottom<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginInline<TLength = string | 0> = Globals | TLength | string; + +export type Property$ScrollMarginInlineEnd<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginInlineStart<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginLeft<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginRight<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollMarginTop<TLength = string | 0> = Globals | TLength; + +export type Property$ScrollPadding<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingBlock<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingBlockEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingBlockStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingBottom<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingInline<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingInlineEnd<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingInlineStart<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingLeft<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingRight<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollPaddingTop<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ScrollSnapAlign = Globals | "center" | "end" | "none" | "start" | string; + +export type Property$ScrollSnapCoordinate<TLength = string | 0> = Globals | DataType$Position<TLength> | "none" | string; + +export type Property$ScrollSnapDestination<TLength = string | 0> = Globals | DataType$Position<TLength>; + +export type Property$ScrollSnapPointsX = Globals | "none" | string; + +export type Property$ScrollSnapPointsY = Globals | "none" | string; + +export type Property$ScrollSnapStop = Globals | "always" | "normal"; + +export type Property$ScrollSnapType = Globals | "block" | "both" | "inline" | "none" | "x" | "y" | string; + +export type Property$ScrollSnapTypeX = Globals | "mandatory" | "none" | "proximity"; + +export type Property$ScrollSnapTypeY = Globals | "mandatory" | "none" | "proximity"; + +export type Property$ScrollTimeline = Globals | "none" | string; + +export type Property$ScrollTimelineAxis = Globals | "block" | "inline" | "x" | "y" | string; + +export type Property$ScrollTimelineName = Globals | "none" | string; + +export type Property$ScrollbarColor = Globals | "auto" | string; + +export type Property$ScrollbarGutter = Globals | "auto" | "stable" | string; + +export type Property$ScrollbarWidth = Globals | "auto" | "none" | "thin"; + +export type Property$ShapeImageThreshold = Globals | string | number; + +export type Property$ShapeMargin<TLength = string | 0> = Globals | TLength | string; + +export type Property$ShapeOutside = Globals | DataType$Box | "margin-box" | "none" | string; + +export type Property$TabSize<TLength = string | 0> = Globals | TLength | number; + +export type Property$TableLayout = Globals | "auto" | "fixed"; + +export type Property$TextAlign = Globals | "-webkit-match-parent" | "center" | "end" | "justify" | "left" | "match-parent" | "right" | "start"; + +export type Property$TextAlignLast = Globals | "auto" | "center" | "end" | "justify" | "left" | "right" | "start"; + +export type Property$TextCombineUpright = Globals | "all" | "none" | string; + +export type Property$TextDecoration<TLength = string | 0> = + | Globals + | DataType$Color + | TLength + | "auto" + | "blink" + | "dashed" + | "dotted" + | "double" + | "from-font" + | "grammar-error" + | "line-through" + | "none" + | "overline" + | "solid" + | "spelling-error" + | "underline" + | "wavy" + | string; + +export type Property$TextDecorationColor = Globals | DataType$Color; + +export type Property$TextDecorationLine = Globals | "blink" | "grammar-error" | "line-through" | "none" | "overline" | "spelling-error" | "underline" | string; + +export type Property$TextDecorationSkip = Globals | "box-decoration" | "edges" | "leading-spaces" | "none" | "objects" | "spaces" | "trailing-spaces" | string; + +export type Property$TextDecorationSkipInk = Globals | "all" | "auto" | "none"; + +export type Property$TextDecorationStyle = Globals | "dashed" | "dotted" | "double" | "solid" | "wavy"; + +export type Property$TextDecorationThickness<TLength = string | 0> = Globals | TLength | "auto" | "from-font" | string; + +export type Property$TextEmphasis = Globals | DataType$Color | "circle" | "dot" | "double-circle" | "filled" | "none" | "open" | "sesame" | "triangle" | string; + +export type Property$TextEmphasisColor = Globals | DataType$Color; + +export type Property$TextEmphasisPosition = Globals | string; + +export type Property$TextEmphasisStyle = Globals | "circle" | "dot" | "double-circle" | "filled" | "none" | "open" | "sesame" | "triangle" | string; + +export type Property$TextIndent<TLength = string | 0> = Globals | TLength | string; + +export type Property$TextJustify = Globals | "auto" | "inter-character" | "inter-word" | "none"; + +export type Property$TextOrientation = Globals | "mixed" | "sideways" | "upright"; + +export type Property$TextOverflow = Globals | "clip" | "ellipsis" | string; + +export type Property$TextRendering = Globals | "auto" | "geometricPrecision" | "optimizeLegibility" | "optimizeSpeed"; + +export type Property$TextShadow = Globals | "none" | string; + +export type Property$TextSizeAdjust = Globals | "auto" | "none" | string; + +export type Property$TextTransform = Globals | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "none" | "uppercase"; + +export type Property$TextUnderlineOffset<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$TextUnderlinePosition = Globals | "auto" | "from-font" | "left" | "right" | "under" | string; + +export type Property$TextWrap = Globals | "balance" | "nowrap" | "pretty" | "stable" | "wrap"; + +export type Property$TimelineScope = Globals | "none" | string; + +export type Property$Top<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$TouchAction = + | Globals + | "-ms-manipulation" + | "-ms-none" + | "-ms-pinch-zoom" + | "auto" + | "manipulation" + | "none" + | "pan-down" + | "pan-left" + | "pan-right" + | "pan-up" + | "pan-x" + | "pan-y" + | "pinch-zoom" + | string; + +export type Property$Transform = Globals | "none" | string; + +export type Property$TransformBox = Globals | "border-box" | "content-box" | "fill-box" | "stroke-box" | "view-box"; + +export type Property$TransformOrigin<TLength = string | 0> = Globals | TLength | "bottom" | "center" | "left" | "right" | "top" | string; + +export type Property$TransformStyle = Globals | "flat" | "preserve-3d"; + +export type Property$Transition<TTime = string> = Globals | DataType$SingleTransition<TTime> | string; + +export type Property$TransitionBehavior = Globals | "allow-discrete" | "normal" | string; + +export type Property$TransitionDelay<TTime = string> = Globals | TTime | string; + +export type Property$TransitionDuration<TTime = string> = Globals | TTime | string; + +export type Property$TransitionProperty = Globals | "all" | "none" | string; + +export type Property$TransitionTimingFunction = Globals | DataType$EasingFunction | string; + +export type Property$Translate<TLength = string | 0> = Globals | TLength | "none" | string; + +export type Property$UnicodeBidi = + | Globals + | "-moz-isolate" + | "-moz-isolate-override" + | "-moz-plaintext" + | "-webkit-isolate" + | "-webkit-isolate-override" + | "-webkit-plaintext" + | "bidi-override" + | "embed" + | "isolate" + | "isolate-override" + | "normal" + | "plaintext"; + +export type Property$UserSelect = Globals | "-moz-none" | "all" | "auto" | "contain" | "element" | "none" | "text"; + +export type Property$VerticalAlign<TLength = string | 0> = Globals | TLength | "baseline" | "bottom" | "middle" | "sub" | "super" | "text-bottom" | "text-top" | "top" | string; + +export type Property$ViewTimeline = Globals | "none" | string; + +export type Property$ViewTimelineAxis = Globals | "block" | "inline" | "x" | "y" | string; + +export type Property$ViewTimelineInset<TLength = string | 0> = Globals | TLength | "auto" | string; + +export type Property$ViewTimelineName = Globals | "none" | string; + +export type Property$ViewTransitionName = Globals | "none" | string; + +export type Property$Visibility = Globals | "collapse" | "hidden" | "visible"; + +export type Property$WhiteSpace = + | Globals + | "-moz-pre-wrap" + | "balance" + | "break-spaces" + | "collapse" + | "discard" + | "discard-after" + | "discard-before" + | "discard-inner" + | "none" + | "normal" + | "nowrap" + | "pre" + | "pre-line" + | "pre-wrap" + | "preserve" + | "preserve-breaks" + | "preserve-spaces" + | "pretty" + | "stable" + | "wrap" + | string; + +export type Property$WhiteSpaceCollapse = Globals | "break-spaces" | "collapse" | "discard" | "preserve" | "preserve-breaks" | "preserve-spaces"; + +export type Property$WhiteSpaceTrim = Globals | "discard-after" | "discard-before" | "discard-inner" | "none" | string; + +export type Property$Widows = Globals | number; + +export type Property$Width<TLength = string | 0> = + | Globals + | TLength + | "-moz-fit-content" + | "-moz-max-content" + | "-moz-min-content" + | "-webkit-fit-content" + | "-webkit-max-content" + | "auto" + | "fit-content" + | "intrinsic" + | "max-content" + | "min-content" + | "min-intrinsic" + | string; + +export type Property$WillChange = Globals | DataType$AnimateableFeature | "auto" | string; + +export type Property$WordBreak = Globals | "break-all" | "break-word" | "keep-all" | "normal"; + +export type Property$WordSpacing<TLength = string | 0> = Globals | TLength | "normal"; + +export type Property$WordWrap = Globals | "break-word" | "normal"; + +export type Property$WritingMode = Globals | "horizontal-tb" | "sideways-lr" | "sideways-rl" | "vertical-lr" | "vertical-rl"; + +export type Property$ZIndex = Globals | "auto" | number; + +export type Property$Zoom = Globals | "normal" | "reset" | string | number; + +export type Property$MozAppearance = + | Globals + | "-moz-mac-unified-toolbar" + | "-moz-win-borderless-glass" + | "-moz-win-browsertabbar-toolbox" + | "-moz-win-communications-toolbox" + | "-moz-win-communicationstext" + | "-moz-win-exclude-glass" + | "-moz-win-glass" + | "-moz-win-media-toolbox" + | "-moz-win-mediatext" + | "-moz-window-button-box" + | "-moz-window-button-box-maximized" + | "-moz-window-button-close" + | "-moz-window-button-maximize" + | "-moz-window-button-minimize" + | "-moz-window-button-restore" + | "-moz-window-frame-bottom" + | "-moz-window-frame-left" + | "-moz-window-frame-right" + | "-moz-window-titlebar" + | "-moz-window-titlebar-maximized" + | "button" + | "button-arrow-down" + | "button-arrow-next" + | "button-arrow-previous" + | "button-arrow-up" + | "button-bevel" + | "button-focus" + | "caret" + | "checkbox" + | "checkbox-container" + | "checkbox-label" + | "checkmenuitem" + | "dualbutton" + | "groupbox" + | "listbox" + | "listitem" + | "menuarrow" + | "menubar" + | "menucheckbox" + | "menuimage" + | "menuitem" + | "menuitemtext" + | "menulist" + | "menulist-button" + | "menulist-text" + | "menulist-textfield" + | "menupopup" + | "menuradio" + | "menuseparator" + | "meterbar" + | "meterchunk" + | "none" + | "progressbar" + | "progressbar-vertical" + | "progresschunk" + | "progresschunk-vertical" + | "radio" + | "radio-container" + | "radio-label" + | "radiomenuitem" + | "range" + | "range-thumb" + | "resizer" + | "resizerpanel" + | "scale-horizontal" + | "scale-vertical" + | "scalethumb-horizontal" + | "scalethumb-vertical" + | "scalethumbend" + | "scalethumbstart" + | "scalethumbtick" + | "scrollbarbutton-down" + | "scrollbarbutton-left" + | "scrollbarbutton-right" + | "scrollbarbutton-up" + | "scrollbarthumb-horizontal" + | "scrollbarthumb-vertical" + | "scrollbartrack-horizontal" + | "scrollbartrack-vertical" + | "searchfield" + | "separator" + | "sheet" + | "spinner" + | "spinner-downbutton" + | "spinner-textfield" + | "spinner-upbutton" + | "splitter" + | "statusbar" + | "statusbarpanel" + | "tab" + | "tab-scroll-arrow-back" + | "tab-scroll-arrow-forward" + | "tabpanel" + | "tabpanels" + | "textfield" + | "textfield-multiline" + | "toolbar" + | "toolbarbutton" + | "toolbarbutton-dropdown" + | "toolbargripper" + | "toolbox" + | "tooltip" + | "treeheader" + | "treeheadercell" + | "treeheadersortarrow" + | "treeitem" + | "treeline" + | "treetwisty" + | "treetwistyopen" + | "treeview"; + +export type Property$MozBinding = Globals | "none" | string; + +export type Property$MozBorderBottomColors = Globals | DataType$Color | "none" | string; + +export type Property$MozBorderLeftColors = Globals | DataType$Color | "none" | string; + +export type Property$MozBorderRightColors = Globals | DataType$Color | "none" | string; + +export type Property$MozBorderTopColors = Globals | DataType$Color | "none" | string; + +export type Property$MozContextProperties = Globals | "fill" | "fill-opacity" | "none" | "stroke" | "stroke-opacity" | string; + +export type Property$MozFloatEdge = Globals | "border-box" | "content-box" | "margin-box" | "padding-box"; + +export type Property$MozForceBrokenImageIcon = Globals | 0 | 1; + +export type Property$MozImageRegion = Globals | "auto" | string; + +export type Property$MozOrient = Globals | "block" | "horizontal" | "inline" | "vertical"; + +export type Property$MozOutlineRadius<TLength = string | 0> = Globals | TLength | string; + +export type Property$MozOutlineRadiusBottomleft<TLength = string | 0> = Globals | TLength | string; + +export type Property$MozOutlineRadiusBottomright<TLength = string | 0> = Globals | TLength | string; + +export type Property$MozOutlineRadiusTopleft<TLength = string | 0> = Globals | TLength | string; + +export type Property$MozOutlineRadiusTopright<TLength = string | 0> = Globals | TLength | string; + +export type Property$MozStackSizing = Globals | "ignore" | "stretch-to-fit"; + +export type Property$MozTextBlink = Globals | "blink" | "none"; + +export type Property$MozUserFocus = Globals | "ignore" | "none" | "normal" | "select-after" | "select-all" | "select-before" | "select-menu" | "select-same"; + +export type Property$MozUserInput = Globals | "auto" | "disabled" | "enabled" | "none"; + +export type Property$MozUserModify = Globals | "read-only" | "read-write" | "write-only"; + +export type Property$MozWindowDragging = Globals | "drag" | "no-drag"; + +export type Property$MozWindowShadow = Globals | "default" | "menu" | "none" | "sheet" | "tooltip"; + +export type Property$MsAccelerator = Globals | "false" | "true"; + +export type Property$MsBlockProgression = Globals | "bt" | "lr" | "rl" | "tb"; + +export type Property$MsContentZoomChaining = Globals | "chained" | "none"; + +export type Property$MsContentZoomLimit = Globals | string; + +export type Property$MsContentZoomLimitMax = Globals | string; + +export type Property$MsContentZoomLimitMin = Globals | string; + +export type Property$MsContentZoomSnap = Globals | "mandatory" | "none" | "proximity" | string; + +export type Property$MsContentZoomSnapPoints = Globals | string; + +export type Property$MsContentZoomSnapType = Globals | "mandatory" | "none" | "proximity"; + +export type Property$MsContentZooming = Globals | "none" | "zoom"; + +export type Property$MsFilter = Globals | string; + +export type Property$MsFlowFrom = Globals | "none" | string; + +export type Property$MsFlowInto = Globals | "none" | string; + +export type Property$MsGridColumns<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | "none" | string; + +export type Property$MsGridRows<TLength = string | 0> = Globals | DataType$TrackBreadth<TLength> | "none" | string; + +export type Property$MsHighContrastAdjust = Globals | "auto" | "none"; + +export type Property$MsHyphenateLimitChars = Globals | "auto" | string | number; + +export type Property$MsHyphenateLimitLines = Globals | "no-limit" | number; + +export type Property$MsHyphenateLimitZone<TLength = string | 0> = Globals | TLength | string; + +export type Property$MsImeAlign = Globals | "after" | "auto"; + +export type Property$MsOverflowStyle = Globals | "-ms-autohiding-scrollbar" | "auto" | "none" | "scrollbar"; + +export type Property$MsScrollChaining = Globals | "chained" | "none"; + +export type Property$MsScrollLimit = Globals | string; + +export type Property$MsScrollLimitXMax<TLength = string | 0> = Globals | TLength | "auto"; + +export type Property$MsScrollLimitXMin<TLength = string | 0> = Globals | TLength; + +export type Property$MsScrollLimitYMax<TLength = string | 0> = Globals | TLength | "auto"; + +export type Property$MsScrollLimitYMin<TLength = string | 0> = Globals | TLength; + +export type Property$MsScrollRails = Globals | "none" | "railed"; + +export type Property$MsScrollSnapPointsX = Globals | string; + +export type Property$MsScrollSnapPointsY = Globals | string; + +export type Property$MsScrollSnapType = Globals | "mandatory" | "none" | "proximity"; + +export type Property$MsScrollSnapX = Globals | string; + +export type Property$MsScrollSnapY = Globals | string; + +export type Property$MsScrollTranslation = Globals | "none" | "vertical-to-horizontal"; + +export type Property$MsScrollbar3dlightColor = Globals | DataType$Color; + +export type Property$MsScrollbarArrowColor = Globals | DataType$Color; + +export type Property$MsScrollbarBaseColor = Globals | DataType$Color; + +export type Property$MsScrollbarDarkshadowColor = Globals | DataType$Color; + +export type Property$MsScrollbarFaceColor = Globals | DataType$Color; + +export type Property$MsScrollbarHighlightColor = Globals | DataType$Color; + +export type Property$MsScrollbarShadowColor = Globals | DataType$Color; + +export type Property$MsScrollbarTrackColor = Globals | DataType$Color; + +export type Property$MsTextAutospace = Globals | "ideograph-alpha" | "ideograph-numeric" | "ideograph-parenthesis" | "ideograph-space" | "none"; + +export type Property$MsTouchSelect = Globals | "grippers" | "none"; + +export type Property$MsUserSelect = Globals | "element" | "none" | "text"; + +export type Property$MsWrapFlow = Globals | "auto" | "both" | "clear" | "end" | "maximum" | "start"; + +export type Property$MsWrapMargin<TLength = string | 0> = Globals | TLength; + +export type Property$MsWrapThrough = Globals | "none" | "wrap"; + +export type Property$WebkitAppearance = + | Globals + | "-apple-pay-button" + | "button" + | "button-bevel" + | "caret" + | "checkbox" + | "default-button" + | "inner-spin-button" + | "listbox" + | "listitem" + | "media-controls-background" + | "media-controls-fullscreen-background" + | "media-current-time-display" + | "media-enter-fullscreen-button" + | "media-exit-fullscreen-button" + | "media-fullscreen-button" + | "media-mute-button" + | "media-overlay-play-button" + | "media-play-button" + | "media-seek-back-button" + | "media-seek-forward-button" + | "media-slider" + | "media-sliderthumb" + | "media-time-remaining-display" + | "media-toggle-closed-captions-button" + | "media-volume-slider" + | "media-volume-slider-container" + | "media-volume-sliderthumb" + | "menulist" + | "menulist-button" + | "menulist-text" + | "menulist-textfield" + | "meter" + | "none" + | "progress-bar" + | "progress-bar-value" + | "push-button" + | "radio" + | "searchfield" + | "searchfield-cancel-button" + | "searchfield-decoration" + | "searchfield-results-button" + | "searchfield-results-decoration" + | "slider-horizontal" + | "slider-vertical" + | "sliderthumb-horizontal" + | "sliderthumb-vertical" + | "square-button" + | "textarea" + | "textfield"; + +export type Property$WebkitBorderBefore<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | DataType$LineStyle | DataType$Color | string; + +export type Property$WebkitBorderBeforeColor = Globals | DataType$Color; + +export type Property$WebkitBorderBeforeStyle = Globals | DataType$LineStyle | string; + +export type Property$WebkitBorderBeforeWidth<TLength = string | 0> = Globals | DataType$LineWidth<TLength> | string; + +export type Property$WebkitBoxReflect<TLength = string | 0> = Globals | TLength | "above" | "below" | "left" | "right" | string; + +export type Property$WebkitLineClamp = Globals | "none" | number; + +export type Property$WebkitMask<TLength = string | 0> = + | Globals + | DataType$Position<TLength> + | DataType$RepeatStyle + | DataType$Box + | "border" + | "content" + | "none" + | "padding" + | "text" + | string; + +export type Property$WebkitMaskAttachment = Globals | DataType$Attachment | string; + +export type Property$WebkitMaskClip = Globals | DataType$Box | "border" | "content" | "padding" | "text" | string; + +export type Property$WebkitMaskComposite = Globals | DataType$CompositeStyle | string; + +export type Property$WebkitMaskImage = Globals | "none" | string; + +export type Property$WebkitMaskOrigin = Globals | DataType$Box | "border" | "content" | "padding" | string; + +export type Property$WebkitMaskPosition<TLength = string | 0> = Globals | DataType$Position<TLength> | string; + +export type Property$WebkitMaskPositionX<TLength = string | 0> = Globals | TLength | "center" | "left" | "right" | string; + +export type Property$WebkitMaskPositionY<TLength = string | 0> = Globals | TLength | "bottom" | "center" | "top" | string; + +export type Property$WebkitMaskRepeat = Globals | DataType$RepeatStyle | string; + +export type Property$WebkitMaskRepeatX = Globals | "no-repeat" | "repeat" | "round" | "space"; + +export type Property$WebkitMaskRepeatY = Globals | "no-repeat" | "repeat" | "round" | "space"; + +export type Property$WebkitMaskSize<TLength = string | 0> = Globals | DataType$BgSize<TLength> | string; + +export type Property$WebkitOverflowScrolling = Globals | "auto" | "touch"; + +export type Property$WebkitTapHighlightColor = Globals | DataType$Color; + +export type Property$WebkitTextFillColor = Globals | DataType$Color; + +export type Property$WebkitTextStroke<TLength = string | 0> = Globals | DataType$Color | TLength | string; + +export type Property$WebkitTextStrokeColor = Globals | DataType$Color; + +export type Property$WebkitTextStrokeWidth<TLength = string | 0> = Globals | TLength; + +export type Property$WebkitTouchCallout = Globals | "default" | "none"; + +export type Property$WebkitUserModify = Globals | "read-only" | "read-write" | "read-write-plaintext-only"; + +export type Property$AlignmentBaseline = + | Globals + | "after-edge" + | "alphabetic" + | "auto" + | "baseline" + | "before-edge" + | "central" + | "hanging" + | "ideographic" + | "mathematical" + | "middle" + | "text-after-edge" + | "text-before-edge"; + +export type Property$BaselineShift<TLength = string | 0> = Globals | TLength | "baseline" | "sub" | "super" | string; + +export type Property$ClipRule = Globals | "evenodd" | "nonzero"; + +export type Property$ColorInterpolation = Globals | "auto" | "linearRGB" | "sRGB"; + +export type Property$ColorRendering = Globals | "auto" | "optimizeQuality" | "optimizeSpeed"; + +export type Property$DominantBaseline = + | Globals + | "alphabetic" + | "auto" + | "central" + | "hanging" + | "ideographic" + | "mathematical" + | "middle" + | "no-change" + | "reset-size" + | "text-after-edge" + | "text-before-edge" + | "use-script"; + +export type Property$Fill = Globals | DataType$Paint; + +export type Property$FillOpacity = Globals | number; + +export type Property$FillRule = Globals | "evenodd" | "nonzero"; + +export type Property$FloodColor = Globals | DataType$Color | "currentColor"; + +export type Property$FloodOpacity = Globals | number; + +export type Property$GlyphOrientationVertical = Globals | "auto" | string | number; + +export type Property$LightingColor = Globals | DataType$Color | "currentColor"; + +export type Property$Marker = Globals | "none" | string; + +export type Property$MarkerEnd = Globals | "none" | string; + +export type Property$MarkerMid = Globals | "none" | string; + +export type Property$MarkerStart = Globals | "none" | string; + +export type Property$ShapeRendering = Globals | "auto" | "crispEdges" | "geometricPrecision" | "optimizeSpeed"; + +export type Property$StopColor = Globals | DataType$Color | "currentColor"; + +export type Property$StopOpacity = Globals | number; + +export type Property$Stroke = Globals | DataType$Paint; + +export type Property$StrokeDasharray<TLength = string | 0> = Globals | DataType$Dasharray<TLength> | "none"; + +export type Property$StrokeDashoffset<TLength = string | 0> = Globals | TLength | string; + +export type Property$StrokeLinecap = Globals | "butt" | "round" | "square"; + +export type Property$StrokeLinejoin = Globals | "bevel" | "miter" | "round"; + +export type Property$StrokeMiterlimit = Globals | number; + +export type Property$StrokeOpacity = Globals | number; + +export type Property$StrokeWidth<TLength = string | 0> = Globals | TLength | string; + +export type Property$TextAnchor = Globals | "end" | "middle" | "start"; + +export type Property$VectorEffect = Globals | "non-scaling-stroke" | "none"; + +export type AtRule$CounterStyle<TLength = string | 0, TTime = string> = {| + additiveSymbols?: string, + fallback?: string, + negative?: string, + pad?: string, + prefix?: string, + range?: AtRule$Range, + speakAs?: AtRule$SpeakAs, + suffix?: string, + symbols?: string, + system?: AtRule$System, +|}; + +export type AtRule$CounterStyleHyphen<TLength = string | 0, TTime = string> = {| + "additive-symbols"?: string, + fallback?: string, + negative?: string, + pad?: string, + prefix?: string, + range?: AtRule$Range, + "speak-as"?: AtRule$SpeakAs, + suffix?: string, + symbols?: string, + system?: AtRule$System, +|}; + +export type AtRule$CounterStyleFallback<TLength = string | 0, TTime = string> = {| + additiveSymbols?: string | Array<string>, + fallback?: string | Array<string>, + negative?: string | Array<string>, + pad?: string | Array<string>, + prefix?: string | Array<string>, + range?: AtRule$Range | Array<AtRule$Range>, + speakAs?: AtRule$SpeakAs | Array<AtRule$SpeakAs>, + suffix?: string | Array<string>, + symbols?: string | Array<string>, + system?: AtRule$System | Array<AtRule$System>, +|}; + +export type AtRule$CounterStyleHyphenFallback<TLength = string | 0, TTime = string> = {| + "additive-symbols"?: string | Array<string>, + fallback?: string | Array<string>, + negative?: string | Array<string>, + pad?: string | Array<string>, + prefix?: string | Array<string>, + range?: AtRule$Range | Array<AtRule$Range>, + "speak-as"?: AtRule$SpeakAs | Array<AtRule$SpeakAs>, + suffix?: string | Array<string>, + symbols?: string | Array<string>, + system?: AtRule$System | Array<AtRule$System>, +|}; + +export type AtRule$FontFace<TLength = string | 0, TTime = string> = {| + MozFontFeatureSettings?: AtRule$FontFeatureSettings, + ascentOverride?: AtRule$AscentOverride, + descentOverride?: AtRule$DescentOverride, + fontDisplay?: AtRule$FontDisplay, + fontFamily?: string, + fontFeatureSettings?: AtRule$FontFeatureSettings, + fontStretch?: AtRule$FontStretch, + fontStyle?: AtRule$FontStyle, + fontVariant?: AtRule$FontVariant, + fontVariationSettings?: AtRule$FontVariationSettings, + fontWeight?: AtRule$FontWeight, + lineGapOverride?: AtRule$LineGapOverride, + sizeAdjust?: string, + src?: string, + unicodeRange?: string, +|}; + +export type AtRule$FontFaceHyphen<TLength = string | 0, TTime = string> = {| + "-moz-font-feature-settings"?: AtRule$FontFeatureSettings, + "ascent-override"?: AtRule$AscentOverride, + "descent-override"?: AtRule$DescentOverride, + "font-display"?: AtRule$FontDisplay, + "font-family"?: string, + "font-feature-settings"?: AtRule$FontFeatureSettings, + "font-stretch"?: AtRule$FontStretch, + "font-style"?: AtRule$FontStyle, + "font-variant"?: AtRule$FontVariant, + "font-variation-settings"?: AtRule$FontVariationSettings, + "font-weight"?: AtRule$FontWeight, + "line-gap-override"?: AtRule$LineGapOverride, + "size-adjust"?: string, + src?: string, + "unicode-range"?: string, +|}; + +export type AtRule$FontFaceFallback<TLength = string | 0, TTime = string> = {| + MozFontFeatureSettings?: AtRule$FontFeatureSettings | Array<AtRule$FontFeatureSettings>, + ascentOverride?: AtRule$AscentOverride | Array<AtRule$AscentOverride>, + descentOverride?: AtRule$DescentOverride | Array<AtRule$DescentOverride>, + fontDisplay?: AtRule$FontDisplay | Array<AtRule$FontDisplay>, + fontFamily?: string | Array<string>, + fontFeatureSettings?: AtRule$FontFeatureSettings | Array<AtRule$FontFeatureSettings>, + fontStretch?: AtRule$FontStretch | Array<AtRule$FontStretch>, + fontStyle?: AtRule$FontStyle | Array<AtRule$FontStyle>, + fontVariant?: AtRule$FontVariant | Array<AtRule$FontVariant>, + fontVariationSettings?: AtRule$FontVariationSettings | Array<AtRule$FontVariationSettings>, + fontWeight?: AtRule$FontWeight | Array<AtRule$FontWeight>, + lineGapOverride?: AtRule$LineGapOverride | Array<AtRule$LineGapOverride>, + sizeAdjust?: string | Array<string>, + src?: string | Array<string>, + unicodeRange?: string | Array<string>, +|}; + +export type AtRule$FontFaceHyphenFallback<TLength = string | 0, TTime = string> = {| + "-moz-font-feature-settings"?: AtRule$FontFeatureSettings | Array<AtRule$FontFeatureSettings>, + "ascent-override"?: AtRule$AscentOverride | Array<AtRule$AscentOverride>, + "descent-override"?: AtRule$DescentOverride | Array<AtRule$DescentOverride>, + "font-display"?: AtRule$FontDisplay | Array<AtRule$FontDisplay>, + "font-family"?: string | Array<string>, + "font-feature-settings"?: AtRule$FontFeatureSettings | Array<AtRule$FontFeatureSettings>, + "font-stretch"?: AtRule$FontStretch | Array<AtRule$FontStretch>, + "font-style"?: AtRule$FontStyle | Array<AtRule$FontStyle>, + "font-variant"?: AtRule$FontVariant | Array<AtRule$FontVariant>, + "font-variation-settings"?: AtRule$FontVariationSettings | Array<AtRule$FontVariationSettings>, + "font-weight"?: AtRule$FontWeight | Array<AtRule$FontWeight>, + "line-gap-override"?: AtRule$LineGapOverride | Array<AtRule$LineGapOverride>, + "size-adjust"?: string | Array<string>, + src?: string | Array<string>, + "unicode-range"?: string | Array<string>, +|}; + +export type AtRule$FontPaletteValues<TLength = string | 0, TTime = string> = {| + basePalette?: AtRule$BasePalette, + fontFamily?: string, + overrideColors?: string, +|}; + +export type AtRule$FontPaletteValuesHyphen<TLength = string | 0, TTime = string> = {| + "base-palette"?: AtRule$BasePalette, + "font-family"?: string, + "override-colors"?: string, +|}; + +export type AtRule$FontPaletteValuesFallback<TLength = string | 0, TTime = string> = {| + basePalette?: AtRule$BasePalette | Array<AtRule$BasePalette>, + fontFamily?: string | Array<string>, + overrideColors?: string | Array<string>, +|}; + +export type AtRule$FontPaletteValuesHyphenFallback<TLength = string | 0, TTime = string> = {| + "base-palette"?: AtRule$BasePalette | Array<AtRule$BasePalette>, + "font-family"?: string | Array<string>, + "override-colors"?: string | Array<string>, +|}; + +export type AtRule$Page<TLength = string | 0, TTime = string> = {| + bleed?: AtRule$Bleed<TLength>, + marks?: AtRule$Marks, + pageOrientation?: AtRule$PageOrientation, + size?: AtRule$Size<TLength>, +|}; + +export type AtRule$PageHyphen<TLength = string | 0, TTime = string> = {| + bleed?: AtRule$Bleed<TLength>, + marks?: AtRule$Marks, + "page-orientation"?: AtRule$PageOrientation, + size?: AtRule$Size<TLength>, +|}; + +export type AtRule$PageFallback<TLength = string | 0, TTime = string> = {| + bleed?: AtRule$Bleed<TLength> | Array<AtRule$Bleed<TLength>>, + marks?: AtRule$Marks | Array<AtRule$Marks>, + pageOrientation?: AtRule$PageOrientation | Array<AtRule$PageOrientation>, + size?: AtRule$Size<TLength> | Array<AtRule$Size<TLength>>, +|}; + +export type AtRule$PageHyphenFallback<TLength = string | 0, TTime = string> = {| + bleed?: AtRule$Bleed<TLength> | Array<AtRule$Bleed<TLength>>, + marks?: AtRule$Marks | Array<AtRule$Marks>, + "page-orientation"?: AtRule$PageOrientation | Array<AtRule$PageOrientation>, + size?: AtRule$Size<TLength> | Array<AtRule$Size<TLength>>, +|}; + +export type AtRule$Property<TLength = string | 0, TTime = string> = {| + inherits?: AtRule$Inherits, + initialValue?: string, + syntax?: string, +|}; + +export type AtRule$PropertyHyphen<TLength = string | 0, TTime = string> = {| + inherits?: AtRule$Inherits, + "initial-value"?: string, + syntax?: string, +|}; + +export type AtRule$PropertyFallback<TLength = string | 0, TTime = string> = {| + inherits?: AtRule$Inherits | Array<AtRule$Inherits>, + initialValue?: string | Array<string>, + syntax?: string | Array<string>, +|}; + +export type AtRule$PropertyHyphenFallback<TLength = string | 0, TTime = string> = {| + inherits?: AtRule$Inherits | Array<AtRule$Inherits>, + "initial-value"?: string | Array<string>, + syntax?: string | Array<string>, +|}; + +export type AtRule$Viewport<TLength = string | 0, TTime = string> = {| + height?: AtRule$Height<TLength>, + maxHeight?: AtRule$MaxHeight<TLength>, + maxWidth?: AtRule$MaxWidth<TLength>, + maxZoom?: AtRule$MaxZoom, + minHeight?: AtRule$MinHeight<TLength>, + minWidth?: AtRule$MinWidth<TLength>, + minZoom?: AtRule$MinZoom, + orientation?: AtRule$Orientation, + userZoom?: AtRule$UserZoom, + viewportFit?: AtRule$ViewportFit, + width?: AtRule$Width<TLength>, + zoom?: AtRule$Zoom, +|}; + +export type AtRule$ViewportHyphen<TLength = string | 0, TTime = string> = {| + height?: AtRule$Height<TLength>, + "max-height"?: AtRule$MaxHeight<TLength>, + "max-width"?: AtRule$MaxWidth<TLength>, + "max-zoom"?: AtRule$MaxZoom, + "min-height"?: AtRule$MinHeight<TLength>, + "min-width"?: AtRule$MinWidth<TLength>, + "min-zoom"?: AtRule$MinZoom, + orientation?: AtRule$Orientation, + "user-zoom"?: AtRule$UserZoom, + "viewport-fit"?: AtRule$ViewportFit, + width?: AtRule$Width<TLength>, + zoom?: AtRule$Zoom, +|}; + +export type AtRule$ViewportFallback<TLength = string | 0, TTime = string> = {| + height?: AtRule$Height<TLength> | Array<AtRule$Height<TLength>>, + maxHeight?: AtRule$MaxHeight<TLength> | Array<AtRule$MaxHeight<TLength>>, + maxWidth?: AtRule$MaxWidth<TLength> | Array<AtRule$MaxWidth<TLength>>, + maxZoom?: AtRule$MaxZoom | Array<AtRule$MaxZoom>, + minHeight?: AtRule$MinHeight<TLength> | Array<AtRule$MinHeight<TLength>>, + minWidth?: AtRule$MinWidth<TLength> | Array<AtRule$MinWidth<TLength>>, + minZoom?: AtRule$MinZoom | Array<AtRule$MinZoom>, + orientation?: AtRule$Orientation | Array<AtRule$Orientation>, + userZoom?: AtRule$UserZoom | Array<AtRule$UserZoom>, + viewportFit?: AtRule$ViewportFit | Array<AtRule$ViewportFit>, + width?: AtRule$Width<TLength> | Array<AtRule$Width<TLength>>, + zoom?: AtRule$Zoom | Array<AtRule$Zoom>, +|}; + +export type AtRule$ViewportHyphenFallback<TLength = string | 0, TTime = string> = {| + height?: AtRule$Height<TLength> | Array<AtRule$Height<TLength>>, + "max-height"?: AtRule$MaxHeight<TLength> | Array<AtRule$MaxHeight<TLength>>, + "max-width"?: AtRule$MaxWidth<TLength> | Array<AtRule$MaxWidth<TLength>>, + "max-zoom"?: AtRule$MaxZoom | Array<AtRule$MaxZoom>, + "min-height"?: AtRule$MinHeight<TLength> | Array<AtRule$MinHeight<TLength>>, + "min-width"?: AtRule$MinWidth<TLength> | Array<AtRule$MinWidth<TLength>>, + "min-zoom"?: AtRule$MinZoom | Array<AtRule$MinZoom>, + orientation?: AtRule$Orientation | Array<AtRule$Orientation>, + "user-zoom"?: AtRule$UserZoom | Array<AtRule$UserZoom>, + "viewport-fit"?: AtRule$ViewportFit | Array<AtRule$ViewportFit>, + width?: AtRule$Width<TLength> | Array<AtRule$Width<TLength>>, + zoom?: AtRule$Zoom | Array<AtRule$Zoom>, +|}; + +type AtRule$Range = "auto" | string; + +type AtRule$SpeakAs = "auto" | "bullets" | "numbers" | "spell-out" | "words" | string; + +type AtRule$System = "additive" | "alphabetic" | "cyclic" | "fixed" | "numeric" | "symbolic" | string; + +type AtRule$FontFeatureSettings = "normal" | string; + +type AtRule$AscentOverride = "normal" | string; + +type AtRule$DescentOverride = "normal" | string; + +type AtRule$FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; + +type AtRule$FontStretch = DataType$FontStretchAbsolute | string; + +type AtRule$FontStyle = "italic" | "normal" | "oblique" | string; + +type AtRule$FontVariant = + | DataType$EastAsianVariantValues + | "all-petite-caps" + | "all-small-caps" + | "common-ligatures" + | "contextual" + | "diagonal-fractions" + | "discretionary-ligatures" + | "full-width" + | "historical-forms" + | "historical-ligatures" + | "lining-nums" + | "no-common-ligatures" + | "no-contextual" + | "no-discretionary-ligatures" + | "no-historical-ligatures" + | "none" + | "normal" + | "oldstyle-nums" + | "ordinal" + | "petite-caps" + | "proportional-nums" + | "proportional-width" + | "ruby" + | "slashed-zero" + | "small-caps" + | "stacked-fractions" + | "tabular-nums" + | "titling-caps" + | "unicase" + | string; + +type AtRule$FontVariationSettings = "normal" | string; + +type AtRule$FontWeight = DataType$FontWeightAbsolute | string; + +type AtRule$LineGapOverride = "normal" | string; + +type AtRule$BasePalette = "dark" | "light" | number; + +type AtRule$Bleed<TLength> = TLength | "auto"; + +type AtRule$Marks = "crop" | "cross" | "none" | string; + +type AtRule$PageOrientation = "rotate-left" | "rotate-right" | "upright"; + +type AtRule$Size<TLength> = DataType$PageSize | TLength | "auto" | "landscape" | "portrait" | string; + +type AtRule$Inherits = "false" | "true"; + +type AtRule$Height<TLength> = DataType$ViewportLength<TLength> | string; + +type AtRule$MaxHeight<TLength> = DataType$ViewportLength<TLength>; + +type AtRule$MaxWidth<TLength> = DataType$ViewportLength<TLength>; + +type AtRule$MaxZoom = "auto" | string | number; + +type AtRule$MinHeight<TLength> = DataType$ViewportLength<TLength>; + +type AtRule$MinWidth<TLength> = DataType$ViewportLength<TLength>; + +type AtRule$MinZoom = "auto" | string | number; + +type AtRule$Orientation = "auto" | "landscape" | "portrait"; + +type AtRule$UserZoom = "fixed" | "zoom"; + +type AtRule$ViewportFit = "auto" | "contain" | "cover"; + +type AtRule$Width<TLength> = DataType$ViewportLength<TLength> | string; + +type AtRule$Zoom = "auto" | string | number; + +type DataType$AbsoluteSize = "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large"; + +type DataType$AnimateableFeature = "contents" | "scroll-position" | string; + +type DataType$Attachment = "fixed" | "local" | "scroll"; + +type DataType$BgPosition<TLength> = TLength | "bottom" | "center" | "left" | "right" | "top" | string; + +type DataType$BgSize<TLength> = TLength | "auto" | "contain" | "cover" | string; + +type DataType$BlendMode = + | "color" + | "color-burn" + | "color-dodge" + | "darken" + | "difference" + | "exclusion" + | "hard-light" + | "hue" + | "lighten" + | "luminosity" + | "multiply" + | "normal" + | "overlay" + | "saturation" + | "screen" + | "soft-light"; + +type DataType$Box = "border-box" | "content-box" | "padding-box"; + +type DataType$Color = DataType$NamedColor | DataType$DeprecatedSystemColor | "currentcolor" | string; + +type DataType$CompatAuto = + | "button" + | "checkbox" + | "listbox" + | "menulist" + | "meter" + | "progress-bar" + | "push-button" + | "radio" + | "searchfield" + | "slider-horizontal" + | "square-button" + | "textarea"; + +type DataType$CompositeStyle = + | "clear" + | "copy" + | "destination-atop" + | "destination-in" + | "destination-out" + | "destination-over" + | "source-atop" + | "source-in" + | "source-out" + | "source-over" + | "xor"; + +type DataType$CompositingOperator = "add" | "exclude" | "intersect" | "subtract"; + +type DataType$ContentDistribution = "space-around" | "space-between" | "space-evenly" | "stretch"; + +type DataType$ContentList = DataType$Quote | "contents" | string; + +type DataType$ContentPosition = "center" | "end" | "flex-end" | "flex-start" | "start"; + +type DataType$CubicBezierTimingFunction = "ease" | "ease-in" | "ease-in-out" | "ease-out" | string; + +type DataType$Dasharray<TLength> = TLength | string | number; + +type DataType$DeprecatedSystemColor = + | "ActiveBorder" + | "ActiveCaption" + | "AppWorkspace" + | "Background" + | "ButtonFace" + | "ButtonHighlight" + | "ButtonShadow" + | "ButtonText" + | "CaptionText" + | "GrayText" + | "Highlight" + | "HighlightText" + | "InactiveBorder" + | "InactiveCaption" + | "InactiveCaptionText" + | "InfoBackground" + | "InfoText" + | "Menu" + | "MenuText" + | "Scrollbar" + | "ThreeDDarkShadow" + | "ThreeDFace" + | "ThreeDHighlight" + | "ThreeDLightShadow" + | "ThreeDShadow" + | "Window" + | "WindowFrame" + | "WindowText"; + +type DataType$DisplayInside = "-ms-flexbox" | "-ms-grid" | "-webkit-flex" | "flex" | "flow" | "flow-root" | "grid" | "ruby" | "table"; + +type DataType$DisplayInternal = + | "ruby-base" + | "ruby-base-container" + | "ruby-text" + | "ruby-text-container" + | "table-caption" + | "table-cell" + | "table-column" + | "table-column-group" + | "table-footer-group" + | "table-header-group" + | "table-row" + | "table-row-group"; + +type DataType$DisplayLegacy = + | "-ms-inline-flexbox" + | "-ms-inline-grid" + | "-webkit-inline-flex" + | "inline-block" + | "inline-flex" + | "inline-grid" + | "inline-list-item" + | "inline-table"; + +type DataType$DisplayOutside = "block" | "inline" | "run-in"; + +type DataType$EasingFunction = DataType$CubicBezierTimingFunction | DataType$StepTimingFunction | "linear"; + +type DataType$EastAsianVariantValues = "jis04" | "jis78" | "jis83" | "jis90" | "simplified" | "traditional"; + +type DataType$FinalBgLayer<TLength> = DataType$Color | DataType$BgPosition<TLength> | DataType$RepeatStyle | DataType$Attachment | DataType$Box | "none" | string; + +type DataType$FontStretchAbsolute = + | "condensed" + | "expanded" + | "extra-condensed" + | "extra-expanded" + | "normal" + | "semi-condensed" + | "semi-expanded" + | "ultra-condensed" + | "ultra-expanded" + | string; + +type DataType$FontWeightAbsolute = "bold" | "normal" | number; + +type DataType$GenericFamily = "cursive" | "fantasy" | "monospace" | "sans-serif" | "serif"; + +type DataType$GeometryBox = DataType$Box | "fill-box" | "margin-box" | "stroke-box" | "view-box"; + +type DataType$GridLine = "auto" | string | number; + +type DataType$LineStyle = "dashed" | "dotted" | "double" | "groove" | "hidden" | "inset" | "none" | "outset" | "ridge" | "solid"; + +type DataType$LineWidth<TLength> = TLength | "medium" | "thick" | "thin"; + +type DataType$MaskLayer<TLength> = + | DataType$Position<TLength> + | DataType$RepeatStyle + | DataType$GeometryBox + | DataType$CompositingOperator + | DataType$MaskingMode + | "no-clip" + | "none" + | string; + +type DataType$MaskingMode = "alpha" | "luminance" | "match-source"; + +type DataType$NamedColor = + | "aliceblue" + | "antiquewhite" + | "aqua" + | "aquamarine" + | "azure" + | "beige" + | "bisque" + | "black" + | "blanchedalmond" + | "blue" + | "blueviolet" + | "brown" + | "burlywood" + | "cadetblue" + | "chartreuse" + | "chocolate" + | "coral" + | "cornflowerblue" + | "cornsilk" + | "crimson" + | "cyan" + | "darkblue" + | "darkcyan" + | "darkgoldenrod" + | "darkgray" + | "darkgreen" + | "darkgrey" + | "darkkhaki" + | "darkmagenta" + | "darkolivegreen" + | "darkorange" + | "darkorchid" + | "darkred" + | "darksalmon" + | "darkseagreen" + | "darkslateblue" + | "darkslategray" + | "darkslategrey" + | "darkturquoise" + | "darkviolet" + | "deeppink" + | "deepskyblue" + | "dimgray" + | "dimgrey" + | "dodgerblue" + | "firebrick" + | "floralwhite" + | "forestgreen" + | "fuchsia" + | "gainsboro" + | "ghostwhite" + | "gold" + | "goldenrod" + | "gray" + | "green" + | "greenyellow" + | "grey" + | "honeydew" + | "hotpink" + | "indianred" + | "indigo" + | "ivory" + | "khaki" + | "lavender" + | "lavenderblush" + | "lawngreen" + | "lemonchiffon" + | "lightblue" + | "lightcoral" + | "lightcyan" + | "lightgoldenrodyellow" + | "lightgray" + | "lightgreen" + | "lightgrey" + | "lightpink" + | "lightsalmon" + | "lightseagreen" + | "lightskyblue" + | "lightslategray" + | "lightslategrey" + | "lightsteelblue" + | "lightyellow" + | "lime" + | "limegreen" + | "linen" + | "magenta" + | "maroon" + | "mediumaquamarine" + | "mediumblue" + | "mediumorchid" + | "mediumpurple" + | "mediumseagreen" + | "mediumslateblue" + | "mediumspringgreen" + | "mediumturquoise" + | "mediumvioletred" + | "midnightblue" + | "mintcream" + | "mistyrose" + | "moccasin" + | "navajowhite" + | "navy" + | "oldlace" + | "olive" + | "olivedrab" + | "orange" + | "orangered" + | "orchid" + | "palegoldenrod" + | "palegreen" + | "paleturquoise" + | "palevioletred" + | "papayawhip" + | "peachpuff" + | "peru" + | "pink" + | "plum" + | "powderblue" + | "purple" + | "rebeccapurple" + | "red" + | "rosybrown" + | "royalblue" + | "saddlebrown" + | "salmon" + | "sandybrown" + | "seagreen" + | "seashell" + | "sienna" + | "silver" + | "skyblue" + | "slateblue" + | "slategray" + | "slategrey" + | "snow" + | "springgreen" + | "steelblue" + | "tan" + | "teal" + | "thistle" + | "tomato" + | "transparent" + | "turquoise" + | "violet" + | "wheat" + | "white" + | "whitesmoke" + | "yellow" + | "yellowgreen"; + +type DataType$PageSize = "A3" | "A4" | "A5" | "B4" | "B5" | "JIS-B4" | "JIS-B5" | "ledger" | "legal" | "letter"; + +type DataType$Paint = DataType$Color | "child" | "context-fill" | "context-stroke" | "none" | string; + +type DataType$Position<TLength> = TLength | "bottom" | "center" | "left" | "right" | "top" | string; + +type DataType$Quote = "close-quote" | "no-close-quote" | "no-open-quote" | "open-quote"; + +type DataType$RepeatStyle = "no-repeat" | "repeat" | "repeat-x" | "repeat-y" | "round" | "space" | string; + +type DataType$SelfPosition = "center" | "end" | "flex-end" | "flex-start" | "self-end" | "self-start" | "start"; + +type DataType$SingleAnimation<TTime> = + | DataType$EasingFunction + | DataType$SingleAnimationDirection + | DataType$SingleAnimationFillMode + | DataType$SingleAnimationTimeline + | TTime + | "infinite" + | "none" + | "paused" + | "running" + | string + | number; + +type DataType$SingleAnimationComposition = "accumulate" | "add" | "replace"; + +type DataType$SingleAnimationDirection = "alternate" | "alternate-reverse" | "normal" | "reverse"; + +type DataType$SingleAnimationFillMode = "backwards" | "both" | "forwards" | "none"; + +type DataType$SingleAnimationTimeline = "auto" | "none" | string; + +type DataType$SingleTransition<TTime> = DataType$EasingFunction | TTime | "all" | "allow-discrete" | "none" | "normal" | string; + +type DataType$StepTimingFunction = "step-end" | "step-start" | string; + +type DataType$TimelineRangeName = "contain" | "cover" | "entry" | "entry-crossing" | "exit" | "exit-crossing"; + +type DataType$TrackBreadth<TLength> = TLength | "auto" | "max-content" | "min-content" | string; + +type DataType$ViewportLength<TLength> = TLength | "auto" | string; + +type DataType$VisualBox = "border-box" | "content-box" | "padding-box"; diff --git a/seller_1/node_modules/csstype/package.json b/seller_1/node_modules/csstype/package.json new file mode 100644 index 0000000..2400fc3 --- /dev/null +++ b/seller_1/node_modules/csstype/package.json @@ -0,0 +1,66 @@ +{ + "name": "csstype", + "version": "3.1.3", + "main": "", + "types": "index.d.ts", + "description": "Strict TypeScript and Flow types for style based on MDN data", + "repository": "https://github.com/frenic/csstype", + "author": "Fredrik Nicol <fredrik.nicol@gmail.com>", + "license": "MIT", + "devDependencies": { + "@types/chokidar": "^2.1.3", + "@types/css-tree": "^2.3.1", + "@types/jest": "^29.5.0", + "@types/jsdom": "^21.1.1", + "@types/node": "^16.18.23", + "@types/prettier": "^2.7.2", + "@types/request": "^2.48.8", + "@types/turndown": "^5.0.1", + "@typescript-eslint/eslint-plugin": "^5.57.0", + "@typescript-eslint/parser": "^5.57.0", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "eslint": "^8.37.0", + "css-tree": "^2.3.1", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "fast-glob": "^3.2.12", + "flow-bin": "^0.203.1", + "jest": "^29.5.0", + "jsdom": "^21.1.1", + "mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#1bf44517bd08de735e9ec20dbfe8e86c96341054", + "mdn-data": "git+https://github.com/mdn/data.git#7f0c865a3c4b5d891285c93308ee5c25cb5cfee8", + "prettier": "^2.8.7", + "request": "^2.88.2", + "ts-jest": "^29.0.5", + "ts-node": "^10.9.1", + "turndown": "^7.1.2", + "typescript": "~5.0.3" + }, + "scripts": { + "prepublish": "npm install --prefix __tests__ && npm install --prefix __tests__/__fixtures__", + "prepublishOnly": "tsc && npm run test:src && npm run build && ts-node --files prepublish.ts", + "update": "ts-node --files update.ts", + "build": "ts-node --files build.ts --start", + "watch": "ts-node --files build.ts --watch", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix", + "pretty": "prettier --write build.ts **/*.{ts,js,json,md}", + "lazy": "tsc && npm run lint", + "test": "jest --runInBand", + "test:src": "jest src.*.ts", + "test:dist": "jest dist.*.ts --runInBand" + }, + "files": [ + "index.d.ts", + "index.js.flow" + ], + "keywords": [ + "css", + "style", + "typescript", + "flow", + "typings", + "types", + "definitions" + ] +} diff --git a/seller_1/node_modules/entities/LICENSE b/seller_1/node_modules/entities/LICENSE new file mode 100644 index 0000000..c464f86 --- /dev/null +++ b/seller_1/node_modules/entities/LICENSE @@ -0,0 +1,11 @@ +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/seller_1/node_modules/entities/lib/decode.d.ts b/seller_1/node_modules/entities/lib/decode.d.ts new file mode 100644 index 0000000..ccfd9fb --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode.d.ts @@ -0,0 +1,211 @@ +import htmlDecodeTree from "./generated/decode-data-html.js"; +import xmlDecodeTree from "./generated/decode-data-xml.js"; +import decodeCodePoint from "./decode_codepoint.js"; +export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint }; +export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js"; +export declare enum BinTrieFlags { + VALUE_LENGTH = 49152, + BRANCH_LENGTH = 16256, + JUMP_TABLE = 127 +} +export declare enum DecodingMode { + /** Entities in text nodes that can end with any character. */ + Legacy = 0, + /** Only allow entities terminated with a semicolon. */ + Strict = 1, + /** Entities in attributes have limitations on ending characters. */ + Attribute = 2 +} +/** + * Producers for character reference errors as defined in the HTML spec. + */ +export interface EntityErrorProducer { + missingSemicolonAfterCharacterReference(): void; + absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void; + validateNumericCharacterReference(code: number): void; +} +/** + * Token decoder with support of writing partial entities. + */ +export declare class EntityDecoder { + /** The tree used to decode entities. */ + private readonly decodeTree; + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + private readonly emitCodePoint; + /** An object that is used to produce errors. */ + private readonly errors?; + constructor( + /** The tree used to decode entities. */ + decodeTree: Uint16Array, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint: (cp: number, consumed: number) => void, + /** An object that is used to produce errors. */ + errors?: EntityErrorProducer | undefined); + /** The current state of the decoder. */ + private state; + /** Characters that were consumed while parsing an entity. */ + private consumed; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + private result; + /** The current index in the decode tree. */ + private treeIndex; + /** The number of characters that were consumed in excess. */ + private excess; + /** The mode in which the decoder is operating. */ + private decodeMode; + /** Resets the instance to make it reusable. */ + startEntity(decodeMode: DecodingMode): void; + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + write(str: string, offset: number): number; + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericStart; + private addToNumericResult; + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericHex; + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericDecimal; + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + private emitNumericEntity; + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNamedEntity; + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + private emitNotTerminatedNamedEntity; + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + private emitNamedEntityData; + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + end(): number; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number; +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +export declare function decodeHTML(str: string, mode?: DecodingMode): string; +/** + * Decodes an HTML string in an attribute. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeHTMLAttribute(str: string): string; +/** + * Decodes an HTML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeHTMLStrict(str: string): string; +/** + * Decodes an XML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeXML(str: string): string; +//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode.d.ts.map b/seller_1/node_modules/entities/lib/decode.d.ts.map new file mode 100644 index 0000000..4c0b4b4 --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAGN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAoBxE,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;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;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,eAAsB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode.js b/seller_1/node_modules/entities/lib/decode.js new file mode 100644 index 0000000..aa4a42c --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode.js @@ -0,0 +1,536 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; +var decode_data_html_js_1 = __importDefault(require("./generated/decode-data-html.js")); +exports.htmlDecodeTree = decode_data_html_js_1.default; +var decode_data_xml_js_1 = __importDefault(require("./generated/decode-data-xml.js")); +exports.xmlDecodeTree = decode_data_xml_js_1.default; +var decode_codepoint_js_1 = __importStar(require("./decode_codepoint.js")); +exports.decodeCodePoint = decode_codepoint_js_1.default; +var decode_codepoint_js_2 = require("./decode_codepoint.js"); +Object.defineProperty(exports, "replaceCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } }); +Object.defineProperty(exports, "fromCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } }); +var CharCodes; +(function (CharCodes) { + CharCodes[CharCodes["NUM"] = 35] = "NUM"; + CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; + CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; + CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; + CharCodes[CharCodes["NINE"] = 57] = "NINE"; + CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; + CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; + CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; + CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; + CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; + CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; + CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; +})(CharCodes || (CharCodes = {})); +/** Bit that needs to be set to convert an upper case ASCII character to lower case */ +var TO_LOWER_BIT = 32; +var BinTrieFlags; +(function (BinTrieFlags) { + BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; + BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; + BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; +})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); +function isNumber(code) { + return code >= CharCodes.ZERO && code <= CharCodes.NINE; +} +function isHexadecimalCharacter(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); +} +function isAsciiAlphaNumeric(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || + isNumber(code)); +} +/** + * Checks if the given character is a valid end character for an entity in an attribute. + * + * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. + * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state + */ +function isEntityInAttributeInvalidEnd(code) { + return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); +} +var EntityDecoderState; +(function (EntityDecoderState) { + EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; + EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; + EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; + EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; + EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; +})(EntityDecoderState || (EntityDecoderState = {})); +var DecodingMode; +(function (DecodingMode) { + /** Entities in text nodes that can end with any character. */ + DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; + /** Only allow entities terminated with a semicolon. */ + DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; + /** Entities in attributes have limitations on ending characters. */ + DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; +})(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); +/** + * Token decoder with support of writing partial entities. + */ +var EntityDecoder = /** @class */ (function () { + function EntityDecoder( + /** The tree used to decode entities. */ + decodeTree, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint, + /** An object that is used to produce errors. */ + errors) { + this.decodeTree = decodeTree; + this.emitCodePoint = emitCodePoint; + this.errors = errors; + /** The current state of the decoder. */ + this.state = EntityDecoderState.EntityStart; + /** Characters that were consumed while parsing an entity. */ + this.consumed = 1; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + this.result = 0; + /** The current index in the decode tree. */ + this.treeIndex = 0; + /** The number of characters that were consumed in excess. */ + this.excess = 1; + /** The mode in which the decoder is operating. */ + this.decodeMode = DecodingMode.Strict; + } + /** Resets the instance to make it reusable. */ + EntityDecoder.prototype.startEntity = function (decodeMode) { + this.decodeMode = decodeMode; + this.state = EntityDecoderState.EntityStart; + this.result = 0; + this.treeIndex = 0; + this.excess = 1; + this.consumed = 1; + }; + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.write = function (str, offset) { + switch (this.state) { + case EntityDecoderState.EntityStart: { + if (str.charCodeAt(offset) === CharCodes.NUM) { + this.state = EntityDecoderState.NumericStart; + this.consumed += 1; + return this.stateNumericStart(str, offset + 1); + } + this.state = EntityDecoderState.NamedEntity; + return this.stateNamedEntity(str, offset); + } + case EntityDecoderState.NumericStart: { + return this.stateNumericStart(str, offset); + } + case EntityDecoderState.NumericDecimal: { + return this.stateNumericDecimal(str, offset); + } + case EntityDecoderState.NumericHex: { + return this.stateNumericHex(str, offset); + } + case EntityDecoderState.NamedEntity: { + return this.stateNamedEntity(str, offset); + } + } + }; + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericStart = function (str, offset) { + if (offset >= str.length) { + return -1; + } + if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { + this.state = EntityDecoderState.NumericHex; + this.consumed += 1; + return this.stateNumericHex(str, offset + 1); + } + this.state = EntityDecoderState.NumericDecimal; + return this.stateNumericDecimal(str, offset); + }; + EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) { + if (start !== end) { + var digitCount = end - start; + this.result = + this.result * Math.pow(base, digitCount) + + parseInt(str.substr(start, digitCount), base); + this.consumed += digitCount; + } + }; + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericHex = function (str, offset) { + var startIdx = offset; + while (offset < str.length) { + var char = str.charCodeAt(offset); + if (isNumber(char) || isHexadecimalCharacter(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 16); + return this.emitNumericEntity(char, 3); + } + } + this.addToNumericResult(str, startIdx, offset, 16); + return -1; + }; + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericDecimal = function (str, offset) { + var startIdx = offset; + while (offset < str.length) { + var char = str.charCodeAt(offset); + if (isNumber(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 10); + return this.emitNumericEntity(char, 2); + } + } + this.addToNumericResult(str, startIdx, offset, 10); + return -1; + }; + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) { + var _a; + // Ensure we consumed at least one digit. + if (this.consumed <= expectedLength) { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + // Figure out if this is a legit end of the entity + if (lastCp === CharCodes.SEMI) { + this.consumed += 1; + } + else if (this.decodeMode === DecodingMode.Strict) { + return 0; + } + this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); + if (this.errors) { + if (lastCp !== CharCodes.SEMI) { + this.errors.missingSemicolonAfterCharacterReference(); + } + this.errors.validateNumericCharacterReference(this.result); + } + return this.consumed; + }; + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNamedEntity = function (str, offset) { + var decodeTree = this.decodeTree; + var current = decodeTree[this.treeIndex]; + // The mask is the number of bytes of the value, including the current byte. + var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + for (; offset < str.length; offset++, this.excess++) { + var char = str.charCodeAt(offset); + this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); + if (this.treeIndex < 0) { + return this.result === 0 || + // If we are parsing an attribute + (this.decodeMode === DecodingMode.Attribute && + // We shouldn't have consumed any characters after the entity, + (valueLength === 0 || + // And there should be no invalid characters. + isEntityInAttributeInvalidEnd(char))) + ? 0 + : this.emitNotTerminatedNamedEntity(); + } + current = decodeTree[this.treeIndex]; + valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + // If the branch is a value, store it and continue + if (valueLength !== 0) { + // If the entity is terminated by a semicolon, we are done. + if (char === CharCodes.SEMI) { + return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); + } + // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. + if (this.decodeMode !== DecodingMode.Strict) { + this.result = this.treeIndex; + this.consumed += this.excess; + this.excess = 0; + } + } + } + return -1; + }; + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () { + var _a; + var _b = this, result = _b.result, decodeTree = _b.decodeTree; + var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; + this.emitNamedEntityData(result, valueLength, this.consumed); + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); + return this.consumed; + }; + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) { + var decodeTree = this.decodeTree; + this.emitCodePoint(valueLength === 1 + ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH + : decodeTree[result + 1], consumed); + if (valueLength === 3) { + // For multi-byte values, we need to emit the second byte. + this.emitCodePoint(decodeTree[result + 2], consumed); + } + return consumed; + }; + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.end = function () { + var _a; + switch (this.state) { + case EntityDecoderState.NamedEntity: { + // Emit a named entity if we have one. + return this.result !== 0 && + (this.decodeMode !== DecodingMode.Attribute || + this.result === this.treeIndex) + ? this.emitNotTerminatedNamedEntity() + : 0; + } + // Otherwise, emit a numeric entity if we have one. + case EntityDecoderState.NumericDecimal: { + return this.emitNumericEntity(0, 2); + } + case EntityDecoderState.NumericHex: { + return this.emitNumericEntity(0, 3); + } + case EntityDecoderState.NumericStart: { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + case EntityDecoderState.EntityStart: { + // Return 0 if we have no entity. + return 0; + } + } + }; + return EntityDecoder; +}()); +exports.EntityDecoder = EntityDecoder; +/** + * Creates a function that decodes entities in a string. + * + * @param decodeTree The decode tree. + * @returns A function that decodes entities in a string. + */ +function getDecoder(decodeTree) { + var ret = ""; + var decoder = new EntityDecoder(decodeTree, function (str) { return (ret += (0, decode_codepoint_js_1.fromCodePoint)(str)); }); + return function decodeWithTrie(str, decodeMode) { + var lastIndex = 0; + var offset = 0; + while ((offset = str.indexOf("&", offset)) >= 0) { + ret += str.slice(lastIndex, offset); + decoder.startEntity(decodeMode); + var len = decoder.write(str, + // Skip the "&" + offset + 1); + if (len < 0) { + lastIndex = offset + decoder.end(); + break; + } + lastIndex = offset + len; + // If `len` is 0, skip the current `&` and continue. + offset = len === 0 ? lastIndex + 1 : lastIndex; + } + var result = ret + str.slice(lastIndex); + // Make sure we don't keep a reference to the final string. + ret = ""; + return result; + }; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +function determineBranch(decodeTree, current, nodeIdx, char) { + var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; + var jumpOffset = current & BinTrieFlags.JUMP_TABLE; + // Case 1: Single branch encoded in jump offset + if (branchCount === 0) { + return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + } + // Case 2: Multiple branches encoded in jump table + if (jumpOffset) { + var value = char - jumpOffset; + return value < 0 || value >= branchCount + ? -1 + : decodeTree[nodeIdx + value] - 1; + } + // Case 3: Multiple branches encoded in dictionary + // Binary search for the character. + var lo = nodeIdx; + var hi = lo + branchCount - 1; + while (lo <= hi) { + var mid = (lo + hi) >>> 1; + var midVal = decodeTree[mid]; + if (midVal < char) { + lo = mid + 1; + } + else if (midVal > char) { + hi = mid - 1; + } + else { + return decodeTree[mid + branchCount]; + } + } + return -1; +} +exports.determineBranch = determineBranch; +var htmlDecoder = getDecoder(decode_data_html_js_1.default); +var xmlDecoder = getDecoder(decode_data_xml_js_1.default); +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +function decodeHTML(str, mode) { + if (mode === void 0) { mode = DecodingMode.Legacy; } + return htmlDecoder(str, mode); +} +exports.decodeHTML = decodeHTML; +/** + * Decodes an HTML string in an attribute. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeHTMLAttribute(str) { + return htmlDecoder(str, DecodingMode.Attribute); +} +exports.decodeHTMLAttribute = decodeHTMLAttribute; +/** + * Decodes an HTML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeHTMLStrict(str) { + return htmlDecoder(str, DecodingMode.Strict); +} +exports.decodeHTMLStrict = decodeHTMLStrict; +/** + * Decodes an XML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeXML(str) { + return xmlDecoder(str, DecodingMode.Strict); +} +exports.decodeXML = decodeXML; +//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode.js.map b/seller_1/node_modules/entities/lib/decode.js.map new file mode 100644 index 0000000..afcad7e --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wFAA6D;AAQpD,yBARF,6BAAc,CAQE;AAPvB,sFAA2D;AAOlC,wBAPlB,4BAAa,CAOkB;AANtC,2EAG+B;AAGS,0BANjC,6BAAe,CAMiC;AACvD,6DAAwE;AAA/D,uHAAA,gBAAgB,OAAA;AAAE,oHAAA,aAAa,OAAA;AAExC,IAAW,SAaV;AAbD,WAAW,SAAS;IAChB,wCAAQ,CAAA;IACR,0CAAS,CAAA;IACT,8CAAW,CAAA;IACX,0CAAS,CAAA;IACT,0CAAS,CAAA;IACT,gDAAY,CAAA;IACZ,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,gDAAY,CAAA;IACZ,gDAAY,CAAA;IACZ,gDAAY,CAAA;AAChB,CAAC,EAbU,SAAS,KAAT,SAAS,QAanB;AAED,sFAAsF;AACtF,IAAM,YAAY,GAAG,EAAQ,CAAC;AAE9B,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,mEAAoC,CAAA;IACpC,qEAAqC,CAAA;IACrC,6DAAkC,CAAA;AACtC,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY;IACxC,OAAO,CACH,CAAC,IAAI,IAAI,SAAS,CAAC,OAAO,IAAI,IAAI,IAAI,SAAS,CAAC,OAAO,CAAC;QACxD,CAAC,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C,OAAO,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode_codepoint.d.ts b/seller_1/node_modules/entities/lib/decode_codepoint.d.ts new file mode 100644 index 0000000..84ae206 --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode_codepoint.d.ts @@ -0,0 +1,19 @@ +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +export declare const fromCodePoint: (...codePoints: number[]) => string; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +export declare function replaceCodePoint(codePoint: number): number; +/** + * Replace the code point if relevant, then convert it to a string. + * + * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. + * @param codePoint The code point to decode. + * @returns The decoded code point. + */ +export default function decodeCodePoint(codePoint: number): string; +//# sourceMappingURL=decode_codepoint.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode_codepoint.d.ts.map b/seller_1/node_modules/entities/lib/decode_codepoint.d.ts.map new file mode 100644 index 0000000..38a8dea --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode_codepoint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,eAAO,MAAM,aAAa,qCAgBrB,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAMjD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode_codepoint.js b/seller_1/node_modules/entities/lib/decode_codepoint.js new file mode 100644 index 0000000..1205346 --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode_codepoint.js @@ -0,0 +1,76 @@ +"use strict"; +// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceCodePoint = exports.fromCodePoint = void 0; +var decodeMap = new Map([ + [0, 65533], + // C1 Unicode control character reference replacements + [128, 8364], + [130, 8218], + [131, 402], + [132, 8222], + [133, 8230], + [134, 8224], + [135, 8225], + [136, 710], + [137, 8240], + [138, 352], + [139, 8249], + [140, 338], + [142, 381], + [145, 8216], + [146, 8217], + [147, 8220], + [148, 8221], + [149, 8226], + [150, 8211], + [151, 8212], + [152, 732], + [153, 8482], + [154, 353], + [155, 8250], + [156, 339], + [158, 382], + [159, 376], +]); +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +exports.fromCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins +(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { + var output = ""; + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); + codePoint = 0xdc00 | (codePoint & 0x3ff); + } + output += String.fromCharCode(codePoint); + return output; +}; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +function replaceCodePoint(codePoint) { + var _a; + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return 0xfffd; + } + return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; +} +exports.replaceCodePoint = replaceCodePoint; +/** + * Replace the code point if relevant, then convert it to a string. + * + * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. + * @param codePoint The code point to decode. + * @returns The decoded code point. + */ +function decodeCodePoint(codePoint) { + return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); +} +exports.default = decodeCodePoint; +//# sourceMappingURL=decode_codepoint.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/decode_codepoint.js.map b/seller_1/node_modules/entities/lib/decode_codepoint.js.map new file mode 100644 index 0000000..2747865 --- /dev/null +++ b/seller_1/node_modules/entities/lib/decode_codepoint.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode_codepoint.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":";AAAA,qHAAqH;;;;AAErH,IAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,CAAC,EAAE,KAAK,CAAC;IACV,sDAAsD;IACtD,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;CACb,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,aAAa;AACtB,iHAAiH;AACjH,MAAA,MAAM,CAAC,aAAa,mCACpB,UAAU,SAAiB;IACvB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG,MAAM,EAAE;QACpB,SAAS,IAAI,OAAO,CAAC;QACrB,MAAM,IAAI,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CACxC,CAAC;QACF,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEN;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,SAAiB;;IAC9C,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE;QACtE,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjD,CAAC;AAND,4CAMC;AAED;;;;;;GAMG;AACH,SAAwB,eAAe,CAAC,SAAiB;IACrD,OAAO,IAAA,qBAAa,EAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,kCAEC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/encode.d.ts b/seller_1/node_modules/entities/lib/encode.d.ts new file mode 100644 index 0000000..f09c4ee --- /dev/null +++ b/seller_1/node_modules/entities/lib/encode.d.ts @@ -0,0 +1,22 @@ +/** + * Encodes all characters in the input using HTML entities. This includes + * characters that are valid ASCII characters in HTML documents, such as `#`. + * + * To get a more compact output, consider using the `encodeNonAsciiHTML` + * function, which will only encode characters that are not valid in HTML + * documents, as well as non-ASCII characters. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export declare function encodeHTML(data: string): string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. This function will not encode characters that + * are valid in HTML documents, such as `#`. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export declare function encodeNonAsciiHTML(data: string): string; +//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/encode.d.ts.map b/seller_1/node_modules/entities/lib/encode.d.ts.map new file mode 100644 index 0000000..e24c05b --- /dev/null +++ b/seller_1/node_modules/entities/lib/encode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/encode.js b/seller_1/node_modules/entities/lib/encode.js new file mode 100644 index 0000000..4786a03 --- /dev/null +++ b/seller_1/node_modules/entities/lib/encode.js @@ -0,0 +1,77 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.encodeNonAsciiHTML = exports.encodeHTML = void 0; +var encode_html_js_1 = __importDefault(require("./generated/encode-html.js")); +var escape_js_1 = require("./escape.js"); +var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; +/** + * Encodes all characters in the input using HTML entities. This includes + * characters that are valid ASCII characters in HTML documents, such as `#`. + * + * To get a more compact output, consider using the `encodeNonAsciiHTML` + * function, which will only encode characters that are not valid in HTML + * documents, as well as non-ASCII characters. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +function encodeHTML(data) { + return encodeHTMLTrieRe(htmlReplacer, data); +} +exports.encodeHTML = encodeHTML; +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. This function will not encode characters that + * are valid in HTML documents, such as `#`. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +function encodeNonAsciiHTML(data) { + return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data); +} +exports.encodeNonAsciiHTML = encodeNonAsciiHTML; +function encodeHTMLTrieRe(regExp, str) { + var ret = ""; + var lastIdx = 0; + var match; + while ((match = regExp.exec(str)) !== null) { + var i = match.index; + ret += str.substring(lastIdx, i); + var char = str.charCodeAt(i); + var next = encode_html_js_1.default.get(char); + if (typeof next === "object") { + // We are in a branch. Try to match the next char. + if (i + 1 < str.length) { + var nextChar = str.charCodeAt(i + 1); + var value = typeof next.n === "number" + ? next.n === nextChar + ? next.o + : undefined + : next.n.get(nextChar); + if (value !== undefined) { + ret += value; + lastIdx = regExp.lastIndex += 1; + continue; + } + } + next = next.v; + } + // We might have a tree node without a value; skip and use a numeric entity. + if (next !== undefined) { + ret += next; + lastIdx = i + 1; + } + else { + var cp = (0, escape_js_1.getCodePoint)(str, i); + ret += "&#x".concat(cp.toString(16), ";"); + // Increase by 1 if we have a surrogate pair + lastIdx = regExp.lastIndex += Number(cp !== char); + } + } + return ret + str.substr(lastIdx); +} +//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/encode.js.map b/seller_1/node_modules/entities/lib/encode.js.map new file mode 100644 index 0000000..9d47162 --- /dev/null +++ b/seller_1/node_modules/entities/lib/encode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":";;;;;;AAAA,8EAAkD;AAClD,yCAAwD;AAExD,IAAM,YAAY,GAAG,qCAAqC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CAAC,IAAY;IACnC,OAAO,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC;AACD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,uBAAW,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAFD,gDAEC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,KAAK,CAAC;IAEV,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QACxC,IAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACtB,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACjC,IAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,IAAI,GAAG,wBAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,kDAAkD;YAClD,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACpB,IAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvC,IAAM,KAAK,GACP,OAAO,IAAI,CAAC,CAAC,KAAK,QAAQ;oBACtB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,QAAQ;wBACjB,CAAC,CAAC,IAAI,CAAC,CAAC;wBACR,CAAC,CAAC,SAAS;oBACf,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAE/B,IAAI,KAAK,KAAK,SAAS,EAAE;oBACrB,GAAG,IAAI,KAAK,CAAC;oBACb,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;oBAChC,SAAS;iBACZ;aACJ;YAED,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;SACjB;QAED,4EAA4E;QAC5E,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,GAAG,IAAI,IAAI,CAAC;YACZ,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;SACnB;aAAM;YACH,IAAM,EAAE,GAAG,IAAA,wBAAY,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAChC,GAAG,IAAI,aAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAG,CAAC;YAChC,4CAA4C;YAC5C,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/escape.d.ts b/seller_1/node_modules/entities/lib/escape.d.ts new file mode 100644 index 0000000..c07ecdc --- /dev/null +++ b/seller_1/node_modules/entities/lib/escape.d.ts @@ -0,0 +1,43 @@ +export declare const xmlReplacer: RegExp; +export declare const getCodePoint: (str: string, index: number) => number; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export declare function encodeXML(str: string): string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +export declare const escape: typeof encodeXML; +/** + * Encodes all characters not valid in XML documents using XML entities. + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +export declare const escapeUTF8: (data: string) => string; +/** + * Encodes all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export declare const escapeAttribute: (data: string) => string; +/** + * Encodes all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export declare const escapeText: (data: string) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/escape.d.ts.map b/seller_1/node_modules/entities/lib/escape.d.ts.map new file mode 100644 index 0000000..fa19825 --- /dev/null +++ b/seller_1/node_modules/entities/lib/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAyB,CAAC;AAWlD,eAAO,MAAM,YAAY,QAGT,MAAM,SAAS,MAAM,KAAG,MAQD,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0B7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,kBAAY,CAAC;AAqChC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,SA7Bb,MAAM,KAAK,MA6BuC,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SArClB,MAAM,KAAK,MA4CpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SApDb,MAAM,KAAK,MA4DpB,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/escape.js b/seller_1/node_modules/entities/lib/escape.js new file mode 100644 index 0000000..9f36272 --- /dev/null +++ b/seller_1/node_modules/entities/lib/escape.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0; +exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g; +var xmlCodeMap = new Map([ + [34, """], + [38, "&"], + [39, "'"], + [60, "<"], + [62, ">"], +]); +// For compatibility with node < 4, we wrap `codePointAt` +exports.getCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition +String.prototype.codePointAt != null + ? function (str, index) { return str.codePointAt(index); } + : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + function (c, index) { + return (c.charCodeAt(index) & 0xfc00) === 0xd800 + ? (c.charCodeAt(index) - 0xd800) * 0x400 + + c.charCodeAt(index + 1) - + 0xdc00 + + 0x10000 + : c.charCodeAt(index); + }; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +function encodeXML(str) { + var ret = ""; + var lastIdx = 0; + var match; + while ((match = exports.xmlReplacer.exec(str)) !== null) { + var i = match.index; + var char = str.charCodeAt(i); + var next = xmlCodeMap.get(char); + if (next !== undefined) { + ret += str.substring(lastIdx, i) + next; + lastIdx = i + 1; + } + else { + ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";"); + // Increase by 1 if we have a surrogate pair + lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); + } + } + return ret + str.substr(lastIdx); +} +exports.encodeXML = encodeXML; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +exports.escape = encodeXML; +/** + * Creates a function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + * + * @param regex Regular expression to match characters to escape. + * @param map Map of characters to escape to their entities. + * + * @returns Function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + */ +function getEscaper(regex, map) { + return function escape(data) { + var match; + var lastIdx = 0; + var result = ""; + while ((match = regex.exec(data))) { + if (lastIdx !== match.index) { + result += data.substring(lastIdx, match.index); + } + // We know that this character will be in the map. + result += map.get(match[0].charCodeAt(0)); + // Every match will be of length 1 + lastIdx = match.index + 1; + } + return result + data.substring(lastIdx); + }; +} +/** + * Encodes all characters not valid in XML documents using XML entities. + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); +/** + * Encodes all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([ + [34, """], + [38, "&"], + [160, " "], +])); +/** + * Encodes all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([ + [38, "&"], + [60, "<"], + [62, ">"], + [160, " "], +])); +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/escape.js.map b/seller_1/node_modules/entities/lib/escape.js.map new file mode 100644 index 0000000..f96d022 --- /dev/null +++ b/seller_1/node_modules/entities/lib/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc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E,CAAC;YAE3C,kCAAkC;YAClC,OAAO,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;SAC7B;QAED,OAAO,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACU,QAAA,UAAU,GAAG,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE7D;;;;;GAKG;AACU,QAAA,eAAe,GAAG,UAAU,CACrC,aAAa,EACb,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC;AAEF;;;;;GAKG;AACU,QAAA,UAAU,GAAG,UAAU,CAChC,cAAc,EACd,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode.d.ts b/seller_1/node_modules/entities/lib/esm/decode.d.ts new file mode 100644 index 0000000..ccfd9fb --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode.d.ts @@ -0,0 +1,211 @@ +import htmlDecodeTree from "./generated/decode-data-html.js"; +import xmlDecodeTree from "./generated/decode-data-xml.js"; +import decodeCodePoint from "./decode_codepoint.js"; +export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint }; +export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js"; +export declare enum BinTrieFlags { + VALUE_LENGTH = 49152, + BRANCH_LENGTH = 16256, + JUMP_TABLE = 127 +} +export declare enum DecodingMode { + /** Entities in text nodes that can end with any character. */ + Legacy = 0, + /** Only allow entities terminated with a semicolon. */ + Strict = 1, + /** Entities in attributes have limitations on ending characters. */ + Attribute = 2 +} +/** + * Producers for character reference errors as defined in the HTML spec. + */ +export interface EntityErrorProducer { + missingSemicolonAfterCharacterReference(): void; + absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void; + validateNumericCharacterReference(code: number): void; +} +/** + * Token decoder with support of writing partial entities. + */ +export declare class EntityDecoder { + /** The tree used to decode entities. */ + private readonly decodeTree; + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + private readonly emitCodePoint; + /** An object that is used to produce errors. */ + private readonly errors?; + constructor( + /** The tree used to decode entities. */ + decodeTree: Uint16Array, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint: (cp: number, consumed: number) => void, + /** An object that is used to produce errors. */ + errors?: EntityErrorProducer | undefined); + /** The current state of the decoder. */ + private state; + /** Characters that were consumed while parsing an entity. */ + private consumed; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + private result; + /** The current index in the decode tree. */ + private treeIndex; + /** The number of characters that were consumed in excess. */ + private excess; + /** The mode in which the decoder is operating. */ + private decodeMode; + /** Resets the instance to make it reusable. */ + startEntity(decodeMode: DecodingMode): void; + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + write(str: string, offset: number): number; + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericStart; + private addToNumericResult; + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericHex; + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNumericDecimal; + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + private emitNumericEntity; + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + private stateNamedEntity; + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + private emitNotTerminatedNamedEntity; + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + private emitNamedEntityData; + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + end(): number; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number; +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +export declare function decodeHTML(str: string, mode?: DecodingMode): string; +/** + * Decodes an HTML string in an attribute. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeHTMLAttribute(str: string): string; +/** + * Decodes an HTML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeHTMLStrict(str: string): string; +/** + * Decodes an XML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export declare function decodeXML(str: string): string; +//# sourceMappingURL=decode.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode.d.ts.map b/seller_1/node_modules/entities/lib/esm/decode.d.ts.map new file mode 100644 index 0000000..4c0b4b4 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAGN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAoBxE,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,u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B;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,eAAsB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode.js b/seller_1/node_modules/entities/lib/esm/decode.js new file mode 100644 index 0000000..de225ec --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode.js @@ -0,0 +1,496 @@ +import htmlDecodeTree from "./generated/decode-data-html.js"; +import xmlDecodeTree from "./generated/decode-data-xml.js"; +import decodeCodePoint, { replaceCodePoint, fromCodePoint, } from "./decode_codepoint.js"; +// Re-export for use by eg. htmlparser2 +export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint }; +export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js"; +var CharCodes; +(function (CharCodes) { + CharCodes[CharCodes["NUM"] = 35] = "NUM"; + CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; + CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; + CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; + CharCodes[CharCodes["NINE"] = 57] = "NINE"; + CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; + CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; + CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; + CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; + CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; + CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; + CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; +})(CharCodes || (CharCodes = {})); +/** Bit that needs to be set to convert an upper case ASCII character to lower case */ +const TO_LOWER_BIT = 0b100000; +export var BinTrieFlags; +(function (BinTrieFlags) { + BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; + BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; + BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; +})(BinTrieFlags || (BinTrieFlags = {})); +function isNumber(code) { + return code >= CharCodes.ZERO && code <= CharCodes.NINE; +} +function isHexadecimalCharacter(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); +} +function isAsciiAlphaNumeric(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || + isNumber(code)); +} +/** + * Checks if the given character is a valid end character for an entity in an attribute. + * + * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. + * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state + */ +function isEntityInAttributeInvalidEnd(code) { + return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); +} +var EntityDecoderState; +(function (EntityDecoderState) { + EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; + EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; + EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; + EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; + EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; +})(EntityDecoderState || (EntityDecoderState = {})); +export var DecodingMode; +(function (DecodingMode) { + /** Entities in text nodes that can end with any character. */ + DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; + /** Only allow entities terminated with a semicolon. */ + DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; + /** Entities in attributes have limitations on ending characters. */ + DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; +})(DecodingMode || (DecodingMode = {})); +/** + * Token decoder with support of writing partial entities. + */ +export class EntityDecoder { + constructor( + /** The tree used to decode entities. */ + decodeTree, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint, + /** An object that is used to produce errors. */ + errors) { + this.decodeTree = decodeTree; + this.emitCodePoint = emitCodePoint; + this.errors = errors; + /** The current state of the decoder. */ + this.state = EntityDecoderState.EntityStart; + /** Characters that were consumed while parsing an entity. */ + this.consumed = 1; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + this.result = 0; + /** The current index in the decode tree. */ + this.treeIndex = 0; + /** The number of characters that were consumed in excess. */ + this.excess = 1; + /** The mode in which the decoder is operating. */ + this.decodeMode = DecodingMode.Strict; + } + /** Resets the instance to make it reusable. */ + startEntity(decodeMode) { + this.decodeMode = decodeMode; + this.state = EntityDecoderState.EntityStart; + this.result = 0; + this.treeIndex = 0; + this.excess = 1; + this.consumed = 1; + } + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + write(str, offset) { + switch (this.state) { + case EntityDecoderState.EntityStart: { + if (str.charCodeAt(offset) === CharCodes.NUM) { + this.state = EntityDecoderState.NumericStart; + this.consumed += 1; + return this.stateNumericStart(str, offset + 1); + } + this.state = EntityDecoderState.NamedEntity; + return this.stateNamedEntity(str, offset); + } + case EntityDecoderState.NumericStart: { + return this.stateNumericStart(str, offset); + } + case EntityDecoderState.NumericDecimal: { + return this.stateNumericDecimal(str, offset); + } + case EntityDecoderState.NumericHex: { + return this.stateNumericHex(str, offset); + } + case EntityDecoderState.NamedEntity: { + return this.stateNamedEntity(str, offset); + } + } + } + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericStart(str, offset) { + if (offset >= str.length) { + return -1; + } + if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { + this.state = EntityDecoderState.NumericHex; + this.consumed += 1; + return this.stateNumericHex(str, offset + 1); + } + this.state = EntityDecoderState.NumericDecimal; + return this.stateNumericDecimal(str, offset); + } + addToNumericResult(str, start, end, base) { + if (start !== end) { + const digitCount = end - start; + this.result = + this.result * Math.pow(base, digitCount) + + parseInt(str.substr(start, digitCount), base); + this.consumed += digitCount; + } + } + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericHex(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber(char) || isHexadecimalCharacter(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 16); + return this.emitNumericEntity(char, 3); + } + } + this.addToNumericResult(str, startIdx, offset, 16); + return -1; + } + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericDecimal(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 10); + return this.emitNumericEntity(char, 2); + } + } + this.addToNumericResult(str, startIdx, offset, 10); + return -1; + } + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + emitNumericEntity(lastCp, expectedLength) { + var _a; + // Ensure we consumed at least one digit. + if (this.consumed <= expectedLength) { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + // Figure out if this is a legit end of the entity + if (lastCp === CharCodes.SEMI) { + this.consumed += 1; + } + else if (this.decodeMode === DecodingMode.Strict) { + return 0; + } + this.emitCodePoint(replaceCodePoint(this.result), this.consumed); + if (this.errors) { + if (lastCp !== CharCodes.SEMI) { + this.errors.missingSemicolonAfterCharacterReference(); + } + this.errors.validateNumericCharacterReference(this.result); + } + return this.consumed; + } + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNamedEntity(str, offset) { + const { decodeTree } = this; + let current = decodeTree[this.treeIndex]; + // The mask is the number of bytes of the value, including the current byte. + let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + for (; offset < str.length; offset++, this.excess++) { + const char = str.charCodeAt(offset); + this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); + if (this.treeIndex < 0) { + return this.result === 0 || + // If we are parsing an attribute + (this.decodeMode === DecodingMode.Attribute && + // We shouldn't have consumed any characters after the entity, + (valueLength === 0 || + // And there should be no invalid characters. + isEntityInAttributeInvalidEnd(char))) + ? 0 + : this.emitNotTerminatedNamedEntity(); + } + current = decodeTree[this.treeIndex]; + valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + // If the branch is a value, store it and continue + if (valueLength !== 0) { + // If the entity is terminated by a semicolon, we are done. + if (char === CharCodes.SEMI) { + return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); + } + // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. + if (this.decodeMode !== DecodingMode.Strict) { + this.result = this.treeIndex; + this.consumed += this.excess; + this.excess = 0; + } + } + } + return -1; + } + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + emitNotTerminatedNamedEntity() { + var _a; + const { result, decodeTree } = this; + const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; + this.emitNamedEntityData(result, valueLength, this.consumed); + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); + return this.consumed; + } + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + emitNamedEntityData(result, valueLength, consumed) { + const { decodeTree } = this; + this.emitCodePoint(valueLength === 1 + ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH + : decodeTree[result + 1], consumed); + if (valueLength === 3) { + // For multi-byte values, we need to emit the second byte. + this.emitCodePoint(decodeTree[result + 2], consumed); + } + return consumed; + } + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + end() { + var _a; + switch (this.state) { + case EntityDecoderState.NamedEntity: { + // Emit a named entity if we have one. + return this.result !== 0 && + (this.decodeMode !== DecodingMode.Attribute || + this.result === this.treeIndex) + ? this.emitNotTerminatedNamedEntity() + : 0; + } + // Otherwise, emit a numeric entity if we have one. + case EntityDecoderState.NumericDecimal: { + return this.emitNumericEntity(0, 2); + } + case EntityDecoderState.NumericHex: { + return this.emitNumericEntity(0, 3); + } + case EntityDecoderState.NumericStart: { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + case EntityDecoderState.EntityStart: { + // Return 0 if we have no entity. + return 0; + } + } + } +} +/** + * Creates a function that decodes entities in a string. + * + * @param decodeTree The decode tree. + * @returns A function that decodes entities in a string. + */ +function getDecoder(decodeTree) { + let ret = ""; + const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str))); + return function decodeWithTrie(str, decodeMode) { + let lastIndex = 0; + let offset = 0; + while ((offset = str.indexOf("&", offset)) >= 0) { + ret += str.slice(lastIndex, offset); + decoder.startEntity(decodeMode); + const len = decoder.write(str, + // Skip the "&" + offset + 1); + if (len < 0) { + lastIndex = offset + decoder.end(); + break; + } + lastIndex = offset + len; + // If `len` is 0, skip the current `&` and continue. + offset = len === 0 ? lastIndex + 1 : lastIndex; + } + const result = ret + str.slice(lastIndex); + // Make sure we don't keep a reference to the final string. + ret = ""; + return result; + }; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +export function determineBranch(decodeTree, current, nodeIdx, char) { + const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; + const jumpOffset = current & BinTrieFlags.JUMP_TABLE; + // Case 1: Single branch encoded in jump offset + if (branchCount === 0) { + return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + } + // Case 2: Multiple branches encoded in jump table + if (jumpOffset) { + const value = char - jumpOffset; + return value < 0 || value >= branchCount + ? -1 + : decodeTree[nodeIdx + value] - 1; + } + // Case 3: Multiple branches encoded in dictionary + // Binary search for the character. + let lo = nodeIdx; + let hi = lo + branchCount - 1; + while (lo <= hi) { + const mid = (lo + hi) >>> 1; + const midVal = decodeTree[mid]; + if (midVal < char) { + lo = mid + 1; + } + else if (midVal > char) { + hi = mid - 1; + } + else { + return decodeTree[mid + branchCount]; + } + } + return -1; +} +const htmlDecoder = getDecoder(htmlDecodeTree); +const xmlDecoder = getDecoder(xmlDecodeTree); +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +export function decodeHTML(str, mode = DecodingMode.Legacy) { + return htmlDecoder(str, mode); +} +/** + * Decodes an HTML string in an attribute. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export function decodeHTMLAttribute(str) { + return htmlDecoder(str, DecodingMode.Attribute); +} +/** + * Decodes an HTML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export function decodeHTMLStrict(str) { + return htmlDecoder(str, DecodingMode.Strict); +} +/** + * Decodes an XML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +export function decodeXML(str) { + return xmlDecoder(str, DecodingMode.Strict); +} +//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode.js.map b/seller_1/node_modules/entities/lib/esm/decode.js.map new file mode 100644 index 0000000..2db1510 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,g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AE,GAAG,GAAG,GAAG,CAAC,CAAC;SAChB;aAAM,IAAI,MAAM,GAAG,IAAI,EAAE;YACtB,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;SAChB;aAAM;YACH,OAAO,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC;SACxC;KACJ;IAED,OAAO,CAAC,CAAC,CAAC;AACd,CAAC;AAED,MAAM,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AAC/C,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,IAAI,GAAG,YAAY,CAAC,MAAM;IAC9D,OAAO,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC3C,OAAO,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IACxC,OAAO,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACjC,OAAO,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts b/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts new file mode 100644 index 0000000..84ae206 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts @@ -0,0 +1,19 @@ +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +export declare const fromCodePoint: (...codePoints: number[]) => string; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +export declare function replaceCodePoint(codePoint: number): number; +/** + * Replace the code point if relevant, then convert it to a string. + * + * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. + * @param codePoint The code point to decode. + * @returns The decoded code point. + */ +export default function decodeCodePoint(codePoint: number): string; +//# sourceMappingURL=decode_codepoint.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts.map b/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts.map new file mode 100644 index 0000000..38a8dea --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode_codepoint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,eAAO,MAAM,aAAa,qCAgBrB,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAMjD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode_codepoint.js b/seller_1/node_modules/entities/lib/esm/decode_codepoint.js new file mode 100644 index 0000000..4d8281e --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode_codepoint.js @@ -0,0 +1,71 @@ +// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 +var _a; +const decodeMap = new Map([ + [0, 65533], + // C1 Unicode control character reference replacements + [128, 8364], + [130, 8218], + [131, 402], + [132, 8222], + [133, 8230], + [134, 8224], + [135, 8225], + [136, 710], + [137, 8240], + [138, 352], + [139, 8249], + [140, 338], + [142, 381], + [145, 8216], + [146, 8217], + [147, 8220], + [148, 8221], + [149, 8226], + [150, 8211], + [151, 8212], + [152, 732], + [153, 8482], + [154, 353], + [155, 8250], + [156, 339], + [158, 382], + [159, 376], +]); +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +export const fromCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins +(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { + let output = ""; + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); + codePoint = 0xdc00 | (codePoint & 0x3ff); + } + output += String.fromCharCode(codePoint); + return output; +}; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +export function replaceCodePoint(codePoint) { + var _a; + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return 0xfffd; + } + return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; +} +/** + * Replace the code point if relevant, then convert it to a string. + * + * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. + * @param codePoint The code point to decode. + * @returns The decoded code point. + */ +export default function decodeCodePoint(codePoint) { + return fromCodePoint(replaceCodePoint(codePoint)); +} +//# sourceMappingURL=decode_codepoint.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/decode_codepoint.js.map b/seller_1/node_modules/entities/lib/esm/decode_codepoint.js.map new file mode 100644 index 0000000..53a32b6 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/decode_codepoint.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode_codepoint.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAAA,qHAAqH;;AAErH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,CAAC,EAAE,KAAK,CAAC;IACV,sDAAsD;IACtD,CAAC,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AAC,GAAG,KAAK,CAAC,GAAG,MAAM,CACxC,CAAC;QACF,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEN;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;;IAC9C,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE;QACtE,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAiB;IACrD,OAAO,aAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/encode.d.ts b/seller_1/node_modules/entities/lib/esm/encode.d.ts new file mode 100644 index 0000000..f09c4ee --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/encode.d.ts @@ -0,0 +1,22 @@ +/** + * Encodes all characters in the input using HTML entities. This includes + * characters that are valid ASCII characters in HTML documents, such as `#`. + * + * To get a more compact output, consider using the `encodeNonAsciiHTML` + * function, which will only encode characters that are not valid in HTML + * documents, as well as non-ASCII characters. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export declare function encodeHTML(data: string): string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. This function will not encode characters that + * are valid in HTML documents, such as `#`. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export declare function encodeNonAsciiHTML(data: string): string; +//# sourceMappingURL=encode.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/encode.d.ts.map b/seller_1/node_modules/entities/lib/esm/encode.d.ts.map new file mode 100644 index 0000000..e24c05b --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/encode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/encode.js b/seller_1/node_modules/entities/lib/esm/encode.js new file mode 100644 index 0000000..9c2364f --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/encode.js @@ -0,0 +1,69 @@ +import htmlTrie from "./generated/encode-html.js"; +import { xmlReplacer, getCodePoint } from "./escape.js"; +const htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; +/** + * Encodes all characters in the input using HTML entities. This includes + * characters that are valid ASCII characters in HTML documents, such as `#`. + * + * To get a more compact output, consider using the `encodeNonAsciiHTML` + * function, which will only encode characters that are not valid in HTML + * documents, as well as non-ASCII characters. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export function encodeHTML(data) { + return encodeHTMLTrieRe(htmlReplacer, data); +} +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. This function will not encode characters that + * are valid in HTML documents, such as `#`. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +export function encodeNonAsciiHTML(data) { + return encodeHTMLTrieRe(xmlReplacer, data); +} +function encodeHTMLTrieRe(regExp, str) { + let ret = ""; + let lastIdx = 0; + let match; + while ((match = regExp.exec(str)) !== null) { + const i = match.index; + ret += str.substring(lastIdx, i); + const char = str.charCodeAt(i); + let next = htmlTrie.get(char); + if (typeof next === "object") { + // We are in a branch. Try to match the next char. + if (i + 1 < str.length) { + const nextChar = str.charCodeAt(i + 1); + const value = typeof next.n === "number" + ? next.n === nextChar + ? next.o + : undefined + : next.n.get(nextChar); + if (value !== undefined) { + ret += value; + lastIdx = regExp.lastIndex += 1; + continue; + } + } + next = next.v; + } + // We might have a tree node without a value; skip and use a numeric entity. + if (next !== undefined) { + ret += next; + lastIdx = i + 1; + } + else { + const cp = getCodePoint(str, i); + ret += `&#x${cp.toString(16)};`; + // Increase by 1 if we have a surrogate pair + lastIdx = regExp.lastIndex += Number(cp !== char); + } + } + return ret + str.substr(lastIdx); +} +//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/encode.js.map b/seller_1/node_modules/entities/lib/esm/encode.js.map new file mode 100644 index 0000000..14ac068 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/encode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,YAAY,GAAG,qCAAqC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AACD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG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GAAG,EAAE,CAAC,CAAC,CAAC;YAChC,GAAG,IAAI,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;YAChC,4CAA4C;YAC5C,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/escape.d.ts b/seller_1/node_modules/entities/lib/esm/escape.d.ts new file mode 100644 index 0000000..c07ecdc --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/escape.d.ts @@ -0,0 +1,43 @@ +export declare const xmlReplacer: RegExp; +export declare const getCodePoint: (str: string, index: number) => number; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export declare function encodeXML(str: string): string; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +export declare const escape: typeof encodeXML; +/** + * Encodes all characters not valid in XML documents using XML entities. + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +export declare const escapeUTF8: (data: string) => string; +/** + * Encodes all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export declare const escapeAttribute: (data: string) => string; +/** + * Encodes all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export declare const escapeText: (data: string) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/escape.d.ts.map b/seller_1/node_modules/entities/lib/esm/escape.d.ts.map new file mode 100644 index 0000000..fa19825 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAyB,CAAC;AAWlD,eAAO,MAAM,YAAY,QAGT,MAAM,SAAS,MAAM,KAAG,MAQD,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0B7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,kBAAY,CAAC;AAqChC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,SA7Bb,MAAM,KAAK,MA6BuC,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SArClB,MAAM,KAAK,MA4CpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SApDb,MAAM,KAAK,MA4DpB,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/escape.js b/seller_1/node_modules/entities/lib/esm/escape.js new file mode 100644 index 0000000..c64da6e --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/escape.js @@ -0,0 +1,116 @@ +export const xmlReplacer = /["&'<>$\x80-\uFFFF]/g; +const xmlCodeMap = new Map([ + [34, """], + [38, "&"], + [39, "'"], + [60, "<"], + [62, ">"], +]); +// For compatibility with node < 4, we wrap `codePointAt` +export const getCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition +String.prototype.codePointAt != null + ? (str, index) => str.codePointAt(index) + : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + (c, index) => (c.charCodeAt(index) & 0xfc00) === 0xd800 + ? (c.charCodeAt(index) - 0xd800) * 0x400 + + c.charCodeAt(index + 1) - + 0xdc00 + + 0x10000 + : c.charCodeAt(index); +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +export function encodeXML(str) { + let ret = ""; + let lastIdx = 0; + let match; + while ((match = xmlReplacer.exec(str)) !== null) { + const i = match.index; + const char = str.charCodeAt(i); + const next = xmlCodeMap.get(char); + if (next !== undefined) { + ret += str.substring(lastIdx, i) + next; + lastIdx = i + 1; + } + else { + ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`; + // Increase by 1 if we have a surrogate pair + lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); + } + } + return ret + str.substr(lastIdx); +} +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +export const escape = encodeXML; +/** + * Creates a function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + * + * @param regex Regular expression to match characters to escape. + * @param map Map of characters to escape to their entities. + * + * @returns Function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + */ +function getEscaper(regex, map) { + return function escape(data) { + let match; + let lastIdx = 0; + let result = ""; + while ((match = regex.exec(data))) { + if (lastIdx !== match.index) { + result += data.substring(lastIdx, match.index); + } + // We know that this character will be in the map. + result += map.get(match[0].charCodeAt(0)); + // Every match will be of length 1 + lastIdx = match.index + 1; + } + return result + data.substring(lastIdx); + }; +} +/** + * Encodes all characters not valid in XML documents using XML entities. + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +export const escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); +/** + * Encodes all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export const escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([ + [34, """], + [38, "&"], + [160, " "], +])); +/** + * Encodes all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +export const escapeText = getEscaper(/[&<>\u00A0]/g, new Map([ + [38, "&"], + [60, "<"], + [62, ">"], + [160, " "], +])); +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/escape.js.map b/seller_1/node_modules/entities/lib/esm/escape.js.map new file mode 100644 index 0000000..164301c --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAElD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACvB,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,YAAY;AACrB,uEAAuE;AACvE,MAAM,CAAC,SAAS,CAAC,WAAW,IAAI,IAAI;IAChC,CAAC,CAAC,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAE;IACjE,CAAC,CAAC,uEAAuE;QACvE,CAAC,CAAS,EAAE,KAAa,EAAU,EAAE,CACjC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,MAAM;YACrC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,KAAK;gBACtC,CAAC,CAAC,UAAU,CAAC,KAAK,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decode-data-html.d.ts b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.d.ts new file mode 100644 index 0000000..9cfc4f4 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.d.ts @@ -0,0 +1,3 @@ +declare const _default: Uint16Array; +export default _default; +//# sourceMappingURL=decode-data-html.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map new file mode 100644 index 0000000..6d4d64b --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAEA,wBAKE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js new file mode 100644 index 0000000..0791b55 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js @@ -0,0 +1,7 @@ +// Generated using scripts/write-decode-map.ts +export default new Uint16Array( +// prettier-ignore +"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c" + .split("") + .map((c) => c.charCodeAt(0))); +//# sourceMappingURL=decode-data-html.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js.map b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js.map new file mode 100644 index 0000000..c4b1e6b --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,eAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,268CAA268C;KACt68C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts new file mode 100644 index 0000000..4a3f533 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts @@ -0,0 +1,3 @@ +declare const _default: Uint16Array; +export default _default; +//# sourceMappingURL=decode-data-xml.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map new file mode 100644 index 0000000..be2a9a2 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAEA,wBAKE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js new file mode 100644 index 0000000..b01dec7 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js @@ -0,0 +1,7 @@ +// Generated using scripts/write-decode-map.ts +export default new Uint16Array( +// prettier-ignore +"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" + .split("") + .map((c) => c.charCodeAt(0))); +//# sourceMappingURL=decode-data-xml.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js.map b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js.map new file mode 100644 index 0000000..86f7150 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/decode-data-xml.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-xml.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,eAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,uFAAuF;KAClF,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts b/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts new file mode 100644 index 0000000..0704827 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts @@ -0,0 +1,8 @@ +type EncodeTrieNode = string | { + v?: string; + n: number | Map<number, EncodeTrieNode>; + o?: string; +}; +declare const _default: Map<number, EncodeTrieNode>; +export default _default; +//# sourceMappingURL=encode-html.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts.map b/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts.map new file mode 100644 index 0000000..e665a6e --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/encode-html.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GACb,MAAM,GACN;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;AAY1E,wBAAo+tB"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/encode-html.js b/seller_1/node_modules/entities/lib/esm/generated/encode-html.js new file mode 100644 index 0000000..9f1858b --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/encode-html.js @@ -0,0 +1,10 @@ +// Generated using scripts/write-encode-map.ts +function restoreDiff(arr) { + for (let i = 1; i < arr.length; i++) { + arr[i][0] += arr[i - 1][0] + 1; + } + return arr; +} +// prettier-ignore +export default new Map(/* #__PURE__ */ restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* #__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); +//# sourceMappingURL=encode-html.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/generated/encode-html.js.map b/seller_1/node_modules/entities/lib/esm/generated/encode-html.js.map new file mode 100644 index 0000000..8906ff8 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/generated/encode-html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAM9C,SAAS,WAAW,CAChB,GAAM;IAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAClC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,kBAAkB;AAClB,eAAe,IAAI,GAAG,CAAwB,eAAe,CAAA,WAAW,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,WAAW,CAAC,EAAC,CAAC,EAAE,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAA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QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,IAAI,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/index.d.ts b/seller_1/node_modules/entities/lib/esm/index.d.ts new file mode 100644 index 0000000..dd4eb11 --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/index.d.ts @@ -0,0 +1,96 @@ +import { DecodingMode } from "./decode.js"; +/** The level of entities to support. */ +export declare enum EntityLevel { + /** Support only XML entities. */ + XML = 0, + /** Support HTML entities, which are a superset of XML entities. */ + HTML = 1 +} +export declare enum EncodingMode { + /** + * The output is UTF-8 encoded. Only characters that need escaping within + * XML will be escaped. + */ + UTF8 = 0, + /** + * The output consists only of ASCII characters. Characters that need + * escaping within HTML, and characters that aren't ASCII characters will + * be escaped. + */ + ASCII = 1, + /** + * Encode all characters that have an equivalent entity, as well as all + * characters that are not ASCII characters. + */ + Extensive = 2, + /** + * Encode all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + Attribute = 3, + /** + * Encode all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + Text = 4 +} +export interface DecodingOptions { + /** + * The level of entities to support. + * @default {@link EntityLevel.XML} + */ + level?: EntityLevel; + /** + * Decoding mode. If `Legacy`, will support legacy entities not terminated + * with a semicolon (`;`). + * + * Always `Strict` for XML. For HTML, set this to `true` if you are parsing + * an attribute value. + * + * The deprecated `decodeStrict` function defaults this to `Strict`. + * + * @default {@link DecodingMode.Legacy} + */ + mode?: DecodingMode | undefined; +} +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param options Decoding options. + */ +export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param options Decoding options. + * @deprecated Use `decode` with the `mode` set to `Strict`. + */ +export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string; +/** + * Options for `encode`. + */ +export interface EncodingOptions { + /** + * The level of entities to support. + * @default {@link EntityLevel.XML} + */ + level?: EntityLevel; + /** + * Output format. + * @default {@link EncodingMode.Extensive} + */ + mode?: EncodingMode; +} +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param options Encoding options. + */ +export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string; +export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js"; +export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js"; +export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/index.d.ts.map b/seller_1/node_modules/entities/lib/esm/index.d.ts.map new file mode 100644 index 0000000..cfeef9f --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI,IAAA;IACJ;;;;OAIG;IACH,KAAK,IAAA;IACL;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,IAAI,IAAA;CACP;AAED,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAKR;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAkBR;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB,EAElB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/index.js b/seller_1/node_modules/entities/lib/esm/index.js new file mode 100644 index 0000000..acc6dbe --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/index.js @@ -0,0 +1,99 @@ +import { decodeXML, decodeHTML, DecodingMode } from "./decode.js"; +import { encodeHTML, encodeNonAsciiHTML } from "./encode.js"; +import { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js"; +/** The level of entities to support. */ +export var EntityLevel; +(function (EntityLevel) { + /** Support only XML entities. */ + EntityLevel[EntityLevel["XML"] = 0] = "XML"; + /** Support HTML entities, which are a superset of XML entities. */ + EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; +})(EntityLevel || (EntityLevel = {})); +export var EncodingMode; +(function (EncodingMode) { + /** + * The output is UTF-8 encoded. Only characters that need escaping within + * XML will be escaped. + */ + EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; + /** + * The output consists only of ASCII characters. Characters that need + * escaping within HTML, and characters that aren't ASCII characters will + * be escaped. + */ + EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; + /** + * Encode all characters that have an equivalent entity, as well as all + * characters that are not ASCII characters. + */ + EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; + /** + * Encode all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; + /** + * Encode all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Text"] = 4] = "Text"; +})(EncodingMode || (EncodingMode = {})); +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param options Decoding options. + */ +export function decode(data, options = EntityLevel.XML) { + const level = typeof options === "number" ? options : options.level; + if (level === EntityLevel.HTML) { + const mode = typeof options === "object" ? options.mode : undefined; + return decodeHTML(data, mode); + } + return decodeXML(data); +} +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param options Decoding options. + * @deprecated Use `decode` with the `mode` set to `Strict`. + */ +export function decodeStrict(data, options = EntityLevel.XML) { + var _a; + const opts = typeof options === "number" ? { level: options } : options; + (_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = DecodingMode.Strict); + return decode(data, opts); +} +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param options Encoding options. + */ +export function encode(data, options = EntityLevel.XML) { + const opts = typeof options === "number" ? { level: options } : options; + // Mode `UTF8` just escapes XML entities + if (opts.mode === EncodingMode.UTF8) + return escapeUTF8(data); + if (opts.mode === EncodingMode.Attribute) + return escapeAttribute(data); + if (opts.mode === EncodingMode.Text) + return escapeText(data); + if (opts.level === EntityLevel.HTML) { + if (opts.mode === EncodingMode.ASCII) { + return encodeNonAsciiHTML(data); + } + return encodeHTML(data); + } + // ASCII and Extensive are equivalent + return encodeXML(data); +} +export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js"; +export { encodeHTML, encodeNonAsciiHTML, +// Legacy aliases (deprecated) +encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js"; +export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, +// Legacy aliases (deprecated) +decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/index.js.map b/seller_1/node_modules/entities/lib/esm/index.js.map new file mode 100644 index 0000000..5f634fc --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACH,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,wCAAwC;AACxC,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,iCAAiC;IACjC,2CAAO,CAAA;IACP,mEAAmE;IACnE,6CAAQ,CAAA;AACZ,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACpB;;;OAGG;IACH,+CAAI,CAAA;IACJ;;;;OAIG;IACH,iDAAK,CAAA;IACL;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,+CAAI,CAAA;AACR,CAAC,EA3BW,YAAY,KAAZ,YAAY,QA2BvB;AAsBD;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAClB,IAAY,EACZ,UAAyC,WAAW,CAAC,GAAG;IAExD,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E,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;IAE7D,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,EAAE;QACjC,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,KAAK,EAAE;YAClC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACnC;QAED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;KAC3B;IAED,qCAAqC;IACrC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB;AAClB,8BAA8B;AAC9B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB;AACnB,8BAA8B;AAC9B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/esm/package.json b/seller_1/node_modules/entities/lib/esm/package.json new file mode 100644 index 0000000..089153b --- /dev/null +++ b/seller_1/node_modules/entities/lib/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts b/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts new file mode 100644 index 0000000..9cfc4f4 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts @@ -0,0 +1,3 @@ +declare const _default: Uint16Array; +export default _default; +//# sourceMappingURL=decode-data-html.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts.map b/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts.map new file mode 100644 index 0000000..6d4d64b --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-html.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAEA,wBAKE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-html.js b/seller_1/node_modules/entities/lib/generated/decode-data-html.js new file mode 100644 index 0000000..295cd9b --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-html.js @@ -0,0 +1,9 @@ +"use strict"; +// Generated using scripts/write-decode-map.ts +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new Uint16Array( +// prettier-ignore +"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c" + .split("") + .map(function (c) { return c.charCodeAt(0); })); +//# sourceMappingURL=decode-data-html.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-html.js.map b/seller_1/node_modules/entities/lib/generated/decode-data-html.js.map new file mode 100644 index 0000000..5732f6f --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,kBAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,268CAA268C;KACt68C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAf,CAAe,CAAC,CACnC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts b/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts new file mode 100644 index 0000000..4a3f533 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts @@ -0,0 +1,3 @@ +declare const _default: Uint16Array; +export default _default; +//# sourceMappingURL=decode-data-xml.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts.map b/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts.map new file mode 100644 index 0000000..be2a9a2 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-xml.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAEA,wBAKE"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-xml.js b/seller_1/node_modules/entities/lib/generated/decode-data-xml.js new file mode 100644 index 0000000..8fee783 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-xml.js @@ -0,0 +1,9 @@ +"use strict"; +// Generated using scripts/write-decode-map.ts +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new Uint16Array( +// prettier-ignore +"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" + .split("") + .map(function (c) { return c.charCodeAt(0); })); +//# sourceMappingURL=decode-data-xml.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/decode-data-xml.js.map b/seller_1/node_modules/entities/lib/generated/decode-data-xml.js.map new file mode 100644 index 0000000..569fef4 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/decode-data-xml.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decode-data-xml.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,kBAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,uFAAuF;KAClF,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAf,CAAe,CAAC,CACnC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/encode-html.d.ts b/seller_1/node_modules/entities/lib/generated/encode-html.d.ts new file mode 100644 index 0000000..0704827 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/encode-html.d.ts @@ -0,0 +1,8 @@ +type EncodeTrieNode = string | { + v?: string; + n: number | Map<number, EncodeTrieNode>; + o?: string; +}; +declare const _default: Map<number, EncodeTrieNode>; +export default _default; +//# sourceMappingURL=encode-html.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/encode-html.d.ts.map b/seller_1/node_modules/entities/lib/generated/encode-html.d.ts.map new file mode 100644 index 0000000..e665a6e --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/encode-html.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GACb,MAAM,GACN;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;AAY1E,wBAAo+tB"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/encode-html.js b/seller_1/node_modules/entities/lib/generated/encode-html.js new file mode 100644 index 0000000..071e853 --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/encode-html.js @@ -0,0 +1,12 @@ +"use strict"; +// Generated using scripts/write-encode-map.ts +Object.defineProperty(exports, "__esModule", { value: true }); +function restoreDiff(arr) { + for (var i = 1; i < arr.length; i++) { + arr[i][0] += arr[i - 1][0] + 1; + } + return arr; +} +// prettier-ignore +exports.default = new Map(/* #__PURE__ */ restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* #__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); +//# sourceMappingURL=encode-html.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/generated/encode-html.js.map b/seller_1/node_modules/entities/lib/generated/encode-html.js.map new file mode 100644 index 0000000..2d2d9be --- /dev/null +++ b/seller_1/node_modules/entities/lib/generated/encode-html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAM9C,SAAS,WAAW,CAChB,GAAM;IAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAClC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,kBAAkB;AAClB,kBAAe,IAAI,GAAG,CAAwB,eAAe,CAAA,WAAW,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,WAAW,CAAC,EAAC,CAAC,EAAE,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,OAAO,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,C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AAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,IAAI,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/index.d.ts b/seller_1/node_modules/entities/lib/index.d.ts new file mode 100644 index 0000000..dd4eb11 --- /dev/null +++ b/seller_1/node_modules/entities/lib/index.d.ts @@ -0,0 +1,96 @@ +import { DecodingMode } from "./decode.js"; +/** The level of entities to support. */ +export declare enum EntityLevel { + /** Support only XML entities. */ + XML = 0, + /** Support HTML entities, which are a superset of XML entities. */ + HTML = 1 +} +export declare enum EncodingMode { + /** + * The output is UTF-8 encoded. Only characters that need escaping within + * XML will be escaped. + */ + UTF8 = 0, + /** + * The output consists only of ASCII characters. Characters that need + * escaping within HTML, and characters that aren't ASCII characters will + * be escaped. + */ + ASCII = 1, + /** + * Encode all characters that have an equivalent entity, as well as all + * characters that are not ASCII characters. + */ + Extensive = 2, + /** + * Encode all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + Attribute = 3, + /** + * Encode all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + Text = 4 +} +export interface DecodingOptions { + /** + * The level of entities to support. + * @default {@link EntityLevel.XML} + */ + level?: EntityLevel; + /** + * Decoding mode. If `Legacy`, will support legacy entities not terminated + * with a semicolon (`;`). + * + * Always `Strict` for XML. For HTML, set this to `true` if you are parsing + * an attribute value. + * + * The deprecated `decodeStrict` function defaults this to `Strict`. + * + * @default {@link DecodingMode.Legacy} + */ + mode?: DecodingMode | undefined; +} +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param options Decoding options. + */ +export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param options Decoding options. + * @deprecated Use `decode` with the `mode` set to `Strict`. + */ +export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string; +/** + * Options for `encode`. + */ +export interface EncodingOptions { + /** + * The level of entities to support. + * @default {@link EntityLevel.XML} + */ + level?: EntityLevel; + /** + * Output format. + * @default {@link EncodingMode.Extensive} + */ + mode?: EncodingMode; +} +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param options Encoding options. + */ +export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string; +export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js"; +export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js"; +export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/index.d.ts.map b/seller_1/node_modules/entities/lib/index.d.ts.map new file mode 100644 index 0000000..cfeef9f --- /dev/null +++ b/seller_1/node_modules/entities/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI,IAAA;IACJ;;;;OAIG;IACH,KAAK,IAAA;IACL;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,IAAI,IAAA;CACP;AAED,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAKR;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAkBR;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB,EAElB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/index.js b/seller_1/node_modules/entities/lib/index.js new file mode 100644 index 0000000..f809b1b --- /dev/null +++ b/seller_1/node_modules/entities/lib/index.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0; +var decode_js_1 = require("./decode.js"); +var encode_js_1 = require("./encode.js"); +var escape_js_1 = require("./escape.js"); +/** The level of entities to support. */ +var EntityLevel; +(function (EntityLevel) { + /** Support only XML entities. */ + EntityLevel[EntityLevel["XML"] = 0] = "XML"; + /** Support HTML entities, which are a superset of XML entities. */ + EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; +})(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {})); +var EncodingMode; +(function (EncodingMode) { + /** + * The output is UTF-8 encoded. Only characters that need escaping within + * XML will be escaped. + */ + EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; + /** + * The output consists only of ASCII characters. Characters that need + * escaping within HTML, and characters that aren't ASCII characters will + * be escaped. + */ + EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; + /** + * Encode all characters that have an equivalent entity, as well as all + * characters that are not ASCII characters. + */ + EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; + /** + * Encode all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; + /** + * Encode all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Text"] = 4] = "Text"; +})(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {})); +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param options Decoding options. + */ +function decode(data, options) { + if (options === void 0) { options = EntityLevel.XML; } + var level = typeof options === "number" ? options : options.level; + if (level === EntityLevel.HTML) { + var mode = typeof options === "object" ? options.mode : undefined; + return (0, decode_js_1.decodeHTML)(data, mode); + } + return (0, decode_js_1.decodeXML)(data); +} +exports.decode = decode; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param options Decoding options. + * @deprecated Use `decode` with the `mode` set to `Strict`. + */ +function decodeStrict(data, options) { + var _a; + if (options === void 0) { options = EntityLevel.XML; } + var opts = typeof options === "number" ? { level: options } : options; + (_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = decode_js_1.DecodingMode.Strict); + return decode(data, opts); +} +exports.decodeStrict = decodeStrict; +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param options Encoding options. + */ +function encode(data, options) { + if (options === void 0) { options = EntityLevel.XML; } + var opts = typeof options === "number" ? { level: options } : options; + // Mode `UTF8` just escapes XML entities + if (opts.mode === EncodingMode.UTF8) + return (0, escape_js_1.escapeUTF8)(data); + if (opts.mode === EncodingMode.Attribute) + return (0, escape_js_1.escapeAttribute)(data); + if (opts.mode === EncodingMode.Text) + return (0, escape_js_1.escapeText)(data); + if (opts.level === EntityLevel.HTML) { + if (opts.mode === EncodingMode.ASCII) { + return (0, encode_js_1.encodeNonAsciiHTML)(data); + } + return (0, encode_js_1.encodeHTML)(data); + } + // ASCII and Extensive are equivalent + return (0, escape_js_1.encodeXML)(data); +} +exports.encode = encode; +var escape_js_2 = require("./escape.js"); +Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return escape_js_2.encodeXML; } }); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } }); +Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return escape_js_2.escapeUTF8; } }); +Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function () { return escape_js_2.escapeAttribute; } }); +Object.defineProperty(exports, "escapeText", { enumerable: true, get: function () { return escape_js_2.escapeText; } }); +var encode_js_2 = require("./encode.js"); +Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } }); +Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } }); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } }); +Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } }); +var decode_js_2 = require("./decode.js"); +Object.defineProperty(exports, "EntityDecoder", { enumerable: true, get: function () { return decode_js_2.EntityDecoder; } }); +Object.defineProperty(exports, "DecodingMode", { enumerable: true, get: function () { return decode_js_2.DecodingMode; } }); +Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_js_2.decodeXML; } }); +Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } }); +Object.defineProperty(exports, "decodeHTMLAttribute", { enumerable: true, get: function () { return decode_js_2.decodeHTMLAttribute; } }); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } }); +Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } }); +Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } }); +Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/seller_1/node_modules/entities/lib/index.js.map b/seller_1/node_modules/entities/lib/index.js.map new file mode 100644 index 0000000..2ef7751 --- /dev/null +++ b/seller_1/node_modules/entities/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yCAAkE;AAClE,yCAA6D;AAC7D,yCAKqB;AAErB,wCAAwC;AACxC,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,iCAAiC;IACjC,2CAAO,CAAA;IACP,mEAAmE;IACnE,6CAAQ,CAAA;AACZ,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACpB;;;OAGG;IACH,+CAAI,CAAA;IACJ;;;;OAIG;IACH,iDAAK,CAAA;IACL;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,+CAAI,CAAA;AACR,CAAC,EA3BW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA2BvB;AAsBD;;;;;GAKG;AACH,SAAgB,MAAM,CAClB,IAAY,EACZ,OAAwD;IAAxD,wBAAA,EAAA,UAAyC,WAAW,CAAC,GAAG;IAExD,IAAM,KAAK,GAAG,OAAO,OAAO,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,CAAC,CAAC;IACvE,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI;QAAE,OAAO,IAAA,sBAAU,EAAC,IAAI,CAAC,CAAC;IAE7D,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,EAAE;QACjC,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,KAAK,EAAE;YAClC,OAAO,IAAA,8BAAkB,EAAC,IAAI,CAAC,CAAC;SACnC;QAED,OAAO,IAAA,sBAAU,EAAC,IAAI,CAAC,CAAC;KAC3B;IAED,qCAAqC;IACrC,OAAO,IAAA,qBAAS,EAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AArBD,wBAqBC;AAED,yCAMqB;AALjB,sGAAA,SAAS,OAAA;AACT,mGAAA,MAAM,OAAA;AACN,uGAAA,UAAU,OAAA;AACV,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AAGd,yCAMqB;AALjB,uGAAA,UAAU,OAAA;AACV,+GAAA,kBAAkB,OAAA;AAClB,8BAA8B;AAC9B,wGAAA,UAAU,OAAe;AACzB,wGAAA,UAAU,OAAe;AAG7B,yCAaqB;AAZjB,0GAAA,aAAa,OAAA;AACb,yGAAA,YAAY,OAAA;AACZ,sGAAA,SAAS,OAAA;AACT,uGAAA,UAAU,OAAA;AACV,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,8BAA8B;AAC9B,wGAAA,UAAU,OAAe;AACzB,wGAAA,UAAU,OAAe;AACzB,8GAAA,gBAAgB,OAAqB;AACrC,8GAAA,gBAAgB,OAAqB;AACrC,4GAAA,SAAS,OAAmB"} \ No newline at end of file diff --git a/seller_1/node_modules/entities/package.json b/seller_1/node_modules/entities/package.json new file mode 100644 index 0000000..2e857f8 --- /dev/null +++ b/seller_1/node_modules/entities/package.json @@ -0,0 +1,90 @@ +{ + "name": "entities", + "version": "4.5.0", + "description": "Encode & decode XML and HTML entities with ease & speed", + "author": "Felix Boehm <me@feedic.com>", + "funding": "https://github.com/fb55/entities?sponsor=1", + "sideEffects": false, + "keywords": [ + "entity", + "decoding", + "encoding", + "html", + "xml", + "html entities" + ], + "directories": { + "lib": "lib/" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "module": "lib/esm/index.js", + "exports": { + ".": { + "require": "./lib/index.js", + "import": "./lib/esm/index.js" + }, + "./lib/decode.js": { + "require": "./lib/decode.js", + "import": "./lib/esm/decode.js" + }, + "./lib/escape.js": { + "require": "./lib/escape.js", + "import": "./lib/esm/escape.js" + } + }, + "files": [ + "lib/**/*" + ], + "engines": { + "node": ">=0.12" + }, + "devDependencies": { + "@types/jest": "^28.1.8", + "@types/node": "^18.15.11", + "@typescript-eslint/eslint-plugin": "^5.58.0", + "@typescript-eslint/parser": "^5.58.0", + "eslint": "^8.38.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-node": "^11.1.0", + "jest": "^28.1.3", + "prettier": "^2.8.7", + "ts-jest": "^28.0.8", + "typedoc": "^0.24.1", + "typescript": "^5.0.4" + }, + "scripts": { + "test": "npm run test:jest && npm run lint", + "test:jest": "jest", + "lint": "npm run lint:es && npm run lint:prettier", + "lint:es": "eslint .", + "lint:prettier": "npm run prettier -- --check", + "format": "npm run format:es && npm run format:prettier", + "format:es": "npm run lint:es -- --fix", + "format:prettier": "npm run prettier -- --write", + "prettier": "prettier '**/*.{ts,md,json,yml}'", + "build": "npm run build:cjs && npm run build:esm", + "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/entities/$(git rev-parse HEAD)/src/", + "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json", + "build:docs": "typedoc --hideGenerator src/index.ts", + "build:trie": "ts-node scripts/write-decode-map.ts", + "build:encode-trie": "ts-node scripts/write-encode-map.ts", + "prepare": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/fb55/entities.git" + }, + "license": "BSD-2-Clause", + "jest": { + "preset": "ts-jest", + "coverageProvider": "v8", + "moduleNameMapper": { + "^(.*)\\.js$": "$1" + } + }, + "prettier": { + "tabWidth": 4, + "proseWrap": "always" + } +} diff --git a/seller_1/node_modules/entities/readme.md b/seller_1/node_modules/entities/readme.md new file mode 100644 index 0000000..731d90c --- /dev/null +++ b/seller_1/node_modules/entities/readme.md @@ -0,0 +1,122 @@ +# entities [![NPM version](https://img.shields.io/npm/v/entities.svg)](https://npmjs.org/package/entities) [![Downloads](https://img.shields.io/npm/dm/entities.svg)](https://npmjs.org/package/entities) [![Node.js CI](https://github.com/fb55/entities/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/fb55/entities/actions/workflows/nodejs-test.yml) + +Encode & decode HTML & XML entities with ease & speed. + +## Features + +- 😇 Tried and true: `entities` is used by many popular libraries; eg. + [`htmlparser2`](https://github.com/fb55/htmlparser2), the official + [AWS SDK](https://github.com/aws/aws-sdk-js-v3) and + [`commonmark`](https://github.com/commonmark/commonmark.js) use it to + process HTML entities. +- ⚡️ Fast: `entities` is the fastest library for decoding HTML entities (as + of April 2022); see [performance](#performance). +- 🎛 Configurable: Get an output tailored for your needs. You are fine with + UTF8? That'll save you some bytes. Prefer to only have ASCII characters? We + can do that as well! + +## How to… + +### …install `entities` + + npm install entities + +### …use `entities` + +```javascript +const entities = require("entities"); + +// Encoding +entities.escapeUTF8("& ü"); // "&#38; ü" +entities.encodeXML("& ü"); // "&#38; ü" +entities.encodeHTML("& ü"); // "&#38; ü" + +// Decoding +entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '" +entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '" +``` + +## Performance + +This is how `entities` compares to other libraries on a very basic benchmark +(see `scripts/benchmark.ts`, for 10,000,000 iterations; **lower is better**): + +| Library | Version | `decode` perf | `encode` perf | `escape` perf | +| -------------- | ------- | ------------- | ------------- | ------------- | +| entities | `3.0.1` | 1.418s | 6.786s | 2.196s | +| html-entities | `2.3.2` | 2.530s | 6.829s | 2.415s | +| he | `1.2.0` | 5.800s | 24.237s | 3.624s | +| parse-entities | `3.0.0` | 9.660s | N/A | N/A | + +--- + +## FAQ + +> What methods should I actually use to encode my documents? + +If your target supports UTF-8, the `escapeUTF8` method is going to be your best +choice. Otherwise, use either `encodeHTML` or `encodeXML` based on whether +you're dealing with an HTML or an XML document. + +You can have a look at the options for the `encode` and `decode` methods to see +everything you can configure. + +> When should I use strict decoding? + +When strict decoding, entities not terminated with a semicolon will be ignored. +This is helpful for decoding entities in legacy environments. + +> Why should I use `entities` instead of alternative modules? + +As of April 2022, `entities` is a bit faster than other modules. Still, this is +not a very differentiated space and other modules can catch up. + +**More importantly**, you might already have `entities` in your dependency graph +(as a dependency of eg. `cheerio`, or `htmlparser2`), and including it directly +might not even increase your bundle size. The same is true for other entity +libraries, so have a look through your `node_modules` directory! + +> Does `entities` support tree shaking? + +Yes! `entities` ships as both a CommonJS and a ES module. Note that for best +results, you should not use the `encode` and `decode` functions, as they wrap +around a number of other functions, all of which will remain in the bundle. +Instead, use the functions that you need directly. + +--- + +## Acknowledgements + +This library wouldn't be possible without the work of these individuals. Thanks +to + +- [@mathiasbynens](https://github.com/mathiasbynens) for his explanations + about character encodings, and his library `he`, which was one of the + inspirations for `entities` +- [@inikulin](https://github.com/inikulin) for his work on optimized tries for + decoding HTML entities for the `parse5` project +- [@mdevils](https://github.com/mdevils) for taking on the challenge of + producing a quick entity library with his `html-entities` library. + `entities` would be quite a bit slower if there wasn't any competition. + Right now `entities` is on top, but we'll see how long that lasts! + +--- + +License: BSD-2-Clause + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). Tidelift will +coordinate the fix and disclosure. + +## `entities` for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of `entities` and thousands of other packages are working with +Tidelift to deliver commercial support and maintenance for the open source +dependencies you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact dependencies you +use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/seller_1/node_modules/esbuild/LICENSE.md b/seller_1/node_modules/esbuild/LICENSE.md new file mode 100644 index 0000000..2027e8d --- /dev/null +++ b/seller_1/node_modules/esbuild/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/seller_1/node_modules/esbuild/README.md b/seller_1/node_modules/esbuild/README.md new file mode 100644 index 0000000..93863d1 --- /dev/null +++ b/seller_1/node_modules/esbuild/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/seller_1/node_modules/esbuild/bin/esbuild b/seller_1/node_modules/esbuild/bin/esbuild new file mode 100644 index 0000000..06f4563 --- /dev/null +++ b/seller_1/node_modules/esbuild/bin/esbuild @@ -0,0 +1,221 @@ +#!/usr/bin/env node +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM2 = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM2 = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM: isWASM2 }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform(); + let binPath2; + try { + binPath2 = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath2 = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath2)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath2)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.24.0"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath2, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM: isWASM2 }; + } + } + return { binPath: binPath2, isWASM: isWASM2 }; +} + +// lib/npm/node-shim.ts +var { binPath, isWASM } = generateBinPath(); +if (isWASM) { + require("child_process").execFileSync("node", [binPath].concat(process.argv.slice(2)), { stdio: "inherit" }); +} else { + require("child_process").execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" }); +} diff --git a/seller_1/node_modules/esbuild/install.js b/seller_1/node_modules/esbuild/install.js new file mode 100644 index 0000000..86b6c43 --- /dev/null +++ b/seller_1/node_modules/esbuild/install.js @@ -0,0 +1,286 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} + +// lib/npm/node-install.ts +var fs2 = require("fs"); +var os2 = require("os"); +var path2 = require("path"); +var zlib = require("zlib"); +var https = require("https"); +var child_process = require("child_process"); +var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; +var toPath = path2.join(__dirname, "bin", "esbuild"); +var isToPathJS = true; +function validateBinaryVersion(...command) { + command.push("--version"); + let stdout; + try { + stdout = child_process.execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe" + }).toString().trim(); + } catch (err) { + if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { + let os3 = "this version of macOS"; + try { + os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); + } catch { + } + throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. + +The Go compiler (which esbuild relies on) no longer supports ${os3}, +which means the "esbuild" binary executable can't be run. You can either: + + * Update your version of macOS to one that the Go compiler supports + * Use the "esbuild-wasm" package instead of the "esbuild" package + * Build esbuild yourself using an older version of the Go compiler +`); + } + throw err; + } + if (stdout !== versionFromPackageJSON) { + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); + } +} +function isYarn() { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} +function fetch(url) { + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => resolve(Buffer.concat(chunks))); + }).on("error", reject); + }); +} +function extractFileFromTarGzip(buffer, subpath) { + try { + buffer = zlib.unzipSync(buffer); + } catch (err) { + throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); + } + let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += size + 511 & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} +function installUsingNPM(pkg, subpath, binPath) { + const env = { ...process.env, npm_config_global: void 0 }; + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + const installDir = path2.join(esbuildLibDir, "npm-install"); + fs2.mkdirSync(installDir); + try { + fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, + { cwd: installDir, stdio: "pipe", env } + ); + const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); + fs2.renameSync(installedBinPath, binPath); + } finally { + try { + removeRecursive(installDir); + } catch { + } + } +} +function removeRecursive(dir) { + for (const entry of fs2.readdirSync(dir)) { + const entryPath = path2.join(dir, entry); + let stats; + try { + stats = fs2.lstatSync(entryPath); + } catch { + continue; + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs2.unlinkSync(entryPath); + } + fs2.rmdirSync(dir); +} +function applyManualBinaryPathOverride(overridePath) { + const pathString = JSON.stringify(overridePath); + fs2.writeFileSync(toPath, `#!/usr/bin/env node +require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); +`); + const libMain = path2.join(__dirname, "lib", "main.js"); + const code = fs2.readFileSync(libMain, "utf8"); + fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; +${code}`); +} +function maybeOptimizePackage(binPath) { + if (os2.platform() !== "win32" && !isYarn()) { + const tempPath = path2.join(__dirname, "bin-esbuild"); + try { + fs2.linkSync(binPath, tempPath); + fs2.renameSync(tempPath, toPath); + isToPathJS = false; + fs2.unlinkSync(tempPath); + } catch { + } + } +} +async function downloadDirectlyFromNPM(pkg, subpath, binPath) { + const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; + console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); + try { + fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); + fs2.chmodSync(binPath, 493); + } catch (e) { + console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); + throw e; + } +} +async function checkAndPreparePackage() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); + return; + } + } + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[esbuild] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by esbuild to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use esbuild. +`); + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[esbuild] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2) { + console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + maybeOptimizePackage(binPath); +} +checkAndPreparePackage().then(() => { + if (isToPathJS) { + validateBinaryVersion(process.execPath, toPath); + } else { + validateBinaryVersion(toPath); + } +}); diff --git a/seller_1/node_modules/esbuild/lib/main.d.ts b/seller_1/node_modules/esbuild/lib/main.d.ts new file mode 100644 index 0000000..c705307 --- /dev/null +++ b/seller_1/node_modules/esbuild/lib/main.d.ts @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record<string, boolean> + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record<string, string | false> + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record<string, LogLevel> + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record<string, string[]> + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record<string, string> + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record<string, string> | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise<void>) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise<ResolveResult> + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise<OnEndResult | null | void>)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record<string, string> +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record<string, string> +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record<string, string> +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial<Location> | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial<Location> | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record<string, string> + }[] + format?: 'cjs' | 'esm' + with?: Record<string, string> + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise<BuildResult<ProvidedOptions>> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise<void> + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise<ServeResult> + + cancel(): Promise<void> + dispose(): Promise<void> +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]> + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string> + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T> + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T> + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise<void> + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise<void> + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/seller_1/node_modules/esbuild/lib/main.js b/seller_1/node_modules/esbuild/lib/main.js new file mode 100644 index 0000000..a2a6591 --- /dev/null +++ b/seller_1/node_modules/esbuild/lib/main.js @@ -0,0 +1,2244 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.24.0") { + throw new Error(`Cannot start service: Host version "${"0.24.0"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.24.0"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; +} + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // <v12.17.0 does not work + +major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13 + ) { + worker_threads = void 0; + } +} +var _a; +var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.24.0"; +var esbuildCommandAndArgs = () => { + if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.24.0"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.24.0"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.0"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.24.0" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/seller_1/node_modules/esbuild/package.json b/seller_1/node_modules/esbuild/package.json new file mode 100644 index 0000000..720860f --- /dev/null +++ b/seller_1/node_modules/esbuild/package.json @@ -0,0 +1,47 @@ +{ + "name": "esbuild", + "version": "0.24.0", + "description": "An extremely fast JavaScript and CSS bundler and minifier.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "scripts": { + "postinstall": "node install.js" + }, + "main": "lib/main.js", + "types": "lib/main.d.ts", + "engines": { + "node": ">=18" + }, + "bin": { + "esbuild": "bin/esbuild" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" + }, + "license": "MIT" +} diff --git a/seller_1/node_modules/estree-walker/CHANGELOG.md b/seller_1/node_modules/estree-walker/CHANGELOG.md new file mode 100644 index 0000000..20e8c7e --- /dev/null +++ b/seller_1/node_modules/estree-walker/CHANGELOG.md @@ -0,0 +1,92 @@ +# changelog + +## 2.0.2 + +* Internal tidying up (change test runner, convert to JS) + +## 2.0.1 + +* Robustify `this.remove()`, pass current index to walker functions ([#18](https://github.com/Rich-Harris/estree-walker/pull/18)) + +## 2.0.0 + +* Add an `asyncWalk` export ([#20](https://github.com/Rich-Harris/estree-walker/pull/20)) +* Internal rewrite + +## 1.0.1 + +* Relax node type to `BaseNode` ([#17](https://github.com/Rich-Harris/estree-walker/pull/17)) + +## 1.0.0 + +* Don't cache child keys + +## 0.9.0 + +* Add `this.remove()` method + +## 0.8.1 + +* Fix pkg.files + +## 0.8.0 + +* Adopt `estree` types + +## 0.7.0 + +* Add a `this.replace(node)` method + +## 0.6.1 + +* Only traverse nodes that exist and have a type ([#9](https://github.com/Rich-Harris/estree-walker/pull/9)) +* Only cache keys for nodes with a type ([#8](https://github.com/Rich-Harris/estree-walker/pull/8)) + +## 0.6.0 + +* Fix walker context type +* Update deps, remove unncessary Bublé transformation + +## 0.5.2 + +* Add types to package + +## 0.5.1 + +* Prevent context corruption when `walk()` is called during a walk + +## 0.5.0 + +* Export `childKeys`, for manually fixing in case of malformed ASTs + +## 0.4.0 + +* Add TypeScript typings ([#3](https://github.com/Rich-Harris/estree-walker/pull/3)) + +## 0.3.1 + +* Include `pkg.repository` ([#2](https://github.com/Rich-Harris/estree-walker/pull/2)) + +## 0.3.0 + +* More predictable ordering + +## 0.2.1 + +* Keep `context` shape + +## 0.2.0 + +* Add ES6 build + +## 0.1.3 + +* npm snafu + +## 0.1.2 + +* Pass current prop and index to `enter`/`leave` callbacks + +## 0.1.1 + +* First release diff --git a/seller_1/node_modules/estree-walker/LICENSE b/seller_1/node_modules/estree-walker/LICENSE new file mode 100644 index 0000000..63b6209 --- /dev/null +++ b/seller_1/node_modules/estree-walker/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2015-20 [these people](https://github.com/Rich-Harris/estree-walker/graphs/contributors) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/seller_1/node_modules/estree-walker/README.md b/seller_1/node_modules/estree-walker/README.md new file mode 100644 index 0000000..d877af3 --- /dev/null +++ b/seller_1/node_modules/estree-walker/README.md @@ -0,0 +1,48 @@ +# estree-walker + +Simple utility for walking an [ESTree](https://github.com/estree/estree)-compliant AST, such as one generated by [acorn](https://github.com/marijnh/acorn). + + +## Installation + +```bash +npm i estree-walker +``` + + +## Usage + +```js +var walk = require( 'estree-walker' ).walk; +var acorn = require( 'acorn' ); + +ast = acorn.parse( sourceCode, options ); // https://github.com/acornjs/acorn + +walk( ast, { + enter: function ( node, parent, prop, index ) { + // some code happens + }, + leave: function ( node, parent, prop, index ) { + // some code happens + } +}); +``` + +Inside the `enter` function, calling `this.skip()` will prevent the node's children being walked, or the `leave` function (which is optional) being called. + +Call `this.replace(new_node)` in either `enter` or `leave` to replace the current node with a new one. + +Call `this.remove()` in either `enter` or `leave` to remove the current node. + +## Why not use estraverse? + +The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where [estraverse](https://github.com/estools/estraverse) was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys. + +estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.) + +None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful. + + +## License + +MIT diff --git a/seller_1/node_modules/estree-walker/dist/esm/estree-walker.js b/seller_1/node_modules/estree-walker/dist/esm/estree-walker.js new file mode 100644 index 0000000..a0beeeb --- /dev/null +++ b/seller_1/node_modules/estree-walker/dist/esm/estree-walker.js @@ -0,0 +1,333 @@ +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +} + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +class SyncWalker extends WalkerBase { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +} + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => Promise<void>} AsyncHandler */ + +class AsyncWalker extends WalkerBase { + /** + * + * @param {AsyncHandler} enter + * @param {AsyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {AsyncHandler} */ + this.enter = enter; + + /** @type {AsyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {Promise<BaseNode>} + */ + async visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + await this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!(await this.visit(value[i], node, key, i))) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + await this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + await this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +} + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +function walk(ast, { enter, leave }) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); +} + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: AsyncHandler + * leave?: AsyncHandler + * }} walker + * @returns {Promise<BaseNode>} + */ +async function asyncWalk(ast, { enter, leave }) { + const instance = new AsyncWalker(enter, leave); + return await instance.visit(ast, null); +} + +export { asyncWalk, walk }; diff --git a/seller_1/node_modules/estree-walker/dist/esm/package.json b/seller_1/node_modules/estree-walker/dist/esm/package.json new file mode 100644 index 0000000..7c34deb --- /dev/null +++ b/seller_1/node_modules/estree-walker/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/seller_1/node_modules/estree-walker/dist/umd/estree-walker.js b/seller_1/node_modules/estree-walker/dist/umd/estree-walker.js new file mode 100644 index 0000000..46fed0f --- /dev/null +++ b/seller_1/node_modules/estree-walker/dist/umd/estree-walker.js @@ -0,0 +1,344 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.estreeWalker = {})); +}(this, (function (exports) { 'use strict'; + + // @ts-check + /** @typedef { import('estree').BaseNode} BaseNode */ + + /** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; + }} WalkerContext */ + + class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } + } + + // @ts-check + + /** @typedef { import('estree').BaseNode} BaseNode */ + /** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + + /** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + + class SyncWalker extends WalkerBase { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } + } + + // @ts-check + + /** @typedef { import('estree').BaseNode} BaseNode */ + /** @typedef { import('./walker').WalkerContext} WalkerContext */ + + /** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => Promise<void>} AsyncHandler */ + + class AsyncWalker extends WalkerBase { + /** + * + * @param {AsyncHandler} enter + * @param {AsyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {AsyncHandler} */ + this.enter = enter; + + /** @type {AsyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {Promise<BaseNode>} + */ + async visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + await this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!(await this.visit(value[i], node, key, i))) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + await this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + await this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } + } + + // @ts-check + + /** @typedef { import('estree').BaseNode} BaseNode */ + /** @typedef { import('./sync.js').SyncHandler} SyncHandler */ + /** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + + /** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ + function walk(ast, { enter, leave }) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); + } + + /** + * + * @param {BaseNode} ast + * @param {{ + * enter?: AsyncHandler + * leave?: AsyncHandler + * }} walker + * @returns {Promise<BaseNode>} + */ + async function asyncWalk(ast, { enter, leave }) { + const instance = new AsyncWalker(enter, leave); + return await instance.visit(ast, null); + } + + exports.asyncWalk = asyncWalk; + exports.walk = walk; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/seller_1/node_modules/estree-walker/package.json b/seller_1/node_modules/estree-walker/package.json new file mode 100644 index 0000000..f646eb5 --- /dev/null +++ b/seller_1/node_modules/estree-walker/package.json @@ -0,0 +1,37 @@ +{ + "name": "estree-walker", + "description": "Traverse an ESTree-compliant AST", + "version": "2.0.2", + "private": false, + "author": "Rich Harris", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/Rich-Harris/estree-walker" + }, + "type": "commonjs", + "main": "./dist/umd/estree-walker.js", + "module": "./dist/esm/estree-walker.js", + "exports": { + "require": "./dist/umd/estree-walker.js", + "import": "./dist/esm/estree-walker.js" + }, + "types": "types/index.d.ts", + "scripts": { + "prepublishOnly": "npm run build && npm test", + "build": "tsc && rollup -c", + "test": "uvu test" + }, + "devDependencies": { + "@types/estree": "0.0.42", + "rollup": "^2.10.9", + "typescript": "^3.7.5", + "uvu": "^0.5.1" + }, + "files": [ + "src", + "dist", + "types", + "README.md" + ] +} diff --git a/seller_1/node_modules/estree-walker/src/async.js b/seller_1/node_modules/estree-walker/src/async.js new file mode 100644 index 0000000..54276b5 --- /dev/null +++ b/seller_1/node_modules/estree-walker/src/async.js @@ -0,0 +1,118 @@ +// @ts-check +import { WalkerBase } from './walker.js'; + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => Promise<void>} AsyncHandler */ + +export class AsyncWalker extends WalkerBase { + /** + * + * @param {AsyncHandler} enter + * @param {AsyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {AsyncHandler} */ + this.enter = enter; + + /** @type {AsyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {Promise<BaseNode>} + */ + async visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + await this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!(await this.visit(value[i], node, key, i))) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + await this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + await this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +} diff --git a/seller_1/node_modules/estree-walker/src/index.js b/seller_1/node_modules/estree-walker/src/index.js new file mode 100644 index 0000000..dcf4c72 --- /dev/null +++ b/seller_1/node_modules/estree-walker/src/index.js @@ -0,0 +1,35 @@ +// @ts-check +import { SyncWalker } from './sync.js'; +import { AsyncWalker } from './async.js'; + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +export function walk(ast, { enter, leave }) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); +} + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: AsyncHandler + * leave?: AsyncHandler + * }} walker + * @returns {Promise<BaseNode>} + */ +export async function asyncWalk(ast, { enter, leave }) { + const instance = new AsyncWalker(enter, leave); + return await instance.visit(ast, null); +} diff --git a/seller_1/node_modules/estree-walker/src/package.json b/seller_1/node_modules/estree-walker/src/package.json new file mode 100644 index 0000000..1632c2c --- /dev/null +++ b/seller_1/node_modules/estree-walker/src/package.json @@ -0,0 +1 @@ +{"type": "module"} \ No newline at end of file diff --git a/seller_1/node_modules/estree-walker/src/sync.js b/seller_1/node_modules/estree-walker/src/sync.js new file mode 100644 index 0000000..b3cea40 --- /dev/null +++ b/seller_1/node_modules/estree-walker/src/sync.js @@ -0,0 +1,118 @@ +// @ts-check +import { WalkerBase } from './walker.js'; + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +export class SyncWalker extends WalkerBase { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +} diff --git a/seller_1/node_modules/estree-walker/src/walker.js b/seller_1/node_modules/estree-walker/src/walker.js new file mode 100644 index 0000000..3555d88 --- /dev/null +++ b/seller_1/node_modules/estree-walker/src/walker.js @@ -0,0 +1,61 @@ +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +export class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +} diff --git a/seller_1/node_modules/estree-walker/types/async.d.ts b/seller_1/node_modules/estree-walker/types/async.d.ts new file mode 100644 index 0000000..c85bfdc --- /dev/null +++ b/seller_1/node_modules/estree-walker/types/async.d.ts @@ -0,0 +1,53 @@ +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker').WalkerContext} WalkerContext */ +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => Promise<void>} AsyncHandler */ +export class AsyncWalker extends WalkerBase { + /** + * + * @param {AsyncHandler} enter + * @param {AsyncHandler} leave + */ + constructor(enter: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>, leave: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>); + /** @type {AsyncHandler} */ + enter: AsyncHandler; + /** @type {AsyncHandler} */ + leave: AsyncHandler; + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {Promise<BaseNode>} + */ + visit(node: import("estree").BaseNode, parent: import("estree").BaseNode, prop?: string, index?: number): Promise<import("estree").BaseNode>; + should_skip: any; + should_remove: any; + replacement: any; +} +export type BaseNode = import("estree").BaseNode; +export type WalkerContext = { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}; +export type AsyncHandler = (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>; +import { WalkerBase } from "./walker.js"; diff --git a/seller_1/node_modules/estree-walker/types/index.d.ts b/seller_1/node_modules/estree-walker/types/index.d.ts new file mode 100644 index 0000000..dfc3277 --- /dev/null +++ b/seller_1/node_modules/estree-walker/types/index.d.ts @@ -0,0 +1,56 @@ +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +export function walk(ast: import("estree").BaseNode, { enter, leave }: { + enter?: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void; + leave?: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void; +}): import("estree").BaseNode; +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: AsyncHandler + * leave?: AsyncHandler + * }} walker + * @returns {Promise<BaseNode>} + */ +export function asyncWalk(ast: import("estree").BaseNode, { enter, leave }: { + enter?: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>; + leave?: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>; +}): Promise<import("estree").BaseNode>; +export type BaseNode = import("estree").BaseNode; +export type SyncHandler = (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void; +export type AsyncHandler = (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>; diff --git a/seller_1/node_modules/estree-walker/types/sync.d.ts b/seller_1/node_modules/estree-walker/types/sync.d.ts new file mode 100644 index 0000000..e9e4cc1 --- /dev/null +++ b/seller_1/node_modules/estree-walker/types/sync.d.ts @@ -0,0 +1,53 @@ +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ +export class SyncWalker extends WalkerBase { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void, leave: (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; + }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void); + /** @type {SyncHandler} */ + enter: SyncHandler; + /** @type {SyncHandler} */ + leave: SyncHandler; + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node: import("estree").BaseNode, parent: import("estree").BaseNode, prop?: string, index?: number): import("estree").BaseNode; + should_skip: any; + should_remove: any; + replacement: any; +} +export type BaseNode = import("estree").BaseNode; +export type WalkerContext = { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}; +export type SyncHandler = (this: { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void; +import { WalkerBase } from "./walker.js"; diff --git a/seller_1/node_modules/estree-walker/types/tsconfig.tsbuildinfo b/seller_1/node_modules/estree-walker/types/tsconfig.tsbuildinfo new file mode 100644 index 0000000..799022f --- /dev/null +++ b/seller_1/node_modules/estree-walker/types/tsconfig.tsbuildinfo @@ -0,0 +1,345 @@ +{ + "program": { + "fileInfos": { + "../node_modules/typescript/lib/lib.es5.d.ts": { + "version": "fc43680ad3a1a4ec8c7b8d908af1ec9ddff87845346de5f02c735c9171fa98ea", + "signature": "fc43680ad3a1a4ec8c7b8d908af1ec9ddff87845346de5f02c735c9171fa98ea" + }, + "../node_modules/typescript/lib/lib.es2015.d.ts": { + "version": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96", + "signature": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96" + }, + "../node_modules/typescript/lib/lib.es2016.d.ts": { + "version": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1", + "signature": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1" + }, + "../node_modules/typescript/lib/lib.es2017.d.ts": { + "version": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743", + "signature": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743" + }, + "../node_modules/typescript/lib/lib.dom.d.ts": { + "version": "d93de5e8a7275cb9d47481410e13b3b1debb997e216490954b5d106e37e086de", + "signature": "d93de5e8a7275cb9d47481410e13b3b1debb997e216490954b5d106e37e086de" + }, + "../node_modules/typescript/lib/lib.dom.iterable.d.ts": { + "version": "8329c3401aa8708426c7760f14219170f69a2cb77e4519758cec6f5027270faf", + "signature": "8329c3401aa8708426c7760f14219170f69a2cb77e4519758cec6f5027270faf" + }, + "../node_modules/typescript/lib/lib.webworker.importscripts.d.ts": { + "version": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b", + "signature": "fe4e59403e34c7ff747abe4ff6abbc7718229556d7c1a5b93473fb53156c913b" + }, + "../node_modules/typescript/lib/lib.scripthost.d.ts": { + "version": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9", + "signature": "b9faa17292f17d2ad75e34fac77dd63a6403af1dba02d39cd0cbb9ffdf3de8b9" + }, + "../node_modules/typescript/lib/lib.es2015.core.d.ts": { + "version": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6", + "signature": "734ddc145e147fbcd55f07d034f50ccff1086f5a880107665ec326fb368876f6" + }, + "../node_modules/typescript/lib/lib.es2015.collection.d.ts": { + "version": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8", + "signature": "4a0862a21f4700de873db3b916f70e41570e2f558da77d2087c9490f5a0615d8" + }, + "../node_modules/typescript/lib/lib.es2015.generator.d.ts": { + "version": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122", + "signature": "765e0e9c9d74cf4d031ca8b0bdb269a853e7d81eda6354c8510218d03db12122" + }, + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts": { + "version": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210", + "signature": "285958e7699f1babd76d595830207f18d719662a0c30fac7baca7df7162a9210" + }, + "../node_modules/typescript/lib/lib.es2015.promise.d.ts": { + "version": "d4deaafbb18680e3143e8b471acd650ed6f72a408a33137f0a0dd104fbe7f8ca", + "signature": "d4deaafbb18680e3143e8b471acd650ed6f72a408a33137f0a0dd104fbe7f8ca" + }, + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts": { + "version": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe", + "signature": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe" + }, + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts": { + "version": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976", + "signature": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976" + }, + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts": { + "version": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230", + "signature": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230" + }, + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { + "version": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303", + "signature": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303" + }, + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts": { + "version": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0", + "signature": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0" + }, + "../node_modules/typescript/lib/lib.es2017.object.d.ts": { + "version": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408", + "signature": "c2d60b2e558d44384e4704b00e6b3d154334721a911f094d3133c35f0917b408" + }, + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { + "version": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f", + "signature": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f" + }, + "../node_modules/typescript/lib/lib.es2017.string.d.ts": { + "version": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c", + "signature": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c" + }, + "../node_modules/typescript/lib/lib.es2017.intl.d.ts": { + "version": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6", + "signature": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6" + }, + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { + "version": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46", + "signature": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46" + }, + "../node_modules/typescript/lib/lib.es2017.full.d.ts": { + "version": "873c09f1c309389742d98b7b67419a8e0a5fa6f10ce59fd5149ecd31a2818594", + "signature": "873c09f1c309389742d98b7b67419a8e0a5fa6f10ce59fd5149ecd31a2818594" + }, + "../node_modules/@types/estree/index.d.ts": { + "version": "c2efad8a2f2d7fb931ff15c7959fb45340e74684cd665ddf0cbf9b3977be1644", + "signature": "c2efad8a2f2d7fb931ff15c7959fb45340e74684cd665ddf0cbf9b3977be1644" + }, + "../src/walker.js": { + "version": "4cc9d0e334d83a4cebeeac502de37a1aeeb953f6d4145a886d9eecea1f2142a7", + "signature": "075872468ccc19c83b03fd717fc9305b5f8ec09592210cf60279cb13eca2bd70" + }, + "../src/async.js": { + "version": "904efd145090ac40c3c98f29cc928332898a62ab642dd5921db2ae249bfe014a", + "signature": "da428f781d6dc6dfd4f4afd0dd5f25a780897dc8b57e5b30462491b7d08f32c0" + }, + "../src/sync.js": { + "version": "85bb22b85042f0a3717d8fac2fc8f62af16894652be34d1e08eb3e63785535f5", + "signature": "5b131a727db18c956611a5e33d08217df96d0f2e0f26d98b804d1ec2407e59ae" + }, + "../src/index.js": { + "version": "99128f4c6cb79cb1e3abf3f2ba96faedd2b820aab4fd7f743aab0b8d710a73af", + "signature": "c52be5c79280bfcfcf359c084c6f2f70f405b0ad14dde96b6703dbc5ef2261f5" + } + }, + "options": { + "allowJs": true, + "target": 4, + "module": 99, + "types": [ + "estree" + ], + "declaration": true, + "declarationDir": "./", + "emitDeclarationOnly": true, + "outDir": "./", + "newLine": 1, + "noImplicitAny": true, + "noImplicitThis": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/walker.js": [ + "../node_modules/@types/estree/index.d.ts" + ], + "../src/async.js": [ + "../src/walker.js", + "../node_modules/@types/estree/index.d.ts" + ], + "../src/sync.js": [ + "../src/walker.js", + "../node_modules/@types/estree/index.d.ts" + ], + "../src/index.js": [ + "../src/sync.js", + "../src/async.js", + "../node_modules/@types/estree/index.d.ts" + ] + }, + "exportedModulesMap": { + "../src/walker.js": [ + "../node_modules/@types/estree/index.d.ts" + ], + "../src/async.js": [ + "../node_modules/@types/estree/index.d.ts" + ], + "../src/sync.js": [ + "../node_modules/@types/estree/index.d.ts" + ], + "../src/index.js": [ + "../node_modules/@types/estree/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../node_modules/typescript/lib/lib.es5.d.ts", + "../node_modules/typescript/lib/lib.es2015.d.ts", + "../node_modules/typescript/lib/lib.es2016.d.ts", + "../node_modules/typescript/lib/lib.es2017.d.ts", + "../node_modules/typescript/lib/lib.dom.d.ts", + "../node_modules/typescript/lib/lib.dom.iterable.d.ts", + "../node_modules/typescript/lib/lib.webworker.importscripts.d.ts", + "../node_modules/typescript/lib/lib.scripthost.d.ts", + "../node_modules/typescript/lib/lib.es2015.core.d.ts", + "../node_modules/typescript/lib/lib.es2015.collection.d.ts", + "../node_modules/typescript/lib/lib.es2015.generator.d.ts", + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts", + "../node_modules/typescript/lib/lib.es2015.promise.d.ts", + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts", + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts", + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts", + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts", + "../node_modules/typescript/lib/lib.es2017.object.d.ts", + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", + "../node_modules/typescript/lib/lib.es2017.string.d.ts", + "../node_modules/typescript/lib/lib.es2017.intl.d.ts", + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", + "../node_modules/typescript/lib/lib.es2017.full.d.ts", + "../node_modules/@types/estree/index.d.ts", + "../src/walker.js", + [ + "../src/async.js", + [ + { + "file": "../src/async.js", + "start": 864, + "length": 12, + "messageText": "'_should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 907, + "length": 14, + "messageText": "'_should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 954, + "length": 12, + "messageText": "'_replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 991, + "length": 24, + "messageText": "'should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 1021, + "length": 26, + "messageText": "'should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 1053, + "length": 23, + "messageText": "'replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/async.js", + "start": 1643, + "length": 9, + "code": 7053, + "category": 1, + "messageText": { + "messageText": "Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'BaseNode'.", + "category": 1, + "code": 7053, + "next": [ + { + "messageText": "No index signature with a parameter of type 'string' was found on type 'BaseNode'.", + "category": 1, + "code": 7054 + } + ] + } + } + ] + ], + [ + "../src/sync.js", + [ + { + "file": "../src/sync.js", + "start": 837, + "length": 12, + "messageText": "'_should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 880, + "length": 14, + "messageText": "'_should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 927, + "length": 12, + "messageText": "'_replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 964, + "length": 24, + "messageText": "'should_skip' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 994, + "length": 26, + "messageText": "'should_remove' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 1026, + "length": 23, + "messageText": "'replacement' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", + "category": 1, + "code": 7022 + }, + { + "file": "../src/sync.js", + "start": 1610, + "length": 9, + "code": 7053, + "category": 1, + "messageText": { + "messageText": "Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'BaseNode'.", + "category": 1, + "code": 7053, + "next": [ + { + "messageText": "No index signature with a parameter of type 'string' was found on type 'BaseNode'.", + "category": 1, + "code": 7054 + } + ] + } + } + ] + ], + "../src/index.js" + ] + }, + "version": "3.7.5" +} \ No newline at end of file diff --git a/seller_1/node_modules/estree-walker/types/walker.d.ts b/seller_1/node_modules/estree-walker/types/walker.d.ts new file mode 100644 index 0000000..49d8441 --- /dev/null +++ b/seller_1/node_modules/estree-walker/types/walker.d.ts @@ -0,0 +1,37 @@ +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ +export class WalkerBase { + /** @type {boolean} */ + should_skip: boolean; + /** @type {boolean} */ + should_remove: boolean; + /** @type {BaseNode | null} */ + replacement: BaseNode | null; + /** @type {WalkerContext} */ + context: WalkerContext; + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent: any, prop: string, index: number, node: import("estree").BaseNode): void; + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent: any, prop: string, index: number): void; +} +export type BaseNode = import("estree").BaseNode; +export type WalkerContext = { + skip: () => void; + remove: () => void; + replace: (node: import("estree").BaseNode) => void; +}; diff --git a/seller_1/node_modules/magic-string/LICENSE b/seller_1/node_modules/magic-string/LICENSE new file mode 100644 index 0000000..667e8b4 --- /dev/null +++ b/seller_1/node_modules/magic-string/LICENSE @@ -0,0 +1,7 @@ +Copyright 2018 Rich Harris + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/magic-string/README.md b/seller_1/node_modules/magic-string/README.md new file mode 100644 index 0000000..fa4c4f9 --- /dev/null +++ b/seller_1/node_modules/magic-string/README.md @@ -0,0 +1,304 @@ +# magic-string + +<a href="https://github.com/Rich-Harris/magic-string/actions/workflows/test.yml"> + <img src="https://img.shields.io/github/actions/workflow/status/Rich-Harris/magic-string/test.yml" + alt="build status"> +</a> +<a href="https://npmjs.org/package/magic-string"> + <img src="https://img.shields.io/npm/v/magic-string.svg" + alt="npm version"> +</a> +<a href="https://github.com/Rich-Harris/magic-string/blob/master/LICENSE.md"> + <img src="https://img.shields.io/npm/l/magic-string.svg" + alt="license"> +</a> + +Suppose you have some source code. You want to make some light modifications to it - replacing a few characters here and there, wrapping it with a header and footer, etc - and ideally you'd like to generate a [source map](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/) at the end of it. You've thought about using something like [recast](https://github.com/benjamn/recast) (which allows you to generate an AST from some JavaScript, manipulate it, and reprint it with a sourcemap without losing your comments and formatting), but it seems like overkill for your needs (or maybe the source code isn't JavaScript). + +Your requirements are, frankly, rather niche. But they're requirements that I also have, and for which I made magic-string. It's a small, fast utility for manipulating strings and generating sourcemaps. + +## Installation + +magic-string works in both node.js and browser environments. For node, install with npm: + +```bash +npm i magic-string +``` + +To use in browser, grab the [magic-string.umd.js](https://unpkg.com/magic-string/dist/magic-string.umd.js) file and add it to your page: + +```html +<script src='magic-string.umd.js'></script> +``` + +(It also works with various module systems, if you prefer that sort of thing - it has a dependency on [vlq](https://github.com/Rich-Harris/vlq).) + +## Usage + +These examples assume you're in node.js, or something similar: + +```js +import MagicString from 'magic-string'; +import fs from 'fs' + +const s = new MagicString('problems = 99'); + +s.update(0, 8, 'answer'); +s.toString(); // 'answer = 99' + +s.update(11, 13, '42'); // character indices always refer to the original string +s.toString(); // 'answer = 42' + +s.prepend('var ').append(';'); // most methods are chainable +s.toString(); // 'var answer = 42;' + +const map = s.generateMap({ + source: 'source.js', + file: 'converted.js.map', + includeContent: true +}); // generates a v3 sourcemap + +fs.writeFileSync('converted.js', s.toString()); +fs.writeFileSync('converted.js.map', map.toString()); +``` + +You can pass an options argument: + +```js +const s = new MagicString(someCode, { + // these options will be used if you later call `bundle.addSource( s )` - see below + filename: 'foo.js', + indentExclusionRanges: [/*...*/], + // mark source as ignore in DevTools, see below #Bundling + ignoreList: false +}); +``` + +## Methods + +### s.addSourcemapLocation( index ) + +Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is `false` (see below). + +### s.append( content ) + +Appends the specified content to the end of the string. Returns `this`. + +### s.appendLeft( index, content ) + +Appends the specified `content` at the `index` in the original string. If a range *ending* with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependLeft(...)`. + +### s.appendRight( index, content ) + +Appends the specified `content` at the `index` in the original string. If a range *starting* with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependRight(...)`. + +### s.clone() + +Does what you'd expect. + +### s.generateDecodedMap( options ) + +Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. See `generateMap` documentation below for options details. Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + +### s.generateMap( options ) + +Generates a [version 3 sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). All options are, well, optional: + +* `file` - the filename where you plan to write the sourcemap +* `source` - the filename of the file containing the original source +* `includeContent` - whether to include the original content in the map's `sourcesContent` array +* `hires` - whether the mapping should be high-resolution. Hi-res mappings map every single character, meaning (for example) your devtools will always be able to pinpoint the exact location of function calls and so on. With lo-res mappings, devtools may only be able to identify the correct line - but they're quicker to generate and less bulky. You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary instead of per character, suitable for string semantics that are separated by words. If sourcemap locations have been specified with `s.addSourcemapLocation()`, they will be used here. + +The returned sourcemap has two (non-enumerable) methods attached for convenience: + +* `toString` - returns the equivalent of `JSON.stringify(map)` +* `toUrl` - returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + +```js +code += '\n//# sourceMappingURL=' + map.toUrl(); +``` + +### s.hasChanged() + +Indicates if the string has been changed. + +### s.indent( prefix[, options] ) + +Prefixes each line of the string with `prefix`. If `prefix` is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. Returns `this`. + +The `options` argument can have an `exclude` property, which is an array of `[start, end]` character ranges. These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + +### s.insertLeft( index, content ) + +**DEPRECATED** since 0.17 – use `s.appendLeft(...)` instead + +### s.insertRight( index, content ) + +**DEPRECATED** since 0.17 – use `s.prependRight(...)` instead + +### s.isEmpty() + +Returns true if the resulting source is empty (disregarding white space). + +### s.locate( index ) + +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) + +### s.locateOrigin( index ) + +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) + +### s.move( start, end, index ) + +Moves the characters from `start` and `end` to `index`. Returns `this`. + +### s.overwrite( start, end, content[, options] ) + +Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in that range. The same restrictions as `s.remove()` apply. Returns `this`. + +The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and a `contentOnly` property which determines whether only the content is overwritten, or anything that was appended/prepended to the range as well. + +It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + +### s.prepend( content ) + +Prepends the string with the specified content. Returns `this`. + +### s.prependLeft ( index, content ) + +Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + +### s.prependRight ( index, content ) + +Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + +### s.replace( regexpOrString, substitution ) + +String replacement with RegExp or string. When using a RegExp, replacer function is also supported. Returns `this`. + +```ts +import MagicString from 'magic-string' + +const s = new MagicString(source) + +s.replace('foo', 'bar') +s.replace(/foo/g, 'bar') +s.replace(/(\w)(\d+)/g, (_, $1, $2) => $1.toUpperCase() + $2) +``` + +The differences from [`String.replace`]((https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)): +- It will always match against the **original string** +- It mutates the magic string state (use `.clone()` to be immutable) + +### s.replaceAll( regexpOrString, substitution ) + +Same as `s.replace`, but replace all matched strings instead of just one. +If `regexpOrString` is a regex, then it must have the global (`g`) flag set, or a `TypeError` is thrown. Matches the behavior of the builtin [`String.property.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll). Returns `this`. + +### s.remove( start, end ) + +Removes the characters from `start` to `end` (of the original string, **not** the generated string). Removing the same content twice, or making removals that partially overlap, will cause an error. Returns `this`. + +### s.reset( start, end ) + +Resets the characters from `start` to `end` (of the original string, **not** the generated string). +It can be used to restore previously removed characters and discard unwanted changes. + +### s.slice( start, end ) + +Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. Throws error if the indices are for characters that were already removed. + +### s.snip( start, end ) + +Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + +### s.toString() + +Returns the generated string. + +### s.trim([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. Returns `this`. + +### s.trimStart([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. Returns `this`. + +### s.trimEnd([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. Returns `this`. + +### s.trimLines() + +Removes empty lines from the start and end. Returns `this`. + +### s.update( start, end, content[, options] ) + +Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. Returns `this`. + +The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and an `overwrite` property which defaults to `false` and determines whether anything that was appended/prepended to the range will be overwritten along with the original content. + +`s.update(start, end, content)` is equivalent to `s.overwrite(start, end, content, { contentOnly: true })`. + +## Bundling + +To concatenate several sources, use `MagicString.Bundle`: + +```js +const bundle = new MagicString.Bundle(); + +bundle.addSource({ + filename: 'foo.js', + content: new MagicString('var answer = 42;') +}); + +bundle.addSource({ + filename: 'bar.js', + content: new MagicString('console.log( answer )') +}); + +// Sources can be marked as ignore-listed, which provides a hint to debuggers +// to not step into this code and also don't show the source files depending +// on user preferences. +bundle.addSource({ + filename: 'some-3rdparty-library.js', + content: new MagicString('function myLib(){}'), + ignoreList: false // <-- +}) + +// Advanced: a source can include an `indentExclusionRanges` property +// alongside `filename` and `content`. This will be passed to `s.indent()` +// - see documentation above + +bundle.indent() // optionally, pass an indent string, otherwise it will be guessed + .prepend('(function () {\n') + .append('}());'); + +bundle.toString(); +// (function () { +// var answer = 42; +// console.log( answer ); +// }()); + +// options are as per `s.generateMap()` above +const map = bundle.generateMap({ + file: 'bundle.js', + includeContent: true, + hires: true +}); +``` + +As an alternative syntax, if you a) don't have `filename` or `indentExclusionRanges` options, or b) passed those in when you used `new MagicString(...)`, you can simply pass the `MagicString` instance itself: + +```js +const bundle = new MagicString.Bundle(); +const source = new MagicString(someCode, { + filename: 'foo.js' +}); + +bundle.addSource(source); +``` + +## License + +MIT diff --git a/seller_1/node_modules/magic-string/dist/magic-string.cjs.d.ts b/seller_1/node_modules/magic-string/dist/magic-string.cjs.d.ts new file mode 100644 index 0000000..6d1fa2b --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.cjs.d.ts @@ -0,0 +1,269 @@ +export interface BundleOptions { + intro?: string; + separator?: string; +} + +export interface SourceMapOptions { + /** + * Whether the mapping should be high-resolution. + * Hi-res mappings map every single character, meaning (for example) your devtools will always + * be able to pinpoint the exact location of function calls and so on. + * With lo-res mappings, devtools may only be able to identify the correct + * line - but they're quicker to generate and less bulky. + * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary + * instead of per character, suitable for string semantics that are separated by words. + * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here. + */ + hires?: boolean | 'boundary'; + /** + * The filename where you plan to write the sourcemap. + */ + file?: string; + /** + * The filename of the file containing the original source. + */ + source?: string; + /** + * Whether to include the original content in the map's sourcesContent array. + */ + includeContent?: boolean; +} + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; + +export interface DecodedSourceMap { + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: SourceMapSegment[][]; + x_google_ignoreList?: number[]; +} + +export class SourceMap { + constructor(properties: DecodedSourceMap); + + version: number; + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: string; + x_google_ignoreList?: number[]; + debugId?: string; + + /** + * Returns the equivalent of `JSON.stringify(map)` + */ + toString(): string; + /** + * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + * `generateMap(options?: SourceMapOptions): SourceMap;` + */ + toUrl(): string; +} + +export class Bundle { + constructor(options?: BundleOptions); + /** + * Adds the specified source to the bundle, which can either be a `MagicString` object directly, + * or an options object that holds a magic string `content` property and optionally provides + * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint + * (which defaults to `false`). The `filename` is used when constructing the source map for the + * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint + * is used to populate the `x_google_ignoreList` extension field in the source map, which is a + * mechanism for tools to signal to debuggers that certain sources should be ignored by default + * (depending on user preferences). + */ + addSource(source: MagicString | { filename?: string, content: MagicString, ignoreList?: boolean }): this; + append(str: string, options?: BundleOptions): this; + clone(): this; + generateMap(options?: SourceMapOptions): Omit<SourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> }; + generateDecodedMap(options?: SourceMapOptions): Omit<DecodedSourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> }; + getIndentString(): string; + indent(indentStr?: string): this; + indentExclusionRanges: ExclusionRange | Array<ExclusionRange>; + prepend(str: string): this; + toString(): string; + trimLines(): this; + trim(charType?: string): this; + trimStart(charType?: string): this; + trimEnd(charType?: string): this; + isEmpty(): boolean; + length(): number; +} + +export type ExclusionRange = [ number, number ]; + +export interface MagicStringOptions { + filename?: string, + indentExclusionRanges?: ExclusionRange | Array<ExclusionRange>; +} + +export interface IndentOptions { + exclude?: ExclusionRange | Array<ExclusionRange>; + indentStart?: boolean; +} + +export interface OverwriteOptions { + storeName?: boolean; + contentOnly?: boolean; +} + +export interface UpdateOptions { + storeName?: boolean; + overwrite?: boolean; +} + +export default class MagicString { + constructor(str: string, options?: MagicStringOptions); + /** + * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. + */ + addSourcemapLocation(char: number): void; + /** + * Appends the specified content to the end of the string. + */ + append(content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *ending* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependLeft(...)`. + */ + appendLeft(index: number, content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *starting* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependRight(...)`. + */ + appendRight(index: number, content: string): this; + /** + * Does what you'd expect. + */ + clone(): this; + /** + * Generates a version 3 sourcemap. + */ + generateMap(options?: SourceMapOptions): SourceMap; + /** + * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. + * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + */ + generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap; + getIndentString(): string; + + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + */ + indent(options?: IndentOptions): this; + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + * + * The options argument can have an exclude property, which is an array of [start, end] character ranges. + * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + */ + indent(indentStr?: string, options?: IndentOptions): this; + indentExclusionRanges: ExclusionRange | Array<ExclusionRange>; + + /** + * Moves the characters from `start` and `end` to `index`. + */ + move(start: number, end: number, index: number): this; + /** + * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in + * that range. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + * + * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + */ + overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): this; + /** + * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + */ + update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this; + /** + * Prepends the string with the specified content. + */ + prepend(content: string): this; + /** + * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index + */ + prependLeft(index: number, content: string): this; + /** + * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + */ + prependRight(index: number, content: string): this; + /** + * Removes the characters from `start` to `end` (of the original string, **not** the generated string). + * Removing the same content twice, or making removals that partially overlap, will cause an error. + */ + remove(start: number, end: number): this; + /** + * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string). + */ + reset(start: number, end: number): this; + /** + * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. + * Throws error if the indices are for characters that were already removed. + */ + slice(start: number, end: number): string; + /** + * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + */ + snip(start: number, end: number): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. + */ + trim(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. + */ + trimStart(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. + */ + trimEnd(charType?: string): this; + /** + * Removes empty lines from the start and end. + */ + trimLines(): this; + /** + * String replacement with RegExp or string. + */ + replace(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; + /** + * Same as `s.replace`, but replace all matched strings instead of just one. + */ + replaceAll(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; + + lastChar(): string; + lastLine(): string; + /** + * Returns true if the resulting source is empty (disregarding white space). + */ + isEmpty(): boolean; + length(): number; + + /** + * Indicates if the string has been changed. + */ + hasChanged(): boolean; + + original: string; + /** + * Returns the generated string. + */ + toString(): string; +} diff --git a/seller_1/node_modules/magic-string/dist/magic-string.cjs.js b/seller_1/node_modules/magic-string/dist/magic-string.cjs.js new file mode 100644 index 0000000..102c125 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.cjs.js @@ -0,0 +1,1558 @@ +'use strict'; + +var sourcemapCodec = require('@jridgewell/sourcemap-codec'); + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = sourcemapCodec.encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +} + +MagicString.Bundle = Bundle; +MagicString.SourceMap = SourceMap; +MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 + +module.exports = MagicString; +//# sourceMappingURL=magic-string.cjs.js.map diff --git a/seller_1/node_modules/magic-string/dist/magic-string.cjs.js.map b/seller_1/node_modules/magic-string/dist/magic-string.cjs.js.map new file mode 100644 index 0000000..0242070 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.cjs.js","sources":["../src/BitSet.js","../src/Chunk.js","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js","../src/index-legacy.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + '' \n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t); // eslint-disable-line no-console\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\t\treplacement\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\treplacement\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tif (previous !== replacement)\n\t\t\t\tthis.overwrite(index, index + stringLength, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n","import MagicString from './MagicString.js';\nimport Bundle from './Bundle.js';\nimport SourceMap from './SourceMap.js';\n\nMagicString.Bundle = Bundle;\nMagicString.SourceMap = SourceMap;\nMagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121\n\nexport default MagicString;\n"],"names":["encode"],"mappings":";;;;AAAe,MAAM,MAAM,CAAC;AAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;AAClB,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,YAAY,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC;AAC5D,EAAE;AACF;AACA,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;AACrC,EAAE;AACF;AACA,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACjD,EAAE;AACF;;ACZe,MAAM,KAAK,CAAC;AAC3B,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACrB,EAAE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACjB,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC1B;AACA,EAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AAClB,EAAE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AC;AAClC;AACA,EAAE,GAAG;AACL,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AAC9B,GAAG,IAAI,CAAC,MAAM,EAAE;AAChB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC5C,IAAI,MAAM;AACV,IAAI;AACJ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACrD;AACA,EAAE,OAAO,IAAI,CAAC;AACd,EAAE;AACF;;ACpSA,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;AAClC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/magic-string/dist/magic-string.es.d.mts b/seller_1/node_modules/magic-string/dist/magic-string.es.d.mts new file mode 100644 index 0000000..6d1fa2b --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.es.d.mts @@ -0,0 +1,269 @@ +export interface BundleOptions { + intro?: string; + separator?: string; +} + +export interface SourceMapOptions { + /** + * Whether the mapping should be high-resolution. + * Hi-res mappings map every single character, meaning (for example) your devtools will always + * be able to pinpoint the exact location of function calls and so on. + * With lo-res mappings, devtools may only be able to identify the correct + * line - but they're quicker to generate and less bulky. + * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary + * instead of per character, suitable for string semantics that are separated by words. + * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here. + */ + hires?: boolean | 'boundary'; + /** + * The filename where you plan to write the sourcemap. + */ + file?: string; + /** + * The filename of the file containing the original source. + */ + source?: string; + /** + * Whether to include the original content in the map's sourcesContent array. + */ + includeContent?: boolean; +} + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; + +export interface DecodedSourceMap { + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: SourceMapSegment[][]; + x_google_ignoreList?: number[]; +} + +export class SourceMap { + constructor(properties: DecodedSourceMap); + + version: number; + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: string; + x_google_ignoreList?: number[]; + debugId?: string; + + /** + * Returns the equivalent of `JSON.stringify(map)` + */ + toString(): string; + /** + * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + * `generateMap(options?: SourceMapOptions): SourceMap;` + */ + toUrl(): string; +} + +export class Bundle { + constructor(options?: BundleOptions); + /** + * Adds the specified source to the bundle, which can either be a `MagicString` object directly, + * or an options object that holds a magic string `content` property and optionally provides + * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint + * (which defaults to `false`). The `filename` is used when constructing the source map for the + * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint + * is used to populate the `x_google_ignoreList` extension field in the source map, which is a + * mechanism for tools to signal to debuggers that certain sources should be ignored by default + * (depending on user preferences). + */ + addSource(source: MagicString | { filename?: string, content: MagicString, ignoreList?: boolean }): this; + append(str: string, options?: BundleOptions): this; + clone(): this; + generateMap(options?: SourceMapOptions): Omit<SourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> }; + generateDecodedMap(options?: SourceMapOptions): Omit<DecodedSourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> }; + getIndentString(): string; + indent(indentStr?: string): this; + indentExclusionRanges: ExclusionRange | Array<ExclusionRange>; + prepend(str: string): this; + toString(): string; + trimLines(): this; + trim(charType?: string): this; + trimStart(charType?: string): this; + trimEnd(charType?: string): this; + isEmpty(): boolean; + length(): number; +} + +export type ExclusionRange = [ number, number ]; + +export interface MagicStringOptions { + filename?: string, + indentExclusionRanges?: ExclusionRange | Array<ExclusionRange>; +} + +export interface IndentOptions { + exclude?: ExclusionRange | Array<ExclusionRange>; + indentStart?: boolean; +} + +export interface OverwriteOptions { + storeName?: boolean; + contentOnly?: boolean; +} + +export interface UpdateOptions { + storeName?: boolean; + overwrite?: boolean; +} + +export default class MagicString { + constructor(str: string, options?: MagicStringOptions); + /** + * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. + */ + addSourcemapLocation(char: number): void; + /** + * Appends the specified content to the end of the string. + */ + append(content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *ending* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependLeft(...)`. + */ + appendLeft(index: number, content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *starting* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependRight(...)`. + */ + appendRight(index: number, content: string): this; + /** + * Does what you'd expect. + */ + clone(): this; + /** + * Generates a version 3 sourcemap. + */ + generateMap(options?: SourceMapOptions): SourceMap; + /** + * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. + * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + */ + generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap; + getIndentString(): string; + + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + */ + indent(options?: IndentOptions): this; + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + * + * The options argument can have an exclude property, which is an array of [start, end] character ranges. + * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + */ + indent(indentStr?: string, options?: IndentOptions): this; + indentExclusionRanges: ExclusionRange | Array<ExclusionRange>; + + /** + * Moves the characters from `start` and `end` to `index`. + */ + move(start: number, end: number, index: number): this; + /** + * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in + * that range. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + * + * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + */ + overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): this; + /** + * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + */ + update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this; + /** + * Prepends the string with the specified content. + */ + prepend(content: string): this; + /** + * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index + */ + prependLeft(index: number, content: string): this; + /** + * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + */ + prependRight(index: number, content: string): this; + /** + * Removes the characters from `start` to `end` (of the original string, **not** the generated string). + * Removing the same content twice, or making removals that partially overlap, will cause an error. + */ + remove(start: number, end: number): this; + /** + * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string). + */ + reset(start: number, end: number): this; + /** + * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. + * Throws error if the indices are for characters that were already removed. + */ + slice(start: number, end: number): string; + /** + * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + */ + snip(start: number, end: number): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. + */ + trim(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. + */ + trimStart(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. + */ + trimEnd(charType?: string): this; + /** + * Removes empty lines from the start and end. + */ + trimLines(): this; + /** + * String replacement with RegExp or string. + */ + replace(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; + /** + * Same as `s.replace`, but replace all matched strings instead of just one. + */ + replaceAll(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; + + lastChar(): string; + lastLine(): string; + /** + * Returns true if the resulting source is empty (disregarding white space). + */ + isEmpty(): boolean; + length(): number; + + /** + * Indicates if the string has been changed. + */ + hasChanged(): boolean; + + original: string; + /** + * Returns the generated string. + */ + toString(): string; +} diff --git a/seller_1/node_modules/magic-string/dist/magic-string.es.mjs b/seller_1/node_modules/magic-string/dist/magic-string.es.mjs new file mode 100644 index 0000000..1629de0 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.es.mjs @@ -0,0 +1,1552 @@ +import { encode } from '@jridgewell/sourcemap-codec'; + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +} + +export { Bundle, SourceMap, MagicString as default }; +//# sourceMappingURL=magic-string.es.mjs.map diff --git a/seller_1/node_modules/magic-string/dist/magic-string.es.mjs.map b/seller_1/node_modules/magic-string/dist/magic-string.es.mjs.map new file mode 100644 index 0000000..7e6c358 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.es.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.es.mjs","sources":["../src/BitSet.js","../src/Chunk.js","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + '' \n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t); // eslint-disable-line no-console\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\t\treplacement\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\treplacement\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tif (previous !== replacement)\n\t\t\t\tthis.overwrite(index, index + stringLength, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n"],"names":[],"mappings":";;AAAe,MAAM,MAAM,CAAC;AAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;AAClB,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,YAAY,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC;AAC5D,EAAE;AACF;AACA,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;AACrC,EAAE;AACF;AACA,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACjD,EAAE;AACF;;ACZe,MAAM,KAAK,CAAC;AAC3B,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACrB,EAAE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACjB,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC1B;AACA,EAAE,IAAI,CAAC,KAAK,GAAG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,MAAM,GAAG,CAAC,CAAC;AAClC;AACA,EAAE,GAAG;AACL,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AAC9B,GAAG,IAAI,CAAC,MAAM,EAAE;AAChB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC5C,IAAI,MAAM;AACV,IAAI;AACJ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACrD;AACA,EAAE,OAAO,IAAI,CAAC;AACd,EAAE;AACF;;;;"} \ No newline at end of file diff --git a/seller_1/node_modules/magic-string/dist/magic-string.umd.js b/seller_1/node_modules/magic-string/dist/magic-string.umd.js new file mode 100644 index 0000000..1f328a9 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.umd.js @@ -0,0 +1,1655 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MagicString = factory()); +})(this, (function () { 'use strict'; + + class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } + } + + class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } + } + + const comma = ','.charCodeAt(0); + const semicolon = ';'.charCodeAt(0); + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + const intToChar = new Uint8Array(64); // 64 possible chars. + const charToInt = new Uint8Array(128); // z is 122 in ASCII + for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; + } + function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; + } + + const bufLength = 1024 * 16; + // Provide a fallback for older environments. + const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } + } + function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); + } + + function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } + } + + const btoa = /*#__PURE__*/ getBtoa(); + + class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } + } + + function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); + } + + function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); + } + + const toString = Object.prototype.toString; + + function isObject(thing) { + return toString.call(thing) === '[object Object]'; + } + + function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; + } + + const wordRegex = /\w/; + + class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } + } + + const n = '\n'; + + const warned = { + insertLeft: false, + insertRight: false, + storeName: false, + }; + + class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } + } + + const hasOwnProp = Object.prototype.hasOwnProperty; + + class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } + } + + MagicString.Bundle = Bundle; + MagicString.SourceMap = SourceMap; + MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 + + return MagicString; + +})); +//# sourceMappingURL=magic-string.umd.js.map diff --git a/seller_1/node_modules/magic-string/dist/magic-string.umd.js.map b/seller_1/node_modules/magic-string/dist/magic-string.umd.js.map new file mode 100644 index 0000000..9d089d2 --- /dev/null +++ b/seller_1/node_modules/magic-string/dist/magic-string.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.umd.js","sources":["../src/BitSet.js","../src/Chunk.js","../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js","../src/index-legacy.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + '' \n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","const comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;\n do {\n let clamped = delta & 0b011111;\n delta >>>= 5;\n if (delta > 0)\n clamped |= 0b100000;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max)\n return false;\n return reader.peek() !== comma;\n}\n\nconst bufLength = 1024 * 16;\n// Provide a fallback for older environments.\nconst td = typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\nclass StringWriter {\n constructor() {\n this.pos = 0;\n this.out = '';\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n}\nclass StringReader {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n}\n\nconst EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 0b0001;\n const scope = (hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]);\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length;) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0)\n writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 0b0001 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6)\n encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length;) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || (l === endLine && c >= endColumn)) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(';');\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 0b0001;\n const hasCallsite = fields & 0b0010;\n const hasScope = fields & 0b0100;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(reader, definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0);\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n }\n else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(reader, sameSource && prevLine === callsiteLine ? callsiteColumn : 0);\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n }\n else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0)\n return '';\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length;) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, isScope, callsite, bindings, } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n }\n else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 0b0001 : 0) | (callsite ? 0b0010 : 0) | (isScope ? 0b0100 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n }\n else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1)\n encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length;) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || (l === endLine && c >= endColumn)) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n }\n else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(';');\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol)\n sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n }\n else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n }\n else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted)\n sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0)\n writer.write(semicolon);\n if (line.length === 0)\n continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0)\n writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1)\n continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4)\n continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\n\nexport { decode, decodeGeneratedRanges, decodeOriginalScopes, encode, encodeGeneratedRanges, encodeOriginalScopes };\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t); // eslint-disable-line no-console\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length) {\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\t\treplacement\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\treplacement\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tif (previous !== replacement)\n\t\t\t\tthis.overwrite(index, index + stringLength, replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n","import MagicString from './MagicString.js';\nimport Bundle from './Bundle.js';\nimport SourceMap from './SourceMap.js';\n\nMagicString.Bundle = Bundle;\nMagicString.SourceMap = SourceMap;\nMagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121\n\nexport default MagicString;\n"],"names":[],"mappings":";;;;;;CAAe,MAAM,MAAM,CAAC;CAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;CAClB,EAAE,IAAI,CAAC,IAA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CACA,CAAC,OAAO,CAAC,QAAQ,EAAE;CACnB,EAAE,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC;AACpD;CACA,EAAE,IAAI,MAAM,CAAC;CACb,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC;CACA,EAAE,GAAG;CACL,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,MAAM,EAAE;CAChB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,IAAI,MAAM;CACV,IAAI;CACJ,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACrD;CACA,EAAE,OAAO,IAAI,CAAC;CACd,EAAE;CACF;;CCpSA,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;CAC5B,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;CAClC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC;;;;;;;;","x_google_ignoreList":[2]} \ No newline at end of file diff --git a/seller_1/node_modules/magic-string/package.json b/seller_1/node_modules/magic-string/package.json new file mode 100644 index 0000000..e4a05cf --- /dev/null +++ b/seller_1/node_modules/magic-string/package.json @@ -0,0 +1,64 @@ +{ + "name": "magic-string", + "version": "0.30.15", + "packageManager": "pnpm@9.6.0", + "description": "Modify strings, generate sourcemaps", + "keywords": [ + "string", + "string manipulation", + "sourcemap", + "templating", + "transpilation" + ], + "repository": "https://github.com/rich-harris/magic-string", + "license": "MIT", + "author": "Rich Harris", + "main": "./dist/magic-string.cjs.js", + "module": "./dist/magic-string.es.mjs", + "sideEffects": false, + "jsnext:main": "./dist/magic-string.es.mjs", + "types": "./dist/magic-string.cjs.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./dist/magic-string.es.mjs", + "require": "./dist/magic-string.cjs.js" + } + }, + "files": [ + "dist/*", + "index.d.ts", + "README.md" + ], + "scripts": { + "build": "rollup -c", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "format": "prettier --single-quote --print-width 100 --use-tabs --write src/*.js src/**/*.js", + "lint": "eslint src test && publint", + "lint:fix": "eslint src test --fix", + "prepare": "npm run build", + "prepublishOnly": "npm run lint && rm -rf dist && npm test", + "release": "bumpp -x \"npm run changelog\" --all --commit --tag --push && npm publish", + "pretest": "npm run build", + "test": "mocha", + "bench": "npm run build && node benchmark/index.mjs", + "watch": "rollup -cw" + }, + "devDependencies": { + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.7", + "benchmark": "^2.1.4", + "bumpp": "^9.4.1", + "conventional-changelog-cli": "^3.0.0", + "eslint": "^8.57.0", + "mocha": "^10.7.0", + "prettier": "^3.3.3", + "publint": "^0.2.9", + "rollup": "^3.29.4", + "source-map-js": "^1.2.0", + "source-map-support": "^0.5.21" + }, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } +} diff --git a/seller_1/node_modules/nanoid/.devcontainer.json b/seller_1/node_modules/nanoid/.devcontainer.json new file mode 100644 index 0000000..7fd5ba1 --- /dev/null +++ b/seller_1/node_modules/nanoid/.devcontainer.json @@ -0,0 +1,23 @@ +{ + "image": "localhost/ai-opensource:latest", + "forwardPorts": [], + "mounts": [ + { + "source": "pnpm-store", + "target": "/home/ai/.local/share/pnpm/store", + "type": "volume" + }, + { + "source": "shell-history", + "target": "/home/ai/.local/share/history/", + "type": "volume" + } + ], + "workspaceMount": "", + "runArgs": [ + "--userns=keep-id:uid=1000,gid=1000", + "--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z", + "--network=host", + "--ulimit=host" + ] +} diff --git a/seller_1/node_modules/nanoid/LICENSE b/seller_1/node_modules/nanoid/LICENSE new file mode 100644 index 0000000..37f56aa --- /dev/null +++ b/seller_1/node_modules/nanoid/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2017 Andrey Sitnik <andrey@sitnik.ru> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/nanoid/README.md b/seller_1/node_modules/nanoid/README.md new file mode 100644 index 0000000..f4c8c13 --- /dev/null +++ b/seller_1/node_modules/nanoid/README.md @@ -0,0 +1,554 @@ +# Nano ID + +<img src="https://ai.github.io/nanoid/logo.svg" align="right" + alt="Nano ID logo by Anton Lovchikov" width="180" height="94"> + +**English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) + +A tiny, secure, URL-friendly, unique string ID generator for JavaScript. + +> “An amazing level of senseless perfectionism, +> which is simply impossible not to respect.” + +* **Small.** 130 bytes (minified and gzipped). No dependencies. + [Size Limit] controls the size. +* **Fast.** It is 2 times faster than UUID. +* **Safe.** It uses hardware random generator. Can be used in clusters. +* **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). + So ID size was reduced from 36 to 21 symbols. +* **Portable.** Nano ID was ported + to [20 programming languages](#other-programming-languages). + +```js +import { nanoid } from 'nanoid' +model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" +``` + +Supports modern browsers, IE [with Babel], Node.js and React Native. + +[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ +[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ +[Size Limit]: https://github.com/ai/size-limit + +<a href="https://evilmartians.com/?utm_source=nanoid"> + <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" + alt="Sponsored by Evil Martians" width="236" height="54"> +</a> + +## Table of Contents + +* [Comparison with UUID](#comparison-with-uuid) +* [Benchmark](#benchmark) +* [Security](#security) +* [API](#api) + * [Blocking](#blocking) + * [Async](#async) + * [Non-Secure](#non-secure) + * [Custom Alphabet or Size](#custom-alphabet-or-size) + * [Custom Random Bytes Generator](#custom-random-bytes-generator) +* [Usage](#usage) + * [IE](#ie) + * [React](#react) + * [React Native](#react-native) + * [Rollup](#rollup) + * [PouchDB and CouchDB](#pouchdb-and-couchdb) + * [Mongoose](#mongoose) + * [Web Workers](#web-workers) + * [CLI](#cli) + * [Other Programming Languages](#other-programming-languages) +* [Tools](#tools) + + +## Comparison with UUID + +Nano ID is quite comparable to UUID v4 (random-based). +It has a similar number of random bits in the ID +(126 in Nano ID and 122 in UUID), so it has a similar collision probability: + +> For there to be a one in a billion chance of duplication, +> 103 trillion version 4 IDs must be generated. + +There are three main differences between Nano ID and UUID v4: + +1. Nano ID uses a bigger alphabet, so a similar number of random bits + are packed in just 21 symbols instead of 36. +2. Nano ID code is **4 times less** than `uuid/v4` package: + 130 bytes instead of 483. +3. Because of memory allocation tricks, Nano ID is **2 times** faster than UUID. + + +## Benchmark + +```rust +$ node ./test/benchmark.js +crypto.randomUUID 25,603,857 ops/sec +@napi-rs/uuid 9,973,819 ops/sec +uid/secure 8,234,798 ops/sec +@lukeed/uuid 7,464,706 ops/sec +nanoid 5,616,592 ops/sec +customAlphabet 3,115,207 ops/sec +uuid v4 1,535,753 ops/sec +secure-random-string 388,226 ops/sec +uid-safe.sync 363,489 ops/sec +cuid 187,343 ops/sec +shortid 45,758 ops/sec + +Async: +nanoid/async 96,094 ops/sec +async customAlphabet 97,184 ops/sec +async secure-random-string 92,794 ops/sec +uid-safe 90,684 ops/sec + +Non-secure: +uid 67,376,692 ops/sec +nanoid/non-secure 2,849,639 ops/sec +rndm 2,674,806 ops/sec +``` + +Test configuration: ThinkPad X1 Carbon Gen 9, Fedora 34, Node.js 16.10. + + +## Security + +*See a good article about random generators theory: +[Secure random values (in Node.js)]* + +* **Unpredictability.** Instead of using the unsafe `Math.random()`, Nano ID + uses the `crypto` module in Node.js and the Web Crypto API in browsers. + These modules use unpredictable hardware random generator. +* **Uniformity.** `random % alphabet` is a popular mistake to make when coding + an ID generator. The distribution will not be even; there will be a lower + chance for some symbols to appear compared to others. So, it will reduce + the number of tries when brute-forcing. Nano ID uses a [better algorithm] + and is tested for uniformity. + + <img src="img/distribution.png" alt="Nano ID uniformity" + width="340" height="135"> + +* **Well-documented:** all Nano ID hacks are documented. See comments + in [the source]. +* **Vulnerabilities:** to report a security vulnerability, please use + the [Tidelift security contact](https://tidelift.com/security). + Tidelift will coordinate the fix and disclosure. + +[Secure random values (in Node.js)]: https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba +[better algorithm]: https://github.com/ai/nanoid/blob/main/index.js +[the source]: https://github.com/ai/nanoid/blob/main/index.js + + +## Install + +```bash +npm install --save nanoid +``` + +For quick hacks, you can load Nano ID from CDN. Though, it is not recommended +to be used in production because of the lower loading performance. + +```js +import { nanoid } from 'https://cdn.jsdelivr.net/npm/nanoid/nanoid.js' +``` + +Nano ID provides ES modules. You do not need to do anything to use Nano ID +as ESM in webpack, Rollup, Parcel, or Node.js. + +```js +import { nanoid } from 'nanoid' +``` + +In Node.js you can use CommonJS import: + +```js +const { nanoid } = require('nanoid') +``` + + +## API + +Nano ID has 3 APIs: normal (blocking), asynchronous, and non-secure. + +By default, Nano ID uses URL-friendly symbols (`A-Za-z0-9_-`) and returns an ID +with 21 characters (to have a collision probability similar to UUID v4). + + +### Blocking + +The safe and easiest way to use Nano ID. + +In rare cases could block CPU from other work while noise collection +for hardware random generator. + +```js +import { nanoid } from 'nanoid' +model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" +``` + +If you want to reduce the ID size (and increase collisions probability), +you can pass the size as an argument. + +```js +nanoid(10) //=> "IRFa-VaY2b" +``` + +Don’t forget to check the safety of your ID size +in our [ID collision probability] calculator. + +You can also use a [custom alphabet](#custom-alphabet-or-size) +or a [random generator](#custom-random-bytes-generator). + +[ID collision probability]: https://zelark.github.io/nano-id-cc/ + + +### Async + +To generate hardware random bytes, CPU collects electromagnetic noise. +For most cases, entropy will be already collected. + +In the synchronous API during the noise collection, the CPU is busy and +cannot do anything useful (for instance, process another HTTP request). + +Using the asynchronous API of Nano ID, another code can run during +the entropy collection. + +```js +import { nanoid } from 'nanoid/async' + +async function createUser () { + user.id = await nanoid() +} +``` + +Read more about entropy collection in [`crypto.randomBytes`] docs. + +Unfortunately, you will lose Web Crypto API advantages in a browser +if you use the asynchronous API. So, currently, in the browser, you are limited +with either security (`nanoid`), asynchronous behavior (`nanoid/async`), +or non-secure behavior (`nanoid/non-secure`) that will be explained +in the next part of the documentation. + +[`crypto.randomBytes`]: https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback + + +### Non-Secure + +By default, Nano ID uses hardware random bytes generation for security +and low collision probability. If you are not so concerned with security, +you can use the faster non-secure generator. + +```js +import { nanoid } from 'nanoid/non-secure' +const id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqLJ" +``` + + +### Custom Alphabet or Size + +`customAlphabet` allows you to create `nanoid` with your own alphabet +and ID size. + +```js +import { customAlphabet } from 'nanoid' +const nanoid = customAlphabet('1234567890abcdef', 10) +model.id = nanoid() //=> "4f90d13a42" +``` + +```js +import { customAlphabet } from 'nanoid/async' +const nanoid = customAlphabet('1234567890abcdef', 10) +async function createUser () { + user.id = await nanoid() +} +``` + +```js +import { customAlphabet } from 'nanoid/non-secure' +const nanoid = customAlphabet('1234567890abcdef', 10) +user.id = nanoid() +``` + +Check the safety of your custom alphabet and ID size in our +[ID collision probability] calculator. For more alphabets, check out the options +in [`nanoid-dictionary`]. + +Alphabet must contain 256 symbols or less. +Otherwise, the security of the internal generator algorithm is not guaranteed. + +In addition to setting a default size, you can change the ID size when calling +the function: + +```js +import { customAlphabet } from 'nanoid' +const nanoid = customAlphabet('1234567890abcdef', 10) +model.id = nanoid(5) //=> "f01a2" +``` + +[ID collision probability]: https://alex7kom.github.io/nano-nanoid-cc/ +[`nanoid-dictionary`]: https://github.com/CyberAP/nanoid-dictionary + + +### Custom Random Bytes Generator + +`customRandom` allows you to create a `nanoid` and replace alphabet +and the default random bytes generator. + +In this example, a seed-based generator is used: + +```js +import { customRandom } from 'nanoid' + +const rng = seedrandom(seed) +const nanoid = customRandom('abcdef', 10, size => { + return (new Uint8Array(size)).map(() => 256 * rng()) +}) + +nanoid() //=> "fbaefaadeb" +``` + +`random` callback must accept the array size and return an array +with random numbers. + +If you want to use the same URL-friendly symbols with `customRandom`, +you can get the default alphabet using the `urlAlphabet`. + +```js +const { customRandom, urlAlphabet } = require('nanoid') +const nanoid = customRandom(urlAlphabet, 10, random) +``` + +Asynchronous and non-secure APIs are not available for `customRandom`. + +Note, that between Nano ID versions we may change random generator +call sequence. If you are using seed-based generators, we do not guarantee +the same result. + + +## Usage + +### IE + +If you support IE, you need to [transpile `node_modules`] by Babel +and add `crypto` alias. Moreover, `UInt8Array` in IE actually +is not an array and to cope with it, you have to convert it to an array +manually: + +```js +// polyfills.js +if (!window.crypto && window.msCrypto) { + window.crypto = window.msCrypto + + const getRandomValuesDef = window.crypto.getRandomValues + + window.crypto.getRandomValues = function (array) { + const values = getRandomValuesDef.call(window.crypto, array) + const result = [] + + for (let i = 0; i < array.length; i++) { + result[i] = values[i]; + } + + return result + }; +} +``` + +```js +import './polyfills.js' +import { nanoid } from 'nanoid' +``` + +[transpile `node_modules`]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ + + +### React + +There’s no correct way to use Nano ID for React `key` prop +since it should be consistent among renders. + +```jsx +function Todos({todos}) { + return ( + <ul> + {todos.map(todo => ( + <li key={nanoid()}> /* DON’T DO IT */ + {todo.text} + </li> + ))} + </ul> + ) +} +``` + +You should rather try to reach for stable ID inside your list item. + +```jsx +const todoItems = todos.map((todo) => + <li key={todo.id}> + {todo.text} + </li> +) +``` + +In case you don’t have stable IDs you'd rather use index as `key` +instead of `nanoid()`: + +```jsx +const todoItems = todos.map((text, index) => + <li key={index}> /* Still not recommended but preferred over nanoid(). + Only do this if items have no stable IDs. */ + {text} + </li> +) +``` + + +### React Native + +React Native does not have built-in random generator. The following polyfill +works for plain React Native and Expo starting with `39.x`. + +1. Check [`react-native-get-random-values`] docs and install it. +2. Import it before Nano ID. + +```js +import 'react-native-get-random-values' +import { nanoid } from 'nanoid' +``` + +[`react-native-get-random-values`]: https://github.com/LinusU/react-native-get-random-values + + +### Rollup + +For Rollup you will need [`@rollup/plugin-node-resolve`] to bundle browser version +of this library.: + +```js + plugins: [ + nodeResolve({ + browser: true + }) + ] +``` + +[`@rollup/plugin-node-resolve`]: https://github.com/rollup/plugins/tree/master/packages/node-resolve + + +### PouchDB and CouchDB + +In PouchDB and CouchDB, IDs can’t start with an underscore `_`. +A prefix is required to prevent this issue, as Nano ID might use a `_` +at the start of the ID by default. + +Override the default ID with the following option: + +```js +db.put({ + _id: 'id' + nanoid(), + … +}) +``` + + +### Mongoose + +```js +const mySchema = new Schema({ + _id: { + type: String, + default: () => nanoid() + } +}) +``` + + +### Web Workers + +Web Workers do not have access to a secure random generator. + +Security is important in IDs when IDs should be unpredictable. +For instance, in "access by URL" link generation. +If you do not need unpredictable IDs, but you need to use Web Workers, +you can use the non‑secure ID generator. + +```js +import { nanoid } from 'nanoid/non-secure' +nanoid() //=> "Uakgb_J5m9g-0JDMbcJqLJ" +``` + +Note: non-secure IDs are more prone to collision attacks. + + +### CLI + +You can get unique ID in terminal by calling `npx nanoid`. You need only +Node.js in the system. You do not need Nano ID to be installed anywhere. + +```sh +$ npx nanoid +npx: installed 1 in 0.63s +LZfXLFzPPR4NNrgjlWDxn +``` + +Size of generated ID can be specified with `--size` (or `-s`) option: + +```sh +$ npx nanoid --size 10 +L3til0JS4z +``` + +Custom alphabet can be specified with `--alphabet` (or `-a`) option +(note that in this case `--size` is required): + +```sh +$ npx nanoid --alphabet abc --size 15 +bccbcabaabaccab +``` + +### Other Programming Languages + +Nano ID was ported to many languages. You can use these ports to have +the same ID generator on the client and server side. + +* [C#](https://github.com/codeyu/nanoid-net) +* [C++](https://github.com/mcmikecreations/nanoid_cpp) +* [Clojure and ClojureScript](https://github.com/zelark/nano-id) +* [ColdFusion/CFML](https://github.com/JamoCA/cfml-nanoid) +* [Crystal](https://github.com/mamantoha/nanoid.cr) +* [Dart & Flutter](https://github.com/pd4d10/nanoid-dart) +* [Deno](https://github.com/ianfabs/nanoid) +* [Go](https://github.com/matoous/go-nanoid) +* [Elixir](https://github.com/railsmechanic/nanoid) +* [Haskell](https://github.com/MichelBoucey/NanoID) +* [Janet](https://sr.ht/~statianzo/janet-nanoid/) +* [Java](https://github.com/aventrix/jnanoid) +* [Nim](https://github.com/icyphox/nanoid.nim) +* [OCaml](https://github.com/routineco/ocaml-nanoid) +* [Perl](https://github.com/tkzwtks/Nanoid-perl) +* [PHP](https://github.com/hidehalo/nanoid-php) +* [Python](https://github.com/puyuan/py-nanoid) + with [dictionaries](https://pypi.org/project/nanoid-dictionary) +* [Postgres Extension](https://github.com/spa5k/uids-postgres) +* [R](https://github.com/hrbrmstr/nanoid) (with dictionaries) +* [Ruby](https://github.com/radeno/nanoid.rb) +* [Rust](https://github.com/nikolay-govorov/nanoid) +* [Swift](https://github.com/antiflasher/NanoID) +* [Unison](https://share.unison-lang.org/latest/namespaces/hojberg/nanoid) +* [V](https://github.com/invipal/nanoid) +* [Zig](https://github.com/SasLuca/zig-nanoid) + +For other environments, [CLI] is available to generate IDs from a command line. + +[CLI]: #cli + + +## Tools + +* [ID size calculator] shows collision probability when adjusting + the ID alphabet or size. +* [`nanoid-dictionary`] with popular alphabets to use with [`customAlphabet`]. +* [`nanoid-good`] to be sure that your ID doesn’t contain any obscene words. + +[`nanoid-dictionary`]: https://github.com/CyberAP/nanoid-dictionary +[ID size calculator]: https://zelark.github.io/nano-id-cc/ +[`customAlphabet`]: #custom-alphabet-or-size +[`nanoid-good`]: https://github.com/y-gagar1n/nanoid-good diff --git a/seller_1/node_modules/nanoid/async/index.browser.cjs b/seller_1/node_modules/nanoid/async/index.browser.cjs new file mode 100644 index 0000000..80d1871 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.browser.cjs @@ -0,0 +1,69 @@ +let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) + +let customAlphabet = (alphabet, defaultSize = 21) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + // `Math.clz32` is not used, because it is not available in browsers. + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + + // `-~f => Math.ceil(f)` if f is a float + // `-~i => i + 1` if i is an integer + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + + return async (size = defaultSize) => { + let id = '' + while (true) { + let bytes = crypto.getRandomValues(new Uint8Array(step)) + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = step | 0 + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let nanoid = async (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) + + // A compact alternative for `for (var i = 0; i < step; i++)`. + while (size--) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + let byte = bytes[size] & 63 + if (byte < 36) { + // `0-9a-z` + id += byte.toString(36) + } else if (byte < 62) { + // `A-Z` + id += (byte - 26).toString(36).toUpperCase() + } else if (byte < 63) { + id += '_' + } else { + id += '-' + } + } + return id +} + +module.exports = { nanoid, customAlphabet, random } diff --git a/seller_1/node_modules/nanoid/async/index.browser.js b/seller_1/node_modules/nanoid/async/index.browser.js new file mode 100644 index 0000000..aeffb3f --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.browser.js @@ -0,0 +1,69 @@ +let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) + +let customAlphabet = (alphabet, defaultSize = 21) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + // `Math.clz32` is not used, because it is not available in browsers. + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + + // `-~f => Math.ceil(f)` if f is a float + // `-~i => i + 1` if i is an integer + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + + return async (size = defaultSize) => { + let id = '' + while (true) { + let bytes = crypto.getRandomValues(new Uint8Array(step)) + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = step | 0 + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let nanoid = async (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) + + // A compact alternative for `for (var i = 0; i < step; i++)`. + while (size--) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + let byte = bytes[size] & 63 + if (byte < 36) { + // `0-9a-z` + id += byte.toString(36) + } else if (byte < 62) { + // `A-Z` + id += (byte - 26).toString(36).toUpperCase() + } else if (byte < 63) { + id += '_' + } else { + id += '-' + } + } + return id +} + +export { nanoid, customAlphabet, random } diff --git a/seller_1/node_modules/nanoid/async/index.cjs b/seller_1/node_modules/nanoid/async/index.cjs new file mode 100644 index 0000000..f1b0ad0 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.cjs @@ -0,0 +1,71 @@ +let crypto = require('crypto') + +let { urlAlphabet } = require('../url-alphabet/index.cjs') + +// `crypto.randomFill()` is a little faster than `crypto.randomBytes()`, +// because it is possible to use in combination with `Buffer.allocUnsafe()`. +let random = bytes => + new Promise((resolve, reject) => { + // `Buffer.allocUnsafe()` is faster because it doesn’t flush the memory. + // Memory flushing is unnecessary since the buffer allocation itself resets + // the memory with the new bytes. + crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { + if (err) { + reject(err) + } else { + resolve(buf) + } + }) + }) + +let customAlphabet = (alphabet, defaultSize = 21) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = step + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length >= size) return id + } + return tick(id, size) + }) + + return size => tick('', size) +} + +let nanoid = (size = 21) => + random((size |= 0)).then(bytes => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + while (size--) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + id += urlAlphabet[bytes[size] & 63] + } + return id + }) + +module.exports = { nanoid, customAlphabet, random } diff --git a/seller_1/node_modules/nanoid/async/index.d.ts b/seller_1/node_modules/nanoid/async/index.d.ts new file mode 100644 index 0000000..9e91965 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.d.ts @@ -0,0 +1,56 @@ +/** + * Generate secure URL-friendly unique ID. The non-blocking version. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid/async' + * nanoid().then(id => { + * model.id = id + * }) + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A promise with a random string. + */ +export function nanoid(size?: number): Promise<string> + +/** + * A low-level function. + * Generate secure unique ID with custom alphabet. The non-blocking version. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A function that returns a promise with a random string. + * + * ```js + * import { customAlphabet } from 'nanoid/async' + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid().then(id => { + * model.id = id //=> "8ё56а" + * }) + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => Promise<string> + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { random } from 'nanoid/async' + * random(5).then(bytes => { + * bytes //=> [10, 67, 212, 67, 89] + * }) + * ``` + * + * @param bytes Size of the array. + * @returns A promise with a random bytes array. + */ +export function random(bytes: number): Promise<Uint8Array> diff --git a/seller_1/node_modules/nanoid/async/index.js b/seller_1/node_modules/nanoid/async/index.js new file mode 100644 index 0000000..7f2eae9 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.js @@ -0,0 +1,71 @@ +import crypto from 'crypto' + +import { urlAlphabet } from '../url-alphabet/index.js' + +// `crypto.randomFill()` is a little faster than `crypto.randomBytes()`, +// because it is possible to use in combination with `Buffer.allocUnsafe()`. +let random = bytes => + new Promise((resolve, reject) => { + // `Buffer.allocUnsafe()` is faster because it doesn’t flush the memory. + // Memory flushing is unnecessary since the buffer allocation itself resets + // the memory with the new bytes. + crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { + if (err) { + reject(err) + } else { + resolve(buf) + } + }) + }) + +let customAlphabet = (alphabet, defaultSize = 21) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = step + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length >= size) return id + } + return tick(id, size) + }) + + return size => tick('', size) +} + +let nanoid = (size = 21) => + random((size |= 0)).then(bytes => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + while (size--) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + id += urlAlphabet[bytes[size] & 63] + } + return id + }) + +export { nanoid, customAlphabet, random } diff --git a/seller_1/node_modules/nanoid/async/index.native.js b/seller_1/node_modules/nanoid/async/index.native.js new file mode 100644 index 0000000..a765de9 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/index.native.js @@ -0,0 +1,57 @@ +import { getRandomBytesAsync } from 'expo-random' + +import { urlAlphabet } from '../url-alphabet/index.js' + +let random = getRandomBytesAsync + +let customAlphabet = (alphabet, defaultSize = 21) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = step + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length >= size) return id + } + return tick(id, size) + }) + + return size => tick('', size) +} + +let nanoid = (size = 21) => + random((size |= 0)).then(bytes => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + while (size--) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + id += urlAlphabet[bytes[size] & 63] + } + return id + }) + +export { nanoid, customAlphabet, random } diff --git a/seller_1/node_modules/nanoid/async/package.json b/seller_1/node_modules/nanoid/async/package.json new file mode 100644 index 0000000..578cdb4 --- /dev/null +++ b/seller_1/node_modules/nanoid/async/package.json @@ -0,0 +1,12 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": { + "./index.js": "./index.native.js" + }, + "browser": { + "./index.js": "./index.browser.js", + "./index.cjs": "./index.browser.cjs" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/nanoid/bin/nanoid.cjs b/seller_1/node_modules/nanoid/bin/nanoid.cjs new file mode 100644 index 0000000..c76db0f --- /dev/null +++ b/seller_1/node_modules/nanoid/bin/nanoid.cjs @@ -0,0 +1,55 @@ +#!/usr/bin/env node + +let { nanoid, customAlphabet } = require('..') + +function print(msg) { + process.stdout.write(msg + '\n') +} + +function error(msg) { + process.stderr.write(msg + '\n') + process.exit(1) +} + +if (process.argv.includes('--help') || process.argv.includes('-h')) { + print(` + Usage + $ nanoid [options] + + Options + -s, --size Generated ID size + -a, --alphabet Alphabet to use + -h, --help Show this help + + Examples + $ nanoid --s 15 + S9sBF77U6sDB8Yg + + $ nanoid --size 10 --alphabet abc + bcabababca`) + process.exit() +} + +let alphabet, size +for (let i = 2; i < process.argv.length; i++) { + let arg = process.argv[i] + if (arg === '--size' || arg === '-s') { + size = Number(process.argv[i + 1]) + i += 1 + if (Number.isNaN(size) || size <= 0) { + error('Size must be positive integer') + } + } else if (arg === '--alphabet' || arg === '-a') { + alphabet = process.argv[i + 1] + i += 1 + } else { + error('Unknown argument ' + arg) + } +} + +if (alphabet) { + let customNanoid = customAlphabet(alphabet, size) + print(customNanoid()) +} else { + print(nanoid(size)) +} diff --git a/seller_1/node_modules/nanoid/index.browser.cjs b/seller_1/node_modules/nanoid/index.browser.cjs new file mode 100644 index 0000000..d21a91f --- /dev/null +++ b/seller_1/node_modules/nanoid/index.browser.cjs @@ -0,0 +1,72 @@ +// This file replaces `index.js` in bundlers like webpack or Rollup, +// according to `browser` config in `package.json`. + +let { urlAlphabet } = require('./url-alphabet/index.cjs') + +let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) + +let customRandom = (alphabet, defaultSize, getRandom) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + // `Math.clz32` is not used, because it is not available in browsers. + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + + // `-~f => Math.ceil(f)` if f is a float + // `-~i => i + 1` if i is an integer + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + // A compact alternative for `for (var i = 0; i < step; i++)`. + let j = step | 0 + while (j--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[j] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) + +let nanoid = (size = 21) => + crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + byte &= 63 + if (byte < 36) { + // `0-9a-z` + id += byte.toString(36) + } else if (byte < 62) { + // `A-Z` + id += (byte - 26).toString(36).toUpperCase() + } else if (byte > 62) { + id += '-' + } else { + id += '_' + } + return id + }, '') + +module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/seller_1/node_modules/nanoid/index.browser.js b/seller_1/node_modules/nanoid/index.browser.js new file mode 100644 index 0000000..732e504 --- /dev/null +++ b/seller_1/node_modules/nanoid/index.browser.js @@ -0,0 +1,72 @@ +// This file replaces `index.js` in bundlers like webpack or Rollup, +// according to `browser` config in `package.json`. + +import { urlAlphabet } from './url-alphabet/index.js' + +let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) + +let customRandom = (alphabet, defaultSize, getRandom) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + // `Math.clz32` is not used, because it is not available in browsers. + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + + // `-~f => Math.ceil(f)` if f is a float + // `-~i => i + 1` if i is an integer + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + // A compact alternative for `for (var i = 0; i < step; i++)`. + let j = step | 0 + while (j--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[j] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) + +let nanoid = (size = 21) => + crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + byte &= 63 + if (byte < 36) { + // `0-9a-z` + id += byte.toString(36) + } else if (byte < 62) { + // `A-Z` + id += (byte - 26).toString(36).toUpperCase() + } else if (byte > 62) { + id += '-' + } else { + id += '_' + } + return id + }, '') + +export { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/seller_1/node_modules/nanoid/index.cjs b/seller_1/node_modules/nanoid/index.cjs new file mode 100644 index 0000000..c20e374 --- /dev/null +++ b/seller_1/node_modules/nanoid/index.cjs @@ -0,0 +1,85 @@ +let crypto = require('crypto') + +let { urlAlphabet } = require('./url-alphabet/index.cjs') + +// It is best to make fewer, larger requests to the crypto module to +// avoid system call overhead. So, random numbers are generated in a +// pool. The pool is a Buffer that is larger than the initial random +// request size by this multiplier. The pool is enlarged if subsequent +// requests exceed the maximum buffer size. +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset + +let fillPool = bytes => { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + crypto.randomFillSync(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + crypto.randomFillSync(pool) + poolOffset = 0 + } + poolOffset += bytes +} + +let random = bytes => { + // `|=` convert `bytes` to number to prevent `valueOf` abusing and pool pollution + fillPool((bytes |= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} + +let customRandom = (alphabet, defaultSize, getRandom) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + // A compact alternative for `for (let i = 0; i < step; i++)`. + let i = step + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) + +let nanoid = (size = 21) => { + // `|=` convert `size` to number to prevent `valueOf` abusing and pool pollution + fillPool((size |= 0)) + let id = '' + // We are reading directly from the random pool to avoid creating new array + for (let i = poolOffset - size; i < poolOffset; i++) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + id += urlAlphabet[pool[i] & 63] + } + return id +} + +module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/seller_1/node_modules/nanoid/index.d.cts b/seller_1/node_modules/nanoid/index.d.cts new file mode 100644 index 0000000..3e111a3 --- /dev/null +++ b/seller_1/node_modules/nanoid/index.d.cts @@ -0,0 +1,91 @@ +/** + * Generate secure URL-friendly unique ID. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A random string. + */ +export function nanoid(size?: number): string + +/** + * Generate secure unique ID with custom alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A random string generator. + * + * ```js + * const { customAlphabet } = require('nanoid') + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid() //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => string + +/** + * Generate unique ID with custom random generator and alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * ```js + * import { customRandom } from 'nanoid/format' + * + * const nanoid = customRandom('abcdef', 5, size => { + * const random = [] + * for (let i = 0; i < size; i++) { + * random.push(randomByte()) + * } + * return random + * }) + * + * nanoid() //=> "fbaef" + * ``` + * + * @param alphabet Alphabet used to generate a random string. + * @param size Size of the random string. + * @param random A random bytes generator. + * @returns A random string generator. + */ +export function customRandom( + alphabet: string, + size: number, + random: (bytes: number) => Uint8Array +): () => string + +/** + * URL safe symbols. + * + * ```js + * import { urlAlphabet } from 'nanoid' + * const nanoid = customAlphabet(urlAlphabet, 10) + * nanoid() //=> "Uakgb_J5m9" + * ``` + */ +export const urlAlphabet: string + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { customRandom, random } from 'nanoid' + * const nanoid = customRandom("abcdef", 5, random) + * ``` + * + * @param bytes Size of the array. + * @returns An array of random bytes. + */ +export function random(bytes: number): Uint8Array diff --git a/seller_1/node_modules/nanoid/index.d.ts b/seller_1/node_modules/nanoid/index.d.ts new file mode 100644 index 0000000..3e111a3 --- /dev/null +++ b/seller_1/node_modules/nanoid/index.d.ts @@ -0,0 +1,91 @@ +/** + * Generate secure URL-friendly unique ID. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A random string. + */ +export function nanoid(size?: number): string + +/** + * Generate secure unique ID with custom alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A random string generator. + * + * ```js + * const { customAlphabet } = require('nanoid') + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid() //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => string + +/** + * Generate unique ID with custom random generator and alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * ```js + * import { customRandom } from 'nanoid/format' + * + * const nanoid = customRandom('abcdef', 5, size => { + * const random = [] + * for (let i = 0; i < size; i++) { + * random.push(randomByte()) + * } + * return random + * }) + * + * nanoid() //=> "fbaef" + * ``` + * + * @param alphabet Alphabet used to generate a random string. + * @param size Size of the random string. + * @param random A random bytes generator. + * @returns A random string generator. + */ +export function customRandom( + alphabet: string, + size: number, + random: (bytes: number) => Uint8Array +): () => string + +/** + * URL safe symbols. + * + * ```js + * import { urlAlphabet } from 'nanoid' + * const nanoid = customAlphabet(urlAlphabet, 10) + * nanoid() //=> "Uakgb_J5m9" + * ``` + */ +export const urlAlphabet: string + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { customRandom, random } from 'nanoid' + * const nanoid = customRandom("abcdef", 5, random) + * ``` + * + * @param bytes Size of the array. + * @returns An array of random bytes. + */ +export function random(bytes: number): Uint8Array diff --git a/seller_1/node_modules/nanoid/index.js b/seller_1/node_modules/nanoid/index.js new file mode 100644 index 0000000..5203a4c --- /dev/null +++ b/seller_1/node_modules/nanoid/index.js @@ -0,0 +1,85 @@ +import crypto from 'crypto' + +import { urlAlphabet } from './url-alphabet/index.js' + +// It is best to make fewer, larger requests to the crypto module to +// avoid system call overhead. So, random numbers are generated in a +// pool. The pool is a Buffer that is larger than the initial random +// request size by this multiplier. The pool is enlarged if subsequent +// requests exceed the maximum buffer size. +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset + +let fillPool = bytes => { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + crypto.randomFillSync(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + crypto.randomFillSync(pool) + poolOffset = 0 + } + poolOffset += bytes +} + +let random = bytes => { + // `|=` convert `bytes` to number to prevent `valueOf` abusing and pool pollution + fillPool((bytes |= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} + +let customRandom = (alphabet, defaultSize, getRandom) => { + // First, a bitmask is necessary to generate the ID. The bitmask makes bytes + // values closer to the alphabet size. The bitmask calculates the closest + // `2^31 - 1` number, which exceeds the alphabet size. + // For example, the bitmask for the alphabet size 30 is 31 (00011111). + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + // Though, the bitmask solution is not perfect since the bytes exceeding + // the alphabet size are refused. Therefore, to reliably generate the ID, + // the random bytes redundancy has to be satisfied. + + // Note: every hardware random generator call is performance expensive, + // because the system call for entropy collection takes a lot of time. + // So, to avoid additional system calls, extra bytes are requested in advance. + + // Next, a step determines how many random bytes to generate. + // The number of random bytes gets decided upon the ID size, mask, + // alphabet size, and magic number 1.6 (using 1.6 peaks at performance + // according to benchmarks). + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + // A compact alternative for `for (let i = 0; i < step; i++)`. + let i = step + while (i--) { + // Adding `|| ''` refuses a random byte that exceeds the alphabet size. + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} + +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) + +let nanoid = (size = 21) => { + // `|=` convert `size` to number to prevent `valueOf` abusing and pool pollution + fillPool((size |= 0)) + let id = '' + // We are reading directly from the random pool to avoid creating new array + for (let i = poolOffset - size; i < poolOffset; i++) { + // It is incorrect to use bytes exceeding the alphabet size. + // The following mask reduces the random byte in the 0-255 value + // range to the 0-63 value range. Therefore, adding hacks, such + // as empty string fallback or magic numbers, is unneccessary because + // the bitmask trims bytes down to the alphabet size. + id += urlAlphabet[pool[i] & 63] + } + return id +} + +export { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/seller_1/node_modules/nanoid/nanoid.js b/seller_1/node_modules/nanoid/nanoid.js new file mode 100644 index 0000000..ec242ea --- /dev/null +++ b/seller_1/node_modules/nanoid/nanoid.js @@ -0,0 +1 @@ +export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),""); \ No newline at end of file diff --git a/seller_1/node_modules/nanoid/non-secure/index.cjs b/seller_1/node_modules/nanoid/non-secure/index.cjs new file mode 100644 index 0000000..d51fcb6 --- /dev/null +++ b/seller_1/node_modules/nanoid/non-secure/index.cjs @@ -0,0 +1,34 @@ +// This alphabet uses `A-Za-z0-9_-` symbols. +// The order of characters is optimized for better gzip and brotli compression. +// References to the same file (works both for gzip and brotli): +// `'use`, `andom`, and `rict'` +// References to the brotli default dictionary: +// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf` +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + +let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = size | 0 + while (i--) { + // `| 0` is more compact and faster than `Math.floor()`. + id += alphabet[(Math.random() * alphabet.length) | 0] + } + return id + } +} + +let nanoid = (size = 21) => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = size | 0 + while (i--) { + // `| 0` is more compact and faster than `Math.floor()`. + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id +} + +module.exports = { nanoid, customAlphabet } diff --git a/seller_1/node_modules/nanoid/non-secure/index.d.ts b/seller_1/node_modules/nanoid/non-secure/index.d.ts new file mode 100644 index 0000000..4965322 --- /dev/null +++ b/seller_1/node_modules/nanoid/non-secure/index.d.ts @@ -0,0 +1,33 @@ +/** + * Generate URL-friendly unique ID. This method uses the non-secure + * predictable random generator with bigger collision probability. + * + * ```js + * import { nanoid } from 'nanoid/non-secure' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A random string. + */ +export function nanoid(size?: number): string + +/** + * Generate a unique ID based on a custom alphabet. + * This method uses the non-secure predictable random generator + * with bigger collision probability. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A random string generator. + * + * ```js + * import { customAlphabet } from 'nanoid/non-secure' + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * model.id = //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => string diff --git a/seller_1/node_modules/nanoid/non-secure/index.js b/seller_1/node_modules/nanoid/non-secure/index.js new file mode 100644 index 0000000..fcb3e25 --- /dev/null +++ b/seller_1/node_modules/nanoid/non-secure/index.js @@ -0,0 +1,34 @@ +// This alphabet uses `A-Za-z0-9_-` symbols. +// The order of characters is optimized for better gzip and brotli compression. +// References to the same file (works both for gzip and brotli): +// `'use`, `andom`, and `rict'` +// References to the brotli default dictionary: +// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf` +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + +let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = size | 0 + while (i--) { + // `| 0` is more compact and faster than `Math.floor()`. + id += alphabet[(Math.random() * alphabet.length) | 0] + } + return id + } +} + +let nanoid = (size = 21) => { + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = size | 0 + while (i--) { + // `| 0` is more compact and faster than `Math.floor()`. + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id +} + +export { nanoid, customAlphabet } diff --git a/seller_1/node_modules/nanoid/non-secure/package.json b/seller_1/node_modules/nanoid/non-secure/package.json new file mode 100644 index 0000000..9930d6a --- /dev/null +++ b/seller_1/node_modules/nanoid/non-secure/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": "index.js" +} \ No newline at end of file diff --git a/seller_1/node_modules/nanoid/package.json b/seller_1/node_modules/nanoid/package.json new file mode 100644 index 0000000..b238dca --- /dev/null +++ b/seller_1/node_modules/nanoid/package.json @@ -0,0 +1,88 @@ +{ + "name": "nanoid", + "version": "3.3.8", + "description": "A tiny (116 bytes), secure URL-friendly unique string ID generator", + "keywords": [ + "uuid", + "random", + "id", + "url" + ], + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik <andrey@sitnik.ru>", + "license": "MIT", + "repository": "ai/nanoid", + "browser": { + "./index.js": "./index.browser.js", + "./async/index.js": "./async/index.browser.js", + "./async/index.cjs": "./async/index.browser.cjs", + "./index.cjs": "./index.browser.cjs" + }, + "react-native": "index.js", + "bin": "./bin/nanoid.cjs", + "sideEffects": false, + "types": "./index.d.ts", + "type": "module", + "main": "index.cjs", + "module": "index.js", + "exports": { + ".": { + "browser": "./index.browser.js", + "require": { + "types": "./index.d.cts", + "default": "./index.cjs" + }, + "import": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "default": "./index.js" + }, + "./package.json": "./package.json", + "./async/package.json": "./async/package.json", + "./async": { + "browser": "./async/index.browser.js", + "require": { + "types": "./index.d.cts", + "default": "./async/index.cjs" + }, + "import": { + "types": "./index.d.ts", + "default": "./async/index.js" + }, + "default": "./async/index.js" + }, + "./non-secure/package.json": "./non-secure/package.json", + "./non-secure": { + "require": { + "types": "./index.d.cts", + "default": "./non-secure/index.cjs" + }, + "import": { + "types": "./index.d.ts", + "default": "./non-secure/index.js" + }, + "default": "./non-secure/index.js" + }, + "./url-alphabet/package.json": "./url-alphabet/package.json", + "./url-alphabet": { + "require": { + "types": "./index.d.cts", + "default": "./url-alphabet/index.cjs" + }, + "import": { + "types": "./index.d.ts", + "default": "./url-alphabet/index.js" + }, + "default": "./url-alphabet/index.js" + } + } +} \ No newline at end of file diff --git a/seller_1/node_modules/nanoid/url-alphabet/index.cjs b/seller_1/node_modules/nanoid/url-alphabet/index.cjs new file mode 100644 index 0000000..a332f0b --- /dev/null +++ b/seller_1/node_modules/nanoid/url-alphabet/index.cjs @@ -0,0 +1,7 @@ +// This alphabet uses `A-Za-z0-9_-` symbols. +// The order of characters is optimized for better gzip and brotli compression. +// Same as in non-secure/index.js +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + +module.exports = { urlAlphabet } diff --git a/seller_1/node_modules/nanoid/url-alphabet/index.js b/seller_1/node_modules/nanoid/url-alphabet/index.js new file mode 100644 index 0000000..27efec8 --- /dev/null +++ b/seller_1/node_modules/nanoid/url-alphabet/index.js @@ -0,0 +1,7 @@ +// This alphabet uses `A-Za-z0-9_-` symbols. +// The order of characters is optimized for better gzip and brotli compression. +// Same as in non-secure/index.js +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + +export { urlAlphabet } diff --git a/seller_1/node_modules/nanoid/url-alphabet/package.json b/seller_1/node_modules/nanoid/url-alphabet/package.json new file mode 100644 index 0000000..9930d6a --- /dev/null +++ b/seller_1/node_modules/nanoid/url-alphabet/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": "index.js" +} \ No newline at end of file diff --git a/seller_1/node_modules/picocolors/LICENSE b/seller_1/node_modules/picocolors/LICENSE new file mode 100644 index 0000000..46c9b95 --- /dev/null +++ b/seller_1/node_modules/picocolors/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/seller_1/node_modules/picocolors/README.md b/seller_1/node_modules/picocolors/README.md new file mode 100644 index 0000000..8e47aa8 --- /dev/null +++ b/seller_1/node_modules/picocolors/README.md @@ -0,0 +1,21 @@ +# picocolors + +The tiniest and the fastest library for terminal output formatting with ANSI colors. + +```javascript +import pc from "picocolors" + +console.log( + pc.green(`How are ${pc.italic(`you`)} doing?`) +) +``` + +- **No dependencies.** +- **14 times** smaller and **2 times** faster than chalk. +- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. +- Node.js v6+ & browsers support. Support for both CJS and ESM projects. +- TypeScript type declarations included. +- [`NO_COLOR`](https://no-color.org/) friendly. + +## Docs +Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/seller_1/node_modules/picocolors/package.json b/seller_1/node_modules/picocolors/package.json new file mode 100644 index 0000000..372d4b6 --- /dev/null +++ b/seller_1/node_modules/picocolors/package.json @@ -0,0 +1,25 @@ +{ + "name": "picocolors", + "version": "1.1.1", + "main": "./picocolors.js", + "types": "./picocolors.d.ts", + "browser": { + "./picocolors.js": "./picocolors.browser.js" + }, + "sideEffects": false, + "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", + "files": [ + "picocolors.*", + "types.d.ts" + ], + "keywords": [ + "terminal", + "colors", + "formatting", + "cli", + "console" + ], + "author": "Alexey Raspopov", + "repository": "alexeyraspopov/picocolors", + "license": "ISC" +} diff --git a/seller_1/node_modules/picocolors/picocolors.browser.js b/seller_1/node_modules/picocolors/picocolors.browser.js new file mode 100644 index 0000000..9dcf637 --- /dev/null +++ b/seller_1/node_modules/picocolors/picocolors.browser.js @@ -0,0 +1,4 @@ +var x=String; +var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}}; +module.exports=create(); +module.exports.createColors = create; diff --git a/seller_1/node_modules/picocolors/picocolors.d.ts b/seller_1/node_modules/picocolors/picocolors.d.ts new file mode 100644 index 0000000..94e146a --- /dev/null +++ b/seller_1/node_modules/picocolors/picocolors.d.ts @@ -0,0 +1,5 @@ +import { Colors } from "./types" + +declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } + +export = picocolors diff --git a/seller_1/node_modules/picocolors/picocolors.js b/seller_1/node_modules/picocolors/picocolors.js new file mode 100644 index 0000000..e32df85 --- /dev/null +++ b/seller_1/node_modules/picocolors/picocolors.js @@ -0,0 +1,75 @@ +let p = process || {}, argv = p.argv || [], env = p.env || {} +let isColorSupported = + !(!!env.NO_COLOR || argv.includes("--no-color")) && + (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI) + +let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length) + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + } + +let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0 + do { + result += string.substring(cursor, index) + replace + cursor = index + close.length + index = string.indexOf(close, cursor) + } while (~index) + return result + string.substring(cursor) +} + +let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } +} + +module.exports = createColors() +module.exports.createColors = createColors diff --git a/seller_1/node_modules/picocolors/types.d.ts b/seller_1/node_modules/picocolors/types.d.ts new file mode 100644 index 0000000..cd1aec4 --- /dev/null +++ b/seller_1/node_modules/picocolors/types.d.ts @@ -0,0 +1,51 @@ +export type Formatter = (input: string | number | null | undefined) => string + +export interface Colors { + isColorSupported: boolean + + reset: Formatter + bold: Formatter + dim: Formatter + italic: Formatter + underline: Formatter + inverse: Formatter + hidden: Formatter + strikethrough: Formatter + + black: Formatter + red: Formatter + green: Formatter + yellow: Formatter + blue: Formatter + magenta: Formatter + cyan: Formatter + white: Formatter + gray: Formatter + + bgBlack: Formatter + bgRed: Formatter + bgGreen: Formatter + bgYellow: Formatter + bgBlue: Formatter + bgMagenta: Formatter + bgCyan: Formatter + bgWhite: Formatter + + blackBright: Formatter + redBright: Formatter + greenBright: Formatter + yellowBright: Formatter + blueBright: Formatter + magentaBright: Formatter + cyanBright: Formatter + whiteBright: Formatter + + bgBlackBright: Formatter + bgRedBright: Formatter + bgGreenBright: Formatter + bgYellowBright: Formatter + bgBlueBright: Formatter + bgMagentaBright: Formatter + bgCyanBright: Formatter + bgWhiteBright: Formatter +} diff --git a/seller_1/node_modules/pinia/LICENSE b/seller_1/node_modules/pinia/LICENSE new file mode 100644 index 0000000..0c77562 --- /dev/null +++ b/seller_1/node_modules/pinia/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-present Eduardo San Martin Morote + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/seller_1/node_modules/pinia/README.md b/seller_1/node_modules/pinia/README.md new file mode 100644 index 0000000..d73d322 --- /dev/null +++ b/seller_1/node_modules/pinia/README.md @@ -0,0 +1,24 @@ +<p align="center"> + <a href="https://pinia.vuejs.org" target="_blank" rel="noopener noreferrer"> + <img width="180" src="https://pinia.vuejs.org/logo.svg" alt="Pinia logo"> + </a> +</p> + +# Pinia + +> Intuitive, type safe and flexible Store for Vue + +## 👉 [Demo with Vue 3 on StackBlitz](https://stackblitz.com/github/piniajs/example-vue-3-vite) + +## Help me keep working on this project 💚 + +- [Become a Sponsor on GitHub](https://github.com/sponsors/posva) +- [One-time donation via PayPal](https://paypal.me/posva) + +## Documentation + +To learn more about Pinia, check [its documentation](https://pinia.vuejs.org). + +## License + +[MIT](http://opensource.org/licenses/MIT) diff --git a/seller_1/node_modules/pinia/dist/pinia.cjs b/seller_1/node_modules/pinia/dist/pinia.cjs new file mode 100644 index 0000000..c1cc6c9 --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.cjs @@ -0,0 +1,2061 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +'use strict'; + +var vueDemi = require('vue-demi'); +var devtoolsApi = require('@vue/devtools-api'); + +/** + * setActivePinia must be called to handle SSR at the top of functions like + * `fetch`, `setup`, `serverPrefetch` and others + */ +let activePinia; +/** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ +// @ts-expect-error: cannot constrain the type of the return +const setActivePinia = (pinia) => (activePinia = pinia); +/** + * Get the currently active pinia if there is any. + */ +const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; +const piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol()); + +function isPlainObject( +// eslint-disable-next-line @typescript-eslint/no-explicit-any +o) { + return (o && + typeof o === 'object' && + Object.prototype.toString.call(o) === '[object Object]' && + typeof o.toJSON !== 'function'); +} +// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> } +// TODO: can we change these to numbers? +/** + * Possible types for SubscriptionCallback + */ +exports.MutationType = void 0; +(function (MutationType) { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + MutationType["direct"] = "direct"; + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + MutationType["patchObject"] = "patch object"; + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + MutationType["patchFunction"] = "patch function"; + // maybe reset? for $state = {} and $reset +})(exports.MutationType || (exports.MutationType = {})); + +const IS_CLIENT = typeof window !== 'undefined'; + +/* + * FileSaver.js A saveAs() FileSaver implementation. + * + * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin + * Morote. + * + * License : MIT + */ +// The one and only way of getting global scope in all environments +// https://stackoverflow.com/q/3277182/1008999 +const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window + ? window + : typeof self === 'object' && self.self === self + ? self + : typeof global === 'object' && global.global === global + ? global + : typeof globalThis === 'object' + ? globalThis + : { HTMLElement: null })(); +function bom(blob, { autoBom = false } = {}) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (autoBom && + /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); + } + return blob; +} +function download(url, name, opts) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + xhr.onerror = function () { + console.error('could not download file'); + }; + xhr.send(); +} +function corsEnabled(url) { + const xhr = new XMLHttpRequest(); + // use sync to avoid popup blocker + xhr.open('HEAD', url, false); + try { + xhr.send(); + } + catch (e) { } + return xhr.status >= 200 && xhr.status <= 299; +} +// `a.click()` doesn't work for all browsers (#465) +function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } + catch (e) { + const evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } +} +const _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' }; +// Detect WebView inside a native macOS app by ruling out all browsers +// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too +// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos +const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && + /AppleWebKit/.test(_navigator.userAgent) && + !/Safari/.test(_navigator.userAgent))(); +const saveAs = !IS_CLIENT + ? () => { } // noop + : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program + typeof HTMLAnchorElement !== 'undefined' && + 'download' in HTMLAnchorElement.prototype && + !isMacOSWebView + ? downloadSaveAs + : // Use msSaveOrOpenBlob as a second approach + 'msSaveOrOpenBlob' in _navigator + ? msSaveAs + : // Fallback to using FileReader and a popup + fileSaverSaveAs; +function downloadSaveAs(blob, name = 'download', opts) { + const a = document.createElement('a'); + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + if (a.origin !== location.origin) { + if (corsEnabled(a.href)) { + download(blob, name, opts); + } + else { + a.target = '_blank'; + click(a); + } + } + else { + click(a); + } + } + else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4e4); // 40s + setTimeout(function () { + click(a); + }, 0); + } +} +function msSaveAs(blob, name = 'download', opts) { + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } + else { + const a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } + else { + // @ts-ignore: works on windows + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } +} +function fileSaverSaveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + if (typeof blob === 'string') + return download(blob, name, opts); + const force = blob.type === 'application/octet-stream'; + const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; + const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && + typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + const reader = new FileReader(); + reader.onloadend = function () { + let url = reader.result; + if (typeof url !== 'string') { + popup = null; + throw new Error('Wrong reader.result type'); + } + url = isChromeIOS + ? url + : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) { + popup.location.href = url; + } + else { + location.assign(url); + } + popup = null; // reverse-tabnabbing #460 + }; + reader.readAsDataURL(blob); + } + else { + const url = URL.createObjectURL(blob); + if (popup) + popup.location.assign(url); + else + location.href = url; + popup = null; // reverse-tabnabbing #460 + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4e4); // 40s + } +} + +/** + * Shows a toast or console.log + * + * @param message - message to log + * @param type - different color of the tooltip + */ +function toastMessage(message, type) { + const piniaMessage = '🍍 ' + message; + if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { + // No longer available :( + __VUE_DEVTOOLS_TOAST__(piniaMessage, type); + } + else if (type === 'error') { + console.error(piniaMessage); + } + else if (type === 'warn') { + console.warn(piniaMessage); + } + else { + console.log(piniaMessage); + } +} +function isPinia(o) { + return '_a' in o && 'install' in o; +} + +/** + * This file contain devtools actions, they are not Pinia actions. + */ +// --- +function checkClipboardAccess() { + if (!('clipboard' in navigator)) { + toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); + return true; + } +} +function checkNotFocusedError(error) { + if (error instanceof Error && + error.message.toLowerCase().includes('document is not focused')) { + toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); + return true; + } + return false; +} +async function actionGlobalCopyState(pinia) { + if (checkClipboardAccess()) + return; + try { + await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); + toastMessage('Global state copied to clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalPasteState(pinia) { + if (checkClipboardAccess()) + return; + try { + loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); + toastMessage('Global state pasted from clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalSaveState(pinia) { + try { + saveAs(new Blob([JSON.stringify(pinia.state.value)], { + type: 'text/plain;charset=utf-8', + }), 'pinia-state.json'); + } + catch (error) { + toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +let fileInput; +function getFileOpener() { + if (!fileInput) { + fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = '.json'; + } + function openFile() { + return new Promise((resolve, reject) => { + fileInput.onchange = async () => { + const files = fileInput.files; + if (!files) + return resolve(null); + const file = files.item(0); + if (!file) + return resolve(null); + return resolve({ text: await file.text(), file }); + }; + // @ts-ignore: TODO: changed from 4.3 to 4.4 + fileInput.oncancel = () => resolve(null); + fileInput.onerror = reject; + fileInput.click(); + }); + } + return openFile; +} +async function actionGlobalOpenStateFile(pinia) { + try { + const open = getFileOpener(); + const result = await open(); + if (!result) + return; + const { text, file } = result; + loadStoresState(pinia, JSON.parse(text)); + toastMessage(`Global state imported from "${file.name}".`); + } + catch (error) { + toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +function loadStoresState(pinia, state) { + for (const key in state) { + const storeState = pinia.state.value[key]; + // store is already instantiated, patch it + if (storeState) { + Object.assign(storeState, state[key]); + } + else { + // store is not instantiated, set the initial state + pinia.state.value[key] = state[key]; + } + } +} + +function formatDisplay(display) { + return { + _custom: { + display, + }, + }; +} +const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; +const PINIA_ROOT_ID = '_root'; +function formatStoreForInspectorTree(store) { + return isPinia(store) + ? { + id: PINIA_ROOT_ID, + label: PINIA_ROOT_LABEL, + } + : { + id: store.$id, + label: store.$id, + }; +} +function formatStoreForInspectorState(store) { + if (isPinia(store)) { + const storeNames = Array.from(store._s.keys()); + const storeMap = store._s; + const state = { + state: storeNames.map((storeId) => ({ + editable: true, + key: storeId, + value: store.state.value[storeId], + })), + getters: storeNames + .filter((id) => storeMap.get(id)._getters) + .map((id) => { + const store = storeMap.get(id); + return { + editable: false, + key: id, + value: store._getters.reduce((getters, key) => { + getters[key] = store[key]; + return getters; + }, {}), + }; + }), + }; + return state; + } + const state = { + state: Object.keys(store.$state).map((key) => ({ + editable: true, + key, + value: store.$state[key], + })), + }; + // avoid adding empty getters + if (store._getters && store._getters.length) { + state.getters = store._getters.map((getterName) => ({ + editable: false, + key: getterName, + value: store[getterName], + })); + } + if (store._customProperties.size) { + state.customProperties = Array.from(store._customProperties).map((key) => ({ + editable: true, + key, + value: store[key], + })); + } + return state; +} +function formatEventData(events) { + if (!events) + return {}; + if (Array.isArray(events)) { + // TODO: handle add and delete for arrays and objects + return events.reduce((data, event) => { + data.keys.push(event.key); + data.operations.push(event.type); + data.oldValue[event.key] = event.oldValue; + data.newValue[event.key] = event.newValue; + return data; + }, { + oldValue: {}, + keys: [], + operations: [], + newValue: {}, + }); + } + else { + return { + operation: formatDisplay(events.type), + key: formatDisplay(events.key), + oldValue: events.oldValue, + newValue: events.newValue, + }; + } +} +function formatMutationType(type) { + switch (type) { + case exports.MutationType.direct: + return 'mutation'; + case exports.MutationType.patchFunction: + return '$patch'; + case exports.MutationType.patchObject: + return '$patch'; + default: + return 'unknown'; + } +} + +// timeline can be paused when directly changing the state +let isTimelineActive = true; +const componentStateTypes = []; +const MUTATIONS_LAYER_ID = 'pinia:mutations'; +const INSPECTOR_ID = 'pinia'; +const { assign: assign$1 } = Object; +/** + * Gets the displayed name of a store in devtools + * + * @param id - id of the store + * @returns a formatted string + */ +const getStoreType = (id) => '🍍 ' + id; +/** + * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab + * as soon as it is added to the application. + * + * @param app - Vue application + * @param pinia - pinia instance + */ +function registerPiniaDevtools(app, pinia) { + devtoolsApi.setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + }, (api) => { + if (typeof api.now !== 'function') { + toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); + } + api.addTimelineLayer({ + id: MUTATIONS_LAYER_ID, + label: `Pinia 🍍`, + color: 0xe5df88, + }); + api.addInspector({ + id: INSPECTOR_ID, + label: 'Pinia 🍍', + icon: 'storage', + treeFilterPlaceholder: 'Search stores', + actions: [ + { + icon: 'content_copy', + action: () => { + actionGlobalCopyState(pinia); + }, + tooltip: 'Serialize and copy the state', + }, + { + icon: 'content_paste', + action: async () => { + await actionGlobalPasteState(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Replace the state with the content of your clipboard', + }, + { + icon: 'save', + action: () => { + actionGlobalSaveState(pinia); + }, + tooltip: 'Save the state as a JSON file', + }, + { + icon: 'folder_open', + action: async () => { + await actionGlobalOpenStateFile(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Import the state from a JSON file', + }, + ], + nodeActions: [ + { + icon: 'restore', + tooltip: 'Reset the state (with "$reset")', + action: (nodeId) => { + const store = pinia._s.get(nodeId); + if (!store) { + toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); + } + else if (typeof store.$reset !== 'function') { + toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); + } + else { + store.$reset(); + toastMessage(`Store "${nodeId}" reset.`); + } + }, + }, + ], + }); + api.on.inspectComponent((payload, ctx) => { + const proxy = (payload.componentInstance && + payload.componentInstance.proxy); + if (proxy && proxy._pStores) { + const piniaStores = payload.componentInstance.proxy._pStores; + Object.values(piniaStores).forEach((store) => { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'state', + editable: true, + value: store._isOptionsAPI + ? { + _custom: { + value: vueDemi.toRaw(store.$state), + actions: [ + { + icon: 'restore', + tooltip: 'Reset the state of this store', + action: () => store.$reset(), + }, + ], + }, + } + : // NOTE: workaround to unwrap transferred refs + Object.keys(store.$state).reduce((state, key) => { + state[key] = store.$state[key]; + return state; + }, {}), + }); + if (store._getters && store._getters.length) { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'getters', + editable: false, + value: store._getters.reduce((getters, key) => { + try { + getters[key] = store[key]; + } + catch (error) { + // @ts-expect-error: we just want to show it in devtools + getters[key] = error; + } + return getters; + }, {}), + }); + } + }); + } + }); + api.on.getInspectorTree((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + let stores = [pinia]; + stores = stores.concat(Array.from(pinia._s.values())); + payload.rootNodes = (payload.filter + ? stores.filter((store) => '$id' in store + ? store.$id + .toLowerCase() + .includes(payload.filter.toLowerCase()) + : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) + : stores).map(formatStoreForInspectorTree); + } + }); + // Expose pinia instance as $pinia to window + globalThis.$pinia = pinia; + api.on.getInspectorState((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + // this could be the selected store restored for a different project + // so it's better not to say anything here + return; + } + if (inspectedStore) { + // Expose selected store as $store to window + if (payload.nodeId !== PINIA_ROOT_ID) + globalThis.$store = vueDemi.toRaw(inspectedStore); + payload.state = formatStoreForInspectorState(inspectedStore); + } + } + }); + api.on.editInspectorState((payload, ctx) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + return toastMessage(`store "${payload.nodeId}" not found`, 'error'); + } + const { path } = payload; + if (!isPinia(inspectedStore)) { + // access only the state + if (path.length !== 1 || + !inspectedStore._customProperties.has(path[0]) || + path[0] in inspectedStore.$state) { + path.unshift('$state'); + } + } + else { + // Root access, we can omit the `.value` because the devtools API does it for us + path.unshift('state'); + } + isTimelineActive = false; + payload.set(inspectedStore, path, payload.state.value); + isTimelineActive = true; + } + }); + api.on.editComponentState((payload) => { + if (payload.type.startsWith('🍍')) { + const storeId = payload.type.replace(/^🍍\s*/, ''); + const store = pinia._s.get(storeId); + if (!store) { + return toastMessage(`store "${storeId}" not found`, 'error'); + } + const { path } = payload; + if (path[0] !== 'state') { + return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); + } + // rewrite the first entry to be able to directly set the state as + // well as any other path + path[0] = '$state'; + isTimelineActive = false; + payload.set(store, path, payload.state.value); + isTimelineActive = true; + } + }); + }); +} +function addStoreToDevtools(app, store) { + if (!componentStateTypes.includes(getStoreType(store.$id))) { + componentStateTypes.push(getStoreType(store.$id)); + } + devtoolsApi.setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + settings: { + logStoreChanges: { + label: 'Notify about new/deleted stores', + type: 'boolean', + defaultValue: true, + }, + // useEmojis: { + // label: 'Use emojis in messages ⚡️', + // type: 'boolean', + // defaultValue: true, + // }, + }, + }, (api) => { + // gracefully handle errors + const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; + store.$onAction(({ after, onError, name, args }) => { + const groupId = runningActionId++; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛫 ' + name, + subtitle: 'start', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + }, + groupId, + }, + }); + after((result) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛬 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + result, + }, + groupId, + }, + }); + }); + onError((error) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + logType: 'error', + title: '💥 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + error, + }, + groupId, + }, + }); + }); + }, true); + store._customProperties.forEach((name) => { + vueDemi.watch(() => vueDemi.unref(store[name]), (newValue, oldValue) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (isTimelineActive) { + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: 'Change', + subtitle: name, + data: { + newValue, + oldValue, + }, + groupId: activeAction, + }, + }); + } + }, { deep: true }); + }); + store.$subscribe(({ events, type }, state) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (!isTimelineActive) + return; + // rootStore.state[store.id] = state + const eventData = { + time: now(), + title: formatMutationType(type), + data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), + groupId: activeAction, + }; + if (type === exports.MutationType.patchFunction) { + eventData.subtitle = '⤵️'; + } + else if (type === exports.MutationType.patchObject) { + eventData.subtitle = '🧩'; + } + else if (events && !Array.isArray(events)) { + eventData.subtitle = events.type; + } + if (events) { + eventData.data['rawEvent(s)'] = { + _custom: { + display: 'DebuggerEvent', + type: 'object', + tooltip: 'raw DebuggerEvent[]', + value: events, + }, + }; + } + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: eventData, + }); + }, { detached: true, flush: 'sync' }); + const hotUpdate = store._hotUpdate; + store._hotUpdate = vueDemi.markRaw((newStore) => { + hotUpdate(newStore); + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🔥 ' + store.$id, + subtitle: 'HMR update', + data: { + store: formatDisplay(store.$id), + info: formatDisplay(`HMR update`), + }, + }, + }); + // update the devtools too + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }); + const { $dispose } = store; + store.$dispose = () => { + $dispose(); + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`Disposed "${store.$id}" store 🗑`); + }; + // trigger an update so it can display new registered stores + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`"${store.$id}" store installed 🆕`); + }); +} +let runningActionId = 0; +let activeAction; +/** + * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the + * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state + * mutation to the action. + * + * @param store - store to patch + * @param actionNames - list of actionst to patch + */ +function patchActionForGrouping(store, actionNames, wrapWithProxy) { + // original actions of the store as they are given by pinia. We are going to override them + const actions = actionNames.reduce((storeActions, actionName) => { + // use toRaw to avoid tracking #541 + storeActions[actionName] = vueDemi.toRaw(store)[actionName]; + return storeActions; + }, {}); + for (const actionName in actions) { + store[actionName] = function () { + // the running action id is incremented in a before action hook + const _actionId = runningActionId; + const trackedStore = wrapWithProxy + ? new Proxy(store, { + get(...args) { + activeAction = _actionId; + return Reflect.get(...args); + }, + set(...args) { + activeAction = _actionId; + return Reflect.set(...args); + }, + }) + : store; + // For Setup Stores we need https://github.com/tc39/proposal-async-context + activeAction = _actionId; + const retValue = actions[actionName].apply(trackedStore, arguments); + // this is safer as async actions in Setup Stores would associate mutations done outside of the action + activeAction = undefined; + return retValue; + }; + } +} +/** + * pinia.use(devtoolsPlugin) + */ +function devtoolsPlugin({ app, store, options }) { + // HMR module + if (store.$id.startsWith('__hot:')) { + return; + } + // detect option api vs setup api + store._isOptionsAPI = !!options.state; + // Do not overwrite actions mocked by @pinia/testing (#2298) + if (!store._p._testing) { + patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); + // Upgrade the HMR to also update the new actions + const originalHotUpdate = store._hotUpdate; + vueDemi.toRaw(store)._hotUpdate = function (newStore) { + originalHotUpdate.apply(this, arguments); + patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); + }; + } + addStoreToDevtools(app, + // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric? + store); +} + +/** + * Creates a Pinia instance to be used by the application + */ +function createPinia() { + const scope = vueDemi.effectScope(true); + // NOTE: here we could check the window object for a state and directly set it + // if there is anything like it with Vue 3 SSR + const state = scope.run(() => vueDemi.ref({})); + let _p = []; + // plugins added before calling app.use(pinia) + let toBeInstalled = []; + const pinia = vueDemi.markRaw({ + install(app) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + if (!vueDemi.isVue2) { + pinia._a = app; + app.provide(piniaSymbol, pinia); + app.config.globalProperties.$pinia = pinia; + /* istanbul ignore else */ + if ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + registerPiniaDevtools(app, pinia); + } + toBeInstalled.forEach((plugin) => _p.push(plugin)); + toBeInstalled = []; + } + }, + use(plugin) { + if (!this._a && !vueDemi.isVue2) { + toBeInstalled.push(plugin); + } + else { + _p.push(plugin); + } + return this; + }, + _p, + // it's actually undefined here + // @ts-expect-error + _a: null, + _e: scope, + _s: new Map(), + state, + }); + // pinia devtools rely on dev only features so they cannot be forced unless + // the dev build of Vue is used. Avoid old browsers like IE11. + if ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') { + pinia.use(devtoolsPlugin); + } + return pinia; +} +/** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ +function disposePinia(pinia) { + pinia._e.stop(); + pinia._s.clear(); + pinia._p.splice(0); + pinia.state.value = {}; + // @ts-expect-error: non valid + pinia._a = null; +} + +/** + * Checks if a function is a `StoreDefinition`. + * + * @param fn - object to test + * @returns true if `fn` is a StoreDefinition + */ +const isUseStore = (fn) => { + return typeof fn === 'function' && typeof fn.$id === 'string'; +}; +/** + * Mutates in place `newState` with `oldState` to _hot update_ it. It will + * remove any key not existing in `newState` and recursively merge plain + * objects. + * + * @param newState - new state object to be patched + * @param oldState - old state that should be used to patch newState + * @returns - newState + */ +function patchObject(newState, oldState) { + // no need to go through symbols because they cannot be serialized anyway + for (const key in oldState) { + const subPatch = oldState[key]; + // skip the whole sub tree + if (!(key in newState)) { + continue; + } + const targetValue = newState[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + !vueDemi.isRef(subPatch) && + !vueDemi.isReactive(subPatch)) { + newState[key] = patchObject(targetValue, subPatch); + } + else { + // objects are either a bit more complex (e.g. refs) or primitives, so we + // just set the whole thing + if (vueDemi.isVue2) { + vueDemi.set(newState, key, subPatch); + } + else { + newState[key] = subPatch; + } + } + } + return newState; +} +/** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ +function acceptHMRUpdate(initialUseStore, hot) { + // strip as much as possible from iife.prod + if (!(process.env.NODE_ENV !== 'production')) { + return () => { }; + } + return (newModule) => { + const pinia = hot.data.pinia || initialUseStore._pinia; + if (!pinia) { + // this store is still not used + return; + } + // preserve the pinia instance across loads + hot.data.pinia = pinia; + // console.log('got data', newStore) + for (const exportName in newModule) { + const useStore = newModule[exportName]; + // console.log('checking for', exportName) + if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { + // console.log('Accepting update for', useStore.$id) + const id = useStore.$id; + if (id !== initialUseStore.$id) { + console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); + // return import.meta.hot.invalidate() + return hot.invalidate(); + } + const existingStore = pinia._s.get(id); + if (!existingStore) { + console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); + return; + } + useStore(pinia, existingStore); + } + } + }; +} + +const noop = () => { }; +function addSubscription(subscriptions, callback, detached, onCleanup = noop) { + subscriptions.push(callback); + const removeSubscription = () => { + const idx = subscriptions.indexOf(callback); + if (idx > -1) { + subscriptions.splice(idx, 1); + onCleanup(); + } + }; + if (!detached && vueDemi.getCurrentScope()) { + vueDemi.onScopeDispose(removeSubscription); + } + return removeSubscription; +} +function triggerSubscriptions(subscriptions, ...args) { + subscriptions.slice().forEach((callback) => { + callback(...args); + }); +} + +const fallbackRunWithContext = (fn) => fn(); +/** + * Marks a function as an action for `$onAction` + * @internal + */ +const ACTION_MARKER = Symbol(); +/** + * Action name symbol. Allows to add a name to an action after defining it + * @internal + */ +const ACTION_NAME = Symbol(); +function mergeReactiveObjects(target, patchToApply) { + // Handle Map instances + if (target instanceof Map && patchToApply instanceof Map) { + patchToApply.forEach((value, key) => target.set(key, value)); + } + else if (target instanceof Set && patchToApply instanceof Set) { + // Handle Set instances + patchToApply.forEach(target.add, target); + } + // no need to go through symbols because they cannot be serialized anyway + for (const key in patchToApply) { + if (!patchToApply.hasOwnProperty(key)) + continue; + const subPatch = patchToApply[key]; + const targetValue = target[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + target.hasOwnProperty(key) && + !vueDemi.isRef(subPatch) && + !vueDemi.isReactive(subPatch)) { + // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might + // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that + // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. + target[key] = mergeReactiveObjects(targetValue, subPatch); + } + else { + // @ts-expect-error: subPatch is a valid value + target[key] = subPatch; + } + } + return target; +} +const skipHydrateSymbol = (process.env.NODE_ENV !== 'production') + ? Symbol('pinia:skipHydration') + : /* istanbul ignore next */ Symbol(); +/** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ +function skipHydrate(obj) { + return Object.defineProperty(obj, skipHydrateSymbol, {}); +} +/** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ +function shouldHydrate(obj) { + return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); +} +const { assign } = Object; +function isComputed(o) { + return !!(vueDemi.isRef(o) && o.effect); +} +function createOptionsStore(id, options, pinia, hot) { + const { state, actions, getters } = options; + const initialState = pinia.state.value[id]; + let store; + function setup() { + if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, id, state ? state() : {}); + } + else { + pinia.state.value[id] = state ? state() : {}; + } + } + // avoid creating a state in pinia.state.value + const localState = (process.env.NODE_ENV !== 'production') && hot + ? // use ref() to unwrap refs inside state TODO: check if this is still necessary + vueDemi.toRefs(vueDemi.ref(state ? state() : {}).value) + : vueDemi.toRefs(pinia.state.value[id]); + return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { + if ((process.env.NODE_ENV !== 'production') && name in localState) { + console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); + } + computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { + setActivePinia(pinia); + // it was created just before + const store = pinia._s.get(id); + // allow cross using stores + /* istanbul ignore if */ + if (vueDemi.isVue2 && !store._r) + return; + // @ts-expect-error + // return getters![name].call(context, context) + // TODO: avoid reading the getter while assigning with a global variable + return getters[name].call(store, store); + })); + return computedGetters; + }, {})); + } + store = createSetupStore(id, setup, options, pinia, hot, true); + return store; +} +function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { + let scope; + const optionsForPlugin = assign({ actions: {} }, options); + /* istanbul ignore if */ + if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) { + throw new Error('Pinia destroyed'); + } + // watcher options for $subscribe + const $subscribeOptions = { deep: true }; + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production') && !vueDemi.isVue2) { + $subscribeOptions.onTrigger = (event) => { + /* istanbul ignore else */ + if (isListening) { + debuggerEvents = event; + // avoid triggering this while the store is being built and the state is being set in pinia + } + else if (isListening == false && !store._hotUpdating) { + // let patch send all the events together later + /* istanbul ignore else */ + if (Array.isArray(debuggerEvents)) { + debuggerEvents.push(event); + } + else { + console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); + } + } + }; + } + // internal state + let isListening; // set to true at the end + let isSyncListening; // set to true at the end + let subscriptions = []; + let actionSubscriptions = []; + let debuggerEvents; + const initialState = pinia.state.value[$id]; + // avoid setting the state for option stores if it is set + // by the setup + if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, $id, {}); + } + else { + pinia.state.value[$id] = {}; + } + } + const hotState = vueDemi.ref({}); + // avoid triggering too many listeners + // https://github.com/vuejs/pinia/issues/1129 + let activeListener; + function $patch(partialStateOrMutator) { + let subscriptionMutation; + isListening = isSyncListening = false; + // reset the debugger events since patches are sync + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + debuggerEvents = []; + } + if (typeof partialStateOrMutator === 'function') { + partialStateOrMutator(pinia.state.value[$id]); + subscriptionMutation = { + type: exports.MutationType.patchFunction, + storeId: $id, + events: debuggerEvents, + }; + } + else { + mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); + subscriptionMutation = { + type: exports.MutationType.patchObject, + payload: partialStateOrMutator, + storeId: $id, + events: debuggerEvents, + }; + } + const myListenerId = (activeListener = Symbol()); + vueDemi.nextTick().then(() => { + if (activeListener === myListenerId) { + isListening = true; + } + }); + isSyncListening = true; + // because we paused the watcher, we need to manually call the subscriptions + triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); + } + const $reset = isOptionsStore + ? function $reset() { + const { state } = options; + const newState = state ? state() : {}; + // we use a patch to group all changes into one single subscription + this.$patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, newState); + }); + } + : /* istanbul ignore next */ + (process.env.NODE_ENV !== 'production') + ? () => { + throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); + } + : noop; + function $dispose() { + scope.stop(); + subscriptions = []; + actionSubscriptions = []; + pinia._s.delete($id); + } + /** + * Helper that wraps function so it can be tracked with $onAction + * @param fn - action to wrap + * @param name - name of the action + */ + const action = (fn, name = '') => { + if (ACTION_MARKER in fn) { + fn[ACTION_NAME] = name; + return fn; + } + const wrappedAction = function () { + setActivePinia(pinia); + const args = Array.from(arguments); + const afterCallbackList = []; + const onErrorCallbackList = []; + function after(callback) { + afterCallbackList.push(callback); + } + function onError(callback) { + onErrorCallbackList.push(callback); + } + // @ts-expect-error + triggerSubscriptions(actionSubscriptions, { + args, + name: wrappedAction[ACTION_NAME], + store, + after, + onError, + }); + let ret; + try { + ret = fn.apply(this && this.$id === $id ? this : store, args); + // handle sync errors + } + catch (error) { + triggerSubscriptions(onErrorCallbackList, error); + throw error; + } + if (ret instanceof Promise) { + return ret + .then((value) => { + triggerSubscriptions(afterCallbackList, value); + return value; + }) + .catch((error) => { + triggerSubscriptions(onErrorCallbackList, error); + return Promise.reject(error); + }); + } + // trigger after callbacks + triggerSubscriptions(afterCallbackList, ret); + return ret; + }; + wrappedAction[ACTION_MARKER] = true; + wrappedAction[ACTION_NAME] = name; // will be set later + // @ts-expect-error: we are intentionally limiting the returned type to just Fn + // because all the added properties are internals that are exposed through `$onAction()` only + return wrappedAction; + }; + const _hmrPayload = /*#__PURE__*/ vueDemi.markRaw({ + actions: {}, + getters: {}, + state: [], + hotState, + }); + const partialStore = { + _p: pinia, + // _s: scope, + $id, + $onAction: addSubscription.bind(null, actionSubscriptions), + $patch, + $reset, + $subscribe(callback, options = {}) { + const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); + const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { + if (options.flush === 'sync' ? isSyncListening : isListening) { + callback({ + storeId: $id, + type: exports.MutationType.direct, + events: debuggerEvents, + }, state); + } + }, assign({}, $subscribeOptions, options))); + return removeSubscription; + }, + $dispose, + }; + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // start as non ready + partialStore._r = false; + } + const store = vueDemi.reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) + ? assign({ + _hmrPayload, + _customProperties: vueDemi.markRaw(new Set()), // devtools custom properties + }, partialStore + // must be added later + // setupStore + ) + : partialStore); + // store the partial store now so the setup of stores can instantiate each other before they are finished without + // creating infinite loops. + pinia._s.set($id, store); + const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; + // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped + const setupStore = runWithContext(() => pinia._e.run(() => (scope = vueDemi.effectScope()).run(() => setup({ action })))); + // overwrite existing actions to support $onAction + for (const key in setupStore) { + const prop = setupStore[key]; + if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { + // mark it as a piece of state to be serialized + if ((process.env.NODE_ENV !== 'production') && hot) { + vueDemi.set(hotState.value, key, vueDemi.toRef(setupStore, key)); + // createOptionStore directly sets the state in pinia.state.value so we + // can just skip that + } + else if (!isOptionsStore) { + // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created + if (initialState && shouldHydrate(prop)) { + if (vueDemi.isRef(prop)) { + prop.value = initialState[key]; + } + else { + // probably a reactive object, lets recursively assign + // @ts-expect-error: prop is unknown + mergeReactiveObjects(prop, initialState[key]); + } + } + // transfer the ref to the pinia state to keep everything in sync + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value[$id], key, prop); + } + else { + pinia.state.value[$id][key] = prop; + } + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + _hmrPayload.state.push(key); + } + // action + } + else if (typeof prop === 'function') { + const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key); + // this a hot module replacement store because the hotUpdate method needs + // to do it with the right context + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(setupStore, key, actionValue); + } + else { + // @ts-expect-error + setupStore[key] = actionValue; + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + _hmrPayload.actions[key] = prop; + } + // list actions so they can be used in plugins + // @ts-expect-error + optionsForPlugin.actions[key] = prop; + } + else if ((process.env.NODE_ENV !== 'production')) { + // add getters for devtools + if (isComputed(prop)) { + _hmrPayload.getters[key] = isOptionsStore + ? // @ts-expect-error + options.getters[key] + : prop; + if (IS_CLIENT) { + const getters = setupStore._getters || + // @ts-expect-error: same + (setupStore._getters = vueDemi.markRaw([])); + getters.push(key); + } + } + } + } + // add the state, getters, and action properties + /* istanbul ignore if */ + if (vueDemi.isVue2) { + Object.keys(setupStore).forEach((key) => { + vueDemi.set(store, key, setupStore[key]); + }); + } + else { + assign(store, setupStore); + // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. + // Make `storeToRefs()` work with `reactive()` #799 + assign(vueDemi.toRaw(store), setupStore); + } + // use this instead of a computed with setter to be able to create it anywhere + // without linking the computed lifespan to wherever the store is first + // created. + Object.defineProperty(store, '$state', { + get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]), + set: (state) => { + /* istanbul ignore if */ + if ((process.env.NODE_ENV !== 'production') && hot) { + throw new Error('cannot set hotState'); + } + $patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, state); + }); + }, + }); + // add the hotUpdate before plugins to allow them to override it + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + store._hotUpdate = vueDemi.markRaw((newStore) => { + store._hotUpdating = true; + newStore._hmrPayload.state.forEach((stateKey) => { + if (stateKey in store.$state) { + const newStateTarget = newStore.$state[stateKey]; + const oldStateSource = store.$state[stateKey]; + if (typeof newStateTarget === 'object' && + isPlainObject(newStateTarget) && + isPlainObject(oldStateSource)) { + patchObject(newStateTarget, oldStateSource); + } + else { + // transfer the ref + newStore.$state[stateKey] = oldStateSource; + } + } + // patch direct access properties to allow store.stateProperty to work as + // store.$state.stateProperty + vueDemi.set(store, stateKey, vueDemi.toRef(newStore.$state, stateKey)); + }); + // remove deleted state properties + Object.keys(store.$state).forEach((stateKey) => { + if (!(stateKey in newStore.$state)) { + vueDemi.del(store, stateKey); + } + }); + // avoid devtools logging this as a mutation + isListening = false; + isSyncListening = false; + pinia.state.value[$id] = vueDemi.toRef(newStore._hmrPayload, 'hotState'); + isSyncListening = true; + vueDemi.nextTick().then(() => { + isListening = true; + }); + for (const actionName in newStore._hmrPayload.actions) { + const actionFn = newStore[actionName]; + vueDemi.set(store, actionName, action(actionFn, actionName)); + } + // TODO: does this work in both setup and option store? + for (const getterName in newStore._hmrPayload.getters) { + const getter = newStore._hmrPayload.getters[getterName]; + const getterValue = isOptionsStore + ? // special handling of options api + vueDemi.computed(() => { + setActivePinia(pinia); + return getter.call(store, store); + }) + : getter; + vueDemi.set(store, getterName, getterValue); + } + // remove deleted getters + Object.keys(store._hmrPayload.getters).forEach((key) => { + if (!(key in newStore._hmrPayload.getters)) { + vueDemi.del(store, key); + } + }); + // remove old actions + Object.keys(store._hmrPayload.actions).forEach((key) => { + if (!(key in newStore._hmrPayload.actions)) { + vueDemi.del(store, key); + } + }); + // update the values used in devtools and to allow deleting new properties later on + store._hmrPayload = newStore._hmrPayload; + store._getters = newStore._getters; + store._hotUpdating = false; + }); + } + if ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + const nonEnumerable = { + writable: true, + configurable: true, + // avoid warning on devtools trying to display this property + enumerable: false, + }; + ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { + Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); + }); + } + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // mark the store as ready before plugins + store._r = true; + } + // apply all plugins + pinia._p.forEach((extender) => { + /* istanbul ignore else */ + if ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + const extensions = scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + })); + Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); + assign(store, extensions); + } + else { + assign(store, scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + }))); + } + }); + if ((process.env.NODE_ENV !== 'production') && + store.$state && + typeof store.$state === 'object' && + typeof store.$state.constructor === 'function' && + !store.$state.constructor.toString().includes('[native code]')) { + console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + + `\tstate: () => new MyClass()\n` + + `Found in store "${store.$id}".`); + } + // only apply hydrate to option stores with an initial state in pinia + if (initialState && + isOptionsStore && + options.hydrate) { + options.hydrate(store.$state, initialState); + } + isListening = true; + isSyncListening = true; + return store; +} +// allows unused stores to be tree shaken +/*! #__NO_SIDE_EFFECTS__ */ +function defineStore( +// TODO: add proper types from above +idOrOptions, setup, setupOptions) { + let id; + let options; + const isSetupStore = typeof setup === 'function'; + if (typeof idOrOptions === 'string') { + id = idOrOptions; + // the option store setup will contain the actual options in this case + options = isSetupStore ? setupOptions : setup; + } + else { + options = idOrOptions; + id = idOrOptions.id; + if ((process.env.NODE_ENV !== 'production') && typeof id !== 'string') { + throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); + } + } + function useStore(pinia, hot) { + const hasContext = vueDemi.hasInjectionContext(); + pinia = + // in test mode, ignore the argument provided as we can always retrieve a + // pinia instance with getActivePinia() + ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || + (hasContext ? vueDemi.inject(piniaSymbol, null) : null); + if (pinia) + setActivePinia(pinia); + if ((process.env.NODE_ENV !== 'production') && !activePinia) { + throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + + `This will fail in production.`); + } + pinia = activePinia; + if (!pinia._s.has(id)) { + // creating the store registers it in `pinia._s` + if (isSetupStore) { + createSetupStore(id, setup, options, pinia); + } + else { + createOptionsStore(id, options, pinia); + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + // @ts-expect-error: not the right inferred type + useStore._pinia = pinia; + } + } + const store = pinia._s.get(id); + if ((process.env.NODE_ENV !== 'production') && hot) { + const hotId = '__hot:' + id; + const newStore = isSetupStore + ? createSetupStore(hotId, setup, options, pinia, true) + : createOptionsStore(hotId, assign({}, options), pinia, true); + hot._hotUpdate(newStore); + // cleanup the state properties and the store from the cache + delete pinia.state.value[hotId]; + pinia._s.delete(hotId); + } + if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) { + const currentInstance = vueDemi.getCurrentInstance(); + // save stores in instances to access them devtools + if (currentInstance && + currentInstance.proxy && + // avoid adding stores that are just built for hot module replacement + !hot) { + const vm = currentInstance.proxy; + const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); + cache[id] = store; + } + } + // StoreGeneric cannot be casted towards Store + return store; + } + useStore.$id = id; + return useStore; +} + +let mapStoreSuffix = 'Store'; +/** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ +function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS +) { + mapStoreSuffix = suffix; +} +/** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ +function mapStores(...stores) { + if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) { + console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + + `Replace\n` + + `\tmapStores([useAuthStore, useCartStore])\n` + + `with\n` + + `\tmapStores(useAuthStore, useCartStore)\n` + + `This will fail in production if not fixed.`); + stores = stores[0]; + } + return stores.reduce((reduced, useStore) => { + // @ts-expect-error: $id is added by defineStore + reduced[useStore.$id + mapStoreSuffix] = function () { + return useStore(this.$pinia); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = function () { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key]; + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function () { + const store = useStore(this.$pinia); + const storeKey = keysOrMapper[key]; + // for some reason TS is unable to infer the type of storeKey to be a + // function + return typeof storeKey === 'function' + ? storeKey.call(this, store) + : // @ts-expect-error: FIXME: should work? + store[storeKey]; + }; + return reduced; + }, {}); +} +/** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ +const mapGetters = mapState; +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapActions(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key](...args); + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[keysOrMapper[key]](...args); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapWritableState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[key]; + }, + set(value) { + return (useStore(this.$pinia)[key] = value); + }, + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[keysOrMapper[key]]; + }, + set(value) { + return (useStore(this.$pinia)[keysOrMapper[key]] = value); + }, + }; + return reduced; + }, {}); +} + +/** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ +function storeToRefs(store) { + // See https://github.com/vuejs/pinia/issues/852 + // It's easier to just use toRefs() even if it includes more stuff + if (vueDemi.isVue2) { + // @ts-expect-error: toRefs include methods and others + return vueDemi.toRefs(store); + } + else { + const rawStore = vueDemi.toRaw(store); + const refs = {}; + for (const key in rawStore) { + const value = rawStore[key]; + // There is no native method to check for a computed + // https://github.com/vuejs/core/pull/4165 + if (value.effect) { + // @ts-expect-error: too hard to type correctly + refs[key] = + // ... + vueDemi.computed({ + get: () => store[key], + set(value) { + store[key] = value; + }, + }); + } + else if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { + // @ts-expect-error: the key is state or getter + refs[key] = + // --- + vueDemi.toRef(store, key); + } + } + return refs; + } +} + +/** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ +const PiniaVuePlugin = function (_Vue) { + // Equivalent of + // app.config.globalProperties.$pinia = pinia + _Vue.mixin({ + beforeCreate() { + const options = this.$options; + if (options.pinia) { + const pinia = options.pinia; + // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 + /* istanbul ignore else */ + if (!this._provided) { + const provideCache = {}; + Object.defineProperty(this, '_provided', { + get: () => provideCache, + set: (v) => Object.assign(provideCache, v), + }); + } + this._provided[piniaSymbol] = pinia; + // propagate the pinia instance in an SSR friendly way + // avoid adding it to nuxt twice + /* istanbul ignore else */ + if (!this.$pinia) { + this.$pinia = pinia; + } + pinia._a = this; + if (IS_CLIENT) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + } + if ((((process.env.NODE_ENV !== 'production') || false) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + registerPiniaDevtools(pinia._a, pinia); + } + } + else if (!this.$pinia && options.parent && options.parent.$pinia) { + this.$pinia = options.parent.$pinia; + } + }, + destroyed() { + delete this._pStores; + }, + }); +}; + +exports.PiniaVuePlugin = PiniaVuePlugin; +exports.acceptHMRUpdate = acceptHMRUpdate; +exports.createPinia = createPinia; +exports.defineStore = defineStore; +exports.disposePinia = disposePinia; +exports.getActivePinia = getActivePinia; +exports.mapActions = mapActions; +exports.mapGetters = mapGetters; +exports.mapState = mapState; +exports.mapStores = mapStores; +exports.mapWritableState = mapWritableState; +exports.setActivePinia = setActivePinia; +exports.setMapStoreSuffix = setMapStoreSuffix; +exports.shouldHydrate = shouldHydrate; +exports.skipHydrate = skipHydrate; +exports.storeToRefs = storeToRefs; diff --git a/seller_1/node_modules/pinia/dist/pinia.d.ts b/seller_1/node_modules/pinia/dist/pinia.d.ts new file mode 100644 index 0000000..60dd2cb --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.d.ts @@ -0,0 +1,1074 @@ +import { App } from 'vue-demi'; +import { ComputedRef } from 'vue-demi'; +import type { DebuggerEvent } from 'vue-demi'; +import { EffectScope } from 'vue-demi'; +import type { Plugin as Plugin_2 } from 'vue-demi'; +import { Ref } from 'vue-demi'; +import { ToRef } from 'vue-demi'; +import { ToRefs } from 'vue-demi'; +import { UnwrapRef } from 'vue-demi'; +import type { WatchOptions } from 'vue-demi'; +import { WritableComputedRef } from 'vue-demi'; + +/** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ +export declare function acceptHMRUpdate<Id extends string = string, S extends StateTree = StateTree, G extends _GettersTree<S> = _GettersTree<S>, A = _ActionsTree>(initialUseStore: StoreDefinition<Id, S, G, A>, hot: any): (newModule: any) => any; + +/** + * Type of an object of Actions. For internal usage only. + * For internal use **only** + */ +export declare type _ActionsTree = Record<string, _Method>; + +export declare type _Awaited<T> = T extends null | undefined ? T : T extends object & { + then(onfulfilled: infer F): any; +} ? F extends (value: infer V, ...args: any) => any ? _Awaited<V> : never : T; + +/** + * Creates a Pinia instance to be used by the application + */ +export declare function createPinia(): Pinia; + +/** + * Recursive `Partial<T>`. Used by {@link Store['$patch']}. + * + * For internal use **only** + */ +export declare type _DeepPartial<T> = { + [K in keyof T]?: _DeepPartial<T[K]>; +}; + +/** + * Options parameter of `defineStore()` for setup stores. Can be extended to + * augment stores with the plugin API. @see {@link DefineStoreOptionsBase}. + */ +export declare interface DefineSetupStoreOptions<Id extends string, S extends StateTree, G, A> extends DefineStoreOptionsBase<S, Store<Id, S, G, A>> { + /** + * Extracted actions. Added by useStore(). SHOULD NOT be added by the user when + * creating the store. Can be used in plugins to get the list of actions in a + * store defined with a setup function. Note this is always defined + */ + actions?: A; +} + +/** + * Creates a `useStore` function that retrieves the store instance + * + * @param id - id of the store (must be unique) + * @param options - options to define the store + */ +export declare function defineStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(id: Id, options: Omit<DefineStoreOptions<Id, S, G, A>, 'id'>): StoreDefinition<Id, S, G, A>; + +/** + * Creates a `useStore` function that retrieves the store instance + * + * @param options - options to define the store + * + * @deprecated use `defineStore(id, options)` instead + */ +export declare function defineStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(options: DefineStoreOptions<Id, S, G, A>): StoreDefinition<Id, S, G, A>; + +/** + * Creates a `useStore` function that retrieves the store instance + * + * @param id - id of the store (must be unique) + * @param storeSetup - function that defines the store + * @param options - extra options + */ +export declare function defineStore<Id extends string, SS>(id: Id, storeSetup: (helpers: SetupStoreHelpers) => SS, options?: DefineSetupStoreOptions<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>): StoreDefinition<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>>; + +/** + * Options parameter of `defineStore()` for option stores. Can be extended to + * augment stores with the plugin API. @see {@link DefineStoreOptionsBase}. + */ +export declare interface DefineStoreOptions<Id extends string, S extends StateTree, G, A> extends DefineStoreOptionsBase<S, Store<Id, S, G, A>> { + /** + * Unique string key to identify the store across the application. + */ + id: Id; + /** + * Function to create a fresh state. **Must be an arrow function** to ensure + * correct typings! + */ + state?: () => S; + /** + * Optional object of getters. + */ + getters?: G & ThisType<UnwrapRef<S> & _StoreWithGetters<G> & PiniaCustomProperties> & _GettersTree<S>; + /** + * Optional object of actions. + */ + actions?: A & ThisType<A & UnwrapRef<S> & _StoreWithState<Id, S, G, A> & _StoreWithGetters<G> & PiniaCustomProperties>; + /** + * Allows hydrating the store during SSR when complex state (like client side only refs) are used in the store + * definition and copying the value from `pinia.state` isn't enough. + * + * @example + * If in your `state`, you use any `customRef`s, any `computed`s, or any `ref`s that have a different value on + * Server and Client, you need to manually hydrate them. e.g., a custom ref that is stored in the local + * storage: + * + * ```ts + * const useStore = defineStore('main', { + * state: () => ({ + * n: useLocalStorage('key', 0) + * }), + * hydrate(storeState, initialState) { + * // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826 + * storeState.n = useLocalStorage('key', 0) + * } + * }) + * ``` + * + * @param storeState - the current state in the store + * @param initialState - initialState + */ + hydrate?(storeState: UnwrapRef<S>, initialState: UnwrapRef<S>): void; +} + +/** + * Options passed to `defineStore()` that are common between option and setup + * stores. Extend this interface if you want to add custom options to both kinds + * of stores. + */ +export declare interface DefineStoreOptionsBase<S extends StateTree, Store> { +} + +/** + * Available `options` when creating a pinia plugin. + */ +export declare interface DefineStoreOptionsInPlugin<Id extends string, S extends StateTree, G, A> extends Omit<DefineStoreOptions<Id, S, G, A>, 'id' | 'actions'> { + /** + * Extracted object of actions. Added by useStore() when the store is built + * using the setup API, otherwise uses the one passed to `defineStore()`. + * Defaults to an empty object if no actions are defined. + */ + actions: A; +} + +/** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ +export declare function disposePinia(pinia: Pinia): void; + +/** + * For internal use **only** + */ +export declare type _ExtractActionsFromSetupStore<SS> = SS extends undefined | void ? {} : Pick<SS, _ExtractActionsFromSetupStore_Keys<SS>>; + +/** + * Type that enables refactoring through IDE. + * For internal use **only** + */ +export declare type _ExtractActionsFromSetupStore_Keys<SS> = keyof { + [K in keyof SS as SS[K] extends _Method ? K : never]: any; +}; + +/** + * For internal use **only** + */ +export declare type _ExtractGettersFromSetupStore<SS> = SS extends undefined | void ? {} : Pick<SS, _ExtractGettersFromSetupStore_Keys<SS>>; + +/** + * Type that enables refactoring through IDE. + * For internal use **only** + */ +export declare type _ExtractGettersFromSetupStore_Keys<SS> = keyof { + [K in keyof SS as SS[K] extends ComputedRef ? K : never]: any; +}; + +/** + * For internal use **only** + */ +export declare type _ExtractStateFromSetupStore<SS> = SS extends undefined | void ? {} : Pick<SS, _ExtractStateFromSetupStore_Keys<SS>>; + +/** + * Type that enables refactoring through IDE. + * For internal use **only** + */ +export declare type _ExtractStateFromSetupStore_Keys<SS> = keyof { + [K in keyof SS as SS[K] extends _Method | ComputedRef ? never : K]: any; +}; + +/** + * Get the currently active pinia if there is any. + */ +export declare const getActivePinia: () => Pinia | undefined; + +/** + * Type of an object of Getters that infers the argument. For internal usage only. + * For internal use **only** + */ +export declare type _GettersTree<S extends StateTree> = Record<string, ((state: UnwrapRef<S> & UnwrapRef<PiniaCustomStateProperties<S>>) => any) | (() => any)>; + +/** + * Internal utility type + */ +declare type _IfEquals<X, Y, A = true, B = false> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B; + +/** + * Internal utility type + */ +declare type _IsReadonly<T, K extends keyof T> = _IfEquals<{ + [P in K]: T[P]; +}, { + -readonly [P in K]: T[P]; +}, false, // Property is not readonly if they are the same +true>; + +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. The values of the object are the actions while the keys are + * the names of the resulting methods. + * + * @example + * ```js + * export default { + * methods: { + * // other methods properties + * // useCounterStore has two actions named `increment` and `setCount` + * ...mapActions(useCounterStore, { more: 'increment', setIt: 'setCount' }) + * }, + * + * created() { + * this.more() + * this.setIt(2) + * } + * } + * ``` + * + * @param useStore - store to map from + * @param keyMapper - object to define new names for the actions + */ +export declare function mapActions<Id extends string, S extends StateTree, G extends _GettersTree<S>, A, KeyMapper extends Record<string, keyof A>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapActionsObjectReturn<A, KeyMapper>; + +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @example + * ```js + * export default { + * methods: { + * // other methods properties + * ...mapActions(useCounterStore, ['increment', 'setCount']) + * }, + * + * created() { + * this.increment() + * this.setCount(2) // pass arguments as usual + * } + * } + * ``` + * + * @param useStore - store to map from + * @param keys - array of action names to map + */ +export declare function mapActions<Id extends string, S extends StateTree, G extends _GettersTree<S>, A>(useStore: StoreDefinition<Id, S, G, A>, keys: Array<keyof A>): _MapActionsReturn<A>; + +/** + * For internal use **only** + */ +export declare type _MapActionsObjectReturn<A, T extends Record<string, keyof A>> = { + [key in keyof T]: A[T[key]]; +}; + +/** + * For internal use **only** + */ +export declare type _MapActionsReturn<A> = { + [key in keyof A]: A[key]; +}; + +/** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ +export declare const mapGetters: typeof mapState; + +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. The values of the object are the state properties/getters + * while the keys are the names of the resulting computed properties. + * Optionally, you can also pass a custom function that will receive the store + * as its first argument. Note that while it has access to the component + * instance via `this`, it won't be typed. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * // useCounterStore has a state property named `count` and a getter `double` + * ...mapState(useCounterStore, { + * n: 'count', + * triple: store => store.n * 3, + * // note we can't use an arrow function if we want to use `this` + * custom(store) { + * return this.someComponentValue + store.n + * }, + * doubleN: 'double' + * }) + * }, + * + * created() { + * this.n // 2 + * this.doubleN // 4 + * } + * } + * ``` + * + * @param useStore - store to map from + * @param keyMapper - object of state properties or getters + */ +export declare function mapState<Id extends string, S extends StateTree, G extends _GettersTree<S> | { + [key: string]: ComputedRef; +}, A, KeyMapper extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapStateObjectReturn<Id, S, G, A, KeyMapper>; + +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapState(useCounterStore, ['count', 'double']) + * }, + * + * created() { + * this.count // 2 + * this.double // 4 + * } + * } + * ``` + * + * @param useStore - store to map from + * @param keys - array of state properties or getters + */ +export declare function mapState<Id extends string, S extends StateTree, G extends _GettersTree<S> | { + [key: string]: ComputedRef; +}, A, Keys extends keyof S | keyof G>(useStore: StoreDefinition<Id, S, G, A>, keys: readonly Keys[]): _MapStateReturn<S, G, Keys>; + +/** + * For internal use **only** + */ +export declare type _MapStateObjectReturn<Id extends string, S extends StateTree, G extends _GettersTree<S> | { + [key: string]: ComputedRef; +}, A, T extends Record<string, keyof S | keyof G | ((store: Store<Id, S, G, A>) => any)> = {}> = { + [key in keyof T]: () => T[key] extends (store: any) => infer R ? R : T[key] extends keyof Store<Id, S, G, A> ? Store<Id, S, G, A>[T[key]] : never; +}; + +/** + * For internal use **only** + */ +export declare type _MapStateReturn<S extends StateTree, G extends _GettersTree<S> | { + [key: string]: ComputedRef; +}, Keys extends keyof S | keyof G = keyof S | keyof G> = { + [key in Keys]: key extends keyof Store<string, S, G, {}> ? () => Store<string, S, G, {}>[key] : never; +}; + +/** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ +export declare function mapStores<Stores extends any[]>(...stores: [...Stores]): _Spread<Stores>; + +/** + * Interface to allow customizing map helpers. Extend this interface with the + * following properties: + * + * - `suffix`: string. Affects the suffix of `mapStores()`, defaults to `Store`. + */ +export declare interface MapStoresCustomization { +} + +/** + * Same as `mapState()` but creates computed setters as well so the state can be + * modified. Differently from `mapState()`, only `state` properties can be + * added. + * + * @param useStore - store to map from + * @param keyMapper - object of state properties + */ +export declare function mapWritableState<Id extends string, S extends StateTree, G, A, KeyMapper extends Record<string, _MapWritableStateKeys<S, G>>>(useStore: StoreDefinition<Id, S, G, A>, keyMapper: KeyMapper): _MapWritableStateObjectReturn<S, G, KeyMapper>; + +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keys - array of state properties + */ +export declare function mapWritableState<Id extends string, S extends StateTree, G, A, Keys extends _MapWritableStateKeys<S, G>>(useStore: StoreDefinition<Id, S, G, A>, keys: readonly Keys[]): Pick<_MapWritableStateReturn<S, G, Keys>, Keys>; + +/** + * For internal use **only** + */ +declare type _MapWritableStateKeys<S extends StateTree, G> = keyof UnwrapRef<S> | keyof _StoreWithGetters_Writable<G>; + +/** + * For internal use **only** + */ +export declare type _MapWritableStateObjectReturn<S extends StateTree, G, KeyMapper extends Record<string, _MapWritableStateKeys<S, G>>> = { + [key in keyof KeyMapper]: { + get: () => UnwrapRef<(S & G)[KeyMapper[key]]>; + set: (value: UnwrapRef<(S & G)[KeyMapper[key]]>) => any; + }; +}; + +/** + * For internal use **only** + */ +export declare type _MapWritableStateReturn<S extends StateTree, G, Keys extends _MapWritableStateKeys<S, G>> = { + [key in Keys]: { + get: () => UnwrapRef<(S & G)[key]>; + set: (value: UnwrapRef<(S & G)[key]>) => any; + }; +}; + +/** + * Generic type for a function that can infer arguments and return type + * + * For internal use **only** + */ +export declare type _Method = (...args: any[]) => any; + +/** + * Possible types for SubscriptionCallback + */ +export declare enum MutationType { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + direct = "direct", + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + patchObject = "patch object", + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + patchFunction = "patch function" +} + +/** + * Every application must own its own pinia to be able to create stores + */ +export declare interface Pinia { + install: (app: App) => void; + /** + * root state + */ + state: Ref<Record<string, StateTree>>; + /** + * Adds a store plugin to extend every store + * + * @param plugin - store plugin to add + */ + use(plugin: PiniaPlugin): Pinia; + /* Excluded from this release type: _p */ + /* Excluded from this release type: _a */ + /* Excluded from this release type: _e */ + /* Excluded from this release type: _s */ + /* Excluded from this release type: _testing */ +} + +/** + * Interface to be extended by the user when they add properties through plugins. + */ +export declare interface PiniaCustomProperties<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> { +} + +/** + * Properties that are added to every `store.$state` by `pinia.use()`. + */ +export declare interface PiniaCustomStateProperties<S extends StateTree = StateTree> { +} + +/** + * Plugin to extend every store. + */ +export declare interface PiniaPlugin { + /** + * Plugin to extend every store. Returns an object to extend the store or + * nothing. + * + * @param context - Context + */ + (context: PiniaPluginContext): Partial<PiniaCustomProperties & PiniaCustomStateProperties> | void; +} + +/** + * Context argument passed to Pinia plugins. + */ +export declare interface PiniaPluginContext<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> { + /** + * pinia instance. + */ + pinia: Pinia; + /** + * Current app created with `Vue.createApp()`. + */ + app: App; + /** + * Current store being extended. + */ + store: Store<Id, S, G, A>; + /** + * Initial options defining the store when calling `defineStore()`. + */ + options: DefineStoreOptionsInPlugin<Id, S, G, A>; +} + +/** + * Plugin to extend every store. + * @deprecated use PiniaPlugin instead + */ +export declare type PiniaStorePlugin = PiniaPlugin; + +/** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ +export declare const PiniaVuePlugin: Plugin_2; + +declare interface _SetActivePinia { + (pinia: Pinia): Pinia; + (pinia: undefined): undefined; + (pinia: Pinia | undefined): Pinia | undefined; +} + +/** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ +export declare const setActivePinia: _SetActivePinia; + +/** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ +export declare function setMapStoreSuffix(suffix: MapStoresCustomization extends Record<'suffix', infer Suffix> ? Suffix : string): void; + +/** + * Return type of `defineStore()` with a setup function. + * - `Id` is a string literal of the store's name + * - `SS` is the return type of the setup function + * @see {@link StoreDefinition} + */ +export declare interface SetupStoreDefinition<Id extends string, SS> extends StoreDefinition<Id, _ExtractStateFromSetupStore<SS>, _ExtractGettersFromSetupStore<SS>, _ExtractActionsFromSetupStore<SS>> { +} + +declare interface SetupStoreHelpers { + action: <Fn extends _Method>(fn: Fn) => Fn; +} + +/** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ +export declare function shouldHydrate(obj: any): boolean; + +/** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ +export declare function skipHydrate<T = any>(obj: T): T; + +/** + * For internal use **only**. + */ +export declare type _Spread<A extends readonly any[]> = A extends [infer L, ...infer R] ? _StoreObject<L> & _Spread<R> : unknown; + +/** + * Generic state of a Store + */ +export declare type StateTree = Record<PropertyKey, any>; + +/** + * Store type to build a store. + */ +export declare type Store<Id extends string = string, S extends StateTree = {}, G = {}, A = {}> = _StoreWithState<Id, S, G, A> & UnwrapRef<S> & _StoreWithGetters<G> & (_ActionsTree extends A ? {} : A) & PiniaCustomProperties<Id, S, G, A> & PiniaCustomStateProperties<S>; + +/** + * Extract the actions of a store type. Works with both a Setup Store or an + * Options Store. + */ +export declare type StoreActions<SS> = SS extends Store<string, StateTree, _GettersTree<StateTree>, infer A> ? A : _ExtractActionsFromSetupStore<SS>; + +/** + * Return type of `defineStore()`. Function that allows instantiating a store. + */ +export declare interface StoreDefinition<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> { + /** + * Returns a store, creates it if necessary. + * + * @param pinia - Pinia instance to retrieve the store + * @param hot - dev only hot module replacement + */ + (pinia?: Pinia | null | undefined, hot?: StoreGeneric): Store<Id, S, G, A>; + /** + * Id of the store. Used by map helpers. + */ + $id: Id; + /* Excluded from this release type: _pinia */ +} + +/** + * Generic and type-unsafe version of Store. Doesn't fail on access with + * strings, making it much easier to write generic functions that do not care + * about the kind of store that is passed. + */ +export declare type StoreGeneric = Store<string, StateTree, _GettersTree<StateTree>, _ActionsTree>; + +/** + * Extract the getters of a store type. Works with both a Setup Store or an + * Options Store. + */ +export declare type StoreGetters<SS> = SS extends Store<string, StateTree, infer G, _ActionsTree> ? _StoreWithGetters<G> : _ExtractGettersFromSetupStore<SS>; + +/** + * For internal use **only**. + */ +export declare type _StoreObject<S> = S extends StoreDefinition<infer Ids, infer State, infer Getters, infer Actions> ? { + [Id in `${Ids}${MapStoresCustomization extends Record<'suffix', infer Suffix> ? Suffix : 'Store'}`]: () => Store<Id extends `${infer RealId}${MapStoresCustomization extends Record<'suffix', infer Suffix> ? Suffix : 'Store'}` ? RealId : string, State, Getters, Actions>; +} : {}; + +/** + * Argument of `store.$onAction()` + */ +export declare type StoreOnActionListener<Id extends string, S extends StateTree, G, A> = (context: StoreOnActionListenerContext<Id, S, G, {} extends A ? _ActionsTree : A>) => void; + +/** + * Context object passed to callbacks of `store.$onAction(context => {})` + * TODO: should have only the Id, the Store and Actions to generate the proper object + */ +export declare type StoreOnActionListenerContext<Id extends string, S extends StateTree, G, A> = _ActionsTree extends A ? _StoreOnActionListenerContext<StoreGeneric, string, _ActionsTree> : { + [Name in keyof A]: Name extends string ? _StoreOnActionListenerContext<Store<Id, S, G, A>, Name, A> : never; +}[keyof A]; + +/** + * Actual type for {@link StoreOnActionListenerContext}. Exists for refactoring + * purposes. For internal use only. + * For internal use **only** + */ +export declare interface _StoreOnActionListenerContext<Store, ActionName extends string, A> { + /** + * Name of the action + */ + name: ActionName; + /** + * Store that is invoking the action + */ + store: Store; + /** + * Parameters passed to the action + */ + args: A extends Record<ActionName, _Method> ? Parameters<A[ActionName]> : unknown[]; + /** + * Sets up a hook once the action is finished. It receives the return value + * of the action, if it's a Promise, it will be unwrapped. + */ + after: (callback: A extends Record<ActionName, _Method> ? (resolvedReturn: _Awaited<ReturnType<A[ActionName]>>) => void : () => void) => void; + /** + * Sets up a hook if the action fails. Return `false` to catch the error and + * stop it from propagating. + */ + onError: (callback: (error: unknown) => void) => void; +} + +/** + * Properties of a store. + */ +export declare interface StoreProperties<Id extends string> { + /** + * Unique identifier of the store + */ + $id: Id; + /* Excluded from this release type: _p */ + /* Excluded from this release type: _getters */ + /* Excluded from this release type: _isOptionsAPI */ + /** + * Used by devtools plugin to retrieve properties added with plugins. Removed + * in production. Can be used by the user to add property keys of the store + * that should be displayed in devtools. + */ + _customProperties: Set<string>; + /* Excluded from this release type: _hotUpdate */ + /* Excluded from this release type: _hotUpdating */ + /* Excluded from this release type: _hmrPayload */ +} + +/** + * Extract the state of a store type. Works with both a Setup Store or an + * Options Store. Note this unwraps refs. + */ +export declare type StoreState<SS> = SS extends Store<string, infer S, _GettersTree<StateTree>, _ActionsTree> ? UnwrapRef<S> : _ExtractStateFromSetupStore<SS>; + +/** + * Extracts the return type for `storeToRefs`. + * Will convert any `getters` into `ComputedRef`. + */ +declare type StoreToRefs<SS extends StoreGeneric> = SS extends unknown ? _ToStateRefs<SS> & ToRefs<PiniaCustomStateProperties<StoreState<SS>>> & _ToComputedRefs<StoreGetters<SS>> : never; + +/** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ +export declare function storeToRefs<SS extends StoreGeneric>(store: SS): StoreToRefs<SS>; + +/** + * Store augmented for actions. For internal usage only. + * For internal use **only** + */ +export declare type _StoreWithActions<A> = { + [k in keyof A]: A[k] extends (...args: infer P) => infer R ? (...args: P) => R : never; +}; + +/** + * Store augmented with getters. For internal usage only. + * For internal use **only** + */ +export declare type _StoreWithGetters<G> = _StoreWithGetters_Readonly<G> & _StoreWithGetters_Writable<G>; + +/** + * Store augmented with readonly getters. For internal usage **only**. + */ +declare type _StoreWithGetters_Readonly<G> = { + readonly [K in keyof G as G[K] extends (...args: any[]) => any ? K : ComputedRef extends G[K] ? K : never]: G[K] extends (...args: any[]) => infer R ? R : UnwrapRef<G[K]>; +}; + +/** + * Store augmented with writable getters. For internal usage **only**. + */ +declare type _StoreWithGetters_Writable<G> = { + [K in keyof G as G[K] extends WritableComputedRef<any> ? K : never]: G[K] extends WritableComputedRef<infer R, infer _S> ? R : never; +}; + +/** + * Base store with state and functions. Should not be used directly. + */ +export declare interface _StoreWithState<Id extends string, S extends StateTree, G, A> extends StoreProperties<Id> { + /** + * State of the Store. Setting it will internally call `$patch()` to update the state. + */ + $state: UnwrapRef<S> & PiniaCustomStateProperties<S>; + /** + * Applies a state patch to current state. Allows passing nested values + * + * @param partialState - patch to apply to the state + */ + $patch(partialState: _DeepPartial<UnwrapRef<S>>): void; + /** + * Group multiple changes into one function. Useful when mutating objects like + * Sets or arrays and applying an object patch isn't practical, e.g. appending + * to an array. The function passed to `$patch()` **must be synchronous**. + * + * @param stateMutator - function that mutates `state`, cannot be asynchronous + */ + $patch<F extends (state: UnwrapRef<S>) => any>(stateMutator: ReturnType<F> extends Promise<any> ? never : F): void; + /** + * Resets the store to its initial state by building a new state object. + */ + $reset(): void; + /** + * Setups a callback to be called whenever the state changes. It also returns a function to remove the callback. Note + * that when calling `store.$subscribe()` inside of a component, it will be automatically cleaned up when the + * component gets unmounted unless `detached` is set to true. + * + * @param callback - callback passed to the watcher + * @param options - `watch` options + `detached` to detach the subscription from the context (usually a component) + * this is called from. Note that the `flush` option does not affect calls to `store.$patch()`. + * @returns function that removes the watcher + */ + $subscribe(callback: SubscriptionCallback<S>, options?: { + detached?: boolean; + } & WatchOptions): () => void; + /** + * Setups a callback to be called every time an action is about to get + * invoked. The callback receives an object with all the relevant information + * of the invoked action: + * - `store`: the store it is invoked on + * - `name`: The name of the action + * - `args`: The parameters passed to the action + * + * On top of these, it receives two functions that allow setting up a callback + * once the action finishes or when it fails. + * + * It also returns a function to remove the callback. Note than when calling + * `store.$onAction()` inside of a component, it will be automatically cleaned + * up when the component gets unmounted unless `detached` is set to true. + * + * @example + * + *```js + *store.$onAction(({ after, onError }) => { + * // Here you could share variables between all of the hooks as well as + * // setting up watchers and clean them up + * after((resolvedValue) => { + * // can be used to cleanup side effects + * . // `resolvedValue` is the value returned by the action, if it's a + * . // Promise, it will be the resolved value instead of the Promise + * }) + * onError((error) => { + * // can be used to pass up errors + * }) + *}) + *``` + * + * @param callback - callback called before every action + * @param detached - detach the subscription from the context this is called from + * @returns function that removes the watcher + */ + $onAction(callback: StoreOnActionListener<Id, S, G, A>, detached?: boolean): () => void; + /** + * Stops the associated effect scope of the store and remove it from the store + * registry. Plugins can override this method to cleanup any added effects. + * e.g. devtools plugin stops displaying disposed stores from devtools. + * Note this doesn't delete the state of the store, you have to do it manually with + * `delete pinia.state.value[store.$id]` if you want to. If you don't and the + * store is used again, it will reuse the previous state. + */ + $dispose(): void; + /* Excluded from this release type: _r */ +} + +/** + * Callback of a subscription + */ +export declare type SubscriptionCallback<S> = ( +/** + * Object with information relative to the store mutation that triggered the + * subscription. + */ +mutation: SubscriptionCallbackMutation<S>, +/** + * State of the store when the subscription is triggered. Same as + * `store.$state`. + */ +state: UnwrapRef<S>) => void; + +/** + * Context object passed to a subscription callback. + */ +export declare type SubscriptionCallbackMutation<S> = SubscriptionCallbackMutationDirect | SubscriptionCallbackMutationPatchObject<S> | SubscriptionCallbackMutationPatchFunction; + +/** + * Base type for the context passed to a subscription callback. Internal type. + */ +export declare interface _SubscriptionCallbackMutationBase { + /** + * Type of the mutation. + */ + type: MutationType; + /** + * `id` of the store doing the mutation. + */ + storeId: string; + /** + * 🔴 DEV ONLY, DO NOT use for production code. Different mutation calls. Comes from + * https://vuejs.org/guide/extras/reactivity-in-depth.html#reactivity-debugging and allows to track mutations in + * devtools and plugins **during development only**. + */ + events?: DebuggerEvent[] | DebuggerEvent; +} + +/** + * Context passed to a subscription callback when directly mutating the state of + * a store with `store.someState = newValue` or `store.$state.someState = + * newValue`. + */ +export declare interface SubscriptionCallbackMutationDirect extends _SubscriptionCallbackMutationBase { + type: MutationType.direct; + events: DebuggerEvent; +} + +/** + * Context passed to a subscription callback when `store.$patch()` is called + * with a function. + */ +export declare interface SubscriptionCallbackMutationPatchFunction extends _SubscriptionCallbackMutationBase { + type: MutationType.patchFunction; + events: DebuggerEvent[]; +} + +/** + * Context passed to a subscription callback when `store.$patch()` is called + * with an object. + */ +export declare interface SubscriptionCallbackMutationPatchObject<S> extends _SubscriptionCallbackMutationBase { + type: MutationType.patchObject; + events: DebuggerEvent[]; + /** + * Object passed to `store.$patch()`. + */ + payload: _DeepPartial<UnwrapRef<S>>; +} + +/** + * Extracts the getters of a store while keeping writable and readonly properties. **Internal type DO NOT USE**. + */ +declare type _ToComputedRefs<SS> = { + [K in keyof SS]: true extends _IsReadonly<SS, K> ? ComputedRef<SS[K]> : WritableComputedRef<SS[K]>; +}; + +/** + * Extracts the refs of a state object from a store. If the state value is a Ref or type that extends ref, it will be kept as is. + * Otherwise, it will be converted into a Ref. **Internal type DO NOT USE**. + */ +declare type _ToStateRefs<SS> = SS extends Store<string, infer UnwrappedState, _GettersTree<StateTree>, _ActionsTree> ? UnwrappedState extends _UnwrapAll<Pick<infer State, infer Key>> ? { + [K in Key]: ToRef<State[K]>; +} : ToRefs<UnwrappedState> : ToRefs<StoreState<SS>>; + +/** + * Type that enables refactoring through IDE. + * For internal use **only** + */ +export declare type _UnwrapAll<SS> = { + [K in keyof SS]: UnwrapRef<SS[K]>; +}; + +export { } + +// Extensions of Vue types to be appended manually +// https://github.com/microsoft/rushstack/issues/2090 +// https://github.com/microsoft/rushstack/issues/1709 + +// @ts-ignore: works on Vue 2, fails in Vue 3 +declare module 'vue/types/vue' { + interface Vue { + /** + * Currently installed pinia instance. + */ + $pinia: Pinia + + /** + * Cache of stores instantiated by the current instance. Used by map + * helpers. Used internally by Pinia. + * + * @internal + */ + _pStores?: Record<string, Store> + } +} + +// @ts-ignore: works on Vue 2, fails in Vue 3 +declare module 'vue/types/options' { + interface ComponentOptions<V> { + /** + * Pinia instance to install in your application. Should be passed to the + * root Vue. + */ + pinia?: Pinia + } +} + +/** + * NOTE: Used to be `@vue/runtime-core` but it break types from time to time. Then, in Vue docs, we started recommending + * to use `vue` instead of `@vue/runtime-core` but that broke others' types so we reverted it. Now, local types do not + * work if we use `@vue/runtime-core` so we are using `vue` again. + */ +// @ts-ignore: works on Vue 3, fails in Vue 2 +declare module 'vue' { + // This seems to be needed to not break auto import types based on the order + // https://github.com/vuejs/pinia/pull/2730 + interface GlobalComponents {} + interface ComponentCustomProperties { + /** + * Access to the application's Pinia + */ + $pinia: Pinia + + /** + * Cache of stores instantiated by the current instance. Used by devtools to + * list currently used stores. Used internally by Pinia. + * + * @internal + */ + _pStores?: Record<string, StoreGeneric> + } +} + +// normally this is only needed in .d.ts files +export {} diff --git a/seller_1/node_modules/pinia/dist/pinia.esm-browser.js b/seller_1/node_modules/pinia/dist/pinia.esm-browser.js new file mode 100644 index 0000000..9bf3c35 --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.esm-browser.js @@ -0,0 +1,2036 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from 'vue-demi'; +import { setupDevtoolsPlugin } from '@vue/devtools-api'; + +/** + * setActivePinia must be called to handle SSR at the top of functions like + * `fetch`, `setup`, `serverPrefetch` and others + */ +let activePinia; +/** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ +// @ts-expect-error: cannot constrain the type of the return +const setActivePinia = (pinia) => (activePinia = pinia); +/** + * Get the currently active pinia if there is any. + */ +const getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia; +const piniaSymbol = (Symbol('pinia') ); + +function isPlainObject( +// eslint-disable-next-line @typescript-eslint/no-explicit-any +o) { + return (o && + typeof o === 'object' && + Object.prototype.toString.call(o) === '[object Object]' && + typeof o.toJSON !== 'function'); +} +// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> } +// TODO: can we change these to numbers? +/** + * Possible types for SubscriptionCallback + */ +var MutationType; +(function (MutationType) { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + MutationType["direct"] = "direct"; + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + MutationType["patchObject"] = "patch object"; + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + MutationType["patchFunction"] = "patch function"; + // maybe reset? for $state = {} and $reset +})(MutationType || (MutationType = {})); + +const IS_CLIENT = typeof window !== 'undefined'; + +/* + * FileSaver.js A saveAs() FileSaver implementation. + * + * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin + * Morote. + * + * License : MIT + */ +// The one and only way of getting global scope in all environments +// https://stackoverflow.com/q/3277182/1008999 +const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window + ? window + : typeof self === 'object' && self.self === self + ? self + : typeof global === 'object' && global.global === global + ? global + : typeof globalThis === 'object' + ? globalThis + : { HTMLElement: null })(); +function bom(blob, { autoBom = false } = {}) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (autoBom && + /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); + } + return blob; +} +function download(url, name, opts) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + xhr.onerror = function () { + console.error('could not download file'); + }; + xhr.send(); +} +function corsEnabled(url) { + const xhr = new XMLHttpRequest(); + // use sync to avoid popup blocker + xhr.open('HEAD', url, false); + try { + xhr.send(); + } + catch (e) { } + return xhr.status >= 200 && xhr.status <= 299; +} +// `a.click()` doesn't work for all browsers (#465) +function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } + catch (e) { + const evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } +} +const _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' }; +// Detect WebView inside a native macOS app by ruling out all browsers +// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too +// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos +const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && + /AppleWebKit/.test(_navigator.userAgent) && + !/Safari/.test(_navigator.userAgent))(); +const saveAs = !IS_CLIENT + ? () => { } // noop + : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program + typeof HTMLAnchorElement !== 'undefined' && + 'download' in HTMLAnchorElement.prototype && + !isMacOSWebView + ? downloadSaveAs + : // Use msSaveOrOpenBlob as a second approach + 'msSaveOrOpenBlob' in _navigator + ? msSaveAs + : // Fallback to using FileReader and a popup + fileSaverSaveAs; +function downloadSaveAs(blob, name = 'download', opts) { + const a = document.createElement('a'); + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + if (a.origin !== location.origin) { + if (corsEnabled(a.href)) { + download(blob, name, opts); + } + else { + a.target = '_blank'; + click(a); + } + } + else { + click(a); + } + } + else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4e4); // 40s + setTimeout(function () { + click(a); + }, 0); + } +} +function msSaveAs(blob, name = 'download', opts) { + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } + else { + const a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } + else { + // @ts-ignore: works on windows + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } +} +function fileSaverSaveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + if (typeof blob === 'string') + return download(blob, name, opts); + const force = blob.type === 'application/octet-stream'; + const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; + const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && + typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + const reader = new FileReader(); + reader.onloadend = function () { + let url = reader.result; + if (typeof url !== 'string') { + popup = null; + throw new Error('Wrong reader.result type'); + } + url = isChromeIOS + ? url + : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) { + popup.location.href = url; + } + else { + location.assign(url); + } + popup = null; // reverse-tabnabbing #460 + }; + reader.readAsDataURL(blob); + } + else { + const url = URL.createObjectURL(blob); + if (popup) + popup.location.assign(url); + else + location.href = url; + popup = null; // reverse-tabnabbing #460 + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4e4); // 40s + } +} + +/** + * Shows a toast or console.log + * + * @param message - message to log + * @param type - different color of the tooltip + */ +function toastMessage(message, type) { + const piniaMessage = '🍍 ' + message; + if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { + // No longer available :( + __VUE_DEVTOOLS_TOAST__(piniaMessage, type); + } + else if (type === 'error') { + console.error(piniaMessage); + } + else if (type === 'warn') { + console.warn(piniaMessage); + } + else { + console.log(piniaMessage); + } +} +function isPinia(o) { + return '_a' in o && 'install' in o; +} + +/** + * This file contain devtools actions, they are not Pinia actions. + */ +// --- +function checkClipboardAccess() { + if (!('clipboard' in navigator)) { + toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); + return true; + } +} +function checkNotFocusedError(error) { + if (error instanceof Error && + error.message.toLowerCase().includes('document is not focused')) { + toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); + return true; + } + return false; +} +async function actionGlobalCopyState(pinia) { + if (checkClipboardAccess()) + return; + try { + await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); + toastMessage('Global state copied to clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalPasteState(pinia) { + if (checkClipboardAccess()) + return; + try { + loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); + toastMessage('Global state pasted from clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalSaveState(pinia) { + try { + saveAs(new Blob([JSON.stringify(pinia.state.value)], { + type: 'text/plain;charset=utf-8', + }), 'pinia-state.json'); + } + catch (error) { + toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +let fileInput; +function getFileOpener() { + if (!fileInput) { + fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = '.json'; + } + function openFile() { + return new Promise((resolve, reject) => { + fileInput.onchange = async () => { + const files = fileInput.files; + if (!files) + return resolve(null); + const file = files.item(0); + if (!file) + return resolve(null); + return resolve({ text: await file.text(), file }); + }; + // @ts-ignore: TODO: changed from 4.3 to 4.4 + fileInput.oncancel = () => resolve(null); + fileInput.onerror = reject; + fileInput.click(); + }); + } + return openFile; +} +async function actionGlobalOpenStateFile(pinia) { + try { + const open = getFileOpener(); + const result = await open(); + if (!result) + return; + const { text, file } = result; + loadStoresState(pinia, JSON.parse(text)); + toastMessage(`Global state imported from "${file.name}".`); + } + catch (error) { + toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +function loadStoresState(pinia, state) { + for (const key in state) { + const storeState = pinia.state.value[key]; + // store is already instantiated, patch it + if (storeState) { + Object.assign(storeState, state[key]); + } + else { + // store is not instantiated, set the initial state + pinia.state.value[key] = state[key]; + } + } +} + +function formatDisplay(display) { + return { + _custom: { + display, + }, + }; +} +const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; +const PINIA_ROOT_ID = '_root'; +function formatStoreForInspectorTree(store) { + return isPinia(store) + ? { + id: PINIA_ROOT_ID, + label: PINIA_ROOT_LABEL, + } + : { + id: store.$id, + label: store.$id, + }; +} +function formatStoreForInspectorState(store) { + if (isPinia(store)) { + const storeNames = Array.from(store._s.keys()); + const storeMap = store._s; + const state = { + state: storeNames.map((storeId) => ({ + editable: true, + key: storeId, + value: store.state.value[storeId], + })), + getters: storeNames + .filter((id) => storeMap.get(id)._getters) + .map((id) => { + const store = storeMap.get(id); + return { + editable: false, + key: id, + value: store._getters.reduce((getters, key) => { + getters[key] = store[key]; + return getters; + }, {}), + }; + }), + }; + return state; + } + const state = { + state: Object.keys(store.$state).map((key) => ({ + editable: true, + key, + value: store.$state[key], + })), + }; + // avoid adding empty getters + if (store._getters && store._getters.length) { + state.getters = store._getters.map((getterName) => ({ + editable: false, + key: getterName, + value: store[getterName], + })); + } + if (store._customProperties.size) { + state.customProperties = Array.from(store._customProperties).map((key) => ({ + editable: true, + key, + value: store[key], + })); + } + return state; +} +function formatEventData(events) { + if (!events) + return {}; + if (Array.isArray(events)) { + // TODO: handle add and delete for arrays and objects + return events.reduce((data, event) => { + data.keys.push(event.key); + data.operations.push(event.type); + data.oldValue[event.key] = event.oldValue; + data.newValue[event.key] = event.newValue; + return data; + }, { + oldValue: {}, + keys: [], + operations: [], + newValue: {}, + }); + } + else { + return { + operation: formatDisplay(events.type), + key: formatDisplay(events.key), + oldValue: events.oldValue, + newValue: events.newValue, + }; + } +} +function formatMutationType(type) { + switch (type) { + case MutationType.direct: + return 'mutation'; + case MutationType.patchFunction: + return '$patch'; + case MutationType.patchObject: + return '$patch'; + default: + return 'unknown'; + } +} + +// timeline can be paused when directly changing the state +let isTimelineActive = true; +const componentStateTypes = []; +const MUTATIONS_LAYER_ID = 'pinia:mutations'; +const INSPECTOR_ID = 'pinia'; +const { assign: assign$1 } = Object; +/** + * Gets the displayed name of a store in devtools + * + * @param id - id of the store + * @returns a formatted string + */ +const getStoreType = (id) => '🍍 ' + id; +/** + * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab + * as soon as it is added to the application. + * + * @param app - Vue application + * @param pinia - pinia instance + */ +function registerPiniaDevtools(app, pinia) { + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + }, (api) => { + if (typeof api.now !== 'function') { + toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); + } + api.addTimelineLayer({ + id: MUTATIONS_LAYER_ID, + label: `Pinia 🍍`, + color: 0xe5df88, + }); + api.addInspector({ + id: INSPECTOR_ID, + label: 'Pinia 🍍', + icon: 'storage', + treeFilterPlaceholder: 'Search stores', + actions: [ + { + icon: 'content_copy', + action: () => { + actionGlobalCopyState(pinia); + }, + tooltip: 'Serialize and copy the state', + }, + { + icon: 'content_paste', + action: async () => { + await actionGlobalPasteState(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Replace the state with the content of your clipboard', + }, + { + icon: 'save', + action: () => { + actionGlobalSaveState(pinia); + }, + tooltip: 'Save the state as a JSON file', + }, + { + icon: 'folder_open', + action: async () => { + await actionGlobalOpenStateFile(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Import the state from a JSON file', + }, + ], + nodeActions: [ + { + icon: 'restore', + tooltip: 'Reset the state (with "$reset")', + action: (nodeId) => { + const store = pinia._s.get(nodeId); + if (!store) { + toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); + } + else if (typeof store.$reset !== 'function') { + toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); + } + else { + store.$reset(); + toastMessage(`Store "${nodeId}" reset.`); + } + }, + }, + ], + }); + api.on.inspectComponent((payload, ctx) => { + const proxy = (payload.componentInstance && + payload.componentInstance.proxy); + if (proxy && proxy._pStores) { + const piniaStores = payload.componentInstance.proxy._pStores; + Object.values(piniaStores).forEach((store) => { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'state', + editable: true, + value: store._isOptionsAPI + ? { + _custom: { + value: toRaw(store.$state), + actions: [ + { + icon: 'restore', + tooltip: 'Reset the state of this store', + action: () => store.$reset(), + }, + ], + }, + } + : // NOTE: workaround to unwrap transferred refs + Object.keys(store.$state).reduce((state, key) => { + state[key] = store.$state[key]; + return state; + }, {}), + }); + if (store._getters && store._getters.length) { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'getters', + editable: false, + value: store._getters.reduce((getters, key) => { + try { + getters[key] = store[key]; + } + catch (error) { + // @ts-expect-error: we just want to show it in devtools + getters[key] = error; + } + return getters; + }, {}), + }); + } + }); + } + }); + api.on.getInspectorTree((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + let stores = [pinia]; + stores = stores.concat(Array.from(pinia._s.values())); + payload.rootNodes = (payload.filter + ? stores.filter((store) => '$id' in store + ? store.$id + .toLowerCase() + .includes(payload.filter.toLowerCase()) + : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) + : stores).map(formatStoreForInspectorTree); + } + }); + // Expose pinia instance as $pinia to window + globalThis.$pinia = pinia; + api.on.getInspectorState((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + // this could be the selected store restored for a different project + // so it's better not to say anything here + return; + } + if (inspectedStore) { + // Expose selected store as $store to window + if (payload.nodeId !== PINIA_ROOT_ID) + globalThis.$store = toRaw(inspectedStore); + payload.state = formatStoreForInspectorState(inspectedStore); + } + } + }); + api.on.editInspectorState((payload, ctx) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + return toastMessage(`store "${payload.nodeId}" not found`, 'error'); + } + const { path } = payload; + if (!isPinia(inspectedStore)) { + // access only the state + if (path.length !== 1 || + !inspectedStore._customProperties.has(path[0]) || + path[0] in inspectedStore.$state) { + path.unshift('$state'); + } + } + else { + // Root access, we can omit the `.value` because the devtools API does it for us + path.unshift('state'); + } + isTimelineActive = false; + payload.set(inspectedStore, path, payload.state.value); + isTimelineActive = true; + } + }); + api.on.editComponentState((payload) => { + if (payload.type.startsWith('🍍')) { + const storeId = payload.type.replace(/^🍍\s*/, ''); + const store = pinia._s.get(storeId); + if (!store) { + return toastMessage(`store "${storeId}" not found`, 'error'); + } + const { path } = payload; + if (path[0] !== 'state') { + return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); + } + // rewrite the first entry to be able to directly set the state as + // well as any other path + path[0] = '$state'; + isTimelineActive = false; + payload.set(store, path, payload.state.value); + isTimelineActive = true; + } + }); + }); +} +function addStoreToDevtools(app, store) { + if (!componentStateTypes.includes(getStoreType(store.$id))) { + componentStateTypes.push(getStoreType(store.$id)); + } + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + settings: { + logStoreChanges: { + label: 'Notify about new/deleted stores', + type: 'boolean', + defaultValue: true, + }, + // useEmojis: { + // label: 'Use emojis in messages ⚡️', + // type: 'boolean', + // defaultValue: true, + // }, + }, + }, (api) => { + // gracefully handle errors + const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; + store.$onAction(({ after, onError, name, args }) => { + const groupId = runningActionId++; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛫 ' + name, + subtitle: 'start', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + }, + groupId, + }, + }); + after((result) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛬 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + result, + }, + groupId, + }, + }); + }); + onError((error) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + logType: 'error', + title: '💥 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + error, + }, + groupId, + }, + }); + }); + }, true); + store._customProperties.forEach((name) => { + watch(() => unref(store[name]), (newValue, oldValue) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (isTimelineActive) { + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: 'Change', + subtitle: name, + data: { + newValue, + oldValue, + }, + groupId: activeAction, + }, + }); + } + }, { deep: true }); + }); + store.$subscribe(({ events, type }, state) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (!isTimelineActive) + return; + // rootStore.state[store.id] = state + const eventData = { + time: now(), + title: formatMutationType(type), + data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), + groupId: activeAction, + }; + if (type === MutationType.patchFunction) { + eventData.subtitle = '⤵️'; + } + else if (type === MutationType.patchObject) { + eventData.subtitle = '🧩'; + } + else if (events && !Array.isArray(events)) { + eventData.subtitle = events.type; + } + if (events) { + eventData.data['rawEvent(s)'] = { + _custom: { + display: 'DebuggerEvent', + type: 'object', + tooltip: 'raw DebuggerEvent[]', + value: events, + }, + }; + } + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: eventData, + }); + }, { detached: true, flush: 'sync' }); + const hotUpdate = store._hotUpdate; + store._hotUpdate = markRaw((newStore) => { + hotUpdate(newStore); + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🔥 ' + store.$id, + subtitle: 'HMR update', + data: { + store: formatDisplay(store.$id), + info: formatDisplay(`HMR update`), + }, + }, + }); + // update the devtools too + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }); + const { $dispose } = store; + store.$dispose = () => { + $dispose(); + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`Disposed "${store.$id}" store 🗑`); + }; + // trigger an update so it can display new registered stores + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`"${store.$id}" store installed 🆕`); + }); +} +let runningActionId = 0; +let activeAction; +/** + * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the + * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state + * mutation to the action. + * + * @param store - store to patch + * @param actionNames - list of actionst to patch + */ +function patchActionForGrouping(store, actionNames, wrapWithProxy) { + // original actions of the store as they are given by pinia. We are going to override them + const actions = actionNames.reduce((storeActions, actionName) => { + // use toRaw to avoid tracking #541 + storeActions[actionName] = toRaw(store)[actionName]; + return storeActions; + }, {}); + for (const actionName in actions) { + store[actionName] = function () { + // the running action id is incremented in a before action hook + const _actionId = runningActionId; + const trackedStore = wrapWithProxy + ? new Proxy(store, { + get(...args) { + activeAction = _actionId; + return Reflect.get(...args); + }, + set(...args) { + activeAction = _actionId; + return Reflect.set(...args); + }, + }) + : store; + // For Setup Stores we need https://github.com/tc39/proposal-async-context + activeAction = _actionId; + const retValue = actions[actionName].apply(trackedStore, arguments); + // this is safer as async actions in Setup Stores would associate mutations done outside of the action + activeAction = undefined; + return retValue; + }; + } +} +/** + * pinia.use(devtoolsPlugin) + */ +function devtoolsPlugin({ app, store, options }) { + // HMR module + if (store.$id.startsWith('__hot:')) { + return; + } + // detect option api vs setup api + store._isOptionsAPI = !!options.state; + // Do not overwrite actions mocked by @pinia/testing (#2298) + if (!store._p._testing) { + patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); + // Upgrade the HMR to also update the new actions + const originalHotUpdate = store._hotUpdate; + toRaw(store)._hotUpdate = function (newStore) { + originalHotUpdate.apply(this, arguments); + patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); + }; + } + addStoreToDevtools(app, + // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric? + store); +} + +/** + * Creates a Pinia instance to be used by the application + */ +function createPinia() { + const scope = effectScope(true); + // NOTE: here we could check the window object for a state and directly set it + // if there is anything like it with Vue 3 SSR + const state = scope.run(() => ref({})); + let _p = []; + // plugins added before calling app.use(pinia) + let toBeInstalled = []; + const pinia = markRaw({ + install(app) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + if (!isVue2) { + pinia._a = app; + app.provide(piniaSymbol, pinia); + app.config.globalProperties.$pinia = pinia; + /* istanbul ignore else */ + if (IS_CLIENT) { + registerPiniaDevtools(app, pinia); + } + toBeInstalled.forEach((plugin) => _p.push(plugin)); + toBeInstalled = []; + } + }, + use(plugin) { + if (!this._a && !isVue2) { + toBeInstalled.push(plugin); + } + else { + _p.push(plugin); + } + return this; + }, + _p, + // it's actually undefined here + // @ts-expect-error + _a: null, + _e: scope, + _s: new Map(), + state, + }); + // pinia devtools rely on dev only features so they cannot be forced unless + // the dev build of Vue is used. Avoid old browsers like IE11. + if (IS_CLIENT && typeof Proxy !== 'undefined') { + pinia.use(devtoolsPlugin); + } + return pinia; +} +/** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ +function disposePinia(pinia) { + pinia._e.stop(); + pinia._s.clear(); + pinia._p.splice(0); + pinia.state.value = {}; + // @ts-expect-error: non valid + pinia._a = null; +} + +/** + * Checks if a function is a `StoreDefinition`. + * + * @param fn - object to test + * @returns true if `fn` is a StoreDefinition + */ +const isUseStore = (fn) => { + return typeof fn === 'function' && typeof fn.$id === 'string'; +}; +/** + * Mutates in place `newState` with `oldState` to _hot update_ it. It will + * remove any key not existing in `newState` and recursively merge plain + * objects. + * + * @param newState - new state object to be patched + * @param oldState - old state that should be used to patch newState + * @returns - newState + */ +function patchObject(newState, oldState) { + // no need to go through symbols because they cannot be serialized anyway + for (const key in oldState) { + const subPatch = oldState[key]; + // skip the whole sub tree + if (!(key in newState)) { + continue; + } + const targetValue = newState[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + !isRef(subPatch) && + !isReactive(subPatch)) { + newState[key] = patchObject(targetValue, subPatch); + } + else { + // objects are either a bit more complex (e.g. refs) or primitives, so we + // just set the whole thing + if (isVue2) { + set(newState, key, subPatch); + } + else { + newState[key] = subPatch; + } + } + } + return newState; +} +/** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ +function acceptHMRUpdate(initialUseStore, hot) { + return (newModule) => { + const pinia = hot.data.pinia || initialUseStore._pinia; + if (!pinia) { + // this store is still not used + return; + } + // preserve the pinia instance across loads + hot.data.pinia = pinia; + // console.log('got data', newStore) + for (const exportName in newModule) { + const useStore = newModule[exportName]; + // console.log('checking for', exportName) + if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { + // console.log('Accepting update for', useStore.$id) + const id = useStore.$id; + if (id !== initialUseStore.$id) { + console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); + // return import.meta.hot.invalidate() + return hot.invalidate(); + } + const existingStore = pinia._s.get(id); + if (!existingStore) { + console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); + return; + } + useStore(pinia, existingStore); + } + } + }; +} + +const noop = () => { }; +function addSubscription(subscriptions, callback, detached, onCleanup = noop) { + subscriptions.push(callback); + const removeSubscription = () => { + const idx = subscriptions.indexOf(callback); + if (idx > -1) { + subscriptions.splice(idx, 1); + onCleanup(); + } + }; + if (!detached && getCurrentScope()) { + onScopeDispose(removeSubscription); + } + return removeSubscription; +} +function triggerSubscriptions(subscriptions, ...args) { + subscriptions.slice().forEach((callback) => { + callback(...args); + }); +} + +const fallbackRunWithContext = (fn) => fn(); +/** + * Marks a function as an action for `$onAction` + * @internal + */ +const ACTION_MARKER = Symbol(); +/** + * Action name symbol. Allows to add a name to an action after defining it + * @internal + */ +const ACTION_NAME = Symbol(); +function mergeReactiveObjects(target, patchToApply) { + // Handle Map instances + if (target instanceof Map && patchToApply instanceof Map) { + patchToApply.forEach((value, key) => target.set(key, value)); + } + else if (target instanceof Set && patchToApply instanceof Set) { + // Handle Set instances + patchToApply.forEach(target.add, target); + } + // no need to go through symbols because they cannot be serialized anyway + for (const key in patchToApply) { + if (!patchToApply.hasOwnProperty(key)) + continue; + const subPatch = patchToApply[key]; + const targetValue = target[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + target.hasOwnProperty(key) && + !isRef(subPatch) && + !isReactive(subPatch)) { + // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might + // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that + // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. + target[key] = mergeReactiveObjects(targetValue, subPatch); + } + else { + // @ts-expect-error: subPatch is a valid value + target[key] = subPatch; + } + } + return target; +} +const skipHydrateSymbol = Symbol('pinia:skipHydration') + ; +/** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ +function skipHydrate(obj) { + return Object.defineProperty(obj, skipHydrateSymbol, {}); +} +/** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ +function shouldHydrate(obj) { + return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); +} +const { assign } = Object; +function isComputed(o) { + return !!(isRef(o) && o.effect); +} +function createOptionsStore(id, options, pinia, hot) { + const { state, actions, getters } = options; + const initialState = pinia.state.value[id]; + let store; + function setup() { + if (!initialState && (!hot)) { + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value, id, state ? state() : {}); + } + else { + pinia.state.value[id] = state ? state() : {}; + } + } + // avoid creating a state in pinia.state.value + const localState = hot + ? // use ref() to unwrap refs inside state TODO: check if this is still necessary + toRefs(ref(state ? state() : {}).value) + : toRefs(pinia.state.value[id]); + return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { + if (name in localState) { + console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); + } + computedGetters[name] = markRaw(computed(() => { + setActivePinia(pinia); + // it was created just before + const store = pinia._s.get(id); + // allow cross using stores + /* istanbul ignore if */ + if (isVue2 && !store._r) + return; + // @ts-expect-error + // return getters![name].call(context, context) + // TODO: avoid reading the getter while assigning with a global variable + return getters[name].call(store, store); + })); + return computedGetters; + }, {})); + } + store = createSetupStore(id, setup, options, pinia, hot, true); + return store; +} +function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { + let scope; + const optionsForPlugin = assign({ actions: {} }, options); + /* istanbul ignore if */ + if (!pinia._e.active) { + throw new Error('Pinia destroyed'); + } + // watcher options for $subscribe + const $subscribeOptions = { deep: true }; + /* istanbul ignore else */ + if (!isVue2) { + $subscribeOptions.onTrigger = (event) => { + /* istanbul ignore else */ + if (isListening) { + debuggerEvents = event; + // avoid triggering this while the store is being built and the state is being set in pinia + } + else if (isListening == false && !store._hotUpdating) { + // let patch send all the events together later + /* istanbul ignore else */ + if (Array.isArray(debuggerEvents)) { + debuggerEvents.push(event); + } + else { + console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); + } + } + }; + } + // internal state + let isListening; // set to true at the end + let isSyncListening; // set to true at the end + let subscriptions = []; + let actionSubscriptions = []; + let debuggerEvents; + const initialState = pinia.state.value[$id]; + // avoid setting the state for option stores if it is set + // by the setup + if (!isOptionsStore && !initialState && (!hot)) { + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value, $id, {}); + } + else { + pinia.state.value[$id] = {}; + } + } + const hotState = ref({}); + // avoid triggering too many listeners + // https://github.com/vuejs/pinia/issues/1129 + let activeListener; + function $patch(partialStateOrMutator) { + let subscriptionMutation; + isListening = isSyncListening = false; + // reset the debugger events since patches are sync + /* istanbul ignore else */ + { + debuggerEvents = []; + } + if (typeof partialStateOrMutator === 'function') { + partialStateOrMutator(pinia.state.value[$id]); + subscriptionMutation = { + type: MutationType.patchFunction, + storeId: $id, + events: debuggerEvents, + }; + } + else { + mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); + subscriptionMutation = { + type: MutationType.patchObject, + payload: partialStateOrMutator, + storeId: $id, + events: debuggerEvents, + }; + } + const myListenerId = (activeListener = Symbol()); + nextTick().then(() => { + if (activeListener === myListenerId) { + isListening = true; + } + }); + isSyncListening = true; + // because we paused the watcher, we need to manually call the subscriptions + triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); + } + const $reset = isOptionsStore + ? function $reset() { + const { state } = options; + const newState = state ? state() : {}; + // we use a patch to group all changes into one single subscription + this.$patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, newState); + }); + } + : /* istanbul ignore next */ + () => { + throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); + } + ; + function $dispose() { + scope.stop(); + subscriptions = []; + actionSubscriptions = []; + pinia._s.delete($id); + } + /** + * Helper that wraps function so it can be tracked with $onAction + * @param fn - action to wrap + * @param name - name of the action + */ + const action = (fn, name = '') => { + if (ACTION_MARKER in fn) { + fn[ACTION_NAME] = name; + return fn; + } + const wrappedAction = function () { + setActivePinia(pinia); + const args = Array.from(arguments); + const afterCallbackList = []; + const onErrorCallbackList = []; + function after(callback) { + afterCallbackList.push(callback); + } + function onError(callback) { + onErrorCallbackList.push(callback); + } + // @ts-expect-error + triggerSubscriptions(actionSubscriptions, { + args, + name: wrappedAction[ACTION_NAME], + store, + after, + onError, + }); + let ret; + try { + ret = fn.apply(this && this.$id === $id ? this : store, args); + // handle sync errors + } + catch (error) { + triggerSubscriptions(onErrorCallbackList, error); + throw error; + } + if (ret instanceof Promise) { + return ret + .then((value) => { + triggerSubscriptions(afterCallbackList, value); + return value; + }) + .catch((error) => { + triggerSubscriptions(onErrorCallbackList, error); + return Promise.reject(error); + }); + } + // trigger after callbacks + triggerSubscriptions(afterCallbackList, ret); + return ret; + }; + wrappedAction[ACTION_MARKER] = true; + wrappedAction[ACTION_NAME] = name; // will be set later + // @ts-expect-error: we are intentionally limiting the returned type to just Fn + // because all the added properties are internals that are exposed through `$onAction()` only + return wrappedAction; + }; + const _hmrPayload = /*#__PURE__*/ markRaw({ + actions: {}, + getters: {}, + state: [], + hotState, + }); + const partialStore = { + _p: pinia, + // _s: scope, + $id, + $onAction: addSubscription.bind(null, actionSubscriptions), + $patch, + $reset, + $subscribe(callback, options = {}) { + const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); + const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => { + if (options.flush === 'sync' ? isSyncListening : isListening) { + callback({ + storeId: $id, + type: MutationType.direct, + events: debuggerEvents, + }, state); + } + }, assign({}, $subscribeOptions, options))); + return removeSubscription; + }, + $dispose, + }; + /* istanbul ignore if */ + if (isVue2) { + // start as non ready + partialStore._r = false; + } + const store = reactive(assign({ + _hmrPayload, + _customProperties: markRaw(new Set()), // devtools custom properties + }, partialStore + // must be added later + // setupStore + ) + ); + // store the partial store now so the setup of stores can instantiate each other before they are finished without + // creating infinite loops. + pinia._s.set($id, store); + const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; + // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped + const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action })))); + // overwrite existing actions to support $onAction + for (const key in setupStore) { + const prop = setupStore[key]; + if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) { + // mark it as a piece of state to be serialized + if (hot) { + set(hotState.value, key, toRef(setupStore, key)); + // createOptionStore directly sets the state in pinia.state.value so we + // can just skip that + } + else if (!isOptionsStore) { + // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created + if (initialState && shouldHydrate(prop)) { + if (isRef(prop)) { + prop.value = initialState[key]; + } + else { + // probably a reactive object, lets recursively assign + // @ts-expect-error: prop is unknown + mergeReactiveObjects(prop, initialState[key]); + } + } + // transfer the ref to the pinia state to keep everything in sync + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value[$id], key, prop); + } + else { + pinia.state.value[$id][key] = prop; + } + } + /* istanbul ignore else */ + { + _hmrPayload.state.push(key); + } + // action + } + else if (typeof prop === 'function') { + const actionValue = hot ? prop : action(prop, key); + // this a hot module replacement store because the hotUpdate method needs + // to do it with the right context + /* istanbul ignore if */ + if (isVue2) { + set(setupStore, key, actionValue); + } + else { + // @ts-expect-error + setupStore[key] = actionValue; + } + /* istanbul ignore else */ + { + _hmrPayload.actions[key] = prop; + } + // list actions so they can be used in plugins + // @ts-expect-error + optionsForPlugin.actions[key] = prop; + } + else { + // add getters for devtools + if (isComputed(prop)) { + _hmrPayload.getters[key] = isOptionsStore + ? // @ts-expect-error + options.getters[key] + : prop; + if (IS_CLIENT) { + const getters = setupStore._getters || + // @ts-expect-error: same + (setupStore._getters = markRaw([])); + getters.push(key); + } + } + } + } + // add the state, getters, and action properties + /* istanbul ignore if */ + if (isVue2) { + Object.keys(setupStore).forEach((key) => { + set(store, key, setupStore[key]); + }); + } + else { + assign(store, setupStore); + // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. + // Make `storeToRefs()` work with `reactive()` #799 + assign(toRaw(store), setupStore); + } + // use this instead of a computed with setter to be able to create it anywhere + // without linking the computed lifespan to wherever the store is first + // created. + Object.defineProperty(store, '$state', { + get: () => (hot ? hotState.value : pinia.state.value[$id]), + set: (state) => { + /* istanbul ignore if */ + if (hot) { + throw new Error('cannot set hotState'); + } + $patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, state); + }); + }, + }); + // add the hotUpdate before plugins to allow them to override it + /* istanbul ignore else */ + { + store._hotUpdate = markRaw((newStore) => { + store._hotUpdating = true; + newStore._hmrPayload.state.forEach((stateKey) => { + if (stateKey in store.$state) { + const newStateTarget = newStore.$state[stateKey]; + const oldStateSource = store.$state[stateKey]; + if (typeof newStateTarget === 'object' && + isPlainObject(newStateTarget) && + isPlainObject(oldStateSource)) { + patchObject(newStateTarget, oldStateSource); + } + else { + // transfer the ref + newStore.$state[stateKey] = oldStateSource; + } + } + // patch direct access properties to allow store.stateProperty to work as + // store.$state.stateProperty + set(store, stateKey, toRef(newStore.$state, stateKey)); + }); + // remove deleted state properties + Object.keys(store.$state).forEach((stateKey) => { + if (!(stateKey in newStore.$state)) { + del(store, stateKey); + } + }); + // avoid devtools logging this as a mutation + isListening = false; + isSyncListening = false; + pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState'); + isSyncListening = true; + nextTick().then(() => { + isListening = true; + }); + for (const actionName in newStore._hmrPayload.actions) { + const actionFn = newStore[actionName]; + set(store, actionName, action(actionFn, actionName)); + } + // TODO: does this work in both setup and option store? + for (const getterName in newStore._hmrPayload.getters) { + const getter = newStore._hmrPayload.getters[getterName]; + const getterValue = isOptionsStore + ? // special handling of options api + computed(() => { + setActivePinia(pinia); + return getter.call(store, store); + }) + : getter; + set(store, getterName, getterValue); + } + // remove deleted getters + Object.keys(store._hmrPayload.getters).forEach((key) => { + if (!(key in newStore._hmrPayload.getters)) { + del(store, key); + } + }); + // remove old actions + Object.keys(store._hmrPayload.actions).forEach((key) => { + if (!(key in newStore._hmrPayload.actions)) { + del(store, key); + } + }); + // update the values used in devtools and to allow deleting new properties later on + store._hmrPayload = newStore._hmrPayload; + store._getters = newStore._getters; + store._hotUpdating = false; + }); + } + if (IS_CLIENT) { + const nonEnumerable = { + writable: true, + configurable: true, + // avoid warning on devtools trying to display this property + enumerable: false, + }; + ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { + Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); + }); + } + /* istanbul ignore if */ + if (isVue2) { + // mark the store as ready before plugins + store._r = true; + } + // apply all plugins + pinia._p.forEach((extender) => { + /* istanbul ignore else */ + if (IS_CLIENT) { + const extensions = scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + })); + Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); + assign(store, extensions); + } + else { + assign(store, scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + }))); + } + }); + if (store.$state && + typeof store.$state === 'object' && + typeof store.$state.constructor === 'function' && + !store.$state.constructor.toString().includes('[native code]')) { + console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + + `\tstate: () => new MyClass()\n` + + `Found in store "${store.$id}".`); + } + // only apply hydrate to option stores with an initial state in pinia + if (initialState && + isOptionsStore && + options.hydrate) { + options.hydrate(store.$state, initialState); + } + isListening = true; + isSyncListening = true; + return store; +} +// allows unused stores to be tree shaken +/*! #__NO_SIDE_EFFECTS__ */ +function defineStore( +// TODO: add proper types from above +idOrOptions, setup, setupOptions) { + let id; + let options; + const isSetupStore = typeof setup === 'function'; + if (typeof idOrOptions === 'string') { + id = idOrOptions; + // the option store setup will contain the actual options in this case + options = isSetupStore ? setupOptions : setup; + } + else { + options = idOrOptions; + id = idOrOptions.id; + if (typeof id !== 'string') { + throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); + } + } + function useStore(pinia, hot) { + const hasContext = hasInjectionContext(); + pinia = + // in test mode, ignore the argument provided as we can always retrieve a + // pinia instance with getActivePinia() + (pinia) || + (hasContext ? inject(piniaSymbol, null) : null); + if (pinia) + setActivePinia(pinia); + if (!activePinia) { + throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + + `This will fail in production.`); + } + pinia = activePinia; + if (!pinia._s.has(id)) { + // creating the store registers it in `pinia._s` + if (isSetupStore) { + createSetupStore(id, setup, options, pinia); + } + else { + createOptionsStore(id, options, pinia); + } + /* istanbul ignore else */ + { + // @ts-expect-error: not the right inferred type + useStore._pinia = pinia; + } + } + const store = pinia._s.get(id); + if (hot) { + const hotId = '__hot:' + id; + const newStore = isSetupStore + ? createSetupStore(hotId, setup, options, pinia, true) + : createOptionsStore(hotId, assign({}, options), pinia, true); + hot._hotUpdate(newStore); + // cleanup the state properties and the store from the cache + delete pinia.state.value[hotId]; + pinia._s.delete(hotId); + } + if (IS_CLIENT) { + const currentInstance = getCurrentInstance(); + // save stores in instances to access them devtools + if (currentInstance && + currentInstance.proxy && + // avoid adding stores that are just built for hot module replacement + !hot) { + const vm = currentInstance.proxy; + const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); + cache[id] = store; + } + } + // StoreGeneric cannot be casted towards Store + return store; + } + useStore.$id = id; + return useStore; +} + +let mapStoreSuffix = 'Store'; +/** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ +function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS +) { + mapStoreSuffix = suffix; +} +/** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ +function mapStores(...stores) { + if (Array.isArray(stores[0])) { + console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + + `Replace\n` + + `\tmapStores([useAuthStore, useCartStore])\n` + + `with\n` + + `\tmapStores(useAuthStore, useCartStore)\n` + + `This will fail in production if not fixed.`); + stores = stores[0]; + } + return stores.reduce((reduced, useStore) => { + // @ts-expect-error: $id is added by defineStore + reduced[useStore.$id + mapStoreSuffix] = function () { + return useStore(this.$pinia); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = function () { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key]; + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function () { + const store = useStore(this.$pinia); + const storeKey = keysOrMapper[key]; + // for some reason TS is unable to infer the type of storeKey to be a + // function + return typeof storeKey === 'function' + ? storeKey.call(this, store) + : // @ts-expect-error: FIXME: should work? + store[storeKey]; + }; + return reduced; + }, {}); +} +/** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ +const mapGetters = mapState; +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapActions(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key](...args); + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[keysOrMapper[key]](...args); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapWritableState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[key]; + }, + set(value) { + return (useStore(this.$pinia)[key] = value); + }, + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[keysOrMapper[key]]; + }, + set(value) { + return (useStore(this.$pinia)[keysOrMapper[key]] = value); + }, + }; + return reduced; + }, {}); +} + +/** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ +function storeToRefs(store) { + // See https://github.com/vuejs/pinia/issues/852 + // It's easier to just use toRefs() even if it includes more stuff + if (isVue2) { + // @ts-expect-error: toRefs include methods and others + return toRefs(store); + } + else { + const rawStore = toRaw(store); + const refs = {}; + for (const key in rawStore) { + const value = rawStore[key]; + // There is no native method to check for a computed + // https://github.com/vuejs/core/pull/4165 + if (value.effect) { + // @ts-expect-error: too hard to type correctly + refs[key] = + // ... + computed({ + get: () => store[key], + set(value) { + store[key] = value; + }, + }); + } + else if (isRef(value) || isReactive(value)) { + // @ts-expect-error: the key is state or getter + refs[key] = + // --- + toRef(store, key); + } + } + return refs; + } +} + +/** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ +const PiniaVuePlugin = function (_Vue) { + // Equivalent of + // app.config.globalProperties.$pinia = pinia + _Vue.mixin({ + beforeCreate() { + const options = this.$options; + if (options.pinia) { + const pinia = options.pinia; + // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 + /* istanbul ignore else */ + if (!this._provided) { + const provideCache = {}; + Object.defineProperty(this, '_provided', { + get: () => provideCache, + set: (v) => Object.assign(provideCache, v), + }); + } + this._provided[piniaSymbol] = pinia; + // propagate the pinia instance in an SSR friendly way + // avoid adding it to nuxt twice + /* istanbul ignore else */ + if (!this.$pinia) { + this.$pinia = pinia; + } + pinia._a = this; + if (IS_CLIENT) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + } + if (IS_CLIENT) { + registerPiniaDevtools(pinia._a, pinia); + } + } + else if (!this.$pinia && options.parent && options.parent.$pinia) { + this.$pinia = options.parent.$pinia; + } + }, + destroyed() { + delete this._pStores; + }, + }); +}; + +export { MutationType, PiniaVuePlugin, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs }; diff --git a/seller_1/node_modules/pinia/dist/pinia.iife.js b/seller_1/node_modules/pinia/dist/pinia.iife.js new file mode 100644 index 0000000..747daeb --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.iife.js @@ -0,0 +1,2223 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +var Pinia = (function (exports, vueDemi) { + 'use strict'; + + /** + * setActivePinia must be called to handle SSR at the top of functions like + * `fetch`, `setup`, `serverPrefetch` and others + */ + let activePinia; + /** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ + // @ts-expect-error: cannot constrain the type of the return + const setActivePinia = (pinia) => (activePinia = pinia); + /** + * Get the currently active pinia if there is any. + */ + const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; + const piniaSymbol = (Symbol('pinia') ); + + function getDevtoolsGlobalHook() { + return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; + } + function getTarget() { + // @ts-expect-error navigator and windows are not available in all environments + return (typeof navigator !== 'undefined' && typeof window !== 'undefined') + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : {}; + } + const isProxyAvailable = typeof Proxy === 'function'; + + const HOOK_SETUP = 'devtools-plugin:setup'; + const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set'; + + let supported; + let perf; + function isPerformanceSupported() { + var _a; + if (supported !== undefined) { + return supported; + } + if (typeof window !== 'undefined' && window.performance) { + supported = true; + perf = window.performance; + } + else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) { + supported = true; + perf = globalThis.perf_hooks.performance; + } + else { + supported = false; + } + return supported; + } + function now() { + return isPerformanceSupported() ? perf.now() : Date.now(); + } + + class ApiProxy { + constructor(plugin, hook) { + this.target = null; + this.targetQueue = []; + this.onQueue = []; + this.plugin = plugin; + this.hook = hook; + const defaultSettings = {}; + if (plugin.settings) { + for (const id in plugin.settings) { + const item = plugin.settings[id]; + defaultSettings[id] = item.defaultValue; + } + } + const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; + let currentSettings = Object.assign({}, defaultSettings); + try { + const raw = localStorage.getItem(localSettingsSaveId); + const data = JSON.parse(raw); + Object.assign(currentSettings, data); + } + catch (e) { + // noop + } + this.fallbacks = { + getSettings() { + return currentSettings; + }, + setSettings(value) { + try { + localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); + } + catch (e) { + // noop + } + currentSettings = value; + }, + now() { + return now(); + }, + }; + if (hook) { + hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { + if (pluginId === this.plugin.id) { + this.fallbacks.setSettings(value); + } + }); + } + this.proxiedOn = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target.on[prop]; + } + else { + return (...args) => { + this.onQueue.push({ + method: prop, + args, + }); + }; + } + }, + }); + this.proxiedTarget = new Proxy({}, { + get: (_target, prop) => { + if (this.target) { + return this.target[prop]; + } + else if (prop === 'on') { + return this.proxiedOn; + } + else if (Object.keys(this.fallbacks).includes(prop)) { + return (...args) => { + this.targetQueue.push({ + method: prop, + args, + resolve: () => { }, + }); + return this.fallbacks[prop](...args); + }; + } + else { + return (...args) => { + return new Promise((resolve) => { + this.targetQueue.push({ + method: prop, + args, + resolve, + }); + }); + }; + } + }, + }); + } + async setRealTarget(target) { + this.target = target; + for (const item of this.onQueue) { + this.target.on[item.method](...item.args); + } + for (const item of this.targetQueue) { + item.resolve(await this.target[item.method](...item.args)); + } + } + } + + function setupDevtoolsPlugin(pluginDescriptor, setupFn) { + const descriptor = pluginDescriptor; + const target = getTarget(); + const hook = getDevtoolsGlobalHook(); + const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy; + if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { + hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); + } + else { + const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null; + const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; + list.push({ + pluginDescriptor: descriptor, + setupFn, + proxy, + }); + if (proxy) { + setupFn(proxy.proxiedTarget); + } + } + } + + function isPlainObject( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + o) { + return (o && + typeof o === 'object' && + Object.prototype.toString.call(o) === '[object Object]' && + typeof o.toJSON !== 'function'); + } + // type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> } + // TODO: can we change these to numbers? + /** + * Possible types for SubscriptionCallback + */ + exports.MutationType = void 0; + (function (MutationType) { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + MutationType["direct"] = "direct"; + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + MutationType["patchObject"] = "patch object"; + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + MutationType["patchFunction"] = "patch function"; + // maybe reset? for $state = {} and $reset + })(exports.MutationType || (exports.MutationType = {})); + + const IS_CLIENT = typeof window !== 'undefined'; + + /* + * FileSaver.js A saveAs() FileSaver implementation. + * + * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin + * Morote. + * + * License : MIT + */ + // The one and only way of getting global scope in all environments + // https://stackoverflow.com/q/3277182/1008999 + const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window + ? window + : typeof self === 'object' && self.self === self + ? self + : typeof global === 'object' && global.global === global + ? global + : typeof globalThis === 'object' + ? globalThis + : { HTMLElement: null })(); + function bom(blob, { autoBom = false } = {}) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (autoBom && + /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); + } + return blob; + } + function download(url, name, opts) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + xhr.onerror = function () { + console.error('could not download file'); + }; + xhr.send(); + } + function corsEnabled(url) { + const xhr = new XMLHttpRequest(); + // use sync to avoid popup blocker + xhr.open('HEAD', url, false); + try { + xhr.send(); + } + catch (e) { } + return xhr.status >= 200 && xhr.status <= 299; + } + // `a.click()` doesn't work for all browsers (#465) + function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } + catch (e) { + const evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } + } + const _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' }; + // Detect WebView inside a native macOS app by ruling out all browsers + // We just need to check for 'Safari' because all other browsers (besides Firefox) include that too + // https://www.whatismybrowser.com/guides/the-latest-user-agent/macos + const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && + /AppleWebKit/.test(_navigator.userAgent) && + !/Safari/.test(_navigator.userAgent))(); + const saveAs = !IS_CLIENT + ? () => { } // noop + : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program + typeof HTMLAnchorElement !== 'undefined' && + 'download' in HTMLAnchorElement.prototype && + !isMacOSWebView + ? downloadSaveAs + : // Use msSaveOrOpenBlob as a second approach + 'msSaveOrOpenBlob' in _navigator + ? msSaveAs + : // Fallback to using FileReader and a popup + fileSaverSaveAs; + function downloadSaveAs(blob, name = 'download', opts) { + const a = document.createElement('a'); + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + if (a.origin !== location.origin) { + if (corsEnabled(a.href)) { + download(blob, name, opts); + } + else { + a.target = '_blank'; + click(a); + } + } + else { + click(a); + } + } + else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4e4); // 40s + setTimeout(function () { + click(a); + }, 0); + } + } + function msSaveAs(blob, name = 'download', opts) { + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } + else { + const a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } + else { + // @ts-ignore: works on windows + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } + } + function fileSaverSaveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + if (typeof blob === 'string') + return download(blob, name, opts); + const force = blob.type === 'application/octet-stream'; + const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; + const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && + typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + const reader = new FileReader(); + reader.onloadend = function () { + let url = reader.result; + if (typeof url !== 'string') { + popup = null; + throw new Error('Wrong reader.result type'); + } + url = isChromeIOS + ? url + : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) { + popup.location.href = url; + } + else { + location.assign(url); + } + popup = null; // reverse-tabnabbing #460 + }; + reader.readAsDataURL(blob); + } + else { + const url = URL.createObjectURL(blob); + if (popup) + popup.location.assign(url); + else + location.href = url; + popup = null; // reverse-tabnabbing #460 + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4e4); // 40s + } + } + + /** + * Shows a toast or console.log + * + * @param message - message to log + * @param type - different color of the tooltip + */ + function toastMessage(message, type) { + const piniaMessage = '🍍 ' + message; + if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { + // No longer available :( + __VUE_DEVTOOLS_TOAST__(piniaMessage, type); + } + else if (type === 'error') { + console.error(piniaMessage); + } + else if (type === 'warn') { + console.warn(piniaMessage); + } + else { + console.log(piniaMessage); + } + } + function isPinia(o) { + return '_a' in o && 'install' in o; + } + + /** + * This file contain devtools actions, they are not Pinia actions. + */ + // --- + function checkClipboardAccess() { + if (!('clipboard' in navigator)) { + toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); + return true; + } + } + function checkNotFocusedError(error) { + if (error instanceof Error && + error.message.toLowerCase().includes('document is not focused')) { + toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); + return true; + } + return false; + } + async function actionGlobalCopyState(pinia) { + if (checkClipboardAccess()) + return; + try { + await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); + toastMessage('Global state copied to clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); + console.error(error); + } + } + async function actionGlobalPasteState(pinia) { + if (checkClipboardAccess()) + return; + try { + loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); + toastMessage('Global state pasted from clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); + console.error(error); + } + } + async function actionGlobalSaveState(pinia) { + try { + saveAs(new Blob([JSON.stringify(pinia.state.value)], { + type: 'text/plain;charset=utf-8', + }), 'pinia-state.json'); + } + catch (error) { + toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); + console.error(error); + } + } + let fileInput; + function getFileOpener() { + if (!fileInput) { + fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = '.json'; + } + function openFile() { + return new Promise((resolve, reject) => { + fileInput.onchange = async () => { + const files = fileInput.files; + if (!files) + return resolve(null); + const file = files.item(0); + if (!file) + return resolve(null); + return resolve({ text: await file.text(), file }); + }; + // @ts-ignore: TODO: changed from 4.3 to 4.4 + fileInput.oncancel = () => resolve(null); + fileInput.onerror = reject; + fileInput.click(); + }); + } + return openFile; + } + async function actionGlobalOpenStateFile(pinia) { + try { + const open = getFileOpener(); + const result = await open(); + if (!result) + return; + const { text, file } = result; + loadStoresState(pinia, JSON.parse(text)); + toastMessage(`Global state imported from "${file.name}".`); + } + catch (error) { + toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); + console.error(error); + } + } + function loadStoresState(pinia, state) { + for (const key in state) { + const storeState = pinia.state.value[key]; + // store is already instantiated, patch it + if (storeState) { + Object.assign(storeState, state[key]); + } + else { + // store is not instantiated, set the initial state + pinia.state.value[key] = state[key]; + } + } + } + + function formatDisplay(display) { + return { + _custom: { + display, + }, + }; + } + const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; + const PINIA_ROOT_ID = '_root'; + function formatStoreForInspectorTree(store) { + return isPinia(store) + ? { + id: PINIA_ROOT_ID, + label: PINIA_ROOT_LABEL, + } + : { + id: store.$id, + label: store.$id, + }; + } + function formatStoreForInspectorState(store) { + if (isPinia(store)) { + const storeNames = Array.from(store._s.keys()); + const storeMap = store._s; + const state = { + state: storeNames.map((storeId) => ({ + editable: true, + key: storeId, + value: store.state.value[storeId], + })), + getters: storeNames + .filter((id) => storeMap.get(id)._getters) + .map((id) => { + const store = storeMap.get(id); + return { + editable: false, + key: id, + value: store._getters.reduce((getters, key) => { + getters[key] = store[key]; + return getters; + }, {}), + }; + }), + }; + return state; + } + const state = { + state: Object.keys(store.$state).map((key) => ({ + editable: true, + key, + value: store.$state[key], + })), + }; + // avoid adding empty getters + if (store._getters && store._getters.length) { + state.getters = store._getters.map((getterName) => ({ + editable: false, + key: getterName, + value: store[getterName], + })); + } + if (store._customProperties.size) { + state.customProperties = Array.from(store._customProperties).map((key) => ({ + editable: true, + key, + value: store[key], + })); + } + return state; + } + function formatEventData(events) { + if (!events) + return {}; + if (Array.isArray(events)) { + // TODO: handle add and delete for arrays and objects + return events.reduce((data, event) => { + data.keys.push(event.key); + data.operations.push(event.type); + data.oldValue[event.key] = event.oldValue; + data.newValue[event.key] = event.newValue; + return data; + }, { + oldValue: {}, + keys: [], + operations: [], + newValue: {}, + }); + } + else { + return { + operation: formatDisplay(events.type), + key: formatDisplay(events.key), + oldValue: events.oldValue, + newValue: events.newValue, + }; + } + } + function formatMutationType(type) { + switch (type) { + case exports.MutationType.direct: + return 'mutation'; + case exports.MutationType.patchFunction: + return '$patch'; + case exports.MutationType.patchObject: + return '$patch'; + default: + return 'unknown'; + } + } + + // timeline can be paused when directly changing the state + let isTimelineActive = true; + const componentStateTypes = []; + const MUTATIONS_LAYER_ID = 'pinia:mutations'; + const INSPECTOR_ID = 'pinia'; + const { assign: assign$1 } = Object; + /** + * Gets the displayed name of a store in devtools + * + * @param id - id of the store + * @returns a formatted string + */ + const getStoreType = (id) => '🍍 ' + id; + /** + * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab + * as soon as it is added to the application. + * + * @param app - Vue application + * @param pinia - pinia instance + */ + function registerPiniaDevtools(app, pinia) { + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + }, (api) => { + if (typeof api.now !== 'function') { + toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); + } + api.addTimelineLayer({ + id: MUTATIONS_LAYER_ID, + label: `Pinia 🍍`, + color: 0xe5df88, + }); + api.addInspector({ + id: INSPECTOR_ID, + label: 'Pinia 🍍', + icon: 'storage', + treeFilterPlaceholder: 'Search stores', + actions: [ + { + icon: 'content_copy', + action: () => { + actionGlobalCopyState(pinia); + }, + tooltip: 'Serialize and copy the state', + }, + { + icon: 'content_paste', + action: async () => { + await actionGlobalPasteState(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Replace the state with the content of your clipboard', + }, + { + icon: 'save', + action: () => { + actionGlobalSaveState(pinia); + }, + tooltip: 'Save the state as a JSON file', + }, + { + icon: 'folder_open', + action: async () => { + await actionGlobalOpenStateFile(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Import the state from a JSON file', + }, + ], + nodeActions: [ + { + icon: 'restore', + tooltip: 'Reset the state (with "$reset")', + action: (nodeId) => { + const store = pinia._s.get(nodeId); + if (!store) { + toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); + } + else if (typeof store.$reset !== 'function') { + toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); + } + else { + store.$reset(); + toastMessage(`Store "${nodeId}" reset.`); + } + }, + }, + ], + }); + api.on.inspectComponent((payload, ctx) => { + const proxy = (payload.componentInstance && + payload.componentInstance.proxy); + if (proxy && proxy._pStores) { + const piniaStores = payload.componentInstance.proxy._pStores; + Object.values(piniaStores).forEach((store) => { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'state', + editable: true, + value: store._isOptionsAPI + ? { + _custom: { + value: vueDemi.toRaw(store.$state), + actions: [ + { + icon: 'restore', + tooltip: 'Reset the state of this store', + action: () => store.$reset(), + }, + ], + }, + } + : // NOTE: workaround to unwrap transferred refs + Object.keys(store.$state).reduce((state, key) => { + state[key] = store.$state[key]; + return state; + }, {}), + }); + if (store._getters && store._getters.length) { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'getters', + editable: false, + value: store._getters.reduce((getters, key) => { + try { + getters[key] = store[key]; + } + catch (error) { + // @ts-expect-error: we just want to show it in devtools + getters[key] = error; + } + return getters; + }, {}), + }); + } + }); + } + }); + api.on.getInspectorTree((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + let stores = [pinia]; + stores = stores.concat(Array.from(pinia._s.values())); + payload.rootNodes = (payload.filter + ? stores.filter((store) => '$id' in store + ? store.$id + .toLowerCase() + .includes(payload.filter.toLowerCase()) + : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) + : stores).map(formatStoreForInspectorTree); + } + }); + // Expose pinia instance as $pinia to window + globalThis.$pinia = pinia; + api.on.getInspectorState((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + // this could be the selected store restored for a different project + // so it's better not to say anything here + return; + } + if (inspectedStore) { + // Expose selected store as $store to window + if (payload.nodeId !== PINIA_ROOT_ID) + globalThis.$store = vueDemi.toRaw(inspectedStore); + payload.state = formatStoreForInspectorState(inspectedStore); + } + } + }); + api.on.editInspectorState((payload, ctx) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + return toastMessage(`store "${payload.nodeId}" not found`, 'error'); + } + const { path } = payload; + if (!isPinia(inspectedStore)) { + // access only the state + if (path.length !== 1 || + !inspectedStore._customProperties.has(path[0]) || + path[0] in inspectedStore.$state) { + path.unshift('$state'); + } + } + else { + // Root access, we can omit the `.value` because the devtools API does it for us + path.unshift('state'); + } + isTimelineActive = false; + payload.set(inspectedStore, path, payload.state.value); + isTimelineActive = true; + } + }); + api.on.editComponentState((payload) => { + if (payload.type.startsWith('🍍')) { + const storeId = payload.type.replace(/^🍍\s*/, ''); + const store = pinia._s.get(storeId); + if (!store) { + return toastMessage(`store "${storeId}" not found`, 'error'); + } + const { path } = payload; + if (path[0] !== 'state') { + return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); + } + // rewrite the first entry to be able to directly set the state as + // well as any other path + path[0] = '$state'; + isTimelineActive = false; + payload.set(store, path, payload.state.value); + isTimelineActive = true; + } + }); + }); + } + function addStoreToDevtools(app, store) { + if (!componentStateTypes.includes(getStoreType(store.$id))) { + componentStateTypes.push(getStoreType(store.$id)); + } + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + settings: { + logStoreChanges: { + label: 'Notify about new/deleted stores', + type: 'boolean', + defaultValue: true, + }, + // useEmojis: { + // label: 'Use emojis in messages ⚡️', + // type: 'boolean', + // defaultValue: true, + // }, + }, + }, (api) => { + // gracefully handle errors + const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; + store.$onAction(({ after, onError, name, args }) => { + const groupId = runningActionId++; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛫 ' + name, + subtitle: 'start', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + }, + groupId, + }, + }); + after((result) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛬 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + result, + }, + groupId, + }, + }); + }); + onError((error) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + logType: 'error', + title: '💥 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + error, + }, + groupId, + }, + }); + }); + }, true); + store._customProperties.forEach((name) => { + vueDemi.watch(() => vueDemi.unref(store[name]), (newValue, oldValue) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (isTimelineActive) { + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: 'Change', + subtitle: name, + data: { + newValue, + oldValue, + }, + groupId: activeAction, + }, + }); + } + }, { deep: true }); + }); + store.$subscribe(({ events, type }, state) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (!isTimelineActive) + return; + // rootStore.state[store.id] = state + const eventData = { + time: now(), + title: formatMutationType(type), + data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), + groupId: activeAction, + }; + if (type === exports.MutationType.patchFunction) { + eventData.subtitle = '⤵️'; + } + else if (type === exports.MutationType.patchObject) { + eventData.subtitle = '🧩'; + } + else if (events && !Array.isArray(events)) { + eventData.subtitle = events.type; + } + if (events) { + eventData.data['rawEvent(s)'] = { + _custom: { + display: 'DebuggerEvent', + type: 'object', + tooltip: 'raw DebuggerEvent[]', + value: events, + }, + }; + } + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: eventData, + }); + }, { detached: true, flush: 'sync' }); + const hotUpdate = store._hotUpdate; + store._hotUpdate = vueDemi.markRaw((newStore) => { + hotUpdate(newStore); + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🔥 ' + store.$id, + subtitle: 'HMR update', + data: { + store: formatDisplay(store.$id), + info: formatDisplay(`HMR update`), + }, + }, + }); + // update the devtools too + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }); + const { $dispose } = store; + store.$dispose = () => { + $dispose(); + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`Disposed "${store.$id}" store 🗑`); + }; + // trigger an update so it can display new registered stores + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`"${store.$id}" store installed 🆕`); + }); + } + let runningActionId = 0; + let activeAction; + /** + * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the + * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state + * mutation to the action. + * + * @param store - store to patch + * @param actionNames - list of actionst to patch + */ + function patchActionForGrouping(store, actionNames, wrapWithProxy) { + // original actions of the store as they are given by pinia. We are going to override them + const actions = actionNames.reduce((storeActions, actionName) => { + // use toRaw to avoid tracking #541 + storeActions[actionName] = vueDemi.toRaw(store)[actionName]; + return storeActions; + }, {}); + for (const actionName in actions) { + store[actionName] = function () { + // the running action id is incremented in a before action hook + const _actionId = runningActionId; + const trackedStore = wrapWithProxy + ? new Proxy(store, { + get(...args) { + activeAction = _actionId; + return Reflect.get(...args); + }, + set(...args) { + activeAction = _actionId; + return Reflect.set(...args); + }, + }) + : store; + // For Setup Stores we need https://github.com/tc39/proposal-async-context + activeAction = _actionId; + const retValue = actions[actionName].apply(trackedStore, arguments); + // this is safer as async actions in Setup Stores would associate mutations done outside of the action + activeAction = undefined; + return retValue; + }; + } + } + /** + * pinia.use(devtoolsPlugin) + */ + function devtoolsPlugin({ app, store, options }) { + // HMR module + if (store.$id.startsWith('__hot:')) { + return; + } + // detect option api vs setup api + store._isOptionsAPI = !!options.state; + // Do not overwrite actions mocked by @pinia/testing (#2298) + if (!store._p._testing) { + patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); + // Upgrade the HMR to also update the new actions + const originalHotUpdate = store._hotUpdate; + vueDemi.toRaw(store)._hotUpdate = function (newStore) { + originalHotUpdate.apply(this, arguments); + patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); + }; + } + addStoreToDevtools(app, + // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric? + store); + } + + /** + * Creates a Pinia instance to be used by the application + */ + function createPinia() { + const scope = vueDemi.effectScope(true); + // NOTE: here we could check the window object for a state and directly set it + // if there is anything like it with Vue 3 SSR + const state = scope.run(() => vueDemi.ref({})); + let _p = []; + // plugins added before calling app.use(pinia) + let toBeInstalled = []; + const pinia = vueDemi.markRaw({ + install(app) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + if (!vueDemi.isVue2) { + pinia._a = app; + app.provide(piniaSymbol, pinia); + app.config.globalProperties.$pinia = pinia; + /* istanbul ignore else */ + if (IS_CLIENT) { + registerPiniaDevtools(app, pinia); + } + toBeInstalled.forEach((plugin) => _p.push(plugin)); + toBeInstalled = []; + } + }, + use(plugin) { + if (!this._a && !vueDemi.isVue2) { + toBeInstalled.push(plugin); + } + else { + _p.push(plugin); + } + return this; + }, + _p, + // it's actually undefined here + // @ts-expect-error + _a: null, + _e: scope, + _s: new Map(), + state, + }); + // pinia devtools rely on dev only features so they cannot be forced unless + // the dev build of Vue is used. Avoid old browsers like IE11. + if (IS_CLIENT && typeof Proxy !== 'undefined') { + pinia.use(devtoolsPlugin); + } + return pinia; + } + /** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ + function disposePinia(pinia) { + pinia._e.stop(); + pinia._s.clear(); + pinia._p.splice(0); + pinia.state.value = {}; + // @ts-expect-error: non valid + pinia._a = null; + } + + /** + * Checks if a function is a `StoreDefinition`. + * + * @param fn - object to test + * @returns true if `fn` is a StoreDefinition + */ + const isUseStore = (fn) => { + return typeof fn === 'function' && typeof fn.$id === 'string'; + }; + /** + * Mutates in place `newState` with `oldState` to _hot update_ it. It will + * remove any key not existing in `newState` and recursively merge plain + * objects. + * + * @param newState - new state object to be patched + * @param oldState - old state that should be used to patch newState + * @returns - newState + */ + function patchObject(newState, oldState) { + // no need to go through symbols because they cannot be serialized anyway + for (const key in oldState) { + const subPatch = oldState[key]; + // skip the whole sub tree + if (!(key in newState)) { + continue; + } + const targetValue = newState[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + !vueDemi.isRef(subPatch) && + !vueDemi.isReactive(subPatch)) { + newState[key] = patchObject(targetValue, subPatch); + } + else { + // objects are either a bit more complex (e.g. refs) or primitives, so we + // just set the whole thing + if (vueDemi.isVue2) { + vueDemi.set(newState, key, subPatch); + } + else { + newState[key] = subPatch; + } + } + } + return newState; + } + /** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ + function acceptHMRUpdate(initialUseStore, hot) { + return (newModule) => { + const pinia = hot.data.pinia || initialUseStore._pinia; + if (!pinia) { + // this store is still not used + return; + } + // preserve the pinia instance across loads + hot.data.pinia = pinia; + // console.log('got data', newStore) + for (const exportName in newModule) { + const useStore = newModule[exportName]; + // console.log('checking for', exportName) + if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { + // console.log('Accepting update for', useStore.$id) + const id = useStore.$id; + if (id !== initialUseStore.$id) { + console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); + // return import.meta.hot.invalidate() + return hot.invalidate(); + } + const existingStore = pinia._s.get(id); + if (!existingStore) { + console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); + return; + } + useStore(pinia, existingStore); + } + } + }; + } + + const noop = () => { }; + function addSubscription(subscriptions, callback, detached, onCleanup = noop) { + subscriptions.push(callback); + const removeSubscription = () => { + const idx = subscriptions.indexOf(callback); + if (idx > -1) { + subscriptions.splice(idx, 1); + onCleanup(); + } + }; + if (!detached && vueDemi.getCurrentScope()) { + vueDemi.onScopeDispose(removeSubscription); + } + return removeSubscription; + } + function triggerSubscriptions(subscriptions, ...args) { + subscriptions.slice().forEach((callback) => { + callback(...args); + }); + } + + const fallbackRunWithContext = (fn) => fn(); + /** + * Marks a function as an action for `$onAction` + * @internal + */ + const ACTION_MARKER = Symbol(); + /** + * Action name symbol. Allows to add a name to an action after defining it + * @internal + */ + const ACTION_NAME = Symbol(); + function mergeReactiveObjects(target, patchToApply) { + // Handle Map instances + if (target instanceof Map && patchToApply instanceof Map) { + patchToApply.forEach((value, key) => target.set(key, value)); + } + else if (target instanceof Set && patchToApply instanceof Set) { + // Handle Set instances + patchToApply.forEach(target.add, target); + } + // no need to go through symbols because they cannot be serialized anyway + for (const key in patchToApply) { + if (!patchToApply.hasOwnProperty(key)) + continue; + const subPatch = patchToApply[key]; + const targetValue = target[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + target.hasOwnProperty(key) && + !vueDemi.isRef(subPatch) && + !vueDemi.isReactive(subPatch)) { + // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might + // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that + // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. + target[key] = mergeReactiveObjects(targetValue, subPatch); + } + else { + // @ts-expect-error: subPatch is a valid value + target[key] = subPatch; + } + } + return target; + } + const skipHydrateSymbol = Symbol('pinia:skipHydration') + ; + /** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ + function skipHydrate(obj) { + return Object.defineProperty(obj, skipHydrateSymbol, {}); + } + /** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ + function shouldHydrate(obj) { + return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); + } + const { assign } = Object; + function isComputed(o) { + return !!(vueDemi.isRef(o) && o.effect); + } + function createOptionsStore(id, options, pinia, hot) { + const { state, actions, getters } = options; + const initialState = pinia.state.value[id]; + let store; + function setup() { + if (!initialState && (!hot)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, id, state ? state() : {}); + } + else { + pinia.state.value[id] = state ? state() : {}; + } + } + // avoid creating a state in pinia.state.value + const localState = hot + ? // use ref() to unwrap refs inside state TODO: check if this is still necessary + vueDemi.toRefs(vueDemi.ref(state ? state() : {}).value) + : vueDemi.toRefs(pinia.state.value[id]); + return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { + if (name in localState) { + console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); + } + computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { + setActivePinia(pinia); + // it was created just before + const store = pinia._s.get(id); + // allow cross using stores + /* istanbul ignore if */ + if (vueDemi.isVue2 && !store._r) + return; + // @ts-expect-error + // return getters![name].call(context, context) + // TODO: avoid reading the getter while assigning with a global variable + return getters[name].call(store, store); + })); + return computedGetters; + }, {})); + } + store = createSetupStore(id, setup, options, pinia, hot, true); + return store; + } + function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { + let scope; + const optionsForPlugin = assign({ actions: {} }, options); + /* istanbul ignore if */ + if (!pinia._e.active) { + throw new Error('Pinia destroyed'); + } + // watcher options for $subscribe + const $subscribeOptions = { deep: true }; + /* istanbul ignore else */ + if (!vueDemi.isVue2) { + $subscribeOptions.onTrigger = (event) => { + /* istanbul ignore else */ + if (isListening) { + debuggerEvents = event; + // avoid triggering this while the store is being built and the state is being set in pinia + } + else if (isListening == false && !store._hotUpdating) { + // let patch send all the events together later + /* istanbul ignore else */ + if (Array.isArray(debuggerEvents)) { + debuggerEvents.push(event); + } + else { + console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); + } + } + }; + } + // internal state + let isListening; // set to true at the end + let isSyncListening; // set to true at the end + let subscriptions = []; + let actionSubscriptions = []; + let debuggerEvents; + const initialState = pinia.state.value[$id]; + // avoid setting the state for option stores if it is set + // by the setup + if (!isOptionsStore && !initialState && (!hot)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, $id, {}); + } + else { + pinia.state.value[$id] = {}; + } + } + const hotState = vueDemi.ref({}); + // avoid triggering too many listeners + // https://github.com/vuejs/pinia/issues/1129 + let activeListener; + function $patch(partialStateOrMutator) { + let subscriptionMutation; + isListening = isSyncListening = false; + // reset the debugger events since patches are sync + /* istanbul ignore else */ + { + debuggerEvents = []; + } + if (typeof partialStateOrMutator === 'function') { + partialStateOrMutator(pinia.state.value[$id]); + subscriptionMutation = { + type: exports.MutationType.patchFunction, + storeId: $id, + events: debuggerEvents, + }; + } + else { + mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); + subscriptionMutation = { + type: exports.MutationType.patchObject, + payload: partialStateOrMutator, + storeId: $id, + events: debuggerEvents, + }; + } + const myListenerId = (activeListener = Symbol()); + vueDemi.nextTick().then(() => { + if (activeListener === myListenerId) { + isListening = true; + } + }); + isSyncListening = true; + // because we paused the watcher, we need to manually call the subscriptions + triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); + } + const $reset = isOptionsStore + ? function $reset() { + const { state } = options; + const newState = state ? state() : {}; + // we use a patch to group all changes into one single subscription + this.$patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, newState); + }); + } + : /* istanbul ignore next */ + () => { + throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); + } + ; + function $dispose() { + scope.stop(); + subscriptions = []; + actionSubscriptions = []; + pinia._s.delete($id); + } + /** + * Helper that wraps function so it can be tracked with $onAction + * @param fn - action to wrap + * @param name - name of the action + */ + const action = (fn, name = '') => { + if (ACTION_MARKER in fn) { + fn[ACTION_NAME] = name; + return fn; + } + const wrappedAction = function () { + setActivePinia(pinia); + const args = Array.from(arguments); + const afterCallbackList = []; + const onErrorCallbackList = []; + function after(callback) { + afterCallbackList.push(callback); + } + function onError(callback) { + onErrorCallbackList.push(callback); + } + // @ts-expect-error + triggerSubscriptions(actionSubscriptions, { + args, + name: wrappedAction[ACTION_NAME], + store, + after, + onError, + }); + let ret; + try { + ret = fn.apply(this && this.$id === $id ? this : store, args); + // handle sync errors + } + catch (error) { + triggerSubscriptions(onErrorCallbackList, error); + throw error; + } + if (ret instanceof Promise) { + return ret + .then((value) => { + triggerSubscriptions(afterCallbackList, value); + return value; + }) + .catch((error) => { + triggerSubscriptions(onErrorCallbackList, error); + return Promise.reject(error); + }); + } + // trigger after callbacks + triggerSubscriptions(afterCallbackList, ret); + return ret; + }; + wrappedAction[ACTION_MARKER] = true; + wrappedAction[ACTION_NAME] = name; // will be set later + // @ts-expect-error: we are intentionally limiting the returned type to just Fn + // because all the added properties are internals that are exposed through `$onAction()` only + return wrappedAction; + }; + const _hmrPayload = /*#__PURE__*/ vueDemi.markRaw({ + actions: {}, + getters: {}, + state: [], + hotState, + }); + const partialStore = { + _p: pinia, + // _s: scope, + $id, + $onAction: addSubscription.bind(null, actionSubscriptions), + $patch, + $reset, + $subscribe(callback, options = {}) { + const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); + const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { + if (options.flush === 'sync' ? isSyncListening : isListening) { + callback({ + storeId: $id, + type: exports.MutationType.direct, + events: debuggerEvents, + }, state); + } + }, assign({}, $subscribeOptions, options))); + return removeSubscription; + }, + $dispose, + }; + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // start as non ready + partialStore._r = false; + } + const store = vueDemi.reactive(assign({ + _hmrPayload, + _customProperties: vueDemi.markRaw(new Set()), // devtools custom properties + }, partialStore + // must be added later + // setupStore + ) + ); + // store the partial store now so the setup of stores can instantiate each other before they are finished without + // creating infinite loops. + pinia._s.set($id, store); + const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; + // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped + const setupStore = runWithContext(() => pinia._e.run(() => (scope = vueDemi.effectScope()).run(() => setup({ action })))); + // overwrite existing actions to support $onAction + for (const key in setupStore) { + const prop = setupStore[key]; + if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { + // mark it as a piece of state to be serialized + if (hot) { + vueDemi.set(hotState.value, key, vueDemi.toRef(setupStore, key)); + // createOptionStore directly sets the state in pinia.state.value so we + // can just skip that + } + else if (!isOptionsStore) { + // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created + if (initialState && shouldHydrate(prop)) { + if (vueDemi.isRef(prop)) { + prop.value = initialState[key]; + } + else { + // probably a reactive object, lets recursively assign + // @ts-expect-error: prop is unknown + mergeReactiveObjects(prop, initialState[key]); + } + } + // transfer the ref to the pinia state to keep everything in sync + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value[$id], key, prop); + } + else { + pinia.state.value[$id][key] = prop; + } + } + /* istanbul ignore else */ + { + _hmrPayload.state.push(key); + } + // action + } + else if (typeof prop === 'function') { + const actionValue = hot ? prop : action(prop, key); + // this a hot module replacement store because the hotUpdate method needs + // to do it with the right context + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(setupStore, key, actionValue); + } + else { + // @ts-expect-error + setupStore[key] = actionValue; + } + /* istanbul ignore else */ + { + _hmrPayload.actions[key] = prop; + } + // list actions so they can be used in plugins + // @ts-expect-error + optionsForPlugin.actions[key] = prop; + } + else { + // add getters for devtools + if (isComputed(prop)) { + _hmrPayload.getters[key] = isOptionsStore + ? // @ts-expect-error + options.getters[key] + : prop; + if (IS_CLIENT) { + const getters = setupStore._getters || + // @ts-expect-error: same + (setupStore._getters = vueDemi.markRaw([])); + getters.push(key); + } + } + } + } + // add the state, getters, and action properties + /* istanbul ignore if */ + if (vueDemi.isVue2) { + Object.keys(setupStore).forEach((key) => { + vueDemi.set(store, key, setupStore[key]); + }); + } + else { + assign(store, setupStore); + // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. + // Make `storeToRefs()` work with `reactive()` #799 + assign(vueDemi.toRaw(store), setupStore); + } + // use this instead of a computed with setter to be able to create it anywhere + // without linking the computed lifespan to wherever the store is first + // created. + Object.defineProperty(store, '$state', { + get: () => (hot ? hotState.value : pinia.state.value[$id]), + set: (state) => { + /* istanbul ignore if */ + if (hot) { + throw new Error('cannot set hotState'); + } + $patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, state); + }); + }, + }); + // add the hotUpdate before plugins to allow them to override it + /* istanbul ignore else */ + { + store._hotUpdate = vueDemi.markRaw((newStore) => { + store._hotUpdating = true; + newStore._hmrPayload.state.forEach((stateKey) => { + if (stateKey in store.$state) { + const newStateTarget = newStore.$state[stateKey]; + const oldStateSource = store.$state[stateKey]; + if (typeof newStateTarget === 'object' && + isPlainObject(newStateTarget) && + isPlainObject(oldStateSource)) { + patchObject(newStateTarget, oldStateSource); + } + else { + // transfer the ref + newStore.$state[stateKey] = oldStateSource; + } + } + // patch direct access properties to allow store.stateProperty to work as + // store.$state.stateProperty + vueDemi.set(store, stateKey, vueDemi.toRef(newStore.$state, stateKey)); + }); + // remove deleted state properties + Object.keys(store.$state).forEach((stateKey) => { + if (!(stateKey in newStore.$state)) { + vueDemi.del(store, stateKey); + } + }); + // avoid devtools logging this as a mutation + isListening = false; + isSyncListening = false; + pinia.state.value[$id] = vueDemi.toRef(newStore._hmrPayload, 'hotState'); + isSyncListening = true; + vueDemi.nextTick().then(() => { + isListening = true; + }); + for (const actionName in newStore._hmrPayload.actions) { + const actionFn = newStore[actionName]; + vueDemi.set(store, actionName, action(actionFn, actionName)); + } + // TODO: does this work in both setup and option store? + for (const getterName in newStore._hmrPayload.getters) { + const getter = newStore._hmrPayload.getters[getterName]; + const getterValue = isOptionsStore + ? // special handling of options api + vueDemi.computed(() => { + setActivePinia(pinia); + return getter.call(store, store); + }) + : getter; + vueDemi.set(store, getterName, getterValue); + } + // remove deleted getters + Object.keys(store._hmrPayload.getters).forEach((key) => { + if (!(key in newStore._hmrPayload.getters)) { + vueDemi.del(store, key); + } + }); + // remove old actions + Object.keys(store._hmrPayload.actions).forEach((key) => { + if (!(key in newStore._hmrPayload.actions)) { + vueDemi.del(store, key); + } + }); + // update the values used in devtools and to allow deleting new properties later on + store._hmrPayload = newStore._hmrPayload; + store._getters = newStore._getters; + store._hotUpdating = false; + }); + } + if (IS_CLIENT) { + const nonEnumerable = { + writable: true, + configurable: true, + // avoid warning on devtools trying to display this property + enumerable: false, + }; + ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { + Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); + }); + } + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // mark the store as ready before plugins + store._r = true; + } + // apply all plugins + pinia._p.forEach((extender) => { + /* istanbul ignore else */ + if (IS_CLIENT) { + const extensions = scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + })); + Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); + assign(store, extensions); + } + else { + assign(store, scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + }))); + } + }); + if (store.$state && + typeof store.$state === 'object' && + typeof store.$state.constructor === 'function' && + !store.$state.constructor.toString().includes('[native code]')) { + console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + + `\tstate: () => new MyClass()\n` + + `Found in store "${store.$id}".`); + } + // only apply hydrate to option stores with an initial state in pinia + if (initialState && + isOptionsStore && + options.hydrate) { + options.hydrate(store.$state, initialState); + } + isListening = true; + isSyncListening = true; + return store; + } + // allows unused stores to be tree shaken + /*! #__NO_SIDE_EFFECTS__ */ + function defineStore( + // TODO: add proper types from above + idOrOptions, setup, setupOptions) { + let id; + let options; + const isSetupStore = typeof setup === 'function'; + if (typeof idOrOptions === 'string') { + id = idOrOptions; + // the option store setup will contain the actual options in this case + options = isSetupStore ? setupOptions : setup; + } + else { + options = idOrOptions; + id = idOrOptions.id; + if (typeof id !== 'string') { + throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); + } + } + function useStore(pinia, hot) { + const hasContext = vueDemi.hasInjectionContext(); + pinia = + // in test mode, ignore the argument provided as we can always retrieve a + // pinia instance with getActivePinia() + (pinia) || + (hasContext ? vueDemi.inject(piniaSymbol, null) : null); + if (pinia) + setActivePinia(pinia); + if (!activePinia) { + throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + + `This will fail in production.`); + } + pinia = activePinia; + if (!pinia._s.has(id)) { + // creating the store registers it in `pinia._s` + if (isSetupStore) { + createSetupStore(id, setup, options, pinia); + } + else { + createOptionsStore(id, options, pinia); + } + /* istanbul ignore else */ + { + // @ts-expect-error: not the right inferred type + useStore._pinia = pinia; + } + } + const store = pinia._s.get(id); + if (hot) { + const hotId = '__hot:' + id; + const newStore = isSetupStore + ? createSetupStore(hotId, setup, options, pinia, true) + : createOptionsStore(hotId, assign({}, options), pinia, true); + hot._hotUpdate(newStore); + // cleanup the state properties and the store from the cache + delete pinia.state.value[hotId]; + pinia._s.delete(hotId); + } + if (IS_CLIENT) { + const currentInstance = vueDemi.getCurrentInstance(); + // save stores in instances to access them devtools + if (currentInstance && + currentInstance.proxy && + // avoid adding stores that are just built for hot module replacement + !hot) { + const vm = currentInstance.proxy; + const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); + cache[id] = store; + } + } + // StoreGeneric cannot be casted towards Store + return store; + } + useStore.$id = id; + return useStore; + } + + let mapStoreSuffix = 'Store'; + /** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ + function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS + ) { + mapStoreSuffix = suffix; + } + /** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ + function mapStores(...stores) { + if (Array.isArray(stores[0])) { + console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + + `Replace\n` + + `\tmapStores([useAuthStore, useCartStore])\n` + + `with\n` + + `\tmapStores(useAuthStore, useCartStore)\n` + + `This will fail in production if not fixed.`); + stores = stores[0]; + } + return stores.reduce((reduced, useStore) => { + // @ts-expect-error: $id is added by defineStore + reduced[useStore.$id + mapStoreSuffix] = function () { + return useStore(this.$pinia); + }; + return reduced; + }, {}); + } + /** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ + function mapState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = function () { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key]; + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function () { + const store = useStore(this.$pinia); + const storeKey = keysOrMapper[key]; + // for some reason TS is unable to infer the type of storeKey to be a + // function + return typeof storeKey === 'function' + ? storeKey.call(this, store) + : // @ts-expect-error: FIXME: should work? + store[storeKey]; + }; + return reduced; + }, {}); + } + /** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ + const mapGetters = mapState; + /** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ + function mapActions(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key](...args); + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[keysOrMapper[key]](...args); + }; + return reduced; + }, {}); + } + /** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ + function mapWritableState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[key]; + }, + set(value) { + return (useStore(this.$pinia)[key] = value); + }, + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[keysOrMapper[key]]; + }, + set(value) { + return (useStore(this.$pinia)[keysOrMapper[key]] = value); + }, + }; + return reduced; + }, {}); + } + + /** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ + function storeToRefs(store) { + // See https://github.com/vuejs/pinia/issues/852 + // It's easier to just use toRefs() even if it includes more stuff + if (vueDemi.isVue2) { + // @ts-expect-error: toRefs include methods and others + return vueDemi.toRefs(store); + } + else { + const rawStore = vueDemi.toRaw(store); + const refs = {}; + for (const key in rawStore) { + const value = rawStore[key]; + // There is no native method to check for a computed + // https://github.com/vuejs/core/pull/4165 + if (value.effect) { + // @ts-expect-error: too hard to type correctly + refs[key] = + // ... + vueDemi.computed({ + get: () => store[key], + set(value) { + store[key] = value; + }, + }); + } + else if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { + // @ts-expect-error: the key is state or getter + refs[key] = + // --- + vueDemi.toRef(store, key); + } + } + return refs; + } + } + + /** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ + const PiniaVuePlugin = function (_Vue) { + // Equivalent of + // app.config.globalProperties.$pinia = pinia + _Vue.mixin({ + beforeCreate() { + const options = this.$options; + if (options.pinia) { + const pinia = options.pinia; + // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 + /* istanbul ignore else */ + if (!this._provided) { + const provideCache = {}; + Object.defineProperty(this, '_provided', { + get: () => provideCache, + set: (v) => Object.assign(provideCache, v), + }); + } + this._provided[piniaSymbol] = pinia; + // propagate the pinia instance in an SSR friendly way + // avoid adding it to nuxt twice + /* istanbul ignore else */ + if (!this.$pinia) { + this.$pinia = pinia; + } + pinia._a = this; + if (IS_CLIENT) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + } + if (IS_CLIENT) { + registerPiniaDevtools(pinia._a, pinia); + } + } + else if (!this.$pinia && options.parent && options.parent.$pinia) { + this.$pinia = options.parent.$pinia; + } + }, + destroyed() { + delete this._pStores; + }, + }); + }; + + exports.PiniaVuePlugin = PiniaVuePlugin; + exports.acceptHMRUpdate = acceptHMRUpdate; + exports.createPinia = createPinia; + exports.defineStore = defineStore; + exports.disposePinia = disposePinia; + exports.getActivePinia = getActivePinia; + exports.mapActions = mapActions; + exports.mapGetters = mapGetters; + exports.mapState = mapState; + exports.mapStores = mapStores; + exports.mapWritableState = mapWritableState; + exports.setActivePinia = setActivePinia; + exports.setMapStoreSuffix = setMapStoreSuffix; + exports.shouldHydrate = shouldHydrate; + exports.skipHydrate = skipHydrate; + exports.storeToRefs = storeToRefs; + + return exports; + +})({}, VueDemi); diff --git a/seller_1/node_modules/pinia/dist/pinia.iife.prod.js b/seller_1/node_modules/pinia/dist/pinia.iife.prod.js new file mode 100644 index 0000000..7bad35b --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.iife.prod.js @@ -0,0 +1,7 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +var Pinia=function(t,e){"use strict";let n;const i=t=>n=t,s=Symbol();function o(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}var r;t.MutationType=void 0,(r=t.MutationType||(t.MutationType={})).direct="direct",r.patchObject="patch object",r.patchFunction="patch function";const c="undefined"!=typeof window;const a=()=>{};function u(t,n,i,s=a){t.push(n);const o=()=>{const e=t.indexOf(n);e>-1&&(t.splice(e,1),s())};return!i&&e.getCurrentScope()&&e.onScopeDispose(o),o}function p(t,...e){t.slice().forEach((t=>{t(...e)}))}const f=t=>t(),l=Symbol(),h=Symbol();function d(t,n){t instanceof Map&&n instanceof Map?n.forEach(((e,n)=>t.set(n,e))):t instanceof Set&&n instanceof Set&&n.forEach(t.add,t);for(const i in n){if(!n.hasOwnProperty(i))continue;const s=n[i],r=t[i];t[i]=o(r)&&o(s)&&t.hasOwnProperty(i)&&!e.isRef(s)&&!e.isReactive(s)?d(r,s):s}return t}const y=Symbol();function v(t){return!o(t)||!t.hasOwnProperty(y)}const{assign:$}=Object;function _(n,s,o={},r,c,y){let _;const b=$({actions:{}},o),j={deep:!0};let S,m,O,g=[],R=[];const P=r.state.value[n];let V;function w(i){let s;S=m=!1,"function"==typeof i?(i(r.state.value[n]),s={type:t.MutationType.patchFunction,storeId:n,events:O}):(d(r.state.value[n],i),s={type:t.MutationType.patchObject,payload:i,storeId:n,events:O});const o=V=Symbol();e.nextTick().then((()=>{V===o&&(S=!0)})),m=!0,p(g,s,r.state.value[n])}y||P||(e.isVue2?e.set(r.state.value,n,{}):r.state.value[n]={}),e.ref({});const A=y?function(){const{state:t}=o,e=t?t():{};this.$patch((t=>{$(t,e)}))}:a;const M=(t,e="")=>{if(l in t)return t[h]=e,t;const s=function(){i(r);const e=Array.from(arguments),o=[],c=[];let a;p(R,{args:e,name:s[h],store:T,after:function(t){o.push(t)},onError:function(t){c.push(t)}});try{a=t.apply(this&&this.$id===n?this:T,e)}catch(t){throw p(c,t),t}return a instanceof Promise?a.then((t=>(p(o,t),t))).catch((t=>(p(c,t),Promise.reject(t)))):(p(o,a),a)};return s[l]=!0,s[h]=e,s},k={_p:r,$id:n,$onAction:u.bind(null,R),$patch:w,$reset:A,$subscribe(i,s={}){const o=u(g,i,s.detached,(()=>c())),c=_.run((()=>e.watch((()=>r.state.value[n]),(e=>{("sync"===s.flush?m:S)&&i({storeId:n,type:t.MutationType.direct,events:O},e)}),$({},j,s))));return o},$dispose:function(){_.stop(),g=[],R=[],r._s.delete(n)}};e.isVue2&&(k._r=!1);const T=e.reactive(k);r._s.set(n,T);const x=(r._a&&r._a.runWithContext||f)((()=>r._e.run((()=>(_=e.effectScope()).run((()=>s({action:M})))))));for(const t in x){const i=x[t];if(e.isRef(i)&&(!e.isRef(E=i)||!E.effect)||e.isReactive(i))y||(P&&v(i)&&(e.isRef(i)?i.value=P[t]:d(i,P[t])),e.isVue2?e.set(r.state.value[n],t,i):r.state.value[n][t]=i);else if("function"==typeof i){const n=M(i,t);e.isVue2?e.set(x,t,n):x[t]=n,b.actions[t]=i}}var E;return e.isVue2?Object.keys(x).forEach((t=>{e.set(T,t,x[t])})):($(T,x),$(e.toRaw(T),x)),Object.defineProperty(T,"$state",{get:()=>r.state.value[n],set:t=>{w((e=>{$(e,t)}))}}),e.isVue2&&(T._r=!0),r._p.forEach((t=>{$(T,_.run((()=>t({store:T,app:r._a,pinia:r,options:b}))))})),P&&y&&o.hydrate&&o.hydrate(T.$state,P),S=!0,m=!0,T} +/*! #__NO_SIDE_EFFECTS__ */let b="Store";function j(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(){return t(this.$pinia)[n]},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(){const n=t(this.$pinia),s=e[i];return"function"==typeof s?s.call(this,n):n[s]},n)),{})}const S=j;return t.PiniaVuePlugin=function(t){t.mixin({beforeCreate(){const t=this.$options;if(t.pinia){const e=t.pinia;if(!this._provided){const t={};Object.defineProperty(this,"_provided",{get:()=>t,set:e=>Object.assign(t,e)})}this._provided[s]=e,this.$pinia||(this.$pinia=e),e._a=this,c&&i(e)}else!this.$pinia&&t.parent&&t.parent.$pinia&&(this.$pinia=t.parent.$pinia)},destroyed(){delete this._pStores}})},t.acceptHMRUpdate=function(t,e){return()=>{}},t.createPinia=function(){const t=e.effectScope(!0),n=t.run((()=>e.ref({})));let o=[],r=[];const c=e.markRaw({install(t){i(c),e.isVue2||(c._a=t,t.provide(s,c),t.config.globalProperties.$pinia=c,r.forEach((t=>o.push(t))),r=[])},use(t){return this._a||e.isVue2?o.push(t):r.push(t),this},_p:o,_a:null,_e:t,_s:new Map,state:n});return c},t.defineStore=function(t,o,r){let c,a;const u="function"==typeof o;function p(t,r){const p=e.hasInjectionContext();(t=t||(p?e.inject(s,null):null))&&i(t),(t=n)._s.has(c)||(u?_(c,o,a,t):function(t,n,s){const{state:o,actions:r,getters:c}=n,a=s.state.value[t];let u;u=_(t,(function(){a||(e.isVue2?e.set(s.state.value,t,o?o():{}):s.state.value[t]=o?o():{});const n=e.toRefs(s.state.value[t]);return $(n,r,Object.keys(c||{}).reduce(((n,o)=>(n[o]=e.markRaw(e.computed((()=>{i(s);const n=s._s.get(t);if(!e.isVue2||n._r)return c[o].call(n,n)}))),n)),{}))}),n,s,0,!0)}(c,a,t));return t._s.get(c)}return"string"==typeof t?(c=t,a=u?r:o):(a=t,c=t.id),p.$id=c,p},t.disposePinia=function(t){t._e.stop(),t._s.clear(),t._p.splice(0),t.state.value={},t._a=null},t.getActivePinia=()=>e.hasInjectionContext()&&e.inject(s)||n,t.mapActions=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(...e){return t(this.$pinia)[n](...e)},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(...n){return t(this.$pinia)[e[i]](...n)},n)),{})},t.mapGetters=S,t.mapState=j,t.mapStores=function(...t){return t.reduce(((t,e)=>(t[e.$id+b]=function(){return e(this.$pinia)},t)),{})},t.mapWritableState=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]={get(){return t(this.$pinia)[n]},set(e){return t(this.$pinia)[n]=e}},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]={get(){return t(this.$pinia)[e[i]]},set(n){return t(this.$pinia)[e[i]]=n}},n)),{})},t.setActivePinia=i,t.setMapStoreSuffix=function(t){b=t},t.shouldHydrate=v,t.skipHydrate=function(t){return Object.defineProperty(t,y,{})},t.storeToRefs=function(t){if(e.isVue2)return e.toRefs(t);{const n=e.toRaw(t),i={};for(const s in n){const o=n[s];o.effect?i[s]=e.computed({get:()=>t[s],set(e){t[s]=e}}):(e.isRef(o)||e.isReactive(o))&&(i[s]=e.toRef(t,s))}return i}},t}({},VueDemi); diff --git a/seller_1/node_modules/pinia/dist/pinia.mjs b/seller_1/node_modules/pinia/dist/pinia.mjs new file mode 100644 index 0000000..625059e --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.mjs @@ -0,0 +1,2044 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, del, nextTick, computed, toRefs } from 'vue-demi'; +import { setupDevtoolsPlugin } from '@vue/devtools-api'; + +/** + * setActivePinia must be called to handle SSR at the top of functions like + * `fetch`, `setup`, `serverPrefetch` and others + */ +let activePinia; +/** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ +// @ts-expect-error: cannot constrain the type of the return +const setActivePinia = (pinia) => (activePinia = pinia); +/** + * Get the currently active pinia if there is any. + */ +const getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia; +const piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol()); + +function isPlainObject( +// eslint-disable-next-line @typescript-eslint/no-explicit-any +o) { + return (o && + typeof o === 'object' && + Object.prototype.toString.call(o) === '[object Object]' && + typeof o.toJSON !== 'function'); +} +// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> } +// TODO: can we change these to numbers? +/** + * Possible types for SubscriptionCallback + */ +var MutationType; +(function (MutationType) { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + MutationType["direct"] = "direct"; + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + MutationType["patchObject"] = "patch object"; + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + MutationType["patchFunction"] = "patch function"; + // maybe reset? for $state = {} and $reset +})(MutationType || (MutationType = {})); + +const IS_CLIENT = typeof window !== 'undefined'; + +/* + * FileSaver.js A saveAs() FileSaver implementation. + * + * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin + * Morote. + * + * License : MIT + */ +// The one and only way of getting global scope in all environments +// https://stackoverflow.com/q/3277182/1008999 +const _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window + ? window + : typeof self === 'object' && self.self === self + ? self + : typeof global === 'object' && global.global === global + ? global + : typeof globalThis === 'object' + ? globalThis + : { HTMLElement: null })(); +function bom(blob, { autoBom = false } = {}) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (autoBom && + /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type }); + } + return blob; +} +function download(url, name, opts) { + const xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + xhr.onerror = function () { + console.error('could not download file'); + }; + xhr.send(); +} +function corsEnabled(url) { + const xhr = new XMLHttpRequest(); + // use sync to avoid popup blocker + xhr.open('HEAD', url, false); + try { + xhr.send(); + } + catch (e) { } + return xhr.status >= 200 && xhr.status <= 299; +} +// `a.click()` doesn't work for all browsers (#465) +function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } + catch (e) { + const evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } +} +const _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' }; +// Detect WebView inside a native macOS app by ruling out all browsers +// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too +// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos +const isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) && + /AppleWebKit/.test(_navigator.userAgent) && + !/Safari/.test(_navigator.userAgent))(); +const saveAs = !IS_CLIENT + ? () => { } // noop + : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program + typeof HTMLAnchorElement !== 'undefined' && + 'download' in HTMLAnchorElement.prototype && + !isMacOSWebView + ? downloadSaveAs + : // Use msSaveOrOpenBlob as a second approach + 'msSaveOrOpenBlob' in _navigator + ? msSaveAs + : // Fallback to using FileReader and a popup + fileSaverSaveAs; +function downloadSaveAs(blob, name = 'download', opts) { + const a = document.createElement('a'); + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + if (a.origin !== location.origin) { + if (corsEnabled(a.href)) { + download(blob, name, opts); + } + else { + a.target = '_blank'; + click(a); + } + } + else { + click(a); + } + } + else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4e4); // 40s + setTimeout(function () { + click(a); + }, 0); + } +} +function msSaveAs(blob, name = 'download', opts) { + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } + else { + const a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } + else { + // @ts-ignore: works on windows + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } +} +function fileSaverSaveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + if (typeof blob === 'string') + return download(blob, name, opts); + const force = blob.type === 'application/octet-stream'; + const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global; + const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && + typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + const reader = new FileReader(); + reader.onloadend = function () { + let url = reader.result; + if (typeof url !== 'string') { + popup = null; + throw new Error('Wrong reader.result type'); + } + url = isChromeIOS + ? url + : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) { + popup.location.href = url; + } + else { + location.assign(url); + } + popup = null; // reverse-tabnabbing #460 + }; + reader.readAsDataURL(blob); + } + else { + const url = URL.createObjectURL(blob); + if (popup) + popup.location.assign(url); + else + location.href = url; + popup = null; // reverse-tabnabbing #460 + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4e4); // 40s + } +} + +/** + * Shows a toast or console.log + * + * @param message - message to log + * @param type - different color of the tooltip + */ +function toastMessage(message, type) { + const piniaMessage = '🍍 ' + message; + if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') { + // No longer available :( + __VUE_DEVTOOLS_TOAST__(piniaMessage, type); + } + else if (type === 'error') { + console.error(piniaMessage); + } + else if (type === 'warn') { + console.warn(piniaMessage); + } + else { + console.log(piniaMessage); + } +} +function isPinia(o) { + return '_a' in o && 'install' in o; +} + +/** + * This file contain devtools actions, they are not Pinia actions. + */ +// --- +function checkClipboardAccess() { + if (!('clipboard' in navigator)) { + toastMessage(`Your browser doesn't support the Clipboard API`, 'error'); + return true; + } +} +function checkNotFocusedError(error) { + if (error instanceof Error && + error.message.toLowerCase().includes('document is not focused')) { + toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', 'warn'); + return true; + } + return false; +} +async function actionGlobalCopyState(pinia) { + if (checkClipboardAccess()) + return; + try { + await navigator.clipboard.writeText(JSON.stringify(pinia.state.value)); + toastMessage('Global state copied to clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalPasteState(pinia) { + if (checkClipboardAccess()) + return; + try { + loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText())); + toastMessage('Global state pasted from clipboard.'); + } + catch (error) { + if (checkNotFocusedError(error)) + return; + toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error'); + console.error(error); + } +} +async function actionGlobalSaveState(pinia) { + try { + saveAs(new Blob([JSON.stringify(pinia.state.value)], { + type: 'text/plain;charset=utf-8', + }), 'pinia-state.json'); + } + catch (error) { + toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +let fileInput; +function getFileOpener() { + if (!fileInput) { + fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = '.json'; + } + function openFile() { + return new Promise((resolve, reject) => { + fileInput.onchange = async () => { + const files = fileInput.files; + if (!files) + return resolve(null); + const file = files.item(0); + if (!file) + return resolve(null); + return resolve({ text: await file.text(), file }); + }; + // @ts-ignore: TODO: changed from 4.3 to 4.4 + fileInput.oncancel = () => resolve(null); + fileInput.onerror = reject; + fileInput.click(); + }); + } + return openFile; +} +async function actionGlobalOpenStateFile(pinia) { + try { + const open = getFileOpener(); + const result = await open(); + if (!result) + return; + const { text, file } = result; + loadStoresState(pinia, JSON.parse(text)); + toastMessage(`Global state imported from "${file.name}".`); + } + catch (error) { + toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error'); + console.error(error); + } +} +function loadStoresState(pinia, state) { + for (const key in state) { + const storeState = pinia.state.value[key]; + // store is already instantiated, patch it + if (storeState) { + Object.assign(storeState, state[key]); + } + else { + // store is not instantiated, set the initial state + pinia.state.value[key] = state[key]; + } + } +} + +function formatDisplay(display) { + return { + _custom: { + display, + }, + }; +} +const PINIA_ROOT_LABEL = '🍍 Pinia (root)'; +const PINIA_ROOT_ID = '_root'; +function formatStoreForInspectorTree(store) { + return isPinia(store) + ? { + id: PINIA_ROOT_ID, + label: PINIA_ROOT_LABEL, + } + : { + id: store.$id, + label: store.$id, + }; +} +function formatStoreForInspectorState(store) { + if (isPinia(store)) { + const storeNames = Array.from(store._s.keys()); + const storeMap = store._s; + const state = { + state: storeNames.map((storeId) => ({ + editable: true, + key: storeId, + value: store.state.value[storeId], + })), + getters: storeNames + .filter((id) => storeMap.get(id)._getters) + .map((id) => { + const store = storeMap.get(id); + return { + editable: false, + key: id, + value: store._getters.reduce((getters, key) => { + getters[key] = store[key]; + return getters; + }, {}), + }; + }), + }; + return state; + } + const state = { + state: Object.keys(store.$state).map((key) => ({ + editable: true, + key, + value: store.$state[key], + })), + }; + // avoid adding empty getters + if (store._getters && store._getters.length) { + state.getters = store._getters.map((getterName) => ({ + editable: false, + key: getterName, + value: store[getterName], + })); + } + if (store._customProperties.size) { + state.customProperties = Array.from(store._customProperties).map((key) => ({ + editable: true, + key, + value: store[key], + })); + } + return state; +} +function formatEventData(events) { + if (!events) + return {}; + if (Array.isArray(events)) { + // TODO: handle add and delete for arrays and objects + return events.reduce((data, event) => { + data.keys.push(event.key); + data.operations.push(event.type); + data.oldValue[event.key] = event.oldValue; + data.newValue[event.key] = event.newValue; + return data; + }, { + oldValue: {}, + keys: [], + operations: [], + newValue: {}, + }); + } + else { + return { + operation: formatDisplay(events.type), + key: formatDisplay(events.key), + oldValue: events.oldValue, + newValue: events.newValue, + }; + } +} +function formatMutationType(type) { + switch (type) { + case MutationType.direct: + return 'mutation'; + case MutationType.patchFunction: + return '$patch'; + case MutationType.patchObject: + return '$patch'; + default: + return 'unknown'; + } +} + +// timeline can be paused when directly changing the state +let isTimelineActive = true; +const componentStateTypes = []; +const MUTATIONS_LAYER_ID = 'pinia:mutations'; +const INSPECTOR_ID = 'pinia'; +const { assign: assign$1 } = Object; +/** + * Gets the displayed name of a store in devtools + * + * @param id - id of the store + * @returns a formatted string + */ +const getStoreType = (id) => '🍍 ' + id; +/** + * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab + * as soon as it is added to the application. + * + * @param app - Vue application + * @param pinia - pinia instance + */ +function registerPiniaDevtools(app, pinia) { + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + }, (api) => { + if (typeof api.now !== 'function') { + toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'); + } + api.addTimelineLayer({ + id: MUTATIONS_LAYER_ID, + label: `Pinia 🍍`, + color: 0xe5df88, + }); + api.addInspector({ + id: INSPECTOR_ID, + label: 'Pinia 🍍', + icon: 'storage', + treeFilterPlaceholder: 'Search stores', + actions: [ + { + icon: 'content_copy', + action: () => { + actionGlobalCopyState(pinia); + }, + tooltip: 'Serialize and copy the state', + }, + { + icon: 'content_paste', + action: async () => { + await actionGlobalPasteState(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Replace the state with the content of your clipboard', + }, + { + icon: 'save', + action: () => { + actionGlobalSaveState(pinia); + }, + tooltip: 'Save the state as a JSON file', + }, + { + icon: 'folder_open', + action: async () => { + await actionGlobalOpenStateFile(pinia); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }, + tooltip: 'Import the state from a JSON file', + }, + ], + nodeActions: [ + { + icon: 'restore', + tooltip: 'Reset the state (with "$reset")', + action: (nodeId) => { + const store = pinia._s.get(nodeId); + if (!store) { + toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, 'warn'); + } + else if (typeof store.$reset !== 'function') { + toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, 'warn'); + } + else { + store.$reset(); + toastMessage(`Store "${nodeId}" reset.`); + } + }, + }, + ], + }); + api.on.inspectComponent((payload, ctx) => { + const proxy = (payload.componentInstance && + payload.componentInstance.proxy); + if (proxy && proxy._pStores) { + const piniaStores = payload.componentInstance.proxy._pStores; + Object.values(piniaStores).forEach((store) => { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'state', + editable: true, + value: store._isOptionsAPI + ? { + _custom: { + value: toRaw(store.$state), + actions: [ + { + icon: 'restore', + tooltip: 'Reset the state of this store', + action: () => store.$reset(), + }, + ], + }, + } + : // NOTE: workaround to unwrap transferred refs + Object.keys(store.$state).reduce((state, key) => { + state[key] = store.$state[key]; + return state; + }, {}), + }); + if (store._getters && store._getters.length) { + payload.instanceData.state.push({ + type: getStoreType(store.$id), + key: 'getters', + editable: false, + value: store._getters.reduce((getters, key) => { + try { + getters[key] = store[key]; + } + catch (error) { + // @ts-expect-error: we just want to show it in devtools + getters[key] = error; + } + return getters; + }, {}), + }); + } + }); + } + }); + api.on.getInspectorTree((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + let stores = [pinia]; + stores = stores.concat(Array.from(pinia._s.values())); + payload.rootNodes = (payload.filter + ? stores.filter((store) => '$id' in store + ? store.$id + .toLowerCase() + .includes(payload.filter.toLowerCase()) + : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) + : stores).map(formatStoreForInspectorTree); + } + }); + // Expose pinia instance as $pinia to window + globalThis.$pinia = pinia; + api.on.getInspectorState((payload) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + // this could be the selected store restored for a different project + // so it's better not to say anything here + return; + } + if (inspectedStore) { + // Expose selected store as $store to window + if (payload.nodeId !== PINIA_ROOT_ID) + globalThis.$store = toRaw(inspectedStore); + payload.state = formatStoreForInspectorState(inspectedStore); + } + } + }); + api.on.editInspectorState((payload, ctx) => { + if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { + const inspectedStore = payload.nodeId === PINIA_ROOT_ID + ? pinia + : pinia._s.get(payload.nodeId); + if (!inspectedStore) { + return toastMessage(`store "${payload.nodeId}" not found`, 'error'); + } + const { path } = payload; + if (!isPinia(inspectedStore)) { + // access only the state + if (path.length !== 1 || + !inspectedStore._customProperties.has(path[0]) || + path[0] in inspectedStore.$state) { + path.unshift('$state'); + } + } + else { + // Root access, we can omit the `.value` because the devtools API does it for us + path.unshift('state'); + } + isTimelineActive = false; + payload.set(inspectedStore, path, payload.state.value); + isTimelineActive = true; + } + }); + api.on.editComponentState((payload) => { + if (payload.type.startsWith('🍍')) { + const storeId = payload.type.replace(/^🍍\s*/, ''); + const store = pinia._s.get(storeId); + if (!store) { + return toastMessage(`store "${storeId}" not found`, 'error'); + } + const { path } = payload; + if (path[0] !== 'state') { + return toastMessage(`Invalid path for store "${storeId}":\n${path}\nOnly state can be modified.`); + } + // rewrite the first entry to be able to directly set the state as + // well as any other path + path[0] = '$state'; + isTimelineActive = false; + payload.set(store, path, payload.state.value); + isTimelineActive = true; + } + }); + }); +} +function addStoreToDevtools(app, store) { + if (!componentStateTypes.includes(getStoreType(store.$id))) { + componentStateTypes.push(getStoreType(store.$id)); + } + setupDevtoolsPlugin({ + id: 'dev.esm.pinia', + label: 'Pinia 🍍', + logo: 'https://pinia.vuejs.org/logo.svg', + packageName: 'pinia', + homepage: 'https://pinia.vuejs.org', + componentStateTypes, + app, + settings: { + logStoreChanges: { + label: 'Notify about new/deleted stores', + type: 'boolean', + defaultValue: true, + }, + // useEmojis: { + // label: 'Use emojis in messages ⚡️', + // type: 'boolean', + // defaultValue: true, + // }, + }, + }, (api) => { + // gracefully handle errors + const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now; + store.$onAction(({ after, onError, name, args }) => { + const groupId = runningActionId++; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛫 ' + name, + subtitle: 'start', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + }, + groupId, + }, + }); + after((result) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🛬 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + result, + }, + groupId, + }, + }); + }); + onError((error) => { + activeAction = undefined; + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + logType: 'error', + title: '💥 ' + name, + subtitle: 'end', + data: { + store: formatDisplay(store.$id), + action: formatDisplay(name), + args, + error, + }, + groupId, + }, + }); + }); + }, true); + store._customProperties.forEach((name) => { + watch(() => unref(store[name]), (newValue, oldValue) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (isTimelineActive) { + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: 'Change', + subtitle: name, + data: { + newValue, + oldValue, + }, + groupId: activeAction, + }, + }); + } + }, { deep: true }); + }); + store.$subscribe(({ events, type }, state) => { + api.notifyComponentUpdate(); + api.sendInspectorState(INSPECTOR_ID); + if (!isTimelineActive) + return; + // rootStore.state[store.id] = state + const eventData = { + time: now(), + title: formatMutationType(type), + data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)), + groupId: activeAction, + }; + if (type === MutationType.patchFunction) { + eventData.subtitle = '⤵️'; + } + else if (type === MutationType.patchObject) { + eventData.subtitle = '🧩'; + } + else if (events && !Array.isArray(events)) { + eventData.subtitle = events.type; + } + if (events) { + eventData.data['rawEvent(s)'] = { + _custom: { + display: 'DebuggerEvent', + type: 'object', + tooltip: 'raw DebuggerEvent[]', + value: events, + }, + }; + } + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: eventData, + }); + }, { detached: true, flush: 'sync' }); + const hotUpdate = store._hotUpdate; + store._hotUpdate = markRaw((newStore) => { + hotUpdate(newStore); + api.addTimelineEvent({ + layerId: MUTATIONS_LAYER_ID, + event: { + time: now(), + title: '🔥 ' + store.$id, + subtitle: 'HMR update', + data: { + store: formatDisplay(store.$id), + info: formatDisplay(`HMR update`), + }, + }, + }); + // update the devtools too + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + }); + const { $dispose } = store; + store.$dispose = () => { + $dispose(); + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`Disposed "${store.$id}" store 🗑`); + }; + // trigger an update so it can display new registered stores + api.notifyComponentUpdate(); + api.sendInspectorTree(INSPECTOR_ID); + api.sendInspectorState(INSPECTOR_ID); + api.getSettings().logStoreChanges && + toastMessage(`"${store.$id}" store installed 🆕`); + }); +} +let runningActionId = 0; +let activeAction; +/** + * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the + * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state + * mutation to the action. + * + * @param store - store to patch + * @param actionNames - list of actionst to patch + */ +function patchActionForGrouping(store, actionNames, wrapWithProxy) { + // original actions of the store as they are given by pinia. We are going to override them + const actions = actionNames.reduce((storeActions, actionName) => { + // use toRaw to avoid tracking #541 + storeActions[actionName] = toRaw(store)[actionName]; + return storeActions; + }, {}); + for (const actionName in actions) { + store[actionName] = function () { + // the running action id is incremented in a before action hook + const _actionId = runningActionId; + const trackedStore = wrapWithProxy + ? new Proxy(store, { + get(...args) { + activeAction = _actionId; + return Reflect.get(...args); + }, + set(...args) { + activeAction = _actionId; + return Reflect.set(...args); + }, + }) + : store; + // For Setup Stores we need https://github.com/tc39/proposal-async-context + activeAction = _actionId; + const retValue = actions[actionName].apply(trackedStore, arguments); + // this is safer as async actions in Setup Stores would associate mutations done outside of the action + activeAction = undefined; + return retValue; + }; + } +} +/** + * pinia.use(devtoolsPlugin) + */ +function devtoolsPlugin({ app, store, options }) { + // HMR module + if (store.$id.startsWith('__hot:')) { + return; + } + // detect option api vs setup api + store._isOptionsAPI = !!options.state; + // Do not overwrite actions mocked by @pinia/testing (#2298) + if (!store._p._testing) { + patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI); + // Upgrade the HMR to also update the new actions + const originalHotUpdate = store._hotUpdate; + toRaw(store)._hotUpdate = function (newStore) { + originalHotUpdate.apply(this, arguments); + patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI); + }; + } + addStoreToDevtools(app, + // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric? + store); +} + +/** + * Creates a Pinia instance to be used by the application + */ +function createPinia() { + const scope = effectScope(true); + // NOTE: here we could check the window object for a state and directly set it + // if there is anything like it with Vue 3 SSR + const state = scope.run(() => ref({})); + let _p = []; + // plugins added before calling app.use(pinia) + let toBeInstalled = []; + const pinia = markRaw({ + install(app) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + if (!isVue2) { + pinia._a = app; + app.provide(piniaSymbol, pinia); + app.config.globalProperties.$pinia = pinia; + /* istanbul ignore else */ + if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + registerPiniaDevtools(app, pinia); + } + toBeInstalled.forEach((plugin) => _p.push(plugin)); + toBeInstalled = []; + } + }, + use(plugin) { + if (!this._a && !isVue2) { + toBeInstalled.push(plugin); + } + else { + _p.push(plugin); + } + return this; + }, + _p, + // it's actually undefined here + // @ts-expect-error + _a: null, + _e: scope, + _s: new Map(), + state, + }); + // pinia devtools rely on dev only features so they cannot be forced unless + // the dev build of Vue is used. Avoid old browsers like IE11. + if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') { + pinia.use(devtoolsPlugin); + } + return pinia; +} +/** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ +function disposePinia(pinia) { + pinia._e.stop(); + pinia._s.clear(); + pinia._p.splice(0); + pinia.state.value = {}; + // @ts-expect-error: non valid + pinia._a = null; +} + +/** + * Checks if a function is a `StoreDefinition`. + * + * @param fn - object to test + * @returns true if `fn` is a StoreDefinition + */ +const isUseStore = (fn) => { + return typeof fn === 'function' && typeof fn.$id === 'string'; +}; +/** + * Mutates in place `newState` with `oldState` to _hot update_ it. It will + * remove any key not existing in `newState` and recursively merge plain + * objects. + * + * @param newState - new state object to be patched + * @param oldState - old state that should be used to patch newState + * @returns - newState + */ +function patchObject(newState, oldState) { + // no need to go through symbols because they cannot be serialized anyway + for (const key in oldState) { + const subPatch = oldState[key]; + // skip the whole sub tree + if (!(key in newState)) { + continue; + } + const targetValue = newState[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + !isRef(subPatch) && + !isReactive(subPatch)) { + newState[key] = patchObject(targetValue, subPatch); + } + else { + // objects are either a bit more complex (e.g. refs) or primitives, so we + // just set the whole thing + if (isVue2) { + set(newState, key, subPatch); + } + else { + newState[key] = subPatch; + } + } + } + return newState; +} +/** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ +function acceptHMRUpdate(initialUseStore, hot) { + // strip as much as possible from iife.prod + if (!(process.env.NODE_ENV !== 'production')) { + return () => { }; + } + return (newModule) => { + const pinia = hot.data.pinia || initialUseStore._pinia; + if (!pinia) { + // this store is still not used + return; + } + // preserve the pinia instance across loads + hot.data.pinia = pinia; + // console.log('got data', newStore) + for (const exportName in newModule) { + const useStore = newModule[exportName]; + // console.log('checking for', exportName) + if (isUseStore(useStore) && pinia._s.has(useStore.$id)) { + // console.log('Accepting update for', useStore.$id) + const id = useStore.$id; + if (id !== initialUseStore.$id) { + console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`); + // return import.meta.hot.invalidate() + return hot.invalidate(); + } + const existingStore = pinia._s.get(id); + if (!existingStore) { + console.log(`[Pinia]: skipping hmr because store doesn't exist yet`); + return; + } + useStore(pinia, existingStore); + } + } + }; +} + +const noop = () => { }; +function addSubscription(subscriptions, callback, detached, onCleanup = noop) { + subscriptions.push(callback); + const removeSubscription = () => { + const idx = subscriptions.indexOf(callback); + if (idx > -1) { + subscriptions.splice(idx, 1); + onCleanup(); + } + }; + if (!detached && getCurrentScope()) { + onScopeDispose(removeSubscription); + } + return removeSubscription; +} +function triggerSubscriptions(subscriptions, ...args) { + subscriptions.slice().forEach((callback) => { + callback(...args); + }); +} + +const fallbackRunWithContext = (fn) => fn(); +/** + * Marks a function as an action for `$onAction` + * @internal + */ +const ACTION_MARKER = Symbol(); +/** + * Action name symbol. Allows to add a name to an action after defining it + * @internal + */ +const ACTION_NAME = Symbol(); +function mergeReactiveObjects(target, patchToApply) { + // Handle Map instances + if (target instanceof Map && patchToApply instanceof Map) { + patchToApply.forEach((value, key) => target.set(key, value)); + } + else if (target instanceof Set && patchToApply instanceof Set) { + // Handle Set instances + patchToApply.forEach(target.add, target); + } + // no need to go through symbols because they cannot be serialized anyway + for (const key in patchToApply) { + if (!patchToApply.hasOwnProperty(key)) + continue; + const subPatch = patchToApply[key]; + const targetValue = target[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + target.hasOwnProperty(key) && + !isRef(subPatch) && + !isReactive(subPatch)) { + // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might + // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that + // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. + target[key] = mergeReactiveObjects(targetValue, subPatch); + } + else { + // @ts-expect-error: subPatch is a valid value + target[key] = subPatch; + } + } + return target; +} +const skipHydrateSymbol = (process.env.NODE_ENV !== 'production') + ? Symbol('pinia:skipHydration') + : /* istanbul ignore next */ Symbol(); +/** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ +function skipHydrate(obj) { + return Object.defineProperty(obj, skipHydrateSymbol, {}); +} +/** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ +function shouldHydrate(obj) { + return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); +} +const { assign } = Object; +function isComputed(o) { + return !!(isRef(o) && o.effect); +} +function createOptionsStore(id, options, pinia, hot) { + const { state, actions, getters } = options; + const initialState = pinia.state.value[id]; + let store; + function setup() { + if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value, id, state ? state() : {}); + } + else { + pinia.state.value[id] = state ? state() : {}; + } + } + // avoid creating a state in pinia.state.value + const localState = (process.env.NODE_ENV !== 'production') && hot + ? // use ref() to unwrap refs inside state TODO: check if this is still necessary + toRefs(ref(state ? state() : {}).value) + : toRefs(pinia.state.value[id]); + return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { + if ((process.env.NODE_ENV !== 'production') && name in localState) { + console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); + } + computedGetters[name] = markRaw(computed(() => { + setActivePinia(pinia); + // it was created just before + const store = pinia._s.get(id); + // allow cross using stores + /* istanbul ignore if */ + if (isVue2 && !store._r) + return; + // @ts-expect-error + // return getters![name].call(context, context) + // TODO: avoid reading the getter while assigning with a global variable + return getters[name].call(store, store); + })); + return computedGetters; + }, {})); + } + store = createSetupStore(id, setup, options, pinia, hot, true); + return store; +} +function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { + let scope; + const optionsForPlugin = assign({ actions: {} }, options); + /* istanbul ignore if */ + if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) { + throw new Error('Pinia destroyed'); + } + // watcher options for $subscribe + const $subscribeOptions = { deep: true }; + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production') && !isVue2) { + $subscribeOptions.onTrigger = (event) => { + /* istanbul ignore else */ + if (isListening) { + debuggerEvents = event; + // avoid triggering this while the store is being built and the state is being set in pinia + } + else if (isListening == false && !store._hotUpdating) { + // let patch send all the events together later + /* istanbul ignore else */ + if (Array.isArray(debuggerEvents)) { + debuggerEvents.push(event); + } + else { + console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.'); + } + } + }; + } + // internal state + let isListening; // set to true at the end + let isSyncListening; // set to true at the end + let subscriptions = []; + let actionSubscriptions = []; + let debuggerEvents; + const initialState = pinia.state.value[$id]; + // avoid setting the state for option stores if it is set + // by the setup + if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) { + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value, $id, {}); + } + else { + pinia.state.value[$id] = {}; + } + } + const hotState = ref({}); + // avoid triggering too many listeners + // https://github.com/vuejs/pinia/issues/1129 + let activeListener; + function $patch(partialStateOrMutator) { + let subscriptionMutation; + isListening = isSyncListening = false; + // reset the debugger events since patches are sync + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + debuggerEvents = []; + } + if (typeof partialStateOrMutator === 'function') { + partialStateOrMutator(pinia.state.value[$id]); + subscriptionMutation = { + type: MutationType.patchFunction, + storeId: $id, + events: debuggerEvents, + }; + } + else { + mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); + subscriptionMutation = { + type: MutationType.patchObject, + payload: partialStateOrMutator, + storeId: $id, + events: debuggerEvents, + }; + } + const myListenerId = (activeListener = Symbol()); + nextTick().then(() => { + if (activeListener === myListenerId) { + isListening = true; + } + }); + isSyncListening = true; + // because we paused the watcher, we need to manually call the subscriptions + triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); + } + const $reset = isOptionsStore + ? function $reset() { + const { state } = options; + const newState = state ? state() : {}; + // we use a patch to group all changes into one single subscription + this.$patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, newState); + }); + } + : /* istanbul ignore next */ + (process.env.NODE_ENV !== 'production') + ? () => { + throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`); + } + : noop; + function $dispose() { + scope.stop(); + subscriptions = []; + actionSubscriptions = []; + pinia._s.delete($id); + } + /** + * Helper that wraps function so it can be tracked with $onAction + * @param fn - action to wrap + * @param name - name of the action + */ + const action = (fn, name = '') => { + if (ACTION_MARKER in fn) { + fn[ACTION_NAME] = name; + return fn; + } + const wrappedAction = function () { + setActivePinia(pinia); + const args = Array.from(arguments); + const afterCallbackList = []; + const onErrorCallbackList = []; + function after(callback) { + afterCallbackList.push(callback); + } + function onError(callback) { + onErrorCallbackList.push(callback); + } + // @ts-expect-error + triggerSubscriptions(actionSubscriptions, { + args, + name: wrappedAction[ACTION_NAME], + store, + after, + onError, + }); + let ret; + try { + ret = fn.apply(this && this.$id === $id ? this : store, args); + // handle sync errors + } + catch (error) { + triggerSubscriptions(onErrorCallbackList, error); + throw error; + } + if (ret instanceof Promise) { + return ret + .then((value) => { + triggerSubscriptions(afterCallbackList, value); + return value; + }) + .catch((error) => { + triggerSubscriptions(onErrorCallbackList, error); + return Promise.reject(error); + }); + } + // trigger after callbacks + triggerSubscriptions(afterCallbackList, ret); + return ret; + }; + wrappedAction[ACTION_MARKER] = true; + wrappedAction[ACTION_NAME] = name; // will be set later + // @ts-expect-error: we are intentionally limiting the returned type to just Fn + // because all the added properties are internals that are exposed through `$onAction()` only + return wrappedAction; + }; + const _hmrPayload = /*#__PURE__*/ markRaw({ + actions: {}, + getters: {}, + state: [], + hotState, + }); + const partialStore = { + _p: pinia, + // _s: scope, + $id, + $onAction: addSubscription.bind(null, actionSubscriptions), + $patch, + $reset, + $subscribe(callback, options = {}) { + const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); + const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => { + if (options.flush === 'sync' ? isSyncListening : isListening) { + callback({ + storeId: $id, + type: MutationType.direct, + events: debuggerEvents, + }, state); + } + }, assign({}, $subscribeOptions, options))); + return removeSubscription; + }, + $dispose, + }; + /* istanbul ignore if */ + if (isVue2) { + // start as non ready + partialStore._r = false; + } + const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) + ? assign({ + _hmrPayload, + _customProperties: markRaw(new Set()), // devtools custom properties + }, partialStore + // must be added later + // setupStore + ) + : partialStore); + // store the partial store now so the setup of stores can instantiate each other before they are finished without + // creating infinite loops. + pinia._s.set($id, store); + const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; + // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped + const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action })))); + // overwrite existing actions to support $onAction + for (const key in setupStore) { + const prop = setupStore[key]; + if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) { + // mark it as a piece of state to be serialized + if ((process.env.NODE_ENV !== 'production') && hot) { + set(hotState.value, key, toRef(setupStore, key)); + // createOptionStore directly sets the state in pinia.state.value so we + // can just skip that + } + else if (!isOptionsStore) { + // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created + if (initialState && shouldHydrate(prop)) { + if (isRef(prop)) { + prop.value = initialState[key]; + } + else { + // probably a reactive object, lets recursively assign + // @ts-expect-error: prop is unknown + mergeReactiveObjects(prop, initialState[key]); + } + } + // transfer the ref to the pinia state to keep everything in sync + /* istanbul ignore if */ + if (isVue2) { + set(pinia.state.value[$id], key, prop); + } + else { + pinia.state.value[$id][key] = prop; + } + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + _hmrPayload.state.push(key); + } + // action + } + else if (typeof prop === 'function') { + const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key); + // this a hot module replacement store because the hotUpdate method needs + // to do it with the right context + /* istanbul ignore if */ + if (isVue2) { + set(setupStore, key, actionValue); + } + else { + // @ts-expect-error + setupStore[key] = actionValue; + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + _hmrPayload.actions[key] = prop; + } + // list actions so they can be used in plugins + // @ts-expect-error + optionsForPlugin.actions[key] = prop; + } + else if ((process.env.NODE_ENV !== 'production')) { + // add getters for devtools + if (isComputed(prop)) { + _hmrPayload.getters[key] = isOptionsStore + ? // @ts-expect-error + options.getters[key] + : prop; + if (IS_CLIENT) { + const getters = setupStore._getters || + // @ts-expect-error: same + (setupStore._getters = markRaw([])); + getters.push(key); + } + } + } + } + // add the state, getters, and action properties + /* istanbul ignore if */ + if (isVue2) { + Object.keys(setupStore).forEach((key) => { + set(store, key, setupStore[key]); + }); + } + else { + assign(store, setupStore); + // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. + // Make `storeToRefs()` work with `reactive()` #799 + assign(toRaw(store), setupStore); + } + // use this instead of a computed with setter to be able to create it anywhere + // without linking the computed lifespan to wherever the store is first + // created. + Object.defineProperty(store, '$state', { + get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]), + set: (state) => { + /* istanbul ignore if */ + if ((process.env.NODE_ENV !== 'production') && hot) { + throw new Error('cannot set hotState'); + } + $patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, state); + }); + }, + }); + // add the hotUpdate before plugins to allow them to override it + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + store._hotUpdate = markRaw((newStore) => { + store._hotUpdating = true; + newStore._hmrPayload.state.forEach((stateKey) => { + if (stateKey in store.$state) { + const newStateTarget = newStore.$state[stateKey]; + const oldStateSource = store.$state[stateKey]; + if (typeof newStateTarget === 'object' && + isPlainObject(newStateTarget) && + isPlainObject(oldStateSource)) { + patchObject(newStateTarget, oldStateSource); + } + else { + // transfer the ref + newStore.$state[stateKey] = oldStateSource; + } + } + // patch direct access properties to allow store.stateProperty to work as + // store.$state.stateProperty + set(store, stateKey, toRef(newStore.$state, stateKey)); + }); + // remove deleted state properties + Object.keys(store.$state).forEach((stateKey) => { + if (!(stateKey in newStore.$state)) { + del(store, stateKey); + } + }); + // avoid devtools logging this as a mutation + isListening = false; + isSyncListening = false; + pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState'); + isSyncListening = true; + nextTick().then(() => { + isListening = true; + }); + for (const actionName in newStore._hmrPayload.actions) { + const actionFn = newStore[actionName]; + set(store, actionName, action(actionFn, actionName)); + } + // TODO: does this work in both setup and option store? + for (const getterName in newStore._hmrPayload.getters) { + const getter = newStore._hmrPayload.getters[getterName]; + const getterValue = isOptionsStore + ? // special handling of options api + computed(() => { + setActivePinia(pinia); + return getter.call(store, store); + }) + : getter; + set(store, getterName, getterValue); + } + // remove deleted getters + Object.keys(store._hmrPayload.getters).forEach((key) => { + if (!(key in newStore._hmrPayload.getters)) { + del(store, key); + } + }); + // remove old actions + Object.keys(store._hmrPayload.actions).forEach((key) => { + if (!(key in newStore._hmrPayload.actions)) { + del(store, key); + } + }); + // update the values used in devtools and to allow deleting new properties later on + store._hmrPayload = newStore._hmrPayload; + store._getters = newStore._getters; + store._hotUpdating = false; + }); + } + if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + const nonEnumerable = { + writable: true, + configurable: true, + // avoid warning on devtools trying to display this property + enumerable: false, + }; + ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => { + Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable)); + }); + } + /* istanbul ignore if */ + if (isVue2) { + // mark the store as ready before plugins + store._r = true; + } + // apply all plugins + pinia._p.forEach((extender) => { + /* istanbul ignore else */ + if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + const extensions = scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + })); + Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); + assign(store, extensions); + } + else { + assign(store, scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + }))); + } + }); + if ((process.env.NODE_ENV !== 'production') && + store.$state && + typeof store.$state === 'object' && + typeof store.$state.constructor === 'function' && + !store.$state.constructor.toString().includes('[native code]')) { + console.warn(`[🍍]: The "state" must be a plain object. It cannot be\n` + + `\tstate: () => new MyClass()\n` + + `Found in store "${store.$id}".`); + } + // only apply hydrate to option stores with an initial state in pinia + if (initialState && + isOptionsStore && + options.hydrate) { + options.hydrate(store.$state, initialState); + } + isListening = true; + isSyncListening = true; + return store; +} +// allows unused stores to be tree shaken +/*! #__NO_SIDE_EFFECTS__ */ +function defineStore( +// TODO: add proper types from above +idOrOptions, setup, setupOptions) { + let id; + let options; + const isSetupStore = typeof setup === 'function'; + if (typeof idOrOptions === 'string') { + id = idOrOptions; + // the option store setup will contain the actual options in this case + options = isSetupStore ? setupOptions : setup; + } + else { + options = idOrOptions; + id = idOrOptions.id; + if ((process.env.NODE_ENV !== 'production') && typeof id !== 'string') { + throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`); + } + } + function useStore(pinia, hot) { + const hasContext = hasInjectionContext(); + pinia = + // in test mode, ignore the argument provided as we can always retrieve a + // pinia instance with getActivePinia() + ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || + (hasContext ? inject(piniaSymbol, null) : null); + if (pinia) + setActivePinia(pinia); + if ((process.env.NODE_ENV !== 'production') && !activePinia) { + throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?\n` + + `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\n` + + `This will fail in production.`); + } + pinia = activePinia; + if (!pinia._s.has(id)) { + // creating the store registers it in `pinia._s` + if (isSetupStore) { + createSetupStore(id, setup, options, pinia); + } + else { + createOptionsStore(id, options, pinia); + } + /* istanbul ignore else */ + if ((process.env.NODE_ENV !== 'production')) { + // @ts-expect-error: not the right inferred type + useStore._pinia = pinia; + } + } + const store = pinia._s.get(id); + if ((process.env.NODE_ENV !== 'production') && hot) { + const hotId = '__hot:' + id; + const newStore = isSetupStore + ? createSetupStore(hotId, setup, options, pinia, true) + : createOptionsStore(hotId, assign({}, options), pinia, true); + hot._hotUpdate(newStore); + // cleanup the state properties and the store from the cache + delete pinia.state.value[hotId]; + pinia._s.delete(hotId); + } + if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) { + const currentInstance = getCurrentInstance(); + // save stores in instances to access them devtools + if (currentInstance && + currentInstance.proxy && + // avoid adding stores that are just built for hot module replacement + !hot) { + const vm = currentInstance.proxy; + const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {}); + cache[id] = store; + } + } + // StoreGeneric cannot be casted towards Store + return store; + } + useStore.$id = id; + return useStore; +} + +let mapStoreSuffix = 'Store'; +/** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ +function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS +) { + mapStoreSuffix = suffix; +} +/** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ +function mapStores(...stores) { + if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) { + console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:\n` + + `Replace\n` + + `\tmapStores([useAuthStore, useCartStore])\n` + + `with\n` + + `\tmapStores(useAuthStore, useCartStore)\n` + + `This will fail in production if not fixed.`); + stores = stores[0]; + } + return stores.reduce((reduced, useStore) => { + // @ts-expect-error: $id is added by defineStore + reduced[useStore.$id + mapStoreSuffix] = function () { + return useStore(this.$pinia); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = function () { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key]; + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function () { + const store = useStore(this.$pinia); + const storeKey = keysOrMapper[key]; + // for some reason TS is unable to infer the type of storeKey to be a + // function + return typeof storeKey === 'function' + ? storeKey.call(this, store) + : // @ts-expect-error: FIXME: should work? + store[storeKey]; + }; + return reduced; + }, {}); +} +/** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ +const mapGetters = mapState; +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapActions(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key](...args); + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[keysOrMapper[key]](...args); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapWritableState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[key]; + }, + set(value) { + return (useStore(this.$pinia)[key] = value); + }, + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[keysOrMapper[key]]; + }, + set(value) { + return (useStore(this.$pinia)[keysOrMapper[key]] = value); + }, + }; + return reduced; + }, {}); +} + +/** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ +function storeToRefs(store) { + // See https://github.com/vuejs/pinia/issues/852 + // It's easier to just use toRefs() even if it includes more stuff + if (isVue2) { + // @ts-expect-error: toRefs include methods and others + return toRefs(store); + } + else { + const rawStore = toRaw(store); + const refs = {}; + for (const key in rawStore) { + const value = rawStore[key]; + // There is no native method to check for a computed + // https://github.com/vuejs/core/pull/4165 + if (value.effect) { + // @ts-expect-error: too hard to type correctly + refs[key] = + // ... + computed({ + get: () => store[key], + set(value) { + store[key] = value; + }, + }); + } + else if (isRef(value) || isReactive(value)) { + // @ts-expect-error: the key is state or getter + refs[key] = + // --- + toRef(store, key); + } + } + return refs; + } +} + +/** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ +const PiniaVuePlugin = function (_Vue) { + // Equivalent of + // app.config.globalProperties.$pinia = pinia + _Vue.mixin({ + beforeCreate() { + const options = this.$options; + if (options.pinia) { + const pinia = options.pinia; + // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 + /* istanbul ignore else */ + if (!this._provided) { + const provideCache = {}; + Object.defineProperty(this, '_provided', { + get: () => provideCache, + set: (v) => Object.assign(provideCache, v), + }); + } + this._provided[piniaSymbol] = pinia; + // propagate the pinia instance in an SSR friendly way + // avoid adding it to nuxt twice + /* istanbul ignore else */ + if (!this.$pinia) { + this.$pinia = pinia; + } + pinia._a = this; + if (IS_CLIENT) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + } + if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) { + registerPiniaDevtools(pinia._a, pinia); + } + } + else if (!this.$pinia && options.parent && options.parent.$pinia) { + this.$pinia = options.parent.$pinia; + } + }, + destroyed() { + delete this._pStores; + }, + }); +}; + +export { MutationType, PiniaVuePlugin, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs }; diff --git a/seller_1/node_modules/pinia/dist/pinia.prod.cjs b/seller_1/node_modules/pinia/dist/pinia.prod.cjs new file mode 100644 index 0000000..7a61470 --- /dev/null +++ b/seller_1/node_modules/pinia/dist/pinia.prod.cjs @@ -0,0 +1,846 @@ +/*! + * pinia v2.3.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +'use strict'; + +var vueDemi = require('vue-demi'); + +/** + * setActivePinia must be called to handle SSR at the top of functions like + * `fetch`, `setup`, `serverPrefetch` and others + */ +let activePinia; +/** + * Sets or unsets the active pinia. Used in SSR and internally when calling + * actions and getters + * + * @param pinia - Pinia instance + */ +// @ts-expect-error: cannot constrain the type of the return +const setActivePinia = (pinia) => (activePinia = pinia); +/** + * Get the currently active pinia if there is any. + */ +const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia; +const piniaSymbol = (/* istanbul ignore next */ Symbol()); + +function isPlainObject( +// eslint-disable-next-line @typescript-eslint/no-explicit-any +o) { + return (o && + typeof o === 'object' && + Object.prototype.toString.call(o) === '[object Object]' && + typeof o.toJSON !== 'function'); +} +// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> } +// TODO: can we change these to numbers? +/** + * Possible types for SubscriptionCallback + */ +exports.MutationType = void 0; +(function (MutationType) { + /** + * Direct mutation of the state: + * + * - `store.name = 'new name'` + * - `store.$state.name = 'new name'` + * - `store.list.push('new item')` + */ + MutationType["direct"] = "direct"; + /** + * Mutated the state with `$patch` and an object + * + * - `store.$patch({ name: 'newName' })` + */ + MutationType["patchObject"] = "patch object"; + /** + * Mutated the state with `$patch` and a function + * + * - `store.$patch(state => state.name = 'newName')` + */ + MutationType["patchFunction"] = "patch function"; + // maybe reset? for $state = {} and $reset +})(exports.MutationType || (exports.MutationType = {})); + +const IS_CLIENT = typeof window !== 'undefined'; + +/** + * Creates a Pinia instance to be used by the application + */ +function createPinia() { + const scope = vueDemi.effectScope(true); + // NOTE: here we could check the window object for a state and directly set it + // if there is anything like it with Vue 3 SSR + const state = scope.run(() => vueDemi.ref({})); + let _p = []; + // plugins added before calling app.use(pinia) + let toBeInstalled = []; + const pinia = vueDemi.markRaw({ + install(app) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + if (!vueDemi.isVue2) { + pinia._a = app; + app.provide(piniaSymbol, pinia); + app.config.globalProperties.$pinia = pinia; + toBeInstalled.forEach((plugin) => _p.push(plugin)); + toBeInstalled = []; + } + }, + use(plugin) { + if (!this._a && !vueDemi.isVue2) { + toBeInstalled.push(plugin); + } + else { + _p.push(plugin); + } + return this; + }, + _p, + // it's actually undefined here + // @ts-expect-error + _a: null, + _e: scope, + _s: new Map(), + state, + }); + return pinia; +} +/** + * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly + * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances. + * Once disposed, the pinia instance cannot be used anymore. + * + * @param pinia - pinia instance + */ +function disposePinia(pinia) { + pinia._e.stop(); + pinia._s.clear(); + pinia._p.splice(0); + pinia.state.value = {}; + // @ts-expect-error: non valid + pinia._a = null; +} + +/** + * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications. + * + * @example + * ```js + * const useUser = defineStore(...) + * if (import.meta.hot) { + * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot)) + * } + * ``` + * + * @param initialUseStore - return of the defineStore to hot update + * @param hot - `import.meta.hot` + */ +function acceptHMRUpdate(initialUseStore, hot) { + // strip as much as possible from iife.prod + { + return () => { }; + } +} + +const noop = () => { }; +function addSubscription(subscriptions, callback, detached, onCleanup = noop) { + subscriptions.push(callback); + const removeSubscription = () => { + const idx = subscriptions.indexOf(callback); + if (idx > -1) { + subscriptions.splice(idx, 1); + onCleanup(); + } + }; + if (!detached && vueDemi.getCurrentScope()) { + vueDemi.onScopeDispose(removeSubscription); + } + return removeSubscription; +} +function triggerSubscriptions(subscriptions, ...args) { + subscriptions.slice().forEach((callback) => { + callback(...args); + }); +} + +const fallbackRunWithContext = (fn) => fn(); +/** + * Marks a function as an action for `$onAction` + * @internal + */ +const ACTION_MARKER = Symbol(); +/** + * Action name symbol. Allows to add a name to an action after defining it + * @internal + */ +const ACTION_NAME = Symbol(); +function mergeReactiveObjects(target, patchToApply) { + // Handle Map instances + if (target instanceof Map && patchToApply instanceof Map) { + patchToApply.forEach((value, key) => target.set(key, value)); + } + else if (target instanceof Set && patchToApply instanceof Set) { + // Handle Set instances + patchToApply.forEach(target.add, target); + } + // no need to go through symbols because they cannot be serialized anyway + for (const key in patchToApply) { + if (!patchToApply.hasOwnProperty(key)) + continue; + const subPatch = patchToApply[key]; + const targetValue = target[key]; + if (isPlainObject(targetValue) && + isPlainObject(subPatch) && + target.hasOwnProperty(key) && + !vueDemi.isRef(subPatch) && + !vueDemi.isReactive(subPatch)) { + // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might + // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that + // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`. + target[key] = mergeReactiveObjects(targetValue, subPatch); + } + else { + // @ts-expect-error: subPatch is a valid value + target[key] = subPatch; + } + } + return target; +} +const skipHydrateSymbol = /* istanbul ignore next */ Symbol(); +/** + * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a + * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store. + * + * @param obj - target object + * @returns obj + */ +function skipHydrate(obj) { + return Object.defineProperty(obj, skipHydrateSymbol, {}); +} +/** + * Returns whether a value should be hydrated + * + * @param obj - target variable + * @returns true if `obj` should be hydrated + */ +function shouldHydrate(obj) { + return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); +} +const { assign } = Object; +function isComputed(o) { + return !!(vueDemi.isRef(o) && o.effect); +} +function createOptionsStore(id, options, pinia, hot) { + const { state, actions, getters } = options; + const initialState = pinia.state.value[id]; + let store; + function setup() { + if (!initialState && (!false)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, id, state ? state() : {}); + } + else { + pinia.state.value[id] = state ? state() : {}; + } + } + // avoid creating a state in pinia.state.value + const localState = vueDemi.toRefs(pinia.state.value[id]); + return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { + computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => { + setActivePinia(pinia); + // it was created just before + const store = pinia._s.get(id); + // allow cross using stores + /* istanbul ignore if */ + if (vueDemi.isVue2 && !store._r) + return; + // @ts-expect-error + // return getters![name].call(context, context) + // TODO: avoid reading the getter while assigning with a global variable + return getters[name].call(store, store); + })); + return computedGetters; + }, {})); + } + store = createSetupStore(id, setup, options, pinia, hot, true); + return store; +} +function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { + let scope; + const optionsForPlugin = assign({ actions: {} }, options); + // watcher options for $subscribe + const $subscribeOptions = { deep: true }; + // internal state + let isListening; // set to true at the end + let isSyncListening; // set to true at the end + let subscriptions = []; + let actionSubscriptions = []; + let debuggerEvents; + const initialState = pinia.state.value[$id]; + // avoid setting the state for option stores if it is set + // by the setup + if (!isOptionsStore && !initialState && (!false)) { + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value, $id, {}); + } + else { + pinia.state.value[$id] = {}; + } + } + vueDemi.ref({}); + // avoid triggering too many listeners + // https://github.com/vuejs/pinia/issues/1129 + let activeListener; + function $patch(partialStateOrMutator) { + let subscriptionMutation; + isListening = isSyncListening = false; + if (typeof partialStateOrMutator === 'function') { + partialStateOrMutator(pinia.state.value[$id]); + subscriptionMutation = { + type: exports.MutationType.patchFunction, + storeId: $id, + events: debuggerEvents, + }; + } + else { + mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); + subscriptionMutation = { + type: exports.MutationType.patchObject, + payload: partialStateOrMutator, + storeId: $id, + events: debuggerEvents, + }; + } + const myListenerId = (activeListener = Symbol()); + vueDemi.nextTick().then(() => { + if (activeListener === myListenerId) { + isListening = true; + } + }); + isSyncListening = true; + // because we paused the watcher, we need to manually call the subscriptions + triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); + } + const $reset = isOptionsStore + ? function $reset() { + const { state } = options; + const newState = state ? state() : {}; + // we use a patch to group all changes into one single subscription + this.$patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, newState); + }); + } + : /* istanbul ignore next */ + noop; + function $dispose() { + scope.stop(); + subscriptions = []; + actionSubscriptions = []; + pinia._s.delete($id); + } + /** + * Helper that wraps function so it can be tracked with $onAction + * @param fn - action to wrap + * @param name - name of the action + */ + const action = (fn, name = '') => { + if (ACTION_MARKER in fn) { + fn[ACTION_NAME] = name; + return fn; + } + const wrappedAction = function () { + setActivePinia(pinia); + const args = Array.from(arguments); + const afterCallbackList = []; + const onErrorCallbackList = []; + function after(callback) { + afterCallbackList.push(callback); + } + function onError(callback) { + onErrorCallbackList.push(callback); + } + // @ts-expect-error + triggerSubscriptions(actionSubscriptions, { + args, + name: wrappedAction[ACTION_NAME], + store, + after, + onError, + }); + let ret; + try { + ret = fn.apply(this && this.$id === $id ? this : store, args); + // handle sync errors + } + catch (error) { + triggerSubscriptions(onErrorCallbackList, error); + throw error; + } + if (ret instanceof Promise) { + return ret + .then((value) => { + triggerSubscriptions(afterCallbackList, value); + return value; + }) + .catch((error) => { + triggerSubscriptions(onErrorCallbackList, error); + return Promise.reject(error); + }); + } + // trigger after callbacks + triggerSubscriptions(afterCallbackList, ret); + return ret; + }; + wrappedAction[ACTION_MARKER] = true; + wrappedAction[ACTION_NAME] = name; // will be set later + // @ts-expect-error: we are intentionally limiting the returned type to just Fn + // because all the added properties are internals that are exposed through `$onAction()` only + return wrappedAction; + }; + const partialStore = { + _p: pinia, + // _s: scope, + $id, + $onAction: addSubscription.bind(null, actionSubscriptions), + $patch, + $reset, + $subscribe(callback, options = {}) { + const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher()); + const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => { + if (options.flush === 'sync' ? isSyncListening : isListening) { + callback({ + storeId: $id, + type: exports.MutationType.direct, + events: debuggerEvents, + }, state); + } + }, assign({}, $subscribeOptions, options))); + return removeSubscription; + }, + $dispose, + }; + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // start as non ready + partialStore._r = false; + } + const store = vueDemi.reactive(partialStore); + // store the partial store now so the setup of stores can instantiate each other before they are finished without + // creating infinite loops. + pinia._s.set($id, store); + const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext; + // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped + const setupStore = runWithContext(() => pinia._e.run(() => (scope = vueDemi.effectScope()).run(() => setup({ action })))); + // overwrite existing actions to support $onAction + for (const key in setupStore) { + const prop = setupStore[key]; + if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) { + // mark it as a piece of state to be serialized + if (!isOptionsStore) { + // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created + if (initialState && shouldHydrate(prop)) { + if (vueDemi.isRef(prop)) { + prop.value = initialState[key]; + } + else { + // probably a reactive object, lets recursively assign + // @ts-expect-error: prop is unknown + mergeReactiveObjects(prop, initialState[key]); + } + } + // transfer the ref to the pinia state to keep everything in sync + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(pinia.state.value[$id], key, prop); + } + else { + pinia.state.value[$id][key] = prop; + } + } + // action + } + else if (typeof prop === 'function') { + const actionValue = action(prop, key); + // this a hot module replacement store because the hotUpdate method needs + // to do it with the right context + /* istanbul ignore if */ + if (vueDemi.isVue2) { + vueDemi.set(setupStore, key, actionValue); + } + else { + // @ts-expect-error + setupStore[key] = actionValue; + } + // list actions so they can be used in plugins + // @ts-expect-error + optionsForPlugin.actions[key] = prop; + } + else ; + } + // add the state, getters, and action properties + /* istanbul ignore if */ + if (vueDemi.isVue2) { + Object.keys(setupStore).forEach((key) => { + vueDemi.set(store, key, setupStore[key]); + }); + } + else { + assign(store, setupStore); + // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object. + // Make `storeToRefs()` work with `reactive()` #799 + assign(vueDemi.toRaw(store), setupStore); + } + // use this instead of a computed with setter to be able to create it anywhere + // without linking the computed lifespan to wherever the store is first + // created. + Object.defineProperty(store, '$state', { + get: () => (pinia.state.value[$id]), + set: (state) => { + $patch(($state) => { + // @ts-expect-error: FIXME: shouldn't error? + assign($state, state); + }); + }, + }); + /* istanbul ignore if */ + if (vueDemi.isVue2) { + // mark the store as ready before plugins + store._r = true; + } + // apply all plugins + pinia._p.forEach((extender) => { + /* istanbul ignore else */ + { + assign(store, scope.run(() => extender({ + store: store, + app: pinia._a, + pinia, + options: optionsForPlugin, + }))); + } + }); + // only apply hydrate to option stores with an initial state in pinia + if (initialState && + isOptionsStore && + options.hydrate) { + options.hydrate(store.$state, initialState); + } + isListening = true; + isSyncListening = true; + return store; +} +// allows unused stores to be tree shaken +/*! #__NO_SIDE_EFFECTS__ */ +function defineStore( +// TODO: add proper types from above +idOrOptions, setup, setupOptions) { + let id; + let options; + const isSetupStore = typeof setup === 'function'; + if (typeof idOrOptions === 'string') { + id = idOrOptions; + // the option store setup will contain the actual options in this case + options = isSetupStore ? setupOptions : setup; + } + else { + options = idOrOptions; + id = idOrOptions.id; + } + function useStore(pinia, hot) { + const hasContext = vueDemi.hasInjectionContext(); + pinia = + // in test mode, ignore the argument provided as we can always retrieve a + // pinia instance with getActivePinia() + ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) || + (hasContext ? vueDemi.inject(piniaSymbol, null) : null); + if (pinia) + setActivePinia(pinia); + pinia = activePinia; + if (!pinia._s.has(id)) { + // creating the store registers it in `pinia._s` + if (isSetupStore) { + createSetupStore(id, setup, options, pinia); + } + else { + createOptionsStore(id, options, pinia); + } + } + const store = pinia._s.get(id); + // StoreGeneric cannot be casted towards Store + return store; + } + useStore.$id = id; + return useStore; +} + +let mapStoreSuffix = 'Store'; +/** + * Changes the suffix added by `mapStores()`. Can be set to an empty string. + * Defaults to `"Store"`. Make sure to extend the MapStoresCustomization + * interface if you are using TypeScript. + * + * @param suffix - new suffix + */ +function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS +) { + mapStoreSuffix = suffix; +} +/** + * Allows using stores without the composition API (`setup()`) by generating an + * object to be spread in the `computed` field of a component. It accepts a list + * of store definitions. + * + * @example + * ```js + * export default { + * computed: { + * // other computed properties + * ...mapStores(useUserStore, useCartStore) + * }, + * + * created() { + * this.userStore // store with id "user" + * this.cartStore // store with id "cart" + * } + * } + * ``` + * + * @param stores - list of stores to map to an object + */ +function mapStores(...stores) { + return stores.reduce((reduced, useStore) => { + // @ts-expect-error: $id is added by defineStore + reduced[useStore.$id + mapStoreSuffix] = function () { + return useStore(this.$pinia); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = function () { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key]; + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function () { + const store = useStore(this.$pinia); + const storeKey = keysOrMapper[key]; + // for some reason TS is unable to infer the type of storeKey to be a + // function + return typeof storeKey === 'function' + ? storeKey.call(this, store) + : // @ts-expect-error: FIXME: should work? + store[storeKey]; + }; + return reduced; + }, {}); +} +/** + * Alias for `mapState()`. You should use `mapState()` instead. + * @deprecated use `mapState()` instead. + */ +const mapGetters = mapState; +/** + * Allows directly using actions from your store without using the composition + * API (`setup()`) by generating an object to be spread in the `methods` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapActions(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[key](...args); + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + // @ts-expect-error + reduced[key] = function (...args) { + // @ts-expect-error: FIXME: should work? + return useStore(this.$pinia)[keysOrMapper[key]](...args); + }; + return reduced; + }, {}); +} +/** + * Allows using state and getters from one store without using the composition + * API (`setup()`) by generating an object to be spread in the `computed` field + * of a component. + * + * @param useStore - store to map from + * @param keysOrMapper - array or object + */ +function mapWritableState(useStore, keysOrMapper) { + return Array.isArray(keysOrMapper) + ? keysOrMapper.reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[key]; + }, + set(value) { + return (useStore(this.$pinia)[key] = value); + }, + }; + return reduced; + }, {}) + : Object.keys(keysOrMapper).reduce((reduced, key) => { + reduced[key] = { + get() { + return useStore(this.$pinia)[keysOrMapper[key]]; + }, + set(value) { + return (useStore(this.$pinia)[keysOrMapper[key]] = value); + }, + }; + return reduced; + }, {}); +} + +/** + * Creates an object of references with all the state, getters, and plugin-added + * state properties of the store. Similar to `toRefs()` but specifically + * designed for Pinia stores so methods and non reactive properties are + * completely ignored. + * + * @param store - store to extract the refs from + */ +function storeToRefs(store) { + // See https://github.com/vuejs/pinia/issues/852 + // It's easier to just use toRefs() even if it includes more stuff + if (vueDemi.isVue2) { + // @ts-expect-error: toRefs include methods and others + return vueDemi.toRefs(store); + } + else { + const rawStore = vueDemi.toRaw(store); + const refs = {}; + for (const key in rawStore) { + const value = rawStore[key]; + // There is no native method to check for a computed + // https://github.com/vuejs/core/pull/4165 + if (value.effect) { + // @ts-expect-error: too hard to type correctly + refs[key] = + // ... + vueDemi.computed({ + get: () => store[key], + set(value) { + store[key] = value; + }, + }); + } + else if (vueDemi.isRef(value) || vueDemi.isReactive(value)) { + // @ts-expect-error: the key is state or getter + refs[key] = + // --- + vueDemi.toRef(store, key); + } + } + return refs; + } +} + +/** + * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need + * this plugin if you are using Nuxt.js**. Use the `buildModule` instead: + * https://pinia.vuejs.org/ssr/nuxt.html. + * + * @example + * ```js + * import Vue from 'vue' + * import { PiniaVuePlugin, createPinia } from 'pinia' + * + * Vue.use(PiniaVuePlugin) + * const pinia = createPinia() + * + * new Vue({ + * el: '#app', + * // ... + * pinia, + * }) + * ``` + * + * @param _Vue - `Vue` imported from 'vue'. + */ +const PiniaVuePlugin = function (_Vue) { + // Equivalent of + // app.config.globalProperties.$pinia = pinia + _Vue.mixin({ + beforeCreate() { + const options = this.$options; + if (options.pinia) { + const pinia = options.pinia; + // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31 + /* istanbul ignore else */ + if (!this._provided) { + const provideCache = {}; + Object.defineProperty(this, '_provided', { + get: () => provideCache, + set: (v) => Object.assign(provideCache, v), + }); + } + this._provided[piniaSymbol] = pinia; + // propagate the pinia instance in an SSR friendly way + // avoid adding it to nuxt twice + /* istanbul ignore else */ + if (!this.$pinia) { + this.$pinia = pinia; + } + pinia._a = this; + if (IS_CLIENT) { + // this allows calling useStore() outside of a component setup after + // installing pinia's plugin + setActivePinia(pinia); + } + } + else if (!this.$pinia && options.parent && options.parent.$pinia) { + this.$pinia = options.parent.$pinia; + } + }, + destroyed() { + delete this._pStores; + }, + }); +}; + +exports.PiniaVuePlugin = PiniaVuePlugin; +exports.acceptHMRUpdate = acceptHMRUpdate; +exports.createPinia = createPinia; +exports.defineStore = defineStore; +exports.disposePinia = disposePinia; +exports.getActivePinia = getActivePinia; +exports.mapActions = mapActions; +exports.mapGetters = mapGetters; +exports.mapState = mapState; +exports.mapStores = mapStores; +exports.mapWritableState = mapWritableState; +exports.setActivePinia = setActivePinia; +exports.setMapStoreSuffix = setMapStoreSuffix; +exports.shouldHydrate = shouldHydrate; +exports.skipHydrate = skipHydrate; +exports.storeToRefs = storeToRefs; diff --git a/seller_1/node_modules/pinia/index.cjs b/seller_1/node_modules/pinia/index.cjs new file mode 100644 index 0000000..9fc1f5c --- /dev/null +++ b/seller_1/node_modules/pinia/index.cjs @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/pinia.prod.cjs') +} else { + module.exports = require('./dist/pinia.cjs') +} diff --git a/seller_1/node_modules/pinia/index.js b/seller_1/node_modules/pinia/index.js new file mode 100644 index 0000000..9fc1f5c --- /dev/null +++ b/seller_1/node_modules/pinia/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/pinia.prod.cjs') +} else { + module.exports = require('./dist/pinia.cjs') +} diff --git a/seller_1/node_modules/pinia/package.json b/seller_1/node_modules/pinia/package.json new file mode 100644 index 0000000..60fe3d5 --- /dev/null +++ b/seller_1/node_modules/pinia/package.json @@ -0,0 +1,96 @@ +{ + "name": "pinia", + "version": "2.3.0", + "description": "Intuitive, type safe and flexible Store for Vue", + "main": "index.js", + "module": "dist/pinia.mjs", + "unpkg": "dist/pinia.iife.js", + "jsdelivr": "dist/pinia.iife.js", + "types": "dist/pinia.d.ts", + "exports": { + ".": { + "types": "./dist/pinia.d.ts", + "node": { + "import": { + "production": "./dist/pinia.prod.cjs", + "development": "./dist/pinia.mjs", + "default": "./dist/pinia.mjs" + }, + "require": { + "production": "./dist/pinia.prod.cjs", + "development": "./dist/pinia.cjs", + "default": "./index.js" + } + }, + "import": "./dist/pinia.mjs", + "require": "./index.js" + }, + "./package.json": "./package.json", + "./dist/*": "./dist/*" + }, + "sideEffects": false, + "author": { + "name": "Eduardo San Martin Morote", + "email": "posva13@gmail.com" + }, + "funding": "https://github.com/sponsors/posva", + "files": [ + "dist/*.js", + "dist/*.mjs", + "dist/*.cjs", + "dist/pinia.d.ts", + "index.js", + "index.cjs", + "LICENSE", + "README.md" + ], + "keywords": [ + "vue", + "vuex", + "store", + "pinia", + "piña", + "pigna", + "composition", + "api", + "setup", + "typed", + "typescript", + "ts", + "type", + "safe" + ], + "license": "MIT", + "devDependencies": { + "@microsoft/api-extractor": "7.48.0", + "@vue/test-utils": "^2.4.6" + }, + "dependencies": { + "@vue/devtools-api": "^6.6.3", + "vue-demi": "^0.14.10" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/pinia.git" + }, + "bugs": { + "url": "https://github.com/vuejs/pinia/issues" + }, + "homepage": "https://github.com/vuejs/pinia#readme", + "scripts": { + "build": "rimraf dist && rollup -c ../../rollup.config.mjs --environment TARGET:pinia", + "build:dts": "api-extractor run --local --verbose && tail -n +3 ./src/globalExtensions.ts >> dist/pinia.d.ts", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l pinia -r 1", + "test:dts": "tsc -p ./test-dts/tsconfig.json", + "test": "pnpm run build && pnpm run build:dts && pnpm test:dts" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/postcss/LICENSE b/seller_1/node_modules/postcss/LICENSE new file mode 100644 index 0000000..da057b4 --- /dev/null +++ b/seller_1/node_modules/postcss/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik <andrey@sitnik.ru> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/postcss/README.md b/seller_1/node_modules/postcss/README.md new file mode 100644 index 0000000..939a802 --- /dev/null +++ b/seller_1/node_modules/postcss/README.md @@ -0,0 +1,28 @@ +# PostCSS + +<img align="right" width="95" height="95" + alt="Philosopher’s stone, logo of PostCSS" + src="https://postcss.org/logo.svg"> + +PostCSS is a tool for transforming styles with JS plugins. +These plugins can lint your CSS, support variables and mixins, +transpile future CSS syntax, inline images, and more. + +PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba, +and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of the most popular CSS tools. + +--- + +<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made at <b><a href="https://evilmartians.com/devtools?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>. + +--- + +[Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree +[Evil Martians]: https://evilmartians.com/?utm_source=postcss +[Autoprefixer]: https://github.com/postcss/autoprefixer +[Stylelint]: https://stylelint.io/ +[plugins]: https://github.com/postcss/postcss#plugins + + +## Docs +Read full docs **[here](https://postcss.org/)**. diff --git a/seller_1/node_modules/postcss/lib/at-rule.d.ts b/seller_1/node_modules/postcss/lib/at-rule.d.ts new file mode 100644 index 0000000..b2a0e0f --- /dev/null +++ b/seller_1/node_modules/postcss/lib/at-rule.d.ts @@ -0,0 +1,140 @@ +import Container, { + ContainerProps, + ContainerWithChildren +} from './container.js' + +declare namespace AtRule { + export interface AtRuleRaws extends Record<string, unknown> { + /** + * The space symbols after the last child of the node to the end of the node. + */ + after?: string + + /** + * The space between the at-rule name and its parameters. + */ + afterName?: string + + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the last parameter and `{` for rules. + */ + between?: string + + /** + * The rule’s selector with comments. + */ + params?: { + raw: string + value: string + } + + /** + * Contains `true` if the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface AtRuleProps extends ContainerProps { + /** Name of the at-rule. */ + name: string + /** Parameters following the name of the at-rule. */ + params?: number | string + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: AtRuleRaws + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { AtRule_ as default } +} + +/** + * Represents an at-rule. + * + * ```js + * Once (root, { AtRule }) { + * let media = new AtRule({ name: 'media', params: 'print' }) + * media.append(…) + * root.append(media) + * } + * ``` + * + * If it’s followed in the CSS by a `{}` block, this node will have + * a nodes property representing its children. + * + * ```js + * const root = postcss.parse('@charset "UTF-8"; @media print {}') + * + * const charset = root.first + * charset.type //=> 'atrule' + * charset.nodes //=> undefined + * + * const media = root.last + * media.nodes //=> [] + * ``` + */ +declare class AtRule_ extends Container { + /** + * An array containing the layer’s children. + * + * ```js + * const root = postcss.parse('@layer example { a { color: black } }') + * const layer = root.first + * layer.nodes.length //=> 1 + * layer.nodes[0].selector //=> 'a' + * ``` + * + * Can be `undefinded` if the at-rule has no body. + * + * ```js + * const root = postcss.parse('@layer a, b, c;') + * const layer = root.first + * layer.nodes //=> undefined + * ``` + */ + nodes: Container['nodes'] + parent: ContainerWithChildren | undefined + + raws: AtRule.AtRuleRaws + type: 'atrule' + constructor(defaults?: AtRule.AtRuleProps) + assign(overrides: AtRule.AtRuleProps | object): this + + clone(overrides?: Partial<AtRule.AtRuleProps>): this + + cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): this + + cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): this + /** + * The at-rule’s name immediately follows the `@`. + * + * ```js + * const root = postcss.parse('@media print {}') + * const media = root.first + * media.name //=> 'media' + * ``` + */ + get name(): string + set name(value: string) + /** + * The at-rule’s parameters, the values that follow the at-rule’s name + * but precede any `{}` block. + * + * ```js + * const root = postcss.parse('@media print, screen {}') + * const media = root.first + * media.params //=> 'print, screen' + * ``` + */ + get params(): string + set params(value: string) +} + +declare class AtRule extends AtRule_ {} + +export = AtRule diff --git a/seller_1/node_modules/postcss/lib/at-rule.js b/seller_1/node_modules/postcss/lib/at-rule.js new file mode 100644 index 0000000..9486447 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/at-rule.js @@ -0,0 +1,25 @@ +'use strict' + +let Container = require('./container') + +class AtRule extends Container { + constructor(defaults) { + super(defaults) + this.type = 'atrule' + } + + append(...children) { + if (!this.proxyOf.nodes) this.nodes = [] + return super.append(...children) + } + + prepend(...children) { + if (!this.proxyOf.nodes) this.nodes = [] + return super.prepend(...children) + } +} + +module.exports = AtRule +AtRule.default = AtRule + +Container.registerAtRule(AtRule) diff --git a/seller_1/node_modules/postcss/lib/comment.d.ts b/seller_1/node_modules/postcss/lib/comment.d.ts new file mode 100644 index 0000000..2b1a156 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/comment.d.ts @@ -0,0 +1,68 @@ +import Container from './container.js' +import Node, { NodeProps } from './node.js' + +declare namespace Comment { + export interface CommentRaws extends Record<string, unknown> { + /** + * The space symbols before the node. + */ + before?: string + + /** + * The space symbols between `/*` and the comment’s text. + */ + left?: string + + /** + * The space symbols between the comment’s text. + */ + right?: string + } + + export interface CommentProps extends NodeProps { + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: CommentRaws + /** Content of the comment. */ + text: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Comment_ as default } +} + +/** + * It represents a class that handles + * [CSS comments](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments) + * + * ```js + * Once (root, { Comment }) { + * const note = new Comment({ text: 'Note: …' }) + * root.append(note) + * } + * ``` + * + * Remember that CSS comments inside selectors, at-rule parameters, + * or declaration values will be stored in the `raws` properties + * explained above. + */ +declare class Comment_ extends Node { + parent: Container | undefined + raws: Comment.CommentRaws + type: 'comment' + constructor(defaults?: Comment.CommentProps) + + assign(overrides: Comment.CommentProps | object): this + + clone(overrides?: Partial<Comment.CommentProps>): this + cloneAfter(overrides?: Partial<Comment.CommentProps>): this + cloneBefore(overrides?: Partial<Comment.CommentProps>): this + /** + * The comment's text. + */ + get text(): string + set text(value: string) +} + +declare class Comment extends Comment_ {} + +export = Comment diff --git a/seller_1/node_modules/postcss/lib/comment.js b/seller_1/node_modules/postcss/lib/comment.js new file mode 100644 index 0000000..c566506 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/comment.js @@ -0,0 +1,13 @@ +'use strict' + +let Node = require('./node') + +class Comment extends Node { + constructor(defaults) { + super(defaults) + this.type = 'comment' + } +} + +module.exports = Comment +Comment.default = Comment diff --git a/seller_1/node_modules/postcss/lib/container.d.ts b/seller_1/node_modules/postcss/lib/container.d.ts new file mode 100644 index 0000000..692bd69 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/container.d.ts @@ -0,0 +1,483 @@ +import AtRule from './at-rule.js' +import Comment from './comment.js' +import Declaration from './declaration.js' +import Node, { ChildNode, ChildProps, NodeProps } from './node.js' +import Rule from './rule.js' + +declare namespace Container { + export class ContainerWithChildren< + Child extends Node = ChildNode + > extends Container_<Child> { + nodes: Child[] + } + + export interface ValueOptions { + /** + * String that’s used to narrow down values and speed up the regexp search. + */ + fast?: string + + /** + * An array of property names. + */ + props?: readonly string[] + } + + export interface ContainerProps extends NodeProps { + nodes?: readonly (ChildProps | Node)[] + } + + /** + * All types that can be passed into container methods to create or add a new + * child node. + */ + export type NewChild = + | ChildProps + | Node + | readonly ChildProps[] + | readonly Node[] + | readonly string[] + | string + | undefined + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Container_ as default } +} + +/** + * The `Root`, `AtRule`, and `Rule` container nodes + * inherit some common methods to help work with their children. + * + * Note that all containers can store any content. If you write a rule inside + * a rule, PostCSS will parse it. + */ +declare abstract class Container_<Child extends Node = ChildNode> extends Node { + /** + * An array containing the container’s children. + * + * ```js + * const root = postcss.parse('a { color: black }') + * root.nodes.length //=> 1 + * root.nodes[0].selector //=> 'a' + * root.nodes[0].nodes[0].prop //=> 'color' + * ``` + */ + nodes: Child[] | undefined + + /** + * An internal method that converts a {@link NewChild} into a list of actual + * child nodes that can then be added to this container. + * + * This ensures that the nodes' parent is set to this container, that they use + * the correct prototype chain, and that they're marked as dirty. + * + * @param mnodes The new node or nodes to add. + * @param sample A node from whose raws the new node's `before` raw should be + * taken. + * @param type This should be set to `'prepend'` if the new nodes will be + * inserted at the beginning of the container. + * @hidden + */ + protected normalize( + nodes: Container.NewChild, + sample: Node | undefined, + type?: 'prepend' | false + ): Child[] + + /** + * Inserts new nodes to the end of the container. + * + * ```js + * const decl1 = new Declaration({ prop: 'color', value: 'black' }) + * const decl2 = new Declaration({ prop: 'background-color', value: 'white' }) + * rule.append(decl1, decl2) + * + * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule + * root.append({ selector: 'a' }) // rule + * rule.append({ prop: 'color', value: 'black' }) // declaration + * rule.append({ text: 'Comment' }) // comment + * + * root.append('a {}') + * root.first.append('color: black; z-index: 1') + * ``` + * + * @param nodes New nodes. + * @return This node for methods chain. + */ + append(...nodes: Container.NewChild[]): this + assign(overrides: Container.ContainerProps | object): this + clone(overrides?: Partial<Container.ContainerProps>): this + cloneAfter(overrides?: Partial<Container.ContainerProps>): this + + cloneBefore(overrides?: Partial<Container.ContainerProps>): this + + /** + * Iterates through the container’s immediate children, + * calling `callback` for each child. + * + * Returning `false` in the callback will break iteration. + * + * This method only iterates through the container’s immediate children. + * If you need to recursively iterate through all the container’s descendant + * nodes, use `Container#walk`. + * + * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe + * if you are mutating the array of child nodes during iteration. + * PostCSS will adjust the current index to match the mutations. + * + * ```js + * const root = postcss.parse('a { color: black; z-index: 1 }') + * const rule = root.first + * + * for (const decl of rule.nodes) { + * decl.cloneBefore({ prop: '-webkit-' + decl.prop }) + * // Cycle will be infinite, because cloneBefore moves the current node + * // to the next index + * } + * + * rule.each(decl => { + * decl.cloneBefore({ prop: '-webkit-' + decl.prop }) + * // Will be executed only for color and z-index + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + each( + callback: (node: Child, index: number) => false | void + ): false | undefined + /** + * Returns `true` if callback returns `true` + * for all of the container’s children. + * + * ```js + * const noPrefixes = rule.every(i => i.prop[0] !== '-') + * ``` + * + * @param condition Iterator returns true or false. + * @return Is every child pass condition. + */ + every( + condition: (node: Child, index: number, nodes: Child[]) => boolean + ): boolean + + /** + * Returns a `child`’s index within the `Container#nodes` array. + * + * ```js + * rule.index( rule.nodes[2] ) //=> 2 + * ``` + * + * @param child Child of the current container. + * @return Child index. + */ + index(child: Child | number): number + /** + * Insert new node after old node within the container. + * + * @param oldNode Child or child’s index. + * @param newNode New node. + * @return This node for methods chain. + */ + insertAfter(oldNode: Child | number, newNode: Container.NewChild): this + + /** + * Insert new node before old node within the container. + * + * ```js + * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop })) + * ``` + * + * @param oldNode Child or child’s index. + * @param newNode New node. + * @return This node for methods chain. + */ + insertBefore(oldNode: Child | number, newNode: Container.NewChild): this + + /** + * Traverses the container’s descendant nodes, calling callback + * for each comment node. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * root.walkComments(comment => { + * comment.remove() + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + + /** + * Inserts new nodes to the start of the container. + * + * ```js + * const decl1 = new Declaration({ prop: 'color', value: 'black' }) + * const decl2 = new Declaration({ prop: 'background-color', value: 'white' }) + * rule.prepend(decl1, decl2) + * + * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule + * root.append({ selector: 'a' }) // rule + * rule.append({ prop: 'color', value: 'black' }) // declaration + * rule.append({ text: 'Comment' }) // comment + * + * root.append('a {}') + * root.first.append('color: black; z-index: 1') + * ``` + * + * @param nodes New nodes. + * @return This node for methods chain. + */ + prepend(...nodes: Container.NewChild[]): this + /** + * Add child to the end of the node. + * + * ```js + * rule.push(new Declaration({ prop: 'color', value: 'black' })) + * ``` + * + * @param child New node. + * @return This node for methods chain. + */ + push(child: Child): this + + /** + * Removes all children from the container + * and cleans their parent properties. + * + * ```js + * rule.removeAll() + * rule.nodes.length //=> 0 + * ``` + * + * @return This node for methods chain. + */ + removeAll(): this + + /** + * Removes node from the container and cleans the parent properties + * from the node and its children. + * + * ```js + * rule.nodes.length //=> 5 + * rule.removeChild(decl) + * rule.nodes.length //=> 4 + * decl.parent //=> undefined + * ``` + * + * @param child Child or child’s index. + * @return This node for methods chain. + */ + removeChild(child: Child | number): this + + replaceValues( + pattern: RegExp | string, + replaced: { (substring: string, ...args: any[]): string } | string + ): this + + /** + * Passes all declaration values within the container that match pattern + * through callback, replacing those values with the returned result + * of callback. + * + * This method is useful if you are using a custom unit or function + * and need to iterate through all values. + * + * ```js + * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => { + * return 15 * parseInt(string) + 'px' + * }) + * ``` + * + * @param pattern Replace pattern. + * @param {object} options Options to speed up the search. + * @param replaced String to replace pattern or callback + * that returns a new value. The callback + * will receive the same arguments + * as those passed to a function parameter + * of `String#replace`. + * @return This node for methods chain. + */ + replaceValues( + pattern: RegExp | string, + options: Container.ValueOptions, + replaced: { (substring: string, ...args: any[]): string } | string + ): this + + /** + * Returns `true` if callback returns `true` for (at least) one + * of the container’s children. + * + * ```js + * const hasPrefix = rule.some(i => i.prop[0] === '-') + * ``` + * + * @param condition Iterator returns true or false. + * @return Is some child pass condition. + */ + some( + condition: (node: Child, index: number, nodes: Child[]) => boolean + ): boolean + + /** + * Traverses the container’s descendant nodes, calling callback + * for each node. + * + * Like container.each(), this method is safe to use + * if you are mutating arrays during iteration. + * + * If you only need to iterate through the container’s immediate children, + * use `Container#each`. + * + * ```js + * root.walk(node => { + * // Traverses all descendant nodes. + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walk( + callback: (node: ChildNode, index: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each at-rule node. + * + * If you pass a filter, iteration will only happen over at-rules + * that have matching names. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * root.walkAtRules(rule => { + * if (isOld(rule.name)) rule.remove() + * }) + * + * let first = false + * root.walkAtRules('charset', rule => { + * if (!first) { + * first = true + * } else { + * rule.remove() + * } + * }) + * ``` + * + * @param name String or regular expression to filter at-rules by name. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkAtRules( + nameFilter: RegExp | string, + callback: (atRule: AtRule, index: number) => false | void + ): false | undefined + + walkAtRules( + callback: (atRule: AtRule, index: number) => false | void + ): false | undefined + walkComments( + callback: (comment: Comment, indexed: number) => false | void + ): false | undefined + + walkComments( + callback: (comment: Comment, indexed: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each declaration node. + * + * If you pass a filter, iteration will only happen over declarations + * with matching properties. + * + * ```js + * root.walkDecls(decl => { + * checkPropertySupport(decl.prop) + * }) + * + * root.walkDecls('border-radius', decl => { + * decl.remove() + * }) + * + * root.walkDecls(/^background/, decl => { + * decl.value = takeFirstColorFromGradient(decl.value) + * }) + * ``` + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * @param prop String or regular expression to filter declarations + * by property name. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkDecls( + propFilter: RegExp | string, + callback: (decl: Declaration, index: number) => false | void + ): false | undefined + + walkDecls( + callback: (decl: Declaration, index: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each rule node. + * + * If you pass a filter, iteration will only happen over rules + * with matching selectors. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * const selectors = [] + * root.walkRules(rule => { + * selectors.push(rule.selector) + * }) + * console.log(`Your CSS uses ${ selectors.length } selectors`) + * ``` + * + * @param selector String or regular expression to filter rules by selector. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkRules( + selectorFilter: RegExp | string, + callback: (rule: Rule, index: number) => false | void + ): false | undefined + walkRules( + callback: (rule: Rule, index: number) => false | void + ): false | undefined + /** + * The container’s first child. + * + * ```js + * rule.first === rules.nodes[0] + * ``` + */ + get first(): Child | undefined + /** + * The container’s last child. + * + * ```js + * rule.last === rule.nodes[rule.nodes.length - 1] + * ``` + */ + get last(): Child | undefined +} + +declare class Container< + Child extends Node = ChildNode +> extends Container_<Child> {} + +export = Container diff --git a/seller_1/node_modules/postcss/lib/container.js b/seller_1/node_modules/postcss/lib/container.js new file mode 100644 index 0000000..8b9e1ef --- /dev/null +++ b/seller_1/node_modules/postcss/lib/container.js @@ -0,0 +1,447 @@ +'use strict' + +let Comment = require('./comment') +let Declaration = require('./declaration') +let Node = require('./node') +let { isClean, my } = require('./symbols') + +let AtRule, parse, Root, Rule + +function cleanSource(nodes) { + return nodes.map(i => { + if (i.nodes) i.nodes = cleanSource(i.nodes) + delete i.source + return i + }) +} + +function markTreeDirty(node) { + node[isClean] = false + if (node.proxyOf.nodes) { + for (let i of node.proxyOf.nodes) { + markTreeDirty(i) + } + } +} + +class Container extends Node { + append(...children) { + for (let child of children) { + let nodes = this.normalize(child, this.last) + for (let node of nodes) this.proxyOf.nodes.push(node) + } + + this.markDirty() + + return this + } + + cleanRaws(keepBetween) { + super.cleanRaws(keepBetween) + if (this.nodes) { + for (let node of this.nodes) node.cleanRaws(keepBetween) + } + } + + each(callback) { + if (!this.proxyOf.nodes) return undefined + let iterator = this.getIterator() + + let index, result + while (this.indexes[iterator] < this.proxyOf.nodes.length) { + index = this.indexes[iterator] + result = callback(this.proxyOf.nodes[index], index) + if (result === false) break + + this.indexes[iterator] += 1 + } + + delete this.indexes[iterator] + return result + } + + every(condition) { + return this.nodes.every(condition) + } + + getIterator() { + if (!this.lastEach) this.lastEach = 0 + if (!this.indexes) this.indexes = {} + + this.lastEach += 1 + let iterator = this.lastEach + this.indexes[iterator] = 0 + + return iterator + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (!node[prop]) { + return node[prop] + } else if ( + prop === 'each' || + (typeof prop === 'string' && prop.startsWith('walk')) + ) { + return (...args) => { + return node[prop]( + ...args.map(i => { + if (typeof i === 'function') { + return (child, index) => i(child.toProxy(), index) + } else { + return i + } + }) + ) + } + } else if (prop === 'every' || prop === 'some') { + return cb => { + return node[prop]((child, ...other) => + cb(child.toProxy(), ...other) + ) + } + } else if (prop === 'root') { + return () => node.root().toProxy() + } else if (prop === 'nodes') { + return node.nodes.map(i => i.toProxy()) + } else if (prop === 'first' || prop === 'last') { + return node[prop].toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value + if (prop === 'name' || prop === 'params' || prop === 'selector') { + node.markDirty() + } + return true + } + } + } + + index(child) { + if (typeof child === 'number') return child + if (child.proxyOf) child = child.proxyOf + return this.proxyOf.nodes.indexOf(child) + } + + insertAfter(exist, add) { + let existIndex = this.index(exist) + let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse() + existIndex = this.index(exist) + for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (existIndex < index) { + this.indexes[id] = index + nodes.length + } + } + + this.markDirty() + + return this + } + + insertBefore(exist, add) { + let existIndex = this.index(exist) + let type = existIndex === 0 ? 'prepend' : false + let nodes = this.normalize( + add, + this.proxyOf.nodes[existIndex], + type + ).reverse() + existIndex = this.index(exist) + for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (existIndex <= index) { + this.indexes[id] = index + nodes.length + } + } + + this.markDirty() + + return this + } + + normalize(nodes, sample) { + if (typeof nodes === 'string') { + nodes = cleanSource(parse(nodes).nodes) + } else if (typeof nodes === 'undefined') { + nodes = [] + } else if (Array.isArray(nodes)) { + nodes = nodes.slice(0) + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore') + } + } else if (nodes.type === 'root' && this.type !== 'document') { + nodes = nodes.nodes.slice(0) + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore') + } + } else if (nodes.type) { + nodes = [nodes] + } else if (nodes.prop) { + if (typeof nodes.value === 'undefined') { + throw new Error('Value field is missed in node creation') + } else if (typeof nodes.value !== 'string') { + nodes.value = String(nodes.value) + } + nodes = [new Declaration(nodes)] + } else if (nodes.selector || nodes.selectors) { + nodes = [new Rule(nodes)] + } else if (nodes.name) { + nodes = [new AtRule(nodes)] + } else if (nodes.text) { + nodes = [new Comment(nodes)] + } else { + throw new Error('Unknown node type in node creation') + } + + let processed = nodes.map(i => { + /* c8 ignore next */ + if (!i[my]) Container.rebuild(i) + i = i.proxyOf + if (i.parent) i.parent.removeChild(i) + if (i[isClean]) markTreeDirty(i) + + if (!i.raws) i.raws = {} + if (typeof i.raws.before === 'undefined') { + if (sample && typeof sample.raws.before !== 'undefined') { + i.raws.before = sample.raws.before.replace(/\S/g, '') + } + } + i.parent = this.proxyOf + return i + }) + + return processed + } + + prepend(...children) { + children = children.reverse() + for (let child of children) { + let nodes = this.normalize(child, this.first, 'prepend').reverse() + for (let node of nodes) this.proxyOf.nodes.unshift(node) + for (let id in this.indexes) { + this.indexes[id] = this.indexes[id] + nodes.length + } + } + + this.markDirty() + + return this + } + + push(child) { + child.parent = this + this.proxyOf.nodes.push(child) + return this + } + + removeAll() { + for (let node of this.proxyOf.nodes) node.parent = undefined + this.proxyOf.nodes = [] + + this.markDirty() + + return this + } + + removeChild(child) { + child = this.index(child) + this.proxyOf.nodes[child].parent = undefined + this.proxyOf.nodes.splice(child, 1) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (index >= child) { + this.indexes[id] = index - 1 + } + } + + this.markDirty() + + return this + } + + replaceValues(pattern, opts, callback) { + if (!callback) { + callback = opts + opts = {} + } + + this.walkDecls(decl => { + if (opts.props && !opts.props.includes(decl.prop)) return + if (opts.fast && !decl.value.includes(opts.fast)) return + + decl.value = decl.value.replace(pattern, callback) + }) + + this.markDirty() + + return this + } + + some(condition) { + return this.nodes.some(condition) + } + + walk(callback) { + return this.each((child, i) => { + let result + try { + result = callback(child, i) + } catch (e) { + throw child.addToError(e) + } + if (result !== false && child.walk) { + result = child.walk(callback) + } + + return result + }) + } + + walkAtRules(name, callback) { + if (!callback) { + callback = name + return this.walk((child, i) => { + if (child.type === 'atrule') { + return callback(child, i) + } + }) + } + if (name instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'atrule' && name.test(child.name)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'atrule' && child.name === name) { + return callback(child, i) + } + }) + } + + walkComments(callback) { + return this.walk((child, i) => { + if (child.type === 'comment') { + return callback(child, i) + } + }) + } + + walkDecls(prop, callback) { + if (!callback) { + callback = prop + return this.walk((child, i) => { + if (child.type === 'decl') { + return callback(child, i) + } + }) + } + if (prop instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'decl' && prop.test(child.prop)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'decl' && child.prop === prop) { + return callback(child, i) + } + }) + } + + walkRules(selector, callback) { + if (!callback) { + callback = selector + + return this.walk((child, i) => { + if (child.type === 'rule') { + return callback(child, i) + } + }) + } + if (selector instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'rule' && selector.test(child.selector)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'rule' && child.selector === selector) { + return callback(child, i) + } + }) + } + + get first() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[0] + } + + get last() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] + } +} + +Container.registerParse = dependant => { + parse = dependant +} + +Container.registerRule = dependant => { + Rule = dependant +} + +Container.registerAtRule = dependant => { + AtRule = dependant +} + +Container.registerRoot = dependant => { + Root = dependant +} + +module.exports = Container +Container.default = Container + +/* c8 ignore start */ +Container.rebuild = node => { + if (node.type === 'atrule') { + Object.setPrototypeOf(node, AtRule.prototype) + } else if (node.type === 'rule') { + Object.setPrototypeOf(node, Rule.prototype) + } else if (node.type === 'decl') { + Object.setPrototypeOf(node, Declaration.prototype) + } else if (node.type === 'comment') { + Object.setPrototypeOf(node, Comment.prototype) + } else if (node.type === 'root') { + Object.setPrototypeOf(node, Root.prototype) + } + + node[my] = true + + if (node.nodes) { + node.nodes.forEach(child => { + Container.rebuild(child) + }) + } +} +/* c8 ignore stop */ diff --git a/seller_1/node_modules/postcss/lib/css-syntax-error.d.ts b/seller_1/node_modules/postcss/lib/css-syntax-error.d.ts new file mode 100644 index 0000000..e540d84 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/css-syntax-error.d.ts @@ -0,0 +1,248 @@ +import { FilePosition } from './input.js' + +declare namespace CssSyntaxError { + /** + * A position that is part of a range. + */ + export interface RangePosition { + /** + * The column number in the input. + */ + column: number + + /** + * The line number in the input. + */ + line: number + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { CssSyntaxError_ as default } +} + +/** + * The CSS parser throws this error for broken CSS. + * + * Custom parsers can throw this error for broken custom syntax using + * the `Node#error` method. + * + * PostCSS will use the input source map to detect the original error location. + * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS, + * PostCSS will show the original position in the Sass file. + * + * If you need the position in the PostCSS input + * (e.g., to debug the previous compiler), use `error.input.file`. + * + * ```js + * // Raising error from plugin + * throw node.error('Unknown variable', { plugin: 'postcss-vars' }) + * ``` + * + * ```js + * // Catching and checking syntax error + * try { + * postcss.parse('a{') + * } catch (error) { + * if (error.name === 'CssSyntaxError') { + * error //=> CssSyntaxError + * } + * } + * ``` + */ +declare class CssSyntaxError_ extends Error { + /** + * Source column of the error. + * + * ```js + * error.column //=> 1 + * error.input.column //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.column`. + */ + column?: number + + /** + * Source column of the error's end, exclusive. Provided if the error pertains + * to a range. + * + * ```js + * error.endColumn //=> 1 + * error.input.endColumn //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.endColumn`. + */ + endColumn?: number + + /** + * Source line of the error's end, exclusive. Provided if the error pertains + * to a range. + * + * ```js + * error.endLine //=> 3 + * error.input.endLine //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.endLine`. + */ + endLine?: number + + /** + * Absolute path to the broken file. + * + * ```js + * error.file //=> 'a.sass' + * error.input.file //=> 'a.css' + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.file`. + */ + file?: string + + /** + * Input object with PostCSS internal information + * about input file. If input has source map + * from previous tool, PostCSS will use origin + * (for example, Sass) source. You can use this + * object to get PostCSS input source. + * + * ```js + * error.input.file //=> 'a.css' + * error.file //=> 'a.sass' + * ``` + */ + input?: FilePosition + + /** + * Source line of the error. + * + * ```js + * error.line //=> 2 + * error.input.line //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.line`. + */ + line?: number + + /** + * Full error text in the GNU error format + * with plugin, file, line and column. + * + * ```js + * error.message //=> 'a.css:1:1: Unclosed block' + * ``` + */ + message: string + + /** + * Always equal to `'CssSyntaxError'`. You should always check error type + * by `error.name === 'CssSyntaxError'` + * instead of `error instanceof CssSyntaxError`, + * because npm could have several PostCSS versions. + * + * ```js + * if (error.name === 'CssSyntaxError') { + * error //=> CssSyntaxError + * } + * ``` + */ + name: 'CssSyntaxError' + + /** + * Plugin name, if error came from plugin. + * + * ```js + * error.plugin //=> 'postcss-vars' + * ``` + */ + plugin?: string + + /** + * Error message. + * + * ```js + * error.message //=> 'Unclosed block' + * ``` + */ + reason: string + + /** + * Source code of the broken file. + * + * ```js + * error.source //=> 'a { b {} }' + * error.input.source //=> 'a b { }' + * ``` + */ + source?: string + + stack: string + + /** + * Instantiates a CSS syntax error. Can be instantiated for a single position + * or for a range. + * @param message Error message. + * @param lineOrStartPos If for a single position, the line number, or if for + * a range, the inclusive start position of the error. + * @param columnOrEndPos If for a single position, the column number, or if for + * a range, the exclusive end position of the error. + * @param source Source code of the broken file. + * @param file Absolute path to the broken file. + * @param plugin PostCSS plugin name, if error came from plugin. + */ + constructor( + message: string, + lineOrStartPos?: CssSyntaxError.RangePosition | number, + columnOrEndPos?: CssSyntaxError.RangePosition | number, + source?: string, + file?: string, + plugin?: string + ) + + /** + * Returns a few lines of CSS source that caused the error. + * + * If the CSS has an input source map without `sourceContent`, + * this method will return an empty string. + * + * ```js + * error.showSourceCode() //=> " 4 | } + * // 5 | a { + * // > 6 | bad + * // | ^ + * // 7 | } + * // 8 | b {" + * ``` + * + * @param color Whether arrow will be colored red by terminal + * color codes. By default, PostCSS will detect + * color support by `process.stdout.isTTY` + * and `process.env.NODE_DISABLE_COLORS`. + * @return Few lines of CSS source that caused the error. + */ + showSourceCode(color?: boolean): string + + /** + * Returns error position, message and source code of the broken part. + * + * ```js + * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block + * // > 1 | a { + * // | ^" + * ``` + * + * @return Error position, message and source code. + */ + toString(): string +} + +declare class CssSyntaxError extends CssSyntaxError_ {} + +export = CssSyntaxError diff --git a/seller_1/node_modules/postcss/lib/css-syntax-error.js b/seller_1/node_modules/postcss/lib/css-syntax-error.js new file mode 100644 index 0000000..275a4f6 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/css-syntax-error.js @@ -0,0 +1,133 @@ +'use strict' + +let pico = require('picocolors') + +let terminalHighlight = require('./terminal-highlight') + +class CssSyntaxError extends Error { + constructor(message, line, column, source, file, plugin) { + super(message) + this.name = 'CssSyntaxError' + this.reason = message + + if (file) { + this.file = file + } + if (source) { + this.source = source + } + if (plugin) { + this.plugin = plugin + } + if (typeof line !== 'undefined' && typeof column !== 'undefined') { + if (typeof line === 'number') { + this.line = line + this.column = column + } else { + this.line = line.line + this.column = line.column + this.endLine = column.line + this.endColumn = column.column + } + } + + this.setMessage() + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, CssSyntaxError) + } + } + + setMessage() { + this.message = this.plugin ? this.plugin + ': ' : '' + this.message += this.file ? this.file : '<css input>' + if (typeof this.line !== 'undefined') { + this.message += ':' + this.line + ':' + this.column + } + this.message += ': ' + this.reason + } + + showSourceCode(color) { + if (!this.source) return '' + + let css = this.source + if (color == null) color = pico.isColorSupported + + let aside = text => text + let mark = text => text + let highlight = text => text + if (color) { + let { bold, gray, red } = pico.createColors(true) + mark = text => bold(red(text)) + aside = text => gray(text) + if (terminalHighlight) { + highlight = text => terminalHighlight(text) + } + } + + let lines = css.split(/\r?\n/) + let start = Math.max(this.line - 3, 0) + let end = Math.min(this.line + 2, lines.length) + let maxWidth = String(end).length + + return lines + .slice(start, end) + .map((line, index) => { + let number = start + 1 + index + let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ' + if (number === this.line) { + if (line.length > 160) { + let padding = 20 + let subLineStart = Math.max(0, this.column - padding) + let subLineEnd = Math.max( + this.column + padding, + this.endColumn + padding + ) + let subLine = line.slice(subLineStart, subLineEnd) + + let spacing = + aside(gutter.replace(/\d/g, ' ')) + + line + .slice(0, Math.min(this.column - 1, padding - 1)) + .replace(/[^\t]/g, ' ') + + return ( + mark('>') + + aside(gutter) + + highlight(subLine) + + '\n ' + + spacing + + mark('^') + ) + } + + let spacing = + aside(gutter.replace(/\d/g, ' ')) + + line.slice(0, this.column - 1).replace(/[^\t]/g, ' ') + + return ( + mark('>') + + aside(gutter) + + highlight(line) + + '\n ' + + spacing + + mark('^') + ) + } + + return ' ' + aside(gutter) + highlight(line) + }) + .join('\n') + } + + toString() { + let code = this.showSourceCode() + if (code) { + code = '\n\n' + code + '\n' + } + return this.name + ': ' + this.message + code + } +} + +module.exports = CssSyntaxError +CssSyntaxError.default = CssSyntaxError diff --git a/seller_1/node_modules/postcss/lib/declaration.d.ts b/seller_1/node_modules/postcss/lib/declaration.d.ts new file mode 100644 index 0000000..e707ad6 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/declaration.d.ts @@ -0,0 +1,151 @@ +import { ContainerWithChildren } from './container.js' +import Node from './node.js' + +declare namespace Declaration { + export interface DeclarationRaws extends Record<string, unknown> { + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the property and value for declarations. + */ + between?: string + + /** + * The content of the important statement, if it is not just `!important`. + */ + important?: string + + /** + * Declaration value with comments. + */ + value?: { + raw: string + value: string + } + } + + export interface DeclarationProps { + /** Whether the declaration has an `!important` annotation. */ + important?: boolean + /** Name of the declaration. */ + prop: string + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: DeclarationRaws + /** Value of the declaration. */ + value: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Declaration_ as default } +} + +/** + * It represents a class that handles + * [CSS declarations](https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_declarations) + * + * ```js + * Once (root, { Declaration }) { + * const color = new Declaration({ prop: 'color', value: 'black' }) + * root.append(color) + * } + * ``` + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first?.first + * + * decl.type //=> 'decl' + * decl.toString() //=> ' color: black' + * ``` + */ +declare class Declaration_ extends Node { + parent: ContainerWithChildren | undefined + raws: Declaration.DeclarationRaws + + type: 'decl' + + constructor(defaults?: Declaration.DeclarationProps) + assign(overrides: Declaration.DeclarationProps | object): this + + clone(overrides?: Partial<Declaration.DeclarationProps>): this + + cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): this + + cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): this + /** + * It represents a specificity of the declaration. + * + * If true, the CSS declaration will have an + * [important](https://developer.mozilla.org/en-US/docs/Web/CSS/important) + * specifier. + * + * ```js + * const root = postcss.parse('a { color: black !important; color: red }') + * + * root.first.first.important //=> true + * root.first.last.important //=> undefined + * ``` + */ + get important(): boolean + + set important(value: boolean) + /** + * The property name for a CSS declaration. + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first.first + * + * decl.prop //=> 'color' + * ``` + */ + get prop(): string + + set prop(value: string) + /** + * The property value for a CSS declaration. + * + * Any CSS comments inside the value string will be filtered out. + * CSS comments present in the source value will be available in + * the `raws` property. + * + * Assigning new `value` would ignore the comments in `raws` + * property while compiling node to string. + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first.first + * + * decl.value //=> 'black' + * ``` + */ + get value(): string + set value(value: string) + /** + * It represents a getter that returns `true` if a declaration starts with + * `--` or `$`, which are used to declare variables in CSS and SASS/SCSS. + * + * ```js + * const root = postcss.parse(':root { --one: 1 }') + * const one = root.first.first + * + * one.variable //=> true + * ``` + * + * ```js + * const root = postcss.parse('$one: 1') + * const one = root.first + * + * one.variable //=> true + * ``` + */ + get variable(): boolean +} + +declare class Declaration extends Declaration_ {} + +export = Declaration diff --git a/seller_1/node_modules/postcss/lib/declaration.js b/seller_1/node_modules/postcss/lib/declaration.js new file mode 100644 index 0000000..a04bdec --- /dev/null +++ b/seller_1/node_modules/postcss/lib/declaration.js @@ -0,0 +1,24 @@ +'use strict' + +let Node = require('./node') + +class Declaration extends Node { + constructor(defaults) { + if ( + defaults && + typeof defaults.value !== 'undefined' && + typeof defaults.value !== 'string' + ) { + defaults = { ...defaults, value: String(defaults.value) } + } + super(defaults) + this.type = 'decl' + } + + get variable() { + return this.prop.startsWith('--') || this.prop[0] === '$' + } +} + +module.exports = Declaration +Declaration.default = Declaration diff --git a/seller_1/node_modules/postcss/lib/document.d.ts b/seller_1/node_modules/postcss/lib/document.d.ts new file mode 100644 index 0000000..f9e8063 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/document.d.ts @@ -0,0 +1,69 @@ +import Container, { ContainerProps } from './container.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Document { + export interface DocumentProps extends ContainerProps { + nodes?: readonly Root[] + + /** + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * Every parser saves its own properties. + */ + raws?: Record<string, any> + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Document_ as default } +} + +/** + * Represents a file and contains all its parsed nodes. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + * + * ```js + * const document = htmlParser( + * '<html><style>a{color:black}</style><style>b{z-index:2}</style>' + * ) + * document.type //=> 'document' + * document.nodes.length //=> 2 + * ``` + */ +declare class Document_ extends Container<Root> { + nodes: Root[] + parent: undefined + type: 'document' + + constructor(defaults?: Document.DocumentProps) + + assign(overrides: Document.DocumentProps | object): this + clone(overrides?: Partial<Document.DocumentProps>): this + cloneAfter(overrides?: Partial<Document.DocumentProps>): this + cloneBefore(overrides?: Partial<Document.DocumentProps>): this + + /** + * Returns a `Result` instance representing the document’s CSS roots. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * const document = postcss.document() + * document.append(root1) + * document.append(root2) + * const result = document.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current document’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Document extends Document_ {} + +export = Document diff --git a/seller_1/node_modules/postcss/lib/document.js b/seller_1/node_modules/postcss/lib/document.js new file mode 100644 index 0000000..4468991 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/document.js @@ -0,0 +1,33 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Document extends Container { + constructor(defaults) { + // type needs to be passed to super, otherwise child roots won't be normalized correctly + super({ type: 'document', ...defaults }) + + if (!this.nodes) { + this.nodes = [] + } + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + + return lazy.stringify() + } +} + +Document.registerLazyResult = dependant => { + LazyResult = dependant +} + +Document.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Document +Document.default = Document diff --git a/seller_1/node_modules/postcss/lib/fromJSON.d.ts b/seller_1/node_modules/postcss/lib/fromJSON.d.ts new file mode 100644 index 0000000..e1deedb --- /dev/null +++ b/seller_1/node_modules/postcss/lib/fromJSON.d.ts @@ -0,0 +1,9 @@ +import { JSONHydrator } from './postcss.js' + +interface FromJSON extends JSONHydrator { + default: FromJSON +} + +declare const fromJSON: FromJSON + +export = fromJSON diff --git a/seller_1/node_modules/postcss/lib/fromJSON.js b/seller_1/node_modules/postcss/lib/fromJSON.js new file mode 100644 index 0000000..c9ac1a8 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/fromJSON.js @@ -0,0 +1,54 @@ +'use strict' + +let AtRule = require('./at-rule') +let Comment = require('./comment') +let Declaration = require('./declaration') +let Input = require('./input') +let PreviousMap = require('./previous-map') +let Root = require('./root') +let Rule = require('./rule') + +function fromJSON(json, inputs) { + if (Array.isArray(json)) return json.map(n => fromJSON(n)) + + let { inputs: ownInputs, ...defaults } = json + if (ownInputs) { + inputs = [] + for (let input of ownInputs) { + let inputHydrated = { ...input, __proto__: Input.prototype } + if (inputHydrated.map) { + inputHydrated.map = { + ...inputHydrated.map, + __proto__: PreviousMap.prototype + } + } + inputs.push(inputHydrated) + } + } + if (defaults.nodes) { + defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) + } + if (defaults.source) { + let { inputId, ...source } = defaults.source + defaults.source = source + if (inputId != null) { + defaults.source.input = inputs[inputId] + } + } + if (defaults.type === 'root') { + return new Root(defaults) + } else if (defaults.type === 'decl') { + return new Declaration(defaults) + } else if (defaults.type === 'rule') { + return new Rule(defaults) + } else if (defaults.type === 'comment') { + return new Comment(defaults) + } else if (defaults.type === 'atrule') { + return new AtRule(defaults) + } else { + throw new Error('Unknown node type: ' + json.type) + } +} + +module.exports = fromJSON +fromJSON.default = fromJSON diff --git a/seller_1/node_modules/postcss/lib/input.d.ts b/seller_1/node_modules/postcss/lib/input.d.ts new file mode 100644 index 0000000..46ded09 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/input.d.ts @@ -0,0 +1,197 @@ +import { CssSyntaxError, ProcessOptions } from './postcss.js' +import PreviousMap from './previous-map.js' + +declare namespace Input { + export interface FilePosition { + /** + * Column of inclusive start position in source file. + */ + column: number + + /** + * Column of exclusive end position in source file. + */ + endColumn?: number + + /** + * Line of exclusive end position in source file. + */ + endLine?: number + + /** + * Absolute path to the source file. + */ + file?: string + + /** + * Line of inclusive start position in source file. + */ + line: number + + /** + * Source code. + */ + source?: string + + /** + * URL for the source file. + */ + url: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Input_ as default } +} + +/** + * Represents the source CSS. + * + * ```js + * const root = postcss.parse(css, { from: file }) + * const input = root.source.input + * ``` + */ +declare class Input_ { + /** + * Input CSS source. + * + * ```js + * const input = postcss.parse('a{}', { from: file }).input + * input.css //=> "a{}" + * ``` + */ + css: string + + /** + * The absolute path to the CSS source file defined + * with the `from` option. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.file //=> '/home/ai/a.css' + * ``` + */ + file?: string + + /** + * The flag to indicate whether or not the source code has Unicode BOM. + */ + hasBOM: boolean + + /** + * The unique ID of the CSS source. It will be created if `from` option + * is not provided (because PostCSS does not know the file path). + * + * ```js + * const root = postcss.parse(css) + * root.source.input.file //=> undefined + * root.source.input.id //=> "<input css 8LZeVF>" + * ``` + */ + id?: string + + /** + * The input source map passed from a compilation step before PostCSS + * (for example, from Sass compiler). + * + * ```js + * root.source.input.map.consumer().sources //=> ['a.sass'] + * ``` + */ + map: PreviousMap + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + error( + message: string, + start: + | { + column: number + line: number + } + | { + offset: number + }, + end: + | { + column: number + line: number + } + | { + offset: number + }, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * Returns `CssSyntaxError` with information about the error and its position. + */ + error( + message: string, + line: number, + column: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + error( + message: string, + offset: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * Converts source offset to line and column. + * + * @param offset Source offset. + */ + fromOffset(offset: number): { col: number; line: number } | null + /** + * Reads the input source map and returns a symbol position + * in the input source (e.g., in a Sass file that was compiled + * to CSS before being passed to PostCSS). Optionally takes an + * end position, exclusive. + * + * ```js + * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 } + * root.source.input.origin(1, 1, 1, 4) + * //=> { file: 'a.css', line: 3, column: 1, endLine: 3, endColumn: 4 } + * ``` + * + * @param line Line for inclusive start position in input CSS. + * @param column Column for inclusive start position in input CSS. + * @param endLine Line for exclusive end position in input CSS. + * @param endColumn Column for exclusive end position in input CSS. + * + * @return Position in input source. + */ + origin( + line: number, + column: number, + endLine?: number, + endColumn?: number + ): false | Input.FilePosition + /** Converts this to a JSON-friendly object representation. */ + toJSON(): object + + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.from //=> "/home/ai/a.css" + * + * const root = postcss.parse(css) + * root.source.input.from //=> "<input css 1>" + * ``` + */ + get from(): string +} + +declare class Input extends Input_ {} + +export = Input diff --git a/seller_1/node_modules/postcss/lib/input.js b/seller_1/node_modules/postcss/lib/input.js new file mode 100644 index 0000000..685bce7 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/input.js @@ -0,0 +1,248 @@ +'use strict' + +let { nanoid } = require('nanoid/non-secure') +let { isAbsolute, resolve } = require('path') +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { fileURLToPath, pathToFileURL } = require('url') + +let CssSyntaxError = require('./css-syntax-error') +let PreviousMap = require('./previous-map') +let terminalHighlight = require('./terminal-highlight') + +let fromOffsetCache = Symbol('fromOffsetCache') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(resolve && isAbsolute) + +class Input { + constructor(css, opts = {}) { + if ( + css === null || + typeof css === 'undefined' || + (typeof css === 'object' && !css.toString) + ) { + throw new Error(`PostCSS received ${css} instead of CSS string`) + } + + this.css = css.toString() + + if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { + this.hasBOM = true + this.css = this.css.slice(1) + } else { + this.hasBOM = false + } + + if (opts.from) { + if ( + !pathAvailable || + /^\w+:\/\//.test(opts.from) || + isAbsolute(opts.from) + ) { + this.file = opts.from + } else { + this.file = resolve(opts.from) + } + } + + if (pathAvailable && sourceMapAvailable) { + let map = new PreviousMap(this.css, opts) + if (map.text) { + this.map = map + let file = map.consumer().file + if (!this.file && file) this.file = this.mapResolve(file) + } + } + + if (!this.file) { + this.id = '<input css ' + nanoid(6) + '>' + } + if (this.map) this.map.file = this.from + } + + error(message, line, column, opts = {}) { + let endColumn, endLine, result + + if (line && typeof line === 'object') { + let start = line + let end = column + if (typeof start.offset === 'number') { + let pos = this.fromOffset(start.offset) + line = pos.line + column = pos.col + } else { + line = start.line + column = start.column + } + if (typeof end.offset === 'number') { + let pos = this.fromOffset(end.offset) + endLine = pos.line + endColumn = pos.col + } else { + endLine = end.line + endColumn = end.column + } + } else if (!column) { + let pos = this.fromOffset(line) + line = pos.line + column = pos.col + } + + let origin = this.origin(line, column, endLine, endColumn) + if (origin) { + result = new CssSyntaxError( + message, + origin.endLine === undefined + ? origin.line + : { column: origin.column, line: origin.line }, + origin.endLine === undefined + ? origin.column + : { column: origin.endColumn, line: origin.endLine }, + origin.source, + origin.file, + opts.plugin + ) + } else { + result = new CssSyntaxError( + message, + endLine === undefined ? line : { column, line }, + endLine === undefined ? column : { column: endColumn, line: endLine }, + this.css, + this.file, + opts.plugin + ) + } + + result.input = { column, endColumn, endLine, line, source: this.css } + if (this.file) { + if (pathToFileURL) { + result.input.url = pathToFileURL(this.file).toString() + } + result.input.file = this.file + } + + return result + } + + fromOffset(offset) { + let lastLine, lineToIndex + if (!this[fromOffsetCache]) { + let lines = this.css.split('\n') + lineToIndex = new Array(lines.length) + let prevIndex = 0 + + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex + prevIndex += lines[i].length + 1 + } + + this[fromOffsetCache] = lineToIndex + } else { + lineToIndex = this[fromOffsetCache] + } + lastLine = lineToIndex[lineToIndex.length - 1] + + let min = 0 + if (offset >= lastLine) { + min = lineToIndex.length - 1 + } else { + let max = lineToIndex.length - 2 + let mid + while (min < max) { + mid = min + ((max - min) >> 1) + if (offset < lineToIndex[mid]) { + max = mid - 1 + } else if (offset >= lineToIndex[mid + 1]) { + min = mid + 1 + } else { + min = mid + break + } + } + } + return { + col: offset - lineToIndex[min] + 1, + line: min + 1 + } + } + + mapResolve(file) { + if (/^\w+:\/\//.test(file)) { + return file + } + return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) + } + + origin(line, column, endLine, endColumn) { + if (!this.map) return false + let consumer = this.map.consumer() + + let from = consumer.originalPositionFor({ column, line }) + if (!from.source) return false + + let to + if (typeof endLine === 'number') { + to = consumer.originalPositionFor({ column: endColumn, line: endLine }) + } + + let fromUrl + + if (isAbsolute(from.source)) { + fromUrl = pathToFileURL(from.source) + } else { + fromUrl = new URL( + from.source, + this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) + ) + } + + let result = { + column: from.column, + endColumn: to && to.column, + endLine: to && to.line, + line: from.line, + url: fromUrl.toString() + } + + if (fromUrl.protocol === 'file:') { + if (fileURLToPath) { + result.file = fileURLToPath(fromUrl) + } else { + /* c8 ignore next 2 */ + throw new Error(`file: protocol is not available in this PostCSS build`) + } + } + + let source = consumer.sourceContentFor(from.source) + if (source) result.source = source + + return result + } + + toJSON() { + let json = {} + for (let name of ['hasBOM', 'css', 'file', 'id']) { + if (this[name] != null) { + json[name] = this[name] + } + } + if (this.map) { + json.map = { ...this.map } + if (json.map.consumerCache) { + json.map.consumerCache = undefined + } + } + return json + } + + get from() { + return this.file || this.id + } +} + +module.exports = Input +Input.default = Input + +if (terminalHighlight && terminalHighlight.registerInput) { + terminalHighlight.registerInput(Input) +} diff --git a/seller_1/node_modules/postcss/lib/lazy-result.d.ts b/seller_1/node_modules/postcss/lib/lazy-result.d.ts new file mode 100644 index 0000000..dd291aa --- /dev/null +++ b/seller_1/node_modules/postcss/lib/lazy-result.d.ts @@ -0,0 +1,190 @@ +import Document from './document.js' +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace LazyResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { LazyResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * + * A `LazyResult` instance is returned by `Processor#process`. + * + * ```js + * const lazy = postcss([autoprefixer]).process(css) + * ``` + */ +declare class LazyResult_<RootNode = Document | Root> + implements PromiseLike<Result<RootNode>> +{ + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onRejected for each error thrown in any plugin. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }).catch(error => { + * console.error(error) + * }) + * ``` + */ + catch: Promise<Result<RootNode>>['catch'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onFinally on any error or when all plugins will finish work. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).finally(() => { + * console.log('processing ended') + * }) + * ``` + */ + finally: Promise<Result<RootNode>>['finally'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls `onFulfilled` with a Result instance. If a plugin throws + * an error, the `onRejected` callback will be executed. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => { + * console.log(result.css) + * }) + * ``` + */ + then: Promise<Result<RootNode>>['then'] + + /** + * @param processor Processor used for this transformation. + * @param css CSS to parse and transform. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, css: string, opts: ResultOptions) + + /** + * Run plugin in async way and return `Result`. + * + * @return Result with output content. + */ + async(): Promise<Result<RootNode>> + + /** + * Run plugin in sync way and return `Result`. + * + * @return Result with output content. + */ + sync(): Result<RootNode> + + /** + * Alias for the `LazyResult#css` property. + * + * ```js + * lazy + '' === lazy.css + * ``` + * + * @return Output CSS. + */ + toString(): string + + /** + * Processes input CSS through synchronous plugins + * and calls `Result#warnings`. + * + * @return Warnings from plugins. + */ + warnings(): Warning[] + + /** + * An alias for the `css` property. Use it with syntaxes + * that generate non-CSS output. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get content(): string + + /** + * Processes input CSS through synchronous plugins, converts `Root` + * to a CSS string and returns `Result#css`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get css(): string + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#map`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get map(): SourceMap + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#messages`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get messages(): Message[] + + /** + * Options from the `Processor#process` call. + */ + get opts(): ResultOptions + + /** + * Returns a `Processor` instance, which will be used + * for CSS transformations. + */ + get processor(): Processor + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#root`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get root(): RootNode + + /** + * Returns the default string description of an object. + * Required to implement the Promise interface. + */ + get [Symbol.toStringTag](): string +} + +declare class LazyResult< + RootNode = Document | Root +> extends LazyResult_<RootNode> {} + +export = LazyResult diff --git a/seller_1/node_modules/postcss/lib/lazy-result.js b/seller_1/node_modules/postcss/lib/lazy-result.js new file mode 100644 index 0000000..e27701d --- /dev/null +++ b/seller_1/node_modules/postcss/lib/lazy-result.js @@ -0,0 +1,550 @@ +'use strict' + +let Container = require('./container') +let Document = require('./document') +let MapGenerator = require('./map-generator') +let parse = require('./parse') +let Result = require('./result') +let Root = require('./root') +let stringify = require('./stringify') +let { isClean, my } = require('./symbols') +let warnOnce = require('./warn-once') + +const TYPE_TO_CLASS_NAME = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule' +} + +const PLUGIN_PROPS = { + AtRule: true, + AtRuleExit: true, + Comment: true, + CommentExit: true, + Declaration: true, + DeclarationExit: true, + Document: true, + DocumentExit: true, + Once: true, + OnceExit: true, + postcssPlugin: true, + prepare: true, + Root: true, + RootExit: true, + Rule: true, + RuleExit: true +} + +const NOT_VISITORS = { + Once: true, + postcssPlugin: true, + prepare: true +} + +const CHILDREN = 0 + +function isPromise(obj) { + return typeof obj === 'object' && typeof obj.then === 'function' +} + +function getEvents(node) { + let key = false + let type = TYPE_TO_CLASS_NAME[node.type] + if (node.type === 'decl') { + key = node.prop.toLowerCase() + } else if (node.type === 'atrule') { + key = node.name.toLowerCase() + } + + if (key && node.append) { + return [ + type, + type + '-' + key, + CHILDREN, + type + 'Exit', + type + 'Exit-' + key + ] + } else if (key) { + return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] + } else if (node.append) { + return [type, CHILDREN, type + 'Exit'] + } else { + return [type, type + 'Exit'] + } +} + +function toStack(node) { + let events + if (node.type === 'document') { + events = ['Document', CHILDREN, 'DocumentExit'] + } else if (node.type === 'root') { + events = ['Root', CHILDREN, 'RootExit'] + } else { + events = getEvents(node) + } + + return { + eventIndex: 0, + events, + iterator: 0, + node, + visitorIndex: 0, + visitors: [] + } +} + +function cleanMarks(node) { + node[isClean] = false + if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) + return node +} + +let postcss = {} + +class LazyResult { + constructor(processor, css, opts) { + this.stringified = false + this.processed = false + + let root + if ( + typeof css === 'object' && + css !== null && + (css.type === 'root' || css.type === 'document') + ) { + root = cleanMarks(css) + } else if (css instanceof LazyResult || css instanceof Result) { + root = cleanMarks(css.root) + if (css.map) { + if (typeof opts.map === 'undefined') opts.map = {} + if (!opts.map.inline) opts.map.inline = false + opts.map.prev = css.map + } + } else { + let parser = parse + if (opts.syntax) parser = opts.syntax.parse + if (opts.parser) parser = opts.parser + if (parser.parse) parser = parser.parse + + try { + root = parser(css, opts) + } catch (error) { + this.processed = true + this.error = error + } + + if (root && !root[my]) { + /* c8 ignore next 2 */ + Container.rebuild(root) + } + } + + this.result = new Result(processor, root, opts) + this.helpers = { ...postcss, postcss, result: this.result } + this.plugins = this.processor.plugins.map(plugin => { + if (typeof plugin === 'object' && plugin.prepare) { + return { ...plugin, ...plugin.prepare(this.result) } + } else { + return plugin + } + }) + } + + async() { + if (this.error) return Promise.reject(this.error) + if (this.processed) return Promise.resolve(this.result) + if (!this.processing) { + this.processing = this.runAsync() + } + return this.processing + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins') + } + + handleError(error, node) { + let plugin = this.result.lastPlugin + try { + if (node) node.addToError(error) + this.error = error + if (error.name === 'CssSyntaxError' && !error.plugin) { + error.plugin = plugin.postcssPlugin + error.setMessage() + } else if (plugin.postcssVersion) { + if (process.env.NODE_ENV !== 'production') { + let pluginName = plugin.postcssPlugin + let pluginVer = plugin.postcssVersion + let runtimeVer = this.result.processor.version + let a = pluginVer.split('.') + let b = runtimeVer.split('.') + + if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { + // eslint-disable-next-line no-console + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS ' + + 'version is ' + + runtimeVer + + ', but ' + + pluginName + + ' uses ' + + pluginVer + + '. Perhaps this is the source of the error below.' + ) + } + } + } + } catch (err) { + /* c8 ignore next 3 */ + // eslint-disable-next-line no-console + if (console && console.error) console.error(err) + } + return error + } + + prepareVisitors() { + this.listeners = {} + let add = (plugin, type, cb) => { + if (!this.listeners[type]) this.listeners[type] = [] + this.listeners[type].push([plugin, cb]) + } + for (let plugin of this.plugins) { + if (typeof plugin === 'object') { + for (let event in plugin) { + if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { + throw new Error( + `Unknown event ${event} in ${plugin.postcssPlugin}. ` + + `Try to update PostCSS (${this.processor.version} now).` + ) + } + if (!NOT_VISITORS[event]) { + if (typeof plugin[event] === 'object') { + for (let filter in plugin[event]) { + if (filter === '*') { + add(plugin, event, plugin[event][filter]) + } else { + add( + plugin, + event + '-' + filter.toLowerCase(), + plugin[event][filter] + ) + } + } + } else if (typeof plugin[event] === 'function') { + add(plugin, event, plugin[event]) + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0 + } + + async runAsync() { + this.plugin = 0 + for (let i = 0; i < this.plugins.length; i++) { + let plugin = this.plugins[i] + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + try { + await promise + } catch (error) { + throw this.handleError(error) + } + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + let stack = [toStack(root)] + while (stack.length > 0) { + let promise = this.visitTick(stack) + if (isPromise(promise)) { + try { + await promise + } catch (e) { + let node = stack[stack.length - 1].node + throw this.handleError(e, node) + } + } + } + } + + if (this.listeners.OnceExit) { + for (let [plugin, visitor] of this.listeners.OnceExit) { + this.result.lastPlugin = plugin + try { + if (root.type === 'document') { + let roots = root.nodes.map(subRoot => + visitor(subRoot, this.helpers) + ) + + await Promise.all(roots) + } else { + await visitor(root, this.helpers) + } + } catch (e) { + throw this.handleError(e) + } + } + } + } + + this.processed = true + return this.stringify() + } + + runOnRoot(plugin) { + this.result.lastPlugin = plugin + try { + if (typeof plugin === 'object' && plugin.Once) { + if (this.result.root.type === 'document') { + let roots = this.result.root.nodes.map(root => + plugin.Once(root, this.helpers) + ) + + if (isPromise(roots[0])) { + return Promise.all(roots) + } + + return roots + } + + return plugin.Once(this.result.root, this.helpers) + } else if (typeof plugin === 'function') { + return plugin(this.result.root, this.result) + } + } catch (error) { + throw this.handleError(error) + } + } + + stringify() { + if (this.error) throw this.error + if (this.stringified) return this.result + this.stringified = true + + this.sync() + + let opts = this.result.opts + let str = stringify + if (opts.syntax) str = opts.syntax.stringify + if (opts.stringifier) str = opts.stringifier + if (str.stringify) str = str.stringify + + let map = new MapGenerator(str, this.result.root, this.result.opts) + let data = map.generate() + this.result.css = data[0] + this.result.map = data[1] + + return this.result + } + + sync() { + if (this.error) throw this.error + if (this.processed) return this.result + this.processed = true + + if (this.processing) { + throw this.getAsyncError() + } + + for (let plugin of this.plugins) { + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + this.walkSync(root) + } + if (this.listeners.OnceExit) { + if (root.type === 'document') { + for (let subRoot of root.nodes) { + this.visitSync(this.listeners.OnceExit, subRoot) + } + } else { + this.visitSync(this.listeners.OnceExit, root) + } + } + } + + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this.opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this.css + } + + visitSync(visitors, node) { + for (let [plugin, visitor] of visitors) { + this.result.lastPlugin = plugin + let promise + try { + promise = visitor(node, this.helpers) + } catch (e) { + throw this.handleError(e, node.proxyOf) + } + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + return true + } + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + } + + visitTick(stack) { + let visit = stack[stack.length - 1] + let { node, visitors } = visit + + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + stack.pop() + return + } + + if (visitors.length > 0 && visit.visitorIndex < visitors.length) { + let [plugin, visitor] = visitors[visit.visitorIndex] + visit.visitorIndex += 1 + if (visit.visitorIndex === visitors.length) { + visit.visitors = [] + visit.visitorIndex = 0 + } + this.result.lastPlugin = plugin + try { + return visitor(node.toProxy(), this.helpers) + } catch (e) { + throw this.handleError(e, node) + } + } + + if (visit.iterator !== 0) { + let iterator = visit.iterator + let child + while ((child = node.nodes[node.indexes[iterator]])) { + node.indexes[iterator] += 1 + if (!child[isClean]) { + child[isClean] = true + stack.push(toStack(child)) + return + } + } + visit.iterator = 0 + delete node.indexes[iterator] + } + + let events = visit.events + while (visit.eventIndex < events.length) { + let event = events[visit.eventIndex] + visit.eventIndex += 1 + if (event === CHILDREN) { + if (node.nodes && node.nodes.length) { + node[isClean] = true + visit.iterator = node.getIterator() + } + return + } else if (this.listeners[event]) { + visit.visitors = this.listeners[event] + return + } + } + stack.pop() + } + + walkSync(node) { + node[isClean] = true + let events = getEvents(node) + for (let event of events) { + if (event === CHILDREN) { + if (node.nodes) { + node.each(child => { + if (!child[isClean]) this.walkSync(child) + }) + } + } else { + let visitors = this.listeners[event] + if (visitors) { + if (this.visitSync(visitors, node.toProxy())) return + } + } + } + } + + warnings() { + return this.sync().warnings() + } + + get content() { + return this.stringify().content + } + + get css() { + return this.stringify().css + } + + get map() { + return this.stringify().map + } + + get messages() { + return this.sync().messages + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + return this.sync().root + } + + get [Symbol.toStringTag]() { + return 'LazyResult' + } +} + +LazyResult.registerPostcss = dependant => { + postcss = dependant +} + +module.exports = LazyResult +LazyResult.default = LazyResult + +Root.registerLazyResult(LazyResult) +Document.registerLazyResult(LazyResult) diff --git a/seller_1/node_modules/postcss/lib/list.d.ts b/seller_1/node_modules/postcss/lib/list.d.ts new file mode 100644 index 0000000..e262ad3 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/list.d.ts @@ -0,0 +1,60 @@ +declare namespace list { + type List = { + /** + * Safely splits comma-separated values (such as those for `transition-*` + * and `background` properties). + * + * ```js + * Once (root, { list }) { + * list.comma('black, linear-gradient(white, black)') + * //=> ['black', 'linear-gradient(white, black)'] + * } + * ``` + * + * @param str Comma-separated values. + * @return Split values. + */ + comma(str: string): string[] + + default: List + + /** + * Safely splits space-separated values (such as those for `background`, + * `border-radius`, and other shorthand properties). + * + * ```js + * Once (root, { list }) { + * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param str Space-separated values. + * @return Split values. + */ + space(str: string): string[] + + /** + * Safely splits values. + * + * ```js + * Once (root, { list }) { + * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param string separated values. + * @param separators array of separators. + * @param last boolean indicator. + * @return Split values. + */ + split( + string: string, + separators: readonly string[], + last: boolean + ): string[] + } +} + +declare const list: list.List + +export = list diff --git a/seller_1/node_modules/postcss/lib/list.js b/seller_1/node_modules/postcss/lib/list.js new file mode 100644 index 0000000..1b31f98 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/list.js @@ -0,0 +1,58 @@ +'use strict' + +let list = { + comma(string) { + return list.split(string, [','], true) + }, + + space(string) { + let spaces = [' ', '\n', '\t'] + return list.split(string, spaces) + }, + + split(string, separators, last) { + let array = [] + let current = '' + let split = false + + let func = 0 + let inQuote = false + let prevQuote = '' + let escape = false + + for (let letter of string) { + if (escape) { + escape = false + } else if (letter === '\\') { + escape = true + } else if (inQuote) { + if (letter === prevQuote) { + inQuote = false + } + } else if (letter === '"' || letter === "'") { + inQuote = true + prevQuote = letter + } else if (letter === '(') { + func += 1 + } else if (letter === ')') { + if (func > 0) func -= 1 + } else if (func === 0) { + if (separators.includes(letter)) split = true + } + + if (split) { + if (current !== '') array.push(current.trim()) + current = '' + split = false + } else { + current += letter + } + } + + if (last || current !== '') array.push(current.trim()) + return array + } +} + +module.exports = list +list.default = list diff --git a/seller_1/node_modules/postcss/lib/map-generator.js b/seller_1/node_modules/postcss/lib/map-generator.js new file mode 100644 index 0000000..89069d3 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/map-generator.js @@ -0,0 +1,368 @@ +'use strict' + +let { dirname, relative, resolve, sep } = require('path') +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { pathToFileURL } = require('url') + +let Input = require('./input') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(dirname && resolve && relative && sep) + +class MapGenerator { + constructor(stringify, root, opts, cssString) { + this.stringify = stringify + this.mapOpts = opts.map || {} + this.root = root + this.opts = opts + this.css = cssString + this.originalCSS = cssString + this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute + + this.memoizedFileURLs = new Map() + this.memoizedPaths = new Map() + this.memoizedURLs = new Map() + } + + addAnnotation() { + let content + + if (this.isInline()) { + content = + 'data:application/json;base64,' + this.toBase64(this.map.toString()) + } else if (typeof this.mapOpts.annotation === 'string') { + content = this.mapOpts.annotation + } else if (typeof this.mapOpts.annotation === 'function') { + content = this.mapOpts.annotation(this.opts.to, this.root) + } else { + content = this.outputFile() + '.map' + } + let eol = '\n' + if (this.css.includes('\r\n')) eol = '\r\n' + + this.css += eol + '/*# sourceMappingURL=' + content + ' */' + } + + applyPrevMaps() { + for (let prev of this.previous()) { + let from = this.toUrl(this.path(prev.file)) + let root = prev.root || dirname(prev.file) + let map + + if (this.mapOpts.sourcesContent === false) { + map = new SourceMapConsumer(prev.text) + if (map.sourcesContent) { + map.sourcesContent = null + } + } else { + map = prev.consumer() + } + + this.map.applySourceMap(map, from, this.toUrl(this.path(root))) + } + } + + clearAnnotation() { + if (this.mapOpts.annotation === false) return + + if (this.root) { + let node + for (let i = this.root.nodes.length - 1; i >= 0; i--) { + node = this.root.nodes[i] + if (node.type !== 'comment') continue + if (node.text.startsWith('# sourceMappingURL=')) { + this.root.removeChild(i) + } + } + } else if (this.css) { + this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '') + } + } + + generate() { + this.clearAnnotation() + if (pathAvailable && sourceMapAvailable && this.isMap()) { + return this.generateMap() + } else { + let result = '' + this.stringify(this.root, i => { + result += i + }) + return [result] + } + } + + generateMap() { + if (this.root) { + this.generateString() + } else if (this.previous().length === 1) { + let prev = this.previous()[0].consumer() + prev.file = this.outputFile() + this.map = SourceMapGenerator.fromSourceMap(prev, { + ignoreInvalidMapping: true + }) + } else { + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }) + this.map.addMapping({ + generated: { column: 0, line: 1 }, + original: { column: 0, line: 1 }, + source: this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '<no source>' + }) + } + + if (this.isSourcesContent()) this.setSourcesContent() + if (this.root && this.previous().length > 0) this.applyPrevMaps() + if (this.isAnnotation()) this.addAnnotation() + + if (this.isInline()) { + return [this.css] + } else { + return [this.css, this.map] + } + } + + generateString() { + this.css = '' + this.map = new SourceMapGenerator({ + file: this.outputFile(), + ignoreInvalidMapping: true + }) + + let line = 1 + let column = 1 + + let noSource = '<no source>' + let mapping = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '' + } + + let last, lines + this.stringify(this.root, (str, node, type) => { + this.css += str + + if (node && type !== 'end') { + mapping.generated.line = line + mapping.generated.column = column - 1 + if (node.source && node.source.start) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.start.line + mapping.original.column = node.source.start.column - 1 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + this.map.addMapping(mapping) + } + } + + lines = str.match(/\n/g) + if (lines) { + line += lines.length + last = str.lastIndexOf('\n') + column = str.length - last + } else { + column += str.length + } + + if (node && type !== 'start') { + let p = node.parent || { raws: {} } + let childless = + node.type === 'decl' || (node.type === 'atrule' && !node.nodes) + if (!childless || node !== p.last || p.raws.semicolon) { + if (node.source && node.source.end) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.end.line + mapping.original.column = node.source.end.column - 1 + mapping.generated.line = line + mapping.generated.column = column - 2 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + mapping.generated.line = line + mapping.generated.column = column - 1 + this.map.addMapping(mapping) + } + } + } + }) + } + + isAnnotation() { + if (this.isInline()) { + return true + } + if (typeof this.mapOpts.annotation !== 'undefined') { + return this.mapOpts.annotation + } + if (this.previous().length) { + return this.previous().some(i => i.annotation) + } + return true + } + + isInline() { + if (typeof this.mapOpts.inline !== 'undefined') { + return this.mapOpts.inline + } + + let annotation = this.mapOpts.annotation + if (typeof annotation !== 'undefined' && annotation !== true) { + return false + } + + if (this.previous().length) { + return this.previous().some(i => i.inline) + } + return true + } + + isMap() { + if (typeof this.opts.map !== 'undefined') { + return !!this.opts.map + } + return this.previous().length > 0 + } + + isSourcesContent() { + if (typeof this.mapOpts.sourcesContent !== 'undefined') { + return this.mapOpts.sourcesContent + } + if (this.previous().length) { + return this.previous().some(i => i.withContent()) + } + return true + } + + outputFile() { + if (this.opts.to) { + return this.path(this.opts.to) + } else if (this.opts.from) { + return this.path(this.opts.from) + } else { + return 'to.css' + } + } + + path(file) { + if (this.mapOpts.absolute) return file + if (file.charCodeAt(0) === 60 /* `<` */) return file + if (/^\w+:\/\//.test(file)) return file + let cached = this.memoizedPaths.get(file) + if (cached) return cached + + let from = this.opts.to ? dirname(this.opts.to) : '.' + + if (typeof this.mapOpts.annotation === 'string') { + from = dirname(resolve(from, this.mapOpts.annotation)) + } + + let path = relative(from, file) + this.memoizedPaths.set(file, path) + + return path + } + + previous() { + if (!this.previousMaps) { + this.previousMaps = [] + if (this.root) { + this.root.walk(node => { + if (node.source && node.source.input.map) { + let map = node.source.input.map + if (!this.previousMaps.includes(map)) { + this.previousMaps.push(map) + } + } + }) + } else { + let input = new Input(this.originalCSS, this.opts) + if (input.map) this.previousMaps.push(input.map) + } + } + + return this.previousMaps + } + + setSourcesContent() { + let already = {} + if (this.root) { + this.root.walk(node => { + if (node.source) { + let from = node.source.input.from + if (from && !already[from]) { + already[from] = true + let fromUrl = this.usesFileUrls + ? this.toFileUrl(from) + : this.toUrl(this.path(from)) + this.map.setSourceContent(fromUrl, node.source.input.css) + } + } + }) + } else if (this.css) { + let from = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '<no source>' + this.map.setSourceContent(from, this.css) + } + } + + sourcePath(node) { + if (this.mapOpts.from) { + return this.toUrl(this.mapOpts.from) + } else if (this.usesFileUrls) { + return this.toFileUrl(node.source.input.from) + } else { + return this.toUrl(this.path(node.source.input.from)) + } + } + + toBase64(str) { + if (Buffer) { + return Buffer.from(str).toString('base64') + } else { + return window.btoa(unescape(encodeURIComponent(str))) + } + } + + toFileUrl(path) { + let cached = this.memoizedFileURLs.get(path) + if (cached) return cached + + if (pathToFileURL) { + let fileURL = pathToFileURL(path).toString() + this.memoizedFileURLs.set(path, fileURL) + + return fileURL + } else { + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ) + } + } + + toUrl(path) { + let cached = this.memoizedURLs.get(path) + if (cached) return cached + + if (sep === '\\') { + path = path.replace(/\\/g, '/') + } + + let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent) + this.memoizedURLs.set(path, url) + + return url + } +} + +module.exports = MapGenerator diff --git a/seller_1/node_modules/postcss/lib/no-work-result.d.ts b/seller_1/node_modules/postcss/lib/no-work-result.d.ts new file mode 100644 index 0000000..8039076 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/no-work-result.d.ts @@ -0,0 +1,46 @@ +import LazyResult from './lazy-result.js' +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace NoWorkResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { NoWorkResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root` + * are accessed. See the example below for details. + * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined. + * + * ```js + * const noWorkResult = postcss().process(css) // No plugins are defined. + * // CSS is not parsed + * let root = noWorkResult.root // now css is parsed because we accessed the root + * ``` + */ +declare class NoWorkResult_ implements LazyResult<Root> { + catch: Promise<Result<Root>>['catch'] + finally: Promise<Result<Root>>['finally'] + then: Promise<Result<Root>>['then'] + constructor(processor: Processor, css: string, opts: ResultOptions) + async(): Promise<Result<Root>> + sync(): Result<Root> + toString(): string + warnings(): Warning[] + get content(): string + get css(): string + get map(): SourceMap + get messages(): Message[] + get opts(): ResultOptions + get processor(): Processor + get root(): Root + get [Symbol.toStringTag](): string +} + +declare class NoWorkResult extends NoWorkResult_ {} + +export = NoWorkResult diff --git a/seller_1/node_modules/postcss/lib/no-work-result.js b/seller_1/node_modules/postcss/lib/no-work-result.js new file mode 100644 index 0000000..a84d843 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/no-work-result.js @@ -0,0 +1,138 @@ +'use strict' + +let MapGenerator = require('./map-generator') +let parse = require('./parse') +const Result = require('./result') +let stringify = require('./stringify') +let warnOnce = require('./warn-once') + +class NoWorkResult { + constructor(processor, css, opts) { + css = css.toString() + this.stringified = false + + this._processor = processor + this._css = css + this._opts = opts + this._map = undefined + let root + + let str = stringify + this.result = new Result(this._processor, root, this._opts) + this.result.css = css + + let self = this + Object.defineProperty(this.result, 'root', { + get() { + return self.root + } + }) + + let map = new MapGenerator(str, root, this._opts, css) + if (map.isMap()) { + let [generatedCSS, generatedMap] = map.generate() + if (generatedCSS) { + this.result.css = generatedCSS + } + if (generatedMap) { + this.result.map = generatedMap + } + } else { + map.clearAnnotation() + this.result.css = map.css + } + } + + async() { + if (this.error) return Promise.reject(this.error) + return Promise.resolve(this.result) + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + sync() { + if (this.error) throw this.error + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this._opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this._css + } + + warnings() { + return [] + } + + get content() { + return this.result.css + } + + get css() { + return this.result.css + } + + get map() { + return this.result.map + } + + get messages() { + return [] + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + if (this._root) { + return this._root + } + + let root + let parser = parse + + try { + root = parser(this._css, this._opts) + } catch (error) { + this.error = error + } + + if (this.error) { + throw this.error + } else { + this._root = root + return root + } + } + + get [Symbol.toStringTag]() { + return 'NoWorkResult' + } +} + +module.exports = NoWorkResult +NoWorkResult.default = NoWorkResult diff --git a/seller_1/node_modules/postcss/lib/node.d.ts b/seller_1/node_modules/postcss/lib/node.d.ts new file mode 100644 index 0000000..3597670 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/node.d.ts @@ -0,0 +1,541 @@ +import AtRule = require('./at-rule.js') + +import { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container, { NewChild } from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document from './document.js' +import Input from './input.js' +import { Stringifier, Syntax } from './postcss.js' +import Result from './result.js' +import Root from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +declare namespace Node { + export type ChildNode = AtRule.default | Comment | Declaration | Rule + + export type AnyNode = + | AtRule.default + | Comment + | Declaration + | Document + | Root + | Rule + + export type ChildProps = + | AtRuleProps + | CommentProps + | DeclarationProps + | RuleProps + + export interface Position { + /** + * Source line in file. In contrast to `offset` it starts from 1. + */ + column: number + + /** + * Source column in file. + */ + line: number + + /** + * Source offset in file. It starts from 0. + */ + offset: number + } + + export interface Range { + /** + * End position, exclusive. + */ + end: Position + + /** + * Start position, inclusive. + */ + start: Position + } + + /** + * Source represents an interface for the {@link Node.source} property. + */ + export interface Source { + /** + * The inclusive ending position for the source + * code of a node. + */ + end?: Position + + /** + * The source file from where a node has originated. + */ + input: Input + + /** + * The inclusive starting position for the source + * code of a node. + */ + start?: Position + } + + /** + * Interface represents an interface for an object received + * as parameter by Node class constructor. + */ + export interface NodeProps { + source?: Source + } + + export interface NodeErrorOptions { + /** + * An ending index inside a node's string that should be highlighted as + * source of error. + */ + endIndex?: number + /** + * An index inside a node's string that should be highlighted as source + * of error. + */ + index?: number + /** + * Plugin name that created this error. PostCSS will set it automatically. + */ + plugin?: string + /** + * A word inside a node's string, that should be highlighted as source + * of error. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-shadow + class Node extends Node_ {} + export { Node as default } +} + +/** + * It represents an abstract class that handles common + * methods for other CSS abstract syntax tree nodes. + * + * Any node that represents CSS selector or value should + * not extend the `Node` class. + */ +declare abstract class Node_ { + /** + * It represents parent of the current node. + * + * ```js + * root.nodes[0].parent === root //=> true + * ``` + */ + parent: Container | Document | undefined + + /** + * It represents unnecessary whitespace and characters present + * in the css source code. + * + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * The properties of the raws object are decided by parser, + * the default parser uses the following properties: + * + * * `before`: the space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + * * `after`: the space symbols after the last child of the node + * to the end of the node. + * * `between`: the symbols between the property and value + * for declarations, selector and `{` for rules, or last parameter + * and `{` for at-rules. + * * `semicolon`: contains true if the last child has + * an (optional) semicolon. + * * `afterName`: the space between the at-rule name and its parameters. + * * `left`: the space symbols between `/*` and the comment’s text. + * * `right`: the space symbols between the comment’s text + * and <code>*/</code>. + * - `important`: the content of the important statement, + * if it is not just `!important`. + * + * PostCSS filters out the comments inside selectors, declaration values + * and at-rule parameters but it stores the origin content in raws. + * + * ```js + * const root = postcss.parse('a {\n color:black\n}') + * root.first.first.raws //=> { before: '\n ', between: ':' } + * ``` + */ + raws: any + + /** + * It represents information related to origin of a node and is required + * for generating source maps. + * + * The nodes that are created manually using the public APIs + * provided by PostCSS will have `source` undefined and + * will be absent in the source map. + * + * For this reason, the plugin developer should consider + * duplicating nodes as the duplicate node will have the + * same source as the original node by default or assign + * source to a node created manually. + * + * ```js + * decl.source.input.from //=> '/home/ai/source.css' + * decl.source.start //=> { line: 10, column: 2 } + * decl.source.end //=> { line: 10, column: 12 } + * ``` + * + * ```js + * // Incorrect method, source not specified! + * const prefixed = postcss.decl({ + * prop: '-moz-' + decl.prop, + * value: decl.value + * }) + * + * // Correct method, source is inherited when duplicating. + * const prefixed = decl.clone({ + * prop: '-moz-' + decl.prop + * }) + * ``` + * + * ```js + * if (atrule.name === 'add-link') { + * const rule = postcss.rule({ + * selector: 'a', + * source: atrule.source + * }) + * + * atrule.parent.insertBefore(atrule, rule) + * } + * ``` + */ + source?: Node.Source + + /** + * It represents type of a node in + * an abstract syntax tree. + * + * A type of node helps in identification of a node + * and perform operation based on it's type. + * + * ```js + * const declaration = new Declaration({ + * prop: 'color', + * value: 'black' + * }) + * + * declaration.type //=> 'decl' + * ``` + */ + type: string + + constructor(defaults?: object) + + /** + * If this node isn't already dirty, marks it and its ancestors as such. This + * indicates to the LazyResult processor that the {@link Root} has been + * modified by the current plugin and may need to be processed again by other + * plugins. + */ + protected markDirty(): void + + /** + * Insert new node after current node to current node’s parent. + * + * Just alias for `node.parent.insertAfter(node, add)`. + * + * ```js + * decl.after('color: black') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + after( + newNode: Node | Node.ChildProps | readonly Node[] | string | undefined + ): this + + /** + * It assigns properties to an existing node instance. + * + * ```js + * decl.assign({ prop: 'word-wrap', value: 'break-word' }) + * ``` + * + * @param overrides New properties to override the node. + * + * @return `this` for method chaining. + */ + assign(overrides: object): this + + /** + * Insert new node before current node to current node’s parent. + * + * Just alias for `node.parent.insertBefore(node, add)`. + * + * ```js + * decl.before('content: ""') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + before( + newNode: Node | Node.ChildProps | readonly Node[] | string | undefined + ): this + + /** + * Clear the code style properties for the node and its children. + * + * ```js + * node.raws.before //=> ' ' + * node.cleanRaws() + * node.raws.before //=> undefined + * ``` + * + * @param keepBetween Keep the `raws.between` symbols. + */ + cleanRaws(keepBetween?: boolean): void + + /** + * It creates clone of an existing node, which includes all the properties + * and their values, that includes `raws` but not `type`. + * + * ```js + * decl.raws.before //=> "\n " + * const cloned = decl.clone({ prop: '-moz-' + decl.prop }) + * cloned.raws.before //=> "\n " + * cloned.toString() //=> -moz-transform: scale(0) + * ``` + * + * @param overrides New properties to override in the clone. + * + * @return Duplicate of the node instance. + */ + clone(overrides?: object): this + + /** + * Shortcut to clone the node and insert the resulting cloned node + * after the current node. + * + * @param overrides New properties to override in the clone. + * @return New node. + */ + cloneAfter(overrides?: object): this + + /** + * Shortcut to clone the node and insert the resulting cloned node + * before the current node. + * + * ```js + * decl.cloneBefore({ prop: '-moz-' + decl.prop }) + * ``` + * + * @param overrides Mew properties to override in the clone. + * + * @return New node + */ + cloneBefore(overrides?: object): this + + /** + * It creates an instance of the class `CssSyntaxError` and parameters passed + * to this method are assigned to the error instance. + * + * The error instance will have description for the + * error, original position of the node in the + * source, showing line and column number. + * + * If any previous map is present, it would be used + * to get original position of the source. + * + * The Previous Map here is referred to the source map + * generated by previous compilation, example: Less, + * Stylus and Sass. + * + * This method returns the error instance instead of + * throwing it. + * + * ```js + * if (!variables[name]) { + * throw decl.error(`Unknown variable ${name}`, { word: name }) + * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black + * // color: $black + * // a + * // ^ + * // background: white + * } + * ``` + * + * @param message Description for the error instance. + * @param options Options for the error instance. + * + * @return Error instance is returned. + */ + error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError + + /** + * Returns the next child of the node’s parent. + * Returns `undefined` if the current node is the last child. + * + * ```js + * if (comment.text === 'delete next') { + * const next = comment.next() + * if (next) { + * next.remove() + * } + * } + * ``` + * + * @return Next node. + */ + next(): Node.ChildNode | undefined + + /** + * Get the position for a word or an index inside the node. + * + * @param opts Options. + * @return Position. + */ + positionBy(opts?: Pick<WarningOptions, 'index' | 'word'>): Node.Position + + /** + * Convert string index to line/column. + * + * @param index The symbol number in the node’s string. + * @return Symbol position in file. + */ + positionInside(index: number): Node.Position + + /** + * Returns the previous child of the node’s parent. + * Returns `undefined` if the current node is the first child. + * + * ```js + * const annotation = decl.prev() + * if (annotation.type === 'comment') { + * readAnnotation(annotation.text) + * } + * ``` + * + * @return Previous node. + */ + prev(): Node.ChildNode | undefined + + /** + * Get the range for a word or start and end index inside the node. + * The start index is inclusive; the end index is exclusive. + * + * @param opts Options. + * @return Range. + */ + rangeBy( + opts?: Pick<WarningOptions, 'endIndex' | 'index' | 'word'> + ): Node.Range + + /** + * Returns a `raws` value. If the node is missing + * the code style property (because the node was manually built or cloned), + * PostCSS will try to autodetect the code style property by looking + * at other nodes in the tree. + * + * ```js + * const root = postcss.parse('a { background: white }') + * root.nodes[0].append({ prop: 'color', value: 'black' }) + * root.nodes[0].nodes[1].raws.before //=> undefined + * root.nodes[0].nodes[1].raw('before') //=> ' ' + * ``` + * + * @param prop Name of code style property. + * @param defaultType Name of default value, it can be missed + * if the value is the same as prop. + * @return {string} Code style value. + */ + raw(prop: string, defaultType?: string): string + + /** + * It removes the node from its parent and deletes its parent property. + * + * ```js + * if (decl.prop.match(/^-webkit-/)) { + * decl.remove() + * } + * ``` + * + * @return `this` for method chaining. + */ + remove(): this + + /** + * Inserts node(s) before the current node and removes the current node. + * + * ```js + * AtRule: { + * mixin: atrule => { + * atrule.replaceWith(mixinRules[atrule.params]) + * } + * } + * ``` + * + * @param nodes Mode(s) to replace current one. + * @return Current node to methods chain. + */ + replaceWith(...nodes: NewChild[]): this + + /** + * Finds the Root instance of the node’s tree. + * + * ```js + * root.nodes[0].nodes[0].root() === root + * ``` + * + * @return Root parent. + */ + root(): Root + + /** + * Fix circular links on `JSON.stringify()`. + * + * @return Cleaned object. + */ + toJSON(): object + + /** + * It compiles the node to browser readable cascading style sheets string + * depending on it's type. + * + * ```js + * new Rule({ selector: 'a' }).toString() //=> "a {}" + * ``` + * + * @param stringifier A syntax to use in string generation. + * @return CSS string of this node. + */ + toString(stringifier?: Stringifier | Syntax): string + + /** + * It is a wrapper for {@link Result#warn}, providing convenient + * way of generating warnings. + * + * ```js + * Declaration: { + * bad: (decl, { result }) => { + * decl.warn(result, 'Deprecated property: bad') + * } + * } + * ``` + * + * @param result The `Result` instance that will receive the warning. + * @param message Description for the warning. + * @param options Options for the warning. + * + * @return `Warning` instance is returned + */ + warn(result: Result, message: string, options?: WarningOptions): Warning +} + +declare class Node extends Node_ {} + +export = Node diff --git a/seller_1/node_modules/postcss/lib/node.js b/seller_1/node_modules/postcss/lib/node.js new file mode 100644 index 0000000..9949be7 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/node.js @@ -0,0 +1,425 @@ +'use strict' + +let CssSyntaxError = require('./css-syntax-error') +let Stringifier = require('./stringifier') +let stringify = require('./stringify') +let { isClean, my } = require('./symbols') + +function cloneNode(obj, parent) { + let cloned = new obj.constructor() + + for (let i in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, i)) { + /* c8 ignore next 2 */ + continue + } + if (i === 'proxyCache') continue + let value = obj[i] + let type = typeof value + + if (i === 'parent' && type === 'object') { + if (parent) cloned[i] = parent + } else if (i === 'source') { + cloned[i] = value + } else if (Array.isArray(value)) { + cloned[i] = value.map(j => cloneNode(j, cloned)) + } else { + if (type === 'object' && value !== null) value = cloneNode(value) + cloned[i] = value + } + } + + return cloned +} + +function sourceOffset(inputCSS, position) { + // Not all custom syntaxes support `offset` in `source.start` and `source.end` + if ( + position && + typeof position.offset !== 'undefined' + ) { + return position.offset; + } + + let column = 1 + let line = 1 + let offset = 0 + + for (let i = 0; i < inputCSS.length; i++) { + if (line === position.line && column === position.column) { + offset = i + break + } + + if (inputCSS[i] === '\n') { + column = 1 + line += 1 + } else { + column += 1 + } + } + + return offset +} + +class Node { + constructor(defaults = {}) { + this.raws = {} + this[isClean] = false + this[my] = true + + for (let name in defaults) { + if (name === 'nodes') { + this.nodes = [] + for (let node of defaults[name]) { + if (typeof node.clone === 'function') { + this.append(node.clone()) + } else { + this.append(node) + } + } + } else { + this[name] = defaults[name] + } + } + } + + addToError(error) { + error.postcssNode = this + if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { + let s = this.source + error.stack = error.stack.replace( + /\n\s{4}at /, + `$&${s.input.from}:${s.start.line}:${s.start.column}$&` + ) + } + return error + } + + after(add) { + this.parent.insertAfter(this, add) + return this + } + + assign(overrides = {}) { + for (let name in overrides) { + this[name] = overrides[name] + } + return this + } + + before(add) { + this.parent.insertBefore(this, add) + return this + } + + cleanRaws(keepBetween) { + delete this.raws.before + delete this.raws.after + if (!keepBetween) delete this.raws.between + } + + clone(overrides = {}) { + let cloned = cloneNode(this) + for (let name in overrides) { + cloned[name] = overrides[name] + } + return cloned + } + + cloneAfter(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertAfter(this, cloned) + return cloned + } + + cloneBefore(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertBefore(this, cloned) + return cloned + } + + error(message, opts = {}) { + if (this.source) { + let { end, start } = this.rangeBy(opts) + return this.source.input.error( + message, + { column: start.column, line: start.line }, + { column: end.column, line: end.line }, + opts + ) + } + return new CssSyntaxError(message) + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (prop === 'root') { + return () => node.root().toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value + if ( + prop === 'prop' || + prop === 'value' || + prop === 'name' || + prop === 'params' || + prop === 'important' || + /* c8 ignore next */ + prop === 'text' + ) { + node.markDirty() + } + return true + } + } + } + + /* c8 ignore next 3 */ + markClean() { + this[isClean] = true + } + + markDirty() { + if (this[isClean]) { + this[isClean] = false + let next = this + while ((next = next.parent)) { + next[isClean] = false + } + } + } + + next() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index + 1] + } + + positionBy(opts) { + let pos = this.source.start + if (opts.index) { + pos = this.positionInside(opts.index) + } else if (opts.word) { + let stringRepresentation = this.source.input.css.slice( + sourceOffset(this.source.input.css, this.source.start), + sourceOffset(this.source.input.css, this.source.end) + ) + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) pos = this.positionInside(index) + } + return pos + } + + positionInside(index) { + let column = this.source.start.column + let line = this.source.start.line + let offset = sourceOffset(this.source.input.css, this.source.start) + let end = offset + index + + for (let i = offset; i < end; i++) { + if (this.source.input.css[i] === '\n') { + column = 1 + line += 1 + } else { + column += 1 + } + } + + return { column, line } + } + + prev() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index - 1] + } + + rangeBy(opts) { + let start = { + column: this.source.start.column, + line: this.source.start.line + } + let end = this.source.end + ? { + column: this.source.end.column + 1, + line: this.source.end.line + } + : { + column: start.column + 1, + line: start.line + } + + if (opts.word) { + let stringRepresentation = this.source.input.css.slice( + sourceOffset(this.source.input.css, this.source.start), + sourceOffset(this.source.input.css, this.source.end) + ) + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) { + start = this.positionInside(index) + end = this.positionInside( + index + opts.word.length, + ) + } + } else { + if (opts.start) { + start = { + column: opts.start.column, + line: opts.start.line + } + } else if (opts.index) { + start = this.positionInside(opts.index) + } + + if (opts.end) { + end = { + column: opts.end.column, + line: opts.end.line + } + } else if (typeof opts.endIndex === 'number') { + end = this.positionInside(opts.endIndex) + } else if (opts.index) { + end = this.positionInside(opts.index + 1) + } + } + + if ( + end.line < start.line || + (end.line === start.line && end.column <= start.column) + ) { + end = { column: start.column + 1, line: start.line } + } + + return { end, start } + } + + raw(prop, defaultType) { + let str = new Stringifier() + return str.raw(this, prop, defaultType) + } + + remove() { + if (this.parent) { + this.parent.removeChild(this) + } + this.parent = undefined + return this + } + + replaceWith(...nodes) { + if (this.parent) { + let bookmark = this + let foundSelf = false + for (let node of nodes) { + if (node === this) { + foundSelf = true + } else if (foundSelf) { + this.parent.insertAfter(bookmark, node) + bookmark = node + } else { + this.parent.insertBefore(bookmark, node) + } + } + + if (!foundSelf) { + this.remove() + } + } + + return this + } + + root() { + let result = this + while (result.parent && result.parent.type !== 'document') { + result = result.parent + } + return result + } + + toJSON(_, inputs) { + let fixed = {} + let emitInputs = inputs == null + inputs = inputs || new Map() + let inputsNextIndex = 0 + + for (let name in this) { + if (!Object.prototype.hasOwnProperty.call(this, name)) { + /* c8 ignore next 2 */ + continue + } + if (name === 'parent' || name === 'proxyCache') continue + let value = this[name] + + if (Array.isArray(value)) { + fixed[name] = value.map(i => { + if (typeof i === 'object' && i.toJSON) { + return i.toJSON(null, inputs) + } else { + return i + } + }) + } else if (typeof value === 'object' && value.toJSON) { + fixed[name] = value.toJSON(null, inputs) + } else if (name === 'source') { + let inputId = inputs.get(value.input) + if (inputId == null) { + inputId = inputsNextIndex + inputs.set(value.input, inputsNextIndex) + inputsNextIndex++ + } + fixed[name] = { + end: value.end, + inputId, + start: value.start + } + } else { + fixed[name] = value + } + } + + if (emitInputs) { + fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) + } + + return fixed + } + + toProxy() { + if (!this.proxyCache) { + this.proxyCache = new Proxy(this, this.getProxyProcessor()) + } + return this.proxyCache + } + + toString(stringifier = stringify) { + if (stringifier.stringify) stringifier = stringifier.stringify + let result = '' + stringifier(this, i => { + result += i + }) + return result + } + + warn(result, text, opts) { + let data = { node: this } + for (let i in opts) data[i] = opts[i] + return result.warn(text, data) + } + + get proxyOf() { + return this + } +} + +module.exports = Node +Node.default = Node diff --git a/seller_1/node_modules/postcss/lib/parse.d.ts b/seller_1/node_modules/postcss/lib/parse.d.ts new file mode 100644 index 0000000..4c943a4 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/parse.d.ts @@ -0,0 +1,9 @@ +import { Parser } from './postcss.js' + +interface Parse extends Parser { + default: Parse +} + +declare const parse: Parse + +export = parse diff --git a/seller_1/node_modules/postcss/lib/parse.js b/seller_1/node_modules/postcss/lib/parse.js new file mode 100644 index 0000000..00a1037 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/parse.js @@ -0,0 +1,42 @@ +'use strict' + +let Container = require('./container') +let Input = require('./input') +let Parser = require('./parser') + +function parse(css, opts) { + let input = new Input(css, opts) + let parser = new Parser(input) + try { + parser.parse() + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + if (e.name === 'CssSyntaxError' && opts && opts.from) { + if (/\.scss$/i.test(opts.from)) { + e.message += + '\nYou tried to parse SCSS with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-scss parser' + } else if (/\.sass/i.test(opts.from)) { + e.message += + '\nYou tried to parse Sass with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-sass parser' + } else if (/\.less$/i.test(opts.from)) { + e.message += + '\nYou tried to parse Less with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-less parser' + } + } + } + throw e + } + + return parser.root +} + +module.exports = parse +parse.default = parse + +Container.registerParse(parse) diff --git a/seller_1/node_modules/postcss/lib/parser.js b/seller_1/node_modules/postcss/lib/parser.js new file mode 100644 index 0000000..8a04411 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/parser.js @@ -0,0 +1,609 @@ +'use strict' + +let AtRule = require('./at-rule') +let Comment = require('./comment') +let Declaration = require('./declaration') +let Root = require('./root') +let Rule = require('./rule') +let tokenizer = require('./tokenize') + +const SAFE_COMMENT_NEIGHBOR = { + empty: true, + space: true +} + +function findLastWithPosition(tokens) { + for (let i = tokens.length - 1; i >= 0; i--) { + let token = tokens[i] + let pos = token[3] || token[2] + if (pos) return pos + } +} + +class Parser { + constructor(input) { + this.input = input + + this.root = new Root() + this.current = this.root + this.spaces = '' + this.semicolon = false + + this.createTokenizer() + this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } + } + + atrule(token) { + let node = new AtRule() + node.name = token[1].slice(1) + if (node.name === '') { + this.unnamedAtrule(node, token) + } + this.init(node, token[2]) + + let type + let prev + let shift + let last = false + let open = false + let params = [] + let brackets = [] + + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + type = token[0] + + if (type === '(' || type === '[') { + brackets.push(type === '(' ? ')' : ']') + } else if (type === '{' && brackets.length > 0) { + brackets.push('}') + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + } + + if (brackets.length === 0) { + if (type === ';') { + node.source.end = this.getPosition(token[2]) + node.source.end.offset++ + this.semicolon = true + break + } else if (type === '{') { + open = true + break + } else if (type === '}') { + if (params.length > 0) { + shift = params.length - 1 + prev = params[shift] + while (prev && prev[0] === 'space') { + prev = params[--shift] + } + if (prev) { + node.source.end = this.getPosition(prev[3] || prev[2]) + node.source.end.offset++ + } + } + this.end(token) + break + } else { + params.push(token) + } + } else { + params.push(token) + } + + if (this.tokenizer.endOfFile()) { + last = true + break + } + } + + node.raws.between = this.spacesAndCommentsFromEnd(params) + if (params.length) { + node.raws.afterName = this.spacesAndCommentsFromStart(params) + this.raw(node, 'params', params) + if (last) { + token = params[params.length - 1] + node.source.end = this.getPosition(token[3] || token[2]) + node.source.end.offset++ + this.spaces = node.raws.between + node.raws.between = '' + } + } else { + node.raws.afterName = '' + node.params = '' + } + + if (open) { + node.nodes = [] + this.current = node + } + } + + checkMissedSemicolon(tokens) { + let colon = this.colon(tokens) + if (colon === false) return + + let founded = 0 + let token + for (let j = colon - 1; j >= 0; j--) { + token = tokens[j] + if (token[0] !== 'space') { + founded += 1 + if (founded === 2) break + } + } + // If the token is a word, e.g. `!important`, `red` or any other valid property's value. + // Then we need to return the colon after that word token. [3] is the "end" colon of that word. + // And because we need it after that one we do +1 to get the next one. + throw this.input.error( + 'Missed semicolon', + token[0] === 'word' ? token[3] + 1 : token[2] + ) + } + + colon(tokens) { + let brackets = 0 + let prev, token, type + for (let [i, element] of tokens.entries()) { + token = element + type = token[0] + + if (type === '(') { + brackets += 1 + } + if (type === ')') { + brackets -= 1 + } + if (brackets === 0 && type === ':') { + if (!prev) { + this.doubleColon(token) + } else if (prev[0] === 'word' && prev[1] === 'progid') { + continue + } else { + return i + } + } + + prev = token + } + return false + } + + comment(token) { + let node = new Comment() + this.init(node, token[2]) + node.source.end = this.getPosition(token[3] || token[2]) + node.source.end.offset++ + + let text = token[1].slice(2, -2) + if (/^\s*$/.test(text)) { + node.text = '' + node.raws.left = text + node.raws.right = '' + } else { + let match = text.match(/^(\s*)([^]*\S)(\s*)$/) + node.text = match[2] + node.raws.left = match[1] + node.raws.right = match[3] + } + } + + createTokenizer() { + this.tokenizer = tokenizer(this.input) + } + + decl(tokens, customProperty) { + let node = new Declaration() + this.init(node, tokens[0][2]) + + let last = tokens[tokens.length - 1] + if (last[0] === ';') { + this.semicolon = true + tokens.pop() + } + + node.source.end = this.getPosition( + last[3] || last[2] || findLastWithPosition(tokens) + ) + node.source.end.offset++ + + while (tokens[0][0] !== 'word') { + if (tokens.length === 1) this.unknownWord(tokens) + node.raws.before += tokens.shift()[1] + } + node.source.start = this.getPosition(tokens[0][2]) + + node.prop = '' + while (tokens.length) { + let type = tokens[0][0] + if (type === ':' || type === 'space' || type === 'comment') { + break + } + node.prop += tokens.shift()[1] + } + + node.raws.between = '' + + let token + while (tokens.length) { + token = tokens.shift() + + if (token[0] === ':') { + node.raws.between += token[1] + break + } else { + if (token[0] === 'word' && /\w/.test(token[1])) { + this.unknownWord([token]) + } + node.raws.between += token[1] + } + } + + if (node.prop[0] === '_' || node.prop[0] === '*') { + node.raws.before += node.prop[0] + node.prop = node.prop.slice(1) + } + + let firstSpaces = [] + let next + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + firstSpaces.push(tokens.shift()) + } + + this.precheckMissedSemicolon(tokens) + + for (let i = tokens.length - 1; i >= 0; i--) { + token = tokens[i] + if (token[1].toLowerCase() === '!important') { + node.important = true + let string = this.stringFrom(tokens, i) + string = this.spacesFromEnd(tokens) + string + if (string !== ' !important') node.raws.important = string + break + } else if (token[1].toLowerCase() === 'important') { + let cache = tokens.slice(0) + let str = '' + for (let j = i; j > 0; j--) { + let type = cache[j][0] + if (str.trim().startsWith('!') && type !== 'space') { + break + } + str = cache.pop()[1] + str + } + if (str.trim().startsWith('!')) { + node.important = true + node.raws.important = str + tokens = cache + } + } + + if (token[0] !== 'space' && token[0] !== 'comment') { + break + } + } + + let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') + + if (hasWord) { + node.raws.between += firstSpaces.map(i => i[1]).join('') + firstSpaces = [] + } + this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) + + if (node.value.includes(':') && !customProperty) { + this.checkMissedSemicolon(tokens) + } + } + + doubleColon(token) { + throw this.input.error( + 'Double colon', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } + + emptyRule(token) { + let node = new Rule() + this.init(node, token[2]) + node.selector = '' + node.raws.between = '' + this.current = node + } + + end(token) { + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.semicolon = false + + this.current.raws.after = (this.current.raws.after || '') + this.spaces + this.spaces = '' + + if (this.current.parent) { + this.current.source.end = this.getPosition(token[2]) + this.current.source.end.offset++ + this.current = this.current.parent + } else { + this.unexpectedClose(token) + } + } + + endFile() { + if (this.current.parent) this.unclosedBlock() + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.current.raws.after = (this.current.raws.after || '') + this.spaces + this.root.source.end = this.getPosition(this.tokenizer.position()) + } + + freeSemicolon(token) { + this.spaces += token[1] + if (this.current.nodes) { + let prev = this.current.nodes[this.current.nodes.length - 1] + if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { + prev.raws.ownSemicolon = this.spaces + this.spaces = '' + } + } + } + + // Helpers + + getPosition(offset) { + let pos = this.input.fromOffset(offset) + return { + column: pos.col, + line: pos.line, + offset + } + } + + init(node, offset) { + this.current.push(node) + node.source = { + input: this.input, + start: this.getPosition(offset) + } + node.raws.before = this.spaces + this.spaces = '' + if (node.type !== 'comment') this.semicolon = false + } + + other(start) { + let end = false + let type = null + let colon = false + let bracket = null + let brackets = [] + let customProperty = start[1].startsWith('--') + + let tokens = [] + let token = start + while (token) { + type = token[0] + tokens.push(token) + + if (type === '(' || type === '[') { + if (!bracket) bracket = token + brackets.push(type === '(' ? ')' : ']') + } else if (customProperty && colon && type === '{') { + if (!bracket) bracket = token + brackets.push('}') + } else if (brackets.length === 0) { + if (type === ';') { + if (colon) { + this.decl(tokens, customProperty) + return + } else { + break + } + } else if (type === '{') { + this.rule(tokens) + return + } else if (type === '}') { + this.tokenizer.back(tokens.pop()) + end = true + break + } else if (type === ':') { + colon = true + } + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + if (brackets.length === 0) bracket = null + } + + token = this.tokenizer.nextToken() + } + + if (this.tokenizer.endOfFile()) end = true + if (brackets.length > 0) this.unclosedBracket(bracket) + + if (end && colon) { + if (!customProperty) { + while (tokens.length) { + token = tokens[tokens.length - 1][0] + if (token !== 'space' && token !== 'comment') break + this.tokenizer.back(tokens.pop()) + } + } + this.decl(tokens, customProperty) + } else { + this.unknownWord(tokens) + } + } + + parse() { + let token + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + + switch (token[0]) { + case 'space': + this.spaces += token[1] + break + + case ';': + this.freeSemicolon(token) + break + + case '}': + this.end(token) + break + + case 'comment': + this.comment(token) + break + + case 'at-word': + this.atrule(token) + break + + case '{': + this.emptyRule(token) + break + + default: + this.other(token) + break + } + } + this.endFile() + } + + precheckMissedSemicolon(/* tokens */) { + // Hook for Safe Parser + } + + raw(node, prop, tokens, customProperty) { + let token, type + let length = tokens.length + let value = '' + let clean = true + let next, prev + + for (let i = 0; i < length; i += 1) { + token = tokens[i] + type = token[0] + if (type === 'space' && i === length - 1 && !customProperty) { + clean = false + } else if (type === 'comment') { + prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' + next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' + if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { + if (value.slice(-1) === ',') { + clean = false + } else { + value += token[1] + } + } else { + clean = false + } + } else { + value += token[1] + } + } + if (!clean) { + let raw = tokens.reduce((all, i) => all + i[1], '') + node.raws[prop] = { raw, value } + } + node[prop] = value + } + + rule(tokens) { + tokens.pop() + + let node = new Rule() + this.init(node, tokens[0][2]) + + node.raws.between = this.spacesAndCommentsFromEnd(tokens) + this.raw(node, 'selector', tokens) + this.current = node + } + + spacesAndCommentsFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space' && lastTokenType !== 'comment') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + // Errors + + spacesAndCommentsFromStart(tokens) { + let next + let spaces = '' + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + spaces += tokens.shift()[1] + } + return spaces + } + + spacesFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + stringFrom(tokens, from) { + let result = '' + for (let i = from; i < tokens.length; i++) { + result += tokens[i][1] + } + tokens.splice(from, tokens.length - from) + return result + } + + unclosedBlock() { + let pos = this.current.source.start + throw this.input.error('Unclosed block', pos.line, pos.column) + } + + unclosedBracket(bracket) { + throw this.input.error( + 'Unclosed bracket', + { offset: bracket[2] }, + { offset: bracket[2] + 1 } + ) + } + + unexpectedClose(token) { + throw this.input.error( + 'Unexpected }', + { offset: token[2] }, + { offset: token[2] + 1 } + ) + } + + unknownWord(tokens) { + throw this.input.error( + 'Unknown word', + { offset: tokens[0][2] }, + { offset: tokens[0][2] + tokens[0][1].length } + ) + } + + unnamedAtrule(node, token) { + throw this.input.error( + 'At-rule without name', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } +} + +module.exports = Parser diff --git a/seller_1/node_modules/postcss/lib/postcss.d.mts b/seller_1/node_modules/postcss/lib/postcss.d.mts new file mode 100644 index 0000000..4cf5b49 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/postcss.d.mts @@ -0,0 +1,69 @@ +export { + // postcss function / namespace + default, + + // Value exports from postcss.mjs + stringify, + fromJSON, + // @ts-expect-error This value exists, but it’s untyped. + plugin, + parse, + list, + document, + comment, + atRule, + rule, + decl, + root, + CssSyntaxError, + Declaration, + Container, + Processor, + Document, + Comment, + Warning, + AtRule, + Result, + Input, + Rule, + Root, + Node, + + // Type-only exports + AcceptedPlugin, + AnyNode, + AtRuleProps, + Builder, + ChildNode, + ChildProps, + CommentProps, + ContainerProps, + DeclarationProps, + DocumentProps, + FilePosition, + Helpers, + JSONHydrator, + Message, + NodeErrorOptions, + NodeProps, + OldPlugin, + Parser, + Plugin, + PluginCreator, + Position, + Postcss, + ProcessOptions, + RootProps, + RuleProps, + Source, + SourceMap, + SourceMapOptions, + Stringifier, + Syntax, + TransformCallback, + Transformer, + WarningOptions, + + // This is a class, but it’s not re-exported. That’s why it’s exported as type-only here. + type LazyResult +} from './postcss.js' diff --git a/seller_1/node_modules/postcss/lib/postcss.d.ts b/seller_1/node_modules/postcss/lib/postcss.d.ts new file mode 100644 index 0000000..d0b8b53 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/postcss.d.ts @@ -0,0 +1,453 @@ +import { RawSourceMap, SourceMapGenerator } from 'source-map-js' + +import AtRule, { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container, { ContainerProps, NewChild } from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document, { DocumentProps } from './document.js' +import Input, { FilePosition } from './input.js' +import LazyResult from './lazy-result.js' +import list from './list.js' +import Node, { + AnyNode, + ChildNode, + ChildProps, + NodeErrorOptions, + NodeProps, + Position, + Source +} from './node.js' +import Processor from './processor.js' +import Result, { Message } from './result.js' +import Root, { RootProps } from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +type DocumentProcessor = ( + document: Document, + helper: postcss.Helpers +) => Promise<void> | void +type RootProcessor = ( + root: Root, + helper: postcss.Helpers +) => Promise<void> | void +type DeclarationProcessor = ( + decl: Declaration, + helper: postcss.Helpers +) => Promise<void> | void +type RuleProcessor = ( + rule: Rule, + helper: postcss.Helpers +) => Promise<void> | void +type AtRuleProcessor = ( + atRule: AtRule, + helper: postcss.Helpers +) => Promise<void> | void +type CommentProcessor = ( + comment: Comment, + helper: postcss.Helpers +) => Promise<void> | void + +interface Processors { + /** + * Will be called on all`AtRule` nodes. + * + * Will be called again on node or children changes. + */ + AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `AtRule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `Comment` nodes. + * + * Will be called again on node or children changes. + */ + Comment?: CommentProcessor + + /** + * Will be called on all `Comment` nodes after listeners + * for `Comment` event. + * + * Will be called again on node or children changes. + */ + CommentExit?: CommentProcessor + + /** + * Will be called on all `Declaration` nodes after listeners + * for `Declaration` event. + * + * Will be called again on node or children changes. + */ + Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor + + /** + * Will be called on all `Declaration` nodes. + * + * Will be called again on node or children changes. + */ + DeclarationExit?: + | { [prop: string]: DeclarationProcessor } + | DeclarationProcessor + + /** + * Will be called on `Document` node. + * + * Will be called again on children changes. + */ + Document?: DocumentProcessor + + /** + * Will be called on `Document` node, when all children will be processed. + * + * Will be called again on children changes. + */ + DocumentExit?: DocumentProcessor + + /** + * Will be called on `Root` node once. + */ + Once?: RootProcessor + + /** + * Will be called on `Root` node once, when all children will be processed. + */ + OnceExit?: RootProcessor + + /** + * Will be called on `Root` node. + * + * Will be called again on children changes. + */ + Root?: RootProcessor + + /** + * Will be called on `Root` node, when all children will be processed. + * + * Will be called again on children changes. + */ + RootExit?: RootProcessor + + /** + * Will be called on all `Rule` nodes. + * + * Will be called again on node or children changes. + */ + Rule?: RuleProcessor + + /** + * Will be called on all `Rule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + RuleExit?: RuleProcessor +} + +declare namespace postcss { + export { + AnyNode, + AtRule, + AtRuleProps, + ChildNode, + ChildProps, + Comment, + CommentProps, + Container, + ContainerProps, + CssSyntaxError, + Declaration, + DeclarationProps, + Document, + DocumentProps, + FilePosition, + Input, + LazyResult, + list, + Message, + NewChild, + Node, + NodeErrorOptions, + NodeProps, + Position, + Processor, + Result, + Root, + RootProps, + Rule, + RuleProps, + Source, + Warning, + WarningOptions + } + + export type SourceMap = { + toJSON(): RawSourceMap + } & SourceMapGenerator + + export type Helpers = { postcss: Postcss; result: Result } & Postcss + + export interface Plugin extends Processors { + postcssPlugin: string + prepare?: (result: Result) => Processors + } + + export interface PluginCreator<PluginOptions> { + (opts?: PluginOptions): Plugin | Processor + postcss: true + } + + export interface Transformer extends TransformCallback { + postcssPlugin: string + postcssVersion: string + } + + export interface TransformCallback { + (root: Root, result: Result): Promise<void> | void + } + + export interface OldPlugin<T> extends Transformer { + (opts?: T): Transformer + postcss: Transformer + } + + export type AcceptedPlugin = + | { + postcss: Processor | TransformCallback + } + | OldPlugin<any> + | Plugin + | PluginCreator<any> + | Processor + | TransformCallback + + export interface Parser<RootNode = Document | Root> { + ( + css: { toString(): string } | string, + opts?: Pick<ProcessOptions, 'from' | 'map'> + ): RootNode + } + + export interface Builder { + (part: string, node?: AnyNode, type?: 'end' | 'start'): void + } + + export interface Stringifier { + (node: AnyNode, builder: Builder): void + } + + export interface JSONHydrator { + (data: object): Node + (data: object[]): Node[] + } + + export interface Syntax<RootNode = Document | Root> { + /** + * Function to generate AST by string. + */ + parse?: Parser<RootNode> + + /** + * Class to generate string by AST. + */ + stringify?: Stringifier + } + + export interface SourceMapOptions { + /** + * Use absolute path in generated source map. + */ + absolute?: boolean + + /** + * Indicates that PostCSS should add annotation comments to the CSS. + * By default, PostCSS will always add a comment with a path + * to the source map. PostCSS will not add annotations to CSS files + * that do not contain any comments. + * + * By default, PostCSS presumes that you want to save the source map as + * `opts.to + '.map'` and will use this path in the annotation comment. + * A different path can be set by providing a string value for annotation. + * + * If you have set `inline: true`, annotation cannot be disabled. + */ + annotation?: ((file: string, root: Root) => string) | boolean | string + + /** + * Override `from` in map’s sources. + */ + from?: string + + /** + * Indicates that the source map should be embedded in the output CSS + * as a Base64-encoded comment. By default, it is `true`. + * But if all previous maps are external, not inline, PostCSS will not embed + * the map even if you do not set this option. + * + * If you have an inline source map, the result.map property will be empty, + * as the source map will be contained within the text of `result.css`. + */ + inline?: boolean + + /** + * Source map content from a previous processing step (e.g., Sass). + * + * PostCSS will try to read the previous source map + * automatically (based on comments within the source CSS), but you can use + * this option to identify it manually. + * + * If desired, you can omit the previous map with prev: `false`. + */ + prev?: ((file: string) => string) | boolean | object | string + + /** + * Indicates that PostCSS should set the origin content (e.g., Sass source) + * of the source map. By default, it is true. But if all previous maps do not + * contain sources content, PostCSS will also leave it out even if you + * do not set this option. + */ + sourcesContent?: boolean + } + + export interface ProcessOptions<RootNode = Document | Root> { + /** + * The path of the CSS source file. You should always set `from`, + * because it is used in source map generation and syntax error messages. + */ + from?: string | undefined + + /** + * Source map options + */ + map?: boolean | SourceMapOptions + + /** + * Function to generate AST by string. + */ + parser?: Parser<RootNode> | Syntax<RootNode> + + /** + * Class to generate string by AST. + */ + stringifier?: Stringifier | Syntax<RootNode> + + /** + * Object with parse and stringify. + */ + syntax?: Syntax<RootNode> + + /** + * The path where you'll put the output CSS file. You should always set `to` + * to generate correct source maps. + */ + to?: string + } + + export type Postcss = typeof postcss + + /** + * Default function to convert a node tree into a CSS string. + */ + export let stringify: Stringifier + + /** + * Parses source css and returns a new `Root` or `Document` node, + * which contains the source CSS nodes. + * + * ```js + * // Simple CSS concatenation with source map support + * const root1 = postcss.parse(css1, { from: file1 }) + * const root2 = postcss.parse(css2, { from: file2 }) + * root1.append(root2).toResult().css + * ``` + */ + export let parse: Parser<Root> + + /** + * Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes. + * + * ```js + * const json = root.toJSON() + * // save to file, send by network, etc + * const root2 = postcss.fromJSON(json) + * ``` + */ + export let fromJSON: JSONHydrator + + /** + * Creates a new `Comment` node. + * + * @param defaults Properties for the new node. + * @return New comment node + */ + export function comment(defaults?: CommentProps): Comment + + /** + * Creates a new `AtRule` node. + * + * @param defaults Properties for the new node. + * @return New at-rule node. + */ + export function atRule(defaults?: AtRuleProps): AtRule + + /** + * Creates a new `Declaration` node. + * + * @param defaults Properties for the new node. + * @return New declaration node. + */ + export function decl(defaults?: DeclarationProps): Declaration + + /** + * Creates a new `Rule` node. + * + * @param default Properties for the new node. + * @return New rule node. + */ + export function rule(defaults?: RuleProps): Rule + + /** + * Creates a new `Root` node. + * + * @param defaults Properties for the new node. + * @return New root node. + */ + export function root(defaults?: RootProps): Root + + /** + * Creates a new `Document` node. + * + * @param defaults Properties for the new node. + * @return New document node. + */ + export function document(defaults?: DocumentProps): Document + + export { postcss as default } +} + +/** + * Create a new `Processor` instance that will apply `plugins` + * as CSS processors. + * + * ```js + * let postcss = require('postcss') + * + * postcss(plugins).process(css, { from, to }).then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param plugins PostCSS plugins. + * @return Processor to process multiple CSS. + */ +declare function postcss( + plugins?: readonly postcss.AcceptedPlugin[] +): Processor +declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor + +export = postcss diff --git a/seller_1/node_modules/postcss/lib/postcss.js b/seller_1/node_modules/postcss/lib/postcss.js new file mode 100644 index 0000000..8f0773b --- /dev/null +++ b/seller_1/node_modules/postcss/lib/postcss.js @@ -0,0 +1,101 @@ +'use strict' + +let AtRule = require('./at-rule') +let Comment = require('./comment') +let Container = require('./container') +let CssSyntaxError = require('./css-syntax-error') +let Declaration = require('./declaration') +let Document = require('./document') +let fromJSON = require('./fromJSON') +let Input = require('./input') +let LazyResult = require('./lazy-result') +let list = require('./list') +let Node = require('./node') +let parse = require('./parse') +let Processor = require('./processor') +let Result = require('./result.js') +let Root = require('./root') +let Rule = require('./rule') +let stringify = require('./stringify') +let Warning = require('./warning') + +function postcss(...plugins) { + if (plugins.length === 1 && Array.isArray(plugins[0])) { + plugins = plugins[0] + } + return new Processor(plugins) +} + +postcss.plugin = function plugin(name, initializer) { + let warningPrinted = false + function creator(...args) { + // eslint-disable-next-line no-console + if (console && console.warn && !warningPrinted) { + warningPrinted = true + // eslint-disable-next-line no-console + console.warn( + name + + ': postcss.plugin was deprecated. Migration guide:\n' + + 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' + ) + if (process.env.LANG && process.env.LANG.startsWith('cn')) { + /* c8 ignore next 7 */ + // eslint-disable-next-line no-console + console.warn( + name + + ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + + 'https://www.w3ctech.com/topic/2226' + ) + } + } + let transformer = initializer(...args) + transformer.postcssPlugin = name + transformer.postcssVersion = new Processor().version + return transformer + } + + let cache + Object.defineProperty(creator, 'postcss', { + get() { + if (!cache) cache = creator() + return cache + } + }) + + creator.process = function (css, processOpts, pluginOpts) { + return postcss([creator(pluginOpts)]).process(css, processOpts) + } + + return creator +} + +postcss.stringify = stringify +postcss.parse = parse +postcss.fromJSON = fromJSON +postcss.list = list + +postcss.comment = defaults => new Comment(defaults) +postcss.atRule = defaults => new AtRule(defaults) +postcss.decl = defaults => new Declaration(defaults) +postcss.rule = defaults => new Rule(defaults) +postcss.root = defaults => new Root(defaults) +postcss.document = defaults => new Document(defaults) + +postcss.CssSyntaxError = CssSyntaxError +postcss.Declaration = Declaration +postcss.Container = Container +postcss.Processor = Processor +postcss.Document = Document +postcss.Comment = Comment +postcss.Warning = Warning +postcss.AtRule = AtRule +postcss.Result = Result +postcss.Input = Input +postcss.Rule = Rule +postcss.Root = Root +postcss.Node = Node + +LazyResult.registerPostcss(postcss) + +module.exports = postcss +postcss.default = postcss diff --git a/seller_1/node_modules/postcss/lib/postcss.mjs b/seller_1/node_modules/postcss/lib/postcss.mjs new file mode 100644 index 0000000..3507598 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/postcss.mjs @@ -0,0 +1,30 @@ +import postcss from './postcss.js' + +export default postcss + +export const stringify = postcss.stringify +export const fromJSON = postcss.fromJSON +export const plugin = postcss.plugin +export const parse = postcss.parse +export const list = postcss.list + +export const document = postcss.document +export const comment = postcss.comment +export const atRule = postcss.atRule +export const rule = postcss.rule +export const decl = postcss.decl +export const root = postcss.root + +export const CssSyntaxError = postcss.CssSyntaxError +export const Declaration = postcss.Declaration +export const Container = postcss.Container +export const Processor = postcss.Processor +export const Document = postcss.Document +export const Comment = postcss.Comment +export const Warning = postcss.Warning +export const AtRule = postcss.AtRule +export const Result = postcss.Result +export const Input = postcss.Input +export const Rule = postcss.Rule +export const Root = postcss.Root +export const Node = postcss.Node diff --git a/seller_1/node_modules/postcss/lib/previous-map.d.ts b/seller_1/node_modules/postcss/lib/previous-map.d.ts new file mode 100644 index 0000000..23edeb5 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/previous-map.d.ts @@ -0,0 +1,81 @@ +import { SourceMapConsumer } from 'source-map-js' + +import { ProcessOptions } from './postcss.js' + +declare namespace PreviousMap { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { PreviousMap_ as default } +} + +/** + * Source map information from input CSS. + * For example, source map after Sass compiler. + * + * This class will automatically find source map in input CSS or in file system + * near input file (according `from` option). + * + * ```js + * const root = parse(css, { from: 'a.sass.css' }) + * root.input.map //=> PreviousMap + * ``` + */ +declare class PreviousMap_ { + /** + * `sourceMappingURL` content. + */ + annotation?: string + + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + */ + file?: string + + /** + * Was source map inlined by data-uri to input CSS. + */ + inline: boolean + + /** + * Path to source map file. + */ + mapFile?: string + + /** + * The directory with source map file, if source map is in separated file. + */ + root?: string + + /** + * Source map file content. + */ + text?: string + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + /** + * Create a instance of `SourceMapGenerator` class + * from the `source-map` library to work with source map information. + * + * It is lazy method, so it will create object only on first call + * and then it will use cache. + * + * @return Object with source map information. + */ + consumer(): SourceMapConsumer + + /** + * Does source map contains `sourcesContent` with input source text. + * + * @return Is `sourcesContent` present. + */ + withContent(): boolean +} + +declare class PreviousMap extends PreviousMap_ {} + +export = PreviousMap diff --git a/seller_1/node_modules/postcss/lib/previous-map.js b/seller_1/node_modules/postcss/lib/previous-map.js new file mode 100644 index 0000000..b123dcd --- /dev/null +++ b/seller_1/node_modules/postcss/lib/previous-map.js @@ -0,0 +1,144 @@ +'use strict' + +let { existsSync, readFileSync } = require('fs') +let { dirname, join } = require('path') +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') + +function fromBase64(str) { + if (Buffer) { + return Buffer.from(str, 'base64').toString() + } else { + /* c8 ignore next 2 */ + return window.atob(str) + } +} + +class PreviousMap { + constructor(css, opts) { + if (opts.map === false) return + this.loadAnnotation(css) + this.inline = this.startWith(this.annotation, 'data:') + + let prev = opts.map ? opts.map.prev : undefined + let text = this.loadMap(opts.from, prev) + if (!this.mapFile && opts.from) { + this.mapFile = opts.from + } + if (this.mapFile) this.root = dirname(this.mapFile) + if (text) this.text = text + } + + consumer() { + if (!this.consumerCache) { + this.consumerCache = new SourceMapConsumer(this.text) + } + return this.consumerCache + } + + decodeInline(text) { + let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ + let baseUri = /^data:application\/json;base64,/ + let charsetUri = /^data:application\/json;charset=utf-?8,/ + let uri = /^data:application\/json,/ + + let uriMatch = text.match(charsetUri) || text.match(uri) + if (uriMatch) { + return decodeURIComponent(text.substr(uriMatch[0].length)) + } + + let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri) + if (baseUriMatch) { + return fromBase64(text.substr(baseUriMatch[0].length)) + } + + let encoding = text.match(/data:application\/json;([^,]+),/)[1] + throw new Error('Unsupported source map encoding ' + encoding) + } + + getAnnotationURL(sourceMapString) { + return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() + } + + isMap(map) { + if (typeof map !== 'object') return false + return ( + typeof map.mappings === 'string' || + typeof map._mappings === 'string' || + Array.isArray(map.sections) + ) + } + + loadAnnotation(css) { + let comments = css.match(/\/\*\s*# sourceMappingURL=/g) + if (!comments) return + + // sourceMappingURLs from comments, strings, etc. + let start = css.lastIndexOf(comments.pop()) + let end = css.indexOf('*/', start) + + if (start > -1 && end > -1) { + // Locate the last sourceMappingURL to avoid pickin + this.annotation = this.getAnnotationURL(css.substring(start, end)) + } + } + + loadFile(path) { + this.root = dirname(path) + if (existsSync(path)) { + this.mapFile = path + return readFileSync(path, 'utf-8').toString().trim() + } + } + + loadMap(file, prev) { + if (prev === false) return false + + if (prev) { + if (typeof prev === 'string') { + return prev + } else if (typeof prev === 'function') { + let prevPath = prev(file) + if (prevPath) { + let map = this.loadFile(prevPath) + if (!map) { + throw new Error( + 'Unable to load previous source map: ' + prevPath.toString() + ) + } + return map + } + } else if (prev instanceof SourceMapConsumer) { + return SourceMapGenerator.fromSourceMap(prev).toString() + } else if (prev instanceof SourceMapGenerator) { + return prev.toString() + } else if (this.isMap(prev)) { + return JSON.stringify(prev) + } else { + throw new Error( + 'Unsupported previous source map format: ' + prev.toString() + ) + } + } else if (this.inline) { + return this.decodeInline(this.annotation) + } else if (this.annotation) { + let map = this.annotation + if (file) map = join(dirname(file), map) + return this.loadFile(map) + } + } + + startWith(string, start) { + if (!string) return false + return string.substr(0, start.length) === start + } + + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ) + } +} + +module.exports = PreviousMap +PreviousMap.default = PreviousMap diff --git a/seller_1/node_modules/postcss/lib/processor.d.ts b/seller_1/node_modules/postcss/lib/processor.d.ts new file mode 100644 index 0000000..aa2942c --- /dev/null +++ b/seller_1/node_modules/postcss/lib/processor.d.ts @@ -0,0 +1,115 @@ +import Document from './document.js' +import LazyResult from './lazy-result.js' +import NoWorkResult from './no-work-result.js' +import { + AcceptedPlugin, + Plugin, + ProcessOptions, + TransformCallback, + Transformer +} from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Processor { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Processor_ as default } +} + +/** + * Contains plugins to process CSS. Create one `Processor` instance, + * initialize its plugins, and then use that instance on numerous CSS files. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.process(css1).then(result => console.log(result.css)) + * processor.process(css2).then(result => console.log(result.css)) + * ``` + */ +declare class Processor_ { + /** + * Plugins added to this processor. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.plugins.length //=> 2 + * ``` + */ + plugins: (Plugin | TransformCallback | Transformer)[] + + /** + * Current PostCSS version. + * + * ```js + * if (result.processor.version.split('.')[0] !== '6') { + * throw new Error('This plugin works only with PostCSS 6') + * } + * ``` + */ + version: string + + /** + * @param plugins PostCSS plugins + */ + constructor(plugins?: readonly AcceptedPlugin[]) + + /** + * Parses source CSS and returns a `LazyResult` Promise proxy. + * Because some plugins can be asynchronous it doesn’t make + * any transformations. Transformations will be applied + * in the `LazyResult` methods. + * + * ```js + * processor.process(css, { from: 'a.css', to: 'a.out.css' }) + * .then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param css String with input CSS or any object with a `toString()` method, + * like a Buffer. Optionally, send a `Result` instance + * and the processor will take the `Root` from it. + * @param opts Options. + * @return Promise proxy. + */ + process( + css: { toString(): string } | LazyResult | Result | Root | string + ): LazyResult | NoWorkResult + process<RootNode extends Document | Root = Root>( + css: { toString(): string } | LazyResult | Result | Root | string, + options: ProcessOptions<RootNode> + ): LazyResult<RootNode> + + /** + * Adds a plugin to be used as a CSS processor. + * + * PostCSS plugin can be in 4 formats: + * * A plugin in `Plugin` format. + * * A plugin creator function with `pluginCreator.postcss = true`. + * PostCSS will call this function without argument to get plugin. + * * A function. PostCSS will pass the function a {@link Root} + * as the first argument and current `Result` instance + * as the second. + * * Another `Processor` instance. PostCSS will copy plugins + * from that instance into this one. + * + * Plugins can also be added by passing them as arguments when creating + * a `postcss` instance (see [`postcss(plugins)`]). + * + * Asynchronous plugins should return a `Promise` instance. + * + * ```js + * const processor = postcss() + * .use(autoprefixer) + * .use(postcssNested) + * ``` + * + * @param plugin PostCSS plugin or `Processor` with plugins. + * @return Current processor to make methods chain. + */ + use(plugin: AcceptedPlugin): this +} + +declare class Processor extends Processor_ {} + +export = Processor diff --git a/seller_1/node_modules/postcss/lib/processor.js b/seller_1/node_modules/postcss/lib/processor.js new file mode 100644 index 0000000..d6192ab --- /dev/null +++ b/seller_1/node_modules/postcss/lib/processor.js @@ -0,0 +1,67 @@ +'use strict' + +let Document = require('./document') +let LazyResult = require('./lazy-result') +let NoWorkResult = require('./no-work-result') +let Root = require('./root') + +class Processor { + constructor(plugins = []) { + this.version = '8.4.49' + this.plugins = this.normalize(plugins) + } + + normalize(plugins) { + let normalized = [] + for (let i of plugins) { + if (i.postcss === true) { + i = i() + } else if (i.postcss) { + i = i.postcss + } + + if (typeof i === 'object' && Array.isArray(i.plugins)) { + normalized = normalized.concat(i.plugins) + } else if (typeof i === 'object' && i.postcssPlugin) { + normalized.push(i) + } else if (typeof i === 'function') { + normalized.push(i) + } else if (typeof i === 'object' && (i.parse || i.stringify)) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + + 'one of the syntax/parser/stringifier options as outlined ' + + 'in your PostCSS runner documentation.' + ) + } + } else { + throw new Error(i + ' is not a PostCSS plugin') + } + } + return normalized + } + + process(css, opts = {}) { + if ( + !this.plugins.length && + !opts.parser && + !opts.stringifier && + !opts.syntax + ) { + return new NoWorkResult(this, css, opts) + } else { + return new LazyResult(this, css, opts) + } + } + + use(plugin) { + this.plugins = this.plugins.concat(this.normalize([plugin])) + return this + } +} + +module.exports = Processor +Processor.default = Processor + +Root.registerProcessor(Processor) +Document.registerProcessor(Processor) diff --git a/seller_1/node_modules/postcss/lib/result.d.ts b/seller_1/node_modules/postcss/lib/result.d.ts new file mode 100644 index 0000000..40e086f --- /dev/null +++ b/seller_1/node_modules/postcss/lib/result.d.ts @@ -0,0 +1,205 @@ +import { + Document, + Node, + Plugin, + ProcessOptions, + Root, + SourceMap, + TransformCallback, + Warning, + WarningOptions +} from './postcss.js' +import Processor from './processor.js' + +declare namespace Result { + export interface Message { + [others: string]: any + + /** + * Source PostCSS plugin name. + */ + plugin?: string + + /** + * Message type. + */ + type: string + } + + export interface ResultOptions extends ProcessOptions { + /** + * The CSS node that was the source of the warning. + */ + node?: Node + + /** + * Name of plugin that created this warning. `Result#warn` will fill it + * automatically with `Plugin#postcssPlugin` value. + */ + plugin?: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Result_ as default } +} + +/** + * Provides the result of the PostCSS transformations. + * + * A Result instance is returned by `LazyResult#then` + * or `Root#toResult` methods. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }) + * ``` + * + * ```js + * const result2 = postcss.parse(css).toResult() + * ``` + */ +declare class Result_<RootNode = Document | Root> { + /** + * A CSS string representing of `Result#root`. + * + * ```js + * postcss.parse('a{}').toResult().css //=> "a{}" + * ``` + */ + css: string + + /** + * Last runned PostCSS plugin. + */ + lastPlugin: Plugin | TransformCallback + + /** + * An instance of `SourceMapGenerator` class from the `source-map` library, + * representing changes to the `Result#root` instance. + * + * ```js + * result.map.toJSON() //=> { version: 3, file: 'a.css', … } + * ``` + * + * ```js + * if (result.map) { + * fs.writeFileSync(result.opts.to + '.map', result.map.toString()) + * } + * ``` + */ + map: SourceMap + + /** + * Contains messages from plugins (e.g., warnings or custom messages). + * Each message should have type and plugin properties. + * + * ```js + * AtRule: { + * import: (atRule, { result }) { + * const importedFile = parseImport(atRule) + * result.messages.push({ + * type: 'dependency', + * plugin: 'postcss-import', + * file: importedFile, + * parent: result.opts.from + * }) + * } + * } + * ``` + */ + messages: Result.Message[] + + /** + * Options from the `Processor#process` or `Root#toResult` call + * that produced this Result instance.] + * + * ```js + * root.toResult(opts).opts === opts + * ``` + */ + opts: Result.ResultOptions + + /** + * The Processor instance used for this transformation. + * + * ```js + * for (const plugin of result.processor.plugins) { + * if (plugin.postcssPlugin === 'postcss-bad') { + * throw 'postcss-good is incompatible with postcss-bad' + * } + * }) + * ``` + */ + processor: Processor + + /** + * Root node after all transformations. + * + * ```js + * root.toResult().root === root + * ``` + */ + root: RootNode + + /** + * @param processor Processor used for this transformation. + * @param root Root node after all transformations. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, root: RootNode, opts: Result.ResultOptions) + + /** + * Returns for `Result#css` content. + * + * ```js + * result + '' === result.css + * ``` + * + * @return String representing of `Result#root`. + */ + toString(): string + + /** + * Creates an instance of `Warning` and adds it to `Result#messages`. + * + * ```js + * if (decl.important) { + * result.warn('Avoid !important', { node: decl, word: '!important' }) + * } + * ``` + * + * @param text Warning message. + * @param opts Warning options. + * @return Created warning. + */ + warn(message: string, options?: WarningOptions): Warning + + /** + * Returns warnings from plugins. Filters `Warning` instances + * from `Result#messages`. + * + * ```js + * result.warnings().forEach(warn => { + * console.warn(warn.toString()) + * }) + * ``` + * + * @return Warnings from plugins. + */ + warnings(): Warning[] + + /** + * An alias for the `Result#css` property. + * Use it with syntaxes that generate non-CSS output. + * + * ```js + * result.css === result.content + * ``` + */ + get content(): string +} + +declare class Result<RootNode = Document | Root> extends Result_<RootNode> {} + +export = Result diff --git a/seller_1/node_modules/postcss/lib/result.js b/seller_1/node_modules/postcss/lib/result.js new file mode 100644 index 0000000..a39751d --- /dev/null +++ b/seller_1/node_modules/postcss/lib/result.js @@ -0,0 +1,42 @@ +'use strict' + +let Warning = require('./warning') + +class Result { + constructor(processor, root, opts) { + this.processor = processor + this.messages = [] + this.root = root + this.opts = opts + this.css = undefined + this.map = undefined + } + + toString() { + return this.css + } + + warn(text, opts = {}) { + if (!opts.plugin) { + if (this.lastPlugin && this.lastPlugin.postcssPlugin) { + opts.plugin = this.lastPlugin.postcssPlugin + } + } + + let warning = new Warning(text, opts) + this.messages.push(warning) + + return warning + } + + warnings() { + return this.messages.filter(i => i.type === 'warning') + } + + get content() { + return this.css + } +} + +module.exports = Result +Result.default = Result diff --git a/seller_1/node_modules/postcss/lib/root.d.ts b/seller_1/node_modules/postcss/lib/root.d.ts new file mode 100644 index 0000000..5c91139 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/root.d.ts @@ -0,0 +1,87 @@ +import Container, { ContainerProps } from './container.js' +import Document from './document.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' + +declare namespace Root { + export interface RootRaws extends Record<string, any> { + /** + * The space symbols after the last child to the end of file. + */ + after?: string + + /** + * Non-CSS code after `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeAfter?: string + + /** + * Non-CSS code before `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeBefore?: string + + /** + * Is the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface RootProps extends ContainerProps { + /** + * Information used to generate byte-to-byte equal node string + * as it was in the origin input. + * */ + raws?: RootRaws + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Root_ as default } +} + +/** + * Represents a CSS file and contains all its parsed nodes. + * + * ```js + * const root = postcss.parse('a{color:black} b{z-index:2}') + * root.type //=> 'root' + * root.nodes.length //=> 2 + * ``` + */ +declare class Root_ extends Container { + nodes: NonNullable<Container['nodes']> + parent: Document | undefined + raws: Root.RootRaws + type: 'root' + + constructor(defaults?: Root.RootProps) + + assign(overrides: object | Root.RootProps): this + clone(overrides?: Partial<Root.RootProps>): this + cloneAfter(overrides?: Partial<Root.RootProps>): this + cloneBefore(overrides?: Partial<Root.RootProps>): this + + /** + * Returns a `Result` instance representing the root’s CSS. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * root1.append(root2) + * const result = root1.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param options Options. + * @return Result with current root’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Root extends Root_ {} + +export = Root diff --git a/seller_1/node_modules/postcss/lib/root.js b/seller_1/node_modules/postcss/lib/root.js new file mode 100644 index 0000000..ea574ed --- /dev/null +++ b/seller_1/node_modules/postcss/lib/root.js @@ -0,0 +1,61 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Root extends Container { + constructor(defaults) { + super(defaults) + this.type = 'root' + if (!this.nodes) this.nodes = [] + } + + normalize(child, sample, type) { + let nodes = super.normalize(child) + + if (sample) { + if (type === 'prepend') { + if (this.nodes.length > 1) { + sample.raws.before = this.nodes[1].raws.before + } else { + delete sample.raws.before + } + } else if (this.first !== sample) { + for (let node of nodes) { + node.raws.before = sample.raws.before + } + } + } + + return nodes + } + + removeChild(child, ignore) { + let index = this.index(child) + + if (!ignore && index === 0 && this.nodes.length > 1) { + this.nodes[1].raws.before = this.nodes[index].raws.before + } + + return super.removeChild(child) + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + return lazy.stringify() + } +} + +Root.registerLazyResult = dependant => { + LazyResult = dependant +} + +Root.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Root +Root.default = Root + +Container.registerRoot(Root) diff --git a/seller_1/node_modules/postcss/lib/rule.d.ts b/seller_1/node_modules/postcss/lib/rule.d.ts new file mode 100644 index 0000000..da8aae7 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/rule.d.ts @@ -0,0 +1,126 @@ +import Container, { + ContainerProps, + ContainerWithChildren +} from './container.js' + +declare namespace Rule { + export interface RuleRaws extends Record<string, unknown> { + /** + * The space symbols after the last child of the node to the end of the node. + */ + after?: string + + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the selector and `{` for rules. + */ + between?: string + + /** + * Contains `true` if there is semicolon after rule. + */ + ownSemicolon?: string + + /** + * The rule’s selector with comments. + */ + selector?: { + raw: string + value: string + } + + /** + * Contains `true` if the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export type RuleProps = { + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: RuleRaws + } & ( + | { + /** Selector or selectors of the rule. */ + selector: string + selectors?: never + } + | { + selector?: never + /** Selectors of the rule represented as an array of strings. */ + selectors: readonly string[] + } + ) & ContainerProps + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Rule_ as default } +} + +/** + * Represents a CSS rule: a selector followed by a declaration block. + * + * ```js + * Once (root, { Rule }) { + * let a = new Rule({ selector: 'a' }) + * a.append(…) + * root.append(a) + * } + * ``` + * + * ```js + * const root = postcss.parse('a{}') + * const rule = root.first + * rule.type //=> 'rule' + * rule.toString() //=> 'a{}' + * ``` + */ +declare class Rule_ extends Container { + nodes: NonNullable<Container['nodes']> + parent: ContainerWithChildren | undefined + raws: Rule.RuleRaws + type: 'rule' + constructor(defaults?: Rule.RuleProps) + + assign(overrides: object | Rule.RuleProps): this + clone(overrides?: Partial<Rule.RuleProps>): this + + cloneAfter(overrides?: Partial<Rule.RuleProps>): this + + cloneBefore(overrides?: Partial<Rule.RuleProps>): this + /** + * The rule’s full selector represented as a string. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * rule.selector //=> 'a, b' + * ``` + */ + get selector(): string + set selector(value: string) + /** + * An array containing the rule’s individual selectors. + * Groups of selectors are split at commas. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * + * rule.selector //=> 'a, b' + * rule.selectors //=> ['a', 'b'] + * + * rule.selectors = ['a', 'strong'] + * rule.selector //=> 'a, strong' + * ``` + */ + get selectors(): string[] + set selectors(values: string[]) +} + +declare class Rule extends Rule_ {} + +export = Rule diff --git a/seller_1/node_modules/postcss/lib/rule.js b/seller_1/node_modules/postcss/lib/rule.js new file mode 100644 index 0000000..a93ab25 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/rule.js @@ -0,0 +1,27 @@ +'use strict' + +let Container = require('./container') +let list = require('./list') + +class Rule extends Container { + constructor(defaults) { + super(defaults) + this.type = 'rule' + if (!this.nodes) this.nodes = [] + } + + get selectors() { + return list.comma(this.selector) + } + + set selectors(values) { + let match = this.selector ? this.selector.match(/,\s*/) : null + let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') + this.selector = values.join(sep) + } +} + +module.exports = Rule +Rule.default = Rule + +Container.registerRule(Rule) diff --git a/seller_1/node_modules/postcss/lib/stringifier.d.ts b/seller_1/node_modules/postcss/lib/stringifier.d.ts new file mode 100644 index 0000000..f707a6a --- /dev/null +++ b/seller_1/node_modules/postcss/lib/stringifier.d.ts @@ -0,0 +1,46 @@ +import { + AnyNode, + AtRule, + Builder, + Comment, + Container, + Declaration, + Document, + Root, + Rule +} from './postcss.js' + +declare namespace Stringifier { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Stringifier_ as default } +} + +declare class Stringifier_ { + builder: Builder + constructor(builder: Builder) + atrule(node: AtRule, semicolon?: boolean): void + beforeAfter(node: AnyNode, detect: 'after' | 'before'): string + block(node: AnyNode, start: string): void + body(node: Container): void + comment(node: Comment): void + decl(node: Declaration, semicolon?: boolean): void + document(node: Document): void + raw(node: AnyNode, own: null | string, detect?: string): string + rawBeforeClose(root: Root): string | undefined + rawBeforeComment(root: Root, node: Comment): string | undefined + rawBeforeDecl(root: Root, node: Declaration): string | undefined + rawBeforeOpen(root: Root): string | undefined + rawBeforeRule(root: Root): string | undefined + rawColon(root: Root): string | undefined + rawEmptyBody(root: Root): string | undefined + rawIndent(root: Root): string | undefined + rawSemicolon(root: Root): boolean | undefined + rawValue(node: AnyNode, prop: string): string + root(node: Root): void + rule(node: Rule): void + stringify(node: AnyNode, semicolon?: boolean): void +} + +declare class Stringifier extends Stringifier_ {} + +export = Stringifier diff --git a/seller_1/node_modules/postcss/lib/stringifier.js b/seller_1/node_modules/postcss/lib/stringifier.js new file mode 100644 index 0000000..e07ad12 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/stringifier.js @@ -0,0 +1,353 @@ +'use strict' + +const DEFAULT_RAW = { + after: '\n', + beforeClose: '\n', + beforeComment: '\n', + beforeDecl: '\n', + beforeOpen: ' ', + beforeRule: '\n', + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: false +} + +function capitalize(str) { + return str[0].toUpperCase() + str.slice(1) +} + +class Stringifier { + constructor(builder) { + this.builder = builder + } + + atrule(node, semicolon) { + let name = '@' + node.name + let params = node.params ? this.rawValue(node, 'params') : '' + + if (typeof node.raws.afterName !== 'undefined') { + name += node.raws.afterName + } else if (params) { + name += ' ' + } + + if (node.nodes) { + this.block(node, name + params) + } else { + let end = (node.raws.between || '') + (semicolon ? ';' : '') + this.builder(name + params + end, node) + } + } + + beforeAfter(node, detect) { + let value + if (node.type === 'decl') { + value = this.raw(node, null, 'beforeDecl') + } else if (node.type === 'comment') { + value = this.raw(node, null, 'beforeComment') + } else if (detect === 'before') { + value = this.raw(node, null, 'beforeRule') + } else { + value = this.raw(node, null, 'beforeClose') + } + + let buf = node.parent + let depth = 0 + while (buf && buf.type !== 'root') { + depth += 1 + buf = buf.parent + } + + if (value.includes('\n')) { + let indent = this.raw(node, null, 'indent') + if (indent.length) { + for (let step = 0; step < depth; step++) value += indent + } + } + + return value + } + + block(node, start) { + let between = this.raw(node, 'between', 'beforeOpen') + this.builder(start + between + '{', node, 'start') + + let after + if (node.nodes && node.nodes.length) { + this.body(node) + after = this.raw(node, 'after') + } else { + after = this.raw(node, 'after', 'emptyBody') + } + + if (after) this.builder(after) + this.builder('}', node, 'end') + } + + body(node) { + let last = node.nodes.length - 1 + while (last > 0) { + if (node.nodes[last].type !== 'comment') break + last -= 1 + } + + let semicolon = this.raw(node, 'semicolon') + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i] + let before = this.raw(child, 'before') + if (before) this.builder(before) + this.stringify(child, last !== i || semicolon) + } + } + + comment(node) { + let left = this.raw(node, 'left', 'commentLeft') + let right = this.raw(node, 'right', 'commentRight') + this.builder('/*' + left + node.text + right + '*/', node) + } + + decl(node, semicolon) { + let between = this.raw(node, 'between', 'colon') + let string = node.prop + between + this.rawValue(node, 'value') + + if (node.important) { + string += node.raws.important || ' !important' + } + + if (semicolon) string += ';' + this.builder(string, node) + } + + document(node) { + this.body(node) + } + + raw(node, own, detect) { + let value + if (!detect) detect = own + + // Already had + if (own) { + value = node.raws[own] + if (typeof value !== 'undefined') return value + } + + let parent = node.parent + + if (detect === 'before') { + // Hack for first rule in CSS + if (!parent || (parent.type === 'root' && parent.first === node)) { + return '' + } + + // `root` nodes in `document` should use only their own raws + if (parent && parent.type === 'document') { + return '' + } + } + + // Floating child without parent + if (!parent) return DEFAULT_RAW[detect] + + // Detect style by other nodes + let root = node.root() + if (!root.rawCache) root.rawCache = {} + if (typeof root.rawCache[detect] !== 'undefined') { + return root.rawCache[detect] + } + + if (detect === 'before' || detect === 'after') { + return this.beforeAfter(node, detect) + } else { + let method = 'raw' + capitalize(detect) + if (this[method]) { + value = this[method](root, node) + } else { + root.walk(i => { + value = i.raws[own] + if (typeof value !== 'undefined') return false + }) + } + } + + if (typeof value === 'undefined') value = DEFAULT_RAW[detect] + + root.rawCache[detect] = value + return value + } + + rawBeforeClose(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length > 0) { + if (typeof i.raws.after !== 'undefined') { + value = i.raws.after + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawBeforeComment(root, node) { + let value + root.walkComments(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeDecl') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeDecl(root, node) { + let value + root.walkDecls(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeRule') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeOpen(root) { + let value + root.walk(i => { + if (i.type !== 'decl') { + value = i.raws.between + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawBeforeRule(root) { + let value + root.walk(i => { + if (i.nodes && (i.parent !== root || root.first !== i)) { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawColon(root) { + let value + root.walkDecls(i => { + if (typeof i.raws.between !== 'undefined') { + value = i.raws.between.replace(/[^\s:]/g, '') + return false + } + }) + return value + } + + rawEmptyBody(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length === 0) { + value = i.raws.after + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawIndent(root) { + if (root.raws.indent) return root.raws.indent + let value + root.walk(i => { + let p = i.parent + if (p && p !== root && p.parent && p.parent === root) { + if (typeof i.raws.before !== 'undefined') { + let parts = i.raws.before.split('\n') + value = parts[parts.length - 1] + value = value.replace(/\S/g, '') + return false + } + } + }) + return value + } + + rawSemicolon(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length && i.last.type === 'decl') { + value = i.raws.semicolon + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawValue(node, prop) { + let value = node[prop] + let raw = node.raws[prop] + if (raw && raw.value === value) { + return raw.raw + } + + return value + } + + root(node) { + this.body(node) + if (node.raws.after) this.builder(node.raws.after) + } + + rule(node) { + this.block(node, this.rawValue(node, 'selector')) + if (node.raws.ownSemicolon) { + this.builder(node.raws.ownSemicolon, node, 'end') + } + } + + stringify(node, semicolon) { + /* c8 ignore start */ + if (!this[node.type]) { + throw new Error( + 'Unknown AST node type ' + + node.type + + '. ' + + 'Maybe you need to change PostCSS stringifier.' + ) + } + /* c8 ignore stop */ + this[node.type](node, semicolon) + } +} + +module.exports = Stringifier +Stringifier.default = Stringifier diff --git a/seller_1/node_modules/postcss/lib/stringify.d.ts b/seller_1/node_modules/postcss/lib/stringify.d.ts new file mode 100644 index 0000000..06ad0b4 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/stringify.d.ts @@ -0,0 +1,9 @@ +import { Stringifier } from './postcss.js' + +interface Stringify extends Stringifier { + default: Stringify +} + +declare const stringify: Stringify + +export = stringify diff --git a/seller_1/node_modules/postcss/lib/stringify.js b/seller_1/node_modules/postcss/lib/stringify.js new file mode 100644 index 0000000..77bd017 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/stringify.js @@ -0,0 +1,11 @@ +'use strict' + +let Stringifier = require('./stringifier') + +function stringify(node, builder) { + let str = new Stringifier(builder) + str.stringify(node) +} + +module.exports = stringify +stringify.default = stringify diff --git a/seller_1/node_modules/postcss/lib/symbols.js b/seller_1/node_modules/postcss/lib/symbols.js new file mode 100644 index 0000000..a142c26 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/symbols.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports.isClean = Symbol('isClean') + +module.exports.my = Symbol('my') diff --git a/seller_1/node_modules/postcss/lib/terminal-highlight.js b/seller_1/node_modules/postcss/lib/terminal-highlight.js new file mode 100644 index 0000000..6196c9d --- /dev/null +++ b/seller_1/node_modules/postcss/lib/terminal-highlight.js @@ -0,0 +1,70 @@ +'use strict' + +let pico = require('picocolors') + +let tokenizer = require('./tokenize') + +let Input + +function registerInput(dependant) { + Input = dependant +} + +const HIGHLIGHT_THEME = { + ';': pico.yellow, + ':': pico.yellow, + '(': pico.cyan, + ')': pico.cyan, + '[': pico.yellow, + ']': pico.yellow, + '{': pico.yellow, + '}': pico.yellow, + 'at-word': pico.cyan, + 'brackets': pico.cyan, + 'call': pico.cyan, + 'class': pico.yellow, + 'comment': pico.gray, + 'hash': pico.magenta, + 'string': pico.green +} + +function getTokenType([type, value], processor) { + if (type === 'word') { + if (value[0] === '.') { + return 'class' + } + if (value[0] === '#') { + return 'hash' + } + } + + if (!processor.endOfFile()) { + let next = processor.nextToken() + processor.back(next) + if (next[0] === 'brackets' || next[0] === '(') return 'call' + } + + return type +} + +function terminalHighlight(css) { + let processor = tokenizer(new Input(css), { ignoreErrors: true }) + let result = '' + while (!processor.endOfFile()) { + let token = processor.nextToken() + let color = HIGHLIGHT_THEME[getTokenType(token, processor)] + if (color) { + result += token[1] + .split(/\r?\n/) + .map(i => color(i)) + .join('\n') + } else { + result += token[1] + } + } + return result +} + +terminalHighlight.registerInput = registerInput + +module.exports = terminalHighlight diff --git a/seller_1/node_modules/postcss/lib/tokenize.js b/seller_1/node_modules/postcss/lib/tokenize.js new file mode 100644 index 0000000..1d41284 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/tokenize.js @@ -0,0 +1,266 @@ +'use strict' + +const SINGLE_QUOTE = "'".charCodeAt(0) +const DOUBLE_QUOTE = '"'.charCodeAt(0) +const BACKSLASH = '\\'.charCodeAt(0) +const SLASH = '/'.charCodeAt(0) +const NEWLINE = '\n'.charCodeAt(0) +const SPACE = ' '.charCodeAt(0) +const FEED = '\f'.charCodeAt(0) +const TAB = '\t'.charCodeAt(0) +const CR = '\r'.charCodeAt(0) +const OPEN_SQUARE = '['.charCodeAt(0) +const CLOSE_SQUARE = ']'.charCodeAt(0) +const OPEN_PARENTHESES = '('.charCodeAt(0) +const CLOSE_PARENTHESES = ')'.charCodeAt(0) +const OPEN_CURLY = '{'.charCodeAt(0) +const CLOSE_CURLY = '}'.charCodeAt(0) +const SEMICOLON = ';'.charCodeAt(0) +const ASTERISK = '*'.charCodeAt(0) +const COLON = ':'.charCodeAt(0) +const AT = '@'.charCodeAt(0) + +const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g +const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g +const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ +const RE_HEX_ESCAPE = /[\da-f]/i + +module.exports = function tokenizer(input, options = {}) { + let css = input.css.valueOf() + let ignore = options.ignoreErrors + + let code, content, escape, next, quote + let currentToken, escaped, escapePos, n, prev + + let length = css.length + let pos = 0 + let buffer = [] + let returned = [] + + function position() { + return pos + } + + function unclosed(what) { + throw input.error('Unclosed ' + what, pos) + } + + function endOfFile() { + return returned.length === 0 && pos >= length + } + + function nextToken(opts) { + if (returned.length) return returned.pop() + if (pos >= length) return + + let ignoreUnclosed = opts ? opts.ignoreUnclosed : false + + code = css.charCodeAt(pos) + + switch (code) { + case NEWLINE: + case SPACE: + case TAB: + case CR: + case FEED: { + next = pos + do { + next += 1 + code = css.charCodeAt(next) + } while ( + code === SPACE || + code === NEWLINE || + code === TAB || + code === CR || + code === FEED + ) + + currentToken = ['space', css.slice(pos, next)] + pos = next - 1 + break + } + + case OPEN_SQUARE: + case CLOSE_SQUARE: + case OPEN_CURLY: + case CLOSE_CURLY: + case COLON: + case SEMICOLON: + case CLOSE_PARENTHESES: { + let controlChar = String.fromCharCode(code) + currentToken = [controlChar, controlChar, pos] + break + } + + case OPEN_PARENTHESES: { + prev = buffer.length ? buffer.pop()[1] : '' + n = css.charCodeAt(pos + 1) + if ( + prev === 'url' && + n !== SINGLE_QUOTE && + n !== DOUBLE_QUOTE && + n !== SPACE && + n !== NEWLINE && + n !== TAB && + n !== FEED && + n !== CR + ) { + next = pos + do { + escaped = false + next = css.indexOf(')', next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + break + } else { + unclosed('bracket') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['brackets', css.slice(pos, next + 1), pos, next] + + pos = next + } else { + next = css.indexOf(')', pos + 1) + content = css.slice(pos, next + 1) + + if (next === -1 || RE_BAD_BRACKET.test(content)) { + currentToken = ['(', '(', pos] + } else { + currentToken = ['brackets', content, pos, next] + pos = next + } + } + + break + } + + case SINGLE_QUOTE: + case DOUBLE_QUOTE: { + quote = code === SINGLE_QUOTE ? "'" : '"' + next = pos + do { + escaped = false + next = css.indexOf(quote, next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + 1 + break + } else { + unclosed('string') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['string', css.slice(pos, next + 1), pos, next] + pos = next + break + } + + case AT: { + RE_AT_END.lastIndex = pos + 1 + RE_AT_END.test(css) + if (RE_AT_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_AT_END.lastIndex - 2 + } + + currentToken = ['at-word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + case BACKSLASH: { + next = pos + escape = true + while (css.charCodeAt(next + 1) === BACKSLASH) { + next += 1 + escape = !escape + } + code = css.charCodeAt(next + 1) + if ( + escape && + code !== SLASH && + code !== SPACE && + code !== NEWLINE && + code !== TAB && + code !== CR && + code !== FEED + ) { + next += 1 + if (RE_HEX_ESCAPE.test(css.charAt(next))) { + while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { + next += 1 + } + if (css.charCodeAt(next + 1) === SPACE) { + next += 1 + } + } + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + default: { + if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { + next = css.indexOf('*/', pos + 2) + 1 + if (next === 0) { + if (ignore || ignoreUnclosed) { + next = css.length + } else { + unclosed('comment') + } + } + + currentToken = ['comment', css.slice(pos, next + 1), pos, next] + pos = next + } else { + RE_WORD_END.lastIndex = pos + 1 + RE_WORD_END.test(css) + if (RE_WORD_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_WORD_END.lastIndex - 2 + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + buffer.push(currentToken) + pos = next + } + + break + } + } + + pos++ + return currentToken + } + + function back(token) { + returned.push(token) + } + + return { + back, + endOfFile, + nextToken, + position + } +} diff --git a/seller_1/node_modules/postcss/lib/warn-once.js b/seller_1/node_modules/postcss/lib/warn-once.js new file mode 100644 index 0000000..316e1cf --- /dev/null +++ b/seller_1/node_modules/postcss/lib/warn-once.js @@ -0,0 +1,13 @@ +/* eslint-disable no-console */ +'use strict' + +let printed = {} + +module.exports = function warnOnce(message) { + if (printed[message]) return + printed[message] = true + + if (typeof console !== 'undefined' && console.warn) { + console.warn(message) + } +} diff --git a/seller_1/node_modules/postcss/lib/warning.d.ts b/seller_1/node_modules/postcss/lib/warning.d.ts new file mode 100644 index 0000000..b25bba8 --- /dev/null +++ b/seller_1/node_modules/postcss/lib/warning.d.ts @@ -0,0 +1,147 @@ +import { RangePosition } from './css-syntax-error.js' +import Node from './node.js' + +declare namespace Warning { + export interface WarningOptions { + /** + * End position, exclusive, in CSS node string that caused the warning. + */ + end?: RangePosition + + /** + * End index, exclusive, in CSS node string that caused the warning. + */ + endIndex?: number + + /** + * Start index, inclusive, in CSS node string that caused the warning. + */ + index?: number + + /** + * CSS node that caused the warning. + */ + node?: Node + + /** + * Name of the plugin that created this warning. `Result#warn` fills + * this property automatically. + */ + plugin?: string + + /** + * Start position, inclusive, in CSS node string that caused the warning. + */ + start?: RangePosition + + /** + * Word in CSS source that caused the warning. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Warning_ as default } +} + +/** + * Represents a plugin’s warning. It can be created using `Node#warn`. + * + * ```js + * if (decl.important) { + * decl.warn(result, 'Avoid !important', { word: '!important' }) + * } + * ``` + */ +declare class Warning_ { + /** + * Column for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.column //=> 6 + * ``` + */ + column: number + + /** + * Column for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endColumn //=> 4 + * ``` + */ + endColumn?: number + + /** + * Line for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endLine //=> 6 + * ``` + */ + endLine?: number + + /** + * Line for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.line //=> 5 + * ``` + */ + line: number + + /** + * Contains the CSS node that caused the warning. + * + * ```js + * warning.node.toString() //=> 'color: white !important' + * ``` + */ + node: Node + + /** + * The name of the plugin that created this warning. + * When you call `Node#warn` it will fill this property automatically. + * + * ```js + * warning.plugin //=> 'postcss-important' + * ``` + */ + plugin: string + + /** + * The warning message. + * + * ```js + * warning.text //=> 'Try to avoid !important' + * ``` + */ + text: string + + /** + * Type to filter warnings from `Result#messages`. + * Always equal to `"warning"`. + */ + type: 'warning' + + /** + * @param text Warning message. + * @param opts Warning options. + */ + constructor(text: string, opts?: Warning.WarningOptions) + + /** + * Returns a warning position and message. + * + * ```js + * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important' + * ``` + * + * @return Warning position and message. + */ + toString(): string +} + +declare class Warning extends Warning_ {} + +export = Warning diff --git a/seller_1/node_modules/postcss/lib/warning.js b/seller_1/node_modules/postcss/lib/warning.js new file mode 100644 index 0000000..3a3d79c --- /dev/null +++ b/seller_1/node_modules/postcss/lib/warning.js @@ -0,0 +1,37 @@ +'use strict' + +class Warning { + constructor(text, opts = {}) { + this.type = 'warning' + this.text = text + + if (opts.node && opts.node.source) { + let range = opts.node.rangeBy(opts) + this.line = range.start.line + this.column = range.start.column + this.endLine = range.end.line + this.endColumn = range.end.column + } + + for (let opt in opts) this[opt] = opts[opt] + } + + toString() { + if (this.node) { + return this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word + }).message + } + + if (this.plugin) { + return this.plugin + ': ' + this.text + } + + return this.text + } +} + +module.exports = Warning +Warning.default = Warning diff --git a/seller_1/node_modules/postcss/package.json b/seller_1/node_modules/postcss/package.json new file mode 100644 index 0000000..4890c36 --- /dev/null +++ b/seller_1/node_modules/postcss/package.json @@ -0,0 +1,88 @@ +{ + "name": "postcss", + "version": "8.4.49", + "description": "Tool for transforming styles with JS plugins", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "exports": { + ".": { + "require": "./lib/postcss.js", + "import": "./lib/postcss.mjs" + }, + "./lib/at-rule": "./lib/at-rule.js", + "./lib/comment": "./lib/comment.js", + "./lib/container": "./lib/container.js", + "./lib/css-syntax-error": "./lib/css-syntax-error.js", + "./lib/declaration": "./lib/declaration.js", + "./lib/fromJSON": "./lib/fromJSON.js", + "./lib/input": "./lib/input.js", + "./lib/lazy-result": "./lib/lazy-result.js", + "./lib/no-work-result": "./lib/no-work-result.js", + "./lib/list": "./lib/list.js", + "./lib/map-generator": "./lib/map-generator.js", + "./lib/node": "./lib/node.js", + "./lib/parse": "./lib/parse.js", + "./lib/parser": "./lib/parser.js", + "./lib/postcss": "./lib/postcss.js", + "./lib/previous-map": "./lib/previous-map.js", + "./lib/processor": "./lib/processor.js", + "./lib/result": "./lib/result.js", + "./lib/root": "./lib/root.js", + "./lib/rule": "./lib/rule.js", + "./lib/stringifier": "./lib/stringifier.js", + "./lib/stringify": "./lib/stringify.js", + "./lib/symbols": "./lib/symbols.js", + "./lib/terminal-highlight": "./lib/terminal-highlight.js", + "./lib/tokenize": "./lib/tokenize.js", + "./lib/warn-once": "./lib/warn-once.js", + "./lib/warning": "./lib/warning.js", + "./package.json": "./package.json" + }, + "main": "./lib/postcss.js", + "types": "./lib/postcss.d.ts", + "keywords": [ + "css", + "postcss", + "rework", + "preprocessor", + "parser", + "source map", + "transform", + "manipulation", + "transpiler" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik <andrey@sitnik.ru>", + "license": "MIT", + "homepage": "https://postcss.org/", + "repository": "postcss/postcss", + "bugs": { + "url": "https://github.com/postcss/postcss/issues" + }, + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "browser": { + "./lib/terminal-highlight": false, + "source-map-js": false, + "path": false, + "url": false, + "fs": false + } +} diff --git a/seller_1/node_modules/rollup/LICENSE.md b/seller_1/node_modules/rollup/LICENSE.md new file mode 100644 index 0000000..868fbf1 --- /dev/null +++ b/seller_1/node_modules/rollup/LICENSE.md @@ -0,0 +1,673 @@ +# Rollup core license +Rollup is released under the MIT license: + +The MIT License (MIT) + +Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Licenses of bundled dependencies +The published Rollup artifact additionally contains code with the following licenses: +MIT, ISC, 0BSD + +# Bundled dependencies: +## @jridgewell/sourcemap-codec +License: MIT +By: Rich Harris +Repository: git+https://github.com/jridgewell/sourcemap-codec.git + +> The MIT License +> +> Copyright (c) 2015 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## @rollup/pluginutils +License: MIT +By: Rich Harris +Repository: rollup/plugins + +> The MIT License (MIT) +> +> Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## anymatch +License: ISC +By: Elan Shanker +Repository: https://github.com/micromatch/anymatch + +> The ISC License +> +> Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## binary-extensions +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/binary-extensions + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> Copyright (c) Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## braces +License: MIT +By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm +Repository: micromatch/braces + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## builtin-modules +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/builtin-modules + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## chokidar +License: MIT +By: Paul Miller, Elan Shanker +Repository: git+https://github.com/paulmillr/chokidar.git + +> The MIT License (MIT) +> +> Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the “Software”), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## colorette +License: MIT +By: Jorge Bucaran +Repository: jorgebucaran/colorette + +> Copyright © Jorge Bucaran <<https://jorgebucaran.com>> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## date-time +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/date-time + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## fill-range +License: MIT +By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling +Repository: jonschlinkert/fill-range + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## flru +License: MIT +By: Luke Edwards +Repository: lukeed/flru + +> MIT License +> +> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## glob-parent +License: ISC +By: Gulp Team, Elan Shanker, Blaine Bublitz +Repository: gulpjs/glob-parent + +> The ISC License +> +> Copyright (c) 2015, 2019 Elan Shanker +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## is-binary-path +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/is-binary-path + +> MIT License +> +> Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## is-extglob +License: MIT +By: Jon Schlinkert +Repository: jonschlinkert/is-extglob + +> The MIT License (MIT) +> +> Copyright (c) 2014-2016, Jon Schlinkert +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## is-glob +License: MIT +By: Jon Schlinkert, Brian Woodward, Daniel Perez +Repository: micromatch/is-glob + +> The MIT License (MIT) +> +> Copyright (c) 2014-2017, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## is-number +License: MIT +By: Jon Schlinkert, Olsten Larck, Rouven Weßling +Repository: jonschlinkert/is-number + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## is-reference +License: MIT +By: Rich Harris +Repository: git+https://github.com/Rich-Harris/is-reference.git + +--------------------------------------- + +## locate-character +License: MIT +By: Rich Harris +Repository: git+https://gitlab.com/Rich-Harris/locate-character.git + +--------------------------------------- + +## magic-string +License: MIT +By: Rich Harris +Repository: https://github.com/rich-harris/magic-string + +> Copyright 2018 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## normalize-path +License: MIT +By: Jon Schlinkert, Blaine Bublitz +Repository: jonschlinkert/normalize-path + +> The MIT License (MIT) +> +> Copyright (c) 2014-2018, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## parse-ms +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/parse-ms + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## picomatch +License: MIT +By: Jon Schlinkert +Repository: micromatch/picomatch + +> The MIT License (MIT) +> +> Copyright (c) 2017-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## pretty-bytes +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/pretty-bytes + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## pretty-ms +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/pretty-ms + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## readdirp +License: MIT +By: Thorsten Lorenz, Paul Miller +Repository: git://github.com/paulmillr/readdirp.git + +> MIT License +> +> Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## signal-exit +License: ISC +By: Ben Coe +Repository: https://github.com/tapjs/signal-exit.git + +> The ISC License +> +> Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors +> +> Permission to use, copy, modify, and/or distribute this software +> for any purpose with or without fee is hereby granted, provided +> that the above copyright notice and this permission notice +> appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +> OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +> LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +> OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +> WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +> ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## time-zone +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/time-zone + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## to-regex-range +License: MIT +By: Jon Schlinkert, Rouven Weßling +Repository: micromatch/to-regex-range + +> The MIT License (MIT) +> +> Copyright (c) 2015-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## tslib +License: 0BSD +By: Microsoft Corp. +Repository: https://github.com/Microsoft/tslib.git + +> Copyright (c) Microsoft Corporation. +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +> PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## yargs-parser +License: ISC +By: Ben Coe +Repository: https://github.com/yargs/yargs-parser.git + +> Copyright (c) 2016, Contributors +> +> Permission to use, copy, modify, and/or distribute this software +> for any purpose with or without fee is hereby granted, provided +> that the above copyright notice and this permission notice +> appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +> OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +> LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +> OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +> WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +> ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/seller_1/node_modules/rollup/README.md b/seller_1/node_modules/rollup/README.md new file mode 100644 index 0000000..a1b6b9e --- /dev/null +++ b/seller_1/node_modules/rollup/README.md @@ -0,0 +1,134 @@ +<p align="center"> + <a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a> +</p> + +<p align="center"> + <a href="https://www.npmjs.com/package/rollup"> + <img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" > + </a> + <a href="https://nodejs.org/en/about/previous-releases"> + <img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility"> + </a> + <a href="https://packagephobia.now.sh/result?p=rollup"> + <img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" > + </a> + <a href="https://codecov.io/gh/rollup/rollup"> + <img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" > + </a> + <a href="#backers" alt="sponsors on Open Collective"> + <img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" > + </a> + <a href="#sponsors" alt="Sponsors on Open Collective"> + <img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" > + </a> + <a href="https://github.com/rollup/rollup/blob/master/LICENSE.md"> + <img src="https://img.shields.io/npm/l/rollup.svg" alt="license"> + </a> + <a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'> + <img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'> + </a> +</p> + +<h1 align="center">Rollup</h1> + +## Overview + +Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today. + +## Quick Start Guide + +Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/). + +### Commands + +These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js. + +For browsers: + +```bash +# compile to a <script> containing a self-executing function +rollup main.js --format iife --name "myBundle" --file bundle.js +``` + +For Node.js: + +```bash +# compile to a CommonJS module +rollup main.js --format cjs --file bundle.js +``` + +For both browsers and Node.js: + +```bash +# UMD format requires a bundle name +rollup main.js --format umd --name "myBundle" --file bundle.js +``` + +## Why + +Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language. + +This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of... + +## Tree Shaking + +In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project. + +For example, with CommonJS, the _entire tool or library must be imported_. + +```js +// import the entire utils object with CommonJS +var utils = require('node:utils'); +var query = 'Rollup'; +// use the ajax method of the utils object +utils.ajax('https://api.example.com?search=' + query).then(handleResponse); +``` + +But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need: + +```js +// import the ajax function with an ES import statement +import { ajax } from 'node:utils'; + +var query = 'Rollup'; +// call the ajax function +ajax('https://api.example.com?search=' + query).then(handleResponse); +``` + +Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code. + +## Compatibility + +### Importing CommonJS + +Rollup can import existing CommonJS modules [through a plugin](https://github.com/rollup/plugins/tree/master/packages/commonjs). + +### Publishing ES Modules + +To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly. + +## Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rollup/rollup/graphs/contributors"><img src="https://opencollective.com/rollup/contributors.svg?width=890" /></a>. If you want to contribute yourself, head over to the [contribution guidelines](CONTRIBUTING.md). + +## Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/rollup#backer)] + +<a href="https://opencollective.com/rollup#backers" target="_blank"><img src="https://opencollective.com/rollup/backers.svg?width=890"></a> + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)] + +<a href="https://opencollective.com/rollup/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/14/avatar.svg"></a> + +## Special Sponsor + +<a href="https://www.tngtech.com/en/index.html" target="_blank"><img src="https://www.tngtech.com/fileadmin/Public/Images/Logos/TNG_Logo_medium_400x64.svg" alt="TNG Logo" width="280"/></a> + +TNG has been supporting the work of [Lukas Taegert-Atkinson](https://github.com/lukastaegert) on Rollup since 2017. + +## License + +[MIT](https://github.com/rollup/rollup/blob/master/LICENSE.md) diff --git a/seller_1/node_modules/rollup/dist/bin/rollup b/seller_1/node_modules/rollup/dist/bin/rollup new file mode 100644 index 0000000..b229162 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/bin/rollup @@ -0,0 +1,1857 @@ +#!/usr/bin/env node +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const process$1 = require('node:process'); +const rollup = require('../shared/rollup.js'); +const require$$2 = require('util'); +const require$$0 = require('path'); +const require$$0$1 = require('fs'); +const parseAst_js = require('../shared/parseAst.js'); +const fseventsImporter = require('../shared/fsevents-importer.js'); +const promises = require('node:fs/promises'); +const path = require('node:path'); +const loadConfigFile_js = require('../shared/loadConfigFile.js'); +require('tty'); +require('../native.js'); +require('node:perf_hooks'); +require('node:url'); +require('../getLogFilter.js'); + +const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n"; + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +function camelCase(str) { + // Handle the case where an argument is provided as camel case, e.g., fooBar. + // by ensuring that the string isn't already mixed case: + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; + } + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } + } + return camelcase; + } +} +function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } + else { + notCamelcase += chrString; + } + } + return notCamelcase; +} +function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + // if loaded from config, may already be a number. + if (typeof x === 'number') + return true; + // hexadecimal. + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + // don't treat 0123 as a number; as it drops the leading '0'. + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +// take an un-split argv string and tokenize it. +function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; + } + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null; + } + else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) + args[i] = ''; + args[i] += c; + } + return args; +} + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +let mixin; +class YargsParser { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + // allow a string argument to be passed in rather + // than an argv array. + const args = tokenizeArgString(argsInput); + // tokenizeArgString adds extra quotes to args if argsInput is a string + // only strip those extra quotes in processValue if argsInput is a string + const inputIsString = typeof argsInput === 'string'; + // aliases might have transitive relationships, normalize this. + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + // allow a i18n handler to be passed in, default to a fake one (util.format). + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); + } + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); + } + } + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays); + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + // TODO(bcoe): for the first pass at removing object prototype we didn't + // remove all prototypes from objects returned by this API, we might want + // to gradually move towards doing so. + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + // any unknown option (except for end-of-options, "--") + if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + // ---, ---=, ----, etc, + } + else if (truncatedArg.match(/^---+(=|$)/)) { + // options without key name are invalid. + pushPositional(arg); + continue; + // -- separated by = + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + // arrays format = '--f=a b c' + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + // nargs format = '--f=monkey washing cat' + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2], true); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + // -- separated by space. + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '--foo a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '--foo a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + // dot-notation flag separated by '='. + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + // dot-notation flag separated by space. + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f=a b c' + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f=monkey washing cat' + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + // single-digit boolean alias, e.g: xargs -0 + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } + } + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true); // special case: check env vars that point to config file + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); + }); + // '--' defaults to undefined. + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); + } + if (configuration['strip-aliased']) { + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; + }); + } + // Push argument into positional array, applying numeric coercion: + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } + } + // how many arguments should we consume, based + // on the nargs option? + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + // NaN has a special meaning for the array type, indicating that one or + // more values are expected. + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + // classic behavior, yargs eats positional and dash arguments. + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; + } + else { + // nargs will not consume flag arguments, e.g., -abc, --foo, + // and terminates when one is observed. + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + // If both array and nargs are configured, enforce the nargs count: + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + // value in --option=value is eaten as is + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign, true)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next, inputIsString)); + } + } + // If both array and nargs are configured, create an error if less than + // nargs positionals were found. NaN has special meaning, indicating + // that at least one value is required (more are okay). + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val, shouldStripQuotes = inputIsString) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val, shouldStripQuotes); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + // expand alias with nested objects in key + const a = [].concat(splitKey); + a.shift(); // nuke the old key. + keyProperties = keyProperties.concat(a); + // populate alias only if is not already an alias of the full key + // (already populated above) + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val, shouldStripQuotes) { + // strings may be quoted, clean this up as we assign values. + if (shouldStripQuotes) { + val = stripQuotes(val); + } + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig(argv) { + const configLookup = Object.create(null); + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + // Deno will receive a PermissionDenied error if an attempt is + // made to load config without the --allow-read flag: + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + // set args from config object. + // it recursively checks nested objects. + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey); + } + else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + // set all config objects passed in opts + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + // ensure that o[key] is an array, and that the last item is an empty object. + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + // we want to update the empty object at the end of the o[key] array, so set o to that object + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + // extend the aliases list with inferred aliases. + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags(arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + // ignore negative numbers + if (arg.match(negative)) { + return false; + } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { + return false; + } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/; + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/; + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + // make a best effort to pick a default value + // for an option based on name and type. + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + // return a default value, given the type of a flag., + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + // given a flag, enforce a default type. + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + // check user configuration settings for inconsistencies + function checkConfiguration() { + // count keys should not be set as array/narg + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; + } +} +// if any aliases reference each other, we should +// merge them together. +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +// this function should only be called when a count is given as an arg +// it is NOT called to set a default value +// thus we can start the count at 1 instead of 0 +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; +} +// TODO(bcoe): in the next major version of yargs, switch to +// Object.create(null) for dot notation: +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; +} +function stripQuotes(val) { + return (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) + ? val.substring(1, val.length - 1) + : val; +} + +/** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * CJS and ESM environments. + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +var _a, _b, _c; +// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our +// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 12; +const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); +if (nodeVersion) { + const major = Number(nodeVersion.match(/^([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +// Creates a yargs-parser instance using Node.js standard libraries: +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format: require$$2.format, + normalize: require$$0.normalize, + resolve: require$$0.resolve, + // TODO: figure out a way to combine ESM and CJS coverage, such that + // we can exercise all the lines below: + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + // Addresses: https://github.com/yargs/yargs/issues/2040 + return JSON.parse(require$$0$1.readFileSync(path, 'utf8')); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0; + +function parseNumber(milliseconds) { + return { + days: Math.trunc(milliseconds / 86_400_000), + hours: Math.trunc(milliseconds / 3_600_000 % 24), + minutes: Math.trunc(milliseconds / 60_000 % 60), + seconds: Math.trunc(milliseconds / 1000 % 60), + milliseconds: Math.trunc(milliseconds % 1000), + microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000), + nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000), + }; +} + +function parseBigint(milliseconds) { + return { + days: milliseconds / 86_400_000n, + hours: milliseconds / 3_600_000n % 24n, + minutes: milliseconds / 60_000n % 60n, + seconds: milliseconds / 1000n % 60n, + milliseconds: milliseconds % 1000n, + microseconds: 0n, + nanoseconds: 0n, + }; +} + +function parseMilliseconds(milliseconds) { + switch (typeof milliseconds) { + case 'number': { + if (Number.isFinite(milliseconds)) { + return parseNumber(milliseconds); + } + + break; + } + + case 'bigint': { + return parseBigint(milliseconds); + } + + // No default + } + + throw new TypeError('Expected a finite number or bigint'); +} + +const isZero = value => value === 0 || value === 0n; +const pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`; + +const SECOND_ROUNDING_EPSILON = 0.000_000_1; +const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n; + +function prettyMilliseconds(milliseconds, options) { + const isBigInt = typeof milliseconds === 'bigint'; + if (!isBigInt && !Number.isFinite(milliseconds)) { + throw new TypeError('Expected a finite number or bigint'); + } + + options = {...options}; + + const sign = milliseconds < 0 ? '-' : ''; + milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support. + + if (options.colonNotation) { + options.compact = false; + options.formatSubMilliseconds = false; + options.separateMilliseconds = false; + options.verbose = false; + } + + if (options.compact) { + options.unitCount = 1; + options.secondsDecimalDigits = 0; + options.millisecondsDecimalDigits = 0; + } + + let result = []; + + const floorDecimals = (value, decimalDigits) => { + const flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON); + const flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits); + return flooredValue.toFixed(decimalDigits); + }; + + const add = (value, long, short, valueString) => { + if ( + (result.length === 0 || !options.colonNotation) + && isZero(value) + && !(options.colonNotation && short === 'm')) { + return; + } + + valueString ??= String(value); + if (options.colonNotation) { + const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length; + const minLength = result.length > 0 ? 2 : 1; + valueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString; + } else { + valueString += options.verbose ? ' ' + pluralize(long, value) : short; + } + + result.push(valueString); + }; + + const parsed = parseMilliseconds(milliseconds); + const days = BigInt(parsed.days); + + if (options.hideYearAndDays) { + add((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h'); + } else { + if (options.hideYear) { + add(days, 'day', 'd'); + } else { + add(days / 365n, 'year', 'y'); + add(days % 365n, 'day', 'd'); + } + + add(Number(parsed.hours), 'hour', 'h'); + } + + add(Number(parsed.minutes), 'minute', 'm'); + + if (!options.hideSeconds) { + if ( + options.separateMilliseconds + || options.formatSubMilliseconds + || (!options.colonNotation && milliseconds < 1000) + ) { + const seconds = Number(parsed.seconds); + const milliseconds = Number(parsed.milliseconds); + const microseconds = Number(parsed.microseconds); + const nanoseconds = Number(parsed.nanoseconds); + + add(seconds, 'second', 's'); + + if (options.formatSubMilliseconds) { + add(milliseconds, 'millisecond', 'ms'); + add(microseconds, 'microsecond', 'µs'); + add(nanoseconds, 'nanosecond', 'ns'); + } else { + const millisecondsAndBelow + = milliseconds + + (microseconds / 1000) + + (nanoseconds / 1e6); + + const millisecondsDecimalDigits + = typeof options.millisecondsDecimalDigits === 'number' + ? options.millisecondsDecimalDigits + : 0; + + const roundedMilliseconds = millisecondsAndBelow >= 1 + ? Math.round(millisecondsAndBelow) + : Math.ceil(millisecondsAndBelow); + + const millisecondsString = millisecondsDecimalDigits + ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) + : roundedMilliseconds; + + add( + Number.parseFloat(millisecondsString), + 'millisecond', + 'ms', + millisecondsString, + ); + } + } else { + const seconds = ( + (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) + / 1000 + ) % 60; + const secondsDecimalDigits + = typeof options.secondsDecimalDigits === 'number' + ? options.secondsDecimalDigits + : 1; + const secondsFixed = floorDecimals(seconds, secondsDecimalDigits); + const secondsString = options.keepDecimalsOnWholeSeconds + ? secondsFixed + : secondsFixed.replace(/\.0+$/, ''); + add(Number.parseFloat(secondsString), 'second', 's', secondsString); + } + } + + if (result.length === 0) { + return sign + '0' + (options.verbose ? ' milliseconds' : 'ms'); + } + + const separator = options.colonNotation ? ':' : ' '; + if (typeof options.unitCount === 'number') { + result = result.slice(0, Math.max(options.unitCount, 1)); + } + + return sign + result.join(separator); +} + +const BYTE_UNITS = [ + 'B', + 'kB', + 'MB', + 'GB', + 'TB', + 'PB', + 'EB', + 'ZB', + 'YB', +]; + +const BIBYTE_UNITS = [ + 'B', + 'KiB', + 'MiB', + 'GiB', + 'TiB', + 'PiB', + 'EiB', + 'ZiB', + 'YiB', +]; + +const BIT_UNITS = [ + 'b', + 'kbit', + 'Mbit', + 'Gbit', + 'Tbit', + 'Pbit', + 'Ebit', + 'Zbit', + 'Ybit', +]; + +const BIBIT_UNITS = [ + 'b', + 'kibit', + 'Mibit', + 'Gibit', + 'Tibit', + 'Pibit', + 'Eibit', + 'Zibit', + 'Yibit', +]; + +/* +Formats the given number using `Number#toLocaleString`. +- If locale is a string, the value is expected to be a locale-key (for example: `de`). +- If locale is true, the system default locale is used for translation. +- If no value for locale is specified, the number is returned unmodified. +*/ +const toLocaleString = (number, locale, options) => { + let result = number; + if (typeof locale === 'string' || Array.isArray(locale)) { + result = number.toLocaleString(locale, options); + } else if (locale === true || options !== undefined) { + result = number.toLocaleString(undefined, options); + } + + return result; +}; + +function prettyBytes(number, options) { + if (!Number.isFinite(number)) { + throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`); + } + + options = { + bits: false, + binary: false, + space: true, + ...options, + }; + + const UNITS = options.bits + ? (options.binary ? BIBIT_UNITS : BIT_UNITS) + : (options.binary ? BIBYTE_UNITS : BYTE_UNITS); + + const separator = options.space ? ' ' : ''; + + if (options.signed && number === 0) { + return ` 0${separator}${UNITS[0]}`; + } + + const isNegative = number < 0; + const prefix = isNegative ? '-' : (options.signed ? '+' : ''); + + if (isNegative) { + number = -number; + } + + let localeOptions; + + if (options.minimumFractionDigits !== undefined) { + localeOptions = {minimumFractionDigits: options.minimumFractionDigits}; + } + + if (options.maximumFractionDigits !== undefined) { + localeOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions}; + } + + if (number < 1) { + const numberString = toLocaleString(number, options.locale, localeOptions); + return prefix + numberString + separator + UNITS[0]; + } + + const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1); + number /= (options.binary ? 1024 : 1000) ** exponent; + + if (!localeOptions) { + number = number.toPrecision(3); + } + + const numberString = toLocaleString(Number(number), options.locale, localeOptions); + + const unit = UNITS[exponent]; + + return prefix + numberString + separator + unit; +} + +function printTimings(timings) { + for (const [label, [time, memory, total]] of Object.entries(timings)) { + const appliedColor = label[0] === '#' ? (label[1] === '#' ? rollup.bold : rollup.underline) : (text) => text; + const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; + console.info(appliedColor(row)); + } +} + +async function build(inputOptions, warnings, silent = false) { + const env_1 = { stack: [], error: void 0, hasError: false }; + try { + const outputOptions = inputOptions.output; + const useStdout = !outputOptions[0].file && !outputOptions[0].dir; + const start = Date.now(); + const files = useStdout ? ['stdout'] : outputOptions.map(t => parseAst_js.relativeId(t.file || t.dir)); + if (!silent) { + let inputFiles; + if (typeof inputOptions.input === 'string') { + inputFiles = inputOptions.input; + } + else if (Array.isArray(inputOptions.input)) { + inputFiles = inputOptions.input.join(', '); + } + else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) { + inputFiles = Object.values(inputOptions.input).join(', '); + } + rollup.stderr(rollup.cyan$1(`\n${rollup.bold(inputFiles)} → ${rollup.bold(files.join(', '))}...`)); + } + const bundle = __addDisposableResource(env_1, await rollup.rollup(inputOptions), true); + if (useStdout) { + const output = outputOptions[0]; + if (output.sourcemap && output.sourcemap !== 'inline') { + rollup.handleError(parseAst_js.logOnlyInlineSourcemapsForStdout()); + } + const { output: outputs } = await bundle.generate(output); + for (const file of outputs) { + if (outputs.length > 1) + process$1.stdout.write(`\n${rollup.cyan$1(rollup.bold(`//→ ${file.fileName}:`))}\n`); + process$1.stdout.write(file.type === 'asset' ? file.source : file.code); + } + if (!silent) { + warnings.flush(); + } + return; + } + await Promise.all(outputOptions.map(bundle.write)); + if (!silent) { + warnings.flush(); + rollup.stderr(rollup.green(`created ${rollup.bold(files.join(', '))} in ${rollup.bold(prettyMilliseconds(Date.now() - start))}`)); + if (bundle && bundle.getTimings) { + printTimings(bundle.getTimings()); + } + } + } + catch (e_1) { + env_1.error = e_1; + env_1.hasError = true; + } + finally { + const result_1 = __disposeResources(env_1); + if (result_1) + await result_1; + } +} + +const DEFAULT_CONFIG_BASE = 'rollup.config'; +async function getConfigPath(commandConfig) { + if (commandConfig === true) { + return path.resolve(await findConfigFileNameInCwd()); + } + if (commandConfig.slice(0, 5) === 'node:') { + const packageName = commandConfig.slice(5); + try { + return require.resolve(`rollup-config-${packageName}`, { paths: [process$1.cwd()] }); + } + catch { + try { + return require.resolve(packageName, { paths: [process$1.cwd()] }); + } + catch (error) { + if (error.code === 'MODULE_NOT_FOUND') { + rollup.handleError(parseAst_js.logMissingExternalConfig(commandConfig)); + } + throw error; + } + } + } + return path.resolve(commandConfig); +} +async function findConfigFileNameInCwd() { + const filesInWorkingDirectory = new Set(await promises.readdir(process$1.cwd())); + for (const extension of ['mjs', 'cjs', 'ts']) { + const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`; + if (filesInWorkingDirectory.has(fileName)) + return fileName; + } + return `${DEFAULT_CONFIG_BASE}.js`; +} + +async function loadConfigFromCommand(commandOptions, watchMode) { + const warnings = loadConfigFile_js.batchWarnings(commandOptions); + if (!commandOptions.input && (commandOptions.stdin || !process$1.stdin.isTTY)) { + commandOptions.input = loadConfigFile_js.stdinName; + } + const options = await rollup.mergeOptions({ input: [] }, watchMode, commandOptions, warnings.log); + await loadConfigFile_js.addCommandPluginsToInputOptions(options, commandOptions); + return { options: [options], warnings }; +} + +async function runRollup(command) { + let inputSource; + if (command._.length > 0) { + if (command.input) { + rollup.handleError(parseAst_js.logDuplicateImportOptions()); + } + inputSource = command._; + } + else if (typeof command.input === 'string') { + inputSource = [command.input]; + } + else { + inputSource = command.input; + } + if (inputSource && inputSource.length > 0) { + if (inputSource.some((input) => input.includes('='))) { + command.input = {}; + for (const input of inputSource) { + const equalsIndex = input.indexOf('='); + const value = input.slice(Math.max(0, equalsIndex + 1)); + const key = input.slice(0, Math.max(0, equalsIndex)) || parseAst_js.getAliasName(input); + command.input[key] = value; + } + } + else { + command.input = inputSource; + } + } + if (command.environment) { + const environment = Array.isArray(command.environment) + ? command.environment + : [command.environment]; + for (const argument of environment) { + for (const pair of argument.split(',')) { + const [key, ...value] = pair.split(':'); + process$1.env[key] = value.length === 0 ? String(true) : value.join(':'); + } + } + } + if (rollup.isWatchEnabled(command.watch)) { + await fseventsImporter.loadFsEvents(); + const { watch } = await Promise.resolve().then(() => require('../shared/watch-cli.js')); + await watch(command); + } + else { + try { + const { options, warnings } = await getConfigs(command); + try { + for (const inputOptions of options) { + if (!inputOptions.cache) { + // We explicitly disable the cache when unused as the CLI will not + // use the cache object on the bundle when not in watch mode. This + // improves performance as the cache is not generated. + inputOptions.cache = false; + } + await build(inputOptions, warnings, command.silent); + } + if (command.failAfterWarnings && warnings.warningOccurred) { + warnings.flush(); + rollup.handleError(parseAst_js.logFailAfterWarnings()); + } + } + catch (error) { + warnings.flush(); + rollup.handleError(error); + } + } + catch (error) { + rollup.handleError(error); + } + } +} +async function getConfigs(command) { + if (command.config) { + const configFile = await getConfigPath(command.config); + const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command, false); + return { options, warnings }; + } + return await loadConfigFromCommand(command, false); +} + +const command = yargsParser(process$1.argv.slice(2), { + alias: rollup.commandAliases, + configuration: { 'camel-case-expansion': false } +}); +if (command.help || (process$1.argv.length <= 2 && process$1.stdin.isTTY)) { + console.log(`\n${help.replace('__VERSION__', rollup.version)}\n`); +} +else if (command.version) { + console.log(`rollup v${rollup.version}`); +} +else { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + require('source-map-support').install(); + } + catch { + // do nothing + } + const promise = runRollup(command); + if (command.forceExit) { + promise.then(() => process$1.exit()); + } +} + +exports.getConfigPath = getConfigPath; +exports.loadConfigFromCommand = loadConfigFromCommand; +exports.prettyMilliseconds = prettyMilliseconds; +exports.printTimings = printTimings; +//# sourceMappingURL=rollup.map diff --git a/seller_1/node_modules/rollup/dist/es/getLogFilter.js b/seller_1/node_modules/rollup/dist/es/getLogFilter.js new file mode 100644 index 0000000..af6826d --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/getLogFilter.js @@ -0,0 +1,64 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +const getLogFilter = filters => { + if (filters.length === 0) + return () => true; + const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => { + const inverted = subFilter.startsWith('!'); + if (inverted) + subFilter = subFilter.slice(1); + const [key, ...value] = subFilter.split(':'); + return { inverted, key: key.split('.'), parts: value.join(':').split('*') }; + })); + return (log) => { + nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) { + for (const { inverted, key, parts } of intersectedFilters) { + const isFilterSatisfied = testFilter(log, key, parts); + if (inverted ? isFilterSatisfied : !isFilterSatisfied) { + continue nextIntersectedFilter; + } + } + return true; + } + return false; + }; +}; +const testFilter = (log, key, parts) => { + let rawValue = log; + for (let index = 0; index < key.length; index++) { + if (!rawValue) { + return false; + } + const part = key[index]; + if (!(part in rawValue)) { + return false; + } + rawValue = rawValue[part]; + } + let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue); + if (parts.length === 1) { + return value === parts[0]; + } + if (!value.startsWith(parts[0])) { + return false; + } + const lastPartIndex = parts.length - 1; + for (let index = 1; index < lastPartIndex; index++) { + const part = parts[index]; + const position = value.indexOf(part); + if (position === -1) { + return false; + } + value = value.slice(position + part.length); + } + return value.endsWith(parts[lastPartIndex]); +}; + +export { getLogFilter }; diff --git a/seller_1/node_modules/rollup/dist/es/package.json b/seller_1/node_modules/rollup/dist/es/package.json new file mode 100644 index 0000000..7c34deb --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/seller_1/node_modules/rollup/dist/es/parseAst.js b/seller_1/node_modules/rollup/dist/es/parseAst.js new file mode 100644 index 0000000..0150402 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/parseAst.js @@ -0,0 +1,12 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import '../native.js'; +export { parseAst, parseAstAsync } from './shared/parseAst.js'; +import 'node:path'; diff --git a/seller_1/node_modules/rollup/dist/es/rollup.js b/seller_1/node_modules/rollup/dist/es/rollup.js new file mode 100644 index 0000000..8d5009f --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/rollup.js @@ -0,0 +1,18 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +export { version as VERSION, defineConfig, rollup, watch } from './shared/node-entry.js'; +import './shared/parseAst.js'; +import '../native.js'; +import 'node:path'; +import 'path'; +import 'node:process'; +import 'node:perf_hooks'; +import 'node:fs/promises'; +import 'tty'; diff --git a/seller_1/node_modules/rollup/dist/es/shared/node-entry.js b/seller_1/node_modules/rollup/dist/es/shared/node-entry.js new file mode 100644 index 0000000..3b4c02c --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/shared/node-entry.js @@ -0,0 +1,22276 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import { ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, ExpressionStatement as ExpressionStatement$1, logMissingExport, normalize, getImportPath, logMissingNodeBuiltins, logReservedNamespace, error, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logConstVariableReassignError, ArrowFunctionExpression as ArrowFunctionExpression$1, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logParseError, logModuleParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, Identifier as Identifier$1, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, EMPTY_OBJECT, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logCircularReexport, logInvalidFormatForTopLevelAwait, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, relativeId, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, warnDeprecation, URL_GENERATEBUNDLE, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, logInvalidExportOptionValue, URL_OUTPUT_INTEROP, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js'; +import { relative, dirname, basename, extname, resolve as resolve$1 } from 'node:path'; +import { posix, win32, isAbsolute, resolve } from 'path'; +import { parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../native.js'; +import process$1, { env as env$1 } from 'node:process'; +import { performance } from 'node:perf_hooks'; +import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises'; +import * as tty from 'tty'; + +var version = "4.28.1"; + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars$1.length; i++) { + const c = chars$1.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) + return false; + return reader.peek() !== comma; +} + +const bufLength = 1024 * 16; +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} +class StringReader { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +} + +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(';'); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) + sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } + else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } + else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) + sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +let Chunk$1 = class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +}; + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk$1(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk$1(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +let Bundle$1 = class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +}; + +function treeshakeNode(node, code, start, end) { + code.remove(start, end); + node.removeAnnotations(code); +} + +const NO_SEMICOLON = { isNoStatement: true }; +// This assumes there are only white-space and comments between start and the string we are looking for +function findFirstOccurrenceOutsideComment(code, searchString, start = 0) { + let searchPos, charCodeAfterSlash; + searchPos = code.indexOf(searchString, start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start >= searchPos) + return searchPos; + charCodeAfterSlash = code.charCodeAt(++start); + ++start; + // With our assumption, '/' always starts a comment. Determine comment type: + start = + charCodeAfterSlash === 47 /*"/"*/ + ? code.indexOf('\n', start) + 1 + : code.indexOf('*/', start) + 2; + if (start > searchPos) { + searchPos = code.indexOf(searchString, start); + } + } +} +const NON_WHITESPACE = /\S/g; +function findNonWhiteSpace(code, index) { + NON_WHITESPACE.lastIndex = index; + const result = NON_WHITESPACE.exec(code); + return result.index; +} +const WHITESPACE = /\s/; +function findLastWhiteSpaceReverse(code, start, end) { + while (true) { + if (start >= end) { + return end; + } + if (WHITESPACE.test(code[end - 1])) { + end--; + } + else { + return end; + } + } +} +// This assumes "code" only contains white-space and comments +// Returns position of line-comment if applicable +function findFirstLineBreakOutsideComment(code) { + let lineBreakPos, charCodeAfterSlash, start = 0; + lineBreakPos = code.indexOf('\n', start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start > lineBreakPos) + return [lineBreakPos, lineBreakPos + 1]; + // With our assumption, '/' always starts a comment. Determine comment type: + charCodeAfterSlash = code.charCodeAt(start + 1); + if (charCodeAfterSlash === 47 /*"/"*/) + return [start, lineBreakPos + 1]; + start = code.indexOf('*/', start + 2) + 2; + if (start > lineBreakPos) { + lineBreakPos = code.indexOf('\n', start); + } + } +} +function renderStatementList(statements, code, start, end, options) { + let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; + let nextNode = statements[0]; + let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; + if (nextNodeNeedsBoundaries) { + nextNodeStart = + start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1]; + } + for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { + currentNode = nextNode; + currentNodeStart = nextNodeStart; + currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; + nextNode = statements[nextIndex]; + nextNodeNeedsBoundaries = + nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; + if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { + nextNodeStart = + currentNode.end + + findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1]; + if (currentNode.included) { + if (currentNodeNeedsBoundaries) { + currentNode.render(code, options, { + end: nextNodeStart, + start: currentNodeStart + }); + } + else { + currentNode.render(code, options); + } + } + else { + treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart); + } + } + else { + currentNode.render(code, options); + } + } +} +// This assumes that the first character is not part of the first node +function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) { + const splitUpNodes = []; + let node, nextNodeStart, contentEnd, char; + let separator = start - 1; + for (const nextNode of nodes) { + if (node !== undefined) { + separator = + node.end + + findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); + } + nextNodeStart = contentEnd = + separator + + 1 + + findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1]; + while (((char = code.original.charCodeAt(nextNodeStart)), + char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/) + nextNodeStart++; + if (node !== undefined) { + splitUpNodes.push({ + contentEnd, + end: nextNodeStart, + node, + separator, + start + }); + } + node = nextNode; + start = nextNodeStart; + } + splitUpNodes.push({ + contentEnd: end, + end, + node: node, + separator: null, + start + }); + return splitUpNodes; +} +// This assumes there are only white-space and comments between start and end +function removeLineBreaks(code, start, end) { + while (true) { + const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end)); + if (removeStart === -1) { + break; + } + code.remove(start + removeStart, (start += removeEnd)); + } +} + +function getSystemExportStatement(exportedVariables, { exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }, modifier = '') { + if (exportedVariables.length === 1 && + exportNamesByVariable.get(exportedVariables[0]).length === 1) { + const variable = exportedVariables[0]; + return `exports(${JSON.stringify(exportNamesByVariable.get(variable)[0])},${_}${variable.getName(getPropertyAccess)}${modifier})`; + } + else { + const fields = []; + for (const variable of exportedVariables) { + for (const exportName of exportNamesByVariable.get(variable)) { + fields.push([exportName, variable.getName(getPropertyAccess) + modifier]); + } + } + return `exports(${getObject(fields, { lineBreakIndent: null })})`; + } +} +// This is only invoked if there is exactly one export name +function renderSystemExportExpression(exportedVariable, expressionStart, expressionEnd, code, { exportNamesByVariable, snippets: { _ } }) { + code.prependRight(expressionStart, `exports(${JSON.stringify(exportNamesByVariable.get(exportedVariable)[0])},${_}`); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportFunction(exportedVariables, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getDirectReturnIifeLeft } = options.snippets; + code.prependRight(expressionStart, getDirectReturnIifeLeft(['v'], `${getSystemExportStatement(exportedVariables, options)},${_}v`, { needsArrowReturnParens: true, needsWrappedFunction: needsParens })); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportSequenceAfterExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getPropertyAccess } = options.snippets; + code.appendLeft(expressionEnd, `,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(getPropertyAccess)}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} +function renderSystemExportSequenceBeforeExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options, modifier) { + const { _ } = options.snippets; + code.prependRight(expressionStart, `${getSystemExportStatement([exportedVariable], options, modifier)},${_}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} + +/** @import { Node } from 'estree' */ + +/** + * @param {Node} node + * @param {Node} parent + * @returns {boolean} + */ +function is_reference(node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && is_reference(node.object, node); + } + + if (node.type !== 'Identifier') return false; + + switch (parent?.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': + return parent.computed || node === parent.object; + + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': + return parent.computed; + + // disregard the `meta` in `import.meta` + case 'MetaProperty': + return parent.meta === node; + + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'PropertyDefinition': + return parent.computed || node === parent.value; + + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': + return parent.computed || node === parent.value; + + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': + return node === parent.local; + + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': + return false; + + default: + return true; + } +} + +const PureFunctionKey = Symbol('PureFunction'); +const getPureFunctions = ({ treeshake }) => { + const pureFunctions = Object.create(null); + for (const functionName of treeshake ? treeshake.manualPureFunctions : []) { + let currentFunctions = pureFunctions; + for (const pathSegment of functionName.split('.')) { + currentFunctions = currentFunctions[pathSegment] ||= Object.create(null); + } + currentFunctions[PureFunctionKey] = true; + } + return pureFunctions; +}; + +function getOrCreate(map, key, init) { + const existing = map.get(key); + if (existing !== undefined) { + return existing; + } + const value = init(); + map.set(key, value); + return value; +} +function getNewSet() { + return new Set(); +} +function getNewArray() { + return []; +} + +const UnknownKey = Symbol('Unknown Key'); +const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); +const UnknownInteger = Symbol('Unknown Integer'); +const SymbolToStringTag = Symbol('Symbol.toStringTag'); +const EMPTY_PATH = []; +const UNKNOWN_PATH = [UnknownKey]; +// For deoptimizations, this means we are modifying an unknown property but did +// not lose track of the object or are creating a setter/getter; +// For assignment effects it means we do not check for setter/getter effects +// but only if something is mutated that is included, which is relevant for +// Object.defineProperty +const UNKNOWN_NON_ACCESSOR_PATH = [UnknownNonAccessorKey]; +const UNKNOWN_INTEGER_PATH = [UnknownInteger]; +const EntitiesKey = Symbol('Entities'); +class PathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Set() } + }); + } + trackEntityAtPathAndGetIfTracked(path, entity) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } + withTrackedEntityAtPath(path, entity, onUntracked, returnIfTracked) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return returnIfTracked; + trackedEntities.add(entity); + const result = onUntracked(); + trackedEntities.delete(entity); + return result; + } + getEntities(path) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Set() } }); + } + return currentPaths[EntitiesKey]; + } +} +const SHARED_RECURSION_TRACKER = new PathTracker(); +class DiscriminatedPathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Map() } + }); + } + trackEntityAtPathAndGetIfTracked(path, discriminator, entity) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Map() } }); + } + const trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, (getNewSet)); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } +} + +function isFlagSet(flags, flag) { + return (flags & flag) !== 0; +} +function setFlag(flags, flag, value) { + return (flags & ~flag) | (-value & flag); +} + +const UnknownValue = Symbol('Unknown Value'); +const UnknownTruthyValue = Symbol('Unknown Truthy Value'); +class ExpressionEntity { + constructor() { + this.flags = 0; + } + get included() { + return isFlagSet(this.flags, 1 /* Flag.included */); + } + set included(value) { + this.flags = setFlag(this.flags, 1 /* Flag.included */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, _path, _recursionTracker) { + deoptimizeInteraction(interaction); + } + deoptimizePath(_path) { } + /** + * If possible it returns a stringifyable literal value for this node that + * can be used for inlining or comparing values. Otherwise, it should return + * UnknownValue. + */ + getLiteralValueAtPath(_path, _recursionTracker, _origin) { + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(_path, _interaction, _recursionTracker, _origin) { + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(_path, _interaction, _context) { + return true; + } + include(_context, _includeChildrenRecursively, _options) { + this.included = true; + } + includeCallArguments(context, parameters) { + for (const argument of parameters) { + argument.include(context, false); + } + } + shouldBeIncluded(_context) { + return true; + } +} +const UNKNOWN_EXPRESSION = new (class UnknownExpression extends ExpressionEntity { +})(); +const UNKNOWN_RETURN_EXPRESSION = [ + UNKNOWN_EXPRESSION, + false +]; +const deoptimizeInteraction = (interaction) => { + for (const argument of interaction.args) { + argument?.deoptimizePath(UNKNOWN_PATH); + } +}; + +const INTERACTION_ACCESSED = 0; +const INTERACTION_ASSIGNED = 1; +const INTERACTION_CALLED = 2; +const NODE_INTERACTION_UNKNOWN_ACCESS = { + args: [null], + type: INTERACTION_ACCESSED +}; +const NODE_INTERACTION_UNKNOWN_ASSIGNMENT = { + args: [null, UNKNOWN_EXPRESSION], + type: INTERACTION_ASSIGNED +}; +// While this is technically a call without arguments, we can compare against +// this reference in places where precise values or this argument would make a +// difference +const NODE_INTERACTION_UNKNOWN_CALL = { + args: [null], + type: INTERACTION_CALLED, + withNew: false +}; + +class Variable extends ExpressionEntity { + markReassigned() { + this.isReassigned = true; + } + constructor(name) { + super(); + this.name = name; + this.alwaysRendered = false; + this.forbiddenNames = null; + this.globalName = null; + this.initReached = false; + this.isId = false; + this.kind = null; + this.renderBaseName = null; + this.renderName = null; + this.isReassigned = false; + this.onlyFunctionCallUsed = true; + } + /** + * Binds identifiers that reference this variable to this variable. + * Necessary to be able to change variable names. + */ + addReference(_identifier) { } + /** + * Check if the identifier variable is only used as function call + * @returns true if the variable is only used as function call + */ + getOnlyFunctionCallUsed() { + return this.onlyFunctionCallUsed; + } + /** + * Collect the places where the identifier variable is used + * @param usedPlace Where the variable is used + */ + addUsedPlace(usedPlace) { + const isFunctionCall = usedPlace.parent.type === CallExpression$1 && + usedPlace.parent.callee === usedPlace; + if (!isFunctionCall && usedPlace.parent.type !== ExportDefaultDeclaration$1) { + this.onlyFunctionCallUsed = false; + } + } + /** + * Prevent this variable from being renamed to this name to avoid name + * collisions + */ + forbidName(name) { + (this.forbiddenNames ||= new Set()).add(name); + } + getBaseVariableName() { + return (this.renderedLikeHoisted?.getBaseVariableName() || + this.renderBaseName || + this.renderName || + this.name); + } + getName(getPropertyAccess, useOriginalName) { + if (this.globalName) { + return this.globalName; + } + if (useOriginalName?.(this)) { + return this.name; + } + if (this.renderedLikeHoisted) { + return this.renderedLikeHoisted.getName(getPropertyAccess, useOriginalName); + } + const name = this.renderName || this.name; + return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name; + } + hasEffectsOnInteractionAtPath(path, { type }, _context) { + return type !== INTERACTION_ACCESSED || path.length > 0; + } + /** + * Marks this variable as being part of the bundle, which is usually the case + * when one of its identifiers becomes part of the bundle. Returns true if it + * has not been included previously. Once a variable is included, it should + * take care all its declarations are included. + */ + include() { + this.included = true; + this.renderedLikeHoisted?.include(); + } + /** + * Links the rendered name of this variable to another variable and includes + * this variable if the other variable is included. + */ + renderLikeHoisted(variable) { + this.renderedLikeHoisted = variable; + } + markCalledFromTryStatement() { } + setRenderNames(baseName, name) { + this.renderBaseName = baseName; + this.renderName = name; + } +} + +class ExternalVariable extends Variable { + constructor(module, name) { + super(name); + this.referenced = false; + this.module = module; + this.isNamespace = name === '*'; + } + addReference(identifier) { + this.referenced = true; + if (this.name === 'default' || this.name === '*') { + this.module.suggestName(identifier.name); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); + } + include() { + super.include(); + this.module.used = true; + } +} + +function cacheObjectGetters(object, getterProperties) { + for (const property of getterProperties) { + const propertyGetter = Object.getOwnPropertyDescriptor(object, property).get; + Object.defineProperty(object, property, { + get() { + const value = propertyGetter.call(object); + // This replaces the getter with a fixed value for subsequent calls + Object.defineProperty(object, property, { value }); + return value; + } + }); + } +} + +const RESERVED_NAMES = new Set([ + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'NaN', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'undefined', + 'var', + 'void', + 'while', + 'with', + 'yield' +]); + +const illegalCharacters = /[^\w$]/g; +const startsWithDigit = (value) => /\d/.test(value[0]); +const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments'; +function isLegal(value) { + if (needsEscape(value)) { + return false; + } + return !illegalCharacters.test(value); +} +function makeLegal(value) { + value = value + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(illegalCharacters, '_'); + if (needsEscape(value)) + value = `_${value}`; + return value || '_'; +} +const VALID_IDENTIFIER_REGEXP = /^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u; +const NUMBER_REGEXP = /^(?:0|[1-9]\d*)$/; +function stringifyObjectKeyIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key === '__proto__' ? '["__proto__"]' : key; + } + if (NUMBER_REGEXP.test(key) && +key <= Number.MAX_SAFE_INTEGER) { + return key; + } + return JSON.stringify(key); +} +function stringifyIdentifierIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key; + } + return JSON.stringify(key); +} + +class ExternalModule { + constructor(options, id, moduleSideEffects, meta, renormalizeRenderPath, attributes) { + this.options = options; + this.id = id; + this.renormalizeRenderPath = renormalizeRenderPath; + this.dynamicImporters = []; + this.execIndex = Infinity; + this.exportedVariables = new Map(); + this.importers = []; + this.reexported = false; + this.used = false; + this.declarations = new Map(); + this.mostCommonSuggestion = 0; + this.nameSuggestions = new Map(); + this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()); + const { importers, dynamicImporters } = this; + this.info = { + ast: null, + attributes, + code: null, + dynamicallyImportedIdResolutions: EMPTY_ARRAY, + dynamicallyImportedIds: EMPTY_ARRAY, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + exportedBindings: null, + exports: null, + hasDefaultExport: null, + id, + implicitlyLoadedAfterOneOf: EMPTY_ARRAY, + implicitlyLoadedBefore: EMPTY_ARRAY, + importedIdResolutions: EMPTY_ARRAY, + importedIds: EMPTY_ARRAY, + get importers() { + return importers.sort(); + }, + isEntry: false, + isExternal: true, + isIncluded: null, + meta, + moduleSideEffects, + syntheticNamedExports: false + }; + } + cacheInfoGetters() { + cacheObjectGetters(this.info, ['dynamicImporters', 'importers']); + } + getVariableForExportName(name) { + const declaration = this.declarations.get(name); + if (declaration) + return [declaration]; + const externalVariable = new ExternalVariable(this, name); + this.declarations.set(name, externalVariable); + this.exportedVariables.set(externalVariable, name); + return [externalVariable]; + } + suggestName(name) { + const value = (this.nameSuggestions.get(name) ?? 0) + 1; + this.nameSuggestions.set(name, value); + if (value > this.mostCommonSuggestion) { + this.mostCommonSuggestion = value; + this.suggestedVariableName = name; + } + } + warnUnusedImports() { + const unused = [...this.declarations] + .filter(([name, declaration]) => name !== '*' && !declaration.included && !this.reexported && !declaration.referenced) + .map(([name]) => name); + if (unused.length === 0) + return; + const importersSet = new Set(); + for (const name of unused) { + for (const importer of this.declarations.get(name).module.importers) { + importersSet.add(importer); + } + } + const importersArray = [...importersSet]; + this.options.onLog(LOGLEVEL_WARN, logUnusedExternalImports(this.id, unused, importersArray)); + } +} + +function markModuleAndImpureDependenciesAsExecuted(baseModule) { + baseModule.isExecuted = true; + const modules = [baseModule]; + const visitedModules = new Set(); + for (const module of modules) { + for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { + if (!(dependency instanceof ExternalModule) && + !dependency.isExecuted && + (dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && + !visitedModules.has(dependency.id)) { + dependency.isExecuted = true; + visitedModules.add(dependency.id); + modules.push(dependency); + } + } + } +} + +const doNothing = () => { }; + +// This file is generated by scripts/generate-child-node-keys.js. +// Do not edit this file directly. +const childNodeKeys = { + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + AwaitExpression: ['argument'], + BinaryExpression: ['left', 'right'], + BlockStatement: ['body'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['decorators', 'id', 'superClass', 'body'], + ClassExpression: ['decorators', 'id', 'superClass', 'body'], + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + Decorator: ['expression'], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['exported', 'source', 'attributes'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['specifiers', 'source', 'attributes', 'declaration'], + ExportSpecifier: ['local', 'exported'], + ExpressionStatement: ['expression'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + ForStatement: ['init', 'test', 'update', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportAttribute: ['key', 'value'], + ImportDeclaration: ['specifiers', 'source', 'attributes'], + ImportDefaultSpecifier: ['local'], + ImportExpression: ['source', 'options'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + JSXAttribute: ['name', 'value'], + JSXClosingElement: ['name'], + JSXClosingFragment: [], + JSXElement: ['openingElement', 'children', 'closingElement'], + JSXEmptyExpression: [], + JSXExpressionContainer: ['expression'], + JSXFragment: ['openingFragment', 'children', 'closingFragment'], + JSXIdentifier: [], + JSXMemberExpression: ['object', 'property'], + JSXNamespacedName: ['namespace', 'name'], + JSXOpeningElement: ['name', 'attributes'], + JSXOpeningFragment: [], + JSXSpreadAttribute: ['argument'], + JSXSpreadChild: ['expression'], + JSXText: [], + LabeledStatement: ['label', 'body'], + Literal: [], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['decorators', 'key', 'value'], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + PanicError: [], + ParseError: [], + PrivateIdentifier: [], + Program: ['body'], + Property: ['key', 'value'], + PropertyDefinition: ['decorators', 'key', 'value'], + RestElement: ['argument'], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + StaticBlock: ['body'], + Super: [], + SwitchCase: ['test', 'consequent'], + SwitchStatement: ['discriminant', 'cases'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + YieldExpression: ['argument'] +}; + +function createInclusionContext() { + return { + brokenFlow: false, + hasBreak: false, + hasContinue: false, + includedCallArguments: new Set(), + includedLabels: new Set() + }; +} +function createHasEffectsContext() { + return { + accessed: new PathTracker(), + assigned: new PathTracker(), + brokenFlow: false, + called: new DiscriminatedPathTracker(), + hasBreak: false, + hasContinue: false, + ignore: { + breaks: false, + continues: false, + labels: new Set(), + returnYield: false, + this: false + }, + includedLabels: new Set(), + instantiated: new DiscriminatedPathTracker(), + replacedVariableInits: new Map() + }; +} + +const INCLUDE_PARAMETERS = 'variables'; +const IS_SKIPPED_CHAIN = Symbol('IS_SKIPPED_CHAIN'); +class NodeBase extends ExpressionEntity { + /** + * Nodes can apply custom deoptimizations once they become part of the + * executed code. To do this, they must initialize this as false, implement + * applyDeoptimizations and call this from include and hasEffects if they have + * custom handlers + */ + get deoptimized() { + return isFlagSet(this.flags, 2 /* Flag.deoptimized */); + } + set deoptimized(value) { + this.flags = setFlag(this.flags, 2 /* Flag.deoptimized */, value); + } + constructor(parent, parentScope) { + super(); + this.parent = parent; + this.scope = parentScope; + this.createScope(parentScope); + } + addExportedVariables(_variables, _exportNamesByVariable) { } + /** + * Override this to bind assignments to variables and do any initialisations + * that require the scopes to be populated with variables. + */ + bind() { + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (Array.isArray(value)) { + for (const child of value) { + child?.bind(); + } + } + else if (value) { + value.bind(); + } + } + } + /** + * Override if this node should receive a different scope than the parent + * scope. + */ + createScope(parentScope) { + this.scope = parentScope; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + if (child?.hasEffects(context)) + return true; + } + } + else if (value.hasEffects(context)) + return true; + } + return false; + } + hasEffectsAsAssignmentTarget(context, _checkAccess) { + return (this.hasEffects(context) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + include(context, includeChildrenRecursively, _options) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.include(context, includeChildrenRecursively); + } + } + else { + value.include(context, includeChildrenRecursively); + } + } + } + includeAsAssignmentTarget(context, includeChildrenRecursively, _deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + /** + * Override to perform special initialisation steps after the scope is + * initialised + */ + initialise() { + this.scope.context.magicString.addSourcemapLocation(this.start); + this.scope.context.magicString.addSourcemapLocation(this.end); + } + parseNode(esTreeNode) { + for (const [key, value] of Object.entries(esTreeNode)) { + // Skip properties defined on the class already. + // This way, we can override this function to add custom initialisation and then call super.parseNode + // Note: this doesn't skip properties with defined getters/setters which we use to pack wrap booleans + // in bitfields. Those are still assigned from the value in the esTreeNode. + if (this.hasOwnProperty(key)) + continue; + if (key.charCodeAt(0) === 95 /* _ */) { + if (key === ANNOTATION_KEY) { + this.annotations = value; + } + else if (key === INVALID_ANNOTATION_KEY) { + this.invalidAnnotations = value; + } + } + else if (typeof value !== 'object' || value === null) { + this[key] = value; + } + else if (Array.isArray(value)) { + this[key] = new Array(value.length); + let index = 0; + for (const child of value) { + this[key][index++] = + child === null + ? null + : new (this.scope.context.getNodeConstructor(child.type))(this, this.scope).parseNode(child); + } + } + else { + this[key] = new (this.scope.context.getNodeConstructor(value.type))(this, this.scope).parseNode(value); + } + } + // extend child keys for unknown node types + childNodeKeys[esTreeNode.type] ||= createChildNodeKeysForNode(esTreeNode); + this.initialise(); + return this; + } + removeAnnotations(code) { + if (this.annotations) { + for (const annotation of this.annotations) { + code.remove(annotation.start, annotation.end); + } + } + } + render(code, options) { + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.render(code, options); + } + } + else { + value.render(code, options); + } + } + } + setAssignedValue(value) { + this.assignmentInteraction = { args: [null, value], type: INTERACTION_ASSIGNED }; + } + shouldBeIncluded(context) { + return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); + } + /** + * Just deoptimize everything by default so that when e.g. we do not track + * something properly, it is deoptimized. + * @protected + */ + applyDeoptimizations() { + this.deoptimized = true; + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.deoptimizePath(UNKNOWN_PATH); + } + } + else { + value.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } +} +function createChildNodeKeysForNode(esTreeNode) { + return Object.keys(esTreeNode).filter(key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */); +} + +function isObjectExpressionNode(node) { + return node instanceof NodeBase && node.type === ObjectExpression$1; +} +function isPropertyNode(node) { + return node.type === Property$1; +} + +function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) { + return Object.create(inheritedDescriptions, memberDescriptions); +} +const UNDEFINED_EXPRESSION = new (class UndefinedExpression extends ExpressionEntity { + getLiteralValueAtPath() { + return undefined; + } +})(); +const returnsUnknown = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_EXPRESSION + } +}; +const UNKNOWN_LITERAL_BOOLEAN = new (class UnknownBoolean extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsBoolean = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_BOOLEAN + } +}; +const UNKNOWN_LITERAL_NUMBER = new (class UnknownNumber extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsNumber = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_NUMBER + } +}; +const UNKNOWN_LITERAL_STRING = new (class UnknownString extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsString = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_STRING + } +}; +const stringReplace = { + value: { + hasEffectsWhenCalled({ args }, context) { + const argument1 = args[2]; + return (args.length < 3 || + (typeof argument1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, { + deoptimizeCache() { } + }) === 'symbol' && + argument1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))); + }, + returns: UNKNOWN_LITERAL_STRING + } +}; +const objectMembers = assembleMemberDescriptions({ + hasOwnProperty: returnsBoolean, + isPrototypeOf: returnsBoolean, + propertyIsEnumerable: returnsBoolean, + toLocaleString: returnsString, + toString: returnsString, + valueOf: returnsUnknown +}); +const literalBooleanMembers = assembleMemberDescriptions({ + valueOf: returnsBoolean +}, objectMembers); +const literalNumberMembers = assembleMemberDescriptions({ + toExponential: returnsString, + toFixed: returnsString, + toLocaleString: returnsString, + toPrecision: returnsString, + valueOf: returnsNumber +}, objectMembers); +/** + * RegExp are stateful when they have the global or sticky flags set. + * But if we actually don't use them, the side effect does not matter. + * the check logic in `hasEffectsOnInteractionAtPath`. + */ +const literalRegExpMembers = assembleMemberDescriptions({ + exec: returnsUnknown, + test: returnsBoolean +}, objectMembers); +const literalStringMembers = assembleMemberDescriptions({ + anchor: returnsString, + at: returnsUnknown, + big: returnsString, + blink: returnsString, + bold: returnsString, + charAt: returnsString, + charCodeAt: returnsNumber, + codePointAt: returnsUnknown, + concat: returnsString, + endsWith: returnsBoolean, + fixed: returnsString, + fontcolor: returnsString, + fontsize: returnsString, + includes: returnsBoolean, + indexOf: returnsNumber, + italics: returnsString, + lastIndexOf: returnsNumber, + link: returnsString, + localeCompare: returnsNumber, + match: returnsUnknown, + matchAll: returnsUnknown, + normalize: returnsString, + padEnd: returnsString, + padStart: returnsString, + repeat: returnsString, + replace: stringReplace, + replaceAll: stringReplace, + search: returnsNumber, + slice: returnsString, + small: returnsString, + split: returnsUnknown, + startsWith: returnsBoolean, + strike: returnsString, + sub: returnsString, + substr: returnsString, + substring: returnsString, + sup: returnsString, + toLocaleLowerCase: returnsString, + toLocaleUpperCase: returnsString, + toLowerCase: returnsString, + toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString() + toUpperCase: returnsString, + trim: returnsString, + trimEnd: returnsString, + trimLeft: returnsString, + trimRight: returnsString, + trimStart: returnsString, + valueOf: returnsString +}, objectMembers); +function getLiteralMembersForValue(value) { + if (value instanceof RegExp) { + return literalRegExpMembers; + } + switch (typeof value) { + case 'boolean': { + return literalBooleanMembers; + } + case 'number': { + return literalNumberMembers; + } + case 'string': { + return literalStringMembers; + } + } + return Object.create(null); +} +function hasMemberEffectWhenCalled(members, memberName, interaction, context) { + if (typeof memberName !== 'string' || !members[memberName]) { + return true; + } + return members[memberName].hasEffectsWhenCalled?.(interaction, context) || false; +} +function getMemberReturnExpressionWhenCalled(members, memberName) { + if (typeof memberName !== 'string' || !members[memberName]) + return UNKNOWN_RETURN_EXPRESSION; + return [members[memberName].returns, false]; +} + +class SpreadElement extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 0) { + this.argument.deoptimizeArgumentsOnInteractionAtPath(interaction, UNKNOWN_PATH, recursionTracker); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (this.argument.hasEffects(context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.argument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)))); + } + applyDeoptimizations() { + this.deoptimized = true; + // Only properties of properties of the argument could become subject to reassignment + // This will also reassign the return values of iterators + this.argument.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } +} + +class Method extends ExpressionEntity { + constructor(description) { + super(); + this.description = description; + } + deoptimizeArgumentsOnInteractionAtPath({ args, type }, path) { + if (type === INTERACTION_CALLED && path.length === 0) { + if (this.description.mutatesSelfAsArray) { + args[0]?.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + if (this.description.mutatesArgs) { + for (let index = 1; index < args.length; index++) { + args[index].deoptimizePath(UNKNOWN_PATH); + } + } + } + } + getReturnExpressionWhenCalledAtPath(path, { args }) { + if (path.length > 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + return [ + this.description.returnsPrimitive || + (this.description.returns === 'self' + ? args[0] || UNKNOWN_EXPRESSION + : this.description.returns()), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) { + return true; + } + if (type === INTERACTION_CALLED) { + const { args } = interaction; + if (this.description.mutatesSelfAsArray === true && + args[0]?.hasEffectsOnInteractionAtPath(UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)) { + return true; + } + if (this.description.callsArgs) { + for (const argumentIndex of this.description.callsArgs) { + if (args[argumentIndex + 1]?.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)) { + return true; + } + } + } + } + return false; + } +} +const METHOD_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_RETURNS_STRING = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_STRING + }) +]; +const METHOD_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; + +const INTEGER_REG_EXP = /^\d+$/; +class ObjectEntity extends ExpressionEntity { + get hasLostTrack() { + return isFlagSet(this.flags, 2048 /* Flag.hasLostTrack */); + } + set hasLostTrack(value) { + this.flags = setFlag(this.flags, 2048 /* Flag.hasLostTrack */, value); + } + get hasUnknownDeoptimizedInteger() { + return isFlagSet(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */); + } + set hasUnknownDeoptimizedInteger(value) { + this.flags = setFlag(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */, value); + } + get hasUnknownDeoptimizedProperty() { + return isFlagSet(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */); + } + set hasUnknownDeoptimizedProperty(value) { + this.flags = setFlag(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */, value); + } + // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey + // and we assume there are no setters or getters + constructor(properties, prototypeExpression, immutable = false) { + super(); + this.prototypeExpression = prototypeExpression; + this.immutable = immutable; + this.additionalExpressionsToBeDeoptimized = new Set(); + this.allProperties = []; + this.deoptimizedPaths = Object.create(null); + this.expressionsToBeDeoptimizedByKey = Object.create(null); + this.gettersByKey = Object.create(null); + this.propertiesAndGettersByKey = Object.create(null); + this.propertiesAndSettersByKey = Object.create(null); + this.settersByKey = Object.create(null); + this.unknownIntegerProps = []; + this.unmatchableGetters = []; + this.unmatchablePropertiesAndGetters = []; + this.unmatchableSetters = []; + if (Array.isArray(properties)) { + this.buildPropertyMaps(properties); + } + else { + this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties; + for (const propertiesForKey of Object.values(properties)) { + this.allProperties.push(...propertiesForKey); + } + } + } + deoptimizeAllProperties(noAccessors) { + const isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty; + if (noAccessors) { + this.hasUnknownDeoptimizedProperty = true; + } + else { + this.hasLostTrack = true; + } + if (isDeoptimized) { + return; + } + for (const properties of [ + ...Object.values(this.propertiesAndGettersByKey), + ...Object.values(this.settersByKey) + ]) { + for (const property of properties) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + // While the prototype itself cannot be mutated, each property can + this.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]); + this.deoptimizeCachedEntities(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const [key, ...subPath] = path; + const { args, type } = interaction; + if (this.hasLostTrack || + // single paths that are deoptimized will not become getters or setters + ((type === INTERACTION_CALLED || path.length > 1) && + (this.hasUnknownDeoptimizedProperty || + (typeof key === 'string' && this.deoptimizedPaths[key])))) { + deoptimizeInteraction(interaction); + return; + } + const [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] = type === INTERACTION_CALLED || path.length > 1 + ? [ + this.propertiesAndGettersByKey, + this.propertiesAndGettersByKey, + this.unmatchablePropertiesAndGetters + ] + : type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesForExactMatchByKey[key]) { + const properties = relevantPropertiesByKey[key]; + if (properties) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + return; + } + for (const property of relevantUnmatchableProperties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + if (INTEGER_REG_EXP.test(key)) { + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + } + else { + for (const properties of [ + ...Object.values(relevantPropertiesByKey), + relevantUnmatchableProperties + ]) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeIntegerProperties() { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + this.hasUnknownDeoptimizedInteger) { + return; + } + this.hasUnknownDeoptimizedInteger = true; + for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const property of propertiesAndGetters) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + } + this.deoptimizeCachedIntegerEntities(); + } + // Assumption: If only a specific path is deoptimized, no accessors are created + deoptimizePath(path) { + if (this.hasLostTrack || this.immutable) { + return; + } + const key = path[0]; + if (path.length === 1) { + if (key === UnknownInteger) { + return this.deoptimizeIntegerProperties(); + } + else if (typeof key !== 'string') { + return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); + } + if (!this.deoptimizedPaths[key]) { + this.deoptimizedPaths[key] = true; + // we only deoptimizeCache exact matches as in all other cases, + // we do not return a literal value or return expression + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key]; + if (expressionsToBeDeoptimized) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + } + const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); + for (const property of typeof key === 'string' + ? [ + ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters), + ...(this.settersByKey[key] || this.unmatchableSetters) + ] + : this.allProperties) { + property.deoptimizePath(subPath); + } + this.prototypeExpression?.deoptimizePath(path.length === 1 ? [path[0], UnknownKey] : path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length === 0) { + return UnknownTruthyValue; + } + const key = path[0]; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (path.length === 1) { + return undefined; + } + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length === 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + const [key, ...subPath] = path; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getReturnExpressionWhenCalledAtPath(subPath, interaction, recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const [key, ...subPath] = path; + if (subPath.length > 0 || interaction.type === INTERACTION_CALLED) { + const expressionAtPath = this.getMemberExpression(key); + if (expressionAtPath) { + return expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context); + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return true; + } + if (key === UnknownNonAccessorKey) + return false; + if (this.hasLostTrack) + return true; + const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesAndAccessorsByKey[key]) { + const accessors = accessorsByKey[key]; + if (accessors) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + return false; + } + for (const accessor of unmatchableAccessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) { + return true; + } + } + } + else { + for (const accessors of [...Object.values(accessorsByKey), unmatchableAccessors]) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return false; + } + buildPropertyMaps(properties) { + const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchableGetters, unmatchableSetters } = this; + const unmatchablePropertiesAndSetters = []; + for (let index = properties.length - 1; index >= 0; index--) { + const { key, kind, property } = properties[index]; + allProperties.push(property); + if (typeof key === 'string') { + if (kind === 'set') { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + settersByKey[key] = [property, ...unmatchableSetters]; + } + } + else if (kind === 'get') { + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + gettersByKey[key] = [property, ...unmatchableGetters]; + } + } + else { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + } + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + } + } + } + else { + if (key === UnknownInteger) { + unknownIntegerProps.push(property); + continue; + } + if (kind === 'set') + unmatchableSetters.push(property); + if (kind === 'get') + unmatchableGetters.push(property); + if (kind !== 'get') + unmatchablePropertiesAndSetters.push(property); + if (kind !== 'set') + unmatchablePropertiesAndGetters.push(property); + } + } + } + deoptimizeCachedEntities() { + for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + deoptimizeCachedIntegerEntities() { + for (const [key, expressionsToBeDeoptimized] of Object.entries(this.expressionsToBeDeoptimizedByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + } + getMemberExpression(key) { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + typeof key !== 'string' || + (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) || + this.deoptimizedPaths[key]) { + return UNKNOWN_EXPRESSION; + } + const properties = this.propertiesAndGettersByKey[key]; + if (properties?.length === 1) { + return properties[0]; + } + if (properties || + this.unmatchablePropertiesAndGetters.length > 0 || + (this.unknownIntegerProps.length > 0 && INTEGER_REG_EXP.test(key))) { + return UNKNOWN_EXPRESSION; + } + return null; + } + getMemberExpressionAndTrackDeopt(key, origin) { + if (typeof key !== 'string') { + return UNKNOWN_EXPRESSION; + } + const expression = this.getMemberExpression(key); + if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) { + const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] = + this.expressionsToBeDeoptimizedByKey[key] || []); + expressionsToBeDeoptimized.push(origin); + } + return expression; + } +} + +const isInteger = (property) => typeof property === 'string' && /^\d+$/.test(property); +// This makes sure unknown properties are not handled as "undefined" but as +// "unknown" but without access side effects. An exception is done for numeric +// properties as we do not expect new builtin properties to be numbers, this +// will improve tree-shaking for out-of-bounds array properties +const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity { + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + if (interaction.type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) { + deoptimizeInteraction(interaction); + } + } + getLiteralValueAtPath(path) { + // We ignore number properties as we do not expect new properties to be + // numbers and also want to keep handling out-of-bound array elements as + // "undefined" + return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type === INTERACTION_CALLED; + } +})(); +const OBJECT_PROTOTYPE = new ObjectEntity({ + __proto__: null, + hasOwnProperty: METHOD_RETURNS_BOOLEAN, + isPrototypeOf: METHOD_RETURNS_BOOLEAN, + propertyIsEnumerable: METHOD_RETURNS_BOOLEAN, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + valueOf: METHOD_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE_FALLBACK, true); + +const NEW_ARRAY_PROPERTIES = [ + { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION }, + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: true, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const ARRAY_PROTOTYPE = new ObjectEntity({ + __proto__: null, + // We assume that accessors have effects as we do not track the accessed value afterwards + at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN, + concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF, + entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + fill: METHOD_MUTATES_SELF_RETURNS_SELF, + filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + includes: METHOD_RETURNS_BOOLEAN, + indexOf: METHOD_RETURNS_NUMBER, + join: METHOD_RETURNS_STRING, + keys: METHOD_RETURNS_UNKNOWN, + lastIndexOf: METHOD_RETURNS_NUMBER, + map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + push: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reverse: METHOD_MUTATES_SELF_RETURNS_SELF, + shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF, + splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + unshift: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE, true); + +class ArrayExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { + this.deoptimized = true; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (element && (hasSpread || element instanceof SpreadElement)) { + hasSpread = true; + element.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const properties = [ + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } + ]; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (hasSpread || element instanceof SpreadElement) { + if (element) { + hasSpread = true; + properties.unshift({ key: UnknownInteger, kind: 'init', property: element }); + } + } + else if (element) { + properties.push({ key: String(index), kind: 'init', property: element }); + } + else { + properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION }); + } + } + return (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE)); + } +} + +/* eslint sort-keys: "off" */ +const ValueProperties = Symbol('Value Properties'); +const getTruthyLiteralValue = () => UnknownTruthyValue; +const returnFalse = () => false; +const returnTrue = () => true; +const PURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse +}; +const IMPURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnTrue +}; +const PURE_WITH_ARRAY = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }) { + return args.length > 1 && !(args[1] instanceof ArrayExpression); + } +}; +const GETTER_ACCESS = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + const [_thisArgument, firstArgument] = args; + return (!(firstArgument instanceof ExpressionEntity) || + firstArgument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } +}; +// We use shortened variables to reduce file size here +/* OBJECT */ +const O = { + __proto__: null, + [ValueProperties]: IMPURE +}; +/* PURE FUNCTION */ +const PF = { + __proto__: null, + [ValueProperties]: PURE +}; +/* PURE FUNCTION IF FIRST ARG DOES NOT CONTAIN A GETTER */ +const PF_NO_GETTER = { + __proto__: null, + [ValueProperties]: GETTER_ACCESS +}; +/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */ +const MUTATES_ARG_WITHOUT_ACCESSOR = { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args: [, firstArgument] }) { + firstArgument?.deoptimizePath(UNKNOWN_PATH); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + return (args.length <= 1 || + args[1].hasEffectsOnInteractionAtPath(UNKNOWN_NON_ACCESSOR_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)); + } + } +}; +/* CONSTRUCTOR */ +const C = { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O +}; +/* PURE CONSTRUCTOR */ +const PC = { + __proto__: null, + [ValueProperties]: PURE, + prototype: O +}; +const PC_WITH_ARRAY = { + __proto__: null, + [ValueProperties]: PURE_WITH_ARRAY, + prototype: O +}; +const ARRAY_TYPE = { + __proto__: null, + [ValueProperties]: PURE, + from: O, + of: PF, + prototype: O +}; +const INTL_MEMBER = { + __proto__: null, + [ValueProperties]: PURE, + supportedLocalesOf: PC +}; +const knownGlobals = { + // Placeholders for global objects to avoid shape mutations + global: O, + globalThis: O, + self: O, + window: O, + // Common globals + __proto__: null, + [ValueProperties]: IMPURE, + Array: { + __proto__: null, + [ValueProperties]: IMPURE, + from: O, + isArray: PF, + of: PF, + prototype: O + }, + ArrayBuffer: { + __proto__: null, + [ValueProperties]: PURE, + isView: PF, + prototype: O + }, + AggregateError: PC_WITH_ARRAY, + Atomics: O, + BigInt: C, + BigInt64Array: C, + BigUint64Array: C, + Boolean: PC, + constructor: C, + DataView: PC, + Date: { + __proto__: null, + [ValueProperties]: PURE, + now: PF, + parse: PF, + prototype: O, + UTC: PF + }, + decodeURI: PF, + decodeURIComponent: PF, + encodeURI: PF, + encodeURIComponent: PF, + Error: PC, + escape: PF, + eval: O, + EvalError: PC, + FinalizationRegistry: C, + Float32Array: ARRAY_TYPE, + Float64Array: ARRAY_TYPE, + Function: C, + hasOwnProperty: O, + Infinity: O, + Int16Array: ARRAY_TYPE, + Int32Array: ARRAY_TYPE, + Int8Array: ARRAY_TYPE, + isFinite: PF, + isNaN: PF, + isPrototypeOf: O, + JSON: O, + Map: PC_WITH_ARRAY, + Math: { + __proto__: null, + [ValueProperties]: IMPURE, + abs: PF, + acos: PF, + acosh: PF, + asin: PF, + asinh: PF, + atan: PF, + atan2: PF, + atanh: PF, + cbrt: PF, + ceil: PF, + clz32: PF, + cos: PF, + cosh: PF, + exp: PF, + expm1: PF, + floor: PF, + fround: PF, + hypot: PF, + imul: PF, + log: PF, + log10: PF, + log1p: PF, + log2: PF, + max: PF, + min: PF, + pow: PF, + random: PF, + round: PF, + sign: PF, + sin: PF, + sinh: PF, + sqrt: PF, + tan: PF, + tanh: PF, + trunc: PF + }, + NaN: O, + Number: { + __proto__: null, + [ValueProperties]: PURE, + isFinite: PF, + isInteger: PF, + isNaN: PF, + isSafeInteger: PF, + parseFloat: PF, + parseInt: PF, + prototype: O + }, + Object: { + __proto__: null, + [ValueProperties]: PURE, + create: PF, + // Technically those can throw in certain situations, but we ignore this as + // code that relies on this will hopefully wrap this in a try-catch, which + // deoptimizes everything anyway + defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR, + defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR, + freeze: MUTATES_ARG_WITHOUT_ACCESSOR, + getOwnPropertyDescriptor: PF, + getOwnPropertyDescriptors: PF, + getOwnPropertyNames: PF, + getOwnPropertySymbols: PF, + getPrototypeOf: PF, + hasOwn: PF, + is: PF, + isExtensible: PF, + isFrozen: PF, + isSealed: PF, + keys: PF, + fromEntries: O, + entries: PF_NO_GETTER, + values: PF_NO_GETTER, + prototype: O + }, + parseFloat: PF, + parseInt: PF, + Promise: { + __proto__: null, + [ValueProperties]: IMPURE, + all: O, + allSettled: O, + any: O, + prototype: O, + race: O, + reject: O, + resolve: O + }, + propertyIsEnumerable: O, + Proxy: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall: ({ args: [, target, parameter] }) => { + if (isObjectExpressionNode(parameter)) { + const hasSpreadElement = parameter.properties.some(property => !isPropertyNode(property)); + if (!hasSpreadElement) { + for (const property of parameter.properties) { + property.deoptimizeArgumentsOnInteractionAtPath({ + args: [null, target], + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, SHARED_RECURSION_TRACKER); + } + return; + } + } + target.deoptimizePath(UNKNOWN_PATH); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnTrue + } + }, + RangeError: PC, + ReferenceError: PC, + Reflect: O, + RegExp: PC, + Set: PC_WITH_ARRAY, + SharedArrayBuffer: C, + String: { + __proto__: null, + [ValueProperties]: PURE, + fromCharCode: PF, + fromCodePoint: PF, + prototype: O, + raw: PF + }, + Symbol: { + __proto__: null, + [ValueProperties]: PURE, + for: PF, + keyFor: PF, + prototype: O, + toStringTag: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue() { + return SymbolToStringTag; + }, + hasEffectsWhenCalled: returnTrue + } + } + }, + SyntaxError: PC, + toLocaleString: O, + toString: O, + TypeError: PC, + Uint16Array: ARRAY_TYPE, + Uint32Array: ARRAY_TYPE, + Uint8Array: ARRAY_TYPE, + Uint8ClampedArray: ARRAY_TYPE, + // Technically, this is a global, but it needs special handling + // undefined: ?, + unescape: PF, + URIError: PC, + valueOf: O, + WeakMap: PC_WITH_ARRAY, + WeakRef: C, + WeakSet: PC_WITH_ARRAY, + // Additional globals shared by Node and Browser that are not strictly part of the language + clearInterval: C, + clearTimeout: C, + console: { + __proto__: null, + [ValueProperties]: IMPURE, + assert: C, + clear: C, + count: C, + countReset: C, + debug: C, + dir: C, + dirxml: C, + error: C, + exception: C, + group: C, + groupCollapsed: C, + groupEnd: C, + info: C, + log: C, + table: C, + time: C, + timeEnd: C, + timeLog: C, + trace: C, + warn: C + }, + Intl: { + __proto__: null, + [ValueProperties]: IMPURE, + Collator: INTL_MEMBER, + DateTimeFormat: INTL_MEMBER, + DisplayNames: INTL_MEMBER, + ListFormat: INTL_MEMBER, + Locale: INTL_MEMBER, + NumberFormat: INTL_MEMBER, + PluralRules: INTL_MEMBER, + RelativeTimeFormat: INTL_MEMBER, + Segmenter: INTL_MEMBER + }, + setInterval: C, + setTimeout: C, + TextDecoder: C, + TextEncoder: C, + URL: { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O, + canParse: PF + }, + URLSearchParams: C, + // Browser specific globals + AbortController: C, + AbortSignal: C, + addEventListener: O, + alert: O, + AnalyserNode: C, + Animation: C, + AnimationEvent: C, + applicationCache: O, + ApplicationCache: C, + ApplicationCacheErrorEvent: C, + atob: O, + Attr: C, + Audio: C, + AudioBuffer: C, + AudioBufferSourceNode: C, + AudioContext: C, + AudioDestinationNode: C, + AudioListener: C, + AudioNode: C, + AudioParam: C, + AudioProcessingEvent: C, + AudioScheduledSourceNode: C, + AudioWorkletNode: C, + BarProp: C, + BaseAudioContext: C, + BatteryManager: C, + BeforeUnloadEvent: C, + BiquadFilterNode: C, + Blob: C, + BlobEvent: C, + blur: O, + BroadcastChannel: C, + btoa: O, + ByteLengthQueuingStrategy: C, + Cache: C, + caches: O, + CacheStorage: C, + cancelAnimationFrame: O, + cancelIdleCallback: O, + CanvasCaptureMediaStreamTrack: C, + CanvasGradient: C, + CanvasPattern: C, + CanvasRenderingContext2D: C, + ChannelMergerNode: C, + ChannelSplitterNode: C, + CharacterData: C, + clientInformation: O, + ClipboardEvent: C, + close: O, + closed: O, + CloseEvent: C, + Comment: C, + CompositionEvent: C, + confirm: O, + ConstantSourceNode: C, + ConvolverNode: C, + CountQueuingStrategy: C, + createImageBitmap: O, + Credential: C, + CredentialsContainer: C, + crypto: O, + Crypto: C, + CryptoKey: C, + CSS: C, + CSSConditionRule: C, + CSSFontFaceRule: C, + CSSGroupingRule: C, + CSSImportRule: C, + CSSKeyframeRule: C, + CSSKeyframesRule: C, + CSSMediaRule: C, + CSSNamespaceRule: C, + CSSPageRule: C, + CSSRule: C, + CSSRuleList: C, + CSSStyleDeclaration: C, + CSSStyleRule: C, + CSSStyleSheet: C, + CSSSupportsRule: C, + CustomElementRegistry: C, + customElements: O, + CustomEvent: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args }) { + args[2]?.deoptimizePath(['detail']); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse + }, + prototype: O + }, + DataTransfer: C, + DataTransferItem: C, + DataTransferItemList: C, + defaultstatus: O, + defaultStatus: O, + DelayNode: C, + DeviceMotionEvent: C, + DeviceOrientationEvent: C, + devicePixelRatio: O, + dispatchEvent: O, + document: O, + Document: C, + DocumentFragment: C, + DocumentType: C, + DOMError: C, + DOMException: C, + DOMImplementation: C, + DOMMatrix: C, + DOMMatrixReadOnly: C, + DOMParser: C, + DOMPoint: C, + DOMPointReadOnly: C, + DOMQuad: C, + DOMRect: C, + DOMRectReadOnly: C, + DOMStringList: C, + DOMStringMap: C, + DOMTokenList: C, + DragEvent: C, + DynamicsCompressorNode: C, + Element: C, + ErrorEvent: C, + Event: C, + EventSource: C, + EventTarget: C, + external: O, + fetch: O, + File: C, + FileList: C, + FileReader: C, + find: O, + focus: O, + FocusEvent: C, + FontFace: C, + FontFaceSetLoadEvent: C, + FormData: C, + frames: O, + GainNode: C, + Gamepad: C, + GamepadButton: C, + GamepadEvent: C, + getComputedStyle: O, + getSelection: O, + HashChangeEvent: C, + Headers: C, + history: O, + History: C, + HTMLAllCollection: C, + HTMLAnchorElement: C, + HTMLAreaElement: C, + HTMLAudioElement: C, + HTMLBaseElement: C, + HTMLBodyElement: C, + HTMLBRElement: C, + HTMLButtonElement: C, + HTMLCanvasElement: C, + HTMLCollection: C, + HTMLContentElement: C, + HTMLDataElement: C, + HTMLDataListElement: C, + HTMLDetailsElement: C, + HTMLDialogElement: C, + HTMLDirectoryElement: C, + HTMLDivElement: C, + HTMLDListElement: C, + HTMLDocument: C, + HTMLElement: C, + HTMLEmbedElement: C, + HTMLFieldSetElement: C, + HTMLFontElement: C, + HTMLFormControlsCollection: C, + HTMLFormElement: C, + HTMLFrameElement: C, + HTMLFrameSetElement: C, + HTMLHeadElement: C, + HTMLHeadingElement: C, + HTMLHRElement: C, + HTMLHtmlElement: C, + HTMLIFrameElement: C, + HTMLImageElement: C, + HTMLInputElement: C, + HTMLLabelElement: C, + HTMLLegendElement: C, + HTMLLIElement: C, + HTMLLinkElement: C, + HTMLMapElement: C, + HTMLMarqueeElement: C, + HTMLMediaElement: C, + HTMLMenuElement: C, + HTMLMetaElement: C, + HTMLMeterElement: C, + HTMLModElement: C, + HTMLObjectElement: C, + HTMLOListElement: C, + HTMLOptGroupElement: C, + HTMLOptionElement: C, + HTMLOptionsCollection: C, + HTMLOutputElement: C, + HTMLParagraphElement: C, + HTMLParamElement: C, + HTMLPictureElement: C, + HTMLPreElement: C, + HTMLProgressElement: C, + HTMLQuoteElement: C, + HTMLScriptElement: C, + HTMLSelectElement: C, + HTMLShadowElement: C, + HTMLSlotElement: C, + HTMLSourceElement: C, + HTMLSpanElement: C, + HTMLStyleElement: C, + HTMLTableCaptionElement: C, + HTMLTableCellElement: C, + HTMLTableColElement: C, + HTMLTableElement: C, + HTMLTableRowElement: C, + HTMLTableSectionElement: C, + HTMLTemplateElement: C, + HTMLTextAreaElement: C, + HTMLTimeElement: C, + HTMLTitleElement: C, + HTMLTrackElement: C, + HTMLUListElement: C, + HTMLUnknownElement: C, + HTMLVideoElement: C, + IDBCursor: C, + IDBCursorWithValue: C, + IDBDatabase: C, + IDBFactory: C, + IDBIndex: C, + IDBKeyRange: C, + IDBObjectStore: C, + IDBOpenDBRequest: C, + IDBRequest: C, + IDBTransaction: C, + IDBVersionChangeEvent: C, + IdleDeadline: C, + IIRFilterNode: C, + Image: C, + ImageBitmap: C, + ImageBitmapRenderingContext: C, + ImageCapture: C, + ImageData: C, + indexedDB: O, + innerHeight: O, + innerWidth: O, + InputEvent: C, + IntersectionObserver: C, + IntersectionObserverEntry: C, + isSecureContext: O, + KeyboardEvent: C, + KeyframeEffect: C, + length: O, + localStorage: O, + location: O, + Location: C, + locationbar: O, + matchMedia: O, + MediaDeviceInfo: C, + MediaDevices: C, + MediaElementAudioSourceNode: C, + MediaEncryptedEvent: C, + MediaError: C, + MediaKeyMessageEvent: C, + MediaKeySession: C, + MediaKeyStatusMap: C, + MediaKeySystemAccess: C, + MediaList: C, + MediaQueryList: C, + MediaQueryListEvent: C, + MediaRecorder: C, + MediaSettingsRange: C, + MediaSource: C, + MediaStream: C, + MediaStreamAudioDestinationNode: C, + MediaStreamAudioSourceNode: C, + MediaStreamEvent: C, + MediaStreamTrack: C, + MediaStreamTrackEvent: C, + menubar: O, + MessageChannel: C, + MessageEvent: C, + MessagePort: C, + MIDIAccess: C, + MIDIConnectionEvent: C, + MIDIInput: C, + MIDIInputMap: C, + MIDIMessageEvent: C, + MIDIOutput: C, + MIDIOutputMap: C, + MIDIPort: C, + MimeType: C, + MimeTypeArray: C, + MouseEvent: C, + moveBy: O, + moveTo: O, + MutationEvent: C, + MutationObserver: C, + MutationRecord: C, + name: O, + NamedNodeMap: C, + NavigationPreloadManager: C, + navigator: O, + Navigator: C, + NetworkInformation: C, + Node: C, + NodeFilter: O, + NodeIterator: C, + NodeList: C, + Notification: C, + OfflineAudioCompletionEvent: C, + OfflineAudioContext: C, + offscreenBuffering: O, + OffscreenCanvas: C, + open: O, + openDatabase: O, + Option: C, + origin: O, + OscillatorNode: C, + outerHeight: O, + outerWidth: O, + PageTransitionEvent: C, + pageXOffset: O, + pageYOffset: O, + PannerNode: C, + parent: O, + Path2D: C, + PaymentAddress: C, + PaymentRequest: C, + PaymentRequestUpdateEvent: C, + PaymentResponse: C, + performance: O, + Performance: C, + PerformanceEntry: C, + PerformanceLongTaskTiming: C, + PerformanceMark: C, + PerformanceMeasure: C, + PerformanceNavigation: C, + PerformanceNavigationTiming: C, + PerformanceObserver: C, + PerformanceObserverEntryList: C, + PerformancePaintTiming: C, + PerformanceResourceTiming: C, + PerformanceTiming: C, + PeriodicWave: C, + Permissions: C, + PermissionStatus: C, + personalbar: O, + PhotoCapabilities: C, + Plugin: C, + PluginArray: C, + PointerEvent: C, + PopStateEvent: C, + postMessage: O, + Presentation: C, + PresentationAvailability: C, + PresentationConnection: C, + PresentationConnectionAvailableEvent: C, + PresentationConnectionCloseEvent: C, + PresentationConnectionList: C, + PresentationReceiver: C, + PresentationRequest: C, + print: O, + ProcessingInstruction: C, + ProgressEvent: C, + PromiseRejectionEvent: C, + prompt: O, + PushManager: C, + PushSubscription: C, + PushSubscriptionOptions: C, + queueMicrotask: O, + RadioNodeList: C, + Range: C, + ReadableStream: C, + RemotePlayback: C, + removeEventListener: O, + Request: C, + requestAnimationFrame: O, + requestIdleCallback: O, + resizeBy: O, + ResizeObserver: C, + ResizeObserverEntry: C, + resizeTo: O, + Response: C, + RTCCertificate: C, + RTCDataChannel: C, + RTCDataChannelEvent: C, + RTCDtlsTransport: C, + RTCIceCandidate: C, + RTCIceTransport: C, + RTCPeerConnection: C, + RTCPeerConnectionIceEvent: C, + RTCRtpReceiver: C, + RTCRtpSender: C, + RTCSctpTransport: C, + RTCSessionDescription: C, + RTCStatsReport: C, + RTCTrackEvent: C, + screen: O, + Screen: C, + screenLeft: O, + ScreenOrientation: C, + screenTop: O, + screenX: O, + screenY: O, + ScriptProcessorNode: C, + scroll: O, + scrollbars: O, + scrollBy: O, + scrollTo: O, + scrollX: O, + scrollY: O, + SecurityPolicyViolationEvent: C, + Selection: C, + ServiceWorker: C, + ServiceWorkerContainer: C, + ServiceWorkerRegistration: C, + sessionStorage: O, + ShadowRoot: C, + SharedWorker: C, + SourceBuffer: C, + SourceBufferList: C, + speechSynthesis: O, + SpeechSynthesisEvent: C, + SpeechSynthesisUtterance: C, + StaticRange: C, + status: O, + statusbar: O, + StereoPannerNode: C, + stop: O, + Storage: C, + StorageEvent: C, + StorageManager: C, + styleMedia: O, + StyleSheet: C, + StyleSheetList: C, + SubtleCrypto: C, + SVGAElement: C, + SVGAngle: C, + SVGAnimatedAngle: C, + SVGAnimatedBoolean: C, + SVGAnimatedEnumeration: C, + SVGAnimatedInteger: C, + SVGAnimatedLength: C, + SVGAnimatedLengthList: C, + SVGAnimatedNumber: C, + SVGAnimatedNumberList: C, + SVGAnimatedPreserveAspectRatio: C, + SVGAnimatedRect: C, + SVGAnimatedString: C, + SVGAnimatedTransformList: C, + SVGAnimateElement: C, + SVGAnimateMotionElement: C, + SVGAnimateTransformElement: C, + SVGAnimationElement: C, + SVGCircleElement: C, + SVGClipPathElement: C, + SVGComponentTransferFunctionElement: C, + SVGDefsElement: C, + SVGDescElement: C, + SVGDiscardElement: C, + SVGElement: C, + SVGEllipseElement: C, + SVGFEBlendElement: C, + SVGFEColorMatrixElement: C, + SVGFEComponentTransferElement: C, + SVGFECompositeElement: C, + SVGFEConvolveMatrixElement: C, + SVGFEDiffuseLightingElement: C, + SVGFEDisplacementMapElement: C, + SVGFEDistantLightElement: C, + SVGFEDropShadowElement: C, + SVGFEFloodElement: C, + SVGFEFuncAElement: C, + SVGFEFuncBElement: C, + SVGFEFuncGElement: C, + SVGFEFuncRElement: C, + SVGFEGaussianBlurElement: C, + SVGFEImageElement: C, + SVGFEMergeElement: C, + SVGFEMergeNodeElement: C, + SVGFEMorphologyElement: C, + SVGFEOffsetElement: C, + SVGFEPointLightElement: C, + SVGFESpecularLightingElement: C, + SVGFESpotLightElement: C, + SVGFETileElement: C, + SVGFETurbulenceElement: C, + SVGFilterElement: C, + SVGForeignObjectElement: C, + SVGGElement: C, + SVGGeometryElement: C, + SVGGradientElement: C, + SVGGraphicsElement: C, + SVGImageElement: C, + SVGLength: C, + SVGLengthList: C, + SVGLinearGradientElement: C, + SVGLineElement: C, + SVGMarkerElement: C, + SVGMaskElement: C, + SVGMatrix: C, + SVGMetadataElement: C, + SVGMPathElement: C, + SVGNumber: C, + SVGNumberList: C, + SVGPathElement: C, + SVGPatternElement: C, + SVGPoint: C, + SVGPointList: C, + SVGPolygonElement: C, + SVGPolylineElement: C, + SVGPreserveAspectRatio: C, + SVGRadialGradientElement: C, + SVGRect: C, + SVGRectElement: C, + SVGScriptElement: C, + SVGSetElement: C, + SVGStopElement: C, + SVGStringList: C, + SVGStyleElement: C, + SVGSVGElement: C, + SVGSwitchElement: C, + SVGSymbolElement: C, + SVGTextContentElement: C, + SVGTextElement: C, + SVGTextPathElement: C, + SVGTextPositioningElement: C, + SVGTitleElement: C, + SVGTransform: C, + SVGTransformList: C, + SVGTSpanElement: C, + SVGUnitTypes: C, + SVGUseElement: C, + SVGViewElement: C, + TaskAttributionTiming: C, + Text: C, + TextEvent: C, + TextMetrics: C, + TextTrack: C, + TextTrackCue: C, + TextTrackCueList: C, + TextTrackList: C, + TimeRanges: C, + toolbar: O, + top: O, + Touch: C, + TouchEvent: C, + TouchList: C, + TrackEvent: C, + TransitionEvent: C, + TreeWalker: C, + UIEvent: C, + ValidityState: C, + visualViewport: O, + VisualViewport: C, + VTTCue: C, + WaveShaperNode: C, + WebAssembly: O, + WebGL2RenderingContext: C, + WebGLActiveInfo: C, + WebGLBuffer: C, + WebGLContextEvent: C, + WebGLFramebuffer: C, + WebGLProgram: C, + WebGLQuery: C, + WebGLRenderbuffer: C, + WebGLRenderingContext: C, + WebGLSampler: C, + WebGLShader: C, + WebGLShaderPrecisionFormat: C, + WebGLSync: C, + WebGLTexture: C, + WebGLTransformFeedback: C, + WebGLUniformLocation: C, + WebGLVertexArrayObject: C, + WebSocket: C, + WheelEvent: C, + Window: C, + Worker: C, + WritableStream: C, + XMLDocument: C, + XMLHttpRequest: C, + XMLHttpRequestEventTarget: C, + XMLHttpRequestUpload: C, + XMLSerializer: C, + XPathEvaluator: C, + XPathExpression: C, + XPathResult: C, + XSLTProcessor: C +}; +for (const global of ['window', 'global', 'self', 'globalThis']) { + knownGlobals[global] = knownGlobals; +} +function getGlobalAtPath(path) { + let currentGlobal = knownGlobals; + for (const pathSegment of path) { + if (typeof pathSegment !== 'string') { + return null; + } + currentGlobal = currentGlobal[pathSegment]; + if (!currentGlobal) { + return null; + } + } + return currentGlobal[ValueProperties]; +} + +class GlobalVariable extends Variable { + constructor(name) { + super(name); + // Ensure we use live-bindings for globals as we do not know if they have + // been reassigned + this.markReassigned(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + switch (interaction.type) { + // While there is no point in testing these cases as at the moment, they + // are also covered via other means, we keep them for completeness + case INTERACTION_ACCESSED: + case INTERACTION_ASSIGNED: { + if (!getGlobalAtPath([this.name, ...path].slice(0, -1))) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + if (globalAtPath) { + globalAtPath.deoptimizeArgumentsOnCall(interaction); + } + else { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + } + } + getLiteralValueAtPath(path, _recursionTracker, _origin) { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return globalAtPath ? globalAtPath.getLiteralValue() : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (path.length === 0) { + // Technically, "undefined" is a global variable of sorts + return this.name !== 'undefined' && !getGlobalAtPath([this.name]); + } + return !getGlobalAtPath([this.name, ...path].slice(0, -1)); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context); + } + } + } +} + +class LocalVariable extends Variable { + constructor(name, declarator, init, context, kind) { + super(name); + this.init = init; + this.calledFromTryStatement = false; + this.additionalInitializers = null; + this.expressionsToBeDeoptimized = []; + this.declarations = declarator ? [declarator] : []; + this.deoptimizationTracker = context.deoptimizationTracker; + this.module = context.module; + this.kind = kind; + } + addDeclaration(identifier, init) { + this.declarations.push(identifier); + this.markInitializersForDeoptimization().push(init); + } + consolidateInitializers() { + if (this.additionalInitializers) { + for (const initializer of this.additionalInitializers) { + initializer.deoptimizePath(UNKNOWN_PATH); + } + this.additionalInitializers = null; + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.isReassigned) { + deoptimizeInteraction(interaction); + return; + } + recursionTracker.withTrackedEntityAtPath(path, this.init, () => this.init.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker), undefined); + } + deoptimizePath(path) { + if (this.isReassigned || + this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + if (path.length === 0) { + this.markReassigned(); + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + this.init.deoptimizePath(UNKNOWN_PATH); + } + else { + this.init.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.isReassigned) { + return UNKNOWN_RETURN_EXPRESSION; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (this.isReassigned) + return true; + return (!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + if (this.included) + return true; + if (path.length === 0) + return false; + if (this.isReassigned) + return true; + return (!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_CALLED: { + if (this.isReassigned) + return true; + return (!(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.included) { + super.include(); + for (const declaration of this.declarations) { + // If node is a default export, it can save a tree-shaking run to include the full declaration now + if (!declaration.included) + declaration.include(createInclusionContext(), false); + let node = declaration.parent; + while (!node.included) { + // We do not want to properly include parents in case they are part of a dead branch + // in which case .include() might pull in more dead code + node.included = true; + if (node.type === Program$1) + break; + node = node.parent; + } + } + } + } + includeCallArguments(context, parameters) { + if (this.isReassigned || context.includedCallArguments.has(this.init)) { + for (const argument of parameters) { + argument.include(context, false); + } + } + else { + context.includedCallArguments.add(this.init); + this.init.includeCallArguments(context, parameters); + context.includedCallArguments.delete(this.init); + } + } + markCalledFromTryStatement() { + this.calledFromTryStatement = true; + } + markInitializersForDeoptimization() { + if (this.additionalInitializers === null) { + this.additionalInitializers = [this.init]; + this.init = UNKNOWN_EXPRESSION; + this.markReassigned(); + } + return this.additionalInitializers; + } +} + +const tdzVariableKinds = new Set(['class', 'const', 'let', 'var', 'using', 'await using']); +class IdentifierBase extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.isVariableReference = false; + } + get isTDZAccess() { + if (!isFlagSet(this.flags, 4 /* Flag.tdzAccessDefined */)) { + return null; + } + return isFlagSet(this.flags, 8 /* Flag.tdzAccess */); + } + set isTDZAccess(value) { + this.flags = setFlag(this.flags, 4 /* Flag.tdzAccessDefined */, true); + this.flags = setFlag(this.flags, 8 /* Flag.tdzAccess */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + if (path.length === 0 && !this.scope.contains(this.name)) { + this.disallowImportReassignment(); + } + // We keep conditional chaining because an unknown Node could have an + // Identifier as property that might be deoptimized by default + this.variable?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getVariableRespectingTDZ().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const [expression, isPure] = this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || this.isPureFunction(path)]; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.isPossibleTDZ() && this.variable.kind !== 'var') { + return true; + } + return (this.scope.context.options.treeshake + .unknownGlobalSideEffects && + this.variable instanceof GlobalVariable && + !this.isPureFunction(EMPTY_PATH) && + this.variable.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return (this.variable !== null && + !this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context); + } + case INTERACTION_CALLED: { + return (!this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable); + } + } + } + includeCallArguments(context, parameters) { + this.variable.includeCallArguments(context, parameters); + } + isPossibleTDZ() { + // return cached value to avoid issues with the next tree-shaking pass + const cachedTdzAccess = this.isTDZAccess; + if (cachedTdzAccess !== null) + return cachedTdzAccess; + if (!(this.variable instanceof LocalVariable && + this.variable.kind && + tdzVariableKinds.has(this.variable.kind) && + // We ignore modules that did not receive a treeshaking pass yet as that + // causes many false positives due to circular dependencies or disabled + // moduleSideEffects. + this.variable.module.hasTreeShakingPassStarted)) { + return (this.isTDZAccess = false); + } + let decl_id; + if (this.variable.declarations && + this.variable.declarations.length === 1 && + (decl_id = this.variable.declarations[0]) && + this.start < decl_id.start && + closestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)) { + // a variable accessed before its declaration + // in the same function or at top level of module + return (this.isTDZAccess = true); + } + if (!this.variable.initReached) { + // Either a const/let TDZ violation or + // var use before declaration was encountered. + return (this.isTDZAccess = true); + } + return (this.isTDZAccess = false); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.variable instanceof LocalVariable) { + // When accessing a variable from a module without side effects, this + // means we use an export of that module and therefore need to potentially + // include it in the bundle. + if (!this.variable.module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this.variable.module); + } + this.variable.consolidateInitializers(); + this.scope.context.requestTreeshakingPass(); + } + if (this.isVariableReference) { + this.variable.addUsedPlace(this); + this.scope.context.requestTreeshakingPass(); + } + } + disallowImportReassignment() { + return this.scope.context.error(logIllegalImportReassignment(this.name, this.scope.context.module.id), this.start); + } + getVariableRespectingTDZ() { + if (this.isPossibleTDZ()) { + return UNKNOWN_EXPRESSION; + } + return this.variable; + } + isPureFunction(path) { + let currentPureFunction = this.scope.context.manualPureFunctions[this.name]; + for (const segment of path) { + if (currentPureFunction) { + if (currentPureFunction[PureFunctionKey]) { + return true; + } + currentPureFunction = currentPureFunction[segment]; + } + else { + return false; + } + } + return currentPureFunction?.[PureFunctionKey]; + } +} +function closestParentFunctionOrProgram(node) { + while (node && !/^Program|Function/.test(node.type)) { + node = node.parent; + } + // one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program + return node; +} + +class Identifier extends IdentifierBase { + constructor() { + super(...arguments); + this.variable = null; + } + addExportedVariables(variables, exportNamesByVariable) { + if (exportNamesByVariable.has(this.variable)) { + variables.push(this.variable); + } + } + bind() { + if (!this.variable && is_reference(this, this.parent)) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + this.isVariableReference = true; + } + } + declare(kind, init) { + let variable; + const { treeshake } = this.scope.context.options; + switch (kind) { + case 'var': { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + if (treeshake && treeshake.correctVarValueBeforeDeclaration) { + // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); + } + break; + } + case 'function': { + // in strict mode, functions are only hoisted within a scope but not across block scopes + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case 'let': + case 'const': + case 'using': + case 'await using': + case 'class': { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case 'parameter': { + variable = this.scope.addParameterDeclaration(this); + break; + } + /* istanbul ignore next */ + default: { + /* istanbul ignore next */ + throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); + } + } + return [(this.variable = variable)]; + } + markDeclarationReached() { + this.variable.initReached = true; + } + render(code, { snippets: { getPropertyAccess }, useOriginalName }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess, useOriginalName); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + if (isShorthandProperty) { + code.prependRight(this.start, `${this.name}: `); + } + } + // In strict mode, any variable named "eval" must be the actual "eval" function + if (name === 'eval' && + renderedParentType === CallExpression$1 && + isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + } + } +} + +const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; +const base = 64; +function toBase64(value) { + let outString = ''; + do { + const currentDigit = value % base; + value = (value / base) | 0; + outString = chars[currentDigit] + outString; + } while (value !== 0); + return outString; +} + +function getSafeName(baseName, usedNames, forbiddenNames) { + let safeName = baseName; + let count = 1; + while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) { + safeName = `${baseName}$${toBase64(count++)}`; + } + usedNames.add(safeName); + return safeName; +} + +class Scope { + constructor() { + this.children = []; + this.variables = new Map(); + } + /* + Redeclaration rules: + - var can redeclare var + - in function scopes, function and var can redeclare function and var + - var is hoisted across scopes, function remains in the scope it is declared + - var and function can redeclare function parameters, but parameters cannot redeclare parameters + - function cannot redeclare catch scope parameters + - var can redeclare catch scope parameters in a way + - if the parameter is an identifier and not a pattern + - then the variable is still declared in the hoisted outer scope, but the initializer is assigned to the parameter + - const, let, class, and function except in the cases above cannot redeclare anything + */ + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (kind === 'var' && existingKind === 'var') { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } + addHoistedVariable(name, variable) { + (this.hoistedVariables ||= new Map()).set(name, variable); + } + contains(name) { + return this.variables.has(name); + } + findVariable(_name) { + /* istanbul ignore next */ + throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); + } +} + +class ChildScope extends Scope { + constructor(parent, context) { + super(); + this.parent = parent; + this.context = context; + this.accessedOutsideVariables = new Map(); + parent.children.push(this); + } + addAccessedDynamicImport(importExpression) { + (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedDynamicImport(importExpression); + } + } + addAccessedGlobals(globals, accessedGlobalsByScope) { + const accessedGlobals = accessedGlobalsByScope.get(this) || new Set(); + for (const name of globals) { + accessedGlobals.add(name); + } + accessedGlobalsByScope.set(this, accessedGlobals); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedGlobals(globals, accessedGlobalsByScope); + } + } + addNamespaceMemberAccess(name, variable) { + this.accessedOutsideVariables.set(name, variable); + this.parent.addNamespaceMemberAccess(name, variable); + } + addReturnExpression(expression) { + if (this.parent instanceof ChildScope) { + this.parent.addReturnExpression(expression); + } + } + addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) { + for (const variable of this.accessedOutsideVariables.values()) { + if (variable.included) { + usedNames.add(variable.getBaseVariableName()); + if (format === 'system' && exportNamesByVariable.has(variable)) { + usedNames.add('exports'); + } + } + } + const accessedGlobals = accessedGlobalsByScope.get(this); + if (accessedGlobals) { + for (const name of accessedGlobals) { + usedNames.add(name); + } + } + } + contains(name) { + return this.variables.has(name) || this.parent.contains(name); + } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + const usedNames = new Set(); + this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + if (this.accessedDynamicImports) { + for (const importExpression of this.accessedDynamicImports) { + if (importExpression.inlineNamespace) { + usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); + } + } + } + for (const [name, variable] of this.variables) { + if (variable.included || variable.alwaysRendered) { + variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames)); + } + } + for (const scope of this.children) { + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + } + findLexicalBoundary() { + return this.parent.findLexicalBoundary(); + } + findGlobal(name) { + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } +} + +function checkEffectForNodes(nodes, context) { + for (const node of nodes) { + if (node.hasEffects(context)) { + return true; + } + } + return false; +} + +class MethodBase extends NodeBase { + constructor() { + super(...arguments); + this.accessedValue = null; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + if (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + // As getter properties directly receive their values from fixed function + // expressions, there is no known situation where a getter is deoptimized. + deoptimizeCache() { } + deoptimizePath(path) { + this.getAccessedValue()[0].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + return this.key.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + // setters are only called for empty paths + if (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } + getAccessedValue() { + if (this.accessedValue === null) { + if (this.kind === 'get') { + this.accessedValue = UNKNOWN_RETURN_EXPRESSION; + return (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, SHARED_RECURSION_TRACKER, this)); + } + else { + return (this.accessedValue = [this.value, false]); + } + } + return this.accessedValue; + } +} + +class MethodDefinition extends MethodBase { + hasEffects(context) { + return super.hasEffects(context) || checkEffectForNodes(this.decorators, context); + } + applyDeoptimizations() { } +} + +class BlockScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + addDeclaration(identifier, context, init, kind) { + if (kind === 'var') { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + if (existingVariable.kind === 'var' || + (kind === 'var' && existingVariable.kind === 'parameter')) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(logRedeclarationError(name), identifier.start); + } + const declaredVariable = this.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class StaticBlock extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options) { + if (this.body.length > 0) { + const bodyStartPos = findFirstOccurrenceOutsideComment(code.original.slice(this.start, this.end), '{') + 1; + renderStatementList(this.body, code, this.start + bodyStartPos, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} +function isStaticBlock(statement) { + return statement.type === StaticBlock$1; +} + +class ObjectMember extends ExpressionEntity { + constructor(object, key) { + super(); + this.object = object; + this.key = key; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.key, ...path], recursionTracker); + } + deoptimizePath(path) { + this.object.deoptimizePath([this.key, ...path]); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.object.getReturnExpressionWhenCalledAtPath([this.key, ...path], interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); + } +} + +class ClassNode extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new ChildScope(parentScope, parentScope.context); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context); + this.id?.markDeclarationReached(); + return initEffect || super.hasEffects(context) || checkEffectForNodes(this.decorators, context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return interaction.type === INTERACTION_CALLED && path.length === 0 + ? !interaction.withNew || + (this.classConstructor === null + ? this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context) + : this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)) || + false + : this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.superClass?.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively); + for (const decorator of this.decorators) + decorator.include(context, includeChildrenRecursively); + if (this.id) { + this.id.markDeclarationReached(); + this.id.include(); + } + } + initialise() { + super.initialise(); + this.id?.declare('class', this); + for (const method of this.body.body) { + if (method instanceof MethodDefinition && method.kind === 'constructor') { + this.classConstructor = method; + return; + } + } + this.classConstructor = null; + } + applyDeoptimizations() { + this.deoptimized = true; + for (const definition of this.body.body) { + if (!isStaticBlock(definition) && + !(definition.static || + (definition instanceof MethodDefinition && definition.kind === 'constructor'))) { + // Calls to methods are not tracked, ensure that the return value is deoptimized + definition.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const staticProperties = []; + const dynamicMethods = []; + for (const definition of this.body.body) { + if (isStaticBlock(definition)) + continue; + const properties = definition.static ? staticProperties : dynamicMethods; + const definitionKind = definition.kind; + // Note that class fields do not end up on the prototype + if (properties === dynamicMethods && !definitionKind) + continue; + const kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init'; + let key; + if (definition.computed) { + const keyValue = definition.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind, property: definition }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + definition.key instanceof Identifier + ? definition.key.name + : String(definition.key.value); + } + properties.push({ key, kind, property: definition }); + } + staticProperties.unshift({ + key: 'prototype', + kind: 'init', + property: new ObjectEntity(dynamicMethods, this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE) + }); + return (this.objectEntity = new ObjectEntity(staticProperties, this.superClass || OBJECT_PROTOTYPE)); + } +} + +class ClassDeclaration extends ClassNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.scope.parent).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options; + if (this.id) { + const { variable, name } = this.id; + if (format === 'system' && exportNamesByVariable.has(variable)) { + code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`); + } + const renderedVariable = variable.getName(getPropertyAccess); + if (renderedVariable !== name) { + this.decorators.map(decorator => decorator.render(code, options)); + this.superClass?.render(code, options); + this.body.render(code, { + ...options, + useOriginalName: (_variable) => _variable === variable + }); + code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`); + code.prependLeft(this.end, ';'); + return; + } + } + super.render(code, options); + } + applyDeoptimizations() { + super.applyDeoptimizations(); + const { id, scope } = this; + if (id) { + const { name, variable } = id; + for (const accessedVariable of scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ArgumentsVariable extends LocalVariable { + constructor(context) { + super('arguments', null, UNKNOWN_EXPRESSION, context, 'other'); + this.deoptimizedArguments = []; + } + addArgumentToBeDeoptimized(argument) { + if (this.included) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.deoptimizedArguments.push(argument); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + include() { + super.include(); + for (const argument of this.deoptimizedArguments) { + argument.deoptimizePath(UNKNOWN_PATH); + } + this.deoptimizedArguments.length = 0; + } +} + +const MAX_TRACKED_INTERACTIONS = 20; +const NO_INTERACTIONS = EMPTY_ARRAY; +const UNKNOWN_DEOPTIMIZED_FIELD = new Set([UnknownKey]); +const EMPTY_PATH_TRACKER = new PathTracker(); +const UNKNOWN_DEOPTIMIZED_ENTITY = new Set([UNKNOWN_EXPRESSION]); +class ParameterVariable extends LocalVariable { + constructor(name, declarator, context) { + super(name, declarator, UNKNOWN_EXPRESSION, context, 'parameter'); + this.deoptimizationInteractions = []; + this.deoptimizations = new PathTracker(); + this.deoptimizedFields = new Set(); + this.entitiesToBeDeoptimized = new Set(); + this.expressionsUseTheKnownValue = []; + this.knownValue = null; + this.knownValueLiteral = UnknownValue; + this.frozenValue = null; + } + addEntityToBeDeoptimized(entity) { + if (entity === UNKNOWN_EXPRESSION) { + // As unknown expressions fully deoptimize all interactions, we can clear + // the interaction cache at this point provided we keep this optimization + // in mind when adding new interactions + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.entitiesToBeDeoptimized.add(UNKNOWN_EXPRESSION); + for (const { interaction } of this.deoptimizationInteractions) { + deoptimizeInteraction(interaction); + } + this.deoptimizationInteractions = NO_INTERACTIONS; + } + } + else if (this.deoptimizedFields.has(UnknownKey)) { + // This means that we already deoptimized all interactions and no longer + // track them + entity.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.entitiesToBeDeoptimized.has(entity)) { + this.entitiesToBeDeoptimized.add(entity); + for (const field of this.deoptimizedFields) { + entity.deoptimizePath([field]); + } + for (const { interaction, path } of this.deoptimizationInteractions) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + } + } + markReassigned() { + if (this.isReassigned) { + return; + } + super.markReassigned(); + for (const expression of this.expressionsUseTheKnownValue) { + expression.deoptimizeCache(); + } + this.expressionsUseTheKnownValue = EMPTY_ARRAY; + } + deoptimizeCache() { + this.markReassigned(); + } + /** + * Update the known value of the parameter variable. + * Must be called for every function call, so it can track all the arguments, + * and deoptimizeCache itself to mark reassigned if the argument is changed. + * @param argument The argument of the function call + */ + updateKnownValue(argument) { + if (this.isReassigned) { + return; + } + if (this.knownValue === null) { + this.knownValue = argument; + this.knownValueLiteral = argument.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return; + } + // the same literal or identifier, do nothing + if (this.knownValue === argument || + (this.knownValue instanceof Identifier && + argument instanceof Identifier && + this.knownValue.variable === argument.variable)) { + return; + } + const oldValue = this.knownValueLiteral; + if (typeof oldValue === 'symbol') { + this.markReassigned(); + return; + } + // add tracking for the new argument + const newValue = argument.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (newValue !== oldValue) { + this.markReassigned(); + } + } + /** + * This function freezes the known value of the parameter variable, + * so the optimization starts with a certain ExpressionEntity. + * The optimization can be undone by calling `markReassigned`. + * @returns the frozen value + */ + getKnownValue() { + if (this.frozenValue === null) { + this.frozenValue = this.knownValue || UNKNOWN_EXPRESSION; + } + return this.frozenValue; + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned) { + return UnknownValue; + } + const knownValue = this.getKnownValue(); + this.expressionsUseTheKnownValue.push(origin); + return recursionTracker.withTrackedEntityAtPath(path, knownValue, () => knownValue.getLiteralValueAtPath(path, recursionTracker, origin), UnknownValue); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.isReassigned || interaction.type === INTERACTION_ASSIGNED) { + return super.hasEffectsOnInteractionAtPath(path, interaction, context); + } + const knownValue = this.getKnownValue(); + return knownValue.hasEffectsOnInteractionAtPath(path, interaction, context); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + // For performance reasons, we fully deoptimize all deeper interactions + if (path.length >= 2 || + this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION) || + this.deoptimizationInteractions.length >= MAX_TRACKED_INTERACTIONS || + (path.length === 1 && + (this.deoptimizedFields.has(UnknownKey) || + (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0]))))) { + deoptimizeInteraction(interaction); + return; + } + if (!this.deoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.args)) { + for (const entity of this.entitiesToBeDeoptimized) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.deoptimizationInteractions.push({ + interaction, + path + }); + } + } + } + deoptimizePath(path) { + if (path.length === 0) { + this.markReassigned(); + return; + } + if (this.deoptimizedFields.has(UnknownKey)) { + return; + } + const key = path[0]; + if (this.deoptimizedFields.has(key)) { + return; + } + this.deoptimizedFields.add(key); + for (const entity of this.entitiesToBeDeoptimized) { + // We do not need a recursion tracker here as we already track whether + // this field is deoptimized + entity.deoptimizePath([key]); + } + if (key === UnknownKey) { + // save some memory + this.deoptimizationInteractions = NO_INTERACTIONS; + this.deoptimizations = EMPTY_PATH_TRACKER; + this.deoptimizedFields = UNKNOWN_DEOPTIMIZED_FIELD; + this.entitiesToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; + } + } + getReturnExpressionWhenCalledAtPath(path) { + // We deoptimize everything that is called as that will trivially deoptimize + // the corresponding return expressions as well and avoid badly performing + // and complicated alternatives + if (path.length === 0) { + this.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.deoptimizedFields.has(path[0])) { + this.deoptimizePath([path[0]]); + } + return UNKNOWN_RETURN_EXPRESSION; + } +} + +class ThisVariable extends ParameterVariable { + constructor(context) { + super('this', null, context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION).hasEffectsOnInteractionAtPath(path, interaction, context); + } +} + +class CatchBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + this.parent = parent; + } + addDeclaration(identifier, context, init, kind) { + if (kind === 'var') { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (existingKind === 'parameter' && + // If this is a destructured parameter, it is forbidden to redeclare + existingVariable.declarations[0].parent.type === CatchClause$1) { + // If this is a var with the same name as the catch scope parameter, + // the assignment actually goes to the parameter and the var is + // hoisted without assignment. Locally, it is shadowed by the + // parameter + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, kind); + // To avoid the need to rewrite the declaration, we link the variable + // names. If we ever implement a logic that splits initialization and + // assignment for hoisted vars, the "renderLikeHoisted" logic can be + // removed again. + // We do not need to check whether there already is a linked + // variable because then declaredVariable would be that linked + // variable. + existingVariable.renderLikeHoisted(declaredVariable); + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + if (existingKind === 'var') { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(logRedeclarationError(name), identifier.start); + } + // We only add parameters to parameter scopes + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class FunctionBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + // There is stuff that is only allowed in function scopes, i.e. functions can + // be redeclared, functions and var can redeclare each other + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if ((kind === 'var' || kind === 'function') && + (existingKind === 'var' || existingKind === 'function' || existingKind === 'parameter')) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } +} + +class ParameterScope extends ChildScope { + constructor(parent, isCatchScope) { + super(parent, parent.context); + this.parameters = []; + this.hasRest = false; + this.bodyScope = isCatchScope ? new CatchBodyScope(this) : new FunctionBodyScope(this); + } + /** + * Adds a parameter to this scope. Parameters must be added in the correct + * order, i.e. from left to right. + */ + addParameterDeclaration(identifier) { + const { name, start } = identifier; + const existingParameter = this.variables.get(name); + if (existingParameter) { + return this.context.error(logDuplicateArgumentNameError(name), start); + } + const variable = new ParameterVariable(name, identifier, this.context); + this.variables.set(name, variable); + // We also add it to the body scope to detect name conflicts with local + // variables. We still need the intermediate scope, though, as parameter + // defaults are NOT taken from the body scope but from the parameters or + // outside scope. + this.bodyScope.addHoistedVariable(name, variable); + return variable; + } + addParameterVariables(parameters, hasRest) { + this.parameters = parameters; + for (const parameterList of parameters) { + for (const parameter of parameterList) { + parameter.alwaysRendered = true; + } + } + this.hasRest = hasRest; + } + includeCallArguments(context, parameters) { + let calledFromTryStatement = false; + let argumentIncluded = false; + const restParameter = this.hasRest && this.parameters[this.parameters.length - 1]; + for (const checkedArgument of parameters) { + if (checkedArgument instanceof SpreadElement) { + for (const argument of parameters) { + argument.include(context, false); + } + break; + } + } + for (let index = parameters.length - 1; index >= 0; index--) { + const parameterVariables = this.parameters[index] || restParameter; + const argument = parameters[index]; + if (parameterVariables) { + calledFromTryStatement = false; + if (parameterVariables.length === 0) { + // handle empty destructuring + argumentIncluded = true; + } + else { + for (const variable of parameterVariables) { + if (variable.included) { + argumentIncluded = true; + } + if (variable.calledFromTryStatement) { + calledFromTryStatement = true; + } + } + } + } + if (!argumentIncluded && argument.shouldBeIncluded(context)) { + argumentIncluded = true; + } + if (argumentIncluded) { + argument.include(context, calledFromTryStatement); + } + } + } +} + +class ReturnValueScope extends ParameterScope { + constructor() { + super(...arguments); + this.returnExpression = null; + this.returnExpressions = []; + } + addReturnExpression(expression) { + this.returnExpressions.push(expression); + } + getReturnExpression() { + if (this.returnExpression === null) + this.updateReturnExpression(); + return this.returnExpression; + } + updateReturnExpression() { + if (this.returnExpressions.length === 1) { + this.returnExpression = this.returnExpressions[0]; + } + else { + this.returnExpression = UNKNOWN_EXPRESSION; + for (const expression of this.returnExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } +} + +class FunctionScope extends ReturnValueScope { + constructor(parent) { + const { context } = parent; + super(parent, false); + this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); + this.variables.set('this', (this.thisVariable = new ThisVariable(context))); + } + findLexicalBoundary() { + return this; + } + includeCallArguments(context, parameters) { + super.includeCallArguments(context, parameters); + if (this.argumentsVariable.included) { + for (const argument of parameters) { + if (!argument.included) { + argument.include(context, false); + } + } + } + } +} + +class ExpressionStatement extends NodeBase { + initialise() { + super.initialise(); + if (this.directive && + this.directive !== 'use strict' && + this.parent.type === Program$1) { + this.scope.context.log(LOGLEVEL_WARN, + // This is necessary, because either way (deleting or not) can lead to errors. + logModuleLevelDirective(this.directive, this.scope.context.module.id), this.start); + } + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } + render(code, options) { + super.render(code, options); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + } + shouldBeIncluded(context) { + if (this.directive && this.directive !== 'use strict') + return this.parent.type !== Program$1; + return super.shouldBeIncluded(context); + } + applyDeoptimizations() { } +} + +class BlockStatement extends NodeBase { + get deoptimizeBody() { + return isFlagSet(this.flags, 32768 /* Flag.deoptimizeBody */); + } + set deoptimizeBody(value) { + this.flags = setFlag(this.flags, 32768 /* Flag.deoptimizeBody */, value); + } + get directlyIncluded() { + return isFlagSet(this.flags, 16384 /* Flag.directlyIncluded */); + } + set directlyIncluded(value) { + this.flags = setFlag(this.flags, 16384 /* Flag.directlyIncluded */, value); + } + addImplicitReturnExpressionToScope() { + const lastStatement = this.body[this.body.length - 1]; + if (!lastStatement || lastStatement.type !== ReturnStatement$1) { + this.scope.addReturnExpression(UNKNOWN_EXPRESSION); + } + } + createScope(parentScope) { + this.scope = this.parent.preventChildBlockScope + ? parentScope + : new BlockScope(parentScope); + } + hasEffects(context) { + if (this.deoptimizeBody) + return true; + for (const node of this.body) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + if (!(this.deoptimizeBody && this.directlyIncluded)) { + this.included = true; + this.directlyIncluded = true; + if (this.deoptimizeBody) + includeChildrenRecursively = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + const firstBodyStatement = this.body[0]; + this.deoptimizeBody = + firstBodyStatement instanceof ExpressionStatement && + firstBodyStatement.directive === 'use asm'; + } + render(code, options) { + if (this.body.length > 0) { + renderStatementList(this.body, code, this.start + 1, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} + +class RestElement extends NodeBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + addExportedVariables(variables, exportNamesByVariable) { + this.argument.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + this.declarationInit = init; + return this.argument.declare(kind, UNKNOWN_EXPRESSION); + } + deoptimizePath(path) { + if (path.length === 0) { + this.argument.deoptimizePath(EMPTY_PATH); + } + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.argument.markDeclarationReached(); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class FunctionBase extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + this.parameterVariableValuesDeoptimized = false; + } + get async() { + return isFlagSet(this.flags, 256 /* Flag.async */); + } + set async(value) { + this.flags = setFlag(this.flags, 256 /* Flag.async */, value); + } + get deoptimizedReturn() { + return isFlagSet(this.flags, 512 /* Flag.deoptimizedReturn */); + } + set deoptimizedReturn(value) { + this.flags = setFlag(this.flags, 512 /* Flag.deoptimizedReturn */, value); + } + get generator() { + return isFlagSet(this.flags, 4194304 /* Flag.generator */); + } + set generator(value) { + this.flags = setFlag(this.flags, 4194304 /* Flag.generator */, value); + } + updateParameterVariableValues(_arguments) { + for (let position = 0; position < this.params.length; position++) { + const parameter = this.params[position]; + if (!(parameter instanceof Identifier)) { + continue; + } + const parameterVariable = parameter.variable; + const argument = _arguments[position + 1] ?? UNDEFINED_EXPRESSION; + parameterVariable.updateKnownValue(argument); + } + } + deoptimizeParameterVariableValues() { + for (const parameter of this.params) { + if (parameter instanceof Identifier) { + const parameterVariable = parameter.variable; + parameterVariable.markReassigned(); + } + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_CALLED) { + const { parameters } = this.scope; + const { args } = interaction; + let hasRest = false; + for (let position = 0; position < args.length - 1; position++) { + const parameter = this.params[position]; + // Only the "this" argument arg[0] can be null + const argument = args[position + 1]; + if (argument instanceof SpreadElement) { + this.deoptimizeParameterVariableValues(); + } + if (hasRest || parameter instanceof RestElement) { + hasRest = true; + argument.deoptimizePath(UNKNOWN_PATH); + } + else if (parameter instanceof Identifier) { + parameters[position][0].addEntityToBeDeoptimized(argument); + this.addArgumentToBeDeoptimized(argument); + } + else if (parameter) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.addArgumentToBeDeoptimized(argument); + } + } + this.updateParameterVariableValues(args); + } + else { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + if (path.length === 1 && path[0] === UnknownKey) { + // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track + // which means the return expression and parameters need to be reassigned + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + for (const parameterList of this.scope.parameters) { + for (const parameter of parameterList) { + parameter.deoptimizePath(UNKNOWN_PATH); + parameter.markReassigned(); + } + } + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length > 0) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.async) { + if (!this.deoptimizedReturn) { + this.deoptimizedReturn = true; + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } + return UNKNOWN_RETURN_EXPRESSION; + } + return [this.scope.getReturnExpression(), false]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.annotationNoSideEffects) { + return false; + } + if (this.async) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + const returnExpression = this.scope.getReturnExpression(); + if (returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_CALL, context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_ACCESS, context)))) { + return true; + } + } + for (const parameter of this.params) { + if (parameter.hasEffects(context)) + return true; + } + return false; + } + /** + * If the function (expression or declaration) is only used as function calls + */ + onlyFunctionCallUsed() { + let variable = null; + if (this.parent.type === VariableDeclarator$1) { + variable = this.parent.id.variable ?? null; + } + if (this.parent.type === ExportDefaultDeclaration$1) { + variable = this.parent.variable; + } + return variable?.getOnlyFunctionCallUsed() ?? false; + } + include(context, includeChildrenRecursively) { + if (!this.parameterVariableValuesDeoptimized && !this.onlyFunctionCallUsed()) { + this.parameterVariableValuesDeoptimized = true; + this.deoptimizeParameterVariableValues(); + } + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + const { brokenFlow } = context; + context.brokenFlow = false; + this.body.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + includeCallArguments(context, parameters) { + this.scope.includeCallArguments(context, parameters); + } + initialise() { + super.initialise(); + if (this.body instanceof BlockStatement) { + this.body.addImplicitReturnExpressionToScope(); + } + else { + this.scope.addReturnExpression(this.body); + } + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationNoSideEffects = this.annotations.some(comment => comment.type === 'noSideEffects'); + } + } + parseNode(esTreeNode) { + const { body, params } = esTreeNode; + const { scope } = this; + const { bodyScope, context } = scope; + // We need to ensure that parameters are declared before the body is parsed + // so that the scope already knows all parameters and can detect conflicts + // when parsing the body. + const parameters = (this.params = params.map((parameter) => new (context.getNodeConstructor(parameter.type))(this, scope).parseNode(parameter))); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + this.body = new (context.getNodeConstructor(body.type))(this, bodyScope).parseNode(body); + return super.parseNode(esTreeNode); + } + addArgumentToBeDeoptimized(_argument) { } + applyDeoptimizations() { } +} +FunctionBase.prototype.preventChildBlockScope = true; + +class FunctionNode extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new FunctionScope(parentScope); + this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); + // This makes sure that all deoptimizations of "this" are applied to the + // constructed entity. + this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) { + // args[0] is the "this" argument + this.scope.thisVariable.addEntityToBeDeoptimized(interaction.args[0]); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.annotationNoSideEffects) { + return false; + } + return !!this.id?.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); + context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION); + const { brokenFlow, ignore, replacedVariableInits } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: interaction.withNew + }; + if (this.body.hasEffects(context)) + return true; + context.brokenFlow = brokenFlow; + if (thisInit) { + replacedVariableInits.set(this.scope.thisVariable, thisInit); + } + else { + replacedVariableInits.delete(this.scope.thisVariable); + } + context.ignore = ignore; + } + return false; + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + this.id?.include(); + const hasArguments = this.scope.argumentsVariable.included; + for (const parameter of this.params) { + if (!(parameter instanceof Identifier) || hasArguments) { + parameter.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + this.id?.declare('function', this); + } + addArgumentToBeDeoptimized(argument) { + this.scope.argumentsVariable.addArgumentToBeDeoptimized(argument); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([ + { + key: 'prototype', + kind: 'init', + property: new ObjectEntity([], OBJECT_PROTOTYPE) + } + ], OBJECT_PROTOTYPE)); + } +} + +class FunctionDeclaration extends FunctionNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + onlyFunctionCallUsed() { + // call super.onlyFunctionCallUsed for export default anonymous function + return this.id?.variable.getOnlyFunctionCallUsed() ?? super.onlyFunctionCallUsed(); + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.scope.parent).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } +} + +// The header ends at the first non-white-space after "default" +function getDeclarationStart(code, start) { + return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); +} +function getFunctionIdInsertPosition(code, start) { + const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length; + code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd)); + const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); + if (generatorStarPos === -1) { + return declarationEnd; + } + return declarationEnd + generatorStarPos + 1; +} +class ExportDefaultDeclaration extends NodeBase { + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively) { + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + super.initialise(); + const declaration = this.declaration; + this.declarationName = + (declaration.id && declaration.id.name) || this.declaration.name; + this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.scope.context.getModuleName(), this, this.scope.context); + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + const declarationStart = getDeclarationStart(code.original, this.start); + if (this.declaration instanceof FunctionDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? getFunctionIdInsertPosition(code.original, declarationStart) + : null, options); + } + else if (this.declaration instanceof ClassDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length + : null, options); + } + else if (this.variable.getOriginalVariable() !== this.variable) { + // Remove altogether to prevent re-declaring the same variable + treeshakeNode(this, code, start, end); + return; + } + else if (this.variable.included) { + this.renderVariableDeclaration(code, declarationStart, options); + } + else { + code.remove(this.start, declarationStart); + this.declaration.render(code, options, { + renderedSurroundingElement: ExpressionStatement$1 + }); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + return; + } + this.declaration.render(code, options); + } + applyDeoptimizations() { } + renderNamedDeclaration(code, declarationStart, idInsertPosition, options) { + const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options; + const name = this.variable.getName(getPropertyAccess); + // Remove `export default` + code.remove(this.start, declarationStart); + if (idInsertPosition !== null) { + code.appendLeft(idInsertPosition, ` ${name}`); + } + if (format === 'system' && + this.declaration instanceof ClassDeclaration && + exportNamesByVariable.has(this.variable)) { + code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); + } + } + renderVariableDeclaration(code, declarationStart, { format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) { + const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ + const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable); + if (systemExportNames) { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports(${JSON.stringify(systemExportNames[0])}, `); + code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';')); + } + else { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = `); + if (!hasTrailingSemicolon) { + code.appendLeft(this.end, ';'); + } + } + } +} +ExportDefaultDeclaration.prototype.needsBoundaries = true; + +const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/; +const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g; +const backSlashRegEx = /\\/g; +function escapeId(id) { + if (!needsEscapeRegEx.test(id)) + return id; + return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1'); +} + +const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; +const INTEROP_DEFAULT_COMPAT_VARIABLE = '_interopDefaultCompat'; +const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; +const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat'; +const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault'; +const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly'; +const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces'; +const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript'; +const defaultInteropHelpersByInteropType = { + auto: INTEROP_DEFAULT_VARIABLE, + compat: INTEROP_DEFAULT_COMPAT_VARIABLE, + default: null, + defaultOnly: null, + esModule: null +}; +const isDefaultAProperty = (interopType, externalLiveBindings) => interopType === 'esModule' || + (externalLiveBindings && (interopType === 'auto' || interopType === 'compat')); +const namespaceInteropHelpersByInteropType = { + auto: INTEROP_NAMESPACE_VARIABLE, + compat: INTEROP_NAMESPACE_COMPAT_VARIABLE, + default: INTEROP_NAMESPACE_DEFAULT_VARIABLE, + defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, + esModule: null +}; +const canDefaultBeTakenFromNamespace = (interopType, externalLiveBindings) => interopType !== 'esModule' && isDefaultAProperty(interopType, externalLiveBindings); +const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, liveBindings, freeze, symbols) => { + const usedHelpers = new Set(additionalHelpers); + for (const variable of HELPER_NAMES) { + if (accessedGlobals.has(variable)) { + usedHelpers.add(variable); + } + } + return HELPER_NAMES.map(variable => usedHelpers.has(variable) + ? HELPER_GENERATORS[variable](indent, snippets, liveBindings, freeze, symbols, usedHelpers) + : '').join(''); +}; +const HELPER_GENERATORS = { + [DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) { + return `var ${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`; + }, + [INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_COMPAT_VARIABLE + }); + return (`${left}${getIsCompatNamespace(snippets)}${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_VARIABLE + }); + return (`${left}e${_}&&${_}e.__esModule${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_NAMESPACE_COMPAT_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_COMPAT_VARIABLE + }); + return `${left}${getIsCompatNamespace(snippets)}${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_COMPAT_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(${getIsCompatNamespace(snippets)})${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, symbols) { + const { getDirectReturnFunction, getObject, n, _ } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + }); + return `${left}${getFrozen(freeze, getWithToStringTag(symbols, getObject([ + [null, `__proto__:${_}null`], + ['default', 'e'] + ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`; + }, + [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, n } = snippets; + return (`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_VARIABLE + }); + return `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, cnst, n } = snippets; + const useForEach = cnst === 'var' && liveBindings; + return (`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` + + `${t}${loopOverNamespaces(`{${n}` + + `${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` + + (liveBindings + ? useForEach + ? copyOwnPropertyLiveBinding + : copyPropertyLiveBinding + : copyPropertyStatic)(t, t + t + t + t, snippets) + + `${t}${t}${t}}${n}` + + `${t}${t}}`, useForEach, t, snippets)}${n}` + + `${t}return ${getFrozen(freeze, getWithToStringTag(symbols, 'n', snippets))};${n}` + + `}${n}${n}`); + } +}; +const getDefaultLiveBinding = ({ _, getObject }) => `e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`; +const getDefaultStatic = ({ _, getPropertyAccess }) => `e${getPropertyAccess('default')}${_}:${_}e`; +const getIsCompatNamespace = ({ _ }) => `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e`; +const createNamespaceObject = (t, index, snippets, liveBindings, freeze, symbols) => { + const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; + const copyProperty = `{${n}` + + (liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(t, index + t + t, snippets) + + `${index}${t}}`; + return (`${index}${cnst} n${_}=${_}Object.create(null${symbols ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` : ''});${n}` + + `${index}if${_}(e)${_}{${n}` + + `${index}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + + `${index}}${n}` + + `${index}n${getPropertyAccess('default')}${_}=${_}e;${n}` + + `${index}return ${getFrozen(freeze, 'n')}${s}${n}`); +}; +const loopOverKeys = (body, allowVariableLoopVariable, { _, cnst, getFunctionIntro, s }) => cnst !== 'var' || allowVariableLoopVariable + ? `for${_}(${cnst} k in e)${_}${body}` + : `Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${s}`; +const loopOverNamespaces = (body, useForEach, t, { _, cnst, getDirectReturnFunction, getFunctionIntro, n }) => { + if (useForEach) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: false, + lineBreakIndent: { base: t, t }, + name: null + }); + return (`m.forEach(${left}` + + `e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${right});`); + } + return (`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` + + `${t}${t}${cnst} e${_}=${_}m[i];${n}` + + `${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`); +}; +const copyNonDefaultOwnPropertyLiveBinding = (t, index, snippets) => { + const { _, n } = snippets; + return (`${index}if${_}(k${_}!==${_}'default')${_}{${n}` + + copyOwnPropertyLiveBinding(t, index + t, snippets) + + `${index}}${n}`); +}; +const copyOwnPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}enumerable:${_}true,${n}` + + `${index}${t}get:${_}${left}e[k]${right}${n}` + + `${index}});${n}`); +}; +const copyPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}if${_}(d)${_}{${n}` + + `${index}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}${t}enumerable:${_}true,${n}` + + `${index}${t}${t}get:${_}${left}e[k]${right}${n}` + + `${index}${t}});${n}` + + `${index}}${n}`); +}; +const copyPropertyStatic = (_t, index, { _, n }) => `${index}n[k]${_}=${_}e[k];${n}`; +const getFrozen = (freeze, fragment) => freeze ? `Object.freeze(${fragment})` : fragment; +const getWithToStringTag = (symbols, fragment, { _, getObject }) => symbols + ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})` + : fragment; +const HELPER_NAMES = Object.keys(HELPER_GENERATORS); +function getToStringTagValue(getObject) { + return getObject([['value', "'Module'"]], { + lineBreakIndent: null + }); +} + +class Literal extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || + // unknown literals can also be null but do not start with an "n" + (this.value === null && this.scope.context.code.charCodeAt(this.start) !== 110) || + typeof this.value === 'bigint' || + // to support shims for regular expressions + this.scope.context.code.charCodeAt(this.start) === 47) { + return UnknownValue; + } + return this.value; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) + return UNKNOWN_RETURN_EXPRESSION; + return getMemberReturnExpressionWhenCalled(this.members, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return path.length > (this.value === null ? 0 : 1); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + if (this.included && + this.value instanceof RegExp && + (this.value.global || this.value.sticky)) { + return true; + } + return (path.length !== 1 || + hasMemberEffectWhenCalled(this.members, path[0], interaction, context)); + } + } + } + initialise() { + super.initialise(); + this.members = getLiteralMembersForValue(this.value); + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + this.regex = esTreeNode.regex; + return super.parseNode(esTreeNode); + } + render(code) { + if (typeof this.value === 'string') { + code.indentExclusionRanges.push([this.start + 1, this.end - 1]); + } + } +} + +function getChainElementLiteralValueAtPath(element, object, path, recursionTracker, origin) { + if ('getLiteralValueAtPathAsChainElement' in object) { + const calleeValue = object.getLiteralValueAtPathAsChainElement(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin); + if (calleeValue === IS_SKIPPED_CHAIN || (element.optional && calleeValue == null)) { + return IS_SKIPPED_CHAIN; + } + } + else if (element.optional && + object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null) { + return IS_SKIPPED_CHAIN; + } + return element.getLiteralValueAtPath(path, recursionTracker, origin); +} + +// To avoid infinite recursions +const MAX_PATH_DEPTH = 7; +function getResolvablePropertyKey(memberExpression) { + return memberExpression.computed + ? getResolvableComputedPropertyKey(memberExpression.property) + : memberExpression.property.name; +} +function getResolvableComputedPropertyKey(propertyKey) { + if (propertyKey instanceof Literal) { + return String(propertyKey.value); + } + return null; +} +function getPathIfNotComputed(memberExpression) { + const nextPathKey = memberExpression.propertyKey; + const object = memberExpression.object; + if (typeof nextPathKey === 'string') { + if (object instanceof Identifier) { + return [ + { key: object.name, pos: object.start }, + { key: nextPathKey, pos: memberExpression.property.start } + ]; + } + if (object instanceof MemberExpression) { + const parentPath = getPathIfNotComputed(object); + return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]); + } + } + return null; +} +function getStringFromPath(path) { + let pathString = path[0].key; + for (let index = 1; index < path.length; index++) { + pathString += '.' + path[index].key; + } + return pathString; +} +class MemberExpression extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.expressionsToBeDeoptimized = []; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + get assignmentDeoptimized() { + return isFlagSet(this.flags, 16 /* Flag.assignmentDeoptimized */); + } + set assignmentDeoptimized(value) { + this.flags = setFlag(this.flags, 16 /* Flag.assignmentDeoptimized */, value); + } + get bound() { + return isFlagSet(this.flags, 32 /* Flag.bound */); + } + set bound(value) { + this.flags = setFlag(this.flags, 32 /* Flag.bound */, value); + } + get isUndefined() { + return isFlagSet(this.flags, 64 /* Flag.isUndefined */); + } + set isUndefined(value) { + this.flags = setFlag(this.flags, 64 /* Flag.isUndefined */, value); + } + bind() { + this.bound = true; + const path = getPathIfNotComputed(this); + const baseVariable = path && this.scope.findVariable(path[0].key); + if (baseVariable?.isNamespace) { + const resolvedVariable = resolveNamespaceVariables(baseVariable, path.slice(1), this.scope.context); + if (!resolvedVariable) { + super.bind(); + } + else if (resolvedVariable === 'undefined') { + this.isUndefined = true; + } + else { + this.variable = resolvedVariable; + this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable); + } + } + else { + super.bind(); + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.variable) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + else if (!this.isUndefined) { + if (path.length < MAX_PATH_DEPTH) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.getPropertyKey(), ...path], recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizeCache() { + const { expressionsToBeDeoptimized, object } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + this.propertyKey = UnknownKey; + object.deoptimizePath(UNKNOWN_PATH); + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + deoptimizePath(path) { + if (path.length === 0) + this.disallowNamespaceReassignment(); + if (this.variable) { + this.variable.deoptimizePath(path); + } + else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizePath([ + propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, + ...path + ]); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.variable) { + return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (this.isUndefined) { + return undefined; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + } + return UnknownValue; + } + getLiteralValueAtPathAsChainElement(path, recursionTracker, origin) { + if (this.variable) { + return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (this.isUndefined) { + return undefined; + } + return getChainElementLiteralValueAtPath(this, this.object, path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.variable) { + return this.variable.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.isUndefined) { + return [UNDEFINED_EXPRESSION, false]; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + this.hasAccessEffect(context)); + } + hasEffectsAsChainElement(context) { + if (this.variable || this.isUndefined) + return this.hasEffects(context); + const objectHasEffects = 'hasEffectsAsChainElement' in this.object + ? this.object.hasEffectsAsChainElement(context) + : this.object.hasEffects(context); + if (objectHasEffects === IS_SKIPPED_CHAIN) + return IS_SKIPPED_CHAIN; + if (this.optional && + this.object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) == null) { + return objectHasEffects || IS_SKIPPED_CHAIN; + } + // We only apply deoptimizations lazily once we know we are not skipping + if (!this.deoptimized) + this.applyDeoptimizations(); + return objectHasEffects || this.property.hasEffects(context) || this.hasAccessEffect(context); + } + hasEffectsAsAssignmentTarget(context, checkAccess) { + if (checkAccess && !this.deoptimized) + this.applyDeoptimizations(); + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + (checkAccess && this.hasAccessEffect(context)) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.variable) { + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.isUndefined) { + return true; + } + if (path.length < MAX_PATH_DEPTH) { + return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(), ...path], interaction, context); + } + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.includeProperties(context, includeChildrenRecursively); + } + includeAsAssignmentTarget(context, includeChildrenRecursively, deoptimizeAccess) { + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + if (deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + else { + this.includeProperties(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + if (this.variable) { + this.variable.includeCallArguments(context, parameters); + } + else { + super.includeCallArguments(context, parameters); + } + } + initialise() { + super.initialise(); + this.propertyKey = getResolvablePropertyKey(this); + this.accessInteraction = { args: [this.object], type: INTERACTION_ACCESSED }; + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) { + if (this.variable || this.isUndefined) { + const { snippets: { getPropertyAccess } } = options; + let replacement = this.variable ? this.variable.getName(getPropertyAccess) : 'undefined'; + if (renderedParentType && isCalleeOfRenderedParent) + replacement = '0, ' + replacement; + code.overwrite(this.start, this.end, replacement, { + contentOnly: true, + storeName: true + }); + } + else { + if (renderedParentType && isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + this.object.render(code, options, { renderedSurroundingElement }); + this.property.render(code, options); + } + } + setAssignedValue(value) { + this.assignmentInteraction = { + args: [this.object, value], + type: INTERACTION_ASSIGNED + }; + } + applyDeoptimizations() { + this.deoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizeArgumentsOnInteractionAtPath(this.accessInteraction, [propertyKey], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + if (this.variable) { + this.variable.addUsedPlace(this); + this.scope.context.requestTreeshakingPass(); + } + } + applyAssignmentDeoptimization() { + this.assignmentDeoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + this.object.deoptimizeArgumentsOnInteractionAtPath(this.assignmentInteraction, [this.getPropertyKey()], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + } + disallowNamespaceReassignment() { + if (this.object instanceof Identifier) { + const variable = this.scope.findVariable(this.object.name); + if (variable.isNamespace) { + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + this.scope.context.log(LOGLEVEL_WARN, logIllegalImportReassignment(this.object.name, this.scope.context.module.id), this.start); + } + } + } + getPropertyKey() { + if (this.propertyKey === null) { + this.propertyKey = UnknownKey; + const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return (this.propertyKey = + value === SymbolToStringTag + ? value + : typeof value === 'symbol' + ? UnknownKey + : String(value)); + } + return this.propertyKey; + } + hasAccessEffect(context) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (!(this.variable || this.isUndefined) && + propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()], this.accessInteraction, context))); + } + includeProperties(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + } + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); + } +} +function resolveNamespaceVariables(baseVariable, path, astContext) { + if (path.length === 0) + return baseVariable; + if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) + return null; + const exportName = path[0].key; + const variable = baseVariable.context.traceExport(exportName); + if (!variable) { + if (path.length === 1) { + const fileName = baseVariable.context.fileName; + astContext.log(LOGLEVEL_WARN, logMissingExport(exportName, astContext.module.id, fileName), path[0].pos); + return 'undefined'; + } + return null; + } + return resolveNamespaceVariables(variable, path.slice(1), astContext); +} + +const FILE_PREFIX = 'ROLLUP_FILE_URL_'; +const IMPORT = 'import'; +class MetaProperty extends NodeBase { + constructor() { + super(...arguments); + this.metaProperty = null; + this.preliminaryChunkId = null; + this.referenceId = null; + } + getReferencedFileName(outputPluginDriver) { + const { meta: { name }, metaProperty } = this; + if (name === IMPORT && metaProperty?.startsWith(FILE_PREFIX)) { + return outputPluginDriver.getFileName(metaProperty.slice(FILE_PREFIX.length)); + } + return null; + } + hasEffects() { + return false; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include() { + if (!this.included) { + this.included = true; + if (this.meta.name === IMPORT) { + this.scope.context.addImportMeta(this); + const parent = this.parent; + const metaProperty = (this.metaProperty = + parent instanceof MemberExpression && typeof parent.propertyKey === 'string' + ? parent.propertyKey + : null); + if (metaProperty?.startsWith(FILE_PREFIX)) { + this.referenceId = metaProperty.slice(FILE_PREFIX.length); + } + } + } + } + render(code, renderOptions) { + const { format, pluginDriver, snippets } = renderOptions; + const { scope: { context: { module } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this; + const { id: moduleId } = module; + if (name !== IMPORT) + return; + const chunkId = preliminaryChunkId; + if (referenceId) { + const fileName = pluginDriver.getFileName(referenceId); + const relativePath = normalize(relative(dirname(chunkId), fileName)); + const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [ + { chunkId, fileName, format, moduleId, referenceId, relativePath } + ]) || relativeUrlMechanisms[format](relativePath); + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + return; + } + let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [ + metaProperty, + { chunkId, format, moduleId } + ]); + if (!replacement) { + replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets }); + renderOptions.accessedDocumentCurrentScript ||= + formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined'; + } + if (typeof replacement === 'string') { + if (parent instanceof MemberExpression) { + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + } + else { + code.overwrite(start, end, replacement, { contentOnly: true }); + } + } + } + setResolution(format, accessedGlobalsByScope, preliminaryChunkId) { + this.preliminaryChunkId = preliminaryChunkId; + const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format]; + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } +} +const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd']; +const accessedMetaUrlGlobals = { + amd: ['document', 'module', 'URL'], + cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT], + es: [], + iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT], + system: ['module'], + umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT] +}; +const accessedFileUrlGlobals = { + amd: ['document', 'require', 'URL'], + cjs: ['document', 'require', 'URL'], + es: [], + iife: ['document', 'URL'], + system: ['module', 'URL'], + umd: ['document', 'require', 'URL'] +}; +const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`; +const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(relativePath)}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`); +const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => { + const urlMechanism = getUrl(chunkId); + return property === null + ? `({ url: ${urlMechanism} })` + : property === 'url' + ? urlMechanism + : 'undefined'; +}; +const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`; +const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${escapeId(path)}'`); +const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`; +const relativeUrlMechanisms = { + amd: relativePath => { + if (relativePath[0] !== '.') + relativePath = './' + relativePath; + return getResolveUrl(`require.toUrl('${escapeId(relativePath)}'), document.baseURI`); + }, + cjs: relativePath => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath)})`, + es: relativePath => getResolveUrl(`'${escapeId(relativePath)}', import.meta.url`), + iife: relativePath => getRelativeUrlFromDocument(relativePath), + system: relativePath => getResolveUrl(`'${escapeId(relativePath)}', module.meta.url`), + umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})` +}; +const importMetaMechanisms = { + amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)), + cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId)})`), + iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)), + system: (property, { snippets: { getPropertyAccess } }) => property === null ? `module.meta` : `module.meta${getPropertyAccess(property)}`, + umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId, true)})`) +}; + +class UndefinedVariable extends Variable { + constructor() { + super('undefined'); + } + getLiteralValueAtPath() { + return undefined; + } +} + +class ExportDefaultVariable extends LocalVariable { + constructor(name, exportDefaultDeclaration, context) { + super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context, 'other'); + this.hasId = false; + this.originalId = null; + this.originalVariable = null; + const declaration = exportDefaultDeclaration.declaration; + if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && + declaration.id) { + this.hasId = true; + this.originalId = declaration.id; + } + else if (declaration instanceof Identifier) { + this.originalId = declaration; + } + } + addReference(identifier) { + if (!this.hasId) { + this.name = identifier.name; + } + } + addUsedPlace(usedPlace) { + const original = this.getOriginalVariable(); + if (original === this) { + super.addUsedPlace(usedPlace); + } + else { + original.addUsedPlace(usedPlace); + } + } + forbidName(name) { + const original = this.getOriginalVariable(); + if (original === this) { + super.forbidName(name); + } + else { + original.forbidName(name); + } + } + getAssignedVariableName() { + return (this.originalId && this.originalId.name) || null; + } + getBaseVariableName() { + const original = this.getOriginalVariable(); + return original === this ? super.getBaseVariableName() : original.getBaseVariableName(); + } + getDirectOriginalVariable() { + return this.originalId && + (this.hasId || + !(this.originalId.isPossibleTDZ() || + this.originalId.variable.isReassigned || + this.originalId.variable instanceof UndefinedVariable || + // this avoids a circular dependency + 'syntheticNamespace' in this.originalId.variable)) + ? this.originalId.variable + : null; + } + getName(getPropertyAccess) { + const original = this.getOriginalVariable(); + return original === this + ? super.getName(getPropertyAccess) + : original.getName(getPropertyAccess); + } + getOriginalVariable() { + if (this.originalVariable) + return this.originalVariable; + // eslint-disable-next-line @typescript-eslint/no-this-alias + let original = this; + let currentVariable; + const checkedVariables = new Set(); + do { + checkedVariables.add(original); + currentVariable = original; + original = currentVariable.getDirectOriginalVariable(); + } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original)); + return (this.originalVariable = original || currentVariable); + } +} + +class NamespaceVariable extends Variable { + constructor(context) { + super(context.getModuleName()); + this.memberVariables = null; + this.mergedNamespaces = []; + this.referencedEarly = false; + this.references = []; + this.context = context; + this.module = context.module; + } + addReference(identifier) { + this.references.push(identifier); + this.name = identifier.name; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizeArgumentsOnInteractionAtPath(interaction, path.slice(1), recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizePath(path) { + if (path.length > 1) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizePath(path.slice(1)); + } + } + } + getLiteralValueAtPath(path) { + if (path[0] === SymbolToStringTag) { + return 'Module'; + } + return UnknownValue; + } + getMemberVariables() { + if (this.memberVariables) { + return this.memberVariables; + } + const memberVariables = Object.create(null); + const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort(); + for (const name of sortedExports) { + if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) { + const exportedVariable = this.context.traceExport(name); + if (exportedVariable) { + memberVariables[name] = exportedVariable; + } + } + } + return (this.memberVariables = memberVariables); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length === 0) { + // This can only be a call anyway + return true; + } + if (path.length === 1 && type !== INTERACTION_CALLED) { + return type === INTERACTION_ASSIGNED; + } + const key = path[0]; + if (typeof key !== 'string') { + return true; + } + const memberVariable = this.getMemberVariables()[key]; + return (!memberVariable || + memberVariable.hasEffectsOnInteractionAtPath(path.slice(1), interaction, context)); + } + include() { + super.include(); + this.context.includeAllExports(); + } + prepare(accessedGlobalsByScope) { + if (this.mergedNamespaces.length > 0) { + this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope); + } + } + renderBlock(options) { + const { exportNamesByVariable, format, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; + const memberVariables = this.getMemberVariables(); + const members = Object.entries(memberVariables) + .filter(([_, variable]) => variable.included) + .map(([name, variable]) => { + if (this.referencedEarly || variable.isReassigned || variable === this) { + return [ + null, + `get ${stringifyObjectKeyIfNeeded(name)}${_}()${_}{${_}return ${variable.getName(getPropertyAccess)}${s}${_}}` + ]; + } + return [name, variable.getName(getPropertyAccess)]; + }); + members.unshift([null, `__proto__:${_}null`]); + let output = getObject(members, { lineBreakIndent: { base: '', t } }); + if (this.mergedNamespaces.length > 0) { + const assignmentArguments = this.mergedNamespaces.map(variable => variable.getName(getPropertyAccess)); + output = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArguments.join(`,${_}`)}])`; + } + else { + // The helper to merge namespaces will also take care of freezing and toStringTag + if (symbols) { + output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})`; + } + if (freeze) { + output = `/*#__PURE__*/Object.freeze(${output})`; + } + } + const name = this.getName(getPropertyAccess); + output = `${cnst} ${name}${_}=${_}${output};`; + if (format === 'system' && exportNamesByVariable.has(this)) { + output += `${n}${getSystemExportStatement([this], options)};`; + } + return output; + } + renderFirst() { + return this.referencedEarly; + } + setMergedNamespaces(mergedNamespaces) { + this.mergedNamespaces = mergedNamespaces; + const moduleExecIndex = this.context.getModuleExecIndex(); + for (const identifier of this.references) { + const { context } = identifier.scope; + if (context.getModuleExecIndex() <= moduleExecIndex) { + this.referencedEarly = true; + break; + } + } + } +} +NamespaceVariable.prototype.isNamespace = true; + +class SyntheticNamedExportVariable extends Variable { + constructor(context, name, syntheticNamespace) { + super(name); + this.baseVariable = null; + this.context = context; + this.module = context.module; + this.syntheticNamespace = syntheticNamespace; + } + getBaseVariable() { + if (this.baseVariable) + return this.baseVariable; + let baseVariable = this.syntheticNamespace; + while (baseVariable instanceof ExportDefaultVariable || + baseVariable instanceof SyntheticNamedExportVariable) { + if (baseVariable instanceof ExportDefaultVariable) { + const original = baseVariable.getOriginalVariable(); + if (original === baseVariable) + break; + baseVariable = original; + } + if (baseVariable instanceof SyntheticNamedExportVariable) { + baseVariable = baseVariable.syntheticNamespace; + } + } + return (this.baseVariable = baseVariable); + } + getBaseVariableName() { + return this.syntheticNamespace.getBaseVariableName(); + } + getName(getPropertyAccess) { + return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; + } + include() { + super.include(); + this.context.includeVariableInModule(this.syntheticNamespace); + } + setRenderNames(baseName, name) { + super.setRenderNames(baseName, name); + } +} + +class ExternalChunk { + constructor(module, options, inputBase) { + this.options = options; + this.inputBase = inputBase; + this.defaultVariableName = ''; + this.namespaceVariableName = ''; + this.variableName = ''; + this.fileName = null; + this.importAttributes = null; + this.id = module.id; + this.moduleInfo = module.info; + this.renormalizeRenderPath = module.renormalizeRenderPath; + this.suggestedVariableName = module.suggestedVariableName; + } + getFileName() { + if (this.fileName) { + return this.fileName; + } + const { paths } = this.options; + return (this.fileName = + (typeof paths === 'function' ? paths(this.id) : paths[this.id]) || + (this.renormalizeRenderPath ? normalize(relative(this.inputBase, this.id)) : this.id)); + } + getImportAttributes(snippets) { + return (this.importAttributes ||= formatAttributes(this.options.format === 'es' && + this.options.externalImportAttributes && + this.moduleInfo.attributes, snippets)); + } + getImportPath(importer) { + return escapeId(this.renormalizeRenderPath + ? getImportPath(importer, this.getFileName(), this.options.format === 'amd', false) + : this.getFileName()); + } +} +function formatAttributes(attributes, { getObject }) { + if (!attributes) { + return null; + } + const assertionEntries = Object.entries(attributes).map(([key, value]) => [key, `'${value}'`]); + if (assertionEntries.length > 0) { + return getObject(assertionEntries, { lineBreakIndent: null }); + } + return null; +} + +function removeJsExtension(name) { + return name.endsWith('.js') ? name.slice(0, -3) : name; +} + +function getCompleteAmdId(options, chunkId) { + if (options.autoId) { + return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`; + } + return options.id ?? ''; +} + +function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') { + const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets; + if (!namedExportsMode) { + return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`; + } + let exportBlock = ''; + if (namedExportsMode) { + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (!reexports) { + continue; + } + for (const specifier of reexports) { + if (specifier.reexported !== '*') { + const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + if (exportBlock) + exportBlock += n; + if (specifier.imported !== '*' && specifier.needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + exportBlock += + `Object.defineProperty(exports,${_}${JSON.stringify(specifier.reexported)},${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}get:${_}${left}${importName}${right}${n}});`; + } + else if (specifier.reexported === '__proto__') { + exportBlock += + `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${importName}${n}});`; + } + else { + exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`; + } + } + } + } + } + for (const { exported, local } of exports) { + const lhs = `exports${getPropertyAccess(exported)}`; + const rhs = local; + if (lhs !== rhs) { + if (exportBlock) + exportBlock += n; + exportBlock += + exported === '__proto__' + ? `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${rhs}${n}});` + : `${lhs}${_}=${_}${rhs};`; + } + } + if (namedExportsMode) { + for (const { name, reexports } of dependencies) { + if (!reexports) { + continue; + } + for (const specifier of reexports) { + if (specifier.reexported === '*') { + if (exportBlock) + exportBlock += n; + if (!specifier.needsLiveBinding && reexportProtoFromExternal) { + const protoString = "'__proto__'"; + exportBlock += + `Object.prototype.hasOwnProperty.call(${name},${_}${protoString})${_}&&${n}` + + `${t}!Object.prototype.hasOwnProperty.call(exports,${_}${protoString})${_}&&${n}` + + `${t}Object.defineProperty(exports,${_}${protoString},${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}value:${_}${name}[${protoString}]${n}` + + `${t}});${n}${n}`; + } + const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!Object.prototype.hasOwnProperty.call(exports,${_}k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`; + exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${copyPropertyIfNecessary});`; + } + } + } + } + if (exportBlock) { + return `${n}${n}${exportBlock}`; + } + return ''; +} +function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) { + if (exports.length > 0) { + return exports[0].local; + } + else { + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports) { + return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + } + } + } +} +function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings, getPropertyAccess) { + if (imported === 'default') { + if (!isChunk) { + const moduleInterop = interop(moduleId); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? defaultVariableName + : moduleVariableName; + return isDefaultAProperty(moduleInterop, externalLiveBindings) + ? `${variableName}${getPropertyAccess('default')}` + : variableName; + } + return depNamedExportsMode + ? `${moduleVariableName}${getPropertyAccess('default')}` + : moduleVariableName; + } + if (imported === '*') { + return (isChunk ? !depNamedExportsMode : namespaceInteropHelpersByInteropType[interop(moduleId)]) + ? namespaceVariableName + : moduleVariableName; + } + return `${moduleVariableName}${getPropertyAccess(imported)}`; +} +function getEsModuleValue(getObject) { + return getObject([['value', 'true']], { + lineBreakIndent: null + }); +} +function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, { _, getObject }) { + if (hasNamedExports) { + if (addEsModule) { + if (addNamespaceToStringTag) { + return `Object.defineProperties(exports,${_}${getObject([ + ['__esModule', getEsModuleValue(getObject)], + [null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`] + ], { + lineBreakIndent: null + })});`; + } + return `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`; + } + if (addNamespaceToStringTag) { + return `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)});`; + } + } + return ''; +} +const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFunction, n }) => { + if (needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`Object.defineProperty(exports,${_}k,${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`); + } + return `exports[k]${_}=${_}${name}[k]`; +}; + +function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) { + const { _, cnst, n } = snippets; + const neededInteropHelpers = new Set(); + const interopStatements = []; + const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => { + neededInteropHelpers.add(helper); + interopStatements.push(`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`); + }; + for (const { defaultVariableName, imports, importPath, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (isChunk) { + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + if (imported === '*' && reexported !== '*') { + if (!namedExportsMode) { + addInteropStatement(namespaceVariableName, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, name); + } + break; + } + } + } + else { + const moduleInterop = interop(importPath); + let hasDefault = false; + let hasNamespace = false; + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + let helper; + let variableName; + if (imported === 'default') { + if (!hasDefault) { + hasDefault = true; + if (defaultVariableName !== namespaceVariableName) { + variableName = defaultVariableName; + helper = defaultInteropHelpersByInteropType[moduleInterop]; + } + } + } + else if (imported === '*' && reexported !== '*' && !hasNamespace) { + hasNamespace = true; + helper = namespaceInteropHelpersByInteropType[moduleInterop]; + variableName = namespaceVariableName; + } + if (helper) { + addInteropStatement(variableName, helper, name); + } + } + } + } + return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, symbols)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; +} + +function addJsExtension(name) { + return name.endsWith('.js') ? name : name + '.js'; +} + +// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. +// The assumption is that this makes sense for all relative ids: +// https://requirejs.org/docs/api.html#jsfiles +function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) { + if (id[0] !== '.') { + return id; + } + return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id); +} + +const builtinModules = [ + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "http2", + "https", + "inspector", + "inspector/promises", + "module", + "net", + "os", + "path", + "path/posix", + "path/win32", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "readline/promises", + "repl", + "stream", + "stream/consumers", + "stream/promises", + "stream/web", + "string_decoder", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "wasi", + "worker_threads", + "zlib" +]; + +const nodeBuiltins = new Set(builtinModules); +function warnOnBuiltins(log, dependencies) { + const externalBuiltins = dependencies + .map(({ importPath }) => importPath) + .filter(importPath => nodeBuiltins.has(importPath) || importPath.startsWith('node:')); + if (externalBuiltins.length === 0) + return; + log(LOGLEVEL_WARN, logMissingNodeBuiltins(externalBuiltins)); +} + +function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) { + warnOnBuiltins(log, dependencies); + const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const parameters = dependencies.map(m => m.name); + const { n, getNonArrowFunctionIntro, _ } = snippets; + if (namedExportsMode && hasExports) { + parameters.unshift(`exports`); + deps.unshift(`'exports'`); + } + if (accessedGlobals.has('require')) { + parameters.unshift('require'); + deps.unshift(`'require'`); + } + if (accessedGlobals.has('module')) { + parameters.unshift('module'); + deps.unshift(`'module'`); + } + const completeAmdId = getCompleteAmdId(amd, id); + const defineParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``); + const useStrict = strict ? `${_}'use strict';` : ''; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + .prepend(`${amd.define}(${defineParameters}(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${useStrict}${n}${n}`) + .append(`${n}${n}}));`); +} + +function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) { + const { _, n } = snippets; + const useStrict = strict ? `'use strict';${n}${n}` : ''; + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers += n + n; + } + const importBlock = getImportBlock$1(dependencies, snippets, compact); + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`); + magicString.append(`${exportBlock}${outro}`); +} +function getImportBlock$1(dependencies, { _, cnst, n }, compact) { + let importBlock = ''; + let definingVariable = false; + for (const { importPath, name, reexports, imports } of dependencies) { + if (!reexports && !imports) { + if (importBlock) { + importBlock += compact && !definingVariable ? ',' : `;${n}`; + } + definingVariable = false; + importBlock += `require('${importPath}')`; + } + else { + importBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `; + definingVariable = true; + importBlock += `${name}${_}=${_}require('${importPath}')`; + } + } + if (importBlock) { + return `${importBlock};${n}${n}`; + } + return ''; +} + +function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) { + const { n } = snippets; + const importBlock = getImportBlock(dependencies, importAttributesKey, snippets); + if (importBlock.length > 0) + intro += importBlock.join(n) + n + n; + intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols); + if (intro) + magicString.prepend(intro); + const exportBlock = getExportBlock(exports, snippets); + if (exportBlock.length > 0) + magicString.append(n + n + exportBlock.join(n).trim()); + if (outro) + magicString.append(outro); + magicString.trim(); +} +function getImportBlock(dependencies, importAttributesKey, { _ }) { + const importBlock = []; + for (const { importPath, reexports, imports, name, attributes } of dependencies) { + const assertion = attributes ? `${_}${importAttributesKey}${_}${attributes}` : ''; + const pathWithAssertion = `'${importPath}'${assertion};`; + if (!reexports && !imports) { + importBlock.push(`import${_}${pathWithAssertion}`); + continue; + } + if (imports) { + let defaultImport = null; + let starImport = null; + const importedNames = []; + for (const specifier of imports) { + if (specifier.imported === 'default') { + defaultImport = specifier; + } + else if (specifier.imported === '*') { + starImport = specifier; + } + else { + importedNames.push(specifier); + } + } + if (starImport) { + importBlock.push(`import${_}*${_}as ${starImport.local} from${_}${pathWithAssertion}`); + } + if (defaultImport && importedNames.length === 0) { + importBlock.push(`import ${defaultImport.local} from${_}${pathWithAssertion}`); + } + else if (importedNames.length > 0) { + importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames + .map(specifier => specifier.imported === specifier.local + ? specifier.imported + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${specifier.local}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + if (reexports) { + let starExport = null; + const namespaceReexports = []; + const namedReexports = []; + for (const specifier of reexports) { + if (specifier.reexported === '*') { + starExport = specifier; + } + else if (specifier.imported === '*') { + namespaceReexports.push(specifier); + } + else { + namedReexports.push(specifier); + } + } + if (starExport) { + importBlock.push(`export${_}*${_}from${_}${pathWithAssertion}`); + } + if (namespaceReexports.length > 0) { + if (!imports || + !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) { + importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`); + } + for (const specifier of namespaceReexports) { + importBlock.push(`export${_}{${_}${name === specifier.reexported + ? name + : `${name} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`} };`); + } + } + if (namedReexports.length > 0) { + importBlock.push(`export${_}{${_}${namedReexports + .map(specifier => specifier.imported === specifier.reexported + ? stringifyIdentifierIfNeeded(specifier.imported) + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + } + return importBlock; +} +function getExportBlock(exports, { _, cnst }) { + const exportBlock = []; + const exportDeclaration = new Array(exports.length); + let index = 0; + for (const specifier of exports) { + if (specifier.expression) { + exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`); + } + exportDeclaration[index++] = + specifier.exported === specifier.local + ? specifier.local + : `${specifier.local} as ${stringifyIdentifierIfNeeded(specifier.exported)}`; + } + if (exportDeclaration.length > 0) { + exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); + } + return exportBlock; +} + +const keypath = (keypath, getPropertyAccess) => keypath.split('.').map(getPropertyAccess).join(''); + +function setupNamespace(name, root, globals, { _, getPropertyAccess, s }, compact, log) { + const parts = name.split('.'); + // Check if the key exists in the object's prototype. + const isReserved = parts[0] in Object.prototype; + if (log && isReserved) { + log(LOGLEVEL_WARN, logReservedNamespace(parts[0])); + } + parts[0] = + (typeof globals === 'function' + ? globals(parts[0]) + : isReserved + ? parts[0] + : globals[parts[0]]) || parts[0]; + parts.pop(); + let propertyPath = root; + return (parts + .map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`; + }) + .join(compact ? ',' : '\n') + (compact && parts.length > 0 ? ';' : '\n')); +} +function assignToDeepVariable(deepName, root, globals, assignment, { _, getPropertyAccess }, log) { + const parts = deepName.split('.'); + // Check if the key exists in the object's prototype. + const isReserved = parts[0] in Object.prototype; + if (log && isReserved) { + log(LOGLEVEL_WARN, logReservedNamespace(parts[0])); + } + parts[0] = + (typeof globals === 'function' + ? globals(parts[0]) + : isReserved + ? parts[0] + : globals[parts[0]]) || parts[0]; + const last = parts.pop(); + let propertyPath = root; + let deepAssignment = [ + ...parts.map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`; + }), + `${propertyPath}${getPropertyAccess(last)}` + ].join(`,${_}`) + `${_}=${_}${assignment}`; + if (parts.length > 0) { + deepAssignment = `(${deepAssignment})`; + } + return deepAssignment; +} + +function trimEmptyImports(dependencies) { + let index = dependencies.length; + while (index--) { + const { imports, reexports } = dependencies[index]; + if (imports || reexports) { + return dependencies.slice(0, index + 1); + } + } + return []; +} + +function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) { + const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets; + const isNamespaced = name && name.includes('.'); + const useVariableAssignment = !extend && !isNamespaced; + if (name && useVariableAssignment && !isLegal(name)) { + return error(logIllegalIdentifierAsName(name)); + } + warnOnBuiltins(log, dependencies); + const external = trimEmptyImports(dependencies); + const deps = external.map(dep => dep.globalName || 'null'); + const parameters = external.map(m => m.name); + if (hasExports && !name) { + log(LOGLEVEL_WARN, logMissingNameOptionForIifeExport()); + } + if (namedExportsMode && hasExports) { + if (extend) { + deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`); + parameters.unshift('exports'); + } + else { + deps.unshift('{}'); + parameters.unshift('exports'); + } + } + const useStrict = strict ? `${t}'use strict';${n}` : ''; + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${intro}${interopBlock}`); + let wrapperIntro = `(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${n}${useStrict}${n}`; + if (hasExports) { + if (name && !(extend && namedExportsMode)) { + wrapperIntro = + (useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) + + `${_}=${_}${wrapperIntro}`; + } + if (isNamespaced) { + wrapperIntro = setupNamespace(name, 'this', globals, snippets, compact, log) + wrapperIntro; + } + } + let wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`; + if (hasExports && !extend && namedExportsMode) { + wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; + } + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + .prepend(wrapperIntro) + .append(wrapperOutro); +} + +const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; + +function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) { + const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets; + const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets); + const registeredName = name ? `'${name}',${_}` : ''; + const wrapperParameters = accessedGlobals.has('module') + ? ['exports', 'module'] + : hasExports + ? ['exports'] + : []; + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + let wrapperStart = `System.register(${registeredName}[` + + dependencies.map(({ importPath }) => `'${importPath}'`).join(`,${_}`) + + `],${_}(${getNonArrowFunctionIntro(wrapperParameters, { + isAsync: false, + name: null + })}{${n}${t}${strict ? "'use strict';" : ''}` + + getStarExcludesBlock(starExcludes, t, snippets) + + getImportBindingsBlock(importBindings, t, snippets) + + `${n}${t}return${_}{${setters.length > 0 + ? `${n}${t}${t}setters:${_}[${setters + .map(setter => setter + ? `${getFunctionIntro(['module'], { + isAsync: false, + name: null + })}{${n}${t}${t}${t}${setter}${n}${t}${t}}` + : systemNullSetters + ? `null` + : `${getFunctionIntro([], { isAsync: false, name: null })}{}`) + .join(`,${_}`)}],` + : ''}${n}`; + wrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], { + isAsync: usesTopLevelAwait, + name: null + })}{${n}${n}`; + const wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`; + magicString + .prepend(intro + + getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) + + getHoistedExportsBlock(exports, t, snippets)) + .append(`${outro}${n}${n}` + + getSyntheticExportsBlock(exports, t, snippets) + + getMissingExportsBlock(exports, t, snippets)) + .indent(`${t}${t}${t}`) + .append(wrapperEnd) + .prepend(wrapperStart); +} +function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) { + const importBindings = []; + const setters = []; + let starExcludes = null; + for (const { imports, reexports } of dependencies) { + const setter = []; + if (imports) { + for (const specifier of imports) { + importBindings.push(specifier.local); + if (specifier.imported === '*') { + setter.push(`${specifier.local}${_}=${_}module;`); + } + else { + setter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`); + } + } + } + if (reexports) { + const reexportedNames = []; + let hasStarReexport = false; + for (const { imported, reexported } of reexports) { + if (reexported === '*') { + hasStarReexport = true; + } + else { + reexportedNames.push([ + reexported, + imported === '*' ? 'module' : `module${getPropertyAccess(imported)}` + ]); + } + } + if (reexportedNames.length > 1 || hasStarReexport) { + if (hasStarReexport) { + if (!starExcludes) { + starExcludes = getStarExcludes({ dependencies, exports }); + } + reexportedNames.unshift([null, `__proto__:${_}null`]); + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);'); + } + else { + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`exports(${exportMapping});`); + } + } + else { + const [key, value] = reexportedNames[0]; + setter.push(`exports(${JSON.stringify(key)},${_}${value});`); + } + } + setters.push(setter.join(`${n}${t}${t}${t}`)); + } + return { importBindings, setters, starExcludes }; +} +const getStarExcludes = ({ dependencies, exports }) => { + const starExcludes = new Set(exports.map(expt => expt.exported)); + starExcludes.add('default'); + for (const { reexports } of dependencies) { + if (reexports) { + for (const reexport of reexports) { + if (reexport.reexported !== '*') + starExcludes.add(reexport.reexported); + } + } + } + return starExcludes; +}; +const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => { + if (starExcludes) { + const fields = [...starExcludes].map(property => [ + property, + '1' + ]); + fields.unshift([null, `__proto__:${_}null`]); + return `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(fields, { + lineBreakIndent: { base: t, t } + })};`; + } + return ''; +}; +const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); +const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +function getExportsBlock(exports, t, { _, n }) { + if (exports.length === 0) { + return ''; + } + if (exports.length === 1) { + return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`; + } + return (`exports({${n}` + + exports + .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`) + .join(`,${n}`) + + `${n}});${n}${n}`); +} +const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.expression) + .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) + .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets); + +function globalProperty(name, globalVariable, getPropertyAccess) { + if (!name) + return 'null'; + return `${globalVariable}${keypath(name, getPropertyAccess)}`; +} +function safeAccess(name, globalVariable, { _, getPropertyAccess }) { + let propertyPath = globalVariable; + return name + .split('.') + .map(part => (propertyPath += getPropertyAccess(part))) + .join(`${_}&&${_}`); +} +function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) { + const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets; + const factoryVariable = compact ? 'f' : 'factory'; + const globalVariable = compact ? 'g' : 'global'; + if (hasExports && !name) { + return error(logMissingNameOptionForUmdExport()); + } + warnOnBuiltins(log, dependencies); + const amdDeps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const cjsDeps = dependencies.map(m => `require('${m.importPath}')`); + const trimmedImports = trimEmptyImports(dependencies); + const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess)); + const factoryParameters = trimmedImports.map(m => m.name); + if (namedExportsMode && (hasExports || noConflict)) { + amdDeps.unshift(`'exports'`); + cjsDeps.unshift(`exports`); + globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log)); + factoryParameters.unshift('exports'); + } + const completeAmdId = getCompleteAmdId(amd, id); + const amdParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (amdDeps.length > 0 ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); + const define = amd.define; + const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; + const useStrict = strict ? `${_}'use strict';${n}` : ``; + let iifeExport; + if (noConflict) { + const noConflictExportsVariable = compact ? 'e' : 'exports'; + let factory; + if (!namedExportsMode && hasExports) { + factory = `${cnst} ${noConflictExportsVariable}${_}=${_}${assignToDeepVariable(name, globalVariable, globals, `${factoryVariable}(${globalDeps.join(`,${_}`)})`, snippets, log)};`; + } + else { + const module = globalDeps.shift(); + factory = + `${cnst} ${noConflictExportsVariable}${_}=${_}${module};${n}` + + `${t}${t}${factoryVariable}(${[noConflictExportsVariable, ...globalDeps].join(`,${_}`)});`; + } + iifeExport = + `(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` + + `${t}${t}${cnst} current${_}=${_}${safeAccess(name, globalVariable, snippets)};${n}` + + `${t}${t}${factory}${n}` + + `${t}${t}${noConflictExportsVariable}.noConflict${_}=${_}${getFunctionIntro([], { + isAsync: false, + name: null + })}{${_}` + + `${globalProperty(name, globalVariable, getPropertyAccess)}${_}=${_}current;${_}return ${noConflictExportsVariable}${s}${_}};${n}` + + `${t}})()`; + } + else { + iifeExport = `${factoryVariable}(${globalDeps.join(`,${_}`)})`; + if (!namedExportsMode && hasExports) { + iifeExport = assignToDeepVariable(name, globalVariable, globals, iifeExport, snippets, log); + } + } + const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0; + const wrapperParameters = [factoryVariable]; + if (iifeNeedsGlobal) { + wrapperParameters.unshift(globalVariable); + } + const globalArgument = iifeNeedsGlobal ? `this,${_}` : ''; + const iifeStart = iifeNeedsGlobal + ? `(${globalVariable}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVariable}${_}||${_}self,${_}` + : ''; + const iifeEnd = iifeNeedsGlobal ? ')' : ''; + const cjsIntro = iifeNeedsGlobal + ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + + `${_}${cjsExport}${factoryVariable}(${cjsDeps.join(`,${_}`)})${_}:${n}` + : ''; + const wrapperIntro = `(${getNonArrowFunctionIntro(wrapperParameters, { isAsync: false, name: null })}{${n}` + + cjsIntro + + `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParameters}${factoryVariable})${_}:${n}` + + `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + `})(${globalArgument}(${getNonArrowFunctionIntro(factoryParameters, { + isAsync: false, + name: null + })}{${useStrict}${n}`; + const wrapperOutro = n + n + '}));'; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .trim() + .indent(t) + .append(wrapperOutro) + .prepend(wrapperIntro); +} + +const finalisers = { amd, cjs, es, iife, system, umd }; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var utils = {}; + +var constants; +var hasRequiredConstants; + +function requireConstants () { + if (hasRequiredConstants) return constants; + hasRequiredConstants = 1; + + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + const SEP = '/'; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants; +} + +/*global navigator*/ + +var hasRequiredUtils; + +function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + (function (exports) { + + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; + }; + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + + exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; + }; + } (utils)); + return utils; +} + +var scan_1; +var hasRequiredScan; + +function requireScan () { + if (hasRequiredScan) return scan_1; + hasRequiredScan = 1; + + const utils = /*@__PURE__*/ requireUtils(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1 = scan; + return scan_1; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + const constants = /*@__PURE__*/ requireConstants(); + const utils = /*@__PURE__*/ requireUtils(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(opts.windows); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1 = parse; + return parse_1; +} + +var picomatch_1$1; +var hasRequiredPicomatch$1; + +function requirePicomatch$1 () { + if (hasRequiredPicomatch$1) return picomatch_1$1; + hasRequiredPicomatch$1 = 1; + + const scan = /*@__PURE__*/ requireScan(); + const parse = /*@__PURE__*/ requireParse(); + const utils = /*@__PURE__*/ requireUtils(); + const constants = /*@__PURE__*/ requireConstants(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(utils.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1$1 = picomatch; + return picomatch_1$1; +} + +var picomatch_1; +var hasRequiredPicomatch; + +function requirePicomatch () { + if (hasRequiredPicomatch) return picomatch_1; + hasRequiredPicomatch = 1; + + const pico = /*@__PURE__*/ requirePicomatch$1(); + const utils = /*@__PURE__*/ requireUtils(); + + function picomatch(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils.isWindows() }; + } + + return pico(glob, options, returnState); + } + + Object.assign(picomatch, pico); + picomatch_1 = picomatch; + return picomatch_1; +} + +var picomatchExports = /*@__PURE__*/ requirePicomatch(); +const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray$1(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePathRegExp = new RegExp(`\\${win32.sep}`, 'g'); +const normalizePath = function normalizePath(filename) { + return filename.replace(normalizePathRegExp, posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) { + return normalizePath(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath(resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath(id)); +} +const createFilter = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray$1(include).map(getMatcher); + const excludeMatchers = ensureArray$1(exclude).map(getMatcher); + if (!includeMatchers.length && !excludeMatchers.length) + return (id) => typeof id === 'string' && !id.includes('\0'); + return function result(id) { + if (typeof id !== 'string') + return false; + if (id.includes('\0')) + return false; + const pathId = normalizePath(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); + +class ArrayPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const element of this.elements) { + element?.addExportedVariables(variables, exportNamesByVariable); + } + } + declare(kind) { + const variables = []; + for (const element of this.elements) { + if (element !== null) { + variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); + } + } + return variables; + } + // Patterns can only be deoptimized at the empty path at the moment + deoptimizePath() { + for (const element of this.elements) { + element?.deoptimizePath(EMPTY_PATH); + } + } + // Patterns are only checked at the empty path at the moment + hasEffectsOnInteractionAtPath(_path, interaction, context) { + for (const element of this.elements) { + if (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const element of this.elements) { + element?.markDeclarationReached(); + } + } +} + +class ArrowFunctionExpression extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + get expression() { + return isFlagSet(this.flags, 8388608 /* Flag.expression */); + } + set expression(value) { + this.flags = setFlag(this.flags, 8388608 /* Flag.expression */, value); + } + createScope(parentScope) { + this.scope = new ReturnValueScope(parentScope, false); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { + return true; + } + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const { ignore, brokenFlow } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: false + }; + if (this.body.hasEffects(context)) + return true; + context.ignore = ignore; + context.brokenFlow = brokenFlow; + } + return false; + } + onlyFunctionCallUsed() { + const isIIFE = this.parent.type === CallExpression$1 && + this.parent.callee === this; + return isIIFE || super.onlyFunctionCallUsed(); + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + for (const parameter of this.params) { + if (!(parameter instanceof Identifier)) { + parameter.include(context, includeChildrenRecursively); + } + } + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE)); + } +} + +class ObjectPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const property of this.properties) { + if (property.type === Property$1) { + property.value.addExportedVariables(variables, exportNamesByVariable); + } + else { + property.argument.addExportedVariables(variables, exportNamesByVariable); + } + } + } + declare(kind, init) { + const variables = []; + for (const property of this.properties) { + variables.push(...property.declare(kind, init)); + } + return variables; + } + deoptimizePath(path) { + if (path.length === 0) { + for (const property of this.properties) { + property.deoptimizePath(path); + } + } + } + hasEffectsOnInteractionAtPath( + // At the moment, this is only triggered for assignment left-hand sides, + // where the path is empty + _path, interaction, context) { + for (const property of this.properties) { + if (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const property of this.properties) { + property.markDeclarationReached(); + } + } +} + +class AssignmentExpression extends NodeBase { + hasEffects(context) { + const { deoptimized, left, operator, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + // MemberExpressions do not access the property before assignments if the + // operator is '='. + return (right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, operator !== '=')); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.right.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + const { deoptimized, left, right, operator } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + if (includeChildrenRecursively || + operator !== '=' || + left.included || + left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)) { + left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); + } + right.include(context, includeChildrenRecursively); + } + initialise() { + super.initialise(); + if (this.left instanceof Identifier) { + const variable = this.scope.variables.get(this.left.name); + if (variable?.kind === 'const') { + this.scope.context.error(logConstVariableReassignError(), this.left.start); + } + } + this.left.setAssignedValue(this.right); + } + render(code, options, { preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const { left, right, start, end, parent } = this; + if (left.included) { + left.render(code, options); + right.render(code, options); + } + else { + const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1); + code.remove(start, inclusionStart); + if (preventASI) { + removeLineBreaks(code, inclusionStart, right.start); + } + right.render(code, options, { + renderedParentType: renderedParentType || parent.type, + renderedSurroundingElement: renderedSurroundingElement || parent.type + }); + } + if (options.format === 'system') { + if (left instanceof Identifier) { + const variable = left.variable; + const exportNames = options.exportNamesByVariable.get(variable); + if (exportNames) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, start, end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, start, end, parent.type !== ExpressionStatement$1, code, options); + } + return; + } + } + else { + const systemPatternExports = []; + left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); + if (systemPatternExports.length > 0) { + renderSystemExportFunction(systemPatternExports, start, end, renderedSurroundingElement === ExpressionStatement$1, code, options); + return; + } + } + } + if (left.included && + left instanceof ObjectPattern && + (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1)) { + code.appendRight(start, '('); + code.prependLeft(end, ')'); + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class AssignmentPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + this.left.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + return this.left.declare(kind, init); + } + deoptimizePath(path) { + if (path.length === 0) { + this.left.deoptimizePath(path); + } + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.left.markDeclarationReached(); + } + render(code, options, { isShorthandProperty } = BLANK) { + this.left.render(code, options, { isShorthandProperty }); + this.right.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class AwaitExpression extends NodeBase { + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { + let parent = this.parent; + do { + if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) + break checkTopLevelAwait; + } while ((parent = parent.parent)); + this.scope.context.usesTopLevelAwait = true; + } + } + this.argument.include(context, includeChildrenRecursively); + } +} + +const binaryOperators = { + '!=': (left, right) => left != right, + '!==': (left, right) => left !== right, + '%': (left, right) => left % right, + '&': (left, right) => left & right, + '*': (left, right) => left * right, + // At the moment, "**" will be transpiled to Math.pow + '**': (left, right) => left ** right, + '+': (left, right) => left + right, + '-': (left, right) => left - right, + '/': (left, right) => left / right, + '<': (left, right) => left < right, + '<<': (left, right) => left << right, + '<=': (left, right) => left <= right, + '==': (left, right) => left == right, + '===': (left, right) => left === right, + '>': (left, right) => left > right, + '>=': (left, right) => left >= right, + '>>': (left, right) => left >> right, + '>>>': (left, right) => left >>> right, + '^': (left, right) => left ^ right, + '|': (left, right) => left | right + // We use the fallback for cases where we return something unknown + // in: () => UnknownValue, + // instanceof: () => UnknownValue, +}; +class BinaryExpression extends NodeBase { + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof leftValue === 'symbol') + return UnknownValue; + const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof rightValue === 'symbol') + return UnknownValue; + const operatorFunction = binaryOperators[this.operator]; + if (!operatorFunction) + return UnknownValue; + return operatorFunction(leftValue, rightValue); + } + hasEffects(context) { + // support some implicit type coercion runtime errors + if (this.operator === '+' && + this.parent instanceof ExpressionStatement && + this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '') { + return true; + } + return super.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + this.left.render(code, options, { renderedSurroundingElement }); + this.right.render(code, options); + } +} + +class BreakStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.breaks) + return true; + context.hasBreak = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasBreak = true; + } + context.brokenFlow = true; + } +} + +function renderCallArguments(code, options, node) { + if (node.arguments.length > 0) { + if (node.arguments[node.arguments.length - 1].included) { + for (const argument of node.arguments) { + argument.render(code, options); + } + } + else { + let lastIncludedIndex = node.arguments.length - 2; + while (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) { + lastIncludedIndex--; + } + if (lastIncludedIndex >= 0) { + for (let index = 0; index <= lastIncludedIndex; index++) { + node.arguments[index].render(code, options); + } + code.remove(findFirstOccurrenceOutsideComment(code.original, ',', node.arguments[lastIncludedIndex].end), node.end - 1); + } + else { + code.remove(findFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1, node.end - 1); + } + } + } +} + +class CallExpressionBase extends NodeBase { + constructor() { + super(...arguments); + this.returnExpression = null; + this.deoptimizableDependentExpressions = []; + this.expressionsToBeDeoptimized = new Set(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const { args } = interaction; + const [returnExpression, isPure] = this.getReturnExpression(recursionTracker); + if (isPure) + return; + const deoptimizedExpressions = args.filter(expression => !!expression && expression !== UNKNOWN_EXPRESSION); + if (deoptimizedExpressions.length === 0) + return; + if (returnExpression === UNKNOWN_EXPRESSION) { + for (const expression of deoptimizedExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + else { + recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + for (const expression of deoptimizedExpressions) { + this.expressionsToBeDeoptimized.add(expression); + } + returnExpression.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + }, null); + } + } + deoptimizeCache() { + if (this.returnExpression?.[0] !== UNKNOWN_EXPRESSION) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + const { deoptimizableDependentExpressions, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_SET; + this.deoptimizableDependentExpressions = EMPTY_ARRAY; + for (const expression of deoptimizableDependentExpressions) { + expression.deoptimizeCache(); + } + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } + deoptimizePath(path) { + if (path.length === 0 || + this.scope.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + const [returnExpression] = this.getReturnExpression(); + if (returnExpression !== UNKNOWN_EXPRESSION) { + returnExpression.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const [returnExpression] = this.getReturnExpression(recursionTracker); + if (returnExpression === UNKNOWN_EXPRESSION) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + return returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const returnExpression = this.getReturnExpression(recursionTracker); + if (returnExpression[0] === UNKNOWN_EXPRESSION) { + return returnExpression; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + const [expression, isPure] = returnExpression[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || returnExpression[1]]; + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (type === INTERACTION_CALLED) { + const { args, withNew } = interaction; + if ((withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, args, this)) { + return false; + } + } + else if ((type === INTERACTION_ASSIGNED + ? context.assigned + : context.accessed).trackEntityAtPathAndGetIfTracked(path, this)) { + return false; + } + const [returnExpression, isPure] = this.getReturnExpression(); + return ((type === INTERACTION_ASSIGNED || !isPure) && + returnExpression.hasEffectsOnInteractionAtPath(path, interaction, context)); + } +} + +class CallExpression extends CallExpressionBase { + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + bind() { + super.bind(); + if (this.callee instanceof Identifier) { + const variable = this.scope.findVariable(this.callee.name); + if (variable.isNamespace) { + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(this.callee.name), this.start); + } + if (this.callee.name === 'eval') { + this.scope.context.log(LOGLEVEL_WARN, logEval(this.scope.context.module.id), this.start); + } + } + this.interaction = { + args: [ + this.callee instanceof MemberExpression && !this.callee.variable + ? this.callee.object + : null, + ...this.arguments + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + getLiteralValueAtPathAsChainElement(path, recursionTracker, origin) { + return getChainElementLiteralValueAtPath(this, this.callee, path, recursionTracker, origin); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + hasEffectsAsChainElement(context) { + const calleeHasEffects = 'hasEffectsAsChainElement' in this.callee + ? this.callee.hasEffectsAsChainElement(context) + : this.callee.hasEffects(context); + if (calleeHasEffects === IS_SKIPPED_CHAIN) + return IS_SKIPPED_CHAIN; + if (this.optional && + this.callee.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) == null) { + return (!this.annotationPure && calleeHasEffects) || IS_SKIPPED_CHAIN; + } + // We only apply deoptimizations lazily once we know we are not skipping + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + return (!this.annotationPure && + (calleeHasEffects || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context))); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively === INCLUDE_PARAMETERS && + this.callee instanceof Identifier && + this.callee.variable) { + this.callee.variable.markCalledFromTryStatement(); + } + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + initialise() { + super.initialise(); + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationPure = this.annotations.some(comment => comment.type === 'pure'); + } + } + render(code, options, { renderedSurroundingElement } = BLANK) { + this.callee.render(code, options, { + isCalleeOfRenderedParent: true, + renderedSurroundingElement + }); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class CatchClause extends NodeBase { + createScope(parentScope) { + this.scope = new ParameterScope(parentScope, true); + } + parseNode(esTreeNode) { + const { body, param, type } = esTreeNode; + this.type = type; + if (param) { + this.param = new (this.scope.context.getNodeConstructor(param.type))(this, this.scope).parseNode(param); + this.param.declare('parameter', UNKNOWN_EXPRESSION); + } + this.body = new BlockStatement(this, this.scope.bodyScope).parseNode(body); + return super.parseNode(esTreeNode); + } +} +CatchClause.prototype.preventChildBlockScope = true; + +class ChainExpression extends NodeBase { + // deoptimizations are not relevant as we are not caching values + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + const literalValue = this.expression.getLiteralValueAtPathAsChainElement(path, recursionTracker, origin); + return literalValue === IS_SKIPPED_CHAIN ? undefined : literalValue; + } + hasEffects(context) { + return this.expression.hasEffectsAsChainElement(context) === true; + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } + applyDeoptimizations() { } +} + +class ClassBodyScope extends ChildScope { + constructor(parent, classNode) { + const { context } = parent; + super(parent, context); + this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context, 'other'))); + this.instanceScope = new ChildScope(this, context); + this.instanceScope.variables.set('this', new ThisVariable(context)); + } + findLexicalBoundary() { + return this; + } +} + +class ClassBody extends NodeBase { + createScope(parentScope) { + this.scope = new ClassBodyScope(parentScope, this.parent); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.scope.context.includeVariableInModule(this.scope.thisVariable); + for (const definition of this.body) { + definition.include(context, includeChildrenRecursively); + } + } + parseNode(esTreeNode) { + const body = (this.body = new Array(esTreeNode.body.length)); + let index = 0; + for (const definition of esTreeNode.body) { + body[index++] = new (this.scope.context.getNodeConstructor(definition.type))(this, definition.static ? this.scope : this.scope.instanceScope).parseNode(definition); + } + return super.parseNode(esTreeNode); + } + applyDeoptimizations() { } +} + +class ClassExpression extends ClassNode { + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class MultiExpression extends ExpressionEntity { + constructor(expressions) { + super(); + this.expressions = expressions; + } + deoptimizePath(path) { + for (const expression of this.expressions) { + expression.deoptimizePath(path); + } + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return [ + new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0])), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + for (const expression of this.expressions) { + if (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + } + return false; + } +} + +class ConditionalExpression extends NodeBase { + constructor() { + super(...arguments); + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.consequent.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.alternate.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch !== null) { + const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.consequent.deoptimizePath(path); + this.alternate.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.consequent.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.alternate.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return this.consequent.hasEffects(context) || this.alternate.hasEffects(context); + } + return usedBranch.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.includeCallArguments(context, parameters); + } + else { + this.consequent.includeCallArguments(context, parameters); + this.alternate.includeCallArguments(context, parameters); + } + } + removeAnnotations(code) { + this.test.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const usedBranch = this.getUsedBranch(); + if (this.test.included) { + this.test.render(code, options, { renderedSurroundingElement }); + this.consequent.render(code, options); + this.alternate.render(code, options); + } + else { + const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); + const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included + ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end) + : colonPos) + 1); + if (preventASI) { + removeLineBreaks(code, inclusionStart, usedBranch.start); + } + code.remove(this.start, inclusionStart); + if (this.consequent.included) { + code.remove(colonPos, this.end); + } + this.test.removeAnnotations(code); + usedBranch.render(code, options, { + isCalleeOfRenderedParent, + preventASI: true, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + } + getUsedBranch() { + if (this.isBranchResolutionAnalysed) { + return this.usedBranch; + } + this.isBranchResolutionAnalysed = true; + const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return typeof testValue === 'symbol' + ? null + : (this.usedBranch = testValue ? this.consequent : this.alternate); + } +} + +class ContinueStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.continues) + return true; + context.hasContinue = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasContinue = true; + } + context.brokenFlow = true; + } +} + +class DebuggerStatement extends NodeBase { + hasEffects() { + return true; + } +} + +class Decorator extends NodeBase { + hasEffects(context) { + return (this.expression.hasEffects(context) || + this.expression.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)); + } +} + +function hasLoopBodyEffects(context, body) { + const { brokenFlow, hasBreak, hasContinue, ignore } = context; + const { breaks, continues } = ignore; + ignore.breaks = true; + ignore.continues = true; + context.hasBreak = false; + context.hasContinue = false; + if (body.hasEffects(context)) + return true; + ignore.breaks = breaks; + ignore.continues = continues; + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; + return false; +} +function includeLoopBody(context, body, includeChildrenRecursively) { + const { brokenFlow, hasBreak, hasContinue } = context; + context.hasBreak = false; + context.hasContinue = false; + body.include(context, includeChildrenRecursively, { asSingleStatement: true }); + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; +} + +class DoWhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class EmptyStatement extends NodeBase { + hasEffects() { + return false; + } +} + +class ExportAllDeclaration extends NodeBase { + hasEffects() { + return false; + } + initialise() { + super.initialise(); + this.scope.context.addExport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ExportAllDeclaration.prototype.needsBoundaries = true; + +class ExportNamedDeclaration extends NodeBase { + bind() { + // Do not bind specifiers + this.declaration?.bind(); + } + hasEffects(context) { + return !!this.declaration?.hasEffects(context); + } + initialise() { + super.initialise(); + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration?.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + if (this.declaration === null) { + code.remove(start, end); + } + else { + code.remove(this.start, this.declaration.start); + this.declaration.render(code, options, { end, start }); + } + } + applyDeoptimizations() { } +} +ExportNamedDeclaration.prototype.needsBoundaries = true; + +class ExportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ForInStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + if (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, body); + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "in" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForOfStatement extends NodeBase { + get await() { + return isFlagSet(this.flags, 131072 /* Flag.await */); + } + set await(value) { + this.flags = setFlag(this.flags, 131072 /* Flag.await */, value); + } + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + // Placeholder until proper Symbol.Iterator support + return true; + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "of" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.init?.hasEffects(context) || + this.test?.hasEffects(context) || + this.update?.hasEffects(context)) { + return true; + } + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.init?.include(context, includeChildrenRecursively, { asSingleStatement: true }); + this.test?.include(context, includeChildrenRecursively); + this.update?.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } + render(code, options) { + this.init?.render(code, options, NO_SEMICOLON); + this.test?.render(code, options, NO_SEMICOLON); + this.update?.render(code, options, NO_SEMICOLON); + this.body.render(code, options); + } +} + +class FunctionExpression extends FunctionNode { + createScope(parentScope) { + super.createScope((this.idScope = new ChildScope(parentScope, parentScope.context))); + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.idScope).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } + onlyFunctionCallUsed() { + const isIIFE = this.parent.type === CallExpression$1 && + this.parent.callee === this && + (this.id === null || this.id.variable.getOnlyFunctionCallUsed()); + return isIIFE || super.onlyFunctionCallUsed(); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class TrackingScope extends BlockScope { + constructor() { + super(...arguments); + this.hoistedDeclarations = []; + } + addDeclaration(identifier, context, init, kind) { + this.hoistedDeclarations.push(identifier); + return super.addDeclaration(identifier, context, init, kind); + } +} + +const unset = Symbol('unset'); +class IfStatement extends NodeBase { + constructor() { + super(...arguments); + this.testValue = unset; + } + deoptimizeCache() { + this.testValue = UnknownValue; + } + hasEffects(context) { + if (this.test.hasEffects(context)) { + return true; + } + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + const { brokenFlow } = context; + if (this.consequent.hasEffects(context)) + return true; + const consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + if (this.alternate === null) + return false; + if (this.alternate.hasEffects(context)) + return true; + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + return false; + } + return testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context); + } + include(context, includeChildrenRecursively) { + this.included = true; + if (includeChildrenRecursively) { + this.includeRecursively(includeChildrenRecursively, context); + } + else { + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + this.includeUnknownTest(context); + } + else { + this.includeKnownTest(context, testValue); + } + } + } + parseNode(esTreeNode) { + this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))(this, (this.consequentScope = new TrackingScope(this.scope))).parseNode(esTreeNode.consequent); + if (esTreeNode.alternate) { + this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))(this, (this.alternateScope = new TrackingScope(this.scope))).parseNode(esTreeNode.alternate); + } + return super.parseNode(esTreeNode); + } + render(code, options) { + const { snippets: { getPropertyAccess } } = options; + // Note that unknown test values are always included + const testValue = this.getTestValue(); + const hoistedDeclarations = []; + const includesIfElse = this.test.included; + const noTreeshake = !this.scope.context.options.treeshake; + if (includesIfElse) { + this.test.render(code, options); + } + else { + code.remove(this.start, this.consequent.start); + } + if (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) { + this.consequent.render(code, options); + } + else { + code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : ''); + hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations); + } + if (this.alternate) { + if (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) { + if (includesIfElse) { + if (code.original.charCodeAt(this.alternate.start - 1) === 101) { + code.prependLeft(this.alternate.start, ' '); + } + } + else { + code.remove(this.consequent.end, this.alternate.start); + } + this.alternate.render(code, options); + } + else { + if (includesIfElse && this.shouldKeepAlternateBranch()) { + code.overwrite(this.alternate.start, this.end, ';'); + } + else { + code.remove(this.consequent.end, this.end); + } + hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations); + } + } + this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); + } + applyDeoptimizations() { } + getTestValue() { + if (this.testValue === unset) { + return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this)); + } + return this.testValue; + } + includeKnownTest(context, testValue) { + if (this.test.shouldBeIncluded(context)) { + this.test.include(context, false); + } + if (testValue && this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + } + if (!testValue && this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + } + } + includeRecursively(includeChildrenRecursively, context) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate?.include(context, includeChildrenRecursively); + } + includeUnknownTest(context) { + this.test.include(context, false); + const { brokenFlow } = context; + let consequentBrokenFlow = false; + if (this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + } + if (this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + } + } + renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess) { + const hoistedVariables = [ + ...new Set(hoistedDeclarations.map(identifier => { + const variable = identifier.variable; + return variable.included ? variable.getName(getPropertyAccess) : ''; + })) + ] + .filter(Boolean) + .join(', '); + if (hoistedVariables) { + const parentType = this.parent.type; + const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1; + code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVariables}; `); + if (needsBraces) { + code.appendLeft(this.end, ` }`); + } + } + } + shouldKeepAlternateBranch() { + let currentParent = this.parent; + do { + if (currentParent instanceof IfStatement && currentParent.alternate) { + return true; + } + if (currentParent instanceof BlockStatement) { + return false; + } + currentParent = currentParent.parent; + } while (currentParent); + return false; + } +} + +class ImportAttribute extends NodeBase { +} + +class ImportDeclaration extends NodeBase { + // Do not bind specifiers or attributes + bind() { } + hasEffects() { + return false; + } + initialise() { + super.initialise(); + this.scope.context.addImport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ImportDeclaration.prototype.needsBoundaries = true; + +class ImportDefaultSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +function isReassignedExportsMember(variable, exportNamesByVariable) { + return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned); +} + +class VariableDeclarator extends NodeBase { + declareDeclarator(kind, isUsingDeclaration) { + this.isUsingDeclaration = isUsingDeclaration; + this.id.declare(kind, this.init || UNDEFINED_EXPRESSION); + } + deoptimizePath(path) { + this.id.deoptimizePath(path); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.init?.hasEffects(context); + this.id.markDeclarationReached(); + return initEffect || this.id.hasEffects(context) || this.isUsingDeclaration; + } + include(context, includeChildrenRecursively) { + const { deoptimized, id, init } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + init?.include(context, includeChildrenRecursively); + id.markDeclarationReached(); + if (includeChildrenRecursively || id.shouldBeIncluded(context)) { + id.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.init?.removeAnnotations(code); + } + render(code, options) { + const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options; + const { end, id, init, start } = this; + const renderId = id.included || this.isUsingDeclaration; + if (renderId) { + id.render(code, options); + } + else { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end); + code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1)); + } + if (init) { + if (id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const renderedVariable = id.variable.getName(getPropertyAccess); + if (renderedVariable !== id.name) { + code.appendLeft(init.start + 5, ` ${id.name}`); + } + } + init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 }); + } + else if (id instanceof Identifier && + isReassignedExportsMember(id.variable, exportNamesByVariable)) { + code.appendLeft(end, `${_}=${_}void 0`); + } + } + applyDeoptimizations() { + this.deoptimized = true; + const { id, init } = this; + if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const { name, variable } = id; + for (const accessedVariable of init.scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ImportExpression extends NodeBase { + constructor() { + super(...arguments); + this.inlineNamespace = null; + this.attributes = null; + this.mechanism = null; + this.namespaceExportName = undefined; + this.resolution = null; + this.resolutionString = null; + } + // Do not bind attributes + bind() { + this.source.bind(); + } + /** + * Get imported variables for deterministic usage, valid cases are: + * + * - `const { foo } = await import('bar')`. + * - `(await import('bar')).foo` + * - `import('bar').then(({ foo }) => {})` + * + * Returns empty array if it's side-effect only import. + * Returns undefined if it's not fully deterministic. + */ + getDeterministicImportedNames() { + const parent1 = this.parent; + // Side-effect only: import('bar') + if (parent1 instanceof ExpressionStatement) { + return EMPTY_ARRAY; + } + if (parent1 instanceof AwaitExpression) { + const parent2 = parent1.parent; + // Side-effect only: await import('bar') + if (parent2 instanceof ExpressionStatement) { + return EMPTY_ARRAY; + } + // Case 1: const { foo } = await import('bar') + if (parent2 instanceof VariableDeclarator) { + const declaration = parent2.id; + return declaration instanceof ObjectPattern + ? getDeterministicObjectDestructure(declaration) + : undefined; + } + // Case 2: (await import('bar')).foo + if (parent2 instanceof MemberExpression) { + const id = parent2.property; + if (!parent2.computed && id instanceof Identifier) { + return [id.name]; + } + } + return; + } + // Case 3: import('bar').then(({ foo }) => {}) + if (parent1 instanceof MemberExpression) { + const callExpression = parent1.parent; + const property = parent1.property; + if (!(callExpression instanceof CallExpression) || !(property instanceof Identifier)) { + return; + } + const memberName = property.name; + // side-effect only, when only chaining .catch or .finally + if (callExpression.parent instanceof ExpressionStatement && + ['catch', 'finally'].includes(memberName)) { + return EMPTY_ARRAY; + } + if (memberName !== 'then') + return; + // Side-effect only: import('bar').then() + if (callExpression.arguments.length === 0) { + return EMPTY_ARRAY; + } + const argument = callExpression.arguments[0]; + if (callExpression.arguments.length !== 1 || + !(argument instanceof ArrowFunctionExpression || argument instanceof FunctionExpression)) { + return; + } + // Side-effect only: import('bar').then(() => {}) + if (argument.params.length === 0) { + return EMPTY_ARRAY; + } + const declaration = argument.params[0]; + if (argument.params.length === 1 && declaration instanceof ObjectPattern) { + return getDeterministicObjectDestructure(declaration); + } + return; + } + } + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + this.scope.context.includeDynamicImport(this); + this.scope.addAccessedDynamicImport(this); + } + this.source.include(context, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.scope.context.addDynamicImport(this); + } + parseNode(esTreeNode) { + this.sourceAstNode = esTreeNode.source; + return super.parseNode(esTreeNode); + } + render(code, options) { + const { snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess } } = options; + if (this.inlineNamespace) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.overwrite(this.start, this.end, `Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`); + return; + } + if (this.mechanism) { + code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left); + code.overwrite(this.end - 1, this.end, this.mechanism.right); + } + if (this.resolutionString) { + code.overwrite(this.source.start, this.source.end, this.resolutionString); + if (this.namespaceExportName) { + const [left, right] = getDirectReturnFunction(['n'], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.prependLeft(this.end, `.then(${left}n.${this.namespaceExportName}${right})`); + } + } + else { + this.source.render(code, options); + } + if (this.attributes !== true) { + if (this.options) { + code.overwrite(this.source.end, this.end - 1, '', { contentOnly: true }); + } + if (this.attributes) { + code.appendLeft(this.end - 1, `,${_}${getObject([['assert', this.attributes]], { + lineBreakIndent: null + })}`); + } + } + } + setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) { + const { format } = options; + this.inlineNamespace = null; + this.resolution = resolution; + this.resolutionString = resolutionString; + this.namespaceExportName = namespaceExportName; + this.attributes = attributes; + const accessedGlobals = [...(accessedImportGlobals[format] || [])]; + let helper; + ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver)); + if (helper) { + accessedGlobals.push(helper); + } + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } + setInternalResolution(inlineNamespace) { + this.inlineNamespace = inlineNamespace; + } + applyDeoptimizations() { } + getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) { + const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [ + { + customResolution: typeof this.resolution === 'string' ? this.resolution : null, + format, + moduleId: this.scope.context.module.id, + targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null + } + ]); + if (mechanism) { + return { helper: null, mechanism }; + } + const hasDynamicTarget = !this.resolution || typeof this.resolution === 'string'; + switch (format) { + case 'cjs': { + if (dynamicImportInCjs && + (!resolution || typeof resolution === 'string' || resolution instanceof ExternalModule)) { + return { helper: null, mechanism: null }; + } + const helper = getInteropHelper(resolution, exportMode, interop); + let left = `require(`; + let right = `)`; + if (helper) { + left = `/*#__PURE__*/${helper}(${left}`; + right += ')'; + } + const [functionLeft, functionRight] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + left = `Promise.resolve().then(${functionLeft}${left}`; + right += `${functionRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'amd': { + const resolve = compact ? 'c' : 'resolve'; + const reject = compact ? 'e' : 'reject'; + const helper = getInteropHelper(resolution, exportMode, interop); + const [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + const resolveNamespace = helper + ? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}` + : resolve; + const [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + let left = `new Promise(${handlerLeft}require([`; + let right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'system': { + return { + helper: null, + mechanism: { + left: 'module.import(', + right: ')' + } + }; + } + } + return { helper: null, mechanism: null }; + } +} +function getInteropHelper(resolution, exportMode, interop) { + return exportMode === 'external' + ? namespaceInteropHelpersByInteropType[interop(resolution instanceof ExternalModule ? resolution.id : null)] + : exportMode === 'default' + ? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + : null; +} +const accessedImportGlobals = { + amd: ['require'], + cjs: ['require'], + system: ['module'] +}; +function getDeterministicObjectDestructure(objectPattern) { + const variables = []; + for (const property of objectPattern.properties) { + if (property.type === 'RestElement' || property.computed || property.key.type !== 'Identifier') + return; + variables.push(property.key.name); + } + return variables; +} + +class ImportNamespaceSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ImportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class JSXIdentifier extends IdentifierBase { + constructor() { + super(...arguments); + this.isNativeElement = false; + } + bind() { + const type = this.getType(); + if (type === 0 /* IdentifierType.Reference */) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + } + else if (type === 1 /* IdentifierType.NativeElementName */) { + this.isNativeElement = true; + } + } + render(code, { snippets: { getPropertyAccess }, useOriginalName }) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess, useOriginalName); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + } + } + else if (this.isNativeElement && + this.scope.context.options.jsx.mode !== 'preserve') { + code.update(this.start, this.end, JSON.stringify(this.name)); + } + } + getType() { + switch (this.parent.type) { + case 'JSXOpeningElement': + case 'JSXClosingElement': { + return this.name.startsWith(this.name.charAt(0).toUpperCase()) + ? 0 /* IdentifierType.Reference */ + : 1 /* IdentifierType.NativeElementName */; + } + case 'JSXMemberExpression': { + return this.parent.object === this + ? 0 /* IdentifierType.Reference */ + : 2 /* IdentifierType.Other */; + } + case 'JSXAttribute': + case 'JSXNamespacedName': { + return 2 /* IdentifierType.Other */; + } + default: { + /* istanbul ignore next */ + throw new Error(`Unexpected parent node type for JSXIdentifier: ${this.parent.type}`); + } + } + } +} + +class JSXAttribute extends NodeBase { + render(code, options, { jsxMode } = BLANK) { + super.render(code, options); + if (['classic', 'automatic'].includes(jsxMode)) { + const { name, value } = this; + const key = name instanceof JSXIdentifier ? name.name : `${name.namespace.name}:${name.name.name}`; + if (!(jsxMode === 'automatic' && key === 'key')) { + const safeKey = stringifyObjectKeyIfNeeded(key); + if (key !== safeKey) { + code.overwrite(name.start, name.end, safeKey, { contentOnly: true }); + } + if (value) { + code.overwrite(name.end, value.start, ': ', { contentOnly: true }); + } + else { + code.appendLeft(name.end, ': true'); + } + } + } + } +} + +class JSXClosingBase extends NodeBase { + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.end, ')', { contentOnly: true }); + } + else { + super.render(code, options); + } + } +} + +class JSXClosingElement extends JSXClosingBase { +} + +class JSXClosingFragment extends JSXClosingBase { +} + +class JSXSpreadAttribute extends NodeBase { + render(code, options) { + this.argument.render(code, options); + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.argument.start, '', { contentOnly: true }); + code.overwrite(this.argument.end, this.end, '', { contentOnly: true }); + } + } +} + +class JSXEmptyExpression extends NodeBase { +} + +class JSXExpressionContainer extends NodeBase { + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.remove(this.start, this.expression.start); + code.remove(this.expression.end, this.end); + } + this.expression.render(code, options); + } +} + +function getRenderedJsxChildren(children) { + let renderedChildren = 0; + for (const child of children) { + if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)) { + renderedChildren++; + } + } + return renderedChildren; +} + +function getAndIncludeFactoryVariable(factory, preserve, importSource, node) { + const [baseName, nestedName] = factory.split('.'); + let factoryVariable; + if (importSource) { + factoryVariable = node.scope.context.getImportedJsxFactoryVariable(nestedName ? 'default' : baseName, node.start, importSource); + if (preserve) { + // This pretends we are accessing an included global variable of the same name + const globalVariable = node.scope.findGlobal(baseName); + globalVariable.include(); + // This excludes this variable from renaming + factoryVariable.globalName = baseName; + } + } + else { + factoryVariable = node.scope.findGlobal(baseName); + } + node.scope.context.includeVariableInModule(factoryVariable); + if (factoryVariable instanceof LocalVariable) { + factoryVariable.consolidateInitializers(); + factoryVariable.addUsedPlace(node); + node.scope.context.requestTreeshakingPass(); + } + return factoryVariable; +} + +class JSXElementBase extends NodeBase { + constructor() { + super(...arguments); + this.factoryVariable = null; + this.factory = null; + } + initialise() { + super.initialise(); + const { importSource } = (this.jsxMode = this.getRenderingMode()); + if (importSource) { + this.scope.context.addImportSource(importSource); + } + } + include(context, includeChildrenRecursively) { + if (!this.included) { + const { factory, importSource, mode } = this.jsxMode; + if (factory) { + this.factory = factory; + this.factoryVariable = getAndIncludeFactoryVariable(factory, mode === 'preserve', importSource, this); + } + } + super.include(context, includeChildrenRecursively); + } + applyDeoptimizations() { } + getRenderingMode() { + const jsx = this.scope.context.options.jsx; + const { mode, factory, importSource } = jsx; + if (mode === 'automatic') { + return { + factory: getRenderedJsxChildren(this.children) > 1 ? 'jsxs' : 'jsx', + importSource: jsx.jsxImportSource, + mode + }; + } + return { factory, importSource, mode }; + } + renderChildren(code, options, openingEnd) { + const { children } = this; + let hasMultipleChildren = false; + let childrenEnd = openingEnd; + let firstChild = null; + for (const child of children) { + if (child instanceof JSXExpressionContainer && + child.expression instanceof JSXEmptyExpression) { + code.remove(childrenEnd, child.end); + } + else { + code.appendLeft(childrenEnd, ', '); + child.render(code, options); + if (firstChild) { + hasMultipleChildren = true; + } + else { + firstChild = child; + } + } + childrenEnd = child.end; + } + return { childrenEnd, firstChild, hasMultipleChildren }; + } +} + +class JSXElement extends JSXElementBase { + render(code, options) { + switch (this.jsxMode.mode) { + case 'classic': { + this.renderClassicMode(code, options); + break; + } + case 'automatic': { + this.renderAutomaticMode(code, options); + break; + } + default: { + super.render(code, options); + } + } + } + getRenderingMode() { + const jsx = this.scope.context.options.jsx; + const { mode, factory, importSource } = jsx; + if (mode === 'automatic') { + // In the case there is a key after a spread attribute, we fall back to + // classic mode, see https://github.com/facebook/react/issues/20031#issuecomment-710346866 + // for reasoning. + let hasSpread = false; + for (const attribute of this.openingElement.attributes) { + if (attribute instanceof JSXSpreadAttribute) { + hasSpread = true; + } + else if (hasSpread && attribute.name.name === 'key') { + return { factory, importSource, mode: 'classic' }; + } + } + } + return super.getRenderingMode(); + } + renderClassicMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingElement, end, factory, factoryVariable, openingElement: { end: openingEnd, selfClosing } } = this; + const [, ...nestedName] = factory.split('.'); + const { firstAttribute, hasAttributes, hasSpread, inObject, previousEnd } = this.renderAttributes(code, options, [factoryVariable.getName(getPropertyAccess, useOriginalName), ...nestedName].join('.'), false); + this.wrapAttributes(code, inObject, hasAttributes, hasSpread, firstAttribute, 'null', previousEnd); + this.renderChildren(code, options, openingEnd); + if (selfClosing) { + code.appendLeft(end, ')'); + } + else { + closingElement.render(code, options); + } + } + renderAutomaticMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingElement, end, factoryVariable, openingElement: { end: openindEnd, selfClosing } } = this; + let { firstAttribute, hasAttributes, hasSpread, inObject, keyAttribute, previousEnd } = this.renderAttributes(code, options, factoryVariable.getName(getPropertyAccess, useOriginalName), true); + const { firstChild, hasMultipleChildren, childrenEnd } = this.renderChildren(code, options, openindEnd); + if (firstChild) { + code.prependRight(firstChild.start, `children: ${hasMultipleChildren ? '[' : ''}`); + if (!inObject) { + code.prependRight(firstChild.start, '{ '); + inObject = true; + } + previousEnd = closingElement.start; + if (hasMultipleChildren) { + code.appendLeft(previousEnd, ']'); + } + } + this.wrapAttributes(code, inObject, hasAttributes || !!firstChild, hasSpread, firstAttribute || firstChild, '{}', childrenEnd); + if (keyAttribute) { + const { value } = keyAttribute; + // This will appear to the left of the moved code... + code.appendLeft(childrenEnd, ', '); + if (value) { + code.move(value.start, value.end, childrenEnd); + } + else { + code.appendLeft(childrenEnd, 'true'); + } + } + if (selfClosing) { + // Moving the key attribute will also move the parenthesis to the right position + code.appendLeft(keyAttribute?.value?.end || end, ')'); + } + else { + closingElement.render(code, options); + } + } + renderAttributes(code, options, factoryName, extractKeyAttribute) { + const { jsxMode: { mode }, openingElement } = this; + const { attributes, end: openingEnd, start: openingStart, name: { start: nameStart, end: nameEnd } } = openingElement; + code.update(openingStart, nameStart, `/*#__PURE__*/${factoryName}(`); + openingElement.render(code, options, { jsxMode: mode }); + let keyAttribute = null; + let hasSpread = false; + let inObject = false; + let previousEnd = nameEnd; + let hasAttributes = false; + let firstAttribute = null; + for (const attribute of attributes) { + if (attribute instanceof JSXAttribute) { + if (extractKeyAttribute && attribute.name.name === 'key') { + keyAttribute = attribute; + code.remove(previousEnd, attribute.value?.start || attribute.end); + continue; + } + code.appendLeft(previousEnd, ','); + if (!inObject) { + code.prependRight(attribute.start, '{ '); + inObject = true; + } + hasAttributes = true; + } + else { + if (inObject) { + if (hasAttributes) { + code.appendLeft(previousEnd, ' '); + } + code.appendLeft(previousEnd, '},'); + inObject = false; + } + else { + code.appendLeft(previousEnd, ','); + } + hasSpread = true; + } + previousEnd = attribute.end; + if (!firstAttribute) { + firstAttribute = attribute; + } + } + code.remove(attributes.at(-1)?.end || previousEnd, openingEnd); + return { firstAttribute, hasAttributes, hasSpread, inObject, keyAttribute, previousEnd }; + } + wrapAttributes(code, inObject, hasAttributes, hasSpread, firstAttribute, missingAttributesFallback, attributesEnd) { + if (inObject) { + code.appendLeft(attributesEnd, ' }'); + } + if (hasSpread) { + if (hasAttributes) { + const { start } = firstAttribute; + if (firstAttribute instanceof JSXSpreadAttribute) { + code.prependRight(start, '{}, '); + } + code.prependRight(start, 'Object.assign('); + code.appendLeft(attributesEnd, ')'); + } + } + else if (!hasAttributes) { + code.appendLeft(attributesEnd, `, ${missingAttributesFallback}`); + } + } +} + +class JSXFragment extends JSXElementBase { + render(code, options) { + switch (this.jsxMode.mode) { + case 'classic': { + this.renderClassicMode(code, options); + break; + } + case 'automatic': { + this.renderAutomaticMode(code, options); + break; + } + default: { + super.render(code, options); + } + } + } + renderClassicMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingFragment, factory, factoryVariable, openingFragment, start } = this; + const [, ...nestedName] = factory.split('.'); + openingFragment.render(code, options); + code.prependRight(start, `/*#__PURE__*/${[ + factoryVariable.getName(getPropertyAccess, useOriginalName), + ...nestedName + ].join('.')}(`); + code.appendLeft(openingFragment.end, ', null'); + this.renderChildren(code, options, openingFragment.end); + closingFragment.render(code, options); + } + renderAutomaticMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingFragment, factoryVariable, openingFragment, start } = this; + openingFragment.render(code, options); + code.prependRight(start, `/*#__PURE__*/${factoryVariable.getName(getPropertyAccess, useOriginalName)}(`); + const { firstChild, hasMultipleChildren, childrenEnd } = this.renderChildren(code, options, openingFragment.end); + if (firstChild) { + code.prependRight(firstChild.start, `{ children: ${hasMultipleChildren ? '[' : ''}`); + if (hasMultipleChildren) { + code.appendLeft(closingFragment.start, ']'); + } + code.appendLeft(childrenEnd, ' }'); + } + else { + code.appendLeft(openingFragment.end, ', {}'); + } + closingFragment.render(code, options); + } +} + +class JSXMemberExpression extends NodeBase { +} + +class JSXNamespacedName extends NodeBase { +} + +class JSXOpeningElement extends NodeBase { + render(code, options, { jsxMode = this.scope.context.options.jsx.mode } = {}) { + this.name.render(code, options); + for (const attribute of this.attributes) { + attribute.render(code, options, { jsxMode }); + } + } +} + +class JSXOpeningFragment extends NodeBase { + constructor() { + super(...arguments); + this.fragment = null; + this.fragmentVariable = null; + } + include(context, includeChildrenRecursively) { + if (!this.included) { + const jsx = this.scope.context.options.jsx; + if (jsx.mode === 'automatic') { + this.fragment = 'Fragment'; + this.fragmentVariable = getAndIncludeFactoryVariable('Fragment', false, jsx.jsxImportSource, this); + } + else { + const { fragment, importSource, mode } = jsx; + if (fragment != null) { + this.fragment = fragment; + this.fragmentVariable = getAndIncludeFactoryVariable(fragment, mode === 'preserve', importSource, this); + } + } + } + super.include(context, includeChildrenRecursively); + } + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const [, ...nestedFragment] = this.fragment.split('.'); + const fragment = [ + this.fragmentVariable.getName(getPropertyAccess, useOriginalName), + ...nestedFragment + ].join('.'); + code.update(this.start, this.end, fragment); + } + } +} + +class JSXSpreadChild extends NodeBase { + render(code, options) { + super.render(code, options); + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.expression.start, '...', { contentOnly: true }); + code.overwrite(this.expression.end, this.end, '', { contentOnly: true }); + } + } +} + +class JSXText extends NodeBase { + render(code) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.end, JSON.stringify(this.value), { + contentOnly: true + }); + } + } +} + +class LabeledStatement extends NodeBase { + hasEffects(context) { + const { brokenFlow, includedLabels } = context; + context.ignore.labels.add(this.label.name); + context.includedLabels = new Set(); + let bodyHasEffects = false; + if (this.body.hasEffects(context)) { + bodyHasEffects = true; + } + else { + context.ignore.labels.delete(this.label.name); + if (context.includedLabels.has(this.label.name)) { + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + return bodyHasEffects; + } + include(context, includeChildrenRecursively) { + this.included = true; + const { brokenFlow, includedLabels } = context; + context.includedLabels = new Set(); + this.body.include(context, includeChildrenRecursively); + if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) { + this.label.include(); + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + } + render(code, options) { + if (this.label.included) { + this.label.render(code, options); + } + else { + code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1)); + } + this.body.render(code, options); + } +} + +class LogicalExpression extends NodeBase { + constructor() { + super(...arguments); + // We collect deoptimization information if usedBranch !== null + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + //private isBranchResolutionAnalysed = false; + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.left.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.right.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch) { + const unusedBranch = this.usedBranch === this.left ? this.right : this.left; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { scope: { context }, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + // Request another pass because we need to ensure "include" runs again if + // it is rendered + context.requestTreeshakingPass(); + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.left.deoptimizePath(path); + this.right.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.left.hasEffects(context)) { + return true; + } + if (this.getUsedBranch() !== this.left) { + return this.right.hasEffects(context); + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.right.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || + (usedBranch === this.right && this.left.shouldBeIncluded(context)) || + !usedBranch) { + this.left.include(context, includeChildrenRecursively); + this.right.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + if (!this.left.included || !this.right.included) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end); + if (this.right.included) { + const removePos = findNonWhiteSpace(code.original, operatorPos + 2); + code.remove(this.start, removePos); + if (preventASI) { + removeLineBreaks(code, removePos, this.right.start); + } + this.left.removeAnnotations(code); + } + else { + code.remove(findLastWhiteSpaceReverse(code.original, this.left.end, operatorPos), this.end); + } + this.getUsedBranch().render(code, options, { + isCalleeOfRenderedParent, + preventASI, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + else { + this.left.render(code, options, { + preventASI, + renderedSurroundingElement + }); + this.right.render(code, options); + } + } + getUsedBranch() { + if (!this.isBranchResolutionAnalysed) { + this.isBranchResolutionAnalysed = true; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof leftValue === 'symbol') { + return null; + } + else { + this.usedBranch = + (this.operator === '||' && leftValue) || + (this.operator === '&&' && !leftValue) || + (this.operator === '??' && leftValue != null) + ? this.left + : this.right; + } + } + return this.usedBranch; + } +} + +class NewExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 0 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + initialise() { + super.initialise(); + this.interaction = { + args: [null, ...this.arguments], + type: INTERACTION_CALLED, + withNew: true + }; + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationPure = this.annotations.some(comment => comment.type === 'pure'); + } + } + render(code, options) { + this.callee.render(code, options); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } +} + +class ObjectExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } + applyDeoptimizations() { } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + let prototype = OBJECT_PROTOTYPE; + const properties = []; + for (const property of this.properties) { + if (property instanceof SpreadElement) { + properties.push({ key: UnknownKey, kind: 'init', property }); + continue; + } + let key; + if (property.computed) { + const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind: property.kind, property }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + property.key instanceof Identifier + ? property.key.name + : String(property.key.value); + if (key === '__proto__' && property.kind === 'init') { + prototype = + property.value instanceof Literal && property.value.value === null + ? null + : property.value; + continue; + } + } + properties.push({ key, kind: property.kind, property }); + } + return (this.objectEntity = new ObjectEntity(properties, prototype)); + } +} + +class PanicError extends NodeBase { + initialise() { + const id = this.scope.context.module.id; + // This simulates the current nested error structure. We could also just + // replace it with a flat error. + const parseError = getRollupError(logParseError(this.message)); + const moduleParseError = logModuleParseError(parseError, id); + return error(moduleParseError); + } +} + +class ParseError extends NodeBase { + initialise() { + const pos = this.start; + const id = this.scope.context.module.id; + // This simulates the current nested error structure. We could also just + // replace it with a flat error. + const parseError = getRollupError(logParseError(this.message, pos)); + const moduleParseError = logModuleParseError(parseError, id); + this.scope.context.error(moduleParseError, pos); + } +} + +class PrivateIdentifier extends NodeBase { +} + +class Program extends NodeBase { + constructor() { + super(...arguments); + this.hasCachedEffect = null; + this.hasLoggedEffect = false; + } + hasCachedEffects() { + if (!this.included) { + return false; + } + return this.hasCachedEffect === null + ? (this.hasCachedEffect = this.hasEffects(createHasEffectsContext())) + : this.hasCachedEffect; + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) { + if (this.scope.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { + this.hasLoggedEffect = true; + const { code, log, module } = this.scope.context; + log(LOGLEVEL_INFO, logFirstSideEffect(code, module.id, locate(code, node.start, { offsetLine: 1 })), node.start); + } + return (this.hasCachedEffect = true); + } + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) { + node.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + if (this.invalidAnnotations) + for (const { start, end, type } of this.invalidAnnotations) { + this.scope.context.magicString.remove(start, end); + if (type === 'pure' || type === 'noSideEffects') { + this.scope.context.log(LOGLEVEL_WARN, logInvalidAnnotation(this.scope.context.code.slice(start, end), this.scope.context.module.id, type), start); + } + } + } + render(code, options) { + let start = this.start; + if (code.original.startsWith('#!')) { + start = Math.min(code.original.indexOf('\n') + 1, this.end); + code.remove(0, start); + } + if (this.body.length > 0) { + // Keep all consecutive lines that start with a comment + while (code.original[start] === '/' && /[*/]/.test(code.original[start + 1])) { + const firstLineBreak = findFirstLineBreakOutsideComment(code.original.slice(start, this.body[0].start)); + if (firstLineBreak[0] === -1) { + break; + } + start += firstLineBreak[1]; + } + renderStatementList(this.body, code, start, this.end, options); + } + else { + super.render(code, options); + } + } + applyDeoptimizations() { } +} + +class Property extends MethodBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + //declare method: boolean; + get method() { + return isFlagSet(this.flags, 262144 /* Flag.method */); + } + set method(value) { + this.flags = setFlag(this.flags, 262144 /* Flag.method */, value); + } + //declare shorthand: boolean; + get shorthand() { + return isFlagSet(this.flags, 524288 /* Flag.shorthand */); + } + set shorthand(value) { + this.flags = setFlag(this.flags, 524288 /* Flag.shorthand */, value); + } + declare(kind, init) { + this.declarationInit = init; + return this.value.declare(kind, UNKNOWN_EXPRESSION); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const propertyReadSideEffects = this.scope.context.options.treeshake.propertyReadSideEffects; + return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || + this.key.hasEffects(context) || + this.value.hasEffects(context)); + } + markDeclarationReached() { + this.value.markDeclarationReached(); + } + render(code, options) { + if (!this.shorthand) { + this.key.render(code, options); + } + this.value.render(code, options, { isShorthandProperty: this.shorthand }); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class PropertyDefinition extends NodeBase { + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.value?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.value?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.value + ? this.value.getLiteralValueAtPath(path, recursionTracker, origin) + : UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.value + ? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) + : UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + return (this.key.hasEffects(context) || + (this.static && !!this.value?.hasEffects(context)) || + checkEffectForNodes(this.decorators, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } +} + +class ReturnStatement extends NodeBase { + hasEffects(context) { + if (!context.ignore.returnYield || this.argument?.hasEffects(context)) + return true; + context.brokenFlow = true; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument?.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + initialise() { + super.initialise(); + this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 6 /* 'return'.length */) { + code.prependLeft(this.start + 6, ' '); + } + } + } +} + +class SequenceExpression extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.expressions[this.expressions.length - 1].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.expressions[this.expressions.length - 1].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin); + } + hasEffects(context) { + for (const expression of this.expressions) { + if (expression.hasEffects(context)) + return true; + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const lastExpression = this.expressions[this.expressions.length - 1]; + for (const expression of this.expressions) { + if (includeChildrenRecursively || + (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || + expression.shouldBeIncluded(context)) + expression.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.expressions[0].removeAnnotations(code); + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) { + let includedNodes = 0; + let lastSeparatorPos = null; + const lastNode = this.expressions[this.expressions.length - 1]; + for (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) { + if (!node.included) { + treeshakeNode(node, code, start, end); + continue; + } + includedNodes++; + lastSeparatorPos = separator; + if (includedNodes === 1 && preventASI) { + removeLineBreaks(code, start, node.start); + } + if (includedNodes === 1) { + const parentType = renderedParentType || this.parent.type; + node.render(code, options, { + isCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode, + renderedParentType: parentType, + renderedSurroundingElement: parentType + }); + } + else { + node.render(code, options); + } + } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end); + } + } +} + +class Super extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } +} + +class SwitchCase extends NodeBase { + hasEffects(context) { + if (this.test?.hasEffects(context)) + return true; + for (const node of this.consequent) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test?.include(context, includeChildrenRecursively); + for (const node of this.consequent) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options, nodeRenderOptions) { + if (this.consequent.length > 0) { + if (this.test) { + this.test.render(code, options); + } + const testEnd = this.test + ? this.test.end + : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7; + const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1; + renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options); + } + else { + super.render(code, options); + } + } +} +SwitchCase.prototype.needsBoundaries = true; + +class SwitchStatement extends NodeBase { + createScope(parentScope) { + this.parentScope = parentScope; + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.discriminant.hasEffects(context)) + return true; + const { brokenFlow, hasBreak, ignore } = context; + const { breaks } = ignore; + ignore.breaks = true; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + for (const switchCase of this.cases) { + if (switchCase.hasEffects(context)) + return true; + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + if (this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + ignore.breaks = breaks; + context.hasBreak = hasBreak; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.discriminant.include(context, includeChildrenRecursively); + const { brokenFlow, hasBreak } = context; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + let isCaseIncluded = includeChildrenRecursively || + (this.defaultCase !== null && this.defaultCase < this.cases.length - 1); + for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) { + const switchCase = this.cases[caseIndex]; + if (switchCase.included) { + isCaseIncluded = true; + } + if (!isCaseIncluded) { + const hasEffectsContext = createHasEffectsContext(); + hasEffectsContext.ignore.breaks = true; + isCaseIncluded = switchCase.hasEffects(hasEffectsContext); + } + if (isCaseIncluded) { + switchCase.include(context, includeChildrenRecursively); + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + else { + onlyHasBrokenFlow = brokenFlow; + } + } + if (isCaseIncluded && this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + context.hasBreak = hasBreak; + } + initialise() { + super.initialise(); + for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) { + if (this.cases[caseIndex].test === null) { + this.defaultCase = caseIndex; + return; + } + } + this.defaultCase = null; + } + parseNode(esTreeNode) { + this.discriminant = new (this.scope.context.getNodeConstructor(esTreeNode.discriminant.type))(this, this.parentScope).parseNode(esTreeNode.discriminant); + return super.parseNode(esTreeNode); + } + render(code, options) { + this.discriminant.render(code, options); + if (this.cases.length > 0) { + renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options); + } + } +} + +class TaggedTemplateExpression extends CallExpressionBase { + bind() { + super.bind(); + if (this.tag.type === Identifier$1) { + const name = this.tag.name; + const variable = this.scope.findVariable(name); + if (variable.isNamespace) { + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(name), this.start); + } + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.quasi.expressions) { + if (argument.hasEffects(context)) + return true; + } + return (this.tag.hasEffects(context) || + this.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.tag.include(context, includeChildrenRecursively); + this.quasi.include(context, includeChildrenRecursively); + } + this.tag.includeCallArguments(context, this.args); + const [returnExpression] = this.getReturnExpression(); + if (!returnExpression.included) { + returnExpression.include(context, false); + } + } + initialise() { + super.initialise(); + this.args = [UNKNOWN_EXPRESSION, ...this.quasi.expressions]; + this.interaction = { + args: [ + this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null, + ...this.args + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + render(code, options) { + this.tag.render(code, options, { isCalleeOfRenderedParent: true }); + this.quasi.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.tag.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class TemplateElement extends NodeBase { + get tail() { + return isFlagSet(this.flags, 1048576 /* Flag.tail */); + } + set tail(value) { + this.flags = setFlag(this.flags, 1048576 /* Flag.tail */, value); + } + // Do not try to bind value + bind() { } + hasEffects() { + return false; + } + include() { + this.included = true; + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + return super.parseNode(esTreeNode); + } + render() { } +} + +class TemplateLiteral extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || this.quasis.length !== 1) { + return UnknownValue; + } + return this.quasis[0].value.cooked; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) { + return UNKNOWN_RETURN_EXPRESSION; + } + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } + render(code, options) { + code.indentExclusionRanges.push([this.start, this.end]); + super.render(code, options); + } +} + +class ModuleScope extends ChildScope { + constructor(parent, context) { + super(parent, context); + this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context, 'other')); + } + addDeclaration(identifier, context, init, kind) { + if (this.context.module.importDescriptions.has(identifier.name)) { + context.error(logRedeclarationError(identifier.name), identifier.start); + } + return super.addDeclaration(identifier, context, init, kind); + } + addExportDefaultDeclaration(name, exportDefaultDeclaration, context) { + const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context); + this.variables.set('default', variable); + return variable; + } + addNamespaceMemberAccess() { } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + // all module level variables are already deconflicted when deconflicting the chunk + for (const scope of this.children) + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + findLexicalBoundary() { + return this; + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.context.traceVariable(name) || this.parent.findVariable(name); + if (variable instanceof GlobalVariable) { + this.accessedOutsideVariables.set(name, variable); + } + return variable; + } +} + +class ThisExpression extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length === 0) { + return interaction.type !== INTERACTION_ACCESSED; + } + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + super.initialise(); + this.alias = + this.scope.findLexicalBoundary() instanceof ModuleScope + ? this.scope.context.moduleContext + : null; + if (this.alias === 'undefined') { + this.scope.context.log(LOGLEVEL_WARN, logThisIsUndefined(), this.start); + } + } + render(code) { + if (this.alias !== null) { + code.overwrite(this.start, this.end, this.alias, { + contentOnly: false, + storeName: true + }); + } + } +} + +class ThrowStatement extends NodeBase { + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + render(code, options) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'throw'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } +} + +class TryStatement extends NodeBase { + constructor() { + super(...arguments); + this.directlyIncluded = false; + this.includedLabelsAfterBlock = null; + } + hasEffects(context) { + return ((this.scope.context.options.treeshake.tryCatchDeoptimization + ? this.block.body.length > 0 + : this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context)); + } + include(context, includeChildrenRecursively) { + const tryCatchDeoptimization = this.scope.context.options.treeshake?.tryCatchDeoptimization; + const { brokenFlow, includedLabels } = context; + if (!this.directlyIncluded || !tryCatchDeoptimization) { + this.included = true; + this.directlyIncluded = true; + this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively); + if (includedLabels.size > 0) { + this.includedLabelsAfterBlock = [...includedLabels]; + } + context.brokenFlow = brokenFlow; + } + else if (this.includedLabelsAfterBlock) { + for (const label of this.includedLabelsAfterBlock) { + includedLabels.add(label); + } + } + if (this.handler !== null) { + this.handler.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + this.finalizer?.include(context, includeChildrenRecursively); + } +} + +const unaryOperators = { + '!': value => !value, + '+': value => +value, + '-': value => -value, + delete: () => UnknownValue, + typeof: value => typeof value, + void: () => undefined, + '~': value => ~value +}; +class UnaryExpression extends NodeBase { + get prefix() { + return isFlagSet(this.flags, 2097152 /* Flag.prefix */); + } + set prefix(value) { + this.flags = setFlag(this.flags, 2097152 /* Flag.prefix */, value); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof argumentValue === 'symbol') + return UnknownValue; + return unaryOperators[this.operator](argumentValue); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.operator === 'typeof' && this.argument instanceof Identifier) + return false; + return (this.argument.hasEffects(context) || + (this.operator === 'delete' && + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context))); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.operator === 'delete') { + this.argument.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class UpdateExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return this.argument.hasEffectsAsAssignmentTarget(context, true); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); + } + initialise() { + super.initialise(); + this.argument.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _ } } = options; + this.argument.render(code, options); + if (format === 'system') { + const variable = this.argument.variable; + const exportNames = exportNamesByVariable.get(variable); + if (exportNames) { + if (this.prefix) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, this.start, this.end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options); + } + } + else { + const operator = this.operator[0]; + renderSystemExportSequenceBeforeExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options, `${_}${operator}${_}1`); + } + } + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.argument.deoptimizePath(EMPTY_PATH); + if (this.argument instanceof Identifier) { + const variable = this.scope.findVariable(this.argument.name); + variable.markReassigned(); + } + this.scope.context.requestTreeshakingPass(); + } +} + +function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) { + for (const declarator of declarations) { + if (!declarator.id.included) + return false; + if (declarator.id.type === Identifier$1) { + if (exportNamesByVariable.has(declarator.id.variable)) + return false; + } + else { + const exportedVariables = []; + declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable); + if (exportedVariables.length > 0) + return false; + } + } + return true; +} +class VariableDeclaration extends NodeBase { + deoptimizePath() { + for (const declarator of this.declarations) { + declarator.deoptimizePath(EMPTY_PATH); + } + } + hasEffectsOnInteractionAtPath() { + return false; + } + include(context, includeChildrenRecursively, { asSingleStatement } = BLANK) { + this.included = true; + for (const declarator of this.declarations) { + if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) + declarator.include(context, includeChildrenRecursively); + const { id, init } = declarator; + if (asSingleStatement) { + id.include(context, includeChildrenRecursively); + } + if (init && + id.included && + !init.included && + (id instanceof ObjectPattern || id instanceof ArrayPattern)) { + init.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + this.isUsingDeclaration = this.kind === 'await using' || this.kind === 'using'; + for (const declarator of this.declarations) { + declarator.declareDeclarator(this.kind, this.isUsingDeclaration); + } + } + removeAnnotations(code) { + this.declarations[0].removeAnnotations(code); + } + render(code, options, nodeRenderOptions = BLANK) { + if (this.isUsingDeclaration || + areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) { + for (const declarator of this.declarations) { + declarator.render(code, options); + } + if (!nodeRenderOptions.isNoStatement && + code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) { + code.appendLeft(this.end, ';'); + } + } + else { + this.renderReplacedDeclarations(code, options); + } + } + applyDeoptimizations() { } + renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) { + if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) { + code.remove(this.end - 1, this.end); + } + separatorString += ';'; + if (lastSeparatorPos === null) { + code.appendLeft(renderedContentEnd, separatorString); + } + else { + if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ && + (code.original.charCodeAt(this.end) === 10 /*"\n"*/ || + code.original.charCodeAt(this.end) === 13) /*"\r"*/) { + actualContentEnd--; + if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) { + actualContentEnd--; + } + } + if (actualContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.remove(actualContentEnd, renderedContentEnd); + } + } + if (systemPatternExports.length > 0) { + code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`); + } + } + renderReplacedDeclarations(code, options) { + const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0)); + let actualContentEnd, renderedContentEnd; + renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length); + let lastSeparatorPos = renderedContentEnd - 1; + code.remove(this.start, lastSeparatorPos); + let isInDeclaration = false; + let hasRenderedContent = false; + let separatorString = '', leadingString, nextSeparatorString; + const aggregatedSystemExports = []; + const singleSystemExport = gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports); + for (const { node, start, separator, contentEnd, end } of separatedNodes) { + if (!node.included) { + code.remove(start, end); + node.removeAnnotations(code); + continue; + } + node.render(code, options); + leadingString = ''; + nextSeparatorString = ''; + if (!node.id.included || + (node.id instanceof Identifier && + isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) { + if (hasRenderedContent) { + separatorString += ';'; + } + isInDeclaration = false; + } + else { + if (singleSystemExport && singleSystemExport === node.id.variable) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); + renderSystemExportExpression(singleSystemExport, findNonWhiteSpace(code.original, operatorPos + 1), separator === null ? contentEnd : separator, code, options); + } + if (isInDeclaration) { + separatorString += ','; + } + else { + if (hasRenderedContent) { + separatorString += ';'; + } + leadingString += `${this.kind} `; + isInDeclaration = true; + } + } + if (renderedContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.appendLeft(renderedContentEnd, leadingString); + } + actualContentEnd = contentEnd; + renderedContentEnd = end; + hasRenderedContent = true; + lastSeparatorPos = separator; + separatorString = nextSeparatorString; + } + this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, aggregatedSystemExports, options); + } +} +function gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports) { + let singleSystemExport = null; + if (options.format === 'system') { + for (const { node } of separatedNodes) { + if (node.id instanceof Identifier && + node.init && + aggregatedSystemExports.length === 0 && + options.exportNamesByVariable.get(node.id.variable)?.length === 1) { + singleSystemExport = node.id.variable; + aggregatedSystemExports.push(singleSystemExport); + } + else { + node.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable); + } + } + if (aggregatedSystemExports.length > 1) { + singleSystemExport = null; + } + else if (singleSystemExport) { + aggregatedSystemExports.length = 0; + } + } + return singleSystemExport; +} + +class WhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class YieldExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return !(context.ignore.returnYield && !this.argument?.hasEffects(context)); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'yield'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } + } +} + +// This file is generated by scripts/generate-buffer-parsers.js. +// Do not edit this file directly. +function convertProgram(buffer, parent, parentScope) { + return convertNode(parent, parentScope, 0, getAstBuffer(buffer)); +} +const nodeTypeStrings = [ + 'PanicError', + 'ParseError', + 'ArrayExpression', + 'ArrayPattern', + 'ArrowFunctionExpression', + 'AssignmentExpression', + 'AssignmentPattern', + 'AwaitExpression', + 'BinaryExpression', + 'BlockStatement', + 'BreakStatement', + 'CallExpression', + 'CatchClause', + 'ChainExpression', + 'ClassBody', + 'ClassDeclaration', + 'ClassExpression', + 'ConditionalExpression', + 'ContinueStatement', + 'DebuggerStatement', + 'Decorator', + 'ExpressionStatement', + 'DoWhileStatement', + 'EmptyStatement', + 'ExportAllDeclaration', + 'ExportDefaultDeclaration', + 'ExportNamedDeclaration', + 'ExportSpecifier', + 'ExpressionStatement', + 'ForInStatement', + 'ForOfStatement', + 'ForStatement', + 'FunctionDeclaration', + 'FunctionExpression', + 'Identifier', + 'IfStatement', + 'ImportAttribute', + 'ImportDeclaration', + 'ImportDefaultSpecifier', + 'ImportExpression', + 'ImportNamespaceSpecifier', + 'ImportSpecifier', + 'JSXAttribute', + 'JSXClosingElement', + 'JSXClosingFragment', + 'JSXElement', + 'JSXEmptyExpression', + 'JSXExpressionContainer', + 'JSXFragment', + 'JSXIdentifier', + 'JSXMemberExpression', + 'JSXNamespacedName', + 'JSXOpeningElement', + 'JSXOpeningFragment', + 'JSXSpreadAttribute', + 'JSXSpreadChild', + 'JSXText', + 'LabeledStatement', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'LogicalExpression', + 'MemberExpression', + 'MetaProperty', + 'MethodDefinition', + 'NewExpression', + 'ObjectExpression', + 'ObjectPattern', + 'PrivateIdentifier', + 'Program', + 'Property', + 'PropertyDefinition', + 'RestElement', + 'ReturnStatement', + 'SequenceExpression', + 'SpreadElement', + 'StaticBlock', + 'Super', + 'SwitchCase', + 'SwitchStatement', + 'TaggedTemplateExpression', + 'TemplateElement', + 'TemplateLiteral', + 'ThisExpression', + 'ThrowStatement', + 'TryStatement', + 'UnaryExpression', + 'UpdateExpression', + 'VariableDeclaration', + 'VariableDeclarator', + 'WhileStatement', + 'YieldExpression' +]; +const nodeConstructors$1 = [ + PanicError, + ParseError, + ArrayExpression, + ArrayPattern, + ArrowFunctionExpression, + AssignmentExpression, + AssignmentPattern, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + CallExpression, + CatchClause, + ChainExpression, + ClassBody, + ClassDeclaration, + ClassExpression, + ConditionalExpression, + ContinueStatement, + DebuggerStatement, + Decorator, + ExpressionStatement, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExportSpecifier, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportAttribute, + ImportDeclaration, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, + ImportSpecifier, + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXSpreadChild, + JSXText, + LabeledStatement, + Literal, + Literal, + Literal, + Literal, + Literal, + Literal, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + ObjectPattern, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, + RestElement, + ReturnStatement, + SequenceExpression, + SpreadElement, + StaticBlock, + Super, + SwitchCase, + SwitchStatement, + TaggedTemplateExpression, + TemplateElement, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + YieldExpression +]; +const bufferParsers = [ + function panicError(node, position, buffer) { + node.message = buffer.convertString(buffer[position]); + }, + function parseError(node, position, buffer) { + node.message = buffer.convertString(buffer[position]); + }, + function arrayExpression(node, position, buffer) { + const { scope } = node; + node.elements = convertNodeList(node, scope, buffer[position], buffer); + }, + function arrayPattern(node, position, buffer) { + const { scope } = node; + node.elements = convertNodeList(node, scope, buffer[position], buffer); + }, + function arrowFunctionExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.expression = (flags & 2) === 2; + node.generator = (flags & 4) === 4; + const annotations = (node.annotations = convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 2], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 3], buffer); + }, + function assignmentExpression(node, position, buffer) { + const { scope } = node; + node.operator = FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function assignmentPattern(node, position, buffer) { + const { scope } = node; + node.left = convertNode(node, scope, buffer[position], buffer); + node.right = convertNode(node, scope, buffer[position + 1], buffer); + }, + function awaitExpression(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function binaryExpression(node, position, buffer) { + const { scope } = node; + node.operator = FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function blockStatement(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + }, + function breakStatement(node, position, buffer) { + const { scope } = node; + const labelPosition = buffer[position]; + node.label = labelPosition === 0 ? null : convertNode(node, scope, labelPosition, buffer); + }, + function callExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.optional = (flags & 1) === 1; + node.annotations = convertAnnotations(buffer[position + 1], buffer); + node.callee = convertNode(node, scope, buffer[position + 2], buffer); + node.arguments = convertNodeList(node, scope, buffer[position + 3], buffer); + }, + function catchClause(node, position, buffer) { + const { scope } = node; + const parameterPosition = buffer[position]; + const parameter = (node.param = + parameterPosition === 0 ? null : convertNode(node, scope, parameterPosition, buffer)); + parameter?.declare('parameter', UNKNOWN_EXPRESSION); + node.body = convertNode(node, scope.bodyScope, buffer[position + 1], buffer); + }, + function chainExpression(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function classBody(node, position, buffer) { + const { scope } = node; + const bodyPosition = buffer[position]; + if (bodyPosition) { + const length = buffer[bodyPosition]; + const body = (node.body = new Array(length)); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[bodyPosition + 1 + index]; + body[index] = convertNode(node, (buffer[nodePosition + 3] & 1) === 0 ? scope.instanceScope : scope, nodePosition, buffer); + } + } + else { + node.body = []; + } + }, + function classDeclaration(node, position, buffer) { + const { scope } = node; + node.decorators = convertNodeList(node, scope, buffer[position], buffer); + const idPosition = buffer[position + 1]; + node.id = + idPosition === 0 ? null : convertNode(node, scope.parent, idPosition, buffer); + const superClassPosition = buffer[position + 2]; + node.superClass = + superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function classExpression(node, position, buffer) { + const { scope } = node; + node.decorators = convertNodeList(node, scope, buffer[position], buffer); + const idPosition = buffer[position + 1]; + node.id = idPosition === 0 ? null : convertNode(node, scope, idPosition, buffer); + const superClassPosition = buffer[position + 2]; + node.superClass = + superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function conditionalExpression(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.consequent = convertNode(node, scope, buffer[position + 1], buffer); + node.alternate = convertNode(node, scope, buffer[position + 2], buffer); + }, + function continueStatement(node, position, buffer) { + const { scope } = node; + const labelPosition = buffer[position]; + node.label = labelPosition === 0 ? null : convertNode(node, scope, labelPosition, buffer); + }, + function debuggerStatement() { }, + function decorator(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function directive(node, position, buffer) { + const { scope } = node; + node.directive = buffer.convertString(buffer[position]); + node.expression = convertNode(node, scope, buffer[position + 1], buffer); + }, + function doWhileStatement(node, position, buffer) { + const { scope } = node; + node.body = convertNode(node, scope, buffer[position], buffer); + node.test = convertNode(node, scope, buffer[position + 1], buffer); + }, + function emptyStatement() { }, + function exportAllDeclaration(node, position, buffer) { + const { scope } = node; + const exportedPosition = buffer[position]; + node.exported = + exportedPosition === 0 ? null : convertNode(node, scope, exportedPosition, buffer); + node.source = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function exportDefaultDeclaration(node, position, buffer) { + const { scope } = node; + node.declaration = convertNode(node, scope, buffer[position], buffer); + }, + function exportNamedDeclaration(node, position, buffer) { + const { scope } = node; + node.specifiers = convertNodeList(node, scope, buffer[position], buffer); + const sourcePosition = buffer[position + 1]; + node.source = sourcePosition === 0 ? null : convertNode(node, scope, sourcePosition, buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + const declarationPosition = buffer[position + 3]; + node.declaration = + declarationPosition === 0 ? null : convertNode(node, scope, declarationPosition, buffer); + }, + function exportSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + const exportedPosition = buffer[position + 1]; + node.exported = + exportedPosition === 0 ? node.local : convertNode(node, scope, exportedPosition, buffer); + }, + function expressionStatement(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function forInStatement(node, position, buffer) { + const { scope } = node; + node.left = convertNode(node, scope, buffer[position], buffer); + node.right = convertNode(node, scope, buffer[position + 1], buffer); + node.body = convertNode(node, scope, buffer[position + 2], buffer); + }, + function forOfStatement(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.await = (flags & 1) === 1; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function forStatement(node, position, buffer) { + const { scope } = node; + const initPosition = buffer[position]; + node.init = initPosition === 0 ? null : convertNode(node, scope, initPosition, buffer); + const testPosition = buffer[position + 1]; + node.test = testPosition === 0 ? null : convertNode(node, scope, testPosition, buffer); + const updatePosition = buffer[position + 2]; + node.update = updatePosition === 0 ? null : convertNode(node, scope, updatePosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function functionDeclaration(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.generator = (flags & 2) === 2; + const annotations = (node.annotations = convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const idPosition = buffer[position + 2]; + node.id = + idPosition === 0 ? null : convertNode(node, scope.parent, idPosition, buffer); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 4], buffer); + }, + function functionExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.generator = (flags & 2) === 2; + const annotations = (node.annotations = convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const idPosition = buffer[position + 2]; + node.id = idPosition === 0 ? null : convertNode(node, node.idScope, idPosition, buffer); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 4], buffer); + }, + function identifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function ifStatement(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.consequent = convertNode(node, (node.consequentScope = new TrackingScope(scope)), buffer[position + 1], buffer); + const alternatePosition = buffer[position + 2]; + node.alternate = + alternatePosition === 0 + ? null + : convertNode(node, (node.alternateScope = new TrackingScope(scope)), alternatePosition, buffer); + }, + function importAttribute(node, position, buffer) { + const { scope } = node; + node.key = convertNode(node, scope, buffer[position], buffer); + node.value = convertNode(node, scope, buffer[position + 1], buffer); + }, + function importDeclaration(node, position, buffer) { + const { scope } = node; + node.specifiers = convertNodeList(node, scope, buffer[position], buffer); + node.source = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function importDefaultSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + }, + function importExpression(node, position, buffer) { + const { scope } = node; + node.source = convertNode(node, scope, buffer[position], buffer); + node.sourceAstNode = convertNode$1(buffer[position], buffer); + const optionsPosition = buffer[position + 1]; + node.options = optionsPosition === 0 ? null : convertNode(node, scope, optionsPosition, buffer); + }, + function importNamespaceSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + }, + function importSpecifier(node, position, buffer) { + const { scope } = node; + const importedPosition = buffer[position]; + node.local = convertNode(node, scope, buffer[position + 1], buffer); + node.imported = + importedPosition === 0 ? node.local : convertNode(node, scope, importedPosition, buffer); + }, + function jsxAttribute(node, position, buffer) { + const { scope } = node; + node.name = convertNode(node, scope, buffer[position], buffer); + const valuePosition = buffer[position + 1]; + node.value = valuePosition === 0 ? null : convertNode(node, scope, valuePosition, buffer); + }, + function jsxClosingElement(node, position, buffer) { + const { scope } = node; + node.name = convertNode(node, scope, buffer[position], buffer); + }, + function jsxClosingFragment() { }, + function jsxElement(node, position, buffer) { + const { scope } = node; + node.openingElement = convertNode(node, scope, buffer[position], buffer); + node.children = convertNodeList(node, scope, buffer[position + 1], buffer); + const closingElementPosition = buffer[position + 2]; + node.closingElement = + closingElementPosition === 0 + ? null + : convertNode(node, scope, closingElementPosition, buffer); + }, + function jsxEmptyExpression() { }, + function jsxExpressionContainer(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function jsxFragment(node, position, buffer) { + const { scope } = node; + node.openingFragment = convertNode(node, scope, buffer[position], buffer); + node.children = convertNodeList(node, scope, buffer[position + 1], buffer); + node.closingFragment = convertNode(node, scope, buffer[position + 2], buffer); + }, + function jsxIdentifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function jsxMemberExpression(node, position, buffer) { + const { scope } = node; + node.object = convertNode(node, scope, buffer[position], buffer); + node.property = convertNode(node, scope, buffer[position + 1], buffer); + }, + function jsxNamespacedName(node, position, buffer) { + const { scope } = node; + node.namespace = convertNode(node, scope, buffer[position], buffer); + node.name = convertNode(node, scope, buffer[position + 1], buffer); + }, + function jsxOpeningElement(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.selfClosing = (flags & 1) === 1; + node.name = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function jsxOpeningFragment(node) { + node.attributes = []; + node.selfClosing = false; + }, + function jsxSpreadAttribute(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function jsxSpreadChild(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function jsxText(node, position, buffer) { + node.value = buffer.convertString(buffer[position]); + node.raw = buffer.convertString(buffer[position + 1]); + }, + function labeledStatement(node, position, buffer) { + const { scope } = node; + node.label = convertNode(node, scope, buffer[position], buffer); + node.body = convertNode(node, scope, buffer[position + 1], buffer); + }, + function literalBigInt(node, position, buffer) { + const bigint = (node.bigint = buffer.convertString(buffer[position])); + node.raw = buffer.convertString(buffer[position + 1]); + node.value = BigInt(bigint); + }, + function literalBoolean(node, position, buffer) { + const flags = buffer[position]; + const value = (node.value = (flags & 1) === 1); + node.raw = value ? 'true' : 'false'; + }, + function literalNull(node) { + node.value = null; + }, + function literalNumber(node, position, buffer) { + const rawPosition = buffer[position]; + node.raw = rawPosition === 0 ? undefined : buffer.convertString(rawPosition); + node.value = new DataView(buffer.buffer).getFloat64((position + 1) << 2, true); + }, + function literalRegExp(node, position, buffer) { + const flags = buffer.convertString(buffer[position]); + const pattern = buffer.convertString(buffer[position + 1]); + node.raw = `/${pattern}/${flags}`; + node.regex = { flags, pattern }; + node.value = new RegExp(pattern, flags); + }, + function literalString(node, position, buffer) { + node.value = buffer.convertString(buffer[position]); + const rawPosition = buffer[position + 1]; + node.raw = rawPosition === 0 ? undefined : buffer.convertString(rawPosition); + }, + function logicalExpression(node, position, buffer) { + const { scope } = node; + node.operator = FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function memberExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.computed = (flags & 1) === 1; + node.optional = (flags & 2) === 2; + node.object = convertNode(node, scope, buffer[position + 1], buffer); + node.property = convertNode(node, scope, buffer[position + 2], buffer); + }, + function metaProperty(node, position, buffer) { + const { scope } = node; + node.meta = convertNode(node, scope, buffer[position], buffer); + node.property = convertNode(node, scope, buffer[position + 1], buffer); + }, + function methodDefinition(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.static = (flags & 1) === 1; + node.computed = (flags & 2) === 2; + node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer); + node.key = convertNode(node, scope, buffer[position + 2], buffer); + node.value = convertNode(node, scope, buffer[position + 3], buffer); + node.kind = FIXED_STRINGS[buffer[position + 4]]; + }, + function newExpression(node, position, buffer) { + const { scope } = node; + node.annotations = convertAnnotations(buffer[position], buffer); + node.callee = convertNode(node, scope, buffer[position + 1], buffer); + node.arguments = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function objectExpression(node, position, buffer) { + const { scope } = node; + node.properties = convertNodeList(node, scope, buffer[position], buffer); + }, + function objectPattern(node, position, buffer) { + const { scope } = node; + node.properties = convertNodeList(node, scope, buffer[position], buffer); + }, + function privateIdentifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function program(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + node.invalidAnnotations = convertAnnotations(buffer[position + 1], buffer); + }, + function property(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.method = (flags & 1) === 1; + node.shorthand = (flags & 2) === 2; + node.computed = (flags & 4) === 4; + const keyPosition = buffer[position + 1]; + node.value = convertNode(node, scope, buffer[position + 2], buffer); + node.kind = FIXED_STRINGS[buffer[position + 3]]; + node.key = keyPosition === 0 ? node.value : convertNode(node, scope, keyPosition, buffer); + }, + function propertyDefinition(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.static = (flags & 1) === 1; + node.computed = (flags & 2) === 2; + node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer); + node.key = convertNode(node, scope, buffer[position + 2], buffer); + const valuePosition = buffer[position + 3]; + node.value = valuePosition === 0 ? null : convertNode(node, scope, valuePosition, buffer); + }, + function restElement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function returnStatement(node, position, buffer) { + const { scope } = node; + const argumentPosition = buffer[position]; + node.argument = + argumentPosition === 0 ? null : convertNode(node, scope, argumentPosition, buffer); + }, + function sequenceExpression(node, position, buffer) { + const { scope } = node; + node.expressions = convertNodeList(node, scope, buffer[position], buffer); + }, + function spreadElement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function staticBlock(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + }, + function superElement() { }, + function switchCase(node, position, buffer) { + const { scope } = node; + const testPosition = buffer[position]; + node.test = testPosition === 0 ? null : convertNode(node, scope, testPosition, buffer); + node.consequent = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function switchStatement(node, position, buffer) { + const { scope } = node; + node.discriminant = convertNode(node, node.parentScope, buffer[position], buffer); + node.cases = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function taggedTemplateExpression(node, position, buffer) { + const { scope } = node; + node.tag = convertNode(node, scope, buffer[position], buffer); + node.quasi = convertNode(node, scope, buffer[position + 1], buffer); + }, + function templateElement(node, position, buffer) { + const flags = buffer[position]; + node.tail = (flags & 1) === 1; + const cookedPosition = buffer[position + 1]; + const cooked = cookedPosition === 0 ? undefined : buffer.convertString(cookedPosition); + const raw = buffer.convertString(buffer[position + 2]); + node.value = { cooked, raw }; + }, + function templateLiteral(node, position, buffer) { + const { scope } = node; + node.quasis = convertNodeList(node, scope, buffer[position], buffer); + node.expressions = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function thisExpression() { }, + function throwStatement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function tryStatement(node, position, buffer) { + const { scope } = node; + node.block = convertNode(node, scope, buffer[position], buffer); + const handlerPosition = buffer[position + 1]; + node.handler = handlerPosition === 0 ? null : convertNode(node, scope, handlerPosition, buffer); + const finalizerPosition = buffer[position + 2]; + node.finalizer = + finalizerPosition === 0 ? null : convertNode(node, scope, finalizerPosition, buffer); + }, + function unaryExpression(node, position, buffer) { + const { scope } = node; + node.operator = FIXED_STRINGS[buffer[position]]; + node.argument = convertNode(node, scope, buffer[position + 1], buffer); + }, + function updateExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.prefix = (flags & 1) === 1; + node.operator = FIXED_STRINGS[buffer[position + 1]]; + node.argument = convertNode(node, scope, buffer[position + 2], buffer); + }, + function variableDeclaration(node, position, buffer) { + const { scope } = node; + node.kind = FIXED_STRINGS[buffer[position]]; + node.declarations = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function variableDeclarator(node, position, buffer) { + const { scope } = node; + node.id = convertNode(node, scope, buffer[position], buffer); + const initPosition = buffer[position + 1]; + node.init = initPosition === 0 ? null : convertNode(node, scope, initPosition, buffer); + }, + function whileStatement(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.body = convertNode(node, scope, buffer[position + 1], buffer); + }, + function yieldExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.delegate = (flags & 1) === 1; + const argumentPosition = buffer[position + 1]; + node.argument = + argumentPosition === 0 ? null : convertNode(node, scope, argumentPosition, buffer); + } +]; +function convertNode(parent, parentScope, position, buffer) { + const nodeType = buffer[position]; + const NodeConstructor = nodeConstructors$1[nodeType]; + /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */ + if (!NodeConstructor) { + console.trace(); + throw new Error(`Unknown node type: ${nodeType}`); + } + const node = new NodeConstructor(parent, parentScope); + node.type = nodeTypeStrings[nodeType]; + node.start = buffer[position + 1]; + node.end = buffer[position + 2]; + bufferParsers[nodeType](node, position + 3, buffer); + node.initialise(); + return node; +} +function convertNodeList(parent, parentScope, position, buffer) { + if (position === 0) + return EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[position++]; + list[index] = nodePosition ? convertNode(parent, parentScope, nodePosition, buffer) : null; + } + return list; +} + +class UnknownNode extends NodeBase { + hasEffects() { + return true; + } + include(context) { + super.include(context, true); + } +} + +// This file is generated by scripts/generate-node-index.js. +// Do not edit this file directly. +const nodeConstructors = { + ArrayExpression, + ArrayPattern, + ArrowFunctionExpression, + AssignmentExpression, + AssignmentPattern, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + CallExpression, + CatchClause, + ChainExpression, + ClassBody, + ClassDeclaration, + ClassExpression, + ConditionalExpression, + ContinueStatement, + DebuggerStatement, + Decorator, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExportSpecifier, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportAttribute, + ImportDeclaration, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, + ImportSpecifier, + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXSpreadChild, + JSXText, + LabeledStatement, + Literal, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + ObjectPattern, + PanicError, + ParseError, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, + RestElement, + ReturnStatement, + SequenceExpression, + SpreadElement, + StaticBlock, + Super, + SwitchCase, + SwitchStatement, + TaggedTemplateExpression, + TemplateElement, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UnknownNode, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + YieldExpression +}; + +class ExportShimVariable extends Variable { + constructor(module) { + super(MISSING_EXPORT_SHIM_VARIABLE); + this.module = module; + } + include() { + super.include(); + this.module.needsExportShim = true; + } +} + +var BuildPhase; +(function (BuildPhase) { + BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE"; + BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE"; + BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE"; +})(BuildPhase || (BuildPhase = {})); + +const sourceMapCache = new WeakMap(); +/** + * This clears the decoded array and falls back to the encoded string form. + * Sourcemap mappings arrays can be very large and holding on to them for longer + * than is necessary leads to poor heap utilization. + */ +function resetCacheToEncoded(cache) { + if (cache.encodedMappings === undefined && cache.decodedMappings) { + cache.encodedMappings = encode(cache.decodedMappings); + } + cache.decodedMappings = undefined; +} +function resetSourcemapCache(map, sourcemapChain) { + if (map) { + const cache = sourceMapCache.get(map); + if (cache) { + resetCacheToEncoded(cache); + } + } + if (!sourcemapChain) { + return; + } + for (const map of sourcemapChain) { + if (map.missing) + continue; + resetSourcemapCache(map); + } +} +function decodedSourcemap(map) { + if (!map) + return null; + if (typeof map === 'string') { + map = JSON.parse(map); + } + if (!map.mappings) { + return { + mappings: [], + names: [], + sources: [], + version: 3 + }; + } + const originalMappings = map.mappings; + const isAlreadyDecoded = Array.isArray(originalMappings); + const cache = { + decodedMappings: isAlreadyDecoded ? originalMappings : undefined, + encodedMappings: isAlreadyDecoded ? undefined : originalMappings + }; + const decodedMap = { + ...map, + // By moving mappings behind an accessor, we can avoid unneeded computation for cases + // where the mappings field is never actually accessed. This appears to greatly reduce + // the overhead of sourcemap decoding in terms of both compute time and memory usage. + get mappings() { + if (cache.decodedMappings) { + return cache.decodedMappings; + } + // If decodedMappings doesn't exist then encodedMappings should. + // The only scenario where cache.encodedMappings should be undefined is if the map + // this was constructed from was already decoded, or if mappings was set to a new + // decoded string. In either case, this line shouldn't get hit. + cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : []; + cache.encodedMappings = undefined; + return cache.decodedMappings; + } + }; + sourceMapCache.set(decodedMap, cache); + return decodedMap; +} + +function getId(m) { + return m.id; +} + +function getOriginalLocation(sourcemapChain, location) { + const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !sourcemap.missing); + traceSourcemap: while (filteredSourcemapChain.length > 0) { + const sourcemap = filteredSourcemapChain.pop(); + const line = sourcemap.mappings[location.line - 1]; + if (line) { + const filteredLine = line.filter((segment) => segment.length > 1); + const lastSegment = filteredLine[filteredLine.length - 1]; + for (const segment of filteredLine) { + if (segment[0] >= location.column || segment === lastSegment) { + location = { + column: segment[3], + line: segment[2] + 1 + }; + continue traceSourcemap; + } + } + } + throw new Error("Can't resolve original location of error."); + } + return location; +} + +const ATTRIBUTE_KEYWORDS = new Set(['assert', 'with']); +function getAttributesFromImportExpression(node) { + const { scope: { context }, options, start } = node; + if (!(options instanceof ObjectExpression)) { + if (options) { + context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), start); + } + return EMPTY_OBJECT; + } + const assertProperty = options.properties.find((property) => ATTRIBUTE_KEYWORDS.has(getPropertyKey(property)))?.value; + if (!assertProperty) { + return EMPTY_OBJECT; + } + if (!(assertProperty instanceof ObjectExpression)) { + context.module.log(LOGLEVEL_WARN, logImportOptionsAreInvalid(context.module.id), start); + return EMPTY_OBJECT; + } + const assertFields = assertProperty.properties + .map(property => { + const key = getPropertyKey(property); + if (typeof key === 'string' && + typeof property.value.value === 'string') { + return [key, property.value.value]; + } + context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), property.start); + return null; + }) + .filter((property) => !!property); + if (assertFields.length > 0) { + return Object.fromEntries(assertFields); + } + return EMPTY_OBJECT; +} +const getPropertyKey = (property) => { + const key = property.key; + return (key && + !property.computed && + (key.name || key.value)); +}; +function getAttributesFromImportExportDeclaration(attributes) { + return attributes?.length + ? Object.fromEntries(attributes.map(assertion => [getPropertyKey(assertion), assertion.value.value])) + : EMPTY_OBJECT; +} +function doAttributesDiffer(assertionA, assertionB) { + const keysA = Object.keys(assertionA); + return (keysA.length !== Object.keys(assertionB).length || + keysA.some(key => assertionA[key] !== assertionB[key])); +} + +let timers = new Map(); +function getPersistedLabel(label, level) { + switch (level) { + case 1: { + return `# ${label}`; + } + case 2: { + return `## ${label}`; + } + case 3: { + return label; + } + default: { + return `- ${label}`; + } + } +} +function timeStartImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const startMemory = process$1.memoryUsage().heapUsed; + const startTime = performance.now(); + const timer = timers.get(label); + if (timer === undefined) { + timers.set(label, { + memory: 0, + startMemory, + startTime, + time: 0, + totalMemory: 0 + }); + } + else { + timer.startMemory = startMemory; + timer.startTime = startTime; + } +} +function timeEndImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const timer = timers.get(label); + if (timer !== undefined) { + const currentMemory = process$1.memoryUsage().heapUsed; + timer.memory += currentMemory - timer.startMemory; + timer.time += performance.now() - timer.startTime; + timer.totalMemory = Math.max(timer.totalMemory, currentMemory); + } +} +function getTimings() { + const newTimings = {}; + for (const [label, { memory, time, totalMemory }] of timers) { + newTimings[label] = [time, memory, totalMemory]; + } + return newTimings; +} +let timeStart = doNothing; +let timeEnd = doNothing; +const TIMED_PLUGIN_HOOKS = [ + 'augmentChunkHash', + 'buildEnd', + 'buildStart', + 'generateBundle', + 'load', + 'moduleParsed', + 'options', + 'outputOptions', + 'renderChunk', + 'renderDynamicImport', + 'renderStart', + 'resolveDynamicImport', + 'resolveFileUrl', + 'resolveId', + 'resolveImportMeta', + 'shouldTransformCachedModule', + 'transform', + 'writeBundle' +]; +function getPluginWithTimers(plugin, index) { + if (plugin._hasTimer) + return plugin; + plugin._hasTimer = true; + for (const hook of TIMED_PLUGIN_HOOKS) { + if (hook in plugin) { + let timerLabel = `plugin ${index}`; + if (plugin.name) { + timerLabel += ` (${plugin.name})`; + } + timerLabel += ` - ${hook}`; + const handler = function (...parameters) { + timeStart(timerLabel, 4); + const result = hookFunction.apply(this, parameters); + timeEnd(timerLabel, 4); + return result; + }; + let hookFunction; + if (typeof plugin[hook].handler === 'function') { + hookFunction = plugin[hook].handler; + plugin[hook].handler = handler; + } + else { + hookFunction = plugin[hook]; + plugin[hook] = handler; + } + } + } + return plugin; +} +function initialiseTimers(inputOptions) { + if (inputOptions.perf) { + timers = new Map(); + timeStart = timeStartImpl; + timeEnd = timeEndImpl; + inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers); + } + else { + timeStart = doNothing; + timeEnd = doNothing; + } +} + +const MISSING_EXPORT_SHIM_DESCRIPTION = { + identifier: null, + localName: MISSING_EXPORT_SHIM_VARIABLE +}; +function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) { + const searchedModules = searchedNamesAndModules.get(name); + if (searchedModules) { + if (searchedModules.has(target)) { + return isExportAllSearch ? [null] : error(logCircularReexport(name, target.id)); + } + searchedModules.add(target); + } + else { + searchedNamesAndModules.set(name, new Set([target])); + } + return target.getVariableForExportName(name, { + importerForSideEffects, + isExportAllSearch, + searchedNamesAndModules + }); +} +function getAndExtendSideEffectModules(variable, module) { + const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, (getNewSet)); + let currentVariable = variable; + const referencedVariables = new Set([currentVariable]); + while (true) { + const importingModule = currentVariable.module; + currentVariable = + currentVariable instanceof ExportDefaultVariable + ? currentVariable.getDirectOriginalVariable() + : currentVariable instanceof SyntheticNamedExportVariable + ? currentVariable.syntheticNamespace + : null; + if (!currentVariable || referencedVariables.has(currentVariable)) { + break; + } + referencedVariables.add(currentVariable); + sideEffectModules.add(importingModule); + const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable); + if (originalSideEffects) { + for (const module of originalSideEffects) { + sideEffectModules.add(module); + } + } + } + return sideEffectModules; +} +class Module { + constructor(graph, id, options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes) { + this.graph = graph; + this.id = id; + this.options = options; + this.alternativeReexportModules = new Map(); + this.chunkFileNames = new Set(); + this.chunkNames = []; + this.cycles = new Set(); + this.dependencies = new Set(); + this.dynamicDependencies = new Set(); + this.dynamicImporters = []; + this.dynamicImports = []; + this.execIndex = Infinity; + this.hasTreeShakingPassStarted = false; + this.implicitlyLoadedAfter = new Set(); + this.implicitlyLoadedBefore = new Set(); + this.importDescriptions = new Map(); + this.importMetas = []; + this.importedFromNotTreeshaken = false; + this.importers = []; + this.includedDynamicImporters = []; + this.includedImports = new Set(); + this.isExecuted = false; + this.isUserDefinedEntryPoint = false; + this.needsExportShim = false; + this.sideEffectDependenciesByVariable = new Map(); + this.sourcesWithAttributes = new Map(); + this.allExportNames = null; + this.ast = null; + this.exportAllModules = []; + this.exportAllSources = new Set(); + this.exportNamesByVariable = null; + this.exportShimVariable = new ExportShimVariable(this); + this.exports = new Map(); + this.namespaceReexportsByName = new Map(); + this.reexportDescriptions = new Map(); + this.relevantDependencies = null; + this.syntheticExports = new Map(); + this.syntheticNamespace = null; + this.transformDependencies = []; + this.transitiveReexports = null; + this.excludeFromSourcemap = /\0/.test(id); + this.context = options.moduleContext(id); + this.preserveSignature = this.options.preserveEntrySignatures; + // eslint-disable-next-line @typescript-eslint/no-this-alias + const module = this; + const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this; + this.info = { + ast: null, + attributes, + code: null, + get dynamicallyImportedIdResolutions() { + return dynamicImports + .map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument]) + .filter(Boolean); + }, + get dynamicallyImportedIds() { + // We cannot use this.dynamicDependencies because this is needed before + // dynamicDependencies are populated + return dynamicImports.map(({ id }) => id).filter((id) => id != null); + }, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + get exportedBindings() { + const exportBindings = { '.': [...exports.keys()] }; + for (const [name, { source }] of reexportDescriptions) { + (exportBindings[source] ??= []).push(name); + } + for (const source of exportAllSources) { + (exportBindings[source] ??= []).push('*'); + } + return exportBindings; + }, + get exports() { + return [ + ...exports.keys(), + ...reexportDescriptions.keys(), + ...[...exportAllSources].map(() => '*') + ]; + }, + get hasDefaultExport() { + // This information is only valid after parsing + if (!module.ast) { + return null; + } + return module.exports.has('default') || reexportDescriptions.has('default'); + }, + id, + get implicitlyLoadedAfterOneOf() { + return Array.from(implicitlyLoadedAfter, getId).sort(); + }, + get implicitlyLoadedBefore() { + return Array.from(implicitlyLoadedBefore, getId).sort(); + }, + get importedIdResolutions() { + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]).filter(Boolean); + }, + get importedIds() { + // We cannot use this.dependencies because this is needed before + // dependencies are populated + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id).filter(Boolean); + }, + get importers() { + return importers.sort(); + }, + isEntry, + isExternal: false, + get isIncluded() { + if (graph.phase !== BuildPhase.GENERATE) { + return null; + } + return module.isIncluded(); + }, + meta: { ...meta }, + moduleSideEffects, + syntheticNamedExports + }; + } + basename() { + const base = basename(this.id); + const extension = extname(this.id); + return makeLegal(extension ? base.slice(0, -extension.length) : base); + } + bindReferences() { + this.ast.bind(); + } + cacheInfoGetters() { + cacheObjectGetters(this.info, [ + 'dynamicallyImportedIdResolutions', + 'dynamicallyImportedIds', + 'dynamicImporters', + 'exportedBindings', + 'exports', + 'hasDefaultExport', + 'implicitlyLoadedAfterOneOf', + 'implicitlyLoadedBefore', + 'importedIdResolutions', + 'importedIds', + 'importers' + ]); + } + error(properties, pos) { + if (pos !== undefined) { + this.addLocationToLogProps(properties, pos); + } + return error(properties); + } + // sum up the length of all ast nodes that are included + estimateSize() { + let size = 0; + for (const node of this.ast.body) { + if (node.included) { + size += node.end - node.start; + } + } + return size; + } + getAllExportNames() { + if (this.allExportNames) { + return this.allExportNames; + } + this.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + this.allExportNames.add(`*${module.id}`); + continue; + } + for (const name of module.getAllExportNames()) { + if (name !== 'default') + this.allExportNames.add(name); + } + } + // We do not count the synthetic namespace as a regular export to hide it + // from entry signatures and namespace objects + if (typeof this.info.syntheticNamedExports === 'string') { + this.allExportNames.delete(this.info.syntheticNamedExports); + } + return this.allExportNames; + } + getDependenciesToBeIncluded() { + if (this.relevantDependencies) + return this.relevantDependencies; + this.relevantDependencies = new Set(); + const necessaryDependencies = new Set(); + const alwaysCheckedDependencies = new Set(); + const dependencyVariables = new Set(this.includedImports); + if (this.info.isEntry || + this.includedDynamicImporters.length > 0 || + this.namespace.included || + this.implicitlyLoadedAfter.size > 0) { + for (const exportName of [...this.getReexports(), ...this.getExports()]) { + const [exportedVariable] = this.getVariableForExportName(exportName); + if (exportedVariable?.included) { + dependencyVariables.add(exportedVariable); + } + } + } + for (let variable of dependencyVariables) { + const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable); + if (sideEffectDependencies) { + for (const module of sideEffectDependencies) { + alwaysCheckedDependencies.add(module); + } + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + else if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + necessaryDependencies.add(variable.module); + } + if (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of this.dependencies) { + this.relevantDependencies.add(dependency); + } + } + else { + this.addRelevantSideEffectDependencies(this.relevantDependencies, necessaryDependencies, alwaysCheckedDependencies); + } + for (const dependency of necessaryDependencies) { + this.relevantDependencies.add(dependency); + } + return this.relevantDependencies; + } + getExportNamesByVariable() { + if (this.exportNamesByVariable) { + return this.exportNamesByVariable; + } + const exportNamesByVariable = new Map(); + for (const exportName of this.getAllExportNames()) { + let [tracedVariable] = this.getVariableForExportName(exportName); + if (tracedVariable instanceof ExportDefaultVariable) { + tracedVariable = tracedVariable.getOriginalVariable(); + } + if (!tracedVariable || + !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) { + continue; + } + const existingExportNames = exportNamesByVariable.get(tracedVariable); + if (existingExportNames) { + existingExportNames.push(exportName); + } + else { + exportNamesByVariable.set(tracedVariable, [exportName]); + } + } + return (this.exportNamesByVariable = exportNamesByVariable); + } + getExports() { + return [...this.exports.keys()]; + } + getReexports() { + if (this.transitiveReexports) { + return this.transitiveReexports; + } + // to avoid infinite recursion when using circular `export * from X` + this.transitiveReexports = []; + const reexports = new Set(this.reexportDescriptions.keys()); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + reexports.add(`*${module.id}`); + } + else { + for (const name of [...module.getReexports(), ...module.getExports()]) { + if (name !== 'default') + reexports.add(name); + } + } + } + return (this.transitiveReexports = [...reexports]); + } + getRenderedExports() { + // only direct exports are counted here, not reexports at all + const renderedExports = []; + const removedExports = []; + for (const exportName of this.exports.keys()) { + const [variable] = this.getVariableForExportName(exportName); + (variable?.included ? renderedExports : removedExports).push(exportName); + } + return { removedExports, renderedExports }; + } + getSyntheticNamespace() { + if (this.syntheticNamespace === null) { + this.syntheticNamespace = undefined; + [this.syntheticNamespace] = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string' + ? this.info.syntheticNamedExports + : 'default', { onlyExplicit: true }); + } + if (!this.syntheticNamespace) { + return error(logSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)); + } + return this.syntheticNamespace; + } + getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules } = EMPTY_OBJECT) { + if (name[0] === '*') { + if (name.length === 1) { + // export * from './other' + return [this.namespace]; + } + // export * from 'external' + const module = this.graph.modulesById.get(name.slice(1)); + return module.getVariableForExportName('*'); + } + // export { foo } from './other' + const reexportDeclaration = this.reexportDescriptions.get(name); + if (reexportDeclaration) { + const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules); + if (!variable) { + return this.error(logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start); + } + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + if (this.info.moduleSideEffects) { + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + } + return [variable]; + } + const exportDeclaration = this.exports.get(name); + if (exportDeclaration) { + if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { + return [this.exportShimVariable]; + } + const name = exportDeclaration.localName; + const variable = this.traceVariable(name, { + importerForSideEffects, + searchedNamesAndModules + }); + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + return [variable]; + } + if (onlyExplicit) { + return [null]; + } + if (name !== 'default') { + const foundNamespaceReexport = this.namespaceReexportsByName.get(name) ?? + this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules); + this.namespaceReexportsByName.set(name, foundNamespaceReexport); + if (foundNamespaceReexport[0]) { + return foundNamespaceReexport; + } + } + if (this.info.syntheticNamedExports) { + return [ + getOrCreate(this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())) + ]; + } + // we don't want to create shims when we are just + // probing export * modules for exports + if (!isExportAllSearch && this.options.shimMissingExports) { + this.shimMissingExport(name); + return [this.exportShimVariable]; + } + return [null]; + } + hasEffects() { + return this.info.moduleSideEffects === 'no-treeshake' || this.ast.hasCachedEffects(); + } + include() { + const context = createInclusionContext(); + if (this.ast.shouldBeIncluded(context)) + this.ast.include(context, false); + } + includeAllExports(includeNamespaceMembers) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + for (const exportName of this.exports.keys()) { + if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { + const variable = this.getVariableForExportName(exportName)[0]; + if (!variable) { + return error(logMissingEntryExport(exportName, this.id)); + } + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + } + for (const name of this.getReexports()) { + const [variable] = this.getVariableForExportName(name); + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + if (variable instanceof ExternalVariable) { + variable.module.reexported = true; + } + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + includeAllInBundle() { + this.ast.include(createInclusionContext(), true); + this.includeAllExports(false); + } + includeExportsByNames(names) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + let includeNamespaceMembers = false; + for (const name of names) { + const variable = this.getVariableForExportName(name)[0]; + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + if (!this.exports.has(name) && !this.reexportDescriptions.has(name)) { + includeNamespaceMembers = true; + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + isIncluded() { + // Modules where this.ast is missing have been loaded via this.load and are + // not yet fully processed, hence they cannot be included. + return (this.ast && + (this.ast.included || + this.namespace.included || + this.importedFromNotTreeshaken || + this.exportShimVariable.included)); + } + linkImports() { + this.addModulesToImportDescriptions(this.importDescriptions); + this.addModulesToImportDescriptions(this.reexportDescriptions); + const externalExportAllModules = []; + for (const source of this.exportAllSources) { + const module = this.graph.modulesById.get(this.resolvedIds[source].id); + if (module instanceof ExternalModule) { + externalExportAllModules.push(module); + continue; + } + this.exportAllModules.push(module); + } + this.exportAllModules.push(...externalExportAllModules); + } + log(level, properties, pos) { + this.addLocationToLogProps(properties, pos); + this.options.onLog(level, properties); + } + render(options) { + const source = this.magicString.clone(); + this.ast.render(source, options); + source.trim(); + const { usesTopLevelAwait } = this.astContext; + if (usesTopLevelAwait && options.format !== 'es' && options.format !== 'system') { + return error(logInvalidFormatForTopLevelAwait(this.id, options.format)); + } + return { source, usesTopLevelAwait }; + } + async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) { + timeStart('generate ast', 3); + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n'); + this.shebang = code.slice(2, shebangEndPosition); + } + this.info.code = code; + this.originalCode = originalCode; + // We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't + // have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the + // RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap` + this.originalSourcemap = decodedSourcemap(originalSourcemap); + this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing)); + // If coming from cache and this value is already fully decoded, we want to re-encode here to save memory. + resetSourcemapCache(this.originalSourcemap, this.sourcemapChain); + if (transformFiles) { + this.transformFiles = transformFiles; + } + this.transformDependencies = transformDependencies; + this.customTransformCache = customTransformCache; + this.updateOptions(moduleOptions); + this.resolvedIds = resolvedIds ?? Object.create(null); + // By default, `id` is the file name. Custom resolvers and loaders + // can change that, but it makes sense to use it for the source file name + const fileName = this.id; + this.magicString = new MagicString(code, { + filename: (this.excludeFromSourcemap ? null : fileName), // don't include plugin helpers in sourcemap + indentExclusionRanges: [] + }); + this.astContext = { + addDynamicImport: this.addDynamicImport.bind(this), + addExport: this.addExport.bind(this), + addImport: this.addImport.bind(this), + addImportMeta: this.addImportMeta.bind(this), + addImportSource: this.addImportSource.bind(this), + code, // Only needed for debugging + deoptimizationTracker: this.graph.deoptimizationTracker, + error: this.error.bind(this), + fileName, // Needed for warnings + getExports: this.getExports.bind(this), + getImportedJsxFactoryVariable: this.getImportedJsxFactoryVariable.bind(this), + getModuleExecIndex: () => this.execIndex, + getModuleName: this.basename.bind(this), + getNodeConstructor: (name) => nodeConstructors[name] || nodeConstructors.UnknownNode, + getReexports: this.getReexports.bind(this), + importDescriptions: this.importDescriptions, + includeAllExports: () => this.includeAllExports(true), + includeDynamicImport: this.includeDynamicImport.bind(this), + includeVariableInModule: this.includeVariableInModule.bind(this), + log: this.log.bind(this), + magicString: this.magicString, + manualPureFunctions: this.graph.pureFunctions, + module: this, + moduleContext: this.context, + options: this.options, + requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), + traceExport: (name) => this.getVariableForExportName(name)[0], + traceVariable: this.traceVariable.bind(this), + usesTopLevelAwait: false + }; + this.scope = new ModuleScope(this.graph.scope, this.astContext); + this.namespace = new NamespaceVariable(this.astContext); + const programParent = { context: this.astContext, type: 'Module' }; + if (ast) { + this.ast = new nodeConstructors[ast.type](programParent, this.scope).parseNode(ast); + this.info.ast = ast; + } + else { + // Measuring asynchronous code does not provide reasonable results + timeEnd('generate ast', 3); + const astBuffer = await parseAsync(code, false, this.options.jsx !== false); + timeStart('generate ast', 3); + this.ast = convertProgram(astBuffer, programParent, this.scope); + // Make lazy and apply LRU cache to not hog the memory + Object.defineProperty(this.info, 'ast', { + get: () => { + if (this.graph.astLru.has(fileName)) { + return this.graph.astLru.get(fileName); + } + else { + const parsedAst = this.tryParse(); + // If the cache is not disabled, we need to keep the AST in memory + // until the end when the cache is generated + if (this.options.cache !== false) { + Object.defineProperty(this.info, 'ast', { + value: parsedAst + }); + return parsedAst; + } + // Otherwise, we keep it in a small LRU cache to not hog too much + // memory but allow the same AST to be requested several times. + this.graph.astLru.set(fileName, parsedAst); + return parsedAst; + } + } + }); + } + timeEnd('generate ast', 3); + } + toJSON() { + return { + ast: this.info.ast, + attributes: this.info.attributes, + code: this.info.code, + customTransformCache: this.customTransformCache, + dependencies: Array.from(this.dependencies, getId), + id: this.id, + meta: this.info.meta, + moduleSideEffects: this.info.moduleSideEffects, + originalCode: this.originalCode, + originalSourcemap: this.originalSourcemap, + resolvedIds: this.resolvedIds, + sourcemapChain: this.sourcemapChain, + syntheticNamedExports: this.info.syntheticNamedExports, + transformDependencies: this.transformDependencies, + transformFiles: this.transformFiles + }; + } + traceVariable(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules } = EMPTY_OBJECT) { + const localVariable = this.scope.variables.get(name); + if (localVariable) { + return localVariable; + } + const importDescription = this.importDescriptions.get(name); + if (importDescription) { + const otherModule = importDescription.module; + if (otherModule instanceof Module && importDescription.name === '*') { + return otherModule.namespace; + } + const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules); + if (!declaration) { + return this.error(logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start); + } + return declaration; + } + return null; + } + updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) { + if (moduleSideEffects != null) { + this.info.moduleSideEffects = moduleSideEffects; + } + if (syntheticNamedExports != null) { + this.info.syntheticNamedExports = syntheticNamedExports; + } + if (meta != null) { + Object.assign(this.info.meta, meta); + } + } + addDynamicImport(node) { + let argument = node.sourceAstNode; + if (argument.type === TemplateLiteral$1) { + if (argument.quasis.length === 1 && + typeof argument.quasis[0].value.cooked === 'string') { + argument = argument.quasis[0].value.cooked; + } + } + else if (argument.type === Literal$1 && + typeof argument.value === 'string') { + argument = argument.value; + } + this.dynamicImports.push({ argument, id: null, node, resolution: null }); + } + assertUniqueExportName(name, nodeStart) { + if (this.exports.has(name) || this.reexportDescriptions.has(name)) { + this.error(logDuplicateExportError(name), nodeStart); + } + } + addExport(node) { + if (node instanceof ExportDefaultDeclaration) { + // export default foo; + this.assertUniqueExportName('default', node.start); + this.exports.set('default', { + identifier: node.variable.getAssignedVariableName(), + localName: 'default' + }); + } + else if (node instanceof ExportAllDeclaration) { + const source = node.source.value; + this.addSource(source, node); + if (node.exported) { + // export * as name from './other' + const name = node.exported instanceof Literal ? node.exported.value : node.exported.name; + this.assertUniqueExportName(name, node.exported.start); + this.reexportDescriptions.set(name, { + localName: '*', + module: null, // filled in later, + source, + start: node.start + }); + } + else { + // export * from './other' + this.exportAllSources.add(source); + } + } + else if (node.source instanceof Literal) { + // export { name } from './other' + const source = node.source.value; + this.addSource(source, node); + for (const { exported, local, start } of node.specifiers) { + const name = exported instanceof Literal ? exported.value : exported.name; + this.assertUniqueExportName(name, start); + this.reexportDescriptions.set(name, { + localName: local instanceof Literal ? local.value : local.name, + module: null, // filled in later, + source, + start + }); + } + } + else if (node.declaration) { + const declaration = node.declaration; + if (declaration instanceof VariableDeclaration) { + // export var { foo, bar } = ... + // export var foo = 1, bar = 2; + for (const declarator of declaration.declarations) { + for (const localName of extractAssignedNames(declarator.id)) { + this.assertUniqueExportName(localName, declarator.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + } + else { + // export function foo () {} + const localName = declaration.id.name; + this.assertUniqueExportName(localName, declaration.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + else { + // export { foo, bar, baz } + for (const { local, exported } of node.specifiers) { + // except for reexports, local must be an Identifier + const localName = local.name; + const exportedName = exported instanceof Identifier ? exported.name : exported.value; + this.assertUniqueExportName(exportedName, exported.start); + this.exports.set(exportedName, { identifier: null, localName }); + } + } + } + addImport(node) { + const source = node.source.value; + this.addSource(source, node); + for (const specifier of node.specifiers) { + const localName = specifier.local.name; + if (this.scope.variables.has(localName) || this.importDescriptions.has(localName)) { + this.error(logRedeclarationError(localName), specifier.local.start); + } + const name = specifier instanceof ImportDefaultSpecifier + ? 'default' + : specifier instanceof ImportNamespaceSpecifier + ? '*' + : specifier.imported instanceof Identifier + ? specifier.imported.name + : specifier.imported.value; + this.importDescriptions.set(localName, { + module: null, // filled in later + name, + source, + start: specifier.start + }); + } + } + addImportSource(importSource) { + if (importSource && !this.sourcesWithAttributes.has(importSource)) { + this.sourcesWithAttributes.set(importSource, EMPTY_OBJECT); + } + } + addImportMeta(node) { + this.importMetas.push(node); + } + addLocationToLogProps(properties, pos) { + properties.id = this.id; + properties.pos = pos; + let code = this.info.code; + const location = locate(code, pos, { offsetLine: 1 }); + if (location) { + let { column, line } = location; + try { + ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); + code = this.originalCode; + } + catch (error_) { + this.options.onLog(LOGLEVEL_WARN, logInvalidSourcemapForError(error_, this.id, column, line, pos)); + } + augmentCodeLocation(properties, { column, line }, code, this.id); + } + } + addModulesToImportDescriptions(importDescription) { + for (const specifier of importDescription.values()) { + const { id } = this.resolvedIds[specifier.source]; + specifier.module = this.graph.modulesById.get(id); + } + } + addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) { + const handledDependencies = new Set(); + const addSideEffectDependencies = (possibleDependencies) => { + for (const dependency of possibleDependencies) { + if (handledDependencies.has(dependency)) { + continue; + } + handledDependencies.add(dependency); + if (necessaryDependencies.has(dependency)) { + relevantDependencies.add(dependency); + continue; + } + if (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) { + continue; + } + if (dependency instanceof ExternalModule || dependency.hasEffects()) { + relevantDependencies.add(dependency); + continue; + } + addSideEffectDependencies(dependency.dependencies); + } + }; + addSideEffectDependencies(this.dependencies); + addSideEffectDependencies(alwaysCheckedDependencies); + } + addSource(source, declaration) { + const parsedAttributes = getAttributesFromImportExportDeclaration(declaration.attributes); + const existingAttributes = this.sourcesWithAttributes.get(source); + if (existingAttributes) { + if (doAttributesDiffer(existingAttributes, parsedAttributes)) { + this.log(LOGLEVEL_WARN, logInconsistentImportAttributes(existingAttributes, parsedAttributes, source, this.id), declaration.start); + } + } + else { + this.sourcesWithAttributes.set(source, parsedAttributes); + } + } + getImportedJsxFactoryVariable(baseName, nodeStart, importSource) { + const { id } = this.resolvedIds[importSource]; + const module = this.graph.modulesById.get(id); + const [variable] = module.getVariableForExportName(baseName); + if (!variable) { + return this.error(logMissingJsxExport(baseName, id, this.id), nodeStart); + } + return variable; + } + getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules) { + let foundSyntheticDeclaration = null; + const foundInternalDeclarations = new Map(); + const foundExternalDeclarations = new Set(); + for (const module of this.exportAllModules) { + // Synthetic namespaces should not hide "regular" exports of the same name + if (module.info.syntheticNamedExports === name) { + continue; + } + const [variable, indirectExternal] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, + // We are creating a copy to handle the case where the same binding is + // imported through different namespace reexports gracefully + copyNameToModulesMap(searchedNamesAndModules)); + if (module instanceof ExternalModule || indirectExternal) { + foundExternalDeclarations.add(variable); + } + else if (variable instanceof SyntheticNamedExportVariable) { + if (!foundSyntheticDeclaration) { + foundSyntheticDeclaration = variable; + } + } + else if (variable) { + foundInternalDeclarations.set(variable, module); + } + } + if (foundInternalDeclarations.size > 0) { + const foundDeclarationList = [...foundInternalDeclarations]; + const usedDeclaration = foundDeclarationList[0][0]; + if (foundDeclarationList.length === 1) { + return [usedDeclaration]; + } + this.options.onLog(LOGLEVEL_WARN, logNamespaceConflict(name, this.id, foundDeclarationList.map(([, module]) => module.id))); + // TODO we are pretending it was not found while it should behave like "undefined" + return [null]; + } + if (foundExternalDeclarations.size > 0) { + const foundDeclarationList = [...foundExternalDeclarations]; + const usedDeclaration = foundDeclarationList[0]; + if (foundDeclarationList.length > 1) { + this.options.onLog(LOGLEVEL_WARN, logAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id))); + } + return [usedDeclaration, true]; + } + if (foundSyntheticDeclaration) { + return [foundSyntheticDeclaration]; + } + return [null]; + } + includeAndGetAdditionalMergedNamespaces() { + const externalNamespaces = new Set(); + const syntheticNamespaces = new Set(); + for (const module of [this, ...this.exportAllModules]) { + if (module instanceof ExternalModule) { + const [externalVariable] = module.getVariableForExportName('*'); + externalVariable.include(); + this.includedImports.add(externalVariable); + externalNamespaces.add(externalVariable); + } + else if (module.info.syntheticNamedExports) { + const syntheticNamespace = module.getSyntheticNamespace(); + syntheticNamespace.include(); + this.includedImports.add(syntheticNamespace); + syntheticNamespaces.add(syntheticNamespace); + } + } + return [...syntheticNamespaces, ...externalNamespaces]; + } + includeDynamicImport(node) { + const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution; + if (resolution instanceof Module) { + resolution.includedDynamicImporters.push(this); + const importedNames = this.options.treeshake + ? node.getDeterministicImportedNames() + : undefined; + if (importedNames) { + resolution.includeExportsByNames(importedNames); + } + else { + resolution.includeAllExports(true); + } + } + } + includeVariable(variable) { + const variableModule = variable.module; + if (variable.included) { + if (variableModule instanceof Module && variableModule !== this) { + getAndExtendSideEffectModules(variable, this); + } + } + else { + variable.include(); + this.graph.needsTreeshakingPass = true; + if (variableModule instanceof Module) { + if (!variableModule.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(variableModule); + } + if (variableModule !== this) { + const sideEffectModules = getAndExtendSideEffectModules(variable, this); + for (const module of sideEffectModules) { + if (!module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(module); + } + } + } + } + } + } + includeVariableInModule(variable) { + this.includeVariable(variable); + const variableModule = variable.module; + if (variableModule && variableModule !== this) { + this.includedImports.add(variable); + } + } + shimMissingExport(name) { + this.options.onLog(LOGLEVEL_WARN, logShimmedExport(this.id, name)); + this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); + } + tryParse() { + try { + return parseAst(this.info.code, { jsx: this.options.jsx !== false }); + } + catch (error_) { + return this.error(logModuleParseError(error_, this.id), error_.pos); + } + } +} +// if there is a cyclic import in the reexport chain, we should not +// import from the original module but from the cyclic module to not +// mess up execution order. +function setAlternativeExporterIfCyclic(variable, importer, reexporter) { + if (variable.module instanceof Module && variable.module !== reexporter) { + const exporterCycles = variable.module.cycles; + if (exporterCycles.size > 0) { + const importerCycles = reexporter.cycles; + for (const cycleSymbol of importerCycles) { + if (exporterCycles.has(cycleSymbol)) { + importer.alternativeReexportModules.set(variable, reexporter); + break; + } + } + } + } +} +const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules && + new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)])); + +const concatSeparator = (out, next) => (next ? `${out}\n${next}` : out); +const concatDblSeparator = (out, next) => (next ? `${out}\n\n${next}` : out); +async function createAddons(options, outputPluginDriver, chunk) { + try { + let [banner, footer, intro, outro] = await Promise.all([ + outputPluginDriver.hookReduceValue('banner', options.banner(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('footer', options.footer(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('intro', options.intro(chunk), [chunk], concatDblSeparator), + outputPluginDriver.hookReduceValue('outro', options.outro(chunk), [chunk], concatDblSeparator) + ]); + if (intro) + intro += '\n\n'; + if (outro) + outro = `\n\n${outro}`; + if (banner) + banner += '\n'; + if (footer) + footer = '\n' + footer; + return { banner, footer, intro, outro }; + } + catch (error_) { + return error(logAddonNotGenerated(error_.message, error_.hook, error_.plugin)); + } +} + +const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = { + amd: deconflictImportsOther, + cjs: deconflictImportsOther, + es: deconflictImportsEsmOrSystem, + iife: deconflictImportsOther, + system: deconflictImportsEsmOrSystem, + umd: deconflictImportsOther +}; +function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) { + const reversedModules = [...modules].reverse(); + for (const module of reversedModules) { + module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + } + deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces); + DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports); + for (const module of reversedModules) { + module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } +} +function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) { + // This is needed for namespace reexports + for (const dependency of dependenciesToBeDeconflicted.dependencies) { + if (preserveModules || dependency instanceof ExternalChunk) { + dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null); + } + } + for (const variable of imports) { + const module = variable.module; + const name = variable.name; + if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) { + variable.setRenderNames(null, (module instanceof ExternalModule + ? externalChunkByModule.get(module) + : chunkByModule.get(module)).variableName); + } + else if (module instanceof ExternalModule && name === 'default') { + variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included) + ? module.suggestedVariableName + '__default' + : module.suggestedVariableName, usedNames, variable.forbiddenNames)); + } + else { + variable.setRenderNames(null, getSafeName(makeLegal(name), usedNames, variable.forbiddenNames)); + } + } + for (const variable of syntheticExports) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } +} +function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule) { + for (const chunk of dependencies) { + chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null); + } + for (const chunk of deconflictedNamespace) { + chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames, null); + } + for (const externalModule of deconflictedDefault) { + externalModule.defaultVariableName = + deconflictedNamespace.has(externalModule) && + canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings) + ? externalModule.namespaceVariableName + : getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null); + } + for (const variable of imports) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = externalChunkByModule.get(module); + const name = variable.name; + if (name === 'default') { + const moduleInterop = interop(module.id); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? chunk.defaultVariableName + : chunk.variableName; + if (isDefaultAProperty(moduleInterop, externalLiveBindings)) { + variable.setRenderNames(variableName, 'default'); + } + else { + variable.setRenderNames(null, variableName); + } + } + else if (name === '*') { + variable.setRenderNames(null, namespaceInteropHelpersByInteropType[interop(module.id)] + ? chunk.namespaceVariableName + : chunk.variableName); + } + else { + // if the second parameter is `null`, it uses its "name" for the property name + variable.setRenderNames(chunk.variableName, null); + } + } + else { + const chunk = chunkByModule.get(module); + if (preserveModules && variable.isNamespace) { + variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName); + } + else if (chunk.exportMode === 'default') { + variable.setRenderNames(null, chunk.variableName); + } + else { + variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable)); + } + } + } +} +function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) { + for (const module of modules) { + for (const variable of module.scope.variables.values()) { + if (variable.included && + // this will only happen for exports in some formats + !(variable.renderBaseName || + (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } + } + if (includedNamespaces.has(module)) { + const namespace = module.namespace; + namespace.setRenderNames(null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames)); + } + } +} + +function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) { + let nameIndex = 0; + for (const variable of exports) { + let [exportName] = variable.name; + if (exportsByName.has(exportName)) { + do { + exportName = toBase64(++nameIndex); + // skip past leading number identifiers + if (exportName.charCodeAt(0) === 49 /* '1' */) { + nameIndex += 9 * 64 ** (exportName.length - 1); + exportName = toBase64(nameIndex); + } + } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName)); + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} +function assignExportsToNames(exports, exportsByName, exportNamesByVariable) { + for (const variable of exports) { + let nameIndex = 0; + let exportName = variable.name; + while (exportsByName.has(exportName)) { + exportName = variable.name + '$' + ++nameIndex; + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} + +function getExportMode(chunk, { exports: exportMode, name, format }, facadeModuleId, log) { + const exportKeys = chunk.getExportNames(); + if (exportMode === 'default') { + if (exportKeys.length !== 1 || exportKeys[0] !== 'default') { + return error(logIncompatibleExportOptionValue('default', exportKeys, facadeModuleId)); + } + } + else if (exportMode === 'none' && exportKeys.length > 0) { + return error(logIncompatibleExportOptionValue('none', exportKeys, facadeModuleId)); + } + if (exportMode === 'auto') { + if (exportKeys.length === 0) { + exportMode = 'none'; + } + else if (exportKeys.length === 1 && exportKeys[0] === 'default') { + exportMode = 'default'; + } + else { + if (format !== 'es' && format !== 'system' && exportKeys.includes('default')) { + log(LOGLEVEL_WARN, logMixedExport(facadeModuleId, name)); + } + exportMode = 'named'; + } + } + return exportMode; +} + +function guessIndentString(code) { + const lines = code.split('\n'); + const tabbed = lines.filter(line => /^\t+/.test(line)); + const spaced = lines.filter(line => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numberSpaces = /^ +/.exec(current)[0].length; + return Math.min(numberSpaces, previous); + }, Infinity); + return ' '.repeat(min); +} +function getIndentString(modules, options) { + if (options.indent !== true) + return options.indent; + for (const module of modules) { + const indent = guessIndentString(module.originalCode); + if (indent !== null) + return indent; + } + return '\t'; +} + +function getStaticDependencies(chunk, orderedModules, chunkByModule, externalChunkByModule) { + const staticDependencyBlocks = []; + const handledDependencies = new Set(); + for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) { + const module = orderedModules[modulePos]; + if (!handledDependencies.has(module)) { + const staticDependencies = []; + addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule, externalChunkByModule); + staticDependencyBlocks.unshift(staticDependencies); + } + } + const dependencies = new Set(); + for (const block of staticDependencyBlocks) { + for (const dependency of block) { + dependencies.add(dependency); + } + } + return dependencies; +} +function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule) { + const dependencies = module.getDependenciesToBeIncluded(); + for (const dependency of dependencies) { + if (dependency instanceof ExternalModule) { + staticDependencies.push(externalChunkByModule.get(dependency)); + continue; + } + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk !== chunk) { + staticDependencies.push(dependencyChunk); + continue; + } + if (!handledModules.has(dependency)) { + handledModules.add(dependency); + addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule); + } + } +} + +// Four random characters from the private use area to minimize risk of +// conflicts +const hashPlaceholderLeft = '!~{'; +const hashPlaceholderRight = '}~'; +const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length; +// This is the size of a 128-bits xxhash with base64url encoding +const MAX_HASH_SIZE = 21; +const DEFAULT_HASH_SIZE = 8; +const getHashPlaceholderGenerator = () => { + let nextIndex = 0; + return (optionName, hashSize) => { + if (hashSize > MAX_HASH_SIZE) { + return error(logFailedValidation(`Hashes cannot be longer than ${MAX_HASH_SIZE} characters, received ${hashSize}. Check the "${optionName}" option.`)); + } + const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart(hashSize - hashPlaceholderOverhead, '0')}${hashPlaceholderRight}`; + if (placeholder.length > hashSize) { + return error(logFailedValidation(`To generate hashes for this number of chunks (currently ${nextIndex}), you need a minimum hash size of ${placeholder.length}, received ${hashSize}. Check the "${optionName}" option.`)); + } + return placeholder; + }; +}; +const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${MAX_HASH_SIZE - hashPlaceholderOverhead}}${hashPlaceholderRight}`, 'g'); +const replacePlaceholders = (code, hashesByPlaceholder) => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder); +const replaceSinglePlaceholder = (code, placeholder, value) => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match)); +const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeholders) => { + const containedPlaceholders = new Set(); + const transformedCode = code.replace(REPLACER_REGEX, placeholder => { + if (placeholders.has(placeholder)) { + containedPlaceholders.add(placeholder); + return `${hashPlaceholderLeft}${'0'.repeat(placeholder.length - hashPlaceholderOverhead)}${hashPlaceholderRight}`; + } + return placeholder; + }); + return { containedPlaceholders, transformedCode }; +}; + +const lowercaseBundleKeys = Symbol('bundleKeys'); +const FILE_PLACEHOLDER = { + type: 'placeholder' +}; +const getOutputBundle = (outputBundleBase) => { + const reservedLowercaseBundleKeys = new Set(); + return new Proxy(outputBundleBase, { + deleteProperty(target, key) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.delete(key.toLowerCase()); + } + return Reflect.deleteProperty(target, key); + }, + get(target, key) { + if (key === lowercaseBundleKeys) { + return reservedLowercaseBundleKeys; + } + return Reflect.get(target, key); + }, + set(target, key, value) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.add(key.toLowerCase()); + } + return Reflect.set(target, key, value); + } + }); +}; +const removeUnreferencedAssets = (outputBundle) => { + const unreferencedAssets = new Set(); + const bundleEntries = Object.values(outputBundle); + for (const asset of bundleEntries) { + if (asset.type === 'asset' && asset.needsCodeReference) { + unreferencedAssets.add(asset.fileName); + } + } + for (const chunk of bundleEntries) { + if (chunk.type === 'chunk') { + for (const referencedFile of chunk.referencedFiles) { + if (unreferencedAssets.has(referencedFile)) { + unreferencedAssets.delete(referencedFile); + } + } + } + } + for (const file of unreferencedAssets) { + delete outputBundle[file]; + } +}; + +function renderNamePattern(pattern, patternName, replacements) { + if (isPathFragment(pattern)) + return error(logFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)); + return pattern.replace(/\[(\w+)(:\d+)?]/g, (_match, type, size) => { + if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) { + return error(logFailedValidation(`"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.`)); + } + const replacement = replacements[type](size && Number.parseInt(size.slice(1))); + if (isPathFragment(replacement)) + return error(logFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`)); + return replacement; + }); +} +function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }) { + if (!reservedLowercaseBundleKeys.has(name.toLowerCase())) + return name; + const extension = extname(name); + name = name.slice(0, Math.max(0, name.length - extension.length)); + let uniqueName, uniqueIndex = 1; + while (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + extension).toLowerCase())) + ; + return uniqueName; +} + +const NON_ASSET_EXTENSIONS = new Set([ + '.js', + '.jsx', + '.ts', + '.tsx', + '.mjs', + '.mts', + '.cjs', + '.cts' +]); +function getGlobalName(chunk, globals, hasExports, log) { + const globalName = typeof globals === 'function' ? globals(chunk.id) : globals[chunk.id]; + if (globalName) { + return globalName; + } + if (hasExports) { + log(LOGLEVEL_WARN, logMissingGlobalName(chunk.id, chunk.variableName)); + return chunk.variableName; + } +} +class Chunk { + constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias, getPlaceholder, bundle, inputBase, snippets) { + this.orderedModules = orderedModules; + this.inputOptions = inputOptions; + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.pluginDriver = pluginDriver; + this.modulesById = modulesById; + this.chunkByModule = chunkByModule; + this.externalChunkByModule = externalChunkByModule; + this.facadeChunkByModule = facadeChunkByModule; + this.includedNamespaces = includedNamespaces; + this.manualChunkAlias = manualChunkAlias; + this.getPlaceholder = getPlaceholder; + this.bundle = bundle; + this.inputBase = inputBase; + this.snippets = snippets; + this.entryModules = []; + this.exportMode = 'named'; + this.facadeModule = null; + this.namespaceVariableName = ''; + this.variableName = ''; + this.accessedGlobalsByScope = new Map(); + this.dependencies = new Set(); + this.dynamicEntryModules = []; + this.dynamicName = null; + this.exportNamesByVariable = new Map(); + this.exports = new Set(); + this.exportsByName = new Map(); + this.fileName = null; + this.implicitEntryModules = []; + this.implicitlyLoadedBefore = new Set(); + this.imports = new Set(); + this.includedDynamicImports = null; + this.includedReexportsByModule = new Map(); + // This may be updated in the constructor + this.isEmpty = true; + this.name = null; + this.needsExportsShim = false; + this.preRenderedChunkInfo = null; + this.preliminaryFileName = null; + this.preliminarySourcemapFileName = null; + this.renderedChunkInfo = null; + this.renderedDependencies = null; + this.renderedModules = Object.create(null); + this.sortedExportNames = null; + this.strictFacade = false; + this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity; + const chunkModules = new Set(orderedModules); + for (const module of orderedModules) { + chunkByModule.set(module, this); + if (module.namespace.included && !outputOptions.preserveModules) { + includedNamespaces.add(module); + } + if (this.isEmpty && module.isIncluded()) { + this.isEmpty = false; + } + if (module.info.isEntry || outputOptions.preserveModules) { + this.entryModules.push(module); + } + for (const importer of module.includedDynamicImporters) { + if (!chunkModules.has(importer)) { + this.dynamicEntryModules.push(module); + // Modules with synthetic exports need an artificial namespace for dynamic imports + if (module.info.syntheticNamedExports) { + includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + } + if (module.implicitlyLoadedAfter.size > 0) { + this.implicitEntryModules.push(module); + } + } + this.suggestedVariableName = makeLegal(this.generateVariableName()); + } + static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName, getPlaceholder, bundle, inputBase, snippets) { + const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, null, getPlaceholder, bundle, inputBase, snippets); + chunk.assignFacadeName(facadeName, facadedModule); + if (!facadeChunkByModule.has(facadedModule)) { + facadeChunkByModule.set(facadedModule, chunk); + } + for (const dependency of facadedModule.getDependenciesToBeIncluded()) { + chunk.dependencies.add(dependency instanceof Module + ? chunkByModule.get(dependency) + : externalChunkByModule.get(dependency)); + } + if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) && + facadedModule.info.moduleSideEffects && + facadedModule.hasEffects()) { + chunk.dependencies.add(chunkByModule.get(facadedModule)); + } + chunk.ensureReexportsAreAvailableForModule(facadedModule); + chunk.facadeModule = facadedModule; + chunk.strictFacade = true; + return chunk; + } + canModuleBeFacade(module, exposedVariables) { + const moduleExportNamesByVariable = module.getExportNamesByVariable(); + // All exports of this chunk need to be exposed by the candidate module + for (const exposedVariable of this.exports) { + if (!moduleExportNamesByVariable.has(exposedVariable)) { + return false; + } + } + // Additionally, we need to expose namespaces of dynamic entries that are not the facade module and exports from other entry modules + for (const exposedVariable of exposedVariables) { + if (!(exposedVariable.module === module || + moduleExportNamesByVariable.has(exposedVariable) || + (exposedVariable instanceof SyntheticNamedExportVariable && + moduleExportNamesByVariable.has(exposedVariable.getBaseVariable())))) { + return false; + } + } + return true; + } + finalizeChunk(code, map, sourcemapFileName, hashesByPlaceholder) { + const renderedChunkInfo = this.getRenderedChunkInfo(); + const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder); + const preliminaryFileName = renderedChunkInfo.fileName; + const fileName = (this.fileName = finalize(preliminaryFileName)); + return { + ...renderedChunkInfo, + code, + dynamicImports: renderedChunkInfo.dynamicImports.map(finalize), + fileName, + implicitlyLoadedBefore: renderedChunkInfo.implicitlyLoadedBefore.map(finalize), + importedBindings: Object.fromEntries(Object.entries(renderedChunkInfo.importedBindings).map(([fileName, bindings]) => [ + finalize(fileName), + bindings + ])), + imports: renderedChunkInfo.imports.map(finalize), + map, + preliminaryFileName, + referencedFiles: renderedChunkInfo.referencedFiles.map(finalize), + sourcemapFileName + }; + } + generateExports() { + this.sortedExportNames = null; + const remainingExports = new Set(this.exports); + if (this.facadeModule !== null && + (this.facadeModule.preserveSignature !== false || this.strictFacade)) { + const exportNamesByVariable = this.facadeModule.getExportNamesByVariable(); + for (const [variable, exportNames] of exportNamesByVariable) { + this.exportNamesByVariable.set(variable, [...exportNames]); + for (const exportName of exportNames) { + this.exportsByName.set(exportName, variable); + } + remainingExports.delete(variable); + } + } + if (this.outputOptions.minifyInternalExports) { + assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + else { + assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry)) + this.exportMode = getExportMode(this, this.outputOptions, this.facadeModule.id, this.inputOptions.onLog); + } + generateFacades() { + const facades = []; + const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]); + const exposedVariables = new Set(this.dynamicEntryModules.map(({ namespace }) => namespace)); + for (const module of entryModules) { + if (module.preserveSignature) { + for (const exportedVariable of module.getExportNamesByVariable().keys()) { + // We need to expose all entry exports from this chunk + if (this.chunkByModule.get(exportedVariable.module) === this) { + exposedVariables.add(exportedVariable); + } + } + } + } + for (const module of entryModules) { + const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)), + // mapping must run after Set 'name' dedupe + name => ({ + name + })); + if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) { + requiredFacades.push({}); + } + requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName }))); + if (requiredFacades.length === 0) { + requiredFacades.push({}); + } + if (!this.facadeModule) { + const needsStrictFacade = !this.outputOptions.preserveModules && + (module.preserveSignature === 'strict' || + (module.preserveSignature === 'exports-only' && + module.getExportNamesByVariable().size > 0)); + if (!needsStrictFacade || this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + if (module.preserveSignature) { + this.strictFacade = needsStrictFacade; + } + this.assignFacadeName(requiredFacades.shift(), module, this.outputOptions.preserveModules); + } + } + for (const facadeName of requiredFacades) { + facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName, this.getPlaceholder, this.bundle, this.inputBase, this.snippets)); + } + } + for (const module of this.dynamicEntryModules) { + if (module.info.syntheticNamedExports) + continue; + if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + this.strictFacade = true; + this.dynamicName = getChunkNameFromModule(module); + } + else if (this.facadeModule === module && + !this.strictFacade && + this.canModuleBeFacade(module, exposedVariables)) { + this.strictFacade = true; + } + else if (!this.facadeChunkByModule.get(module)?.strictFacade) { + this.includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + if (!this.outputOptions.preserveModules) { + this.addNecessaryImportsForFacades(); + } + return facades; + } + getChunkName() { + return (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName())); + } + getExportNames() { + return (this.sortedExportNames ??= [...this.exportsByName.keys()].sort()); + } + getFileName() { + return this.fileName || this.getPreliminaryFileName().fileName; + } + getImportPath(importer) { + return escapeId(getImportPath(importer, this.getFileName(), this.outputOptions.format === 'amd' && !this.outputOptions.amd.forceJsExtensionForImports, true)); + } + getPreliminaryFileName() { + if (this.preliminaryFileName) { + return this.preliminaryFileName; + } + let fileName; + let hashPlaceholder = null; + const { chunkFileNames, entryFileNames, file, format, preserveModules } = this.outputOptions; + if (file) { + fileName = basename(file); + } + else if (this.fileName === null) { + const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint + ? [entryFileNames, 'output.entryFileNames'] + : [chunkFileNames, 'output.chunkFileNames']; + fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + fileName = makeUnique(fileName, this.bundle); + } + } + else { + fileName = this.fileName; + } + if (!hashPlaceholder) { + this.bundle[fileName] = FILE_PLACEHOLDER; + } + // Caching is essential to not conflict with the file name reservation above + return (this.preliminaryFileName = { fileName, hashPlaceholder }); + } + getPreliminarySourcemapFileName() { + if (this.preliminarySourcemapFileName) { + return this.preliminarySourcemapFileName; + } + let sourcemapFileName = null; + let hashPlaceholder = null; + const { sourcemapFileNames, format } = this.outputOptions; + if (sourcemapFileNames) { + const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames']; + sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '', + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + sourcemapFileName = makeUnique(sourcemapFileName, this.bundle); + } + } + else { + return null; + } + return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder }); + } + getRenderedChunkInfo() { + if (this.renderedChunkInfo) { + return this.renderedChunkInfo; + } + return (this.renderedChunkInfo = { + ...this.getPreRenderedChunkInfo(), + dynamicImports: this.getDynamicDependencies().map(resolveFileName), + fileName: this.getFileName(), + implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName), + importedBindings: getImportedBindingsPerDependency(this.getRenderedDependencies(), resolveFileName), + imports: Array.from(this.dependencies, resolveFileName), + modules: this.renderedModules, + referencedFiles: this.getReferencedFiles() + }); + } + getVariableExportName(variable) { + if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) { + return '*'; + } + return this.exportNamesByVariable.get(variable)[0]; + } + link() { + this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule, this.externalChunkByModule); + for (const module of this.orderedModules) { + this.addImplicitlyLoadedBeforeFromModule(module); + this.setUpChunkImportsAndExportsForModule(module); + } + } + async render() { + const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this; + const { format, hoistTransitiveImports, preserveModules } = outputOptions; + // for static and dynamic entry points, add transitive dependencies to this + // chunk's dependencies to avoid loading latency + if (hoistTransitiveImports && !preserveModules && facadeModule !== null) { + for (const dep of dependencies) { + if (dep instanceof Chunk) + this.inlineChunkDependencies(dep); + } + } + const preliminaryFileName = this.getPreliminaryFileName(); + const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName(); + const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName); + const renderedDependencies = [...this.getRenderedDependencies().values()]; + const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format); + let hasExports = renderedExports.length > 0; + let hasDefaultExport = false; + for (const renderedDependency of renderedDependencies) { + const { reexports } = renderedDependency; + if (reexports?.length) { + hasExports = true; + if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) { + hasDefaultExport = true; + } + if (format === 'es') { + renderedDependency.reexports = reexports.filter(({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)); + } + } + } + if (!hasDefaultExport) { + for (const { exported } of renderedExports) { + if (exported === 'default') { + hasDefaultExport = true; + break; + } + } + } + const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo()); + finalisers[format](renderedSource, { + accessedGlobals, + dependencies: renderedDependencies, + exports: renderedExports, + hasDefaultExport, + hasExports, + id: preliminaryFileName.fileName, + indent, + intro, + isEntryFacade: preserveModules || (facadeModule !== null && facadeModule.info.isEntry), + isModuleFacade: facadeModule !== null, + log: onLog, + namedExportsMode: exportMode !== 'default', + outro, + snippets, + usesTopLevelAwait + }, outputOptions); + if (banner) + magicString.prepend(banner); + if (format === 'es' || format === 'cjs') { + const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang; + if (shebang) { + magicString.prepend(`#!${shebang}\n`); + } + } + if (footer) + magicString.append(footer); + return { + chunk: this, + magicString, + preliminaryFileName, + preliminarySourcemapFileName, + usedModules + }; + } + addImplicitlyLoadedBeforeFromModule(baseModule) { + const { chunkByModule, implicitlyLoadedBefore } = this; + for (const module of baseModule.implicitlyLoadedBefore) { + const chunk = chunkByModule.get(module); + if (chunk && chunk !== this) { + implicitlyLoadedBefore.add(chunk); + } + } + } + addNecessaryImportsForFacades() { + for (const [module, variables] of this.includedReexportsByModule) { + if (this.includedNamespaces.has(module)) { + for (const variable of variables) { + this.imports.add(variable); + } + } + } + } + assignFacadeName({ fileName, name }, facadedModule, preservePath) { + if (fileName) { + this.fileName = fileName; + } + else { + this.name = this.outputOptions.sanitizeFileName(name || + (preservePath + ? this.getPreserveModulesChunkNameFromModule(facadedModule) + : getChunkNameFromModule(facadedModule))); + } + } + checkCircularDependencyImport(variable, importingModule) { + const variableModule = variable.module; + if (variableModule instanceof Module) { + const exportChunk = this.chunkByModule.get(variableModule); + let alternativeReexportModule; + do { + alternativeReexportModule = importingModule.alternativeReexportModules.get(variable); + if (alternativeReexportModule) { + const exportingChunk = this.chunkByModule.get(alternativeReexportModule); + if (exportingChunk !== exportChunk) { + this.inputOptions.onLog(LOGLEVEL_WARN, logCyclicCrossChunkReexport( + // Namespaces do not have an export name + variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules)); + } + importingModule = alternativeReexportModule; + } + } while (alternativeReexportModule); + } + } + ensureReexportsAreAvailableForModule(module) { + const includedReexports = []; + const map = module.getExportNamesByVariable(); + for (const exportedVariable of map.keys()) { + const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable; + const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable; + this.checkCircularDependencyImport(importedVariable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + const exportingModule = importedVariable.module; + if (exportingModule instanceof Module) { + const chunk = this.chunkByModule.get(exportingModule); + if (chunk && chunk !== this) { + chunk.exports.add(importedVariable); + includedReexports.push(importedVariable); + if (isSynthetic) { + this.imports.add(importedVariable); + } + } + } + } + } + if (includedReexports.length > 0) { + this.includedReexportsByModule.set(module, includedReexports); + } + } + generateVariableName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + const moduleForNaming = this.entryModules[0] || + this.implicitEntryModules[0] || + this.dynamicEntryModules[0] || + this.orderedModules[this.orderedModules.length - 1]; + if (moduleForNaming) { + return getChunkNameFromModule(moduleForNaming); + } + return 'chunk'; + } + getChunkExportDeclarations(format) { + const exports = []; + for (const exportName of this.getExportNames()) { + if (exportName[0] === '*') + continue; + const variable = this.exportsByName.get(exportName); + if (!(variable instanceof SyntheticNamedExportVariable)) { + const module = variable.module; + if (module) { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + if (!chunk || format !== 'es') { + continue; + } + const chunkDep = this.renderedDependencies.get(chunk); + if (!chunkDep) { + continue; + } + const { imports, reexports } = chunkDep; + const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName); + const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported); + if (!isImported) { + continue; + } + } + } + } + let expression = null; + let hoisted = false; + let local = variable.getName(this.snippets.getPropertyAccess); + if (variable instanceof LocalVariable) { + for (const declaration of variable.declarations) { + if (declaration.parent instanceof FunctionDeclaration || + (declaration instanceof ExportDefaultDeclaration && + declaration.declaration instanceof FunctionDeclaration)) { + hoisted = true; + break; + } + } + } + else if (variable instanceof SyntheticNamedExportVariable) { + expression = local; + if (format === 'es') { + local = variable.renderName; + } + } + exports.push({ + exported: exportName, + expression, + hoisted, + local + }); + } + return exports; + } + getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) { + const dependencies = new Set(); + const deconflictedDefault = new Set(); + const deconflictedNamespace = new Set(); + for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) { + if (addNonNamespacesAndInteropHelpers || variable.isNamespace) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(module); + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers) { + if (variable.name === 'default') { + if (defaultInteropHelpersByInteropType[interop(module.id)]) { + deconflictedDefault.add(chunk); + } + } + else if (variable.isNamespace && + namespaceInteropHelpersByInteropType[interop(module.id)] && + (this.imports.has(variable) || + !this.exportNamesByVariable.get(variable)?.every(name => name.startsWith('*')))) { + // We only need to deconflict it if the namespace is actually + // created as a variable, i.e. because it is used internally or + // because it is reexported as an object + deconflictedNamespace.add(chunk); + } + } + } + else { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers && + chunk.exportMode === 'default' && + variable.isNamespace) { + deconflictedNamespace.add(chunk); + } + } + } + } + } + if (addDependenciesWithoutBindings) { + for (const dependency of this.dependencies) { + dependencies.add(dependency); + } + } + return { deconflictedDefault, deconflictedNamespace, dependencies }; + } + getDynamicDependencies() { + return this.getIncludedDynamicImports() + .map(resolvedDynamicImport => resolvedDynamicImport.facadeChunk || + resolvedDynamicImport.chunk || + resolvedDynamicImport.externalChunk || + resolvedDynamicImport.resolution) + .filter((resolution) => resolution !== this && + (resolution instanceof Chunk || resolution instanceof ExternalChunk)); + } + getDynamicImportStringAndAttributes(resolution, fileName) { + if (resolution instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(resolution); + return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAttributes(this.snippets)]; + } + return [ + resolution || '', + (this.outputOptions.format === 'es' && this.outputOptions.externalImportAttributes) || null + ]; + } + getFallbackChunkName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + if (this.dynamicName) { + return this.dynamicName; + } + if (this.fileName) { + return getAliasName(this.fileName); + } + return getAliasName(this.orderedModules[this.orderedModules.length - 1].id); + } + getImportSpecifiers() { + const { interop } = this.outputOptions; + const importsByDependency = new Map(); + for (const variable of this.imports) { + const module = variable.module; + let dependency; + let imported; + if (module instanceof ExternalModule) { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(logUnexpectedNamedImport(module.id, imported, false)); + } + } + else { + dependency = this.chunkByModule.get(module); + imported = dependency.getVariableExportName(variable); + } + getOrCreate(importsByDependency, dependency, getNewArray).push({ + imported, + local: variable.getName(this.snippets.getPropertyAccess) + }); + } + return importsByDependency; + } + getIncludedDynamicImports() { + if (this.includedDynamicImports) { + return this.includedDynamicImports; + } + const includedDynamicImports = []; + for (const module of this.orderedModules) { + for (const { node, resolution } of module.dynamicImports) { + if (!node.included) { + continue; + } + includedDynamicImports.push(resolution instanceof Module + ? { + chunk: this.chunkByModule.get(resolution), + externalChunk: null, + facadeChunk: this.facadeChunkByModule.get(resolution), + node, + resolution + } + : resolution instanceof ExternalModule + ? { + chunk: null, + externalChunk: this.externalChunkByModule.get(resolution), + facadeChunk: null, + node, + resolution + } + : { chunk: null, externalChunk: null, facadeChunk: null, node, resolution }); + } + } + return (this.includedDynamicImports = includedDynamicImports); + } + getPreRenderedChunkInfo() { + if (this.preRenderedChunkInfo) { + return this.preRenderedChunkInfo; + } + const { dynamicEntryModules, facadeModule, implicitEntryModules, orderedModules } = this; + return (this.preRenderedChunkInfo = { + exports: this.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + isDynamicEntry: dynamicEntryModules.length > 0, + isEntry: !!facadeModule?.info.isEntry, + isImplicitEntry: implicitEntryModules.length > 0, + moduleIds: orderedModules.map(({ id }) => id), + name: this.getChunkName(), + type: 'chunk' + }); + } + getPreserveModulesChunkNameFromModule(module) { + const predefinedChunkName = getPredefinedChunkNameFromModule(module); + if (predefinedChunkName) + return predefinedChunkName; + const { preserveModulesRoot, sanitizeFileName } = this.outputOptions; + const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0])); + const extensionName = extname(sanitizedId); + const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) + ? sanitizedId.slice(0, -extensionName.length) + : sanitizedId; + if (isAbsolute$1(idWithoutExtension)) { + if (preserveModulesRoot && resolve$1(idWithoutExtension).startsWith(preserveModulesRoot)) { + return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, ''); + } + else { + // handle edge case in Windows + if (this.inputBase === '/' && !idWithoutExtension.startsWith('/')) { + return relative$1(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/')); + } + return relative$1(this.inputBase, idWithoutExtension); + } + } + else { + return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + basename(idWithoutExtension)); + } + } + getReexportSpecifiers() { + const { externalLiveBindings, interop } = this.outputOptions; + const reexportSpecifiers = new Map(); + for (let exportName of this.getExportNames()) { + let dependency; + let imported; + let needsLiveBinding = false; + if (exportName[0] === '*') { + const id = exportName.slice(1); + if (interop(id) === 'defaultOnly') { + this.inputOptions.onLog(LOGLEVEL_WARN, logUnexpectedNamespaceReexport(id)); + } + needsLiveBinding = externalLiveBindings; + dependency = this.externalChunkByModule.get(this.modulesById.get(id)); + imported = exportName = '*'; + } + else { + const variable = this.exportsByName.get(exportName); + if (variable instanceof SyntheticNamedExportVariable) + continue; + const module = variable.module; + if (module instanceof Module) { + dependency = this.chunkByModule.get(module); + if (dependency === this) + continue; + imported = dependency.getVariableExportName(variable); + needsLiveBinding = variable.isReassigned; + } + else { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(logUnexpectedNamedImport(module.id, imported, true)); + } + needsLiveBinding = + externalLiveBindings && + (imported !== 'default' || isDefaultAProperty(interop(module.id), true)); + } + } + getOrCreate(reexportSpecifiers, dependency, getNewArray).push({ + imported, + needsLiveBinding, + reexported: exportName + }); + } + return reexportSpecifiers; + } + getReferencedFiles() { + const referencedFiles = new Set(); + for (const module of this.orderedModules) { + for (const meta of module.importMetas) { + const fileName = meta.getReferencedFileName(this.pluginDriver); + if (fileName) { + referencedFiles.add(fileName); + } + } + } + return [...referencedFiles]; + } + getRenderedDependencies() { + if (this.renderedDependencies) { + return this.renderedDependencies; + } + const importSpecifiers = this.getImportSpecifiers(); + const reexportSpecifiers = this.getReexportSpecifiers(); + const renderedDependencies = new Map(); + const fileName = this.getFileName(); + for (const dependency of this.dependencies) { + const imports = importSpecifiers.get(dependency) || null; + const reexports = reexportSpecifiers.get(dependency) || null; + const namedExportsMode = dependency instanceof ExternalChunk || dependency.exportMode !== 'default'; + const importPath = dependency.getImportPath(fileName); + renderedDependencies.set(dependency, { + attributes: dependency instanceof ExternalChunk + ? dependency.getImportAttributes(this.snippets) + : null, + defaultVariableName: dependency.defaultVariableName, + globalName: dependency instanceof ExternalChunk && + (this.outputOptions.format === 'umd' || this.outputOptions.format === 'iife') && + getGlobalName(dependency, this.outputOptions.globals, (imports || reexports) !== null, this.inputOptions.onLog), + importPath, + imports, + isChunk: dependency instanceof Chunk, + name: dependency.variableName, + namedExportsMode, + namespaceVariableName: dependency.namespaceVariableName, + reexports + }); + } + return (this.renderedDependencies = renderedDependencies); + } + inlineChunkDependencies(chunk) { + for (const dep of chunk.dependencies) { + if (this.dependencies.has(dep)) + continue; + this.dependencies.add(dep); + if (dep instanceof Chunk) { + this.inlineChunkDependencies(dep); + } + } + } + // This method changes properties on the AST before rendering and must not be async + renderModules(fileName) { + const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this; + const { compact, format, freeze, generatedCode: { symbols } } = outputOptions; + const { _, cnst, n } = snippets; + this.setDynamicImportResolutions(fileName); + this.setImportMetaResolutions(fileName); + this.setIdentifierRenderResolutions(); + const magicString = new Bundle$1({ separator: `${n}${n}` }); + const indent = getIndentString(orderedModules, outputOptions); + const usedModules = []; + let hoistedSource = ''; + const accessedGlobals = new Set(); + const renderedModuleSources = new Map(); + const renderOptions = { + accessedDocumentCurrentScript: false, + exportNamesByVariable, + format, + freeze, + indent, + pluginDriver, + snippets, + symbols, + useOriginalName: null + }; + let usesTopLevelAwait = false; + for (const module of orderedModules) { + let renderedLength = 0; + let source; + if (module.isIncluded() || includedNamespaces.has(module)) { + const rendered = module.render(renderOptions); + if (!renderOptions.accessedDocumentCurrentScript && + formatsMaybeAccessDocumentCurrentScript.includes(format)) { + this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT); + } + renderOptions.accessedDocumentCurrentScript = false; + ({ source } = rendered); + usesTopLevelAwait ||= rendered.usesTopLevelAwait; + renderedLength = source.length(); + if (renderedLength) { + if (compact && source.lastLine().includes('//')) + source.append('\n'); + renderedModuleSources.set(module, source); + magicString.addSource(source); + usedModules.push(module); + } + const namespace = module.namespace; + if (includedNamespaces.has(module)) { + const rendered = namespace.renderBlock(renderOptions); + if (namespace.renderFirst()) + hoistedSource += n + rendered; + else + magicString.addSource(new MagicString(rendered)); + } + const accessedGlobalVariables = accessedGlobalsByScope.get(module.scope); + if (accessedGlobalVariables) { + for (const name of accessedGlobalVariables) { + accessedGlobals.add(name); + } + } + } + const { renderedExports, removedExports } = module.getRenderedExports(); + renderedModules[module.id] = { + get code() { + return source?.toString() ?? null; + }, + originalLength: module.originalCode.length, + removedExports, + renderedExports, + renderedLength + }; + } + if (hoistedSource) + magicString.prepend(hoistedSource + n + n); + if (this.needsExportsShim) { + magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); + } + const renderedSource = compact ? magicString : magicString.trim(); + if (isEmpty && this.getExportNames().length === 0 && dependencies.size === 0) { + onLog(LOGLEVEL_WARN, logEmptyChunk(this.getChunkName())); + } + return { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait }; + } + setDynamicImportResolutions(fileName) { + const { accessedGlobalsByScope, outputOptions, pluginDriver, snippets } = this; + for (const resolvedDynamicImport of this.getIncludedDynamicImports()) { + if (resolvedDynamicImport.chunk) { + const { chunk, facadeChunk, node, resolution } = resolvedDynamicImport; + if (chunk === this) { + node.setInternalResolution(resolution.namespace); + } + else { + node.setExternalResolution((facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)[0], null); + } + } + else { + const { node, resolution } = resolvedDynamicImport; + const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes(resolution, fileName); + node.setExternalResolution('external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, attributes); + } + } + } + setIdentifierRenderResolutions() { + const { format, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions; + const syntheticExports = new Set(); + for (const exportName of this.getExportNames()) { + const exportVariable = this.exportsByName.get(exportName); + if (format !== 'es' && + format !== 'system' && + exportVariable.isReassigned && + !exportVariable.isId) { + exportVariable.setRenderNames('exports', exportName); + } + else if (exportVariable instanceof SyntheticNamedExportVariable) { + syntheticExports.add(exportVariable); + } + else { + exportVariable.setRenderNames(null, null); + } + } + for (const module of this.orderedModules) { + if (module.needsExportShim) { + this.needsExportsShim = true; + break; + } + } + const usedNames = new Set(['Object', 'Promise']); + if (this.needsExportsShim) { + usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); + } + if (symbols) { + usedNames.add('Symbol'); + } + switch (format) { + case 'system': { + usedNames.add('module').add('exports'); + break; + } + case 'es': { + break; + } + case 'cjs': { + usedNames.add('module').add('require').add('__filename').add('__dirname'); + } + // fallthrough + default: { + usedNames.add('exports'); + for (const helper of HELPER_NAMES) { + usedNames.add(helper); + } + } + } + deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces); + } + setImportMetaResolutions(fileName) { + const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format } } = this; + for (const module of orderedModules) { + for (const importMeta of module.importMetas) { + importMeta.setResolution(format, accessedGlobalsByScope, fileName); + } + if (includedNamespaces.has(module)) { + module.namespace.prepare(accessedGlobalsByScope); + } + } + } + setUpChunkImportsAndExportsForModule(module) { + const moduleImports = new Set(module.includedImports); + // when we are not preserving modules, we need to make all namespace variables available for + // rendering the namespace object + if (!this.outputOptions.preserveModules && this.includedNamespaces.has(module)) { + const memberVariables = module.namespace.getMemberVariables(); + for (const variable of Object.values(memberVariables)) { + if (variable.included) { + moduleImports.add(variable); + } + } + } + for (let variable of moduleImports) { + if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + const chunk = this.chunkByModule.get(variable.module); + if (chunk !== this) { + this.imports.add(variable); + if (variable.module instanceof Module) { + this.checkCircularDependencyImport(variable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + chunk.exports.add(variable); + } + } + } + } + if (this.includedNamespaces.has(module) || + (module.info.isEntry && module.preserveSignature !== false) || + module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) { + this.ensureReexportsAreAvailableForModule(module); + } + for (const { node, resolution } of module.dynamicImports) { + if (node.included && + resolution instanceof Module && + this.chunkByModule.get(resolution) === this && + !this.includedNamespaces.has(resolution)) { + this.includedNamespaces.add(resolution); + this.ensureReexportsAreAvailableForModule(resolution); + } + } + } +} +function getChunkNameFromModule(module) { + return getPredefinedChunkNameFromModule(module) ?? getAliasName(module.id); +} +function getPredefinedChunkNameFromModule(module) { + return (module.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ?? module.chunkNames[0]?.name); +} +function getImportedBindingsPerDependency(renderedDependencies, resolveFileName) { + const importedBindingsPerDependency = {}; + for (const [dependency, declaration] of renderedDependencies) { + const specifiers = new Set(); + if (declaration.imports) { + for (const { imported } of declaration.imports) { + specifiers.add(imported); + } + } + if (declaration.reexports) { + for (const { imported } of declaration.reexports) { + specifiers.add(imported); + } + } + importedBindingsPerDependency[resolveFileName(dependency)] = [...specifiers]; + } + return importedBindingsPerDependency; +} +const QUERY_HASH_REGEX = /[#?]/; +const resolveFileName = (dependency) => dependency.getFileName(); + +/** + * Concatenate a number of iterables to a new iterable without fully evaluating + * their iterators. Useful when e.g. working with large sets or lists and when + * there is a chance that the iterators will not be fully exhausted. + */ +function* concatLazy(iterables) { + for (const iterable of iterables) { + yield* iterable; + } +} + +/** + * At its core, the algorithm first starts from each static or dynamic entry + * point and then assigns that entry point to all modules than can be reached + * via static imports. We call this the *dependent entry points* of that + * module. + * + * Then we group all modules with the same dependent entry points into chunks + * as those modules will always be loaded together. + * + * One non-trivial optimization we can apply is that dynamic entries are + * different from static entries in so far as when a dynamic import occurs, + * some modules are already in memory. If some of these modules are also + * dependencies of the dynamic entry, then it does not make sense to create a + * separate chunk for them. Instead, the dynamic import target can load them + * from the importing chunk. + * + * With regard to chunking, if B is implicitly loaded after A, then this can be + * handled the same way as if there was a dynamic import A => B. + * + * Example: + * Assume A -> B (A imports B), A => C (A dynamically imports C) and C -> B. + * Then the initial algorithm would assign A into the A chunk, C into the C + * chunk and B into the AC chunk, i.e. the chunk with the dependent entry + * points A and C. + * However we know that C can only be loaded from A, so A and its dependency B + * must already be in memory when C is loaded. So it is enough to create only + * two chunks A containing [AB] and C containing [C]. + * + * So we do not assign the dynamic entry C as dependent entry point to modules + * that are already loaded. + * + * In a more complex example, let us assume that we have entry points X and Y. + * Further, let us assume + * X -> A, X -> B, X -> C, + * Y -> A, Y -> B, + * A => D, + * D -> B, D -> C + * So without dynamic import optimization, the dependent entry points are + * A: XY, B: DXY, C: DX, D: D, X: X, Y: Y, so we would for now create six + * chunks. + * + * Now D is loaded only after A is loaded. But A is loaded if either X is + * loaded or Y is loaded. So the modules that are already in memory when D is + * loaded are the intersection of all modules that X depends on with all + * modules that Y depends on, which in this case are the modules A and B. + * We could also say they are all modules that have both X and Y as dependent + * entry points. + * + * So we can remove D as dependent entry point from A and B, which means they + * both now have only XY as dependent entry points and can be merged into the + * same chunk. + * + * Now let us extend this to the most general case where we have several + * dynamic importers for one dynamic entry point. + * + * In the most general form, it works like this: + * For each dynamic entry point, we have a number of dynamic importers, which + * are the modules importing it. Using the previous ideas, we can determine + * the modules already in memory for each dynamic importer by looking for all + * modules that have all the dependent entry points of the dynamic importer as + * dependent entry points. + * So the modules that are guaranteed to be in memory when the dynamic entry + * point is loaded are the intersection of the modules already in memory for + * each dynamic importer. + * + * Assuming that A => D and B => D and A has dependent entry points XY and B + * has dependent entry points YZ, then the modules guaranteed to be in memory + * are all modules that have at least XYZ as dependent entry points. + * We call XYZ the *dynamically dependent entry points* of D. + * + * Now there is one last case to consider: If one of the dynamically dependent + * entries is itself a dynamic entry, then any module is in memory that either + * is a dependency of that dynamic entry or again has the dynamic dependent + * entries of that dynamic entry as dependent entry points. + * + * A naive algorithm for this proved to be costly as it contained an O(n^3) + * complexity with regard to dynamic entries that blew up for very large + * projects. + * + * If we have an efficient way to do Set operations, an alternative approach + * would be to instead collect already loaded modules per dynamic entry. And as + * all chunks from the initial grouping would behave the same, we can instead + * collect already loaded chunks for a performance improvement. + * + * To do that efficiently, need + * - a Map of dynamic imports per dynamic entry, which contains all dynamic + * imports that can be triggered by a dynamic entry + * - a Map of static dependencies per entry + * - a Map of already loaded chunks per entry that we initially populate with + * empty Sets for static entries and Sets containing all entries for dynamic + * entries + * + * For efficient operations, we assign each entry a numerical index and + * represent Sets of Chunks as BigInt values where each chunk corresponds to a + * bit index. Then the last two maps can be represented as arrays of BigInt + * values. + * + * Then we iterate through each dynamic entry. We set the already loaded modules + * to the intersection of the previously already loaded modules with the union + * of the already loaded modules of that chunk with its static dependencies. + * + * If the already loaded modules changed, then we use the Map of dynamic imports + * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put + * them back into the iteration. As an additional optimization, we note for + * each dynamic entry which dynamic dependent entries have changed and only + * intersect those entries again on subsequent interations. + * + * Then we remove the dynamic entries from the list of dependent entries for + * those chunks that are already loaded for that dynamic entry and create + * another round of chunks. + */ +function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) { + const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry); + const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entries); + // Each chunk is identified by its position in this array + const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks)); + const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(allEntries, chunkAtoms); + // Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. + // If we no longer want this, we should make a copy here. + const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries); + // This mutates the dependentEntries in chunkAtoms + removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry); + const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize); + chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({ + alias: null, + modules + }))); + return chunkDefinitions; +} +function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry) { + const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys()); + const manualChunkModulesByAlias = Object.create(null); + for (const [entry, alias] of manualChunkAliasByEntry) { + addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks); + } + const manualChunks = Object.entries(manualChunkModulesByAlias); + const chunkDefinitions = new Array(manualChunks.length); + let index = 0; + for (const [alias, modules] of manualChunks) { + chunkDefinitions[index++] = { alias, modules }; + } + return { chunkDefinitions, modulesInManualChunks }; +} +function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) { + const modulesToHandle = new Set([entry]); + for (const module of modulesToHandle) { + modulesInManualChunks.add(module); + manualChunkModules.push(module); + for (const dependency of module.dependencies) { + if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) { + modulesToHandle.add(dependency); + } + } + } +} +function analyzeModuleGraph(entries) { + const dynamicEntryModules = new Set(); + const dependentEntriesByModule = new Map(); + const allEntriesSet = new Set(entries); + const dynamicImportModulesByEntry = new Array(allEntriesSet.size); + let entryIndex = 0; + for (const currentEntry of allEntriesSet) { + const dynamicImportsForCurrentEntry = new Set(); + dynamicImportModulesByEntry[entryIndex] = dynamicImportsForCurrentEntry; + const modulesToHandle = new Set([currentEntry]); + for (const module of modulesToHandle) { + getOrCreate(dependentEntriesByModule, module, (getNewSet)).add(entryIndex); + for (const dependency of module.getDependenciesToBeIncluded()) { + if (!(dependency instanceof ExternalModule)) { + modulesToHandle.add(dependency); + } + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module && + resolution.includedDynamicImporters.length > 0 && + !allEntriesSet.has(resolution)) { + dynamicEntryModules.add(resolution); + allEntriesSet.add(resolution); + dynamicImportsForCurrentEntry.add(resolution); + } + } + for (const dependency of module.implicitlyLoadedBefore) { + if (!allEntriesSet.has(dependency)) { + dynamicEntryModules.add(dependency); + allEntriesSet.add(dependency); + } + } + } + entryIndex++; + } + const allEntries = [...allEntriesSet]; + const { dynamicEntries, dynamicImportsByEntry } = getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry); + return { + allEntries, + dependentEntriesByModule, + dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries), + dynamicImportsByEntry + }; +} +function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry) { + const entryIndexByModule = new Map(); + const dynamicEntries = new Set(); + for (const [entryIndex, entry] of allEntries.entries()) { + entryIndexByModule.set(entry, entryIndex); + if (dynamicEntryModules.has(entry)) { + dynamicEntries.add(entryIndex); + } + } + const dynamicImportsByEntry = new Array(dynamicImportModulesByEntry.length); + let index = 0; + for (const dynamicImportModules of dynamicImportModulesByEntry) { + const dynamicImports = new Set(); + for (const dynamicEntry of dynamicImportModules) { + dynamicImports.add(entryIndexByModule.get(dynamicEntry)); + } + dynamicImportsByEntry[index++] = dynamicImports; + } + return { dynamicEntries, dynamicImportsByEntry }; +} +function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries) { + const dynamicallyDependentEntriesByDynamicEntry = new Map(); + for (const dynamicEntryIndex of dynamicEntries) { + const dynamicallyDependentEntries = getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicEntryIndex, (getNewSet)); + const dynamicEntry = allEntries[dynamicEntryIndex]; + for (const importer of concatLazy([ + dynamicEntry.includedDynamicImporters, + dynamicEntry.implicitlyLoadedAfter + ])) { + for (const entry of dependentEntriesByModule.get(importer)) { + dynamicallyDependentEntries.add(entry); + } + } + } + return dynamicallyDependentEntriesByDynamicEntry; +} +function getChunksWithSameDependentEntries(modulesWithDependentEntries) { + const chunkModules = Object.create(null); + for (const { dependentEntries, modules } of modulesWithDependentEntries) { + let chunkSignature = 0n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + } + (chunkModules[String(chunkSignature)] ||= { + dependentEntries: new Set(dependentEntries), + modules: [] + }).modules.push(...modules); + } + return Object.values(chunkModules); +} +function* getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks) { + for (const [module, dependentEntries] of dependentEntriesByModule) { + if (!modulesInManualChunks.has(module)) { + yield { dependentEntries, modules: [module] }; + } + } +} +function getStaticDependencyAtomsByEntry(allEntries, chunkAtoms) { + // The indices correspond to the indices in allEntries. The atoms correspond + // to bits in the bigint values where chunk 0 is the lowest bit. + const staticDependencyAtomsByEntry = allEntries.map(() => 0n); + // This toggles the bits for each atom that is a dependency of an entry + let atomMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + staticDependencyAtomsByEntry[entryIndex] |= atomMask; + } + atomMask <<= 1n; + } + return staticDependencyAtomsByEntry; +} +// Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. +function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries) { + // Dynamic entries have all atoms as already loaded initially because we then + // intersect with the static dependency atoms of all dynamic importers. + // Static entries cannot have already loaded atoms. + const alreadyLoadedAtomsByEntry = allEntries.map((_entry, entryIndex) => dynamicallyDependentEntriesByDynamicEntry.has(entryIndex) ? -1n : 0n); + for (const [dynamicEntryIndex, dynamicallyDependentEntries] of dynamicallyDependentEntriesByDynamicEntry) { + // We delete here so that they can be added again if necessary to be handled + // again by the loop + dynamicallyDependentEntriesByDynamicEntry.delete(dynamicEntryIndex); + const knownLoadedAtoms = alreadyLoadedAtomsByEntry[dynamicEntryIndex]; + let updatedLoadedAtoms = knownLoadedAtoms; + for (const entryIndex of dynamicallyDependentEntries) { + updatedLoadedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + // If the knownLoadedAtoms changed, all dependent dynamic entries need to be + // updated again + if (updatedLoadedAtoms !== knownLoadedAtoms) { + alreadyLoadedAtomsByEntry[dynamicEntryIndex] = updatedLoadedAtoms; + for (const dynamicImport of dynamicImportsByEntry[dynamicEntryIndex]) { + // If this adds an entry that was deleted before, it will be handled + // again. This is the reason why we delete every entry from this map + // that we processed. + getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicImport, (getNewSet)).add(dynamicEntryIndex); + } + } + } + return alreadyLoadedAtomsByEntry; +} +/** + * This removes all unnecessary dynamic entries from the dependentEntries in its + * first argument if a chunk is already loaded without that entry. + */ +function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry) { + // Remove entries from dependent entries if a chunk is already loaded without + // that entry. + let chunkMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + if ((alreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === chunkMask) { + dependentEntries.delete(entryIndex); + } + } + chunkMask <<= 1n; + } +} +function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) { + const chunksBySignature = Object.create(null); + const chunkByModule = new Map(); + const sizeByAtom = new Array(chunkAtoms.length); + let sideEffectAtoms = 0n; + let atomMask = 1n; + let index = 0; + for (const { dependentEntries, modules } of chunkAtoms) { + let chunkSignature = 0n; + let correlatedAtoms = -1n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + // Correlated atoms are the atoms that are guaranteed to be loaded as + // well when a given atom is loaded. It is the intersection of the already + // loaded modules of each chunk merged with its static dependencies. + correlatedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + const chunk = (chunksBySignature[String(chunkSignature)] ||= { + containedAtoms: 0n, + correlatedAtoms, + dependencies: new Set(), + dependentChunks: new Set(), + dependentEntries: new Set(dependentEntries), + modules: [], + pure: true, + size: 0 + }); + let atomSize = 0; + let pure = true; + for (const module of modules) { + chunkByModule.set(module, chunk); + // Unfortunately, we cannot take tree-shaking into account here because + // rendering did not happen yet, but we can detect empty modules + if (module.isIncluded()) { + pure &&= !module.hasEffects(); + // we use a trivial size for the default minChunkSize to improve + // performance + atomSize += minChunkSize > 1 ? module.estimateSize() : 1; + } + } + if (!pure) { + sideEffectAtoms |= atomMask; + } + sizeByAtom[index++] = atomSize; + chunk.containedAtoms |= atomMask; + chunk.modules.push(...modules); + chunk.pure &&= pure; + chunk.size += atomSize; + atomMask <<= 1n; + } + const chunks = Object.values(chunksBySignature); + sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, atomMask); + return { chunks, sideEffectAtoms, sizeByAtom }; +} +function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, nextAvailableAtomMask) { + const signatureByExternalModule = new Map(); + let externalSideEffectAtoms = 0n; + for (const chunk of chunks) { + const { dependencies, modules } = chunk; + for (const module of modules) { + for (const dependency of module.getDependenciesToBeIncluded()) { + if (dependency instanceof ExternalModule) { + if (dependency.info.moduleSideEffects) { + const signature = getOrCreate(signatureByExternalModule, dependency, () => { + const signature = nextAvailableAtomMask; + nextAvailableAtomMask <<= 1n; + externalSideEffectAtoms |= signature; + return signature; + }); + chunk.containedAtoms |= signature; + chunk.correlatedAtoms |= signature; + } + } + else { + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk && dependencyChunk !== chunk) { + dependencies.add(dependencyChunk); + dependencyChunk.dependentChunks.add(chunk); + } + } + } + } + } + return externalSideEffectAtoms; +} +/** + * This function tries to get rid of small chunks by merging them with other + * chunks. + * + * We can only merge chunks safely if after the merge, loading any entry point + * in any allowed order will not trigger side effects that should not have been + * triggered. While side effects are usually things like global function calls, + * global variable mutations or potentially thrown errors, details do not + * matter here, and we just discern chunks without side effects (pure chunks) + * from other chunks. + * + * As a first step, we assign each pre-generated chunk with side effects a + * label. I.e. we have side effect "A" if the non-pure chunk "A" is loaded. + * + * Now to determine the side effects of loading a chunk, one also has to take + * the side effects of its dependencies into account. So if A depends on B + * (A -> B) and both have side effects, loading A triggers effects AB. + * + * Now from the previous step we know that each chunk is uniquely determine by + * the entry points that depend on it and cause it to load, which we will call + * its dependent entry points. + * + * E.g. if X -> A and Y -> A, then the dependent entry points of A are XY. + * Starting from that idea, we can determine a set of chunks—and thus a set + * of side effects—that must have been triggered if a certain chunk has been + * loaded. Basically, it is the intersection of all chunks loaded by the + * dependent entry points of a given chunk. We call the corresponding side + * effects the correlated side effects of that chunk. + * + * Example: + * X -> ABC, Y -> ADE, A-> F, B -> D + * Then taking dependencies into account, X -> ABCDF, Y -> ADEF + * The intersection is ADF. So we know that when A is loaded, D and F must also + * be in memory even though neither D nor A is a dependency of the other. + * If all have side effects, we call ADF the correlated side effects of A. The + * correlated side effects need to remain constant when merging chunks. + * + * In contrast, we have the dependency side effects of A, which represents + * the side effects we trigger if we directly load A. In this example, the + * dependency side effects are AF. + * For entry chunks, dependency and correlated side effects are the same. + * + * With these concepts, merging chunks is allowed if the correlated side + * effects of each entry do not change. Thus, we are allowed to merge two + * chunks if + * + * a) the dependency side effects of each chunk are a subset of the correlated + * side effects of the other chunk, so no additional side effects are + * triggered for any entry, or + * b) The dependent entry points of chunk A are a subset of the dependent entry + * points of chunk B while the dependency side effects of A are a subset of + * the correlated side effects of B. Because in that scenario, whenever A is + * loaded, B is loaded as well. But there are cases when B is loaded where A + * is not loaded. So if we merge the chunks, all dependency side effects of + * A will be added to the correlated side effects of B, and as the latter is + * not allowed to change, the former need to be a subset of the latter. + * + * Another consideration when merging small chunks into other chunks is to + * avoid + * that too much additional code is loaded. This is achieved when the dependent + * entries of the small chunk are a subset of the dependent entries of the + * other + * chunk. Because then when the small chunk is loaded, the other chunk was + * loaded/in memory anyway, so at most when the other chunk is loaded, the + * additional size of the small chunk is loaded unnecessarily. + * + * So the algorithm performs merges in two passes: + * + * 1. First we try to merge small chunks A only into other chunks B if the + * dependent entries of A are a subset of the dependent entries of B and the + * dependency side effects of A are a subset of the correlated side effects + * of B. + * 2. Only then for all remaining small chunks, we look for arbitrary merges + * following the rule (a), starting with the smallest chunks to look for + * possible merge targets. + */ +function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log) { + timeStart('optimize chunks', 3); + const chunkPartition = getPartitionedChunks(chunks, minChunkSize); + if (!chunkPartition) { + timeEnd('optimize chunks', 3); + return chunks; // the actual modules + } + if (minChunkSize > 1) { + log('info', logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially')); + } + mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom); + if (minChunkSize > 1) { + log('info', logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks')); + } + timeEnd('optimize chunks', 3); + return [...chunkPartition.small, ...chunkPartition.big]; +} +function getPartitionedChunks(chunks, minChunkSize) { + const smallChunks = []; + const bigChunks = []; + for (const chunk of chunks) { + (chunk.size < minChunkSize ? smallChunks : bigChunks).push(chunk); + } + if (smallChunks.length === 0) { + return null; + } + smallChunks.sort(compareChunkSize); + bigChunks.sort(compareChunkSize); + return { + big: new Set(bigChunks), + small: new Set(smallChunks) + }; +} +function compareChunkSize({ size: sizeA }, { size: sizeB }) { + return sizeA - sizeB; +} +function mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom) { + const { small } = chunkPartition; + for (const mergedChunk of small) { + const bestTargetChunk = findBestMergeTarget(mergedChunk, chunkPartition, sideEffectAtoms, sizeByAtom, + // In the default case, we do not accept size increases + minChunkSize <= 1 ? 1 : Infinity); + if (bestTargetChunk) { + const { containedAtoms, correlatedAtoms, modules, pure, size } = mergedChunk; + small.delete(mergedChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).delete(bestTargetChunk); + bestTargetChunk.modules.push(...modules); + bestTargetChunk.size += size; + bestTargetChunk.pure &&= pure; + const { dependencies, dependentChunks, dependentEntries } = bestTargetChunk; + bestTargetChunk.correlatedAtoms &= correlatedAtoms; + bestTargetChunk.containedAtoms |= containedAtoms; + for (const entry of mergedChunk.dependentEntries) { + dependentEntries.add(entry); + } + for (const dependency of mergedChunk.dependencies) { + dependencies.add(dependency); + dependency.dependentChunks.delete(mergedChunk); + dependency.dependentChunks.add(bestTargetChunk); + } + for (const dependentChunk of mergedChunk.dependentChunks) { + dependentChunks.add(dependentChunk); + dependentChunk.dependencies.delete(mergedChunk); + dependentChunk.dependencies.add(bestTargetChunk); + } + dependencies.delete(bestTargetChunk); + dependentChunks.delete(bestTargetChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).add(bestTargetChunk); + } + } +} +function findBestMergeTarget(mergedChunk, { big, small }, sideEffectAtoms, sizeByAtom, smallestAdditionalSize) { + let bestTargetChunk = null; + // In the default case, we do not accept size increases + for (const targetChunk of concatLazy([small, big])) { + if (mergedChunk === targetChunk) + continue; + const additionalSizeAfterMerge = getAdditionalSizeAfterMerge(mergedChunk, targetChunk, smallestAdditionalSize, sideEffectAtoms, sizeByAtom); + if (additionalSizeAfterMerge < smallestAdditionalSize) { + bestTargetChunk = targetChunk; + if (additionalSizeAfterMerge === 0) + break; + smallestAdditionalSize = additionalSizeAfterMerge; + } + } + return bestTargetChunk; +} +/** + * Determine the additional unused code size that would be added by merging the + * two chunks. This is not an exact measurement but rather an upper bound. If + * the merge produces cycles or adds non-correlated side effects, `Infinity` + * is returned. + * Merging will not produce cycles if none of the direct non-merged + * dependencies of a chunk have the other chunk as a transitive dependency. + */ +function getAdditionalSizeAfterMerge(mergedChunk, targetChunk, +// The maximum additional unused code size allowed to be added by the merge, +// taking dependencies into account, needs to be below this number +currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const firstSize = getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(mergedChunk, targetChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom); + return firstSize < currentAdditionalSize + ? firstSize + + getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(targetChunk, mergedChunk, currentAdditionalSize - firstSize, sideEffectAtoms, sizeByAtom) + : Infinity; +} +function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(dependentChunk, dependencyChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const { correlatedAtoms } = dependencyChunk; + let dependencyAtoms = dependentChunk.containedAtoms; + const dependentContainedSideEffects = dependencyAtoms & sideEffectAtoms; + if ((correlatedAtoms & dependentContainedSideEffects) !== dependentContainedSideEffects) { + return Infinity; + } + const chunksToCheck = new Set(dependentChunk.dependencies); + for (const { dependencies, containedAtoms } of chunksToCheck) { + dependencyAtoms |= containedAtoms; + const containedSideEffects = containedAtoms & sideEffectAtoms; + if ((correlatedAtoms & containedSideEffects) !== containedSideEffects) { + return Infinity; + } + for (const dependency of dependencies) { + if (dependency === dependencyChunk) { + return Infinity; + } + chunksToCheck.add(dependency); + } + } + return getAtomsSizeIfBelowLimit(dependencyAtoms & ~correlatedAtoms, currentAdditionalSize, sizeByAtom); +} +function getAtomsSizeIfBelowLimit(atoms, currentAdditionalSize, sizeByAtom) { + let size = 0; + let atomIndex = 0; + let atomSignature = 1n; + const { length } = sizeByAtom; + for (; atomIndex < length; atomIndex++) { + if ((atoms & atomSignature) === atomSignature) { + size += sizeByAtom[atomIndex]; + } + atomSignature <<= 1n; + if (size >= currentAdditionalSize) { + return Infinity; + } + } + return size; +} +function getChunksInPartition(chunk, minChunkSize, chunkPartition) { + return chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big; +} + +// ported from https://github.com/substack/node-commondir +function commondir(files) { + if (files.length === 0) + return '/'; + if (files.length === 1) + return dirname(files[0]); + const commonSegments = files.slice(1).reduce((commonSegments, file) => { + const pathSegments = file.split(/\/+|\\+/); + let index; + for (index = 0; commonSegments[index] === pathSegments[index] && + index < Math.min(commonSegments.length, pathSegments.length); index++) + ; + return commonSegments.slice(0, index); + }, files[0].split(/\/+|\\+/)); + // Windows correctly handles paths with forward-slashes + return commonSegments.length > 1 ? commonSegments.join('/') : '/'; +} + +const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1; +function sortByExecutionOrder(units) { + units.sort(compareExecIndex); +} +// This process is currently faulty in so far as it only takes the first entry +// module into account and assumes that dynamic imports are imported in a +// certain order. +// A better algorithm would follow every possible execution path and mark which +// modules are executed before or after which other modules. THen the chunking +// would need to take care that in each chunk, all modules are always executed +// in the same sequence. +function analyseModuleExecution(entryModules) { + let nextExecIndex = 0; + const cyclePaths = []; + const analysedModules = new Set(); + const dynamicImports = new Set(); + const parents = new Map(); + const orderedModules = []; + const analyseModule = (module) => { + if (module instanceof Module) { + for (const dependency of module.dependencies) { + if (parents.has(dependency)) { + if (!analysedModules.has(dependency)) { + cyclePaths.push(getCyclePath(dependency, module, parents)); + } + continue; + } + parents.set(dependency, module); + analyseModule(dependency); + } + for (const dependency of module.implicitlyLoadedBefore) { + dynamicImports.add(dependency); + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module) { + dynamicImports.add(resolution); + } + } + orderedModules.push(module); + } + module.execIndex = nextExecIndex++; + analysedModules.add(module); + }; + for (const currentEntry of entryModules) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + for (const currentEntry of dynamicImports) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + return { cyclePaths, orderedModules }; +} +function getCyclePath(module, parent, parents) { + const cycleSymbol = Symbol(module.id); + const path = [module.id]; + let nextModule = parent; + module.cycles.add(cycleSymbol); + while (nextModule !== module) { + nextModule.cycles.add(cycleSymbol); + path.push(nextModule.id); + nextModule = parents.get(nextModule); + } + path.push(path[0]); + path.reverse(); + return path; +} + +function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps } }) { + const { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\n', s: ';' }; + const cnst = constBindings ? 'const' : 'var'; + const getNonArrowFunctionIntro = (parameters, { isAsync, name }) => `${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${parameters.join(`,${_}`)})${_}`; + const getFunctionIntro = arrowFunctions + ? (parameters, { isAsync, name }) => { + const singleParameter = parameters.length === 1; + const asyncString = isAsync ? `async${singleParameter ? ' ' : _}` : ''; + return `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${singleParameter ? parameters[0] : `(${parameters.join(`,${_}`)})`}${_}=>${_}`; + } + : getNonArrowFunctionIntro; + const getDirectReturnFunction = (parameters, { functionReturn, lineBreakIndent, name }) => [ + `${getFunctionIntro(parameters, { + isAsync: false, + name + })}${arrowFunctions + ? lineBreakIndent + ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` + : '' + : `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${functionReturn ? 'return ' : ''}`}`, + arrowFunctions + ? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}` + : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}` + ]; + const isValidPropertyName = reservedNamesAsProps + ? (name) => VALID_IDENTIFIER_REGEXP.test(name) + : (name) => !RESERVED_NAMES.has(name) && VALID_IDENTIFIER_REGEXP.test(name); + return { + _, + cnst, + getDirectReturnFunction, + getDirectReturnIifeLeft: (parameters, returned, { needsArrowReturnParens, needsWrappedFunction }) => { + const [left, right] = getDirectReturnFunction(parameters, { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return `${wrapIfNeeded(`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`, arrowFunctions || needsWrappedFunction)}(`; + }, + getFunctionIntro, + getNonArrowFunctionIntro, + getObject(fields, { lineBreakIndent }) { + const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _; + return `{${fields + .map(([key, value]) => { + if (key === null) + return `${prefix}${value}`; + const keyInObject = stringifyObjectKeyIfNeeded(key); + return key === value && objectShorthand && key === keyInObject + ? prefix + key + : `${prefix}${keyInObject}:${_}${value}`; + }) + .join(`,`)}${fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`; + }, + getPropertyAccess: (name) => isValidPropertyName(name) ? `.${name}` : `[${JSON.stringify(name)}]`, + n, + s + }; +} +const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code; + +class Source { + constructor(filename, content) { + this.isOriginal = true; + this.filename = filename; + this.content = content; + } + traceSegment(line, column, name) { + return { column, line, name, source: this }; + } +} +class Link { + constructor(map, sources) { + this.sources = sources; + this.names = map.names; + this.mappings = map.mappings; + } + traceMappings() { + const sources = []; + const sourceIndexMap = new Map(); + const sourcesContent = []; + const names = []; + const nameIndexMap = new Map(); + const mappings = []; + for (const line of this.mappings) { + const tracedLine = []; + for (const segment of line) { + if (segment.length === 1) + continue; + const source = this.sources[segment[1]]; + if (!source) + continue; + const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : ''); + if (traced) { + const { column, line, name, source: { content, filename } } = traced; + let sourceIndex = sourceIndexMap.get(filename); + if (sourceIndex === undefined) { + sourceIndex = sources.length; + sources.push(filename); + sourceIndexMap.set(filename, sourceIndex); + sourcesContent[sourceIndex] = content; + } + else if (sourcesContent[sourceIndex] == null) { + sourcesContent[sourceIndex] = content; + } + else if (content != null && sourcesContent[sourceIndex] !== content) { + return error(logConflictingSourcemapSources(filename)); + } + const tracedSegment = [segment[0], sourceIndex, line, column]; + if (name) { + let nameIndex = nameIndexMap.get(name); + if (nameIndex === undefined) { + nameIndex = names.length; + names.push(name); + nameIndexMap.set(name, nameIndex); + } + tracedSegment[4] = nameIndex; + } + tracedLine.push(tracedSegment); + } + } + mappings.push(tracedLine); + } + return { mappings, names, sources, sourcesContent }; + } + traceSegment(line, column, name) { + const segments = this.mappings[line]; + if (!segments) + return null; + // binary search through segments for the given column + let searchStart = 0; + let searchEnd = segments.length - 1; + while (searchStart <= searchEnd) { + const m = (searchStart + searchEnd) >> 1; + const segment = segments[m]; + // If a sourcemap does not have sufficient resolution to contain a + // necessary mapping, e.g. because it only contains line information, we + // use the best approximation we could find + if (segment[0] === column || searchStart === searchEnd) { + if (segment.length == 1) + return null; + const source = this.sources[segment[1]]; + if (!source) + return null; + return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name); + } + if (segment[0] > column) { + searchEnd = m - 1; + } + else { + searchStart = m + 1; + } + } + return null; + } +} +function getLinkMap(log) { + return function linkMap(source, map) { + if (!map.missing) { + return new Link(map, [source]); + } + log(LOGLEVEL_WARN, logSourcemapBroken(map.plugin)); + return new Link({ + mappings: [], + names: [] + }, [source]); + }; +} +function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) { + let source; + if (originalSourcemap) { + const sources = originalSourcemap.sources; + const sourcesContent = originalSourcemap.sourcesContent || []; + const directory = dirname(id) || '.'; + const sourceRoot = originalSourcemap.sourceRoot || '.'; + const baseSources = sources.map((source, index) => new Source(resolve$1(directory, sourceRoot, source), sourcesContent[index])); + source = new Link(originalSourcemap, baseSources); + } + else { + source = new Source(id, originalCode); + } + return sourcemapChain.reduce(linkMap, source); +} +function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, log) { + const linkMap = getLinkMap(log); + const moduleSources = modules + .filter(module => !module.excludeFromSourcemap) + .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap)); + const link = new Link(map, moduleSources); + const source = bundleSourcemapChain.reduce(linkMap, link); + let { sources, sourcesContent, names, mappings } = source.traceMappings(); + if (file) { + const directory = dirname(file); + sources = sources.map((source) => relative(directory, source)); + file = basename(file); + } + sourcesContent = (excludeContent ? null : sourcesContent); + for (const module of modules) { + resetSourcemapCache(module.originalSourcemap, module.sourcemapChain); + } + return new SourceMap({ file, mappings, names, sources, sourcesContent }); +} +function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) { + if (sourcemapChain.length === 0) { + return originalSourcemap; + } + const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log)); + const map = source.traceMappings(); + return decodedSourcemap({ version: 3, ...map }); +} + +let textEncoder; +const getHash64 = input => xxhashBase64Url(ensureBuffer(input)); +const getHash36 = input => xxhashBase36(ensureBuffer(input)); +const getHash16 = input => xxhashBase16(ensureBuffer(input)); +const hasherByType = { + base36: getHash36, + base64: getHash64, + hex: getHash16 +}; +function ensureBuffer(input) { + if (typeof input === 'string') { + if (typeof Buffer === 'undefined') { + textEncoder ??= new TextEncoder(); + return textEncoder.encode(input); + } + return Buffer.from(input); + } + return input; +} + +// this looks ridiculous, but it prevents sourcemap tooling from mistaking +// this for an actual sourceMappingURL +let SOURCEMAPPING_URL = 'sourceMa'; +SOURCEMAPPING_URL += 'ppingURL'; + +async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) { + timeStart('render chunks', 2); + reserveEntryChunksInBundle(chunks); + const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render())); + timeEnd('render chunks', 2); + timeStart('transform chunks', 2); + const getHash = hasherByType[outputOptions.hashCharacters]; + const chunkGraph = getChunkGraph(chunks); + const { hashDependenciesByPlaceholder, initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, placeholders, renderedChunksByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log); + const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash); + addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions); + timeEnd('transform chunks', 2); +} +function reserveEntryChunksInBundle(chunks) { + for (const chunk of chunks) { + if (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint) { + // reserves name in bundle as side effect if it does not contain a hash + chunk.getPreliminaryFileName(); + } + } +} +function getChunkGraph(chunks) { + return Object.fromEntries(chunks.map(chunk => { + const renderedChunkInfo = chunk.getRenderedChunkInfo(); + return [renderedChunkInfo.fileName, renderedChunkInfo]; + })); +} +async function transformChunk(magicString, fileName, usedModules, chunkGraph, options, outputPluginDriver, log) { + let map = null; + const sourcemapChain = []; + let code = await outputPluginDriver.hookReduceArg0('renderChunk', [magicString.toString(), chunkGraph[fileName], options, { chunks: chunkGraph }], (code, result, plugin) => { + if (result == null) + return code; + if (typeof result === 'string') + result = { + code: result, + map: undefined + }; + // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning + if (result.map !== null) { + const map = decodedSourcemap(result.map); + sourcemapChain.push(map || { missing: true, plugin: plugin.name }); + } + return result.code; + }); + const { compact, dir, file, sourcemap, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, sourcemapIgnoreList } = options; + if (!compact && code[code.length - 1] !== '\n') + code += '\n'; + if (sourcemap) { + timeStart('sourcemaps', 3); + let resultingFile; + if (file) + resultingFile = resolve$1(sourcemapFile || file); + else if (dir) + resultingFile = resolve$1(dir, fileName); + else + resultingFile = resolve$1(fileName); + const decodedMap = magicString.generateDecodedMap({}); + map = collapseSourcemaps(resultingFile, decodedMap, usedModules, sourcemapChain, sourcemapExcludeSources, log); + for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { + let sourcePath = map.sources[sourcesIndex]; + const sourcemapPath = `${resultingFile}.map`; + const ignoreList = sourcemapIgnoreList(sourcePath, sourcemapPath); + if (typeof ignoreList !== 'boolean') { + error(logFailedValidation('sourcemapIgnoreList function must return a boolean.')); + } + if (ignoreList) { + if (map.x_google_ignoreList === undefined) { + map.x_google_ignoreList = []; + } + if (!map.x_google_ignoreList.includes(sourcesIndex)) { + map.x_google_ignoreList.push(sourcesIndex); + } + } + if (sourcemapPathTransform) { + sourcePath = sourcemapPathTransform(sourcePath, sourcemapPath); + if (typeof sourcePath !== 'string') { + error(logFailedValidation(`sourcemapPathTransform function must return a string.`)); + } + } + map.sources[sourcesIndex] = normalize(sourcePath); + } + timeEnd('sourcemaps', 3); + } + return { + code, + map + }; +} +async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log) { + const nonHashedChunksWithPlaceholders = []; + const renderedChunksByPlaceholder = new Map(); + const hashDependenciesByPlaceholder = new Map(); + const initialHashesByPlaceholder = new Map(); + const placeholders = new Set(); + for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) { + if (hashPlaceholder) + placeholders.add(hashPlaceholder); + } + await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => { + const transformedChunk = { + chunk, + fileName, + sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null, + ...(await transformChunk(magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log)) + }; + const { code, map } = transformedChunk; + if (hashPlaceholder) { + // To create a reproducible content-only hash, all placeholders are + // replaced with the same value before hashing + const { containedPlaceholders, transformedCode } = replacePlaceholdersWithDefaultAndGetContainedPlaceholders(code, placeholders); + let contentToHash = transformedCode; + const hashAugmentation = pluginDriver.hookReduceValueSync('augmentChunkHash', '', [chunk.getRenderedChunkInfo()], (augmentation, pluginHash) => { + if (pluginHash) { + augmentation += pluginHash; + } + return augmentation; + }); + if (hashAugmentation) { + contentToHash += hashAugmentation; + } + renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk); + hashDependenciesByPlaceholder.set(hashPlaceholder, { + containedPlaceholders, + contentHash: getHash(contentToHash) + }); + } + else { + nonHashedChunksWithPlaceholders.push(transformedChunk); + } + const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder; + if (map && sourcemapHashPlaceholder) { + initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, getHash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length)); + } + })); + return { + hashDependenciesByPlaceholder, + initialHashesByPlaceholder, + nonHashedChunksWithPlaceholders, + placeholders, + renderedChunksByPlaceholder + }; +} +function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash) { + const hashesByPlaceholder = new Map(initialHashesByPlaceholder); + for (const placeholder of placeholders) { + const { fileName } = renderedChunksByPlaceholder.get(placeholder); + let contentToHash = ''; + const hashDependencyPlaceholders = new Set([placeholder]); + for (const dependencyPlaceholder of hashDependencyPlaceholders) { + const { containedPlaceholders, contentHash } = hashDependenciesByPlaceholder.get(dependencyPlaceholder); + contentToHash += contentHash; + for (const containedPlaceholder of containedPlaceholders) { + // When looping over a map, setting an entry only causes a new iteration if the key is new + hashDependencyPlaceholders.add(containedPlaceholder); + } + } + let finalFileName; + let finalHash; + do { + // In case of a hash collision, create a hash of the hash + if (finalHash) { + contentToHash = finalHash; + } + finalHash = getHash(contentToHash).slice(0, placeholder.length); + finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash); + } while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase())); + bundle[finalFileName] = FILE_PLACEHOLDER; + hashesByPlaceholder.set(placeholder, finalHash); + } + return hashesByPlaceholder; +} +function addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, options) { + for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) { + let updatedCode = replacePlaceholders(code, hashesByPlaceholder); + const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder); + let finalSourcemapFileName = null; + if (map) { + if (options.sourcemapDebugIds) { + updatedCode += calculateDebugIdAndGetComment(updatedCode, map); + } + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${finalFileName}.map`; + map.file = replacePlaceholders(map.file, hashesByPlaceholder); + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } + for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) { + let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code; + let finalSourcemapFileName = null; + if (map) { + if (options.sourcemapDebugIds) { + updatedCode += calculateDebugIdAndGetComment(updatedCode, map); + } + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${fileName}.map`; + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[fileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } +} +function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, sourcemapBaseUrl }) { + let url; + if (sourcemap === 'inline') { + url = map.toUrl(); + } + else { + const sourcemapFileName = basename(fileName); + url = sourcemapBaseUrl + ? new URL(sourcemapFileName, sourcemapBaseUrl).toString() + : sourcemapFileName; + pluginDriver.emitFile({ + fileName, + originalFileName: null, + source: map.toString(), + type: 'asset' + }); + } + return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`; +} +function calculateDebugIdAndGetComment(code, map) { + const hash = hasherByType.hex(code); + const debugId = [ + hash.slice(0, 8), + hash.slice(8, 12), + '4' + hash.slice(12, 15), + ((parseInt(hash.slice(15, 16), 16) & 3) | 8).toString(16) + hash.slice(17, 20), + hash.slice(20, 32) + ].join('-'); + map.debugId = debugId; + return '//# debugId=' + debugId + '\n'; +} + +class Bundle { + constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) { + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.inputOptions = inputOptions; + this.pluginDriver = pluginDriver; + this.graph = graph; + this.facadeChunkByModule = new Map(); + this.includedNamespaces = new Set(); + } + async generate(isWrite) { + timeStart('GENERATE', 1); + const outputBundleBase = Object.create(null); + const outputBundle = getOutputBundle(outputBundleBase); + this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions); + try { + timeStart('initialize render', 2); + await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]); + timeEnd('initialize render', 2); + timeStart('generate chunks', 2); + const getHashPlaceholder = getHashPlaceholderGenerator(); + const chunks = await this.generateChunks(outputBundle, getHashPlaceholder); + if (chunks.length > 1) { + validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onLog); + } + this.pluginDriver.setChunkInformation(this.facadeChunkByModule); + for (const chunk of chunks) { + chunk.generateExports(); + } + timeEnd('generate chunks', 2); + await renderChunks(chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog); + } + catch (error_) { + await this.pluginDriver.hookParallel('renderError', [error_]); + throw error_; + } + removeUnreferencedAssets(outputBundle); + timeStart('generate bundle', 2); + await this.pluginDriver.hookSeq('generateBundle', [ + this.outputOptions, + outputBundle, + isWrite + ]); + this.finaliseAssets(outputBundle); + timeEnd('generate bundle', 2); + timeEnd('GENERATE', 1); + return outputBundleBase; + } + async addManualChunks(manualChunks) { + const manualChunkAliasByEntry = new Map(); + const chunkEntries = await Promise.all(Object.entries(manualChunks).map(async ([alias, files]) => ({ + alias, + entries: await this.graph.moduleLoader.addAdditionalModules(files, true) + }))); + for (const { alias, entries } of chunkEntries) { + for (const entry of entries) { + addModuleToManualChunk(alias, entry, manualChunkAliasByEntry); + } + } + return manualChunkAliasByEntry; + } + assignManualChunks(getManualChunk) { + const manualChunkAliasesWithEntry = []; + const manualChunksApi = { + getModuleIds: () => this.graph.modulesById.keys(), + getModuleInfo: this.graph.getModuleInfo + }; + for (const module of this.graph.modulesById.values()) { + if (module instanceof Module) { + const manualChunkAlias = getManualChunk(module.id, manualChunksApi); + if (typeof manualChunkAlias === 'string') { + manualChunkAliasesWithEntry.push([manualChunkAlias, module]); + } + } + } + manualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) => aliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0); + const manualChunkAliasByEntry = new Map(); + for (const [alias, module] of manualChunkAliasesWithEntry) { + addModuleToManualChunk(alias, module, manualChunkAliasByEntry); + } + return manualChunkAliasByEntry; + } + finaliseAssets(bundle) { + if (this.outputOptions.validate) { + for (const file of Object.values(bundle)) { + if ('code' in file) { + try { + parseAst(file.code, { jsx: this.inputOptions.jsx !== false }); + } + catch (error_) { + this.inputOptions.onLog(LOGLEVEL_WARN, logChunkInvalid(file, error_)); + } + } + } + } + this.pluginDriver.finaliseAssets(); + } + async generateChunks(bundle, getHashPlaceholder) { + const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions; + const manualChunkAliasByEntry = typeof manualChunks === 'object' + ? await this.addManualChunks(manualChunks) + : this.assignManualChunks(manualChunks); + const snippets = getGenerateCodeSnippets(this.outputOptions); + const includedModules = getIncludedModules(this.graph.modulesById); + const inputBase = commondir(getAbsoluteEntryModulePaths(includedModules, preserveModules)); + const externalChunkByModule = getExternalChunkByModule(this.graph.modulesById, this.outputOptions, inputBase); + const executableModule = inlineDynamicImports + ? [{ alias: null, modules: includedModules }] + : preserveModules + ? includedModules.map(module => ({ alias: null, modules: [module] })) + : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog); + const chunks = new Array(executableModule.length); + const chunkByModule = new Map(); + let index = 0; + for (const { alias, modules } of executableModule) { + sortByExecutionOrder(modules); + const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets); + chunks[index++] = chunk; + } + for (const chunk of chunks) { + chunk.link(); + } + const facades = []; + for (const chunk of chunks) { + facades.push(...chunk.generateFacades()); + } + return [...chunks, ...facades]; + } +} +function validateOptionsForMultiChunkOutput(outputOptions, log) { + if (outputOptions.format === 'umd' || outputOptions.format === 'iife') + return error(logInvalidOption('output.format', URL_OUTPUT_FORMAT, 'UMD and IIFE output formats are not supported for code-splitting builds', outputOptions.format)); + if (typeof outputOptions.file === 'string') + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option')); + if (outputOptions.sourcemapFile) + return error(logInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds')); + if (!outputOptions.amd.autoId && outputOptions.amd.id) + log(LOGLEVEL_WARN, logInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead')); +} +function getIncludedModules(modulesById) { + const includedModules = []; + for (const module of modulesById.values()) { + if (module instanceof Module && + (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)) { + includedModules.push(module); + } + } + return includedModules; +} +function getAbsoluteEntryModulePaths(includedModules, preserveModules) { + const absoluteEntryModulePaths = []; + for (const module of includedModules) { + if ((module.info.isEntry || preserveModules) && isAbsolute$1(module.id)) { + absoluteEntryModulePaths.push(module.id); + } + } + return absoluteEntryModulePaths; +} +function getExternalChunkByModule(modulesById, outputOptions, inputBase) { + const externalChunkByModule = new Map(); + for (const module of modulesById.values()) { + if (module instanceof ExternalModule) { + externalChunkByModule.set(module, new ExternalChunk(module, outputOptions, inputBase)); + } + } + return externalChunkByModule; +} +function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) { + const existingAlias = manualChunkAliasByEntry.get(module); + if (typeof existingAlias === 'string' && existingAlias !== alias) { + return error(logCannotAssignModuleToChunk(module.id, alias, existingAlias)); + } + manualChunkAliasByEntry.set(module, alias); +} + +function flru (max) { + var num, curr, prev; + var limit = max; + + function keep(key, value) { + if (++num > limit) { + prev = curr; + reset(1); + ++num; + } + curr[key] = value; + } + + function reset(isPartial) { + num = 0; + curr = Object.create(null); + isPartial || (prev=Object.create(null)); + } + + reset(); + + return { + clear: reset, + has: function (key) { + return curr[key] !== void 0 || prev[key] !== void 0; + }, + get: function (key) { + var val = curr[key]; + if (val !== void 0) return val; + if ((val=prev[key]) !== void 0) { + keep(key, val); + return val; + } + }, + set: function (key, value) { + if (curr[key] !== void 0) { + curr[key] = value; + } else { + keep(key, value); + } + } + }; +} + +class GlobalScope extends Scope { + constructor() { + super(); + this.parent = null; + this.variables.set('undefined', new UndefinedVariable()); + } + findVariable(name) { + let variable = this.variables.get(name); + if (!variable) { + variable = new GlobalVariable(name); + this.variables.set(name, variable); + } + return variable; + } +} + +function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + let skipped = null; + let replaceContext = null; + if (skip) { + skipped = new Set(); + for (const skippedCall of skip) { + if (source === skippedCall.source && importer === skippedCall.importer) { + skipped.add(skippedCall.plugin); + } + } + replaceContext = (pluginContext, plugin) => ({ + ...pluginContext, + resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => { + skipSelf ??= true; + return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip); + } + }); + } + return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped); +} + +async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes); + if (pluginResult != null) { + const [resolveIdResult, plugin] = pluginResult; + if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) { + return { + ...resolveIdResult, + resolvedBy: plugin.name + }; + } + if (typeof resolveIdResult === 'string') { + return { + id: resolveIdResult, + resolvedBy: plugin.name + }; + } + return resolveIdResult; + } + // external modules (non-entry modules that start with neither '.' or '/') + // are skipped at this stage. + if (importer !== undefined && !isAbsolute$1(source) && source[0] !== '.') + return null; + // `resolve` processes paths from right to left, prepending them until an + // absolute path is created. Absolute importees therefore shortcircuit the + // resolve call and require no special handing on our part. + // See https://nodejs.org/api/path.html#path_path_resolve_paths + return addJsExtensionIfNecessary(importer ? resolve$1(dirname(importer), source) : resolve$1(source), preserveSymlinks); +} +async function addJsExtensionIfNecessary(file, preserveSymlinks) { + return ((await findFile(file, preserveSymlinks)) ?? + (await findFile(file + '.mjs', preserveSymlinks)) ?? + (await findFile(file + '.js', preserveSymlinks))); +} +async function findFile(file, preserveSymlinks) { + try { + const stats = await lstat(file); + if (!preserveSymlinks && stats.isSymbolicLink()) + return await findFile(await realpath(file), preserveSymlinks); + if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) { + // check case + const name = basename(file); + const files = await readdir(dirname(file)); + if (files.includes(name)) + return file; + } + } + catch { + // suppress + } +} + +const ANONYMOUS_PLUGIN_PREFIX = 'at position '; +const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position '; + +function createPluginCache(cache) { + return { + delete(id) { + return delete cache[id]; + }, + get(id) { + const item = cache[id]; + if (!item) + return; + item[0] = 0; + return item[1]; + }, + has(id) { + const item = cache[id]; + if (!item) + return false; + item[0] = 0; + return true; + }, + set(id, value) { + cache[id] = [0, value]; + } + }; +} +function getTrackedPluginCache(pluginCache, onUse) { + return { + delete(id) { + onUse(); + return pluginCache.delete(id); + }, + get(id) { + onUse(); + return pluginCache.get(id); + }, + has(id) { + onUse(); + return pluginCache.has(id); + }, + set(id, value) { + onUse(); + return pluginCache.set(id, value); + } + }; +} +const NO_CACHE = { + delete() { + return false; + }, + get() { + return undefined; + }, + has() { + return false; + }, + set() { } +}; +function uncacheablePluginError(pluginName) { + if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) { + return error(logAnonymousPluginCache()); + } + return error(logDuplicatePluginName(pluginName)); +} +function getCacheForUncacheablePlugin(pluginName) { + return { + delete() { + return uncacheablePluginError(pluginName); + }, + get() { + return uncacheablePluginError(pluginName); + }, + has() { + return uncacheablePluginError(pluginName); + }, + set() { + return uncacheablePluginError(pluginName); + } + }; +} + +async function asyncFlatten(array) { + do { + array = (await Promise.all(array)).flat(Infinity); + } while (array.some((v) => v?.then)); + return array; +} + +const getOnLog = (config, logLevel, printLog = defaultPrintLog) => { + const { onwarn, onLog } = config; + const defaultOnLog = getDefaultOnLog(printLog, onwarn); + if (onLog) { + const minimalPriority = logLevelPriority[logLevel]; + return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => { + if (level === LOGLEVEL_ERROR) { + return error(normalizeLog(handledLog)); + } + if (logLevelPriority[level] >= minimalPriority) { + defaultOnLog(level, normalizeLog(handledLog)); + } + }); + } + return defaultOnLog; +}; +const getDefaultOnLog = (printLog, onwarn) => onwarn + ? (level, log) => { + if (level === LOGLEVEL_WARN) { + onwarn(addLogToString(log), warning => printLog(LOGLEVEL_WARN, normalizeLog(warning))); + } + else { + printLog(level, log); + } + } + : printLog; +const addLogToString = (log) => { + Object.defineProperty(log, 'toString', { + value: () => log.message, + writable: true + }); + return log; +}; +const normalizeLog = (log) => typeof log === 'string' + ? { message: log } + : typeof log === 'function' + ? normalizeLog(log()) + : log; +const defaultPrintLog = (level, { message }) => { + switch (level) { + case LOGLEVEL_WARN: { + return console.warn(message); + } + case LOGLEVEL_DEBUG: { + return console.debug(message); + } + default: { + return console.info(message); + } + } +}; +function warnUnknownOptions(passedOptions, validOptions, optionType, log, ignoredKeys = /$./) { + const validOptionSet = new Set(validOptions); + const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key))); + if (unknownOptions.length > 0) { + log(LOGLEVEL_WARN, logUnknownOption(optionType, unknownOptions, [...validOptionSet].sort())); + } +} +const treeshakePresets = { + recommended: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: false + }, + safest: { + annotations: true, + correctVarValueBeforeDeclaration: true, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: true + }, + smallest: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => false, + propertyReadSideEffects: false, + tryCatchDeoptimization: false, + unknownGlobalSideEffects: false + } +}; +const jsxPresets = { + preserve: { + factory: null, + fragment: null, + importSource: null, + mode: 'preserve' + }, + 'preserve-react': { + factory: 'React.createElement', + fragment: 'React.Fragment', + importSource: 'react', + mode: 'preserve' + }, + react: { + factory: 'React.createElement', + fragment: 'React.Fragment', + importSource: 'react', + mode: 'classic' + }, + 'react-jsx': { + factory: 'React.createElement', + importSource: 'react', + jsxImportSource: 'react/jsx-runtime', + mode: 'automatic' + } +}; +const generatedCodePresets = { + es2015: { + arrowFunctions: true, + constBindings: true, + objectShorthand: true, + reservedNamesAsProps: true, + symbols: true + }, + es5: { + arrowFunctions: false, + constBindings: false, + objectShorthand: false, + reservedNamesAsProps: true, + symbols: false + } +}; +const objectifyOption = (value) => value && typeof value === 'object' ? value : {}; +const objectifyOptionWithPresets = (presets, optionName, urlSnippet, additionalValues) => (value) => { + if (typeof value === 'string') { + const preset = presets[value]; + if (preset) { + return preset; + } + error(logInvalidOption(optionName, urlSnippet, `valid values are ${additionalValues}${printQuotedStringList(Object.keys(presets))}. You can also supply an object for more fine-grained control`, value)); + } + return objectifyOption(value); +}; +const getOptionWithPreset = (value, presets, optionName, urlSnippet, additionalValues) => { + const presetName = value?.preset; + if (presetName) { + const preset = presets[presetName]; + if (preset) { + return { ...preset, ...value }; + } + else { + error(logInvalidOption(`${optionName}.preset`, urlSnippet, `valid values are ${printQuotedStringList(Object.keys(presets))}`, presetName)); + } + } + return objectifyOptionWithPresets(presets, optionName, urlSnippet, additionalValues)(value); +}; +const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean); + +async function transform(source, module, pluginDriver, log) { + const id = module.id; + const sourcemapChain = []; + let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map); + const originalCode = source.code; + let ast = source.ast; + const transformDependencies = []; + const emittedFiles = []; + let customTransformCache = false; + const useCustomTransformCache = () => (customTransformCache = true); + let pluginName = ''; + let currentSource = source.code; + function transformReducer(previousCode, result, plugin) { + let code; + let map; + if (typeof result === 'string') { + code = result; + } + else if (result && typeof result === 'object') { + module.updateOptions(result); + if (result.code == null) { + if (result.map || result.ast) { + log(LOGLEVEL_WARN, logNoTransformMapOrAstWithoutCode(plugin.name)); + } + return previousCode; + } + ({ code, map, ast } = result); + } + else { + return previousCode; + } + // strict null check allows 'null' maps to not be pushed to the chain, + // while 'undefined' gets the missing map warning + if (map !== null) { + sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || { + missing: true, + plugin: plugin.name + }); + } + currentSource = code; + return code; + } + const getLogHandler = (handler) => (log, pos) => { + log = normalizeLog(log); + if (pos) + augmentCodeLocation(log, pos, currentSource, id); + log.id = id; + log.hook = 'transform'; + handler(log); + }; + let code; + try { + code = await pluginDriver.hookReduceArg0('transform', [currentSource, id], transformReducer, (pluginContext, plugin) => { + pluginName = plugin.name; + return { + ...pluginContext, + addWatchFile(id) { + transformDependencies.push(id); + pluginContext.addWatchFile(id); + }, + cache: customTransformCache + ? pluginContext.cache + : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), + debug: getLogHandler(pluginContext.debug), + emitFile(emittedFile) { + emittedFiles.push(emittedFile); + return pluginDriver.emitFile(emittedFile); + }, + error(error_, pos) { + if (typeof error_ === 'string') + error_ = { message: error_ }; + if (pos) + augmentCodeLocation(error_, pos, currentSource, id); + error_.id = id; + error_.hook = 'transform'; + return pluginContext.error(error_); + }, + getCombinedSourcemap() { + const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log); + if (!combinedMap) { + const magicString = new MagicString(originalCode); + return magicString.generateMap({ hires: true, includeContent: true, source: id }); + } + if (originalSourcemap !== combinedMap) { + originalSourcemap = combinedMap; + sourcemapChain.length = 0; + } + return new SourceMap({ + ...combinedMap, + file: null, + sourcesContent: combinedMap.sourcesContent + }); + }, + info: getLogHandler(pluginContext.info), + setAssetSource() { + return this.error(logInvalidSetAssetSourceCall()); + }, + warn: getLogHandler(pluginContext.warn) + }; + }); + } + catch (error_) { + return error(logPluginError(error_, pluginName, { hook: 'transform', id })); + } + if (!customTransformCache && // files emitted by a transform hook need to be emitted again if the hook is skipped + emittedFiles.length > 0) + module.transformFiles = emittedFiles; + return { + ast, + code, + customTransformCache, + originalCode, + originalSourcemap, + sourcemapChain, + transformDependencies + }; +} + +const RESOLVE_DEPENDENCIES = 'resolveDependencies'; +class ModuleLoader { + constructor(graph, modulesById, options, pluginDriver) { + this.graph = graph; + this.modulesById = modulesById; + this.options = options; + this.pluginDriver = pluginDriver; + this.implicitEntryModules = new Set(); + this.indexedEntryModules = []; + this.latestLoadModulesPromise = Promise.resolve(); + this.moduleLoadPromises = new Map(); + this.modulesWithLoadedDependencies = new Set(); + this.nextChunkNamePriority = 0; + this.nextEntryModuleIndex = 0; + this.resolveId = async (source, importer, customOptions, isEntry, attributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false) + ? false + : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes), importer, source), attributes); + this.hasModuleSideEffects = options.treeshake + ? options.treeshake.moduleSideEffects + : () => true; + } + async addAdditionalModules(unresolvedModules, isAddForManualChunks) { + const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks)))); + await this.awaitLoadModulesPromise(); + return result; + } + async addEntryModules(unresolvedEntryModules, isUserDefined) { + const firstEntryModuleIndex = this.nextEntryModuleIndex; + this.nextEntryModuleIndex += unresolvedEntryModules.length; + const firstChunkNamePriority = this.nextChunkNamePriority; + this.nextChunkNamePriority += unresolvedEntryModules.length; + const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => { + for (const [index, entryModule] of entryModules.entries()) { + entryModule.isUserDefinedEntryPoint = + entryModule.isUserDefinedEntryPoint || isUserDefined; + addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined, firstChunkNamePriority + index); + const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule); + if (existingIndexedModule) { + existingIndexedModule.index = Math.min(existingIndexedModule.index, firstEntryModuleIndex + index); + } + else { + this.indexedEntryModules.push({ + index: firstEntryModuleIndex + index, + module: entryModule + }); + } + } + this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1); + return entryModules; + })); + await this.awaitLoadModulesPromise(); + return { + entryModules: this.indexedEntryModules.map(({ module }) => module), + implicitEntryModules: [...this.implicitEntryModules], + newEntryModules + }; + } + async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) { + const unresolvedModule = { + fileName: fileName || null, + id, + importer, + name: name || null + }; + const module = implicitlyLoadedAfterOneOf + ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf) + : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0]; + if (preserveSignature != null) { + module.preserveSignature = preserveSignature; + } + return module; + } + async preloadModule(resolvedId) { + const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId, EMPTY_OBJECT), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true); + return module.info; + } + addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) { + const chunkNamePriority = this.nextChunkNamePriority++; + return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => { + addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority); + if (!entryModule.info.isEntry) { + const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id))); + // We need to check again if this is still an entry module as these + // changes need to be performed atomically to avoid race conditions + // if the same module is re-emitted as an entry module. + // The inverse changes happen in "handleExistingModule" + if (!entryModule.info.isEntry) { + this.implicitEntryModules.add(entryModule); + for (const module of implicitlyLoadedAfterModules) { + entryModule.implicitlyLoadedAfter.add(module); + } + for (const dependant of entryModule.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.add(entryModule); + } + } + } + return entryModule; + })); + } + async addModuleSource(id, importer, module) { + let source; + try { + source = await this.graph.fileOperationQueue.run(async () => { + const content = await this.pluginDriver.hookFirst('load', [id]); + if (content !== null) + return content; + this.graph.watchFiles[id] = true; + return await readFile(id, 'utf8'); + }); + } + catch (error_) { + let message = `Could not load ${id}`; + if (importer) + message += ` (imported by ${relativeId(importer)})`; + message += `: ${error_.message}`; + error_.message = message; + throw error_; + } + const sourceDescription = typeof source === 'string' + ? { code: source } + : source != null && typeof source === 'object' && typeof source.code === 'string' + ? source + : error(logBadLoader(id)); + const code = sourceDescription.code; + if (code.charCodeAt(0) === 0xfe_ff) { + sourceDescription.code = code.slice(1); + } + const cachedModule = this.graph.cachedModules.get(id); + if (cachedModule && + !cachedModule.customTransformCache && + cachedModule.originalCode === sourceDescription.code && + !(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [ + { + ast: cachedModule.ast, + code: cachedModule.code, + id: cachedModule.id, + meta: cachedModule.meta, + moduleSideEffects: cachedModule.moduleSideEffects, + resolvedSources: cachedModule.resolvedIds, + syntheticNamedExports: cachedModule.syntheticNamedExports + } + ]))) { + if (cachedModule.transformFiles) { + for (const emittedFile of cachedModule.transformFiles) + this.pluginDriver.emitFile(emittedFile); + } + await module.setSource(cachedModule); + } + else { + module.updateOptions(sourceDescription); + await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onLog)); + } + } + async awaitLoadModulesPromise() { + let startingPromise; + do { + startingPromise = this.latestLoadModulesPromise; + await startingPromise; + } while (startingPromise !== this.latestLoadModulesPromise); + } + extendLoadModulesPromise(loadNewModulesPromise) { + this.latestLoadModulesPromise = Promise.all([ + loadNewModulesPromise, + this.latestLoadModulesPromise + ]); + this.latestLoadModulesPromise.catch(() => { + /* Avoid unhandled Promise rejections */ + }); + return loadNewModulesPromise; + } + async fetchDynamicDependencies(module, resolveDynamicImportPromises) { + const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => { + if (resolvedId === null) + return null; + if (typeof resolvedId === 'string') { + dynamicImport.resolution = resolvedId; + return null; + } + return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId)); + }))); + for (const dependency of dependencies) { + if (dependency) { + module.dynamicDependencies.add(dependency); + dependency.dynamicImporters.push(module.id); + } + } + } + // If this is a preload, then this method always waits for the dependencies of + // the module to be resolved. + // Otherwise, if the module does not exist, it waits for the module and all + // its dependencies to be loaded. + // Otherwise, it returns immediately. + async fetchModule({ attributes, id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry, isPreload) { + const existingModule = this.modulesById.get(id); + if (existingModule instanceof Module) { + if (importer && doAttributesDiffer(attributes, existingModule.info.attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(existingModule.info.attributes, attributes, id, importer)); + } + await this.handleExistingModule(existingModule, isEntry, isPreload); + return existingModule; + } + if (existingModule instanceof ExternalModule) { + return error(logExternalModulesCannotBeTransformedToModules(existingModule.id)); + } + const module = new Module(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes); + this.modulesById.set(id, module); + const loadPromise = this.addModuleSource(id, importer, module).then(() => [ + this.getResolveStaticDependencyPromises(module), + this.getResolveDynamicImportPromises(module), + loadAndResolveDependenciesPromise + ]); + const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info])); + loadAndResolveDependenciesPromise.catch(() => { + /* avoid unhandled promise rejections */ + }); + this.moduleLoadPromises.set(module, loadPromise); + const resolveDependencyPromises = await loadPromise; + if (!isPreload) { + await this.fetchModuleDependencies(module, ...resolveDependencyPromises); + } + else if (isPreload === RESOLVE_DEPENDENCIES) { + await loadAndResolveDependenciesPromise; + } + return module; + } + async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) { + if (this.modulesWithLoadedDependencies.has(module)) { + return; + } + this.modulesWithLoadedDependencies.add(module); + await Promise.all([ + this.fetchStaticDependencies(module, resolveStaticDependencyPromises), + this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises) + ]); + module.linkImports(); + // To handle errors when resolving dependencies or in moduleParsed + await loadAndResolveDependenciesPromise; + } + fetchResolvedDependency(source, importer, resolvedId) { + if (resolvedId.external) { + const { attributes, external, id, moduleSideEffects, meta } = resolvedId; + let externalModule = this.modulesById.get(id); + if (!externalModule) { + externalModule = new ExternalModule(this.options, id, moduleSideEffects, meta, external !== 'absolute' && isAbsolute$1(id), attributes); + this.modulesById.set(id, externalModule); + } + else if (!(externalModule instanceof ExternalModule)) { + return error(logInternalIdCannotBeExternal(source, importer)); + } + else if (doAttributesDiffer(externalModule.info.attributes, attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(externalModule.info.attributes, attributes, source, importer)); + } + return Promise.resolve(externalModule); + } + return this.fetchModule(resolvedId, importer, false, false); + } + async fetchStaticDependencies(module, resolveStaticDependencyPromises) { + for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) { + module.dependencies.add(dependency); + dependency.importers.push(module.id); + } + if (!this.options.treeshake || module.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of module.dependencies) { + if (dependency instanceof Module) { + dependency.importedFromNotTreeshaken = true; + } + } + } + } + getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) { + const { makeAbsoluteExternalsRelative } = this.options; + if (resolveIdResult) { + if (typeof resolveIdResult === 'object') { + const external = resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true); + return { + ...resolveIdResult, + external: external && + (external === 'relative' || + !isAbsolute$1(resolveIdResult.id) || + (external === true && + isNotAbsoluteExternal(resolveIdResult.id, source, makeAbsoluteExternalsRelative)) || + 'absolute') + }; + } + const external = this.options.external(resolveIdResult, importer, true); + return { + external: external && + (isNotAbsoluteExternal(resolveIdResult, source, makeAbsoluteExternalsRelative) || + 'absolute'), + id: external && makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(resolveIdResult, importer) + : resolveIdResult + }; + } + const id = makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(source, importer) + : source; + if (resolveIdResult !== false && !this.options.external(id, importer, true)) { + return null; + } + return { + external: isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) || 'absolute', + id + }; + } + getResolveDynamicImportPromises(module) { + return module.dynamicImports.map(async (dynamicImport) => { + const resolvedId = await this.resolveDynamicImport(module, dynamicImport.argument, module.id, getAttributesFromImportExpression(dynamicImport.node)); + if (resolvedId && typeof resolvedId === 'object') { + dynamicImport.id = resolvedId.id; + } + return [dynamicImport, resolvedId]; + }); + } + getResolveStaticDependencyPromises(module) { + return Array.from(module.sourcesWithAttributes, async ([source, attributes]) => [ + source, + (module.resolvedIds[source] = + module.resolvedIds[source] || + this.handleInvalidResolvedId(await this.resolveId(source, module.id, EMPTY_OBJECT, false, attributes), source, module.id, attributes)) + ]); + } + getResolvedIdWithDefaults(resolvedId, attributes) { + if (!resolvedId) { + return null; + } + const external = resolvedId.external || false; + return { + attributes: resolvedId.attributes || attributes, + external, + id: resolvedId.id, + meta: resolvedId.meta || {}, + moduleSideEffects: resolvedId.moduleSideEffects ?? this.hasModuleSideEffects(resolvedId.id, !!external), + resolvedBy: resolvedId.resolvedBy ?? 'rollup', + syntheticNamedExports: resolvedId.syntheticNamedExports ?? false + }; + } + async handleExistingModule(module, isEntry, isPreload) { + const loadPromise = this.moduleLoadPromises.get(module); + if (isPreload) { + return isPreload === RESOLVE_DEPENDENCIES + ? waitForDependencyResolution(loadPromise) + : loadPromise; + } + if (isEntry) { + // This reverts the changes in addEntryWithImplicitDependants and needs to + // be performed atomically + module.info.isEntry = true; + this.implicitEntryModules.delete(module); + for (const dependant of module.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.delete(module); + } + module.implicitlyLoadedAfter.clear(); + } + return this.fetchModuleDependencies(module, ...(await loadPromise)); + } + handleInvalidResolvedId(resolvedId, source, importer, attributes) { + if (resolvedId === null) { + if (isRelative(source)) { + return error(logUnresolvedImport(source, importer)); + } + this.options.onLog(LOGLEVEL_WARN, logUnresolvedImportTreatedAsExternal(source, importer)); + return { + attributes, + external: true, + id: source, + meta: {}, + moduleSideEffects: this.hasModuleSideEffects(source, true), + resolvedBy: 'rollup', + syntheticNamedExports: false + }; + } + else if (resolvedId.external && resolvedId.syntheticNamedExports) { + this.options.onLog(LOGLEVEL_WARN, logExternalSyntheticExports(source, importer)); + } + return resolvedId; + } + async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false) { + const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true, EMPTY_OBJECT); + if (resolveIdResult == null) { + return error(implicitlyLoadedBefore === null + ? logUnresolvedEntry(unresolvedId) + : logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)); + } + const isExternalModules = typeof resolveIdResult === 'object' && resolveIdResult.external; + if (resolveIdResult === false || isExternalModules) { + return error(implicitlyLoadedBefore === null + ? isExternalModules && isLoadForManualChunks + ? logExternalModulesCannotBeIncludedInManualChunks(unresolvedId) + : logEntryCannotBeExternal(unresolvedId) + : logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore)); + } + return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object' + ? resolveIdResult + : { id: resolveIdResult }, EMPTY_OBJECT), undefined, isEntry, false); + } + async resolveDynamicImport(module, specifier, importer, attributes) { + const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ + specifier, + importer, + { attributes } + ]); + if (typeof specifier !== 'string') { + if (typeof resolution === 'string') { + return resolution; + } + if (!resolution) { + return null; + } + return this.getResolvedIdWithDefaults(resolution, attributes); + } + if (resolution == null) { + const existingResolution = module.resolvedIds[specifier]; + if (existingResolution) { + if (doAttributesDiffer(existingResolution.attributes, attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(existingResolution.attributes, attributes, specifier, importer)); + } + return existingResolution; + } + return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, attributes), specifier, module.id, attributes)); + } + return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), attributes), specifier, importer, attributes); + } +} +function normalizeRelativeExternalId(source, importer) { + return isRelative(source) + ? importer + ? resolve$1(importer, '..', source) + : resolve$1(source) + : source; +} +function addChunkNamesToModule(module, { fileName, name }, isUserDefined, priority) { + if (fileName !== null) { + module.chunkFileNames.add(fileName); + } + else if (name !== null) { + // Always keep chunkNames sorted by priority + let namePosition = 0; + while (module.chunkNames[namePosition]?.priority < priority) + namePosition++; + module.chunkNames.splice(namePosition, 0, { isUserDefined, name, priority }); + } +} +function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) { + return (makeAbsoluteExternalsRelative === true || + (makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) || + !isAbsolute$1(id)); +} +async function waitForDependencyResolution(loadPromise) { + const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise; + return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]); +} + +function generateAssetFileName(name, names, source, originalFileName, originalFileNames, sourceHash, outputOptions, bundle, inputOptions) { + const emittedName = outputOptions.sanitizeFileName(name || 'asset'); + return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function' + ? outputOptions.assetFileNames({ + // Additionally, this should be non-enumerable in the next major + get name() { + warnDeprecation('Accessing the "name" property of emitted assets when generating the file name is deprecated. Use the "names" property instead.', URL_GENERATEBUNDLE, false, inputOptions); + return name; + }, + names, + // Additionally, this should be non-enumerable in the next major + get originalFileName() { + warnDeprecation('Accessing the "originalFileName" property of emitted assets when generating the file name is deprecated. Use the "originalFileNames" property instead.', URL_GENERATEBUNDLE, false, inputOptions); + return originalFileName; + }, + originalFileNames, + source, + type: 'asset' + }) + : outputOptions.assetFileNames, 'output.assetFileNames', { + ext: () => extname(emittedName).slice(1), + extname: () => extname(emittedName), + hash: size => sourceHash.slice(0, Math.max(0, size || DEFAULT_HASH_SIZE)), + name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname(emittedName).length)) + }), bundle); +} +function reserveFileNameInBundle(fileName, { bundle }, log) { + if (bundle[lowercaseBundleKeys].has(fileName.toLowerCase())) { + log(LOGLEVEL_WARN, logFileNameConflict(fileName)); + } + else { + bundle[fileName] = FILE_PLACEHOLDER; + } +} +const emittedFileTypes = new Set(['chunk', 'asset', 'prebuilt-chunk']); +function hasValidType(emittedFile) { + return Boolean(emittedFile && + emittedFileTypes.has(emittedFile.type)); +} +function hasValidName(emittedFile) { + const validatedName = emittedFile.fileName || emittedFile.name; + return !validatedName || (typeof validatedName === 'string' && !isPathFragment(validatedName)); +} +function getValidSource(source, emittedFile, fileReferenceId) { + if (!(typeof source === 'string' || source instanceof Uint8Array)) { + const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; + return error(logFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`)); + } + return source; +} +function getAssetFileName(file, referenceId) { + if (typeof file.fileName !== 'string') { + return error(logAssetNotFinalisedForFileName(file.name || referenceId)); + } + return file.fileName; +} +function getChunkFileName(file, facadeChunkByModule) { + if (file.fileName) { + return file.fileName; + } + if (facadeChunkByModule) { + return facadeChunkByModule.get(file.module).getFileName(); + } + return error(logChunkNotGeneratedForFileName(file.fileName || file.name)); +} +class FileEmitter { + constructor(graph, options, baseFileEmitter) { + this.graph = graph; + this.options = options; + this.facadeChunkByModule = null; + this.nextIdBase = 1; + this.output = null; + this.outputFileEmitters = []; + this.emitFile = (emittedFile) => { + if (!hasValidType(emittedFile)) { + return error(logFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${emittedFile && emittedFile.type}".`)); + } + if (emittedFile.type === 'prebuilt-chunk') { + return this.emitPrebuiltChunk(emittedFile); + } + if (!hasValidName(emittedFile)) { + return error(logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`)); + } + if (emittedFile.type === 'chunk') { + return this.emitChunk(emittedFile); + } + return this.emitAsset(emittedFile); + }; + this.finaliseAssets = () => { + for (const [referenceId, emittedFile] of this.filesByReferenceId) { + if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') + return error(logNoAssetSourceSet(emittedFile.name || referenceId)); + } + }; + this.getFileName = (fileReferenceId) => { + const emittedFile = this.filesByReferenceId.get(fileReferenceId); + if (!emittedFile) + return error(logFileReferenceIdNotFoundForFilename(fileReferenceId)); + if (emittedFile.type === 'chunk') { + return getChunkFileName(emittedFile, this.facadeChunkByModule); + } + if (emittedFile.type === 'prebuilt-chunk') { + return emittedFile.fileName; + } + return getAssetFileName(emittedFile, fileReferenceId); + }; + this.setAssetSource = (referenceId, requestedSource) => { + const consumedFile = this.filesByReferenceId.get(referenceId); + if (!consumedFile) + return error(logAssetReferenceIdNotFoundForSetSource(referenceId)); + if (consumedFile.type !== 'asset') { + return error(logFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`)); + } + if (consumedFile.source !== undefined) { + return error(logAssetSourceAlreadySet(consumedFile.name || referenceId)); + } + const source = getValidSource(requestedSource, consumedFile, referenceId); + if (this.output) { + this.finalizeAdditionalAsset(consumedFile, source, this.output); + } + else { + consumedFile.source = source; + for (const emitter of this.outputFileEmitters) { + emitter.finalizeAdditionalAsset(consumedFile, source, emitter.output); + } + } + }; + this.setChunkInformation = (facadeChunkByModule) => { + this.facadeChunkByModule = facadeChunkByModule; + }; + this.setOutputBundle = (bundle, outputOptions) => { + const getHash = hasherByType[outputOptions.hashCharacters]; + const output = (this.output = { + bundle, + fileNamesBySourceHash: new Map(), + getHash, + outputOptions + }); + for (const emittedFile of this.filesByReferenceId.values()) { + if (emittedFile.fileName) { + reserveFileNameInBundle(emittedFile.fileName, output, this.options.onLog); + } + } + const consumedAssetsByHash = new Map(); + for (const consumedFile of this.filesByReferenceId.values()) { + if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { + if (consumedFile.fileName) { + this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output); + } + else { + const sourceHash = getHash(consumedFile.source); + getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile); + } + } + else if (consumedFile.type === 'prebuilt-chunk') { + this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile); + } + } + for (const [sourceHash, consumedFiles] of consumedAssetsByHash) { + this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output); + } + }; + this.filesByReferenceId = baseFileEmitter + ? new Map(baseFileEmitter.filesByReferenceId) + : new Map(); + baseFileEmitter?.addOutputFileEmitter(this); + } + addOutputFileEmitter(outputFileEmitter) { + this.outputFileEmitters.push(outputFileEmitter); + } + assignReferenceId(file, idBase) { + let referenceId = idBase; + do { + referenceId = getHash64(referenceId).slice(0, 8).replaceAll('-', '$'); + } while (this.filesByReferenceId.has(referenceId) || + this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId))); + file.referenceId = referenceId; + this.filesByReferenceId.set(referenceId, file); + for (const { filesByReferenceId } of this.outputFileEmitters) { + filesByReferenceId.set(referenceId, file); + } + return referenceId; + } + createPrebuiltChunk(prebuiltChunk) { + return { + code: prebuiltChunk.code, + dynamicImports: [], + exports: prebuiltChunk.exports || [], + facadeModuleId: null, + fileName: prebuiltChunk.fileName, + implicitlyLoadedBefore: [], + importedBindings: {}, + imports: [], + isDynamicEntry: false, + isEntry: false, + isImplicitEntry: false, + map: prebuiltChunk.map || null, + moduleIds: [], + modules: {}, + name: prebuiltChunk.fileName, + preliminaryFileName: prebuiltChunk.fileName, + referencedFiles: [], + sourcemapFileName: prebuiltChunk.sourcemapFileName || null, + type: 'chunk' + }; + } + emitAsset(emittedAsset) { + const source = emittedAsset.source === undefined + ? undefined + : getValidSource(emittedAsset.source, emittedAsset, null); + const originalFileName = emittedAsset.originalFileName || null; + if (typeof originalFileName === 'string') { + this.graph.watchFiles[originalFileName] = true; + } + const consumedAsset = { + fileName: emittedAsset.fileName, + name: emittedAsset.name, + needsCodeReference: !!emittedAsset.needsCodeReference, + originalFileName, + referenceId: '', + source, + type: 'asset' + }; + const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++)); + if (this.output) { + this.emitAssetWithReferenceId(consumedAsset, this.output); + } + else { + for (const fileEmitter of this.outputFileEmitters) { + fileEmitter.emitAssetWithReferenceId(consumedAsset, fileEmitter.output); + } + } + return referenceId; + } + emitAssetWithReferenceId(consumedAsset, output) { + const { fileName, source } = consumedAsset; + if (fileName) { + reserveFileNameInBundle(fileName, output, this.options.onLog); + } + if (source !== undefined) { + this.finalizeAdditionalAsset(consumedAsset, source, output); + } + } + emitChunk(emittedChunk) { + if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { + return error(logInvalidRollupPhaseForChunkEmission()); + } + if (typeof emittedChunk.id !== 'string') { + return error(logFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`)); + } + const consumedChunk = { + fileName: emittedChunk.fileName, + module: null, + name: emittedChunk.name || emittedChunk.id, + referenceId: '', + type: 'chunk' + }; + this.graph.moduleLoader + .emitChunk(emittedChunk) + .then(module => (consumedChunk.module = module)) + .catch(() => { + // Avoid unhandled Promise rejection as the error will be thrown later + // once module loading has finished + }); + return this.assignReferenceId(consumedChunk, emittedChunk.id); + } + emitPrebuiltChunk(emitPrebuiltChunk) { + if (typeof emitPrebuiltChunk.code !== 'string') { + return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".`)); + } + if (typeof emitPrebuiltChunk.fileName !== 'string' || + isPathFragment(emitPrebuiltChunk.fileName)) { + return error(logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".`)); + } + const consumedPrebuiltChunk = { + code: emitPrebuiltChunk.code, + exports: emitPrebuiltChunk.exports, + fileName: emitPrebuiltChunk.fileName, + map: emitPrebuiltChunk.map, + referenceId: '', + type: 'prebuilt-chunk' + }; + const referenceId = this.assignReferenceId(consumedPrebuiltChunk, consumedPrebuiltChunk.fileName); + if (this.output) { + this.output.bundle[consumedPrebuiltChunk.fileName] = + this.createPrebuiltChunk(consumedPrebuiltChunk); + } + return referenceId; + } + finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySourceHash, getHash, outputOptions }) { + let { fileName, name, needsCodeReference, originalFileName, referenceId } = consumedFile; + // Deduplicate assets if an explicit fileName is not provided + if (!fileName) { + const sourceHash = getHash(source); + fileName = fileNamesBySourceHash.get(sourceHash); + if (!fileName) { + fileName = generateAssetFileName(name, name ? [name] : [], source, originalFileName, originalFileName ? [originalFileName] : [], sourceHash, outputOptions, bundle, this.options); + fileNamesBySourceHash.set(sourceHash, fileName); + } + } + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName, source }; + this.filesByReferenceId.set(referenceId, assetWithFileName); + const existingAsset = bundle[fileName]; + if (existingAsset?.type === 'asset') { + existingAsset.needsCodeReference &&= needsCodeReference; + if (name) { + existingAsset.names.push(name); + } + if (originalFileName) { + existingAsset.originalFileNames.push(originalFileName); + } + } + else { + const { options } = this; + bundle[fileName] = { + fileName, + get name() { + // Additionally, this should be non-enumerable in the next major + warnDeprecation('Accessing the "name" property of emitted assets in the bundle is deprecated. Use the "names" property instead.', URL_GENERATEBUNDLE, false, options); + return name; + }, + names: name ? [name] : [], + needsCodeReference, + get originalFileName() { + // Additionally, this should be non-enumerable in the next major + warnDeprecation('Accessing the "originalFileName" property of emitted assets in the bundle is deprecated. Use the "originalFileNames" property instead.', URL_GENERATEBUNDLE, false, options); + return originalFileName; + }, + originalFileNames: originalFileName ? [originalFileName] : [], + source, + type: 'asset' + }; + } + } + finalizeAssetsWithSameSource(consumedFiles, sourceHash, { bundle, fileNamesBySourceHash, outputOptions }) { + const { names, originalFileNames } = getNamesFromAssets(consumedFiles); + let fileName = ''; + let usedConsumedFile; + let needsCodeReference = true; + for (const consumedFile of consumedFiles) { + needsCodeReference &&= consumedFile.needsCodeReference; + const assetFileName = generateAssetFileName(consumedFile.name, names, consumedFile.source, consumedFile.originalFileName, originalFileNames, sourceHash, outputOptions, bundle, this.options); + if (!fileName || + assetFileName.length < fileName.length || + (assetFileName.length === fileName.length && assetFileName < fileName)) { + fileName = assetFileName; + usedConsumedFile = consumedFile; + } + } + fileNamesBySourceHash.set(sourceHash, fileName); + for (const consumedFile of consumedFiles) { + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName }; + this.filesByReferenceId.set(consumedFile.referenceId, assetWithFileName); + } + const { options } = this; + bundle[fileName] = { + fileName, + get name() { + // Additionally, this should be non-enumerable in the next major + warnDeprecation('Accessing the "name" property of emitted assets in the bundle is deprecated. Use the "names" property instead.', URL_GENERATEBUNDLE, false, options); + return usedConsumedFile.name; + }, + names, + needsCodeReference, + get originalFileName() { + // Additionally, this should be non-enumerable in the next major + warnDeprecation('Accessing the "originalFileName" property of emitted assets in the bundle is deprecated. Use the "originalFileNames" property instead.', URL_GENERATEBUNDLE, false, options); + return usedConsumedFile.originalFileName; + }, + originalFileNames, + source: usedConsumedFile.source, + type: 'asset' + }; + } +} +function getNamesFromAssets(consumedFiles) { + const names = []; + const originalFileNames = []; + for (const { name, originalFileName } of consumedFiles) { + if (typeof name === 'string') { + names.push(name); + } + if (originalFileName) { + originalFileNames.push(originalFileName); + } + } + originalFileNames.sort(); + // Sort by length first and then alphabetically so that the order is stable + // and the shortest names come first + names.sort((a, b) => a.length - b.length || (a > b ? 1 : a === b ? 0 : -1)); + return { names, originalFileNames }; +} + +function getLogHandler(level, code, logger, pluginName, logLevel) { + if (logLevelPriority[level] < logLevelPriority[logLevel]) { + return doNothing; + } + return (log, pos) => { + if (pos != null) { + logger(LOGLEVEL_WARN, logInvalidLogPosition(pluginName)); + } + log = normalizeLog(log); + if (log.code && !log.pluginCode) { + log.pluginCode = log.code; + } + log.code = code; + log.plugin = pluginName; + logger(level, log); + }; +} + +function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) { + const { logLevel, onLog } = options; + let cacheable = true; + if (typeof plugin.cacheKey !== 'string') { + if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || + existingPluginNames.has(plugin.name)) { + cacheable = false; + } + else { + existingPluginNames.add(plugin.name); + } + } + let cacheInstance; + if (!pluginCache) { + cacheInstance = NO_CACHE; + } + else if (cacheable) { + const cacheKey = plugin.cacheKey || plugin.name; + cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null))); + } + else { + cacheInstance = getCacheForUncacheablePlugin(plugin.name); + } + return { + addWatchFile(id) { + graph.watchFiles[id] = true; + }, + cache: cacheInstance, + debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + emitFile: fileEmitter.emitFile.bind(fileEmitter), + error(error_) { + return error(logPluginError(normalizeLog(error_), plugin.name)); + }, + getFileName: fileEmitter.getFileName, + getModuleIds: () => graph.modulesById.keys(), + getModuleInfo: graph.getModuleInfo, + getWatchFiles: () => Object.keys(graph.watchFiles), + info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + load(resolvedId) { + return graph.moduleLoader.preloadModule(resolvedId); + }, + meta: { + rollupVersion: version, + watchMode: graph.watchMode + }, + parse: parseAst, + resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { + skipSelf ??= true; + return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null); + }, + setAssetSource: fileEmitter.setAssetSource, + warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel) + }; +} + +// This will make sure no input hook is omitted +const inputHookNames = { + buildEnd: 1, + buildStart: 1, + closeBundle: 1, + closeWatcher: 1, + load: 1, + moduleParsed: 1, + onLog: 1, + options: 1, + resolveDynamicImport: 1, + resolveId: 1, + shouldTransformCachedModule: 1, + transform: 1, + watchChange: 1 +}; +const inputHooks = Object.keys(inputHookNames); +class PluginDriver { + constructor(graph, options, userPlugins, pluginCache, basePluginDriver) { + this.graph = graph; + this.options = options; + this.pluginCache = pluginCache; + this.sortedPlugins = new Map(); + this.unfulfilledActions = new Set(); + this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter); + this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter); + this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter); + this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter); + this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter); + this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter); + this.plugins = [...(basePluginDriver ? basePluginDriver.plugins : []), ...userPlugins]; + const existingPluginNames = new Set(); + this.pluginContexts = new Map(this.plugins.map(plugin => [ + plugin, + getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames) + ])); + if (basePluginDriver) { + for (const plugin of userPlugins) { + for (const hook of inputHooks) { + if (hook in plugin) { + options.onLog(LOGLEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook)); + } + } + } + } + } + createOutputPluginDriver(plugins) { + return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this); + } + getUnfulfilledHookActions() { + return this.unfulfilledActions; + } + // chains, first non-null result stops and returns + hookFirst(hookName, parameters, replaceContext, skipped) { + return this.hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped).then(result => result && result[0]); + } + // chains, first non-null result stops and returns result and last plugin + async hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped) { + for (const plugin of this.getSortedPlugins(hookName)) { + if (skipped?.has(plugin)) + continue; + const result = await this.runHook(hookName, parameters, plugin, replaceContext); + if (result != null) + return [result, plugin]; + } + return null; + } + // chains synchronously, first non-null result stops and returns + hookFirstSync(hookName, parameters, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + if (result != null) + return result; + } + return null; + } + // parallel, ignores returns + async hookParallel(hookName, parameters, replaceContext) { + const parallelPromises = []; + for (const plugin of this.getSortedPlugins(hookName)) { + if (plugin[hookName].sequential) { + await Promise.all(parallelPromises); + parallelPromises.length = 0; + await this.runHook(hookName, parameters, plugin, replaceContext); + } + else { + parallelPromises.push(this.runHook(hookName, parameters, plugin, replaceContext)); + } + } + await Promise.all(parallelPromises); + } + // chains, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0(hookName, [argument0, ...rest], reduce, replaceContext) { + let promise = Promise.resolve(argument0); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(argument0 => this.runHook(hookName, [argument0, ...rest], plugin, replaceContext).then(result => reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin))); + } + return promise; + } + // chains synchronously, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0Sync(hookName, [argument0, ...rest], reduce, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const parameters = [argument0, ...rest]; + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + argument0 = reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin); + } + return argument0; + } + // chains, reduces returned value to type string, handling the reduced value separately. permits hooks as values. + async hookReduceValue(hookName, initialValue, parameters, reducer) { + const results = []; + const parallelResults = []; + for (const plugin of this.getSortedPlugins(hookName, validateAddonPluginHandler)) { + if (plugin[hookName].sequential) { + results.push(...(await Promise.all(parallelResults))); + parallelResults.length = 0; + results.push(await this.runHook(hookName, parameters, plugin)); + } + else { + parallelResults.push(this.runHook(hookName, parameters, plugin)); + } + } + results.push(...(await Promise.all(parallelResults))); + return results.reduce(reducer, await initialValue); + } + // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values. + hookReduceValueSync(hookName, initialValue, parameters, reduce, replaceContext) { + let accumulator = initialValue; + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + accumulator = reduce.call(this.pluginContexts.get(plugin), accumulator, result, plugin); + } + return accumulator; + } + // chains, ignores returns + hookSeq(hookName, parameters, replaceContext) { + let promise = Promise.resolve(); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(() => this.runHook(hookName, parameters, plugin, replaceContext)); + } + return promise.then(noReturn); + } + getSortedPlugins(hookName, validateHandler) { + return getOrCreate(this.sortedPlugins, hookName, () => getSortedValidatedPlugins(hookName, this.plugins, validateHandler)); + } + // Implementation signature + runHook(hookName, parameters, plugin, replaceContext) { + // We always filter for plugins that support the hook before running it + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + let action = null; + return Promise.resolve() + .then(() => { + if (typeof handler !== 'function') { + return handler; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + const hookResult = handler.apply(context, parameters); + if (!hookResult?.then) { + // short circuit for non-thenables and non-Promises + return hookResult; + } + // Track pending hook actions to properly error out when + // unfulfilled promises cause rollup to abruptly and confusingly + // exit with a successful 0 return code but without producing any + // output, errors or warnings. + action = [plugin.name, hookName, parameters]; + this.unfulfilledActions.add(action); + // Although it would be more elegant to just return hookResult here + // and put the .then() handler just above the .catch() handler below, + // doing so would subtly change the defacto async event dispatch order + // which at least one test and some plugins in the wild may depend on. + return Promise.resolve(hookResult).then(result => { + // action was fulfilled + this.unfulfilledActions.delete(action); + return result; + }); + }) + .catch(error_ => { + if (action !== null) { + // action considered to be fulfilled since error being handled + this.unfulfilledActions.delete(action); + } + return error(logPluginError(error_, plugin.name, { hook: hookName })); + }); + } + /** + * Run a sync plugin hook and return the result. + * @param hookName Name of the plugin hook. Must be in `PluginHooks`. + * @param args Arguments passed to the plugin hook. + * @param plugin The acutal plugin + * @param replaceContext When passed, the plugin context can be overridden. + */ + runHookSync(hookName, parameters, plugin, replaceContext) { + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + return handler.apply(context, parameters); + } + catch (error_) { + return error(logPluginError(error_, plugin.name, { hook: hookName })); + } + } +} +function getSortedValidatedPlugins(hookName, plugins, validateHandler = validateFunctionPluginHandler) { + const pre = []; + const normal = []; + const post = []; + for (const plugin of plugins) { + const hook = plugin[hookName]; + if (hook) { + if (typeof hook === 'object') { + validateHandler(hook.handler, hookName, plugin); + if (hook.order === 'pre') { + pre.push(plugin); + continue; + } + if (hook.order === 'post') { + post.push(plugin); + continue; + } + } + else { + validateHandler(hook, hookName, plugin); + } + normal.push(plugin); + } + } + return [...pre, ...normal, ...post]; +} +function validateFunctionPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'function') { + error(logInvalidFunctionPluginHook(hookName, plugin.name)); + } +} +function validateAddonPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'string' && typeof handler !== 'function') { + return error(logInvalidAddonPluginHook(hookName, plugin.name)); + } +} +function noReturn() { } + +class Queue { + constructor(maxParallel) { + this.maxParallel = maxParallel; + this.queue = []; + this.workerCount = 0; + } + run(task) { + return new Promise((resolve, reject) => { + this.queue.push({ reject, resolve, task }); + this.work(); + }); + } + async work() { + if (this.workerCount >= this.maxParallel) + return; + this.workerCount++; + let entry; + while ((entry = this.queue.shift())) { + const { reject, resolve, task } = entry; + try { + const result = await task(); + resolve(result); + } + catch (error) { + reject(error); + } + } + this.workerCount--; + } +} + +function normalizeEntryModules(entryModules) { + if (Array.isArray(entryModules)) { + return entryModules.map(id => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name: null + })); + } + return Object.entries(entryModules).map(([name, id]) => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name + })); +} +class Graph { + constructor(options, watcher) { + this.options = options; + this.astLru = flru(5); + this.cachedModules = new Map(); + this.deoptimizationTracker = new PathTracker(); + this.entryModules = []; + this.modulesById = new Map(); + this.needsTreeshakingPass = false; + this.phase = BuildPhase.LOAD_AND_PARSE; + this.scope = new GlobalScope(); + this.watchFiles = Object.create(null); + this.watchMode = false; + this.externalModules = []; + this.implicitEntryModules = []; + this.modules = []; + this.getModuleInfo = (moduleId) => { + const foundModule = this.modulesById.get(moduleId); + if (!foundModule) + return null; + return foundModule.info; + }; + if (options.cache !== false) { + if (options.cache?.modules) { + for (const module of options.cache.modules) + this.cachedModules.set(module.id, module); + } + this.pluginCache = options.cache?.plugins || Object.create(null); + // increment access counter + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + for (const value of Object.values(cache)) + value[0]++; + } + } + if (watcher) { + this.watchMode = true; + const handleChange = (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters); + const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []); + watcher.onCurrentRun('change', handleChange); + watcher.onCurrentRun('close', handleClose); + } + this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); + this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); + this.fileOperationQueue = new Queue(options.maxParallelFileOps); + this.pureFunctions = getPureFunctions(options); + } + async build() { + timeStart('generate module graph', 2); + await this.generateModuleGraph(); + timeEnd('generate module graph', 2); + timeStart('sort and bind modules', 2); + this.phase = BuildPhase.ANALYSE; + this.sortModules(); + timeEnd('sort and bind modules', 2); + timeStart('mark included statements', 2); + this.includeStatements(); + timeEnd('mark included statements', 2); + this.phase = BuildPhase.GENERATE; + } + getCache() { + // handle plugin cache eviction + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + let allDeleted = true; + for (const [key, value] of Object.entries(cache)) { + if (value[0] >= this.options.experimentalCacheExpiry) + delete cache[key]; + else + allDeleted = false; + } + if (allDeleted) + delete this.pluginCache[name]; + } + return { + modules: this.modules.map(module => module.toJSON()), + plugins: this.pluginCache + }; + } + async generateModuleGraph() { + ({ entryModules: this.entryModules, implicitEntryModules: this.implicitEntryModules } = + await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); + if (this.entryModules.length === 0) { + throw new Error('You must supply options.input to rollup'); + } + for (const module of this.modulesById.values()) { + module.cacheInfoGetters(); + if (module instanceof Module) { + this.modules.push(module); + } + else { + this.externalModules.push(module); + } + } + } + includeStatements() { + const entryModules = [...this.entryModules, ...this.implicitEntryModules]; + for (const module of entryModules) { + markModuleAndImpureDependenciesAsExecuted(module); + } + if (this.options.treeshake) { + let treeshakingPass = 1; + do { + timeStart(`treeshaking pass ${treeshakingPass}`, 3); + this.needsTreeshakingPass = false; + for (const module of this.modules) { + if (module.isExecuted) { + module.hasTreeShakingPassStarted = true; + if (module.info.moduleSideEffects === 'no-treeshake') { + module.includeAllInBundle(); + } + else { + module.include(); + } + } + } + if (treeshakingPass === 1) { + // We only include exports after the first pass to avoid issues with + // the TDZ detection logic + for (const module of entryModules) { + if (module.preserveSignature !== false) { + module.includeAllExports(false); + this.needsTreeshakingPass = true; + } + } + } + timeEnd(`treeshaking pass ${treeshakingPass++}`, 3); + } while (this.needsTreeshakingPass); + } + else { + for (const module of this.modules) + module.includeAllInBundle(); + } + for (const externalModule of this.externalModules) + externalModule.warnUnusedImports(); + for (const module of this.implicitEntryModules) { + for (const dependant of module.implicitlyLoadedAfter) { + if (!(dependant.info.isEntry || dependant.isIncluded())) { + error(logImplicitDependantIsNotIncluded(dependant)); + } + } + } + } + sortModules() { + const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); + for (const cyclePath of cyclePaths) { + this.options.onLog(LOGLEVEL_WARN, logCircularDependency(cyclePath)); + } + this.modules = orderedModules; + for (const module of this.modules) { + module.bindReferences(); + } + this.warnForMissingExports(); + } + warnForMissingExports() { + for (const module of this.modules) { + for (const importDescription of module.importDescriptions.values()) { + if (importDescription.name !== '*' && + !importDescription.module.getVariableForExportName(importDescription.name)[0]) { + module.log(LOGLEVEL_WARN, logMissingExport(importDescription.name, module.id, importDescription.module.id), importDescription.start); + } + } + } + } +} + +function formatAction([pluginName, hookName, parameters]) { + const action = `(${pluginName}) ${hookName}`; + const s = JSON.stringify; + switch (hookName) { + case 'resolveId': { + return `${action} ${s(parameters[0])} ${s(parameters[1])}`; + } + case 'load': { + return `${action} ${s(parameters[0])}`; + } + case 'transform': { + return `${action} ${s(parameters[1])}`; + } + case 'shouldTransformCachedModule': { + return `${action} ${s(parameters[0].id)}`; + } + case 'moduleParsed': { + return `${action} ${s(parameters[0].id)}`; + } + } + return action; +} +let handleBeforeExit = null; +const rejectByPluginDriver = new Map(); +async function catchUnfinishedHookActions(pluginDriver, callback) { + const emptyEventLoopPromise = new Promise((_, reject) => { + rejectByPluginDriver.set(pluginDriver, reject); + if (!handleBeforeExit) { + // We only ever create a single event listener to avoid max listener and + // other issues + handleBeforeExit = () => { + for (const [pluginDriver, reject] of rejectByPluginDriver) { + const unfulfilledActions = pluginDriver.getUnfulfilledHookActions(); + reject(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n` + + [...unfulfilledActions].map(formatAction).join('\n'))); + } + }; + process$1.once('beforeExit', handleBeforeExit); + } + }); + try { + return await Promise.race([callback(), emptyEventLoopPromise]); + } + finally { + rejectByPluginDriver.delete(pluginDriver); + if (rejectByPluginDriver.size === 0) { + process$1.off('beforeExit', handleBeforeExit); + handleBeforeExit = null; + } + } +} + +async function initWasm() { } + +function getLogger(plugins, onLog, watchMode, logLevel) { + plugins = getSortedValidatedPlugins('onLog', plugins); + const minimalPriority = logLevelPriority[logLevel]; + const logger = (level, log, skipped = EMPTY_SET) => { + augmentLogMessage(log); + const logPriority = logLevelPriority[level]; + if (logPriority < minimalPriority) { + return; + } + for (const plugin of plugins) { + if (skipped.has(plugin)) + continue; + const { onLog: pluginOnLog } = plugin; + const getLogHandler = (level) => { + if (logLevelPriority[level] < minimalPriority) { + return doNothing; + } + return log => logger(level, normalizeLog(log), new Set(skipped).add(plugin)); + }; + const handler = 'handler' in pluginOnLog ? pluginOnLog.handler : pluginOnLog; + if (handler.call({ + debug: getLogHandler(LOGLEVEL_DEBUG), + error: (log) => error(normalizeLog(log)), + info: getLogHandler(LOGLEVEL_INFO), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(LOGLEVEL_WARN) + }, level, log) === false) { + return; + } + } + onLog(level, log); + }; + return logger; +} + +function ensureArray(items) { + if (Array.isArray(items)) { + return items.filter(Boolean); + } + if (items) { + return [items]; + } + return []; +} + +async function normalizeInputOptions(config, watchMode) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(); + const context = config.context ?? 'undefined'; + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || LOGLEVEL_INFO; + const onLog = getLogger(plugins, getOnLog(config, logLevel), watchMode, logLevel); + const strictDeprecations = config.strictDeprecations || false; + const maxParallelFileOps = getMaxParallelFileOps(config); + const options = { + cache: getCache(config), + context, + experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, + experimentalLogSideEffects: config.experimentalLogSideEffects || false, + external: getIdMatcher(config.external), + input: getInput(config), + jsx: getJsx(config), + logLevel, + makeAbsoluteExternalsRelative: config.makeAbsoluteExternalsRelative ?? 'ifRelativeSource', + maxParallelFileOps, + moduleContext: getModuleContext(config, context), + onLog, + perf: config.perf || false, + plugins, + preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', + preserveSymlinks: config.preserveSymlinks || false, + shimMissingExports: config.shimMissingExports || false, + strictDeprecations, + treeshake: getTreeshake(config) + }; + warnUnknownOptions(config, [...Object.keys(options), 'onwarn', 'watch'], 'input options', onLog, /^(output)$/); + return { options, unsetOptions }; +} +const getCache = (config) => config.cache === true // `true` is the default + ? undefined + : config.cache?.cache || config.cache; +const getIdMatcher = (option) => { + if (option === true) { + return () => true; + } + if (typeof option === 'function') { + return (id, ...parameters) => (!id.startsWith('\0') && option(id, ...parameters)) || false; + } + if (option) { + const ids = new Set(); + const matchers = []; + for (const value of ensureArray(option)) { + if (value instanceof RegExp) { + matchers.push(value); + } + else { + ids.add(value); + } + } + return (id, ..._arguments) => ids.has(id) || matchers.some(matcher => matcher.test(id)); + } + return () => false; +}; +const getInput = (config) => { + const configInput = config.input; + return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; +}; +const getJsx = (config) => { + const configJsx = config.jsx; + if (!configJsx) + return false; + const configWithPreset = getOptionWithPreset(configJsx, jsxPresets, 'jsx', URL_JSX, 'false, '); + const { factory, importSource, mode } = configWithPreset; + switch (mode) { + case 'automatic': { + return { + factory: factory || 'React.createElement', + importSource: importSource || 'react', + jsxImportSource: configWithPreset.jsxImportSource || 'react/jsx-runtime', + mode: 'automatic' + }; + } + case 'preserve': { + if (importSource && !(factory || configWithPreset.fragment)) { + error(logInvalidOption('jsx', URL_JSX, 'when preserving JSX and specifying an importSource, you also need to specify a factory or fragment')); + } + return { + factory: factory || null, + fragment: configWithPreset.fragment || null, + importSource: importSource || null, + mode: 'preserve' + }; + } + // case 'classic': + default: { + if (mode && mode !== 'classic') { + error(logInvalidOption('jsx.mode', URL_JSX, 'mode must be "automatic", "classic" or "preserve"', mode)); + } + return { + factory: factory || 'React.createElement', + fragment: configWithPreset.fragment || 'React.Fragment', + importSource: importSource || null, + mode: 'classic' + }; + } + } +}; +const getMaxParallelFileOps = (config) => { + const maxParallelFileOps = config.maxParallelFileOps; + if (typeof maxParallelFileOps === 'number') { + if (maxParallelFileOps <= 0) + return Infinity; + return maxParallelFileOps; + } + return 20; +}; +const getModuleContext = (config, context) => { + const configModuleContext = config.moduleContext; + if (typeof configModuleContext === 'function') { + return id => configModuleContext(id) ?? context; + } + if (configModuleContext) { + const contextByModuleId = Object.create(null); + for (const [key, moduleContext] of Object.entries(configModuleContext)) { + contextByModuleId[resolve$1(key)] = moduleContext; + } + return id => contextByModuleId[id] ?? context; + } + return () => context; +}; +const getTreeshake = (config) => { + const configTreeshake = config.treeshake; + if (configTreeshake === false) { + return false; + } + const configWithPreset = getOptionWithPreset(config.treeshake, treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, '); + return { + annotations: configWithPreset.annotations !== false, + correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, + manualPureFunctions: configWithPreset.manualPureFunctions ?? EMPTY_ARRAY, + moduleSideEffects: getHasModuleSideEffects(configWithPreset.moduleSideEffects), + propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' + ? 'always' + : configWithPreset.propertyReadSideEffects !== false, + tryCatchDeoptimization: configWithPreset.tryCatchDeoptimization !== false, + unknownGlobalSideEffects: configWithPreset.unknownGlobalSideEffects !== false + }; +}; +const getHasModuleSideEffects = (moduleSideEffectsOption) => { + if (typeof moduleSideEffectsOption === 'boolean') { + return () => moduleSideEffectsOption; + } + if (moduleSideEffectsOption === 'no-external') { + return (_id, external) => !external; + } + if (typeof moduleSideEffectsOption === 'function') { + return (id, external) => id.startsWith('\0') ? true : moduleSideEffectsOption(id, external) !== false; + } + if (Array.isArray(moduleSideEffectsOption)) { + const ids = new Set(moduleSideEffectsOption); + return id => ids.has(id); + } + if (moduleSideEffectsOption) { + error(logInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array')); + } + return () => true; +}; + +// https://datatracker.ietf.org/doc/html/rfc2396 +// eslint-disable-next-line no-control-regex +const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$%&*+,:;<=>?[\]^`{|}\u007F]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; +function sanitizeFileName(name) { + const match = DRIVE_LETTER_REGEX.exec(name); + const driveLetter = match ? match[0] : ''; + // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) + // Otherwise, avoid them because they can refer to NTFS alternate data streams. + return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); +} + +async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(unsetInputOptions); + const compact = config.compact || false; + const format = getFormat(config); + const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); + const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); + const file = getFile(config, preserveModules, inputOptions); + const generatedCode = getGeneratedCode(config); + const externalImportAttributes = getExternalImportAttributes(config, inputOptions); + const outputOptions = { + amd: getAmd(config), + assetFileNames: config.assetFileNames ?? 'assets/[name]-[hash][extname]', + banner: getAddon(config, 'banner'), + chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js', + compact, + dir: getDir(config, file), + dynamicImportInCjs: config.dynamicImportInCjs ?? true, + entryFileNames: getEntryFileNames(config, unsetOptions), + esModule: config.esModule ?? 'if-default-prop', + experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, + exports: getExports(config, unsetOptions), + extend: config.extend || false, + externalImportAssertions: externalImportAttributes, + externalImportAttributes, + externalLiveBindings: config.externalLiveBindings ?? true, + file, + footer: getAddon(config, 'footer'), + format, + freeze: config.freeze ?? true, + generatedCode, + globals: config.globals || {}, + hashCharacters: config.hashCharacters ?? 'base64', + hoistTransitiveImports: config.hoistTransitiveImports ?? true, + importAttributesKey: config.importAttributesKey ?? 'assert', + indent: getIndent(config, compact), + inlineDynamicImports, + interop: getInterop(config), + intro: getAddon(config, 'intro'), + manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules), + minifyInternalExports: getMinifyInternalExports(config, format, compact), + name: config.name, + noConflict: config.noConflict || false, + outro: getAddon(config, 'outro'), + paths: config.paths || {}, + plugins: await normalizePluginOption(config.plugins), + preserveModules, + preserveModulesRoot: getPreserveModulesRoot(config), + reexportProtoFromExternal: config.reexportProtoFromExternal ?? true, + sanitizeFileName: typeof config.sanitizeFileName === 'function' + ? config.sanitizeFileName + : config.sanitizeFileName === false + ? id => id + : sanitizeFileName, + sourcemap: config.sourcemap || false, + sourcemapBaseUrl: getSourcemapBaseUrl(config), + sourcemapDebugIds: config.sourcemapDebugIds || false, + sourcemapExcludeSources: config.sourcemapExcludeSources || false, + sourcemapFile: config.sourcemapFile, + sourcemapFileNames: getSourcemapFileNames(config, unsetOptions), + sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function' + ? config.sourcemapIgnoreList + : config.sourcemapIgnoreList === false + ? () => false + : relativeSourcePath => relativeSourcePath.includes('node_modules'), + sourcemapPathTransform: config.sourcemapPathTransform, + strict: config.strict ?? true, + systemNullSetters: config.systemNullSetters ?? true, + validate: config.validate || false, + virtualDirname: config.virtualDirname || '_virtual' + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog); + return { options: outputOptions, unsetOptions }; +} +const getFile = (config, preserveModules, inputOptions) => { + const { file } = config; + if (typeof file === 'string') { + if (preserveModules) { + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option')); + } + if (!Array.isArray(inputOptions.input)) + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when providing named inputs')); + } + return file; +}; +const getFormat = (config) => { + const configFormat = config.format; + switch (configFormat) { + case undefined: + case 'es': + case 'esm': + case 'module': { + return 'es'; + } + case 'cjs': + case 'commonjs': { + return 'cjs'; + } + case 'system': + case 'systemjs': { + return 'system'; + } + case 'amd': + case 'iife': + case 'umd': { + return configFormat; + } + default: { + return error(logInvalidOption('output.format', URL_OUTPUT_FORMAT, `Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`, configFormat)); + } + } +}; +const getInlineDynamicImports = (config, inputOptions) => { + const inlineDynamicImports = config.inlineDynamicImports || false; + const { input } = inputOptions; + if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { + return error(logInvalidOption('output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, 'multiple inputs are not supported when "output.inlineDynamicImports" is true')); + } + return inlineDynamicImports; +}; +const getPreserveModules = (config, inlineDynamicImports, inputOptions) => { + const preserveModules = config.preserveModules || false; + if (preserveModules) { + if (inlineDynamicImports) { + return error(logInvalidOption('output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, `this option is not supported for "output.preserveModules"`)); + } + if (inputOptions.preserveEntrySignatures === false) { + return error(logInvalidOption('preserveEntrySignatures', URL_PRESERVEENTRYSIGNATURES, 'setting this option to false is not supported for "output.preserveModules"')); + } + } + return preserveModules; +}; +const getPreserveModulesRoot = (config) => { + const { preserveModulesRoot } = config; + if (preserveModulesRoot === null || preserveModulesRoot === undefined) { + return undefined; + } + return resolve$1(preserveModulesRoot); +}; +const getAmd = (config) => { + const mergedOption = { + autoId: false, + basePath: '', + define: 'define', + forceJsExtensionForImports: false, + ...config.amd + }; + if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) { + return error(logInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"')); + } + if (mergedOption.basePath && !mergedOption.autoId) { + return error(logInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"')); + } + return mergedOption.autoId + ? { + autoId: true, + basePath: mergedOption.basePath, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports + } + : { + autoId: false, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports, + id: mergedOption.id + }; +}; +const getAddon = (config, name) => { + const configAddon = config[name]; + if (typeof configAddon === 'function') { + return configAddon; + } + return () => configAddon || ''; +}; +const getDir = (config, file) => { + const { dir } = config; + if (typeof dir === 'string' && typeof file === 'string') { + return error(logInvalidOption('output.dir', URL_OUTPUT_DIR, 'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')); + } + return dir; +}; +const getEntryFileNames = (config, unsetOptions) => { + const configEntryFileNames = config.entryFileNames; + if (configEntryFileNames == null) { + unsetOptions.add('entryFileNames'); + } + return configEntryFileNames ?? '[name].js'; +}; +function getExports(config, unsetOptions) { + const configExports = config.exports; + if (configExports == null) { + unsetOptions.add('exports'); + } + else if (!['default', 'named', 'none', 'auto'].includes(configExports)) { + return error(logInvalidExportOptionValue(configExports)); + } + return configExports || 'auto'; +} +const getExternalImportAttributes = (config, inputOptions) => { + if (config.externalImportAssertions != undefined) { + warnDeprecation(`The "output.externalImportAssertions" option is deprecated. Use the "output.externalImportAttributes" option instead.`, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, true, inputOptions); + } + return config.externalImportAttributes ?? config.externalImportAssertions ?? true; +}; +const getGeneratedCode = (config) => { + const configWithPreset = getOptionWithPreset(config.generatedCode, generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, ''); + return { + arrowFunctions: configWithPreset.arrowFunctions === true, + constBindings: configWithPreset.constBindings === true, + objectShorthand: configWithPreset.objectShorthand === true, + reservedNamesAsProps: configWithPreset.reservedNamesAsProps !== false, + symbols: configWithPreset.symbols === true + }; +}; +const getIndent = (config, compact) => { + if (compact) { + return ''; + } + const configIndent = config.indent; + return configIndent === false ? '' : (configIndent ?? true); +}; +const ALLOWED_INTEROP_TYPES = new Set([ + 'compat', + 'auto', + 'esModule', + 'default', + 'defaultOnly' +]); +const getInterop = (config) => { + const configInterop = config.interop; + if (typeof configInterop === 'function') { + const interopPerId = Object.create(null); + let defaultInterop = null; + return id => id === null + ? defaultInterop || validateInterop((defaultInterop = configInterop(id))) + : id in interopPerId + ? interopPerId[id] + : validateInterop((interopPerId[id] = configInterop(id))); + } + return configInterop === undefined ? () => 'default' : () => validateInterop(configInterop); +}; +const validateInterop = (interop) => { + if (!ALLOWED_INTEROP_TYPES.has(interop)) { + return error(logInvalidOption('output.interop', URL_OUTPUT_INTEROP, `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop)); + } + return interop; +}; +const getManualChunks = (config, inlineDynamicImports, preserveModules) => { + const configManualChunks = config.manualChunks; + if (configManualChunks) { + if (inlineDynamicImports) { + return error(logInvalidOption('output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.inlineDynamicImports"')); + } + if (preserveModules) { + return error(logInvalidOption('output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.preserveModules"')); + } + } + return configManualChunks || {}; +}; +const getMinifyInternalExports = (config, format, compact) => config.minifyInternalExports ?? (compact || format === 'es' || format === 'system'); +const getSourcemapFileNames = (config, unsetOptions) => { + const configSourcemapFileNames = config.sourcemapFileNames; + if (configSourcemapFileNames == null) { + unsetOptions.add('sourcemapFileNames'); + } + return configSourcemapFileNames; +}; +const getSourcemapBaseUrl = (config) => { + const { sourcemapBaseUrl } = config; + if (sourcemapBaseUrl) { + if (isValidUrl(sourcemapBaseUrl)) { + return addTrailingSlashIfMissed(sourcemapBaseUrl); + } + return error(logInvalidOption('output.sourcemapBaseUrl', URL_OUTPUT_SOURCEMAPBASEURL, `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`)); + } +}; + +// @ts-expect-error TS2540: the polyfill of `asyncDispose`. +Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose'); +function rollup(rawInputOptions) { + return rollupInternal(rawInputOptions, null); +} +async function rollupInternal(rawInputOptions, watcher) { + const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null); + initialiseTimers(inputOptions); + await initWasm(); + const graph = new Graph(inputOptions, watcher); + // remove the cache object from the memory after graph creation (cache is not used anymore) + const useCache = rawInputOptions.cache !== false; + if (rawInputOptions.cache) { + inputOptions.cache = undefined; + rawInputOptions.cache = undefined; + } + timeStart('BUILD', 1); + await catchUnfinishedHookActions(graph.pluginDriver, async () => { + try { + timeStart('initialize', 2); + await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); + timeEnd('initialize', 2); + await graph.build(); + } + catch (error_) { + const watchFiles = Object.keys(graph.watchFiles); + if (watchFiles.length > 0) { + error_.watchFiles = watchFiles; + } + await graph.pluginDriver.hookParallel('buildEnd', [error_]); + await graph.pluginDriver.hookParallel('closeBundle', []); + throw error_; + } + await graph.pluginDriver.hookParallel('buildEnd', []); + }); + timeEnd('BUILD', 1); + const result = { + cache: useCache ? graph.getCache() : undefined, + async close() { + if (result.closed) + return; + result.closed = true; + await graph.pluginDriver.hookParallel('closeBundle', []); + }, + closed: false, + async [Symbol.asyncDispose]() { + await this.close(); + }, + async generate(rawOutputOptions) { + if (result.closed) + return error(logAlreadyClosed()); + return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph); + }, + get watchFiles() { + return Object.keys(graph.watchFiles); + }, + async write(rawOutputOptions) { + if (result.closed) + return error(logAlreadyClosed()); + return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph); + } + }; + if (inputOptions.perf) + result.getTimings = getTimings; + return result; +} +async function getInputOptions(initialInputOptions, watchMode) { + if (!initialInputOptions) { + throw new Error('You must supply an options object to rollup'); + } + const processedInputOptions = await getProcessedInputOptions(initialInputOptions, watchMode); + const { options, unsetOptions } = await normalizeInputOptions(processedInputOptions, watchMode); + normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX); + return { options, unsetOptions }; +} +async function getProcessedInputOptions(inputOptions, watchMode) { + const plugins = getSortedValidatedPlugins('options', await normalizePluginOption(inputOptions.plugins)); + const logLevel = inputOptions.logLevel || LOGLEVEL_INFO; + const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), watchMode, logLevel); + for (const plugin of plugins) { + const { name, options } = plugin; + const handler = 'handler' in options ? options.handler : options; + const processedOptions = await handler.call({ + debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', logger, name, logLevel), + error: (error_) => error(logPluginError(normalizeLog(error_), name, { hook: 'onLog' })), + info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', logger, name, logLevel), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', logger, name, logLevel) + }, inputOptions); + if (processedOptions) { + inputOptions = processedOptions; + } + } + return inputOptions; +} +function normalizePlugins(plugins, anonymousPrefix) { + for (const [index, plugin] of plugins.entries()) { + if (!plugin.name) { + plugin.name = `${anonymousPrefix}${index + 1}`; + } + } +} +async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) { + const { options: outputOptions, outputPluginDriver, unsetOptions } = await getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions); + return catchUnfinishedHookActions(outputPluginDriver, async () => { + const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); + const generated = await bundle.generate(isWrite); + if (isWrite) { + timeStart('WRITE', 1); + if (!outputOptions.dir && !outputOptions.file) { + return error(logMissingFileOrDirOption()); + } + await Promise.all(Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions)))); + await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); + timeEnd('WRITE', 1); + } + return createOutput(generated); + }); +} +async function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) { + if (!rawOutputOptions) { + throw new Error('You must supply an options object'); + } + const rawPlugins = await normalizePluginOption(rawOutputOptions.plugins); + normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX); + const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins); + return { + ...(await getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver)), + outputPluginDriver + }; +} +function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) { + return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => { + const emitError = () => pluginContext.error(logCannotEmitFromOptionsHook()); + return { + ...pluginContext, + emitFile: emitError, + setAssetSource: emitError + }; + }), inputOptions, unsetInputOptions); +} +function createOutput(outputBundle) { + return { + output: Object.values(outputBundle).filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => getSortingFileType(outputFileA) - getSortingFileType(outputFileB)) + }; +} +var SortingFileType; +(function (SortingFileType) { + SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK"; + SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK"; + SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET"; +})(SortingFileType || (SortingFileType = {})); +function getSortingFileType(file) { + if (file.type === 'asset') { + return SortingFileType.ASSET; + } + if (file.isEntry) { + return SortingFileType.ENTRY_CHUNK; + } + return SortingFileType.SECONDARY_CHUNK; +} +async function writeOutputFile(outputFile, outputOptions) { + const fileName = resolve$1(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName); + // 'recursive: true' does not throw if the folder structure, or parts of it, already exist + await mkdir(dirname(fileName), { recursive: true }); + return writeFile(fileName, outputFile.type === 'asset' ? outputFile.source : outputFile.code); +} +/** + * Auxiliary function for defining rollup configuration + * Mainly to facilitate IDE code prompts, after all, export default does not + * prompt, even if you add @type annotations, it is not accurate + * @param options + */ +function defineConfig(options) { + return options; +} + +const { + env = {}, + argv = [], + platform = "", +} = typeof process === "undefined" ? {} : process; + +const isDisabled = "NO_COLOR" in env || argv.includes("--no-color"); +const isForced = "FORCE_COLOR" in env || argv.includes("--color"); +const isWindows = platform === "win32"; +const isDumbTerminal = env.TERM === "dumb"; + +const isCompatibleTerminal = + tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal; + +const isCI = + "CI" in env && + ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env); + +const isColorSupported = + !isDisabled && + (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI); + +const replaceClose = ( + index, + string, + close, + replace, + head = string.substring(0, index) + replace, + tail = string.substring(index + close.length), + next = tail.indexOf(close) +) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace)); + +const clearBleed = (index, string, open, close, replace) => + index < 0 + ? open + string + close + : open + replaceClose(index, string, close, replace) + close; + +const filterEmpty = + (open, close, replace = open, at = open.length + 1) => + (string) => + string || !(string === "" || string === undefined) + ? clearBleed( + ("" + string).indexOf(close, at), + string, + open, + close, + replace + ) + : ""; + +const init = (open, close, replace) => + filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace); + +const colors = { + reset: init(0, 0), + bold: init(1, 22, "\x1b[22m\x1b[1m"), + dim: init(2, 22, "\x1b[22m\x1b[2m"), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49), + blackBright: init(90, 39), + redBright: init(91, 39), + greenBright: init(92, 39), + yellowBright: init(93, 39), + blueBright: init(94, 39), + magentaBright: init(95, 39), + cyanBright: init(96, 39), + whiteBright: init(97, 39), + bgBlackBright: init(100, 49), + bgRedBright: init(101, 49), + bgGreenBright: init(102, 49), + bgYellowBright: init(103, 49), + bgBlueBright: init(104, 49), + bgMagentaBright: init(105, 49), + bgCyanBright: init(106, 49), + bgWhiteBright: init(107, 49), +}; + +const createColors = ({ useColor = isColorSupported } = {}) => + useColor + ? colors + : Object.keys(colors).reduce( + (colors, key) => ({ ...colors, [key]: String }), + {} + ); + +createColors(); + +// @see https://no-color.org +// @see https://www.npmjs.com/package/chalk +const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ + useColor: env$1.FORCE_COLOR !== '0' && !env$1.NO_COLOR +}); + +// log to stderr to keep `rollup main.js > bundle.js` from breaking +const stderr = (...parameters) => process$1.stderr.write(`${parameters.join('')}\n`); +function handleError(error, recover = false) { + const name = error.name || error.cause?.name; + const nameSection = name ? `${name}: ` : ''; + const pluginSection = error.plugin ? `(plugin ${error.plugin}) ` : ''; + const message = `${pluginSection}${nameSection}${error.message}`; + const outputLines = [bold(red(`[!] ${bold(message.toString())}`))]; + if (error.url) { + outputLines.push(cyan(error.url)); + } + if (error.loc) { + outputLines.push(`${relativeId((error.loc.file || error.id))} (${error.loc.line}:${error.loc.column})`); + } + else if (error.id) { + outputLines.push(relativeId(error.id)); + } + if (error.frame) { + outputLines.push(dim(error.frame)); + } + if (error.stack) { + outputLines.push(dim(error.stack?.replace(`${nameSection}${error.message}\n`, ''))); + } + // ES2022: Error.prototype.cause is optional + if (error.cause) { + let cause = error.cause; + const causeErrorLines = []; + let indent = ''; + while (cause) { + indent += ' '; + const message = cause.stack || cause; + causeErrorLines.push(...`[cause] ${message}`.split('\n').map(line => indent + line)); + cause = cause.cause; + } + outputLines.push(dim(causeErrorLines.join('\n'))); + } + outputLines.push('', ''); + stderr(outputLines.join('\n')); + if (!recover) + process$1.exit(1); +} + +const commandAliases = { + c: 'config', + d: 'dir', + e: 'external', + f: 'format', + g: 'globals', + h: 'help', + i: 'input', + m: 'sourcemap', + n: 'name', + o: 'file', + p: 'plugin', + v: 'version', + w: 'watch' +}; +const EMPTY_COMMAND_OPTIONS = { external: [], globals: undefined }; +async function mergeOptions(config, watchMode, rawCommandOptions = EMPTY_COMMAND_OPTIONS, printLog) { + const command = getCommandOptions(rawCommandOptions); + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || LOGLEVEL_INFO; + const onLog = getOnLog(config, logLevel, printLog); + const log = getLogger(plugins, onLog, watchMode, logLevel); + const inputOptions = mergeInputOptions(config, command, plugins, log, onLog); + if (command.output) { + Object.assign(command, command.output); + } + const outputOptionsArray = ensureArray(config.output); + if (outputOptionsArray.length === 0) + outputOptionsArray.push({}); + const outputOptions = await Promise.all(outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, log))); + warnUnknownOptions(command, [ + ...Object.keys(inputOptions), + ...Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapIgnoreList' && option !== 'sourcemapPathTransform'), + ...Object.keys(commandAliases), + 'bundleConfigAsCjs', + 'config', + 'configImportAttributesKey', + 'configPlugin', + 'environment', + 'failAfterWarnings', + 'filterLogs', + 'forceExit', + 'plugin', + 'silent', + 'stdin', + 'waitForBundleInput' + ], 'CLI flags', log, /^_$|output$|config/); + inputOptions.output = outputOptions; + return inputOptions; +} +function getCommandOptions(rawCommandOptions) { + const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' + ? rawCommandOptions.external.split(',') + : []; + return { + ...rawCommandOptions, + external, + globals: typeof rawCommandOptions.globals === 'string' + ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { + const [id, variableName] = globalDefinition.split(':'); + globals[id] = variableName; + if (!external.includes(id)) { + external.push(id); + } + return globals; + }, Object.create(null)) + : undefined + }; +} +function mergeInputOptions(config, overrides, plugins, log, onLog) { + const getOption = (name) => overrides[name] ?? config[name]; + const inputOptions = { + cache: config.cache, + context: getOption('context'), + experimentalCacheExpiry: getOption('experimentalCacheExpiry'), + experimentalLogSideEffects: getOption('experimentalLogSideEffects'), + external: getExternal(config, overrides), + input: getOption('input') || [], + jsx: getObjectOption(config, overrides, 'jsx', objectifyOptionWithPresets(jsxPresets, 'jsx', URL_JSX, 'false, ')), + logLevel: getOption('logLevel'), + makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), + maxParallelFileOps: getOption('maxParallelFileOps'), + moduleContext: getOption('moduleContext'), + onLog, + onwarn: undefined, + perf: getOption('perf'), + plugins, + preserveEntrySignatures: getOption('preserveEntrySignatures'), + preserveSymlinks: getOption('preserveSymlinks'), + shimMissingExports: getOption('shimMissingExports'), + strictDeprecations: getOption('strictDeprecations'), + treeshake: getObjectOption(config, overrides, 'treeshake', objectifyOptionWithPresets(treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, ')), + watch: getWatch(config, overrides) + }; + warnUnknownOptions(config, Object.keys(inputOptions), 'input options', log, /^output$/); + return inputOptions; +} +const getExternal = (config, overrides) => { + const configExternal = config.external; + return typeof configExternal === 'function' + ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source) + : [...ensureArray(configExternal), ...overrides.external]; +}; +const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => { + const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue); + const configOption = normalizeObjectOptionValue(config[name], objectifyValue); + if (commandOption !== undefined) { + return commandOption && { ...configOption, ...commandOption }; + } + return configOption; +}; +const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch'); +const normalizeObjectOptionValue = (optionValue, objectifyValue) => { + if (!optionValue) { + return optionValue; + } + if (Array.isArray(optionValue)) { + return optionValue.reduce((result, value) => value && result && { ...result, ...objectifyValue(value) }, {}); + } + return objectifyValue(optionValue); +}; +async function mergeOutputOptions(config, overrides, log) { + const getOption = (name) => overrides[name] ?? config[name]; + const outputOptions = { + amd: getObjectOption(config, overrides, 'amd'), + assetFileNames: getOption('assetFileNames'), + banner: getOption('banner'), + chunkFileNames: getOption('chunkFileNames'), + compact: getOption('compact'), + dir: getOption('dir'), + dynamicImportInCjs: getOption('dynamicImportInCjs'), + entryFileNames: getOption('entryFileNames'), + esModule: getOption('esModule'), + experimentalMinChunkSize: getOption('experimentalMinChunkSize'), + exports: getOption('exports'), + extend: getOption('extend'), + externalImportAssertions: getOption('externalImportAssertions'), + externalImportAttributes: getOption('externalImportAttributes'), + externalLiveBindings: getOption('externalLiveBindings'), + file: getOption('file'), + footer: getOption('footer'), + format: getOption('format'), + freeze: getOption('freeze'), + generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, '')), + globals: getOption('globals'), + hashCharacters: getOption('hashCharacters'), + hoistTransitiveImports: getOption('hoistTransitiveImports'), + importAttributesKey: getOption('importAttributesKey'), + indent: getOption('indent'), + inlineDynamicImports: getOption('inlineDynamicImports'), + interop: getOption('interop'), + intro: getOption('intro'), + manualChunks: getOption('manualChunks'), + minifyInternalExports: getOption('minifyInternalExports'), + name: getOption('name'), + noConflict: getOption('noConflict'), + outro: getOption('outro'), + paths: getOption('paths'), + plugins: await normalizePluginOption(config.plugins), + preserveModules: getOption('preserveModules'), + preserveModulesRoot: getOption('preserveModulesRoot'), + reexportProtoFromExternal: getOption('reexportProtoFromExternal'), + sanitizeFileName: getOption('sanitizeFileName'), + sourcemap: getOption('sourcemap'), + sourcemapBaseUrl: getOption('sourcemapBaseUrl'), + sourcemapDebugIds: getOption('sourcemapDebugIds'), + sourcemapExcludeSources: getOption('sourcemapExcludeSources'), + sourcemapFile: getOption('sourcemapFile'), + sourcemapFileNames: getOption('sourcemapFileNames'), + sourcemapIgnoreList: getOption('sourcemapIgnoreList'), + sourcemapPathTransform: getOption('sourcemapPathTransform'), + strict: getOption('strict'), + systemNullSetters: getOption('systemNullSetters'), + validate: getOption('validate'), + virtualDirname: getOption('virtualDirname') + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log); + return outputOptions; +} + +class WatchEmitter { + constructor() { + this.currentHandlers = Object.create(null); + this.persistentHandlers = Object.create(null); + } + // Will be overwritten by Rollup + async close() { } + emit(event, ...parameters) { + return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters))); + } + off(event, listener) { + const listeners = this.persistentHandlers[event]; + if (listeners) { + // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1 + // (which would remove the last array element if used unchanged) is turned + // into max_int, which is outside the array and does not change anything. + listeners.splice(listeners.indexOf(listener) >>> 0, 1); + } + return this; + } + on(event, listener) { + this.getPersistentHandlers(event).push(listener); + return this; + } + onCurrentRun(event, listener) { + this.getCurrentHandlers(event).push(listener); + return this; + } + once(event, listener) { + const selfRemovingListener = (...parameters) => { + this.off(event, selfRemovingListener); + return listener(...parameters); + }; + this.on(event, selfRemovingListener); + return this; + } + removeAllListeners() { + this.removeListenersForCurrentRun(); + this.persistentHandlers = Object.create(null); + return this; + } + removeListenersForCurrentRun() { + this.currentHandlers = Object.create(null); + return this; + } + getCurrentHandlers(event) { + return this.currentHandlers[event] || (this.currentHandlers[event] = []); + } + getPersistentHandlers(event) { + return this.persistentHandlers[event] || (this.persistentHandlers[event] = []); + } +} + +let fsEvents; +let fsEventsImportError; +async function loadFsEvents() { + try { + ({ default: fsEvents } = await import('fsevents')); + } + catch (error) { + fsEventsImportError = error; + } +} +// A call to this function will be injected into the chokidar code +function getFsEvents() { + if (fsEventsImportError) + throw fsEventsImportError; + return fsEvents; +} + +const fseventsImporter = /*#__PURE__*/Object.defineProperty({ + __proto__: null, + getFsEvents, + loadFsEvents +}, Symbol.toStringTag, { value: 'Module' }); + +function watch(configs) { + const emitter = new WatchEmitter(); + watchInternal(configs, emitter).catch(error => { + handleError(error); + }); + return emitter; +} +async function watchInternal(configs, emitter) { + const optionsList = await Promise.all(ensureArray(configs).map(config => mergeOptions(config, true))); + const watchOptionsList = optionsList.filter(config => config.watch !== false); + if (watchOptionsList.length === 0) { + return error(logInvalidOption('watch', URL_WATCH, 'there must be at least one config where "watch" is not set to "false"')); + } + await loadFsEvents(); + const { Watcher } = await import('./watch.js'); + new Watcher(watchOptionsList, emitter); +} + +export { createFilter, defineConfig, fseventsImporter, getAugmentedNamespace, getDefaultExportFromCjs, rollup, rollupInternal, version, watch }; diff --git a/seller_1/node_modules/rollup/dist/es/shared/parseAst.js b/seller_1/node_modules/rollup/dist/es/shared/parseAst.js new file mode 100644 index 0000000..d7d3364 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/shared/parseAst.js @@ -0,0 +1,2072 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import { parse, parseAsync } from '../../native.js'; +import { resolve, basename, extname, dirname } from 'node:path'; + +// This file is generated by scripts/generate-node-types.js. +// Do not edit this file directly. +const ArrowFunctionExpression = 'ArrowFunctionExpression'; +const BlockStatement = 'BlockStatement'; +const CallExpression = 'CallExpression'; +const CatchClause = 'CatchClause'; +const ExportDefaultDeclaration = 'ExportDefaultDeclaration'; +const ExpressionStatement = 'ExpressionStatement'; +const Identifier = 'Identifier'; +const Literal = 'Literal'; +const ObjectExpression = 'ObjectExpression'; +const PanicError = 'PanicError'; +const ParseError = 'ParseError'; +const Program = 'Program'; +const Property = 'Property'; +const ReturnStatement = 'ReturnStatement'; +const StaticBlock = 'StaticBlock'; +const TemplateLiteral = 'TemplateLiteral'; +const VariableDeclarator = 'VariableDeclarator'; + +const BLANK = Object.freeze(Object.create(null)); +const EMPTY_OBJECT = Object.freeze({}); +const EMPTY_ARRAY = Object.freeze([]); +const EMPTY_SET = Object.freeze(new (class extends Set { + add() { + throw new Error('Cannot add to empty set'); + } +})()); + +// This file is generated by scripts/generate-string-constants.js. +// Do not edit this file directly. +const FIXED_STRINGS = [ + 'var', + 'let', + 'const', + 'init', + 'get', + 'set', + 'constructor', + 'method', + '-', + '+', + '!', + '~', + 'typeof', + 'void', + 'delete', + '++', + '--', + '==', + '!=', + '===', + '!==', + '<', + '<=', + '>', + '>=', + '<<', + '>>', + '>>>', + '+', + '-', + '*', + '/', + '%', + '|', + '^', + '&', + '||', + '&&', + 'in', + 'instanceof', + '**', + '??', + '=', + '+=', + '-=', + '*=', + '/=', + '%=', + '<<=', + '>>=', + '>>>=', + '|=', + '^=', + '&=', + '**=', + '&&=', + '||=', + '??=', + 'pure', + 'noSideEffects', + 'sourcemap', + 'using', + 'await using' +]; + +const ANNOTATION_KEY = '_rollupAnnotations'; +const INVALID_ANNOTATION_KEY = '_rollupRemoved'; +const convertAnnotations = (position, buffer) => { + if (position === 0) + return EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + list[index] = convertAnnotation(buffer[position++], buffer); + } + return list; +}; +const convertAnnotation = (position, buffer) => { + const start = buffer[position++]; + const end = buffer[position++]; + const type = FIXED_STRINGS[buffer[position]]; + return { end, start, type }; +}; + +/** @typedef {import('./types').Location} Location */ + +/** + * @param {import('./types').Range} range + * @param {number} index + */ +function rangeContains(range, index) { + return range.start <= index && index < range.end; +} + +/** + * @param {string} source + * @param {import('./types').Options} [options] + */ +function getLocator(source, options = {}) { + const { offsetLine = 0, offsetColumn = 0 } = options; + + let start = 0; + const ranges = source.split('\n').map((line, i) => { + const end = start + line.length + 1; + + /** @type {import('./types').Range} */ + const range = { start, end, line: i }; + + start = end; + return range; + }); + + let i = 0; + + /** + * @param {string | number} search + * @param {number} [index] + * @returns {Location | undefined} + */ + function locator(search, index) { + if (typeof search === 'string') { + search = source.indexOf(search, index ?? 0); + } + + if (search === -1) return undefined; + + let range = ranges[i]; + + const d = search >= range.end ? 1 : -1; + + while (range) { + if (rangeContains(range, search)) { + return { + line: offsetLine + range.line, + column: offsetColumn + search - range.start, + character: search + }; + } + + i += d; + range = ranges[i]; + } + } + + return locator; +} + +/** + * @param {string} source + * @param {string | number} search + * @param {import('./types').Options} [options] + * @returns {Location | undefined} + */ +function locate(source, search, options) { + return getLocator(source, options)(search, options && options.startIndex); +} + +function spaces(index) { + let result = ''; + while (index--) + result += ' '; + return result; +} +function tabsToSpaces(value) { + return value.replace(/^\t+/, match => match.split('\t').join(' ')); +} +const LINE_TRUNCATE_LENGTH = 120; +const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10; +const ELLIPSIS = '...'; +function getCodeFrame(source, line, column) { + let lines = source.split('\n'); + // Needed if a plugin did not generate correct sourcemaps + if (line > lines.length) + return ''; + const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + + ELLIPSIS.length, LINE_TRUNCATE_LENGTH); + const frameStart = Math.max(0, line - 3); + let frameEnd = Math.min(line + 2, lines.length); + lines = lines.slice(frameStart, frameEnd); + while (!/\S/.test(lines[lines.length - 1])) { + lines.pop(); + frameEnd -= 1; + } + const digits = String(frameEnd).length; + return lines + .map((sourceLine, index) => { + const isErrorLine = frameStart + index + 1 === line; + let lineNumber = String(index + frameStart + 1); + while (lineNumber.length < digits) + lineNumber = ` ${lineNumber}`; + let displayedLine = tabsToSpaces(sourceLine); + if (displayedLine.length > maxLineLength) { + displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`; + } + if (isErrorLine) { + const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^'; + return `${lineNumber}: ${displayedLine}\n${indicator}`; + } + return `${lineNumber}: ${displayedLine}`; + }) + .join('\n'); +} + +const LOGLEVEL_SILENT = 'silent'; +const LOGLEVEL_ERROR = 'error'; +const LOGLEVEL_WARN = 'warn'; +const LOGLEVEL_INFO = 'info'; +const LOGLEVEL_DEBUG = 'debug'; +const logLevelPriority = { + [LOGLEVEL_DEBUG]: 0, + [LOGLEVEL_INFO]: 1, + [LOGLEVEL_SILENT]: 3, + [LOGLEVEL_WARN]: 2 +}; + +const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/; +const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/; +function isAbsolute(path) { + return ABSOLUTE_PATH_REGEX.test(path); +} +function isRelative(path) { + return RELATIVE_PATH_REGEX.test(path); +} +const BACKSLASH_REGEX = /\\/g; +function normalize(path) { + return path.replace(BACKSLASH_REGEX, '/'); +} + +function printQuotedStringList(list, verbs) { + const isSingleItem = list.length <= 1; + const quotedList = list.map(item => `"${item}"`); + let output = isSingleItem + ? quotedList[0] + : `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`; + if (verbs) { + output += ` ${isSingleItem ? verbs[0] : verbs[1]}`; + } + return output; +} + +const ANY_SLASH_REGEX = /[/\\]/; +function relative(from, to) { + const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean); + const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean); + if (fromParts[0] === '.') + fromParts.shift(); + if (toParts[0] === '.') + toParts.shift(); + while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + while (toParts[0] === '..' && fromParts.length > 0) { + toParts.shift(); + fromParts.pop(); + } + while (fromParts.pop()) { + toParts.unshift('..'); + } + return toParts.join('/'); +} + +function getAliasName(id) { + const base = basename(id); + return base.slice(0, Math.max(0, base.length - extname(id).length)); +} +function relativeId(id) { + if (!isAbsolute(id)) + return id; + return relative(resolve(), id); +} +function isPathFragment(name) { + // starting with "/", "./", "../", "C:/" + return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name)); +} +const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/; +function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) { + while (targetPath.startsWith('../')) { + targetPath = targetPath.slice(3); + importerId = '_/' + importerId; + } + let relativePath = normalize(relative(dirname(importerId), targetPath)); + if (stripJsExtension && relativePath.endsWith('.js')) { + relativePath = relativePath.slice(0, -3); + } + if (ensureFileName) { + if (relativePath === '') + return '../' + basename(targetPath); + if (UPPER_DIR_REGEX.test(relativePath)) { + return [...relativePath.split('/'), '..', basename(targetPath)].join('/'); + } + } + return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.'; +} + +function isValidUrl(url) { + try { + new URL(url); + } + catch { + return false; + } + return true; +} +function getRollupUrl(snippet) { + return `https://rollupjs.org/${snippet}`; +} +function addTrailingSlashIfMissed(url) { + if (!url.endsWith('/')) { + return url + '/'; + } + return url; +} + +// troubleshooting +const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval'; +const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module'; +const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined'; +const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency'; +const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect'; +// configuration-options +const URL_JSX = 'configuration-options/#jsx'; +const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id'; +const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath'; +const URL_OUTPUT_DIR = 'configuration-options/#output-dir'; +const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports'; +const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend'; +const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes'; +const URL_OUTPUT_FORMAT = 'configuration-options/#output-format'; +const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode'; +const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals'; +const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports'; +const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop'; +const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks'; +const URL_OUTPUT_NAME = 'configuration-options/#output-name'; +const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl'; +const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile'; +const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures'; +const URL_TREESHAKE = 'configuration-options/#treeshake'; +const URL_TREESHAKE_PURE = 'configuration-options/#pure'; +const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects'; +const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects'; +const URL_WATCH = 'configuration-options/#watch'; +const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle'; + +function error(base) { + throw base instanceof Error ? base : getRollupError(base); +} +function getRollupError(base) { + augmentLogMessage(base); + const errorInstance = Object.assign(new Error(base.message), base); + Object.defineProperty(errorInstance, 'name', { + value: 'RollupError', + writable: true + }); + return errorInstance; +} +function augmentCodeLocation(properties, pos, source, id) { + if (typeof pos === 'object') { + const { line, column } = pos; + properties.loc = { column, file: id, line }; + } + else { + properties.pos = pos; + const location = locate(source, pos, { offsetLine: 1 }); + if (!location) { + return; + } + const { line, column } = location; + properties.loc = { column, file: id, line }; + } + if (properties.frame === undefined) { + const { line, column } = properties.loc; + properties.frame = getCodeFrame(source, line, column); + } +} +const symbolAugmented = Symbol('augmented'); +function augmentLogMessage(log) { + // Make sure to only augment the log message once + if (!(log.plugin || log.loc) || log[symbolAugmented]) { + return; + } + log[symbolAugmented] = true; + let prefix = ''; + if (log.plugin) { + prefix += `[plugin ${log.plugin}] `; + } + const id = log.id || log.loc?.file; + if (id) { + const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : ''; + prefix += `${relativeId(id)}${position}: `; + } + const oldMessage = log.message; + log.message = prefix + log.message; + tweakStackMessage(log, oldMessage); +} +// Error codes should be sorted alphabetically while errors should be sorted by +// error code below +const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR'; +function logAddonNotGenerated(message, hook, plugin) { + return { + code: ADDON_ERROR, + message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}". +\tError Message: ${message}` + }; +} +function logAlreadyClosed() { + return { + code: ALREADY_CLOSED, + message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' + }; +} +function logAmbiguousExternalNamespaces(binding, reexportingModule, usedModule, sources) { + return { + binding, + code: AMBIGUOUS_EXTERNAL_NAMESPACES, + ids: sources, + message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${binding}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`, + reexporter: reexportingModule + }; +} +function logAnonymousPluginCache() { + return { + code: ANONYMOUS_PLUGIN_CACHE, + message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.' + }; +} +function logAssetNotFinalisedForFileName(name) { + return { + code: ASSET_NOT_FINALISED, + message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.` + }; +} +function logAssetReferenceIdNotFoundForSetSource(assetReferenceId) { + return { + code: ASSET_NOT_FOUND, + message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".` + }; +} +function logAssetSourceAlreadySet(name) { + return { + code: ASSET_SOURCE_ALREADY_SET, + message: `Unable to set the source for asset "${name}", source already set.` + }; +} +function logNoAssetSourceSet(assetName) { + return { + code: ASSET_SOURCE_MISSING, + message: `Plugin error creating asset "${assetName}" - no asset source set.` + }; +} +function logBadLoader(id) { + return { + code: BAD_LOADER, + message: `Error loading "${relativeId(id)}": plugin load hook should return a string, a { code, map } object, or nothing/null.` + }; +} +function logCannotCallNamespace(name) { + return { + code: CANNOT_CALL_NAMESPACE, + message: `Cannot call a namespace ("${name}").` + }; +} +function logCannotEmitFromOptionsHook() { + return { + code: CANNOT_EMIT_FROM_OPTIONS_HOOK, + message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.` + }; +} +function logChunkNotGeneratedForFileName(name) { + return { + code: CHUNK_NOT_GENERATED, + message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.` + }; +} +function logChunkInvalid({ fileName, code }, { pos, message }) { + const errorProperties = { + code: CHUNK_INVALID, + message: `Chunk "${fileName}" is not valid JavaScript: ${message}.` + }; + augmentCodeLocation(errorProperties, pos, code, fileName); + return errorProperties; +} +function logCircularDependency(cyclePath) { + return { + code: CIRCULAR_DEPENDENCY, + ids: cyclePath, + message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}` + }; +} +function logCircularReexport(exportName, exporter) { + return { + code: CIRCULAR_REEXPORT, + exporter, + message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.` + }; +} +function logCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) { + return { + code: CYCLIC_CROSS_CHUNK_REEXPORT, + exporter, + id: importer, + message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`, + reexporter + }; +} +function logDeprecation(deprecation, urlSnippet, plugin) { + return { + code: DEPRECATED_FEATURE, + message: deprecation, + url: getRollupUrl(urlSnippet), + ...({}) + }; +} +function logConstVariableReassignError() { + return { + code: CONST_REASSIGN, + message: 'Cannot reassign a variable declared with `const`' + }; +} +function logDuplicateArgumentNameError(name) { + return { + code: DUPLICATE_ARGUMENT_NAME, + message: `Duplicate argument name "${name}"` + }; +} +function logDuplicateExportError(name) { + return { code: DUPLICATE_EXPORT, message: `Duplicate export "${name}"` }; +} +function logDuplicatePluginName(plugin) { + return { + code: DUPLICATE_PLUGIN_NAME, + message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).` + }; +} +function logEmptyChunk(chunkName) { + return { + code: EMPTY_BUNDLE, + message: `Generated an empty chunk: "${chunkName}".`, + names: [chunkName] + }; +} +function logEval(id) { + return { + code: EVAL, + id, + message: `Use of eval in "${relativeId(id)}" is strongly discouraged as it poses security risks and may cause issues with minification.`, + url: getRollupUrl(URL_AVOIDING_EVAL) + }; +} +function logExternalSyntheticExports(id, importer) { + return { + code: EXTERNAL_SYNTHETIC_EXPORTS, + exporter: id, + message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(importer)}").` + }; +} +function logFileNameConflict(fileName) { + return { + code: FILE_NAME_CONFLICT, + message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.` + }; +} +function logFileReferenceIdNotFoundForFilename(assetReferenceId) { + return { + code: FILE_NOT_FOUND, + message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".` + }; +} +function logFirstSideEffect(source, id, { line, column }) { + return { + code: FIRST_SIDE_EFFECT, + message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame(source, line, column)}` + }; +} +function logIllegalIdentifierAsName(name) { + return { + code: ILLEGAL_IDENTIFIER_AS_NAME, + message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`, + url: getRollupUrl(URL_OUTPUT_EXTEND) + }; +} +function logIllegalImportReassignment(name, importingId) { + return { + code: ILLEGAL_REASSIGNMENT, + message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".` + }; +} +function logInconsistentImportAttributes(existingAttributes, newAttributes, source, importer) { + return { + code: INCONSISTENT_IMPORT_ATTRIBUTES, + message: `Module "${relativeId(importer)}" tried to import "${relativeId(source)}" with ${formatAttributes(newAttributes)} attributes, but it was already imported elsewhere with ${formatAttributes(existingAttributes)} attributes. Please ensure that import attributes for the same module are always consistent.` + }; +} +const formatAttributes = (attributes) => { + const entries = Object.entries(attributes); + if (entries.length === 0) + return 'no'; + return entries.map(([key, value]) => `"${key}": "${value}"`).join(', '); +}; +function logInvalidAnnotation(comment, id, type) { + return { + code: INVALID_ANNOTATION, + id, + message: `A comment\n\n"${comment}"\n\nin "${relativeId(id)}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`, + url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE) + }; +} +function logInputHookInOutputPlugin(pluginName, hookName) { + return { + code: INPUT_HOOK_IN_OUTPUT_PLUGIN, + message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.` + }; +} +function logCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) { + return { + code: INVALID_CHUNK, + message: `Cannot assign "${relativeId(moduleId)}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.` + }; +} +function tweakStackMessage(error, oldMessage) { + if (!error.stack) { + return error; + } + error.stack = error.stack.replace(oldMessage, error.message); + return error; +} +function logInvalidExportOptionValue(optionValue) { + return { + code: INVALID_EXPORT_OPTION, + message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logIncompatibleExportOptionValue(optionValue, keys, entryModule) { + return { + code: INVALID_EXPORT_OPTION, + message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${printQuotedStringList(keys)}`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logInternalIdCannotBeExternal(source, importer) { + return { + code: INVALID_EXTERNAL_ID, + message: `"${source}" is imported as an external by "${relativeId(importer)}", but is already an existing non-external module id.` + }; +} +function logImportOptionsAreInvalid(importer) { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId(importer)}". Dynamic import options need to be an object with a nested attributes object.` + }; +} +function logImportAttributeIsInvalid(importer) { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values. The attribute will be removed.` + }; +} +function logInvalidLogPosition(plugin) { + return { + code: INVALID_LOG_POSITION, + message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.` + }; +} +function logInvalidOption(option, urlSnippet, explanation, value) { + return { + code: INVALID_OPTION, + message: `Invalid value ${value === undefined ? '' : `${JSON.stringify(value)} `}for option "${option}" - ${explanation}.`, + url: getRollupUrl(urlSnippet) + }; +} +function logInvalidAddonPluginHook(hook, plugin) { + return { + code: INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`, + plugin + }; +} +function logInvalidFunctionPluginHook(hook, plugin) { + return { + code: INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`, + plugin + }; +} +function logInvalidRollupPhaseForChunkEmission() { + return { + code: INVALID_ROLLUP_PHASE, + message: `Cannot emit chunks after module loading has finished.` + }; +} +function logInvalidSetAssetSourceCall() { + return { + code: INVALID_SETASSETSOURCE, + message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.` + }; +} +function logInvalidFormatForTopLevelAwait(id, format) { + return { + code: INVALID_TLA_FORMAT, + id, + message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.` + }; +} +function logMissingEntryExport(binding, exporter) { + return { + binding, + code: MISSING_EXPORT, + exporter, + message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}".`, + url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED) + }; +} +function logMissingExport(binding, importingModule, exporter) { + const isJson = extname(exporter) === '.json'; + return { + binding, + code: MISSING_EXPORT, + exporter, + id: importingModule, + message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`, + url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED) + }; +} +function logMissingGlobalName(externalId, guess) { + return { + code: MISSING_GLOBAL_NAME, + id: externalId, + message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`, + names: [guess], + url: getRollupUrl(URL_OUTPUT_GLOBALS) + }; +} +function logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) { + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.` + }; +} +function logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) { + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.` + }; +} +function logImplicitDependantIsNotIncluded(module) { + const implicitDependencies = [...module.implicitlyLoadedBefore] + .map(dependency => relativeId(dependency.id)) + .sort(); + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.` + }; +} +function logMissingJsxExport(name, exporter, importer) { + return { + code: MISSING_JSX_EXPORT, + exporter, + id: importer, + message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`, + names: [name], + url: getRollupUrl(URL_JSX) + }; +} +function logMissingNameOptionForIifeExport() { + return { + code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, + message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`, + url: getRollupUrl(URL_OUTPUT_NAME) + }; +} +function logMissingNameOptionForUmdExport() { + return { + code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, + message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.', + url: getRollupUrl(URL_OUTPUT_NAME) + }; +} +function logMissingNodeBuiltins(externalBuiltins) { + return { + code: MISSING_NODE_BUILTINS, + ids: externalBuiltins, + message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node` + }; +} +function logMissingFileOrDirOption() { + return { + code: MISSING_OPTION, + message: 'You must specify "output.file" or "output.dir" for the build.', + url: getRollupUrl(URL_OUTPUT_DIR) + }; +} +function logMixedExport(facadeModuleId, name) { + return { + code: MIXED_EXPORTS, + id: facadeModuleId, + message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logModuleLevelDirective(directive, id) { + return { + code: MODULE_LEVEL_DIRECTIVE, + id, + message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId(id)}" was ignored.` + }; +} +function logNamespaceConflict(binding, reexportingModuleId, sources) { + return { + binding, + code: NAMESPACE_CONFLICT, + ids: sources, + message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${binding}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored).`, + reexporter: reexportingModuleId + }; +} +function logNoTransformMapOrAstWithoutCode(pluginName) { + return { + code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE, + message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` + + 'a "code". This will be ignored.' + }; +} +function logOptimizeChunkStatus(chunks, smallChunks, pointInTime) { + return { + code: OPTIMIZE_CHUNK_STATUS, + message: `${pointInTime}, there are\n` + + `${chunks} chunks, of which\n` + + `${smallChunks} are below minChunkSize.` + }; +} +function logParseError(message, pos) { + return { code: PARSE_ERROR, message, pos }; +} +function logRedeclarationError(name) { + return { + code: REDECLARATION_ERROR, + message: `Identifier "${name}" has already been declared` + }; +} +function logReservedNamespace(namespace) { + return { + code: RESERVED_NAMESPACE, + message: `You have overided reserved namespace "${namespace}"` + }; +} +function logModuleParseError(error, moduleId) { + let message = error.message.replace(/ \(\d+:\d+\)$/, ''); + if (moduleId.endsWith('.json')) { + message += ' (Note that you need @rollup/plugin-json to import JSON files)'; + } + else if (!moduleId.endsWith('.js')) { + message += ' (Note that you need plugins to import files that are not JavaScript)'; + } + return tweakStackMessage({ + cause: error, + code: PARSE_ERROR, + id: moduleId, + message, + stack: error.stack + }, error.message); +} +function logPluginError(error, plugin, { hook, id } = {}) { + const code = error.code; + if (!error.pluginCode && + code != null && + (typeof code !== 'string' || !code.startsWith('PLUGIN_'))) { + error.pluginCode = code; + } + error.code = PLUGIN_ERROR; + error.plugin = plugin; + if (hook) { + error.hook = hook; + } + if (id) { + error.id = id; + } + return error; +} +function logShimmedExport(id, binding) { + return { + binding, + code: SHIMMED_EXPORT, + exporter: id, + message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".` + }; +} +function logSourcemapBroken(plugin) { + return { + code: SOURCEMAP_BROKEN, + message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, + plugin, + url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT) + }; +} +function logConflictingSourcemapSources(filename) { + return { + code: SOURCEMAP_BROKEN, + message: `Multiple conflicting contents for sourcemap source ${filename}` + }; +} +function logInvalidSourcemapForError(error, id, column, line, pos) { + return { + cause: error, + code: SOURCEMAP_ERROR, + id, + loc: { + column, + file: id, + line + }, + message: `Error when using sourcemap for reporting an error: ${error.message}`, + pos + }; +} +function logSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) { + return { + code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT, + exporter: id, + message: `Module "${relativeId(id)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}\` needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default' + ? `an explicit export named "${syntheticNamedExportsOption}"` + : 'a default export'} that does not reexport an unresolved named export of the same module.` + }; +} +function logThisIsUndefined() { + return { + code: THIS_IS_UNDEFINED, + message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`, + url: getRollupUrl(URL_THIS_IS_UNDEFINED) + }; +} +function logUnexpectedNamedImport(id, imported, isReexport) { + const importType = isReexport ? 'reexport' : 'import'; + return { + code: UNEXPECTED_NAMED_IMPORT, + exporter: id, + message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`, + url: getRollupUrl(URL_OUTPUT_INTEROP) + }; +} +function logUnexpectedNamespaceReexport(id) { + return { + code: UNEXPECTED_NAMED_IMPORT, + exporter: id, + message: `There was a namespace "*" reexport from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`, + url: getRollupUrl(URL_OUTPUT_INTEROP) + }; +} +function logUnknownOption(optionType, unknownOptions, validOptions) { + return { + code: UNKNOWN_OPTION, + message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.join(', ')}` + }; +} +function logEntryCannotBeExternal(unresolvedId) { + return { + code: UNRESOLVED_ENTRY, + message: `Entry module "${relativeId(unresolvedId)}" cannot be external.` + }; +} +function logExternalModulesCannotBeIncludedInManualChunks(source) { + return { + code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS, + message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.` + }; +} +function logExternalModulesCannotBeTransformedToModules(source) { + return { + code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES, + message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.` + }; +} +function logUnresolvedEntry(unresolvedId) { + return { + code: UNRESOLVED_ENTRY, + message: `Could not resolve entry module "${relativeId(unresolvedId)}".` + }; +} +function logUnresolvedImport(source, importer) { + return { + code: UNRESOLVED_IMPORT, + exporter: source, + id: importer, + message: `Could not resolve "${source}" from "${relativeId(importer)}"` + }; +} +function logUnresolvedImportTreatedAsExternal(source, importer) { + return { + code: UNRESOLVED_IMPORT, + exporter: source, + id: importer, + message: `"${source}" is imported by "${relativeId(importer)}", but could not be resolved – treating it as an external dependency.`, + url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY) + }; +} +function logUnusedExternalImports(externalId, names, importers) { + return { + code: UNUSED_EXTERNAL_IMPORT, + exporter: externalId, + ids: importers, + message: `${printQuotedStringList(names, [ + 'is', + 'are' + ])} imported from external module "${externalId}" but never used in ${printQuotedStringList(importers.map(importer => relativeId(importer)))}.`, + names + }; +} +function logFailedValidation(message) { + return { + code: VALIDATION_ERROR, + message + }; +} +function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) { + warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations); +} +function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) { + if (activeDeprecation || strictDeprecations) { + const warning = logDeprecation(deprecation, urlSnippet); + if (strictDeprecations) { + return error(warning); + } + log(LOGLEVEL_WARN, warning); + } +} + +// This file is generated by scripts/generate-buffer-to-ast.js. +// Do not edit this file directly. +function convertProgram(buffer) { + const node = convertNode(0, buffer); + switch (node.type) { + case PanicError: { + return error(getRollupError(logParseError(node.message))); + } + case ParseError: { + return error(getRollupError(logParseError(node.message, node.start))); + } + default: { + return node; + } + } +} +/* eslint-disable sort-keys */ +const nodeConverters = [ + function panicError(position, buffer) { + return { + type: 'PanicError', + start: buffer[position], + end: buffer[position + 1], + message: buffer.convertString(buffer[position + 2]) + }; + }, + function parseError(position, buffer) { + return { + type: 'ParseError', + start: buffer[position], + end: buffer[position + 1], + message: buffer.convertString(buffer[position + 2]) + }; + }, + function arrayExpression(position, buffer) { + return { + type: 'ArrayExpression', + start: buffer[position], + end: buffer[position + 1], + elements: convertNodeList(buffer[position + 2], buffer) + }; + }, + function arrayPattern(position, buffer) { + return { + type: 'ArrayPattern', + start: buffer[position], + end: buffer[position + 1], + elements: convertNodeList(buffer[position + 2], buffer) + }; + }, + function arrowFunctionExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'ArrowFunctionExpression', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + expression: (flags & 2) === 2, + generator: (flags & 4) === 4, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + params: convertNodeList(buffer[position + 4], buffer), + body: convertNode(buffer[position + 5], buffer), + id: null + }; + }, + function assignmentExpression(position, buffer) { + return { + type: 'AssignmentExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function assignmentPattern(position, buffer) { + return { + type: 'AssignmentPattern', + start: buffer[position], + end: buffer[position + 1], + left: convertNode(buffer[position + 2], buffer), + right: convertNode(buffer[position + 3], buffer) + }; + }, + function awaitExpression(position, buffer) { + return { + type: 'AwaitExpression', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function binaryExpression(position, buffer) { + return { + type: 'BinaryExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function blockStatement(position, buffer) { + return { + type: 'BlockStatement', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function breakStatement(position, buffer) { + const labelPosition = buffer[position + 2]; + return { + type: 'BreakStatement', + start: buffer[position], + end: buffer[position + 1], + label: labelPosition === 0 ? null : convertNode(labelPosition, buffer) + }; + }, + function callExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'CallExpression', + start: buffer[position], + end: buffer[position + 1], + optional: (flags & 1) === 1, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + callee: convertNode(buffer[position + 4], buffer), + arguments: convertNodeList(buffer[position + 5], buffer) + }; + }, + function catchClause(position, buffer) { + const parameterPosition = buffer[position + 2]; + return { + type: 'CatchClause', + start: buffer[position], + end: buffer[position + 1], + param: parameterPosition === 0 ? null : convertNode(parameterPosition, buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function chainExpression(position, buffer) { + return { + type: 'ChainExpression', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function classBody(position, buffer) { + return { + type: 'ClassBody', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function classDeclaration(position, buffer) { + const idPosition = buffer[position + 3]; + const superClassPosition = buffer[position + 4]; + return { + type: 'ClassDeclaration', + start: buffer[position], + end: buffer[position + 1], + decorators: convertNodeList(buffer[position + 2], buffer), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function classExpression(position, buffer) { + const idPosition = buffer[position + 3]; + const superClassPosition = buffer[position + 4]; + return { + type: 'ClassExpression', + start: buffer[position], + end: buffer[position + 1], + decorators: convertNodeList(buffer[position + 2], buffer), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function conditionalExpression(position, buffer) { + return { + type: 'ConditionalExpression', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + consequent: convertNode(buffer[position + 3], buffer), + alternate: convertNode(buffer[position + 4], buffer) + }; + }, + function continueStatement(position, buffer) { + const labelPosition = buffer[position + 2]; + return { + type: 'ContinueStatement', + start: buffer[position], + end: buffer[position + 1], + label: labelPosition === 0 ? null : convertNode(labelPosition, buffer) + }; + }, + function debuggerStatement(position, buffer) { + return { + type: 'DebuggerStatement', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function decorator(position, buffer) { + return { + type: 'Decorator', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function directive(position, buffer) { + return { + type: 'ExpressionStatement', + start: buffer[position], + end: buffer[position + 1], + directive: buffer.convertString(buffer[position + 2]), + expression: convertNode(buffer[position + 3], buffer) + }; + }, + function doWhileStatement(position, buffer) { + return { + type: 'DoWhileStatement', + start: buffer[position], + end: buffer[position + 1], + body: convertNode(buffer[position + 2], buffer), + test: convertNode(buffer[position + 3], buffer) + }; + }, + function emptyStatement(position, buffer) { + return { + type: 'EmptyStatement', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function exportAllDeclaration(position, buffer) { + const exportedPosition = buffer[position + 2]; + return { + type: 'ExportAllDeclaration', + start: buffer[position], + end: buffer[position + 1], + exported: exportedPosition === 0 ? null : convertNode(exportedPosition, buffer), + source: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function exportDefaultDeclaration(position, buffer) { + return { + type: 'ExportDefaultDeclaration', + start: buffer[position], + end: buffer[position + 1], + declaration: convertNode(buffer[position + 2], buffer) + }; + }, + function exportNamedDeclaration(position, buffer) { + const sourcePosition = buffer[position + 3]; + const declarationPosition = buffer[position + 5]; + return { + type: 'ExportNamedDeclaration', + start: buffer[position], + end: buffer[position + 1], + specifiers: convertNodeList(buffer[position + 2], buffer), + source: sourcePosition === 0 ? null : convertNode(sourcePosition, buffer), + attributes: convertNodeList(buffer[position + 4], buffer), + declaration: declarationPosition === 0 ? null : convertNode(declarationPosition, buffer) + }; + }, + function exportSpecifier(position, buffer) { + const local = convertNode(buffer[position + 2], buffer); + const exportedPosition = buffer[position + 3]; + return { + type: 'ExportSpecifier', + start: buffer[position], + end: buffer[position + 1], + local, + exported: exportedPosition === 0 ? { ...local } : convertNode(exportedPosition, buffer) + }; + }, + function expressionStatement(position, buffer) { + return { + type: 'ExpressionStatement', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function forInStatement(position, buffer) { + return { + type: 'ForInStatement', + start: buffer[position], + end: buffer[position + 1], + left: convertNode(buffer[position + 2], buffer), + right: convertNode(buffer[position + 3], buffer), + body: convertNode(buffer[position + 4], buffer) + }; + }, + function forOfStatement(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'ForOfStatement', + start: buffer[position], + end: buffer[position + 1], + await: (flags & 1) === 1, + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function forStatement(position, buffer) { + const initPosition = buffer[position + 2]; + const testPosition = buffer[position + 3]; + const updatePosition = buffer[position + 4]; + return { + type: 'ForStatement', + start: buffer[position], + end: buffer[position + 1], + init: initPosition === 0 ? null : convertNode(initPosition, buffer), + test: testPosition === 0 ? null : convertNode(testPosition, buffer), + update: updatePosition === 0 ? null : convertNode(updatePosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function functionDeclaration(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + const idPosition = buffer[position + 4]; + return { + type: 'FunctionDeclaration', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + generator: (flags & 2) === 2, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + params: convertNodeList(buffer[position + 5], buffer), + body: convertNode(buffer[position + 6], buffer), + expression: false + }; + }, + function functionExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + const idPosition = buffer[position + 4]; + return { + type: 'FunctionExpression', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + generator: (flags & 2) === 2, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + params: convertNodeList(buffer[position + 5], buffer), + body: convertNode(buffer[position + 6], buffer), + expression: false + }; + }, + function identifier(position, buffer) { + return { + type: 'Identifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function ifStatement(position, buffer) { + const alternatePosition = buffer[position + 4]; + return { + type: 'IfStatement', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + consequent: convertNode(buffer[position + 3], buffer), + alternate: alternatePosition === 0 ? null : convertNode(alternatePosition, buffer) + }; + }, + function importAttribute(position, buffer) { + return { + type: 'ImportAttribute', + start: buffer[position], + end: buffer[position + 1], + key: convertNode(buffer[position + 2], buffer), + value: convertNode(buffer[position + 3], buffer) + }; + }, + function importDeclaration(position, buffer) { + return { + type: 'ImportDeclaration', + start: buffer[position], + end: buffer[position + 1], + specifiers: convertNodeList(buffer[position + 2], buffer), + source: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function importDefaultSpecifier(position, buffer) { + return { + type: 'ImportDefaultSpecifier', + start: buffer[position], + end: buffer[position + 1], + local: convertNode(buffer[position + 2], buffer) + }; + }, + function importExpression(position, buffer) { + const optionsPosition = buffer[position + 3]; + return { + type: 'ImportExpression', + start: buffer[position], + end: buffer[position + 1], + source: convertNode(buffer[position + 2], buffer), + options: optionsPosition === 0 ? null : convertNode(optionsPosition, buffer) + }; + }, + function importNamespaceSpecifier(position, buffer) { + return { + type: 'ImportNamespaceSpecifier', + start: buffer[position], + end: buffer[position + 1], + local: convertNode(buffer[position + 2], buffer) + }; + }, + function importSpecifier(position, buffer) { + const importedPosition = buffer[position + 2]; + const local = convertNode(buffer[position + 3], buffer); + return { + type: 'ImportSpecifier', + start: buffer[position], + end: buffer[position + 1], + imported: importedPosition === 0 ? { ...local } : convertNode(importedPosition, buffer), + local + }; + }, + function jsxAttribute(position, buffer) { + const valuePosition = buffer[position + 3]; + return { + type: 'JSXAttribute', + start: buffer[position], + end: buffer[position + 1], + name: convertNode(buffer[position + 2], buffer), + value: valuePosition === 0 ? null : convertNode(valuePosition, buffer) + }; + }, + function jsxClosingElement(position, buffer) { + return { + type: 'JSXClosingElement', + start: buffer[position], + end: buffer[position + 1], + name: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxClosingFragment(position, buffer) { + return { + type: 'JSXClosingFragment', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function jsxElement(position, buffer) { + const closingElementPosition = buffer[position + 4]; + return { + type: 'JSXElement', + start: buffer[position], + end: buffer[position + 1], + openingElement: convertNode(buffer[position + 2], buffer), + children: convertNodeList(buffer[position + 3], buffer), + closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer) + }; + }, + function jsxEmptyExpression(position, buffer) { + return { + type: 'JSXEmptyExpression', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function jsxExpressionContainer(position, buffer) { + return { + type: 'JSXExpressionContainer', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxFragment(position, buffer) { + return { + type: 'JSXFragment', + start: buffer[position], + end: buffer[position + 1], + openingFragment: convertNode(buffer[position + 2], buffer), + children: convertNodeList(buffer[position + 3], buffer), + closingFragment: convertNode(buffer[position + 4], buffer) + }; + }, + function jsxIdentifier(position, buffer) { + return { + type: 'JSXIdentifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function jsxMemberExpression(position, buffer) { + return { + type: 'JSXMemberExpression', + start: buffer[position], + end: buffer[position + 1], + object: convertNode(buffer[position + 2], buffer), + property: convertNode(buffer[position + 3], buffer) + }; + }, + function jsxNamespacedName(position, buffer) { + return { + type: 'JSXNamespacedName', + start: buffer[position], + end: buffer[position + 1], + namespace: convertNode(buffer[position + 2], buffer), + name: convertNode(buffer[position + 3], buffer) + }; + }, + function jsxOpeningElement(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'JSXOpeningElement', + start: buffer[position], + end: buffer[position + 1], + selfClosing: (flags & 1) === 1, + name: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function jsxOpeningFragment(position, buffer) { + return { + type: 'JSXOpeningFragment', + start: buffer[position], + end: buffer[position + 1], + attributes: [], + selfClosing: false + }; + }, + function jsxSpreadAttribute(position, buffer) { + return { + type: 'JSXSpreadAttribute', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxSpreadChild(position, buffer) { + return { + type: 'JSXSpreadChild', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxText(position, buffer) { + return { + type: 'JSXText', + start: buffer[position], + end: buffer[position + 1], + value: buffer.convertString(buffer[position + 2]), + raw: buffer.convertString(buffer[position + 3]) + }; + }, + function labeledStatement(position, buffer) { + return { + type: 'LabeledStatement', + start: buffer[position], + end: buffer[position + 1], + label: convertNode(buffer[position + 2], buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function literalBigInt(position, buffer) { + const bigint = buffer.convertString(buffer[position + 2]); + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + bigint, + raw: buffer.convertString(buffer[position + 3]), + value: BigInt(bigint) + }; + }, + function literalBoolean(position, buffer) { + const flags = buffer[position + 2]; + const value = (flags & 1) === 1; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + value, + raw: value ? 'true' : 'false' + }; + }, + function literalNull(position, buffer) { + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: 'null', + value: null + }; + }, + function literalNumber(position, buffer) { + const rawPosition = buffer[position + 2]; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition), + value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true) + }; + }, + function literalRegExp(position, buffer) { + const flags = buffer.convertString(buffer[position + 2]); + const pattern = buffer.convertString(buffer[position + 3]); + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: `/${pattern}/${flags}`, + regex: { flags, pattern }, + value: new RegExp(pattern, flags) + }; + }, + function literalString(position, buffer) { + const rawPosition = buffer[position + 3]; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + value: buffer.convertString(buffer[position + 2]), + raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition) + }; + }, + function logicalExpression(position, buffer) { + return { + type: 'LogicalExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function memberExpression(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'MemberExpression', + start: buffer[position], + end: buffer[position + 1], + computed: (flags & 1) === 1, + optional: (flags & 2) === 2, + object: convertNode(buffer[position + 3], buffer), + property: convertNode(buffer[position + 4], buffer) + }; + }, + function metaProperty(position, buffer) { + return { + type: 'MetaProperty', + start: buffer[position], + end: buffer[position + 1], + meta: convertNode(buffer[position + 2], buffer), + property: convertNode(buffer[position + 3], buffer) + }; + }, + function methodDefinition(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'MethodDefinition', + start: buffer[position], + end: buffer[position + 1], + static: (flags & 1) === 1, + computed: (flags & 2) === 2, + decorators: convertNodeList(buffer[position + 3], buffer), + key: convertNode(buffer[position + 4], buffer), + value: convertNode(buffer[position + 5], buffer), + kind: FIXED_STRINGS[buffer[position + 6]] + }; + }, + function newExpression(position, buffer) { + const annotations = convertAnnotations(buffer[position + 2], buffer); + return { + type: 'NewExpression', + start: buffer[position], + end: buffer[position + 1], + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + callee: convertNode(buffer[position + 3], buffer), + arguments: convertNodeList(buffer[position + 4], buffer) + }; + }, + function objectExpression(position, buffer) { + return { + type: 'ObjectExpression', + start: buffer[position], + end: buffer[position + 1], + properties: convertNodeList(buffer[position + 2], buffer) + }; + }, + function objectPattern(position, buffer) { + return { + type: 'ObjectPattern', + start: buffer[position], + end: buffer[position + 1], + properties: convertNodeList(buffer[position + 2], buffer) + }; + }, + function privateIdentifier(position, buffer) { + return { + type: 'PrivateIdentifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function program(position, buffer) { + const invalidAnnotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'Program', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer), + ...(invalidAnnotations.length > 0 ? { [INVALID_ANNOTATION_KEY]: invalidAnnotations } : {}), + sourceType: 'module' + }; + }, + function property(position, buffer) { + const flags = buffer[position + 2]; + const keyPosition = buffer[position + 3]; + const value = convertNode(buffer[position + 4], buffer); + return { + type: 'Property', + start: buffer[position], + end: buffer[position + 1], + method: (flags & 1) === 1, + shorthand: (flags & 2) === 2, + computed: (flags & 4) === 4, + key: keyPosition === 0 ? { ...value } : convertNode(keyPosition, buffer), + value, + kind: FIXED_STRINGS[buffer[position + 5]] + }; + }, + function propertyDefinition(position, buffer) { + const flags = buffer[position + 2]; + const valuePosition = buffer[position + 5]; + return { + type: 'PropertyDefinition', + start: buffer[position], + end: buffer[position + 1], + static: (flags & 1) === 1, + computed: (flags & 2) === 2, + decorators: convertNodeList(buffer[position + 3], buffer), + key: convertNode(buffer[position + 4], buffer), + value: valuePosition === 0 ? null : convertNode(valuePosition, buffer) + }; + }, + function restElement(position, buffer) { + return { + type: 'RestElement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function returnStatement(position, buffer) { + const argumentPosition = buffer[position + 2]; + return { + type: 'ReturnStatement', + start: buffer[position], + end: buffer[position + 1], + argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer) + }; + }, + function sequenceExpression(position, buffer) { + return { + type: 'SequenceExpression', + start: buffer[position], + end: buffer[position + 1], + expressions: convertNodeList(buffer[position + 2], buffer) + }; + }, + function spreadElement(position, buffer) { + return { + type: 'SpreadElement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function staticBlock(position, buffer) { + return { + type: 'StaticBlock', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function superElement(position, buffer) { + return { + type: 'Super', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function switchCase(position, buffer) { + const testPosition = buffer[position + 2]; + return { + type: 'SwitchCase', + start: buffer[position], + end: buffer[position + 1], + test: testPosition === 0 ? null : convertNode(testPosition, buffer), + consequent: convertNodeList(buffer[position + 3], buffer) + }; + }, + function switchStatement(position, buffer) { + return { + type: 'SwitchStatement', + start: buffer[position], + end: buffer[position + 1], + discriminant: convertNode(buffer[position + 2], buffer), + cases: convertNodeList(buffer[position + 3], buffer) + }; + }, + function taggedTemplateExpression(position, buffer) { + return { + type: 'TaggedTemplateExpression', + start: buffer[position], + end: buffer[position + 1], + tag: convertNode(buffer[position + 2], buffer), + quasi: convertNode(buffer[position + 3], buffer) + }; + }, + function templateElement(position, buffer) { + const flags = buffer[position + 2]; + const cookedPosition = buffer[position + 3]; + const cooked = cookedPosition === 0 ? undefined : buffer.convertString(cookedPosition); + const raw = buffer.convertString(buffer[position + 4]); + return { + type: 'TemplateElement', + start: buffer[position], + end: buffer[position + 1], + tail: (flags & 1) === 1, + value: { cooked, raw } + }; + }, + function templateLiteral(position, buffer) { + return { + type: 'TemplateLiteral', + start: buffer[position], + end: buffer[position + 1], + quasis: convertNodeList(buffer[position + 2], buffer), + expressions: convertNodeList(buffer[position + 3], buffer) + }; + }, + function thisExpression(position, buffer) { + return { + type: 'ThisExpression', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function throwStatement(position, buffer) { + return { + type: 'ThrowStatement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function tryStatement(position, buffer) { + const handlerPosition = buffer[position + 3]; + const finalizerPosition = buffer[position + 4]; + return { + type: 'TryStatement', + start: buffer[position], + end: buffer[position + 1], + block: convertNode(buffer[position + 2], buffer), + handler: handlerPosition === 0 ? null : convertNode(handlerPosition, buffer), + finalizer: finalizerPosition === 0 ? null : convertNode(finalizerPosition, buffer) + }; + }, + function unaryExpression(position, buffer) { + return { + type: 'UnaryExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + argument: convertNode(buffer[position + 3], buffer), + prefix: true + }; + }, + function updateExpression(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'UpdateExpression', + start: buffer[position], + end: buffer[position + 1], + prefix: (flags & 1) === 1, + operator: FIXED_STRINGS[buffer[position + 3]], + argument: convertNode(buffer[position + 4], buffer) + }; + }, + function variableDeclaration(position, buffer) { + return { + type: 'VariableDeclaration', + start: buffer[position], + end: buffer[position + 1], + kind: FIXED_STRINGS[buffer[position + 2]], + declarations: convertNodeList(buffer[position + 3], buffer) + }; + }, + function variableDeclarator(position, buffer) { + const initPosition = buffer[position + 3]; + return { + type: 'VariableDeclarator', + start: buffer[position], + end: buffer[position + 1], + id: convertNode(buffer[position + 2], buffer), + init: initPosition === 0 ? null : convertNode(initPosition, buffer) + }; + }, + function whileStatement(position, buffer) { + return { + type: 'WhileStatement', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function yieldExpression(position, buffer) { + const flags = buffer[position + 2]; + const argumentPosition = buffer[position + 3]; + return { + type: 'YieldExpression', + start: buffer[position], + end: buffer[position + 1], + delegate: (flags & 1) === 1, + argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer) + }; + } +]; +function convertNode(position, buffer) { + const nodeType = buffer[position]; + const converter = nodeConverters[nodeType]; + /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */ + if (!converter) { + console.trace(); + throw new Error(`Unknown node type: ${nodeType}`); + } + return converter(position + 1, buffer); +} +function convertNodeList(position, buffer) { + if (position === 0) + return EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[position++]; + list[index] = nodePosition ? convertNode(nodePosition, buffer) : null; + } + return list; +} + +function getAstBuffer(astBuffer) { + const array = new Uint32Array(astBuffer.buffer); + let convertString; + if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) { + convertString = (position) => { + const length = array[position++]; + const bytePosition = position << 2; + return astBuffer.toString('utf8', bytePosition, bytePosition + length); + }; + } + else { + const textDecoder = new TextDecoder(); + convertString = (position) => { + const length = array[position++]; + const bytePosition = position << 2; + return textDecoder.decode(astBuffer.subarray(bytePosition, bytePosition + length)); + }; + } + return Object.assign(array, { convertString }); +} + +const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx))); +const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal))); + +export { ANNOTATION_KEY, ArrowFunctionExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, ObjectExpression, Program, Property, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation }; diff --git a/seller_1/node_modules/rollup/dist/es/shared/watch.js b/seller_1/node_modules/rollup/dist/es/shared/watch.js new file mode 100644 index 0000000..c7f22c2 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/es/shared/watch.js @@ -0,0 +1,9297 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import { getAugmentedNamespace, fseventsImporter, getDefaultExportFromCjs, createFilter, rollupInternal } from './node-entry.js'; +import path from 'node:path'; +import process$1 from 'node:process'; +import require$$0$1 from 'path'; +import require$$0$2 from 'fs'; +import require$$2 from 'util'; +import require$$1 from 'stream'; +import require$$2$1 from 'os'; +import require$$0$3 from 'events'; +import { platform } from 'node:os'; +import './parseAst.js'; +import '../../native.js'; +import 'node:perf_hooks'; +import 'node:fs/promises'; +import 'tty'; + +var chokidar$1 = {}; + +var utils$2 = {}; + +var constants$3; +var hasRequiredConstants$3; + +function requireConstants$3 () { + if (hasRequiredConstants$3) return constants$3; + hasRequiredConstants$3 = 1; + + const path = require$$0$1; + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants$3 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants$3; +} + +var hasRequiredUtils$2; + +function requireUtils$2 () { + if (hasRequiredUtils$2) return utils$2; + hasRequiredUtils$2 = 1; + (function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants$3(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } (utils$2)); + return utils$2; +} + +var scan_1$1; +var hasRequiredScan$1; + +function requireScan$1 () { + if (hasRequiredScan$1) return scan_1$1; + hasRequiredScan$1 = 1; + + const utils = /*@__PURE__*/ requireUtils$2(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants$3(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1$1 = scan; + return scan_1$1; +} + +var parse_1$2; +var hasRequiredParse$2; + +function requireParse$2 () { + if (hasRequiredParse$2) return parse_1$2; + hasRequiredParse$2 = 1; + + const constants = /*@__PURE__*/ requireConstants$3(); + const utils = /*@__PURE__*/ requireUtils$2(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1$2 = parse; + return parse_1$2; +} + +var picomatch_1$1; +var hasRequiredPicomatch$3; + +function requirePicomatch$3 () { + if (hasRequiredPicomatch$3) return picomatch_1$1; + hasRequiredPicomatch$3 = 1; + + const path = require$$0$1; + const scan = /*@__PURE__*/ requireScan$1(); + const parse = /*@__PURE__*/ requireParse$2(); + const utils = /*@__PURE__*/ requireUtils$2(); + const constants = /*@__PURE__*/ requireConstants$3(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1$1 = picomatch; + return picomatch_1$1; +} + +var picomatch$1; +var hasRequiredPicomatch$2; + +function requirePicomatch$2 () { + if (hasRequiredPicomatch$2) return picomatch$1; + hasRequiredPicomatch$2 = 1; + + picomatch$1 = /*@__PURE__*/ requirePicomatch$3(); + return picomatch$1; +} + +var readdirp_1; +var hasRequiredReaddirp; + +function requireReaddirp () { + if (hasRequiredReaddirp) return readdirp_1; + hasRequiredReaddirp = 1; + + const fs = require$$0$2; + const { Readable } = require$$1; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const picomatch = /*@__PURE__*/ requirePicomatch$2(); + + const readdir = promisify(fs.readdir); + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const realpath = promisify(fs.realpath); + + /** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + + const BANG = '!'; + const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; + const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); + const FILE_TYPE = 'files'; + const DIR_TYPE = 'directories'; + const FILE_DIR_TYPE = 'files_directories'; + const EVERYTHING_TYPE = 'all'; + const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + + const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); + const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); + const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + + const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } + }; + + class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } + } + + /** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + + /** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ + const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); + }; + + const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); + }; + + readdirp.promise = readdirpPromise; + readdirp.ReaddirpStream = ReaddirpStream; + readdirp.default = readdirp; + + readdirp_1 = readdirp; + return readdirp_1; +} + +var anymatch = {exports: {}}; + +var utils$1 = {}; + +var constants$2; +var hasRequiredConstants$2; + +function requireConstants$2 () { + if (hasRequiredConstants$2) return constants$2; + hasRequiredConstants$2 = 1; + + const path = require$$0$1; + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants$2; +} + +var hasRequiredUtils$1; + +function requireUtils$1 () { + if (hasRequiredUtils$1) return utils$1; + hasRequiredUtils$1 = 1; + (function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants$2(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } (utils$1)); + return utils$1; +} + +var scan_1; +var hasRequiredScan; + +function requireScan () { + if (hasRequiredScan) return scan_1; + hasRequiredScan = 1; + + const utils = /*@__PURE__*/ requireUtils$1(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants$2(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1 = scan; + return scan_1; +} + +var parse_1$1; +var hasRequiredParse$1; + +function requireParse$1 () { + if (hasRequiredParse$1) return parse_1$1; + hasRequiredParse$1 = 1; + + const constants = /*@__PURE__*/ requireConstants$2(); + const utils = /*@__PURE__*/ requireUtils$1(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1$1 = parse; + return parse_1$1; +} + +var picomatch_1; +var hasRequiredPicomatch$1; + +function requirePicomatch$1 () { + if (hasRequiredPicomatch$1) return picomatch_1; + hasRequiredPicomatch$1 = 1; + + const path = require$$0$1; + const scan = /*@__PURE__*/ requireScan(); + const parse = /*@__PURE__*/ requireParse$1(); + const utils = /*@__PURE__*/ requireUtils$1(); + const constants = /*@__PURE__*/ requireConstants$2(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1 = picomatch; + return picomatch_1; +} + +var picomatch; +var hasRequiredPicomatch; + +function requirePicomatch () { + if (hasRequiredPicomatch) return picomatch; + hasRequiredPicomatch = 1; + + picomatch = /*@__PURE__*/ requirePicomatch$1(); + return picomatch; +} + +/*! + * normalize-path <https://github.com/jonschlinkert/normalize-path> + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +var normalizePath; +var hasRequiredNormalizePath; + +function requireNormalizePath () { + if (hasRequiredNormalizePath) return normalizePath; + hasRequiredNormalizePath = 1; + normalizePath = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); + }; + return normalizePath; +} + +var anymatch_1 = anymatch.exports; + +var hasRequiredAnymatch; + +function requireAnymatch () { + if (hasRequiredAnymatch) return anymatch.exports; + hasRequiredAnymatch = 1; + + Object.defineProperty(anymatch_1, "__esModule", { value: true }); + + const picomatch = /*@__PURE__*/ requirePicomatch(); + const normalizePath = /*@__PURE__*/ requireNormalizePath(); + + /** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ + const BANG = '!'; + const DEFAULT_OPTIONS = {returnIndex: false}; + const arrify = (item) => Array.isArray(item) ? item : [item]; + + /** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ + const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; + }; + + /** + * @param {Array<Function>} patterns + * @param {Array<Function>} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ + const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath(_path, false); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; + } + } + + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; + } + } + + return returnIndex ? -1 : false; + }; + + /** + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} + */ + const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; + + // Early cache for matchers. + const mtchers = arrify(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) + .map(matcher => createPattern(matcher, opts)); + + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } + + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + }; + + anymatch$1.default = anymatch$1; + anymatch.exports = anymatch$1; + return anymatch.exports; +} + +/*! + * is-extglob <https://github.com/jonschlinkert/is-extglob> + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob; +var hasRequiredIsExtglob; + +function requireIsExtglob () { + if (hasRequiredIsExtglob) return isExtglob; + hasRequiredIsExtglob = 1; + isExtglob = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; + }; + return isExtglob; +} + +/*! + * is-glob <https://github.com/jonschlinkert/is-glob> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isGlob; +var hasRequiredIsGlob; + +function requireIsGlob () { + if (hasRequiredIsGlob) return isGlob; + hasRequiredIsGlob = 1; + var isExtglob = /*@__PURE__*/ requireIsExtglob(); + var chars = { '{': '}', '(': ')', '[': ']'}; + var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; + }; + + var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; + }; + + isGlob = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); + }; + return isGlob; +} + +var globParent; +var hasRequiredGlobParent; + +function requireGlobParent () { + if (hasRequiredGlobParent) return globParent; + hasRequiredGlobParent = 1; + + var isGlob = /*@__PURE__*/ requireIsGlob(); + var pathPosixDirname = require$$0$1.posix.dirname; + var isWin32 = require$$2$1.platform() === 'win32'; + + var slash = '/'; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + + /** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ + globParent = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); + }; + return globParent; +} + +var utils = {}; + +var hasRequiredUtils; + +function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + (function (exports) { + + exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; + }; + + /** + * Find a node of the given type + */ + + exports.find = (node, type) => node.nodes.find(node => node.type === type); + + /** + * Find a node of the given type + */ + + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; + }; + + /** + * Escape the given node with '\\' before node.value + */ + + exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } + }; + + /** + * Returns true if the given brace node should be enclosed in literal braces + */ + + exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a brace node is invalid. + */ + + exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a node is an open or close node + */ + + exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; + }; + + /** + * Reduce an array of text nodes. + */ + + exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; + }, []); + + /** + * Flatten an array + */ + + exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; + }; + } (utils)); + return utils; +} + +var stringify; +var hasRequiredStringify; + +function requireStringify () { + if (hasRequiredStringify) return stringify; + hasRequiredStringify = 1; + + const utils = /*@__PURE__*/ requireUtils(); + + stringify = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); + }; + return stringify; +} + +/*! + * is-number <https://github.com/jonschlinkert/is-number> + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var isNumber; +var hasRequiredIsNumber; + +function requireIsNumber () { + if (hasRequiredIsNumber) return isNumber; + hasRequiredIsNumber = 1; + + isNumber = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; + }; + return isNumber; +} + +/*! + * to-regex-range <https://github.com/micromatch/to-regex-range> + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var toRegexRange_1; +var hasRequiredToRegexRange; + +function requireToRegexRange () { + if (hasRequiredToRegexRange) return toRegexRange_1; + hasRequiredToRegexRange = 1; + + const isNumber = /*@__PURE__*/ requireIsNumber(); + + const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; + }; + + function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false) || []; + let onlyPositive = filterPatterns(pos, neg, '', false) || []; + let intersected = filterPatterns(neg, pos, '-?', true) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); + } + + function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; + } + + /** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + + function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; + } + + function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; + } + + function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; + } + + /** + * Zip strings + */ + + function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; + } + + function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; + } + + function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); + } + + function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); + } + + function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); + } + + function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; + } + + function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; + } + + function hasPadding(str) { + return /^-?(0+)\d/.test(str); + } + + function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } + } + + /** + * Cache + */ + + toRegexRange.cache = {}; + toRegexRange.clearCache = () => (toRegexRange.cache = {}); + + /** + * Expose `toRegexRange` + */ + + toRegexRange_1 = toRegexRange; + return toRegexRange_1; +} + +/*! + * fill-range <https://github.com/jonschlinkert/fill-range> + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var fillRange; +var hasRequiredFillRange; + +function requireFillRange () { + if (hasRequiredFillRange) return fillRange; + hasRequiredFillRange = 1; + + const util = require$$2; + const toRegexRange = /*@__PURE__*/ requireToRegexRange(); + + const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + + const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); + }; + + const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); + }; + + const isNumber = num => Number.isInteger(+num); + + const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; + }; + + const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; + }; + + const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; + }; + + const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; + }; + + const toSequence = (parts, options, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; + }; + + const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; + }; + + const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); + }; + + const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); + }; + + const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + }; + + const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; + }; + + const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options, maxLen) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; + }; + + const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; + }; + + const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); + }; + + fillRange = fill; + return fillRange; +} + +var compile_1; +var hasRequiredCompile; + +function requireCompile () { + if (hasRequiredCompile) return compile_1; + hasRequiredCompile = 1; + + const fill = /*@__PURE__*/ requireFillRange(); + const utils = /*@__PURE__*/ requireUtils(); + + const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); + }; + + compile_1 = compile; + return compile_1; +} + +var expand_1; +var hasRequiredExpand; + +function requireExpand () { + if (hasRequiredExpand) return expand_1; + hasRequiredExpand = 1; + + const fill = /*@__PURE__*/ requireFillRange(); + const stringify = /*@__PURE__*/ requireStringify(); + const utils = /*@__PURE__*/ requireUtils(); + + const append = (queue = '', stash = '', enclose = false) => { + const result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); + }; + + const expand = (ast, options = {}) => { + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); + }; + + expand_1 = expand; + return expand_1; +} + +var constants$1; +var hasRequiredConstants$1; + +function requireConstants$1 () { + if (hasRequiredConstants$1) return constants$1; + hasRequiredConstants$1 = 1; + + constants$1 = { + MAX_LENGTH: 10000, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ + }; + return constants$1; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + const stringify = /*@__PURE__*/ requireStringify(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE + } = /*@__PURE__*/ requireConstants$1(); + + /** + * parse + */ + + const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; + }; + + parse_1 = parse; + return parse_1; +} + +var braces_1; +var hasRequiredBraces; + +function requireBraces () { + if (hasRequiredBraces) return braces_1; + hasRequiredBraces = 1; + + const stringify = /*@__PURE__*/ requireStringify(); + const compile = /*@__PURE__*/ requireCompile(); + const expand = /*@__PURE__*/ requireExpand(); + const parse = /*@__PURE__*/ requireParse(); + + /** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + + const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; + }; + + /** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + + braces.parse = (input, options = {}) => parse(input, options); + + /** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); + }; + + /** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); + }; + + /** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; + }; + + /** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); + }; + + /** + * Expose "braces" + */ + + braces_1 = braces; + return braces_1; +} + +const require$$0 = [ + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "afdesign", + "afphoto", + "afpub", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "appimage", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "flatpak", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "odp", + "ods", + "odt", + "oga", + "ogg", + "ogv", + "otf", + "ott", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rpm", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "snap", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx" +]; + +var binaryExtensions; +var hasRequiredBinaryExtensions; + +function requireBinaryExtensions () { + if (hasRequiredBinaryExtensions) return binaryExtensions; + hasRequiredBinaryExtensions = 1; + binaryExtensions = require$$0; + return binaryExtensions; +} + +var isBinaryPath; +var hasRequiredIsBinaryPath; + +function requireIsBinaryPath () { + if (hasRequiredIsBinaryPath) return isBinaryPath; + hasRequiredIsBinaryPath = 1; + const path = require$$0$1; + const binaryExtensions = /*@__PURE__*/ requireBinaryExtensions(); + + const extensions = new Set(binaryExtensions); + + isBinaryPath = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); + return isBinaryPath; +} + +var constants = {}; + +var hasRequiredConstants; + +function requireConstants () { + if (hasRequiredConstants) return constants; + hasRequiredConstants = 1; + (function (exports) { + + const {sep} = require$$0$1; + const {platform} = process; + const os = require$$2$1; + + exports.EV_ALL = 'all'; + exports.EV_READY = 'ready'; + exports.EV_ADD = 'add'; + exports.EV_CHANGE = 'change'; + exports.EV_ADD_DIR = 'addDir'; + exports.EV_UNLINK = 'unlink'; + exports.EV_UNLINK_DIR = 'unlinkDir'; + exports.EV_RAW = 'raw'; + exports.EV_ERROR = 'error'; + + exports.STR_DATA = 'data'; + exports.STR_END = 'end'; + exports.STR_CLOSE = 'close'; + + exports.FSEVENT_CREATED = 'created'; + exports.FSEVENT_MODIFIED = 'modified'; + exports.FSEVENT_DELETED = 'deleted'; + exports.FSEVENT_MOVED = 'moved'; + exports.FSEVENT_CLONED = 'cloned'; + exports.FSEVENT_UNKNOWN = 'unknown'; + exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; + exports.FSEVENT_TYPE_FILE = 'file'; + exports.FSEVENT_TYPE_DIRECTORY = 'directory'; + exports.FSEVENT_TYPE_SYMLINK = 'symlink'; + + exports.KEY_LISTENERS = 'listeners'; + exports.KEY_ERR = 'errHandlers'; + exports.KEY_RAW = 'rawEmitters'; + exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; + + exports.DOT_SLASH = `.${sep}`; + + exports.BACK_SLASH_RE = /\\/g; + exports.DOUBLE_SLASH_RE = /\/\//; + exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; + exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; + exports.REPLACER_RE = /^\.[/\\]/; + + exports.SLASH = '/'; + exports.SLASH_SLASH = '//'; + exports.BRACE_START = '{'; + exports.BANG = '!'; + exports.ONE_DOT = '.'; + exports.TWO_DOTS = '..'; + exports.STAR = '*'; + exports.GLOBSTAR = '**'; + exports.ROOT_GLOBSTAR = '/**/*'; + exports.SLASH_GLOBSTAR = '/**'; + exports.DIR_SUFFIX = 'Dir'; + exports.ANYMATCH_OPTS = {dot: true}; + exports.STRING_TYPE = 'string'; + exports.FUNCTION_TYPE = 'function'; + exports.EMPTY_STR = ''; + exports.EMPTY_FN = () => {}; + exports.IDENTITY_FN = val => val; + + exports.isWindows = platform === 'win32'; + exports.isMacos = platform === 'darwin'; + exports.isLinux = platform === 'linux'; + exports.isIBMi = os.type() === 'OS400'; + } (constants)); + return constants; +} + +var nodefsHandler; +var hasRequiredNodefsHandler; + +function requireNodefsHandler () { + if (hasRequiredNodefsHandler) return nodefsHandler; + hasRequiredNodefsHandler = 1; + + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const isBinaryPath = /*@__PURE__*/ requireIsBinaryPath(); + const { + isWindows, + isLinux, + EMPTY_FN, + EMPTY_STR, + KEY_LISTENERS, + KEY_ERR, + KEY_RAW, + HANDLER_KEYS, + EV_CHANGE, + EV_ADD, + EV_ADD_DIR, + EV_ERROR, + STR_DATA, + STR_END, + BRACE_START, + STAR + } = /*@__PURE__*/ requireConstants(); + + const THROTTLE_MODE_WATCH = 'watch'; + + const open = promisify(fs.open); + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const close = promisify(fs.close); + const fsrealpath = promisify(fs.realpath); + + const statMethods = { lstat, stat }; + + // TODO: emit errors properly. Example: EMFILE on Macos. + const foreach = (val, fn) => { + if (val instanceof Set) { + val.forEach(fn); + } else { + fn(val); + } + }; + + const addAndConvert = (main, prop, item) => { + let container = main[prop]; + if (!(container instanceof Set)) { + main[prop] = container = new Set([container]); + } + container.add(item); + }; + + const clearItem = cont => key => { + const set = cont[key]; + if (set instanceof Set) { + set.clear(); + } else { + delete cont[key]; + } + }; + + const delFromSet = (main, prop, item) => { + const container = main[prop]; + if (container instanceof Set) { + container.delete(item); + } else if (container === item) { + delete main[prop]; + } + }; + + const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; + + /** + * @typedef {String} Path + */ + + // fs_watch helpers + + // object to hold per-process fs_watch instances + // (may be shared across chokidar FSWatcher instances) + + /** + * @typedef {Object} FsWatchContainer + * @property {Set} listeners + * @property {Set} errHandlers + * @property {Set} rawEmitters + * @property {fs.FSWatcher=} watcher + * @property {Boolean=} watcherUnusable + */ + + /** + * @type {Map<String,FsWatchContainer>} + */ + const FsWatchInstances = new Map(); + + /** + * Instantiates the fs_watch interface + * @param {String} path to be watched + * @param {Object} options to be passed to fs_watch + * @param {Function} listener main event handler + * @param {Function} errHandler emits info about errors + * @param {Function} emitRaw emits raw event data + * @returns {fs.FSWatcher} new fsevents instance + */ + function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { + const handleEvent = (rawEvent, evPath) => { + listener(path); + emitRaw(rawEvent, evPath, {watchedPath: path}); + + // emit based on events occurring for files from a directory's watcher in + // case the file's watcher misses it (and rely on throttling to de-dupe) + if (evPath && path !== evPath) { + fsWatchBroadcast( + sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) + ); + } + }; + try { + return fs.watch(path, options, handleEvent); + } catch (error) { + errHandler(error); + } + } + + /** + * Helper for passing fs_watch event data to a collection of listeners + * @param {Path} fullPath absolute path bound to fs_watch instance + * @param {String} type listener type + * @param {*=} val1 arguments to be passed to listeners + * @param {*=} val2 + * @param {*=} val3 + */ + const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { + const cont = FsWatchInstances.get(fullPath); + if (!cont) return; + foreach(cont[type], (listener) => { + listener(val1, val2, val3); + }); + }; + + /** + * Instantiates the fs_watch interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path + * @param {String} fullPath absolute path + * @param {Object} options to be passed to fs_watch + * @param {Object} handlers container for event listener functions + */ + const setFsWatchListener = (path, fullPath, options, handlers) => { + const {listener, errHandler, rawEmitter} = handlers; + let cont = FsWatchInstances.get(fullPath); + + /** @type {fs.FSWatcher=} */ + let watcher; + if (!options.persistent) { + watcher = createFsWatchInstance( + path, options, listener, errHandler, rawEmitter + ); + return watcher.close.bind(watcher); + } + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_ERR, errHandler); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + watcher = createFsWatchInstance( + path, + options, + fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), + errHandler, // no need to use broadcast here + fsWatchBroadcast.bind(null, fullPath, KEY_RAW) + ); + if (!watcher) return; + watcher.on(EV_ERROR, async (error) => { + const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); + cont.watcherUnusable = true; // documented since Node 10.4.1 + // Workaround for https://github.com/joyent/node/issues/4337 + if (isWindows && error.code === 'EPERM') { + try { + const fd = await open(path, 'r'); + await close(fd); + broadcastErr(error); + } catch (err) {} + } else { + broadcastErr(error); + } + }); + cont = { + listeners: listener, + errHandlers: errHandler, + rawEmitters: rawEmitter, + watcher + }; + FsWatchInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // removes this instance's listeners and closes the underlying fs_watch + // instance if there are no more listeners left + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_ERR, errHandler); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + // Check to protect against issue gh-730. + // if (cont.watcherUnusable) { + cont.watcher.close(); + // } + FsWatchInstances.delete(fullPath); + HANDLER_KEYS.forEach(clearItem(cont)); + cont.watcher = undefined; + Object.freeze(cont); + } + }; + }; + + // fs_watchFile helpers + + // object to hold per-process fs_watchFile instances + // (may be shared across chokidar FSWatcher instances) + const FsWatchFileInstances = new Map(); + + /** + * Instantiates the fs_watchFile interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path to be watched + * @param {String} fullPath absolute path + * @param {Object} options options to be passed to fs_watchFile + * @param {Object} handlers container for event listener functions + * @returns {Function} closer + */ + const setFsWatchFileListener = (path, fullPath, options, handlers) => { + const {listener, rawEmitter} = handlers; + let cont = FsWatchFileInstances.get(fullPath); + + const copts = cont && cont.options; + if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { + fs.unwatchFile(fullPath); + cont = undefined; + } + + /* eslint-enable no-unused-vars, prefer-destructuring */ + + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + // TODO + // listeners.add(listener); + // rawEmitters.add(rawEmitter); + cont = { + listeners: listener, + rawEmitters: rawEmitter, + options, + watcher: fs.watchFile(fullPath, options, (curr, prev) => { + foreach(cont.rawEmitters, (rawEmitter) => { + rawEmitter(EV_CHANGE, fullPath, {curr, prev}); + }); + const currmtime = curr.mtimeMs; + if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { + foreach(cont.listeners, (listener) => listener(path, curr)); + } + }) + }; + FsWatchFileInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // Removes this instance's listeners and closes the underlying fs_watchFile + // instance if there are no more listeners left. + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + FsWatchFileInstances.delete(fullPath); + fs.unwatchFile(fullPath); + cont.options = cont.watcher = undefined; + Object.freeze(cont); + } + }; + }; + + /** + * @mixin + */ + class NodeFsHandler { + + /** + * @param {import("../index").FSWatcher} fsW + */ + constructor(fsW) { + this.fsw = fsW; + this._boundHandleError = (error) => fsW._handleError(error); + } + + /** + * Watch file for changes with fs_watchFile or fs_watch. + * @param {String} path to file or dir + * @param {Function} listener on fs change + * @returns {Function} closer for the watcher instance + */ + _watchWithNodeFs(path, listener) { + const opts = this.fsw.options; + const directory = sysPath.dirname(path); + const basename = sysPath.basename(path); + const parent = this.fsw._getWatchedDir(directory); + parent.add(basename); + const absolutePath = sysPath.resolve(path); + const options = {persistent: opts.persistent}; + if (!listener) listener = EMPTY_FN; + + let closer; + if (opts.usePolling) { + options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? + opts.binaryInterval : opts.interval; + closer = setFsWatchFileListener(path, absolutePath, options, { + listener, + rawEmitter: this.fsw._emitRaw + }); + } else { + closer = setFsWatchListener(path, absolutePath, options, { + listener, + errHandler: this._boundHandleError, + rawEmitter: this.fsw._emitRaw + }); + } + return closer; + } + + /** + * Watch a file and emit add event if warranted. + * @param {Path} file Path + * @param {fs.Stats} stats result of fs_stat + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @returns {Function} closer for the watcher instance + */ + _handleFile(file, stats, initialAdd) { + if (this.fsw.closed) { + return; + } + const dirname = sysPath.dirname(file); + const basename = sysPath.basename(file); + const parent = this.fsw._getWatchedDir(dirname); + // stats is always present + let prevStats = stats; + + // if the file is already being watched, do nothing + if (parent.has(basename)) return; + + const listener = async (path, newStats) => { + if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; + if (!newStats || newStats.mtimeMs === 0) { + try { + const newStats = await stat(file); + if (this.fsw.closed) return; + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path); + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; + } + } catch (error) { + // Fix issues where mtime is null but file is still present + this.fsw._remove(dirname, basename); + } + // add is about to be emitted if file not already tracked in parent + } else if (parent.has(basename)) { + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + prevStats = newStats; + } + }; + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); + + // emit an add event if we're supposed to + if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { + if (!this.fsw._throttle(EV_ADD, file, 0)) return; + this.fsw._emit(EV_ADD, file, stats); + } + + return closer; + } + + /** + * Handle symlinks encountered while reading a dir. + * @param {Object} entry returned by readdirp + * @param {String} directory path of dir being read + * @param {String} path of this item + * @param {String} item basename of this item + * @returns {Promise<Boolean>} true if no more processing is needed for this entry. + */ + async _handleSymlink(entry, directory, path, item) { + if (this.fsw.closed) { + return; + } + const full = entry.fullPath; + const dir = this.fsw._getWatchedDir(directory); + + if (!this.fsw.options.followSymlinks) { + // watch symlink directly (don't follow) and detect changes + this.fsw._incrReadyCount(); + + let linkPath; + try { + linkPath = await fsrealpath(path); + } catch (e) { + this.fsw._emitReady(); + return true; + } + + if (this.fsw.closed) return; + if (dir.has(item)) { + if (this.fsw._symlinkPaths.get(full) !== linkPath) { + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_CHANGE, path, entry.stats); + } + } else { + dir.add(item); + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_ADD, path, entry.stats); + } + this.fsw._emitReady(); + return true; + } + + // don't follow the same symlink more than once + if (this.fsw._symlinkPaths.has(full)) { + return true; + } + + this.fsw._symlinkPaths.set(full, true); + } + + _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { + // Normalize the directory name on Windows + directory = sysPath.join(directory, EMPTY_STR); + + if (!wh.hasGlob) { + throttler = this.fsw._throttle('readdir', directory, 1000); + if (!throttler) return; + } + + const previous = this.fsw._getWatchedDir(wh.path); + const current = new Set(); + + let stream = this.fsw._readdirp(directory, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + depth: 0 + }).on(STR_DATA, async (entry) => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const item = entry.path; + let path = sysPath.join(directory, item); + current.add(item); + + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { + return; + } + + if (this.fsw.closed) { + stream = undefined; + return; + } + // Files that present in current directory snapshot + // but absent in previous are added to watch list and + // emit `add` event. + if (item === target || !target && !previous.has(item)) { + this.fsw._incrReadyCount(); + + // ensure relativeness of path is preserved in case of watcher reuse + path = sysPath.join(dir, sysPath.relative(dir, path)); + + this._addToNodeFs(path, initialAdd, wh, depth + 1); + } + }).on(EV_ERROR, this._boundHandleError); + + return new Promise(resolve => + stream.once(STR_END, () => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const wasThrottled = throttler ? throttler.clear() : false; + + resolve(); + + // Files that absent in current directory snapshot + // but present in previous emit `remove` event + // and are removed from @watched[directory]. + previous.getChildren().filter((item) => { + return item !== directory && + !current.has(item) && + // in case of intersecting globs; + // a path may have been filtered out of this readdir, but + // shouldn't be removed because it matches a different glob + (!wh.hasGlob || wh.filterPath({ + fullPath: sysPath.resolve(directory, item) + })); + }).forEach((item) => { + this.fsw._remove(directory, item); + }); + + stream = undefined; + + // one more time for any missed in case changes came in extremely quickly + if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); + }) + ); + } + + /** + * Read directory to add / remove files from `@watched` list and re-read it on change. + * @param {String} dir fs path + * @param {fs.Stats} stats + * @param {Boolean} initialAdd + * @param {Number} depth relative to user-supplied path + * @param {String} target child path targeted for watch + * @param {Object} wh Common watch helpers for this path + * @param {String} realpath + * @returns {Promise<Function>} closer for the watcher instance. + */ + async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { + const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); + const tracked = parentDir.has(sysPath.basename(dir)); + if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { + if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); + } + + // ensure dir is tracked (harmless if redundant) + parentDir.add(sysPath.basename(dir)); + this.fsw._getWatchedDir(dir); + let throttler; + let closer; + + const oDepth = this.fsw.options.depth; + if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { + if (!target) { + await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); + if (this.fsw.closed) return; + } + + closer = this._watchWithNodeFs(dir, (dirPath, stats) => { + // if current directory is removed, do nothing + if (stats && stats.mtimeMs === 0) return; + + this._handleRead(dirPath, false, wh, target, dir, depth, throttler); + }); + } + return closer; + } + + /** + * Handle added file, directory, or glob pattern. + * Delegates call to _handleFile / _handleDir after checks. + * @param {String} path to file or ir + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @param {Object} priorWh depth relative to user-supplied path + * @param {Number} depth Child path actually targeted for watch + * @param {String=} target Child path actually targeted for watch + * @returns {Promise} + */ + async _addToNodeFs(path, initialAdd, priorWh, depth, target) { + const ready = this.fsw._emitReady; + if (this.fsw._isIgnored(path) || this.fsw.closed) { + ready(); + return false; + } + + const wh = this.fsw._getWatchHelpers(path, depth); + if (!wh.hasGlob && priorWh) { + wh.hasGlob = priorWh.hasGlob; + wh.globFilter = priorWh.globFilter; + wh.filterPath = entry => priorWh.filterPath(entry); + wh.filterDir = entry => priorWh.filterDir(entry); + } + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + ready(); + return false; + } + + const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); + let closer; + if (stats.isDirectory()) { + const absPath = sysPath.resolve(path); + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); + if (this.fsw.closed) return; + // preserve this symlink's target path + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); + } + } else if (stats.isSymbolicLink()) { + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + const parent = sysPath.dirname(wh.watchPath); + this.fsw._getWatchedDir(parent).add(wh.watchPath); + this.fsw._emit(EV_ADD, wh.watchPath, stats); + closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); + if (this.fsw.closed) return; + + // preserve this symlink's target path + if (targetPath !== undefined) { + this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); + } + } else { + closer = this._handleFile(wh.watchPath, stats, initialAdd); + } + ready(); + + this.fsw._addPathCloser(path, closer); + return false; + + } catch (error) { + if (this.fsw._handleError(error)) { + ready(); + return path; + } + } + } + + } + + nodefsHandler = NodeFsHandler; + return nodefsHandler; +} + +var fseventsHandler = {exports: {}}; + +const require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter); + +var hasRequiredFseventsHandler; + +function requireFseventsHandler () { + if (hasRequiredFseventsHandler) return fseventsHandler.exports; + hasRequiredFseventsHandler = 1; + + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + + let fsevents; + try { + fsevents = require$$3.getFsEvents(); + } catch (error) { + if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); + } + + if (fsevents) { + // TODO: real check + const mtch = process.version.match(/v(\d+)\.(\d+)/); + if (mtch && mtch[1] && mtch[2]) { + const maj = Number.parseInt(mtch[1], 10); + const min = Number.parseInt(mtch[2], 10); + if (maj === 8 && min < 16) { + fsevents = undefined; + } + } + } + + const { + EV_ADD, + EV_CHANGE, + EV_ADD_DIR, + EV_UNLINK, + EV_ERROR, + STR_DATA, + STR_END, + FSEVENT_CREATED, + FSEVENT_MODIFIED, + FSEVENT_DELETED, + FSEVENT_MOVED, + // FSEVENT_CLONED, + FSEVENT_UNKNOWN, + FSEVENT_FLAG_MUST_SCAN_SUBDIRS, + FSEVENT_TYPE_FILE, + FSEVENT_TYPE_DIRECTORY, + FSEVENT_TYPE_SYMLINK, + + ROOT_GLOBSTAR, + DIR_SUFFIX, + DOT_SLASH, + FUNCTION_TYPE, + EMPTY_FN, + IDENTITY_FN + } = /*@__PURE__*/ requireConstants(); + + const Depth = (value) => isNaN(value) ? {} : {depth: value}; + + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const realpath = promisify(fs.realpath); + + const statMethods = { stat, lstat }; + + /** + * @typedef {String} Path + */ + + /** + * @typedef {Object} FsEventsWatchContainer + * @property {Set<Function>} listeners + * @property {Function} rawEmitter + * @property {{stop: Function}} watcher + */ + + // fsevents instance helper functions + /** + * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) + * @type {Map<Path,FsEventsWatchContainer>} + */ + const FSEventsWatchers = new Map(); + + // Threshold of duplicate path prefixes at which to start + // consolidating going forward + const consolidateThreshhold = 10; + + const wrongEventFlags = new Set([ + 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 + ]); + + /** + * Instantiates the fsevents interface + * @param {Path} path path to be watched + * @param {Function} callback called when fsevents is bound and ready + * @returns {{stop: Function}} new fsevents instance + */ + const createFSEventsInstance = (path, callback) => { + const stop = fsevents.watch(path, callback); + return {stop}; + }; + + /** + * Instantiates the fsevents interface or binds listeners to an existing one covering + * the same file tree. + * @param {Path} path - to be watched + * @param {Path} realPath - real path for symlinks + * @param {Function} listener - called when fsevents emits events + * @param {Function} rawEmitter - passes data to listeners of the 'raw' event + * @returns {Function} closer + */ + function setFSEventsListener(path, realPath, listener, rawEmitter) { + let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath; + + const parentPath = sysPath.dirname(watchPath); + let cont = FSEventsWatchers.get(watchPath); + + // If we've accumulated a substantial number of paths that + // could have been consolidated by watching one directory + // above the current one, create a watcher on the parent + // path instead, so that we do consolidate going forward. + if (couldConsolidate(parentPath)) { + watchPath = parentPath; + } + + const resolvedPath = sysPath.resolve(path); + const hasSymlink = resolvedPath !== realPath; + + const filteredListener = (fullPath, flags, info) => { + if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); + if ( + fullPath === resolvedPath || + !fullPath.indexOf(resolvedPath + sysPath.sep) + ) listener(fullPath, flags, info); + }; + + // check if there is already a watcher on a parent path + // modifies `watchPath` to the parent path when it finds a match + let watchedParent = false; + for (const watchedPath of FSEventsWatchers.keys()) { + if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { + watchPath = watchedPath; + cont = FSEventsWatchers.get(watchPath); + watchedParent = true; + break; + } + } + + if (cont || watchedParent) { + cont.listeners.add(filteredListener); + } else { + cont = { + listeners: new Set([filteredListener]), + rawEmitter, + watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { + if (!cont.listeners.size) return; + if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; + const info = fsevents.getInfo(fullPath, flags); + cont.listeners.forEach(list => { + list(fullPath, flags, info); + }); + + cont.rawEmitter(info.event, fullPath, info); + }) + }; + FSEventsWatchers.set(watchPath, cont); + } + + // removes this instance's listeners and closes the underlying fsevents + // instance if there are no more listeners left + return () => { + const lst = cont.listeners; + + lst.delete(filteredListener); + if (!lst.size) { + FSEventsWatchers.delete(watchPath); + if (cont.watcher) return cont.watcher.stop().then(() => { + cont.rawEmitter = cont.watcher = undefined; + Object.freeze(cont); + }); + } + }; + } + + // Decide whether or not we should start a new higher-level + // parent watcher + const couldConsolidate = (path) => { + let count = 0; + for (const watchPath of FSEventsWatchers.keys()) { + if (watchPath.indexOf(path) === 0) { + count++; + if (count >= consolidateThreshhold) { + return true; + } + } + } + + return false; + }; + + // returns boolean indicating whether fsevents can be used + const canUse = () => fsevents && FSEventsWatchers.size < 128; + + // determines subdirectory traversal levels from root to path + const calcDepth = (path, root) => { + let i = 0; + while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; + return i; + }; + + // returns boolean indicating whether the fsevents' event info has the same type + // as the one returned by fs.stat + const sameTypes = (info, stats) => ( + info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || + info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || + info.type === FSEVENT_TYPE_FILE && stats.isFile() + ); + + /** + * @mixin + */ + class FsEventsHandler { + + /** + * @param {import('../index').FSWatcher} fsw + */ + constructor(fsw) { + this.fsw = fsw; + } + checkIgnored(path, stats) { + const ipaths = this.fsw._ignoredPaths; + if (this.fsw._isIgnored(path, stats)) { + ipaths.add(path); + if (stats && stats.isDirectory()) { + ipaths.add(path + ROOT_GLOBSTAR); + } + return true; + } + + ipaths.delete(path); + ipaths.delete(path + ROOT_GLOBSTAR); + } + + addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; + this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + + async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + try { + const stats = await stat(path); + if (this.fsw.closed) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } catch (error) { + if (error.code === 'EACCES') { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + } + + handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { + if (this.fsw.closed || this.checkIgnored(path)) return; + + if (event === EV_UNLINK) { + const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY; + // suppress unlink events on never before seen files + if (isDirectory || watchedDir.has(item)) { + this.fsw._remove(parent, item, isDirectory); + } + } else { + if (event === EV_ADD) { + // track new directories + if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); + + if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { + // push symlinks back to the top of the stack to get handled + const curDepth = opts.depth === undefined ? + undefined : calcDepth(fullPath, realPath) + 1; + return this._addToFsEvents(path, false, true, curDepth); + } + + // track new paths + // (other than symlinks being followed, which will be tracked soon) + this.fsw._getWatchedDir(parent).add(item); + } + /** + * @type {'add'|'addDir'|'unlink'|'unlinkDir'} + */ + const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; + this.fsw._emit(eventName, path); + if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); + } + } + + /** + * Handle symlinks encountered during directory scan + * @param {String} watchPath - file/dir path to be watched with fsevents + * @param {String} realPath - real path (in case of symlinks) + * @param {Function} transform - path transformer + * @param {Function} globFilter - path filter in case a glob pattern was provided + * @returns {Function} closer for the watcher instance + */ + _watchWithFsEvents(watchPath, realPath, transform, globFilter) { + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; + const opts = this.fsw.options; + const watchCallback = async (fullPath, flags, info) => { + if (this.fsw.closed) return; + if ( + opts.depth !== undefined && + calcDepth(fullPath, realPath) > opts.depth + ) return; + const path = transform(sysPath.join( + watchPath, sysPath.relative(watchPath, fullPath) + )); + if (globFilter && !globFilter(path)) return; + // ensure directories are tracked + const parent = sysPath.dirname(path); + const item = sysPath.basename(path); + const watchedDir = this.fsw._getWatchedDir( + info.type === FSEVENT_TYPE_DIRECTORY ? path : parent + ); + + // correct for wrong events emitted + if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { + if (typeof opts.ignored === FUNCTION_TYPE) { + let stats; + try { + stats = await stat(path); + } catch (error) {} + if (this.fsw.closed) return; + if (this.checkIgnored(path, stats)) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + switch (info.event) { + case FSEVENT_CREATED: + case FSEVENT_MODIFIED: + return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + case FSEVENT_DELETED: + case FSEVENT_MOVED: + return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + }; + + const closer = setFSEventsListener( + watchPath, + realPath, + watchCallback, + this.fsw._emitRaw + ); + + this.fsw._emitReady(); + return closer; + } + + /** + * Handle symlinks encountered during directory scan + * @param {String} linkPath path to symlink + * @param {String} fullPath absolute path to the symlink + * @param {Function} transform pre-existing path transformer + * @param {Number} curDepth level of subdirectories traversed to where symlink is + * @returns {Promise<void>} + */ + async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { + // don't follow the same symlink more than once + if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; + + this.fsw._symlinkPaths.set(fullPath, true); + this.fsw._incrReadyCount(); + + try { + const linkTarget = await realpath(linkPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(linkTarget)) { + return this.fsw._emitReady(); + } + + this.fsw._incrReadyCount(); + + // add the linkTarget for watching with a wrapper for transform + // that causes emitted paths to incorporate the link's path + this._addToFsEvents(linkTarget || linkPath, (path) => { + let aliasedPath = linkPath; + if (linkTarget && linkTarget !== DOT_SLASH) { + aliasedPath = path.replace(linkTarget, linkPath); + } else if (path !== DOT_SLASH) { + aliasedPath = sysPath.join(linkPath, path); + } + return transform(aliasedPath); + }, false, curDepth); + } catch(error) { + if (this.fsw._handleError(error)) { + return this.fsw._emitReady(); + } + } + } + + /** + * + * @param {Path} newPath + * @param {fs.Stats} stats + */ + emitAdd(newPath, stats, processPath, opts, forceAdd) { + const pp = processPath(newPath); + const isDir = stats.isDirectory(); + const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); + const base = sysPath.basename(pp); + + // ensure empty dirs get tracked + if (isDir) this.fsw._getWatchedDir(pp); + if (dirObj.has(base)) return; + dirObj.add(base); + + if (!opts.ignoreInitial || forceAdd === true) { + this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); + } + } + + initWatch(realPath, path, wh, processPath) { + if (this.fsw.closed) return; + const closer = this._watchWithFsEvents( + wh.watchPath, + sysPath.resolve(realPath || wh.watchPath), + processPath, + wh.globFilter + ); + this.fsw._addPathCloser(path, closer); + } + + /** + * Handle added path with fsevents + * @param {String} path file/dir path or glob pattern + * @param {Function|Boolean=} transform converts working path to what the user expects + * @param {Boolean=} forceAdd ensure add is emitted + * @param {Number=} priorDepth Level of subdirectories already traversed. + * @returns {Promise<void>} + */ + async _addToFsEvents(path, transform, forceAdd, priorDepth) { + if (this.fsw.closed) { + return; + } + const opts = this.fsw.options; + const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; + + const wh = this.fsw._getWatchHelpers(path); + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + throw null; + } + if (stats.isDirectory()) { + // emit addDir unless this is a glob parent + if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); + + // don't recurse further if it would exceed depth setting + if (priorDepth && priorDepth > opts.depth) return; + + // scan the contents of the dir + this.fsw._readdirp(wh.watchPath, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + ...Depth(opts.depth - (priorDepth || 0)) + }).on(STR_DATA, (entry) => { + // need to check filterPath on dirs b/c filterDir is less restrictive + if (this.fsw.closed) { + return; + } + if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; + + const joinedPath = sysPath.join(wh.watchPath, entry.path); + const {fullPath} = entry; + + if (wh.followSymlinks && entry.stats.isSymbolicLink()) { + // preserve the current depth here since it can't be derived from + // real paths past the symlink + const curDepth = opts.depth === undefined ? + undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; + + this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); + } else { + this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); + } + }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { + this.fsw._emitReady(); + }); + } else { + this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); + this.fsw._emitReady(); + } + } catch (error) { + if (!error || this.fsw._handleError(error)) { + // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- + this.fsw._emitReady(); + this.fsw._emitReady(); + } + } + + if (opts.persistent && forceAdd !== true) { + if (typeof transform === FUNCTION_TYPE) { + // realpath has already been resolved + this.initWatch(undefined, path, wh, processPath); + } else { + let realPath; + try { + realPath = await realpath(wh.watchPath); + } catch (e) {} + this.initWatch(realPath, path, wh, processPath); + } + } + } + + } + + fseventsHandler.exports = FsEventsHandler; + fseventsHandler.exports.canUse = canUse; + return fseventsHandler.exports; +} + +var hasRequiredChokidar; + +function requireChokidar () { + if (hasRequiredChokidar) return chokidar$1; + hasRequiredChokidar = 1; + + const { EventEmitter } = require$$0$3; + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const readdirp = /*@__PURE__*/ requireReaddirp(); + const anymatch = /*@__PURE__*/ requireAnymatch().default; + const globParent = /*@__PURE__*/ requireGlobParent(); + const isGlob = /*@__PURE__*/ requireIsGlob(); + const braces = /*@__PURE__*/ requireBraces(); + const normalizePath = /*@__PURE__*/ requireNormalizePath(); + + const NodeFsHandler = /*@__PURE__*/ requireNodefsHandler(); + const FsEventsHandler = /*@__PURE__*/ requireFseventsHandler(); + const { + EV_ALL, + EV_READY, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, + EV_UNLINK_DIR, + EV_RAW, + EV_ERROR, + + STR_CLOSE, + STR_END, + + BACK_SLASH_RE, + DOUBLE_SLASH_RE, + SLASH_OR_BACK_SLASH_RE, + DOT_RE, + REPLACER_RE, + + SLASH, + SLASH_SLASH, + BRACE_START, + BANG, + ONE_DOT, + TWO_DOTS, + GLOBSTAR, + SLASH_GLOBSTAR, + ANYMATCH_OPTS, + STRING_TYPE, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, + + isWindows, + isMacos, + isIBMi + } = /*@__PURE__*/ requireConstants(); + + const stat = promisify(fs.stat); + const readdir = promisify(fs.readdir); + + /** + * @typedef {String} Path + * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName + * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType + */ + + /** + * + * @typedef {Object} WatchHelpers + * @property {Boolean} followSymlinks + * @property {'stat'|'lstat'} statMethod + * @property {Path} path + * @property {Path} watchPath + * @property {Function} entryPath + * @property {Boolean} hasGlob + * @property {Object} globFilter + * @property {Function} filterPath + * @property {Function} filterDir + */ + + const arrify = (value = []) => Array.isArray(value) ? value : [value]; + const flatten = (list, result = []) => { + list.forEach(item => { + if (Array.isArray(item)) { + flatten(item, result); + } else { + result.push(item); + } + }); + return result; + }; + + const unifyPaths = (paths_) => { + /** + * @type {Array<String>} + */ + const paths = flatten(arrify(paths_)); + if (!paths.every(p => typeof p === STRING_TYPE)) { + throw new TypeError(`Non-string provided as watch path: ${paths}`); + } + return paths.map(normalizePathToUnix); + }; + + // If SLASH_SLASH occurs at the beginning of path, it is not replaced + // because "//StoragePC/DrivePool/Movies" is a valid network path + const toUnix = (string) => { + let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } + while (str.match(DOUBLE_SLASH_RE)) { + str = str.replace(DOUBLE_SLASH_RE, SLASH); + } + if (prepend) { + str = SLASH + str; + } + return str; + }; + + // Our version of upath.normalize + // TODO: this is not equal to path-normalize module - investigate why + const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); + + const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); + }; + + const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; + } + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); + } + return sysPath.join(cwd, path); + }; + + const undef = (opts, key) => opts[key] === undefined; + + /** + * Directory entry. + * @property {Path} path + * @property {Set<Path>} items + */ + class DirEntry { + /** + * @param {Path} dir + * @param {Function} removeWatcher + */ + constructor(dir, removeWatcher) { + this.path = dir; + this._removeWatcher = removeWatcher; + /** @type {Set<Path>} */ + this.items = new Set(); + } + + add(item) { + const {items} = this; + if (!items) return; + if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); + } + + async remove(item) { + const {items} = this; + if (!items) return; + items.delete(item); + if (items.size > 0) return; + + const dir = this.path; + try { + await readdir(dir); + } catch (err) { + if (this._removeWatcher) { + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); + } + } + } + + has(item) { + const {items} = this; + if (!items) return; + return items.has(item); + } + + /** + * @returns {Array<String>} + */ + getChildren() { + const {items} = this; + if (!items) return; + return [...items.values()]; + } + + dispose() { + this.items.clear(); + delete this.path; + delete this._removeWatcher; + delete this.items; + Object.freeze(this); + } + } + + const STAT_METHOD_F = 'stat'; + const STAT_METHOD_L = 'lstat'; + class WatchHelper { + constructor(path, watchPath, follow, fsw) { + this.fsw = fsw; + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); + this.watchPath = watchPath; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; + /** @type {object|boolean} */ + if (path === EMPTY_STR) this.hasGlob = false; + this.globSymlink = this.hasGlob && follow ? undefined : false; + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); + this.dirParts.forEach((parts) => { + if (parts.length > 1) parts.pop(); + }); + this.followSymlinks = follow; + this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; + } + + checkGlobSymlink(entry) { + // only need to resolve once + // first entry should always have entry.parentDir === EMPTY_STR + if (this.globSymlink === undefined) { + this.globSymlink = entry.fullParentDir === this.fullWatchPath ? + false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; + } + + if (this.globSymlink) { + return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); + } + + return entry.fullPath; + } + + entryPath(entry) { + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) + ); + } + + filterPath(entry) { + const {stats} = entry; + if (stats && stats.isSymbolicLink()) return this.filterDir(entry); + const resolvedPath = this.entryPath(entry); + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? + this.globFilter(resolvedPath) : true; + return matchesGlob && + this.fsw._isntIgnored(resolvedPath, stats) && + this.fsw._hasReadPermissions(stats); + } + + getDirParts(path) { + if (!this.hasGlob) return []; + const parts = []; + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); + }); + return parts; + } + + filterDir(entry) { + if (this.hasGlob) { + const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); + let globstar = false; + this.unmatchedGlob = !this.dirParts.some((parts) => { + return parts.every((part, i) => { + if (part === GLOBSTAR) globstar = true; + return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + }); + }); + } + return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); + } + } + + /** + * Watches files & directories for changes. Emitted events: + * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` + * + * new FSWatcher() + * .add(directories) + * .on('add', path => log('File', path, 'was added')) + */ + class FSWatcher extends EventEmitter { + // Not indenting methods for history sake; for now. + constructor(_opts) { + super(); + + const opts = {}; + if (_opts) Object.assign(opts, _opts); // for frozen objects + + /** @type {Map<String, DirEntry>} */ + this._watched = new Map(); + /** @type {Map<String, Array>} */ + this._closers = new Map(); + /** @type {Set<String>} */ + this._ignoredPaths = new Set(); + + /** @type {Map<ThrottleType, Map>} */ + this._throttled = new Map(); + + /** @type {Map<Path, String|Boolean>} */ + this._symlinkPaths = new Map(); + + this._streams = new Set(); + this.closed = false; + + // Set up default options. + if (undef(opts, 'persistent')) opts.persistent = true; + if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; + if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; + if (undef(opts, 'interval')) opts.interval = 100; + if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; + if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; + opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; + + // Enable fsevents on OS X when polling isn't explicitly enabled. + if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; + + // If we can't use fsevents, ensure the options reflect it's disabled. + const canUseFsEvents = FsEventsHandler.canUse(); + if (!canUseFsEvents) opts.useFsEvents = false; + + // Use polling on Mac if not using fsevents. + // Other platforms use non-polling fs_watch. + if (undef(opts, 'usePolling') && !opts.useFsEvents) { + opts.usePolling = isMacos; + } + + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + + // Global override (useful for end-developers that need to force polling for all + // instances of chokidar, regardless of usage/dependency depth) + const envPoll = process.env.CHOKIDAR_USEPOLLING; + if (envPoll !== undefined) { + const envLower = envPoll.toLowerCase(); + + if (envLower === 'false' || envLower === '0') { + opts.usePolling = false; + } else if (envLower === 'true' || envLower === '1') { + opts.usePolling = true; + } else { + opts.usePolling = !!envLower; + } + } + const envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = Number.parseInt(envInterval, 10); + } + + // Editor atomic write normalization enabled by default with fs.watch + if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; + if (opts.atomic) this._pendingUnlinks = new Map(); + + if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; + + if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; + if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; + const awf = opts.awaitWriteFinish; + if (awf) { + if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; + if (!awf.pollInterval) awf.pollInterval = 100; + this._pendingWrites = new Map(); + } + if (opts.ignored) opts.ignored = arrify(opts.ignored); + + let readyCalls = 0; + this._emitReady = () => { + readyCalls++; + if (readyCalls >= this._readyCount) { + this._emitReady = EMPTY_FN; + this._readyEmitted = true; + // use process.nextTick to allow time for listener to be bound + process.nextTick(() => this.emit(EV_READY)); + } + }; + this._emitRaw = (...args) => this.emit(EV_RAW, ...args); + this._readyEmitted = false; + this.options = opts; + + // Initialize with proper watcher. + if (opts.useFsEvents) { + this._fsEventsHandler = new FsEventsHandler(this); + } else { + this._nodeFsHandler = new NodeFsHandler(this); + } + + // You’re frozen when your heart’s not open. + Object.freeze(opts); + } + + // Public methods + + /** + * Adds paths to be watched on an existing FSWatcher instance + * @param {Path|Array<Path>} paths_ + * @param {String=} _origAdd private; for handling non-existent paths to be watched + * @param {Boolean=} _internal private; indicates a non-user add + * @returns {FSWatcher} for chaining + */ + add(paths_, _origAdd, _internal) { + const {cwd, disableGlobbing} = this.options; + this.closed = false; + let paths = unifyPaths(paths_); + if (cwd) { + paths = paths.map((path) => { + const absPath = getAbsolutePath(path, cwd); + + // Check `path` instead of `absPath` because the cwd portion can't be a glob + if (disableGlobbing || !isGlob(path)) { + return absPath; + } + return normalizePath(absPath); + }); + } + + // set aside negated glob strings + paths = paths.filter((path) => { + if (path.startsWith(BANG)) { + this._ignoredPaths.add(path.slice(1)); + return false; + } + + // if a path is being added that was previously ignored, stop ignoring it + this._ignoredPaths.delete(path); + this._ignoredPaths.delete(path + SLASH_GLOBSTAR); + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + + return true; + }); + + if (this.options.useFsEvents && this._fsEventsHandler) { + if (!this._readyCount) this._readyCount = paths.length; + if (this.options.persistent) this._readyCount += paths.length; + paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); + } else { + if (!this._readyCount) this._readyCount = 0; + this._readyCount += paths.length; + Promise.all( + paths.map(async path => { + const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); + if (res) this._emitReady(); + return res; + }) + ).then(results => { + if (this.closed) return; + results.filter(item => item).forEach(item => { + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); + }); + }); + } + + return this; + } + + /** + * Close watchers or start ignoring events from specified paths. + * @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs + * @returns {FSWatcher} for chaining + */ + unwatch(paths_) { + if (this.closed) return this; + const paths = unifyPaths(paths_); + const {cwd} = this.options; + + paths.forEach((path) => { + // convert to absolute path unless relative path already matches + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); + } + + this._closePath(path); + + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); + } + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + }); + + return this; + } + + /** + * Close watchers and remove all listeners from watched paths. + * @returns {Promise<void>}. + */ + close() { + if (this.closed) return this._closePromise; + this.closed = true; + + // Memory management. + this.removeAllListeners(); + const closers = []; + this._closers.forEach(closerList => closerList.forEach(closer => { + const promise = closer(); + if (promise instanceof Promise) closers.push(promise); + })); + this._streams.forEach(stream => stream.destroy()); + this._userIgnored = undefined; + this._readyCount = 0; + this._readyEmitted = false; + this._watched.forEach(dirent => dirent.dispose()); + ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { + this[`_${key}`].clear(); + }); + + this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); + return this._closePromise; + } + + /** + * Expose list of watched paths + * @returns {Object} for chaining + */ + getWatched() { + const watchList = {}; + this._watched.forEach((entry, dir) => { + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; + watchList[key || ONE_DOT] = entry.getChildren().sort(); + }); + return watchList; + } + + emitWithAll(event, args) { + this.emit(...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); + } + + // Common helpers + // -------------- + + /** + * Normalize and emit events. + * Calling _emit DOES NOT MEAN emit() would be called! + * @param {EventName} event Type of event + * @param {Path} path File or directory path + * @param {*=} val1 arguments to be passed with event + * @param {*=} val2 + * @param {*=} val3 + * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ + async _emit(event, path, val1, val2, val3) { + if (this.closed) return; + + const opts = this.options; + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); + /** @type Array<any> */ + const args = [event, path]; + if (val3 !== undefined) args.push(val1, val2, val3); + else if (val2 !== undefined) args.push(val1, val2); + else if (val1 !== undefined) args.push(val1); + + const awf = opts.awaitWriteFinish; + let pw; + if (awf && (pw = this._pendingWrites.get(path))) { + pw.lastChange = new Date(); + return this; + } + + if (opts.atomic) { + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); + setTimeout(() => { + this._pendingUnlinks.forEach((entry, path) => { + this.emit(...entry); + this.emit(EV_ALL, ...entry); + this._pendingUnlinks.delete(path); + }); + }, typeof opts.atomic === 'number' ? opts.atomic : 100); + return this; + } + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); + } + } + + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { + const awfEmit = (err, stats) => { + if (err) { + event = args[0] = EV_ERROR; + args[1] = err; + this.emitWithAll(event, args); + } else if (stats) { + // if stats doesn't exist the file must have been deleted + if (args.length > 2) { + args[2] = stats; + } else { + args.push(stats); + } + this.emitWithAll(event, args); + } + }; + + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); + return this; + } + + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); + if (isThrottled) return this; + } + + if (opts.alwaysStat && val1 === undefined && + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) + ) { + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; + let stats; + try { + stats = await stat(fullPath); + } catch (err) {} + // Suppress event when fs_stat fails, to avoid sending undefined 'stat' + if (!stats || this.closed) return; + args.push(stats); + } + this.emitWithAll(event, args); + + return this; + } + + /** + * Common handler for errors + * @param {Error} error + * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ + _handleError(error) { + const code = error && error.code; + if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && + (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) + ) { + this.emit(EV_ERROR, error); + } + return error || this.closed; + } + + /** + * Helper utility for throttling + * @param {ThrottleType} actionType type being throttled + * @param {Path} path being acted upon + * @param {Number} timeout duration of time to suppress duplicate actions + * @returns {Object|false} tracking object or false if action should be suppressed + */ + _throttle(actionType, path, timeout) { + if (!this._throttled.has(actionType)) { + this._throttled.set(actionType, new Map()); + } + + /** @type {Map<Path, Object>} */ + const action = this._throttled.get(actionType); + /** @type {Object} */ + const actionPath = action.get(path); + + if (actionPath) { + actionPath.count++; + return false; + } + + let timeoutObject; + const clear = () => { + const item = action.get(path); + const count = item ? item.count : 0; + action.delete(path); + clearTimeout(timeoutObject); + if (item) clearTimeout(item.timeoutObject); + return count; + }; + timeoutObject = setTimeout(clear, timeout); + const thr = {timeoutObject, clear, count: 0}; + action.set(path, thr); + return thr; + } + + _incrReadyCount() { + return this._readyCount++; + } + + /** + * Awaits write operation to finish. + * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. + * @param {Path} path being acted upon + * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished + * @param {EventName} event + * @param {Function} awfEmit Callback to be called when ready for event to be emitted. + */ + _awaitWriteFinish(path, threshold, event, awfEmit) { + let timeoutHandler; + + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); + } + + const now = new Date(); + + const awaitWriteFinish = (prevStat) => { + fs.stat(fullPath, (err, curStat) => { + if (err || !this._pendingWrites.has(path)) { + if (err && err.code !== 'ENOENT') awfEmit(err); + return; + } + + const now = Number(new Date()); + + if (prevStat && curStat.size !== prevStat.size) { + this._pendingWrites.get(path).lastChange = now; + } + const pw = this._pendingWrites.get(path); + const df = now - pw.lastChange; + + if (df >= threshold) { + this._pendingWrites.delete(path); + awfEmit(undefined, curStat); + } else { + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval, + curStat + ); + } + }); + }; + + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { + lastChange: now, + cancelWait: () => { + this._pendingWrites.delete(path); + clearTimeout(timeoutHandler); + return event; + } + }); + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval + ); + } + } + + _getGlobIgnored() { + return [...this._ignoredPaths.values()]; + } + + /** + * Determines whether user has asked to ignore this path. + * @param {Path} path filepath or dir + * @param {fs.Stats=} stats result of fs.stat + * @returns {Boolean} + */ + _isIgnored(path, stats) { + if (this.options.atomic && DOT_RE.test(path)) return true; + if (!this._userIgnored) { + const {cwd} = this.options; + const ign = this.options.ignored; + + const ignored = ign && ign.map(normalizeIgnored(cwd)); + const paths = arrify(ignored) + .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) + .map((path) => path + SLASH_GLOBSTAR); + const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); + this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + } + + return this._userIgnored([path, stats]); + } + + _isntIgnored(path, stat) { + return !this._isIgnored(path, stat); + } + + /** + * Provides a set of common helpers and properties relating to symlink and glob handling. + * @param {Path} path file, directory, or glob pattern being watched + * @param {Number=} depth at any depth > 0, this isn't a glob + * @returns {WatchHelper} object containing helpers for this path + */ + _getWatchHelpers(path, depth) { + const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); + const follow = this.options.followSymlinks; + + return new WatchHelper(path, watchPath, follow, this); + } + + // Directory helpers + // ----------------- + + /** + * Provides directory tracking objects + * @param {String} directory path of the directory + * @returns {DirEntry} the directory's tracking object + */ + _getWatchedDir(directory) { + if (!this._boundRemove) this._boundRemove = this._remove.bind(this); + const dir = sysPath.resolve(directory); + if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); + return this._watched.get(dir); + } + + // File helpers + // ------------ + + /** + * Check for read permissions. + * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 + * @param {fs.Stats} stats - object, result of fs_stat + * @returns {Boolean} indicates whether the file can be read + */ + _hasReadPermissions(stats) { + if (this.options.ignorePermissionErrors) return true; + + // stats.mode may be bigint + const md = stats && Number.parseInt(stats.mode, 10); + const st = md & 0o777; + const it = Number.parseInt(st.toString(8)[0], 10); + return Boolean(4 & it); + } + + /** + * Handles emitting unlink events for + * files and directories, and via recursion, for + * files and directories within directories that are unlinked + * @param {String} directory within which the following item is located + * @param {String} item base path of item/directory + * @returns {void} + */ + _remove(directory, item, isDirectory) { + // if what is being deleted is a directory, get that directory's paths + // for recursive deleting and cleaning of watched object + // if it is not a directory, nestedDirectoryChildren will be empty array + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); + isDirectory = isDirectory != null + ? isDirectory + : this._watched.has(path) || this._watched.has(fullPath); + + // prevent duplicate handling in case of arriving here nearly simultaneously + // via multiple paths (such as _handleFile and _handleDir) + if (!this._throttle('remove', path, 100)) return; + + // if the only watched file is removed, watch for its return + if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { + this.add(directory, item, true); + } + + // This will create a new entry in the watched object in either case + // so we got to do the directory check beforehand + const wp = this._getWatchedDir(path); + const nestedDirectoryChildren = wp.getChildren(); + + // Recursively remove children directories / files. + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); + + // Check if item was on the watched list and remove it + const parent = this._getWatchedDir(directory); + const wasTracked = parent.has(item); + parent.remove(item); + + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + + // If we wait for this file to be fully written, cancel the wait. + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); + if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { + const event = this._pendingWrites.get(relPath).cancelWait(); + if (event === EV_ADD) return; + } + + // The Entry will either be a directory that just got removed + // or a bogus entry to a file, in either case we have to remove it + this._watched.delete(path); + this._watched.delete(fullPath); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); + + // Avoid conflicts if we later create another file with the same name + if (!this.options.useFsEvents) { + this._closePath(path); + } + } + + /** + * Closes all watchers for a path + * @param {Path} path + */ + _closePath(path) { + this._closeFile(path); + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); + } + + /** + * Closes only file-specific watchers + * @param {Path} path + */ + _closeFile(path) { + const closers = this._closers.get(path); + if (!closers) return; + closers.forEach(closer => closer()); + this._closers.delete(path); + } + + /** + * + * @param {Path} path + * @param {Function} closer + */ + _addPathCloser(path, closer) { + if (!closer) return; + let list = this._closers.get(path); + if (!list) { + list = []; + this._closers.set(path, list); + } + list.push(closer); + } + + _readdirp(root, opts) { + if (this.closed) return; + const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; + let stream = readdirp(root, options); + this._streams.add(stream); + stream.once(STR_CLOSE, () => { + stream = undefined; + }); + stream.once(STR_END, () => { + if (stream) { + this._streams.delete(stream); + stream = undefined; + } + }); + return stream; + } + + } + + // Export FSWatcher class + chokidar$1.FSWatcher = FSWatcher; + + /** + * Instantiates watcher with paths to be tracked. + * @param {String|Array<String>} paths file/directory paths and/or globs + * @param {Object=} options chokidar opts + * @returns an instance of FSWatcher for chaining. + */ + const watch = (paths, options) => { + const watcher = new FSWatcher(options); + watcher.add(paths); + return watcher; + }; + + chokidar$1.watch = watch; + return chokidar$1; +} + +var chokidarExports = /*@__PURE__*/ requireChokidar(); +const chokidar = /*@__PURE__*/getDefaultExportFromCjs(chokidarExports); + +class FileWatcher { + constructor(task, chokidarOptions) { + this.transformWatchers = new Map(); + this.chokidarOptions = chokidarOptions; + this.task = task; + this.watcher = this.createWatcher(null); + } + close() { + this.watcher.close(); + for (const watcher of this.transformWatchers.values()) { + watcher.close(); + } + } + unwatch(id) { + this.watcher.unwatch(id); + const transformWatcher = this.transformWatchers.get(id); + if (transformWatcher) { + this.transformWatchers.delete(id); + transformWatcher.close(); + } + } + watch(id, isTransformDependency) { + if (isTransformDependency) { + const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id); + watcher.add(id); + this.transformWatchers.set(id, watcher); + } + else { + this.watcher.add(id); + } + } + createWatcher(transformWatcherId) { + const task = this.task; + const isLinux = platform() === 'linux'; + const isFreeBSD = platform() === 'freebsd'; + const isTransformDependency = transformWatcherId !== null; + const handleChange = (id, event) => { + const changedId = transformWatcherId || id; + if (isLinux || isFreeBSD) { + // unwatching and watching fixes an issue with chokidar where on certain systems, + // a file that was unlinked and immediately recreated would create a change event + // but then no longer any further events + watcher.unwatch(changedId); + watcher.add(changedId); + } + task.invalidate(changedId, { event, isTransformDependency }); + }; + const watcher = chokidar + .watch([], this.chokidarOptions) + .on('add', id => handleChange(id, 'create')) + .on('change', id => handleChange(id, 'update')) + .on('unlink', id => handleChange(id, 'delete')); + return watcher; + } +} + +const eventsRewrites = { + create: { + create: 'buggy', + delete: null, //delete file from map + update: 'create' + }, + delete: { + create: 'update', + delete: 'buggy', + update: 'buggy' + }, + update: { + create: 'buggy', + delete: 'delete', + update: 'update' + } +}; +class Watcher { + constructor(optionsList, emitter) { + this.buildDelay = 0; + this.buildTimeout = null; + this.closed = false; + this.invalidatedIds = new Map(); + this.rerun = false; + this.running = true; + this.emitter = emitter; + emitter.close = this.close.bind(this); + this.tasks = optionsList.map(options => new Task(this, options)); + for (const { watch } of optionsList) { + if (watch && typeof watch.buildDelay === 'number') { + this.buildDelay = Math.max(this.buildDelay, watch.buildDelay); + } + } + process$1.nextTick(() => this.run()); + } + async close() { + if (this.closed) + return; + this.closed = true; + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + for (const task of this.tasks) { + task.close(); + } + await this.emitter.emit('close'); + this.emitter.removeAllListeners(); + } + invalidate(file) { + if (file) { + const previousEvent = this.invalidatedIds.get(file.id); + const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event; + if (event === 'buggy') { + //TODO: throws or warn? Currently just ignore, uses new event + this.invalidatedIds.set(file.id, file.event); + } + else if (event === null) { + this.invalidatedIds.delete(file.id); + } + else { + this.invalidatedIds.set(file.id, event); + } + } + if (this.running) { + this.rerun = true; + return; + } + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + this.buildTimeout = setTimeout(async () => { + this.buildTimeout = null; + try { + await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event }))); + this.invalidatedIds.clear(); + await this.emitter.emit('restart'); + this.emitter.removeListenersForCurrentRun(); + this.run(); + } + catch (error) { + this.invalidatedIds.clear(); + await this.emitter.emit('event', { + code: 'ERROR', + error, + result: null + }); + await this.emitter.emit('event', { + code: 'END' + }); + } + }, this.buildDelay); + } + async run() { + this.running = true; + await this.emitter.emit('event', { + code: 'START' + }); + for (const task of this.tasks) { + await task.run(); + } + this.running = false; + await this.emitter.emit('event', { + code: 'END' + }); + if (this.rerun) { + this.rerun = false; + this.invalidate(); + } + } +} +class Task { + constructor(watcher, options) { + this.cache = { modules: [] }; + this.watchFiles = []; + this.closed = false; + this.invalidated = true; + this.watched = new Set(); + this.watcher = watcher; + this.options = options; + this.skipWrite = Boolean(options.watch && options.watch.skipWrite); + this.outputs = this.options.output; + this.outputFiles = this.outputs.map(output => { + if (output.file || output.dir) + return path.resolve(output.file || output.dir); + return undefined; + }); + const watchOptions = this.options.watch || {}; + this.filter = createFilter(watchOptions.include, watchOptions.exclude); + this.fileWatcher = new FileWatcher(this, { + ...watchOptions.chokidar, + disableGlobbing: true, + ignoreInitial: true + }); + } + close() { + this.closed = true; + this.fileWatcher.close(); + } + invalidate(id, details) { + this.invalidated = true; + if (details.isTransformDependency) { + for (const module of this.cache.modules) { + if (!module.transformDependencies.includes(id)) + continue; + // effective invalidation + module.originalCode = null; + } + } + this.watcher.invalidate({ event: details.event, id }); + } + async run() { + if (!this.invalidated) + return; + this.invalidated = false; + const options = { + ...this.options, + cache: this.cache + }; + const start = Date.now(); + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_START', + input: this.options.input, + output: this.outputFiles + }); + let result = null; + try { + result = await rollupInternal(options, this.watcher.emitter); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + if (!this.skipWrite) { + await Promise.all(this.outputs.map(output => result.write(output))); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + } + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_END', + duration: Date.now() - start, + input: this.options.input, + output: this.outputFiles, + result + }); + } + catch (error) { + if (!this.closed) { + if (Array.isArray(error.watchFiles)) { + for (const id of error.watchFiles) { + this.watchFile(id); + } + } + if (error.id) { + this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); + } + } + await this.watcher.emitter.emit('event', { + code: 'ERROR', + error, + result + }); + } + } + updateWatchedFiles(result) { + const previouslyWatched = this.watched; + this.watched = new Set(); + this.watchFiles = result.watchFiles; + this.cache = result.cache; + for (const id of this.watchFiles) { + this.watchFile(id); + } + for (const module of this.cache.modules) { + for (const depId of module.transformDependencies) { + this.watchFile(depId, true); + } + } + for (const id of previouslyWatched) { + if (!this.watched.has(id)) { + this.fileWatcher.unwatch(id); + } + } + } + watchFile(id, isTransformDependency = false) { + if (!this.filter(id)) + return; + this.watched.add(id); + if (this.outputFiles.includes(id)) { + throw new Error('Cannot import the generated bundle'); + } + // this is necessary to ensure that any 'renamed' files + // continue to be watched following an error + this.fileWatcher.watch(id, isTransformDependency); + } +} + +export { Task, Watcher }; diff --git a/seller_1/node_modules/rollup/dist/getLogFilter.d.ts b/seller_1/node_modules/rollup/dist/getLogFilter.d.ts new file mode 100644 index 0000000..cc75d62 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/getLogFilter.d.ts @@ -0,0 +1,5 @@ +import type { RollupLog } from './rollup'; + +export type GetLogFilter = typeof getLogFilter; + +export function getLogFilter(filters: string[]): (log: RollupLog) => boolean; diff --git a/seller_1/node_modules/rollup/dist/getLogFilter.js b/seller_1/node_modules/rollup/dist/getLogFilter.js new file mode 100644 index 0000000..42b68cf --- /dev/null +++ b/seller_1/node_modules/rollup/dist/getLogFilter.js @@ -0,0 +1,69 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const getLogFilter = filters => { + if (filters.length === 0) + return () => true; + const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => { + const inverted = subFilter.startsWith('!'); + if (inverted) + subFilter = subFilter.slice(1); + const [key, ...value] = subFilter.split(':'); + return { inverted, key: key.split('.'), parts: value.join(':').split('*') }; + })); + return (log) => { + nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) { + for (const { inverted, key, parts } of intersectedFilters) { + const isFilterSatisfied = testFilter(log, key, parts); + if (inverted ? isFilterSatisfied : !isFilterSatisfied) { + continue nextIntersectedFilter; + } + } + return true; + } + return false; + }; +}; +const testFilter = (log, key, parts) => { + let rawValue = log; + for (let index = 0; index < key.length; index++) { + if (!rawValue) { + return false; + } + const part = key[index]; + if (!(part in rawValue)) { + return false; + } + rawValue = rawValue[part]; + } + let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue); + if (parts.length === 1) { + return value === parts[0]; + } + if (!value.startsWith(parts[0])) { + return false; + } + const lastPartIndex = parts.length - 1; + for (let index = 1; index < lastPartIndex; index++) { + const part = parts[index]; + const position = value.indexOf(part); + if (position === -1) { + return false; + } + value = value.slice(position + part.length); + } + return value.endsWith(parts[lastPartIndex]); +}; + +exports.getLogFilter = getLogFilter; +//# sourceMappingURL=getLogFilter.js.map diff --git a/seller_1/node_modules/rollup/dist/loadConfigFile.d.ts b/seller_1/node_modules/rollup/dist/loadConfigFile.d.ts new file mode 100644 index 0000000..4306b09 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/loadConfigFile.d.ts @@ -0,0 +1,20 @@ +import type { LogHandler, MergedRollupOptions, RollupLog } from './rollup'; + +export interface BatchWarnings { + add: (warning: RollupLog) => void; + readonly count: number; + flush: () => void; + log: LogHandler; + readonly warningOccurred: boolean; +} + +export type LoadConfigFile = typeof loadConfigFile; + +export function loadConfigFile( + fileName: string, + commandOptions: any, + watchMode?: boolean +): Promise<{ + options: MergedRollupOptions[]; + warnings: BatchWarnings; +}>; diff --git a/seller_1/node_modules/rollup/dist/loadConfigFile.js b/seller_1/node_modules/rollup/dist/loadConfigFile.js new file mode 100644 index 0000000..e7ee275 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/loadConfigFile.js @@ -0,0 +1,30 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +require('node:fs/promises'); +require('node:path'); +require('node:process'); +require('node:url'); +require('./shared/rollup.js'); +require('./shared/parseAst.js'); +const loadConfigFile_js = require('./shared/loadConfigFile.js'); +require('tty'); +require('path'); +require('./native.js'); +require('node:perf_hooks'); +require('./getLogFilter.js'); + + + +exports.loadConfigFile = loadConfigFile_js.loadConfigFile; +//# sourceMappingURL=loadConfigFile.js.map diff --git a/seller_1/node_modules/rollup/dist/native.js b/seller_1/node_modules/rollup/dist/native.js new file mode 100644 index 0000000..68a0e1e --- /dev/null +++ b/seller_1/node_modules/rollup/dist/native.js @@ -0,0 +1,110 @@ +const { existsSync } = require('node:fs'); +const path = require('node:path'); +const { platform, arch, report } = require('node:process'); + +const isMusl = () => !report.getReport().header.glibcVersionRuntime; + +const bindingsByPlatformAndArch = { + android: { + arm: { base: 'android-arm-eabi' }, + arm64: { base: 'android-arm64' } + }, + darwin: { + arm64: { base: 'darwin-arm64' }, + x64: { base: 'darwin-x64' } + }, + freebsd: { + arm64: { base: 'freebsd-arm64' }, + x64: { base: 'freebsd-x64' } + }, + linux: { + arm: { base: 'linux-arm-gnueabihf', musl: 'linux-arm-musleabihf' }, + arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' }, + loong64: { base: 'linux-loongarch64-gnu', musl: null }, + ppc64: { base: 'linux-powerpc64le-gnu', musl: null }, + riscv64: { base: 'linux-riscv64-gnu', musl: null }, + s390x: { base: 'linux-s390x-gnu', musl: null }, + x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' } + }, + win32: { + arm64: { base: 'win32-arm64-msvc' }, + ia32: { base: 'win32-ia32-msvc' }, + x64: { base: 'win32-x64-msvc' } + } +}; + +const msvcLinkFilenameByArch = { + arm64: 'vc_redist.arm64.exe', + ia32: 'vc_redist.x86.exe', + x64: 'vc_redist.x64.exe' +}; + +const packageBase = getPackageBase(); +const localName = `./rollup.${packageBase}.node`; +const requireWithFriendlyError = id => { + try { + return require(id); + } catch (error) { + if ( + platform === 'win32' && + error instanceof Error && + error.code === 'ERR_DLOPEN_FAILED' && + error.message.includes('The specified module could not be found') + ) { + const msvcDownloadLink = `https://aka.ms/vs/17/release/${msvcLinkFilenameByArch[arch]}`; + throw new Error( + `Failed to load module ${id}. ` + + 'Required DLL was not found. ' + + 'This error usually happens when Microsoft Visual C++ Redistributable is not installed. ' + + `You can download it from ${msvcDownloadLink}`, + { cause: error } + ); + } + + throw new Error( + `Cannot find module ${id}. ` + + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + + 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', + { cause: error } + ); + } +}; + +const { parse, parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } = requireWithFriendlyError( + existsSync(path.join(__dirname, localName)) ? localName : `@rollup/rollup-${packageBase}` +); + +function getPackageBase() { + const imported = bindingsByPlatformAndArch[platform]?.[arch]; + if (!imported) { + throwUnsupportedError(false); + } + if ('musl' in imported && isMusl()) { + return imported.musl || throwUnsupportedError(true); + } + return imported.base; +} + +function throwUnsupportedError(isMusl) { + throw new Error( + `Your current platform "${platform}${isMusl ? ' (musl)' : ''}" and architecture "${arch}" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead. + +The following platform-architecture combinations are supported: +${Object.entries(bindingsByPlatformAndArch) + .flatMap(([platformName, architectures]) => + Object.entries(architectures).flatMap(([architectureName, { musl }]) => { + const name = `${platformName}-${architectureName}`; + return musl ? [name, `${name} (musl)`] : [name]; + }) + ) + .join('\n')} + +If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.` + ); +} + +module.exports.parse = parse; +module.exports.parseAsync = parseAsync; +module.exports.xxhashBase64Url = xxhashBase64Url; +module.exports.xxhashBase36 = xxhashBase36; +module.exports.xxhashBase16 = xxhashBase16; diff --git a/seller_1/node_modules/rollup/dist/parseAst.d.ts b/seller_1/node_modules/rollup/dist/parseAst.d.ts new file mode 100644 index 0000000..4d64dac --- /dev/null +++ b/seller_1/node_modules/rollup/dist/parseAst.d.ts @@ -0,0 +1,4 @@ +import type { ParseAst, ParseAstAsync } from './rollup'; + +export const parseAst: ParseAst; +export const parseAstAsync: ParseAstAsync; diff --git a/seller_1/node_modules/rollup/dist/parseAst.js b/seller_1/node_modules/rollup/dist/parseAst.js new file mode 100644 index 0000000..a22f1d6 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/parseAst.js @@ -0,0 +1,22 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +require('./native.js'); +const parseAst_js = require('./shared/parseAst.js'); +require('node:path'); + + + +exports.parseAst = parseAst_js.parseAst; +exports.parseAstAsync = parseAst_js.parseAstAsync; +//# sourceMappingURL=parseAst.js.map diff --git a/seller_1/node_modules/rollup/dist/rollup.d.ts b/seller_1/node_modules/rollup/dist/rollup.d.ts new file mode 100644 index 0000000..181a18b --- /dev/null +++ b/seller_1/node_modules/rollup/dist/rollup.d.ts @@ -0,0 +1,1057 @@ +import type * as estree from 'estree'; + +declare module 'estree' { + export interface Decorator extends estree.BaseNode { + type: 'Decorator'; + expression: estree.Expression; + } + interface PropertyDefinition { + decorators: estree.Decorator[]; + } + interface MethodDefinition { + decorators: estree.Decorator[]; + } + interface BaseClass { + decorators: estree.Decorator[]; + } +} + +export const VERSION: string; + +// utils +type NullValue = null | undefined | void; +type MaybeArray<T> = T | T[]; +type MaybePromise<T> = T | Promise<T>; + +type PartialNull<T> = { + [P in keyof T]: T[P] | null; +}; + +export interface RollupError extends RollupLog { + name?: string; + stack?: string; + watchFiles?: string[]; +} + +export interface RollupLog { + binding?: string; + cause?: unknown; + code?: string; + exporter?: string; + frame?: string; + hook?: string; + id?: string; + ids?: string[]; + loc?: { + column: number; + file?: string; + line: number; + }; + message: string; + meta?: any; + names?: string[]; + plugin?: string; + pluginCode?: unknown; + pos?: number; + reexporter?: string; + stack?: string; + url?: string; +} + +export type LogLevel = 'warn' | 'info' | 'debug'; +export type LogLevelOption = LogLevel | 'silent'; + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; + +export interface ExistingDecodedSourceMap { + file?: string; + readonly mappings: SourceMapSegment[][]; + names: string[]; + sourceRoot?: string; + sources: string[]; + sourcesContent?: string[]; + version: number; + x_google_ignoreList?: number[]; +} + +export interface ExistingRawSourceMap { + file?: string; + mappings: string; + names: string[]; + sourceRoot?: string; + sources: string[]; + sourcesContent?: string[]; + version: number; + x_google_ignoreList?: number[]; +} + +export type DecodedSourceMapOrMissing = + | { + missing: true; + plugin: string; + } + | (ExistingDecodedSourceMap & { missing?: false }); + +export interface SourceMap { + file: string; + mappings: string; + names: string[]; + sources: string[]; + sourcesContent?: string[]; + version: number; + debugId?: string; + toString(): string; + toUrl(): string; +} + +export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' }; + +interface ModuleOptions { + attributes: Record<string, string>; + meta: CustomPluginOptions; + moduleSideEffects: boolean | 'no-treeshake'; + syntheticNamedExports: boolean | string; +} + +export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> { + ast?: ProgramNode; + code: string; + map?: SourceMapInput; +} + +export interface TransformModuleJSON { + ast?: ProgramNode; + code: string; + // note if plugins use new this.cache to opt-out auto transform cache + customTransformCache: boolean; + originalCode: string; + originalSourcemap: ExistingDecodedSourceMap | null; + sourcemapChain: DecodedSourceMapOrMissing[]; + transformDependencies: string[]; +} + +export interface ModuleJSON extends TransformModuleJSON, ModuleOptions { + ast: ProgramNode; + dependencies: string[]; + id: string; + resolvedIds: ResolvedIdMap; + transformFiles: EmittedFile[] | undefined; +} + +export interface PluginCache { + delete(id: string): boolean; + get<T = any>(id: string): T; + has(id: string): boolean; + set<T = any>(id: string, value: T): void; +} + +export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void; + +export interface MinimalPluginContext { + debug: LoggingFunction; + error: (error: RollupError | string) => never; + info: LoggingFunction; + meta: PluginContextMeta; + warn: LoggingFunction; +} + +export interface EmittedAsset { + fileName?: string; + name?: string; + needsCodeReference?: boolean; + originalFileName?: string | null; + source?: string | Uint8Array; + type: 'asset'; +} + +export interface EmittedChunk { + fileName?: string; + id: string; + implicitlyLoadedAfterOneOf?: string[]; + importer?: string; + name?: string; + preserveSignature?: PreserveEntrySignaturesOption; + type: 'chunk'; +} + +export interface EmittedPrebuiltChunk { + code: string; + exports?: string[]; + fileName: string; + map?: SourceMap; + sourcemapFileName?: string; + type: 'prebuilt-chunk'; +} + +export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk; + +export type EmitFile = (emittedFile: EmittedFile) => string; + +interface ModuleInfo extends ModuleOptions { + ast: ProgramNode | null; + code: string | null; + dynamicImporters: readonly string[]; + dynamicallyImportedIdResolutions: readonly ResolvedId[]; + dynamicallyImportedIds: readonly string[]; + exportedBindings: Record<string, string[]> | null; + exports: string[] | null; + hasDefaultExport: boolean | null; + id: string; + implicitlyLoadedAfterOneOf: readonly string[]; + implicitlyLoadedBefore: readonly string[]; + importedIdResolutions: readonly ResolvedId[]; + importedIds: readonly string[]; + importers: readonly string[]; + isEntry: boolean; + isExternal: boolean; + isIncluded: boolean | null; +} + +export type GetModuleInfo = (moduleId: string) => ModuleInfo | null; + +export type CustomPluginOptions = Record<string, any>; + +type LoggingFunctionWithPosition = ( + log: RollupLog | string | (() => RollupLog | string), + pos?: number | { column: number; line: number } +) => void; + +export type ParseAst = ( + input: string, + options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean } +) => ProgramNode; + +// declare AbortSignal here for environments without DOM lib or @types/node +declare global { + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + interface AbortSignal {} +} + +export type ParseAstAsync = ( + input: string, + options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; signal?: AbortSignal } +) => Promise<ProgramNode>; + +export interface PluginContext extends MinimalPluginContext { + addWatchFile: (id: string) => void; + cache: PluginCache; + debug: LoggingFunction; + emitFile: EmitFile; + error: (error: RollupError | string) => never; + getFileName: (fileReferenceId: string) => string; + getModuleIds: () => IterableIterator<string>; + getModuleInfo: GetModuleInfo; + getWatchFiles: () => string[]; + info: LoggingFunction; + load: ( + options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>> + ) => Promise<ModuleInfo>; + parse: ParseAst; + resolve: ( + source: string, + importer?: string, + options?: { + attributes?: Record<string, string>; + custom?: CustomPluginOptions; + isEntry?: boolean; + skipSelf?: boolean; + } + ) => Promise<ResolvedId | null>; + setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void; + warn: LoggingFunction; +} + +export interface PluginContextMeta { + rollupVersion: string; + watchMode: boolean; +} + +export interface ResolvedId extends ModuleOptions { + external: boolean | 'absolute'; + id: string; + resolvedBy: string; +} + +export type ResolvedIdMap = Record<string, ResolvedId>; + +interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> { + external?: boolean | 'absolute' | 'relative'; + id: string; + resolvedBy?: string; +} + +export type ResolveIdResult = string | NullValue | false | PartialResolvedId; + +export type ResolveIdResultWithoutNullValue = string | false | PartialResolvedId; + +export type ResolveIdHook = ( + this: PluginContext, + source: string, + importer: string | undefined, + options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean } +) => ResolveIdResult; + +export type ShouldTransformCachedModuleHook = ( + this: PluginContext, + options: { + ast: ProgramNode; + code: string; + id: string; + meta: CustomPluginOptions; + moduleSideEffects: boolean | 'no-treeshake'; + resolvedSources: ResolvedIdMap; + syntheticNamedExports: boolean | string; + } +) => boolean | NullValue; + +export type IsExternal = ( + source: string, + importer: string | undefined, + isResolved: boolean +) => boolean; + +export type HasModuleSideEffects = (id: string, external: boolean) => boolean; + +export type LoadResult = SourceDescription | string | NullValue; + +export type LoadHook = (this: PluginContext, id: string) => LoadResult; + +export interface TransformPluginContext extends PluginContext { + debug: LoggingFunctionWithPosition; + error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never; + getCombinedSourcemap: () => SourceMap; + info: LoggingFunctionWithPosition; + warn: LoggingFunctionWithPosition; +} + +export type TransformResult = string | NullValue | Partial<SourceDescription>; + +export type TransformHook = ( + this: TransformPluginContext, + code: string, + id: string +) => TransformResult; + +export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void; + +export type RenderChunkHook = ( + this: PluginContext, + code: string, + chunk: RenderedChunk, + options: NormalizedOutputOptions, + meta: { chunks: Record<string, RenderedChunk> } +) => { code: string; map?: SourceMapInput } | string | NullValue; + +export type ResolveDynamicImportHook = ( + this: PluginContext, + specifier: string | AstNode, + importer: string, + options: { attributes: Record<string, string> } +) => ResolveIdResult; + +export type ResolveImportMetaHook = ( + this: PluginContext, + property: string | null, + options: { chunkId: string; format: InternalModuleFormat; moduleId: string } +) => string | NullValue; + +export type ResolveFileUrlHook = ( + this: PluginContext, + options: { + chunkId: string; + fileName: string; + format: InternalModuleFormat; + moduleId: string; + referenceId: string; + relativePath: string; + } +) => string | NullValue; + +export type AddonHookFunction = ( + this: PluginContext, + chunk: RenderedChunk +) => string | Promise<string>; +export type AddonHook = string | AddonHookFunction; + +export type ChangeEvent = 'create' | 'update' | 'delete'; +export type WatchChangeHook = ( + this: PluginContext, + id: string, + change: { event: ChangeEvent } +) => void; + +/** + * use this type for plugin annotation + * @example + * ```ts + * interface Options { + * ... + * } + * const myPlugin: PluginImpl<Options> = (options = {}) => { ... } + * ``` + */ +export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>; + +export type OutputBundle = Record<string, OutputAsset | OutputChunk>; + +export interface FunctionPluginHooks { + augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void; + buildEnd: (this: PluginContext, error?: Error) => void; + buildStart: (this: PluginContext, options: NormalizedInputOptions) => void; + closeBundle: (this: PluginContext) => void; + closeWatcher: (this: PluginContext) => void; + generateBundle: ( + this: PluginContext, + options: NormalizedOutputOptions, + bundle: OutputBundle, + isWrite: boolean + ) => void; + load: LoadHook; + moduleParsed: ModuleParsedHook; + onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue; + options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue; + outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue; + renderChunk: RenderChunkHook; + renderDynamicImport: ( + this: PluginContext, + options: { + customResolution: string | null; + format: InternalModuleFormat; + moduleId: string; + targetModuleId: string | null; + } + ) => { left: string; right: string } | NullValue; + renderError: (this: PluginContext, error?: Error) => void; + renderStart: ( + this: PluginContext, + outputOptions: NormalizedOutputOptions, + inputOptions: NormalizedInputOptions + ) => void; + resolveDynamicImport: ResolveDynamicImportHook; + resolveFileUrl: ResolveFileUrlHook; + resolveId: ResolveIdHook; + resolveImportMeta: ResolveImportMetaHook; + shouldTransformCachedModule: ShouldTransformCachedModuleHook; + transform: TransformHook; + watchChange: WatchChangeHook; + writeBundle: ( + this: PluginContext, + options: NormalizedOutputOptions, + bundle: OutputBundle + ) => void; +} + +export type OutputPluginHooks = + | 'augmentChunkHash' + | 'generateBundle' + | 'outputOptions' + | 'renderChunk' + | 'renderDynamicImport' + | 'renderError' + | 'renderStart' + | 'resolveFileUrl' + | 'resolveImportMeta' + | 'writeBundle'; + +export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>; + +export type SyncPluginHooks = + | 'augmentChunkHash' + | 'onLog' + | 'outputOptions' + | 'renderDynamicImport' + | 'resolveFileUrl' + | 'resolveImportMeta'; + +export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>; + +export type FirstPluginHooks = + | 'load' + | 'renderDynamicImport' + | 'resolveDynamicImport' + | 'resolveFileUrl' + | 'resolveId' + | 'resolveImportMeta' + | 'shouldTransformCachedModule'; + +export type SequentialPluginHooks = + | 'augmentChunkHash' + | 'generateBundle' + | 'onLog' + | 'options' + | 'outputOptions' + | 'renderChunk' + | 'transform'; + +export type ParallelPluginHooks = Exclude< + keyof FunctionPluginHooks | AddonHooks, + FirstPluginHooks | SequentialPluginHooks +>; + +export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro'; + +type MakeAsync<Function_> = Function_ extends ( + this: infer This, + ...parameters: infer Arguments +) => infer Return + ? (this: This, ...parameters: Arguments) => Return | Promise<Return> + : never; + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O); + +export type PluginHooks = { + [K in keyof FunctionPluginHooks]: ObjectHook< + K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + K extends ParallelPluginHooks ? { sequential?: boolean } : {} + >; +}; + +export interface OutputPlugin + extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, + Partial<Record<AddonHooks, ObjectHook<AddonHook>>> { + cacheKey?: string; + name: string; + version?: string; +} + +export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> { + // for inter-plugin communication + api?: A; +} + +export type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react'; + +export type NormalizedJsxOptions = + | NormalizedJsxPreserveOptions + | NormalizedJsxClassicOptions + | NormalizedJsxAutomaticOptions; + +interface NormalizedJsxPreserveOptions { + factory: string | null; + fragment: string | null; + importSource: string | null; + mode: 'preserve'; +} + +interface NormalizedJsxClassicOptions { + factory: string; + fragment: string; + importSource: string | null; + mode: 'classic'; +} + +interface NormalizedJsxAutomaticOptions { + factory: string; + importSource: string | null; + jsxImportSource: string; + mode: 'automatic'; +} + +export type JsxOptions = Partial<NormalizedJsxOptions> & { + preset?: JsxPreset; +}; + +export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended'; + +export interface NormalizedTreeshakingOptions { + annotations: boolean; + correctVarValueBeforeDeclaration: boolean; + manualPureFunctions: readonly string[]; + moduleSideEffects: HasModuleSideEffects; + propertyReadSideEffects: boolean | 'always'; + tryCatchDeoptimization: boolean; + unknownGlobalSideEffects: boolean; +} + +export interface TreeshakingOptions + extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> { + moduleSideEffects?: ModuleSideEffectsOption; + preset?: TreeshakingPreset; +} + +interface ManualChunkMeta { + getModuleIds: () => IterableIterator<string>; + getModuleInfo: GetModuleInfo; +} + +export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue; + +export type ExternalOption = + | (string | RegExp)[] + | string + | RegExp + | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue); + +export type GlobalsOption = Record<string, string> | ((name: string) => string); + +export type InputOption = string | string[] | Record<string, string>; + +export type ManualChunksOption = Record<string, string[]> | GetManualChunk; + +export type LogHandlerWithDefault = ( + level: LogLevel, + log: RollupLog, + defaultHandler: LogOrStringHandler +) => void; + +export type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void; + +export type LogHandler = (level: LogLevel, log: RollupLog) => void; + +export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects; + +export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only'; + +export type SourcemapPathTransformOption = ( + relativeSourcePath: string, + sourcemapPath: string +) => string; + +export type SourcemapIgnoreListOption = ( + relativeSourcePath: string, + sourcemapPath: string +) => boolean; + +export type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>; + +export interface InputOptions { + cache?: boolean | RollupCache; + context?: string; + experimentalCacheExpiry?: number; + experimentalLogSideEffects?: boolean; + external?: ExternalOption; + input?: InputOption; + jsx?: false | JsxPreset | JsxOptions; + logLevel?: LogLevelOption; + makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource'; + maxParallelFileOps?: number; + moduleContext?: ((id: string) => string | NullValue) | Record<string, string>; + onLog?: LogHandlerWithDefault; + onwarn?: WarningHandlerWithDefault; + perf?: boolean; + plugins?: InputPluginOption; + preserveEntrySignatures?: PreserveEntrySignaturesOption; + preserveSymlinks?: boolean; + shimMissingExports?: boolean; + strictDeprecations?: boolean; + treeshake?: boolean | TreeshakingPreset | TreeshakingOptions; + watch?: WatcherOptions | false; +} + +export interface InputOptionsWithPlugins extends InputOptions { + plugins: Plugin[]; +} + +export interface NormalizedInputOptions { + cache: false | undefined | RollupCache; + context: string; + experimentalCacheExpiry: number; + experimentalLogSideEffects: boolean; + external: IsExternal; + input: string[] | Record<string, string>; + jsx: false | NormalizedJsxOptions; + logLevel: LogLevelOption; + makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource'; + maxParallelFileOps: number; + moduleContext: (id: string) => string; + onLog: LogHandler; + perf: boolean; + plugins: Plugin[]; + preserveEntrySignatures: PreserveEntrySignaturesOption; + preserveSymlinks: boolean; + shimMissingExports: boolean; + strictDeprecations: boolean; + treeshake: false | NormalizedTreeshakingOptions; +} + +export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd'; +export type ImportAttributesKey = 'with' | 'assert'; + +export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs'; + +type GeneratedCodePreset = 'es5' | 'es2015'; + +interface NormalizedGeneratedCodeOptions { + arrowFunctions: boolean; + constBindings: boolean; + objectShorthand: boolean; + reservedNamesAsProps: boolean; + symbols: boolean; +} + +interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> { + preset?: GeneratedCodePreset; +} + +export type OptionsPaths = Record<string, string> | ((id: string) => string); + +export type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly'; + +export type GetInterop = (id: string | null) => InteropType; + +export type AmdOptions = ( + | { + autoId?: false; + id: string; + } + | { + autoId: true; + basePath?: string; + id?: undefined; + } + | { + autoId?: false; + id?: undefined; + } +) & { + define?: string; + forceJsExtensionForImports?: boolean; +}; + +export type NormalizedAmdOptions = ( + | { + autoId: false; + id?: string; + } + | { + autoId: true; + basePath: string; + } +) & { + define: string; + forceJsExtensionForImports: boolean; +}; + +type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>; + +type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>; + +type HashCharacters = 'base64' | 'base36' | 'hex'; + +export interface OutputOptions { + amd?: AmdOptions; + assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string); + banner?: string | AddonFunction; + chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); + compact?: boolean; + // only required for bundle.write + dir?: string; + dynamicImportInCjs?: boolean; + entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); + esModule?: boolean | 'if-default-prop'; + experimentalMinChunkSize?: number; + exports?: 'default' | 'named' | 'none' | 'auto'; + extend?: boolean; + /** @deprecated Use "externalImportAttributes" instead. */ + externalImportAssertions?: boolean; + externalImportAttributes?: boolean; + externalLiveBindings?: boolean; + // only required for bundle.write + file?: string; + footer?: string | AddonFunction; + format?: ModuleFormat; + freeze?: boolean; + generatedCode?: GeneratedCodePreset | GeneratedCodeOptions; + globals?: GlobalsOption; + hashCharacters?: HashCharacters; + hoistTransitiveImports?: boolean; + importAttributesKey?: ImportAttributesKey; + indent?: string | boolean; + inlineDynamicImports?: boolean; + interop?: InteropType | GetInterop; + intro?: string | AddonFunction; + manualChunks?: ManualChunksOption; + minifyInternalExports?: boolean; + name?: string; + noConflict?: boolean; + outro?: string | AddonFunction; + paths?: OptionsPaths; + plugins?: OutputPluginOption; + preserveModules?: boolean; + preserveModulesRoot?: string; + reexportProtoFromExternal?: boolean; + sanitizeFileName?: boolean | ((fileName: string) => string); + sourcemap?: boolean | 'inline' | 'hidden'; + sourcemapBaseUrl?: string; + sourcemapExcludeSources?: boolean; + sourcemapFile?: string; + sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); + sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption; + sourcemapPathTransform?: SourcemapPathTransformOption; + sourcemapDebugIds?: boolean; + strict?: boolean; + systemNullSetters?: boolean; + validate?: boolean; + virtualDirname?: string; +} + +export interface NormalizedOutputOptions { + amd: NormalizedAmdOptions; + assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string); + banner: AddonFunction; + chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string); + compact: boolean; + dir: string | undefined; + dynamicImportInCjs: boolean; + entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string); + esModule: boolean | 'if-default-prop'; + experimentalMinChunkSize: number; + exports: 'default' | 'named' | 'none' | 'auto'; + extend: boolean; + /** @deprecated Use "externalImportAttributes" instead. */ + externalImportAssertions: boolean; + externalImportAttributes: boolean; + externalLiveBindings: boolean; + file: string | undefined; + footer: AddonFunction; + format: InternalModuleFormat; + freeze: boolean; + generatedCode: NormalizedGeneratedCodeOptions; + globals: GlobalsOption; + hashCharacters: HashCharacters; + hoistTransitiveImports: boolean; + importAttributesKey: ImportAttributesKey; + indent: true | string; + inlineDynamicImports: boolean; + interop: GetInterop; + intro: AddonFunction; + manualChunks: ManualChunksOption; + minifyInternalExports: boolean; + name: string | undefined; + noConflict: boolean; + outro: AddonFunction; + paths: OptionsPaths; + plugins: OutputPlugin[]; + preserveModules: boolean; + preserveModulesRoot: string | undefined; + reexportProtoFromExternal: boolean; + sanitizeFileName: (fileName: string) => string; + sourcemap: boolean | 'inline' | 'hidden'; + sourcemapBaseUrl: string | undefined; + sourcemapExcludeSources: boolean; + sourcemapFile: string | undefined; + sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined; + sourcemapIgnoreList: SourcemapIgnoreListOption; + sourcemapPathTransform: SourcemapPathTransformOption | undefined; + sourcemapDebugIds: boolean; + strict: boolean; + systemNullSetters: boolean; + validate: boolean; + virtualDirname: string; +} + +export type WarningHandlerWithDefault = ( + warning: RollupLog, + defaultHandler: LoggingFunction +) => void; + +export type SerializedTimings = Record<string, [number, number, number]>; + +export interface PreRenderedAsset { + /** @deprecated Use "names" instead. */ + name: string | undefined; + names: string[]; + /** @deprecated Use "originalFileNames" instead. */ + originalFileName: string | null; + originalFileNames: string[]; + source: string | Uint8Array; + type: 'asset'; +} + +export interface OutputAsset extends PreRenderedAsset { + fileName: string; + needsCodeReference: boolean; +} + +export interface RenderedModule { + readonly code: string | null; + originalLength: number; + removedExports: string[]; + renderedExports: string[]; + renderedLength: number; +} + +export interface PreRenderedChunk { + exports: string[]; + facadeModuleId: string | null; + isDynamicEntry: boolean; + isEntry: boolean; + isImplicitEntry: boolean; + moduleIds: string[]; + name: string; + type: 'chunk'; +} + +export interface RenderedChunk extends PreRenderedChunk { + dynamicImports: string[]; + fileName: string; + implicitlyLoadedBefore: string[]; + importedBindings: Record<string, string[]>; + imports: string[]; + modules: Record<string, RenderedModule>; + referencedFiles: string[]; +} + +export interface OutputChunk extends RenderedChunk { + code: string; + map: SourceMap | null; + sourcemapFileName: string | null; + preliminaryFileName: string; +} + +export type SerializablePluginCache = Record<string, [number, any]>; + +export interface RollupCache { + modules: ModuleJSON[]; + plugins?: Record<string, SerializablePluginCache>; +} + +export interface RollupOutput { + output: [OutputChunk, ...(OutputChunk | OutputAsset)[]]; +} + +export interface RollupBuild { + cache: RollupCache | undefined; + close: () => Promise<void>; + closed: boolean; + [Symbol.asyncDispose](): Promise<void>; + generate: (outputOptions: OutputOptions) => Promise<RollupOutput>; + getTimings?: () => SerializedTimings; + watchFiles: string[]; + write: (options: OutputOptions) => Promise<RollupOutput>; +} + +export interface RollupOptions extends InputOptions { + // This is included for compatibility with config files but ignored by rollup.rollup + output?: OutputOptions | OutputOptions[]; +} + +export interface MergedRollupOptions extends InputOptionsWithPlugins { + output: OutputOptions[]; +} + +export function rollup(options: RollupOptions): Promise<RollupBuild>; + +export interface ChokidarOptions { + alwaysStat?: boolean; + atomic?: boolean | number; + awaitWriteFinish?: + | { + pollInterval?: number; + stabilityThreshold?: number; + } + | boolean; + binaryInterval?: number; + cwd?: string; + depth?: number; + disableGlobbing?: boolean; + followSymlinks?: boolean; + ignoreInitial?: boolean; + ignorePermissionErrors?: boolean; + ignored?: any; + interval?: number; + persistent?: boolean; + useFsEvents?: boolean; + usePolling?: boolean; +} + +export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd'; + +export interface WatcherOptions { + buildDelay?: number; + chokidar?: ChokidarOptions; + clearScreen?: boolean; + exclude?: string | RegExp | (string | RegExp)[]; + include?: string | RegExp | (string | RegExp)[]; + skipWrite?: boolean; +} + +export interface RollupWatchOptions extends InputOptions { + output?: OutputOptions | OutputOptions[]; + watch?: WatcherOptions | false; +} + +export type AwaitedEventListener< + T extends Record<string, (...parameters: any) => any>, + K extends keyof T +> = (...parameters: Parameters<T[K]>) => void | Promise<void>; + +export interface AwaitingEventEmitter<T extends Record<string, (...parameters: any) => any>> { + close(): Promise<void>; + emit<K extends keyof T>(event: K, ...parameters: Parameters<T[K]>): Promise<unknown>; + /** + * Removes an event listener. + */ + off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this; + /** + * Registers an event listener that will be awaited before Rollup continues. + * All listeners will be awaited in parallel while rejections are tracked via + * Promise.all. + */ + on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this; + /** + * Registers an event listener that will be awaited before Rollup continues. + * All listeners will be awaited in parallel while rejections are tracked via + * Promise.all. + * Listeners are removed automatically when removeListenersForCurrentRun is + * called, which happens automatically after each run. + */ + onCurrentRun<K extends keyof T>( + event: K, + listener: (...parameters: Parameters<T[K]>) => Promise<ReturnType<T[K]>> + ): this; + removeAllListeners(): this; + removeListenersForCurrentRun(): this; +} + +export type RollupWatcherEvent = + | { code: 'START' } + | { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] } + | { + code: 'BUNDLE_END'; + duration: number; + input?: InputOption; + output: readonly string[]; + result: RollupBuild; + } + | { code: 'END' } + | { code: 'ERROR'; error: RollupError; result: RollupBuild | null }; + +export type RollupWatcher = AwaitingEventEmitter<{ + change: (id: string, change: { event: ChangeEvent }) => void; + close: () => void; + event: (event: RollupWatcherEvent) => void; + restart: () => void; +}>; + +export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher; + +interface AstNodeLocation { + end: number; + start: number; +} + +type OmittedEstreeKeys = + | 'loc' + | 'range' + | 'leadingComments' + | 'trailingComments' + | 'innerComments' + | 'comments'; +type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation; + +type ProgramNode = RollupAstNode<estree.Program>; +export type AstNode = RollupAstNode<estree.Node>; + +export function defineConfig(options: RollupOptions): RollupOptions; +export function defineConfig(options: RollupOptions[]): RollupOptions[]; +export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction; + +export type RollupOptionsFunction = ( + commandLineArguments: Record<string, any> +) => MaybePromise<RollupOptions | RollupOptions[]>; diff --git a/seller_1/node_modules/rollup/dist/rollup.js b/seller_1/node_modules/rollup/dist/rollup.js new file mode 100644 index 0000000..63b247f --- /dev/null +++ b/seller_1/node_modules/rollup/dist/rollup.js @@ -0,0 +1,100 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const rollup = require('./shared/rollup.js'); +const parseAst_js = require('./shared/parseAst.js'); +const fseventsImporter = require('./shared/fsevents-importer.js'); +require('node:process'); +require('tty'); +require('node:path'); +require('path'); +require('./native.js'); +require('node:perf_hooks'); +require('node:fs/promises'); + +class WatchEmitter { + constructor() { + this.currentHandlers = Object.create(null); + this.persistentHandlers = Object.create(null); + } + // Will be overwritten by Rollup + async close() { } + emit(event, ...parameters) { + return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters))); + } + off(event, listener) { + const listeners = this.persistentHandlers[event]; + if (listeners) { + // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1 + // (which would remove the last array element if used unchanged) is turned + // into max_int, which is outside the array and does not change anything. + listeners.splice(listeners.indexOf(listener) >>> 0, 1); + } + return this; + } + on(event, listener) { + this.getPersistentHandlers(event).push(listener); + return this; + } + onCurrentRun(event, listener) { + this.getCurrentHandlers(event).push(listener); + return this; + } + once(event, listener) { + const selfRemovingListener = (...parameters) => { + this.off(event, selfRemovingListener); + return listener(...parameters); + }; + this.on(event, selfRemovingListener); + return this; + } + removeAllListeners() { + this.removeListenersForCurrentRun(); + this.persistentHandlers = Object.create(null); + return this; + } + removeListenersForCurrentRun() { + this.currentHandlers = Object.create(null); + return this; + } + getCurrentHandlers(event) { + return this.currentHandlers[event] || (this.currentHandlers[event] = []); + } + getPersistentHandlers(event) { + return this.persistentHandlers[event] || (this.persistentHandlers[event] = []); + } +} + +function watch(configs) { + const emitter = new WatchEmitter(); + watchInternal(configs, emitter).catch(error => { + rollup.handleError(error); + }); + return emitter; +} +async function watchInternal(configs, emitter) { + const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true))); + const watchOptionsList = optionsList.filter(config => config.watch !== false); + if (watchOptionsList.length === 0) { + return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"')); + } + await fseventsImporter.loadFsEvents(); + const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js')); + new Watcher(watchOptionsList, emitter); +} + +exports.VERSION = rollup.version; +exports.defineConfig = rollup.defineConfig; +exports.rollup = rollup.rollup; +exports.watch = watch; +//# sourceMappingURL=rollup.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/fsevents-importer.js b/seller_1/node_modules/rollup/dist/shared/fsevents-importer.js new file mode 100644 index 0000000..0c0b2dd --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/fsevents-importer.js @@ -0,0 +1,37 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +let fsEvents; +let fsEventsImportError; +async function loadFsEvents() { + try { + ({ default: fsEvents } = await import('fsevents')); + } + catch (error) { + fsEventsImportError = error; + } +} +// A call to this function will be injected into the chokidar code +function getFsEvents() { + if (fsEventsImportError) + throw fsEventsImportError; + return fsEvents; +} + +const fseventsImporter = /*#__PURE__*/Object.defineProperty({ + __proto__: null, + getFsEvents, + loadFsEvents +}, Symbol.toStringTag, { value: 'Module' }); + +exports.fseventsImporter = fseventsImporter; +exports.loadFsEvents = loadFsEvents; +//# sourceMappingURL=fsevents-importer.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/index.js b/seller_1/node_modules/rollup/dist/shared/index.js new file mode 100644 index 0000000..3a3b57c --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/index.js @@ -0,0 +1,9003 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +const rollup = require('./rollup.js'); +const require$$0$1 = require('path'); +const require$$0$2 = require('fs'); +const require$$2 = require('util'); +const require$$1 = require('stream'); +const require$$2$1 = require('os'); +const fseventsImporter = require('./fsevents-importer.js'); +const require$$0$3 = require('events'); + +var chokidar$1 = {}; + +var utils$2 = {}; + +var constants$3; +var hasRequiredConstants$3; + +function requireConstants$3 () { + if (hasRequiredConstants$3) return constants$3; + hasRequiredConstants$3 = 1; + + const path = require$$0$1; + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants$3 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants$3; +} + +var hasRequiredUtils$2; + +function requireUtils$2 () { + if (hasRequiredUtils$2) return utils$2; + hasRequiredUtils$2 = 1; + (function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants$3(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } (utils$2)); + return utils$2; +} + +var scan_1$1; +var hasRequiredScan$1; + +function requireScan$1 () { + if (hasRequiredScan$1) return scan_1$1; + hasRequiredScan$1 = 1; + + const utils = /*@__PURE__*/ requireUtils$2(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants$3(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1$1 = scan; + return scan_1$1; +} + +var parse_1$2; +var hasRequiredParse$2; + +function requireParse$2 () { + if (hasRequiredParse$2) return parse_1$2; + hasRequiredParse$2 = 1; + + const constants = /*@__PURE__*/ requireConstants$3(); + const utils = /*@__PURE__*/ requireUtils$2(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1$2 = parse; + return parse_1$2; +} + +var picomatch_1$1; +var hasRequiredPicomatch$3; + +function requirePicomatch$3 () { + if (hasRequiredPicomatch$3) return picomatch_1$1; + hasRequiredPicomatch$3 = 1; + + const path = require$$0$1; + const scan = /*@__PURE__*/ requireScan$1(); + const parse = /*@__PURE__*/ requireParse$2(); + const utils = /*@__PURE__*/ requireUtils$2(); + const constants = /*@__PURE__*/ requireConstants$3(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1$1 = picomatch; + return picomatch_1$1; +} + +var picomatch$1; +var hasRequiredPicomatch$2; + +function requirePicomatch$2 () { + if (hasRequiredPicomatch$2) return picomatch$1; + hasRequiredPicomatch$2 = 1; + + picomatch$1 = /*@__PURE__*/ requirePicomatch$3(); + return picomatch$1; +} + +var readdirp_1; +var hasRequiredReaddirp; + +function requireReaddirp () { + if (hasRequiredReaddirp) return readdirp_1; + hasRequiredReaddirp = 1; + + const fs = require$$0$2; + const { Readable } = require$$1; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const picomatch = /*@__PURE__*/ requirePicomatch$2(); + + const readdir = promisify(fs.readdir); + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const realpath = promisify(fs.realpath); + + /** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + + const BANG = '!'; + const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; + const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); + const FILE_TYPE = 'files'; + const DIR_TYPE = 'directories'; + const FILE_DIR_TYPE = 'files_directories'; + const EVERYTHING_TYPE = 'all'; + const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + + const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); + const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); + const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + + const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } + }; + + class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } + } + + /** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + + /** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ + const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); + }; + + const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); + }; + + readdirp.promise = readdirpPromise; + readdirp.ReaddirpStream = ReaddirpStream; + readdirp.default = readdirp; + + readdirp_1 = readdirp; + return readdirp_1; +} + +var anymatch = {exports: {}}; + +var utils$1 = {}; + +var constants$2; +var hasRequiredConstants$2; + +function requireConstants$2 () { + if (hasRequiredConstants$2) return constants$2; + hasRequiredConstants$2 = 1; + + const path = require$$0$1; + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants$2; +} + +var hasRequiredUtils$1; + +function requireUtils$1 () { + if (hasRequiredUtils$1) return utils$1; + hasRequiredUtils$1 = 1; + (function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants$2(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + } (utils$1)); + return utils$1; +} + +var scan_1; +var hasRequiredScan; + +function requireScan () { + if (hasRequiredScan) return scan_1; + hasRequiredScan = 1; + + const utils = /*@__PURE__*/ requireUtils$1(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants$2(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1 = scan; + return scan_1; +} + +var parse_1$1; +var hasRequiredParse$1; + +function requireParse$1 () { + if (hasRequiredParse$1) return parse_1$1; + hasRequiredParse$1 = 1; + + const constants = /*@__PURE__*/ requireConstants$2(); + const utils = /*@__PURE__*/ requireUtils$1(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1$1 = parse; + return parse_1$1; +} + +var picomatch_1; +var hasRequiredPicomatch$1; + +function requirePicomatch$1 () { + if (hasRequiredPicomatch$1) return picomatch_1; + hasRequiredPicomatch$1 = 1; + + const path = require$$0$1; + const scan = /*@__PURE__*/ requireScan(); + const parse = /*@__PURE__*/ requireParse$1(); + const utils = /*@__PURE__*/ requireUtils$1(); + const constants = /*@__PURE__*/ requireConstants$2(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1 = picomatch; + return picomatch_1; +} + +var picomatch; +var hasRequiredPicomatch; + +function requirePicomatch () { + if (hasRequiredPicomatch) return picomatch; + hasRequiredPicomatch = 1; + + picomatch = /*@__PURE__*/ requirePicomatch$1(); + return picomatch; +} + +/*! + * normalize-path <https://github.com/jonschlinkert/normalize-path> + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +var normalizePath; +var hasRequiredNormalizePath; + +function requireNormalizePath () { + if (hasRequiredNormalizePath) return normalizePath; + hasRequiredNormalizePath = 1; + normalizePath = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); + }; + return normalizePath; +} + +var anymatch_1 = anymatch.exports; + +var hasRequiredAnymatch; + +function requireAnymatch () { + if (hasRequiredAnymatch) return anymatch.exports; + hasRequiredAnymatch = 1; + + Object.defineProperty(anymatch_1, "__esModule", { value: true }); + + const picomatch = /*@__PURE__*/ requirePicomatch(); + const normalizePath = /*@__PURE__*/ requireNormalizePath(); + + /** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ + const BANG = '!'; + const DEFAULT_OPTIONS = {returnIndex: false}; + const arrify = (item) => Array.isArray(item) ? item : [item]; + + /** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ + const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; + }; + + /** + * @param {Array<Function>} patterns + * @param {Array<Function>} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ + const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath(_path, false); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; + } + } + + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; + } + } + + return returnIndex ? -1 : false; + }; + + /** + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} + */ + const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; + + // Early cache for matchers. + const mtchers = arrify(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) + .map(matcher => createPattern(matcher, opts)); + + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } + + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + }; + + anymatch$1.default = anymatch$1; + anymatch.exports = anymatch$1; + return anymatch.exports; +} + +/*! + * is-extglob <https://github.com/jonschlinkert/is-extglob> + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob; +var hasRequiredIsExtglob; + +function requireIsExtglob () { + if (hasRequiredIsExtglob) return isExtglob; + hasRequiredIsExtglob = 1; + isExtglob = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; + }; + return isExtglob; +} + +/*! + * is-glob <https://github.com/jonschlinkert/is-glob> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isGlob; +var hasRequiredIsGlob; + +function requireIsGlob () { + if (hasRequiredIsGlob) return isGlob; + hasRequiredIsGlob = 1; + var isExtglob = /*@__PURE__*/ requireIsExtglob(); + var chars = { '{': '}', '(': ')', '[': ']'}; + var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; + }; + + var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; + }; + + isGlob = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); + }; + return isGlob; +} + +var globParent; +var hasRequiredGlobParent; + +function requireGlobParent () { + if (hasRequiredGlobParent) return globParent; + hasRequiredGlobParent = 1; + + var isGlob = /*@__PURE__*/ requireIsGlob(); + var pathPosixDirname = require$$0$1.posix.dirname; + var isWin32 = require$$2$1.platform() === 'win32'; + + var slash = '/'; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + + /** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ + globParent = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); + }; + return globParent; +} + +var utils = {}; + +var hasRequiredUtils; + +function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + (function (exports) { + + exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; + }; + + /** + * Find a node of the given type + */ + + exports.find = (node, type) => node.nodes.find(node => node.type === type); + + /** + * Find a node of the given type + */ + + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; + }; + + /** + * Escape the given node with '\\' before node.value + */ + + exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } + }; + + /** + * Returns true if the given brace node should be enclosed in literal braces + */ + + exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a brace node is invalid. + */ + + exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a node is an open or close node + */ + + exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; + }; + + /** + * Reduce an array of text nodes. + */ + + exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; + }, []); + + /** + * Flatten an array + */ + + exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; + }; + } (utils)); + return utils; +} + +var stringify; +var hasRequiredStringify; + +function requireStringify () { + if (hasRequiredStringify) return stringify; + hasRequiredStringify = 1; + + const utils = /*@__PURE__*/ requireUtils(); + + stringify = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); + }; + return stringify; +} + +/*! + * is-number <https://github.com/jonschlinkert/is-number> + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var isNumber; +var hasRequiredIsNumber; + +function requireIsNumber () { + if (hasRequiredIsNumber) return isNumber; + hasRequiredIsNumber = 1; + + isNumber = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; + }; + return isNumber; +} + +/*! + * to-regex-range <https://github.com/micromatch/to-regex-range> + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var toRegexRange_1; +var hasRequiredToRegexRange; + +function requireToRegexRange () { + if (hasRequiredToRegexRange) return toRegexRange_1; + hasRequiredToRegexRange = 1; + + const isNumber = /*@__PURE__*/ requireIsNumber(); + + const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; + }; + + function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false) || []; + let onlyPositive = filterPatterns(pos, neg, '', false) || []; + let intersected = filterPatterns(neg, pos, '-?', true) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); + } + + function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; + } + + /** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + + function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; + } + + function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; + } + + function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; + } + + /** + * Zip strings + */ + + function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; + } + + function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; + } + + function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); + } + + function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); + } + + function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); + } + + function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; + } + + function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; + } + + function hasPadding(str) { + return /^-?(0+)\d/.test(str); + } + + function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } + } + + /** + * Cache + */ + + toRegexRange.cache = {}; + toRegexRange.clearCache = () => (toRegexRange.cache = {}); + + /** + * Expose `toRegexRange` + */ + + toRegexRange_1 = toRegexRange; + return toRegexRange_1; +} + +/*! + * fill-range <https://github.com/jonschlinkert/fill-range> + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var fillRange; +var hasRequiredFillRange; + +function requireFillRange () { + if (hasRequiredFillRange) return fillRange; + hasRequiredFillRange = 1; + + const util = require$$2; + const toRegexRange = /*@__PURE__*/ requireToRegexRange(); + + const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + + const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); + }; + + const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); + }; + + const isNumber = num => Number.isInteger(+num); + + const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; + }; + + const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; + }; + + const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; + }; + + const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; + }; + + const toSequence = (parts, options, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; + }; + + const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; + }; + + const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); + }; + + const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); + }; + + const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + }; + + const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; + }; + + const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options, maxLen) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; + }; + + const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; + }; + + const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); + }; + + fillRange = fill; + return fillRange; +} + +var compile_1; +var hasRequiredCompile; + +function requireCompile () { + if (hasRequiredCompile) return compile_1; + hasRequiredCompile = 1; + + const fill = /*@__PURE__*/ requireFillRange(); + const utils = /*@__PURE__*/ requireUtils(); + + const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); + }; + + compile_1 = compile; + return compile_1; +} + +var expand_1; +var hasRequiredExpand; + +function requireExpand () { + if (hasRequiredExpand) return expand_1; + hasRequiredExpand = 1; + + const fill = /*@__PURE__*/ requireFillRange(); + const stringify = /*@__PURE__*/ requireStringify(); + const utils = /*@__PURE__*/ requireUtils(); + + const append = (queue = '', stash = '', enclose = false) => { + const result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); + }; + + const expand = (ast, options = {}) => { + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); + }; + + expand_1 = expand; + return expand_1; +} + +var constants$1; +var hasRequiredConstants$1; + +function requireConstants$1 () { + if (hasRequiredConstants$1) return constants$1; + hasRequiredConstants$1 = 1; + + constants$1 = { + MAX_LENGTH: 10000, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ + }; + return constants$1; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + const stringify = /*@__PURE__*/ requireStringify(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE + } = /*@__PURE__*/ requireConstants$1(); + + /** + * parse + */ + + const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; + }; + + parse_1 = parse; + return parse_1; +} + +var braces_1; +var hasRequiredBraces; + +function requireBraces () { + if (hasRequiredBraces) return braces_1; + hasRequiredBraces = 1; + + const stringify = /*@__PURE__*/ requireStringify(); + const compile = /*@__PURE__*/ requireCompile(); + const expand = /*@__PURE__*/ requireExpand(); + const parse = /*@__PURE__*/ requireParse(); + + /** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + + const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; + }; + + /** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + + braces.parse = (input, options = {}) => parse(input, options); + + /** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); + }; + + /** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); + }; + + /** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; + }; + + /** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + + braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); + }; + + /** + * Expose "braces" + */ + + braces_1 = braces; + return braces_1; +} + +const require$$0 = [ + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "afdesign", + "afphoto", + "afpub", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "appimage", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "flatpak", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "odp", + "ods", + "odt", + "oga", + "ogg", + "ogv", + "otf", + "ott", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rpm", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "snap", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx" +]; + +var binaryExtensions; +var hasRequiredBinaryExtensions; + +function requireBinaryExtensions () { + if (hasRequiredBinaryExtensions) return binaryExtensions; + hasRequiredBinaryExtensions = 1; + binaryExtensions = require$$0; + return binaryExtensions; +} + +var isBinaryPath; +var hasRequiredIsBinaryPath; + +function requireIsBinaryPath () { + if (hasRequiredIsBinaryPath) return isBinaryPath; + hasRequiredIsBinaryPath = 1; + const path = require$$0$1; + const binaryExtensions = /*@__PURE__*/ requireBinaryExtensions(); + + const extensions = new Set(binaryExtensions); + + isBinaryPath = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); + return isBinaryPath; +} + +var constants = {}; + +var hasRequiredConstants; + +function requireConstants () { + if (hasRequiredConstants) return constants; + hasRequiredConstants = 1; + (function (exports) { + + const {sep} = require$$0$1; + const {platform} = process; + const os = require$$2$1; + + exports.EV_ALL = 'all'; + exports.EV_READY = 'ready'; + exports.EV_ADD = 'add'; + exports.EV_CHANGE = 'change'; + exports.EV_ADD_DIR = 'addDir'; + exports.EV_UNLINK = 'unlink'; + exports.EV_UNLINK_DIR = 'unlinkDir'; + exports.EV_RAW = 'raw'; + exports.EV_ERROR = 'error'; + + exports.STR_DATA = 'data'; + exports.STR_END = 'end'; + exports.STR_CLOSE = 'close'; + + exports.FSEVENT_CREATED = 'created'; + exports.FSEVENT_MODIFIED = 'modified'; + exports.FSEVENT_DELETED = 'deleted'; + exports.FSEVENT_MOVED = 'moved'; + exports.FSEVENT_CLONED = 'cloned'; + exports.FSEVENT_UNKNOWN = 'unknown'; + exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; + exports.FSEVENT_TYPE_FILE = 'file'; + exports.FSEVENT_TYPE_DIRECTORY = 'directory'; + exports.FSEVENT_TYPE_SYMLINK = 'symlink'; + + exports.KEY_LISTENERS = 'listeners'; + exports.KEY_ERR = 'errHandlers'; + exports.KEY_RAW = 'rawEmitters'; + exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; + + exports.DOT_SLASH = `.${sep}`; + + exports.BACK_SLASH_RE = /\\/g; + exports.DOUBLE_SLASH_RE = /\/\//; + exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; + exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; + exports.REPLACER_RE = /^\.[/\\]/; + + exports.SLASH = '/'; + exports.SLASH_SLASH = '//'; + exports.BRACE_START = '{'; + exports.BANG = '!'; + exports.ONE_DOT = '.'; + exports.TWO_DOTS = '..'; + exports.STAR = '*'; + exports.GLOBSTAR = '**'; + exports.ROOT_GLOBSTAR = '/**/*'; + exports.SLASH_GLOBSTAR = '/**'; + exports.DIR_SUFFIX = 'Dir'; + exports.ANYMATCH_OPTS = {dot: true}; + exports.STRING_TYPE = 'string'; + exports.FUNCTION_TYPE = 'function'; + exports.EMPTY_STR = ''; + exports.EMPTY_FN = () => {}; + exports.IDENTITY_FN = val => val; + + exports.isWindows = platform === 'win32'; + exports.isMacos = platform === 'darwin'; + exports.isLinux = platform === 'linux'; + exports.isIBMi = os.type() === 'OS400'; + } (constants)); + return constants; +} + +var nodefsHandler; +var hasRequiredNodefsHandler; + +function requireNodefsHandler () { + if (hasRequiredNodefsHandler) return nodefsHandler; + hasRequiredNodefsHandler = 1; + + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const isBinaryPath = /*@__PURE__*/ requireIsBinaryPath(); + const { + isWindows, + isLinux, + EMPTY_FN, + EMPTY_STR, + KEY_LISTENERS, + KEY_ERR, + KEY_RAW, + HANDLER_KEYS, + EV_CHANGE, + EV_ADD, + EV_ADD_DIR, + EV_ERROR, + STR_DATA, + STR_END, + BRACE_START, + STAR + } = /*@__PURE__*/ requireConstants(); + + const THROTTLE_MODE_WATCH = 'watch'; + + const open = promisify(fs.open); + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const close = promisify(fs.close); + const fsrealpath = promisify(fs.realpath); + + const statMethods = { lstat, stat }; + + // TODO: emit errors properly. Example: EMFILE on Macos. + const foreach = (val, fn) => { + if (val instanceof Set) { + val.forEach(fn); + } else { + fn(val); + } + }; + + const addAndConvert = (main, prop, item) => { + let container = main[prop]; + if (!(container instanceof Set)) { + main[prop] = container = new Set([container]); + } + container.add(item); + }; + + const clearItem = cont => key => { + const set = cont[key]; + if (set instanceof Set) { + set.clear(); + } else { + delete cont[key]; + } + }; + + const delFromSet = (main, prop, item) => { + const container = main[prop]; + if (container instanceof Set) { + container.delete(item); + } else if (container === item) { + delete main[prop]; + } + }; + + const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; + + /** + * @typedef {String} Path + */ + + // fs_watch helpers + + // object to hold per-process fs_watch instances + // (may be shared across chokidar FSWatcher instances) + + /** + * @typedef {Object} FsWatchContainer + * @property {Set} listeners + * @property {Set} errHandlers + * @property {Set} rawEmitters + * @property {fs.FSWatcher=} watcher + * @property {Boolean=} watcherUnusable + */ + + /** + * @type {Map<String,FsWatchContainer>} + */ + const FsWatchInstances = new Map(); + + /** + * Instantiates the fs_watch interface + * @param {String} path to be watched + * @param {Object} options to be passed to fs_watch + * @param {Function} listener main event handler + * @param {Function} errHandler emits info about errors + * @param {Function} emitRaw emits raw event data + * @returns {fs.FSWatcher} new fsevents instance + */ + function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { + const handleEvent = (rawEvent, evPath) => { + listener(path); + emitRaw(rawEvent, evPath, {watchedPath: path}); + + // emit based on events occurring for files from a directory's watcher in + // case the file's watcher misses it (and rely on throttling to de-dupe) + if (evPath && path !== evPath) { + fsWatchBroadcast( + sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) + ); + } + }; + try { + return fs.watch(path, options, handleEvent); + } catch (error) { + errHandler(error); + } + } + + /** + * Helper for passing fs_watch event data to a collection of listeners + * @param {Path} fullPath absolute path bound to fs_watch instance + * @param {String} type listener type + * @param {*=} val1 arguments to be passed to listeners + * @param {*=} val2 + * @param {*=} val3 + */ + const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { + const cont = FsWatchInstances.get(fullPath); + if (!cont) return; + foreach(cont[type], (listener) => { + listener(val1, val2, val3); + }); + }; + + /** + * Instantiates the fs_watch interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path + * @param {String} fullPath absolute path + * @param {Object} options to be passed to fs_watch + * @param {Object} handlers container for event listener functions + */ + const setFsWatchListener = (path, fullPath, options, handlers) => { + const {listener, errHandler, rawEmitter} = handlers; + let cont = FsWatchInstances.get(fullPath); + + /** @type {fs.FSWatcher=} */ + let watcher; + if (!options.persistent) { + watcher = createFsWatchInstance( + path, options, listener, errHandler, rawEmitter + ); + return watcher.close.bind(watcher); + } + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_ERR, errHandler); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + watcher = createFsWatchInstance( + path, + options, + fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), + errHandler, // no need to use broadcast here + fsWatchBroadcast.bind(null, fullPath, KEY_RAW) + ); + if (!watcher) return; + watcher.on(EV_ERROR, async (error) => { + const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); + cont.watcherUnusable = true; // documented since Node 10.4.1 + // Workaround for https://github.com/joyent/node/issues/4337 + if (isWindows && error.code === 'EPERM') { + try { + const fd = await open(path, 'r'); + await close(fd); + broadcastErr(error); + } catch (err) {} + } else { + broadcastErr(error); + } + }); + cont = { + listeners: listener, + errHandlers: errHandler, + rawEmitters: rawEmitter, + watcher + }; + FsWatchInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // removes this instance's listeners and closes the underlying fs_watch + // instance if there are no more listeners left + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_ERR, errHandler); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + // Check to protect against issue gh-730. + // if (cont.watcherUnusable) { + cont.watcher.close(); + // } + FsWatchInstances.delete(fullPath); + HANDLER_KEYS.forEach(clearItem(cont)); + cont.watcher = undefined; + Object.freeze(cont); + } + }; + }; + + // fs_watchFile helpers + + // object to hold per-process fs_watchFile instances + // (may be shared across chokidar FSWatcher instances) + const FsWatchFileInstances = new Map(); + + /** + * Instantiates the fs_watchFile interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path to be watched + * @param {String} fullPath absolute path + * @param {Object} options options to be passed to fs_watchFile + * @param {Object} handlers container for event listener functions + * @returns {Function} closer + */ + const setFsWatchFileListener = (path, fullPath, options, handlers) => { + const {listener, rawEmitter} = handlers; + let cont = FsWatchFileInstances.get(fullPath); + + const copts = cont && cont.options; + if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { + fs.unwatchFile(fullPath); + cont = undefined; + } + + /* eslint-enable no-unused-vars, prefer-destructuring */ + + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + // TODO + // listeners.add(listener); + // rawEmitters.add(rawEmitter); + cont = { + listeners: listener, + rawEmitters: rawEmitter, + options, + watcher: fs.watchFile(fullPath, options, (curr, prev) => { + foreach(cont.rawEmitters, (rawEmitter) => { + rawEmitter(EV_CHANGE, fullPath, {curr, prev}); + }); + const currmtime = curr.mtimeMs; + if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { + foreach(cont.listeners, (listener) => listener(path, curr)); + } + }) + }; + FsWatchFileInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // Removes this instance's listeners and closes the underlying fs_watchFile + // instance if there are no more listeners left. + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + FsWatchFileInstances.delete(fullPath); + fs.unwatchFile(fullPath); + cont.options = cont.watcher = undefined; + Object.freeze(cont); + } + }; + }; + + /** + * @mixin + */ + class NodeFsHandler { + + /** + * @param {import("../index").FSWatcher} fsW + */ + constructor(fsW) { + this.fsw = fsW; + this._boundHandleError = (error) => fsW._handleError(error); + } + + /** + * Watch file for changes with fs_watchFile or fs_watch. + * @param {String} path to file or dir + * @param {Function} listener on fs change + * @returns {Function} closer for the watcher instance + */ + _watchWithNodeFs(path, listener) { + const opts = this.fsw.options; + const directory = sysPath.dirname(path); + const basename = sysPath.basename(path); + const parent = this.fsw._getWatchedDir(directory); + parent.add(basename); + const absolutePath = sysPath.resolve(path); + const options = {persistent: opts.persistent}; + if (!listener) listener = EMPTY_FN; + + let closer; + if (opts.usePolling) { + options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? + opts.binaryInterval : opts.interval; + closer = setFsWatchFileListener(path, absolutePath, options, { + listener, + rawEmitter: this.fsw._emitRaw + }); + } else { + closer = setFsWatchListener(path, absolutePath, options, { + listener, + errHandler: this._boundHandleError, + rawEmitter: this.fsw._emitRaw + }); + } + return closer; + } + + /** + * Watch a file and emit add event if warranted. + * @param {Path} file Path + * @param {fs.Stats} stats result of fs_stat + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @returns {Function} closer for the watcher instance + */ + _handleFile(file, stats, initialAdd) { + if (this.fsw.closed) { + return; + } + const dirname = sysPath.dirname(file); + const basename = sysPath.basename(file); + const parent = this.fsw._getWatchedDir(dirname); + // stats is always present + let prevStats = stats; + + // if the file is already being watched, do nothing + if (parent.has(basename)) return; + + const listener = async (path, newStats) => { + if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; + if (!newStats || newStats.mtimeMs === 0) { + try { + const newStats = await stat(file); + if (this.fsw.closed) return; + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path); + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; + } + } catch (error) { + // Fix issues where mtime is null but file is still present + this.fsw._remove(dirname, basename); + } + // add is about to be emitted if file not already tracked in parent + } else if (parent.has(basename)) { + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + prevStats = newStats; + } + }; + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); + + // emit an add event if we're supposed to + if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { + if (!this.fsw._throttle(EV_ADD, file, 0)) return; + this.fsw._emit(EV_ADD, file, stats); + } + + return closer; + } + + /** + * Handle symlinks encountered while reading a dir. + * @param {Object} entry returned by readdirp + * @param {String} directory path of dir being read + * @param {String} path of this item + * @param {String} item basename of this item + * @returns {Promise<Boolean>} true if no more processing is needed for this entry. + */ + async _handleSymlink(entry, directory, path, item) { + if (this.fsw.closed) { + return; + } + const full = entry.fullPath; + const dir = this.fsw._getWatchedDir(directory); + + if (!this.fsw.options.followSymlinks) { + // watch symlink directly (don't follow) and detect changes + this.fsw._incrReadyCount(); + + let linkPath; + try { + linkPath = await fsrealpath(path); + } catch (e) { + this.fsw._emitReady(); + return true; + } + + if (this.fsw.closed) return; + if (dir.has(item)) { + if (this.fsw._symlinkPaths.get(full) !== linkPath) { + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_CHANGE, path, entry.stats); + } + } else { + dir.add(item); + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_ADD, path, entry.stats); + } + this.fsw._emitReady(); + return true; + } + + // don't follow the same symlink more than once + if (this.fsw._symlinkPaths.has(full)) { + return true; + } + + this.fsw._symlinkPaths.set(full, true); + } + + _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { + // Normalize the directory name on Windows + directory = sysPath.join(directory, EMPTY_STR); + + if (!wh.hasGlob) { + throttler = this.fsw._throttle('readdir', directory, 1000); + if (!throttler) return; + } + + const previous = this.fsw._getWatchedDir(wh.path); + const current = new Set(); + + let stream = this.fsw._readdirp(directory, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + depth: 0 + }).on(STR_DATA, async (entry) => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const item = entry.path; + let path = sysPath.join(directory, item); + current.add(item); + + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { + return; + } + + if (this.fsw.closed) { + stream = undefined; + return; + } + // Files that present in current directory snapshot + // but absent in previous are added to watch list and + // emit `add` event. + if (item === target || !target && !previous.has(item)) { + this.fsw._incrReadyCount(); + + // ensure relativeness of path is preserved in case of watcher reuse + path = sysPath.join(dir, sysPath.relative(dir, path)); + + this._addToNodeFs(path, initialAdd, wh, depth + 1); + } + }).on(EV_ERROR, this._boundHandleError); + + return new Promise(resolve => + stream.once(STR_END, () => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const wasThrottled = throttler ? throttler.clear() : false; + + resolve(); + + // Files that absent in current directory snapshot + // but present in previous emit `remove` event + // and are removed from @watched[directory]. + previous.getChildren().filter((item) => { + return item !== directory && + !current.has(item) && + // in case of intersecting globs; + // a path may have been filtered out of this readdir, but + // shouldn't be removed because it matches a different glob + (!wh.hasGlob || wh.filterPath({ + fullPath: sysPath.resolve(directory, item) + })); + }).forEach((item) => { + this.fsw._remove(directory, item); + }); + + stream = undefined; + + // one more time for any missed in case changes came in extremely quickly + if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); + }) + ); + } + + /** + * Read directory to add / remove files from `@watched` list and re-read it on change. + * @param {String} dir fs path + * @param {fs.Stats} stats + * @param {Boolean} initialAdd + * @param {Number} depth relative to user-supplied path + * @param {String} target child path targeted for watch + * @param {Object} wh Common watch helpers for this path + * @param {String} realpath + * @returns {Promise<Function>} closer for the watcher instance. + */ + async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { + const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); + const tracked = parentDir.has(sysPath.basename(dir)); + if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { + if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); + } + + // ensure dir is tracked (harmless if redundant) + parentDir.add(sysPath.basename(dir)); + this.fsw._getWatchedDir(dir); + let throttler; + let closer; + + const oDepth = this.fsw.options.depth; + if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { + if (!target) { + await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); + if (this.fsw.closed) return; + } + + closer = this._watchWithNodeFs(dir, (dirPath, stats) => { + // if current directory is removed, do nothing + if (stats && stats.mtimeMs === 0) return; + + this._handleRead(dirPath, false, wh, target, dir, depth, throttler); + }); + } + return closer; + } + + /** + * Handle added file, directory, or glob pattern. + * Delegates call to _handleFile / _handleDir after checks. + * @param {String} path to file or ir + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @param {Object} priorWh depth relative to user-supplied path + * @param {Number} depth Child path actually targeted for watch + * @param {String=} target Child path actually targeted for watch + * @returns {Promise} + */ + async _addToNodeFs(path, initialAdd, priorWh, depth, target) { + const ready = this.fsw._emitReady; + if (this.fsw._isIgnored(path) || this.fsw.closed) { + ready(); + return false; + } + + const wh = this.fsw._getWatchHelpers(path, depth); + if (!wh.hasGlob && priorWh) { + wh.hasGlob = priorWh.hasGlob; + wh.globFilter = priorWh.globFilter; + wh.filterPath = entry => priorWh.filterPath(entry); + wh.filterDir = entry => priorWh.filterDir(entry); + } + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + ready(); + return false; + } + + const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); + let closer; + if (stats.isDirectory()) { + const absPath = sysPath.resolve(path); + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); + if (this.fsw.closed) return; + // preserve this symlink's target path + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); + } + } else if (stats.isSymbolicLink()) { + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + const parent = sysPath.dirname(wh.watchPath); + this.fsw._getWatchedDir(parent).add(wh.watchPath); + this.fsw._emit(EV_ADD, wh.watchPath, stats); + closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); + if (this.fsw.closed) return; + + // preserve this symlink's target path + if (targetPath !== undefined) { + this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); + } + } else { + closer = this._handleFile(wh.watchPath, stats, initialAdd); + } + ready(); + + this.fsw._addPathCloser(path, closer); + return false; + + } catch (error) { + if (this.fsw._handleError(error)) { + ready(); + return path; + } + } + } + + } + + nodefsHandler = NodeFsHandler; + return nodefsHandler; +} + +var fseventsHandler = {exports: {}}; + +const require$$3 = /*@__PURE__*/rollup.getAugmentedNamespace(fseventsImporter.fseventsImporter); + +var hasRequiredFseventsHandler; + +function requireFseventsHandler () { + if (hasRequiredFseventsHandler) return fseventsHandler.exports; + hasRequiredFseventsHandler = 1; + + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + + let fsevents; + try { + fsevents = require$$3.getFsEvents(); + } catch (error) { + if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); + } + + if (fsevents) { + // TODO: real check + const mtch = process.version.match(/v(\d+)\.(\d+)/); + if (mtch && mtch[1] && mtch[2]) { + const maj = Number.parseInt(mtch[1], 10); + const min = Number.parseInt(mtch[2], 10); + if (maj === 8 && min < 16) { + fsevents = undefined; + } + } + } + + const { + EV_ADD, + EV_CHANGE, + EV_ADD_DIR, + EV_UNLINK, + EV_ERROR, + STR_DATA, + STR_END, + FSEVENT_CREATED, + FSEVENT_MODIFIED, + FSEVENT_DELETED, + FSEVENT_MOVED, + // FSEVENT_CLONED, + FSEVENT_UNKNOWN, + FSEVENT_FLAG_MUST_SCAN_SUBDIRS, + FSEVENT_TYPE_FILE, + FSEVENT_TYPE_DIRECTORY, + FSEVENT_TYPE_SYMLINK, + + ROOT_GLOBSTAR, + DIR_SUFFIX, + DOT_SLASH, + FUNCTION_TYPE, + EMPTY_FN, + IDENTITY_FN + } = /*@__PURE__*/ requireConstants(); + + const Depth = (value) => isNaN(value) ? {} : {depth: value}; + + const stat = promisify(fs.stat); + const lstat = promisify(fs.lstat); + const realpath = promisify(fs.realpath); + + const statMethods = { stat, lstat }; + + /** + * @typedef {String} Path + */ + + /** + * @typedef {Object} FsEventsWatchContainer + * @property {Set<Function>} listeners + * @property {Function} rawEmitter + * @property {{stop: Function}} watcher + */ + + // fsevents instance helper functions + /** + * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) + * @type {Map<Path,FsEventsWatchContainer>} + */ + const FSEventsWatchers = new Map(); + + // Threshold of duplicate path prefixes at which to start + // consolidating going forward + const consolidateThreshhold = 10; + + const wrongEventFlags = new Set([ + 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 + ]); + + /** + * Instantiates the fsevents interface + * @param {Path} path path to be watched + * @param {Function} callback called when fsevents is bound and ready + * @returns {{stop: Function}} new fsevents instance + */ + const createFSEventsInstance = (path, callback) => { + const stop = fsevents.watch(path, callback); + return {stop}; + }; + + /** + * Instantiates the fsevents interface or binds listeners to an existing one covering + * the same file tree. + * @param {Path} path - to be watched + * @param {Path} realPath - real path for symlinks + * @param {Function} listener - called when fsevents emits events + * @param {Function} rawEmitter - passes data to listeners of the 'raw' event + * @returns {Function} closer + */ + function setFSEventsListener(path, realPath, listener, rawEmitter) { + let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath; + + const parentPath = sysPath.dirname(watchPath); + let cont = FSEventsWatchers.get(watchPath); + + // If we've accumulated a substantial number of paths that + // could have been consolidated by watching one directory + // above the current one, create a watcher on the parent + // path instead, so that we do consolidate going forward. + if (couldConsolidate(parentPath)) { + watchPath = parentPath; + } + + const resolvedPath = sysPath.resolve(path); + const hasSymlink = resolvedPath !== realPath; + + const filteredListener = (fullPath, flags, info) => { + if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); + if ( + fullPath === resolvedPath || + !fullPath.indexOf(resolvedPath + sysPath.sep) + ) listener(fullPath, flags, info); + }; + + // check if there is already a watcher on a parent path + // modifies `watchPath` to the parent path when it finds a match + let watchedParent = false; + for (const watchedPath of FSEventsWatchers.keys()) { + if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { + watchPath = watchedPath; + cont = FSEventsWatchers.get(watchPath); + watchedParent = true; + break; + } + } + + if (cont || watchedParent) { + cont.listeners.add(filteredListener); + } else { + cont = { + listeners: new Set([filteredListener]), + rawEmitter, + watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { + if (!cont.listeners.size) return; + if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; + const info = fsevents.getInfo(fullPath, flags); + cont.listeners.forEach(list => { + list(fullPath, flags, info); + }); + + cont.rawEmitter(info.event, fullPath, info); + }) + }; + FSEventsWatchers.set(watchPath, cont); + } + + // removes this instance's listeners and closes the underlying fsevents + // instance if there are no more listeners left + return () => { + const lst = cont.listeners; + + lst.delete(filteredListener); + if (!lst.size) { + FSEventsWatchers.delete(watchPath); + if (cont.watcher) return cont.watcher.stop().then(() => { + cont.rawEmitter = cont.watcher = undefined; + Object.freeze(cont); + }); + } + }; + } + + // Decide whether or not we should start a new higher-level + // parent watcher + const couldConsolidate = (path) => { + let count = 0; + for (const watchPath of FSEventsWatchers.keys()) { + if (watchPath.indexOf(path) === 0) { + count++; + if (count >= consolidateThreshhold) { + return true; + } + } + } + + return false; + }; + + // returns boolean indicating whether fsevents can be used + const canUse = () => fsevents && FSEventsWatchers.size < 128; + + // determines subdirectory traversal levels from root to path + const calcDepth = (path, root) => { + let i = 0; + while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; + return i; + }; + + // returns boolean indicating whether the fsevents' event info has the same type + // as the one returned by fs.stat + const sameTypes = (info, stats) => ( + info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || + info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || + info.type === FSEVENT_TYPE_FILE && stats.isFile() + ); + + /** + * @mixin + */ + class FsEventsHandler { + + /** + * @param {import('../index').FSWatcher} fsw + */ + constructor(fsw) { + this.fsw = fsw; + } + checkIgnored(path, stats) { + const ipaths = this.fsw._ignoredPaths; + if (this.fsw._isIgnored(path, stats)) { + ipaths.add(path); + if (stats && stats.isDirectory()) { + ipaths.add(path + ROOT_GLOBSTAR); + } + return true; + } + + ipaths.delete(path); + ipaths.delete(path + ROOT_GLOBSTAR); + } + + addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; + this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + + async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + try { + const stats = await stat(path); + if (this.fsw.closed) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } catch (error) { + if (error.code === 'EACCES') { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + } + + handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { + if (this.fsw.closed || this.checkIgnored(path)) return; + + if (event === EV_UNLINK) { + const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY; + // suppress unlink events on never before seen files + if (isDirectory || watchedDir.has(item)) { + this.fsw._remove(parent, item, isDirectory); + } + } else { + if (event === EV_ADD) { + // track new directories + if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); + + if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { + // push symlinks back to the top of the stack to get handled + const curDepth = opts.depth === undefined ? + undefined : calcDepth(fullPath, realPath) + 1; + return this._addToFsEvents(path, false, true, curDepth); + } + + // track new paths + // (other than symlinks being followed, which will be tracked soon) + this.fsw._getWatchedDir(parent).add(item); + } + /** + * @type {'add'|'addDir'|'unlink'|'unlinkDir'} + */ + const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; + this.fsw._emit(eventName, path); + if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); + } + } + + /** + * Handle symlinks encountered during directory scan + * @param {String} watchPath - file/dir path to be watched with fsevents + * @param {String} realPath - real path (in case of symlinks) + * @param {Function} transform - path transformer + * @param {Function} globFilter - path filter in case a glob pattern was provided + * @returns {Function} closer for the watcher instance + */ + _watchWithFsEvents(watchPath, realPath, transform, globFilter) { + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; + const opts = this.fsw.options; + const watchCallback = async (fullPath, flags, info) => { + if (this.fsw.closed) return; + if ( + opts.depth !== undefined && + calcDepth(fullPath, realPath) > opts.depth + ) return; + const path = transform(sysPath.join( + watchPath, sysPath.relative(watchPath, fullPath) + )); + if (globFilter && !globFilter(path)) return; + // ensure directories are tracked + const parent = sysPath.dirname(path); + const item = sysPath.basename(path); + const watchedDir = this.fsw._getWatchedDir( + info.type === FSEVENT_TYPE_DIRECTORY ? path : parent + ); + + // correct for wrong events emitted + if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { + if (typeof opts.ignored === FUNCTION_TYPE) { + let stats; + try { + stats = await stat(path); + } catch (error) {} + if (this.fsw.closed) return; + if (this.checkIgnored(path, stats)) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + switch (info.event) { + case FSEVENT_CREATED: + case FSEVENT_MODIFIED: + return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + case FSEVENT_DELETED: + case FSEVENT_MOVED: + return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + }; + + const closer = setFSEventsListener( + watchPath, + realPath, + watchCallback, + this.fsw._emitRaw + ); + + this.fsw._emitReady(); + return closer; + } + + /** + * Handle symlinks encountered during directory scan + * @param {String} linkPath path to symlink + * @param {String} fullPath absolute path to the symlink + * @param {Function} transform pre-existing path transformer + * @param {Number} curDepth level of subdirectories traversed to where symlink is + * @returns {Promise<void>} + */ + async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { + // don't follow the same symlink more than once + if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; + + this.fsw._symlinkPaths.set(fullPath, true); + this.fsw._incrReadyCount(); + + try { + const linkTarget = await realpath(linkPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(linkTarget)) { + return this.fsw._emitReady(); + } + + this.fsw._incrReadyCount(); + + // add the linkTarget for watching with a wrapper for transform + // that causes emitted paths to incorporate the link's path + this._addToFsEvents(linkTarget || linkPath, (path) => { + let aliasedPath = linkPath; + if (linkTarget && linkTarget !== DOT_SLASH) { + aliasedPath = path.replace(linkTarget, linkPath); + } else if (path !== DOT_SLASH) { + aliasedPath = sysPath.join(linkPath, path); + } + return transform(aliasedPath); + }, false, curDepth); + } catch(error) { + if (this.fsw._handleError(error)) { + return this.fsw._emitReady(); + } + } + } + + /** + * + * @param {Path} newPath + * @param {fs.Stats} stats + */ + emitAdd(newPath, stats, processPath, opts, forceAdd) { + const pp = processPath(newPath); + const isDir = stats.isDirectory(); + const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); + const base = sysPath.basename(pp); + + // ensure empty dirs get tracked + if (isDir) this.fsw._getWatchedDir(pp); + if (dirObj.has(base)) return; + dirObj.add(base); + + if (!opts.ignoreInitial || forceAdd === true) { + this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); + } + } + + initWatch(realPath, path, wh, processPath) { + if (this.fsw.closed) return; + const closer = this._watchWithFsEvents( + wh.watchPath, + sysPath.resolve(realPath || wh.watchPath), + processPath, + wh.globFilter + ); + this.fsw._addPathCloser(path, closer); + } + + /** + * Handle added path with fsevents + * @param {String} path file/dir path or glob pattern + * @param {Function|Boolean=} transform converts working path to what the user expects + * @param {Boolean=} forceAdd ensure add is emitted + * @param {Number=} priorDepth Level of subdirectories already traversed. + * @returns {Promise<void>} + */ + async _addToFsEvents(path, transform, forceAdd, priorDepth) { + if (this.fsw.closed) { + return; + } + const opts = this.fsw.options; + const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; + + const wh = this.fsw._getWatchHelpers(path); + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + throw null; + } + if (stats.isDirectory()) { + // emit addDir unless this is a glob parent + if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); + + // don't recurse further if it would exceed depth setting + if (priorDepth && priorDepth > opts.depth) return; + + // scan the contents of the dir + this.fsw._readdirp(wh.watchPath, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + ...Depth(opts.depth - (priorDepth || 0)) + }).on(STR_DATA, (entry) => { + // need to check filterPath on dirs b/c filterDir is less restrictive + if (this.fsw.closed) { + return; + } + if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; + + const joinedPath = sysPath.join(wh.watchPath, entry.path); + const {fullPath} = entry; + + if (wh.followSymlinks && entry.stats.isSymbolicLink()) { + // preserve the current depth here since it can't be derived from + // real paths past the symlink + const curDepth = opts.depth === undefined ? + undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; + + this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); + } else { + this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); + } + }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { + this.fsw._emitReady(); + }); + } else { + this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); + this.fsw._emitReady(); + } + } catch (error) { + if (!error || this.fsw._handleError(error)) { + // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- + this.fsw._emitReady(); + this.fsw._emitReady(); + } + } + + if (opts.persistent && forceAdd !== true) { + if (typeof transform === FUNCTION_TYPE) { + // realpath has already been resolved + this.initWatch(undefined, path, wh, processPath); + } else { + let realPath; + try { + realPath = await realpath(wh.watchPath); + } catch (e) {} + this.initWatch(realPath, path, wh, processPath); + } + } + } + + } + + fseventsHandler.exports = FsEventsHandler; + fseventsHandler.exports.canUse = canUse; + return fseventsHandler.exports; +} + +var hasRequiredChokidar; + +function requireChokidar () { + if (hasRequiredChokidar) return chokidar$1; + hasRequiredChokidar = 1; + + const { EventEmitter } = require$$0$3; + const fs = require$$0$2; + const sysPath = require$$0$1; + const { promisify } = require$$2; + const readdirp = /*@__PURE__*/ requireReaddirp(); + const anymatch = /*@__PURE__*/ requireAnymatch().default; + const globParent = /*@__PURE__*/ requireGlobParent(); + const isGlob = /*@__PURE__*/ requireIsGlob(); + const braces = /*@__PURE__*/ requireBraces(); + const normalizePath = /*@__PURE__*/ requireNormalizePath(); + + const NodeFsHandler = /*@__PURE__*/ requireNodefsHandler(); + const FsEventsHandler = /*@__PURE__*/ requireFseventsHandler(); + const { + EV_ALL, + EV_READY, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, + EV_UNLINK_DIR, + EV_RAW, + EV_ERROR, + + STR_CLOSE, + STR_END, + + BACK_SLASH_RE, + DOUBLE_SLASH_RE, + SLASH_OR_BACK_SLASH_RE, + DOT_RE, + REPLACER_RE, + + SLASH, + SLASH_SLASH, + BRACE_START, + BANG, + ONE_DOT, + TWO_DOTS, + GLOBSTAR, + SLASH_GLOBSTAR, + ANYMATCH_OPTS, + STRING_TYPE, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, + + isWindows, + isMacos, + isIBMi + } = /*@__PURE__*/ requireConstants(); + + const stat = promisify(fs.stat); + const readdir = promisify(fs.readdir); + + /** + * @typedef {String} Path + * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName + * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType + */ + + /** + * + * @typedef {Object} WatchHelpers + * @property {Boolean} followSymlinks + * @property {'stat'|'lstat'} statMethod + * @property {Path} path + * @property {Path} watchPath + * @property {Function} entryPath + * @property {Boolean} hasGlob + * @property {Object} globFilter + * @property {Function} filterPath + * @property {Function} filterDir + */ + + const arrify = (value = []) => Array.isArray(value) ? value : [value]; + const flatten = (list, result = []) => { + list.forEach(item => { + if (Array.isArray(item)) { + flatten(item, result); + } else { + result.push(item); + } + }); + return result; + }; + + const unifyPaths = (paths_) => { + /** + * @type {Array<String>} + */ + const paths = flatten(arrify(paths_)); + if (!paths.every(p => typeof p === STRING_TYPE)) { + throw new TypeError(`Non-string provided as watch path: ${paths}`); + } + return paths.map(normalizePathToUnix); + }; + + // If SLASH_SLASH occurs at the beginning of path, it is not replaced + // because "//StoragePC/DrivePool/Movies" is a valid network path + const toUnix = (string) => { + let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } + while (str.match(DOUBLE_SLASH_RE)) { + str = str.replace(DOUBLE_SLASH_RE, SLASH); + } + if (prepend) { + str = SLASH + str; + } + return str; + }; + + // Our version of upath.normalize + // TODO: this is not equal to path-normalize module - investigate why + const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); + + const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); + }; + + const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; + } + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); + } + return sysPath.join(cwd, path); + }; + + const undef = (opts, key) => opts[key] === undefined; + + /** + * Directory entry. + * @property {Path} path + * @property {Set<Path>} items + */ + class DirEntry { + /** + * @param {Path} dir + * @param {Function} removeWatcher + */ + constructor(dir, removeWatcher) { + this.path = dir; + this._removeWatcher = removeWatcher; + /** @type {Set<Path>} */ + this.items = new Set(); + } + + add(item) { + const {items} = this; + if (!items) return; + if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); + } + + async remove(item) { + const {items} = this; + if (!items) return; + items.delete(item); + if (items.size > 0) return; + + const dir = this.path; + try { + await readdir(dir); + } catch (err) { + if (this._removeWatcher) { + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); + } + } + } + + has(item) { + const {items} = this; + if (!items) return; + return items.has(item); + } + + /** + * @returns {Array<String>} + */ + getChildren() { + const {items} = this; + if (!items) return; + return [...items.values()]; + } + + dispose() { + this.items.clear(); + delete this.path; + delete this._removeWatcher; + delete this.items; + Object.freeze(this); + } + } + + const STAT_METHOD_F = 'stat'; + const STAT_METHOD_L = 'lstat'; + class WatchHelper { + constructor(path, watchPath, follow, fsw) { + this.fsw = fsw; + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); + this.watchPath = watchPath; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; + /** @type {object|boolean} */ + if (path === EMPTY_STR) this.hasGlob = false; + this.globSymlink = this.hasGlob && follow ? undefined : false; + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); + this.dirParts.forEach((parts) => { + if (parts.length > 1) parts.pop(); + }); + this.followSymlinks = follow; + this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; + } + + checkGlobSymlink(entry) { + // only need to resolve once + // first entry should always have entry.parentDir === EMPTY_STR + if (this.globSymlink === undefined) { + this.globSymlink = entry.fullParentDir === this.fullWatchPath ? + false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; + } + + if (this.globSymlink) { + return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); + } + + return entry.fullPath; + } + + entryPath(entry) { + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) + ); + } + + filterPath(entry) { + const {stats} = entry; + if (stats && stats.isSymbolicLink()) return this.filterDir(entry); + const resolvedPath = this.entryPath(entry); + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? + this.globFilter(resolvedPath) : true; + return matchesGlob && + this.fsw._isntIgnored(resolvedPath, stats) && + this.fsw._hasReadPermissions(stats); + } + + getDirParts(path) { + if (!this.hasGlob) return []; + const parts = []; + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); + }); + return parts; + } + + filterDir(entry) { + if (this.hasGlob) { + const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); + let globstar = false; + this.unmatchedGlob = !this.dirParts.some((parts) => { + return parts.every((part, i) => { + if (part === GLOBSTAR) globstar = true; + return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + }); + }); + } + return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); + } + } + + /** + * Watches files & directories for changes. Emitted events: + * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` + * + * new FSWatcher() + * .add(directories) + * .on('add', path => log('File', path, 'was added')) + */ + class FSWatcher extends EventEmitter { + // Not indenting methods for history sake; for now. + constructor(_opts) { + super(); + + const opts = {}; + if (_opts) Object.assign(opts, _opts); // for frozen objects + + /** @type {Map<String, DirEntry>} */ + this._watched = new Map(); + /** @type {Map<String, Array>} */ + this._closers = new Map(); + /** @type {Set<String>} */ + this._ignoredPaths = new Set(); + + /** @type {Map<ThrottleType, Map>} */ + this._throttled = new Map(); + + /** @type {Map<Path, String|Boolean>} */ + this._symlinkPaths = new Map(); + + this._streams = new Set(); + this.closed = false; + + // Set up default options. + if (undef(opts, 'persistent')) opts.persistent = true; + if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; + if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; + if (undef(opts, 'interval')) opts.interval = 100; + if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; + if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; + opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; + + // Enable fsevents on OS X when polling isn't explicitly enabled. + if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; + + // If we can't use fsevents, ensure the options reflect it's disabled. + const canUseFsEvents = FsEventsHandler.canUse(); + if (!canUseFsEvents) opts.useFsEvents = false; + + // Use polling on Mac if not using fsevents. + // Other platforms use non-polling fs_watch. + if (undef(opts, 'usePolling') && !opts.useFsEvents) { + opts.usePolling = isMacos; + } + + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + + // Global override (useful for end-developers that need to force polling for all + // instances of chokidar, regardless of usage/dependency depth) + const envPoll = process.env.CHOKIDAR_USEPOLLING; + if (envPoll !== undefined) { + const envLower = envPoll.toLowerCase(); + + if (envLower === 'false' || envLower === '0') { + opts.usePolling = false; + } else if (envLower === 'true' || envLower === '1') { + opts.usePolling = true; + } else { + opts.usePolling = !!envLower; + } + } + const envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = Number.parseInt(envInterval, 10); + } + + // Editor atomic write normalization enabled by default with fs.watch + if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; + if (opts.atomic) this._pendingUnlinks = new Map(); + + if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; + + if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; + if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; + const awf = opts.awaitWriteFinish; + if (awf) { + if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; + if (!awf.pollInterval) awf.pollInterval = 100; + this._pendingWrites = new Map(); + } + if (opts.ignored) opts.ignored = arrify(opts.ignored); + + let readyCalls = 0; + this._emitReady = () => { + readyCalls++; + if (readyCalls >= this._readyCount) { + this._emitReady = EMPTY_FN; + this._readyEmitted = true; + // use process.nextTick to allow time for listener to be bound + process.nextTick(() => this.emit(EV_READY)); + } + }; + this._emitRaw = (...args) => this.emit(EV_RAW, ...args); + this._readyEmitted = false; + this.options = opts; + + // Initialize with proper watcher. + if (opts.useFsEvents) { + this._fsEventsHandler = new FsEventsHandler(this); + } else { + this._nodeFsHandler = new NodeFsHandler(this); + } + + // You’re frozen when your heart’s not open. + Object.freeze(opts); + } + + // Public methods + + /** + * Adds paths to be watched on an existing FSWatcher instance + * @param {Path|Array<Path>} paths_ + * @param {String=} _origAdd private; for handling non-existent paths to be watched + * @param {Boolean=} _internal private; indicates a non-user add + * @returns {FSWatcher} for chaining + */ + add(paths_, _origAdd, _internal) { + const {cwd, disableGlobbing} = this.options; + this.closed = false; + let paths = unifyPaths(paths_); + if (cwd) { + paths = paths.map((path) => { + const absPath = getAbsolutePath(path, cwd); + + // Check `path` instead of `absPath` because the cwd portion can't be a glob + if (disableGlobbing || !isGlob(path)) { + return absPath; + } + return normalizePath(absPath); + }); + } + + // set aside negated glob strings + paths = paths.filter((path) => { + if (path.startsWith(BANG)) { + this._ignoredPaths.add(path.slice(1)); + return false; + } + + // if a path is being added that was previously ignored, stop ignoring it + this._ignoredPaths.delete(path); + this._ignoredPaths.delete(path + SLASH_GLOBSTAR); + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + + return true; + }); + + if (this.options.useFsEvents && this._fsEventsHandler) { + if (!this._readyCount) this._readyCount = paths.length; + if (this.options.persistent) this._readyCount += paths.length; + paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); + } else { + if (!this._readyCount) this._readyCount = 0; + this._readyCount += paths.length; + Promise.all( + paths.map(async path => { + const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); + if (res) this._emitReady(); + return res; + }) + ).then(results => { + if (this.closed) return; + results.filter(item => item).forEach(item => { + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); + }); + }); + } + + return this; + } + + /** + * Close watchers or start ignoring events from specified paths. + * @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs + * @returns {FSWatcher} for chaining + */ + unwatch(paths_) { + if (this.closed) return this; + const paths = unifyPaths(paths_); + const {cwd} = this.options; + + paths.forEach((path) => { + // convert to absolute path unless relative path already matches + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); + } + + this._closePath(path); + + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); + } + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + }); + + return this; + } + + /** + * Close watchers and remove all listeners from watched paths. + * @returns {Promise<void>}. + */ + close() { + if (this.closed) return this._closePromise; + this.closed = true; + + // Memory management. + this.removeAllListeners(); + const closers = []; + this._closers.forEach(closerList => closerList.forEach(closer => { + const promise = closer(); + if (promise instanceof Promise) closers.push(promise); + })); + this._streams.forEach(stream => stream.destroy()); + this._userIgnored = undefined; + this._readyCount = 0; + this._readyEmitted = false; + this._watched.forEach(dirent => dirent.dispose()); + ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { + this[`_${key}`].clear(); + }); + + this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); + return this._closePromise; + } + + /** + * Expose list of watched paths + * @returns {Object} for chaining + */ + getWatched() { + const watchList = {}; + this._watched.forEach((entry, dir) => { + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; + watchList[key || ONE_DOT] = entry.getChildren().sort(); + }); + return watchList; + } + + emitWithAll(event, args) { + this.emit(...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); + } + + // Common helpers + // -------------- + + /** + * Normalize and emit events. + * Calling _emit DOES NOT MEAN emit() would be called! + * @param {EventName} event Type of event + * @param {Path} path File or directory path + * @param {*=} val1 arguments to be passed with event + * @param {*=} val2 + * @param {*=} val3 + * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ + async _emit(event, path, val1, val2, val3) { + if (this.closed) return; + + const opts = this.options; + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); + /** @type Array<any> */ + const args = [event, path]; + if (val3 !== undefined) args.push(val1, val2, val3); + else if (val2 !== undefined) args.push(val1, val2); + else if (val1 !== undefined) args.push(val1); + + const awf = opts.awaitWriteFinish; + let pw; + if (awf && (pw = this._pendingWrites.get(path))) { + pw.lastChange = new Date(); + return this; + } + + if (opts.atomic) { + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); + setTimeout(() => { + this._pendingUnlinks.forEach((entry, path) => { + this.emit(...entry); + this.emit(EV_ALL, ...entry); + this._pendingUnlinks.delete(path); + }); + }, typeof opts.atomic === 'number' ? opts.atomic : 100); + return this; + } + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); + } + } + + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { + const awfEmit = (err, stats) => { + if (err) { + event = args[0] = EV_ERROR; + args[1] = err; + this.emitWithAll(event, args); + } else if (stats) { + // if stats doesn't exist the file must have been deleted + if (args.length > 2) { + args[2] = stats; + } else { + args.push(stats); + } + this.emitWithAll(event, args); + } + }; + + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); + return this; + } + + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); + if (isThrottled) return this; + } + + if (opts.alwaysStat && val1 === undefined && + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) + ) { + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; + let stats; + try { + stats = await stat(fullPath); + } catch (err) {} + // Suppress event when fs_stat fails, to avoid sending undefined 'stat' + if (!stats || this.closed) return; + args.push(stats); + } + this.emitWithAll(event, args); + + return this; + } + + /** + * Common handler for errors + * @param {Error} error + * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ + _handleError(error) { + const code = error && error.code; + if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && + (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) + ) { + this.emit(EV_ERROR, error); + } + return error || this.closed; + } + + /** + * Helper utility for throttling + * @param {ThrottleType} actionType type being throttled + * @param {Path} path being acted upon + * @param {Number} timeout duration of time to suppress duplicate actions + * @returns {Object|false} tracking object or false if action should be suppressed + */ + _throttle(actionType, path, timeout) { + if (!this._throttled.has(actionType)) { + this._throttled.set(actionType, new Map()); + } + + /** @type {Map<Path, Object>} */ + const action = this._throttled.get(actionType); + /** @type {Object} */ + const actionPath = action.get(path); + + if (actionPath) { + actionPath.count++; + return false; + } + + let timeoutObject; + const clear = () => { + const item = action.get(path); + const count = item ? item.count : 0; + action.delete(path); + clearTimeout(timeoutObject); + if (item) clearTimeout(item.timeoutObject); + return count; + }; + timeoutObject = setTimeout(clear, timeout); + const thr = {timeoutObject, clear, count: 0}; + action.set(path, thr); + return thr; + } + + _incrReadyCount() { + return this._readyCount++; + } + + /** + * Awaits write operation to finish. + * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. + * @param {Path} path being acted upon + * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished + * @param {EventName} event + * @param {Function} awfEmit Callback to be called when ready for event to be emitted. + */ + _awaitWriteFinish(path, threshold, event, awfEmit) { + let timeoutHandler; + + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); + } + + const now = new Date(); + + const awaitWriteFinish = (prevStat) => { + fs.stat(fullPath, (err, curStat) => { + if (err || !this._pendingWrites.has(path)) { + if (err && err.code !== 'ENOENT') awfEmit(err); + return; + } + + const now = Number(new Date()); + + if (prevStat && curStat.size !== prevStat.size) { + this._pendingWrites.get(path).lastChange = now; + } + const pw = this._pendingWrites.get(path); + const df = now - pw.lastChange; + + if (df >= threshold) { + this._pendingWrites.delete(path); + awfEmit(undefined, curStat); + } else { + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval, + curStat + ); + } + }); + }; + + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { + lastChange: now, + cancelWait: () => { + this._pendingWrites.delete(path); + clearTimeout(timeoutHandler); + return event; + } + }); + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval + ); + } + } + + _getGlobIgnored() { + return [...this._ignoredPaths.values()]; + } + + /** + * Determines whether user has asked to ignore this path. + * @param {Path} path filepath or dir + * @param {fs.Stats=} stats result of fs.stat + * @returns {Boolean} + */ + _isIgnored(path, stats) { + if (this.options.atomic && DOT_RE.test(path)) return true; + if (!this._userIgnored) { + const {cwd} = this.options; + const ign = this.options.ignored; + + const ignored = ign && ign.map(normalizeIgnored(cwd)); + const paths = arrify(ignored) + .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) + .map((path) => path + SLASH_GLOBSTAR); + const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); + this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + } + + return this._userIgnored([path, stats]); + } + + _isntIgnored(path, stat) { + return !this._isIgnored(path, stat); + } + + /** + * Provides a set of common helpers and properties relating to symlink and glob handling. + * @param {Path} path file, directory, or glob pattern being watched + * @param {Number=} depth at any depth > 0, this isn't a glob + * @returns {WatchHelper} object containing helpers for this path + */ + _getWatchHelpers(path, depth) { + const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); + const follow = this.options.followSymlinks; + + return new WatchHelper(path, watchPath, follow, this); + } + + // Directory helpers + // ----------------- + + /** + * Provides directory tracking objects + * @param {String} directory path of the directory + * @returns {DirEntry} the directory's tracking object + */ + _getWatchedDir(directory) { + if (!this._boundRemove) this._boundRemove = this._remove.bind(this); + const dir = sysPath.resolve(directory); + if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); + return this._watched.get(dir); + } + + // File helpers + // ------------ + + /** + * Check for read permissions. + * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 + * @param {fs.Stats} stats - object, result of fs_stat + * @returns {Boolean} indicates whether the file can be read + */ + _hasReadPermissions(stats) { + if (this.options.ignorePermissionErrors) return true; + + // stats.mode may be bigint + const md = stats && Number.parseInt(stats.mode, 10); + const st = md & 0o777; + const it = Number.parseInt(st.toString(8)[0], 10); + return Boolean(4 & it); + } + + /** + * Handles emitting unlink events for + * files and directories, and via recursion, for + * files and directories within directories that are unlinked + * @param {String} directory within which the following item is located + * @param {String} item base path of item/directory + * @returns {void} + */ + _remove(directory, item, isDirectory) { + // if what is being deleted is a directory, get that directory's paths + // for recursive deleting and cleaning of watched object + // if it is not a directory, nestedDirectoryChildren will be empty array + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); + isDirectory = isDirectory != null + ? isDirectory + : this._watched.has(path) || this._watched.has(fullPath); + + // prevent duplicate handling in case of arriving here nearly simultaneously + // via multiple paths (such as _handleFile and _handleDir) + if (!this._throttle('remove', path, 100)) return; + + // if the only watched file is removed, watch for its return + if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { + this.add(directory, item, true); + } + + // This will create a new entry in the watched object in either case + // so we got to do the directory check beforehand + const wp = this._getWatchedDir(path); + const nestedDirectoryChildren = wp.getChildren(); + + // Recursively remove children directories / files. + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); + + // Check if item was on the watched list and remove it + const parent = this._getWatchedDir(directory); + const wasTracked = parent.has(item); + parent.remove(item); + + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + + // If we wait for this file to be fully written, cancel the wait. + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); + if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { + const event = this._pendingWrites.get(relPath).cancelWait(); + if (event === EV_ADD) return; + } + + // The Entry will either be a directory that just got removed + // or a bogus entry to a file, in either case we have to remove it + this._watched.delete(path); + this._watched.delete(fullPath); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); + + // Avoid conflicts if we later create another file with the same name + if (!this.options.useFsEvents) { + this._closePath(path); + } + } + + /** + * Closes all watchers for a path + * @param {Path} path + */ + _closePath(path) { + this._closeFile(path); + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); + } + + /** + * Closes only file-specific watchers + * @param {Path} path + */ + _closeFile(path) { + const closers = this._closers.get(path); + if (!closers) return; + closers.forEach(closer => closer()); + this._closers.delete(path); + } + + /** + * + * @param {Path} path + * @param {Function} closer + */ + _addPathCloser(path, closer) { + if (!closer) return; + let list = this._closers.get(path); + if (!list) { + list = []; + this._closers.set(path, list); + } + list.push(closer); + } + + _readdirp(root, opts) { + if (this.closed) return; + const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; + let stream = readdirp(root, options); + this._streams.add(stream); + stream.once(STR_CLOSE, () => { + stream = undefined; + }); + stream.once(STR_END, () => { + if (stream) { + this._streams.delete(stream); + stream = undefined; + } + }); + return stream; + } + + } + + // Export FSWatcher class + chokidar$1.FSWatcher = FSWatcher; + + /** + * Instantiates watcher with paths to be tracked. + * @param {String|Array<String>} paths file/directory paths and/or globs + * @param {Object=} options chokidar opts + * @returns an instance of FSWatcher for chaining. + */ + const watch = (paths, options) => { + const watcher = new FSWatcher(options); + watcher.add(paths); + return watcher; + }; + + chokidar$1.watch = watch; + return chokidar$1; +} + +var chokidarExports = /*@__PURE__*/ requireChokidar(); +const chokidar = /*@__PURE__*/rollup.getDefaultExportFromCjs(chokidarExports); + +exports.chokidar = chokidar; +//# sourceMappingURL=index.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/loadConfigFile.js b/seller_1/node_modules/rollup/dist/shared/loadConfigFile.js new file mode 100644 index 0000000..310cc24 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/loadConfigFile.js @@ -0,0 +1,559 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +const promises = require('node:fs/promises'); +const path = require('node:path'); +const process$1 = require('node:process'); +const node_url = require('node:url'); +const rollup = require('./rollup.js'); +const parseAst_js = require('./parseAst.js'); +const getLogFilter_js = require('../getLogFilter.js'); + +function batchWarnings(command) { + const silent = !!command.silent; + const logFilter = generateLogFilter(command); + let count = 0; + const deferredWarnings = new Map(); + let warningOccurred = false; + const add = (warning) => { + count += 1; + warningOccurred = true; + if (silent) + return; + if (warning.code in deferredHandlers) { + rollup.getOrCreate(deferredWarnings, warning.code, rollup.getNewArray).push(warning); + } + else if (warning.code in immediateHandlers) { + immediateHandlers[warning.code](warning); + } + else { + title(warning.message); + defaultBody(warning); + } + }; + return { + add, + get count() { + return count; + }, + flush() { + if (count === 0 || silent) + return; + const codes = [...deferredWarnings.keys()].sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length); + for (const code of codes) { + deferredHandlers[code](deferredWarnings.get(code)); + } + deferredWarnings.clear(); + count = 0; + }, + log(level, log) { + if (!logFilter(log)) + return; + switch (level) { + case parseAst_js.LOGLEVEL_WARN: { + return add(log); + } + case parseAst_js.LOGLEVEL_DEBUG: { + if (!silent) { + rollup.stderr(rollup.bold(rollup.blue(log.message))); + defaultBody(log); + } + return; + } + default: { + if (!silent) { + rollup.stderr(rollup.bold(rollup.cyan(log.message))); + defaultBody(log); + } + } + } + }, + get warningOccurred() { + return warningOccurred; + } + }; +} +const immediateHandlers = { + MISSING_NODE_BUILTINS(warning) { + title(`Missing shims for Node.js built-ins`); + rollup.stderr(`Creating a browser bundle that depends on ${parseAst_js.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`); + }, + UNKNOWN_OPTION(warning) { + title(`You have passed an unrecognized option`); + rollup.stderr(warning.message); + } +}; +const deferredHandlers = { + CIRCULAR_DEPENDENCY(warnings) { + title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`); + const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings; + for (const warning of displayed) { + rollup.stderr(warning.ids.map(parseAst_js.relativeId).join(' -> ')); + } + if (warnings.length > displayed.length) { + rollup.stderr(`...and ${warnings.length - displayed.length} more`); + } + }, + EMPTY_BUNDLE(warnings) { + title(`Generated${warnings.length === 1 ? ' an' : ''} empty ${warnings.length > 1 ? 'chunks' : 'chunk'}`); + rollup.stderr(parseAst_js.printQuotedStringList(warnings.map(warning => warning.names[0]))); + }, + EVAL(warnings) { + title('Use of eval is strongly discouraged'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_AVOIDING_EVAL)); + showTruncatedWarnings(warnings); + }, + MISSING_EXPORT(warnings) { + title('Missing exports'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_NAME_IS_NOT_EXPORTED)); + for (const warning of warnings) { + rollup.stderr(rollup.bold(parseAst_js.relativeId(warning.id))); + rollup.stderr(`${warning.binding} is not exported by ${parseAst_js.relativeId(warning.exporter)}`); + rollup.stderr(rollup.gray(warning.frame)); + } + }, + MISSING_GLOBAL_NAME(warnings) { + title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`); + info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_GLOBALS)); + rollup.stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`); + for (const warning of warnings) { + rollup.stderr(`${rollup.bold(warning.id)} (guessing "${warning.names[0]}")`); + } + }, + MIXED_EXPORTS(warnings) { + title('Mixing named and default exports'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_EXPORTS)); + rollup.stderr(rollup.bold('The following entry modules are using named and default exports together:')); + warnings.sort((a, b) => (a.id < b.id ? -1 : 1)); + const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings; + for (const warning of displayedWarnings) { + rollup.stderr(parseAst_js.relativeId(warning.id)); + } + if (displayedWarnings.length < warnings.length) { + rollup.stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`); + } + rollup.stderr(`\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`); + }, + NAMESPACE_CONFLICT(warnings) { + title(`Conflicting re-exports`); + for (const warning of warnings) { + rollup.stderr(`"${rollup.bold(parseAst_js.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${parseAst_js.relativeId(warning.ids[0])}" and "${parseAst_js.relativeId(warning.ids[1])}" (will be ignored).`); + } + }, + PLUGIN_WARNING(warnings) { + const nestedByPlugin = nest(warnings, 'plugin'); + for (const { items } of nestedByPlugin) { + const nestedByMessage = nest(items, 'message'); + let lastUrl = ''; + for (const { key: message, items } of nestedByMessage) { + title(message); + for (const warning of items) { + if (warning.url && warning.url !== lastUrl) + info((lastUrl = warning.url)); + const loc = formatLocation(warning); + if (loc) { + rollup.stderr(rollup.bold(loc)); + } + if (warning.frame) + info(warning.frame); + } + } + } + }, + SOURCEMAP_BROKEN(warnings) { + title(`Broken sourcemap`); + info(parseAst_js.getRollupUrl(parseAst_js.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)); + const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))]; + rollup.stderr(`Plugins that transform code (such as ${parseAst_js.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`); + }, + THIS_IS_UNDEFINED(warnings) { + title('"this" has been rewritten to "undefined"'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_THIS_IS_UNDEFINED)); + showTruncatedWarnings(warnings); + }, + UNRESOLVED_IMPORT(warnings) { + title('Unresolved dependencies'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)); + const dependencies = new Map(); + for (const warning of warnings) { + rollup.getOrCreate(dependencies, parseAst_js.relativeId(warning.exporter), rollup.getNewArray).push(parseAst_js.relativeId(warning.id)); + } + for (const [dependency, importers] of dependencies) { + rollup.stderr(`${rollup.bold(dependency)} (imported by ${parseAst_js.printQuotedStringList(importers)})`); + } + }, + UNUSED_EXTERNAL_IMPORT(warnings) { + title('Unused external imports'); + for (const warning of warnings) { + rollup.stderr(warning.names + + ' imported from external module "' + + warning.exporter + + '" but never used in ' + + parseAst_js.printQuotedStringList(warning.ids.map(parseAst_js.relativeId)) + + '.'); + } + } +}; +function defaultBody(log) { + if (log.url) { + info(parseAst_js.getRollupUrl(log.url)); + } + const loc = formatLocation(log); + if (loc) { + rollup.stderr(rollup.bold(loc)); + } + if (log.frame) + info(log.frame); +} +function title(string_) { + rollup.stderr(rollup.bold(rollup.yellow(`(!) ${string_}`))); +} +function info(url) { + rollup.stderr(rollup.gray(url)); +} +function nest(array, property) { + const nested = []; + const lookup = new Map(); + for (const item of array) { + const key = item[property]; + rollup.getOrCreate(lookup, key, () => { + const items = { + items: [], + key + }; + nested.push(items); + return items; + }).items.push(item); + } + return nested; +} +function showTruncatedWarnings(warnings) { + const nestedByModule = nest(warnings, 'id'); + const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule; + for (const { key: id, items } of displayedByModule) { + rollup.stderr(rollup.bold(parseAst_js.relativeId(id))); + rollup.stderr(rollup.gray(items[0].frame)); + if (items.length > 1) { + rollup.stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`); + } + } + if (nestedByModule.length > displayedByModule.length) { + rollup.stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`); + } +} +function generateLogFilter(command) { + const filters = rollup.ensureArray(command.filterLogs).flatMap(filter => String(filter).split(',')); + if (process.env.ROLLUP_FILTER_LOGS) { + filters.push(...process.env.ROLLUP_FILTER_LOGS.split(',')); + } + return getLogFilter_js.getLogFilter(filters); +} +function formatLocation(log) { + const id = log.loc?.file || log.id; + if (!id) + return null; + return log.loc ? `${id}:${log.loc.line}:${log.loc.column}` : id; +} + +const stdinName = '-'; +let stdinResult = null; +function stdinPlugin(argument) { + const suffix = typeof argument == 'string' && argument.length > 0 ? '.' + argument : ''; + return { + load(id) { + if (id === stdinName || id.startsWith(stdinName + '.')) { + return stdinResult || (stdinResult = readStdin()); + } + }, + name: 'stdin', + resolveId(id) { + if (id === stdinName) { + return id + suffix; + } + } + }; +} +function readStdin() { + return new Promise((resolve, reject) => { + const chunks = []; + process$1.stdin.setEncoding('utf8'); + process$1.stdin + .on('data', chunk => chunks.push(chunk)) + .on('end', () => { + const result = chunks.join(''); + resolve(result); + }) + .on('error', error => { + reject(error); + }); + }); +} + +function waitForInputPlugin() { + return { + async buildStart(options) { + const inputSpecifiers = Array.isArray(options.input) + ? options.input + : Object.keys(options.input); + let lastAwaitedSpecifier = null; + checkSpecifiers: while (true) { + for (const specifier of inputSpecifiers) { + if ((await this.resolve(specifier)) === null) { + if (lastAwaitedSpecifier !== specifier) { + rollup.stderr(`waiting for input ${rollup.bold(specifier)}...`); + lastAwaitedSpecifier = specifier; + } + await new Promise(resolve => setTimeout(resolve, 500)); + continue checkSpecifiers; + } + } + break; + } + }, + name: 'wait-for-input' + }; +} + +async function addCommandPluginsToInputOptions(inputOptions, command) { + if (command.stdin !== false) { + inputOptions.plugins.push(stdinPlugin(command.stdin)); + } + if (command.waitForBundleInput === true) { + inputOptions.plugins.push(waitForInputPlugin()); + } + await addPluginsFromCommandOption(command.plugin, inputOptions); +} +async function addPluginsFromCommandOption(commandPlugin, inputOptions) { + if (commandPlugin) { + const plugins = await rollup.normalizePluginOption(commandPlugin); + for (const plugin of plugins) { + if (/[={}]/.test(plugin)) { + // -p plugin=value + // -p "{transform(c,i){...}}" + await loadAndRegisterPlugin(inputOptions, plugin); + } + else { + // split out plugins joined by commas + // -p node-resolve,commonjs,buble + for (const p of plugin.split(',')) { + await loadAndRegisterPlugin(inputOptions, p); + } + } + } + } +} +async function loadAndRegisterPlugin(inputOptions, pluginText) { + let plugin = null; + let pluginArgument = undefined; + if (pluginText[0] === '{') { + // -p "{transform(c,i){...}}" + plugin = new Function('return ' + pluginText); + } + else { + const match = pluginText.match(/^([\w./:@\\^{|}-]+)(=(.*))?$/); + if (match) { + // -p plugin + // -p plugin=arg + pluginText = match[1]; + pluginArgument = new Function('return ' + match[3])(); + } + else { + throw new Error(`Invalid --plugin argument format: ${JSON.stringify(pluginText)}`); + } + if (!/^\.|^rollup-plugin-|[/@\\]/.test(pluginText)) { + // Try using plugin prefix variations first if applicable. + // Prefix order is significant - left has higher precedence. + for (const prefix of ['@rollup/plugin-', 'rollup-plugin-']) { + try { + plugin = await requireOrImport(prefix + pluginText); + break; + } + catch { + // if this does not work, we try requiring the actual name below + } + } + } + if (!plugin) { + try { + if (pluginText[0] == '.') + pluginText = path.resolve(pluginText); + // Windows absolute paths must be specified as file:// protocol URL + // Note that we do not have coverage for Windows-only code paths + else if (/^[A-Za-z]:\\/.test(pluginText)) { + pluginText = node_url.pathToFileURL(path.resolve(pluginText)).href; + } + plugin = await requireOrImport(pluginText); + } + catch (error) { + throw new Error(`Cannot load plugin "${pluginText}": ${error.message}.`); + } + } + } + // some plugins do not use `module.exports` for their entry point, + // in which case we try the named default export and the plugin name + if (typeof plugin === 'object') { + plugin = plugin.default || plugin[getCamelizedPluginBaseName(pluginText)]; + } + if (!plugin) { + throw new Error(`Cannot find entry for plugin "${pluginText}". The plugin needs to export a function either as "default" or "${getCamelizedPluginBaseName(pluginText)}" for Rollup to recognize it.`); + } + inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArgument) : plugin); +} +function getCamelizedPluginBaseName(pluginText) { + return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText) + .split(/[/\\]/) + .slice(-1)[0] + .split('.')[0] + .split('-') + .map((part, index) => (index === 0 || !part ? part : part[0].toUpperCase() + part.slice(1))) + .join(''); +} +async function requireOrImport(pluginPath) { + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require(pluginPath); + } + catch { + return import(pluginPath); + } +} + +const loadConfigFile = async (fileName, commandOptions = {}, watchMode = false) => { + const configs = await getConfigList(getDefaultFromCjs(await getConfigFileExport(fileName, commandOptions, watchMode)), commandOptions); + const warnings = batchWarnings(commandOptions); + try { + const normalizedConfigs = []; + for (const config of configs) { + const options = await rollup.mergeOptions(config, watchMode, commandOptions, warnings.log); + await addCommandPluginsToInputOptions(options, commandOptions); + normalizedConfigs.push(options); + } + return { options: normalizedConfigs, warnings }; + } + catch (error_) { + warnings.flush(); + throw error_; + } +}; +async function getConfigFileExport(fileName, commandOptions, watchMode) { + if (commandOptions.configPlugin || commandOptions.bundleConfigAsCjs) { + try { + return await loadTranspiledConfigFile(fileName, commandOptions); + } + catch (error_) { + if (error_.message.includes('not defined in ES module scope')) { + return parseAst_js.error(parseAst_js.logCannotBundleConfigAsEsm(error_)); + } + throw error_; + } + } + let cannotLoadEsm = false; + const handleWarning = (warning) => { + if (warning.message.includes('To load an ES module')) { + cannotLoadEsm = true; + } + }; + process$1.on('warning', handleWarning); + try { + const fileUrl = node_url.pathToFileURL(fileName); + if (watchMode) { + // We are adding the current date to allow reloads in watch mode + fileUrl.search = `?${Date.now()}`; + } + return (await import(fileUrl.href)).default; + } + catch (error_) { + if (cannotLoadEsm) { + return parseAst_js.error(parseAst_js.logCannotLoadConfigAsCjs(error_)); + } + if (error_.message.includes('not defined in ES module scope')) { + return parseAst_js.error(parseAst_js.logCannotLoadConfigAsEsm(error_)); + } + throw error_; + } + finally { + process$1.off('warning', handleWarning); + } +} +function getDefaultFromCjs(namespace) { + return namespace.default || namespace; +} +function getConfigImportAttributesKey(input) { + if (input === 'assert' || input === 'with') + return input; + return; +} +async function loadTranspiledConfigFile(fileName, commandOptions) { + const { bundleConfigAsCjs, configPlugin, configImportAttributesKey, silent } = commandOptions; + const warnings = batchWarnings(commandOptions); + const inputOptions = { + external: (id) => (id[0] !== '.' && !path.isAbsolute(id)) || id.slice(-5) === '.json', + input: fileName, + onwarn: warnings.add, + plugins: [], + treeshake: false + }; + await addPluginsFromCommandOption(configPlugin, inputOptions); + const bundle = await rollup.rollup(inputOptions); + const { output: [{ code }] } = await bundle.generate({ + exports: 'named', + format: bundleConfigAsCjs ? 'cjs' : 'es', + importAttributesKey: getConfigImportAttributesKey(configImportAttributesKey), + plugins: [ + { + name: 'transpile-import-meta', + resolveImportMeta(property, { moduleId }) { + if (property === 'url') { + return `'${node_url.pathToFileURL(moduleId).href}'`; + } + if (property == 'filename') { + return `'${moduleId}'`; + } + if (property == 'dirname') { + return `'${path.dirname(moduleId)}'`; + } + if (property == null) { + return `{url:'${node_url.pathToFileURL(moduleId).href}', filename: '${moduleId}', dirname: '${path.dirname(moduleId)}'}`; + } + } + } + ] + }); + if (!silent && warnings.count > 0) { + rollup.stderr(rollup.bold(`loaded ${parseAst_js.relativeId(fileName)} with warnings`)); + warnings.flush(); + } + return loadConfigFromWrittenFile(path.join(path.dirname(fileName), `rollup.config-${Date.now()}.${bundleConfigAsCjs ? 'cjs' : 'mjs'}`), code); +} +async function loadConfigFromWrittenFile(bundledFileName, bundledCode) { + await promises.writeFile(bundledFileName, bundledCode); + try { + return (await import(node_url.pathToFileURL(bundledFileName).href)).default; + } + finally { + promises.unlink(bundledFileName).catch(error => console.warn(error?.message || error)); + } +} +async function getConfigList(configFileExport, commandOptions) { + const config = await (typeof configFileExport === 'function' + ? configFileExport(commandOptions) + : configFileExport); + if (Object.keys(config).length === 0) { + return parseAst_js.error(parseAst_js.logMissingConfig()); + } + return Array.isArray(config) ? config : [config]; +} + +exports.addCommandPluginsToInputOptions = addCommandPluginsToInputOptions; +exports.batchWarnings = batchWarnings; +exports.loadConfigFile = loadConfigFile; +exports.stdinName = stdinName; +//# sourceMappingURL=loadConfigFile.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/parseAst.js b/seller_1/node_modules/rollup/dist/shared/parseAst.js new file mode 100644 index 0000000..06cc940 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/parseAst.js @@ -0,0 +1,2299 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +const native_js = require('../native.js'); +const path = require('node:path'); + +/** @typedef {import('./types').Location} Location */ + +/** + * @param {import('./types').Range} range + * @param {number} index + */ +function rangeContains(range, index) { + return range.start <= index && index < range.end; +} + +/** + * @param {string} source + * @param {import('./types').Options} [options] + */ +function getLocator(source, options = {}) { + const { offsetLine = 0, offsetColumn = 0 } = options; + + let start = 0; + const ranges = source.split('\n').map((line, i) => { + const end = start + line.length + 1; + + /** @type {import('./types').Range} */ + const range = { start, end, line: i }; + + start = end; + return range; + }); + + let i = 0; + + /** + * @param {string | number} search + * @param {number} [index] + * @returns {Location | undefined} + */ + function locator(search, index) { + if (typeof search === 'string') { + search = source.indexOf(search, index ?? 0); + } + + if (search === -1) return undefined; + + let range = ranges[i]; + + const d = search >= range.end ? 1 : -1; + + while (range) { + if (rangeContains(range, search)) { + return { + line: offsetLine + range.line, + column: offsetColumn + search - range.start, + character: search + }; + } + + i += d; + range = ranges[i]; + } + } + + return locator; +} + +/** + * @param {string} source + * @param {string | number} search + * @param {import('./types').Options} [options] + * @returns {Location | undefined} + */ +function locate(source, search, options) { + return getLocator(source, options)(search, options && options.startIndex); +} + +function spaces(index) { + let result = ''; + while (index--) + result += ' '; + return result; +} +function tabsToSpaces(value) { + return value.replace(/^\t+/, match => match.split('\t').join(' ')); +} +const LINE_TRUNCATE_LENGTH = 120; +const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10; +const ELLIPSIS = '...'; +function getCodeFrame(source, line, column) { + let lines = source.split('\n'); + // Needed if a plugin did not generate correct sourcemaps + if (line > lines.length) + return ''; + const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + + ELLIPSIS.length, LINE_TRUNCATE_LENGTH); + const frameStart = Math.max(0, line - 3); + let frameEnd = Math.min(line + 2, lines.length); + lines = lines.slice(frameStart, frameEnd); + while (!/\S/.test(lines[lines.length - 1])) { + lines.pop(); + frameEnd -= 1; + } + const digits = String(frameEnd).length; + return lines + .map((sourceLine, index) => { + const isErrorLine = frameStart + index + 1 === line; + let lineNumber = String(index + frameStart + 1); + while (lineNumber.length < digits) + lineNumber = ` ${lineNumber}`; + let displayedLine = tabsToSpaces(sourceLine); + if (displayedLine.length > maxLineLength) { + displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`; + } + if (isErrorLine) { + const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^'; + return `${lineNumber}: ${displayedLine}\n${indicator}`; + } + return `${lineNumber}: ${displayedLine}`; + }) + .join('\n'); +} + +const LOGLEVEL_SILENT = 'silent'; +const LOGLEVEL_ERROR = 'error'; +const LOGLEVEL_WARN = 'warn'; +const LOGLEVEL_INFO = 'info'; +const LOGLEVEL_DEBUG = 'debug'; +const logLevelPriority = { + [LOGLEVEL_DEBUG]: 0, + [LOGLEVEL_INFO]: 1, + [LOGLEVEL_SILENT]: 3, + [LOGLEVEL_WARN]: 2 +}; + +const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/; +const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/; +function isAbsolute(path) { + return ABSOLUTE_PATH_REGEX.test(path); +} +function isRelative(path) { + return RELATIVE_PATH_REGEX.test(path); +} +const BACKSLASH_REGEX = /\\/g; +function normalize(path) { + return path.replace(BACKSLASH_REGEX, '/'); +} + +function printQuotedStringList(list, verbs) { + const isSingleItem = list.length <= 1; + const quotedList = list.map(item => `"${item}"`); + let output = isSingleItem + ? quotedList[0] + : `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`; + if (verbs) { + output += ` ${isSingleItem ? verbs[0] : verbs[1]}`; + } + return output; +} + +const ANY_SLASH_REGEX = /[/\\]/; +function relative(from, to) { + const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean); + const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean); + if (fromParts[0] === '.') + fromParts.shift(); + if (toParts[0] === '.') + toParts.shift(); + while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + while (toParts[0] === '..' && fromParts.length > 0) { + toParts.shift(); + fromParts.pop(); + } + while (fromParts.pop()) { + toParts.unshift('..'); + } + return toParts.join('/'); +} + +function getAliasName(id) { + const base = path.basename(id); + return base.slice(0, Math.max(0, base.length - path.extname(id).length)); +} +function relativeId(id) { + if (!isAbsolute(id)) + return id; + return relative(path.resolve(), id); +} +function isPathFragment(name) { + // starting with "/", "./", "../", "C:/" + return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name)); +} +const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/; +function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) { + while (targetPath.startsWith('../')) { + targetPath = targetPath.slice(3); + importerId = '_/' + importerId; + } + let relativePath = normalize(relative(path.dirname(importerId), targetPath)); + if (stripJsExtension && relativePath.endsWith('.js')) { + relativePath = relativePath.slice(0, -3); + } + if (ensureFileName) { + if (relativePath === '') + return '../' + path.basename(targetPath); + if (UPPER_DIR_REGEX.test(relativePath)) { + return [...relativePath.split('/'), '..', path.basename(targetPath)].join('/'); + } + } + return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.'; +} + +function isValidUrl(url) { + try { + new URL(url); + } + catch { + return false; + } + return true; +} +function getRollupUrl(snippet) { + return `https://rollupjs.org/${snippet}`; +} +function addTrailingSlashIfMissed(url) { + if (!url.endsWith('/')) { + return url + '/'; + } + return url; +} + +// troubleshooting +const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval'; +const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module'; +const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined'; +const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency'; +const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect'; +// configuration-options +const URL_JSX = 'configuration-options/#jsx'; +const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id'; +const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath'; +const URL_OUTPUT_DIR = 'configuration-options/#output-dir'; +const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports'; +const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend'; +const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes'; +const URL_OUTPUT_FORMAT = 'configuration-options/#output-format'; +const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode'; +const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals'; +const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports'; +const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop'; +const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks'; +const URL_OUTPUT_NAME = 'configuration-options/#output-name'; +const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl'; +const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile'; +const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures'; +const URL_TREESHAKE = 'configuration-options/#treeshake'; +const URL_TREESHAKE_PURE = 'configuration-options/#pure'; +const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects'; +const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects'; +const URL_WATCH = 'configuration-options/#watch'; +// command-line-interface +const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs'; +const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files'; +const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle'; + +function error(base) { + throw base instanceof Error ? base : getRollupError(base); +} +function getRollupError(base) { + augmentLogMessage(base); + const errorInstance = Object.assign(new Error(base.message), base); + Object.defineProperty(errorInstance, 'name', { + value: 'RollupError', + writable: true + }); + return errorInstance; +} +function augmentCodeLocation(properties, pos, source, id) { + if (typeof pos === 'object') { + const { line, column } = pos; + properties.loc = { column, file: id, line }; + } + else { + properties.pos = pos; + const location = locate(source, pos, { offsetLine: 1 }); + if (!location) { + return; + } + const { line, column } = location; + properties.loc = { column, file: id, line }; + } + if (properties.frame === undefined) { + const { line, column } = properties.loc; + properties.frame = getCodeFrame(source, line, column); + } +} +const symbolAugmented = Symbol('augmented'); +function augmentLogMessage(log) { + // Make sure to only augment the log message once + if (!(log.plugin || log.loc) || log[symbolAugmented]) { + return; + } + log[symbolAugmented] = true; + let prefix = ''; + if (log.plugin) { + prefix += `[plugin ${log.plugin}] `; + } + const id = log.id || log.loc?.file; + if (id) { + const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : ''; + prefix += `${relativeId(id)}${position}: `; + } + const oldMessage = log.message; + log.message = prefix + log.message; + tweakStackMessage(log, oldMessage); +} +// Error codes should be sorted alphabetically while errors should be sorted by +// error code below +const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR'; +function logAddonNotGenerated(message, hook, plugin) { + return { + code: ADDON_ERROR, + message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}". +\tError Message: ${message}` + }; +} +function logAlreadyClosed() { + return { + code: ALREADY_CLOSED, + message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' + }; +} +function logAmbiguousExternalNamespaces(binding, reexportingModule, usedModule, sources) { + return { + binding, + code: AMBIGUOUS_EXTERNAL_NAMESPACES, + ids: sources, + message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${binding}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`, + reexporter: reexportingModule + }; +} +function logAnonymousPluginCache() { + return { + code: ANONYMOUS_PLUGIN_CACHE, + message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.' + }; +} +function logAssetNotFinalisedForFileName(name) { + return { + code: ASSET_NOT_FINALISED, + message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.` + }; +} +function logAssetReferenceIdNotFoundForSetSource(assetReferenceId) { + return { + code: ASSET_NOT_FOUND, + message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".` + }; +} +function logAssetSourceAlreadySet(name) { + return { + code: ASSET_SOURCE_ALREADY_SET, + message: `Unable to set the source for asset "${name}", source already set.` + }; +} +function logNoAssetSourceSet(assetName) { + return { + code: ASSET_SOURCE_MISSING, + message: `Plugin error creating asset "${assetName}" - no asset source set.` + }; +} +function logBadLoader(id) { + return { + code: BAD_LOADER, + message: `Error loading "${relativeId(id)}": plugin load hook should return a string, a { code, map } object, or nothing/null.` + }; +} +function logCannotCallNamespace(name) { + return { + code: CANNOT_CALL_NAMESPACE, + message: `Cannot call a namespace ("${name}").` + }; +} +function logCannotEmitFromOptionsHook() { + return { + code: CANNOT_EMIT_FROM_OPTIONS_HOOK, + message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.` + }; +} +function logChunkNotGeneratedForFileName(name) { + return { + code: CHUNK_NOT_GENERATED, + message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.` + }; +} +function logChunkInvalid({ fileName, code }, { pos, message }) { + const errorProperties = { + code: CHUNK_INVALID, + message: `Chunk "${fileName}" is not valid JavaScript: ${message}.` + }; + augmentCodeLocation(errorProperties, pos, code, fileName); + return errorProperties; +} +function logCircularDependency(cyclePath) { + return { + code: CIRCULAR_DEPENDENCY, + ids: cyclePath, + message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}` + }; +} +function logCircularReexport(exportName, exporter) { + return { + code: CIRCULAR_REEXPORT, + exporter, + message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.` + }; +} +function logCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) { + return { + code: CYCLIC_CROSS_CHUNK_REEXPORT, + exporter, + id: importer, + message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`, + reexporter + }; +} +function logDeprecation(deprecation, urlSnippet, plugin) { + return { + code: DEPRECATED_FEATURE, + message: deprecation, + url: getRollupUrl(urlSnippet), + ...({}) + }; +} +function logConstVariableReassignError() { + return { + code: CONST_REASSIGN, + message: 'Cannot reassign a variable declared with `const`' + }; +} +function logDuplicateArgumentNameError(name) { + return { + code: DUPLICATE_ARGUMENT_NAME, + message: `Duplicate argument name "${name}"` + }; +} +function logDuplicateExportError(name) { + return { code: DUPLICATE_EXPORT, message: `Duplicate export "${name}"` }; +} +function logDuplicateImportOptions() { + return { + code: DUPLICATE_IMPORT_OPTIONS, + message: 'Either use --input, or pass input path as argument' + }; +} +function logDuplicatePluginName(plugin) { + return { + code: DUPLICATE_PLUGIN_NAME, + message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).` + }; +} +function logEmptyChunk(chunkName) { + return { + code: EMPTY_BUNDLE, + message: `Generated an empty chunk: "${chunkName}".`, + names: [chunkName] + }; +} +function logEval(id) { + return { + code: EVAL, + id, + message: `Use of eval in "${relativeId(id)}" is strongly discouraged as it poses security risks and may cause issues with minification.`, + url: getRollupUrl(URL_AVOIDING_EVAL) + }; +} +function logExternalSyntheticExports(id, importer) { + return { + code: EXTERNAL_SYNTHETIC_EXPORTS, + exporter: id, + message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(importer)}").` + }; +} +function logFailAfterWarnings() { + return { + code: FAIL_AFTER_WARNINGS, + message: 'Warnings occurred and --failAfterWarnings flag present.' + }; +} +function logFileNameConflict(fileName) { + return { + code: FILE_NAME_CONFLICT, + message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.` + }; +} +function logFileReferenceIdNotFoundForFilename(assetReferenceId) { + return { + code: FILE_NOT_FOUND, + message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".` + }; +} +function logFirstSideEffect(source, id, { line, column }) { + return { + code: FIRST_SIDE_EFFECT, + message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame(source, line, column)}` + }; +} +function logIllegalIdentifierAsName(name) { + return { + code: ILLEGAL_IDENTIFIER_AS_NAME, + message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`, + url: getRollupUrl(URL_OUTPUT_EXTEND) + }; +} +function logIllegalImportReassignment(name, importingId) { + return { + code: ILLEGAL_REASSIGNMENT, + message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".` + }; +} +function logInconsistentImportAttributes(existingAttributes, newAttributes, source, importer) { + return { + code: INCONSISTENT_IMPORT_ATTRIBUTES, + message: `Module "${relativeId(importer)}" tried to import "${relativeId(source)}" with ${formatAttributes(newAttributes)} attributes, but it was already imported elsewhere with ${formatAttributes(existingAttributes)} attributes. Please ensure that import attributes for the same module are always consistent.` + }; +} +const formatAttributes = (attributes) => { + const entries = Object.entries(attributes); + if (entries.length === 0) + return 'no'; + return entries.map(([key, value]) => `"${key}": "${value}"`).join(', '); +}; +function logInvalidAnnotation(comment, id, type) { + return { + code: INVALID_ANNOTATION, + id, + message: `A comment\n\n"${comment}"\n\nin "${relativeId(id)}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`, + url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE) + }; +} +function logInputHookInOutputPlugin(pluginName, hookName) { + return { + code: INPUT_HOOK_IN_OUTPUT_PLUGIN, + message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.` + }; +} +function logCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) { + return { + code: INVALID_CHUNK, + message: `Cannot assign "${relativeId(moduleId)}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.` + }; +} +function tweakStackMessage(error, oldMessage) { + if (!error.stack) { + return error; + } + error.stack = error.stack.replace(oldMessage, error.message); + return error; +} +function logCannotBundleConfigAsEsm(originalError) { + return tweakStackMessage({ + cause: originalError, + code: INVALID_CONFIG_MODULE_FORMAT, + message: `Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${originalError.message}`, + stack: originalError.stack, + url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) + }, originalError.message); +} +function logCannotLoadConfigAsCjs(originalError) { + return tweakStackMessage({ + cause: originalError, + code: INVALID_CONFIG_MODULE_FORMAT, + message: `Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`, + stack: originalError.stack, + url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) + }, originalError.message); +} +function logCannotLoadConfigAsEsm(originalError) { + return tweakStackMessage({ + cause: originalError, + code: INVALID_CONFIG_MODULE_FORMAT, + message: `Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`, + stack: originalError.stack, + url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) + }, originalError.message); +} +function logInvalidExportOptionValue(optionValue) { + return { + code: INVALID_EXPORT_OPTION, + message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logIncompatibleExportOptionValue(optionValue, keys, entryModule) { + return { + code: INVALID_EXPORT_OPTION, + message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${printQuotedStringList(keys)}`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logInternalIdCannotBeExternal(source, importer) { + return { + code: INVALID_EXTERNAL_ID, + message: `"${source}" is imported as an external by "${relativeId(importer)}", but is already an existing non-external module id.` + }; +} +function logImportOptionsAreInvalid(importer) { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId(importer)}". Dynamic import options need to be an object with a nested attributes object.` + }; +} +function logImportAttributeIsInvalid(importer) { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values. The attribute will be removed.` + }; +} +function logInvalidLogPosition(plugin) { + return { + code: INVALID_LOG_POSITION, + message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.` + }; +} +function logInvalidOption(option, urlSnippet, explanation, value) { + return { + code: INVALID_OPTION, + message: `Invalid value ${value === undefined ? '' : `${JSON.stringify(value)} `}for option "${option}" - ${explanation}.`, + url: getRollupUrl(urlSnippet) + }; +} +function logInvalidAddonPluginHook(hook, plugin) { + return { + code: INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`, + plugin + }; +} +function logInvalidFunctionPluginHook(hook, plugin) { + return { + code: INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`, + plugin + }; +} +function logInvalidRollupPhaseForChunkEmission() { + return { + code: INVALID_ROLLUP_PHASE, + message: `Cannot emit chunks after module loading has finished.` + }; +} +function logInvalidSetAssetSourceCall() { + return { + code: INVALID_SETASSETSOURCE, + message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.` + }; +} +function logInvalidFormatForTopLevelAwait(id, format) { + return { + code: INVALID_TLA_FORMAT, + id, + message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.` + }; +} +function logMissingConfig() { + return { + code: MISSING_CONFIG, + message: 'Config file must export an options object, or an array of options objects', + url: getRollupUrl(URL_CONFIGURATION_FILES) + }; +} +function logMissingEntryExport(binding, exporter) { + return { + binding, + code: MISSING_EXPORT, + exporter, + message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}".`, + url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED) + }; +} +function logMissingExport(binding, importingModule, exporter) { + const isJson = path.extname(exporter) === '.json'; + return { + binding, + code: MISSING_EXPORT, + exporter, + id: importingModule, + message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`, + url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED) + }; +} +function logMissingExternalConfig(file) { + return { + code: MISSING_EXTERNAL_CONFIG, + message: `Could not resolve config file "${file}"` + }; +} +function logMissingGlobalName(externalId, guess) { + return { + code: MISSING_GLOBAL_NAME, + id: externalId, + message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`, + names: [guess], + url: getRollupUrl(URL_OUTPUT_GLOBALS) + }; +} +function logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) { + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.` + }; +} +function logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) { + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.` + }; +} +function logImplicitDependantIsNotIncluded(module) { + const implicitDependencies = [...module.implicitlyLoadedBefore] + .map(dependency => relativeId(dependency.id)) + .sort(); + return { + code: MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.` + }; +} +function logMissingJsxExport(name, exporter, importer) { + return { + code: MISSING_JSX_EXPORT, + exporter, + id: importer, + message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`, + names: [name], + url: getRollupUrl(URL_JSX) + }; +} +function logMissingNameOptionForIifeExport() { + return { + code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, + message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`, + url: getRollupUrl(URL_OUTPUT_NAME) + }; +} +function logMissingNameOptionForUmdExport() { + return { + code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, + message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.', + url: getRollupUrl(URL_OUTPUT_NAME) + }; +} +function logMissingNodeBuiltins(externalBuiltins) { + return { + code: MISSING_NODE_BUILTINS, + ids: externalBuiltins, + message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node` + }; +} +function logMissingFileOrDirOption() { + return { + code: MISSING_OPTION, + message: 'You must specify "output.file" or "output.dir" for the build.', + url: getRollupUrl(URL_OUTPUT_DIR) + }; +} +function logMixedExport(facadeModuleId, name) { + return { + code: MIXED_EXPORTS, + id: facadeModuleId, + message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`, + url: getRollupUrl(URL_OUTPUT_EXPORTS) + }; +} +function logModuleLevelDirective(directive, id) { + return { + code: MODULE_LEVEL_DIRECTIVE, + id, + message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId(id)}" was ignored.` + }; +} +function logNamespaceConflict(binding, reexportingModuleId, sources) { + return { + binding, + code: NAMESPACE_CONFLICT, + ids: sources, + message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${binding}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored).`, + reexporter: reexportingModuleId + }; +} +function logNoTransformMapOrAstWithoutCode(pluginName) { + return { + code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE, + message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` + + 'a "code". This will be ignored.' + }; +} +function logOnlyInlineSourcemapsForStdout() { + return { + code: ONLY_INLINE_SOURCEMAPS, + message: 'Only inline sourcemaps are supported when bundling to stdout.' + }; +} +function logOptimizeChunkStatus(chunks, smallChunks, pointInTime) { + return { + code: OPTIMIZE_CHUNK_STATUS, + message: `${pointInTime}, there are\n` + + `${chunks} chunks, of which\n` + + `${smallChunks} are below minChunkSize.` + }; +} +function logParseError(message, pos) { + return { code: PARSE_ERROR, message, pos }; +} +function logRedeclarationError(name) { + return { + code: REDECLARATION_ERROR, + message: `Identifier "${name}" has already been declared` + }; +} +function logReservedNamespace(namespace) { + return { + code: RESERVED_NAMESPACE, + message: `You have overided reserved namespace "${namespace}"` + }; +} +function logModuleParseError(error, moduleId) { + let message = error.message.replace(/ \(\d+:\d+\)$/, ''); + if (moduleId.endsWith('.json')) { + message += ' (Note that you need @rollup/plugin-json to import JSON files)'; + } + else if (!moduleId.endsWith('.js')) { + message += ' (Note that you need plugins to import files that are not JavaScript)'; + } + return tweakStackMessage({ + cause: error, + code: PARSE_ERROR, + id: moduleId, + message, + stack: error.stack + }, error.message); +} +function logPluginError(error, plugin, { hook, id } = {}) { + const code = error.code; + if (!error.pluginCode && + code != null && + (typeof code !== 'string' || !code.startsWith('PLUGIN_'))) { + error.pluginCode = code; + } + error.code = PLUGIN_ERROR; + error.plugin = plugin; + if (hook) { + error.hook = hook; + } + if (id) { + error.id = id; + } + return error; +} +function logShimmedExport(id, binding) { + return { + binding, + code: SHIMMED_EXPORT, + exporter: id, + message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".` + }; +} +function logSourcemapBroken(plugin) { + return { + code: SOURCEMAP_BROKEN, + message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, + plugin, + url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT) + }; +} +function logConflictingSourcemapSources(filename) { + return { + code: SOURCEMAP_BROKEN, + message: `Multiple conflicting contents for sourcemap source ${filename}` + }; +} +function logInvalidSourcemapForError(error, id, column, line, pos) { + return { + cause: error, + code: SOURCEMAP_ERROR, + id, + loc: { + column, + file: id, + line + }, + message: `Error when using sourcemap for reporting an error: ${error.message}`, + pos + }; +} +function logSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) { + return { + code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT, + exporter: id, + message: `Module "${relativeId(id)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}\` needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default' + ? `an explicit export named "${syntheticNamedExportsOption}"` + : 'a default export'} that does not reexport an unresolved named export of the same module.` + }; +} +function logThisIsUndefined() { + return { + code: THIS_IS_UNDEFINED, + message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`, + url: getRollupUrl(URL_THIS_IS_UNDEFINED) + }; +} +function logUnexpectedNamedImport(id, imported, isReexport) { + const importType = isReexport ? 'reexport' : 'import'; + return { + code: UNEXPECTED_NAMED_IMPORT, + exporter: id, + message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`, + url: getRollupUrl(URL_OUTPUT_INTEROP) + }; +} +function logUnexpectedNamespaceReexport(id) { + return { + code: UNEXPECTED_NAMED_IMPORT, + exporter: id, + message: `There was a namespace "*" reexport from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`, + url: getRollupUrl(URL_OUTPUT_INTEROP) + }; +} +function logUnknownOption(optionType, unknownOptions, validOptions) { + return { + code: UNKNOWN_OPTION, + message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.join(', ')}` + }; +} +function logEntryCannotBeExternal(unresolvedId) { + return { + code: UNRESOLVED_ENTRY, + message: `Entry module "${relativeId(unresolvedId)}" cannot be external.` + }; +} +function logExternalModulesCannotBeIncludedInManualChunks(source) { + return { + code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS, + message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.` + }; +} +function logExternalModulesCannotBeTransformedToModules(source) { + return { + code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES, + message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.` + }; +} +function logUnresolvedEntry(unresolvedId) { + return { + code: UNRESOLVED_ENTRY, + message: `Could not resolve entry module "${relativeId(unresolvedId)}".` + }; +} +function logUnresolvedImport(source, importer) { + return { + code: UNRESOLVED_IMPORT, + exporter: source, + id: importer, + message: `Could not resolve "${source}" from "${relativeId(importer)}"` + }; +} +function logUnresolvedImportTreatedAsExternal(source, importer) { + return { + code: UNRESOLVED_IMPORT, + exporter: source, + id: importer, + message: `"${source}" is imported by "${relativeId(importer)}", but could not be resolved – treating it as an external dependency.`, + url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY) + }; +} +function logUnusedExternalImports(externalId, names, importers) { + return { + code: UNUSED_EXTERNAL_IMPORT, + exporter: externalId, + ids: importers, + message: `${printQuotedStringList(names, [ + 'is', + 'are' + ])} imported from external module "${externalId}" but never used in ${printQuotedStringList(importers.map(importer => relativeId(importer)))}.`, + names + }; +} +function logFailedValidation(message) { + return { + code: VALIDATION_ERROR, + message + }; +} +function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) { + warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations); +} +function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) { + if (activeDeprecation || strictDeprecations) { + const warning = logDeprecation(deprecation, urlSnippet); + if (strictDeprecations) { + return error(warning); + } + log(LOGLEVEL_WARN, warning); + } +} + +const BLANK = Object.freeze(Object.create(null)); +const EMPTY_OBJECT = Object.freeze({}); +const EMPTY_ARRAY = Object.freeze([]); +const EMPTY_SET = Object.freeze(new (class extends Set { + add() { + throw new Error('Cannot add to empty set'); + } +})()); + +// This file is generated by scripts/generate-node-types.js. +// Do not edit this file directly. +const ArrowFunctionExpression = 'ArrowFunctionExpression'; +const BlockStatement = 'BlockStatement'; +const CallExpression = 'CallExpression'; +const CatchClause = 'CatchClause'; +const ExportDefaultDeclaration = 'ExportDefaultDeclaration'; +const ExpressionStatement = 'ExpressionStatement'; +const Identifier = 'Identifier'; +const Literal = 'Literal'; +const ObjectExpression = 'ObjectExpression'; +const PanicError = 'PanicError'; +const ParseError = 'ParseError'; +const Program = 'Program'; +const Property = 'Property'; +const ReturnStatement = 'ReturnStatement'; +const StaticBlock = 'StaticBlock'; +const TemplateLiteral = 'TemplateLiteral'; +const VariableDeclarator = 'VariableDeclarator'; + +// This file is generated by scripts/generate-string-constants.js. +// Do not edit this file directly. +const FIXED_STRINGS = [ + 'var', + 'let', + 'const', + 'init', + 'get', + 'set', + 'constructor', + 'method', + '-', + '+', + '!', + '~', + 'typeof', + 'void', + 'delete', + '++', + '--', + '==', + '!=', + '===', + '!==', + '<', + '<=', + '>', + '>=', + '<<', + '>>', + '>>>', + '+', + '-', + '*', + '/', + '%', + '|', + '^', + '&', + '||', + '&&', + 'in', + 'instanceof', + '**', + '??', + '=', + '+=', + '-=', + '*=', + '/=', + '%=', + '<<=', + '>>=', + '>>>=', + '|=', + '^=', + '&=', + '**=', + '&&=', + '||=', + '??=', + 'pure', + 'noSideEffects', + 'sourcemap', + 'using', + 'await using' +]; + +const ANNOTATION_KEY = '_rollupAnnotations'; +const INVALID_ANNOTATION_KEY = '_rollupRemoved'; +const convertAnnotations = (position, buffer) => { + if (position === 0) + return EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + list[index] = convertAnnotation(buffer[position++], buffer); + } + return list; +}; +const convertAnnotation = (position, buffer) => { + const start = buffer[position++]; + const end = buffer[position++]; + const type = FIXED_STRINGS[buffer[position]]; + return { end, start, type }; +}; + +// This file is generated by scripts/generate-buffer-to-ast.js. +// Do not edit this file directly. +function convertProgram(buffer) { + const node = convertNode(0, buffer); + switch (node.type) { + case PanicError: { + return error(getRollupError(logParseError(node.message))); + } + case ParseError: { + return error(getRollupError(logParseError(node.message, node.start))); + } + default: { + return node; + } + } +} +/* eslint-disable sort-keys */ +const nodeConverters = [ + function panicError(position, buffer) { + return { + type: 'PanicError', + start: buffer[position], + end: buffer[position + 1], + message: buffer.convertString(buffer[position + 2]) + }; + }, + function parseError(position, buffer) { + return { + type: 'ParseError', + start: buffer[position], + end: buffer[position + 1], + message: buffer.convertString(buffer[position + 2]) + }; + }, + function arrayExpression(position, buffer) { + return { + type: 'ArrayExpression', + start: buffer[position], + end: buffer[position + 1], + elements: convertNodeList(buffer[position + 2], buffer) + }; + }, + function arrayPattern(position, buffer) { + return { + type: 'ArrayPattern', + start: buffer[position], + end: buffer[position + 1], + elements: convertNodeList(buffer[position + 2], buffer) + }; + }, + function arrowFunctionExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'ArrowFunctionExpression', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + expression: (flags & 2) === 2, + generator: (flags & 4) === 4, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + params: convertNodeList(buffer[position + 4], buffer), + body: convertNode(buffer[position + 5], buffer), + id: null + }; + }, + function assignmentExpression(position, buffer) { + return { + type: 'AssignmentExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function assignmentPattern(position, buffer) { + return { + type: 'AssignmentPattern', + start: buffer[position], + end: buffer[position + 1], + left: convertNode(buffer[position + 2], buffer), + right: convertNode(buffer[position + 3], buffer) + }; + }, + function awaitExpression(position, buffer) { + return { + type: 'AwaitExpression', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function binaryExpression(position, buffer) { + return { + type: 'BinaryExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function blockStatement(position, buffer) { + return { + type: 'BlockStatement', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function breakStatement(position, buffer) { + const labelPosition = buffer[position + 2]; + return { + type: 'BreakStatement', + start: buffer[position], + end: buffer[position + 1], + label: labelPosition === 0 ? null : convertNode(labelPosition, buffer) + }; + }, + function callExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'CallExpression', + start: buffer[position], + end: buffer[position + 1], + optional: (flags & 1) === 1, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + callee: convertNode(buffer[position + 4], buffer), + arguments: convertNodeList(buffer[position + 5], buffer) + }; + }, + function catchClause(position, buffer) { + const parameterPosition = buffer[position + 2]; + return { + type: 'CatchClause', + start: buffer[position], + end: buffer[position + 1], + param: parameterPosition === 0 ? null : convertNode(parameterPosition, buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function chainExpression(position, buffer) { + return { + type: 'ChainExpression', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function classBody(position, buffer) { + return { + type: 'ClassBody', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function classDeclaration(position, buffer) { + const idPosition = buffer[position + 3]; + const superClassPosition = buffer[position + 4]; + return { + type: 'ClassDeclaration', + start: buffer[position], + end: buffer[position + 1], + decorators: convertNodeList(buffer[position + 2], buffer), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function classExpression(position, buffer) { + const idPosition = buffer[position + 3]; + const superClassPosition = buffer[position + 4]; + return { + type: 'ClassExpression', + start: buffer[position], + end: buffer[position + 1], + decorators: convertNodeList(buffer[position + 2], buffer), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function conditionalExpression(position, buffer) { + return { + type: 'ConditionalExpression', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + consequent: convertNode(buffer[position + 3], buffer), + alternate: convertNode(buffer[position + 4], buffer) + }; + }, + function continueStatement(position, buffer) { + const labelPosition = buffer[position + 2]; + return { + type: 'ContinueStatement', + start: buffer[position], + end: buffer[position + 1], + label: labelPosition === 0 ? null : convertNode(labelPosition, buffer) + }; + }, + function debuggerStatement(position, buffer) { + return { + type: 'DebuggerStatement', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function decorator(position, buffer) { + return { + type: 'Decorator', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function directive(position, buffer) { + return { + type: 'ExpressionStatement', + start: buffer[position], + end: buffer[position + 1], + directive: buffer.convertString(buffer[position + 2]), + expression: convertNode(buffer[position + 3], buffer) + }; + }, + function doWhileStatement(position, buffer) { + return { + type: 'DoWhileStatement', + start: buffer[position], + end: buffer[position + 1], + body: convertNode(buffer[position + 2], buffer), + test: convertNode(buffer[position + 3], buffer) + }; + }, + function emptyStatement(position, buffer) { + return { + type: 'EmptyStatement', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function exportAllDeclaration(position, buffer) { + const exportedPosition = buffer[position + 2]; + return { + type: 'ExportAllDeclaration', + start: buffer[position], + end: buffer[position + 1], + exported: exportedPosition === 0 ? null : convertNode(exportedPosition, buffer), + source: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function exportDefaultDeclaration(position, buffer) { + return { + type: 'ExportDefaultDeclaration', + start: buffer[position], + end: buffer[position + 1], + declaration: convertNode(buffer[position + 2], buffer) + }; + }, + function exportNamedDeclaration(position, buffer) { + const sourcePosition = buffer[position + 3]; + const declarationPosition = buffer[position + 5]; + return { + type: 'ExportNamedDeclaration', + start: buffer[position], + end: buffer[position + 1], + specifiers: convertNodeList(buffer[position + 2], buffer), + source: sourcePosition === 0 ? null : convertNode(sourcePosition, buffer), + attributes: convertNodeList(buffer[position + 4], buffer), + declaration: declarationPosition === 0 ? null : convertNode(declarationPosition, buffer) + }; + }, + function exportSpecifier(position, buffer) { + const local = convertNode(buffer[position + 2], buffer); + const exportedPosition = buffer[position + 3]; + return { + type: 'ExportSpecifier', + start: buffer[position], + end: buffer[position + 1], + local, + exported: exportedPosition === 0 ? { ...local } : convertNode(exportedPosition, buffer) + }; + }, + function expressionStatement(position, buffer) { + return { + type: 'ExpressionStatement', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function forInStatement(position, buffer) { + return { + type: 'ForInStatement', + start: buffer[position], + end: buffer[position + 1], + left: convertNode(buffer[position + 2], buffer), + right: convertNode(buffer[position + 3], buffer), + body: convertNode(buffer[position + 4], buffer) + }; + }, + function forOfStatement(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'ForOfStatement', + start: buffer[position], + end: buffer[position + 1], + await: (flags & 1) === 1, + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function forStatement(position, buffer) { + const initPosition = buffer[position + 2]; + const testPosition = buffer[position + 3]; + const updatePosition = buffer[position + 4]; + return { + type: 'ForStatement', + start: buffer[position], + end: buffer[position + 1], + init: initPosition === 0 ? null : convertNode(initPosition, buffer), + test: testPosition === 0 ? null : convertNode(testPosition, buffer), + update: updatePosition === 0 ? null : convertNode(updatePosition, buffer), + body: convertNode(buffer[position + 5], buffer) + }; + }, + function functionDeclaration(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + const idPosition = buffer[position + 4]; + return { + type: 'FunctionDeclaration', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + generator: (flags & 2) === 2, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + params: convertNodeList(buffer[position + 5], buffer), + body: convertNode(buffer[position + 6], buffer), + expression: false + }; + }, + function functionExpression(position, buffer) { + const flags = buffer[position + 2]; + const annotations = convertAnnotations(buffer[position + 3], buffer); + const idPosition = buffer[position + 4]; + return { + type: 'FunctionExpression', + start: buffer[position], + end: buffer[position + 1], + async: (flags & 1) === 1, + generator: (flags & 2) === 2, + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + id: idPosition === 0 ? null : convertNode(idPosition, buffer), + params: convertNodeList(buffer[position + 5], buffer), + body: convertNode(buffer[position + 6], buffer), + expression: false + }; + }, + function identifier(position, buffer) { + return { + type: 'Identifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function ifStatement(position, buffer) { + const alternatePosition = buffer[position + 4]; + return { + type: 'IfStatement', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + consequent: convertNode(buffer[position + 3], buffer), + alternate: alternatePosition === 0 ? null : convertNode(alternatePosition, buffer) + }; + }, + function importAttribute(position, buffer) { + return { + type: 'ImportAttribute', + start: buffer[position], + end: buffer[position + 1], + key: convertNode(buffer[position + 2], buffer), + value: convertNode(buffer[position + 3], buffer) + }; + }, + function importDeclaration(position, buffer) { + return { + type: 'ImportDeclaration', + start: buffer[position], + end: buffer[position + 1], + specifiers: convertNodeList(buffer[position + 2], buffer), + source: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function importDefaultSpecifier(position, buffer) { + return { + type: 'ImportDefaultSpecifier', + start: buffer[position], + end: buffer[position + 1], + local: convertNode(buffer[position + 2], buffer) + }; + }, + function importExpression(position, buffer) { + const optionsPosition = buffer[position + 3]; + return { + type: 'ImportExpression', + start: buffer[position], + end: buffer[position + 1], + source: convertNode(buffer[position + 2], buffer), + options: optionsPosition === 0 ? null : convertNode(optionsPosition, buffer) + }; + }, + function importNamespaceSpecifier(position, buffer) { + return { + type: 'ImportNamespaceSpecifier', + start: buffer[position], + end: buffer[position + 1], + local: convertNode(buffer[position + 2], buffer) + }; + }, + function importSpecifier(position, buffer) { + const importedPosition = buffer[position + 2]; + const local = convertNode(buffer[position + 3], buffer); + return { + type: 'ImportSpecifier', + start: buffer[position], + end: buffer[position + 1], + imported: importedPosition === 0 ? { ...local } : convertNode(importedPosition, buffer), + local + }; + }, + function jsxAttribute(position, buffer) { + const valuePosition = buffer[position + 3]; + return { + type: 'JSXAttribute', + start: buffer[position], + end: buffer[position + 1], + name: convertNode(buffer[position + 2], buffer), + value: valuePosition === 0 ? null : convertNode(valuePosition, buffer) + }; + }, + function jsxClosingElement(position, buffer) { + return { + type: 'JSXClosingElement', + start: buffer[position], + end: buffer[position + 1], + name: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxClosingFragment(position, buffer) { + return { + type: 'JSXClosingFragment', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function jsxElement(position, buffer) { + const closingElementPosition = buffer[position + 4]; + return { + type: 'JSXElement', + start: buffer[position], + end: buffer[position + 1], + openingElement: convertNode(buffer[position + 2], buffer), + children: convertNodeList(buffer[position + 3], buffer), + closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer) + }; + }, + function jsxEmptyExpression(position, buffer) { + return { + type: 'JSXEmptyExpression', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function jsxExpressionContainer(position, buffer) { + return { + type: 'JSXExpressionContainer', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxFragment(position, buffer) { + return { + type: 'JSXFragment', + start: buffer[position], + end: buffer[position + 1], + openingFragment: convertNode(buffer[position + 2], buffer), + children: convertNodeList(buffer[position + 3], buffer), + closingFragment: convertNode(buffer[position + 4], buffer) + }; + }, + function jsxIdentifier(position, buffer) { + return { + type: 'JSXIdentifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function jsxMemberExpression(position, buffer) { + return { + type: 'JSXMemberExpression', + start: buffer[position], + end: buffer[position + 1], + object: convertNode(buffer[position + 2], buffer), + property: convertNode(buffer[position + 3], buffer) + }; + }, + function jsxNamespacedName(position, buffer) { + return { + type: 'JSXNamespacedName', + start: buffer[position], + end: buffer[position + 1], + namespace: convertNode(buffer[position + 2], buffer), + name: convertNode(buffer[position + 3], buffer) + }; + }, + function jsxOpeningElement(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'JSXOpeningElement', + start: buffer[position], + end: buffer[position + 1], + selfClosing: (flags & 1) === 1, + name: convertNode(buffer[position + 3], buffer), + attributes: convertNodeList(buffer[position + 4], buffer) + }; + }, + function jsxOpeningFragment(position, buffer) { + return { + type: 'JSXOpeningFragment', + start: buffer[position], + end: buffer[position + 1], + attributes: [], + selfClosing: false + }; + }, + function jsxSpreadAttribute(position, buffer) { + return { + type: 'JSXSpreadAttribute', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxSpreadChild(position, buffer) { + return { + type: 'JSXSpreadChild', + start: buffer[position], + end: buffer[position + 1], + expression: convertNode(buffer[position + 2], buffer) + }; + }, + function jsxText(position, buffer) { + return { + type: 'JSXText', + start: buffer[position], + end: buffer[position + 1], + value: buffer.convertString(buffer[position + 2]), + raw: buffer.convertString(buffer[position + 3]) + }; + }, + function labeledStatement(position, buffer) { + return { + type: 'LabeledStatement', + start: buffer[position], + end: buffer[position + 1], + label: convertNode(buffer[position + 2], buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function literalBigInt(position, buffer) { + const bigint = buffer.convertString(buffer[position + 2]); + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + bigint, + raw: buffer.convertString(buffer[position + 3]), + value: BigInt(bigint) + }; + }, + function literalBoolean(position, buffer) { + const flags = buffer[position + 2]; + const value = (flags & 1) === 1; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + value, + raw: value ? 'true' : 'false' + }; + }, + function literalNull(position, buffer) { + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: 'null', + value: null + }; + }, + function literalNumber(position, buffer) { + const rawPosition = buffer[position + 2]; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition), + value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true) + }; + }, + function literalRegExp(position, buffer) { + const flags = buffer.convertString(buffer[position + 2]); + const pattern = buffer.convertString(buffer[position + 3]); + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + raw: `/${pattern}/${flags}`, + regex: { flags, pattern }, + value: new RegExp(pattern, flags) + }; + }, + function literalString(position, buffer) { + const rawPosition = buffer[position + 3]; + return { + type: 'Literal', + start: buffer[position], + end: buffer[position + 1], + value: buffer.convertString(buffer[position + 2]), + raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition) + }; + }, + function logicalExpression(position, buffer) { + return { + type: 'LogicalExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + left: convertNode(buffer[position + 3], buffer), + right: convertNode(buffer[position + 4], buffer) + }; + }, + function memberExpression(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'MemberExpression', + start: buffer[position], + end: buffer[position + 1], + computed: (flags & 1) === 1, + optional: (flags & 2) === 2, + object: convertNode(buffer[position + 3], buffer), + property: convertNode(buffer[position + 4], buffer) + }; + }, + function metaProperty(position, buffer) { + return { + type: 'MetaProperty', + start: buffer[position], + end: buffer[position + 1], + meta: convertNode(buffer[position + 2], buffer), + property: convertNode(buffer[position + 3], buffer) + }; + }, + function methodDefinition(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'MethodDefinition', + start: buffer[position], + end: buffer[position + 1], + static: (flags & 1) === 1, + computed: (flags & 2) === 2, + decorators: convertNodeList(buffer[position + 3], buffer), + key: convertNode(buffer[position + 4], buffer), + value: convertNode(buffer[position + 5], buffer), + kind: FIXED_STRINGS[buffer[position + 6]] + }; + }, + function newExpression(position, buffer) { + const annotations = convertAnnotations(buffer[position + 2], buffer); + return { + type: 'NewExpression', + start: buffer[position], + end: buffer[position + 1], + ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}), + callee: convertNode(buffer[position + 3], buffer), + arguments: convertNodeList(buffer[position + 4], buffer) + }; + }, + function objectExpression(position, buffer) { + return { + type: 'ObjectExpression', + start: buffer[position], + end: buffer[position + 1], + properties: convertNodeList(buffer[position + 2], buffer) + }; + }, + function objectPattern(position, buffer) { + return { + type: 'ObjectPattern', + start: buffer[position], + end: buffer[position + 1], + properties: convertNodeList(buffer[position + 2], buffer) + }; + }, + function privateIdentifier(position, buffer) { + return { + type: 'PrivateIdentifier', + start: buffer[position], + end: buffer[position + 1], + name: buffer.convertString(buffer[position + 2]) + }; + }, + function program(position, buffer) { + const invalidAnnotations = convertAnnotations(buffer[position + 3], buffer); + return { + type: 'Program', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer), + ...(invalidAnnotations.length > 0 ? { [INVALID_ANNOTATION_KEY]: invalidAnnotations } : {}), + sourceType: 'module' + }; + }, + function property(position, buffer) { + const flags = buffer[position + 2]; + const keyPosition = buffer[position + 3]; + const value = convertNode(buffer[position + 4], buffer); + return { + type: 'Property', + start: buffer[position], + end: buffer[position + 1], + method: (flags & 1) === 1, + shorthand: (flags & 2) === 2, + computed: (flags & 4) === 4, + key: keyPosition === 0 ? { ...value } : convertNode(keyPosition, buffer), + value, + kind: FIXED_STRINGS[buffer[position + 5]] + }; + }, + function propertyDefinition(position, buffer) { + const flags = buffer[position + 2]; + const valuePosition = buffer[position + 5]; + return { + type: 'PropertyDefinition', + start: buffer[position], + end: buffer[position + 1], + static: (flags & 1) === 1, + computed: (flags & 2) === 2, + decorators: convertNodeList(buffer[position + 3], buffer), + key: convertNode(buffer[position + 4], buffer), + value: valuePosition === 0 ? null : convertNode(valuePosition, buffer) + }; + }, + function restElement(position, buffer) { + return { + type: 'RestElement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function returnStatement(position, buffer) { + const argumentPosition = buffer[position + 2]; + return { + type: 'ReturnStatement', + start: buffer[position], + end: buffer[position + 1], + argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer) + }; + }, + function sequenceExpression(position, buffer) { + return { + type: 'SequenceExpression', + start: buffer[position], + end: buffer[position + 1], + expressions: convertNodeList(buffer[position + 2], buffer) + }; + }, + function spreadElement(position, buffer) { + return { + type: 'SpreadElement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function staticBlock(position, buffer) { + return { + type: 'StaticBlock', + start: buffer[position], + end: buffer[position + 1], + body: convertNodeList(buffer[position + 2], buffer) + }; + }, + function superElement(position, buffer) { + return { + type: 'Super', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function switchCase(position, buffer) { + const testPosition = buffer[position + 2]; + return { + type: 'SwitchCase', + start: buffer[position], + end: buffer[position + 1], + test: testPosition === 0 ? null : convertNode(testPosition, buffer), + consequent: convertNodeList(buffer[position + 3], buffer) + }; + }, + function switchStatement(position, buffer) { + return { + type: 'SwitchStatement', + start: buffer[position], + end: buffer[position + 1], + discriminant: convertNode(buffer[position + 2], buffer), + cases: convertNodeList(buffer[position + 3], buffer) + }; + }, + function taggedTemplateExpression(position, buffer) { + return { + type: 'TaggedTemplateExpression', + start: buffer[position], + end: buffer[position + 1], + tag: convertNode(buffer[position + 2], buffer), + quasi: convertNode(buffer[position + 3], buffer) + }; + }, + function templateElement(position, buffer) { + const flags = buffer[position + 2]; + const cookedPosition = buffer[position + 3]; + const cooked = cookedPosition === 0 ? undefined : buffer.convertString(cookedPosition); + const raw = buffer.convertString(buffer[position + 4]); + return { + type: 'TemplateElement', + start: buffer[position], + end: buffer[position + 1], + tail: (flags & 1) === 1, + value: { cooked, raw } + }; + }, + function templateLiteral(position, buffer) { + return { + type: 'TemplateLiteral', + start: buffer[position], + end: buffer[position + 1], + quasis: convertNodeList(buffer[position + 2], buffer), + expressions: convertNodeList(buffer[position + 3], buffer) + }; + }, + function thisExpression(position, buffer) { + return { + type: 'ThisExpression', + start: buffer[position], + end: buffer[position + 1] + }; + }, + function throwStatement(position, buffer) { + return { + type: 'ThrowStatement', + start: buffer[position], + end: buffer[position + 1], + argument: convertNode(buffer[position + 2], buffer) + }; + }, + function tryStatement(position, buffer) { + const handlerPosition = buffer[position + 3]; + const finalizerPosition = buffer[position + 4]; + return { + type: 'TryStatement', + start: buffer[position], + end: buffer[position + 1], + block: convertNode(buffer[position + 2], buffer), + handler: handlerPosition === 0 ? null : convertNode(handlerPosition, buffer), + finalizer: finalizerPosition === 0 ? null : convertNode(finalizerPosition, buffer) + }; + }, + function unaryExpression(position, buffer) { + return { + type: 'UnaryExpression', + start: buffer[position], + end: buffer[position + 1], + operator: FIXED_STRINGS[buffer[position + 2]], + argument: convertNode(buffer[position + 3], buffer), + prefix: true + }; + }, + function updateExpression(position, buffer) { + const flags = buffer[position + 2]; + return { + type: 'UpdateExpression', + start: buffer[position], + end: buffer[position + 1], + prefix: (flags & 1) === 1, + operator: FIXED_STRINGS[buffer[position + 3]], + argument: convertNode(buffer[position + 4], buffer) + }; + }, + function variableDeclaration(position, buffer) { + return { + type: 'VariableDeclaration', + start: buffer[position], + end: buffer[position + 1], + kind: FIXED_STRINGS[buffer[position + 2]], + declarations: convertNodeList(buffer[position + 3], buffer) + }; + }, + function variableDeclarator(position, buffer) { + const initPosition = buffer[position + 3]; + return { + type: 'VariableDeclarator', + start: buffer[position], + end: buffer[position + 1], + id: convertNode(buffer[position + 2], buffer), + init: initPosition === 0 ? null : convertNode(initPosition, buffer) + }; + }, + function whileStatement(position, buffer) { + return { + type: 'WhileStatement', + start: buffer[position], + end: buffer[position + 1], + test: convertNode(buffer[position + 2], buffer), + body: convertNode(buffer[position + 3], buffer) + }; + }, + function yieldExpression(position, buffer) { + const flags = buffer[position + 2]; + const argumentPosition = buffer[position + 3]; + return { + type: 'YieldExpression', + start: buffer[position], + end: buffer[position + 1], + delegate: (flags & 1) === 1, + argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer) + }; + } +]; +function convertNode(position, buffer) { + const nodeType = buffer[position]; + const converter = nodeConverters[nodeType]; + /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */ + if (!converter) { + console.trace(); + throw new Error(`Unknown node type: ${nodeType}`); + } + return converter(position + 1, buffer); +} +function convertNodeList(position, buffer) { + if (position === 0) + return EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[position++]; + list[index] = nodePosition ? convertNode(nodePosition, buffer) : null; + } + return list; +} + +function getAstBuffer(astBuffer) { + const array = new Uint32Array(astBuffer.buffer); + let convertString; + if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) { + convertString = (position) => { + const length = array[position++]; + const bytePosition = position << 2; + return astBuffer.toString('utf8', bytePosition, bytePosition + length); + }; + } + else { + const textDecoder = new TextDecoder(); + convertString = (position) => { + const length = array[position++]; + const bytePosition = position << 2; + return textDecoder.decode(astBuffer.subarray(bytePosition, bytePosition + length)); + }; + } + return Object.assign(array, { convertString }); +} + +const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(native_js.parse(input, allowReturnOutsideFunction, jsx))); +const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await native_js.parseAsync(input, allowReturnOutsideFunction, jsx, signal))); + +exports.ANNOTATION_KEY = ANNOTATION_KEY; +exports.ArrowFunctionExpression = ArrowFunctionExpression; +exports.BLANK = BLANK; +exports.BlockStatement = BlockStatement; +exports.CallExpression = CallExpression; +exports.CatchClause = CatchClause; +exports.EMPTY_ARRAY = EMPTY_ARRAY; +exports.EMPTY_OBJECT = EMPTY_OBJECT; +exports.EMPTY_SET = EMPTY_SET; +exports.ExportDefaultDeclaration = ExportDefaultDeclaration; +exports.ExpressionStatement = ExpressionStatement; +exports.FIXED_STRINGS = FIXED_STRINGS; +exports.INVALID_ANNOTATION_KEY = INVALID_ANNOTATION_KEY; +exports.Identifier = Identifier; +exports.LOGLEVEL_DEBUG = LOGLEVEL_DEBUG; +exports.LOGLEVEL_ERROR = LOGLEVEL_ERROR; +exports.LOGLEVEL_INFO = LOGLEVEL_INFO; +exports.LOGLEVEL_WARN = LOGLEVEL_WARN; +exports.Literal = Literal; +exports.ObjectExpression = ObjectExpression; +exports.Program = Program; +exports.Property = Property; +exports.ReturnStatement = ReturnStatement; +exports.StaticBlock = StaticBlock; +exports.TemplateLiteral = TemplateLiteral; +exports.URL_AVOIDING_EVAL = URL_AVOIDING_EVAL; +exports.URL_GENERATEBUNDLE = URL_GENERATEBUNDLE; +exports.URL_JSX = URL_JSX; +exports.URL_NAME_IS_NOT_EXPORTED = URL_NAME_IS_NOT_EXPORTED; +exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH; +exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID; +exports.URL_OUTPUT_DIR = URL_OUTPUT_DIR; +exports.URL_OUTPUT_EXPORTS = URL_OUTPUT_EXPORTS; +exports.URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = URL_OUTPUT_EXTERNALIMPORTATTRIBUTES; +exports.URL_OUTPUT_FORMAT = URL_OUTPUT_FORMAT; +exports.URL_OUTPUT_GENERATEDCODE = URL_OUTPUT_GENERATEDCODE; +exports.URL_OUTPUT_GLOBALS = URL_OUTPUT_GLOBALS; +exports.URL_OUTPUT_INLINEDYNAMICIMPORTS = URL_OUTPUT_INLINEDYNAMICIMPORTS; +exports.URL_OUTPUT_INTEROP = URL_OUTPUT_INTEROP; +exports.URL_OUTPUT_MANUALCHUNKS = URL_OUTPUT_MANUALCHUNKS; +exports.URL_OUTPUT_SOURCEMAPBASEURL = URL_OUTPUT_SOURCEMAPBASEURL; +exports.URL_OUTPUT_SOURCEMAPFILE = URL_OUTPUT_SOURCEMAPFILE; +exports.URL_PRESERVEENTRYSIGNATURES = URL_PRESERVEENTRYSIGNATURES; +exports.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT; +exports.URL_THIS_IS_UNDEFINED = URL_THIS_IS_UNDEFINED; +exports.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY; +exports.URL_TREESHAKE = URL_TREESHAKE; +exports.URL_TREESHAKE_MODULESIDEEFFECTS = URL_TREESHAKE_MODULESIDEEFFECTS; +exports.URL_WATCH = URL_WATCH; +exports.VariableDeclarator = VariableDeclarator; +exports.addTrailingSlashIfMissed = addTrailingSlashIfMissed; +exports.augmentCodeLocation = augmentCodeLocation; +exports.augmentLogMessage = augmentLogMessage; +exports.convertAnnotations = convertAnnotations; +exports.convertNode = convertNode; +exports.error = error; +exports.getAliasName = getAliasName; +exports.getAstBuffer = getAstBuffer; +exports.getImportPath = getImportPath; +exports.getRollupError = getRollupError; +exports.getRollupUrl = getRollupUrl; +exports.isAbsolute = isAbsolute; +exports.isPathFragment = isPathFragment; +exports.isRelative = isRelative; +exports.isValidUrl = isValidUrl; +exports.locate = locate; +exports.logAddonNotGenerated = logAddonNotGenerated; +exports.logAlreadyClosed = logAlreadyClosed; +exports.logAmbiguousExternalNamespaces = logAmbiguousExternalNamespaces; +exports.logAnonymousPluginCache = logAnonymousPluginCache; +exports.logAssetNotFinalisedForFileName = logAssetNotFinalisedForFileName; +exports.logAssetReferenceIdNotFoundForSetSource = logAssetReferenceIdNotFoundForSetSource; +exports.logAssetSourceAlreadySet = logAssetSourceAlreadySet; +exports.logBadLoader = logBadLoader; +exports.logCannotAssignModuleToChunk = logCannotAssignModuleToChunk; +exports.logCannotBundleConfigAsEsm = logCannotBundleConfigAsEsm; +exports.logCannotCallNamespace = logCannotCallNamespace; +exports.logCannotEmitFromOptionsHook = logCannotEmitFromOptionsHook; +exports.logCannotLoadConfigAsCjs = logCannotLoadConfigAsCjs; +exports.logCannotLoadConfigAsEsm = logCannotLoadConfigAsEsm; +exports.logChunkInvalid = logChunkInvalid; +exports.logChunkNotGeneratedForFileName = logChunkNotGeneratedForFileName; +exports.logCircularDependency = logCircularDependency; +exports.logCircularReexport = logCircularReexport; +exports.logConflictingSourcemapSources = logConflictingSourcemapSources; +exports.logConstVariableReassignError = logConstVariableReassignError; +exports.logCyclicCrossChunkReexport = logCyclicCrossChunkReexport; +exports.logDuplicateArgumentNameError = logDuplicateArgumentNameError; +exports.logDuplicateExportError = logDuplicateExportError; +exports.logDuplicateImportOptions = logDuplicateImportOptions; +exports.logDuplicatePluginName = logDuplicatePluginName; +exports.logEmptyChunk = logEmptyChunk; +exports.logEntryCannotBeExternal = logEntryCannotBeExternal; +exports.logEval = logEval; +exports.logExternalModulesCannotBeIncludedInManualChunks = logExternalModulesCannotBeIncludedInManualChunks; +exports.logExternalModulesCannotBeTransformedToModules = logExternalModulesCannotBeTransformedToModules; +exports.logExternalSyntheticExports = logExternalSyntheticExports; +exports.logFailAfterWarnings = logFailAfterWarnings; +exports.logFailedValidation = logFailedValidation; +exports.logFileNameConflict = logFileNameConflict; +exports.logFileReferenceIdNotFoundForFilename = logFileReferenceIdNotFoundForFilename; +exports.logFirstSideEffect = logFirstSideEffect; +exports.logIllegalIdentifierAsName = logIllegalIdentifierAsName; +exports.logIllegalImportReassignment = logIllegalImportReassignment; +exports.logImplicitDependantCannotBeExternal = logImplicitDependantCannotBeExternal; +exports.logImplicitDependantIsNotIncluded = logImplicitDependantIsNotIncluded; +exports.logImportAttributeIsInvalid = logImportAttributeIsInvalid; +exports.logImportOptionsAreInvalid = logImportOptionsAreInvalid; +exports.logIncompatibleExportOptionValue = logIncompatibleExportOptionValue; +exports.logInconsistentImportAttributes = logInconsistentImportAttributes; +exports.logInputHookInOutputPlugin = logInputHookInOutputPlugin; +exports.logInternalIdCannotBeExternal = logInternalIdCannotBeExternal; +exports.logInvalidAddonPluginHook = logInvalidAddonPluginHook; +exports.logInvalidAnnotation = logInvalidAnnotation; +exports.logInvalidExportOptionValue = logInvalidExportOptionValue; +exports.logInvalidFormatForTopLevelAwait = logInvalidFormatForTopLevelAwait; +exports.logInvalidFunctionPluginHook = logInvalidFunctionPluginHook; +exports.logInvalidLogPosition = logInvalidLogPosition; +exports.logInvalidOption = logInvalidOption; +exports.logInvalidRollupPhaseForChunkEmission = logInvalidRollupPhaseForChunkEmission; +exports.logInvalidSetAssetSourceCall = logInvalidSetAssetSourceCall; +exports.logInvalidSourcemapForError = logInvalidSourcemapForError; +exports.logLevelPriority = logLevelPriority; +exports.logMissingConfig = logMissingConfig; +exports.logMissingEntryExport = logMissingEntryExport; +exports.logMissingExport = logMissingExport; +exports.logMissingExternalConfig = logMissingExternalConfig; +exports.logMissingFileOrDirOption = logMissingFileOrDirOption; +exports.logMissingGlobalName = logMissingGlobalName; +exports.logMissingJsxExport = logMissingJsxExport; +exports.logMissingNameOptionForIifeExport = logMissingNameOptionForIifeExport; +exports.logMissingNameOptionForUmdExport = logMissingNameOptionForUmdExport; +exports.logMissingNodeBuiltins = logMissingNodeBuiltins; +exports.logMixedExport = logMixedExport; +exports.logModuleLevelDirective = logModuleLevelDirective; +exports.logModuleParseError = logModuleParseError; +exports.logNamespaceConflict = logNamespaceConflict; +exports.logNoAssetSourceSet = logNoAssetSourceSet; +exports.logNoTransformMapOrAstWithoutCode = logNoTransformMapOrAstWithoutCode; +exports.logOnlyInlineSourcemapsForStdout = logOnlyInlineSourcemapsForStdout; +exports.logOptimizeChunkStatus = logOptimizeChunkStatus; +exports.logParseError = logParseError; +exports.logPluginError = logPluginError; +exports.logRedeclarationError = logRedeclarationError; +exports.logReservedNamespace = logReservedNamespace; +exports.logShimmedExport = logShimmedExport; +exports.logSourcemapBroken = logSourcemapBroken; +exports.logSyntheticNamedExportsNeedNamespaceExport = logSyntheticNamedExportsNeedNamespaceExport; +exports.logThisIsUndefined = logThisIsUndefined; +exports.logUnexpectedNamedImport = logUnexpectedNamedImport; +exports.logUnexpectedNamespaceReexport = logUnexpectedNamespaceReexport; +exports.logUnknownOption = logUnknownOption; +exports.logUnresolvedEntry = logUnresolvedEntry; +exports.logUnresolvedImplicitDependant = logUnresolvedImplicitDependant; +exports.logUnresolvedImport = logUnresolvedImport; +exports.logUnresolvedImportTreatedAsExternal = logUnresolvedImportTreatedAsExternal; +exports.logUnusedExternalImports = logUnusedExternalImports; +exports.normalize = normalize; +exports.parseAst = parseAst; +exports.parseAstAsync = parseAstAsync; +exports.printQuotedStringList = printQuotedStringList; +exports.relative = relative; +exports.relativeId = relativeId; +exports.warnDeprecation = warnDeprecation; +//# sourceMappingURL=parseAst.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/rollup.js b/seller_1/node_modules/rollup/dist/shared/rollup.js new file mode 100644 index 0000000..cf83744 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/rollup.js @@ -0,0 +1,22269 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +const parseAst_js = require('./parseAst.js'); +const process$1 = require('node:process'); +const tty = require('tty'); +const path = require('node:path'); +const require$$0 = require('path'); +const native_js = require('../native.js'); +const node_perf_hooks = require('node:perf_hooks'); +const promises = require('node:fs/promises'); + +function _interopNamespaceDefault(e) { + const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); + if (e) { + for (const k in e) { + n[k] = e[k]; + } + } + n.default = e; + return n; +} + +const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty); + +var version = "4.28.1"; + +function ensureArray$1(items) { + if (Array.isArray(items)) { + return items.filter(Boolean); + } + if (items) { + return [items]; + } + return []; +} + +var BuildPhase; +(function (BuildPhase) { + BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE"; + BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE"; + BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE"; +})(BuildPhase || (BuildPhase = {})); + +let textEncoder; +const getHash64 = input => native_js.xxhashBase64Url(ensureBuffer(input)); +const getHash36 = input => native_js.xxhashBase36(ensureBuffer(input)); +const getHash16 = input => native_js.xxhashBase16(ensureBuffer(input)); +const hasherByType = { + base36: getHash36, + base64: getHash64, + hex: getHash16 +}; +function ensureBuffer(input) { + if (typeof input === 'string') { + if (typeof Buffer === 'undefined') { + textEncoder ??= new TextEncoder(); + return textEncoder.encode(input); + } + return Buffer.from(input); + } + return input; +} + +function getOrCreate(map, key, init) { + const existing = map.get(key); + if (existing !== undefined) { + return existing; + } + const value = init(); + map.set(key, value); + return value; +} +function getNewSet() { + return new Set(); +} +function getNewArray() { + return []; +} + +const chars$1 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; +const base = 64; +function toBase64(value) { + let outString = ''; + do { + const currentDigit = value % base; + value = (value / base) | 0; + outString = chars$1[currentDigit] + outString; + } while (value !== 0); + return outString; +} + +// Four random characters from the private use area to minimize risk of +// conflicts +const hashPlaceholderLeft = '!~{'; +const hashPlaceholderRight = '}~'; +const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length; +// This is the size of a 128-bits xxhash with base64url encoding +const MAX_HASH_SIZE = 21; +const DEFAULT_HASH_SIZE = 8; +const getHashPlaceholderGenerator = () => { + let nextIndex = 0; + return (optionName, hashSize) => { + if (hashSize > MAX_HASH_SIZE) { + return parseAst_js.error(parseAst_js.logFailedValidation(`Hashes cannot be longer than ${MAX_HASH_SIZE} characters, received ${hashSize}. Check the "${optionName}" option.`)); + } + const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart(hashSize - hashPlaceholderOverhead, '0')}${hashPlaceholderRight}`; + if (placeholder.length > hashSize) { + return parseAst_js.error(parseAst_js.logFailedValidation(`To generate hashes for this number of chunks (currently ${nextIndex}), you need a minimum hash size of ${placeholder.length}, received ${hashSize}. Check the "${optionName}" option.`)); + } + return placeholder; + }; +}; +const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${MAX_HASH_SIZE - hashPlaceholderOverhead}}${hashPlaceholderRight}`, 'g'); +const replacePlaceholders = (code, hashesByPlaceholder) => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder); +const replaceSinglePlaceholder = (code, placeholder, value) => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match)); +const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeholders) => { + const containedPlaceholders = new Set(); + const transformedCode = code.replace(REPLACER_REGEX, placeholder => { + if (placeholders.has(placeholder)) { + containedPlaceholders.add(placeholder); + return `${hashPlaceholderLeft}${'0'.repeat(placeholder.length - hashPlaceholderOverhead)}${hashPlaceholderRight}`; + } + return placeholder; + }); + return { containedPlaceholders, transformedCode }; +}; + +const lowercaseBundleKeys = Symbol('bundleKeys'); +const FILE_PLACEHOLDER = { + type: 'placeholder' +}; +const getOutputBundle = (outputBundleBase) => { + const reservedLowercaseBundleKeys = new Set(); + return new Proxy(outputBundleBase, { + deleteProperty(target, key) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.delete(key.toLowerCase()); + } + return Reflect.deleteProperty(target, key); + }, + get(target, key) { + if (key === lowercaseBundleKeys) { + return reservedLowercaseBundleKeys; + } + return Reflect.get(target, key); + }, + set(target, key, value) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.add(key.toLowerCase()); + } + return Reflect.set(target, key, value); + } + }); +}; +const removeUnreferencedAssets = (outputBundle) => { + const unreferencedAssets = new Set(); + const bundleEntries = Object.values(outputBundle); + for (const asset of bundleEntries) { + if (asset.type === 'asset' && asset.needsCodeReference) { + unreferencedAssets.add(asset.fileName); + } + } + for (const chunk of bundleEntries) { + if (chunk.type === 'chunk') { + for (const referencedFile of chunk.referencedFiles) { + if (unreferencedAssets.has(referencedFile)) { + unreferencedAssets.delete(referencedFile); + } + } + } + } + for (const file of unreferencedAssets) { + delete outputBundle[file]; + } +}; + +function renderNamePattern(pattern, patternName, replacements) { + if (parseAst_js.isPathFragment(pattern)) + return parseAst_js.error(parseAst_js.logFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)); + return pattern.replace(/\[(\w+)(:\d+)?]/g, (_match, type, size) => { + if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) { + return parseAst_js.error(parseAst_js.logFailedValidation(`"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.`)); + } + const replacement = replacements[type](size && Number.parseInt(size.slice(1))); + if (parseAst_js.isPathFragment(replacement)) + return parseAst_js.error(parseAst_js.logFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`)); + return replacement; + }); +} +function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }) { + if (!reservedLowercaseBundleKeys.has(name.toLowerCase())) + return name; + const extension = path.extname(name); + name = name.slice(0, Math.max(0, name.length - extension.length)); + let uniqueName, uniqueIndex = 1; + while (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + extension).toLowerCase())) + ; + return uniqueName; +} + +function generateAssetFileName(name, names, source, originalFileName, originalFileNames, sourceHash, outputOptions, bundle, inputOptions) { + const emittedName = outputOptions.sanitizeFileName(name || 'asset'); + return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function' + ? outputOptions.assetFileNames({ + // Additionally, this should be non-enumerable in the next major + get name() { + parseAst_js.warnDeprecation('Accessing the "name" property of emitted assets when generating the file name is deprecated. Use the "names" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, inputOptions); + return name; + }, + names, + // Additionally, this should be non-enumerable in the next major + get originalFileName() { + parseAst_js.warnDeprecation('Accessing the "originalFileName" property of emitted assets when generating the file name is deprecated. Use the "originalFileNames" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, inputOptions); + return originalFileName; + }, + originalFileNames, + source, + type: 'asset' + }) + : outputOptions.assetFileNames, 'output.assetFileNames', { + ext: () => path.extname(emittedName).slice(1), + extname: () => path.extname(emittedName), + hash: size => sourceHash.slice(0, Math.max(0, size || DEFAULT_HASH_SIZE)), + name: () => emittedName.slice(0, Math.max(0, emittedName.length - path.extname(emittedName).length)) + }), bundle); +} +function reserveFileNameInBundle(fileName, { bundle }, log) { + if (bundle[lowercaseBundleKeys].has(fileName.toLowerCase())) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logFileNameConflict(fileName)); + } + else { + bundle[fileName] = FILE_PLACEHOLDER; + } +} +const emittedFileTypes = new Set(['chunk', 'asset', 'prebuilt-chunk']); +function hasValidType(emittedFile) { + return Boolean(emittedFile && + emittedFileTypes.has(emittedFile.type)); +} +function hasValidName(emittedFile) { + const validatedName = emittedFile.fileName || emittedFile.name; + return !validatedName || (typeof validatedName === 'string' && !parseAst_js.isPathFragment(validatedName)); +} +function getValidSource(source, emittedFile, fileReferenceId) { + if (!(typeof source === 'string' || source instanceof Uint8Array)) { + const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; + return parseAst_js.error(parseAst_js.logFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`)); + } + return source; +} +function getAssetFileName(file, referenceId) { + if (typeof file.fileName !== 'string') { + return parseAst_js.error(parseAst_js.logAssetNotFinalisedForFileName(file.name || referenceId)); + } + return file.fileName; +} +function getChunkFileName(file, facadeChunkByModule) { + if (file.fileName) { + return file.fileName; + } + if (facadeChunkByModule) { + return facadeChunkByModule.get(file.module).getFileName(); + } + return parseAst_js.error(parseAst_js.logChunkNotGeneratedForFileName(file.fileName || file.name)); +} +class FileEmitter { + constructor(graph, options, baseFileEmitter) { + this.graph = graph; + this.options = options; + this.facadeChunkByModule = null; + this.nextIdBase = 1; + this.output = null; + this.outputFileEmitters = []; + this.emitFile = (emittedFile) => { + if (!hasValidType(emittedFile)) { + return parseAst_js.error(parseAst_js.logFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${emittedFile && emittedFile.type}".`)); + } + if (emittedFile.type === 'prebuilt-chunk') { + return this.emitPrebuiltChunk(emittedFile); + } + if (!hasValidName(emittedFile)) { + return parseAst_js.error(parseAst_js.logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`)); + } + if (emittedFile.type === 'chunk') { + return this.emitChunk(emittedFile); + } + return this.emitAsset(emittedFile); + }; + this.finaliseAssets = () => { + for (const [referenceId, emittedFile] of this.filesByReferenceId) { + if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') + return parseAst_js.error(parseAst_js.logNoAssetSourceSet(emittedFile.name || referenceId)); + } + }; + this.getFileName = (fileReferenceId) => { + const emittedFile = this.filesByReferenceId.get(fileReferenceId); + if (!emittedFile) + return parseAst_js.error(parseAst_js.logFileReferenceIdNotFoundForFilename(fileReferenceId)); + if (emittedFile.type === 'chunk') { + return getChunkFileName(emittedFile, this.facadeChunkByModule); + } + if (emittedFile.type === 'prebuilt-chunk') { + return emittedFile.fileName; + } + return getAssetFileName(emittedFile, fileReferenceId); + }; + this.setAssetSource = (referenceId, requestedSource) => { + const consumedFile = this.filesByReferenceId.get(referenceId); + if (!consumedFile) + return parseAst_js.error(parseAst_js.logAssetReferenceIdNotFoundForSetSource(referenceId)); + if (consumedFile.type !== 'asset') { + return parseAst_js.error(parseAst_js.logFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`)); + } + if (consumedFile.source !== undefined) { + return parseAst_js.error(parseAst_js.logAssetSourceAlreadySet(consumedFile.name || referenceId)); + } + const source = getValidSource(requestedSource, consumedFile, referenceId); + if (this.output) { + this.finalizeAdditionalAsset(consumedFile, source, this.output); + } + else { + consumedFile.source = source; + for (const emitter of this.outputFileEmitters) { + emitter.finalizeAdditionalAsset(consumedFile, source, emitter.output); + } + } + }; + this.setChunkInformation = (facadeChunkByModule) => { + this.facadeChunkByModule = facadeChunkByModule; + }; + this.setOutputBundle = (bundle, outputOptions) => { + const getHash = hasherByType[outputOptions.hashCharacters]; + const output = (this.output = { + bundle, + fileNamesBySourceHash: new Map(), + getHash, + outputOptions + }); + for (const emittedFile of this.filesByReferenceId.values()) { + if (emittedFile.fileName) { + reserveFileNameInBundle(emittedFile.fileName, output, this.options.onLog); + } + } + const consumedAssetsByHash = new Map(); + for (const consumedFile of this.filesByReferenceId.values()) { + if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { + if (consumedFile.fileName) { + this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output); + } + else { + const sourceHash = getHash(consumedFile.source); + getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile); + } + } + else if (consumedFile.type === 'prebuilt-chunk') { + this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile); + } + } + for (const [sourceHash, consumedFiles] of consumedAssetsByHash) { + this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output); + } + }; + this.filesByReferenceId = baseFileEmitter + ? new Map(baseFileEmitter.filesByReferenceId) + : new Map(); + baseFileEmitter?.addOutputFileEmitter(this); + } + addOutputFileEmitter(outputFileEmitter) { + this.outputFileEmitters.push(outputFileEmitter); + } + assignReferenceId(file, idBase) { + let referenceId = idBase; + do { + referenceId = getHash64(referenceId).slice(0, 8).replaceAll('-', '$'); + } while (this.filesByReferenceId.has(referenceId) || + this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId))); + file.referenceId = referenceId; + this.filesByReferenceId.set(referenceId, file); + for (const { filesByReferenceId } of this.outputFileEmitters) { + filesByReferenceId.set(referenceId, file); + } + return referenceId; + } + createPrebuiltChunk(prebuiltChunk) { + return { + code: prebuiltChunk.code, + dynamicImports: [], + exports: prebuiltChunk.exports || [], + facadeModuleId: null, + fileName: prebuiltChunk.fileName, + implicitlyLoadedBefore: [], + importedBindings: {}, + imports: [], + isDynamicEntry: false, + isEntry: false, + isImplicitEntry: false, + map: prebuiltChunk.map || null, + moduleIds: [], + modules: {}, + name: prebuiltChunk.fileName, + preliminaryFileName: prebuiltChunk.fileName, + referencedFiles: [], + sourcemapFileName: prebuiltChunk.sourcemapFileName || null, + type: 'chunk' + }; + } + emitAsset(emittedAsset) { + const source = emittedAsset.source === undefined + ? undefined + : getValidSource(emittedAsset.source, emittedAsset, null); + const originalFileName = emittedAsset.originalFileName || null; + if (typeof originalFileName === 'string') { + this.graph.watchFiles[originalFileName] = true; + } + const consumedAsset = { + fileName: emittedAsset.fileName, + name: emittedAsset.name, + needsCodeReference: !!emittedAsset.needsCodeReference, + originalFileName, + referenceId: '', + source, + type: 'asset' + }; + const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++)); + if (this.output) { + this.emitAssetWithReferenceId(consumedAsset, this.output); + } + else { + for (const fileEmitter of this.outputFileEmitters) { + fileEmitter.emitAssetWithReferenceId(consumedAsset, fileEmitter.output); + } + } + return referenceId; + } + emitAssetWithReferenceId(consumedAsset, output) { + const { fileName, source } = consumedAsset; + if (fileName) { + reserveFileNameInBundle(fileName, output, this.options.onLog); + } + if (source !== undefined) { + this.finalizeAdditionalAsset(consumedAsset, source, output); + } + } + emitChunk(emittedChunk) { + if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { + return parseAst_js.error(parseAst_js.logInvalidRollupPhaseForChunkEmission()); + } + if (typeof emittedChunk.id !== 'string') { + return parseAst_js.error(parseAst_js.logFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`)); + } + const consumedChunk = { + fileName: emittedChunk.fileName, + module: null, + name: emittedChunk.name || emittedChunk.id, + referenceId: '', + type: 'chunk' + }; + this.graph.moduleLoader + .emitChunk(emittedChunk) + .then(module => (consumedChunk.module = module)) + .catch(() => { + // Avoid unhandled Promise rejection as the error will be thrown later + // once module loading has finished + }); + return this.assignReferenceId(consumedChunk, emittedChunk.id); + } + emitPrebuiltChunk(emitPrebuiltChunk) { + if (typeof emitPrebuiltChunk.code !== 'string') { + return parseAst_js.error(parseAst_js.logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".`)); + } + if (typeof emitPrebuiltChunk.fileName !== 'string' || + parseAst_js.isPathFragment(emitPrebuiltChunk.fileName)) { + return parseAst_js.error(parseAst_js.logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".`)); + } + const consumedPrebuiltChunk = { + code: emitPrebuiltChunk.code, + exports: emitPrebuiltChunk.exports, + fileName: emitPrebuiltChunk.fileName, + map: emitPrebuiltChunk.map, + referenceId: '', + type: 'prebuilt-chunk' + }; + const referenceId = this.assignReferenceId(consumedPrebuiltChunk, consumedPrebuiltChunk.fileName); + if (this.output) { + this.output.bundle[consumedPrebuiltChunk.fileName] = + this.createPrebuiltChunk(consumedPrebuiltChunk); + } + return referenceId; + } + finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySourceHash, getHash, outputOptions }) { + let { fileName, name, needsCodeReference, originalFileName, referenceId } = consumedFile; + // Deduplicate assets if an explicit fileName is not provided + if (!fileName) { + const sourceHash = getHash(source); + fileName = fileNamesBySourceHash.get(sourceHash); + if (!fileName) { + fileName = generateAssetFileName(name, name ? [name] : [], source, originalFileName, originalFileName ? [originalFileName] : [], sourceHash, outputOptions, bundle, this.options); + fileNamesBySourceHash.set(sourceHash, fileName); + } + } + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName, source }; + this.filesByReferenceId.set(referenceId, assetWithFileName); + const existingAsset = bundle[fileName]; + if (existingAsset?.type === 'asset') { + existingAsset.needsCodeReference &&= needsCodeReference; + if (name) { + existingAsset.names.push(name); + } + if (originalFileName) { + existingAsset.originalFileNames.push(originalFileName); + } + } + else { + const { options } = this; + bundle[fileName] = { + fileName, + get name() { + // Additionally, this should be non-enumerable in the next major + parseAst_js.warnDeprecation('Accessing the "name" property of emitted assets in the bundle is deprecated. Use the "names" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, options); + return name; + }, + names: name ? [name] : [], + needsCodeReference, + get originalFileName() { + // Additionally, this should be non-enumerable in the next major + parseAst_js.warnDeprecation('Accessing the "originalFileName" property of emitted assets in the bundle is deprecated. Use the "originalFileNames" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, options); + return originalFileName; + }, + originalFileNames: originalFileName ? [originalFileName] : [], + source, + type: 'asset' + }; + } + } + finalizeAssetsWithSameSource(consumedFiles, sourceHash, { bundle, fileNamesBySourceHash, outputOptions }) { + const { names, originalFileNames } = getNamesFromAssets(consumedFiles); + let fileName = ''; + let usedConsumedFile; + let needsCodeReference = true; + for (const consumedFile of consumedFiles) { + needsCodeReference &&= consumedFile.needsCodeReference; + const assetFileName = generateAssetFileName(consumedFile.name, names, consumedFile.source, consumedFile.originalFileName, originalFileNames, sourceHash, outputOptions, bundle, this.options); + if (!fileName || + assetFileName.length < fileName.length || + (assetFileName.length === fileName.length && assetFileName < fileName)) { + fileName = assetFileName; + usedConsumedFile = consumedFile; + } + } + fileNamesBySourceHash.set(sourceHash, fileName); + for (const consumedFile of consumedFiles) { + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName }; + this.filesByReferenceId.set(consumedFile.referenceId, assetWithFileName); + } + const { options } = this; + bundle[fileName] = { + fileName, + get name() { + // Additionally, this should be non-enumerable in the next major + parseAst_js.warnDeprecation('Accessing the "name" property of emitted assets in the bundle is deprecated. Use the "names" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, options); + return usedConsumedFile.name; + }, + names, + needsCodeReference, + get originalFileName() { + // Additionally, this should be non-enumerable in the next major + parseAst_js.warnDeprecation('Accessing the "originalFileName" property of emitted assets in the bundle is deprecated. Use the "originalFileNames" property instead.', parseAst_js.URL_GENERATEBUNDLE, false, options); + return usedConsumedFile.originalFileName; + }, + originalFileNames, + source: usedConsumedFile.source, + type: 'asset' + }; + } +} +function getNamesFromAssets(consumedFiles) { + const names = []; + const originalFileNames = []; + for (const { name, originalFileName } of consumedFiles) { + if (typeof name === 'string') { + names.push(name); + } + if (originalFileName) { + originalFileNames.push(originalFileName); + } + } + originalFileNames.sort(); + // Sort by length first and then alphabetically so that the order is stable + // and the shortest names come first + names.sort((a, b) => a.length - b.length || (a > b ? 1 : a === b ? 0 : -1)); + return { names, originalFileNames }; +} + +const doNothing = () => { }; + +async function asyncFlatten(array) { + do { + array = (await Promise.all(array)).flat(Infinity); + } while (array.some((v) => v?.then)); + return array; +} + +const getOnLog = (config, logLevel, printLog = defaultPrintLog) => { + const { onwarn, onLog } = config; + const defaultOnLog = getDefaultOnLog(printLog, onwarn); + if (onLog) { + const minimalPriority = parseAst_js.logLevelPriority[logLevel]; + return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => { + if (level === parseAst_js.LOGLEVEL_ERROR) { + return parseAst_js.error(normalizeLog(handledLog)); + } + if (parseAst_js.logLevelPriority[level] >= minimalPriority) { + defaultOnLog(level, normalizeLog(handledLog)); + } + }); + } + return defaultOnLog; +}; +const getDefaultOnLog = (printLog, onwarn) => onwarn + ? (level, log) => { + if (level === parseAst_js.LOGLEVEL_WARN) { + onwarn(addLogToString(log), warning => printLog(parseAst_js.LOGLEVEL_WARN, normalizeLog(warning))); + } + else { + printLog(level, log); + } + } + : printLog; +const addLogToString = (log) => { + Object.defineProperty(log, 'toString', { + value: () => log.message, + writable: true + }); + return log; +}; +const normalizeLog = (log) => typeof log === 'string' + ? { message: log } + : typeof log === 'function' + ? normalizeLog(log()) + : log; +const defaultPrintLog = (level, { message }) => { + switch (level) { + case parseAst_js.LOGLEVEL_WARN: { + return console.warn(message); + } + case parseAst_js.LOGLEVEL_DEBUG: { + return console.debug(message); + } + default: { + return console.info(message); + } + } +}; +function warnUnknownOptions(passedOptions, validOptions, optionType, log, ignoredKeys = /$./) { + const validOptionSet = new Set(validOptions); + const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key))); + if (unknownOptions.length > 0) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logUnknownOption(optionType, unknownOptions, [...validOptionSet].sort())); + } +} +const treeshakePresets = { + recommended: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: parseAst_js.EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: false + }, + safest: { + annotations: true, + correctVarValueBeforeDeclaration: true, + manualPureFunctions: parseAst_js.EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: true + }, + smallest: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: parseAst_js.EMPTY_ARRAY, + moduleSideEffects: () => false, + propertyReadSideEffects: false, + tryCatchDeoptimization: false, + unknownGlobalSideEffects: false + } +}; +const jsxPresets = { + preserve: { + factory: null, + fragment: null, + importSource: null, + mode: 'preserve' + }, + 'preserve-react': { + factory: 'React.createElement', + fragment: 'React.Fragment', + importSource: 'react', + mode: 'preserve' + }, + react: { + factory: 'React.createElement', + fragment: 'React.Fragment', + importSource: 'react', + mode: 'classic' + }, + 'react-jsx': { + factory: 'React.createElement', + importSource: 'react', + jsxImportSource: 'react/jsx-runtime', + mode: 'automatic' + } +}; +const generatedCodePresets = { + es2015: { + arrowFunctions: true, + constBindings: true, + objectShorthand: true, + reservedNamesAsProps: true, + symbols: true + }, + es5: { + arrowFunctions: false, + constBindings: false, + objectShorthand: false, + reservedNamesAsProps: true, + symbols: false + } +}; +const objectifyOption = (value) => value && typeof value === 'object' ? value : {}; +const objectifyOptionWithPresets = (presets, optionName, urlSnippet, additionalValues) => (value) => { + if (typeof value === 'string') { + const preset = presets[value]; + if (preset) { + return preset; + } + parseAst_js.error(parseAst_js.logInvalidOption(optionName, urlSnippet, `valid values are ${additionalValues}${parseAst_js.printQuotedStringList(Object.keys(presets))}. You can also supply an object for more fine-grained control`, value)); + } + return objectifyOption(value); +}; +const getOptionWithPreset = (value, presets, optionName, urlSnippet, additionalValues) => { + const presetName = value?.preset; + if (presetName) { + const preset = presets[presetName]; + if (preset) { + return { ...preset, ...value }; + } + else { + parseAst_js.error(parseAst_js.logInvalidOption(`${optionName}.preset`, urlSnippet, `valid values are ${parseAst_js.printQuotedStringList(Object.keys(presets))}`, presetName)); + } + } + return objectifyOptionWithPresets(presets, optionName, urlSnippet, additionalValues)(value); +}; +const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean); + +function getLogHandler(level, code, logger, pluginName, logLevel) { + if (parseAst_js.logLevelPriority[level] < parseAst_js.logLevelPriority[logLevel]) { + return doNothing; + } + return (log, pos) => { + if (pos != null) { + logger(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInvalidLogPosition(pluginName)); + } + log = normalizeLog(log); + if (log.code && !log.pluginCode) { + log.pluginCode = log.code; + } + log.code = code; + log.plugin = pluginName; + logger(level, log); + }; +} + +const ANONYMOUS_PLUGIN_PREFIX = 'at position '; +const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position '; + +function createPluginCache(cache) { + return { + delete(id) { + return delete cache[id]; + }, + get(id) { + const item = cache[id]; + if (!item) + return; + item[0] = 0; + return item[1]; + }, + has(id) { + const item = cache[id]; + if (!item) + return false; + item[0] = 0; + return true; + }, + set(id, value) { + cache[id] = [0, value]; + } + }; +} +function getTrackedPluginCache(pluginCache, onUse) { + return { + delete(id) { + onUse(); + return pluginCache.delete(id); + }, + get(id) { + onUse(); + return pluginCache.get(id); + }, + has(id) { + onUse(); + return pluginCache.has(id); + }, + set(id, value) { + onUse(); + return pluginCache.set(id, value); + } + }; +} +const NO_CACHE = { + delete() { + return false; + }, + get() { + return undefined; + }, + has() { + return false; + }, + set() { } +}; +function uncacheablePluginError(pluginName) { + if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) { + return parseAst_js.error(parseAst_js.logAnonymousPluginCache()); + } + return parseAst_js.error(parseAst_js.logDuplicatePluginName(pluginName)); +} +function getCacheForUncacheablePlugin(pluginName) { + return { + delete() { + return uncacheablePluginError(pluginName); + }, + get() { + return uncacheablePluginError(pluginName); + }, + has() { + return uncacheablePluginError(pluginName); + }, + set() { + return uncacheablePluginError(pluginName); + } + }; +} + +function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) { + const { logLevel, onLog } = options; + let cacheable = true; + if (typeof plugin.cacheKey !== 'string') { + if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || + existingPluginNames.has(plugin.name)) { + cacheable = false; + } + else { + existingPluginNames.add(plugin.name); + } + } + let cacheInstance; + if (!pluginCache) { + cacheInstance = NO_CACHE; + } + else if (cacheable) { + const cacheKey = plugin.cacheKey || plugin.name; + cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null))); + } + else { + cacheInstance = getCacheForUncacheablePlugin(plugin.name); + } + return { + addWatchFile(id) { + graph.watchFiles[id] = true; + }, + cache: cacheInstance, + debug: getLogHandler(parseAst_js.LOGLEVEL_DEBUG, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + emitFile: fileEmitter.emitFile.bind(fileEmitter), + error(error_) { + return parseAst_js.error(parseAst_js.logPluginError(normalizeLog(error_), plugin.name)); + }, + getFileName: fileEmitter.getFileName, + getModuleIds: () => graph.modulesById.keys(), + getModuleInfo: graph.getModuleInfo, + getWatchFiles: () => Object.keys(graph.watchFiles), + info: getLogHandler(parseAst_js.LOGLEVEL_INFO, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + load(resolvedId) { + return graph.moduleLoader.preloadModule(resolvedId); + }, + meta: { + rollupVersion: version, + watchMode: graph.watchMode + }, + parse: parseAst_js.parseAst, + resolve(source, importer, { attributes, custom, isEntry, skipSelf } = parseAst_js.BLANK) { + skipSelf ??= true; + return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null); + }, + setAssetSource: fileEmitter.setAssetSource, + warn: getLogHandler(parseAst_js.LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel) + }; +} + +// This will make sure no input hook is omitted +const inputHookNames = { + buildEnd: 1, + buildStart: 1, + closeBundle: 1, + closeWatcher: 1, + load: 1, + moduleParsed: 1, + onLog: 1, + options: 1, + resolveDynamicImport: 1, + resolveId: 1, + shouldTransformCachedModule: 1, + transform: 1, + watchChange: 1 +}; +const inputHooks = Object.keys(inputHookNames); +class PluginDriver { + constructor(graph, options, userPlugins, pluginCache, basePluginDriver) { + this.graph = graph; + this.options = options; + this.pluginCache = pluginCache; + this.sortedPlugins = new Map(); + this.unfulfilledActions = new Set(); + this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter); + this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter); + this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter); + this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter); + this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter); + this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter); + this.plugins = [...(basePluginDriver ? basePluginDriver.plugins : []), ...userPlugins]; + const existingPluginNames = new Set(); + this.pluginContexts = new Map(this.plugins.map(plugin => [ + plugin, + getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames) + ])); + if (basePluginDriver) { + for (const plugin of userPlugins) { + for (const hook of inputHooks) { + if (hook in plugin) { + options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInputHookInOutputPlugin(plugin.name, hook)); + } + } + } + } + } + createOutputPluginDriver(plugins) { + return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this); + } + getUnfulfilledHookActions() { + return this.unfulfilledActions; + } + // chains, first non-null result stops and returns + hookFirst(hookName, parameters, replaceContext, skipped) { + return this.hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped).then(result => result && result[0]); + } + // chains, first non-null result stops and returns result and last plugin + async hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped) { + for (const plugin of this.getSortedPlugins(hookName)) { + if (skipped?.has(plugin)) + continue; + const result = await this.runHook(hookName, parameters, plugin, replaceContext); + if (result != null) + return [result, plugin]; + } + return null; + } + // chains synchronously, first non-null result stops and returns + hookFirstSync(hookName, parameters, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + if (result != null) + return result; + } + return null; + } + // parallel, ignores returns + async hookParallel(hookName, parameters, replaceContext) { + const parallelPromises = []; + for (const plugin of this.getSortedPlugins(hookName)) { + if (plugin[hookName].sequential) { + await Promise.all(parallelPromises); + parallelPromises.length = 0; + await this.runHook(hookName, parameters, plugin, replaceContext); + } + else { + parallelPromises.push(this.runHook(hookName, parameters, plugin, replaceContext)); + } + } + await Promise.all(parallelPromises); + } + // chains, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0(hookName, [argument0, ...rest], reduce, replaceContext) { + let promise = Promise.resolve(argument0); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(argument0 => this.runHook(hookName, [argument0, ...rest], plugin, replaceContext).then(result => reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin))); + } + return promise; + } + // chains synchronously, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0Sync(hookName, [argument0, ...rest], reduce, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const parameters = [argument0, ...rest]; + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + argument0 = reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin); + } + return argument0; + } + // chains, reduces returned value to type string, handling the reduced value separately. permits hooks as values. + async hookReduceValue(hookName, initialValue, parameters, reducer) { + const results = []; + const parallelResults = []; + for (const plugin of this.getSortedPlugins(hookName, validateAddonPluginHandler)) { + if (plugin[hookName].sequential) { + results.push(...(await Promise.all(parallelResults))); + parallelResults.length = 0; + results.push(await this.runHook(hookName, parameters, plugin)); + } + else { + parallelResults.push(this.runHook(hookName, parameters, plugin)); + } + } + results.push(...(await Promise.all(parallelResults))); + return results.reduce(reducer, await initialValue); + } + // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values. + hookReduceValueSync(hookName, initialValue, parameters, reduce, replaceContext) { + let accumulator = initialValue; + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + accumulator = reduce.call(this.pluginContexts.get(plugin), accumulator, result, plugin); + } + return accumulator; + } + // chains, ignores returns + hookSeq(hookName, parameters, replaceContext) { + let promise = Promise.resolve(); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(() => this.runHook(hookName, parameters, plugin, replaceContext)); + } + return promise.then(noReturn); + } + getSortedPlugins(hookName, validateHandler) { + return getOrCreate(this.sortedPlugins, hookName, () => getSortedValidatedPlugins(hookName, this.plugins, validateHandler)); + } + // Implementation signature + runHook(hookName, parameters, plugin, replaceContext) { + // We always filter for plugins that support the hook before running it + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + let action = null; + return Promise.resolve() + .then(() => { + if (typeof handler !== 'function') { + return handler; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + const hookResult = handler.apply(context, parameters); + if (!hookResult?.then) { + // short circuit for non-thenables and non-Promises + return hookResult; + } + // Track pending hook actions to properly error out when + // unfulfilled promises cause rollup to abruptly and confusingly + // exit with a successful 0 return code but without producing any + // output, errors or warnings. + action = [plugin.name, hookName, parameters]; + this.unfulfilledActions.add(action); + // Although it would be more elegant to just return hookResult here + // and put the .then() handler just above the .catch() handler below, + // doing so would subtly change the defacto async event dispatch order + // which at least one test and some plugins in the wild may depend on. + return Promise.resolve(hookResult).then(result => { + // action was fulfilled + this.unfulfilledActions.delete(action); + return result; + }); + }) + .catch(error_ => { + if (action !== null) { + // action considered to be fulfilled since error being handled + this.unfulfilledActions.delete(action); + } + return parseAst_js.error(parseAst_js.logPluginError(error_, plugin.name, { hook: hookName })); + }); + } + /** + * Run a sync plugin hook and return the result. + * @param hookName Name of the plugin hook. Must be in `PluginHooks`. + * @param args Arguments passed to the plugin hook. + * @param plugin The acutal plugin + * @param replaceContext When passed, the plugin context can be overridden. + */ + runHookSync(hookName, parameters, plugin, replaceContext) { + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + return handler.apply(context, parameters); + } + catch (error_) { + return parseAst_js.error(parseAst_js.logPluginError(error_, plugin.name, { hook: hookName })); + } + } +} +function getSortedValidatedPlugins(hookName, plugins, validateHandler = validateFunctionPluginHandler) { + const pre = []; + const normal = []; + const post = []; + for (const plugin of plugins) { + const hook = plugin[hookName]; + if (hook) { + if (typeof hook === 'object') { + validateHandler(hook.handler, hookName, plugin); + if (hook.order === 'pre') { + pre.push(plugin); + continue; + } + if (hook.order === 'post') { + post.push(plugin); + continue; + } + } + else { + validateHandler(hook, hookName, plugin); + } + normal.push(plugin); + } + } + return [...pre, ...normal, ...post]; +} +function validateFunctionPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'function') { + parseAst_js.error(parseAst_js.logInvalidFunctionPluginHook(hookName, plugin.name)); + } +} +function validateAddonPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'string' && typeof handler !== 'function') { + return parseAst_js.error(parseAst_js.logInvalidAddonPluginHook(hookName, plugin.name)); + } +} +function noReturn() { } + +function getLogger(plugins, onLog, watchMode, logLevel) { + plugins = getSortedValidatedPlugins('onLog', plugins); + const minimalPriority = parseAst_js.logLevelPriority[logLevel]; + const logger = (level, log, skipped = parseAst_js.EMPTY_SET) => { + parseAst_js.augmentLogMessage(log); + const logPriority = parseAst_js.logLevelPriority[level]; + if (logPriority < minimalPriority) { + return; + } + for (const plugin of plugins) { + if (skipped.has(plugin)) + continue; + const { onLog: pluginOnLog } = plugin; + const getLogHandler = (level) => { + if (parseAst_js.logLevelPriority[level] < minimalPriority) { + return doNothing; + } + return log => logger(level, normalizeLog(log), new Set(skipped).add(plugin)); + }; + const handler = 'handler' in pluginOnLog ? pluginOnLog.handler : pluginOnLog; + if (handler.call({ + debug: getLogHandler(parseAst_js.LOGLEVEL_DEBUG), + error: (log) => parseAst_js.error(normalizeLog(log)), + info: getLogHandler(parseAst_js.LOGLEVEL_INFO), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(parseAst_js.LOGLEVEL_WARN) + }, level, log) === false) { + return; + } + } + onLog(level, log); + }; + return logger; +} + +const commandAliases = { + c: 'config', + d: 'dir', + e: 'external', + f: 'format', + g: 'globals', + h: 'help', + i: 'input', + m: 'sourcemap', + n: 'name', + o: 'file', + p: 'plugin', + v: 'version', + w: 'watch' +}; +const EMPTY_COMMAND_OPTIONS = { external: [], globals: undefined }; +async function mergeOptions(config, watchMode, rawCommandOptions = EMPTY_COMMAND_OPTIONS, printLog) { + const command = getCommandOptions(rawCommandOptions); + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || parseAst_js.LOGLEVEL_INFO; + const onLog = getOnLog(config, logLevel, printLog); + const log = getLogger(plugins, onLog, watchMode, logLevel); + const inputOptions = mergeInputOptions(config, command, plugins, log, onLog); + if (command.output) { + Object.assign(command, command.output); + } + const outputOptionsArray = ensureArray$1(config.output); + if (outputOptionsArray.length === 0) + outputOptionsArray.push({}); + const outputOptions = await Promise.all(outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, log))); + warnUnknownOptions(command, [ + ...Object.keys(inputOptions), + ...Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapIgnoreList' && option !== 'sourcemapPathTransform'), + ...Object.keys(commandAliases), + 'bundleConfigAsCjs', + 'config', + 'configImportAttributesKey', + 'configPlugin', + 'environment', + 'failAfterWarnings', + 'filterLogs', + 'forceExit', + 'plugin', + 'silent', + 'stdin', + 'waitForBundleInput' + ], 'CLI flags', log, /^_$|output$|config/); + inputOptions.output = outputOptions; + return inputOptions; +} +function getCommandOptions(rawCommandOptions) { + const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' + ? rawCommandOptions.external.split(',') + : []; + return { + ...rawCommandOptions, + external, + globals: typeof rawCommandOptions.globals === 'string' + ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { + const [id, variableName] = globalDefinition.split(':'); + globals[id] = variableName; + if (!external.includes(id)) { + external.push(id); + } + return globals; + }, Object.create(null)) + : undefined + }; +} +function mergeInputOptions(config, overrides, plugins, log, onLog) { + const getOption = (name) => overrides[name] ?? config[name]; + const inputOptions = { + cache: config.cache, + context: getOption('context'), + experimentalCacheExpiry: getOption('experimentalCacheExpiry'), + experimentalLogSideEffects: getOption('experimentalLogSideEffects'), + external: getExternal(config, overrides), + input: getOption('input') || [], + jsx: getObjectOption(config, overrides, 'jsx', objectifyOptionWithPresets(jsxPresets, 'jsx', parseAst_js.URL_JSX, 'false, ')), + logLevel: getOption('logLevel'), + makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), + maxParallelFileOps: getOption('maxParallelFileOps'), + moduleContext: getOption('moduleContext'), + onLog, + onwarn: undefined, + perf: getOption('perf'), + plugins, + preserveEntrySignatures: getOption('preserveEntrySignatures'), + preserveSymlinks: getOption('preserveSymlinks'), + shimMissingExports: getOption('shimMissingExports'), + strictDeprecations: getOption('strictDeprecations'), + treeshake: getObjectOption(config, overrides, 'treeshake', objectifyOptionWithPresets(treeshakePresets, 'treeshake', parseAst_js.URL_TREESHAKE, 'false, true, ')), + watch: getWatch(config, overrides) + }; + warnUnknownOptions(config, Object.keys(inputOptions), 'input options', log, /^output$/); + return inputOptions; +} +const getExternal = (config, overrides) => { + const configExternal = config.external; + return typeof configExternal === 'function' + ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source) + : [...ensureArray$1(configExternal), ...overrides.external]; +}; +const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => { + const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue); + const configOption = normalizeObjectOptionValue(config[name], objectifyValue); + if (commandOption !== undefined) { + return commandOption && { ...configOption, ...commandOption }; + } + return configOption; +}; +const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch'); +const isWatchEnabled = (optionValue) => { + if (Array.isArray(optionValue)) { + return optionValue.reduce((result, value) => (typeof value === 'boolean' ? value : result), false); + } + return optionValue === true; +}; +const normalizeObjectOptionValue = (optionValue, objectifyValue) => { + if (!optionValue) { + return optionValue; + } + if (Array.isArray(optionValue)) { + return optionValue.reduce((result, value) => value && result && { ...result, ...objectifyValue(value) }, {}); + } + return objectifyValue(optionValue); +}; +async function mergeOutputOptions(config, overrides, log) { + const getOption = (name) => overrides[name] ?? config[name]; + const outputOptions = { + amd: getObjectOption(config, overrides, 'amd'), + assetFileNames: getOption('assetFileNames'), + banner: getOption('banner'), + chunkFileNames: getOption('chunkFileNames'), + compact: getOption('compact'), + dir: getOption('dir'), + dynamicImportInCjs: getOption('dynamicImportInCjs'), + entryFileNames: getOption('entryFileNames'), + esModule: getOption('esModule'), + experimentalMinChunkSize: getOption('experimentalMinChunkSize'), + exports: getOption('exports'), + extend: getOption('extend'), + externalImportAssertions: getOption('externalImportAssertions'), + externalImportAttributes: getOption('externalImportAttributes'), + externalLiveBindings: getOption('externalLiveBindings'), + file: getOption('file'), + footer: getOption('footer'), + format: getOption('format'), + freeze: getOption('freeze'), + generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', parseAst_js.URL_OUTPUT_GENERATEDCODE, '')), + globals: getOption('globals'), + hashCharacters: getOption('hashCharacters'), + hoistTransitiveImports: getOption('hoistTransitiveImports'), + importAttributesKey: getOption('importAttributesKey'), + indent: getOption('indent'), + inlineDynamicImports: getOption('inlineDynamicImports'), + interop: getOption('interop'), + intro: getOption('intro'), + manualChunks: getOption('manualChunks'), + minifyInternalExports: getOption('minifyInternalExports'), + name: getOption('name'), + noConflict: getOption('noConflict'), + outro: getOption('outro'), + paths: getOption('paths'), + plugins: await normalizePluginOption(config.plugins), + preserveModules: getOption('preserveModules'), + preserveModulesRoot: getOption('preserveModulesRoot'), + reexportProtoFromExternal: getOption('reexportProtoFromExternal'), + sanitizeFileName: getOption('sanitizeFileName'), + sourcemap: getOption('sourcemap'), + sourcemapBaseUrl: getOption('sourcemapBaseUrl'), + sourcemapDebugIds: getOption('sourcemapDebugIds'), + sourcemapExcludeSources: getOption('sourcemapExcludeSources'), + sourcemapFile: getOption('sourcemapFile'), + sourcemapFileNames: getOption('sourcemapFileNames'), + sourcemapIgnoreList: getOption('sourcemapIgnoreList'), + sourcemapPathTransform: getOption('sourcemapPathTransform'), + strict: getOption('strict'), + systemNullSetters: getOption('systemNullSetters'), + validate: getOption('validate'), + virtualDirname: getOption('virtualDirname') + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log); + return outputOptions; +} + +const { + env = {}, + argv = [], + platform = "", +} = typeof process === "undefined" ? {} : process; + +const isDisabled = "NO_COLOR" in env || argv.includes("--no-color"); +const isForced = "FORCE_COLOR" in env || argv.includes("--color"); +const isWindows = platform === "win32"; +const isDumbTerminal = env.TERM === "dumb"; + +const isCompatibleTerminal = + tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && !isDumbTerminal; + +const isCI = + "CI" in env && + ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env); + +const isColorSupported = + !isDisabled && + (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI); + +const replaceClose = ( + index, + string, + close, + replace, + head = string.substring(0, index) + replace, + tail = string.substring(index + close.length), + next = tail.indexOf(close) +) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace)); + +const clearBleed = (index, string, open, close, replace) => + index < 0 + ? open + string + close + : open + replaceClose(index, string, close, replace) + close; + +const filterEmpty = + (open, close, replace = open, at = open.length + 1) => + (string) => + string || !(string === "" || string === undefined) + ? clearBleed( + ("" + string).indexOf(close, at), + string, + open, + close, + replace + ) + : ""; + +const init = (open, close, replace) => + filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace); + +const colors = { + reset: init(0, 0), + bold: init(1, 22, "\x1b[22m\x1b[1m"), + dim: init(2, 22, "\x1b[22m\x1b[2m"), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49), + blackBright: init(90, 39), + redBright: init(91, 39), + greenBright: init(92, 39), + yellowBright: init(93, 39), + blueBright: init(94, 39), + magentaBright: init(95, 39), + cyanBright: init(96, 39), + whiteBright: init(97, 39), + bgBlackBright: init(100, 49), + bgRedBright: init(101, 49), + bgGreenBright: init(102, 49), + bgYellowBright: init(103, 49), + bgBlueBright: init(104, 49), + bgMagentaBright: init(105, 49), + bgCyanBright: init(106, 49), + bgWhiteBright: init(107, 49), +}; + +const createColors = ({ useColor = isColorSupported } = {}) => + useColor + ? colors + : Object.keys(colors).reduce( + (colors, key) => ({ ...colors, [key]: String }), + {} + ); + +const { + reset, + bold: bold$1, + dim: dim$1, + italic, + underline: underline$1, + inverse, + hidden, + strikethrough, + black, + red: red$1, + green: green$1, + yellow: yellow$1, + blue, + magenta, + cyan: cyan$1, + white, + gray: gray$1, + bgBlack, + bgRed, + bgGreen, + bgYellow, + bgBlue, + bgMagenta, + bgCyan, + bgWhite, + blackBright, + redBright, + greenBright, + yellowBright, + blueBright, + magentaBright, + cyanBright, + whiteBright, + bgBlackBright, + bgRedBright, + bgGreenBright, + bgYellowBright, + bgBlueBright, + bgMagentaBright, + bgCyanBright, + bgWhiteBright, +} = createColors(); + +// @see https://no-color.org +// @see https://www.npmjs.com/package/chalk +const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ + useColor: process$1.env.FORCE_COLOR !== '0' && !process$1.env.NO_COLOR +}); + +// log to stderr to keep `rollup main.js > bundle.js` from breaking +const stderr = (...parameters) => process$1.stderr.write(`${parameters.join('')}\n`); +function handleError(error, recover = false) { + const name = error.name || error.cause?.name; + const nameSection = name ? `${name}: ` : ''; + const pluginSection = error.plugin ? `(plugin ${error.plugin}) ` : ''; + const message = `${pluginSection}${nameSection}${error.message}`; + const outputLines = [bold(red(`[!] ${bold(message.toString())}`))]; + if (error.url) { + outputLines.push(cyan(error.url)); + } + if (error.loc) { + outputLines.push(`${parseAst_js.relativeId((error.loc.file || error.id))} (${error.loc.line}:${error.loc.column})`); + } + else if (error.id) { + outputLines.push(parseAst_js.relativeId(error.id)); + } + if (error.frame) { + outputLines.push(dim(error.frame)); + } + if (error.stack) { + outputLines.push(dim(error.stack?.replace(`${nameSection}${error.message}\n`, ''))); + } + // ES2022: Error.prototype.cause is optional + if (error.cause) { + let cause = error.cause; + const causeErrorLines = []; + let indent = ''; + while (cause) { + indent += ' '; + const message = cause.stack || cause; + causeErrorLines.push(...`[cause] ${message}`.split('\n').map(line => indent + line)); + cause = cause.cause; + } + outputLines.push(dim(causeErrorLines.join('\n'))); + } + outputLines.push('', ''); + stderr(outputLines.join('\n')); + if (!recover) + process$1.exit(1); +} + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) + return false; + return reader.peek() !== comma; +} + +const bufLength = 1024 * 16; +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} +class StringReader { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +} + +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(';'); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) + sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } + else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } + else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) + sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +let Chunk$1 = class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +}; + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk$1(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk$1(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +let Bundle$1 = class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +}; + +function treeshakeNode(node, code, start, end) { + code.remove(start, end); + node.removeAnnotations(code); +} + +const NO_SEMICOLON = { isNoStatement: true }; +// This assumes there are only white-space and comments between start and the string we are looking for +function findFirstOccurrenceOutsideComment(code, searchString, start = 0) { + let searchPos, charCodeAfterSlash; + searchPos = code.indexOf(searchString, start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start >= searchPos) + return searchPos; + charCodeAfterSlash = code.charCodeAt(++start); + ++start; + // With our assumption, '/' always starts a comment. Determine comment type: + start = + charCodeAfterSlash === 47 /*"/"*/ + ? code.indexOf('\n', start) + 1 + : code.indexOf('*/', start) + 2; + if (start > searchPos) { + searchPos = code.indexOf(searchString, start); + } + } +} +const NON_WHITESPACE = /\S/g; +function findNonWhiteSpace(code, index) { + NON_WHITESPACE.lastIndex = index; + const result = NON_WHITESPACE.exec(code); + return result.index; +} +const WHITESPACE = /\s/; +function findLastWhiteSpaceReverse(code, start, end) { + while (true) { + if (start >= end) { + return end; + } + if (WHITESPACE.test(code[end - 1])) { + end--; + } + else { + return end; + } + } +} +// This assumes "code" only contains white-space and comments +// Returns position of line-comment if applicable +function findFirstLineBreakOutsideComment(code) { + let lineBreakPos, charCodeAfterSlash, start = 0; + lineBreakPos = code.indexOf('\n', start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start > lineBreakPos) + return [lineBreakPos, lineBreakPos + 1]; + // With our assumption, '/' always starts a comment. Determine comment type: + charCodeAfterSlash = code.charCodeAt(start + 1); + if (charCodeAfterSlash === 47 /*"/"*/) + return [start, lineBreakPos + 1]; + start = code.indexOf('*/', start + 2) + 2; + if (start > lineBreakPos) { + lineBreakPos = code.indexOf('\n', start); + } + } +} +function renderStatementList(statements, code, start, end, options) { + let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; + let nextNode = statements[0]; + let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; + if (nextNodeNeedsBoundaries) { + nextNodeStart = + start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1]; + } + for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { + currentNode = nextNode; + currentNodeStart = nextNodeStart; + currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; + nextNode = statements[nextIndex]; + nextNodeNeedsBoundaries = + nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; + if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { + nextNodeStart = + currentNode.end + + findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1]; + if (currentNode.included) { + if (currentNodeNeedsBoundaries) { + currentNode.render(code, options, { + end: nextNodeStart, + start: currentNodeStart + }); + } + else { + currentNode.render(code, options); + } + } + else { + treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart); + } + } + else { + currentNode.render(code, options); + } + } +} +// This assumes that the first character is not part of the first node +function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) { + const splitUpNodes = []; + let node, nextNodeStart, contentEnd, char; + let separator = start - 1; + for (const nextNode of nodes) { + if (node !== undefined) { + separator = + node.end + + findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); + } + nextNodeStart = contentEnd = + separator + + 1 + + findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1]; + while (((char = code.original.charCodeAt(nextNodeStart)), + char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/) + nextNodeStart++; + if (node !== undefined) { + splitUpNodes.push({ + contentEnd, + end: nextNodeStart, + node, + separator, + start + }); + } + node = nextNode; + start = nextNodeStart; + } + splitUpNodes.push({ + contentEnd: end, + end, + node: node, + separator: null, + start + }); + return splitUpNodes; +} +// This assumes there are only white-space and comments between start and end +function removeLineBreaks(code, start, end) { + while (true) { + const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end)); + if (removeStart === -1) { + break; + } + code.remove(start + removeStart, (start += removeEnd)); + } +} + +function getSystemExportStatement(exportedVariables, { exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }, modifier = '') { + if (exportedVariables.length === 1 && + exportNamesByVariable.get(exportedVariables[0]).length === 1) { + const variable = exportedVariables[0]; + return `exports(${JSON.stringify(exportNamesByVariable.get(variable)[0])},${_}${variable.getName(getPropertyAccess)}${modifier})`; + } + else { + const fields = []; + for (const variable of exportedVariables) { + for (const exportName of exportNamesByVariable.get(variable)) { + fields.push([exportName, variable.getName(getPropertyAccess) + modifier]); + } + } + return `exports(${getObject(fields, { lineBreakIndent: null })})`; + } +} +// This is only invoked if there is exactly one export name +function renderSystemExportExpression(exportedVariable, expressionStart, expressionEnd, code, { exportNamesByVariable, snippets: { _ } }) { + code.prependRight(expressionStart, `exports(${JSON.stringify(exportNamesByVariable.get(exportedVariable)[0])},${_}`); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportFunction(exportedVariables, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getDirectReturnIifeLeft } = options.snippets; + code.prependRight(expressionStart, getDirectReturnIifeLeft(['v'], `${getSystemExportStatement(exportedVariables, options)},${_}v`, { needsArrowReturnParens: true, needsWrappedFunction: needsParens })); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportSequenceAfterExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getPropertyAccess } = options.snippets; + code.appendLeft(expressionEnd, `,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(getPropertyAccess)}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} +function renderSystemExportSequenceBeforeExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options, modifier) { + const { _ } = options.snippets; + code.prependRight(expressionStart, `${getSystemExportStatement([exportedVariable], options, modifier)},${_}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} + +/** @import { Node } from 'estree' */ + +/** + * @param {Node} node + * @param {Node} parent + * @returns {boolean} + */ +function is_reference(node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && is_reference(node.object, node); + } + + if (node.type !== 'Identifier') return false; + + switch (parent?.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': + return parent.computed || node === parent.object; + + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': + return parent.computed; + + // disregard the `meta` in `import.meta` + case 'MetaProperty': + return parent.meta === node; + + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'PropertyDefinition': + return parent.computed || node === parent.value; + + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': + return parent.computed || node === parent.value; + + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': + return node === parent.local; + + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': + return false; + + default: + return true; + } +} + +const PureFunctionKey = Symbol('PureFunction'); +const getPureFunctions = ({ treeshake }) => { + const pureFunctions = Object.create(null); + for (const functionName of treeshake ? treeshake.manualPureFunctions : []) { + let currentFunctions = pureFunctions; + for (const pathSegment of functionName.split('.')) { + currentFunctions = currentFunctions[pathSegment] ||= Object.create(null); + } + currentFunctions[PureFunctionKey] = true; + } + return pureFunctions; +}; + +const UnknownKey = Symbol('Unknown Key'); +const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); +const UnknownInteger = Symbol('Unknown Integer'); +const SymbolToStringTag = Symbol('Symbol.toStringTag'); +const EMPTY_PATH = []; +const UNKNOWN_PATH = [UnknownKey]; +// For deoptimizations, this means we are modifying an unknown property but did +// not lose track of the object or are creating a setter/getter; +// For assignment effects it means we do not check for setter/getter effects +// but only if something is mutated that is included, which is relevant for +// Object.defineProperty +const UNKNOWN_NON_ACCESSOR_PATH = [UnknownNonAccessorKey]; +const UNKNOWN_INTEGER_PATH = [UnknownInteger]; +const EntitiesKey = Symbol('Entities'); +class PathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Set() } + }); + } + trackEntityAtPathAndGetIfTracked(path, entity) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } + withTrackedEntityAtPath(path, entity, onUntracked, returnIfTracked) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return returnIfTracked; + trackedEntities.add(entity); + const result = onUntracked(); + trackedEntities.delete(entity); + return result; + } + getEntities(path) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Set() } }); + } + return currentPaths[EntitiesKey]; + } +} +const SHARED_RECURSION_TRACKER = new PathTracker(); +class DiscriminatedPathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Map() } + }); + } + trackEntityAtPathAndGetIfTracked(path, discriminator, entity) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Map() } }); + } + const trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, (getNewSet)); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } +} + +function isFlagSet(flags, flag) { + return (flags & flag) !== 0; +} +function setFlag(flags, flag, value) { + return (flags & ~flag) | (-value & flag); +} + +const UnknownValue = Symbol('Unknown Value'); +const UnknownTruthyValue = Symbol('Unknown Truthy Value'); +class ExpressionEntity { + constructor() { + this.flags = 0; + } + get included() { + return isFlagSet(this.flags, 1 /* Flag.included */); + } + set included(value) { + this.flags = setFlag(this.flags, 1 /* Flag.included */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, _path, _recursionTracker) { + deoptimizeInteraction(interaction); + } + deoptimizePath(_path) { } + /** + * If possible it returns a stringifyable literal value for this node that + * can be used for inlining or comparing values. Otherwise, it should return + * UnknownValue. + */ + getLiteralValueAtPath(_path, _recursionTracker, _origin) { + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(_path, _interaction, _recursionTracker, _origin) { + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(_path, _interaction, _context) { + return true; + } + include(_context, _includeChildrenRecursively, _options) { + this.included = true; + } + includeCallArguments(context, parameters) { + for (const argument of parameters) { + argument.include(context, false); + } + } + shouldBeIncluded(_context) { + return true; + } +} +const UNKNOWN_EXPRESSION = new (class UnknownExpression extends ExpressionEntity { +})(); +const UNKNOWN_RETURN_EXPRESSION = [ + UNKNOWN_EXPRESSION, + false +]; +const deoptimizeInteraction = (interaction) => { + for (const argument of interaction.args) { + argument?.deoptimizePath(UNKNOWN_PATH); + } +}; + +const INTERACTION_ACCESSED = 0; +const INTERACTION_ASSIGNED = 1; +const INTERACTION_CALLED = 2; +const NODE_INTERACTION_UNKNOWN_ACCESS = { + args: [null], + type: INTERACTION_ACCESSED +}; +const NODE_INTERACTION_UNKNOWN_ASSIGNMENT = { + args: [null, UNKNOWN_EXPRESSION], + type: INTERACTION_ASSIGNED +}; +// While this is technically a call without arguments, we can compare against +// this reference in places where precise values or this argument would make a +// difference +const NODE_INTERACTION_UNKNOWN_CALL = { + args: [null], + type: INTERACTION_CALLED, + withNew: false +}; + +class Variable extends ExpressionEntity { + markReassigned() { + this.isReassigned = true; + } + constructor(name) { + super(); + this.name = name; + this.alwaysRendered = false; + this.forbiddenNames = null; + this.globalName = null; + this.initReached = false; + this.isId = false; + this.kind = null; + this.renderBaseName = null; + this.renderName = null; + this.isReassigned = false; + this.onlyFunctionCallUsed = true; + } + /** + * Binds identifiers that reference this variable to this variable. + * Necessary to be able to change variable names. + */ + addReference(_identifier) { } + /** + * Check if the identifier variable is only used as function call + * @returns true if the variable is only used as function call + */ + getOnlyFunctionCallUsed() { + return this.onlyFunctionCallUsed; + } + /** + * Collect the places where the identifier variable is used + * @param usedPlace Where the variable is used + */ + addUsedPlace(usedPlace) { + const isFunctionCall = usedPlace.parent.type === parseAst_js.CallExpression && + usedPlace.parent.callee === usedPlace; + if (!isFunctionCall && usedPlace.parent.type !== parseAst_js.ExportDefaultDeclaration) { + this.onlyFunctionCallUsed = false; + } + } + /** + * Prevent this variable from being renamed to this name to avoid name + * collisions + */ + forbidName(name) { + (this.forbiddenNames ||= new Set()).add(name); + } + getBaseVariableName() { + return (this.renderedLikeHoisted?.getBaseVariableName() || + this.renderBaseName || + this.renderName || + this.name); + } + getName(getPropertyAccess, useOriginalName) { + if (this.globalName) { + return this.globalName; + } + if (useOriginalName?.(this)) { + return this.name; + } + if (this.renderedLikeHoisted) { + return this.renderedLikeHoisted.getName(getPropertyAccess, useOriginalName); + } + const name = this.renderName || this.name; + return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name; + } + hasEffectsOnInteractionAtPath(path, { type }, _context) { + return type !== INTERACTION_ACCESSED || path.length > 0; + } + /** + * Marks this variable as being part of the bundle, which is usually the case + * when one of its identifiers becomes part of the bundle. Returns true if it + * has not been included previously. Once a variable is included, it should + * take care all its declarations are included. + */ + include() { + this.included = true; + this.renderedLikeHoisted?.include(); + } + /** + * Links the rendered name of this variable to another variable and includes + * this variable if the other variable is included. + */ + renderLikeHoisted(variable) { + this.renderedLikeHoisted = variable; + } + markCalledFromTryStatement() { } + setRenderNames(baseName, name) { + this.renderBaseName = baseName; + this.renderName = name; + } +} + +class ExternalVariable extends Variable { + constructor(module, name) { + super(name); + this.referenced = false; + this.module = module; + this.isNamespace = name === '*'; + } + addReference(identifier) { + this.referenced = true; + if (this.name === 'default' || this.name === '*') { + this.module.suggestName(identifier.name); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); + } + include() { + super.include(); + this.module.used = true; + } +} + +function cacheObjectGetters(object, getterProperties) { + for (const property of getterProperties) { + const propertyGetter = Object.getOwnPropertyDescriptor(object, property).get; + Object.defineProperty(object, property, { + get() { + const value = propertyGetter.call(object); + // This replaces the getter with a fixed value for subsequent calls + Object.defineProperty(object, property, { value }); + return value; + } + }); + } +} + +const RESERVED_NAMES = new Set([ + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'NaN', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'undefined', + 'var', + 'void', + 'while', + 'with', + 'yield' +]); + +const illegalCharacters = /[^\w$]/g; +const startsWithDigit = (value) => /\d/.test(value[0]); +const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments'; +function isLegal(value) { + if (needsEscape(value)) { + return false; + } + return !illegalCharacters.test(value); +} +function makeLegal(value) { + value = value + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(illegalCharacters, '_'); + if (needsEscape(value)) + value = `_${value}`; + return value || '_'; +} +const VALID_IDENTIFIER_REGEXP = /^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u; +const NUMBER_REGEXP = /^(?:0|[1-9]\d*)$/; +function stringifyObjectKeyIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key === '__proto__' ? '["__proto__"]' : key; + } + if (NUMBER_REGEXP.test(key) && +key <= Number.MAX_SAFE_INTEGER) { + return key; + } + return JSON.stringify(key); +} +function stringifyIdentifierIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key; + } + return JSON.stringify(key); +} + +class ExternalModule { + constructor(options, id, moduleSideEffects, meta, renormalizeRenderPath, attributes) { + this.options = options; + this.id = id; + this.renormalizeRenderPath = renormalizeRenderPath; + this.dynamicImporters = []; + this.execIndex = Infinity; + this.exportedVariables = new Map(); + this.importers = []; + this.reexported = false; + this.used = false; + this.declarations = new Map(); + this.mostCommonSuggestion = 0; + this.nameSuggestions = new Map(); + this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()); + const { importers, dynamicImporters } = this; + this.info = { + ast: null, + attributes, + code: null, + dynamicallyImportedIdResolutions: parseAst_js.EMPTY_ARRAY, + dynamicallyImportedIds: parseAst_js.EMPTY_ARRAY, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + exportedBindings: null, + exports: null, + hasDefaultExport: null, + id, + implicitlyLoadedAfterOneOf: parseAst_js.EMPTY_ARRAY, + implicitlyLoadedBefore: parseAst_js.EMPTY_ARRAY, + importedIdResolutions: parseAst_js.EMPTY_ARRAY, + importedIds: parseAst_js.EMPTY_ARRAY, + get importers() { + return importers.sort(); + }, + isEntry: false, + isExternal: true, + isIncluded: null, + meta, + moduleSideEffects, + syntheticNamedExports: false + }; + } + cacheInfoGetters() { + cacheObjectGetters(this.info, ['dynamicImporters', 'importers']); + } + getVariableForExportName(name) { + const declaration = this.declarations.get(name); + if (declaration) + return [declaration]; + const externalVariable = new ExternalVariable(this, name); + this.declarations.set(name, externalVariable); + this.exportedVariables.set(externalVariable, name); + return [externalVariable]; + } + suggestName(name) { + const value = (this.nameSuggestions.get(name) ?? 0) + 1; + this.nameSuggestions.set(name, value); + if (value > this.mostCommonSuggestion) { + this.mostCommonSuggestion = value; + this.suggestedVariableName = name; + } + } + warnUnusedImports() { + const unused = [...this.declarations] + .filter(([name, declaration]) => name !== '*' && !declaration.included && !this.reexported && !declaration.referenced) + .map(([name]) => name); + if (unused.length === 0) + return; + const importersSet = new Set(); + for (const name of unused) { + for (const importer of this.declarations.get(name).module.importers) { + importersSet.add(importer); + } + } + const importersArray = [...importersSet]; + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logUnusedExternalImports(this.id, unused, importersArray)); + } +} + +function markModuleAndImpureDependenciesAsExecuted(baseModule) { + baseModule.isExecuted = true; + const modules = [baseModule]; + const visitedModules = new Set(); + for (const module of modules) { + for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { + if (!(dependency instanceof ExternalModule) && + !dependency.isExecuted && + (dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && + !visitedModules.has(dependency.id)) { + dependency.isExecuted = true; + visitedModules.add(dependency.id); + modules.push(dependency); + } + } + } +} + +// This file is generated by scripts/generate-child-node-keys.js. +// Do not edit this file directly. +const childNodeKeys = { + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + AwaitExpression: ['argument'], + BinaryExpression: ['left', 'right'], + BlockStatement: ['body'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['decorators', 'id', 'superClass', 'body'], + ClassExpression: ['decorators', 'id', 'superClass', 'body'], + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + Decorator: ['expression'], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['exported', 'source', 'attributes'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['specifiers', 'source', 'attributes', 'declaration'], + ExportSpecifier: ['local', 'exported'], + ExpressionStatement: ['expression'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + ForStatement: ['init', 'test', 'update', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportAttribute: ['key', 'value'], + ImportDeclaration: ['specifiers', 'source', 'attributes'], + ImportDefaultSpecifier: ['local'], + ImportExpression: ['source', 'options'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + JSXAttribute: ['name', 'value'], + JSXClosingElement: ['name'], + JSXClosingFragment: [], + JSXElement: ['openingElement', 'children', 'closingElement'], + JSXEmptyExpression: [], + JSXExpressionContainer: ['expression'], + JSXFragment: ['openingFragment', 'children', 'closingFragment'], + JSXIdentifier: [], + JSXMemberExpression: ['object', 'property'], + JSXNamespacedName: ['namespace', 'name'], + JSXOpeningElement: ['name', 'attributes'], + JSXOpeningFragment: [], + JSXSpreadAttribute: ['argument'], + JSXSpreadChild: ['expression'], + JSXText: [], + LabeledStatement: ['label', 'body'], + Literal: [], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['decorators', 'key', 'value'], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + PanicError: [], + ParseError: [], + PrivateIdentifier: [], + Program: ['body'], + Property: ['key', 'value'], + PropertyDefinition: ['decorators', 'key', 'value'], + RestElement: ['argument'], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + StaticBlock: ['body'], + Super: [], + SwitchCase: ['test', 'consequent'], + SwitchStatement: ['discriminant', 'cases'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + YieldExpression: ['argument'] +}; + +function createInclusionContext() { + return { + brokenFlow: false, + hasBreak: false, + hasContinue: false, + includedCallArguments: new Set(), + includedLabels: new Set() + }; +} +function createHasEffectsContext() { + return { + accessed: new PathTracker(), + assigned: new PathTracker(), + brokenFlow: false, + called: new DiscriminatedPathTracker(), + hasBreak: false, + hasContinue: false, + ignore: { + breaks: false, + continues: false, + labels: new Set(), + returnYield: false, + this: false + }, + includedLabels: new Set(), + instantiated: new DiscriminatedPathTracker(), + replacedVariableInits: new Map() + }; +} + +const INCLUDE_PARAMETERS = 'variables'; +const IS_SKIPPED_CHAIN = Symbol('IS_SKIPPED_CHAIN'); +class NodeBase extends ExpressionEntity { + /** + * Nodes can apply custom deoptimizations once they become part of the + * executed code. To do this, they must initialize this as false, implement + * applyDeoptimizations and call this from include and hasEffects if they have + * custom handlers + */ + get deoptimized() { + return isFlagSet(this.flags, 2 /* Flag.deoptimized */); + } + set deoptimized(value) { + this.flags = setFlag(this.flags, 2 /* Flag.deoptimized */, value); + } + constructor(parent, parentScope) { + super(); + this.parent = parent; + this.scope = parentScope; + this.createScope(parentScope); + } + addExportedVariables(_variables, _exportNamesByVariable) { } + /** + * Override this to bind assignments to variables and do any initialisations + * that require the scopes to be populated with variables. + */ + bind() { + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (Array.isArray(value)) { + for (const child of value) { + child?.bind(); + } + } + else if (value) { + value.bind(); + } + } + } + /** + * Override if this node should receive a different scope than the parent + * scope. + */ + createScope(parentScope) { + this.scope = parentScope; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + if (child?.hasEffects(context)) + return true; + } + } + else if (value.hasEffects(context)) + return true; + } + return false; + } + hasEffectsAsAssignmentTarget(context, _checkAccess) { + return (this.hasEffects(context) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + include(context, includeChildrenRecursively, _options) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.include(context, includeChildrenRecursively); + } + } + else { + value.include(context, includeChildrenRecursively); + } + } + } + includeAsAssignmentTarget(context, includeChildrenRecursively, _deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + /** + * Override to perform special initialisation steps after the scope is + * initialised + */ + initialise() { + this.scope.context.magicString.addSourcemapLocation(this.start); + this.scope.context.magicString.addSourcemapLocation(this.end); + } + parseNode(esTreeNode) { + for (const [key, value] of Object.entries(esTreeNode)) { + // Skip properties defined on the class already. + // This way, we can override this function to add custom initialisation and then call super.parseNode + // Note: this doesn't skip properties with defined getters/setters which we use to pack wrap booleans + // in bitfields. Those are still assigned from the value in the esTreeNode. + if (this.hasOwnProperty(key)) + continue; + if (key.charCodeAt(0) === 95 /* _ */) { + if (key === parseAst_js.ANNOTATION_KEY) { + this.annotations = value; + } + else if (key === parseAst_js.INVALID_ANNOTATION_KEY) { + this.invalidAnnotations = value; + } + } + else if (typeof value !== 'object' || value === null) { + this[key] = value; + } + else if (Array.isArray(value)) { + this[key] = new Array(value.length); + let index = 0; + for (const child of value) { + this[key][index++] = + child === null + ? null + : new (this.scope.context.getNodeConstructor(child.type))(this, this.scope).parseNode(child); + } + } + else { + this[key] = new (this.scope.context.getNodeConstructor(value.type))(this, this.scope).parseNode(value); + } + } + // extend child keys for unknown node types + childNodeKeys[esTreeNode.type] ||= createChildNodeKeysForNode(esTreeNode); + this.initialise(); + return this; + } + removeAnnotations(code) { + if (this.annotations) { + for (const annotation of this.annotations) { + code.remove(annotation.start, annotation.end); + } + } + } + render(code, options) { + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.render(code, options); + } + } + else { + value.render(code, options); + } + } + } + setAssignedValue(value) { + this.assignmentInteraction = { args: [null, value], type: INTERACTION_ASSIGNED }; + } + shouldBeIncluded(context) { + return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); + } + /** + * Just deoptimize everything by default so that when e.g. we do not track + * something properly, it is deoptimized. + * @protected + */ + applyDeoptimizations() { + this.deoptimized = true; + for (const key of childNodeKeys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.deoptimizePath(UNKNOWN_PATH); + } + } + else { + value.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } +} +function createChildNodeKeysForNode(esTreeNode) { + return Object.keys(esTreeNode).filter(key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */); +} + +function isObjectExpressionNode(node) { + return node instanceof NodeBase && node.type === parseAst_js.ObjectExpression; +} +function isPropertyNode(node) { + return node.type === parseAst_js.Property; +} + +function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) { + return Object.create(inheritedDescriptions, memberDescriptions); +} +const UNDEFINED_EXPRESSION = new (class UndefinedExpression extends ExpressionEntity { + getLiteralValueAtPath() { + return undefined; + } +})(); +const returnsUnknown = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_EXPRESSION + } +}; +const UNKNOWN_LITERAL_BOOLEAN = new (class UnknownBoolean extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsBoolean = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_BOOLEAN + } +}; +const UNKNOWN_LITERAL_NUMBER = new (class UnknownNumber extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsNumber = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_NUMBER + } +}; +const UNKNOWN_LITERAL_STRING = new (class UnknownString extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsString = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_STRING + } +}; +const stringReplace = { + value: { + hasEffectsWhenCalled({ args }, context) { + const argument1 = args[2]; + return (args.length < 3 || + (typeof argument1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, { + deoptimizeCache() { } + }) === 'symbol' && + argument1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))); + }, + returns: UNKNOWN_LITERAL_STRING + } +}; +const objectMembers = assembleMemberDescriptions({ + hasOwnProperty: returnsBoolean, + isPrototypeOf: returnsBoolean, + propertyIsEnumerable: returnsBoolean, + toLocaleString: returnsString, + toString: returnsString, + valueOf: returnsUnknown +}); +const literalBooleanMembers = assembleMemberDescriptions({ + valueOf: returnsBoolean +}, objectMembers); +const literalNumberMembers = assembleMemberDescriptions({ + toExponential: returnsString, + toFixed: returnsString, + toLocaleString: returnsString, + toPrecision: returnsString, + valueOf: returnsNumber +}, objectMembers); +/** + * RegExp are stateful when they have the global or sticky flags set. + * But if we actually don't use them, the side effect does not matter. + * the check logic in `hasEffectsOnInteractionAtPath`. + */ +const literalRegExpMembers = assembleMemberDescriptions({ + exec: returnsUnknown, + test: returnsBoolean +}, objectMembers); +const literalStringMembers = assembleMemberDescriptions({ + anchor: returnsString, + at: returnsUnknown, + big: returnsString, + blink: returnsString, + bold: returnsString, + charAt: returnsString, + charCodeAt: returnsNumber, + codePointAt: returnsUnknown, + concat: returnsString, + endsWith: returnsBoolean, + fixed: returnsString, + fontcolor: returnsString, + fontsize: returnsString, + includes: returnsBoolean, + indexOf: returnsNumber, + italics: returnsString, + lastIndexOf: returnsNumber, + link: returnsString, + localeCompare: returnsNumber, + match: returnsUnknown, + matchAll: returnsUnknown, + normalize: returnsString, + padEnd: returnsString, + padStart: returnsString, + repeat: returnsString, + replace: stringReplace, + replaceAll: stringReplace, + search: returnsNumber, + slice: returnsString, + small: returnsString, + split: returnsUnknown, + startsWith: returnsBoolean, + strike: returnsString, + sub: returnsString, + substr: returnsString, + substring: returnsString, + sup: returnsString, + toLocaleLowerCase: returnsString, + toLocaleUpperCase: returnsString, + toLowerCase: returnsString, + toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString() + toUpperCase: returnsString, + trim: returnsString, + trimEnd: returnsString, + trimLeft: returnsString, + trimRight: returnsString, + trimStart: returnsString, + valueOf: returnsString +}, objectMembers); +function getLiteralMembersForValue(value) { + if (value instanceof RegExp) { + return literalRegExpMembers; + } + switch (typeof value) { + case 'boolean': { + return literalBooleanMembers; + } + case 'number': { + return literalNumberMembers; + } + case 'string': { + return literalStringMembers; + } + } + return Object.create(null); +} +function hasMemberEffectWhenCalled(members, memberName, interaction, context) { + if (typeof memberName !== 'string' || !members[memberName]) { + return true; + } + return members[memberName].hasEffectsWhenCalled?.(interaction, context) || false; +} +function getMemberReturnExpressionWhenCalled(members, memberName) { + if (typeof memberName !== 'string' || !members[memberName]) + return UNKNOWN_RETURN_EXPRESSION; + return [members[memberName].returns, false]; +} + +class SpreadElement extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 0) { + this.argument.deoptimizeArgumentsOnInteractionAtPath(interaction, UNKNOWN_PATH, recursionTracker); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (this.argument.hasEffects(context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.argument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)))); + } + applyDeoptimizations() { + this.deoptimized = true; + // Only properties of properties of the argument could become subject to reassignment + // This will also reassign the return values of iterators + this.argument.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } +} + +class Method extends ExpressionEntity { + constructor(description) { + super(); + this.description = description; + } + deoptimizeArgumentsOnInteractionAtPath({ args, type }, path) { + if (type === INTERACTION_CALLED && path.length === 0) { + if (this.description.mutatesSelfAsArray) { + args[0]?.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + if (this.description.mutatesArgs) { + for (let index = 1; index < args.length; index++) { + args[index].deoptimizePath(UNKNOWN_PATH); + } + } + } + } + getReturnExpressionWhenCalledAtPath(path, { args }) { + if (path.length > 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + return [ + this.description.returnsPrimitive || + (this.description.returns === 'self' + ? args[0] || UNKNOWN_EXPRESSION + : this.description.returns()), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) { + return true; + } + if (type === INTERACTION_CALLED) { + const { args } = interaction; + if (this.description.mutatesSelfAsArray === true && + args[0]?.hasEffectsOnInteractionAtPath(UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)) { + return true; + } + if (this.description.callsArgs) { + for (const argumentIndex of this.description.callsArgs) { + if (args[argumentIndex + 1]?.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)) { + return true; + } + } + } + } + return false; + } +} +const METHOD_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_RETURNS_STRING = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_STRING + }) +]; +const METHOD_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; + +const INTEGER_REG_EXP = /^\d+$/; +class ObjectEntity extends ExpressionEntity { + get hasLostTrack() { + return isFlagSet(this.flags, 2048 /* Flag.hasLostTrack */); + } + set hasLostTrack(value) { + this.flags = setFlag(this.flags, 2048 /* Flag.hasLostTrack */, value); + } + get hasUnknownDeoptimizedInteger() { + return isFlagSet(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */); + } + set hasUnknownDeoptimizedInteger(value) { + this.flags = setFlag(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */, value); + } + get hasUnknownDeoptimizedProperty() { + return isFlagSet(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */); + } + set hasUnknownDeoptimizedProperty(value) { + this.flags = setFlag(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */, value); + } + // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey + // and we assume there are no setters or getters + constructor(properties, prototypeExpression, immutable = false) { + super(); + this.prototypeExpression = prototypeExpression; + this.immutable = immutable; + this.additionalExpressionsToBeDeoptimized = new Set(); + this.allProperties = []; + this.deoptimizedPaths = Object.create(null); + this.expressionsToBeDeoptimizedByKey = Object.create(null); + this.gettersByKey = Object.create(null); + this.propertiesAndGettersByKey = Object.create(null); + this.propertiesAndSettersByKey = Object.create(null); + this.settersByKey = Object.create(null); + this.unknownIntegerProps = []; + this.unmatchableGetters = []; + this.unmatchablePropertiesAndGetters = []; + this.unmatchableSetters = []; + if (Array.isArray(properties)) { + this.buildPropertyMaps(properties); + } + else { + this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties; + for (const propertiesForKey of Object.values(properties)) { + this.allProperties.push(...propertiesForKey); + } + } + } + deoptimizeAllProperties(noAccessors) { + const isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty; + if (noAccessors) { + this.hasUnknownDeoptimizedProperty = true; + } + else { + this.hasLostTrack = true; + } + if (isDeoptimized) { + return; + } + for (const properties of [ + ...Object.values(this.propertiesAndGettersByKey), + ...Object.values(this.settersByKey) + ]) { + for (const property of properties) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + // While the prototype itself cannot be mutated, each property can + this.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]); + this.deoptimizeCachedEntities(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const [key, ...subPath] = path; + const { args, type } = interaction; + if (this.hasLostTrack || + // single paths that are deoptimized will not become getters or setters + ((type === INTERACTION_CALLED || path.length > 1) && + (this.hasUnknownDeoptimizedProperty || + (typeof key === 'string' && this.deoptimizedPaths[key])))) { + deoptimizeInteraction(interaction); + return; + } + const [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] = type === INTERACTION_CALLED || path.length > 1 + ? [ + this.propertiesAndGettersByKey, + this.propertiesAndGettersByKey, + this.unmatchablePropertiesAndGetters + ] + : type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesForExactMatchByKey[key]) { + const properties = relevantPropertiesByKey[key]; + if (properties) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + return; + } + for (const property of relevantUnmatchableProperties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + if (INTEGER_REG_EXP.test(key)) { + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + } + else { + for (const properties of [ + ...Object.values(relevantPropertiesByKey), + relevantUnmatchableProperties + ]) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeIntegerProperties() { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + this.hasUnknownDeoptimizedInteger) { + return; + } + this.hasUnknownDeoptimizedInteger = true; + for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const property of propertiesAndGetters) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + } + this.deoptimizeCachedIntegerEntities(); + } + // Assumption: If only a specific path is deoptimized, no accessors are created + deoptimizePath(path) { + if (this.hasLostTrack || this.immutable) { + return; + } + const key = path[0]; + if (path.length === 1) { + if (key === UnknownInteger) { + return this.deoptimizeIntegerProperties(); + } + else if (typeof key !== 'string') { + return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); + } + if (!this.deoptimizedPaths[key]) { + this.deoptimizedPaths[key] = true; + // we only deoptimizeCache exact matches as in all other cases, + // we do not return a literal value or return expression + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key]; + if (expressionsToBeDeoptimized) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + } + const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); + for (const property of typeof key === 'string' + ? [ + ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters), + ...(this.settersByKey[key] || this.unmatchableSetters) + ] + : this.allProperties) { + property.deoptimizePath(subPath); + } + this.prototypeExpression?.deoptimizePath(path.length === 1 ? [path[0], UnknownKey] : path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length === 0) { + return UnknownTruthyValue; + } + const key = path[0]; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (path.length === 1) { + return undefined; + } + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length === 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + const [key, ...subPath] = path; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getReturnExpressionWhenCalledAtPath(subPath, interaction, recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const [key, ...subPath] = path; + if (subPath.length > 0 || interaction.type === INTERACTION_CALLED) { + const expressionAtPath = this.getMemberExpression(key); + if (expressionAtPath) { + return expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context); + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return true; + } + if (key === UnknownNonAccessorKey) + return false; + if (this.hasLostTrack) + return true; + const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesAndAccessorsByKey[key]) { + const accessors = accessorsByKey[key]; + if (accessors) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + return false; + } + for (const accessor of unmatchableAccessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) { + return true; + } + } + } + else { + for (const accessors of [...Object.values(accessorsByKey), unmatchableAccessors]) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return false; + } + buildPropertyMaps(properties) { + const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchableGetters, unmatchableSetters } = this; + const unmatchablePropertiesAndSetters = []; + for (let index = properties.length - 1; index >= 0; index--) { + const { key, kind, property } = properties[index]; + allProperties.push(property); + if (typeof key === 'string') { + if (kind === 'set') { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + settersByKey[key] = [property, ...unmatchableSetters]; + } + } + else if (kind === 'get') { + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + gettersByKey[key] = [property, ...unmatchableGetters]; + } + } + else { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + } + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + } + } + } + else { + if (key === UnknownInteger) { + unknownIntegerProps.push(property); + continue; + } + if (kind === 'set') + unmatchableSetters.push(property); + if (kind === 'get') + unmatchableGetters.push(property); + if (kind !== 'get') + unmatchablePropertiesAndSetters.push(property); + if (kind !== 'set') + unmatchablePropertiesAndGetters.push(property); + } + } + } + deoptimizeCachedEntities() { + for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + deoptimizeCachedIntegerEntities() { + for (const [key, expressionsToBeDeoptimized] of Object.entries(this.expressionsToBeDeoptimizedByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + } + getMemberExpression(key) { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + typeof key !== 'string' || + (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) || + this.deoptimizedPaths[key]) { + return UNKNOWN_EXPRESSION; + } + const properties = this.propertiesAndGettersByKey[key]; + if (properties?.length === 1) { + return properties[0]; + } + if (properties || + this.unmatchablePropertiesAndGetters.length > 0 || + (this.unknownIntegerProps.length > 0 && INTEGER_REG_EXP.test(key))) { + return UNKNOWN_EXPRESSION; + } + return null; + } + getMemberExpressionAndTrackDeopt(key, origin) { + if (typeof key !== 'string') { + return UNKNOWN_EXPRESSION; + } + const expression = this.getMemberExpression(key); + if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) { + const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] = + this.expressionsToBeDeoptimizedByKey[key] || []); + expressionsToBeDeoptimized.push(origin); + } + return expression; + } +} + +const isInteger = (property) => typeof property === 'string' && /^\d+$/.test(property); +// This makes sure unknown properties are not handled as "undefined" but as +// "unknown" but without access side effects. An exception is done for numeric +// properties as we do not expect new builtin properties to be numbers, this +// will improve tree-shaking for out-of-bounds array properties +const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity { + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + if (interaction.type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) { + deoptimizeInteraction(interaction); + } + } + getLiteralValueAtPath(path) { + // We ignore number properties as we do not expect new properties to be + // numbers and also want to keep handling out-of-bound array elements as + // "undefined" + return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type === INTERACTION_CALLED; + } +})(); +const OBJECT_PROTOTYPE = new ObjectEntity({ + __proto__: null, + hasOwnProperty: METHOD_RETURNS_BOOLEAN, + isPrototypeOf: METHOD_RETURNS_BOOLEAN, + propertyIsEnumerable: METHOD_RETURNS_BOOLEAN, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + valueOf: METHOD_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE_FALLBACK, true); + +const NEW_ARRAY_PROPERTIES = [ + { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION }, + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: true, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const ARRAY_PROTOTYPE = new ObjectEntity({ + __proto__: null, + // We assume that accessors have effects as we do not track the accessed value afterwards + at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN, + concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF, + entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + fill: METHOD_MUTATES_SELF_RETURNS_SELF, + filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + includes: METHOD_RETURNS_BOOLEAN, + indexOf: METHOD_RETURNS_NUMBER, + join: METHOD_RETURNS_STRING, + keys: METHOD_RETURNS_UNKNOWN, + lastIndexOf: METHOD_RETURNS_NUMBER, + map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + push: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reverse: METHOD_MUTATES_SELF_RETURNS_SELF, + shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF, + splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + unshift: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE, true); + +class ArrayExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { + this.deoptimized = true; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (element && (hasSpread || element instanceof SpreadElement)) { + hasSpread = true; + element.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const properties = [ + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } + ]; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (hasSpread || element instanceof SpreadElement) { + if (element) { + hasSpread = true; + properties.unshift({ key: UnknownInteger, kind: 'init', property: element }); + } + } + else if (element) { + properties.push({ key: String(index), kind: 'init', property: element }); + } + else { + properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION }); + } + } + return (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE)); + } +} + +/* eslint sort-keys: "off" */ +const ValueProperties = Symbol('Value Properties'); +const getTruthyLiteralValue = () => UnknownTruthyValue; +const returnFalse = () => false; +const returnTrue = () => true; +const PURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse +}; +const IMPURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnTrue +}; +const PURE_WITH_ARRAY = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }) { + return args.length > 1 && !(args[1] instanceof ArrayExpression); + } +}; +const GETTER_ACCESS = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + const [_thisArgument, firstArgument] = args; + return (!(firstArgument instanceof ExpressionEntity) || + firstArgument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } +}; +// We use shortened variables to reduce file size here +/* OBJECT */ +const O = { + __proto__: null, + [ValueProperties]: IMPURE +}; +/* PURE FUNCTION */ +const PF = { + __proto__: null, + [ValueProperties]: PURE +}; +/* PURE FUNCTION IF FIRST ARG DOES NOT CONTAIN A GETTER */ +const PF_NO_GETTER = { + __proto__: null, + [ValueProperties]: GETTER_ACCESS +}; +/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */ +const MUTATES_ARG_WITHOUT_ACCESSOR = { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args: [, firstArgument] }) { + firstArgument?.deoptimizePath(UNKNOWN_PATH); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + return (args.length <= 1 || + args[1].hasEffectsOnInteractionAtPath(UNKNOWN_NON_ACCESSOR_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)); + } + } +}; +/* CONSTRUCTOR */ +const C = { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O +}; +/* PURE CONSTRUCTOR */ +const PC = { + __proto__: null, + [ValueProperties]: PURE, + prototype: O +}; +const PC_WITH_ARRAY = { + __proto__: null, + [ValueProperties]: PURE_WITH_ARRAY, + prototype: O +}; +const ARRAY_TYPE = { + __proto__: null, + [ValueProperties]: PURE, + from: O, + of: PF, + prototype: O +}; +const INTL_MEMBER = { + __proto__: null, + [ValueProperties]: PURE, + supportedLocalesOf: PC +}; +const knownGlobals = { + // Placeholders for global objects to avoid shape mutations + global: O, + globalThis: O, + self: O, + window: O, + // Common globals + __proto__: null, + [ValueProperties]: IMPURE, + Array: { + __proto__: null, + [ValueProperties]: IMPURE, + from: O, + isArray: PF, + of: PF, + prototype: O + }, + ArrayBuffer: { + __proto__: null, + [ValueProperties]: PURE, + isView: PF, + prototype: O + }, + AggregateError: PC_WITH_ARRAY, + Atomics: O, + BigInt: C, + BigInt64Array: C, + BigUint64Array: C, + Boolean: PC, + constructor: C, + DataView: PC, + Date: { + __proto__: null, + [ValueProperties]: PURE, + now: PF, + parse: PF, + prototype: O, + UTC: PF + }, + decodeURI: PF, + decodeURIComponent: PF, + encodeURI: PF, + encodeURIComponent: PF, + Error: PC, + escape: PF, + eval: O, + EvalError: PC, + FinalizationRegistry: C, + Float32Array: ARRAY_TYPE, + Float64Array: ARRAY_TYPE, + Function: C, + hasOwnProperty: O, + Infinity: O, + Int16Array: ARRAY_TYPE, + Int32Array: ARRAY_TYPE, + Int8Array: ARRAY_TYPE, + isFinite: PF, + isNaN: PF, + isPrototypeOf: O, + JSON: O, + Map: PC_WITH_ARRAY, + Math: { + __proto__: null, + [ValueProperties]: IMPURE, + abs: PF, + acos: PF, + acosh: PF, + asin: PF, + asinh: PF, + atan: PF, + atan2: PF, + atanh: PF, + cbrt: PF, + ceil: PF, + clz32: PF, + cos: PF, + cosh: PF, + exp: PF, + expm1: PF, + floor: PF, + fround: PF, + hypot: PF, + imul: PF, + log: PF, + log10: PF, + log1p: PF, + log2: PF, + max: PF, + min: PF, + pow: PF, + random: PF, + round: PF, + sign: PF, + sin: PF, + sinh: PF, + sqrt: PF, + tan: PF, + tanh: PF, + trunc: PF + }, + NaN: O, + Number: { + __proto__: null, + [ValueProperties]: PURE, + isFinite: PF, + isInteger: PF, + isNaN: PF, + isSafeInteger: PF, + parseFloat: PF, + parseInt: PF, + prototype: O + }, + Object: { + __proto__: null, + [ValueProperties]: PURE, + create: PF, + // Technically those can throw in certain situations, but we ignore this as + // code that relies on this will hopefully wrap this in a try-catch, which + // deoptimizes everything anyway + defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR, + defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR, + freeze: MUTATES_ARG_WITHOUT_ACCESSOR, + getOwnPropertyDescriptor: PF, + getOwnPropertyDescriptors: PF, + getOwnPropertyNames: PF, + getOwnPropertySymbols: PF, + getPrototypeOf: PF, + hasOwn: PF, + is: PF, + isExtensible: PF, + isFrozen: PF, + isSealed: PF, + keys: PF, + fromEntries: O, + entries: PF_NO_GETTER, + values: PF_NO_GETTER, + prototype: O + }, + parseFloat: PF, + parseInt: PF, + Promise: { + __proto__: null, + [ValueProperties]: IMPURE, + all: O, + allSettled: O, + any: O, + prototype: O, + race: O, + reject: O, + resolve: O + }, + propertyIsEnumerable: O, + Proxy: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall: ({ args: [, target, parameter] }) => { + if (isObjectExpressionNode(parameter)) { + const hasSpreadElement = parameter.properties.some(property => !isPropertyNode(property)); + if (!hasSpreadElement) { + for (const property of parameter.properties) { + property.deoptimizeArgumentsOnInteractionAtPath({ + args: [null, target], + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, SHARED_RECURSION_TRACKER); + } + return; + } + } + target.deoptimizePath(UNKNOWN_PATH); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnTrue + } + }, + RangeError: PC, + ReferenceError: PC, + Reflect: O, + RegExp: PC, + Set: PC_WITH_ARRAY, + SharedArrayBuffer: C, + String: { + __proto__: null, + [ValueProperties]: PURE, + fromCharCode: PF, + fromCodePoint: PF, + prototype: O, + raw: PF + }, + Symbol: { + __proto__: null, + [ValueProperties]: PURE, + for: PF, + keyFor: PF, + prototype: O, + toStringTag: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue() { + return SymbolToStringTag; + }, + hasEffectsWhenCalled: returnTrue + } + } + }, + SyntaxError: PC, + toLocaleString: O, + toString: O, + TypeError: PC, + Uint16Array: ARRAY_TYPE, + Uint32Array: ARRAY_TYPE, + Uint8Array: ARRAY_TYPE, + Uint8ClampedArray: ARRAY_TYPE, + // Technically, this is a global, but it needs special handling + // undefined: ?, + unescape: PF, + URIError: PC, + valueOf: O, + WeakMap: PC_WITH_ARRAY, + WeakRef: C, + WeakSet: PC_WITH_ARRAY, + // Additional globals shared by Node and Browser that are not strictly part of the language + clearInterval: C, + clearTimeout: C, + console: { + __proto__: null, + [ValueProperties]: IMPURE, + assert: C, + clear: C, + count: C, + countReset: C, + debug: C, + dir: C, + dirxml: C, + error: C, + exception: C, + group: C, + groupCollapsed: C, + groupEnd: C, + info: C, + log: C, + table: C, + time: C, + timeEnd: C, + timeLog: C, + trace: C, + warn: C + }, + Intl: { + __proto__: null, + [ValueProperties]: IMPURE, + Collator: INTL_MEMBER, + DateTimeFormat: INTL_MEMBER, + DisplayNames: INTL_MEMBER, + ListFormat: INTL_MEMBER, + Locale: INTL_MEMBER, + NumberFormat: INTL_MEMBER, + PluralRules: INTL_MEMBER, + RelativeTimeFormat: INTL_MEMBER, + Segmenter: INTL_MEMBER + }, + setInterval: C, + setTimeout: C, + TextDecoder: C, + TextEncoder: C, + URL: { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O, + canParse: PF + }, + URLSearchParams: C, + // Browser specific globals + AbortController: C, + AbortSignal: C, + addEventListener: O, + alert: O, + AnalyserNode: C, + Animation: C, + AnimationEvent: C, + applicationCache: O, + ApplicationCache: C, + ApplicationCacheErrorEvent: C, + atob: O, + Attr: C, + Audio: C, + AudioBuffer: C, + AudioBufferSourceNode: C, + AudioContext: C, + AudioDestinationNode: C, + AudioListener: C, + AudioNode: C, + AudioParam: C, + AudioProcessingEvent: C, + AudioScheduledSourceNode: C, + AudioWorkletNode: C, + BarProp: C, + BaseAudioContext: C, + BatteryManager: C, + BeforeUnloadEvent: C, + BiquadFilterNode: C, + Blob: C, + BlobEvent: C, + blur: O, + BroadcastChannel: C, + btoa: O, + ByteLengthQueuingStrategy: C, + Cache: C, + caches: O, + CacheStorage: C, + cancelAnimationFrame: O, + cancelIdleCallback: O, + CanvasCaptureMediaStreamTrack: C, + CanvasGradient: C, + CanvasPattern: C, + CanvasRenderingContext2D: C, + ChannelMergerNode: C, + ChannelSplitterNode: C, + CharacterData: C, + clientInformation: O, + ClipboardEvent: C, + close: O, + closed: O, + CloseEvent: C, + Comment: C, + CompositionEvent: C, + confirm: O, + ConstantSourceNode: C, + ConvolverNode: C, + CountQueuingStrategy: C, + createImageBitmap: O, + Credential: C, + CredentialsContainer: C, + crypto: O, + Crypto: C, + CryptoKey: C, + CSS: C, + CSSConditionRule: C, + CSSFontFaceRule: C, + CSSGroupingRule: C, + CSSImportRule: C, + CSSKeyframeRule: C, + CSSKeyframesRule: C, + CSSMediaRule: C, + CSSNamespaceRule: C, + CSSPageRule: C, + CSSRule: C, + CSSRuleList: C, + CSSStyleDeclaration: C, + CSSStyleRule: C, + CSSStyleSheet: C, + CSSSupportsRule: C, + CustomElementRegistry: C, + customElements: O, + CustomEvent: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args }) { + args[2]?.deoptimizePath(['detail']); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse + }, + prototype: O + }, + DataTransfer: C, + DataTransferItem: C, + DataTransferItemList: C, + defaultstatus: O, + defaultStatus: O, + DelayNode: C, + DeviceMotionEvent: C, + DeviceOrientationEvent: C, + devicePixelRatio: O, + dispatchEvent: O, + document: O, + Document: C, + DocumentFragment: C, + DocumentType: C, + DOMError: C, + DOMException: C, + DOMImplementation: C, + DOMMatrix: C, + DOMMatrixReadOnly: C, + DOMParser: C, + DOMPoint: C, + DOMPointReadOnly: C, + DOMQuad: C, + DOMRect: C, + DOMRectReadOnly: C, + DOMStringList: C, + DOMStringMap: C, + DOMTokenList: C, + DragEvent: C, + DynamicsCompressorNode: C, + Element: C, + ErrorEvent: C, + Event: C, + EventSource: C, + EventTarget: C, + external: O, + fetch: O, + File: C, + FileList: C, + FileReader: C, + find: O, + focus: O, + FocusEvent: C, + FontFace: C, + FontFaceSetLoadEvent: C, + FormData: C, + frames: O, + GainNode: C, + Gamepad: C, + GamepadButton: C, + GamepadEvent: C, + getComputedStyle: O, + getSelection: O, + HashChangeEvent: C, + Headers: C, + history: O, + History: C, + HTMLAllCollection: C, + HTMLAnchorElement: C, + HTMLAreaElement: C, + HTMLAudioElement: C, + HTMLBaseElement: C, + HTMLBodyElement: C, + HTMLBRElement: C, + HTMLButtonElement: C, + HTMLCanvasElement: C, + HTMLCollection: C, + HTMLContentElement: C, + HTMLDataElement: C, + HTMLDataListElement: C, + HTMLDetailsElement: C, + HTMLDialogElement: C, + HTMLDirectoryElement: C, + HTMLDivElement: C, + HTMLDListElement: C, + HTMLDocument: C, + HTMLElement: C, + HTMLEmbedElement: C, + HTMLFieldSetElement: C, + HTMLFontElement: C, + HTMLFormControlsCollection: C, + HTMLFormElement: C, + HTMLFrameElement: C, + HTMLFrameSetElement: C, + HTMLHeadElement: C, + HTMLHeadingElement: C, + HTMLHRElement: C, + HTMLHtmlElement: C, + HTMLIFrameElement: C, + HTMLImageElement: C, + HTMLInputElement: C, + HTMLLabelElement: C, + HTMLLegendElement: C, + HTMLLIElement: C, + HTMLLinkElement: C, + HTMLMapElement: C, + HTMLMarqueeElement: C, + HTMLMediaElement: C, + HTMLMenuElement: C, + HTMLMetaElement: C, + HTMLMeterElement: C, + HTMLModElement: C, + HTMLObjectElement: C, + HTMLOListElement: C, + HTMLOptGroupElement: C, + HTMLOptionElement: C, + HTMLOptionsCollection: C, + HTMLOutputElement: C, + HTMLParagraphElement: C, + HTMLParamElement: C, + HTMLPictureElement: C, + HTMLPreElement: C, + HTMLProgressElement: C, + HTMLQuoteElement: C, + HTMLScriptElement: C, + HTMLSelectElement: C, + HTMLShadowElement: C, + HTMLSlotElement: C, + HTMLSourceElement: C, + HTMLSpanElement: C, + HTMLStyleElement: C, + HTMLTableCaptionElement: C, + HTMLTableCellElement: C, + HTMLTableColElement: C, + HTMLTableElement: C, + HTMLTableRowElement: C, + HTMLTableSectionElement: C, + HTMLTemplateElement: C, + HTMLTextAreaElement: C, + HTMLTimeElement: C, + HTMLTitleElement: C, + HTMLTrackElement: C, + HTMLUListElement: C, + HTMLUnknownElement: C, + HTMLVideoElement: C, + IDBCursor: C, + IDBCursorWithValue: C, + IDBDatabase: C, + IDBFactory: C, + IDBIndex: C, + IDBKeyRange: C, + IDBObjectStore: C, + IDBOpenDBRequest: C, + IDBRequest: C, + IDBTransaction: C, + IDBVersionChangeEvent: C, + IdleDeadline: C, + IIRFilterNode: C, + Image: C, + ImageBitmap: C, + ImageBitmapRenderingContext: C, + ImageCapture: C, + ImageData: C, + indexedDB: O, + innerHeight: O, + innerWidth: O, + InputEvent: C, + IntersectionObserver: C, + IntersectionObserverEntry: C, + isSecureContext: O, + KeyboardEvent: C, + KeyframeEffect: C, + length: O, + localStorage: O, + location: O, + Location: C, + locationbar: O, + matchMedia: O, + MediaDeviceInfo: C, + MediaDevices: C, + MediaElementAudioSourceNode: C, + MediaEncryptedEvent: C, + MediaError: C, + MediaKeyMessageEvent: C, + MediaKeySession: C, + MediaKeyStatusMap: C, + MediaKeySystemAccess: C, + MediaList: C, + MediaQueryList: C, + MediaQueryListEvent: C, + MediaRecorder: C, + MediaSettingsRange: C, + MediaSource: C, + MediaStream: C, + MediaStreamAudioDestinationNode: C, + MediaStreamAudioSourceNode: C, + MediaStreamEvent: C, + MediaStreamTrack: C, + MediaStreamTrackEvent: C, + menubar: O, + MessageChannel: C, + MessageEvent: C, + MessagePort: C, + MIDIAccess: C, + MIDIConnectionEvent: C, + MIDIInput: C, + MIDIInputMap: C, + MIDIMessageEvent: C, + MIDIOutput: C, + MIDIOutputMap: C, + MIDIPort: C, + MimeType: C, + MimeTypeArray: C, + MouseEvent: C, + moveBy: O, + moveTo: O, + MutationEvent: C, + MutationObserver: C, + MutationRecord: C, + name: O, + NamedNodeMap: C, + NavigationPreloadManager: C, + navigator: O, + Navigator: C, + NetworkInformation: C, + Node: C, + NodeFilter: O, + NodeIterator: C, + NodeList: C, + Notification: C, + OfflineAudioCompletionEvent: C, + OfflineAudioContext: C, + offscreenBuffering: O, + OffscreenCanvas: C, + open: O, + openDatabase: O, + Option: C, + origin: O, + OscillatorNode: C, + outerHeight: O, + outerWidth: O, + PageTransitionEvent: C, + pageXOffset: O, + pageYOffset: O, + PannerNode: C, + parent: O, + Path2D: C, + PaymentAddress: C, + PaymentRequest: C, + PaymentRequestUpdateEvent: C, + PaymentResponse: C, + performance: O, + Performance: C, + PerformanceEntry: C, + PerformanceLongTaskTiming: C, + PerformanceMark: C, + PerformanceMeasure: C, + PerformanceNavigation: C, + PerformanceNavigationTiming: C, + PerformanceObserver: C, + PerformanceObserverEntryList: C, + PerformancePaintTiming: C, + PerformanceResourceTiming: C, + PerformanceTiming: C, + PeriodicWave: C, + Permissions: C, + PermissionStatus: C, + personalbar: O, + PhotoCapabilities: C, + Plugin: C, + PluginArray: C, + PointerEvent: C, + PopStateEvent: C, + postMessage: O, + Presentation: C, + PresentationAvailability: C, + PresentationConnection: C, + PresentationConnectionAvailableEvent: C, + PresentationConnectionCloseEvent: C, + PresentationConnectionList: C, + PresentationReceiver: C, + PresentationRequest: C, + print: O, + ProcessingInstruction: C, + ProgressEvent: C, + PromiseRejectionEvent: C, + prompt: O, + PushManager: C, + PushSubscription: C, + PushSubscriptionOptions: C, + queueMicrotask: O, + RadioNodeList: C, + Range: C, + ReadableStream: C, + RemotePlayback: C, + removeEventListener: O, + Request: C, + requestAnimationFrame: O, + requestIdleCallback: O, + resizeBy: O, + ResizeObserver: C, + ResizeObserverEntry: C, + resizeTo: O, + Response: C, + RTCCertificate: C, + RTCDataChannel: C, + RTCDataChannelEvent: C, + RTCDtlsTransport: C, + RTCIceCandidate: C, + RTCIceTransport: C, + RTCPeerConnection: C, + RTCPeerConnectionIceEvent: C, + RTCRtpReceiver: C, + RTCRtpSender: C, + RTCSctpTransport: C, + RTCSessionDescription: C, + RTCStatsReport: C, + RTCTrackEvent: C, + screen: O, + Screen: C, + screenLeft: O, + ScreenOrientation: C, + screenTop: O, + screenX: O, + screenY: O, + ScriptProcessorNode: C, + scroll: O, + scrollbars: O, + scrollBy: O, + scrollTo: O, + scrollX: O, + scrollY: O, + SecurityPolicyViolationEvent: C, + Selection: C, + ServiceWorker: C, + ServiceWorkerContainer: C, + ServiceWorkerRegistration: C, + sessionStorage: O, + ShadowRoot: C, + SharedWorker: C, + SourceBuffer: C, + SourceBufferList: C, + speechSynthesis: O, + SpeechSynthesisEvent: C, + SpeechSynthesisUtterance: C, + StaticRange: C, + status: O, + statusbar: O, + StereoPannerNode: C, + stop: O, + Storage: C, + StorageEvent: C, + StorageManager: C, + styleMedia: O, + StyleSheet: C, + StyleSheetList: C, + SubtleCrypto: C, + SVGAElement: C, + SVGAngle: C, + SVGAnimatedAngle: C, + SVGAnimatedBoolean: C, + SVGAnimatedEnumeration: C, + SVGAnimatedInteger: C, + SVGAnimatedLength: C, + SVGAnimatedLengthList: C, + SVGAnimatedNumber: C, + SVGAnimatedNumberList: C, + SVGAnimatedPreserveAspectRatio: C, + SVGAnimatedRect: C, + SVGAnimatedString: C, + SVGAnimatedTransformList: C, + SVGAnimateElement: C, + SVGAnimateMotionElement: C, + SVGAnimateTransformElement: C, + SVGAnimationElement: C, + SVGCircleElement: C, + SVGClipPathElement: C, + SVGComponentTransferFunctionElement: C, + SVGDefsElement: C, + SVGDescElement: C, + SVGDiscardElement: C, + SVGElement: C, + SVGEllipseElement: C, + SVGFEBlendElement: C, + SVGFEColorMatrixElement: C, + SVGFEComponentTransferElement: C, + SVGFECompositeElement: C, + SVGFEConvolveMatrixElement: C, + SVGFEDiffuseLightingElement: C, + SVGFEDisplacementMapElement: C, + SVGFEDistantLightElement: C, + SVGFEDropShadowElement: C, + SVGFEFloodElement: C, + SVGFEFuncAElement: C, + SVGFEFuncBElement: C, + SVGFEFuncGElement: C, + SVGFEFuncRElement: C, + SVGFEGaussianBlurElement: C, + SVGFEImageElement: C, + SVGFEMergeElement: C, + SVGFEMergeNodeElement: C, + SVGFEMorphologyElement: C, + SVGFEOffsetElement: C, + SVGFEPointLightElement: C, + SVGFESpecularLightingElement: C, + SVGFESpotLightElement: C, + SVGFETileElement: C, + SVGFETurbulenceElement: C, + SVGFilterElement: C, + SVGForeignObjectElement: C, + SVGGElement: C, + SVGGeometryElement: C, + SVGGradientElement: C, + SVGGraphicsElement: C, + SVGImageElement: C, + SVGLength: C, + SVGLengthList: C, + SVGLinearGradientElement: C, + SVGLineElement: C, + SVGMarkerElement: C, + SVGMaskElement: C, + SVGMatrix: C, + SVGMetadataElement: C, + SVGMPathElement: C, + SVGNumber: C, + SVGNumberList: C, + SVGPathElement: C, + SVGPatternElement: C, + SVGPoint: C, + SVGPointList: C, + SVGPolygonElement: C, + SVGPolylineElement: C, + SVGPreserveAspectRatio: C, + SVGRadialGradientElement: C, + SVGRect: C, + SVGRectElement: C, + SVGScriptElement: C, + SVGSetElement: C, + SVGStopElement: C, + SVGStringList: C, + SVGStyleElement: C, + SVGSVGElement: C, + SVGSwitchElement: C, + SVGSymbolElement: C, + SVGTextContentElement: C, + SVGTextElement: C, + SVGTextPathElement: C, + SVGTextPositioningElement: C, + SVGTitleElement: C, + SVGTransform: C, + SVGTransformList: C, + SVGTSpanElement: C, + SVGUnitTypes: C, + SVGUseElement: C, + SVGViewElement: C, + TaskAttributionTiming: C, + Text: C, + TextEvent: C, + TextMetrics: C, + TextTrack: C, + TextTrackCue: C, + TextTrackCueList: C, + TextTrackList: C, + TimeRanges: C, + toolbar: O, + top: O, + Touch: C, + TouchEvent: C, + TouchList: C, + TrackEvent: C, + TransitionEvent: C, + TreeWalker: C, + UIEvent: C, + ValidityState: C, + visualViewport: O, + VisualViewport: C, + VTTCue: C, + WaveShaperNode: C, + WebAssembly: O, + WebGL2RenderingContext: C, + WebGLActiveInfo: C, + WebGLBuffer: C, + WebGLContextEvent: C, + WebGLFramebuffer: C, + WebGLProgram: C, + WebGLQuery: C, + WebGLRenderbuffer: C, + WebGLRenderingContext: C, + WebGLSampler: C, + WebGLShader: C, + WebGLShaderPrecisionFormat: C, + WebGLSync: C, + WebGLTexture: C, + WebGLTransformFeedback: C, + WebGLUniformLocation: C, + WebGLVertexArrayObject: C, + WebSocket: C, + WheelEvent: C, + Window: C, + Worker: C, + WritableStream: C, + XMLDocument: C, + XMLHttpRequest: C, + XMLHttpRequestEventTarget: C, + XMLHttpRequestUpload: C, + XMLSerializer: C, + XPathEvaluator: C, + XPathExpression: C, + XPathResult: C, + XSLTProcessor: C +}; +for (const global of ['window', 'global', 'self', 'globalThis']) { + knownGlobals[global] = knownGlobals; +} +function getGlobalAtPath(path) { + let currentGlobal = knownGlobals; + for (const pathSegment of path) { + if (typeof pathSegment !== 'string') { + return null; + } + currentGlobal = currentGlobal[pathSegment]; + if (!currentGlobal) { + return null; + } + } + return currentGlobal[ValueProperties]; +} + +class GlobalVariable extends Variable { + constructor(name) { + super(name); + // Ensure we use live-bindings for globals as we do not know if they have + // been reassigned + this.markReassigned(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + switch (interaction.type) { + // While there is no point in testing these cases as at the moment, they + // are also covered via other means, we keep them for completeness + case INTERACTION_ACCESSED: + case INTERACTION_ASSIGNED: { + if (!getGlobalAtPath([this.name, ...path].slice(0, -1))) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + if (globalAtPath) { + globalAtPath.deoptimizeArgumentsOnCall(interaction); + } + else { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + } + } + getLiteralValueAtPath(path, _recursionTracker, _origin) { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return globalAtPath ? globalAtPath.getLiteralValue() : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (path.length === 0) { + // Technically, "undefined" is a global variable of sorts + return this.name !== 'undefined' && !getGlobalAtPath([this.name]); + } + return !getGlobalAtPath([this.name, ...path].slice(0, -1)); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context); + } + } + } +} + +class LocalVariable extends Variable { + constructor(name, declarator, init, context, kind) { + super(name); + this.init = init; + this.calledFromTryStatement = false; + this.additionalInitializers = null; + this.expressionsToBeDeoptimized = []; + this.declarations = declarator ? [declarator] : []; + this.deoptimizationTracker = context.deoptimizationTracker; + this.module = context.module; + this.kind = kind; + } + addDeclaration(identifier, init) { + this.declarations.push(identifier); + this.markInitializersForDeoptimization().push(init); + } + consolidateInitializers() { + if (this.additionalInitializers) { + for (const initializer of this.additionalInitializers) { + initializer.deoptimizePath(UNKNOWN_PATH); + } + this.additionalInitializers = null; + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.isReassigned) { + deoptimizeInteraction(interaction); + return; + } + recursionTracker.withTrackedEntityAtPath(path, this.init, () => this.init.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker), undefined); + } + deoptimizePath(path) { + if (this.isReassigned || + this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + if (path.length === 0) { + this.markReassigned(); + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; + this.expressionsToBeDeoptimized = parseAst_js.EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + this.init.deoptimizePath(UNKNOWN_PATH); + } + else { + this.init.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.isReassigned) { + return UNKNOWN_RETURN_EXPRESSION; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (this.isReassigned) + return true; + return (!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + if (this.included) + return true; + if (path.length === 0) + return false; + if (this.isReassigned) + return true; + return (!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_CALLED: { + if (this.isReassigned) + return true; + return (!(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.included) { + super.include(); + for (const declaration of this.declarations) { + // If node is a default export, it can save a tree-shaking run to include the full declaration now + if (!declaration.included) + declaration.include(createInclusionContext(), false); + let node = declaration.parent; + while (!node.included) { + // We do not want to properly include parents in case they are part of a dead branch + // in which case .include() might pull in more dead code + node.included = true; + if (node.type === parseAst_js.Program) + break; + node = node.parent; + } + } + } + } + includeCallArguments(context, parameters) { + if (this.isReassigned || context.includedCallArguments.has(this.init)) { + for (const argument of parameters) { + argument.include(context, false); + } + } + else { + context.includedCallArguments.add(this.init); + this.init.includeCallArguments(context, parameters); + context.includedCallArguments.delete(this.init); + } + } + markCalledFromTryStatement() { + this.calledFromTryStatement = true; + } + markInitializersForDeoptimization() { + if (this.additionalInitializers === null) { + this.additionalInitializers = [this.init]; + this.init = UNKNOWN_EXPRESSION; + this.markReassigned(); + } + return this.additionalInitializers; + } +} + +const tdzVariableKinds = new Set(['class', 'const', 'let', 'var', 'using', 'await using']); +class IdentifierBase extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.isVariableReference = false; + } + get isTDZAccess() { + if (!isFlagSet(this.flags, 4 /* Flag.tdzAccessDefined */)) { + return null; + } + return isFlagSet(this.flags, 8 /* Flag.tdzAccess */); + } + set isTDZAccess(value) { + this.flags = setFlag(this.flags, 4 /* Flag.tdzAccessDefined */, true); + this.flags = setFlag(this.flags, 8 /* Flag.tdzAccess */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + if (path.length === 0 && !this.scope.contains(this.name)) { + this.disallowImportReassignment(); + } + // We keep conditional chaining because an unknown Node could have an + // Identifier as property that might be deoptimized by default + this.variable?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getVariableRespectingTDZ().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const [expression, isPure] = this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || this.isPureFunction(path)]; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.isPossibleTDZ() && this.variable.kind !== 'var') { + return true; + } + return (this.scope.context.options.treeshake + .unknownGlobalSideEffects && + this.variable instanceof GlobalVariable && + !this.isPureFunction(EMPTY_PATH) && + this.variable.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return (this.variable !== null && + !this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context); + } + case INTERACTION_CALLED: { + return (!this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable); + } + } + } + includeCallArguments(context, parameters) { + this.variable.includeCallArguments(context, parameters); + } + isPossibleTDZ() { + // return cached value to avoid issues with the next tree-shaking pass + const cachedTdzAccess = this.isTDZAccess; + if (cachedTdzAccess !== null) + return cachedTdzAccess; + if (!(this.variable instanceof LocalVariable && + this.variable.kind && + tdzVariableKinds.has(this.variable.kind) && + // We ignore modules that did not receive a treeshaking pass yet as that + // causes many false positives due to circular dependencies or disabled + // moduleSideEffects. + this.variable.module.hasTreeShakingPassStarted)) { + return (this.isTDZAccess = false); + } + let decl_id; + if (this.variable.declarations && + this.variable.declarations.length === 1 && + (decl_id = this.variable.declarations[0]) && + this.start < decl_id.start && + closestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)) { + // a variable accessed before its declaration + // in the same function or at top level of module + return (this.isTDZAccess = true); + } + if (!this.variable.initReached) { + // Either a const/let TDZ violation or + // var use before declaration was encountered. + return (this.isTDZAccess = true); + } + return (this.isTDZAccess = false); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.variable instanceof LocalVariable) { + // When accessing a variable from a module without side effects, this + // means we use an export of that module and therefore need to potentially + // include it in the bundle. + if (!this.variable.module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this.variable.module); + } + this.variable.consolidateInitializers(); + this.scope.context.requestTreeshakingPass(); + } + if (this.isVariableReference) { + this.variable.addUsedPlace(this); + this.scope.context.requestTreeshakingPass(); + } + } + disallowImportReassignment() { + return this.scope.context.error(parseAst_js.logIllegalImportReassignment(this.name, this.scope.context.module.id), this.start); + } + getVariableRespectingTDZ() { + if (this.isPossibleTDZ()) { + return UNKNOWN_EXPRESSION; + } + return this.variable; + } + isPureFunction(path) { + let currentPureFunction = this.scope.context.manualPureFunctions[this.name]; + for (const segment of path) { + if (currentPureFunction) { + if (currentPureFunction[PureFunctionKey]) { + return true; + } + currentPureFunction = currentPureFunction[segment]; + } + else { + return false; + } + } + return currentPureFunction?.[PureFunctionKey]; + } +} +function closestParentFunctionOrProgram(node) { + while (node && !/^Program|Function/.test(node.type)) { + node = node.parent; + } + // one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program + return node; +} + +class Identifier extends IdentifierBase { + constructor() { + super(...arguments); + this.variable = null; + } + addExportedVariables(variables, exportNamesByVariable) { + if (exportNamesByVariable.has(this.variable)) { + variables.push(this.variable); + } + } + bind() { + if (!this.variable && is_reference(this, this.parent)) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + this.isVariableReference = true; + } + } + declare(kind, init) { + let variable; + const { treeshake } = this.scope.context.options; + switch (kind) { + case 'var': { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + if (treeshake && treeshake.correctVarValueBeforeDeclaration) { + // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); + } + break; + } + case 'function': { + // in strict mode, functions are only hoisted within a scope but not across block scopes + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case 'let': + case 'const': + case 'using': + case 'await using': + case 'class': { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case 'parameter': { + variable = this.scope.addParameterDeclaration(this); + break; + } + /* istanbul ignore next */ + default: { + /* istanbul ignore next */ + throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); + } + } + return [(this.variable = variable)]; + } + markDeclarationReached() { + this.variable.initReached = true; + } + render(code, { snippets: { getPropertyAccess }, useOriginalName }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = parseAst_js.BLANK) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess, useOriginalName); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + if (isShorthandProperty) { + code.prependRight(this.start, `${this.name}: `); + } + } + // In strict mode, any variable named "eval" must be the actual "eval" function + if (name === 'eval' && + renderedParentType === parseAst_js.CallExpression && + isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + } + } +} + +function getSafeName(baseName, usedNames, forbiddenNames) { + let safeName = baseName; + let count = 1; + while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) { + safeName = `${baseName}$${toBase64(count++)}`; + } + usedNames.add(safeName); + return safeName; +} + +class Scope { + constructor() { + this.children = []; + this.variables = new Map(); + } + /* + Redeclaration rules: + - var can redeclare var + - in function scopes, function and var can redeclare function and var + - var is hoisted across scopes, function remains in the scope it is declared + - var and function can redeclare function parameters, but parameters cannot redeclare parameters + - function cannot redeclare catch scope parameters + - var can redeclare catch scope parameters in a way + - if the parameter is an identifier and not a pattern + - then the variable is still declared in the hoisted outer scope, but the initializer is assigned to the parameter + - const, let, class, and function except in the cases above cannot redeclare anything + */ + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (kind === 'var' && existingKind === 'var') { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(parseAst_js.logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } + addHoistedVariable(name, variable) { + (this.hoistedVariables ||= new Map()).set(name, variable); + } + contains(name) { + return this.variables.has(name); + } + findVariable(_name) { + /* istanbul ignore next */ + throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); + } +} + +class ChildScope extends Scope { + constructor(parent, context) { + super(); + this.parent = parent; + this.context = context; + this.accessedOutsideVariables = new Map(); + parent.children.push(this); + } + addAccessedDynamicImport(importExpression) { + (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedDynamicImport(importExpression); + } + } + addAccessedGlobals(globals, accessedGlobalsByScope) { + const accessedGlobals = accessedGlobalsByScope.get(this) || new Set(); + for (const name of globals) { + accessedGlobals.add(name); + } + accessedGlobalsByScope.set(this, accessedGlobals); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedGlobals(globals, accessedGlobalsByScope); + } + } + addNamespaceMemberAccess(name, variable) { + this.accessedOutsideVariables.set(name, variable); + this.parent.addNamespaceMemberAccess(name, variable); + } + addReturnExpression(expression) { + if (this.parent instanceof ChildScope) { + this.parent.addReturnExpression(expression); + } + } + addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) { + for (const variable of this.accessedOutsideVariables.values()) { + if (variable.included) { + usedNames.add(variable.getBaseVariableName()); + if (format === 'system' && exportNamesByVariable.has(variable)) { + usedNames.add('exports'); + } + } + } + const accessedGlobals = accessedGlobalsByScope.get(this); + if (accessedGlobals) { + for (const name of accessedGlobals) { + usedNames.add(name); + } + } + } + contains(name) { + return this.variables.has(name) || this.parent.contains(name); + } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + const usedNames = new Set(); + this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + if (this.accessedDynamicImports) { + for (const importExpression of this.accessedDynamicImports) { + if (importExpression.inlineNamespace) { + usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); + } + } + } + for (const [name, variable] of this.variables) { + if (variable.included || variable.alwaysRendered) { + variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames)); + } + } + for (const scope of this.children) { + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + } + findLexicalBoundary() { + return this.parent.findLexicalBoundary(); + } + findGlobal(name) { + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } +} + +function checkEffectForNodes(nodes, context) { + for (const node of nodes) { + if (node.hasEffects(context)) { + return true; + } + } + return false; +} + +class MethodBase extends NodeBase { + constructor() { + super(...arguments); + this.accessedValue = null; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + if (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + // As getter properties directly receive their values from fixed function + // expressions, there is no known situation where a getter is deoptimized. + deoptimizeCache() { } + deoptimizePath(path) { + this.getAccessedValue()[0].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + return this.key.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + // setters are only called for empty paths + if (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } + getAccessedValue() { + if (this.accessedValue === null) { + if (this.kind === 'get') { + this.accessedValue = UNKNOWN_RETURN_EXPRESSION; + return (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, SHARED_RECURSION_TRACKER, this)); + } + else { + return (this.accessedValue = [this.value, false]); + } + } + return this.accessedValue; + } +} + +class MethodDefinition extends MethodBase { + hasEffects(context) { + return super.hasEffects(context) || checkEffectForNodes(this.decorators, context); + } + applyDeoptimizations() { } +} + +class BlockScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + addDeclaration(identifier, context, init, kind) { + if (kind === 'var') { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + if (existingVariable.kind === 'var' || + (kind === 'var' && existingVariable.kind === 'parameter')) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(parseAst_js.logRedeclarationError(name), identifier.start); + } + const declaredVariable = this.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class StaticBlock extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options) { + if (this.body.length > 0) { + const bodyStartPos = findFirstOccurrenceOutsideComment(code.original.slice(this.start, this.end), '{') + 1; + renderStatementList(this.body, code, this.start + bodyStartPos, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} +function isStaticBlock(statement) { + return statement.type === parseAst_js.StaticBlock; +} + +class ObjectMember extends ExpressionEntity { + constructor(object, key) { + super(); + this.object = object; + this.key = key; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.key, ...path], recursionTracker); + } + deoptimizePath(path) { + this.object.deoptimizePath([this.key, ...path]); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.object.getReturnExpressionWhenCalledAtPath([this.key, ...path], interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); + } +} + +class ClassNode extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new ChildScope(parentScope, parentScope.context); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context); + this.id?.markDeclarationReached(); + return initEffect || super.hasEffects(context) || checkEffectForNodes(this.decorators, context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return interaction.type === INTERACTION_CALLED && path.length === 0 + ? !interaction.withNew || + (this.classConstructor === null + ? this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context) + : this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)) || + false + : this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.superClass?.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively); + for (const decorator of this.decorators) + decorator.include(context, includeChildrenRecursively); + if (this.id) { + this.id.markDeclarationReached(); + this.id.include(); + } + } + initialise() { + super.initialise(); + this.id?.declare('class', this); + for (const method of this.body.body) { + if (method instanceof MethodDefinition && method.kind === 'constructor') { + this.classConstructor = method; + return; + } + } + this.classConstructor = null; + } + applyDeoptimizations() { + this.deoptimized = true; + for (const definition of this.body.body) { + if (!isStaticBlock(definition) && + !(definition.static || + (definition instanceof MethodDefinition && definition.kind === 'constructor'))) { + // Calls to methods are not tracked, ensure that the return value is deoptimized + definition.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const staticProperties = []; + const dynamicMethods = []; + for (const definition of this.body.body) { + if (isStaticBlock(definition)) + continue; + const properties = definition.static ? staticProperties : dynamicMethods; + const definitionKind = definition.kind; + // Note that class fields do not end up on the prototype + if (properties === dynamicMethods && !definitionKind) + continue; + const kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init'; + let key; + if (definition.computed) { + const keyValue = definition.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind, property: definition }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + definition.key instanceof Identifier + ? definition.key.name + : String(definition.key.value); + } + properties.push({ key, kind, property: definition }); + } + staticProperties.unshift({ + key: 'prototype', + kind: 'init', + property: new ObjectEntity(dynamicMethods, this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE) + }); + return (this.objectEntity = new ObjectEntity(staticProperties, this.superClass || OBJECT_PROTOTYPE)); + } +} + +class ClassDeclaration extends ClassNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.scope.parent).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options; + if (this.id) { + const { variable, name } = this.id; + if (format === 'system' && exportNamesByVariable.has(variable)) { + code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`); + } + const renderedVariable = variable.getName(getPropertyAccess); + if (renderedVariable !== name) { + this.decorators.map(decorator => decorator.render(code, options)); + this.superClass?.render(code, options); + this.body.render(code, { + ...options, + useOriginalName: (_variable) => _variable === variable + }); + code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`); + code.prependLeft(this.end, ';'); + return; + } + } + super.render(code, options); + } + applyDeoptimizations() { + super.applyDeoptimizations(); + const { id, scope } = this; + if (id) { + const { name, variable } = id; + for (const accessedVariable of scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ArgumentsVariable extends LocalVariable { + constructor(context) { + super('arguments', null, UNKNOWN_EXPRESSION, context, 'other'); + this.deoptimizedArguments = []; + } + addArgumentToBeDeoptimized(argument) { + if (this.included) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.deoptimizedArguments.push(argument); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + include() { + super.include(); + for (const argument of this.deoptimizedArguments) { + argument.deoptimizePath(UNKNOWN_PATH); + } + this.deoptimizedArguments.length = 0; + } +} + +const MAX_TRACKED_INTERACTIONS = 20; +const NO_INTERACTIONS = parseAst_js.EMPTY_ARRAY; +const UNKNOWN_DEOPTIMIZED_FIELD = new Set([UnknownKey]); +const EMPTY_PATH_TRACKER = new PathTracker(); +const UNKNOWN_DEOPTIMIZED_ENTITY = new Set([UNKNOWN_EXPRESSION]); +class ParameterVariable extends LocalVariable { + constructor(name, declarator, context) { + super(name, declarator, UNKNOWN_EXPRESSION, context, 'parameter'); + this.deoptimizationInteractions = []; + this.deoptimizations = new PathTracker(); + this.deoptimizedFields = new Set(); + this.entitiesToBeDeoptimized = new Set(); + this.expressionsUseTheKnownValue = []; + this.knownValue = null; + this.knownValueLiteral = UnknownValue; + this.frozenValue = null; + } + addEntityToBeDeoptimized(entity) { + if (entity === UNKNOWN_EXPRESSION) { + // As unknown expressions fully deoptimize all interactions, we can clear + // the interaction cache at this point provided we keep this optimization + // in mind when adding new interactions + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.entitiesToBeDeoptimized.add(UNKNOWN_EXPRESSION); + for (const { interaction } of this.deoptimizationInteractions) { + deoptimizeInteraction(interaction); + } + this.deoptimizationInteractions = NO_INTERACTIONS; + } + } + else if (this.deoptimizedFields.has(UnknownKey)) { + // This means that we already deoptimized all interactions and no longer + // track them + entity.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.entitiesToBeDeoptimized.has(entity)) { + this.entitiesToBeDeoptimized.add(entity); + for (const field of this.deoptimizedFields) { + entity.deoptimizePath([field]); + } + for (const { interaction, path } of this.deoptimizationInteractions) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + } + } + markReassigned() { + if (this.isReassigned) { + return; + } + super.markReassigned(); + for (const expression of this.expressionsUseTheKnownValue) { + expression.deoptimizeCache(); + } + this.expressionsUseTheKnownValue = parseAst_js.EMPTY_ARRAY; + } + deoptimizeCache() { + this.markReassigned(); + } + /** + * Update the known value of the parameter variable. + * Must be called for every function call, so it can track all the arguments, + * and deoptimizeCache itself to mark reassigned if the argument is changed. + * @param argument The argument of the function call + */ + updateKnownValue(argument) { + if (this.isReassigned) { + return; + } + if (this.knownValue === null) { + this.knownValue = argument; + this.knownValueLiteral = argument.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return; + } + // the same literal or identifier, do nothing + if (this.knownValue === argument || + (this.knownValue instanceof Identifier && + argument instanceof Identifier && + this.knownValue.variable === argument.variable)) { + return; + } + const oldValue = this.knownValueLiteral; + if (typeof oldValue === 'symbol') { + this.markReassigned(); + return; + } + // add tracking for the new argument + const newValue = argument.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (newValue !== oldValue) { + this.markReassigned(); + } + } + /** + * This function freezes the known value of the parameter variable, + * so the optimization starts with a certain ExpressionEntity. + * The optimization can be undone by calling `markReassigned`. + * @returns the frozen value + */ + getKnownValue() { + if (this.frozenValue === null) { + this.frozenValue = this.knownValue || UNKNOWN_EXPRESSION; + } + return this.frozenValue; + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned) { + return UnknownValue; + } + const knownValue = this.getKnownValue(); + this.expressionsUseTheKnownValue.push(origin); + return recursionTracker.withTrackedEntityAtPath(path, knownValue, () => knownValue.getLiteralValueAtPath(path, recursionTracker, origin), UnknownValue); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.isReassigned || interaction.type === INTERACTION_ASSIGNED) { + return super.hasEffectsOnInteractionAtPath(path, interaction, context); + } + const knownValue = this.getKnownValue(); + return knownValue.hasEffectsOnInteractionAtPath(path, interaction, context); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + // For performance reasons, we fully deoptimize all deeper interactions + if (path.length >= 2 || + this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION) || + this.deoptimizationInteractions.length >= MAX_TRACKED_INTERACTIONS || + (path.length === 1 && + (this.deoptimizedFields.has(UnknownKey) || + (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0]))))) { + deoptimizeInteraction(interaction); + return; + } + if (!this.deoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.args)) { + for (const entity of this.entitiesToBeDeoptimized) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.deoptimizationInteractions.push({ + interaction, + path + }); + } + } + } + deoptimizePath(path) { + if (path.length === 0) { + this.markReassigned(); + return; + } + if (this.deoptimizedFields.has(UnknownKey)) { + return; + } + const key = path[0]; + if (this.deoptimizedFields.has(key)) { + return; + } + this.deoptimizedFields.add(key); + for (const entity of this.entitiesToBeDeoptimized) { + // We do not need a recursion tracker here as we already track whether + // this field is deoptimized + entity.deoptimizePath([key]); + } + if (key === UnknownKey) { + // save some memory + this.deoptimizationInteractions = NO_INTERACTIONS; + this.deoptimizations = EMPTY_PATH_TRACKER; + this.deoptimizedFields = UNKNOWN_DEOPTIMIZED_FIELD; + this.entitiesToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; + } + } + getReturnExpressionWhenCalledAtPath(path) { + // We deoptimize everything that is called as that will trivially deoptimize + // the corresponding return expressions as well and avoid badly performing + // and complicated alternatives + if (path.length === 0) { + this.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.deoptimizedFields.has(path[0])) { + this.deoptimizePath([path[0]]); + } + return UNKNOWN_RETURN_EXPRESSION; + } +} + +class ThisVariable extends ParameterVariable { + constructor(context) { + super('this', null, context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION).hasEffectsOnInteractionAtPath(path, interaction, context); + } +} + +class CatchBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + this.parent = parent; + } + addDeclaration(identifier, context, init, kind) { + if (kind === 'var') { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (existingKind === 'parameter' && + // If this is a destructured parameter, it is forbidden to redeclare + existingVariable.declarations[0].parent.type === parseAst_js.CatchClause) { + // If this is a var with the same name as the catch scope parameter, + // the assignment actually goes to the parameter and the var is + // hoisted without assignment. Locally, it is shadowed by the + // parameter + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, kind); + // To avoid the need to rewrite the declaration, we link the variable + // names. If we ever implement a logic that splits initialization and + // assignment for hoisted vars, the "renderLikeHoisted" logic can be + // removed again. + // We do not need to check whether there already is a linked + // variable because then declaredVariable would be that linked + // variable. + existingVariable.renderLikeHoisted(declaredVariable); + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + if (existingKind === 'var') { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(parseAst_js.logRedeclarationError(name), identifier.start); + } + // We only add parameters to parameter scopes + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class FunctionBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + // There is stuff that is only allowed in function scopes, i.e. functions can + // be redeclared, functions and var can redeclare each other + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if ((kind === 'var' || kind === 'function') && + (existingKind === 'var' || existingKind === 'function' || existingKind === 'parameter')) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(parseAst_js.logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } +} + +class ParameterScope extends ChildScope { + constructor(parent, isCatchScope) { + super(parent, parent.context); + this.parameters = []; + this.hasRest = false; + this.bodyScope = isCatchScope ? new CatchBodyScope(this) : new FunctionBodyScope(this); + } + /** + * Adds a parameter to this scope. Parameters must be added in the correct + * order, i.e. from left to right. + */ + addParameterDeclaration(identifier) { + const { name, start } = identifier; + const existingParameter = this.variables.get(name); + if (existingParameter) { + return this.context.error(parseAst_js.logDuplicateArgumentNameError(name), start); + } + const variable = new ParameterVariable(name, identifier, this.context); + this.variables.set(name, variable); + // We also add it to the body scope to detect name conflicts with local + // variables. We still need the intermediate scope, though, as parameter + // defaults are NOT taken from the body scope but from the parameters or + // outside scope. + this.bodyScope.addHoistedVariable(name, variable); + return variable; + } + addParameterVariables(parameters, hasRest) { + this.parameters = parameters; + for (const parameterList of parameters) { + for (const parameter of parameterList) { + parameter.alwaysRendered = true; + } + } + this.hasRest = hasRest; + } + includeCallArguments(context, parameters) { + let calledFromTryStatement = false; + let argumentIncluded = false; + const restParameter = this.hasRest && this.parameters[this.parameters.length - 1]; + for (const checkedArgument of parameters) { + if (checkedArgument instanceof SpreadElement) { + for (const argument of parameters) { + argument.include(context, false); + } + break; + } + } + for (let index = parameters.length - 1; index >= 0; index--) { + const parameterVariables = this.parameters[index] || restParameter; + const argument = parameters[index]; + if (parameterVariables) { + calledFromTryStatement = false; + if (parameterVariables.length === 0) { + // handle empty destructuring + argumentIncluded = true; + } + else { + for (const variable of parameterVariables) { + if (variable.included) { + argumentIncluded = true; + } + if (variable.calledFromTryStatement) { + calledFromTryStatement = true; + } + } + } + } + if (!argumentIncluded && argument.shouldBeIncluded(context)) { + argumentIncluded = true; + } + if (argumentIncluded) { + argument.include(context, calledFromTryStatement); + } + } + } +} + +class ReturnValueScope extends ParameterScope { + constructor() { + super(...arguments); + this.returnExpression = null; + this.returnExpressions = []; + } + addReturnExpression(expression) { + this.returnExpressions.push(expression); + } + getReturnExpression() { + if (this.returnExpression === null) + this.updateReturnExpression(); + return this.returnExpression; + } + updateReturnExpression() { + if (this.returnExpressions.length === 1) { + this.returnExpression = this.returnExpressions[0]; + } + else { + this.returnExpression = UNKNOWN_EXPRESSION; + for (const expression of this.returnExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } +} + +class FunctionScope extends ReturnValueScope { + constructor(parent) { + const { context } = parent; + super(parent, false); + this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); + this.variables.set('this', (this.thisVariable = new ThisVariable(context))); + } + findLexicalBoundary() { + return this; + } + includeCallArguments(context, parameters) { + super.includeCallArguments(context, parameters); + if (this.argumentsVariable.included) { + for (const argument of parameters) { + if (!argument.included) { + argument.include(context, false); + } + } + } + } +} + +class ExpressionStatement extends NodeBase { + initialise() { + super.initialise(); + if (this.directive && + this.directive !== 'use strict' && + this.parent.type === parseAst_js.Program) { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, + // This is necessary, because either way (deleting or not) can lead to errors. + parseAst_js.logModuleLevelDirective(this.directive, this.scope.context.module.id), this.start); + } + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } + render(code, options) { + super.render(code, options); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + } + shouldBeIncluded(context) { + if (this.directive && this.directive !== 'use strict') + return this.parent.type !== parseAst_js.Program; + return super.shouldBeIncluded(context); + } + applyDeoptimizations() { } +} + +class BlockStatement extends NodeBase { + get deoptimizeBody() { + return isFlagSet(this.flags, 32768 /* Flag.deoptimizeBody */); + } + set deoptimizeBody(value) { + this.flags = setFlag(this.flags, 32768 /* Flag.deoptimizeBody */, value); + } + get directlyIncluded() { + return isFlagSet(this.flags, 16384 /* Flag.directlyIncluded */); + } + set directlyIncluded(value) { + this.flags = setFlag(this.flags, 16384 /* Flag.directlyIncluded */, value); + } + addImplicitReturnExpressionToScope() { + const lastStatement = this.body[this.body.length - 1]; + if (!lastStatement || lastStatement.type !== parseAst_js.ReturnStatement) { + this.scope.addReturnExpression(UNKNOWN_EXPRESSION); + } + } + createScope(parentScope) { + this.scope = this.parent.preventChildBlockScope + ? parentScope + : new BlockScope(parentScope); + } + hasEffects(context) { + if (this.deoptimizeBody) + return true; + for (const node of this.body) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + if (!(this.deoptimizeBody && this.directlyIncluded)) { + this.included = true; + this.directlyIncluded = true; + if (this.deoptimizeBody) + includeChildrenRecursively = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + const firstBodyStatement = this.body[0]; + this.deoptimizeBody = + firstBodyStatement instanceof ExpressionStatement && + firstBodyStatement.directive === 'use asm'; + } + render(code, options) { + if (this.body.length > 0) { + renderStatementList(this.body, code, this.start + 1, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} + +class RestElement extends NodeBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + addExportedVariables(variables, exportNamesByVariable) { + this.argument.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + this.declarationInit = init; + return this.argument.declare(kind, UNKNOWN_EXPRESSION); + } + deoptimizePath(path) { + if (path.length === 0) { + this.argument.deoptimizePath(EMPTY_PATH); + } + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.argument.markDeclarationReached(); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class FunctionBase extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + this.parameterVariableValuesDeoptimized = false; + } + get async() { + return isFlagSet(this.flags, 256 /* Flag.async */); + } + set async(value) { + this.flags = setFlag(this.flags, 256 /* Flag.async */, value); + } + get deoptimizedReturn() { + return isFlagSet(this.flags, 512 /* Flag.deoptimizedReturn */); + } + set deoptimizedReturn(value) { + this.flags = setFlag(this.flags, 512 /* Flag.deoptimizedReturn */, value); + } + get generator() { + return isFlagSet(this.flags, 4194304 /* Flag.generator */); + } + set generator(value) { + this.flags = setFlag(this.flags, 4194304 /* Flag.generator */, value); + } + updateParameterVariableValues(_arguments) { + for (let position = 0; position < this.params.length; position++) { + const parameter = this.params[position]; + if (!(parameter instanceof Identifier)) { + continue; + } + const parameterVariable = parameter.variable; + const argument = _arguments[position + 1] ?? UNDEFINED_EXPRESSION; + parameterVariable.updateKnownValue(argument); + } + } + deoptimizeParameterVariableValues() { + for (const parameter of this.params) { + if (parameter instanceof Identifier) { + const parameterVariable = parameter.variable; + parameterVariable.markReassigned(); + } + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_CALLED) { + const { parameters } = this.scope; + const { args } = interaction; + let hasRest = false; + for (let position = 0; position < args.length - 1; position++) { + const parameter = this.params[position]; + // Only the "this" argument arg[0] can be null + const argument = args[position + 1]; + if (argument instanceof SpreadElement) { + this.deoptimizeParameterVariableValues(); + } + if (hasRest || parameter instanceof RestElement) { + hasRest = true; + argument.deoptimizePath(UNKNOWN_PATH); + } + else if (parameter instanceof Identifier) { + parameters[position][0].addEntityToBeDeoptimized(argument); + this.addArgumentToBeDeoptimized(argument); + } + else if (parameter) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.addArgumentToBeDeoptimized(argument); + } + } + this.updateParameterVariableValues(args); + } + else { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + if (path.length === 1 && path[0] === UnknownKey) { + // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track + // which means the return expression and parameters need to be reassigned + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + for (const parameterList of this.scope.parameters) { + for (const parameter of parameterList) { + parameter.deoptimizePath(UNKNOWN_PATH); + parameter.markReassigned(); + } + } + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length > 0) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.async) { + if (!this.deoptimizedReturn) { + this.deoptimizedReturn = true; + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } + return UNKNOWN_RETURN_EXPRESSION; + } + return [this.scope.getReturnExpression(), false]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.annotationNoSideEffects) { + return false; + } + if (this.async) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + const returnExpression = this.scope.getReturnExpression(); + if (returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_CALL, context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_ACCESS, context)))) { + return true; + } + } + for (const parameter of this.params) { + if (parameter.hasEffects(context)) + return true; + } + return false; + } + /** + * If the function (expression or declaration) is only used as function calls + */ + onlyFunctionCallUsed() { + let variable = null; + if (this.parent.type === parseAst_js.VariableDeclarator) { + variable = this.parent.id.variable ?? null; + } + if (this.parent.type === parseAst_js.ExportDefaultDeclaration) { + variable = this.parent.variable; + } + return variable?.getOnlyFunctionCallUsed() ?? false; + } + include(context, includeChildrenRecursively) { + if (!this.parameterVariableValuesDeoptimized && !this.onlyFunctionCallUsed()) { + this.parameterVariableValuesDeoptimized = true; + this.deoptimizeParameterVariableValues(); + } + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + const { brokenFlow } = context; + context.brokenFlow = false; + this.body.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + includeCallArguments(context, parameters) { + this.scope.includeCallArguments(context, parameters); + } + initialise() { + super.initialise(); + if (this.body instanceof BlockStatement) { + this.body.addImplicitReturnExpressionToScope(); + } + else { + this.scope.addReturnExpression(this.body); + } + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationNoSideEffects = this.annotations.some(comment => comment.type === 'noSideEffects'); + } + } + parseNode(esTreeNode) { + const { body, params } = esTreeNode; + const { scope } = this; + const { bodyScope, context } = scope; + // We need to ensure that parameters are declared before the body is parsed + // so that the scope already knows all parameters and can detect conflicts + // when parsing the body. + const parameters = (this.params = params.map((parameter) => new (context.getNodeConstructor(parameter.type))(this, scope).parseNode(parameter))); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + this.body = new (context.getNodeConstructor(body.type))(this, bodyScope).parseNode(body); + return super.parseNode(esTreeNode); + } + addArgumentToBeDeoptimized(_argument) { } + applyDeoptimizations() { } +} +FunctionBase.prototype.preventChildBlockScope = true; + +class FunctionNode extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new FunctionScope(parentScope); + this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); + // This makes sure that all deoptimizations of "this" are applied to the + // constructed entity. + this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) { + // args[0] is the "this" argument + this.scope.thisVariable.addEntityToBeDeoptimized(interaction.args[0]); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.annotationNoSideEffects) { + return false; + } + return !!this.id?.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); + context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION); + const { brokenFlow, ignore, replacedVariableInits } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: interaction.withNew + }; + if (this.body.hasEffects(context)) + return true; + context.brokenFlow = brokenFlow; + if (thisInit) { + replacedVariableInits.set(this.scope.thisVariable, thisInit); + } + else { + replacedVariableInits.delete(this.scope.thisVariable); + } + context.ignore = ignore; + } + return false; + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + this.id?.include(); + const hasArguments = this.scope.argumentsVariable.included; + for (const parameter of this.params) { + if (!(parameter instanceof Identifier) || hasArguments) { + parameter.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + this.id?.declare('function', this); + } + addArgumentToBeDeoptimized(argument) { + this.scope.argumentsVariable.addArgumentToBeDeoptimized(argument); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([ + { + key: 'prototype', + kind: 'init', + property: new ObjectEntity([], OBJECT_PROTOTYPE) + } + ], OBJECT_PROTOTYPE)); + } +} + +class FunctionDeclaration extends FunctionNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + onlyFunctionCallUsed() { + // call super.onlyFunctionCallUsed for export default anonymous function + return this.id?.variable.getOnlyFunctionCallUsed() ?? super.onlyFunctionCallUsed(); + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.scope.parent).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } +} + +// The header ends at the first non-white-space after "default" +function getDeclarationStart(code, start) { + return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); +} +function getFunctionIdInsertPosition(code, start) { + const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length; + code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd)); + const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); + if (generatorStarPos === -1) { + return declarationEnd; + } + return declarationEnd + generatorStarPos + 1; +} +class ExportDefaultDeclaration extends NodeBase { + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively) { + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + super.initialise(); + const declaration = this.declaration; + this.declarationName = + (declaration.id && declaration.id.name) || this.declaration.name; + this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.scope.context.getModuleName(), this, this.scope.context); + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + const declarationStart = getDeclarationStart(code.original, this.start); + if (this.declaration instanceof FunctionDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? getFunctionIdInsertPosition(code.original, declarationStart) + : null, options); + } + else if (this.declaration instanceof ClassDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length + : null, options); + } + else if (this.variable.getOriginalVariable() !== this.variable) { + // Remove altogether to prevent re-declaring the same variable + treeshakeNode(this, code, start, end); + return; + } + else if (this.variable.included) { + this.renderVariableDeclaration(code, declarationStart, options); + } + else { + code.remove(this.start, declarationStart); + this.declaration.render(code, options, { + renderedSurroundingElement: parseAst_js.ExpressionStatement + }); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + return; + } + this.declaration.render(code, options); + } + applyDeoptimizations() { } + renderNamedDeclaration(code, declarationStart, idInsertPosition, options) { + const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options; + const name = this.variable.getName(getPropertyAccess); + // Remove `export default` + code.remove(this.start, declarationStart); + if (idInsertPosition !== null) { + code.appendLeft(idInsertPosition, ` ${name}`); + } + if (format === 'system' && + this.declaration instanceof ClassDeclaration && + exportNamesByVariable.has(this.variable)) { + code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); + } + } + renderVariableDeclaration(code, declarationStart, { format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) { + const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ + const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable); + if (systemExportNames) { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports(${JSON.stringify(systemExportNames[0])}, `); + code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';')); + } + else { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = `); + if (!hasTrailingSemicolon) { + code.appendLeft(this.end, ';'); + } + } + } +} +ExportDefaultDeclaration.prototype.needsBoundaries = true; + +const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/; +const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g; +const backSlashRegEx = /\\/g; +function escapeId(id) { + if (!needsEscapeRegEx.test(id)) + return id; + return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1'); +} + +const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; +const INTEROP_DEFAULT_COMPAT_VARIABLE = '_interopDefaultCompat'; +const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; +const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat'; +const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault'; +const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly'; +const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces'; +const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript'; +const defaultInteropHelpersByInteropType = { + auto: INTEROP_DEFAULT_VARIABLE, + compat: INTEROP_DEFAULT_COMPAT_VARIABLE, + default: null, + defaultOnly: null, + esModule: null +}; +const isDefaultAProperty = (interopType, externalLiveBindings) => interopType === 'esModule' || + (externalLiveBindings && (interopType === 'auto' || interopType === 'compat')); +const namespaceInteropHelpersByInteropType = { + auto: INTEROP_NAMESPACE_VARIABLE, + compat: INTEROP_NAMESPACE_COMPAT_VARIABLE, + default: INTEROP_NAMESPACE_DEFAULT_VARIABLE, + defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, + esModule: null +}; +const canDefaultBeTakenFromNamespace = (interopType, externalLiveBindings) => interopType !== 'esModule' && isDefaultAProperty(interopType, externalLiveBindings); +const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, liveBindings, freeze, symbols) => { + const usedHelpers = new Set(additionalHelpers); + for (const variable of HELPER_NAMES) { + if (accessedGlobals.has(variable)) { + usedHelpers.add(variable); + } + } + return HELPER_NAMES.map(variable => usedHelpers.has(variable) + ? HELPER_GENERATORS[variable](indent, snippets, liveBindings, freeze, symbols, usedHelpers) + : '').join(''); +}; +const HELPER_GENERATORS = { + [DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) { + return `var ${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`; + }, + [INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_COMPAT_VARIABLE + }); + return (`${left}${getIsCompatNamespace(snippets)}${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_VARIABLE + }); + return (`${left}e${_}&&${_}e.__esModule${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_NAMESPACE_COMPAT_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_COMPAT_VARIABLE + }); + return `${left}${getIsCompatNamespace(snippets)}${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_COMPAT_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(${getIsCompatNamespace(snippets)})${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, symbols) { + const { getDirectReturnFunction, getObject, n, _ } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + }); + return `${left}${getFrozen(freeze, getWithToStringTag(symbols, getObject([ + [null, `__proto__:${_}null`], + ['default', 'e'] + ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`; + }, + [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, n } = snippets; + return (`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_VARIABLE + }); + return `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, cnst, n } = snippets; + const useForEach = cnst === 'var' && liveBindings; + return (`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` + + `${t}${loopOverNamespaces(`{${n}` + + `${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` + + (liveBindings + ? useForEach + ? copyOwnPropertyLiveBinding + : copyPropertyLiveBinding + : copyPropertyStatic)(t, t + t + t + t, snippets) + + `${t}${t}${t}}${n}` + + `${t}${t}}`, useForEach, t, snippets)}${n}` + + `${t}return ${getFrozen(freeze, getWithToStringTag(symbols, 'n', snippets))};${n}` + + `}${n}${n}`); + } +}; +const getDefaultLiveBinding = ({ _, getObject }) => `e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`; +const getDefaultStatic = ({ _, getPropertyAccess }) => `e${getPropertyAccess('default')}${_}:${_}e`; +const getIsCompatNamespace = ({ _ }) => `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e`; +const createNamespaceObject = (t, index, snippets, liveBindings, freeze, symbols) => { + const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; + const copyProperty = `{${n}` + + (liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(t, index + t + t, snippets) + + `${index}${t}}`; + return (`${index}${cnst} n${_}=${_}Object.create(null${symbols ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` : ''});${n}` + + `${index}if${_}(e)${_}{${n}` + + `${index}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + + `${index}}${n}` + + `${index}n${getPropertyAccess('default')}${_}=${_}e;${n}` + + `${index}return ${getFrozen(freeze, 'n')}${s}${n}`); +}; +const loopOverKeys = (body, allowVariableLoopVariable, { _, cnst, getFunctionIntro, s }) => cnst !== 'var' || allowVariableLoopVariable + ? `for${_}(${cnst} k in e)${_}${body}` + : `Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${s}`; +const loopOverNamespaces = (body, useForEach, t, { _, cnst, getDirectReturnFunction, getFunctionIntro, n }) => { + if (useForEach) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: false, + lineBreakIndent: { base: t, t }, + name: null + }); + return (`m.forEach(${left}` + + `e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${right});`); + } + return (`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` + + `${t}${t}${cnst} e${_}=${_}m[i];${n}` + + `${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`); +}; +const copyNonDefaultOwnPropertyLiveBinding = (t, index, snippets) => { + const { _, n } = snippets; + return (`${index}if${_}(k${_}!==${_}'default')${_}{${n}` + + copyOwnPropertyLiveBinding(t, index + t, snippets) + + `${index}}${n}`); +}; +const copyOwnPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}enumerable:${_}true,${n}` + + `${index}${t}get:${_}${left}e[k]${right}${n}` + + `${index}});${n}`); +}; +const copyPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}if${_}(d)${_}{${n}` + + `${index}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}${t}enumerable:${_}true,${n}` + + `${index}${t}${t}get:${_}${left}e[k]${right}${n}` + + `${index}${t}});${n}` + + `${index}}${n}`); +}; +const copyPropertyStatic = (_t, index, { _, n }) => `${index}n[k]${_}=${_}e[k];${n}`; +const getFrozen = (freeze, fragment) => freeze ? `Object.freeze(${fragment})` : fragment; +const getWithToStringTag = (symbols, fragment, { _, getObject }) => symbols + ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})` + : fragment; +const HELPER_NAMES = Object.keys(HELPER_GENERATORS); +function getToStringTagValue(getObject) { + return getObject([['value', "'Module'"]], { + lineBreakIndent: null + }); +} + +class Literal extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || + // unknown literals can also be null but do not start with an "n" + (this.value === null && this.scope.context.code.charCodeAt(this.start) !== 110) || + typeof this.value === 'bigint' || + // to support shims for regular expressions + this.scope.context.code.charCodeAt(this.start) === 47) { + return UnknownValue; + } + return this.value; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) + return UNKNOWN_RETURN_EXPRESSION; + return getMemberReturnExpressionWhenCalled(this.members, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return path.length > (this.value === null ? 0 : 1); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + if (this.included && + this.value instanceof RegExp && + (this.value.global || this.value.sticky)) { + return true; + } + return (path.length !== 1 || + hasMemberEffectWhenCalled(this.members, path[0], interaction, context)); + } + } + } + initialise() { + super.initialise(); + this.members = getLiteralMembersForValue(this.value); + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + this.regex = esTreeNode.regex; + return super.parseNode(esTreeNode); + } + render(code) { + if (typeof this.value === 'string') { + code.indentExclusionRanges.push([this.start + 1, this.end - 1]); + } + } +} + +function getChainElementLiteralValueAtPath(element, object, path, recursionTracker, origin) { + if ('getLiteralValueAtPathAsChainElement' in object) { + const calleeValue = object.getLiteralValueAtPathAsChainElement(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin); + if (calleeValue === IS_SKIPPED_CHAIN || (element.optional && calleeValue == null)) { + return IS_SKIPPED_CHAIN; + } + } + else if (element.optional && + object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null) { + return IS_SKIPPED_CHAIN; + } + return element.getLiteralValueAtPath(path, recursionTracker, origin); +} + +// To avoid infinite recursions +const MAX_PATH_DEPTH = 7; +function getResolvablePropertyKey(memberExpression) { + return memberExpression.computed + ? getResolvableComputedPropertyKey(memberExpression.property) + : memberExpression.property.name; +} +function getResolvableComputedPropertyKey(propertyKey) { + if (propertyKey instanceof Literal) { + return String(propertyKey.value); + } + return null; +} +function getPathIfNotComputed(memberExpression) { + const nextPathKey = memberExpression.propertyKey; + const object = memberExpression.object; + if (typeof nextPathKey === 'string') { + if (object instanceof Identifier) { + return [ + { key: object.name, pos: object.start }, + { key: nextPathKey, pos: memberExpression.property.start } + ]; + } + if (object instanceof MemberExpression) { + const parentPath = getPathIfNotComputed(object); + return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]); + } + } + return null; +} +function getStringFromPath(path) { + let pathString = path[0].key; + for (let index = 1; index < path.length; index++) { + pathString += '.' + path[index].key; + } + return pathString; +} +class MemberExpression extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.expressionsToBeDeoptimized = []; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + get assignmentDeoptimized() { + return isFlagSet(this.flags, 16 /* Flag.assignmentDeoptimized */); + } + set assignmentDeoptimized(value) { + this.flags = setFlag(this.flags, 16 /* Flag.assignmentDeoptimized */, value); + } + get bound() { + return isFlagSet(this.flags, 32 /* Flag.bound */); + } + set bound(value) { + this.flags = setFlag(this.flags, 32 /* Flag.bound */, value); + } + get isUndefined() { + return isFlagSet(this.flags, 64 /* Flag.isUndefined */); + } + set isUndefined(value) { + this.flags = setFlag(this.flags, 64 /* Flag.isUndefined */, value); + } + bind() { + this.bound = true; + const path = getPathIfNotComputed(this); + const baseVariable = path && this.scope.findVariable(path[0].key); + if (baseVariable?.isNamespace) { + const resolvedVariable = resolveNamespaceVariables(baseVariable, path.slice(1), this.scope.context); + if (!resolvedVariable) { + super.bind(); + } + else if (resolvedVariable === 'undefined') { + this.isUndefined = true; + } + else { + this.variable = resolvedVariable; + this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable); + } + } + else { + super.bind(); + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.variable) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + else if (!this.isUndefined) { + if (path.length < MAX_PATH_DEPTH) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.getPropertyKey(), ...path], recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizeCache() { + const { expressionsToBeDeoptimized, object } = this; + this.expressionsToBeDeoptimized = parseAst_js.EMPTY_ARRAY; + this.propertyKey = UnknownKey; + object.deoptimizePath(UNKNOWN_PATH); + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + deoptimizePath(path) { + if (path.length === 0) + this.disallowNamespaceReassignment(); + if (this.variable) { + this.variable.deoptimizePath(path); + } + else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizePath([ + propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, + ...path + ]); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.variable) { + return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (this.isUndefined) { + return undefined; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + } + return UnknownValue; + } + getLiteralValueAtPathAsChainElement(path, recursionTracker, origin) { + if (this.variable) { + return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (this.isUndefined) { + return undefined; + } + return getChainElementLiteralValueAtPath(this, this.object, path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.variable) { + return this.variable.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.isUndefined) { + return [UNDEFINED_EXPRESSION, false]; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + this.hasAccessEffect(context)); + } + hasEffectsAsChainElement(context) { + if (this.variable || this.isUndefined) + return this.hasEffects(context); + const objectHasEffects = 'hasEffectsAsChainElement' in this.object + ? this.object.hasEffectsAsChainElement(context) + : this.object.hasEffects(context); + if (objectHasEffects === IS_SKIPPED_CHAIN) + return IS_SKIPPED_CHAIN; + if (this.optional && + this.object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) == null) { + return objectHasEffects || IS_SKIPPED_CHAIN; + } + // We only apply deoptimizations lazily once we know we are not skipping + if (!this.deoptimized) + this.applyDeoptimizations(); + return objectHasEffects || this.property.hasEffects(context) || this.hasAccessEffect(context); + } + hasEffectsAsAssignmentTarget(context, checkAccess) { + if (checkAccess && !this.deoptimized) + this.applyDeoptimizations(); + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + (checkAccess && this.hasAccessEffect(context)) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.variable) { + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.isUndefined) { + return true; + } + if (path.length < MAX_PATH_DEPTH) { + return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(), ...path], interaction, context); + } + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.includeProperties(context, includeChildrenRecursively); + } + includeAsAssignmentTarget(context, includeChildrenRecursively, deoptimizeAccess) { + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + if (deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + else { + this.includeProperties(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + if (this.variable) { + this.variable.includeCallArguments(context, parameters); + } + else { + super.includeCallArguments(context, parameters); + } + } + initialise() { + super.initialise(); + this.propertyKey = getResolvablePropertyKey(this); + this.accessInteraction = { args: [this.object], type: INTERACTION_ACCESSED }; + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = parseAst_js.BLANK) { + if (this.variable || this.isUndefined) { + const { snippets: { getPropertyAccess } } = options; + let replacement = this.variable ? this.variable.getName(getPropertyAccess) : 'undefined'; + if (renderedParentType && isCalleeOfRenderedParent) + replacement = '0, ' + replacement; + code.overwrite(this.start, this.end, replacement, { + contentOnly: true, + storeName: true + }); + } + else { + if (renderedParentType && isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + this.object.render(code, options, { renderedSurroundingElement }); + this.property.render(code, options); + } + } + setAssignedValue(value) { + this.assignmentInteraction = { + args: [this.object, value], + type: INTERACTION_ASSIGNED + }; + } + applyDeoptimizations() { + this.deoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizeArgumentsOnInteractionAtPath(this.accessInteraction, [propertyKey], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + if (this.variable) { + this.variable.addUsedPlace(this); + this.scope.context.requestTreeshakingPass(); + } + } + applyAssignmentDeoptimization() { + this.assignmentDeoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + this.object.deoptimizeArgumentsOnInteractionAtPath(this.assignmentInteraction, [this.getPropertyKey()], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + } + disallowNamespaceReassignment() { + if (this.object instanceof Identifier) { + const variable = this.scope.findVariable(this.object.name); + if (variable.isNamespace) { + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logIllegalImportReassignment(this.object.name, this.scope.context.module.id), this.start); + } + } + } + getPropertyKey() { + if (this.propertyKey === null) { + this.propertyKey = UnknownKey; + const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return (this.propertyKey = + value === SymbolToStringTag + ? value + : typeof value === 'symbol' + ? UnknownKey + : String(value)); + } + return this.propertyKey; + } + hasAccessEffect(context) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (!(this.variable || this.isUndefined) && + propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()], this.accessInteraction, context))); + } + includeProperties(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + } + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); + } +} +function resolveNamespaceVariables(baseVariable, path, astContext) { + if (path.length === 0) + return baseVariable; + if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) + return null; + const exportName = path[0].key; + const variable = baseVariable.context.traceExport(exportName); + if (!variable) { + if (path.length === 1) { + const fileName = baseVariable.context.fileName; + astContext.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingExport(exportName, astContext.module.id, fileName), path[0].pos); + return 'undefined'; + } + return null; + } + return resolveNamespaceVariables(variable, path.slice(1), astContext); +} + +const FILE_PREFIX = 'ROLLUP_FILE_URL_'; +const IMPORT = 'import'; +class MetaProperty extends NodeBase { + constructor() { + super(...arguments); + this.metaProperty = null; + this.preliminaryChunkId = null; + this.referenceId = null; + } + getReferencedFileName(outputPluginDriver) { + const { meta: { name }, metaProperty } = this; + if (name === IMPORT && metaProperty?.startsWith(FILE_PREFIX)) { + return outputPluginDriver.getFileName(metaProperty.slice(FILE_PREFIX.length)); + } + return null; + } + hasEffects() { + return false; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include() { + if (!this.included) { + this.included = true; + if (this.meta.name === IMPORT) { + this.scope.context.addImportMeta(this); + const parent = this.parent; + const metaProperty = (this.metaProperty = + parent instanceof MemberExpression && typeof parent.propertyKey === 'string' + ? parent.propertyKey + : null); + if (metaProperty?.startsWith(FILE_PREFIX)) { + this.referenceId = metaProperty.slice(FILE_PREFIX.length); + } + } + } + } + render(code, renderOptions) { + const { format, pluginDriver, snippets } = renderOptions; + const { scope: { context: { module } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this; + const { id: moduleId } = module; + if (name !== IMPORT) + return; + const chunkId = preliminaryChunkId; + if (referenceId) { + const fileName = pluginDriver.getFileName(referenceId); + const relativePath = parseAst_js.normalize(path.relative(path.dirname(chunkId), fileName)); + const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [ + { chunkId, fileName, format, moduleId, referenceId, relativePath } + ]) || relativeUrlMechanisms[format](relativePath); + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + return; + } + let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [ + metaProperty, + { chunkId, format, moduleId } + ]); + if (!replacement) { + replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets }); + renderOptions.accessedDocumentCurrentScript ||= + formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined'; + } + if (typeof replacement === 'string') { + if (parent instanceof MemberExpression) { + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + } + else { + code.overwrite(start, end, replacement, { contentOnly: true }); + } + } + } + setResolution(format, accessedGlobalsByScope, preliminaryChunkId) { + this.preliminaryChunkId = preliminaryChunkId; + const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format]; + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } +} +const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd']; +const accessedMetaUrlGlobals = { + amd: ['document', 'module', 'URL'], + cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT], + es: [], + iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT], + system: ['module'], + umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT] +}; +const accessedFileUrlGlobals = { + amd: ['document', 'require', 'URL'], + cjs: ['document', 'require', 'URL'], + es: [], + iife: ['document', 'URL'], + system: ['module', 'URL'], + umd: ['document', 'require', 'URL'] +}; +const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`; +const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(relativePath)}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`); +const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => { + const urlMechanism = getUrl(chunkId); + return property === null + ? `({ url: ${urlMechanism} })` + : property === 'url' + ? urlMechanism + : 'undefined'; +}; +const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`; +const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${escapeId(path)}'`); +const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.tagName.toUpperCase() === 'SCRIPT' && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`; +const relativeUrlMechanisms = { + amd: relativePath => { + if (relativePath[0] !== '.') + relativePath = './' + relativePath; + return getResolveUrl(`require.toUrl('${escapeId(relativePath)}'), document.baseURI`); + }, + cjs: relativePath => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath)})`, + es: relativePath => getResolveUrl(`'${escapeId(relativePath)}', import.meta.url`), + iife: relativePath => getRelativeUrlFromDocument(relativePath), + system: relativePath => getResolveUrl(`'${escapeId(relativePath)}', module.meta.url`), + umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})` +}; +const importMetaMechanisms = { + amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)), + cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId)})`), + iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)), + system: (property, { snippets: { getPropertyAccess } }) => property === null ? `module.meta` : `module.meta${getPropertyAccess(property)}`, + umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId, true)})`) +}; + +class UndefinedVariable extends Variable { + constructor() { + super('undefined'); + } + getLiteralValueAtPath() { + return undefined; + } +} + +class ExportDefaultVariable extends LocalVariable { + constructor(name, exportDefaultDeclaration, context) { + super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context, 'other'); + this.hasId = false; + this.originalId = null; + this.originalVariable = null; + const declaration = exportDefaultDeclaration.declaration; + if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && + declaration.id) { + this.hasId = true; + this.originalId = declaration.id; + } + else if (declaration instanceof Identifier) { + this.originalId = declaration; + } + } + addReference(identifier) { + if (!this.hasId) { + this.name = identifier.name; + } + } + addUsedPlace(usedPlace) { + const original = this.getOriginalVariable(); + if (original === this) { + super.addUsedPlace(usedPlace); + } + else { + original.addUsedPlace(usedPlace); + } + } + forbidName(name) { + const original = this.getOriginalVariable(); + if (original === this) { + super.forbidName(name); + } + else { + original.forbidName(name); + } + } + getAssignedVariableName() { + return (this.originalId && this.originalId.name) || null; + } + getBaseVariableName() { + const original = this.getOriginalVariable(); + return original === this ? super.getBaseVariableName() : original.getBaseVariableName(); + } + getDirectOriginalVariable() { + return this.originalId && + (this.hasId || + !(this.originalId.isPossibleTDZ() || + this.originalId.variable.isReassigned || + this.originalId.variable instanceof UndefinedVariable || + // this avoids a circular dependency + 'syntheticNamespace' in this.originalId.variable)) + ? this.originalId.variable + : null; + } + getName(getPropertyAccess) { + const original = this.getOriginalVariable(); + return original === this + ? super.getName(getPropertyAccess) + : original.getName(getPropertyAccess); + } + getOriginalVariable() { + if (this.originalVariable) + return this.originalVariable; + // eslint-disable-next-line @typescript-eslint/no-this-alias + let original = this; + let currentVariable; + const checkedVariables = new Set(); + do { + checkedVariables.add(original); + currentVariable = original; + original = currentVariable.getDirectOriginalVariable(); + } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original)); + return (this.originalVariable = original || currentVariable); + } +} + +class NamespaceVariable extends Variable { + constructor(context) { + super(context.getModuleName()); + this.memberVariables = null; + this.mergedNamespaces = []; + this.referencedEarly = false; + this.references = []; + this.context = context; + this.module = context.module; + } + addReference(identifier) { + this.references.push(identifier); + this.name = identifier.name; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizeArgumentsOnInteractionAtPath(interaction, path.slice(1), recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizePath(path) { + if (path.length > 1) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizePath(path.slice(1)); + } + } + } + getLiteralValueAtPath(path) { + if (path[0] === SymbolToStringTag) { + return 'Module'; + } + return UnknownValue; + } + getMemberVariables() { + if (this.memberVariables) { + return this.memberVariables; + } + const memberVariables = Object.create(null); + const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort(); + for (const name of sortedExports) { + if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) { + const exportedVariable = this.context.traceExport(name); + if (exportedVariable) { + memberVariables[name] = exportedVariable; + } + } + } + return (this.memberVariables = memberVariables); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length === 0) { + // This can only be a call anyway + return true; + } + if (path.length === 1 && type !== INTERACTION_CALLED) { + return type === INTERACTION_ASSIGNED; + } + const key = path[0]; + if (typeof key !== 'string') { + return true; + } + const memberVariable = this.getMemberVariables()[key]; + return (!memberVariable || + memberVariable.hasEffectsOnInteractionAtPath(path.slice(1), interaction, context)); + } + include() { + super.include(); + this.context.includeAllExports(); + } + prepare(accessedGlobalsByScope) { + if (this.mergedNamespaces.length > 0) { + this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope); + } + } + renderBlock(options) { + const { exportNamesByVariable, format, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; + const memberVariables = this.getMemberVariables(); + const members = Object.entries(memberVariables) + .filter(([_, variable]) => variable.included) + .map(([name, variable]) => { + if (this.referencedEarly || variable.isReassigned || variable === this) { + return [ + null, + `get ${stringifyObjectKeyIfNeeded(name)}${_}()${_}{${_}return ${variable.getName(getPropertyAccess)}${s}${_}}` + ]; + } + return [name, variable.getName(getPropertyAccess)]; + }); + members.unshift([null, `__proto__:${_}null`]); + let output = getObject(members, { lineBreakIndent: { base: '', t } }); + if (this.mergedNamespaces.length > 0) { + const assignmentArguments = this.mergedNamespaces.map(variable => variable.getName(getPropertyAccess)); + output = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArguments.join(`,${_}`)}])`; + } + else { + // The helper to merge namespaces will also take care of freezing and toStringTag + if (symbols) { + output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})`; + } + if (freeze) { + output = `/*#__PURE__*/Object.freeze(${output})`; + } + } + const name = this.getName(getPropertyAccess); + output = `${cnst} ${name}${_}=${_}${output};`; + if (format === 'system' && exportNamesByVariable.has(this)) { + output += `${n}${getSystemExportStatement([this], options)};`; + } + return output; + } + renderFirst() { + return this.referencedEarly; + } + setMergedNamespaces(mergedNamespaces) { + this.mergedNamespaces = mergedNamespaces; + const moduleExecIndex = this.context.getModuleExecIndex(); + for (const identifier of this.references) { + const { context } = identifier.scope; + if (context.getModuleExecIndex() <= moduleExecIndex) { + this.referencedEarly = true; + break; + } + } + } +} +NamespaceVariable.prototype.isNamespace = true; + +class SyntheticNamedExportVariable extends Variable { + constructor(context, name, syntheticNamespace) { + super(name); + this.baseVariable = null; + this.context = context; + this.module = context.module; + this.syntheticNamespace = syntheticNamespace; + } + getBaseVariable() { + if (this.baseVariable) + return this.baseVariable; + let baseVariable = this.syntheticNamespace; + while (baseVariable instanceof ExportDefaultVariable || + baseVariable instanceof SyntheticNamedExportVariable) { + if (baseVariable instanceof ExportDefaultVariable) { + const original = baseVariable.getOriginalVariable(); + if (original === baseVariable) + break; + baseVariable = original; + } + if (baseVariable instanceof SyntheticNamedExportVariable) { + baseVariable = baseVariable.syntheticNamespace; + } + } + return (this.baseVariable = baseVariable); + } + getBaseVariableName() { + return this.syntheticNamespace.getBaseVariableName(); + } + getName(getPropertyAccess) { + return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; + } + include() { + super.include(); + this.context.includeVariableInModule(this.syntheticNamespace); + } + setRenderNames(baseName, name) { + super.setRenderNames(baseName, name); + } +} + +class ExternalChunk { + constructor(module, options, inputBase) { + this.options = options; + this.inputBase = inputBase; + this.defaultVariableName = ''; + this.namespaceVariableName = ''; + this.variableName = ''; + this.fileName = null; + this.importAttributes = null; + this.id = module.id; + this.moduleInfo = module.info; + this.renormalizeRenderPath = module.renormalizeRenderPath; + this.suggestedVariableName = module.suggestedVariableName; + } + getFileName() { + if (this.fileName) { + return this.fileName; + } + const { paths } = this.options; + return (this.fileName = + (typeof paths === 'function' ? paths(this.id) : paths[this.id]) || + (this.renormalizeRenderPath ? parseAst_js.normalize(path.relative(this.inputBase, this.id)) : this.id)); + } + getImportAttributes(snippets) { + return (this.importAttributes ||= formatAttributes(this.options.format === 'es' && + this.options.externalImportAttributes && + this.moduleInfo.attributes, snippets)); + } + getImportPath(importer) { + return escapeId(this.renormalizeRenderPath + ? parseAst_js.getImportPath(importer, this.getFileName(), this.options.format === 'amd', false) + : this.getFileName()); + } +} +function formatAttributes(attributes, { getObject }) { + if (!attributes) { + return null; + } + const assertionEntries = Object.entries(attributes).map(([key, value]) => [key, `'${value}'`]); + if (assertionEntries.length > 0) { + return getObject(assertionEntries, { lineBreakIndent: null }); + } + return null; +} + +function removeJsExtension(name) { + return name.endsWith('.js') ? name.slice(0, -3) : name; +} + +function getCompleteAmdId(options, chunkId) { + if (options.autoId) { + return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`; + } + return options.id ?? ''; +} + +function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') { + const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets; + if (!namedExportsMode) { + return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`; + } + let exportBlock = ''; + if (namedExportsMode) { + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (!reexports) { + continue; + } + for (const specifier of reexports) { + if (specifier.reexported !== '*') { + const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + if (exportBlock) + exportBlock += n; + if (specifier.imported !== '*' && specifier.needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + exportBlock += + `Object.defineProperty(exports,${_}${JSON.stringify(specifier.reexported)},${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}get:${_}${left}${importName}${right}${n}});`; + } + else if (specifier.reexported === '__proto__') { + exportBlock += + `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${importName}${n}});`; + } + else { + exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`; + } + } + } + } + } + for (const { exported, local } of exports) { + const lhs = `exports${getPropertyAccess(exported)}`; + const rhs = local; + if (lhs !== rhs) { + if (exportBlock) + exportBlock += n; + exportBlock += + exported === '__proto__' + ? `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${rhs}${n}});` + : `${lhs}${_}=${_}${rhs};`; + } + } + if (namedExportsMode) { + for (const { name, reexports } of dependencies) { + if (!reexports) { + continue; + } + for (const specifier of reexports) { + if (specifier.reexported === '*') { + if (exportBlock) + exportBlock += n; + if (!specifier.needsLiveBinding && reexportProtoFromExternal) { + const protoString = "'__proto__'"; + exportBlock += + `Object.prototype.hasOwnProperty.call(${name},${_}${protoString})${_}&&${n}` + + `${t}!Object.prototype.hasOwnProperty.call(exports,${_}${protoString})${_}&&${n}` + + `${t}Object.defineProperty(exports,${_}${protoString},${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}value:${_}${name}[${protoString}]${n}` + + `${t}});${n}${n}`; + } + const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!Object.prototype.hasOwnProperty.call(exports,${_}k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`; + exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${copyPropertyIfNecessary});`; + } + } + } + } + if (exportBlock) { + return `${n}${n}${exportBlock}`; + } + return ''; +} +function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) { + if (exports.length > 0) { + return exports[0].local; + } + else { + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports) { + return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + } + } + } +} +function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings, getPropertyAccess) { + if (imported === 'default') { + if (!isChunk) { + const moduleInterop = interop(moduleId); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? defaultVariableName + : moduleVariableName; + return isDefaultAProperty(moduleInterop, externalLiveBindings) + ? `${variableName}${getPropertyAccess('default')}` + : variableName; + } + return depNamedExportsMode + ? `${moduleVariableName}${getPropertyAccess('default')}` + : moduleVariableName; + } + if (imported === '*') { + return (isChunk ? !depNamedExportsMode : namespaceInteropHelpersByInteropType[interop(moduleId)]) + ? namespaceVariableName + : moduleVariableName; + } + return `${moduleVariableName}${getPropertyAccess(imported)}`; +} +function getEsModuleValue(getObject) { + return getObject([['value', 'true']], { + lineBreakIndent: null + }); +} +function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, { _, getObject }) { + if (hasNamedExports) { + if (addEsModule) { + if (addNamespaceToStringTag) { + return `Object.defineProperties(exports,${_}${getObject([ + ['__esModule', getEsModuleValue(getObject)], + [null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`] + ], { + lineBreakIndent: null + })});`; + } + return `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`; + } + if (addNamespaceToStringTag) { + return `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)});`; + } + } + return ''; +} +const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFunction, n }) => { + if (needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`Object.defineProperty(exports,${_}k,${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`); + } + return `exports[k]${_}=${_}${name}[k]`; +}; + +function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) { + const { _, cnst, n } = snippets; + const neededInteropHelpers = new Set(); + const interopStatements = []; + const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => { + neededInteropHelpers.add(helper); + interopStatements.push(`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`); + }; + for (const { defaultVariableName, imports, importPath, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (isChunk) { + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + if (imported === '*' && reexported !== '*') { + if (!namedExportsMode) { + addInteropStatement(namespaceVariableName, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, name); + } + break; + } + } + } + else { + const moduleInterop = interop(importPath); + let hasDefault = false; + let hasNamespace = false; + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + let helper; + let variableName; + if (imported === 'default') { + if (!hasDefault) { + hasDefault = true; + if (defaultVariableName !== namespaceVariableName) { + variableName = defaultVariableName; + helper = defaultInteropHelpersByInteropType[moduleInterop]; + } + } + } + else if (imported === '*' && reexported !== '*' && !hasNamespace) { + hasNamespace = true; + helper = namespaceInteropHelpersByInteropType[moduleInterop]; + variableName = namespaceVariableName; + } + if (helper) { + addInteropStatement(variableName, helper, name); + } + } + } + } + return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, symbols)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; +} + +function addJsExtension(name) { + return name.endsWith('.js') ? name : name + '.js'; +} + +// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. +// The assumption is that this makes sense for all relative ids: +// https://requirejs.org/docs/api.html#jsfiles +function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) { + if (id[0] !== '.') { + return id; + } + return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id); +} + +const builtinModules = [ + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "http2", + "https", + "inspector", + "inspector/promises", + "module", + "net", + "os", + "path", + "path/posix", + "path/win32", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "readline/promises", + "repl", + "stream", + "stream/consumers", + "stream/promises", + "stream/web", + "string_decoder", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "wasi", + "worker_threads", + "zlib" +]; + +const nodeBuiltins = new Set(builtinModules); +function warnOnBuiltins(log, dependencies) { + const externalBuiltins = dependencies + .map(({ importPath }) => importPath) + .filter(importPath => nodeBuiltins.has(importPath) || importPath.startsWith('node:')); + if (externalBuiltins.length === 0) + return; + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingNodeBuiltins(externalBuiltins)); +} + +function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) { + warnOnBuiltins(log, dependencies); + const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const parameters = dependencies.map(m => m.name); + const { n, getNonArrowFunctionIntro, _ } = snippets; + if (namedExportsMode && hasExports) { + parameters.unshift(`exports`); + deps.unshift(`'exports'`); + } + if (accessedGlobals.has('require')) { + parameters.unshift('require'); + deps.unshift(`'require'`); + } + if (accessedGlobals.has('module')) { + parameters.unshift('module'); + deps.unshift(`'module'`); + } + const completeAmdId = getCompleteAmdId(amd, id); + const defineParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``); + const useStrict = strict ? `${_}'use strict';` : ''; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + .prepend(`${amd.define}(${defineParameters}(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${useStrict}${n}${n}`) + .append(`${n}${n}}));`); +} + +function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) { + const { _, n } = snippets; + const useStrict = strict ? `'use strict';${n}${n}` : ''; + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers += n + n; + } + const importBlock = getImportBlock$1(dependencies, snippets, compact); + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`); + magicString.append(`${exportBlock}${outro}`); +} +function getImportBlock$1(dependencies, { _, cnst, n }, compact) { + let importBlock = ''; + let definingVariable = false; + for (const { importPath, name, reexports, imports } of dependencies) { + if (!reexports && !imports) { + if (importBlock) { + importBlock += compact && !definingVariable ? ',' : `;${n}`; + } + definingVariable = false; + importBlock += `require('${importPath}')`; + } + else { + importBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `; + definingVariable = true; + importBlock += `${name}${_}=${_}require('${importPath}')`; + } + } + if (importBlock) { + return `${importBlock};${n}${n}`; + } + return ''; +} + +function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) { + const { n } = snippets; + const importBlock = getImportBlock(dependencies, importAttributesKey, snippets); + if (importBlock.length > 0) + intro += importBlock.join(n) + n + n; + intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols); + if (intro) + magicString.prepend(intro); + const exportBlock = getExportBlock(exports, snippets); + if (exportBlock.length > 0) + magicString.append(n + n + exportBlock.join(n).trim()); + if (outro) + magicString.append(outro); + magicString.trim(); +} +function getImportBlock(dependencies, importAttributesKey, { _ }) { + const importBlock = []; + for (const { importPath, reexports, imports, name, attributes } of dependencies) { + const assertion = attributes ? `${_}${importAttributesKey}${_}${attributes}` : ''; + const pathWithAssertion = `'${importPath}'${assertion};`; + if (!reexports && !imports) { + importBlock.push(`import${_}${pathWithAssertion}`); + continue; + } + if (imports) { + let defaultImport = null; + let starImport = null; + const importedNames = []; + for (const specifier of imports) { + if (specifier.imported === 'default') { + defaultImport = specifier; + } + else if (specifier.imported === '*') { + starImport = specifier; + } + else { + importedNames.push(specifier); + } + } + if (starImport) { + importBlock.push(`import${_}*${_}as ${starImport.local} from${_}${pathWithAssertion}`); + } + if (defaultImport && importedNames.length === 0) { + importBlock.push(`import ${defaultImport.local} from${_}${pathWithAssertion}`); + } + else if (importedNames.length > 0) { + importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames + .map(specifier => specifier.imported === specifier.local + ? specifier.imported + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${specifier.local}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + if (reexports) { + let starExport = null; + const namespaceReexports = []; + const namedReexports = []; + for (const specifier of reexports) { + if (specifier.reexported === '*') { + starExport = specifier; + } + else if (specifier.imported === '*') { + namespaceReexports.push(specifier); + } + else { + namedReexports.push(specifier); + } + } + if (starExport) { + importBlock.push(`export${_}*${_}from${_}${pathWithAssertion}`); + } + if (namespaceReexports.length > 0) { + if (!imports || + !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) { + importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`); + } + for (const specifier of namespaceReexports) { + importBlock.push(`export${_}{${_}${name === specifier.reexported + ? name + : `${name} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`} };`); + } + } + if (namedReexports.length > 0) { + importBlock.push(`export${_}{${_}${namedReexports + .map(specifier => specifier.imported === specifier.reexported + ? stringifyIdentifierIfNeeded(specifier.imported) + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + } + return importBlock; +} +function getExportBlock(exports, { _, cnst }) { + const exportBlock = []; + const exportDeclaration = new Array(exports.length); + let index = 0; + for (const specifier of exports) { + if (specifier.expression) { + exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`); + } + exportDeclaration[index++] = + specifier.exported === specifier.local + ? specifier.local + : `${specifier.local} as ${stringifyIdentifierIfNeeded(specifier.exported)}`; + } + if (exportDeclaration.length > 0) { + exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); + } + return exportBlock; +} + +const keypath = (keypath, getPropertyAccess) => keypath.split('.').map(getPropertyAccess).join(''); + +function setupNamespace(name, root, globals, { _, getPropertyAccess, s }, compact, log) { + const parts = name.split('.'); + // Check if the key exists in the object's prototype. + const isReserved = parts[0] in Object.prototype; + if (log && isReserved) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logReservedNamespace(parts[0])); + } + parts[0] = + (typeof globals === 'function' + ? globals(parts[0]) + : isReserved + ? parts[0] + : globals[parts[0]]) || parts[0]; + parts.pop(); + let propertyPath = root; + return (parts + .map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`; + }) + .join(compact ? ',' : '\n') + (compact && parts.length > 0 ? ';' : '\n')); +} +function assignToDeepVariable(deepName, root, globals, assignment, { _, getPropertyAccess }, log) { + const parts = deepName.split('.'); + // Check if the key exists in the object's prototype. + const isReserved = parts[0] in Object.prototype; + if (log && isReserved) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logReservedNamespace(parts[0])); + } + parts[0] = + (typeof globals === 'function' + ? globals(parts[0]) + : isReserved + ? parts[0] + : globals[parts[0]]) || parts[0]; + const last = parts.pop(); + let propertyPath = root; + let deepAssignment = [ + ...parts.map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`; + }), + `${propertyPath}${getPropertyAccess(last)}` + ].join(`,${_}`) + `${_}=${_}${assignment}`; + if (parts.length > 0) { + deepAssignment = `(${deepAssignment})`; + } + return deepAssignment; +} + +function trimEmptyImports(dependencies) { + let index = dependencies.length; + while (index--) { + const { imports, reexports } = dependencies[index]; + if (imports || reexports) { + return dependencies.slice(0, index + 1); + } + } + return []; +} + +function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) { + const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets; + const isNamespaced = name && name.includes('.'); + const useVariableAssignment = !extend && !isNamespaced; + if (name && useVariableAssignment && !isLegal(name)) { + return parseAst_js.error(parseAst_js.logIllegalIdentifierAsName(name)); + } + warnOnBuiltins(log, dependencies); + const external = trimEmptyImports(dependencies); + const deps = external.map(dep => dep.globalName || 'null'); + const parameters = external.map(m => m.name); + if (hasExports && !name) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingNameOptionForIifeExport()); + } + if (namedExportsMode && hasExports) { + if (extend) { + deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`); + parameters.unshift('exports'); + } + else { + deps.unshift('{}'); + parameters.unshift('exports'); + } + } + const useStrict = strict ? `${t}'use strict';${n}` : ''; + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${intro}${interopBlock}`); + let wrapperIntro = `(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${n}${useStrict}${n}`; + if (hasExports) { + if (name && !(extend && namedExportsMode)) { + wrapperIntro = + (useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) + + `${_}=${_}${wrapperIntro}`; + } + if (isNamespaced) { + wrapperIntro = setupNamespace(name, 'this', globals, snippets, compact, log) + wrapperIntro; + } + } + let wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`; + if (hasExports && !extend && namedExportsMode) { + wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; + } + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + .prepend(wrapperIntro) + .append(wrapperOutro); +} + +const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; + +function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) { + const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets; + const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets); + const registeredName = name ? `'${name}',${_}` : ''; + const wrapperParameters = accessedGlobals.has('module') + ? ['exports', 'module'] + : hasExports + ? ['exports'] + : []; + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + let wrapperStart = `System.register(${registeredName}[` + + dependencies.map(({ importPath }) => `'${importPath}'`).join(`,${_}`) + + `],${_}(${getNonArrowFunctionIntro(wrapperParameters, { + isAsync: false, + name: null + })}{${n}${t}${strict ? "'use strict';" : ''}` + + getStarExcludesBlock(starExcludes, t, snippets) + + getImportBindingsBlock(importBindings, t, snippets) + + `${n}${t}return${_}{${setters.length > 0 + ? `${n}${t}${t}setters:${_}[${setters + .map(setter => setter + ? `${getFunctionIntro(['module'], { + isAsync: false, + name: null + })}{${n}${t}${t}${t}${setter}${n}${t}${t}}` + : systemNullSetters + ? `null` + : `${getFunctionIntro([], { isAsync: false, name: null })}{}`) + .join(`,${_}`)}],` + : ''}${n}`; + wrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], { + isAsync: usesTopLevelAwait, + name: null + })}{${n}${n}`; + const wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`; + magicString + .prepend(intro + + getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) + + getHoistedExportsBlock(exports, t, snippets)) + .append(`${outro}${n}${n}` + + getSyntheticExportsBlock(exports, t, snippets) + + getMissingExportsBlock(exports, t, snippets)) + .indent(`${t}${t}${t}`) + .append(wrapperEnd) + .prepend(wrapperStart); +} +function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) { + const importBindings = []; + const setters = []; + let starExcludes = null; + for (const { imports, reexports } of dependencies) { + const setter = []; + if (imports) { + for (const specifier of imports) { + importBindings.push(specifier.local); + if (specifier.imported === '*') { + setter.push(`${specifier.local}${_}=${_}module;`); + } + else { + setter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`); + } + } + } + if (reexports) { + const reexportedNames = []; + let hasStarReexport = false; + for (const { imported, reexported } of reexports) { + if (reexported === '*') { + hasStarReexport = true; + } + else { + reexportedNames.push([ + reexported, + imported === '*' ? 'module' : `module${getPropertyAccess(imported)}` + ]); + } + } + if (reexportedNames.length > 1 || hasStarReexport) { + if (hasStarReexport) { + if (!starExcludes) { + starExcludes = getStarExcludes({ dependencies, exports }); + } + reexportedNames.unshift([null, `__proto__:${_}null`]); + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);'); + } + else { + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`exports(${exportMapping});`); + } + } + else { + const [key, value] = reexportedNames[0]; + setter.push(`exports(${JSON.stringify(key)},${_}${value});`); + } + } + setters.push(setter.join(`${n}${t}${t}${t}`)); + } + return { importBindings, setters, starExcludes }; +} +const getStarExcludes = ({ dependencies, exports }) => { + const starExcludes = new Set(exports.map(expt => expt.exported)); + starExcludes.add('default'); + for (const { reexports } of dependencies) { + if (reexports) { + for (const reexport of reexports) { + if (reexport.reexported !== '*') + starExcludes.add(reexport.reexported); + } + } + } + return starExcludes; +}; +const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => { + if (starExcludes) { + const fields = [...starExcludes].map(property => [ + property, + '1' + ]); + fields.unshift([null, `__proto__:${_}null`]); + return `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(fields, { + lineBreakIndent: { base: t, t } + })};`; + } + return ''; +}; +const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); +const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +function getExportsBlock(exports, t, { _, n }) { + if (exports.length === 0) { + return ''; + } + if (exports.length === 1) { + return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`; + } + return (`exports({${n}` + + exports + .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`) + .join(`,${n}`) + + `${n}});${n}${n}`); +} +const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.expression) + .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) + .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets); + +function globalProperty(name, globalVariable, getPropertyAccess) { + if (!name) + return 'null'; + return `${globalVariable}${keypath(name, getPropertyAccess)}`; +} +function safeAccess(name, globalVariable, { _, getPropertyAccess }) { + let propertyPath = globalVariable; + return name + .split('.') + .map(part => (propertyPath += getPropertyAccess(part))) + .join(`${_}&&${_}`); +} +function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) { + const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets; + const factoryVariable = compact ? 'f' : 'factory'; + const globalVariable = compact ? 'g' : 'global'; + if (hasExports && !name) { + return parseAst_js.error(parseAst_js.logMissingNameOptionForUmdExport()); + } + warnOnBuiltins(log, dependencies); + const amdDeps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const cjsDeps = dependencies.map(m => `require('${m.importPath}')`); + const trimmedImports = trimEmptyImports(dependencies); + const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess)); + const factoryParameters = trimmedImports.map(m => m.name); + if (namedExportsMode && (hasExports || noConflict)) { + amdDeps.unshift(`'exports'`); + cjsDeps.unshift(`exports`); + globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log)); + factoryParameters.unshift('exports'); + } + const completeAmdId = getCompleteAmdId(amd, id); + const amdParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (amdDeps.length > 0 ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); + const define = amd.define; + const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; + const useStrict = strict ? `${_}'use strict';${n}` : ``; + let iifeExport; + if (noConflict) { + const noConflictExportsVariable = compact ? 'e' : 'exports'; + let factory; + if (!namedExportsMode && hasExports) { + factory = `${cnst} ${noConflictExportsVariable}${_}=${_}${assignToDeepVariable(name, globalVariable, globals, `${factoryVariable}(${globalDeps.join(`,${_}`)})`, snippets, log)};`; + } + else { + const module = globalDeps.shift(); + factory = + `${cnst} ${noConflictExportsVariable}${_}=${_}${module};${n}` + + `${t}${t}${factoryVariable}(${[noConflictExportsVariable, ...globalDeps].join(`,${_}`)});`; + } + iifeExport = + `(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` + + `${t}${t}${cnst} current${_}=${_}${safeAccess(name, globalVariable, snippets)};${n}` + + `${t}${t}${factory}${n}` + + `${t}${t}${noConflictExportsVariable}.noConflict${_}=${_}${getFunctionIntro([], { + isAsync: false, + name: null + })}{${_}` + + `${globalProperty(name, globalVariable, getPropertyAccess)}${_}=${_}current;${_}return ${noConflictExportsVariable}${s}${_}};${n}` + + `${t}})()`; + } + else { + iifeExport = `${factoryVariable}(${globalDeps.join(`,${_}`)})`; + if (!namedExportsMode && hasExports) { + iifeExport = assignToDeepVariable(name, globalVariable, globals, iifeExport, snippets, log); + } + } + const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0; + const wrapperParameters = [factoryVariable]; + if (iifeNeedsGlobal) { + wrapperParameters.unshift(globalVariable); + } + const globalArgument = iifeNeedsGlobal ? `this,${_}` : ''; + const iifeStart = iifeNeedsGlobal + ? `(${globalVariable}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVariable}${_}||${_}self,${_}` + : ''; + const iifeEnd = iifeNeedsGlobal ? ')' : ''; + const cjsIntro = iifeNeedsGlobal + ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + + `${_}${cjsExport}${factoryVariable}(${cjsDeps.join(`,${_}`)})${_}:${n}` + : ''; + const wrapperIntro = `(${getNonArrowFunctionIntro(wrapperParameters, { isAsync: false, name: null })}{${n}` + + cjsIntro + + `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParameters}${factoryVariable})${_}:${n}` + + `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + `})(${globalArgument}(${getNonArrowFunctionIntro(factoryParameters, { + isAsync: false, + name: null + })}{${useStrict}${n}`; + const wrapperOutro = n + n + '}));'; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .trim() + .indent(t) + .append(wrapperOutro) + .prepend(wrapperIntro); +} + +const finalisers = { amd, cjs, es, iife, system, umd }; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var utils = {}; + +var constants; +var hasRequiredConstants; + +function requireConstants () { + if (hasRequiredConstants) return constants; + hasRequiredConstants = 1; + + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + + /** + * Posix glob regex + */ + + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + const SEP = '/'; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP + }; + + /** + * Windows glob regex + */ + + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' + }; + + /** + * POSIX Bracket Regex + */ + + const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; + + constants = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } + }; + return constants; +} + +/*global navigator*/ + +var hasRequiredUtils; + +function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + (function (exports) { + + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = /*@__PURE__*/ requireConstants(); + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; + }; + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + + exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; + }; + } (utils)); + return utils; +} + +var scan_1; +var hasRequiredScan; + +function requireScan () { + if (hasRequiredScan) return scan_1; + hasRequiredScan = 1; + + const utils = /*@__PURE__*/ requireUtils(); + const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ + } = /*@__PURE__*/ requireConstants(); + + const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + }; + + const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } + }; + + /** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + + const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; + }; + + scan_1 = scan; + return scan_1; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + const constants = /*@__PURE__*/ requireConstants(); + const utils = /*@__PURE__*/ requireUtils(); + + /** + * Constants + */ + + const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS + } = constants; + + /** + * Helpers + */ + + const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; + }; + + /** + * Create the message for a syntax error + */ + + const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; + }; + + /** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + + const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(opts.windows); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; + }; + + /** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + + parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; + }; + + parse_1 = parse; + return parse_1; +} + +var picomatch_1$1; +var hasRequiredPicomatch$1; + +function requirePicomatch$1 () { + if (hasRequiredPicomatch$1) return picomatch_1$1; + hasRequiredPicomatch$1 = 1; + + const scan = /*@__PURE__*/ requireScan(); + const parse = /*@__PURE__*/ requireParse(); + const utils = /*@__PURE__*/ requireUtils(); + const constants = /*@__PURE__*/ requireConstants(); + const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + + /** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + + const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; + }; + + /** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + + picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; + }; + + /** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + + picomatch.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(utils.basename(input)); + }; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + + picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + + /** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + + picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); + }; + + /** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + + picomatch.scan = (input, options) => scan(input, options); + + /** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + + picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch.constants = constants; + + /** + * Expose "picomatch" + */ + + picomatch_1$1 = picomatch; + return picomatch_1$1; +} + +var picomatch_1; +var hasRequiredPicomatch; + +function requirePicomatch () { + if (hasRequiredPicomatch) return picomatch_1; + hasRequiredPicomatch = 1; + + const pico = /*@__PURE__*/ requirePicomatch$1(); + const utils = /*@__PURE__*/ requireUtils(); + + function picomatch(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils.isWindows() }; + } + + return pico(glob, options, returnState); + } + + Object.assign(picomatch, pico); + picomatch_1 = picomatch; + return picomatch_1; +} + +var picomatchExports = /*@__PURE__*/ requirePicomatch(); +const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePathRegExp = new RegExp(`\\${require$$0.win32.sep}`, 'g'); +const normalizePath = function normalizePath(filename) { + return filename.replace(normalizePathRegExp, require$$0.posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || require$$0.isAbsolute(id) || id.startsWith('**')) { + return normalizePath(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath(require$$0.resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return require$$0.posix.join(basePath, normalizePath(id)); +} +const createFilter = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + if (!includeMatchers.length && !excludeMatchers.length) + return (id) => typeof id === 'string' && !id.includes('\0'); + return function result(id) { + if (typeof id !== 'string') + return false; + if (id.includes('\0')) + return false; + const pathId = normalizePath(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); + +class ArrayPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const element of this.elements) { + element?.addExportedVariables(variables, exportNamesByVariable); + } + } + declare(kind) { + const variables = []; + for (const element of this.elements) { + if (element !== null) { + variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); + } + } + return variables; + } + // Patterns can only be deoptimized at the empty path at the moment + deoptimizePath() { + for (const element of this.elements) { + element?.deoptimizePath(EMPTY_PATH); + } + } + // Patterns are only checked at the empty path at the moment + hasEffectsOnInteractionAtPath(_path, interaction, context) { + for (const element of this.elements) { + if (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const element of this.elements) { + element?.markDeclarationReached(); + } + } +} + +class ArrowFunctionExpression extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + get expression() { + return isFlagSet(this.flags, 8388608 /* Flag.expression */); + } + set expression(value) { + this.flags = setFlag(this.flags, 8388608 /* Flag.expression */, value); + } + createScope(parentScope) { + this.scope = new ReturnValueScope(parentScope, false); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { + return true; + } + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const { ignore, brokenFlow } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: false + }; + if (this.body.hasEffects(context)) + return true; + context.ignore = ignore; + context.brokenFlow = brokenFlow; + } + return false; + } + onlyFunctionCallUsed() { + const isIIFE = this.parent.type === parseAst_js.CallExpression && + this.parent.callee === this; + return isIIFE || super.onlyFunctionCallUsed(); + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + for (const parameter of this.params) { + if (!(parameter instanceof Identifier)) { + parameter.include(context, includeChildrenRecursively); + } + } + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE)); + } +} + +class ObjectPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const property of this.properties) { + if (property.type === parseAst_js.Property) { + property.value.addExportedVariables(variables, exportNamesByVariable); + } + else { + property.argument.addExportedVariables(variables, exportNamesByVariable); + } + } + } + declare(kind, init) { + const variables = []; + for (const property of this.properties) { + variables.push(...property.declare(kind, init)); + } + return variables; + } + deoptimizePath(path) { + if (path.length === 0) { + for (const property of this.properties) { + property.deoptimizePath(path); + } + } + } + hasEffectsOnInteractionAtPath( + // At the moment, this is only triggered for assignment left-hand sides, + // where the path is empty + _path, interaction, context) { + for (const property of this.properties) { + if (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const property of this.properties) { + property.markDeclarationReached(); + } + } +} + +class AssignmentExpression extends NodeBase { + hasEffects(context) { + const { deoptimized, left, operator, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + // MemberExpressions do not access the property before assignments if the + // operator is '='. + return (right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, operator !== '=')); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.right.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + const { deoptimized, left, right, operator } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + if (includeChildrenRecursively || + operator !== '=' || + left.included || + left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)) { + left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); + } + right.include(context, includeChildrenRecursively); + } + initialise() { + super.initialise(); + if (this.left instanceof Identifier) { + const variable = this.scope.variables.get(this.left.name); + if (variable?.kind === 'const') { + this.scope.context.error(parseAst_js.logConstVariableReassignError(), this.left.start); + } + } + this.left.setAssignedValue(this.right); + } + render(code, options, { preventASI, renderedParentType, renderedSurroundingElement } = parseAst_js.BLANK) { + const { left, right, start, end, parent } = this; + if (left.included) { + left.render(code, options); + right.render(code, options); + } + else { + const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1); + code.remove(start, inclusionStart); + if (preventASI) { + removeLineBreaks(code, inclusionStart, right.start); + } + right.render(code, options, { + renderedParentType: renderedParentType || parent.type, + renderedSurroundingElement: renderedSurroundingElement || parent.type + }); + } + if (options.format === 'system') { + if (left instanceof Identifier) { + const variable = left.variable; + const exportNames = options.exportNamesByVariable.get(variable); + if (exportNames) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, start, end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, start, end, parent.type !== parseAst_js.ExpressionStatement, code, options); + } + return; + } + } + else { + const systemPatternExports = []; + left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); + if (systemPatternExports.length > 0) { + renderSystemExportFunction(systemPatternExports, start, end, renderedSurroundingElement === parseAst_js.ExpressionStatement, code, options); + return; + } + } + } + if (left.included && + left instanceof ObjectPattern && + (renderedSurroundingElement === parseAst_js.ExpressionStatement || + renderedSurroundingElement === parseAst_js.ArrowFunctionExpression)) { + code.appendRight(start, '('); + code.prependLeft(end, ')'); + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class AssignmentPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + this.left.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + return this.left.declare(kind, init); + } + deoptimizePath(path) { + if (path.length === 0) { + this.left.deoptimizePath(path); + } + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.left.markDeclarationReached(); + } + render(code, options, { isShorthandProperty } = parseAst_js.BLANK) { + this.left.render(code, options, { isShorthandProperty }); + this.right.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class AwaitExpression extends NodeBase { + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { + let parent = this.parent; + do { + if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) + break checkTopLevelAwait; + } while ((parent = parent.parent)); + this.scope.context.usesTopLevelAwait = true; + } + } + this.argument.include(context, includeChildrenRecursively); + } +} + +const binaryOperators = { + '!=': (left, right) => left != right, + '!==': (left, right) => left !== right, + '%': (left, right) => left % right, + '&': (left, right) => left & right, + '*': (left, right) => left * right, + // At the moment, "**" will be transpiled to Math.pow + '**': (left, right) => left ** right, + '+': (left, right) => left + right, + '-': (left, right) => left - right, + '/': (left, right) => left / right, + '<': (left, right) => left < right, + '<<': (left, right) => left << right, + '<=': (left, right) => left <= right, + '==': (left, right) => left == right, + '===': (left, right) => left === right, + '>': (left, right) => left > right, + '>=': (left, right) => left >= right, + '>>': (left, right) => left >> right, + '>>>': (left, right) => left >>> right, + '^': (left, right) => left ^ right, + '|': (left, right) => left | right + // We use the fallback for cases where we return something unknown + // in: () => UnknownValue, + // instanceof: () => UnknownValue, +}; +class BinaryExpression extends NodeBase { + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof leftValue === 'symbol') + return UnknownValue; + const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof rightValue === 'symbol') + return UnknownValue; + const operatorFunction = binaryOperators[this.operator]; + if (!operatorFunction) + return UnknownValue; + return operatorFunction(leftValue, rightValue); + } + hasEffects(context) { + // support some implicit type coercion runtime errors + if (this.operator === '+' && + this.parent instanceof ExpressionStatement && + this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '') { + return true; + } + return super.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { renderedSurroundingElement } = parseAst_js.BLANK) { + this.left.render(code, options, { renderedSurroundingElement }); + this.right.render(code, options); + } +} + +class BreakStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.breaks) + return true; + context.hasBreak = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasBreak = true; + } + context.brokenFlow = true; + } +} + +function renderCallArguments(code, options, node) { + if (node.arguments.length > 0) { + if (node.arguments[node.arguments.length - 1].included) { + for (const argument of node.arguments) { + argument.render(code, options); + } + } + else { + let lastIncludedIndex = node.arguments.length - 2; + while (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) { + lastIncludedIndex--; + } + if (lastIncludedIndex >= 0) { + for (let index = 0; index <= lastIncludedIndex; index++) { + node.arguments[index].render(code, options); + } + code.remove(findFirstOccurrenceOutsideComment(code.original, ',', node.arguments[lastIncludedIndex].end), node.end - 1); + } + else { + code.remove(findFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1, node.end - 1); + } + } + } +} + +class CallExpressionBase extends NodeBase { + constructor() { + super(...arguments); + this.returnExpression = null; + this.deoptimizableDependentExpressions = []; + this.expressionsToBeDeoptimized = new Set(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const { args } = interaction; + const [returnExpression, isPure] = this.getReturnExpression(recursionTracker); + if (isPure) + return; + const deoptimizedExpressions = args.filter(expression => !!expression && expression !== UNKNOWN_EXPRESSION); + if (deoptimizedExpressions.length === 0) + return; + if (returnExpression === UNKNOWN_EXPRESSION) { + for (const expression of deoptimizedExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + else { + recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + for (const expression of deoptimizedExpressions) { + this.expressionsToBeDeoptimized.add(expression); + } + returnExpression.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + }, null); + } + } + deoptimizeCache() { + if (this.returnExpression?.[0] !== UNKNOWN_EXPRESSION) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + const { deoptimizableDependentExpressions, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = parseAst_js.EMPTY_SET; + this.deoptimizableDependentExpressions = parseAst_js.EMPTY_ARRAY; + for (const expression of deoptimizableDependentExpressions) { + expression.deoptimizeCache(); + } + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } + deoptimizePath(path) { + if (path.length === 0 || + this.scope.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + const [returnExpression] = this.getReturnExpression(); + if (returnExpression !== UNKNOWN_EXPRESSION) { + returnExpression.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const [returnExpression] = this.getReturnExpression(recursionTracker); + if (returnExpression === UNKNOWN_EXPRESSION) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + return returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const returnExpression = this.getReturnExpression(recursionTracker); + if (returnExpression[0] === UNKNOWN_EXPRESSION) { + return returnExpression; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + const [expression, isPure] = returnExpression[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || returnExpression[1]]; + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (type === INTERACTION_CALLED) { + const { args, withNew } = interaction; + if ((withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, args, this)) { + return false; + } + } + else if ((type === INTERACTION_ASSIGNED + ? context.assigned + : context.accessed).trackEntityAtPathAndGetIfTracked(path, this)) { + return false; + } + const [returnExpression, isPure] = this.getReturnExpression(); + return ((type === INTERACTION_ASSIGNED || !isPure) && + returnExpression.hasEffectsOnInteractionAtPath(path, interaction, context)); + } +} + +class CallExpression extends CallExpressionBase { + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + bind() { + super.bind(); + if (this.callee instanceof Identifier) { + const variable = this.scope.findVariable(this.callee.name); + if (variable.isNamespace) { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logCannotCallNamespace(this.callee.name), this.start); + } + if (this.callee.name === 'eval') { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logEval(this.scope.context.module.id), this.start); + } + } + this.interaction = { + args: [ + this.callee instanceof MemberExpression && !this.callee.variable + ? this.callee.object + : null, + ...this.arguments + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + getLiteralValueAtPathAsChainElement(path, recursionTracker, origin) { + return getChainElementLiteralValueAtPath(this, this.callee, path, recursionTracker, origin); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + hasEffectsAsChainElement(context) { + const calleeHasEffects = 'hasEffectsAsChainElement' in this.callee + ? this.callee.hasEffectsAsChainElement(context) + : this.callee.hasEffects(context); + if (calleeHasEffects === IS_SKIPPED_CHAIN) + return IS_SKIPPED_CHAIN; + if (this.optional && + this.callee.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) == null) { + return (!this.annotationPure && calleeHasEffects) || IS_SKIPPED_CHAIN; + } + // We only apply deoptimizations lazily once we know we are not skipping + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + return (!this.annotationPure && + (calleeHasEffects || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context))); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively === INCLUDE_PARAMETERS && + this.callee instanceof Identifier && + this.callee.variable) { + this.callee.variable.markCalledFromTryStatement(); + } + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + initialise() { + super.initialise(); + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationPure = this.annotations.some(comment => comment.type === 'pure'); + } + } + render(code, options, { renderedSurroundingElement } = parseAst_js.BLANK) { + this.callee.render(code, options, { + isCalleeOfRenderedParent: true, + renderedSurroundingElement + }); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class CatchClause extends NodeBase { + createScope(parentScope) { + this.scope = new ParameterScope(parentScope, true); + } + parseNode(esTreeNode) { + const { body, param, type } = esTreeNode; + this.type = type; + if (param) { + this.param = new (this.scope.context.getNodeConstructor(param.type))(this, this.scope).parseNode(param); + this.param.declare('parameter', UNKNOWN_EXPRESSION); + } + this.body = new BlockStatement(this, this.scope.bodyScope).parseNode(body); + return super.parseNode(esTreeNode); + } +} +CatchClause.prototype.preventChildBlockScope = true; + +class ChainExpression extends NodeBase { + // deoptimizations are not relevant as we are not caching values + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + const literalValue = this.expression.getLiteralValueAtPathAsChainElement(path, recursionTracker, origin); + return literalValue === IS_SKIPPED_CHAIN ? undefined : literalValue; + } + hasEffects(context) { + return this.expression.hasEffectsAsChainElement(context) === true; + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } + applyDeoptimizations() { } +} + +class ClassBodyScope extends ChildScope { + constructor(parent, classNode) { + const { context } = parent; + super(parent, context); + this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context, 'other'))); + this.instanceScope = new ChildScope(this, context); + this.instanceScope.variables.set('this', new ThisVariable(context)); + } + findLexicalBoundary() { + return this; + } +} + +class ClassBody extends NodeBase { + createScope(parentScope) { + this.scope = new ClassBodyScope(parentScope, this.parent); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.scope.context.includeVariableInModule(this.scope.thisVariable); + for (const definition of this.body) { + definition.include(context, includeChildrenRecursively); + } + } + parseNode(esTreeNode) { + const body = (this.body = new Array(esTreeNode.body.length)); + let index = 0; + for (const definition of esTreeNode.body) { + body[index++] = new (this.scope.context.getNodeConstructor(definition.type))(this, definition.static ? this.scope : this.scope.instanceScope).parseNode(definition); + } + return super.parseNode(esTreeNode); + } + applyDeoptimizations() { } +} + +class ClassExpression extends ClassNode { + render(code, options, { renderedSurroundingElement } = parseAst_js.BLANK) { + super.render(code, options); + if (renderedSurroundingElement === parseAst_js.ExpressionStatement) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class MultiExpression extends ExpressionEntity { + constructor(expressions) { + super(); + this.expressions = expressions; + } + deoptimizePath(path) { + for (const expression of this.expressions) { + expression.deoptimizePath(path); + } + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return [ + new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0])), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + for (const expression of this.expressions) { + if (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + } + return false; + } +} + +class ConditionalExpression extends NodeBase { + constructor() { + super(...arguments); + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.consequent.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.alternate.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch !== null) { + const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = parseAst_js.EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.consequent.deoptimizePath(path); + this.alternate.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.consequent.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.alternate.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return this.consequent.hasEffects(context) || this.alternate.hasEffects(context); + } + return usedBranch.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.includeCallArguments(context, parameters); + } + else { + this.consequent.includeCallArguments(context, parameters); + this.alternate.includeCallArguments(context, parameters); + } + } + removeAnnotations(code) { + this.test.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = parseAst_js.BLANK) { + const usedBranch = this.getUsedBranch(); + if (this.test.included) { + this.test.render(code, options, { renderedSurroundingElement }); + this.consequent.render(code, options); + this.alternate.render(code, options); + } + else { + const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); + const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included + ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end) + : colonPos) + 1); + if (preventASI) { + removeLineBreaks(code, inclusionStart, usedBranch.start); + } + code.remove(this.start, inclusionStart); + if (this.consequent.included) { + code.remove(colonPos, this.end); + } + this.test.removeAnnotations(code); + usedBranch.render(code, options, { + isCalleeOfRenderedParent, + preventASI: true, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + } + getUsedBranch() { + if (this.isBranchResolutionAnalysed) { + return this.usedBranch; + } + this.isBranchResolutionAnalysed = true; + const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return typeof testValue === 'symbol' + ? null + : (this.usedBranch = testValue ? this.consequent : this.alternate); + } +} + +class ContinueStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.continues) + return true; + context.hasContinue = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasContinue = true; + } + context.brokenFlow = true; + } +} + +class DebuggerStatement extends NodeBase { + hasEffects() { + return true; + } +} + +class Decorator extends NodeBase { + hasEffects(context) { + return (this.expression.hasEffects(context) || + this.expression.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)); + } +} + +function hasLoopBodyEffects(context, body) { + const { brokenFlow, hasBreak, hasContinue, ignore } = context; + const { breaks, continues } = ignore; + ignore.breaks = true; + ignore.continues = true; + context.hasBreak = false; + context.hasContinue = false; + if (body.hasEffects(context)) + return true; + ignore.breaks = breaks; + ignore.continues = continues; + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; + return false; +} +function includeLoopBody(context, body, includeChildrenRecursively) { + const { brokenFlow, hasBreak, hasContinue } = context; + context.hasBreak = false; + context.hasContinue = false; + body.include(context, includeChildrenRecursively, { asSingleStatement: true }); + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; +} + +class DoWhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class EmptyStatement extends NodeBase { + hasEffects() { + return false; + } +} + +class ExportAllDeclaration extends NodeBase { + hasEffects() { + return false; + } + initialise() { + super.initialise(); + this.scope.context.addExport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ExportAllDeclaration.prototype.needsBoundaries = true; + +class ExportNamedDeclaration extends NodeBase { + bind() { + // Do not bind specifiers + this.declaration?.bind(); + } + hasEffects(context) { + return !!this.declaration?.hasEffects(context); + } + initialise() { + super.initialise(); + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration?.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + if (this.declaration === null) { + code.remove(start, end); + } + else { + code.remove(this.start, this.declaration.start); + this.declaration.render(code, options, { end, start }); + } + } + applyDeoptimizations() { } +} +ExportNamedDeclaration.prototype.needsBoundaries = true; + +class ExportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ForInStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + if (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, body); + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "in" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForOfStatement extends NodeBase { + get await() { + return isFlagSet(this.flags, 131072 /* Flag.await */); + } + set await(value) { + this.flags = setFlag(this.flags, 131072 /* Flag.await */, value); + } + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + // Placeholder until proper Symbol.Iterator support + return true; + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "of" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.init?.hasEffects(context) || + this.test?.hasEffects(context) || + this.update?.hasEffects(context)) { + return true; + } + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.init?.include(context, includeChildrenRecursively, { asSingleStatement: true }); + this.test?.include(context, includeChildrenRecursively); + this.update?.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } + render(code, options) { + this.init?.render(code, options, NO_SEMICOLON); + this.test?.render(code, options, NO_SEMICOLON); + this.update?.render(code, options, NO_SEMICOLON); + this.body.render(code, options); + } +} + +class FunctionExpression extends FunctionNode { + createScope(parentScope) { + super.createScope((this.idScope = new ChildScope(parentScope, parentScope.context))); + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(this, this.idScope).parseNode(esTreeNode.id); + } + return super.parseNode(esTreeNode); + } + onlyFunctionCallUsed() { + const isIIFE = this.parent.type === parseAst_js.CallExpression && + this.parent.callee === this && + (this.id === null || this.id.variable.getOnlyFunctionCallUsed()); + return isIIFE || super.onlyFunctionCallUsed(); + } + render(code, options, { renderedSurroundingElement } = parseAst_js.BLANK) { + super.render(code, options); + if (renderedSurroundingElement === parseAst_js.ExpressionStatement) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class TrackingScope extends BlockScope { + constructor() { + super(...arguments); + this.hoistedDeclarations = []; + } + addDeclaration(identifier, context, init, kind) { + this.hoistedDeclarations.push(identifier); + return super.addDeclaration(identifier, context, init, kind); + } +} + +const unset = Symbol('unset'); +class IfStatement extends NodeBase { + constructor() { + super(...arguments); + this.testValue = unset; + } + deoptimizeCache() { + this.testValue = UnknownValue; + } + hasEffects(context) { + if (this.test.hasEffects(context)) { + return true; + } + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + const { brokenFlow } = context; + if (this.consequent.hasEffects(context)) + return true; + const consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + if (this.alternate === null) + return false; + if (this.alternate.hasEffects(context)) + return true; + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + return false; + } + return testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context); + } + include(context, includeChildrenRecursively) { + this.included = true; + if (includeChildrenRecursively) { + this.includeRecursively(includeChildrenRecursively, context); + } + else { + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + this.includeUnknownTest(context); + } + else { + this.includeKnownTest(context, testValue); + } + } + } + parseNode(esTreeNode) { + this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))(this, (this.consequentScope = new TrackingScope(this.scope))).parseNode(esTreeNode.consequent); + if (esTreeNode.alternate) { + this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))(this, (this.alternateScope = new TrackingScope(this.scope))).parseNode(esTreeNode.alternate); + } + return super.parseNode(esTreeNode); + } + render(code, options) { + const { snippets: { getPropertyAccess } } = options; + // Note that unknown test values are always included + const testValue = this.getTestValue(); + const hoistedDeclarations = []; + const includesIfElse = this.test.included; + const noTreeshake = !this.scope.context.options.treeshake; + if (includesIfElse) { + this.test.render(code, options); + } + else { + code.remove(this.start, this.consequent.start); + } + if (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) { + this.consequent.render(code, options); + } + else { + code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : ''); + hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations); + } + if (this.alternate) { + if (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) { + if (includesIfElse) { + if (code.original.charCodeAt(this.alternate.start - 1) === 101) { + code.prependLeft(this.alternate.start, ' '); + } + } + else { + code.remove(this.consequent.end, this.alternate.start); + } + this.alternate.render(code, options); + } + else { + if (includesIfElse && this.shouldKeepAlternateBranch()) { + code.overwrite(this.alternate.start, this.end, ';'); + } + else { + code.remove(this.consequent.end, this.end); + } + hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations); + } + } + this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); + } + applyDeoptimizations() { } + getTestValue() { + if (this.testValue === unset) { + return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this)); + } + return this.testValue; + } + includeKnownTest(context, testValue) { + if (this.test.shouldBeIncluded(context)) { + this.test.include(context, false); + } + if (testValue && this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + } + if (!testValue && this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + } + } + includeRecursively(includeChildrenRecursively, context) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate?.include(context, includeChildrenRecursively); + } + includeUnknownTest(context) { + this.test.include(context, false); + const { brokenFlow } = context; + let consequentBrokenFlow = false; + if (this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + } + if (this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + } + } + renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess) { + const hoistedVariables = [ + ...new Set(hoistedDeclarations.map(identifier => { + const variable = identifier.variable; + return variable.included ? variable.getName(getPropertyAccess) : ''; + })) + ] + .filter(Boolean) + .join(', '); + if (hoistedVariables) { + const parentType = this.parent.type; + const needsBraces = parentType !== parseAst_js.Program && parentType !== parseAst_js.BlockStatement; + code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVariables}; `); + if (needsBraces) { + code.appendLeft(this.end, ` }`); + } + } + } + shouldKeepAlternateBranch() { + let currentParent = this.parent; + do { + if (currentParent instanceof IfStatement && currentParent.alternate) { + return true; + } + if (currentParent instanceof BlockStatement) { + return false; + } + currentParent = currentParent.parent; + } while (currentParent); + return false; + } +} + +class ImportAttribute extends NodeBase { +} + +class ImportDeclaration extends NodeBase { + // Do not bind specifiers or attributes + bind() { } + hasEffects() { + return false; + } + initialise() { + super.initialise(); + this.scope.context.addImport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ImportDeclaration.prototype.needsBoundaries = true; + +class ImportDefaultSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +function isReassignedExportsMember(variable, exportNamesByVariable) { + return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned); +} + +class VariableDeclarator extends NodeBase { + declareDeclarator(kind, isUsingDeclaration) { + this.isUsingDeclaration = isUsingDeclaration; + this.id.declare(kind, this.init || UNDEFINED_EXPRESSION); + } + deoptimizePath(path) { + this.id.deoptimizePath(path); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.init?.hasEffects(context); + this.id.markDeclarationReached(); + return initEffect || this.id.hasEffects(context) || this.isUsingDeclaration; + } + include(context, includeChildrenRecursively) { + const { deoptimized, id, init } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + init?.include(context, includeChildrenRecursively); + id.markDeclarationReached(); + if (includeChildrenRecursively || id.shouldBeIncluded(context)) { + id.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.init?.removeAnnotations(code); + } + render(code, options) { + const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options; + const { end, id, init, start } = this; + const renderId = id.included || this.isUsingDeclaration; + if (renderId) { + id.render(code, options); + } + else { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end); + code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1)); + } + if (init) { + if (id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const renderedVariable = id.variable.getName(getPropertyAccess); + if (renderedVariable !== id.name) { + code.appendLeft(init.start + 5, ` ${id.name}`); + } + } + init.render(code, options, renderId ? parseAst_js.BLANK : { renderedSurroundingElement: parseAst_js.ExpressionStatement }); + } + else if (id instanceof Identifier && + isReassignedExportsMember(id.variable, exportNamesByVariable)) { + code.appendLeft(end, `${_}=${_}void 0`); + } + } + applyDeoptimizations() { + this.deoptimized = true; + const { id, init } = this; + if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const { name, variable } = id; + for (const accessedVariable of init.scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ImportExpression extends NodeBase { + constructor() { + super(...arguments); + this.inlineNamespace = null; + this.attributes = null; + this.mechanism = null; + this.namespaceExportName = undefined; + this.resolution = null; + this.resolutionString = null; + } + // Do not bind attributes + bind() { + this.source.bind(); + } + /** + * Get imported variables for deterministic usage, valid cases are: + * + * - `const { foo } = await import('bar')`. + * - `(await import('bar')).foo` + * - `import('bar').then(({ foo }) => {})` + * + * Returns empty array if it's side-effect only import. + * Returns undefined if it's not fully deterministic. + */ + getDeterministicImportedNames() { + const parent1 = this.parent; + // Side-effect only: import('bar') + if (parent1 instanceof ExpressionStatement) { + return parseAst_js.EMPTY_ARRAY; + } + if (parent1 instanceof AwaitExpression) { + const parent2 = parent1.parent; + // Side-effect only: await import('bar') + if (parent2 instanceof ExpressionStatement) { + return parseAst_js.EMPTY_ARRAY; + } + // Case 1: const { foo } = await import('bar') + if (parent2 instanceof VariableDeclarator) { + const declaration = parent2.id; + return declaration instanceof ObjectPattern + ? getDeterministicObjectDestructure(declaration) + : undefined; + } + // Case 2: (await import('bar')).foo + if (parent2 instanceof MemberExpression) { + const id = parent2.property; + if (!parent2.computed && id instanceof Identifier) { + return [id.name]; + } + } + return; + } + // Case 3: import('bar').then(({ foo }) => {}) + if (parent1 instanceof MemberExpression) { + const callExpression = parent1.parent; + const property = parent1.property; + if (!(callExpression instanceof CallExpression) || !(property instanceof Identifier)) { + return; + } + const memberName = property.name; + // side-effect only, when only chaining .catch or .finally + if (callExpression.parent instanceof ExpressionStatement && + ['catch', 'finally'].includes(memberName)) { + return parseAst_js.EMPTY_ARRAY; + } + if (memberName !== 'then') + return; + // Side-effect only: import('bar').then() + if (callExpression.arguments.length === 0) { + return parseAst_js.EMPTY_ARRAY; + } + const argument = callExpression.arguments[0]; + if (callExpression.arguments.length !== 1 || + !(argument instanceof ArrowFunctionExpression || argument instanceof FunctionExpression)) { + return; + } + // Side-effect only: import('bar').then(() => {}) + if (argument.params.length === 0) { + return parseAst_js.EMPTY_ARRAY; + } + const declaration = argument.params[0]; + if (argument.params.length === 1 && declaration instanceof ObjectPattern) { + return getDeterministicObjectDestructure(declaration); + } + return; + } + } + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + this.scope.context.includeDynamicImport(this); + this.scope.addAccessedDynamicImport(this); + } + this.source.include(context, includeChildrenRecursively); + } + initialise() { + super.initialise(); + this.scope.context.addDynamicImport(this); + } + parseNode(esTreeNode) { + this.sourceAstNode = esTreeNode.source; + return super.parseNode(esTreeNode); + } + render(code, options) { + const { snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess } } = options; + if (this.inlineNamespace) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.overwrite(this.start, this.end, `Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`); + return; + } + if (this.mechanism) { + code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left); + code.overwrite(this.end - 1, this.end, this.mechanism.right); + } + if (this.resolutionString) { + code.overwrite(this.source.start, this.source.end, this.resolutionString); + if (this.namespaceExportName) { + const [left, right] = getDirectReturnFunction(['n'], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.prependLeft(this.end, `.then(${left}n.${this.namespaceExportName}${right})`); + } + } + else { + this.source.render(code, options); + } + if (this.attributes !== true) { + if (this.options) { + code.overwrite(this.source.end, this.end - 1, '', { contentOnly: true }); + } + if (this.attributes) { + code.appendLeft(this.end - 1, `,${_}${getObject([['assert', this.attributes]], { + lineBreakIndent: null + })}`); + } + } + } + setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) { + const { format } = options; + this.inlineNamespace = null; + this.resolution = resolution; + this.resolutionString = resolutionString; + this.namespaceExportName = namespaceExportName; + this.attributes = attributes; + const accessedGlobals = [...(accessedImportGlobals[format] || [])]; + let helper; + ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver)); + if (helper) { + accessedGlobals.push(helper); + } + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } + setInternalResolution(inlineNamespace) { + this.inlineNamespace = inlineNamespace; + } + applyDeoptimizations() { } + getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) { + const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [ + { + customResolution: typeof this.resolution === 'string' ? this.resolution : null, + format, + moduleId: this.scope.context.module.id, + targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null + } + ]); + if (mechanism) { + return { helper: null, mechanism }; + } + const hasDynamicTarget = !this.resolution || typeof this.resolution === 'string'; + switch (format) { + case 'cjs': { + if (dynamicImportInCjs && + (!resolution || typeof resolution === 'string' || resolution instanceof ExternalModule)) { + return { helper: null, mechanism: null }; + } + const helper = getInteropHelper(resolution, exportMode, interop); + let left = `require(`; + let right = `)`; + if (helper) { + left = `/*#__PURE__*/${helper}(${left}`; + right += ')'; + } + const [functionLeft, functionRight] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + left = `Promise.resolve().then(${functionLeft}${left}`; + right += `${functionRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'amd': { + const resolve = compact ? 'c' : 'resolve'; + const reject = compact ? 'e' : 'reject'; + const helper = getInteropHelper(resolution, exportMode, interop); + const [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + const resolveNamespace = helper + ? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}` + : resolve; + const [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + let left = `new Promise(${handlerLeft}require([`; + let right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'system': { + return { + helper: null, + mechanism: { + left: 'module.import(', + right: ')' + } + }; + } + } + return { helper: null, mechanism: null }; + } +} +function getInteropHelper(resolution, exportMode, interop) { + return exportMode === 'external' + ? namespaceInteropHelpersByInteropType[interop(resolution instanceof ExternalModule ? resolution.id : null)] + : exportMode === 'default' + ? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + : null; +} +const accessedImportGlobals = { + amd: ['require'], + cjs: ['require'], + system: ['module'] +}; +function getDeterministicObjectDestructure(objectPattern) { + const variables = []; + for (const property of objectPattern.properties) { + if (property.type === 'RestElement' || property.computed || property.key.type !== 'Identifier') + return; + variables.push(property.key.name); + } + return variables; +} + +class ImportNamespaceSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ImportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class JSXIdentifier extends IdentifierBase { + constructor() { + super(...arguments); + this.isNativeElement = false; + } + bind() { + const type = this.getType(); + if (type === 0 /* IdentifierType.Reference */) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + } + else if (type === 1 /* IdentifierType.NativeElementName */) { + this.isNativeElement = true; + } + } + render(code, { snippets: { getPropertyAccess }, useOriginalName }) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess, useOriginalName); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + } + } + else if (this.isNativeElement && + this.scope.context.options.jsx.mode !== 'preserve') { + code.update(this.start, this.end, JSON.stringify(this.name)); + } + } + getType() { + switch (this.parent.type) { + case 'JSXOpeningElement': + case 'JSXClosingElement': { + return this.name.startsWith(this.name.charAt(0).toUpperCase()) + ? 0 /* IdentifierType.Reference */ + : 1 /* IdentifierType.NativeElementName */; + } + case 'JSXMemberExpression': { + return this.parent.object === this + ? 0 /* IdentifierType.Reference */ + : 2 /* IdentifierType.Other */; + } + case 'JSXAttribute': + case 'JSXNamespacedName': { + return 2 /* IdentifierType.Other */; + } + default: { + /* istanbul ignore next */ + throw new Error(`Unexpected parent node type for JSXIdentifier: ${this.parent.type}`); + } + } + } +} + +class JSXAttribute extends NodeBase { + render(code, options, { jsxMode } = parseAst_js.BLANK) { + super.render(code, options); + if (['classic', 'automatic'].includes(jsxMode)) { + const { name, value } = this; + const key = name instanceof JSXIdentifier ? name.name : `${name.namespace.name}:${name.name.name}`; + if (!(jsxMode === 'automatic' && key === 'key')) { + const safeKey = stringifyObjectKeyIfNeeded(key); + if (key !== safeKey) { + code.overwrite(name.start, name.end, safeKey, { contentOnly: true }); + } + if (value) { + code.overwrite(name.end, value.start, ': ', { contentOnly: true }); + } + else { + code.appendLeft(name.end, ': true'); + } + } + } + } +} + +class JSXClosingBase extends NodeBase { + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.end, ')', { contentOnly: true }); + } + else { + super.render(code, options); + } + } +} + +class JSXClosingElement extends JSXClosingBase { +} + +class JSXClosingFragment extends JSXClosingBase { +} + +class JSXSpreadAttribute extends NodeBase { + render(code, options) { + this.argument.render(code, options); + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.argument.start, '', { contentOnly: true }); + code.overwrite(this.argument.end, this.end, '', { contentOnly: true }); + } + } +} + +class JSXEmptyExpression extends NodeBase { +} + +class JSXExpressionContainer extends NodeBase { + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.remove(this.start, this.expression.start); + code.remove(this.expression.end, this.end); + } + this.expression.render(code, options); + } +} + +function getRenderedJsxChildren(children) { + let renderedChildren = 0; + for (const child of children) { + if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)) { + renderedChildren++; + } + } + return renderedChildren; +} + +function getAndIncludeFactoryVariable(factory, preserve, importSource, node) { + const [baseName, nestedName] = factory.split('.'); + let factoryVariable; + if (importSource) { + factoryVariable = node.scope.context.getImportedJsxFactoryVariable(nestedName ? 'default' : baseName, node.start, importSource); + if (preserve) { + // This pretends we are accessing an included global variable of the same name + const globalVariable = node.scope.findGlobal(baseName); + globalVariable.include(); + // This excludes this variable from renaming + factoryVariable.globalName = baseName; + } + } + else { + factoryVariable = node.scope.findGlobal(baseName); + } + node.scope.context.includeVariableInModule(factoryVariable); + if (factoryVariable instanceof LocalVariable) { + factoryVariable.consolidateInitializers(); + factoryVariable.addUsedPlace(node); + node.scope.context.requestTreeshakingPass(); + } + return factoryVariable; +} + +class JSXElementBase extends NodeBase { + constructor() { + super(...arguments); + this.factoryVariable = null; + this.factory = null; + } + initialise() { + super.initialise(); + const { importSource } = (this.jsxMode = this.getRenderingMode()); + if (importSource) { + this.scope.context.addImportSource(importSource); + } + } + include(context, includeChildrenRecursively) { + if (!this.included) { + const { factory, importSource, mode } = this.jsxMode; + if (factory) { + this.factory = factory; + this.factoryVariable = getAndIncludeFactoryVariable(factory, mode === 'preserve', importSource, this); + } + } + super.include(context, includeChildrenRecursively); + } + applyDeoptimizations() { } + getRenderingMode() { + const jsx = this.scope.context.options.jsx; + const { mode, factory, importSource } = jsx; + if (mode === 'automatic') { + return { + factory: getRenderedJsxChildren(this.children) > 1 ? 'jsxs' : 'jsx', + importSource: jsx.jsxImportSource, + mode + }; + } + return { factory, importSource, mode }; + } + renderChildren(code, options, openingEnd) { + const { children } = this; + let hasMultipleChildren = false; + let childrenEnd = openingEnd; + let firstChild = null; + for (const child of children) { + if (child instanceof JSXExpressionContainer && + child.expression instanceof JSXEmptyExpression) { + code.remove(childrenEnd, child.end); + } + else { + code.appendLeft(childrenEnd, ', '); + child.render(code, options); + if (firstChild) { + hasMultipleChildren = true; + } + else { + firstChild = child; + } + } + childrenEnd = child.end; + } + return { childrenEnd, firstChild, hasMultipleChildren }; + } +} + +class JSXElement extends JSXElementBase { + render(code, options) { + switch (this.jsxMode.mode) { + case 'classic': { + this.renderClassicMode(code, options); + break; + } + case 'automatic': { + this.renderAutomaticMode(code, options); + break; + } + default: { + super.render(code, options); + } + } + } + getRenderingMode() { + const jsx = this.scope.context.options.jsx; + const { mode, factory, importSource } = jsx; + if (mode === 'automatic') { + // In the case there is a key after a spread attribute, we fall back to + // classic mode, see https://github.com/facebook/react/issues/20031#issuecomment-710346866 + // for reasoning. + let hasSpread = false; + for (const attribute of this.openingElement.attributes) { + if (attribute instanceof JSXSpreadAttribute) { + hasSpread = true; + } + else if (hasSpread && attribute.name.name === 'key') { + return { factory, importSource, mode: 'classic' }; + } + } + } + return super.getRenderingMode(); + } + renderClassicMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingElement, end, factory, factoryVariable, openingElement: { end: openingEnd, selfClosing } } = this; + const [, ...nestedName] = factory.split('.'); + const { firstAttribute, hasAttributes, hasSpread, inObject, previousEnd } = this.renderAttributes(code, options, [factoryVariable.getName(getPropertyAccess, useOriginalName), ...nestedName].join('.'), false); + this.wrapAttributes(code, inObject, hasAttributes, hasSpread, firstAttribute, 'null', previousEnd); + this.renderChildren(code, options, openingEnd); + if (selfClosing) { + code.appendLeft(end, ')'); + } + else { + closingElement.render(code, options); + } + } + renderAutomaticMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingElement, end, factoryVariable, openingElement: { end: openindEnd, selfClosing } } = this; + let { firstAttribute, hasAttributes, hasSpread, inObject, keyAttribute, previousEnd } = this.renderAttributes(code, options, factoryVariable.getName(getPropertyAccess, useOriginalName), true); + const { firstChild, hasMultipleChildren, childrenEnd } = this.renderChildren(code, options, openindEnd); + if (firstChild) { + code.prependRight(firstChild.start, `children: ${hasMultipleChildren ? '[' : ''}`); + if (!inObject) { + code.prependRight(firstChild.start, '{ '); + inObject = true; + } + previousEnd = closingElement.start; + if (hasMultipleChildren) { + code.appendLeft(previousEnd, ']'); + } + } + this.wrapAttributes(code, inObject, hasAttributes || !!firstChild, hasSpread, firstAttribute || firstChild, '{}', childrenEnd); + if (keyAttribute) { + const { value } = keyAttribute; + // This will appear to the left of the moved code... + code.appendLeft(childrenEnd, ', '); + if (value) { + code.move(value.start, value.end, childrenEnd); + } + else { + code.appendLeft(childrenEnd, 'true'); + } + } + if (selfClosing) { + // Moving the key attribute will also move the parenthesis to the right position + code.appendLeft(keyAttribute?.value?.end || end, ')'); + } + else { + closingElement.render(code, options); + } + } + renderAttributes(code, options, factoryName, extractKeyAttribute) { + const { jsxMode: { mode }, openingElement } = this; + const { attributes, end: openingEnd, start: openingStart, name: { start: nameStart, end: nameEnd } } = openingElement; + code.update(openingStart, nameStart, `/*#__PURE__*/${factoryName}(`); + openingElement.render(code, options, { jsxMode: mode }); + let keyAttribute = null; + let hasSpread = false; + let inObject = false; + let previousEnd = nameEnd; + let hasAttributes = false; + let firstAttribute = null; + for (const attribute of attributes) { + if (attribute instanceof JSXAttribute) { + if (extractKeyAttribute && attribute.name.name === 'key') { + keyAttribute = attribute; + code.remove(previousEnd, attribute.value?.start || attribute.end); + continue; + } + code.appendLeft(previousEnd, ','); + if (!inObject) { + code.prependRight(attribute.start, '{ '); + inObject = true; + } + hasAttributes = true; + } + else { + if (inObject) { + if (hasAttributes) { + code.appendLeft(previousEnd, ' '); + } + code.appendLeft(previousEnd, '},'); + inObject = false; + } + else { + code.appendLeft(previousEnd, ','); + } + hasSpread = true; + } + previousEnd = attribute.end; + if (!firstAttribute) { + firstAttribute = attribute; + } + } + code.remove(attributes.at(-1)?.end || previousEnd, openingEnd); + return { firstAttribute, hasAttributes, hasSpread, inObject, keyAttribute, previousEnd }; + } + wrapAttributes(code, inObject, hasAttributes, hasSpread, firstAttribute, missingAttributesFallback, attributesEnd) { + if (inObject) { + code.appendLeft(attributesEnd, ' }'); + } + if (hasSpread) { + if (hasAttributes) { + const { start } = firstAttribute; + if (firstAttribute instanceof JSXSpreadAttribute) { + code.prependRight(start, '{}, '); + } + code.prependRight(start, 'Object.assign('); + code.appendLeft(attributesEnd, ')'); + } + } + else if (!hasAttributes) { + code.appendLeft(attributesEnd, `, ${missingAttributesFallback}`); + } + } +} + +class JSXFragment extends JSXElementBase { + render(code, options) { + switch (this.jsxMode.mode) { + case 'classic': { + this.renderClassicMode(code, options); + break; + } + case 'automatic': { + this.renderAutomaticMode(code, options); + break; + } + default: { + super.render(code, options); + } + } + } + renderClassicMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingFragment, factory, factoryVariable, openingFragment, start } = this; + const [, ...nestedName] = factory.split('.'); + openingFragment.render(code, options); + code.prependRight(start, `/*#__PURE__*/${[ + factoryVariable.getName(getPropertyAccess, useOriginalName), + ...nestedName + ].join('.')}(`); + code.appendLeft(openingFragment.end, ', null'); + this.renderChildren(code, options, openingFragment.end); + closingFragment.render(code, options); + } + renderAutomaticMode(code, options) { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const { closingFragment, factoryVariable, openingFragment, start } = this; + openingFragment.render(code, options); + code.prependRight(start, `/*#__PURE__*/${factoryVariable.getName(getPropertyAccess, useOriginalName)}(`); + const { firstChild, hasMultipleChildren, childrenEnd } = this.renderChildren(code, options, openingFragment.end); + if (firstChild) { + code.prependRight(firstChild.start, `{ children: ${hasMultipleChildren ? '[' : ''}`); + if (hasMultipleChildren) { + code.appendLeft(closingFragment.start, ']'); + } + code.appendLeft(childrenEnd, ' }'); + } + else { + code.appendLeft(openingFragment.end, ', {}'); + } + closingFragment.render(code, options); + } +} + +class JSXMemberExpression extends NodeBase { +} + +class JSXNamespacedName extends NodeBase { +} + +class JSXOpeningElement extends NodeBase { + render(code, options, { jsxMode = this.scope.context.options.jsx.mode } = {}) { + this.name.render(code, options); + for (const attribute of this.attributes) { + attribute.render(code, options, { jsxMode }); + } + } +} + +class JSXOpeningFragment extends NodeBase { + constructor() { + super(...arguments); + this.fragment = null; + this.fragmentVariable = null; + } + include(context, includeChildrenRecursively) { + if (!this.included) { + const jsx = this.scope.context.options.jsx; + if (jsx.mode === 'automatic') { + this.fragment = 'Fragment'; + this.fragmentVariable = getAndIncludeFactoryVariable('Fragment', false, jsx.jsxImportSource, this); + } + else { + const { fragment, importSource, mode } = jsx; + if (fragment != null) { + this.fragment = fragment; + this.fragmentVariable = getAndIncludeFactoryVariable(fragment, mode === 'preserve', importSource, this); + } + } + } + super.include(context, includeChildrenRecursively); + } + render(code, options) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + const { snippets: { getPropertyAccess }, useOriginalName } = options; + const [, ...nestedFragment] = this.fragment.split('.'); + const fragment = [ + this.fragmentVariable.getName(getPropertyAccess, useOriginalName), + ...nestedFragment + ].join('.'); + code.update(this.start, this.end, fragment); + } + } +} + +class JSXSpreadChild extends NodeBase { + render(code, options) { + super.render(code, options); + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.expression.start, '...', { contentOnly: true }); + code.overwrite(this.expression.end, this.end, '', { contentOnly: true }); + } + } +} + +class JSXText extends NodeBase { + render(code) { + const { mode } = this.scope.context.options.jsx; + if (mode !== 'preserve') { + code.overwrite(this.start, this.end, JSON.stringify(this.value), { + contentOnly: true + }); + } + } +} + +class LabeledStatement extends NodeBase { + hasEffects(context) { + const { brokenFlow, includedLabels } = context; + context.ignore.labels.add(this.label.name); + context.includedLabels = new Set(); + let bodyHasEffects = false; + if (this.body.hasEffects(context)) { + bodyHasEffects = true; + } + else { + context.ignore.labels.delete(this.label.name); + if (context.includedLabels.has(this.label.name)) { + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + return bodyHasEffects; + } + include(context, includeChildrenRecursively) { + this.included = true; + const { brokenFlow, includedLabels } = context; + context.includedLabels = new Set(); + this.body.include(context, includeChildrenRecursively); + if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) { + this.label.include(); + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + } + render(code, options) { + if (this.label.included) { + this.label.render(code, options); + } + else { + code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1)); + } + this.body.render(code, options); + } +} + +class LogicalExpression extends NodeBase { + constructor() { + super(...arguments); + // We collect deoptimization information if usedBranch !== null + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + //private isBranchResolutionAnalysed = false; + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.left.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.right.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch) { + const unusedBranch = this.usedBranch === this.left ? this.right : this.left; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { scope: { context }, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = parseAst_js.EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + // Request another pass because we need to ensure "include" runs again if + // it is rendered + context.requestTreeshakingPass(); + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.left.deoptimizePath(path); + this.right.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.left.hasEffects(context)) { + return true; + } + if (this.getUsedBranch() !== this.left) { + return this.right.hasEffects(context); + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.right.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || + (usedBranch === this.right && this.left.shouldBeIncluded(context)) || + !usedBranch) { + this.left.include(context, includeChildrenRecursively); + this.right.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = parseAst_js.BLANK) { + if (!this.left.included || !this.right.included) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end); + if (this.right.included) { + const removePos = findNonWhiteSpace(code.original, operatorPos + 2); + code.remove(this.start, removePos); + if (preventASI) { + removeLineBreaks(code, removePos, this.right.start); + } + this.left.removeAnnotations(code); + } + else { + code.remove(findLastWhiteSpaceReverse(code.original, this.left.end, operatorPos), this.end); + } + this.getUsedBranch().render(code, options, { + isCalleeOfRenderedParent, + preventASI, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + else { + this.left.render(code, options, { + preventASI, + renderedSurroundingElement + }); + this.right.render(code, options); + } + } + getUsedBranch() { + if (!this.isBranchResolutionAnalysed) { + this.isBranchResolutionAnalysed = true; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof leftValue === 'symbol') { + return null; + } + else { + this.usedBranch = + (this.operator === '||' && leftValue) || + (this.operator === '&&' && !leftValue) || + (this.operator === '??' && leftValue != null) + ? this.left + : this.right; + } + } + return this.usedBranch; + } +} + +class NewExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 0 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + initialise() { + super.initialise(); + this.interaction = { + args: [null, ...this.arguments], + type: INTERACTION_CALLED, + withNew: true + }; + if (this.annotations && + this.scope.context.options.treeshake.annotations) { + this.annotationPure = this.annotations.some(comment => comment.type === 'pure'); + } + } + render(code, options) { + this.callee.render(code, options); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } +} + +class ObjectExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + render(code, options, { renderedSurroundingElement } = parseAst_js.BLANK) { + super.render(code, options); + if (renderedSurroundingElement === parseAst_js.ExpressionStatement || + renderedSurroundingElement === parseAst_js.ArrowFunctionExpression) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } + applyDeoptimizations() { } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + let prototype = OBJECT_PROTOTYPE; + const properties = []; + for (const property of this.properties) { + if (property instanceof SpreadElement) { + properties.push({ key: UnknownKey, kind: 'init', property }); + continue; + } + let key; + if (property.computed) { + const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind: property.kind, property }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + property.key instanceof Identifier + ? property.key.name + : String(property.key.value); + if (key === '__proto__' && property.kind === 'init') { + prototype = + property.value instanceof Literal && property.value.value === null + ? null + : property.value; + continue; + } + } + properties.push({ key, kind: property.kind, property }); + } + return (this.objectEntity = new ObjectEntity(properties, prototype)); + } +} + +class PanicError extends NodeBase { + initialise() { + const id = this.scope.context.module.id; + // This simulates the current nested error structure. We could also just + // replace it with a flat error. + const parseError = parseAst_js.getRollupError(parseAst_js.logParseError(this.message)); + const moduleParseError = parseAst_js.logModuleParseError(parseError, id); + return parseAst_js.error(moduleParseError); + } +} + +class ParseError extends NodeBase { + initialise() { + const pos = this.start; + const id = this.scope.context.module.id; + // This simulates the current nested error structure. We could also just + // replace it with a flat error. + const parseError = parseAst_js.getRollupError(parseAst_js.logParseError(this.message, pos)); + const moduleParseError = parseAst_js.logModuleParseError(parseError, id); + this.scope.context.error(moduleParseError, pos); + } +} + +class PrivateIdentifier extends NodeBase { +} + +class Program extends NodeBase { + constructor() { + super(...arguments); + this.hasCachedEffect = null; + this.hasLoggedEffect = false; + } + hasCachedEffects() { + if (!this.included) { + return false; + } + return this.hasCachedEffect === null + ? (this.hasCachedEffect = this.hasEffects(createHasEffectsContext())) + : this.hasCachedEffect; + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) { + if (this.scope.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { + this.hasLoggedEffect = true; + const { code, log, module } = this.scope.context; + log(parseAst_js.LOGLEVEL_INFO, parseAst_js.logFirstSideEffect(code, module.id, parseAst_js.locate(code, node.start, { offsetLine: 1 })), node.start); + } + return (this.hasCachedEffect = true); + } + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) { + node.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + if (this.invalidAnnotations) + for (const { start, end, type } of this.invalidAnnotations) { + this.scope.context.magicString.remove(start, end); + if (type === 'pure' || type === 'noSideEffects') { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInvalidAnnotation(this.scope.context.code.slice(start, end), this.scope.context.module.id, type), start); + } + } + } + render(code, options) { + let start = this.start; + if (code.original.startsWith('#!')) { + start = Math.min(code.original.indexOf('\n') + 1, this.end); + code.remove(0, start); + } + if (this.body.length > 0) { + // Keep all consecutive lines that start with a comment + while (code.original[start] === '/' && /[*/]/.test(code.original[start + 1])) { + const firstLineBreak = findFirstLineBreakOutsideComment(code.original.slice(start, this.body[0].start)); + if (firstLineBreak[0] === -1) { + break; + } + start += firstLineBreak[1]; + } + renderStatementList(this.body, code, start, this.end, options); + } + else { + super.render(code, options); + } + } + applyDeoptimizations() { } +} + +class Property extends MethodBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + //declare method: boolean; + get method() { + return isFlagSet(this.flags, 262144 /* Flag.method */); + } + set method(value) { + this.flags = setFlag(this.flags, 262144 /* Flag.method */, value); + } + //declare shorthand: boolean; + get shorthand() { + return isFlagSet(this.flags, 524288 /* Flag.shorthand */); + } + set shorthand(value) { + this.flags = setFlag(this.flags, 524288 /* Flag.shorthand */, value); + } + declare(kind, init) { + this.declarationInit = init; + return this.value.declare(kind, UNKNOWN_EXPRESSION); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const propertyReadSideEffects = this.scope.context.options.treeshake.propertyReadSideEffects; + return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || + this.key.hasEffects(context) || + this.value.hasEffects(context)); + } + markDeclarationReached() { + this.value.markDeclarationReached(); + } + render(code, options) { + if (!this.shorthand) { + this.key.render(code, options); + } + this.value.render(code, options, { isShorthandProperty: this.shorthand }); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class PropertyDefinition extends NodeBase { + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.value?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.value?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.value + ? this.value.getLiteralValueAtPath(path, recursionTracker, origin) + : UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.value + ? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) + : UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + return (this.key.hasEffects(context) || + (this.static && !!this.value?.hasEffects(context)) || + checkEffectForNodes(this.decorators, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } +} + +class ReturnStatement extends NodeBase { + hasEffects(context) { + if (!context.ignore.returnYield || this.argument?.hasEffects(context)) + return true; + context.brokenFlow = true; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument?.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + initialise() { + super.initialise(); + this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 6 /* 'return'.length */) { + code.prependLeft(this.start + 6, ' '); + } + } + } +} + +class SequenceExpression extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.expressions[this.expressions.length - 1].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.expressions[this.expressions.length - 1].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin); + } + hasEffects(context) { + for (const expression of this.expressions) { + if (expression.hasEffects(context)) + return true; + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const lastExpression = this.expressions[this.expressions.length - 1]; + for (const expression of this.expressions) { + if (includeChildrenRecursively || + (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || + expression.shouldBeIncluded(context)) + expression.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.expressions[0].removeAnnotations(code); + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = parseAst_js.BLANK) { + let includedNodes = 0; + let lastSeparatorPos = null; + const lastNode = this.expressions[this.expressions.length - 1]; + for (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) { + if (!node.included) { + treeshakeNode(node, code, start, end); + continue; + } + includedNodes++; + lastSeparatorPos = separator; + if (includedNodes === 1 && preventASI) { + removeLineBreaks(code, start, node.start); + } + if (includedNodes === 1) { + const parentType = renderedParentType || this.parent.type; + node.render(code, options, { + isCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode, + renderedParentType: parentType, + renderedSurroundingElement: parentType + }); + } + else { + node.render(code, options); + } + } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end); + } + } +} + +class Super extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } +} + +class SwitchCase extends NodeBase { + hasEffects(context) { + if (this.test?.hasEffects(context)) + return true; + for (const node of this.consequent) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test?.include(context, includeChildrenRecursively); + for (const node of this.consequent) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options, nodeRenderOptions) { + if (this.consequent.length > 0) { + if (this.test) { + this.test.render(code, options); + } + const testEnd = this.test + ? this.test.end + : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7; + const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1; + renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options); + } + else { + super.render(code, options); + } + } +} +SwitchCase.prototype.needsBoundaries = true; + +class SwitchStatement extends NodeBase { + createScope(parentScope) { + this.parentScope = parentScope; + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.discriminant.hasEffects(context)) + return true; + const { brokenFlow, hasBreak, ignore } = context; + const { breaks } = ignore; + ignore.breaks = true; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + for (const switchCase of this.cases) { + if (switchCase.hasEffects(context)) + return true; + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + if (this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + ignore.breaks = breaks; + context.hasBreak = hasBreak; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.discriminant.include(context, includeChildrenRecursively); + const { brokenFlow, hasBreak } = context; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + let isCaseIncluded = includeChildrenRecursively || + (this.defaultCase !== null && this.defaultCase < this.cases.length - 1); + for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) { + const switchCase = this.cases[caseIndex]; + if (switchCase.included) { + isCaseIncluded = true; + } + if (!isCaseIncluded) { + const hasEffectsContext = createHasEffectsContext(); + hasEffectsContext.ignore.breaks = true; + isCaseIncluded = switchCase.hasEffects(hasEffectsContext); + } + if (isCaseIncluded) { + switchCase.include(context, includeChildrenRecursively); + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + else { + onlyHasBrokenFlow = brokenFlow; + } + } + if (isCaseIncluded && this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + context.hasBreak = hasBreak; + } + initialise() { + super.initialise(); + for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) { + if (this.cases[caseIndex].test === null) { + this.defaultCase = caseIndex; + return; + } + } + this.defaultCase = null; + } + parseNode(esTreeNode) { + this.discriminant = new (this.scope.context.getNodeConstructor(esTreeNode.discriminant.type))(this, this.parentScope).parseNode(esTreeNode.discriminant); + return super.parseNode(esTreeNode); + } + render(code, options) { + this.discriminant.render(code, options); + if (this.cases.length > 0) { + renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options); + } + } +} + +class TaggedTemplateExpression extends CallExpressionBase { + bind() { + super.bind(); + if (this.tag.type === parseAst_js.Identifier) { + const name = this.tag.name; + const variable = this.scope.findVariable(name); + if (variable.isNamespace) { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logCannotCallNamespace(name), this.start); + } + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const argument of this.quasi.expressions) { + if (argument.hasEffects(context)) + return true; + } + return (this.tag.hasEffects(context) || + this.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.tag.include(context, includeChildrenRecursively); + this.quasi.include(context, includeChildrenRecursively); + } + this.tag.includeCallArguments(context, this.args); + const [returnExpression] = this.getReturnExpression(); + if (!returnExpression.included) { + returnExpression.include(context, false); + } + } + initialise() { + super.initialise(); + this.args = [UNKNOWN_EXPRESSION, ...this.quasi.expressions]; + this.interaction = { + args: [ + this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null, + ...this.args + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + render(code, options) { + this.tag.render(code, options, { isCalleeOfRenderedParent: true }); + this.quasi.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.tag.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class TemplateElement extends NodeBase { + get tail() { + return isFlagSet(this.flags, 1048576 /* Flag.tail */); + } + set tail(value) { + this.flags = setFlag(this.flags, 1048576 /* Flag.tail */, value); + } + // Do not try to bind value + bind() { } + hasEffects() { + return false; + } + include() { + this.included = true; + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + return super.parseNode(esTreeNode); + } + render() { } +} + +class TemplateLiteral extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || this.quasis.length !== 1) { + return UnknownValue; + } + return this.quasis[0].value.cooked; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) { + return UNKNOWN_RETURN_EXPRESSION; + } + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } + render(code, options) { + code.indentExclusionRanges.push([this.start, this.end]); + super.render(code, options); + } +} + +class ModuleScope extends ChildScope { + constructor(parent, context) { + super(parent, context); + this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context, 'other')); + } + addDeclaration(identifier, context, init, kind) { + if (this.context.module.importDescriptions.has(identifier.name)) { + context.error(parseAst_js.logRedeclarationError(identifier.name), identifier.start); + } + return super.addDeclaration(identifier, context, init, kind); + } + addExportDefaultDeclaration(name, exportDefaultDeclaration, context) { + const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context); + this.variables.set('default', variable); + return variable; + } + addNamespaceMemberAccess() { } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + // all module level variables are already deconflicted when deconflicting the chunk + for (const scope of this.children) + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + findLexicalBoundary() { + return this; + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.context.traceVariable(name) || this.parent.findVariable(name); + if (variable instanceof GlobalVariable) { + this.accessedOutsideVariables.set(name, variable); + } + return variable; + } +} + +class ThisExpression extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length === 0) { + return interaction.type !== INTERACTION_ACCESSED; + } + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + super.initialise(); + this.alias = + this.scope.findLexicalBoundary() instanceof ModuleScope + ? this.scope.context.moduleContext + : null; + if (this.alias === 'undefined') { + this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logThisIsUndefined(), this.start); + } + } + render(code) { + if (this.alias !== null) { + code.overwrite(this.start, this.end, this.alias, { + contentOnly: false, + storeName: true + }); + } + } +} + +class ThrowStatement extends NodeBase { + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + render(code, options) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'throw'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } +} + +class TryStatement extends NodeBase { + constructor() { + super(...arguments); + this.directlyIncluded = false; + this.includedLabelsAfterBlock = null; + } + hasEffects(context) { + return ((this.scope.context.options.treeshake.tryCatchDeoptimization + ? this.block.body.length > 0 + : this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context)); + } + include(context, includeChildrenRecursively) { + const tryCatchDeoptimization = this.scope.context.options.treeshake?.tryCatchDeoptimization; + const { brokenFlow, includedLabels } = context; + if (!this.directlyIncluded || !tryCatchDeoptimization) { + this.included = true; + this.directlyIncluded = true; + this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively); + if (includedLabels.size > 0) { + this.includedLabelsAfterBlock = [...includedLabels]; + } + context.brokenFlow = brokenFlow; + } + else if (this.includedLabelsAfterBlock) { + for (const label of this.includedLabelsAfterBlock) { + includedLabels.add(label); + } + } + if (this.handler !== null) { + this.handler.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + this.finalizer?.include(context, includeChildrenRecursively); + } +} + +const unaryOperators = { + '!': value => !value, + '+': value => +value, + '-': value => -value, + delete: () => UnknownValue, + typeof: value => typeof value, + void: () => undefined, + '~': value => ~value +}; +class UnaryExpression extends NodeBase { + get prefix() { + return isFlagSet(this.flags, 2097152 /* Flag.prefix */); + } + set prefix(value) { + this.flags = setFlag(this.flags, 2097152 /* Flag.prefix */, value); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof argumentValue === 'symbol') + return UnknownValue; + return unaryOperators[this.operator](argumentValue); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.operator === 'typeof' && this.argument instanceof Identifier) + return false; + return (this.argument.hasEffects(context) || + (this.operator === 'delete' && + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context))); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.operator === 'delete') { + this.argument.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class UpdateExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return this.argument.hasEffectsAsAssignmentTarget(context, true); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); + } + initialise() { + super.initialise(); + this.argument.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _ } } = options; + this.argument.render(code, options); + if (format === 'system') { + const variable = this.argument.variable; + const exportNames = exportNamesByVariable.get(variable); + if (exportNames) { + if (this.prefix) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, this.start, this.end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, this.start, this.end, this.parent.type !== parseAst_js.ExpressionStatement, code, options); + } + } + else { + const operator = this.operator[0]; + renderSystemExportSequenceBeforeExpression(variable, this.start, this.end, this.parent.type !== parseAst_js.ExpressionStatement, code, options, `${_}${operator}${_}1`); + } + } + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.argument.deoptimizePath(EMPTY_PATH); + if (this.argument instanceof Identifier) { + const variable = this.scope.findVariable(this.argument.name); + variable.markReassigned(); + } + this.scope.context.requestTreeshakingPass(); + } +} + +function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) { + for (const declarator of declarations) { + if (!declarator.id.included) + return false; + if (declarator.id.type === parseAst_js.Identifier) { + if (exportNamesByVariable.has(declarator.id.variable)) + return false; + } + else { + const exportedVariables = []; + declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable); + if (exportedVariables.length > 0) + return false; + } + } + return true; +} +class VariableDeclaration extends NodeBase { + deoptimizePath() { + for (const declarator of this.declarations) { + declarator.deoptimizePath(EMPTY_PATH); + } + } + hasEffectsOnInteractionAtPath() { + return false; + } + include(context, includeChildrenRecursively, { asSingleStatement } = parseAst_js.BLANK) { + this.included = true; + for (const declarator of this.declarations) { + if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) + declarator.include(context, includeChildrenRecursively); + const { id, init } = declarator; + if (asSingleStatement) { + id.include(context, includeChildrenRecursively); + } + if (init && + id.included && + !init.included && + (id instanceof ObjectPattern || id instanceof ArrayPattern)) { + init.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + this.isUsingDeclaration = this.kind === 'await using' || this.kind === 'using'; + for (const declarator of this.declarations) { + declarator.declareDeclarator(this.kind, this.isUsingDeclaration); + } + } + removeAnnotations(code) { + this.declarations[0].removeAnnotations(code); + } + render(code, options, nodeRenderOptions = parseAst_js.BLANK) { + if (this.isUsingDeclaration || + areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) { + for (const declarator of this.declarations) { + declarator.render(code, options); + } + if (!nodeRenderOptions.isNoStatement && + code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) { + code.appendLeft(this.end, ';'); + } + } + else { + this.renderReplacedDeclarations(code, options); + } + } + applyDeoptimizations() { } + renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) { + if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) { + code.remove(this.end - 1, this.end); + } + separatorString += ';'; + if (lastSeparatorPos === null) { + code.appendLeft(renderedContentEnd, separatorString); + } + else { + if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ && + (code.original.charCodeAt(this.end) === 10 /*"\n"*/ || + code.original.charCodeAt(this.end) === 13) /*"\r"*/) { + actualContentEnd--; + if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) { + actualContentEnd--; + } + } + if (actualContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.remove(actualContentEnd, renderedContentEnd); + } + } + if (systemPatternExports.length > 0) { + code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`); + } + } + renderReplacedDeclarations(code, options) { + const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0)); + let actualContentEnd, renderedContentEnd; + renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length); + let lastSeparatorPos = renderedContentEnd - 1; + code.remove(this.start, lastSeparatorPos); + let isInDeclaration = false; + let hasRenderedContent = false; + let separatorString = '', leadingString, nextSeparatorString; + const aggregatedSystemExports = []; + const singleSystemExport = gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports); + for (const { node, start, separator, contentEnd, end } of separatedNodes) { + if (!node.included) { + code.remove(start, end); + node.removeAnnotations(code); + continue; + } + node.render(code, options); + leadingString = ''; + nextSeparatorString = ''; + if (!node.id.included || + (node.id instanceof Identifier && + isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) { + if (hasRenderedContent) { + separatorString += ';'; + } + isInDeclaration = false; + } + else { + if (singleSystemExport && singleSystemExport === node.id.variable) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); + renderSystemExportExpression(singleSystemExport, findNonWhiteSpace(code.original, operatorPos + 1), separator === null ? contentEnd : separator, code, options); + } + if (isInDeclaration) { + separatorString += ','; + } + else { + if (hasRenderedContent) { + separatorString += ';'; + } + leadingString += `${this.kind} `; + isInDeclaration = true; + } + } + if (renderedContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.appendLeft(renderedContentEnd, leadingString); + } + actualContentEnd = contentEnd; + renderedContentEnd = end; + hasRenderedContent = true; + lastSeparatorPos = separator; + separatorString = nextSeparatorString; + } + this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, aggregatedSystemExports, options); + } +} +function gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports) { + let singleSystemExport = null; + if (options.format === 'system') { + for (const { node } of separatedNodes) { + if (node.id instanceof Identifier && + node.init && + aggregatedSystemExports.length === 0 && + options.exportNamesByVariable.get(node.id.variable)?.length === 1) { + singleSystemExport = node.id.variable; + aggregatedSystemExports.push(singleSystemExport); + } + else { + node.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable); + } + } + if (aggregatedSystemExports.length > 1) { + singleSystemExport = null; + } + else if (singleSystemExport) { + aggregatedSystemExports.length = 0; + } + } + return singleSystemExport; +} + +class WhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class YieldExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return !(context.ignore.returnYield && !this.argument?.hasEffects(context)); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'yield'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } + } +} + +// This file is generated by scripts/generate-buffer-parsers.js. +// Do not edit this file directly. +function convertProgram(buffer, parent, parentScope) { + return convertNode(parent, parentScope, 0, parseAst_js.getAstBuffer(buffer)); +} +const nodeTypeStrings = [ + 'PanicError', + 'ParseError', + 'ArrayExpression', + 'ArrayPattern', + 'ArrowFunctionExpression', + 'AssignmentExpression', + 'AssignmentPattern', + 'AwaitExpression', + 'BinaryExpression', + 'BlockStatement', + 'BreakStatement', + 'CallExpression', + 'CatchClause', + 'ChainExpression', + 'ClassBody', + 'ClassDeclaration', + 'ClassExpression', + 'ConditionalExpression', + 'ContinueStatement', + 'DebuggerStatement', + 'Decorator', + 'ExpressionStatement', + 'DoWhileStatement', + 'EmptyStatement', + 'ExportAllDeclaration', + 'ExportDefaultDeclaration', + 'ExportNamedDeclaration', + 'ExportSpecifier', + 'ExpressionStatement', + 'ForInStatement', + 'ForOfStatement', + 'ForStatement', + 'FunctionDeclaration', + 'FunctionExpression', + 'Identifier', + 'IfStatement', + 'ImportAttribute', + 'ImportDeclaration', + 'ImportDefaultSpecifier', + 'ImportExpression', + 'ImportNamespaceSpecifier', + 'ImportSpecifier', + 'JSXAttribute', + 'JSXClosingElement', + 'JSXClosingFragment', + 'JSXElement', + 'JSXEmptyExpression', + 'JSXExpressionContainer', + 'JSXFragment', + 'JSXIdentifier', + 'JSXMemberExpression', + 'JSXNamespacedName', + 'JSXOpeningElement', + 'JSXOpeningFragment', + 'JSXSpreadAttribute', + 'JSXSpreadChild', + 'JSXText', + 'LabeledStatement', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'Literal', + 'LogicalExpression', + 'MemberExpression', + 'MetaProperty', + 'MethodDefinition', + 'NewExpression', + 'ObjectExpression', + 'ObjectPattern', + 'PrivateIdentifier', + 'Program', + 'Property', + 'PropertyDefinition', + 'RestElement', + 'ReturnStatement', + 'SequenceExpression', + 'SpreadElement', + 'StaticBlock', + 'Super', + 'SwitchCase', + 'SwitchStatement', + 'TaggedTemplateExpression', + 'TemplateElement', + 'TemplateLiteral', + 'ThisExpression', + 'ThrowStatement', + 'TryStatement', + 'UnaryExpression', + 'UpdateExpression', + 'VariableDeclaration', + 'VariableDeclarator', + 'WhileStatement', + 'YieldExpression' +]; +const nodeConstructors$1 = [ + PanicError, + ParseError, + ArrayExpression, + ArrayPattern, + ArrowFunctionExpression, + AssignmentExpression, + AssignmentPattern, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + CallExpression, + CatchClause, + ChainExpression, + ClassBody, + ClassDeclaration, + ClassExpression, + ConditionalExpression, + ContinueStatement, + DebuggerStatement, + Decorator, + ExpressionStatement, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExportSpecifier, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportAttribute, + ImportDeclaration, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, + ImportSpecifier, + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXSpreadChild, + JSXText, + LabeledStatement, + Literal, + Literal, + Literal, + Literal, + Literal, + Literal, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + ObjectPattern, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, + RestElement, + ReturnStatement, + SequenceExpression, + SpreadElement, + StaticBlock, + Super, + SwitchCase, + SwitchStatement, + TaggedTemplateExpression, + TemplateElement, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + YieldExpression +]; +const bufferParsers = [ + function panicError(node, position, buffer) { + node.message = buffer.convertString(buffer[position]); + }, + function parseError(node, position, buffer) { + node.message = buffer.convertString(buffer[position]); + }, + function arrayExpression(node, position, buffer) { + const { scope } = node; + node.elements = convertNodeList(node, scope, buffer[position], buffer); + }, + function arrayPattern(node, position, buffer) { + const { scope } = node; + node.elements = convertNodeList(node, scope, buffer[position], buffer); + }, + function arrowFunctionExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.expression = (flags & 2) === 2; + node.generator = (flags & 4) === 4; + const annotations = (node.annotations = parseAst_js.convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 2], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 3], buffer); + }, + function assignmentExpression(node, position, buffer) { + const { scope } = node; + node.operator = parseAst_js.FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function assignmentPattern(node, position, buffer) { + const { scope } = node; + node.left = convertNode(node, scope, buffer[position], buffer); + node.right = convertNode(node, scope, buffer[position + 1], buffer); + }, + function awaitExpression(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function binaryExpression(node, position, buffer) { + const { scope } = node; + node.operator = parseAst_js.FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function blockStatement(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + }, + function breakStatement(node, position, buffer) { + const { scope } = node; + const labelPosition = buffer[position]; + node.label = labelPosition === 0 ? null : convertNode(node, scope, labelPosition, buffer); + }, + function callExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.optional = (flags & 1) === 1; + node.annotations = parseAst_js.convertAnnotations(buffer[position + 1], buffer); + node.callee = convertNode(node, scope, buffer[position + 2], buffer); + node.arguments = convertNodeList(node, scope, buffer[position + 3], buffer); + }, + function catchClause(node, position, buffer) { + const { scope } = node; + const parameterPosition = buffer[position]; + const parameter = (node.param = + parameterPosition === 0 ? null : convertNode(node, scope, parameterPosition, buffer)); + parameter?.declare('parameter', UNKNOWN_EXPRESSION); + node.body = convertNode(node, scope.bodyScope, buffer[position + 1], buffer); + }, + function chainExpression(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function classBody(node, position, buffer) { + const { scope } = node; + const bodyPosition = buffer[position]; + if (bodyPosition) { + const length = buffer[bodyPosition]; + const body = (node.body = new Array(length)); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[bodyPosition + 1 + index]; + body[index] = convertNode(node, (buffer[nodePosition + 3] & 1) === 0 ? scope.instanceScope : scope, nodePosition, buffer); + } + } + else { + node.body = []; + } + }, + function classDeclaration(node, position, buffer) { + const { scope } = node; + node.decorators = convertNodeList(node, scope, buffer[position], buffer); + const idPosition = buffer[position + 1]; + node.id = + idPosition === 0 ? null : convertNode(node, scope.parent, idPosition, buffer); + const superClassPosition = buffer[position + 2]; + node.superClass = + superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function classExpression(node, position, buffer) { + const { scope } = node; + node.decorators = convertNodeList(node, scope, buffer[position], buffer); + const idPosition = buffer[position + 1]; + node.id = idPosition === 0 ? null : convertNode(node, scope, idPosition, buffer); + const superClassPosition = buffer[position + 2]; + node.superClass = + superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function conditionalExpression(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.consequent = convertNode(node, scope, buffer[position + 1], buffer); + node.alternate = convertNode(node, scope, buffer[position + 2], buffer); + }, + function continueStatement(node, position, buffer) { + const { scope } = node; + const labelPosition = buffer[position]; + node.label = labelPosition === 0 ? null : convertNode(node, scope, labelPosition, buffer); + }, + function debuggerStatement() { }, + function decorator(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function directive(node, position, buffer) { + const { scope } = node; + node.directive = buffer.convertString(buffer[position]); + node.expression = convertNode(node, scope, buffer[position + 1], buffer); + }, + function doWhileStatement(node, position, buffer) { + const { scope } = node; + node.body = convertNode(node, scope, buffer[position], buffer); + node.test = convertNode(node, scope, buffer[position + 1], buffer); + }, + function emptyStatement() { }, + function exportAllDeclaration(node, position, buffer) { + const { scope } = node; + const exportedPosition = buffer[position]; + node.exported = + exportedPosition === 0 ? null : convertNode(node, scope, exportedPosition, buffer); + node.source = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function exportDefaultDeclaration(node, position, buffer) { + const { scope } = node; + node.declaration = convertNode(node, scope, buffer[position], buffer); + }, + function exportNamedDeclaration(node, position, buffer) { + const { scope } = node; + node.specifiers = convertNodeList(node, scope, buffer[position], buffer); + const sourcePosition = buffer[position + 1]; + node.source = sourcePosition === 0 ? null : convertNode(node, scope, sourcePosition, buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + const declarationPosition = buffer[position + 3]; + node.declaration = + declarationPosition === 0 ? null : convertNode(node, scope, declarationPosition, buffer); + }, + function exportSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + const exportedPosition = buffer[position + 1]; + node.exported = + exportedPosition === 0 ? node.local : convertNode(node, scope, exportedPosition, buffer); + }, + function expressionStatement(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function forInStatement(node, position, buffer) { + const { scope } = node; + node.left = convertNode(node, scope, buffer[position], buffer); + node.right = convertNode(node, scope, buffer[position + 1], buffer); + node.body = convertNode(node, scope, buffer[position + 2], buffer); + }, + function forOfStatement(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.await = (flags & 1) === 1; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function forStatement(node, position, buffer) { + const { scope } = node; + const initPosition = buffer[position]; + node.init = initPosition === 0 ? null : convertNode(node, scope, initPosition, buffer); + const testPosition = buffer[position + 1]; + node.test = testPosition === 0 ? null : convertNode(node, scope, testPosition, buffer); + const updatePosition = buffer[position + 2]; + node.update = updatePosition === 0 ? null : convertNode(node, scope, updatePosition, buffer); + node.body = convertNode(node, scope, buffer[position + 3], buffer); + }, + function functionDeclaration(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.generator = (flags & 2) === 2; + const annotations = (node.annotations = parseAst_js.convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const idPosition = buffer[position + 2]; + node.id = + idPosition === 0 ? null : convertNode(node, scope.parent, idPosition, buffer); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 4], buffer); + }, + function functionExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.async = (flags & 1) === 1; + node.generator = (flags & 2) === 2; + const annotations = (node.annotations = parseAst_js.convertAnnotations(buffer[position + 1], buffer)); + node.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + const idPosition = buffer[position + 2]; + node.id = idPosition === 0 ? null : convertNode(node, node.idScope, idPosition, buffer); + const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); + scope.addParameterVariables(parameters.map(parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + node.body = convertNode(node, scope.bodyScope, buffer[position + 4], buffer); + }, + function identifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function ifStatement(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.consequent = convertNode(node, (node.consequentScope = new TrackingScope(scope)), buffer[position + 1], buffer); + const alternatePosition = buffer[position + 2]; + node.alternate = + alternatePosition === 0 + ? null + : convertNode(node, (node.alternateScope = new TrackingScope(scope)), alternatePosition, buffer); + }, + function importAttribute(node, position, buffer) { + const { scope } = node; + node.key = convertNode(node, scope, buffer[position], buffer); + node.value = convertNode(node, scope, buffer[position + 1], buffer); + }, + function importDeclaration(node, position, buffer) { + const { scope } = node; + node.specifiers = convertNodeList(node, scope, buffer[position], buffer); + node.source = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function importDefaultSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + }, + function importExpression(node, position, buffer) { + const { scope } = node; + node.source = convertNode(node, scope, buffer[position], buffer); + node.sourceAstNode = parseAst_js.convertNode(buffer[position], buffer); + const optionsPosition = buffer[position + 1]; + node.options = optionsPosition === 0 ? null : convertNode(node, scope, optionsPosition, buffer); + }, + function importNamespaceSpecifier(node, position, buffer) { + const { scope } = node; + node.local = convertNode(node, scope, buffer[position], buffer); + }, + function importSpecifier(node, position, buffer) { + const { scope } = node; + const importedPosition = buffer[position]; + node.local = convertNode(node, scope, buffer[position + 1], buffer); + node.imported = + importedPosition === 0 ? node.local : convertNode(node, scope, importedPosition, buffer); + }, + function jsxAttribute(node, position, buffer) { + const { scope } = node; + node.name = convertNode(node, scope, buffer[position], buffer); + const valuePosition = buffer[position + 1]; + node.value = valuePosition === 0 ? null : convertNode(node, scope, valuePosition, buffer); + }, + function jsxClosingElement(node, position, buffer) { + const { scope } = node; + node.name = convertNode(node, scope, buffer[position], buffer); + }, + function jsxClosingFragment() { }, + function jsxElement(node, position, buffer) { + const { scope } = node; + node.openingElement = convertNode(node, scope, buffer[position], buffer); + node.children = convertNodeList(node, scope, buffer[position + 1], buffer); + const closingElementPosition = buffer[position + 2]; + node.closingElement = + closingElementPosition === 0 + ? null + : convertNode(node, scope, closingElementPosition, buffer); + }, + function jsxEmptyExpression() { }, + function jsxExpressionContainer(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function jsxFragment(node, position, buffer) { + const { scope } = node; + node.openingFragment = convertNode(node, scope, buffer[position], buffer); + node.children = convertNodeList(node, scope, buffer[position + 1], buffer); + node.closingFragment = convertNode(node, scope, buffer[position + 2], buffer); + }, + function jsxIdentifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function jsxMemberExpression(node, position, buffer) { + const { scope } = node; + node.object = convertNode(node, scope, buffer[position], buffer); + node.property = convertNode(node, scope, buffer[position + 1], buffer); + }, + function jsxNamespacedName(node, position, buffer) { + const { scope } = node; + node.namespace = convertNode(node, scope, buffer[position], buffer); + node.name = convertNode(node, scope, buffer[position + 1], buffer); + }, + function jsxOpeningElement(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.selfClosing = (flags & 1) === 1; + node.name = convertNode(node, scope, buffer[position + 1], buffer); + node.attributes = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function jsxOpeningFragment(node) { + node.attributes = []; + node.selfClosing = false; + }, + function jsxSpreadAttribute(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function jsxSpreadChild(node, position, buffer) { + const { scope } = node; + node.expression = convertNode(node, scope, buffer[position], buffer); + }, + function jsxText(node, position, buffer) { + node.value = buffer.convertString(buffer[position]); + node.raw = buffer.convertString(buffer[position + 1]); + }, + function labeledStatement(node, position, buffer) { + const { scope } = node; + node.label = convertNode(node, scope, buffer[position], buffer); + node.body = convertNode(node, scope, buffer[position + 1], buffer); + }, + function literalBigInt(node, position, buffer) { + const bigint = (node.bigint = buffer.convertString(buffer[position])); + node.raw = buffer.convertString(buffer[position + 1]); + node.value = BigInt(bigint); + }, + function literalBoolean(node, position, buffer) { + const flags = buffer[position]; + const value = (node.value = (flags & 1) === 1); + node.raw = value ? 'true' : 'false'; + }, + function literalNull(node) { + node.value = null; + }, + function literalNumber(node, position, buffer) { + const rawPosition = buffer[position]; + node.raw = rawPosition === 0 ? undefined : buffer.convertString(rawPosition); + node.value = new DataView(buffer.buffer).getFloat64((position + 1) << 2, true); + }, + function literalRegExp(node, position, buffer) { + const flags = buffer.convertString(buffer[position]); + const pattern = buffer.convertString(buffer[position + 1]); + node.raw = `/${pattern}/${flags}`; + node.regex = { flags, pattern }; + node.value = new RegExp(pattern, flags); + }, + function literalString(node, position, buffer) { + node.value = buffer.convertString(buffer[position]); + const rawPosition = buffer[position + 1]; + node.raw = rawPosition === 0 ? undefined : buffer.convertString(rawPosition); + }, + function logicalExpression(node, position, buffer) { + const { scope } = node; + node.operator = parseAst_js.FIXED_STRINGS[buffer[position]]; + node.left = convertNode(node, scope, buffer[position + 1], buffer); + node.right = convertNode(node, scope, buffer[position + 2], buffer); + }, + function memberExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.computed = (flags & 1) === 1; + node.optional = (flags & 2) === 2; + node.object = convertNode(node, scope, buffer[position + 1], buffer); + node.property = convertNode(node, scope, buffer[position + 2], buffer); + }, + function metaProperty(node, position, buffer) { + const { scope } = node; + node.meta = convertNode(node, scope, buffer[position], buffer); + node.property = convertNode(node, scope, buffer[position + 1], buffer); + }, + function methodDefinition(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.static = (flags & 1) === 1; + node.computed = (flags & 2) === 2; + node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer); + node.key = convertNode(node, scope, buffer[position + 2], buffer); + node.value = convertNode(node, scope, buffer[position + 3], buffer); + node.kind = parseAst_js.FIXED_STRINGS[buffer[position + 4]]; + }, + function newExpression(node, position, buffer) { + const { scope } = node; + node.annotations = parseAst_js.convertAnnotations(buffer[position], buffer); + node.callee = convertNode(node, scope, buffer[position + 1], buffer); + node.arguments = convertNodeList(node, scope, buffer[position + 2], buffer); + }, + function objectExpression(node, position, buffer) { + const { scope } = node; + node.properties = convertNodeList(node, scope, buffer[position], buffer); + }, + function objectPattern(node, position, buffer) { + const { scope } = node; + node.properties = convertNodeList(node, scope, buffer[position], buffer); + }, + function privateIdentifier(node, position, buffer) { + node.name = buffer.convertString(buffer[position]); + }, + function program(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + node.invalidAnnotations = parseAst_js.convertAnnotations(buffer[position + 1], buffer); + }, + function property(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.method = (flags & 1) === 1; + node.shorthand = (flags & 2) === 2; + node.computed = (flags & 4) === 4; + const keyPosition = buffer[position + 1]; + node.value = convertNode(node, scope, buffer[position + 2], buffer); + node.kind = parseAst_js.FIXED_STRINGS[buffer[position + 3]]; + node.key = keyPosition === 0 ? node.value : convertNode(node, scope, keyPosition, buffer); + }, + function propertyDefinition(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.static = (flags & 1) === 1; + node.computed = (flags & 2) === 2; + node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer); + node.key = convertNode(node, scope, buffer[position + 2], buffer); + const valuePosition = buffer[position + 3]; + node.value = valuePosition === 0 ? null : convertNode(node, scope, valuePosition, buffer); + }, + function restElement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function returnStatement(node, position, buffer) { + const { scope } = node; + const argumentPosition = buffer[position]; + node.argument = + argumentPosition === 0 ? null : convertNode(node, scope, argumentPosition, buffer); + }, + function sequenceExpression(node, position, buffer) { + const { scope } = node; + node.expressions = convertNodeList(node, scope, buffer[position], buffer); + }, + function spreadElement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function staticBlock(node, position, buffer) { + const { scope } = node; + node.body = convertNodeList(node, scope, buffer[position], buffer); + }, + function superElement() { }, + function switchCase(node, position, buffer) { + const { scope } = node; + const testPosition = buffer[position]; + node.test = testPosition === 0 ? null : convertNode(node, scope, testPosition, buffer); + node.consequent = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function switchStatement(node, position, buffer) { + const { scope } = node; + node.discriminant = convertNode(node, node.parentScope, buffer[position], buffer); + node.cases = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function taggedTemplateExpression(node, position, buffer) { + const { scope } = node; + node.tag = convertNode(node, scope, buffer[position], buffer); + node.quasi = convertNode(node, scope, buffer[position + 1], buffer); + }, + function templateElement(node, position, buffer) { + const flags = buffer[position]; + node.tail = (flags & 1) === 1; + const cookedPosition = buffer[position + 1]; + const cooked = cookedPosition === 0 ? undefined : buffer.convertString(cookedPosition); + const raw = buffer.convertString(buffer[position + 2]); + node.value = { cooked, raw }; + }, + function templateLiteral(node, position, buffer) { + const { scope } = node; + node.quasis = convertNodeList(node, scope, buffer[position], buffer); + node.expressions = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function thisExpression() { }, + function throwStatement(node, position, buffer) { + const { scope } = node; + node.argument = convertNode(node, scope, buffer[position], buffer); + }, + function tryStatement(node, position, buffer) { + const { scope } = node; + node.block = convertNode(node, scope, buffer[position], buffer); + const handlerPosition = buffer[position + 1]; + node.handler = handlerPosition === 0 ? null : convertNode(node, scope, handlerPosition, buffer); + const finalizerPosition = buffer[position + 2]; + node.finalizer = + finalizerPosition === 0 ? null : convertNode(node, scope, finalizerPosition, buffer); + }, + function unaryExpression(node, position, buffer) { + const { scope } = node; + node.operator = parseAst_js.FIXED_STRINGS[buffer[position]]; + node.argument = convertNode(node, scope, buffer[position + 1], buffer); + }, + function updateExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.prefix = (flags & 1) === 1; + node.operator = parseAst_js.FIXED_STRINGS[buffer[position + 1]]; + node.argument = convertNode(node, scope, buffer[position + 2], buffer); + }, + function variableDeclaration(node, position, buffer) { + const { scope } = node; + node.kind = parseAst_js.FIXED_STRINGS[buffer[position]]; + node.declarations = convertNodeList(node, scope, buffer[position + 1], buffer); + }, + function variableDeclarator(node, position, buffer) { + const { scope } = node; + node.id = convertNode(node, scope, buffer[position], buffer); + const initPosition = buffer[position + 1]; + node.init = initPosition === 0 ? null : convertNode(node, scope, initPosition, buffer); + }, + function whileStatement(node, position, buffer) { + const { scope } = node; + node.test = convertNode(node, scope, buffer[position], buffer); + node.body = convertNode(node, scope, buffer[position + 1], buffer); + }, + function yieldExpression(node, position, buffer) { + const { scope } = node; + const flags = buffer[position]; + node.delegate = (flags & 1) === 1; + const argumentPosition = buffer[position + 1]; + node.argument = + argumentPosition === 0 ? null : convertNode(node, scope, argumentPosition, buffer); + } +]; +function convertNode(parent, parentScope, position, buffer) { + const nodeType = buffer[position]; + const NodeConstructor = nodeConstructors$1[nodeType]; + /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */ + if (!NodeConstructor) { + console.trace(); + throw new Error(`Unknown node type: ${nodeType}`); + } + const node = new NodeConstructor(parent, parentScope); + node.type = nodeTypeStrings[nodeType]; + node.start = buffer[position + 1]; + node.end = buffer[position + 2]; + bufferParsers[nodeType](node, position + 3, buffer); + node.initialise(); + return node; +} +function convertNodeList(parent, parentScope, position, buffer) { + if (position === 0) + return parseAst_js.EMPTY_ARRAY; + const length = buffer[position++]; + const list = new Array(length); + for (let index = 0; index < length; index++) { + const nodePosition = buffer[position++]; + list[index] = nodePosition ? convertNode(parent, parentScope, nodePosition, buffer) : null; + } + return list; +} + +class UnknownNode extends NodeBase { + hasEffects() { + return true; + } + include(context) { + super.include(context, true); + } +} + +// This file is generated by scripts/generate-node-index.js. +// Do not edit this file directly. +const nodeConstructors = { + ArrayExpression, + ArrayPattern, + ArrowFunctionExpression, + AssignmentExpression, + AssignmentPattern, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + CallExpression, + CatchClause, + ChainExpression, + ClassBody, + ClassDeclaration, + ClassExpression, + ConditionalExpression, + ContinueStatement, + DebuggerStatement, + Decorator, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExportSpecifier, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportAttribute, + ImportDeclaration, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, + ImportSpecifier, + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXSpreadChild, + JSXText, + LabeledStatement, + Literal, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + ObjectPattern, + PanicError, + ParseError, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, + RestElement, + ReturnStatement, + SequenceExpression, + SpreadElement, + StaticBlock, + Super, + SwitchCase, + SwitchStatement, + TaggedTemplateExpression, + TemplateElement, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UnknownNode, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + YieldExpression +}; + +class ExportShimVariable extends Variable { + constructor(module) { + super(MISSING_EXPORT_SHIM_VARIABLE); + this.module = module; + } + include() { + super.include(); + this.module.needsExportShim = true; + } +} + +const sourceMapCache = new WeakMap(); +/** + * This clears the decoded array and falls back to the encoded string form. + * Sourcemap mappings arrays can be very large and holding on to them for longer + * than is necessary leads to poor heap utilization. + */ +function resetCacheToEncoded(cache) { + if (cache.encodedMappings === undefined && cache.decodedMappings) { + cache.encodedMappings = encode(cache.decodedMappings); + } + cache.decodedMappings = undefined; +} +function resetSourcemapCache(map, sourcemapChain) { + if (map) { + const cache = sourceMapCache.get(map); + if (cache) { + resetCacheToEncoded(cache); + } + } + if (!sourcemapChain) { + return; + } + for (const map of sourcemapChain) { + if (map.missing) + continue; + resetSourcemapCache(map); + } +} +function decodedSourcemap(map) { + if (!map) + return null; + if (typeof map === 'string') { + map = JSON.parse(map); + } + if (!map.mappings) { + return { + mappings: [], + names: [], + sources: [], + version: 3 + }; + } + const originalMappings = map.mappings; + const isAlreadyDecoded = Array.isArray(originalMappings); + const cache = { + decodedMappings: isAlreadyDecoded ? originalMappings : undefined, + encodedMappings: isAlreadyDecoded ? undefined : originalMappings + }; + const decodedMap = { + ...map, + // By moving mappings behind an accessor, we can avoid unneeded computation for cases + // where the mappings field is never actually accessed. This appears to greatly reduce + // the overhead of sourcemap decoding in terms of both compute time and memory usage. + get mappings() { + if (cache.decodedMappings) { + return cache.decodedMappings; + } + // If decodedMappings doesn't exist then encodedMappings should. + // The only scenario where cache.encodedMappings should be undefined is if the map + // this was constructed from was already decoded, or if mappings was set to a new + // decoded string. In either case, this line shouldn't get hit. + cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : []; + cache.encodedMappings = undefined; + return cache.decodedMappings; + } + }; + sourceMapCache.set(decodedMap, cache); + return decodedMap; +} + +function getId(m) { + return m.id; +} + +function getOriginalLocation(sourcemapChain, location) { + const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !sourcemap.missing); + traceSourcemap: while (filteredSourcemapChain.length > 0) { + const sourcemap = filteredSourcemapChain.pop(); + const line = sourcemap.mappings[location.line - 1]; + if (line) { + const filteredLine = line.filter((segment) => segment.length > 1); + const lastSegment = filteredLine[filteredLine.length - 1]; + for (const segment of filteredLine) { + if (segment[0] >= location.column || segment === lastSegment) { + location = { + column: segment[3], + line: segment[2] + 1 + }; + continue traceSourcemap; + } + } + } + throw new Error("Can't resolve original location of error."); + } + return location; +} + +const ATTRIBUTE_KEYWORDS = new Set(['assert', 'with']); +function getAttributesFromImportExpression(node) { + const { scope: { context }, options, start } = node; + if (!(options instanceof ObjectExpression)) { + if (options) { + context.module.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logImportAttributeIsInvalid(context.module.id), start); + } + return parseAst_js.EMPTY_OBJECT; + } + const assertProperty = options.properties.find((property) => ATTRIBUTE_KEYWORDS.has(getPropertyKey(property)))?.value; + if (!assertProperty) { + return parseAst_js.EMPTY_OBJECT; + } + if (!(assertProperty instanceof ObjectExpression)) { + context.module.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logImportOptionsAreInvalid(context.module.id), start); + return parseAst_js.EMPTY_OBJECT; + } + const assertFields = assertProperty.properties + .map(property => { + const key = getPropertyKey(property); + if (typeof key === 'string' && + typeof property.value.value === 'string') { + return [key, property.value.value]; + } + context.module.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logImportAttributeIsInvalid(context.module.id), property.start); + return null; + }) + .filter((property) => !!property); + if (assertFields.length > 0) { + return Object.fromEntries(assertFields); + } + return parseAst_js.EMPTY_OBJECT; +} +const getPropertyKey = (property) => { + const key = property.key; + return (key && + !property.computed && + (key.name || key.value)); +}; +function getAttributesFromImportExportDeclaration(attributes) { + return attributes?.length + ? Object.fromEntries(attributes.map(assertion => [getPropertyKey(assertion), assertion.value.value])) + : parseAst_js.EMPTY_OBJECT; +} +function doAttributesDiffer(assertionA, assertionB) { + const keysA = Object.keys(assertionA); + return (keysA.length !== Object.keys(assertionB).length || + keysA.some(key => assertionA[key] !== assertionB[key])); +} + +let timers = new Map(); +function getPersistedLabel(label, level) { + switch (level) { + case 1: { + return `# ${label}`; + } + case 2: { + return `## ${label}`; + } + case 3: { + return label; + } + default: { + return `- ${label}`; + } + } +} +function timeStartImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const startMemory = process$1.memoryUsage().heapUsed; + const startTime = node_perf_hooks.performance.now(); + const timer = timers.get(label); + if (timer === undefined) { + timers.set(label, { + memory: 0, + startMemory, + startTime, + time: 0, + totalMemory: 0 + }); + } + else { + timer.startMemory = startMemory; + timer.startTime = startTime; + } +} +function timeEndImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const timer = timers.get(label); + if (timer !== undefined) { + const currentMemory = process$1.memoryUsage().heapUsed; + timer.memory += currentMemory - timer.startMemory; + timer.time += node_perf_hooks.performance.now() - timer.startTime; + timer.totalMemory = Math.max(timer.totalMemory, currentMemory); + } +} +function getTimings() { + const newTimings = {}; + for (const [label, { memory, time, totalMemory }] of timers) { + newTimings[label] = [time, memory, totalMemory]; + } + return newTimings; +} +let timeStart = doNothing; +let timeEnd = doNothing; +const TIMED_PLUGIN_HOOKS = [ + 'augmentChunkHash', + 'buildEnd', + 'buildStart', + 'generateBundle', + 'load', + 'moduleParsed', + 'options', + 'outputOptions', + 'renderChunk', + 'renderDynamicImport', + 'renderStart', + 'resolveDynamicImport', + 'resolveFileUrl', + 'resolveId', + 'resolveImportMeta', + 'shouldTransformCachedModule', + 'transform', + 'writeBundle' +]; +function getPluginWithTimers(plugin, index) { + if (plugin._hasTimer) + return plugin; + plugin._hasTimer = true; + for (const hook of TIMED_PLUGIN_HOOKS) { + if (hook in plugin) { + let timerLabel = `plugin ${index}`; + if (plugin.name) { + timerLabel += ` (${plugin.name})`; + } + timerLabel += ` - ${hook}`; + const handler = function (...parameters) { + timeStart(timerLabel, 4); + const result = hookFunction.apply(this, parameters); + timeEnd(timerLabel, 4); + return result; + }; + let hookFunction; + if (typeof plugin[hook].handler === 'function') { + hookFunction = plugin[hook].handler; + plugin[hook].handler = handler; + } + else { + hookFunction = plugin[hook]; + plugin[hook] = handler; + } + } + } + return plugin; +} +function initialiseTimers(inputOptions) { + if (inputOptions.perf) { + timers = new Map(); + timeStart = timeStartImpl; + timeEnd = timeEndImpl; + inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers); + } + else { + timeStart = doNothing; + timeEnd = doNothing; + } +} + +const MISSING_EXPORT_SHIM_DESCRIPTION = { + identifier: null, + localName: MISSING_EXPORT_SHIM_VARIABLE +}; +function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) { + const searchedModules = searchedNamesAndModules.get(name); + if (searchedModules) { + if (searchedModules.has(target)) { + return isExportAllSearch ? [null] : parseAst_js.error(parseAst_js.logCircularReexport(name, target.id)); + } + searchedModules.add(target); + } + else { + searchedNamesAndModules.set(name, new Set([target])); + } + return target.getVariableForExportName(name, { + importerForSideEffects, + isExportAllSearch, + searchedNamesAndModules + }); +} +function getAndExtendSideEffectModules(variable, module) { + const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, (getNewSet)); + let currentVariable = variable; + const referencedVariables = new Set([currentVariable]); + while (true) { + const importingModule = currentVariable.module; + currentVariable = + currentVariable instanceof ExportDefaultVariable + ? currentVariable.getDirectOriginalVariable() + : currentVariable instanceof SyntheticNamedExportVariable + ? currentVariable.syntheticNamespace + : null; + if (!currentVariable || referencedVariables.has(currentVariable)) { + break; + } + referencedVariables.add(currentVariable); + sideEffectModules.add(importingModule); + const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable); + if (originalSideEffects) { + for (const module of originalSideEffects) { + sideEffectModules.add(module); + } + } + } + return sideEffectModules; +} +class Module { + constructor(graph, id, options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes) { + this.graph = graph; + this.id = id; + this.options = options; + this.alternativeReexportModules = new Map(); + this.chunkFileNames = new Set(); + this.chunkNames = []; + this.cycles = new Set(); + this.dependencies = new Set(); + this.dynamicDependencies = new Set(); + this.dynamicImporters = []; + this.dynamicImports = []; + this.execIndex = Infinity; + this.hasTreeShakingPassStarted = false; + this.implicitlyLoadedAfter = new Set(); + this.implicitlyLoadedBefore = new Set(); + this.importDescriptions = new Map(); + this.importMetas = []; + this.importedFromNotTreeshaken = false; + this.importers = []; + this.includedDynamicImporters = []; + this.includedImports = new Set(); + this.isExecuted = false; + this.isUserDefinedEntryPoint = false; + this.needsExportShim = false; + this.sideEffectDependenciesByVariable = new Map(); + this.sourcesWithAttributes = new Map(); + this.allExportNames = null; + this.ast = null; + this.exportAllModules = []; + this.exportAllSources = new Set(); + this.exportNamesByVariable = null; + this.exportShimVariable = new ExportShimVariable(this); + this.exports = new Map(); + this.namespaceReexportsByName = new Map(); + this.reexportDescriptions = new Map(); + this.relevantDependencies = null; + this.syntheticExports = new Map(); + this.syntheticNamespace = null; + this.transformDependencies = []; + this.transitiveReexports = null; + this.excludeFromSourcemap = /\0/.test(id); + this.context = options.moduleContext(id); + this.preserveSignature = this.options.preserveEntrySignatures; + // eslint-disable-next-line @typescript-eslint/no-this-alias + const module = this; + const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this; + this.info = { + ast: null, + attributes, + code: null, + get dynamicallyImportedIdResolutions() { + return dynamicImports + .map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument]) + .filter(Boolean); + }, + get dynamicallyImportedIds() { + // We cannot use this.dynamicDependencies because this is needed before + // dynamicDependencies are populated + return dynamicImports.map(({ id }) => id).filter((id) => id != null); + }, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + get exportedBindings() { + const exportBindings = { '.': [...exports.keys()] }; + for (const [name, { source }] of reexportDescriptions) { + (exportBindings[source] ??= []).push(name); + } + for (const source of exportAllSources) { + (exportBindings[source] ??= []).push('*'); + } + return exportBindings; + }, + get exports() { + return [ + ...exports.keys(), + ...reexportDescriptions.keys(), + ...[...exportAllSources].map(() => '*') + ]; + }, + get hasDefaultExport() { + // This information is only valid after parsing + if (!module.ast) { + return null; + } + return module.exports.has('default') || reexportDescriptions.has('default'); + }, + id, + get implicitlyLoadedAfterOneOf() { + return Array.from(implicitlyLoadedAfter, getId).sort(); + }, + get implicitlyLoadedBefore() { + return Array.from(implicitlyLoadedBefore, getId).sort(); + }, + get importedIdResolutions() { + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]).filter(Boolean); + }, + get importedIds() { + // We cannot use this.dependencies because this is needed before + // dependencies are populated + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id).filter(Boolean); + }, + get importers() { + return importers.sort(); + }, + isEntry, + isExternal: false, + get isIncluded() { + if (graph.phase !== BuildPhase.GENERATE) { + return null; + } + return module.isIncluded(); + }, + meta: { ...meta }, + moduleSideEffects, + syntheticNamedExports + }; + } + basename() { + const base = path.basename(this.id); + const extension = path.extname(this.id); + return makeLegal(extension ? base.slice(0, -extension.length) : base); + } + bindReferences() { + this.ast.bind(); + } + cacheInfoGetters() { + cacheObjectGetters(this.info, [ + 'dynamicallyImportedIdResolutions', + 'dynamicallyImportedIds', + 'dynamicImporters', + 'exportedBindings', + 'exports', + 'hasDefaultExport', + 'implicitlyLoadedAfterOneOf', + 'implicitlyLoadedBefore', + 'importedIdResolutions', + 'importedIds', + 'importers' + ]); + } + error(properties, pos) { + if (pos !== undefined) { + this.addLocationToLogProps(properties, pos); + } + return parseAst_js.error(properties); + } + // sum up the length of all ast nodes that are included + estimateSize() { + let size = 0; + for (const node of this.ast.body) { + if (node.included) { + size += node.end - node.start; + } + } + return size; + } + getAllExportNames() { + if (this.allExportNames) { + return this.allExportNames; + } + this.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + this.allExportNames.add(`*${module.id}`); + continue; + } + for (const name of module.getAllExportNames()) { + if (name !== 'default') + this.allExportNames.add(name); + } + } + // We do not count the synthetic namespace as a regular export to hide it + // from entry signatures and namespace objects + if (typeof this.info.syntheticNamedExports === 'string') { + this.allExportNames.delete(this.info.syntheticNamedExports); + } + return this.allExportNames; + } + getDependenciesToBeIncluded() { + if (this.relevantDependencies) + return this.relevantDependencies; + this.relevantDependencies = new Set(); + const necessaryDependencies = new Set(); + const alwaysCheckedDependencies = new Set(); + const dependencyVariables = new Set(this.includedImports); + if (this.info.isEntry || + this.includedDynamicImporters.length > 0 || + this.namespace.included || + this.implicitlyLoadedAfter.size > 0) { + for (const exportName of [...this.getReexports(), ...this.getExports()]) { + const [exportedVariable] = this.getVariableForExportName(exportName); + if (exportedVariable?.included) { + dependencyVariables.add(exportedVariable); + } + } + } + for (let variable of dependencyVariables) { + const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable); + if (sideEffectDependencies) { + for (const module of sideEffectDependencies) { + alwaysCheckedDependencies.add(module); + } + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + else if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + necessaryDependencies.add(variable.module); + } + if (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of this.dependencies) { + this.relevantDependencies.add(dependency); + } + } + else { + this.addRelevantSideEffectDependencies(this.relevantDependencies, necessaryDependencies, alwaysCheckedDependencies); + } + for (const dependency of necessaryDependencies) { + this.relevantDependencies.add(dependency); + } + return this.relevantDependencies; + } + getExportNamesByVariable() { + if (this.exportNamesByVariable) { + return this.exportNamesByVariable; + } + const exportNamesByVariable = new Map(); + for (const exportName of this.getAllExportNames()) { + let [tracedVariable] = this.getVariableForExportName(exportName); + if (tracedVariable instanceof ExportDefaultVariable) { + tracedVariable = tracedVariable.getOriginalVariable(); + } + if (!tracedVariable || + !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) { + continue; + } + const existingExportNames = exportNamesByVariable.get(tracedVariable); + if (existingExportNames) { + existingExportNames.push(exportName); + } + else { + exportNamesByVariable.set(tracedVariable, [exportName]); + } + } + return (this.exportNamesByVariable = exportNamesByVariable); + } + getExports() { + return [...this.exports.keys()]; + } + getReexports() { + if (this.transitiveReexports) { + return this.transitiveReexports; + } + // to avoid infinite recursion when using circular `export * from X` + this.transitiveReexports = []; + const reexports = new Set(this.reexportDescriptions.keys()); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + reexports.add(`*${module.id}`); + } + else { + for (const name of [...module.getReexports(), ...module.getExports()]) { + if (name !== 'default') + reexports.add(name); + } + } + } + return (this.transitiveReexports = [...reexports]); + } + getRenderedExports() { + // only direct exports are counted here, not reexports at all + const renderedExports = []; + const removedExports = []; + for (const exportName of this.exports.keys()) { + const [variable] = this.getVariableForExportName(exportName); + (variable?.included ? renderedExports : removedExports).push(exportName); + } + return { removedExports, renderedExports }; + } + getSyntheticNamespace() { + if (this.syntheticNamespace === null) { + this.syntheticNamespace = undefined; + [this.syntheticNamespace] = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string' + ? this.info.syntheticNamedExports + : 'default', { onlyExplicit: true }); + } + if (!this.syntheticNamespace) { + return parseAst_js.error(parseAst_js.logSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)); + } + return this.syntheticNamespace; + } + getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules } = parseAst_js.EMPTY_OBJECT) { + if (name[0] === '*') { + if (name.length === 1) { + // export * from './other' + return [this.namespace]; + } + // export * from 'external' + const module = this.graph.modulesById.get(name.slice(1)); + return module.getVariableForExportName('*'); + } + // export { foo } from './other' + const reexportDeclaration = this.reexportDescriptions.get(name); + if (reexportDeclaration) { + const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules); + if (!variable) { + return this.error(parseAst_js.logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start); + } + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + if (this.info.moduleSideEffects) { + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + } + return [variable]; + } + const exportDeclaration = this.exports.get(name); + if (exportDeclaration) { + if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { + return [this.exportShimVariable]; + } + const name = exportDeclaration.localName; + const variable = this.traceVariable(name, { + importerForSideEffects, + searchedNamesAndModules + }); + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + return [variable]; + } + if (onlyExplicit) { + return [null]; + } + if (name !== 'default') { + const foundNamespaceReexport = this.namespaceReexportsByName.get(name) ?? + this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules); + this.namespaceReexportsByName.set(name, foundNamespaceReexport); + if (foundNamespaceReexport[0]) { + return foundNamespaceReexport; + } + } + if (this.info.syntheticNamedExports) { + return [ + getOrCreate(this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())) + ]; + } + // we don't want to create shims when we are just + // probing export * modules for exports + if (!isExportAllSearch && this.options.shimMissingExports) { + this.shimMissingExport(name); + return [this.exportShimVariable]; + } + return [null]; + } + hasEffects() { + return this.info.moduleSideEffects === 'no-treeshake' || this.ast.hasCachedEffects(); + } + include() { + const context = createInclusionContext(); + if (this.ast.shouldBeIncluded(context)) + this.ast.include(context, false); + } + includeAllExports(includeNamespaceMembers) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + for (const exportName of this.exports.keys()) { + if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { + const variable = this.getVariableForExportName(exportName)[0]; + if (!variable) { + return parseAst_js.error(parseAst_js.logMissingEntryExport(exportName, this.id)); + } + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + } + for (const name of this.getReexports()) { + const [variable] = this.getVariableForExportName(name); + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + if (variable instanceof ExternalVariable) { + variable.module.reexported = true; + } + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + includeAllInBundle() { + this.ast.include(createInclusionContext(), true); + this.includeAllExports(false); + } + includeExportsByNames(names) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + let includeNamespaceMembers = false; + for (const name of names) { + const variable = this.getVariableForExportName(name)[0]; + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + if (!this.exports.has(name) && !this.reexportDescriptions.has(name)) { + includeNamespaceMembers = true; + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + isIncluded() { + // Modules where this.ast is missing have been loaded via this.load and are + // not yet fully processed, hence they cannot be included. + return (this.ast && + (this.ast.included || + this.namespace.included || + this.importedFromNotTreeshaken || + this.exportShimVariable.included)); + } + linkImports() { + this.addModulesToImportDescriptions(this.importDescriptions); + this.addModulesToImportDescriptions(this.reexportDescriptions); + const externalExportAllModules = []; + for (const source of this.exportAllSources) { + const module = this.graph.modulesById.get(this.resolvedIds[source].id); + if (module instanceof ExternalModule) { + externalExportAllModules.push(module); + continue; + } + this.exportAllModules.push(module); + } + this.exportAllModules.push(...externalExportAllModules); + } + log(level, properties, pos) { + this.addLocationToLogProps(properties, pos); + this.options.onLog(level, properties); + } + render(options) { + const source = this.magicString.clone(); + this.ast.render(source, options); + source.trim(); + const { usesTopLevelAwait } = this.astContext; + if (usesTopLevelAwait && options.format !== 'es' && options.format !== 'system') { + return parseAst_js.error(parseAst_js.logInvalidFormatForTopLevelAwait(this.id, options.format)); + } + return { source, usesTopLevelAwait }; + } + async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) { + timeStart('generate ast', 3); + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n'); + this.shebang = code.slice(2, shebangEndPosition); + } + this.info.code = code; + this.originalCode = originalCode; + // We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't + // have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the + // RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap` + this.originalSourcemap = decodedSourcemap(originalSourcemap); + this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing)); + // If coming from cache and this value is already fully decoded, we want to re-encode here to save memory. + resetSourcemapCache(this.originalSourcemap, this.sourcemapChain); + if (transformFiles) { + this.transformFiles = transformFiles; + } + this.transformDependencies = transformDependencies; + this.customTransformCache = customTransformCache; + this.updateOptions(moduleOptions); + this.resolvedIds = resolvedIds ?? Object.create(null); + // By default, `id` is the file name. Custom resolvers and loaders + // can change that, but it makes sense to use it for the source file name + const fileName = this.id; + this.magicString = new MagicString(code, { + filename: (this.excludeFromSourcemap ? null : fileName), // don't include plugin helpers in sourcemap + indentExclusionRanges: [] + }); + this.astContext = { + addDynamicImport: this.addDynamicImport.bind(this), + addExport: this.addExport.bind(this), + addImport: this.addImport.bind(this), + addImportMeta: this.addImportMeta.bind(this), + addImportSource: this.addImportSource.bind(this), + code, // Only needed for debugging + deoptimizationTracker: this.graph.deoptimizationTracker, + error: this.error.bind(this), + fileName, // Needed for warnings + getExports: this.getExports.bind(this), + getImportedJsxFactoryVariable: this.getImportedJsxFactoryVariable.bind(this), + getModuleExecIndex: () => this.execIndex, + getModuleName: this.basename.bind(this), + getNodeConstructor: (name) => nodeConstructors[name] || nodeConstructors.UnknownNode, + getReexports: this.getReexports.bind(this), + importDescriptions: this.importDescriptions, + includeAllExports: () => this.includeAllExports(true), + includeDynamicImport: this.includeDynamicImport.bind(this), + includeVariableInModule: this.includeVariableInModule.bind(this), + log: this.log.bind(this), + magicString: this.magicString, + manualPureFunctions: this.graph.pureFunctions, + module: this, + moduleContext: this.context, + options: this.options, + requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), + traceExport: (name) => this.getVariableForExportName(name)[0], + traceVariable: this.traceVariable.bind(this), + usesTopLevelAwait: false + }; + this.scope = new ModuleScope(this.graph.scope, this.astContext); + this.namespace = new NamespaceVariable(this.astContext); + const programParent = { context: this.astContext, type: 'Module' }; + if (ast) { + this.ast = new nodeConstructors[ast.type](programParent, this.scope).parseNode(ast); + this.info.ast = ast; + } + else { + // Measuring asynchronous code does not provide reasonable results + timeEnd('generate ast', 3); + const astBuffer = await native_js.parseAsync(code, false, this.options.jsx !== false); + timeStart('generate ast', 3); + this.ast = convertProgram(astBuffer, programParent, this.scope); + // Make lazy and apply LRU cache to not hog the memory + Object.defineProperty(this.info, 'ast', { + get: () => { + if (this.graph.astLru.has(fileName)) { + return this.graph.astLru.get(fileName); + } + else { + const parsedAst = this.tryParse(); + // If the cache is not disabled, we need to keep the AST in memory + // until the end when the cache is generated + if (this.options.cache !== false) { + Object.defineProperty(this.info, 'ast', { + value: parsedAst + }); + return parsedAst; + } + // Otherwise, we keep it in a small LRU cache to not hog too much + // memory but allow the same AST to be requested several times. + this.graph.astLru.set(fileName, parsedAst); + return parsedAst; + } + } + }); + } + timeEnd('generate ast', 3); + } + toJSON() { + return { + ast: this.info.ast, + attributes: this.info.attributes, + code: this.info.code, + customTransformCache: this.customTransformCache, + dependencies: Array.from(this.dependencies, getId), + id: this.id, + meta: this.info.meta, + moduleSideEffects: this.info.moduleSideEffects, + originalCode: this.originalCode, + originalSourcemap: this.originalSourcemap, + resolvedIds: this.resolvedIds, + sourcemapChain: this.sourcemapChain, + syntheticNamedExports: this.info.syntheticNamedExports, + transformDependencies: this.transformDependencies, + transformFiles: this.transformFiles + }; + } + traceVariable(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules } = parseAst_js.EMPTY_OBJECT) { + const localVariable = this.scope.variables.get(name); + if (localVariable) { + return localVariable; + } + const importDescription = this.importDescriptions.get(name); + if (importDescription) { + const otherModule = importDescription.module; + if (otherModule instanceof Module && importDescription.name === '*') { + return otherModule.namespace; + } + const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules); + if (!declaration) { + return this.error(parseAst_js.logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start); + } + return declaration; + } + return null; + } + updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) { + if (moduleSideEffects != null) { + this.info.moduleSideEffects = moduleSideEffects; + } + if (syntheticNamedExports != null) { + this.info.syntheticNamedExports = syntheticNamedExports; + } + if (meta != null) { + Object.assign(this.info.meta, meta); + } + } + addDynamicImport(node) { + let argument = node.sourceAstNode; + if (argument.type === parseAst_js.TemplateLiteral) { + if (argument.quasis.length === 1 && + typeof argument.quasis[0].value.cooked === 'string') { + argument = argument.quasis[0].value.cooked; + } + } + else if (argument.type === parseAst_js.Literal && + typeof argument.value === 'string') { + argument = argument.value; + } + this.dynamicImports.push({ argument, id: null, node, resolution: null }); + } + assertUniqueExportName(name, nodeStart) { + if (this.exports.has(name) || this.reexportDescriptions.has(name)) { + this.error(parseAst_js.logDuplicateExportError(name), nodeStart); + } + } + addExport(node) { + if (node instanceof ExportDefaultDeclaration) { + // export default foo; + this.assertUniqueExportName('default', node.start); + this.exports.set('default', { + identifier: node.variable.getAssignedVariableName(), + localName: 'default' + }); + } + else if (node instanceof ExportAllDeclaration) { + const source = node.source.value; + this.addSource(source, node); + if (node.exported) { + // export * as name from './other' + const name = node.exported instanceof Literal ? node.exported.value : node.exported.name; + this.assertUniqueExportName(name, node.exported.start); + this.reexportDescriptions.set(name, { + localName: '*', + module: null, // filled in later, + source, + start: node.start + }); + } + else { + // export * from './other' + this.exportAllSources.add(source); + } + } + else if (node.source instanceof Literal) { + // export { name } from './other' + const source = node.source.value; + this.addSource(source, node); + for (const { exported, local, start } of node.specifiers) { + const name = exported instanceof Literal ? exported.value : exported.name; + this.assertUniqueExportName(name, start); + this.reexportDescriptions.set(name, { + localName: local instanceof Literal ? local.value : local.name, + module: null, // filled in later, + source, + start + }); + } + } + else if (node.declaration) { + const declaration = node.declaration; + if (declaration instanceof VariableDeclaration) { + // export var { foo, bar } = ... + // export var foo = 1, bar = 2; + for (const declarator of declaration.declarations) { + for (const localName of extractAssignedNames(declarator.id)) { + this.assertUniqueExportName(localName, declarator.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + } + else { + // export function foo () {} + const localName = declaration.id.name; + this.assertUniqueExportName(localName, declaration.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + else { + // export { foo, bar, baz } + for (const { local, exported } of node.specifiers) { + // except for reexports, local must be an Identifier + const localName = local.name; + const exportedName = exported instanceof Identifier ? exported.name : exported.value; + this.assertUniqueExportName(exportedName, exported.start); + this.exports.set(exportedName, { identifier: null, localName }); + } + } + } + addImport(node) { + const source = node.source.value; + this.addSource(source, node); + for (const specifier of node.specifiers) { + const localName = specifier.local.name; + if (this.scope.variables.has(localName) || this.importDescriptions.has(localName)) { + this.error(parseAst_js.logRedeclarationError(localName), specifier.local.start); + } + const name = specifier instanceof ImportDefaultSpecifier + ? 'default' + : specifier instanceof ImportNamespaceSpecifier + ? '*' + : specifier.imported instanceof Identifier + ? specifier.imported.name + : specifier.imported.value; + this.importDescriptions.set(localName, { + module: null, // filled in later + name, + source, + start: specifier.start + }); + } + } + addImportSource(importSource) { + if (importSource && !this.sourcesWithAttributes.has(importSource)) { + this.sourcesWithAttributes.set(importSource, parseAst_js.EMPTY_OBJECT); + } + } + addImportMeta(node) { + this.importMetas.push(node); + } + addLocationToLogProps(properties, pos) { + properties.id = this.id; + properties.pos = pos; + let code = this.info.code; + const location = parseAst_js.locate(code, pos, { offsetLine: 1 }); + if (location) { + let { column, line } = location; + try { + ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); + code = this.originalCode; + } + catch (error_) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInvalidSourcemapForError(error_, this.id, column, line, pos)); + } + parseAst_js.augmentCodeLocation(properties, { column, line }, code, this.id); + } + } + addModulesToImportDescriptions(importDescription) { + for (const specifier of importDescription.values()) { + const { id } = this.resolvedIds[specifier.source]; + specifier.module = this.graph.modulesById.get(id); + } + } + addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) { + const handledDependencies = new Set(); + const addSideEffectDependencies = (possibleDependencies) => { + for (const dependency of possibleDependencies) { + if (handledDependencies.has(dependency)) { + continue; + } + handledDependencies.add(dependency); + if (necessaryDependencies.has(dependency)) { + relevantDependencies.add(dependency); + continue; + } + if (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) { + continue; + } + if (dependency instanceof ExternalModule || dependency.hasEffects()) { + relevantDependencies.add(dependency); + continue; + } + addSideEffectDependencies(dependency.dependencies); + } + }; + addSideEffectDependencies(this.dependencies); + addSideEffectDependencies(alwaysCheckedDependencies); + } + addSource(source, declaration) { + const parsedAttributes = getAttributesFromImportExportDeclaration(declaration.attributes); + const existingAttributes = this.sourcesWithAttributes.get(source); + if (existingAttributes) { + if (doAttributesDiffer(existingAttributes, parsedAttributes)) { + this.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInconsistentImportAttributes(existingAttributes, parsedAttributes, source, this.id), declaration.start); + } + } + else { + this.sourcesWithAttributes.set(source, parsedAttributes); + } + } + getImportedJsxFactoryVariable(baseName, nodeStart, importSource) { + const { id } = this.resolvedIds[importSource]; + const module = this.graph.modulesById.get(id); + const [variable] = module.getVariableForExportName(baseName); + if (!variable) { + return this.error(parseAst_js.logMissingJsxExport(baseName, id, this.id), nodeStart); + } + return variable; + } + getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules) { + let foundSyntheticDeclaration = null; + const foundInternalDeclarations = new Map(); + const foundExternalDeclarations = new Set(); + for (const module of this.exportAllModules) { + // Synthetic namespaces should not hide "regular" exports of the same name + if (module.info.syntheticNamedExports === name) { + continue; + } + const [variable, indirectExternal] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, + // We are creating a copy to handle the case where the same binding is + // imported through different namespace reexports gracefully + copyNameToModulesMap(searchedNamesAndModules)); + if (module instanceof ExternalModule || indirectExternal) { + foundExternalDeclarations.add(variable); + } + else if (variable instanceof SyntheticNamedExportVariable) { + if (!foundSyntheticDeclaration) { + foundSyntheticDeclaration = variable; + } + } + else if (variable) { + foundInternalDeclarations.set(variable, module); + } + } + if (foundInternalDeclarations.size > 0) { + const foundDeclarationList = [...foundInternalDeclarations]; + const usedDeclaration = foundDeclarationList[0][0]; + if (foundDeclarationList.length === 1) { + return [usedDeclaration]; + } + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logNamespaceConflict(name, this.id, foundDeclarationList.map(([, module]) => module.id))); + // TODO we are pretending it was not found while it should behave like "undefined" + return [null]; + } + if (foundExternalDeclarations.size > 0) { + const foundDeclarationList = [...foundExternalDeclarations]; + const usedDeclaration = foundDeclarationList[0]; + if (foundDeclarationList.length > 1) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id))); + } + return [usedDeclaration, true]; + } + if (foundSyntheticDeclaration) { + return [foundSyntheticDeclaration]; + } + return [null]; + } + includeAndGetAdditionalMergedNamespaces() { + const externalNamespaces = new Set(); + const syntheticNamespaces = new Set(); + for (const module of [this, ...this.exportAllModules]) { + if (module instanceof ExternalModule) { + const [externalVariable] = module.getVariableForExportName('*'); + externalVariable.include(); + this.includedImports.add(externalVariable); + externalNamespaces.add(externalVariable); + } + else if (module.info.syntheticNamedExports) { + const syntheticNamespace = module.getSyntheticNamespace(); + syntheticNamespace.include(); + this.includedImports.add(syntheticNamespace); + syntheticNamespaces.add(syntheticNamespace); + } + } + return [...syntheticNamespaces, ...externalNamespaces]; + } + includeDynamicImport(node) { + const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution; + if (resolution instanceof Module) { + resolution.includedDynamicImporters.push(this); + const importedNames = this.options.treeshake + ? node.getDeterministicImportedNames() + : undefined; + if (importedNames) { + resolution.includeExportsByNames(importedNames); + } + else { + resolution.includeAllExports(true); + } + } + } + includeVariable(variable) { + const variableModule = variable.module; + if (variable.included) { + if (variableModule instanceof Module && variableModule !== this) { + getAndExtendSideEffectModules(variable, this); + } + } + else { + variable.include(); + this.graph.needsTreeshakingPass = true; + if (variableModule instanceof Module) { + if (!variableModule.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(variableModule); + } + if (variableModule !== this) { + const sideEffectModules = getAndExtendSideEffectModules(variable, this); + for (const module of sideEffectModules) { + if (!module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(module); + } + } + } + } + } + } + includeVariableInModule(variable) { + this.includeVariable(variable); + const variableModule = variable.module; + if (variableModule && variableModule !== this) { + this.includedImports.add(variable); + } + } + shimMissingExport(name) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logShimmedExport(this.id, name)); + this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); + } + tryParse() { + try { + return parseAst_js.parseAst(this.info.code, { jsx: this.options.jsx !== false }); + } + catch (error_) { + return this.error(parseAst_js.logModuleParseError(error_, this.id), error_.pos); + } + } +} +// if there is a cyclic import in the reexport chain, we should not +// import from the original module but from the cyclic module to not +// mess up execution order. +function setAlternativeExporterIfCyclic(variable, importer, reexporter) { + if (variable.module instanceof Module && variable.module !== reexporter) { + const exporterCycles = variable.module.cycles; + if (exporterCycles.size > 0) { + const importerCycles = reexporter.cycles; + for (const cycleSymbol of importerCycles) { + if (exporterCycles.has(cycleSymbol)) { + importer.alternativeReexportModules.set(variable, reexporter); + break; + } + } + } + } +} +const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules && + new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)])); + +const concatSeparator = (out, next) => (next ? `${out}\n${next}` : out); +const concatDblSeparator = (out, next) => (next ? `${out}\n\n${next}` : out); +async function createAddons(options, outputPluginDriver, chunk) { + try { + let [banner, footer, intro, outro] = await Promise.all([ + outputPluginDriver.hookReduceValue('banner', options.banner(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('footer', options.footer(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('intro', options.intro(chunk), [chunk], concatDblSeparator), + outputPluginDriver.hookReduceValue('outro', options.outro(chunk), [chunk], concatDblSeparator) + ]); + if (intro) + intro += '\n\n'; + if (outro) + outro = `\n\n${outro}`; + if (banner) + banner += '\n'; + if (footer) + footer = '\n' + footer; + return { banner, footer, intro, outro }; + } + catch (error_) { + return parseAst_js.error(parseAst_js.logAddonNotGenerated(error_.message, error_.hook, error_.plugin)); + } +} + +const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = { + amd: deconflictImportsOther, + cjs: deconflictImportsOther, + es: deconflictImportsEsmOrSystem, + iife: deconflictImportsOther, + system: deconflictImportsEsmOrSystem, + umd: deconflictImportsOther +}; +function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) { + const reversedModules = [...modules].reverse(); + for (const module of reversedModules) { + module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + } + deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces); + DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports); + for (const module of reversedModules) { + module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } +} +function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) { + // This is needed for namespace reexports + for (const dependency of dependenciesToBeDeconflicted.dependencies) { + if (preserveModules || dependency instanceof ExternalChunk) { + dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null); + } + } + for (const variable of imports) { + const module = variable.module; + const name = variable.name; + if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) { + variable.setRenderNames(null, (module instanceof ExternalModule + ? externalChunkByModule.get(module) + : chunkByModule.get(module)).variableName); + } + else if (module instanceof ExternalModule && name === 'default') { + variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included) + ? module.suggestedVariableName + '__default' + : module.suggestedVariableName, usedNames, variable.forbiddenNames)); + } + else { + variable.setRenderNames(null, getSafeName(makeLegal(name), usedNames, variable.forbiddenNames)); + } + } + for (const variable of syntheticExports) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } +} +function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule) { + for (const chunk of dependencies) { + chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null); + } + for (const chunk of deconflictedNamespace) { + chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames, null); + } + for (const externalModule of deconflictedDefault) { + externalModule.defaultVariableName = + deconflictedNamespace.has(externalModule) && + canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings) + ? externalModule.namespaceVariableName + : getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null); + } + for (const variable of imports) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = externalChunkByModule.get(module); + const name = variable.name; + if (name === 'default') { + const moduleInterop = interop(module.id); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? chunk.defaultVariableName + : chunk.variableName; + if (isDefaultAProperty(moduleInterop, externalLiveBindings)) { + variable.setRenderNames(variableName, 'default'); + } + else { + variable.setRenderNames(null, variableName); + } + } + else if (name === '*') { + variable.setRenderNames(null, namespaceInteropHelpersByInteropType[interop(module.id)] + ? chunk.namespaceVariableName + : chunk.variableName); + } + else { + // if the second parameter is `null`, it uses its "name" for the property name + variable.setRenderNames(chunk.variableName, null); + } + } + else { + const chunk = chunkByModule.get(module); + if (preserveModules && variable.isNamespace) { + variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName); + } + else if (chunk.exportMode === 'default') { + variable.setRenderNames(null, chunk.variableName); + } + else { + variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable)); + } + } + } +} +function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) { + for (const module of modules) { + for (const variable of module.scope.variables.values()) { + if (variable.included && + // this will only happen for exports in some formats + !(variable.renderBaseName || + (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } + } + if (includedNamespaces.has(module)) { + const namespace = module.namespace; + namespace.setRenderNames(null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames)); + } + } +} + +function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) { + let nameIndex = 0; + for (const variable of exports) { + let [exportName] = variable.name; + if (exportsByName.has(exportName)) { + do { + exportName = toBase64(++nameIndex); + // skip past leading number identifiers + if (exportName.charCodeAt(0) === 49 /* '1' */) { + nameIndex += 9 * 64 ** (exportName.length - 1); + exportName = toBase64(nameIndex); + } + } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName)); + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} +function assignExportsToNames(exports, exportsByName, exportNamesByVariable) { + for (const variable of exports) { + let nameIndex = 0; + let exportName = variable.name; + while (exportsByName.has(exportName)) { + exportName = variable.name + '$' + ++nameIndex; + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} + +function getExportMode(chunk, { exports: exportMode, name, format }, facadeModuleId, log) { + const exportKeys = chunk.getExportNames(); + if (exportMode === 'default') { + if (exportKeys.length !== 1 || exportKeys[0] !== 'default') { + return parseAst_js.error(parseAst_js.logIncompatibleExportOptionValue('default', exportKeys, facadeModuleId)); + } + } + else if (exportMode === 'none' && exportKeys.length > 0) { + return parseAst_js.error(parseAst_js.logIncompatibleExportOptionValue('none', exportKeys, facadeModuleId)); + } + if (exportMode === 'auto') { + if (exportKeys.length === 0) { + exportMode = 'none'; + } + else if (exportKeys.length === 1 && exportKeys[0] === 'default') { + exportMode = 'default'; + } + else { + if (format !== 'es' && format !== 'system' && exportKeys.includes('default')) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMixedExport(facadeModuleId, name)); + } + exportMode = 'named'; + } + } + return exportMode; +} + +function guessIndentString(code) { + const lines = code.split('\n'); + const tabbed = lines.filter(line => /^\t+/.test(line)); + const spaced = lines.filter(line => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numberSpaces = /^ +/.exec(current)[0].length; + return Math.min(numberSpaces, previous); + }, Infinity); + return ' '.repeat(min); +} +function getIndentString(modules, options) { + if (options.indent !== true) + return options.indent; + for (const module of modules) { + const indent = guessIndentString(module.originalCode); + if (indent !== null) + return indent; + } + return '\t'; +} + +function getStaticDependencies(chunk, orderedModules, chunkByModule, externalChunkByModule) { + const staticDependencyBlocks = []; + const handledDependencies = new Set(); + for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) { + const module = orderedModules[modulePos]; + if (!handledDependencies.has(module)) { + const staticDependencies = []; + addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule, externalChunkByModule); + staticDependencyBlocks.unshift(staticDependencies); + } + } + const dependencies = new Set(); + for (const block of staticDependencyBlocks) { + for (const dependency of block) { + dependencies.add(dependency); + } + } + return dependencies; +} +function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule) { + const dependencies = module.getDependenciesToBeIncluded(); + for (const dependency of dependencies) { + if (dependency instanceof ExternalModule) { + staticDependencies.push(externalChunkByModule.get(dependency)); + continue; + } + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk !== chunk) { + staticDependencies.push(dependencyChunk); + continue; + } + if (!handledModules.has(dependency)) { + handledModules.add(dependency); + addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule); + } + } +} + +const NON_ASSET_EXTENSIONS = new Set([ + '.js', + '.jsx', + '.ts', + '.tsx', + '.mjs', + '.mts', + '.cjs', + '.cts' +]); +function getGlobalName(chunk, globals, hasExports, log) { + const globalName = typeof globals === 'function' ? globals(chunk.id) : globals[chunk.id]; + if (globalName) { + return globalName; + } + if (hasExports) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingGlobalName(chunk.id, chunk.variableName)); + return chunk.variableName; + } +} +class Chunk { + constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias, getPlaceholder, bundle, inputBase, snippets) { + this.orderedModules = orderedModules; + this.inputOptions = inputOptions; + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.pluginDriver = pluginDriver; + this.modulesById = modulesById; + this.chunkByModule = chunkByModule; + this.externalChunkByModule = externalChunkByModule; + this.facadeChunkByModule = facadeChunkByModule; + this.includedNamespaces = includedNamespaces; + this.manualChunkAlias = manualChunkAlias; + this.getPlaceholder = getPlaceholder; + this.bundle = bundle; + this.inputBase = inputBase; + this.snippets = snippets; + this.entryModules = []; + this.exportMode = 'named'; + this.facadeModule = null; + this.namespaceVariableName = ''; + this.variableName = ''; + this.accessedGlobalsByScope = new Map(); + this.dependencies = new Set(); + this.dynamicEntryModules = []; + this.dynamicName = null; + this.exportNamesByVariable = new Map(); + this.exports = new Set(); + this.exportsByName = new Map(); + this.fileName = null; + this.implicitEntryModules = []; + this.implicitlyLoadedBefore = new Set(); + this.imports = new Set(); + this.includedDynamicImports = null; + this.includedReexportsByModule = new Map(); + // This may be updated in the constructor + this.isEmpty = true; + this.name = null; + this.needsExportsShim = false; + this.preRenderedChunkInfo = null; + this.preliminaryFileName = null; + this.preliminarySourcemapFileName = null; + this.renderedChunkInfo = null; + this.renderedDependencies = null; + this.renderedModules = Object.create(null); + this.sortedExportNames = null; + this.strictFacade = false; + this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity; + const chunkModules = new Set(orderedModules); + for (const module of orderedModules) { + chunkByModule.set(module, this); + if (module.namespace.included && !outputOptions.preserveModules) { + includedNamespaces.add(module); + } + if (this.isEmpty && module.isIncluded()) { + this.isEmpty = false; + } + if (module.info.isEntry || outputOptions.preserveModules) { + this.entryModules.push(module); + } + for (const importer of module.includedDynamicImporters) { + if (!chunkModules.has(importer)) { + this.dynamicEntryModules.push(module); + // Modules with synthetic exports need an artificial namespace for dynamic imports + if (module.info.syntheticNamedExports) { + includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + } + if (module.implicitlyLoadedAfter.size > 0) { + this.implicitEntryModules.push(module); + } + } + this.suggestedVariableName = makeLegal(this.generateVariableName()); + } + static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName, getPlaceholder, bundle, inputBase, snippets) { + const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, null, getPlaceholder, bundle, inputBase, snippets); + chunk.assignFacadeName(facadeName, facadedModule); + if (!facadeChunkByModule.has(facadedModule)) { + facadeChunkByModule.set(facadedModule, chunk); + } + for (const dependency of facadedModule.getDependenciesToBeIncluded()) { + chunk.dependencies.add(dependency instanceof Module + ? chunkByModule.get(dependency) + : externalChunkByModule.get(dependency)); + } + if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) && + facadedModule.info.moduleSideEffects && + facadedModule.hasEffects()) { + chunk.dependencies.add(chunkByModule.get(facadedModule)); + } + chunk.ensureReexportsAreAvailableForModule(facadedModule); + chunk.facadeModule = facadedModule; + chunk.strictFacade = true; + return chunk; + } + canModuleBeFacade(module, exposedVariables) { + const moduleExportNamesByVariable = module.getExportNamesByVariable(); + // All exports of this chunk need to be exposed by the candidate module + for (const exposedVariable of this.exports) { + if (!moduleExportNamesByVariable.has(exposedVariable)) { + return false; + } + } + // Additionally, we need to expose namespaces of dynamic entries that are not the facade module and exports from other entry modules + for (const exposedVariable of exposedVariables) { + if (!(exposedVariable.module === module || + moduleExportNamesByVariable.has(exposedVariable) || + (exposedVariable instanceof SyntheticNamedExportVariable && + moduleExportNamesByVariable.has(exposedVariable.getBaseVariable())))) { + return false; + } + } + return true; + } + finalizeChunk(code, map, sourcemapFileName, hashesByPlaceholder) { + const renderedChunkInfo = this.getRenderedChunkInfo(); + const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder); + const preliminaryFileName = renderedChunkInfo.fileName; + const fileName = (this.fileName = finalize(preliminaryFileName)); + return { + ...renderedChunkInfo, + code, + dynamicImports: renderedChunkInfo.dynamicImports.map(finalize), + fileName, + implicitlyLoadedBefore: renderedChunkInfo.implicitlyLoadedBefore.map(finalize), + importedBindings: Object.fromEntries(Object.entries(renderedChunkInfo.importedBindings).map(([fileName, bindings]) => [ + finalize(fileName), + bindings + ])), + imports: renderedChunkInfo.imports.map(finalize), + map, + preliminaryFileName, + referencedFiles: renderedChunkInfo.referencedFiles.map(finalize), + sourcemapFileName + }; + } + generateExports() { + this.sortedExportNames = null; + const remainingExports = new Set(this.exports); + if (this.facadeModule !== null && + (this.facadeModule.preserveSignature !== false || this.strictFacade)) { + const exportNamesByVariable = this.facadeModule.getExportNamesByVariable(); + for (const [variable, exportNames] of exportNamesByVariable) { + this.exportNamesByVariable.set(variable, [...exportNames]); + for (const exportName of exportNames) { + this.exportsByName.set(exportName, variable); + } + remainingExports.delete(variable); + } + } + if (this.outputOptions.minifyInternalExports) { + assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + else { + assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry)) + this.exportMode = getExportMode(this, this.outputOptions, this.facadeModule.id, this.inputOptions.onLog); + } + generateFacades() { + const facades = []; + const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]); + const exposedVariables = new Set(this.dynamicEntryModules.map(({ namespace }) => namespace)); + for (const module of entryModules) { + if (module.preserveSignature) { + for (const exportedVariable of module.getExportNamesByVariable().keys()) { + // We need to expose all entry exports from this chunk + if (this.chunkByModule.get(exportedVariable.module) === this) { + exposedVariables.add(exportedVariable); + } + } + } + } + for (const module of entryModules) { + const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)), + // mapping must run after Set 'name' dedupe + name => ({ + name + })); + if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) { + requiredFacades.push({}); + } + requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName }))); + if (requiredFacades.length === 0) { + requiredFacades.push({}); + } + if (!this.facadeModule) { + const needsStrictFacade = !this.outputOptions.preserveModules && + (module.preserveSignature === 'strict' || + (module.preserveSignature === 'exports-only' && + module.getExportNamesByVariable().size > 0)); + if (!needsStrictFacade || this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + if (module.preserveSignature) { + this.strictFacade = needsStrictFacade; + } + this.assignFacadeName(requiredFacades.shift(), module, this.outputOptions.preserveModules); + } + } + for (const facadeName of requiredFacades) { + facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName, this.getPlaceholder, this.bundle, this.inputBase, this.snippets)); + } + } + for (const module of this.dynamicEntryModules) { + if (module.info.syntheticNamedExports) + continue; + if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + this.strictFacade = true; + this.dynamicName = getChunkNameFromModule(module); + } + else if (this.facadeModule === module && + !this.strictFacade && + this.canModuleBeFacade(module, exposedVariables)) { + this.strictFacade = true; + } + else if (!this.facadeChunkByModule.get(module)?.strictFacade) { + this.includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + if (!this.outputOptions.preserveModules) { + this.addNecessaryImportsForFacades(); + } + return facades; + } + getChunkName() { + return (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName())); + } + getExportNames() { + return (this.sortedExportNames ??= [...this.exportsByName.keys()].sort()); + } + getFileName() { + return this.fileName || this.getPreliminaryFileName().fileName; + } + getImportPath(importer) { + return escapeId(parseAst_js.getImportPath(importer, this.getFileName(), this.outputOptions.format === 'amd' && !this.outputOptions.amd.forceJsExtensionForImports, true)); + } + getPreliminaryFileName() { + if (this.preliminaryFileName) { + return this.preliminaryFileName; + } + let fileName; + let hashPlaceholder = null; + const { chunkFileNames, entryFileNames, file, format, preserveModules } = this.outputOptions; + if (file) { + fileName = path.basename(file); + } + else if (this.fileName === null) { + const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint + ? [entryFileNames, 'output.entryFileNames'] + : [chunkFileNames, 'output.chunkFileNames']; + fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + fileName = makeUnique(fileName, this.bundle); + } + } + else { + fileName = this.fileName; + } + if (!hashPlaceholder) { + this.bundle[fileName] = FILE_PLACEHOLDER; + } + // Caching is essential to not conflict with the file name reservation above + return (this.preliminaryFileName = { fileName, hashPlaceholder }); + } + getPreliminarySourcemapFileName() { + if (this.preliminarySourcemapFileName) { + return this.preliminarySourcemapFileName; + } + let sourcemapFileName = null; + let hashPlaceholder = null; + const { sourcemapFileNames, format } = this.outputOptions; + if (sourcemapFileNames) { + const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames']; + sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '', + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + sourcemapFileName = makeUnique(sourcemapFileName, this.bundle); + } + } + else { + return null; + } + return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder }); + } + getRenderedChunkInfo() { + if (this.renderedChunkInfo) { + return this.renderedChunkInfo; + } + return (this.renderedChunkInfo = { + ...this.getPreRenderedChunkInfo(), + dynamicImports: this.getDynamicDependencies().map(resolveFileName), + fileName: this.getFileName(), + implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName), + importedBindings: getImportedBindingsPerDependency(this.getRenderedDependencies(), resolveFileName), + imports: Array.from(this.dependencies, resolveFileName), + modules: this.renderedModules, + referencedFiles: this.getReferencedFiles() + }); + } + getVariableExportName(variable) { + if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) { + return '*'; + } + return this.exportNamesByVariable.get(variable)[0]; + } + link() { + this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule, this.externalChunkByModule); + for (const module of this.orderedModules) { + this.addImplicitlyLoadedBeforeFromModule(module); + this.setUpChunkImportsAndExportsForModule(module); + } + } + async render() { + const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this; + const { format, hoistTransitiveImports, preserveModules } = outputOptions; + // for static and dynamic entry points, add transitive dependencies to this + // chunk's dependencies to avoid loading latency + if (hoistTransitiveImports && !preserveModules && facadeModule !== null) { + for (const dep of dependencies) { + if (dep instanceof Chunk) + this.inlineChunkDependencies(dep); + } + } + const preliminaryFileName = this.getPreliminaryFileName(); + const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName(); + const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName); + const renderedDependencies = [...this.getRenderedDependencies().values()]; + const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format); + let hasExports = renderedExports.length > 0; + let hasDefaultExport = false; + for (const renderedDependency of renderedDependencies) { + const { reexports } = renderedDependency; + if (reexports?.length) { + hasExports = true; + if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) { + hasDefaultExport = true; + } + if (format === 'es') { + renderedDependency.reexports = reexports.filter(({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)); + } + } + } + if (!hasDefaultExport) { + for (const { exported } of renderedExports) { + if (exported === 'default') { + hasDefaultExport = true; + break; + } + } + } + const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo()); + finalisers[format](renderedSource, { + accessedGlobals, + dependencies: renderedDependencies, + exports: renderedExports, + hasDefaultExport, + hasExports, + id: preliminaryFileName.fileName, + indent, + intro, + isEntryFacade: preserveModules || (facadeModule !== null && facadeModule.info.isEntry), + isModuleFacade: facadeModule !== null, + log: onLog, + namedExportsMode: exportMode !== 'default', + outro, + snippets, + usesTopLevelAwait + }, outputOptions); + if (banner) + magicString.prepend(banner); + if (format === 'es' || format === 'cjs') { + const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang; + if (shebang) { + magicString.prepend(`#!${shebang}\n`); + } + } + if (footer) + magicString.append(footer); + return { + chunk: this, + magicString, + preliminaryFileName, + preliminarySourcemapFileName, + usedModules + }; + } + addImplicitlyLoadedBeforeFromModule(baseModule) { + const { chunkByModule, implicitlyLoadedBefore } = this; + for (const module of baseModule.implicitlyLoadedBefore) { + const chunk = chunkByModule.get(module); + if (chunk && chunk !== this) { + implicitlyLoadedBefore.add(chunk); + } + } + } + addNecessaryImportsForFacades() { + for (const [module, variables] of this.includedReexportsByModule) { + if (this.includedNamespaces.has(module)) { + for (const variable of variables) { + this.imports.add(variable); + } + } + } + } + assignFacadeName({ fileName, name }, facadedModule, preservePath) { + if (fileName) { + this.fileName = fileName; + } + else { + this.name = this.outputOptions.sanitizeFileName(name || + (preservePath + ? this.getPreserveModulesChunkNameFromModule(facadedModule) + : getChunkNameFromModule(facadedModule))); + } + } + checkCircularDependencyImport(variable, importingModule) { + const variableModule = variable.module; + if (variableModule instanceof Module) { + const exportChunk = this.chunkByModule.get(variableModule); + let alternativeReexportModule; + do { + alternativeReexportModule = importingModule.alternativeReexportModules.get(variable); + if (alternativeReexportModule) { + const exportingChunk = this.chunkByModule.get(alternativeReexportModule); + if (exportingChunk !== exportChunk) { + this.inputOptions.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logCyclicCrossChunkReexport( + // Namespaces do not have an export name + variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules)); + } + importingModule = alternativeReexportModule; + } + } while (alternativeReexportModule); + } + } + ensureReexportsAreAvailableForModule(module) { + const includedReexports = []; + const map = module.getExportNamesByVariable(); + for (const exportedVariable of map.keys()) { + const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable; + const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable; + this.checkCircularDependencyImport(importedVariable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + const exportingModule = importedVariable.module; + if (exportingModule instanceof Module) { + const chunk = this.chunkByModule.get(exportingModule); + if (chunk && chunk !== this) { + chunk.exports.add(importedVariable); + includedReexports.push(importedVariable); + if (isSynthetic) { + this.imports.add(importedVariable); + } + } + } + } + } + if (includedReexports.length > 0) { + this.includedReexportsByModule.set(module, includedReexports); + } + } + generateVariableName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + const moduleForNaming = this.entryModules[0] || + this.implicitEntryModules[0] || + this.dynamicEntryModules[0] || + this.orderedModules[this.orderedModules.length - 1]; + if (moduleForNaming) { + return getChunkNameFromModule(moduleForNaming); + } + return 'chunk'; + } + getChunkExportDeclarations(format) { + const exports = []; + for (const exportName of this.getExportNames()) { + if (exportName[0] === '*') + continue; + const variable = this.exportsByName.get(exportName); + if (!(variable instanceof SyntheticNamedExportVariable)) { + const module = variable.module; + if (module) { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + if (!chunk || format !== 'es') { + continue; + } + const chunkDep = this.renderedDependencies.get(chunk); + if (!chunkDep) { + continue; + } + const { imports, reexports } = chunkDep; + const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName); + const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported); + if (!isImported) { + continue; + } + } + } + } + let expression = null; + let hoisted = false; + let local = variable.getName(this.snippets.getPropertyAccess); + if (variable instanceof LocalVariable) { + for (const declaration of variable.declarations) { + if (declaration.parent instanceof FunctionDeclaration || + (declaration instanceof ExportDefaultDeclaration && + declaration.declaration instanceof FunctionDeclaration)) { + hoisted = true; + break; + } + } + } + else if (variable instanceof SyntheticNamedExportVariable) { + expression = local; + if (format === 'es') { + local = variable.renderName; + } + } + exports.push({ + exported: exportName, + expression, + hoisted, + local + }); + } + return exports; + } + getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) { + const dependencies = new Set(); + const deconflictedDefault = new Set(); + const deconflictedNamespace = new Set(); + for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) { + if (addNonNamespacesAndInteropHelpers || variable.isNamespace) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(module); + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers) { + if (variable.name === 'default') { + if (defaultInteropHelpersByInteropType[interop(module.id)]) { + deconflictedDefault.add(chunk); + } + } + else if (variable.isNamespace && + namespaceInteropHelpersByInteropType[interop(module.id)] && + (this.imports.has(variable) || + !this.exportNamesByVariable.get(variable)?.every(name => name.startsWith('*')))) { + // We only need to deconflict it if the namespace is actually + // created as a variable, i.e. because it is used internally or + // because it is reexported as an object + deconflictedNamespace.add(chunk); + } + } + } + else { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers && + chunk.exportMode === 'default' && + variable.isNamespace) { + deconflictedNamespace.add(chunk); + } + } + } + } + } + if (addDependenciesWithoutBindings) { + for (const dependency of this.dependencies) { + dependencies.add(dependency); + } + } + return { deconflictedDefault, deconflictedNamespace, dependencies }; + } + getDynamicDependencies() { + return this.getIncludedDynamicImports() + .map(resolvedDynamicImport => resolvedDynamicImport.facadeChunk || + resolvedDynamicImport.chunk || + resolvedDynamicImport.externalChunk || + resolvedDynamicImport.resolution) + .filter((resolution) => resolution !== this && + (resolution instanceof Chunk || resolution instanceof ExternalChunk)); + } + getDynamicImportStringAndAttributes(resolution, fileName) { + if (resolution instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(resolution); + return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAttributes(this.snippets)]; + } + return [ + resolution || '', + (this.outputOptions.format === 'es' && this.outputOptions.externalImportAttributes) || null + ]; + } + getFallbackChunkName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + if (this.dynamicName) { + return this.dynamicName; + } + if (this.fileName) { + return parseAst_js.getAliasName(this.fileName); + } + return parseAst_js.getAliasName(this.orderedModules[this.orderedModules.length - 1].id); + } + getImportSpecifiers() { + const { interop } = this.outputOptions; + const importsByDependency = new Map(); + for (const variable of this.imports) { + const module = variable.module; + let dependency; + let imported; + if (module instanceof ExternalModule) { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return parseAst_js.error(parseAst_js.logUnexpectedNamedImport(module.id, imported, false)); + } + } + else { + dependency = this.chunkByModule.get(module); + imported = dependency.getVariableExportName(variable); + } + getOrCreate(importsByDependency, dependency, getNewArray).push({ + imported, + local: variable.getName(this.snippets.getPropertyAccess) + }); + } + return importsByDependency; + } + getIncludedDynamicImports() { + if (this.includedDynamicImports) { + return this.includedDynamicImports; + } + const includedDynamicImports = []; + for (const module of this.orderedModules) { + for (const { node, resolution } of module.dynamicImports) { + if (!node.included) { + continue; + } + includedDynamicImports.push(resolution instanceof Module + ? { + chunk: this.chunkByModule.get(resolution), + externalChunk: null, + facadeChunk: this.facadeChunkByModule.get(resolution), + node, + resolution + } + : resolution instanceof ExternalModule + ? { + chunk: null, + externalChunk: this.externalChunkByModule.get(resolution), + facadeChunk: null, + node, + resolution + } + : { chunk: null, externalChunk: null, facadeChunk: null, node, resolution }); + } + } + return (this.includedDynamicImports = includedDynamicImports); + } + getPreRenderedChunkInfo() { + if (this.preRenderedChunkInfo) { + return this.preRenderedChunkInfo; + } + const { dynamicEntryModules, facadeModule, implicitEntryModules, orderedModules } = this; + return (this.preRenderedChunkInfo = { + exports: this.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + isDynamicEntry: dynamicEntryModules.length > 0, + isEntry: !!facadeModule?.info.isEntry, + isImplicitEntry: implicitEntryModules.length > 0, + moduleIds: orderedModules.map(({ id }) => id), + name: this.getChunkName(), + type: 'chunk' + }); + } + getPreserveModulesChunkNameFromModule(module) { + const predefinedChunkName = getPredefinedChunkNameFromModule(module); + if (predefinedChunkName) + return predefinedChunkName; + const { preserveModulesRoot, sanitizeFileName } = this.outputOptions; + const sanitizedId = sanitizeFileName(parseAst_js.normalize(module.id.split(QUERY_HASH_REGEX, 1)[0])); + const extensionName = path.extname(sanitizedId); + const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) + ? sanitizedId.slice(0, -extensionName.length) + : sanitizedId; + if (parseAst_js.isAbsolute(idWithoutExtension)) { + if (preserveModulesRoot && path.resolve(idWithoutExtension).startsWith(preserveModulesRoot)) { + return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, ''); + } + else { + // handle edge case in Windows + if (this.inputBase === '/' && !idWithoutExtension.startsWith('/')) { + return parseAst_js.relative(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/')); + } + return parseAst_js.relative(this.inputBase, idWithoutExtension); + } + } + else { + return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + path.basename(idWithoutExtension)); + } + } + getReexportSpecifiers() { + const { externalLiveBindings, interop } = this.outputOptions; + const reexportSpecifiers = new Map(); + for (let exportName of this.getExportNames()) { + let dependency; + let imported; + let needsLiveBinding = false; + if (exportName[0] === '*') { + const id = exportName.slice(1); + if (interop(id) === 'defaultOnly') { + this.inputOptions.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logUnexpectedNamespaceReexport(id)); + } + needsLiveBinding = externalLiveBindings; + dependency = this.externalChunkByModule.get(this.modulesById.get(id)); + imported = exportName = '*'; + } + else { + const variable = this.exportsByName.get(exportName); + if (variable instanceof SyntheticNamedExportVariable) + continue; + const module = variable.module; + if (module instanceof Module) { + dependency = this.chunkByModule.get(module); + if (dependency === this) + continue; + imported = dependency.getVariableExportName(variable); + needsLiveBinding = variable.isReassigned; + } + else { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return parseAst_js.error(parseAst_js.logUnexpectedNamedImport(module.id, imported, true)); + } + needsLiveBinding = + externalLiveBindings && + (imported !== 'default' || isDefaultAProperty(interop(module.id), true)); + } + } + getOrCreate(reexportSpecifiers, dependency, getNewArray).push({ + imported, + needsLiveBinding, + reexported: exportName + }); + } + return reexportSpecifiers; + } + getReferencedFiles() { + const referencedFiles = new Set(); + for (const module of this.orderedModules) { + for (const meta of module.importMetas) { + const fileName = meta.getReferencedFileName(this.pluginDriver); + if (fileName) { + referencedFiles.add(fileName); + } + } + } + return [...referencedFiles]; + } + getRenderedDependencies() { + if (this.renderedDependencies) { + return this.renderedDependencies; + } + const importSpecifiers = this.getImportSpecifiers(); + const reexportSpecifiers = this.getReexportSpecifiers(); + const renderedDependencies = new Map(); + const fileName = this.getFileName(); + for (const dependency of this.dependencies) { + const imports = importSpecifiers.get(dependency) || null; + const reexports = reexportSpecifiers.get(dependency) || null; + const namedExportsMode = dependency instanceof ExternalChunk || dependency.exportMode !== 'default'; + const importPath = dependency.getImportPath(fileName); + renderedDependencies.set(dependency, { + attributes: dependency instanceof ExternalChunk + ? dependency.getImportAttributes(this.snippets) + : null, + defaultVariableName: dependency.defaultVariableName, + globalName: dependency instanceof ExternalChunk && + (this.outputOptions.format === 'umd' || this.outputOptions.format === 'iife') && + getGlobalName(dependency, this.outputOptions.globals, (imports || reexports) !== null, this.inputOptions.onLog), + importPath, + imports, + isChunk: dependency instanceof Chunk, + name: dependency.variableName, + namedExportsMode, + namespaceVariableName: dependency.namespaceVariableName, + reexports + }); + } + return (this.renderedDependencies = renderedDependencies); + } + inlineChunkDependencies(chunk) { + for (const dep of chunk.dependencies) { + if (this.dependencies.has(dep)) + continue; + this.dependencies.add(dep); + if (dep instanceof Chunk) { + this.inlineChunkDependencies(dep); + } + } + } + // This method changes properties on the AST before rendering and must not be async + renderModules(fileName) { + const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this; + const { compact, format, freeze, generatedCode: { symbols } } = outputOptions; + const { _, cnst, n } = snippets; + this.setDynamicImportResolutions(fileName); + this.setImportMetaResolutions(fileName); + this.setIdentifierRenderResolutions(); + const magicString = new Bundle$1({ separator: `${n}${n}` }); + const indent = getIndentString(orderedModules, outputOptions); + const usedModules = []; + let hoistedSource = ''; + const accessedGlobals = new Set(); + const renderedModuleSources = new Map(); + const renderOptions = { + accessedDocumentCurrentScript: false, + exportNamesByVariable, + format, + freeze, + indent, + pluginDriver, + snippets, + symbols, + useOriginalName: null + }; + let usesTopLevelAwait = false; + for (const module of orderedModules) { + let renderedLength = 0; + let source; + if (module.isIncluded() || includedNamespaces.has(module)) { + const rendered = module.render(renderOptions); + if (!renderOptions.accessedDocumentCurrentScript && + formatsMaybeAccessDocumentCurrentScript.includes(format)) { + this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT); + } + renderOptions.accessedDocumentCurrentScript = false; + ({ source } = rendered); + usesTopLevelAwait ||= rendered.usesTopLevelAwait; + renderedLength = source.length(); + if (renderedLength) { + if (compact && source.lastLine().includes('//')) + source.append('\n'); + renderedModuleSources.set(module, source); + magicString.addSource(source); + usedModules.push(module); + } + const namespace = module.namespace; + if (includedNamespaces.has(module)) { + const rendered = namespace.renderBlock(renderOptions); + if (namespace.renderFirst()) + hoistedSource += n + rendered; + else + magicString.addSource(new MagicString(rendered)); + } + const accessedGlobalVariables = accessedGlobalsByScope.get(module.scope); + if (accessedGlobalVariables) { + for (const name of accessedGlobalVariables) { + accessedGlobals.add(name); + } + } + } + const { renderedExports, removedExports } = module.getRenderedExports(); + renderedModules[module.id] = { + get code() { + return source?.toString() ?? null; + }, + originalLength: module.originalCode.length, + removedExports, + renderedExports, + renderedLength + }; + } + if (hoistedSource) + magicString.prepend(hoistedSource + n + n); + if (this.needsExportsShim) { + magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); + } + const renderedSource = compact ? magicString : magicString.trim(); + if (isEmpty && this.getExportNames().length === 0 && dependencies.size === 0) { + onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logEmptyChunk(this.getChunkName())); + } + return { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait }; + } + setDynamicImportResolutions(fileName) { + const { accessedGlobalsByScope, outputOptions, pluginDriver, snippets } = this; + for (const resolvedDynamicImport of this.getIncludedDynamicImports()) { + if (resolvedDynamicImport.chunk) { + const { chunk, facadeChunk, node, resolution } = resolvedDynamicImport; + if (chunk === this) { + node.setInternalResolution(resolution.namespace); + } + else { + node.setExternalResolution((facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)[0], null); + } + } + else { + const { node, resolution } = resolvedDynamicImport; + const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes(resolution, fileName); + node.setExternalResolution('external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, attributes); + } + } + } + setIdentifierRenderResolutions() { + const { format, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions; + const syntheticExports = new Set(); + for (const exportName of this.getExportNames()) { + const exportVariable = this.exportsByName.get(exportName); + if (format !== 'es' && + format !== 'system' && + exportVariable.isReassigned && + !exportVariable.isId) { + exportVariable.setRenderNames('exports', exportName); + } + else if (exportVariable instanceof SyntheticNamedExportVariable) { + syntheticExports.add(exportVariable); + } + else { + exportVariable.setRenderNames(null, null); + } + } + for (const module of this.orderedModules) { + if (module.needsExportShim) { + this.needsExportsShim = true; + break; + } + } + const usedNames = new Set(['Object', 'Promise']); + if (this.needsExportsShim) { + usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); + } + if (symbols) { + usedNames.add('Symbol'); + } + switch (format) { + case 'system': { + usedNames.add('module').add('exports'); + break; + } + case 'es': { + break; + } + case 'cjs': { + usedNames.add('module').add('require').add('__filename').add('__dirname'); + } + // fallthrough + default: { + usedNames.add('exports'); + for (const helper of HELPER_NAMES) { + usedNames.add(helper); + } + } + } + deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces); + } + setImportMetaResolutions(fileName) { + const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format } } = this; + for (const module of orderedModules) { + for (const importMeta of module.importMetas) { + importMeta.setResolution(format, accessedGlobalsByScope, fileName); + } + if (includedNamespaces.has(module)) { + module.namespace.prepare(accessedGlobalsByScope); + } + } + } + setUpChunkImportsAndExportsForModule(module) { + const moduleImports = new Set(module.includedImports); + // when we are not preserving modules, we need to make all namespace variables available for + // rendering the namespace object + if (!this.outputOptions.preserveModules && this.includedNamespaces.has(module)) { + const memberVariables = module.namespace.getMemberVariables(); + for (const variable of Object.values(memberVariables)) { + if (variable.included) { + moduleImports.add(variable); + } + } + } + for (let variable of moduleImports) { + if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + const chunk = this.chunkByModule.get(variable.module); + if (chunk !== this) { + this.imports.add(variable); + if (variable.module instanceof Module) { + this.checkCircularDependencyImport(variable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + chunk.exports.add(variable); + } + } + } + } + if (this.includedNamespaces.has(module) || + (module.info.isEntry && module.preserveSignature !== false) || + module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) { + this.ensureReexportsAreAvailableForModule(module); + } + for (const { node, resolution } of module.dynamicImports) { + if (node.included && + resolution instanceof Module && + this.chunkByModule.get(resolution) === this && + !this.includedNamespaces.has(resolution)) { + this.includedNamespaces.add(resolution); + this.ensureReexportsAreAvailableForModule(resolution); + } + } + } +} +function getChunkNameFromModule(module) { + return getPredefinedChunkNameFromModule(module) ?? parseAst_js.getAliasName(module.id); +} +function getPredefinedChunkNameFromModule(module) { + return (module.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ?? module.chunkNames[0]?.name); +} +function getImportedBindingsPerDependency(renderedDependencies, resolveFileName) { + const importedBindingsPerDependency = {}; + for (const [dependency, declaration] of renderedDependencies) { + const specifiers = new Set(); + if (declaration.imports) { + for (const { imported } of declaration.imports) { + specifiers.add(imported); + } + } + if (declaration.reexports) { + for (const { imported } of declaration.reexports) { + specifiers.add(imported); + } + } + importedBindingsPerDependency[resolveFileName(dependency)] = [...specifiers]; + } + return importedBindingsPerDependency; +} +const QUERY_HASH_REGEX = /[#?]/; +const resolveFileName = (dependency) => dependency.getFileName(); + +/** + * Concatenate a number of iterables to a new iterable without fully evaluating + * their iterators. Useful when e.g. working with large sets or lists and when + * there is a chance that the iterators will not be fully exhausted. + */ +function* concatLazy(iterables) { + for (const iterable of iterables) { + yield* iterable; + } +} + +/** + * At its core, the algorithm first starts from each static or dynamic entry + * point and then assigns that entry point to all modules than can be reached + * via static imports. We call this the *dependent entry points* of that + * module. + * + * Then we group all modules with the same dependent entry points into chunks + * as those modules will always be loaded together. + * + * One non-trivial optimization we can apply is that dynamic entries are + * different from static entries in so far as when a dynamic import occurs, + * some modules are already in memory. If some of these modules are also + * dependencies of the dynamic entry, then it does not make sense to create a + * separate chunk for them. Instead, the dynamic import target can load them + * from the importing chunk. + * + * With regard to chunking, if B is implicitly loaded after A, then this can be + * handled the same way as if there was a dynamic import A => B. + * + * Example: + * Assume A -> B (A imports B), A => C (A dynamically imports C) and C -> B. + * Then the initial algorithm would assign A into the A chunk, C into the C + * chunk and B into the AC chunk, i.e. the chunk with the dependent entry + * points A and C. + * However we know that C can only be loaded from A, so A and its dependency B + * must already be in memory when C is loaded. So it is enough to create only + * two chunks A containing [AB] and C containing [C]. + * + * So we do not assign the dynamic entry C as dependent entry point to modules + * that are already loaded. + * + * In a more complex example, let us assume that we have entry points X and Y. + * Further, let us assume + * X -> A, X -> B, X -> C, + * Y -> A, Y -> B, + * A => D, + * D -> B, D -> C + * So without dynamic import optimization, the dependent entry points are + * A: XY, B: DXY, C: DX, D: D, X: X, Y: Y, so we would for now create six + * chunks. + * + * Now D is loaded only after A is loaded. But A is loaded if either X is + * loaded or Y is loaded. So the modules that are already in memory when D is + * loaded are the intersection of all modules that X depends on with all + * modules that Y depends on, which in this case are the modules A and B. + * We could also say they are all modules that have both X and Y as dependent + * entry points. + * + * So we can remove D as dependent entry point from A and B, which means they + * both now have only XY as dependent entry points and can be merged into the + * same chunk. + * + * Now let us extend this to the most general case where we have several + * dynamic importers for one dynamic entry point. + * + * In the most general form, it works like this: + * For each dynamic entry point, we have a number of dynamic importers, which + * are the modules importing it. Using the previous ideas, we can determine + * the modules already in memory for each dynamic importer by looking for all + * modules that have all the dependent entry points of the dynamic importer as + * dependent entry points. + * So the modules that are guaranteed to be in memory when the dynamic entry + * point is loaded are the intersection of the modules already in memory for + * each dynamic importer. + * + * Assuming that A => D and B => D and A has dependent entry points XY and B + * has dependent entry points YZ, then the modules guaranteed to be in memory + * are all modules that have at least XYZ as dependent entry points. + * We call XYZ the *dynamically dependent entry points* of D. + * + * Now there is one last case to consider: If one of the dynamically dependent + * entries is itself a dynamic entry, then any module is in memory that either + * is a dependency of that dynamic entry or again has the dynamic dependent + * entries of that dynamic entry as dependent entry points. + * + * A naive algorithm for this proved to be costly as it contained an O(n^3) + * complexity with regard to dynamic entries that blew up for very large + * projects. + * + * If we have an efficient way to do Set operations, an alternative approach + * would be to instead collect already loaded modules per dynamic entry. And as + * all chunks from the initial grouping would behave the same, we can instead + * collect already loaded chunks for a performance improvement. + * + * To do that efficiently, need + * - a Map of dynamic imports per dynamic entry, which contains all dynamic + * imports that can be triggered by a dynamic entry + * - a Map of static dependencies per entry + * - a Map of already loaded chunks per entry that we initially populate with + * empty Sets for static entries and Sets containing all entries for dynamic + * entries + * + * For efficient operations, we assign each entry a numerical index and + * represent Sets of Chunks as BigInt values where each chunk corresponds to a + * bit index. Then the last two maps can be represented as arrays of BigInt + * values. + * + * Then we iterate through each dynamic entry. We set the already loaded modules + * to the intersection of the previously already loaded modules with the union + * of the already loaded modules of that chunk with its static dependencies. + * + * If the already loaded modules changed, then we use the Map of dynamic imports + * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put + * them back into the iteration. As an additional optimization, we note for + * each dynamic entry which dynamic dependent entries have changed and only + * intersect those entries again on subsequent interations. + * + * Then we remove the dynamic entries from the list of dependent entries for + * those chunks that are already loaded for that dynamic entry and create + * another round of chunks. + */ +function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) { + const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry); + const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entries); + // Each chunk is identified by its position in this array + const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks)); + const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(allEntries, chunkAtoms); + // Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. + // If we no longer want this, we should make a copy here. + const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries); + // This mutates the dependentEntries in chunkAtoms + removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry); + const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize); + chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({ + alias: null, + modules + }))); + return chunkDefinitions; +} +function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry) { + const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys()); + const manualChunkModulesByAlias = Object.create(null); + for (const [entry, alias] of manualChunkAliasByEntry) { + addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks); + } + const manualChunks = Object.entries(manualChunkModulesByAlias); + const chunkDefinitions = new Array(manualChunks.length); + let index = 0; + for (const [alias, modules] of manualChunks) { + chunkDefinitions[index++] = { alias, modules }; + } + return { chunkDefinitions, modulesInManualChunks }; +} +function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) { + const modulesToHandle = new Set([entry]); + for (const module of modulesToHandle) { + modulesInManualChunks.add(module); + manualChunkModules.push(module); + for (const dependency of module.dependencies) { + if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) { + modulesToHandle.add(dependency); + } + } + } +} +function analyzeModuleGraph(entries) { + const dynamicEntryModules = new Set(); + const dependentEntriesByModule = new Map(); + const allEntriesSet = new Set(entries); + const dynamicImportModulesByEntry = new Array(allEntriesSet.size); + let entryIndex = 0; + for (const currentEntry of allEntriesSet) { + const dynamicImportsForCurrentEntry = new Set(); + dynamicImportModulesByEntry[entryIndex] = dynamicImportsForCurrentEntry; + const modulesToHandle = new Set([currentEntry]); + for (const module of modulesToHandle) { + getOrCreate(dependentEntriesByModule, module, (getNewSet)).add(entryIndex); + for (const dependency of module.getDependenciesToBeIncluded()) { + if (!(dependency instanceof ExternalModule)) { + modulesToHandle.add(dependency); + } + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module && + resolution.includedDynamicImporters.length > 0 && + !allEntriesSet.has(resolution)) { + dynamicEntryModules.add(resolution); + allEntriesSet.add(resolution); + dynamicImportsForCurrentEntry.add(resolution); + } + } + for (const dependency of module.implicitlyLoadedBefore) { + if (!allEntriesSet.has(dependency)) { + dynamicEntryModules.add(dependency); + allEntriesSet.add(dependency); + } + } + } + entryIndex++; + } + const allEntries = [...allEntriesSet]; + const { dynamicEntries, dynamicImportsByEntry } = getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry); + return { + allEntries, + dependentEntriesByModule, + dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries), + dynamicImportsByEntry + }; +} +function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry) { + const entryIndexByModule = new Map(); + const dynamicEntries = new Set(); + for (const [entryIndex, entry] of allEntries.entries()) { + entryIndexByModule.set(entry, entryIndex); + if (dynamicEntryModules.has(entry)) { + dynamicEntries.add(entryIndex); + } + } + const dynamicImportsByEntry = new Array(dynamicImportModulesByEntry.length); + let index = 0; + for (const dynamicImportModules of dynamicImportModulesByEntry) { + const dynamicImports = new Set(); + for (const dynamicEntry of dynamicImportModules) { + dynamicImports.add(entryIndexByModule.get(dynamicEntry)); + } + dynamicImportsByEntry[index++] = dynamicImports; + } + return { dynamicEntries, dynamicImportsByEntry }; +} +function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries) { + const dynamicallyDependentEntriesByDynamicEntry = new Map(); + for (const dynamicEntryIndex of dynamicEntries) { + const dynamicallyDependentEntries = getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicEntryIndex, (getNewSet)); + const dynamicEntry = allEntries[dynamicEntryIndex]; + for (const importer of concatLazy([ + dynamicEntry.includedDynamicImporters, + dynamicEntry.implicitlyLoadedAfter + ])) { + for (const entry of dependentEntriesByModule.get(importer)) { + dynamicallyDependentEntries.add(entry); + } + } + } + return dynamicallyDependentEntriesByDynamicEntry; +} +function getChunksWithSameDependentEntries(modulesWithDependentEntries) { + const chunkModules = Object.create(null); + for (const { dependentEntries, modules } of modulesWithDependentEntries) { + let chunkSignature = 0n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + } + (chunkModules[String(chunkSignature)] ||= { + dependentEntries: new Set(dependentEntries), + modules: [] + }).modules.push(...modules); + } + return Object.values(chunkModules); +} +function* getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks) { + for (const [module, dependentEntries] of dependentEntriesByModule) { + if (!modulesInManualChunks.has(module)) { + yield { dependentEntries, modules: [module] }; + } + } +} +function getStaticDependencyAtomsByEntry(allEntries, chunkAtoms) { + // The indices correspond to the indices in allEntries. The atoms correspond + // to bits in the bigint values where chunk 0 is the lowest bit. + const staticDependencyAtomsByEntry = allEntries.map(() => 0n); + // This toggles the bits for each atom that is a dependency of an entry + let atomMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + staticDependencyAtomsByEntry[entryIndex] |= atomMask; + } + atomMask <<= 1n; + } + return staticDependencyAtomsByEntry; +} +// Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. +function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries) { + // Dynamic entries have all atoms as already loaded initially because we then + // intersect with the static dependency atoms of all dynamic importers. + // Static entries cannot have already loaded atoms. + const alreadyLoadedAtomsByEntry = allEntries.map((_entry, entryIndex) => dynamicallyDependentEntriesByDynamicEntry.has(entryIndex) ? -1n : 0n); + for (const [dynamicEntryIndex, dynamicallyDependentEntries] of dynamicallyDependentEntriesByDynamicEntry) { + // We delete here so that they can be added again if necessary to be handled + // again by the loop + dynamicallyDependentEntriesByDynamicEntry.delete(dynamicEntryIndex); + const knownLoadedAtoms = alreadyLoadedAtomsByEntry[dynamicEntryIndex]; + let updatedLoadedAtoms = knownLoadedAtoms; + for (const entryIndex of dynamicallyDependentEntries) { + updatedLoadedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + // If the knownLoadedAtoms changed, all dependent dynamic entries need to be + // updated again + if (updatedLoadedAtoms !== knownLoadedAtoms) { + alreadyLoadedAtomsByEntry[dynamicEntryIndex] = updatedLoadedAtoms; + for (const dynamicImport of dynamicImportsByEntry[dynamicEntryIndex]) { + // If this adds an entry that was deleted before, it will be handled + // again. This is the reason why we delete every entry from this map + // that we processed. + getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicImport, (getNewSet)).add(dynamicEntryIndex); + } + } + } + return alreadyLoadedAtomsByEntry; +} +/** + * This removes all unnecessary dynamic entries from the dependentEntries in its + * first argument if a chunk is already loaded without that entry. + */ +function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry) { + // Remove entries from dependent entries if a chunk is already loaded without + // that entry. + let chunkMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + if ((alreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === chunkMask) { + dependentEntries.delete(entryIndex); + } + } + chunkMask <<= 1n; + } +} +function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) { + const chunksBySignature = Object.create(null); + const chunkByModule = new Map(); + const sizeByAtom = new Array(chunkAtoms.length); + let sideEffectAtoms = 0n; + let atomMask = 1n; + let index = 0; + for (const { dependentEntries, modules } of chunkAtoms) { + let chunkSignature = 0n; + let correlatedAtoms = -1n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + // Correlated atoms are the atoms that are guaranteed to be loaded as + // well when a given atom is loaded. It is the intersection of the already + // loaded modules of each chunk merged with its static dependencies. + correlatedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + const chunk = (chunksBySignature[String(chunkSignature)] ||= { + containedAtoms: 0n, + correlatedAtoms, + dependencies: new Set(), + dependentChunks: new Set(), + dependentEntries: new Set(dependentEntries), + modules: [], + pure: true, + size: 0 + }); + let atomSize = 0; + let pure = true; + for (const module of modules) { + chunkByModule.set(module, chunk); + // Unfortunately, we cannot take tree-shaking into account here because + // rendering did not happen yet, but we can detect empty modules + if (module.isIncluded()) { + pure &&= !module.hasEffects(); + // we use a trivial size for the default minChunkSize to improve + // performance + atomSize += minChunkSize > 1 ? module.estimateSize() : 1; + } + } + if (!pure) { + sideEffectAtoms |= atomMask; + } + sizeByAtom[index++] = atomSize; + chunk.containedAtoms |= atomMask; + chunk.modules.push(...modules); + chunk.pure &&= pure; + chunk.size += atomSize; + atomMask <<= 1n; + } + const chunks = Object.values(chunksBySignature); + sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, atomMask); + return { chunks, sideEffectAtoms, sizeByAtom }; +} +function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, nextAvailableAtomMask) { + const signatureByExternalModule = new Map(); + let externalSideEffectAtoms = 0n; + for (const chunk of chunks) { + const { dependencies, modules } = chunk; + for (const module of modules) { + for (const dependency of module.getDependenciesToBeIncluded()) { + if (dependency instanceof ExternalModule) { + if (dependency.info.moduleSideEffects) { + const signature = getOrCreate(signatureByExternalModule, dependency, () => { + const signature = nextAvailableAtomMask; + nextAvailableAtomMask <<= 1n; + externalSideEffectAtoms |= signature; + return signature; + }); + chunk.containedAtoms |= signature; + chunk.correlatedAtoms |= signature; + } + } + else { + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk && dependencyChunk !== chunk) { + dependencies.add(dependencyChunk); + dependencyChunk.dependentChunks.add(chunk); + } + } + } + } + } + return externalSideEffectAtoms; +} +/** + * This function tries to get rid of small chunks by merging them with other + * chunks. + * + * We can only merge chunks safely if after the merge, loading any entry point + * in any allowed order will not trigger side effects that should not have been + * triggered. While side effects are usually things like global function calls, + * global variable mutations or potentially thrown errors, details do not + * matter here, and we just discern chunks without side effects (pure chunks) + * from other chunks. + * + * As a first step, we assign each pre-generated chunk with side effects a + * label. I.e. we have side effect "A" if the non-pure chunk "A" is loaded. + * + * Now to determine the side effects of loading a chunk, one also has to take + * the side effects of its dependencies into account. So if A depends on B + * (A -> B) and both have side effects, loading A triggers effects AB. + * + * Now from the previous step we know that each chunk is uniquely determine by + * the entry points that depend on it and cause it to load, which we will call + * its dependent entry points. + * + * E.g. if X -> A and Y -> A, then the dependent entry points of A are XY. + * Starting from that idea, we can determine a set of chunks—and thus a set + * of side effects—that must have been triggered if a certain chunk has been + * loaded. Basically, it is the intersection of all chunks loaded by the + * dependent entry points of a given chunk. We call the corresponding side + * effects the correlated side effects of that chunk. + * + * Example: + * X -> ABC, Y -> ADE, A-> F, B -> D + * Then taking dependencies into account, X -> ABCDF, Y -> ADEF + * The intersection is ADF. So we know that when A is loaded, D and F must also + * be in memory even though neither D nor A is a dependency of the other. + * If all have side effects, we call ADF the correlated side effects of A. The + * correlated side effects need to remain constant when merging chunks. + * + * In contrast, we have the dependency side effects of A, which represents + * the side effects we trigger if we directly load A. In this example, the + * dependency side effects are AF. + * For entry chunks, dependency and correlated side effects are the same. + * + * With these concepts, merging chunks is allowed if the correlated side + * effects of each entry do not change. Thus, we are allowed to merge two + * chunks if + * + * a) the dependency side effects of each chunk are a subset of the correlated + * side effects of the other chunk, so no additional side effects are + * triggered for any entry, or + * b) The dependent entry points of chunk A are a subset of the dependent entry + * points of chunk B while the dependency side effects of A are a subset of + * the correlated side effects of B. Because in that scenario, whenever A is + * loaded, B is loaded as well. But there are cases when B is loaded where A + * is not loaded. So if we merge the chunks, all dependency side effects of + * A will be added to the correlated side effects of B, and as the latter is + * not allowed to change, the former need to be a subset of the latter. + * + * Another consideration when merging small chunks into other chunks is to + * avoid + * that too much additional code is loaded. This is achieved when the dependent + * entries of the small chunk are a subset of the dependent entries of the + * other + * chunk. Because then when the small chunk is loaded, the other chunk was + * loaded/in memory anyway, so at most when the other chunk is loaded, the + * additional size of the small chunk is loaded unnecessarily. + * + * So the algorithm performs merges in two passes: + * + * 1. First we try to merge small chunks A only into other chunks B if the + * dependent entries of A are a subset of the dependent entries of B and the + * dependency side effects of A are a subset of the correlated side effects + * of B. + * 2. Only then for all remaining small chunks, we look for arbitrary merges + * following the rule (a), starting with the smallest chunks to look for + * possible merge targets. + */ +function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log) { + timeStart('optimize chunks', 3); + const chunkPartition = getPartitionedChunks(chunks, minChunkSize); + if (!chunkPartition) { + timeEnd('optimize chunks', 3); + return chunks; // the actual modules + } + if (minChunkSize > 1) { + log('info', parseAst_js.logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially')); + } + mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom); + if (minChunkSize > 1) { + log('info', parseAst_js.logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks')); + } + timeEnd('optimize chunks', 3); + return [...chunkPartition.small, ...chunkPartition.big]; +} +function getPartitionedChunks(chunks, minChunkSize) { + const smallChunks = []; + const bigChunks = []; + for (const chunk of chunks) { + (chunk.size < minChunkSize ? smallChunks : bigChunks).push(chunk); + } + if (smallChunks.length === 0) { + return null; + } + smallChunks.sort(compareChunkSize); + bigChunks.sort(compareChunkSize); + return { + big: new Set(bigChunks), + small: new Set(smallChunks) + }; +} +function compareChunkSize({ size: sizeA }, { size: sizeB }) { + return sizeA - sizeB; +} +function mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom) { + const { small } = chunkPartition; + for (const mergedChunk of small) { + const bestTargetChunk = findBestMergeTarget(mergedChunk, chunkPartition, sideEffectAtoms, sizeByAtom, + // In the default case, we do not accept size increases + minChunkSize <= 1 ? 1 : Infinity); + if (bestTargetChunk) { + const { containedAtoms, correlatedAtoms, modules, pure, size } = mergedChunk; + small.delete(mergedChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).delete(bestTargetChunk); + bestTargetChunk.modules.push(...modules); + bestTargetChunk.size += size; + bestTargetChunk.pure &&= pure; + const { dependencies, dependentChunks, dependentEntries } = bestTargetChunk; + bestTargetChunk.correlatedAtoms &= correlatedAtoms; + bestTargetChunk.containedAtoms |= containedAtoms; + for (const entry of mergedChunk.dependentEntries) { + dependentEntries.add(entry); + } + for (const dependency of mergedChunk.dependencies) { + dependencies.add(dependency); + dependency.dependentChunks.delete(mergedChunk); + dependency.dependentChunks.add(bestTargetChunk); + } + for (const dependentChunk of mergedChunk.dependentChunks) { + dependentChunks.add(dependentChunk); + dependentChunk.dependencies.delete(mergedChunk); + dependentChunk.dependencies.add(bestTargetChunk); + } + dependencies.delete(bestTargetChunk); + dependentChunks.delete(bestTargetChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).add(bestTargetChunk); + } + } +} +function findBestMergeTarget(mergedChunk, { big, small }, sideEffectAtoms, sizeByAtom, smallestAdditionalSize) { + let bestTargetChunk = null; + // In the default case, we do not accept size increases + for (const targetChunk of concatLazy([small, big])) { + if (mergedChunk === targetChunk) + continue; + const additionalSizeAfterMerge = getAdditionalSizeAfterMerge(mergedChunk, targetChunk, smallestAdditionalSize, sideEffectAtoms, sizeByAtom); + if (additionalSizeAfterMerge < smallestAdditionalSize) { + bestTargetChunk = targetChunk; + if (additionalSizeAfterMerge === 0) + break; + smallestAdditionalSize = additionalSizeAfterMerge; + } + } + return bestTargetChunk; +} +/** + * Determine the additional unused code size that would be added by merging the + * two chunks. This is not an exact measurement but rather an upper bound. If + * the merge produces cycles or adds non-correlated side effects, `Infinity` + * is returned. + * Merging will not produce cycles if none of the direct non-merged + * dependencies of a chunk have the other chunk as a transitive dependency. + */ +function getAdditionalSizeAfterMerge(mergedChunk, targetChunk, +// The maximum additional unused code size allowed to be added by the merge, +// taking dependencies into account, needs to be below this number +currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const firstSize = getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(mergedChunk, targetChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom); + return firstSize < currentAdditionalSize + ? firstSize + + getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(targetChunk, mergedChunk, currentAdditionalSize - firstSize, sideEffectAtoms, sizeByAtom) + : Infinity; +} +function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(dependentChunk, dependencyChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const { correlatedAtoms } = dependencyChunk; + let dependencyAtoms = dependentChunk.containedAtoms; + const dependentContainedSideEffects = dependencyAtoms & sideEffectAtoms; + if ((correlatedAtoms & dependentContainedSideEffects) !== dependentContainedSideEffects) { + return Infinity; + } + const chunksToCheck = new Set(dependentChunk.dependencies); + for (const { dependencies, containedAtoms } of chunksToCheck) { + dependencyAtoms |= containedAtoms; + const containedSideEffects = containedAtoms & sideEffectAtoms; + if ((correlatedAtoms & containedSideEffects) !== containedSideEffects) { + return Infinity; + } + for (const dependency of dependencies) { + if (dependency === dependencyChunk) { + return Infinity; + } + chunksToCheck.add(dependency); + } + } + return getAtomsSizeIfBelowLimit(dependencyAtoms & ~correlatedAtoms, currentAdditionalSize, sizeByAtom); +} +function getAtomsSizeIfBelowLimit(atoms, currentAdditionalSize, sizeByAtom) { + let size = 0; + let atomIndex = 0; + let atomSignature = 1n; + const { length } = sizeByAtom; + for (; atomIndex < length; atomIndex++) { + if ((atoms & atomSignature) === atomSignature) { + size += sizeByAtom[atomIndex]; + } + atomSignature <<= 1n; + if (size >= currentAdditionalSize) { + return Infinity; + } + } + return size; +} +function getChunksInPartition(chunk, minChunkSize, chunkPartition) { + return chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big; +} + +// ported from https://github.com/substack/node-commondir +function commondir(files) { + if (files.length === 0) + return '/'; + if (files.length === 1) + return path.dirname(files[0]); + const commonSegments = files.slice(1).reduce((commonSegments, file) => { + const pathSegments = file.split(/\/+|\\+/); + let index; + for (index = 0; commonSegments[index] === pathSegments[index] && + index < Math.min(commonSegments.length, pathSegments.length); index++) + ; + return commonSegments.slice(0, index); + }, files[0].split(/\/+|\\+/)); + // Windows correctly handles paths with forward-slashes + return commonSegments.length > 1 ? commonSegments.join('/') : '/'; +} + +const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1; +function sortByExecutionOrder(units) { + units.sort(compareExecIndex); +} +// This process is currently faulty in so far as it only takes the first entry +// module into account and assumes that dynamic imports are imported in a +// certain order. +// A better algorithm would follow every possible execution path and mark which +// modules are executed before or after which other modules. THen the chunking +// would need to take care that in each chunk, all modules are always executed +// in the same sequence. +function analyseModuleExecution(entryModules) { + let nextExecIndex = 0; + const cyclePaths = []; + const analysedModules = new Set(); + const dynamicImports = new Set(); + const parents = new Map(); + const orderedModules = []; + const analyseModule = (module) => { + if (module instanceof Module) { + for (const dependency of module.dependencies) { + if (parents.has(dependency)) { + if (!analysedModules.has(dependency)) { + cyclePaths.push(getCyclePath(dependency, module, parents)); + } + continue; + } + parents.set(dependency, module); + analyseModule(dependency); + } + for (const dependency of module.implicitlyLoadedBefore) { + dynamicImports.add(dependency); + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module) { + dynamicImports.add(resolution); + } + } + orderedModules.push(module); + } + module.execIndex = nextExecIndex++; + analysedModules.add(module); + }; + for (const currentEntry of entryModules) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + for (const currentEntry of dynamicImports) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + return { cyclePaths, orderedModules }; +} +function getCyclePath(module, parent, parents) { + const cycleSymbol = Symbol(module.id); + const path = [module.id]; + let nextModule = parent; + module.cycles.add(cycleSymbol); + while (nextModule !== module) { + nextModule.cycles.add(cycleSymbol); + path.push(nextModule.id); + nextModule = parents.get(nextModule); + } + path.push(path[0]); + path.reverse(); + return path; +} + +function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps } }) { + const { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\n', s: ';' }; + const cnst = constBindings ? 'const' : 'var'; + const getNonArrowFunctionIntro = (parameters, { isAsync, name }) => `${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${parameters.join(`,${_}`)})${_}`; + const getFunctionIntro = arrowFunctions + ? (parameters, { isAsync, name }) => { + const singleParameter = parameters.length === 1; + const asyncString = isAsync ? `async${singleParameter ? ' ' : _}` : ''; + return `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${singleParameter ? parameters[0] : `(${parameters.join(`,${_}`)})`}${_}=>${_}`; + } + : getNonArrowFunctionIntro; + const getDirectReturnFunction = (parameters, { functionReturn, lineBreakIndent, name }) => [ + `${getFunctionIntro(parameters, { + isAsync: false, + name + })}${arrowFunctions + ? lineBreakIndent + ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` + : '' + : `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${functionReturn ? 'return ' : ''}`}`, + arrowFunctions + ? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}` + : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}` + ]; + const isValidPropertyName = reservedNamesAsProps + ? (name) => VALID_IDENTIFIER_REGEXP.test(name) + : (name) => !RESERVED_NAMES.has(name) && VALID_IDENTIFIER_REGEXP.test(name); + return { + _, + cnst, + getDirectReturnFunction, + getDirectReturnIifeLeft: (parameters, returned, { needsArrowReturnParens, needsWrappedFunction }) => { + const [left, right] = getDirectReturnFunction(parameters, { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return `${wrapIfNeeded(`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`, arrowFunctions || needsWrappedFunction)}(`; + }, + getFunctionIntro, + getNonArrowFunctionIntro, + getObject(fields, { lineBreakIndent }) { + const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _; + return `{${fields + .map(([key, value]) => { + if (key === null) + return `${prefix}${value}`; + const keyInObject = stringifyObjectKeyIfNeeded(key); + return key === value && objectShorthand && key === keyInObject + ? prefix + key + : `${prefix}${keyInObject}:${_}${value}`; + }) + .join(`,`)}${fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`; + }, + getPropertyAccess: (name) => isValidPropertyName(name) ? `.${name}` : `[${JSON.stringify(name)}]`, + n, + s + }; +} +const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code; + +class Source { + constructor(filename, content) { + this.isOriginal = true; + this.filename = filename; + this.content = content; + } + traceSegment(line, column, name) { + return { column, line, name, source: this }; + } +} +class Link { + constructor(map, sources) { + this.sources = sources; + this.names = map.names; + this.mappings = map.mappings; + } + traceMappings() { + const sources = []; + const sourceIndexMap = new Map(); + const sourcesContent = []; + const names = []; + const nameIndexMap = new Map(); + const mappings = []; + for (const line of this.mappings) { + const tracedLine = []; + for (const segment of line) { + if (segment.length === 1) + continue; + const source = this.sources[segment[1]]; + if (!source) + continue; + const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : ''); + if (traced) { + const { column, line, name, source: { content, filename } } = traced; + let sourceIndex = sourceIndexMap.get(filename); + if (sourceIndex === undefined) { + sourceIndex = sources.length; + sources.push(filename); + sourceIndexMap.set(filename, sourceIndex); + sourcesContent[sourceIndex] = content; + } + else if (sourcesContent[sourceIndex] == null) { + sourcesContent[sourceIndex] = content; + } + else if (content != null && sourcesContent[sourceIndex] !== content) { + return parseAst_js.error(parseAst_js.logConflictingSourcemapSources(filename)); + } + const tracedSegment = [segment[0], sourceIndex, line, column]; + if (name) { + let nameIndex = nameIndexMap.get(name); + if (nameIndex === undefined) { + nameIndex = names.length; + names.push(name); + nameIndexMap.set(name, nameIndex); + } + tracedSegment[4] = nameIndex; + } + tracedLine.push(tracedSegment); + } + } + mappings.push(tracedLine); + } + return { mappings, names, sources, sourcesContent }; + } + traceSegment(line, column, name) { + const segments = this.mappings[line]; + if (!segments) + return null; + // binary search through segments for the given column + let searchStart = 0; + let searchEnd = segments.length - 1; + while (searchStart <= searchEnd) { + const m = (searchStart + searchEnd) >> 1; + const segment = segments[m]; + // If a sourcemap does not have sufficient resolution to contain a + // necessary mapping, e.g. because it only contains line information, we + // use the best approximation we could find + if (segment[0] === column || searchStart === searchEnd) { + if (segment.length == 1) + return null; + const source = this.sources[segment[1]]; + if (!source) + return null; + return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name); + } + if (segment[0] > column) { + searchEnd = m - 1; + } + else { + searchStart = m + 1; + } + } + return null; + } +} +function getLinkMap(log) { + return function linkMap(source, map) { + if (!map.missing) { + return new Link(map, [source]); + } + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logSourcemapBroken(map.plugin)); + return new Link({ + mappings: [], + names: [] + }, [source]); + }; +} +function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) { + let source; + if (originalSourcemap) { + const sources = originalSourcemap.sources; + const sourcesContent = originalSourcemap.sourcesContent || []; + const directory = path.dirname(id) || '.'; + const sourceRoot = originalSourcemap.sourceRoot || '.'; + const baseSources = sources.map((source, index) => new Source(path.resolve(directory, sourceRoot, source), sourcesContent[index])); + source = new Link(originalSourcemap, baseSources); + } + else { + source = new Source(id, originalCode); + } + return sourcemapChain.reduce(linkMap, source); +} +function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, log) { + const linkMap = getLinkMap(log); + const moduleSources = modules + .filter(module => !module.excludeFromSourcemap) + .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap)); + const link = new Link(map, moduleSources); + const source = bundleSourcemapChain.reduce(linkMap, link); + let { sources, sourcesContent, names, mappings } = source.traceMappings(); + if (file) { + const directory = path.dirname(file); + sources = sources.map((source) => path.relative(directory, source)); + file = path.basename(file); + } + sourcesContent = (excludeContent ? null : sourcesContent); + for (const module of modules) { + resetSourcemapCache(module.originalSourcemap, module.sourcemapChain); + } + return new SourceMap({ file, mappings, names, sources, sourcesContent }); +} +function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) { + if (sourcemapChain.length === 0) { + return originalSourcemap; + } + const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log)); + const map = source.traceMappings(); + return decodedSourcemap({ version: 3, ...map }); +} + +// this looks ridiculous, but it prevents sourcemap tooling from mistaking +// this for an actual sourceMappingURL +let SOURCEMAPPING_URL = 'sourceMa'; +SOURCEMAPPING_URL += 'ppingURL'; + +async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) { + timeStart('render chunks', 2); + reserveEntryChunksInBundle(chunks); + const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render())); + timeEnd('render chunks', 2); + timeStart('transform chunks', 2); + const getHash = hasherByType[outputOptions.hashCharacters]; + const chunkGraph = getChunkGraph(chunks); + const { hashDependenciesByPlaceholder, initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, placeholders, renderedChunksByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log); + const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash); + addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions); + timeEnd('transform chunks', 2); +} +function reserveEntryChunksInBundle(chunks) { + for (const chunk of chunks) { + if (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint) { + // reserves name in bundle as side effect if it does not contain a hash + chunk.getPreliminaryFileName(); + } + } +} +function getChunkGraph(chunks) { + return Object.fromEntries(chunks.map(chunk => { + const renderedChunkInfo = chunk.getRenderedChunkInfo(); + return [renderedChunkInfo.fileName, renderedChunkInfo]; + })); +} +async function transformChunk(magicString, fileName, usedModules, chunkGraph, options, outputPluginDriver, log) { + let map = null; + const sourcemapChain = []; + let code = await outputPluginDriver.hookReduceArg0('renderChunk', [magicString.toString(), chunkGraph[fileName], options, { chunks: chunkGraph }], (code, result, plugin) => { + if (result == null) + return code; + if (typeof result === 'string') + result = { + code: result, + map: undefined + }; + // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning + if (result.map !== null) { + const map = decodedSourcemap(result.map); + sourcemapChain.push(map || { missing: true, plugin: plugin.name }); + } + return result.code; + }); + const { compact, dir, file, sourcemap, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, sourcemapIgnoreList } = options; + if (!compact && code[code.length - 1] !== '\n') + code += '\n'; + if (sourcemap) { + timeStart('sourcemaps', 3); + let resultingFile; + if (file) + resultingFile = path.resolve(sourcemapFile || file); + else if (dir) + resultingFile = path.resolve(dir, fileName); + else + resultingFile = path.resolve(fileName); + const decodedMap = magicString.generateDecodedMap({}); + map = collapseSourcemaps(resultingFile, decodedMap, usedModules, sourcemapChain, sourcemapExcludeSources, log); + for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { + let sourcePath = map.sources[sourcesIndex]; + const sourcemapPath = `${resultingFile}.map`; + const ignoreList = sourcemapIgnoreList(sourcePath, sourcemapPath); + if (typeof ignoreList !== 'boolean') { + parseAst_js.error(parseAst_js.logFailedValidation('sourcemapIgnoreList function must return a boolean.')); + } + if (ignoreList) { + if (map.x_google_ignoreList === undefined) { + map.x_google_ignoreList = []; + } + if (!map.x_google_ignoreList.includes(sourcesIndex)) { + map.x_google_ignoreList.push(sourcesIndex); + } + } + if (sourcemapPathTransform) { + sourcePath = sourcemapPathTransform(sourcePath, sourcemapPath); + if (typeof sourcePath !== 'string') { + parseAst_js.error(parseAst_js.logFailedValidation(`sourcemapPathTransform function must return a string.`)); + } + } + map.sources[sourcesIndex] = parseAst_js.normalize(sourcePath); + } + timeEnd('sourcemaps', 3); + } + return { + code, + map + }; +} +async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log) { + const nonHashedChunksWithPlaceholders = []; + const renderedChunksByPlaceholder = new Map(); + const hashDependenciesByPlaceholder = new Map(); + const initialHashesByPlaceholder = new Map(); + const placeholders = new Set(); + for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) { + if (hashPlaceholder) + placeholders.add(hashPlaceholder); + } + await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => { + const transformedChunk = { + chunk, + fileName, + sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null, + ...(await transformChunk(magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log)) + }; + const { code, map } = transformedChunk; + if (hashPlaceholder) { + // To create a reproducible content-only hash, all placeholders are + // replaced with the same value before hashing + const { containedPlaceholders, transformedCode } = replacePlaceholdersWithDefaultAndGetContainedPlaceholders(code, placeholders); + let contentToHash = transformedCode; + const hashAugmentation = pluginDriver.hookReduceValueSync('augmentChunkHash', '', [chunk.getRenderedChunkInfo()], (augmentation, pluginHash) => { + if (pluginHash) { + augmentation += pluginHash; + } + return augmentation; + }); + if (hashAugmentation) { + contentToHash += hashAugmentation; + } + renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk); + hashDependenciesByPlaceholder.set(hashPlaceholder, { + containedPlaceholders, + contentHash: getHash(contentToHash) + }); + } + else { + nonHashedChunksWithPlaceholders.push(transformedChunk); + } + const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder; + if (map && sourcemapHashPlaceholder) { + initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, getHash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length)); + } + })); + return { + hashDependenciesByPlaceholder, + initialHashesByPlaceholder, + nonHashedChunksWithPlaceholders, + placeholders, + renderedChunksByPlaceholder + }; +} +function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash) { + const hashesByPlaceholder = new Map(initialHashesByPlaceholder); + for (const placeholder of placeholders) { + const { fileName } = renderedChunksByPlaceholder.get(placeholder); + let contentToHash = ''; + const hashDependencyPlaceholders = new Set([placeholder]); + for (const dependencyPlaceholder of hashDependencyPlaceholders) { + const { containedPlaceholders, contentHash } = hashDependenciesByPlaceholder.get(dependencyPlaceholder); + contentToHash += contentHash; + for (const containedPlaceholder of containedPlaceholders) { + // When looping over a map, setting an entry only causes a new iteration if the key is new + hashDependencyPlaceholders.add(containedPlaceholder); + } + } + let finalFileName; + let finalHash; + do { + // In case of a hash collision, create a hash of the hash + if (finalHash) { + contentToHash = finalHash; + } + finalHash = getHash(contentToHash).slice(0, placeholder.length); + finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash); + } while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase())); + bundle[finalFileName] = FILE_PLACEHOLDER; + hashesByPlaceholder.set(placeholder, finalHash); + } + return hashesByPlaceholder; +} +function addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, options) { + for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) { + let updatedCode = replacePlaceholders(code, hashesByPlaceholder); + const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder); + let finalSourcemapFileName = null; + if (map) { + if (options.sourcemapDebugIds) { + updatedCode += calculateDebugIdAndGetComment(updatedCode, map); + } + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${finalFileName}.map`; + map.file = replacePlaceholders(map.file, hashesByPlaceholder); + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } + for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) { + let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code; + let finalSourcemapFileName = null; + if (map) { + if (options.sourcemapDebugIds) { + updatedCode += calculateDebugIdAndGetComment(updatedCode, map); + } + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${fileName}.map`; + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[fileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } +} +function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, sourcemapBaseUrl }) { + let url; + if (sourcemap === 'inline') { + url = map.toUrl(); + } + else { + const sourcemapFileName = path.basename(fileName); + url = sourcemapBaseUrl + ? new URL(sourcemapFileName, sourcemapBaseUrl).toString() + : sourcemapFileName; + pluginDriver.emitFile({ + fileName, + originalFileName: null, + source: map.toString(), + type: 'asset' + }); + } + return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`; +} +function calculateDebugIdAndGetComment(code, map) { + const hash = hasherByType.hex(code); + const debugId = [ + hash.slice(0, 8), + hash.slice(8, 12), + '4' + hash.slice(12, 15), + ((parseInt(hash.slice(15, 16), 16) & 3) | 8).toString(16) + hash.slice(17, 20), + hash.slice(20, 32) + ].join('-'); + map.debugId = debugId; + return '//# debugId=' + debugId + '\n'; +} + +class Bundle { + constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) { + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.inputOptions = inputOptions; + this.pluginDriver = pluginDriver; + this.graph = graph; + this.facadeChunkByModule = new Map(); + this.includedNamespaces = new Set(); + } + async generate(isWrite) { + timeStart('GENERATE', 1); + const outputBundleBase = Object.create(null); + const outputBundle = getOutputBundle(outputBundleBase); + this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions); + try { + timeStart('initialize render', 2); + await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]); + timeEnd('initialize render', 2); + timeStart('generate chunks', 2); + const getHashPlaceholder = getHashPlaceholderGenerator(); + const chunks = await this.generateChunks(outputBundle, getHashPlaceholder); + if (chunks.length > 1) { + validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onLog); + } + this.pluginDriver.setChunkInformation(this.facadeChunkByModule); + for (const chunk of chunks) { + chunk.generateExports(); + } + timeEnd('generate chunks', 2); + await renderChunks(chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog); + } + catch (error_) { + await this.pluginDriver.hookParallel('renderError', [error_]); + throw error_; + } + removeUnreferencedAssets(outputBundle); + timeStart('generate bundle', 2); + await this.pluginDriver.hookSeq('generateBundle', [ + this.outputOptions, + outputBundle, + isWrite + ]); + this.finaliseAssets(outputBundle); + timeEnd('generate bundle', 2); + timeEnd('GENERATE', 1); + return outputBundleBase; + } + async addManualChunks(manualChunks) { + const manualChunkAliasByEntry = new Map(); + const chunkEntries = await Promise.all(Object.entries(manualChunks).map(async ([alias, files]) => ({ + alias, + entries: await this.graph.moduleLoader.addAdditionalModules(files, true) + }))); + for (const { alias, entries } of chunkEntries) { + for (const entry of entries) { + addModuleToManualChunk(alias, entry, manualChunkAliasByEntry); + } + } + return manualChunkAliasByEntry; + } + assignManualChunks(getManualChunk) { + const manualChunkAliasesWithEntry = []; + const manualChunksApi = { + getModuleIds: () => this.graph.modulesById.keys(), + getModuleInfo: this.graph.getModuleInfo + }; + for (const module of this.graph.modulesById.values()) { + if (module instanceof Module) { + const manualChunkAlias = getManualChunk(module.id, manualChunksApi); + if (typeof manualChunkAlias === 'string') { + manualChunkAliasesWithEntry.push([manualChunkAlias, module]); + } + } + } + manualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) => aliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0); + const manualChunkAliasByEntry = new Map(); + for (const [alias, module] of manualChunkAliasesWithEntry) { + addModuleToManualChunk(alias, module, manualChunkAliasByEntry); + } + return manualChunkAliasByEntry; + } + finaliseAssets(bundle) { + if (this.outputOptions.validate) { + for (const file of Object.values(bundle)) { + if ('code' in file) { + try { + parseAst_js.parseAst(file.code, { jsx: this.inputOptions.jsx !== false }); + } + catch (error_) { + this.inputOptions.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logChunkInvalid(file, error_)); + } + } + } + } + this.pluginDriver.finaliseAssets(); + } + async generateChunks(bundle, getHashPlaceholder) { + const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions; + const manualChunkAliasByEntry = typeof manualChunks === 'object' + ? await this.addManualChunks(manualChunks) + : this.assignManualChunks(manualChunks); + const snippets = getGenerateCodeSnippets(this.outputOptions); + const includedModules = getIncludedModules(this.graph.modulesById); + const inputBase = commondir(getAbsoluteEntryModulePaths(includedModules, preserveModules)); + const externalChunkByModule = getExternalChunkByModule(this.graph.modulesById, this.outputOptions, inputBase); + const executableModule = inlineDynamicImports + ? [{ alias: null, modules: includedModules }] + : preserveModules + ? includedModules.map(module => ({ alias: null, modules: [module] })) + : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog); + const chunks = new Array(executableModule.length); + const chunkByModule = new Map(); + let index = 0; + for (const { alias, modules } of executableModule) { + sortByExecutionOrder(modules); + const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets); + chunks[index++] = chunk; + } + for (const chunk of chunks) { + chunk.link(); + } + const facades = []; + for (const chunk of chunks) { + facades.push(...chunk.generateFacades()); + } + return [...chunks, ...facades]; + } +} +function validateOptionsForMultiChunkOutput(outputOptions, log) { + if (outputOptions.format === 'umd' || outputOptions.format === 'iife') + return parseAst_js.error(parseAst_js.logInvalidOption('output.format', parseAst_js.URL_OUTPUT_FORMAT, 'UMD and IIFE output formats are not supported for code-splitting builds', outputOptions.format)); + if (typeof outputOptions.file === 'string') + return parseAst_js.error(parseAst_js.logInvalidOption('output.file', parseAst_js.URL_OUTPUT_DIR, 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option')); + if (outputOptions.sourcemapFile) + return parseAst_js.error(parseAst_js.logInvalidOption('output.sourcemapFile', parseAst_js.URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds')); + if (!outputOptions.amd.autoId && outputOptions.amd.id) + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInvalidOption('output.amd.id', parseAst_js.URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead')); +} +function getIncludedModules(modulesById) { + const includedModules = []; + for (const module of modulesById.values()) { + if (module instanceof Module && + (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)) { + includedModules.push(module); + } + } + return includedModules; +} +function getAbsoluteEntryModulePaths(includedModules, preserveModules) { + const absoluteEntryModulePaths = []; + for (const module of includedModules) { + if ((module.info.isEntry || preserveModules) && parseAst_js.isAbsolute(module.id)) { + absoluteEntryModulePaths.push(module.id); + } + } + return absoluteEntryModulePaths; +} +function getExternalChunkByModule(modulesById, outputOptions, inputBase) { + const externalChunkByModule = new Map(); + for (const module of modulesById.values()) { + if (module instanceof ExternalModule) { + externalChunkByModule.set(module, new ExternalChunk(module, outputOptions, inputBase)); + } + } + return externalChunkByModule; +} +function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) { + const existingAlias = manualChunkAliasByEntry.get(module); + if (typeof existingAlias === 'string' && existingAlias !== alias) { + return parseAst_js.error(parseAst_js.logCannotAssignModuleToChunk(module.id, alias, existingAlias)); + } + manualChunkAliasByEntry.set(module, alias); +} + +function flru (max) { + var num, curr, prev; + var limit = max; + + function keep(key, value) { + if (++num > limit) { + prev = curr; + reset(1); + ++num; + } + curr[key] = value; + } + + function reset(isPartial) { + num = 0; + curr = Object.create(null); + isPartial || (prev=Object.create(null)); + } + + reset(); + + return { + clear: reset, + has: function (key) { + return curr[key] !== void 0 || prev[key] !== void 0; + }, + get: function (key) { + var val = curr[key]; + if (val !== void 0) return val; + if ((val=prev[key]) !== void 0) { + keep(key, val); + return val; + } + }, + set: function (key, value) { + if (curr[key] !== void 0) { + curr[key] = value; + } else { + keep(key, value); + } + } + }; +} + +class GlobalScope extends Scope { + constructor() { + super(); + this.parent = null; + this.variables.set('undefined', new UndefinedVariable()); + } + findVariable(name) { + let variable = this.variables.get(name); + if (!variable) { + variable = new GlobalVariable(name); + this.variables.set(name, variable); + } + return variable; + } +} + +function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + let skipped = null; + let replaceContext = null; + if (skip) { + skipped = new Set(); + for (const skippedCall of skip) { + if (source === skippedCall.source && importer === skippedCall.importer) { + skipped.add(skippedCall.plugin); + } + } + replaceContext = (pluginContext, plugin) => ({ + ...pluginContext, + resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = parseAst_js.BLANK) => { + skipSelf ??= true; + return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip); + } + }); + } + return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped); +} + +async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes); + if (pluginResult != null) { + const [resolveIdResult, plugin] = pluginResult; + if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) { + return { + ...resolveIdResult, + resolvedBy: plugin.name + }; + } + if (typeof resolveIdResult === 'string') { + return { + id: resolveIdResult, + resolvedBy: plugin.name + }; + } + return resolveIdResult; + } + // external modules (non-entry modules that start with neither '.' or '/') + // are skipped at this stage. + if (importer !== undefined && !parseAst_js.isAbsolute(source) && source[0] !== '.') + return null; + // `resolve` processes paths from right to left, prepending them until an + // absolute path is created. Absolute importees therefore shortcircuit the + // resolve call and require no special handing on our part. + // See https://nodejs.org/api/path.html#path_path_resolve_paths + return addJsExtensionIfNecessary(importer ? path.resolve(path.dirname(importer), source) : path.resolve(source), preserveSymlinks); +} +async function addJsExtensionIfNecessary(file, preserveSymlinks) { + return ((await findFile(file, preserveSymlinks)) ?? + (await findFile(file + '.mjs', preserveSymlinks)) ?? + (await findFile(file + '.js', preserveSymlinks))); +} +async function findFile(file, preserveSymlinks) { + try { + const stats = await promises.lstat(file); + if (!preserveSymlinks && stats.isSymbolicLink()) + return await findFile(await promises.realpath(file), preserveSymlinks); + if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) { + // check case + const name = path.basename(file); + const files = await promises.readdir(path.dirname(file)); + if (files.includes(name)) + return file; + } + } + catch { + // suppress + } +} + +async function transform(source, module, pluginDriver, log) { + const id = module.id; + const sourcemapChain = []; + let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map); + const originalCode = source.code; + let ast = source.ast; + const transformDependencies = []; + const emittedFiles = []; + let customTransformCache = false; + const useCustomTransformCache = () => (customTransformCache = true); + let pluginName = ''; + let currentSource = source.code; + function transformReducer(previousCode, result, plugin) { + let code; + let map; + if (typeof result === 'string') { + code = result; + } + else if (result && typeof result === 'object') { + module.updateOptions(result); + if (result.code == null) { + if (result.map || result.ast) { + log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logNoTransformMapOrAstWithoutCode(plugin.name)); + } + return previousCode; + } + ({ code, map, ast } = result); + } + else { + return previousCode; + } + // strict null check allows 'null' maps to not be pushed to the chain, + // while 'undefined' gets the missing map warning + if (map !== null) { + sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || { + missing: true, + plugin: plugin.name + }); + } + currentSource = code; + return code; + } + const getLogHandler = (handler) => (log, pos) => { + log = normalizeLog(log); + if (pos) + parseAst_js.augmentCodeLocation(log, pos, currentSource, id); + log.id = id; + log.hook = 'transform'; + handler(log); + }; + let code; + try { + code = await pluginDriver.hookReduceArg0('transform', [currentSource, id], transformReducer, (pluginContext, plugin) => { + pluginName = plugin.name; + return { + ...pluginContext, + addWatchFile(id) { + transformDependencies.push(id); + pluginContext.addWatchFile(id); + }, + cache: customTransformCache + ? pluginContext.cache + : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), + debug: getLogHandler(pluginContext.debug), + emitFile(emittedFile) { + emittedFiles.push(emittedFile); + return pluginDriver.emitFile(emittedFile); + }, + error(error_, pos) { + if (typeof error_ === 'string') + error_ = { message: error_ }; + if (pos) + parseAst_js.augmentCodeLocation(error_, pos, currentSource, id); + error_.id = id; + error_.hook = 'transform'; + return pluginContext.error(error_); + }, + getCombinedSourcemap() { + const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log); + if (!combinedMap) { + const magicString = new MagicString(originalCode); + return magicString.generateMap({ hires: true, includeContent: true, source: id }); + } + if (originalSourcemap !== combinedMap) { + originalSourcemap = combinedMap; + sourcemapChain.length = 0; + } + return new SourceMap({ + ...combinedMap, + file: null, + sourcesContent: combinedMap.sourcesContent + }); + }, + info: getLogHandler(pluginContext.info), + setAssetSource() { + return this.error(parseAst_js.logInvalidSetAssetSourceCall()); + }, + warn: getLogHandler(pluginContext.warn) + }; + }); + } + catch (error_) { + return parseAst_js.error(parseAst_js.logPluginError(error_, pluginName, { hook: 'transform', id })); + } + if (!customTransformCache && // files emitted by a transform hook need to be emitted again if the hook is skipped + emittedFiles.length > 0) + module.transformFiles = emittedFiles; + return { + ast, + code, + customTransformCache, + originalCode, + originalSourcemap, + sourcemapChain, + transformDependencies + }; +} + +const RESOLVE_DEPENDENCIES = 'resolveDependencies'; +class ModuleLoader { + constructor(graph, modulesById, options, pluginDriver) { + this.graph = graph; + this.modulesById = modulesById; + this.options = options; + this.pluginDriver = pluginDriver; + this.implicitEntryModules = new Set(); + this.indexedEntryModules = []; + this.latestLoadModulesPromise = Promise.resolve(); + this.moduleLoadPromises = new Map(); + this.modulesWithLoadedDependencies = new Set(); + this.nextChunkNamePriority = 0; + this.nextEntryModuleIndex = 0; + this.resolveId = async (source, importer, customOptions, isEntry, attributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false) + ? false + : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes), importer, source), attributes); + this.hasModuleSideEffects = options.treeshake + ? options.treeshake.moduleSideEffects + : () => true; + } + async addAdditionalModules(unresolvedModules, isAddForManualChunks) { + const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks)))); + await this.awaitLoadModulesPromise(); + return result; + } + async addEntryModules(unresolvedEntryModules, isUserDefined) { + const firstEntryModuleIndex = this.nextEntryModuleIndex; + this.nextEntryModuleIndex += unresolvedEntryModules.length; + const firstChunkNamePriority = this.nextChunkNamePriority; + this.nextChunkNamePriority += unresolvedEntryModules.length; + const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => { + for (const [index, entryModule] of entryModules.entries()) { + entryModule.isUserDefinedEntryPoint = + entryModule.isUserDefinedEntryPoint || isUserDefined; + addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined, firstChunkNamePriority + index); + const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule); + if (existingIndexedModule) { + existingIndexedModule.index = Math.min(existingIndexedModule.index, firstEntryModuleIndex + index); + } + else { + this.indexedEntryModules.push({ + index: firstEntryModuleIndex + index, + module: entryModule + }); + } + } + this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1); + return entryModules; + })); + await this.awaitLoadModulesPromise(); + return { + entryModules: this.indexedEntryModules.map(({ module }) => module), + implicitEntryModules: [...this.implicitEntryModules], + newEntryModules + }; + } + async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) { + const unresolvedModule = { + fileName: fileName || null, + id, + importer, + name: name || null + }; + const module = implicitlyLoadedAfterOneOf + ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf) + : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0]; + if (preserveSignature != null) { + module.preserveSignature = preserveSignature; + } + return module; + } + async preloadModule(resolvedId) { + const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId, parseAst_js.EMPTY_OBJECT), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true); + return module.info; + } + addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) { + const chunkNamePriority = this.nextChunkNamePriority++; + return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => { + addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority); + if (!entryModule.info.isEntry) { + const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id))); + // We need to check again if this is still an entry module as these + // changes need to be performed atomically to avoid race conditions + // if the same module is re-emitted as an entry module. + // The inverse changes happen in "handleExistingModule" + if (!entryModule.info.isEntry) { + this.implicitEntryModules.add(entryModule); + for (const module of implicitlyLoadedAfterModules) { + entryModule.implicitlyLoadedAfter.add(module); + } + for (const dependant of entryModule.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.add(entryModule); + } + } + } + return entryModule; + })); + } + async addModuleSource(id, importer, module) { + let source; + try { + source = await this.graph.fileOperationQueue.run(async () => { + const content = await this.pluginDriver.hookFirst('load', [id]); + if (content !== null) + return content; + this.graph.watchFiles[id] = true; + return await promises.readFile(id, 'utf8'); + }); + } + catch (error_) { + let message = `Could not load ${id}`; + if (importer) + message += ` (imported by ${parseAst_js.relativeId(importer)})`; + message += `: ${error_.message}`; + error_.message = message; + throw error_; + } + const sourceDescription = typeof source === 'string' + ? { code: source } + : source != null && typeof source === 'object' && typeof source.code === 'string' + ? source + : parseAst_js.error(parseAst_js.logBadLoader(id)); + const code = sourceDescription.code; + if (code.charCodeAt(0) === 0xfe_ff) { + sourceDescription.code = code.slice(1); + } + const cachedModule = this.graph.cachedModules.get(id); + if (cachedModule && + !cachedModule.customTransformCache && + cachedModule.originalCode === sourceDescription.code && + !(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [ + { + ast: cachedModule.ast, + code: cachedModule.code, + id: cachedModule.id, + meta: cachedModule.meta, + moduleSideEffects: cachedModule.moduleSideEffects, + resolvedSources: cachedModule.resolvedIds, + syntheticNamedExports: cachedModule.syntheticNamedExports + } + ]))) { + if (cachedModule.transformFiles) { + for (const emittedFile of cachedModule.transformFiles) + this.pluginDriver.emitFile(emittedFile); + } + await module.setSource(cachedModule); + } + else { + module.updateOptions(sourceDescription); + await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onLog)); + } + } + async awaitLoadModulesPromise() { + let startingPromise; + do { + startingPromise = this.latestLoadModulesPromise; + await startingPromise; + } while (startingPromise !== this.latestLoadModulesPromise); + } + extendLoadModulesPromise(loadNewModulesPromise) { + this.latestLoadModulesPromise = Promise.all([ + loadNewModulesPromise, + this.latestLoadModulesPromise + ]); + this.latestLoadModulesPromise.catch(() => { + /* Avoid unhandled Promise rejections */ + }); + return loadNewModulesPromise; + } + async fetchDynamicDependencies(module, resolveDynamicImportPromises) { + const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => { + if (resolvedId === null) + return null; + if (typeof resolvedId === 'string') { + dynamicImport.resolution = resolvedId; + return null; + } + return (dynamicImport.resolution = await this.fetchResolvedDependency(parseAst_js.relativeId(resolvedId.id), module.id, resolvedId)); + }))); + for (const dependency of dependencies) { + if (dependency) { + module.dynamicDependencies.add(dependency); + dependency.dynamicImporters.push(module.id); + } + } + } + // If this is a preload, then this method always waits for the dependencies of + // the module to be resolved. + // Otherwise, if the module does not exist, it waits for the module and all + // its dependencies to be loaded. + // Otherwise, it returns immediately. + async fetchModule({ attributes, id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry, isPreload) { + const existingModule = this.modulesById.get(id); + if (existingModule instanceof Module) { + if (importer && doAttributesDiffer(attributes, existingModule.info.attributes)) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInconsistentImportAttributes(existingModule.info.attributes, attributes, id, importer)); + } + await this.handleExistingModule(existingModule, isEntry, isPreload); + return existingModule; + } + if (existingModule instanceof ExternalModule) { + return parseAst_js.error(parseAst_js.logExternalModulesCannotBeTransformedToModules(existingModule.id)); + } + const module = new Module(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes); + this.modulesById.set(id, module); + const loadPromise = this.addModuleSource(id, importer, module).then(() => [ + this.getResolveStaticDependencyPromises(module), + this.getResolveDynamicImportPromises(module), + loadAndResolveDependenciesPromise + ]); + const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info])); + loadAndResolveDependenciesPromise.catch(() => { + /* avoid unhandled promise rejections */ + }); + this.moduleLoadPromises.set(module, loadPromise); + const resolveDependencyPromises = await loadPromise; + if (!isPreload) { + await this.fetchModuleDependencies(module, ...resolveDependencyPromises); + } + else if (isPreload === RESOLVE_DEPENDENCIES) { + await loadAndResolveDependenciesPromise; + } + return module; + } + async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) { + if (this.modulesWithLoadedDependencies.has(module)) { + return; + } + this.modulesWithLoadedDependencies.add(module); + await Promise.all([ + this.fetchStaticDependencies(module, resolveStaticDependencyPromises), + this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises) + ]); + module.linkImports(); + // To handle errors when resolving dependencies or in moduleParsed + await loadAndResolveDependenciesPromise; + } + fetchResolvedDependency(source, importer, resolvedId) { + if (resolvedId.external) { + const { attributes, external, id, moduleSideEffects, meta } = resolvedId; + let externalModule = this.modulesById.get(id); + if (!externalModule) { + externalModule = new ExternalModule(this.options, id, moduleSideEffects, meta, external !== 'absolute' && parseAst_js.isAbsolute(id), attributes); + this.modulesById.set(id, externalModule); + } + else if (!(externalModule instanceof ExternalModule)) { + return parseAst_js.error(parseAst_js.logInternalIdCannotBeExternal(source, importer)); + } + else if (doAttributesDiffer(externalModule.info.attributes, attributes)) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInconsistentImportAttributes(externalModule.info.attributes, attributes, source, importer)); + } + return Promise.resolve(externalModule); + } + return this.fetchModule(resolvedId, importer, false, false); + } + async fetchStaticDependencies(module, resolveStaticDependencyPromises) { + for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) { + module.dependencies.add(dependency); + dependency.importers.push(module.id); + } + if (!this.options.treeshake || module.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of module.dependencies) { + if (dependency instanceof Module) { + dependency.importedFromNotTreeshaken = true; + } + } + } + } + getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) { + const { makeAbsoluteExternalsRelative } = this.options; + if (resolveIdResult) { + if (typeof resolveIdResult === 'object') { + const external = resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true); + return { + ...resolveIdResult, + external: external && + (external === 'relative' || + !parseAst_js.isAbsolute(resolveIdResult.id) || + (external === true && + isNotAbsoluteExternal(resolveIdResult.id, source, makeAbsoluteExternalsRelative)) || + 'absolute') + }; + } + const external = this.options.external(resolveIdResult, importer, true); + return { + external: external && + (isNotAbsoluteExternal(resolveIdResult, source, makeAbsoluteExternalsRelative) || + 'absolute'), + id: external && makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(resolveIdResult, importer) + : resolveIdResult + }; + } + const id = makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(source, importer) + : source; + if (resolveIdResult !== false && !this.options.external(id, importer, true)) { + return null; + } + return { + external: isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) || 'absolute', + id + }; + } + getResolveDynamicImportPromises(module) { + return module.dynamicImports.map(async (dynamicImport) => { + const resolvedId = await this.resolveDynamicImport(module, dynamicImport.argument, module.id, getAttributesFromImportExpression(dynamicImport.node)); + if (resolvedId && typeof resolvedId === 'object') { + dynamicImport.id = resolvedId.id; + } + return [dynamicImport, resolvedId]; + }); + } + getResolveStaticDependencyPromises(module) { + return Array.from(module.sourcesWithAttributes, async ([source, attributes]) => [ + source, + (module.resolvedIds[source] = + module.resolvedIds[source] || + this.handleInvalidResolvedId(await this.resolveId(source, module.id, parseAst_js.EMPTY_OBJECT, false, attributes), source, module.id, attributes)) + ]); + } + getResolvedIdWithDefaults(resolvedId, attributes) { + if (!resolvedId) { + return null; + } + const external = resolvedId.external || false; + return { + attributes: resolvedId.attributes || attributes, + external, + id: resolvedId.id, + meta: resolvedId.meta || {}, + moduleSideEffects: resolvedId.moduleSideEffects ?? this.hasModuleSideEffects(resolvedId.id, !!external), + resolvedBy: resolvedId.resolvedBy ?? 'rollup', + syntheticNamedExports: resolvedId.syntheticNamedExports ?? false + }; + } + async handleExistingModule(module, isEntry, isPreload) { + const loadPromise = this.moduleLoadPromises.get(module); + if (isPreload) { + return isPreload === RESOLVE_DEPENDENCIES + ? waitForDependencyResolution(loadPromise) + : loadPromise; + } + if (isEntry) { + // This reverts the changes in addEntryWithImplicitDependants and needs to + // be performed atomically + module.info.isEntry = true; + this.implicitEntryModules.delete(module); + for (const dependant of module.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.delete(module); + } + module.implicitlyLoadedAfter.clear(); + } + return this.fetchModuleDependencies(module, ...(await loadPromise)); + } + handleInvalidResolvedId(resolvedId, source, importer, attributes) { + if (resolvedId === null) { + if (parseAst_js.isRelative(source)) { + return parseAst_js.error(parseAst_js.logUnresolvedImport(source, importer)); + } + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logUnresolvedImportTreatedAsExternal(source, importer)); + return { + attributes, + external: true, + id: source, + meta: {}, + moduleSideEffects: this.hasModuleSideEffects(source, true), + resolvedBy: 'rollup', + syntheticNamedExports: false + }; + } + else if (resolvedId.external && resolvedId.syntheticNamedExports) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logExternalSyntheticExports(source, importer)); + } + return resolvedId; + } + async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false) { + const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, parseAst_js.EMPTY_OBJECT, true, parseAst_js.EMPTY_OBJECT); + if (resolveIdResult == null) { + return parseAst_js.error(implicitlyLoadedBefore === null + ? parseAst_js.logUnresolvedEntry(unresolvedId) + : parseAst_js.logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)); + } + const isExternalModules = typeof resolveIdResult === 'object' && resolveIdResult.external; + if (resolveIdResult === false || isExternalModules) { + return parseAst_js.error(implicitlyLoadedBefore === null + ? isExternalModules && isLoadForManualChunks + ? parseAst_js.logExternalModulesCannotBeIncludedInManualChunks(unresolvedId) + : parseAst_js.logEntryCannotBeExternal(unresolvedId) + : parseAst_js.logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore)); + } + return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object' + ? resolveIdResult + : { id: resolveIdResult }, parseAst_js.EMPTY_OBJECT), undefined, isEntry, false); + } + async resolveDynamicImport(module, specifier, importer, attributes) { + const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ + specifier, + importer, + { attributes } + ]); + if (typeof specifier !== 'string') { + if (typeof resolution === 'string') { + return resolution; + } + if (!resolution) { + return null; + } + return this.getResolvedIdWithDefaults(resolution, attributes); + } + if (resolution == null) { + const existingResolution = module.resolvedIds[specifier]; + if (existingResolution) { + if (doAttributesDiffer(existingResolution.attributes, attributes)) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logInconsistentImportAttributes(existingResolution.attributes, attributes, specifier, importer)); + } + return existingResolution; + } + return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, parseAst_js.EMPTY_OBJECT, false, attributes), specifier, module.id, attributes)); + } + return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), attributes), specifier, importer, attributes); + } +} +function normalizeRelativeExternalId(source, importer) { + return parseAst_js.isRelative(source) + ? importer + ? path.resolve(importer, '..', source) + : path.resolve(source) + : source; +} +function addChunkNamesToModule(module, { fileName, name }, isUserDefined, priority) { + if (fileName !== null) { + module.chunkFileNames.add(fileName); + } + else if (name !== null) { + // Always keep chunkNames sorted by priority + let namePosition = 0; + while (module.chunkNames[namePosition]?.priority < priority) + namePosition++; + module.chunkNames.splice(namePosition, 0, { isUserDefined, name, priority }); + } +} +function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) { + return (makeAbsoluteExternalsRelative === true || + (makeAbsoluteExternalsRelative === 'ifRelativeSource' && parseAst_js.isRelative(source)) || + !parseAst_js.isAbsolute(id)); +} +async function waitForDependencyResolution(loadPromise) { + const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise; + return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]); +} + +class Queue { + constructor(maxParallel) { + this.maxParallel = maxParallel; + this.queue = []; + this.workerCount = 0; + } + run(task) { + return new Promise((resolve, reject) => { + this.queue.push({ reject, resolve, task }); + this.work(); + }); + } + async work() { + if (this.workerCount >= this.maxParallel) + return; + this.workerCount++; + let entry; + while ((entry = this.queue.shift())) { + const { reject, resolve, task } = entry; + try { + const result = await task(); + resolve(result); + } + catch (error) { + reject(error); + } + } + this.workerCount--; + } +} + +function normalizeEntryModules(entryModules) { + if (Array.isArray(entryModules)) { + return entryModules.map(id => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name: null + })); + } + return Object.entries(entryModules).map(([name, id]) => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name + })); +} +class Graph { + constructor(options, watcher) { + this.options = options; + this.astLru = flru(5); + this.cachedModules = new Map(); + this.deoptimizationTracker = new PathTracker(); + this.entryModules = []; + this.modulesById = new Map(); + this.needsTreeshakingPass = false; + this.phase = BuildPhase.LOAD_AND_PARSE; + this.scope = new GlobalScope(); + this.watchFiles = Object.create(null); + this.watchMode = false; + this.externalModules = []; + this.implicitEntryModules = []; + this.modules = []; + this.getModuleInfo = (moduleId) => { + const foundModule = this.modulesById.get(moduleId); + if (!foundModule) + return null; + return foundModule.info; + }; + if (options.cache !== false) { + if (options.cache?.modules) { + for (const module of options.cache.modules) + this.cachedModules.set(module.id, module); + } + this.pluginCache = options.cache?.plugins || Object.create(null); + // increment access counter + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + for (const value of Object.values(cache)) + value[0]++; + } + } + if (watcher) { + this.watchMode = true; + const handleChange = (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters); + const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []); + watcher.onCurrentRun('change', handleChange); + watcher.onCurrentRun('close', handleClose); + } + this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); + this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); + this.fileOperationQueue = new Queue(options.maxParallelFileOps); + this.pureFunctions = getPureFunctions(options); + } + async build() { + timeStart('generate module graph', 2); + await this.generateModuleGraph(); + timeEnd('generate module graph', 2); + timeStart('sort and bind modules', 2); + this.phase = BuildPhase.ANALYSE; + this.sortModules(); + timeEnd('sort and bind modules', 2); + timeStart('mark included statements', 2); + this.includeStatements(); + timeEnd('mark included statements', 2); + this.phase = BuildPhase.GENERATE; + } + getCache() { + // handle plugin cache eviction + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + let allDeleted = true; + for (const [key, value] of Object.entries(cache)) { + if (value[0] >= this.options.experimentalCacheExpiry) + delete cache[key]; + else + allDeleted = false; + } + if (allDeleted) + delete this.pluginCache[name]; + } + return { + modules: this.modules.map(module => module.toJSON()), + plugins: this.pluginCache + }; + } + async generateModuleGraph() { + ({ entryModules: this.entryModules, implicitEntryModules: this.implicitEntryModules } = + await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); + if (this.entryModules.length === 0) { + throw new Error('You must supply options.input to rollup'); + } + for (const module of this.modulesById.values()) { + module.cacheInfoGetters(); + if (module instanceof Module) { + this.modules.push(module); + } + else { + this.externalModules.push(module); + } + } + } + includeStatements() { + const entryModules = [...this.entryModules, ...this.implicitEntryModules]; + for (const module of entryModules) { + markModuleAndImpureDependenciesAsExecuted(module); + } + if (this.options.treeshake) { + let treeshakingPass = 1; + do { + timeStart(`treeshaking pass ${treeshakingPass}`, 3); + this.needsTreeshakingPass = false; + for (const module of this.modules) { + if (module.isExecuted) { + module.hasTreeShakingPassStarted = true; + if (module.info.moduleSideEffects === 'no-treeshake') { + module.includeAllInBundle(); + } + else { + module.include(); + } + } + } + if (treeshakingPass === 1) { + // We only include exports after the first pass to avoid issues with + // the TDZ detection logic + for (const module of entryModules) { + if (module.preserveSignature !== false) { + module.includeAllExports(false); + this.needsTreeshakingPass = true; + } + } + } + timeEnd(`treeshaking pass ${treeshakingPass++}`, 3); + } while (this.needsTreeshakingPass); + } + else { + for (const module of this.modules) + module.includeAllInBundle(); + } + for (const externalModule of this.externalModules) + externalModule.warnUnusedImports(); + for (const module of this.implicitEntryModules) { + for (const dependant of module.implicitlyLoadedAfter) { + if (!(dependant.info.isEntry || dependant.isIncluded())) { + parseAst_js.error(parseAst_js.logImplicitDependantIsNotIncluded(dependant)); + } + } + } + } + sortModules() { + const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); + for (const cyclePath of cyclePaths) { + this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logCircularDependency(cyclePath)); + } + this.modules = orderedModules; + for (const module of this.modules) { + module.bindReferences(); + } + this.warnForMissingExports(); + } + warnForMissingExports() { + for (const module of this.modules) { + for (const importDescription of module.importDescriptions.values()) { + if (importDescription.name !== '*' && + !importDescription.module.getVariableForExportName(importDescription.name)[0]) { + module.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingExport(importDescription.name, module.id, importDescription.module.id), importDescription.start); + } + } + } + } +} + +function formatAction([pluginName, hookName, parameters]) { + const action = `(${pluginName}) ${hookName}`; + const s = JSON.stringify; + switch (hookName) { + case 'resolveId': { + return `${action} ${s(parameters[0])} ${s(parameters[1])}`; + } + case 'load': { + return `${action} ${s(parameters[0])}`; + } + case 'transform': { + return `${action} ${s(parameters[1])}`; + } + case 'shouldTransformCachedModule': { + return `${action} ${s(parameters[0].id)}`; + } + case 'moduleParsed': { + return `${action} ${s(parameters[0].id)}`; + } + } + return action; +} +let handleBeforeExit = null; +const rejectByPluginDriver = new Map(); +async function catchUnfinishedHookActions(pluginDriver, callback) { + const emptyEventLoopPromise = new Promise((_, reject) => { + rejectByPluginDriver.set(pluginDriver, reject); + if (!handleBeforeExit) { + // We only ever create a single event listener to avoid max listener and + // other issues + handleBeforeExit = () => { + for (const [pluginDriver, reject] of rejectByPluginDriver) { + const unfulfilledActions = pluginDriver.getUnfulfilledHookActions(); + reject(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n` + + [...unfulfilledActions].map(formatAction).join('\n'))); + } + }; + process$1.once('beforeExit', handleBeforeExit); + } + }); + try { + return await Promise.race([callback(), emptyEventLoopPromise]); + } + finally { + rejectByPluginDriver.delete(pluginDriver); + if (rejectByPluginDriver.size === 0) { + process$1.off('beforeExit', handleBeforeExit); + handleBeforeExit = null; + } + } +} + +async function initWasm() { } + +async function normalizeInputOptions(config, watchMode) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(); + const context = config.context ?? 'undefined'; + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || parseAst_js.LOGLEVEL_INFO; + const onLog = getLogger(plugins, getOnLog(config, logLevel), watchMode, logLevel); + const strictDeprecations = config.strictDeprecations || false; + const maxParallelFileOps = getMaxParallelFileOps(config); + const options = { + cache: getCache(config), + context, + experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, + experimentalLogSideEffects: config.experimentalLogSideEffects || false, + external: getIdMatcher(config.external), + input: getInput(config), + jsx: getJsx(config), + logLevel, + makeAbsoluteExternalsRelative: config.makeAbsoluteExternalsRelative ?? 'ifRelativeSource', + maxParallelFileOps, + moduleContext: getModuleContext(config, context), + onLog, + perf: config.perf || false, + plugins, + preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', + preserveSymlinks: config.preserveSymlinks || false, + shimMissingExports: config.shimMissingExports || false, + strictDeprecations, + treeshake: getTreeshake(config) + }; + warnUnknownOptions(config, [...Object.keys(options), 'onwarn', 'watch'], 'input options', onLog, /^(output)$/); + return { options, unsetOptions }; +} +const getCache = (config) => config.cache === true // `true` is the default + ? undefined + : config.cache?.cache || config.cache; +const getIdMatcher = (option) => { + if (option === true) { + return () => true; + } + if (typeof option === 'function') { + return (id, ...parameters) => (!id.startsWith('\0') && option(id, ...parameters)) || false; + } + if (option) { + const ids = new Set(); + const matchers = []; + for (const value of ensureArray$1(option)) { + if (value instanceof RegExp) { + matchers.push(value); + } + else { + ids.add(value); + } + } + return (id, ..._arguments) => ids.has(id) || matchers.some(matcher => matcher.test(id)); + } + return () => false; +}; +const getInput = (config) => { + const configInput = config.input; + return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; +}; +const getJsx = (config) => { + const configJsx = config.jsx; + if (!configJsx) + return false; + const configWithPreset = getOptionWithPreset(configJsx, jsxPresets, 'jsx', parseAst_js.URL_JSX, 'false, '); + const { factory, importSource, mode } = configWithPreset; + switch (mode) { + case 'automatic': { + return { + factory: factory || 'React.createElement', + importSource: importSource || 'react', + jsxImportSource: configWithPreset.jsxImportSource || 'react/jsx-runtime', + mode: 'automatic' + }; + } + case 'preserve': { + if (importSource && !(factory || configWithPreset.fragment)) { + parseAst_js.error(parseAst_js.logInvalidOption('jsx', parseAst_js.URL_JSX, 'when preserving JSX and specifying an importSource, you also need to specify a factory or fragment')); + } + return { + factory: factory || null, + fragment: configWithPreset.fragment || null, + importSource: importSource || null, + mode: 'preserve' + }; + } + // case 'classic': + default: { + if (mode && mode !== 'classic') { + parseAst_js.error(parseAst_js.logInvalidOption('jsx.mode', parseAst_js.URL_JSX, 'mode must be "automatic", "classic" or "preserve"', mode)); + } + return { + factory: factory || 'React.createElement', + fragment: configWithPreset.fragment || 'React.Fragment', + importSource: importSource || null, + mode: 'classic' + }; + } + } +}; +const getMaxParallelFileOps = (config) => { + const maxParallelFileOps = config.maxParallelFileOps; + if (typeof maxParallelFileOps === 'number') { + if (maxParallelFileOps <= 0) + return Infinity; + return maxParallelFileOps; + } + return 20; +}; +const getModuleContext = (config, context) => { + const configModuleContext = config.moduleContext; + if (typeof configModuleContext === 'function') { + return id => configModuleContext(id) ?? context; + } + if (configModuleContext) { + const contextByModuleId = Object.create(null); + for (const [key, moduleContext] of Object.entries(configModuleContext)) { + contextByModuleId[path.resolve(key)] = moduleContext; + } + return id => contextByModuleId[id] ?? context; + } + return () => context; +}; +const getTreeshake = (config) => { + const configTreeshake = config.treeshake; + if (configTreeshake === false) { + return false; + } + const configWithPreset = getOptionWithPreset(config.treeshake, treeshakePresets, 'treeshake', parseAst_js.URL_TREESHAKE, 'false, true, '); + return { + annotations: configWithPreset.annotations !== false, + correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, + manualPureFunctions: configWithPreset.manualPureFunctions ?? parseAst_js.EMPTY_ARRAY, + moduleSideEffects: getHasModuleSideEffects(configWithPreset.moduleSideEffects), + propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' + ? 'always' + : configWithPreset.propertyReadSideEffects !== false, + tryCatchDeoptimization: configWithPreset.tryCatchDeoptimization !== false, + unknownGlobalSideEffects: configWithPreset.unknownGlobalSideEffects !== false + }; +}; +const getHasModuleSideEffects = (moduleSideEffectsOption) => { + if (typeof moduleSideEffectsOption === 'boolean') { + return () => moduleSideEffectsOption; + } + if (moduleSideEffectsOption === 'no-external') { + return (_id, external) => !external; + } + if (typeof moduleSideEffectsOption === 'function') { + return (id, external) => id.startsWith('\0') ? true : moduleSideEffectsOption(id, external) !== false; + } + if (Array.isArray(moduleSideEffectsOption)) { + const ids = new Set(moduleSideEffectsOption); + return id => ids.has(id); + } + if (moduleSideEffectsOption) { + parseAst_js.error(parseAst_js.logInvalidOption('treeshake.moduleSideEffects', parseAst_js.URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array')); + } + return () => true; +}; + +// https://datatracker.ietf.org/doc/html/rfc2396 +// eslint-disable-next-line no-control-regex +const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$%&*+,:;<=>?[\]^`{|}\u007F]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; +function sanitizeFileName(name) { + const match = DRIVE_LETTER_REGEX.exec(name); + const driveLetter = match ? match[0] : ''; + // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) + // Otherwise, avoid them because they can refer to NTFS alternate data streams. + return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); +} + +async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(unsetInputOptions); + const compact = config.compact || false; + const format = getFormat(config); + const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); + const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); + const file = getFile(config, preserveModules, inputOptions); + const generatedCode = getGeneratedCode(config); + const externalImportAttributes = getExternalImportAttributes(config, inputOptions); + const outputOptions = { + amd: getAmd(config), + assetFileNames: config.assetFileNames ?? 'assets/[name]-[hash][extname]', + banner: getAddon(config, 'banner'), + chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js', + compact, + dir: getDir(config, file), + dynamicImportInCjs: config.dynamicImportInCjs ?? true, + entryFileNames: getEntryFileNames(config, unsetOptions), + esModule: config.esModule ?? 'if-default-prop', + experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, + exports: getExports(config, unsetOptions), + extend: config.extend || false, + externalImportAssertions: externalImportAttributes, + externalImportAttributes, + externalLiveBindings: config.externalLiveBindings ?? true, + file, + footer: getAddon(config, 'footer'), + format, + freeze: config.freeze ?? true, + generatedCode, + globals: config.globals || {}, + hashCharacters: config.hashCharacters ?? 'base64', + hoistTransitiveImports: config.hoistTransitiveImports ?? true, + importAttributesKey: config.importAttributesKey ?? 'assert', + indent: getIndent(config, compact), + inlineDynamicImports, + interop: getInterop(config), + intro: getAddon(config, 'intro'), + manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules), + minifyInternalExports: getMinifyInternalExports(config, format, compact), + name: config.name, + noConflict: config.noConflict || false, + outro: getAddon(config, 'outro'), + paths: config.paths || {}, + plugins: await normalizePluginOption(config.plugins), + preserveModules, + preserveModulesRoot: getPreserveModulesRoot(config), + reexportProtoFromExternal: config.reexportProtoFromExternal ?? true, + sanitizeFileName: typeof config.sanitizeFileName === 'function' + ? config.sanitizeFileName + : config.sanitizeFileName === false + ? id => id + : sanitizeFileName, + sourcemap: config.sourcemap || false, + sourcemapBaseUrl: getSourcemapBaseUrl(config), + sourcemapDebugIds: config.sourcemapDebugIds || false, + sourcemapExcludeSources: config.sourcemapExcludeSources || false, + sourcemapFile: config.sourcemapFile, + sourcemapFileNames: getSourcemapFileNames(config, unsetOptions), + sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function' + ? config.sourcemapIgnoreList + : config.sourcemapIgnoreList === false + ? () => false + : relativeSourcePath => relativeSourcePath.includes('node_modules'), + sourcemapPathTransform: config.sourcemapPathTransform, + strict: config.strict ?? true, + systemNullSetters: config.systemNullSetters ?? true, + validate: config.validate || false, + virtualDirname: config.virtualDirname || '_virtual' + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog); + return { options: outputOptions, unsetOptions }; +} +const getFile = (config, preserveModules, inputOptions) => { + const { file } = config; + if (typeof file === 'string') { + if (preserveModules) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.file', parseAst_js.URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option')); + } + if (!Array.isArray(inputOptions.input)) + return parseAst_js.error(parseAst_js.logInvalidOption('output.file', parseAst_js.URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when providing named inputs')); + } + return file; +}; +const getFormat = (config) => { + const configFormat = config.format; + switch (configFormat) { + case undefined: + case 'es': + case 'esm': + case 'module': { + return 'es'; + } + case 'cjs': + case 'commonjs': { + return 'cjs'; + } + case 'system': + case 'systemjs': { + return 'system'; + } + case 'amd': + case 'iife': + case 'umd': { + return configFormat; + } + default: { + return parseAst_js.error(parseAst_js.logInvalidOption('output.format', parseAst_js.URL_OUTPUT_FORMAT, `Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`, configFormat)); + } + } +}; +const getInlineDynamicImports = (config, inputOptions) => { + const inlineDynamicImports = config.inlineDynamicImports || false; + const { input } = inputOptions; + if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.inlineDynamicImports', parseAst_js.URL_OUTPUT_INLINEDYNAMICIMPORTS, 'multiple inputs are not supported when "output.inlineDynamicImports" is true')); + } + return inlineDynamicImports; +}; +const getPreserveModules = (config, inlineDynamicImports, inputOptions) => { + const preserveModules = config.preserveModules || false; + if (preserveModules) { + if (inlineDynamicImports) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.inlineDynamicImports', parseAst_js.URL_OUTPUT_INLINEDYNAMICIMPORTS, `this option is not supported for "output.preserveModules"`)); + } + if (inputOptions.preserveEntrySignatures === false) { + return parseAst_js.error(parseAst_js.logInvalidOption('preserveEntrySignatures', parseAst_js.URL_PRESERVEENTRYSIGNATURES, 'setting this option to false is not supported for "output.preserveModules"')); + } + } + return preserveModules; +}; +const getPreserveModulesRoot = (config) => { + const { preserveModulesRoot } = config; + if (preserveModulesRoot === null || preserveModulesRoot === undefined) { + return undefined; + } + return path.resolve(preserveModulesRoot); +}; +const getAmd = (config) => { + const mergedOption = { + autoId: false, + basePath: '', + define: 'define', + forceJsExtensionForImports: false, + ...config.amd + }; + if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.amd.id', parseAst_js.URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"')); + } + if (mergedOption.basePath && !mergedOption.autoId) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.amd.basePath', parseAst_js.URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"')); + } + return mergedOption.autoId + ? { + autoId: true, + basePath: mergedOption.basePath, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports + } + : { + autoId: false, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports, + id: mergedOption.id + }; +}; +const getAddon = (config, name) => { + const configAddon = config[name]; + if (typeof configAddon === 'function') { + return configAddon; + } + return () => configAddon || ''; +}; +const getDir = (config, file) => { + const { dir } = config; + if (typeof dir === 'string' && typeof file === 'string') { + return parseAst_js.error(parseAst_js.logInvalidOption('output.dir', parseAst_js.URL_OUTPUT_DIR, 'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')); + } + return dir; +}; +const getEntryFileNames = (config, unsetOptions) => { + const configEntryFileNames = config.entryFileNames; + if (configEntryFileNames == null) { + unsetOptions.add('entryFileNames'); + } + return configEntryFileNames ?? '[name].js'; +}; +function getExports(config, unsetOptions) { + const configExports = config.exports; + if (configExports == null) { + unsetOptions.add('exports'); + } + else if (!['default', 'named', 'none', 'auto'].includes(configExports)) { + return parseAst_js.error(parseAst_js.logInvalidExportOptionValue(configExports)); + } + return configExports || 'auto'; +} +const getExternalImportAttributes = (config, inputOptions) => { + if (config.externalImportAssertions != undefined) { + parseAst_js.warnDeprecation(`The "output.externalImportAssertions" option is deprecated. Use the "output.externalImportAttributes" option instead.`, parseAst_js.URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, true, inputOptions); + } + return config.externalImportAttributes ?? config.externalImportAssertions ?? true; +}; +const getGeneratedCode = (config) => { + const configWithPreset = getOptionWithPreset(config.generatedCode, generatedCodePresets, 'output.generatedCode', parseAst_js.URL_OUTPUT_GENERATEDCODE, ''); + return { + arrowFunctions: configWithPreset.arrowFunctions === true, + constBindings: configWithPreset.constBindings === true, + objectShorthand: configWithPreset.objectShorthand === true, + reservedNamesAsProps: configWithPreset.reservedNamesAsProps !== false, + symbols: configWithPreset.symbols === true + }; +}; +const getIndent = (config, compact) => { + if (compact) { + return ''; + } + const configIndent = config.indent; + return configIndent === false ? '' : (configIndent ?? true); +}; +const ALLOWED_INTEROP_TYPES = new Set([ + 'compat', + 'auto', + 'esModule', + 'default', + 'defaultOnly' +]); +const getInterop = (config) => { + const configInterop = config.interop; + if (typeof configInterop === 'function') { + const interopPerId = Object.create(null); + let defaultInterop = null; + return id => id === null + ? defaultInterop || validateInterop((defaultInterop = configInterop(id))) + : id in interopPerId + ? interopPerId[id] + : validateInterop((interopPerId[id] = configInterop(id))); + } + return configInterop === undefined ? () => 'default' : () => validateInterop(configInterop); +}; +const validateInterop = (interop) => { + if (!ALLOWED_INTEROP_TYPES.has(interop)) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.interop', parseAst_js.URL_OUTPUT_INTEROP, `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop)); + } + return interop; +}; +const getManualChunks = (config, inlineDynamicImports, preserveModules) => { + const configManualChunks = config.manualChunks; + if (configManualChunks) { + if (inlineDynamicImports) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.manualChunks', parseAst_js.URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.inlineDynamicImports"')); + } + if (preserveModules) { + return parseAst_js.error(parseAst_js.logInvalidOption('output.manualChunks', parseAst_js.URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.preserveModules"')); + } + } + return configManualChunks || {}; +}; +const getMinifyInternalExports = (config, format, compact) => config.minifyInternalExports ?? (compact || format === 'es' || format === 'system'); +const getSourcemapFileNames = (config, unsetOptions) => { + const configSourcemapFileNames = config.sourcemapFileNames; + if (configSourcemapFileNames == null) { + unsetOptions.add('sourcemapFileNames'); + } + return configSourcemapFileNames; +}; +const getSourcemapBaseUrl = (config) => { + const { sourcemapBaseUrl } = config; + if (sourcemapBaseUrl) { + if (parseAst_js.isValidUrl(sourcemapBaseUrl)) { + return parseAst_js.addTrailingSlashIfMissed(sourcemapBaseUrl); + } + return parseAst_js.error(parseAst_js.logInvalidOption('output.sourcemapBaseUrl', parseAst_js.URL_OUTPUT_SOURCEMAPBASEURL, `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`)); + } +}; + +// @ts-expect-error TS2540: the polyfill of `asyncDispose`. +Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose'); +function rollup(rawInputOptions) { + return rollupInternal(rawInputOptions, null); +} +async function rollupInternal(rawInputOptions, watcher) { + const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null); + initialiseTimers(inputOptions); + await initWasm(); + const graph = new Graph(inputOptions, watcher); + // remove the cache object from the memory after graph creation (cache is not used anymore) + const useCache = rawInputOptions.cache !== false; + if (rawInputOptions.cache) { + inputOptions.cache = undefined; + rawInputOptions.cache = undefined; + } + timeStart('BUILD', 1); + await catchUnfinishedHookActions(graph.pluginDriver, async () => { + try { + timeStart('initialize', 2); + await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); + timeEnd('initialize', 2); + await graph.build(); + } + catch (error_) { + const watchFiles = Object.keys(graph.watchFiles); + if (watchFiles.length > 0) { + error_.watchFiles = watchFiles; + } + await graph.pluginDriver.hookParallel('buildEnd', [error_]); + await graph.pluginDriver.hookParallel('closeBundle', []); + throw error_; + } + await graph.pluginDriver.hookParallel('buildEnd', []); + }); + timeEnd('BUILD', 1); + const result = { + cache: useCache ? graph.getCache() : undefined, + async close() { + if (result.closed) + return; + result.closed = true; + await graph.pluginDriver.hookParallel('closeBundle', []); + }, + closed: false, + async [Symbol.asyncDispose]() { + await this.close(); + }, + async generate(rawOutputOptions) { + if (result.closed) + return parseAst_js.error(parseAst_js.logAlreadyClosed()); + return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph); + }, + get watchFiles() { + return Object.keys(graph.watchFiles); + }, + async write(rawOutputOptions) { + if (result.closed) + return parseAst_js.error(parseAst_js.logAlreadyClosed()); + return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph); + } + }; + if (inputOptions.perf) + result.getTimings = getTimings; + return result; +} +async function getInputOptions(initialInputOptions, watchMode) { + if (!initialInputOptions) { + throw new Error('You must supply an options object to rollup'); + } + const processedInputOptions = await getProcessedInputOptions(initialInputOptions, watchMode); + const { options, unsetOptions } = await normalizeInputOptions(processedInputOptions, watchMode); + normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX); + return { options, unsetOptions }; +} +async function getProcessedInputOptions(inputOptions, watchMode) { + const plugins = getSortedValidatedPlugins('options', await normalizePluginOption(inputOptions.plugins)); + const logLevel = inputOptions.logLevel || parseAst_js.LOGLEVEL_INFO; + const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), watchMode, logLevel); + for (const plugin of plugins) { + const { name, options } = plugin; + const handler = 'handler' in options ? options.handler : options; + const processedOptions = await handler.call({ + debug: getLogHandler(parseAst_js.LOGLEVEL_DEBUG, 'PLUGIN_LOG', logger, name, logLevel), + error: (error_) => parseAst_js.error(parseAst_js.logPluginError(normalizeLog(error_), name, { hook: 'onLog' })), + info: getLogHandler(parseAst_js.LOGLEVEL_INFO, 'PLUGIN_LOG', logger, name, logLevel), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(parseAst_js.LOGLEVEL_WARN, 'PLUGIN_WARNING', logger, name, logLevel) + }, inputOptions); + if (processedOptions) { + inputOptions = processedOptions; + } + } + return inputOptions; +} +function normalizePlugins(plugins, anonymousPrefix) { + for (const [index, plugin] of plugins.entries()) { + if (!plugin.name) { + plugin.name = `${anonymousPrefix}${index + 1}`; + } + } +} +async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) { + const { options: outputOptions, outputPluginDriver, unsetOptions } = await getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions); + return catchUnfinishedHookActions(outputPluginDriver, async () => { + const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); + const generated = await bundle.generate(isWrite); + if (isWrite) { + timeStart('WRITE', 1); + if (!outputOptions.dir && !outputOptions.file) { + return parseAst_js.error(parseAst_js.logMissingFileOrDirOption()); + } + await Promise.all(Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions)))); + await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); + timeEnd('WRITE', 1); + } + return createOutput(generated); + }); +} +async function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) { + if (!rawOutputOptions) { + throw new Error('You must supply an options object'); + } + const rawPlugins = await normalizePluginOption(rawOutputOptions.plugins); + normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX); + const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins); + return { + ...(await getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver)), + outputPluginDriver + }; +} +function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) { + return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => { + const emitError = () => pluginContext.error(parseAst_js.logCannotEmitFromOptionsHook()); + return { + ...pluginContext, + emitFile: emitError, + setAssetSource: emitError + }; + }), inputOptions, unsetInputOptions); +} +function createOutput(outputBundle) { + return { + output: Object.values(outputBundle).filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => getSortingFileType(outputFileA) - getSortingFileType(outputFileB)) + }; +} +var SortingFileType; +(function (SortingFileType) { + SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK"; + SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK"; + SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET"; +})(SortingFileType || (SortingFileType = {})); +function getSortingFileType(file) { + if (file.type === 'asset') { + return SortingFileType.ASSET; + } + if (file.isEntry) { + return SortingFileType.ENTRY_CHUNK; + } + return SortingFileType.SECONDARY_CHUNK; +} +async function writeOutputFile(outputFile, outputOptions) { + const fileName = path.resolve(outputOptions.dir || path.dirname(outputOptions.file), outputFile.fileName); + // 'recursive: true' does not throw if the folder structure, or parts of it, already exist + await promises.mkdir(path.dirname(fileName), { recursive: true }); + return promises.writeFile(fileName, outputFile.type === 'asset' ? outputFile.source : outputFile.code); +} +/** + * Auxiliary function for defining rollup configuration + * Mainly to facilitate IDE code prompts, after all, export default does not + * prompt, even if you add @type annotations, it is not accurate + * @param options + */ +function defineConfig(options) { + return options; +} + +exports.blue = blue; +exports.bold = bold; +exports.commandAliases = commandAliases; +exports.createFilter = createFilter; +exports.cyan = cyan$1; +exports.cyan$1 = cyan; +exports.defineConfig = defineConfig; +exports.ensureArray = ensureArray$1; +exports.getAugmentedNamespace = getAugmentedNamespace; +exports.getDefaultExportFromCjs = getDefaultExportFromCjs; +exports.getNewArray = getNewArray; +exports.getOrCreate = getOrCreate; +exports.gray = gray; +exports.green = green; +exports.handleError = handleError; +exports.isWatchEnabled = isWatchEnabled; +exports.mergeOptions = mergeOptions; +exports.normalizePluginOption = normalizePluginOption; +exports.rollup = rollup; +exports.rollupInternal = rollupInternal; +exports.stderr = stderr; +exports.underline = underline; +exports.version = version; +exports.yellow = yellow; +//# sourceMappingURL=rollup.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/watch-cli.js b/seller_1/node_modules/rollup/dist/shared/watch-cli.js new file mode 100644 index 0000000..5cae062 --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/watch-cli.js @@ -0,0 +1,563 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const index = require('./index.js'); +const promises = require('node:fs/promises'); +const process$2 = require('node:process'); +const cli = require('../bin/rollup'); +const rollup = require('./rollup.js'); +const parseAst_js = require('./parseAst.js'); +const loadConfigFile_js = require('./loadConfigFile.js'); +const node_child_process = require('node:child_process'); +const rollup_js = require('../rollup.js'); +require('path'); +require('fs'); +require('util'); +require('stream'); +require('os'); +require('./fsevents-importer.js'); +require('events'); +require('node:path'); +require('tty'); +require('../native.js'); +require('node:perf_hooks'); +require('node:url'); +require('../getLogFilter.js'); + +function timeZone(date = new Date()) { + const offset = date.getTimezoneOffset(); + const absOffset = Math.abs(offset); + const hours = Math.floor(absOffset / 60); + const minutes = absOffset % 60; + const minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : ''; + return (offset < 0 ? '+' : '-') + hours + minutesOut; +} + +function dateTime(options = {}) { + let { + date = new Date(), + local = true, + showTimeZone = false, + showMilliseconds = false + } = options; + + if (local) { + // Offset the date so it will return the correct value when getting the ISO string. + date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)); + } + + let end = ''; + + if (showTimeZone) { + end = ' UTC' + (local ? timeZone(date) : ''); + } + + if (showMilliseconds && date.getUTCMilliseconds() > 0) { + end = ` ${date.getUTCMilliseconds()}ms${end}`; + } + + return date + .toISOString() + .replace(/T/, ' ') + .replace(/\..+/, end); +} + +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +const signals = []; +signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} + +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny special purpose ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return false; + } + this.emitted[ev] = true; + let ret = false; + for (const fn of this.listeners[ev]) { + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; + } + return ret; + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process$1.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { <signal>: <listener fn>, ... } + this.#sigListeners = {}; + for (const sig of signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit, and increment by the count of listeners it has + // created. + /* c8 ignore start */ + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + const ret = this.#emitter.emit('exit', null, sig); + /* c8 ignore start */ + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process$1 = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +const { +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload, } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback()); + +const CLEAR_SCREEN = '\u001Bc'; +function getResetScreen(configs, allowClearScreen) { + let clearScreen = allowClearScreen; + for (const config of configs) { + if (config.watch && config.watch.clearScreen === false) { + clearScreen = false; + } + } + if (clearScreen) { + return (heading) => rollup.stderr(CLEAR_SCREEN + heading); + } + let firstRun = true; + return (heading) => { + if (firstRun) { + rollup.stderr(heading); + firstRun = false; + } + }; +} + +function extractWatchHooks(command) { + if (!Array.isArray(command.watch)) + return {}; + return command.watch + .filter(value => typeof value === 'object') + .reduce((accumulator, keyValueOption) => ({ ...accumulator, ...keyValueOption }), {}); +} +function createWatchHooks(command) { + const watchHooks = extractWatchHooks(command); + return function (hook) { + if (watchHooks[hook]) { + const cmd = watchHooks[hook]; + if (!command.silent) { + rollup.stderr(rollup.cyan$1(`watch.${hook} ${rollup.bold(`$ ${cmd}`)}`)); + } + try { + // !! important - use stderr for all writes from execSync + const stdio = [process.stdin, process.stderr, process.stderr]; + node_child_process.execSync(cmd, { stdio: command.silent ? 'ignore' : stdio }); + } + catch (error) { + rollup.stderr(error.message); + } + } + }; +} + +async function watch(command) { + process$2.env.ROLLUP_WATCH = 'true'; + const isTTY = process$2.stderr.isTTY; + const silent = command.silent; + let watcher; + let configWatcher; + let resetScreen; + const configFile = command.config ? await cli.getConfigPath(command.config) : null; + const runWatchHook = createWatchHooks(command); + onExit(close); + process$2.on('uncaughtException', closeWithError); + if (!process$2.stdin.isTTY) { + process$2.stdin.on('end', close); + process$2.stdin.resume(); + } + async function loadConfigFromFileAndTrack(configFile) { + let configFileData = null; + let configFileRevision = 0; + configWatcher = index.chokidar.watch(configFile).on('change', reloadConfigFile); + await reloadConfigFile(); + async function reloadConfigFile() { + try { + const newConfigFileData = await promises.readFile(configFile, 'utf8'); + if (newConfigFileData === configFileData) { + return; + } + configFileRevision++; + const currentConfigFileRevision = configFileRevision; + if (configFileData) { + rollup.stderr(`\nReloading updated config...`); + } + configFileData = newConfigFileData; + const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command, true); + if (currentConfigFileRevision !== configFileRevision) { + return; + } + if (watcher) { + await watcher.close(); + } + start(options, warnings); + } + catch (error) { + rollup.handleError(error, true); + } + } + } + if (configFile) { + await loadConfigFromFileAndTrack(configFile); + } + else { + const { options, warnings } = await cli.loadConfigFromCommand(command, true); + await start(options, warnings); + } + async function start(configs, warnings) { + watcher = rollup_js.watch(configs); + watcher.on('event', event => { + switch (event.code) { + case 'ERROR': { + warnings.flush(); + rollup.handleError(event.error, true); + runWatchHook('onError'); + break; + } + case 'START': { + if (!silent) { + if (!resetScreen) { + resetScreen = getResetScreen(configs, isTTY); + } + resetScreen(rollup.underline(`rollup v${rollup.version}`)); + } + runWatchHook('onStart'); + break; + } + case 'BUNDLE_START': { + if (!silent) { + let input = event.input; + if (typeof input !== 'string') { + input = Array.isArray(input) + ? input.join(', ') + : Object.values(input).join(', '); + } + rollup.stderr(rollup.cyan$1(`bundles ${rollup.bold(input)} → ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))}...`)); + } + runWatchHook('onBundleStart'); + break; + } + case 'BUNDLE_END': { + warnings.flush(); + if (!silent) + rollup.stderr(rollup.green(`created ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))} in ${rollup.bold(cli.prettyMilliseconds(event.duration))}`)); + runWatchHook('onBundleEnd'); + if (event.result && event.result.getTimings) { + cli.printTimings(event.result.getTimings()); + } + break; + } + case 'END': { + runWatchHook('onEnd'); + if (!silent && isTTY) { + rollup.stderr(`\n[${dateTime()}] waiting for changes...`); + } + } + } + if ('result' in event && event.result) { + event.result.close().catch(error => rollup.handleError(error, true)); + } + }); + } + function close(code) { + process$2.removeListener('uncaughtException', closeWithError); + // removing a non-existent listener is a no-op + process$2.stdin.removeListener('end', close); + if (configWatcher) + configWatcher.close(); + Promise.resolve(watcher?.close()).finally(() => { + process$2.exit(typeof code === 'number' ? code : 0); + }); + // Tell signal-exit that we are handling this gracefully + return true; + } + // return a promise that never resolves to keep the process running + return new Promise(() => { }); +} +function closeWithError(error) { + error.name = `Uncaught ${error.name}`; + rollup.handleError(error); +} + +exports.watch = watch; +//# sourceMappingURL=watch-cli.js.map diff --git a/seller_1/node_modules/rollup/dist/shared/watch.js b/seller_1/node_modules/rollup/dist/shared/watch.js new file mode 100644 index 0000000..e0e31ca --- /dev/null +++ b/seller_1/node_modules/rollup/dist/shared/watch.js @@ -0,0 +1,324 @@ +/* + @license + Rollup.js v4.28.1 + Fri, 06 Dec 2024 11:44:27 GMT - commit e60fb1c5d4e54ed5257495215eeda1bb43cf54ba + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const rollup = require('./rollup.js'); +const path = require('node:path'); +const process = require('node:process'); +const index = require('./index.js'); +const node_os = require('node:os'); +require('./parseAst.js'); +require('../native.js'); +require('tty'); +require('path'); +require('node:perf_hooks'); +require('node:fs/promises'); +require('fs'); +require('util'); +require('stream'); +require('os'); +require('./fsevents-importer.js'); +require('events'); + +class FileWatcher { + constructor(task, chokidarOptions) { + this.transformWatchers = new Map(); + this.chokidarOptions = chokidarOptions; + this.task = task; + this.watcher = this.createWatcher(null); + } + close() { + this.watcher.close(); + for (const watcher of this.transformWatchers.values()) { + watcher.close(); + } + } + unwatch(id) { + this.watcher.unwatch(id); + const transformWatcher = this.transformWatchers.get(id); + if (transformWatcher) { + this.transformWatchers.delete(id); + transformWatcher.close(); + } + } + watch(id, isTransformDependency) { + if (isTransformDependency) { + const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id); + watcher.add(id); + this.transformWatchers.set(id, watcher); + } + else { + this.watcher.add(id); + } + } + createWatcher(transformWatcherId) { + const task = this.task; + const isLinux = node_os.platform() === 'linux'; + const isFreeBSD = node_os.platform() === 'freebsd'; + const isTransformDependency = transformWatcherId !== null; + const handleChange = (id, event) => { + const changedId = transformWatcherId || id; + if (isLinux || isFreeBSD) { + // unwatching and watching fixes an issue with chokidar where on certain systems, + // a file that was unlinked and immediately recreated would create a change event + // but then no longer any further events + watcher.unwatch(changedId); + watcher.add(changedId); + } + task.invalidate(changedId, { event, isTransformDependency }); + }; + const watcher = index.chokidar + .watch([], this.chokidarOptions) + .on('add', id => handleChange(id, 'create')) + .on('change', id => handleChange(id, 'update')) + .on('unlink', id => handleChange(id, 'delete')); + return watcher; + } +} + +const eventsRewrites = { + create: { + create: 'buggy', + delete: null, //delete file from map + update: 'create' + }, + delete: { + create: 'update', + delete: 'buggy', + update: 'buggy' + }, + update: { + create: 'buggy', + delete: 'delete', + update: 'update' + } +}; +class Watcher { + constructor(optionsList, emitter) { + this.buildDelay = 0; + this.buildTimeout = null; + this.closed = false; + this.invalidatedIds = new Map(); + this.rerun = false; + this.running = true; + this.emitter = emitter; + emitter.close = this.close.bind(this); + this.tasks = optionsList.map(options => new Task(this, options)); + for (const { watch } of optionsList) { + if (watch && typeof watch.buildDelay === 'number') { + this.buildDelay = Math.max(this.buildDelay, watch.buildDelay); + } + } + process.nextTick(() => this.run()); + } + async close() { + if (this.closed) + return; + this.closed = true; + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + for (const task of this.tasks) { + task.close(); + } + await this.emitter.emit('close'); + this.emitter.removeAllListeners(); + } + invalidate(file) { + if (file) { + const previousEvent = this.invalidatedIds.get(file.id); + const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event; + if (event === 'buggy') { + //TODO: throws or warn? Currently just ignore, uses new event + this.invalidatedIds.set(file.id, file.event); + } + else if (event === null) { + this.invalidatedIds.delete(file.id); + } + else { + this.invalidatedIds.set(file.id, event); + } + } + if (this.running) { + this.rerun = true; + return; + } + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + this.buildTimeout = setTimeout(async () => { + this.buildTimeout = null; + try { + await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event }))); + this.invalidatedIds.clear(); + await this.emitter.emit('restart'); + this.emitter.removeListenersForCurrentRun(); + this.run(); + } + catch (error) { + this.invalidatedIds.clear(); + await this.emitter.emit('event', { + code: 'ERROR', + error, + result: null + }); + await this.emitter.emit('event', { + code: 'END' + }); + } + }, this.buildDelay); + } + async run() { + this.running = true; + await this.emitter.emit('event', { + code: 'START' + }); + for (const task of this.tasks) { + await task.run(); + } + this.running = false; + await this.emitter.emit('event', { + code: 'END' + }); + if (this.rerun) { + this.rerun = false; + this.invalidate(); + } + } +} +class Task { + constructor(watcher, options) { + this.cache = { modules: [] }; + this.watchFiles = []; + this.closed = false; + this.invalidated = true; + this.watched = new Set(); + this.watcher = watcher; + this.options = options; + this.skipWrite = Boolean(options.watch && options.watch.skipWrite); + this.outputs = this.options.output; + this.outputFiles = this.outputs.map(output => { + if (output.file || output.dir) + return path.resolve(output.file || output.dir); + return undefined; + }); + const watchOptions = this.options.watch || {}; + this.filter = rollup.createFilter(watchOptions.include, watchOptions.exclude); + this.fileWatcher = new FileWatcher(this, { + ...watchOptions.chokidar, + disableGlobbing: true, + ignoreInitial: true + }); + } + close() { + this.closed = true; + this.fileWatcher.close(); + } + invalidate(id, details) { + this.invalidated = true; + if (details.isTransformDependency) { + for (const module of this.cache.modules) { + if (!module.transformDependencies.includes(id)) + continue; + // effective invalidation + module.originalCode = null; + } + } + this.watcher.invalidate({ event: details.event, id }); + } + async run() { + if (!this.invalidated) + return; + this.invalidated = false; + const options = { + ...this.options, + cache: this.cache + }; + const start = Date.now(); + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_START', + input: this.options.input, + output: this.outputFiles + }); + let result = null; + try { + result = await rollup.rollupInternal(options, this.watcher.emitter); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + if (!this.skipWrite) { + await Promise.all(this.outputs.map(output => result.write(output))); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + } + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_END', + duration: Date.now() - start, + input: this.options.input, + output: this.outputFiles, + result + }); + } + catch (error) { + if (!this.closed) { + if (Array.isArray(error.watchFiles)) { + for (const id of error.watchFiles) { + this.watchFile(id); + } + } + if (error.id) { + this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); + } + } + await this.watcher.emitter.emit('event', { + code: 'ERROR', + error, + result + }); + } + } + updateWatchedFiles(result) { + const previouslyWatched = this.watched; + this.watched = new Set(); + this.watchFiles = result.watchFiles; + this.cache = result.cache; + for (const id of this.watchFiles) { + this.watchFile(id); + } + for (const module of this.cache.modules) { + for (const depId of module.transformDependencies) { + this.watchFile(depId, true); + } + } + for (const id of previouslyWatched) { + if (!this.watched.has(id)) { + this.fileWatcher.unwatch(id); + } + } + } + watchFile(id, isTransformDependency = false) { + if (!this.filter(id)) + return; + this.watched.add(id); + if (this.outputFiles.includes(id)) { + throw new Error('Cannot import the generated bundle'); + } + // this is necessary to ensure that any 'renamed' files + // continue to be watched following an error + this.fileWatcher.watch(id, isTransformDependency); + } +} + +exports.Task = Task; +exports.Watcher = Watcher; +//# sourceMappingURL=watch.js.map diff --git a/seller_1/node_modules/rollup/package.json b/seller_1/node_modules/rollup/package.json new file mode 100644 index 0000000..6ebef5d --- /dev/null +++ b/seller_1/node_modules/rollup/package.json @@ -0,0 +1,266 @@ +{ + "name": "rollup", + "version": "4.28.1", + "description": "Next-generation ES module bundler", + "main": "dist/rollup.js", + "module": "dist/es/rollup.js", + "types": "dist/rollup.d.ts", + "bin": { + "rollup": "dist/bin/rollup" + }, + "napi": { + "name": "rollup", + "package": { + "name": "@rollup/rollup" + }, + "triples": { + "defaults": false, + "additional": [ + "aarch64-apple-darwin", + "aarch64-linux-android", + "aarch64-pc-windows-msvc", + "aarch64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-linux-androideabi", + "armv7-unknown-linux-gnueabihf", + "armv7-unknown-linux-musleabihf", + "i686-pc-windows-msvc", + "loongarch64-unknown-linux-gnu", + "riscv64gc-unknown-linux-gnu", + "powerpc64le-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-freebsd", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl" + ] + } + }, + "scripts": { + "build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native", + "build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native", + "build:napi": "napi build --platform --dts native.d.ts --js false --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi", + "build:wasm": "cross-env RUSTFLAGS=\"-C opt-level=z\" wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore", + "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore", + "update:napi": "npm run build:napi && npm run build:copy-native", + "build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit", + "build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode --forceExit", + "build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native", + "update:js": "npm run build:js && npm run build:copy-native", + "build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/", + "dev": "concurrently -kc green,blue 'nodemon --watch rust -e rs --exec \"npm run build:wasm\"' 'vitepress dev docs'", + "build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit", + "build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --forceExit && shx rm -rf dist-build", + "build:bootstrap:cjs": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit && shx rm -rf dist-build", + "build:docs": "vitepress build docs", + "build:ast-converters": "node scripts/generate-ast-converters.js", + "preview:docs": "vitepress preview docs", + "ci:artifacts": "napi artifacts", + "ci:lint": "concurrently -c red,yellow,green,blue 'npm:lint:js:nofix' 'npm:lint:native-js' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'", + "ci:test:only": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && npm run test:only", + "ci:test:all": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'", + "ci:coverage": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && NODE_OPTIONS=--no-experimental-detect-module nyc --reporter lcovonly mocha", + "lint": "concurrently -c red,yellow,green,blue 'npm:lint:js' 'npm:lint:native-js' 'npm:lint:markdown' 'npm:lint:rust'", + "lint:js": "eslint . --fix --cache", + "lint:js:nofix": "eslint . --cache", + "lint:native-js": "node scripts/lint-native-js.js", + "lint:markdown": "prettier --write \"**/*.md\"", + "lint:markdown:nofix": "prettier --check \"**/*.md\"", + "lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty", + "lint:rust:nofix": "cd rust && cargo fmt --check && cargo clippy", + "perf": "npm run build:bootstrap:cjs && node --expose-gc scripts/perf-report/index.js", + "prepare": "husky && node scripts/check-release.js || npm run build:prepare", + "prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js", + "postpublish": "node scripts/postpublish.js", + "prepublish:napi": "napi prepublish --skip-gh-release", + "release": "node scripts/prepare-release.js", + "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published", + "check-audit": "check-audit", + "resolve-audit": "resolve-audit", + "test": "npm run build && npm run test:all", + "test:update-snapshots": "node scripts/update-snapshots.js", + "test:cjs": "npm run build:cjs && npm run test:only", + "test:quick": "mocha -b test/test.js", + "test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:package' 'npm:test:options'", + "test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js", + "test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js", + "test:leak": "npm install --no-save weak-napi && node --expose-gc test/leak/index.js", + "test:package": "node scripts/test-package.js", + "test:options": "node scripts/test-options.js", + "test:only": "mocha test/test.js", + "test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit && tsc --noEmit -p scripts", + "test:browser": "mocha test/browser/index.js", + "watch": "rollup --config rollup.config.ts --configPlugin typescript --watch" + }, + "repository": "rollup/rollup", + "keywords": [ + "modules", + "bundler", + "bundling", + "es6", + "optimizer" + ], + "author": "Rich Harris", + "license": "MIT", + "bugs": { + "url": "https://github.com/rollup/rollup/issues" + }, + "homepage": "https://rollupjs.org/", + "optionalDependencies": { + "fsevents": "~2.3.2", + "@rollup/rollup-darwin-arm64": "4.28.1", + "@rollup/rollup-android-arm64": "4.28.1", + "@rollup/rollup-win32-arm64-msvc": "4.28.1", + "@rollup/rollup-freebsd-arm64": "4.28.1", + "@rollup/rollup-linux-arm64-gnu": "4.28.1", + "@rollup/rollup-linux-arm64-musl": "4.28.1", + "@rollup/rollup-android-arm-eabi": "4.28.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.28.1", + "@rollup/rollup-linux-arm-musleabihf": "4.28.1", + "@rollup/rollup-win32-ia32-msvc": "4.28.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.28.1", + "@rollup/rollup-linux-riscv64-gnu": "4.28.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1", + "@rollup/rollup-linux-s390x-gnu": "4.28.1", + "@rollup/rollup-darwin-x64": "4.28.1", + "@rollup/rollup-win32-x64-msvc": "4.28.1", + "@rollup/rollup-freebsd-x64": "4.28.1", + "@rollup/rollup-linux-x64-gnu": "4.28.1", + "@rollup/rollup-linux-x64-musl": "4.28.1" + }, + "dependencies": { + "@types/estree": "1.0.6" + }, + "devDependenciesComments": { + "core-js": "We only update manually as every update requires a snapshot update" + }, + "devDependencies": { + "@codemirror/commands": "^6.7.1", + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/language": "^6.10.6", + "@codemirror/search": "^6.5.8", + "@codemirror/state": "^6.4.1", + "@codemirror/view": "^6.35.0", + "@eslint/js": "^9.16.0", + "@inquirer/prompts": "^7.1.0", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@mermaid-js/mermaid-cli": "^11.4.2", + "@napi-rs/cli": "^2.18.4", + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-buble": "^1.0.3", + "@rollup/plugin-commonjs": "^28.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.3.0", + "@rollup/plugin-replace": "^6.0.1", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.1", + "@rollup/pluginutils": "^5.1.3", + "@shikijs/vitepress-twoslash": "^1.24.0", + "@types/mocha": "^10.0.10", + "@types/node": "^18.19.67", + "@types/semver": "^7.5.8", + "@types/yargs-parser": "^21.0.3", + "@vue/language-server": "^2.1.10", + "acorn": "^8.14.0", + "acorn-import-assertions": "^1.9.0", + "acorn-jsx": "^5.3.2", + "buble": "^0.20.0", + "builtin-modules": "^4.0.0", + "chokidar": "^3.6.0", + "colorette": "^2.0.20", + "concurrently": "^9.1.0", + "core-js": "3.38.1", + "cross-env": "^7.0.3", + "date-time": "^4.0.0", + "es5-shim": "^4.6.7", + "es6-shim": "^0.35.8", + "eslint": "^9.16.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-unicorn": "^56.0.1", + "eslint-plugin-vue": "^9.32.0", + "fixturify": "^3.0.0", + "flru": "^1.0.2", + "fs-extra": "^11.2.0", + "github-api": "^3.4.0", + "globals": "^15.13.0", + "husky": "^9.1.7", + "is-reference": "^3.0.3", + "lint-staged": "^15.2.10", + "locate-character": "^3.0.0", + "magic-string": "^0.30.14", + "mocha": "^11.0.1", + "nodemon": "^3.1.7", + "npm-audit-resolver": "^3.0.0-RC.0", + "nyc": "^17.1.0", + "pinia": "^2.2.8", + "prettier": "^3.4.1", + "prettier-plugin-organize-imports": "^4.1.0", + "pretty-bytes": "^6.1.1", + "pretty-ms": "^9.2.0", + "requirejs": "^2.3.7", + "rollup": "^4.28.0", + "rollup-plugin-license": "^3.5.3", + "rollup-plugin-string": "^3.0.0", + "semver": "^7.6.3", + "shx": "^0.3.4", + "signal-exit": "^4.1.0", + "source-map": "^0.7.4", + "source-map-support": "^0.5.21", + "systemjs": "^6.15.1", + "terser": "^5.36.0", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.17.0", + "vite": "^6.0.2", + "vitepress": "^1.5.0", + "vue": "^3.5.13", + "vue-tsc": "^2.1.10", + "wasm-pack": "^0.13.1", + "yargs-parser": "^21.1.1" + }, + "overrides": { + "axios": "^1.7.8", + "semver": "^7.6.3", + "readable-stream": "npm:@built-in/readable-stream@1" + }, + "comments": { + "vue-tsc": "This is necessary so that prettier-plugin-organize-imports works correctly in Vue templatges" + }, + "files": [ + "dist/*.node", + "dist/**/*.js", + "dist/*.d.ts", + "dist/bin/rollup", + "dist/es/package.json" + ], + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "exports": { + ".": { + "types": "./dist/rollup.d.ts", + "require": "./dist/rollup.js", + "import": "./dist/es/rollup.js" + }, + "./loadConfigFile": { + "types": "./dist/loadConfigFile.d.ts", + "require": "./dist/loadConfigFile.js", + "default": "./dist/loadConfigFile.js" + }, + "./getLogFilter": { + "types": "./dist/getLogFilter.d.ts", + "require": "./dist/getLogFilter.js", + "import": "./dist/es/getLogFilter.js" + }, + "./parseAst": { + "types": "./dist/parseAst.d.ts", + "require": "./dist/parseAst.js", + "import": "./dist/es/parseAst.js" + }, + "./dist/*": "./dist/*" + } +} \ No newline at end of file diff --git a/seller_1/node_modules/source-map-js/LICENSE b/seller_1/node_modules/source-map-js/LICENSE new file mode 100644 index 0000000..ed1b7cf --- /dev/null +++ b/seller_1/node_modules/source-map-js/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/seller_1/node_modules/source-map-js/README.md b/seller_1/node_modules/source-map-js/README.md new file mode 100644 index 0000000..614962d --- /dev/null +++ b/seller_1/node_modules/source-map-js/README.md @@ -0,0 +1,765 @@ +# Source Map JS + +[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js) + +Difference between original [source-map](https://github.com/mozilla/source-map): + +> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations. + +This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async. + +It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times. + +![Downloads count](media/downloads.png) + +More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all. + +[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation. + +I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map. + +--------- + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map-js + +<!-- ## Use on the Web + + <script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> --> + +-------------------------------------------------------------------------------- + +<!-- `npm run toc` to regenerate the Table of Contents --> + +<!-- START doctoc generated TOC please keep comment here to allow auto update --> +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + +<!-- END doctoc generated TOC please keep comment here to allow auto update --> + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on + invalid mapping, it will be ignored. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +* `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, { + ignoreInvalidMapping: true, +}); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/seller_1/node_modules/source-map-js/lib/array-set.js b/seller_1/node_modules/source-map-js/lib/array-set.js new file mode 100644 index 0000000..fbd5c81 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/seller_1/node_modules/source-map-js/lib/base64-vlq.js b/seller_1/node_modules/source-map-js/lib/base64-vlq.js new file mode 100644 index 0000000..612b404 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/seller_1/node_modules/source-map-js/lib/base64.js b/seller_1/node_modules/source-map-js/lib/base64.js new file mode 100644 index 0000000..8aa86b3 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/seller_1/node_modules/source-map-js/lib/binary-search.js b/seller_1/node_modules/source-map-js/lib/binary-search.js new file mode 100644 index 0000000..010ac94 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/seller_1/node_modules/source-map-js/lib/mapping-list.js b/seller_1/node_modules/source-map-js/lib/mapping-list.js new file mode 100644 index 0000000..06d1274 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/seller_1/node_modules/source-map-js/lib/quick-sort.js b/seller_1/node_modules/source-map-js/lib/quick-sort.js new file mode 100644 index 0000000..23f9eda --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/quick-sort.js @@ -0,0 +1,132 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +function SortTemplate(comparator) { + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + + return doQuickSort; +} + +function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + +let sortCache = new WeakMap(); +exports.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); +}; diff --git a/seller_1/node_modules/source-map-js/lib/source-map-consumer.d.ts b/seller_1/node_modules/source-map-js/lib/source-map-consumer.d.ts new file mode 100644 index 0000000..744bda7 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-map-consumer.d.ts @@ -0,0 +1 @@ +export { SourceMapConsumer } from '..'; diff --git a/seller_1/node_modules/source-map-js/lib/source-map-consumer.js b/seller_1/node_modules/source-map-js/lib/source-map-consumer.js new file mode 100644 index 0000000..ee66114 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-map-consumer.js @@ -0,0 +1,1188 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + } + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + +const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; +function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } +} +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content || content === '') { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/seller_1/node_modules/source-map-js/lib/source-map-generator.d.ts b/seller_1/node_modules/source-map-js/lib/source-map-generator.d.ts new file mode 100644 index 0000000..f59d70a --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-map-generator.d.ts @@ -0,0 +1 @@ +export { SourceMapGenerator } from '..'; diff --git a/seller_1/node_modules/source-map-js/lib/source-map-generator.js b/seller_1/node_modules/source-map-js/lib/source-map-generator.js new file mode 100644 index 0000000..bab04ff --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-map-generator.js @@ -0,0 +1,444 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + })); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name) === false) { + return; + } + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + var message = 'Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message) + } + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/seller_1/node_modules/source-map-js/lib/source-node.d.ts b/seller_1/node_modules/source-map-js/lib/source-node.d.ts new file mode 100644 index 0000000..4df6a1a --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-node.d.ts @@ -0,0 +1 @@ +export { SourceNode } from '..'; diff --git a/seller_1/node_modules/source-map-js/lib/source-node.js b/seller_1/node_modules/source-map-js/lib/source-node.js new file mode 100644 index 0000000..8bcdbe3 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/seller_1/node_modules/source-map-js/lib/util.js b/seller_1/node_modules/source-map-js/lib/util.js new file mode 100644 index 0000000..430e2d0 --- /dev/null +++ b/seller_1/node_modules/source-map-js/lib/util.js @@ -0,0 +1,594 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +var MAX_CACHED_INPUTS = 32; + +/** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ +function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; +} + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '<dir>/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +}); +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/seller_1/node_modules/source-map-js/package.json b/seller_1/node_modules/source-map-js/package.json new file mode 100644 index 0000000..f58dbeb --- /dev/null +++ b/seller_1/node_modules/source-map-js/package.json @@ -0,0 +1,71 @@ +{ + "name": "source-map-js", + "description": "Generates and consumes source maps", + "version": "1.2.1", + "homepage": "https://github.com/7rulnik/source-map-js", + "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>", + "contributors": [ + "Nick Fitzgerald <nfitzgerald@mozilla.com>", + "Tobias Koppers <tobias.koppers@googlemail.com>", + "Duncan Beevers <duncan@dweebd.com>", + "Stephen Crane <scrane@mozilla.com>", + "Ryan Seddon <seddon.ryan@gmail.com>", + "Miles Elam <miles.elam@deem.com>", + "Mihai Bazon <mihai.bazon@gmail.com>", + "Michael Ficarra <github.public.email@michael.ficarra.me>", + "Todd Wolfson <todd@twolfson.com>", + "Alexander Solovyov <alexander@solovyov.net>", + "Felix Gnass <fgnass@gmail.com>", + "Conrad Irwin <conrad.irwin@gmail.com>", + "usrbincc <usrbincc@yahoo.com>", + "David Glasser <glasser@davidglasser.net>", + "Chase Douglas <chase@newrelic.com>", + "Evan Wallace <evan.exe@gmail.com>", + "Heather Arthur <fayearthur@gmail.com>", + "Hugh Kennedy <hughskennedy@gmail.com>", + "David Glasser <glasser@davidglasser.net>", + "Simon Lydell <simon.lydell@gmail.com>", + "Jmeas Smith <jellyes2@gmail.com>", + "Michael Z Goddard <mzgoddard@gmail.com>", + "azu <azu@users.noreply.github.com>", + "John Gozde <john@gozde.ca>", + "Adam Kirkton <akirkton@truefitinnovation.com>", + "Chris Montgomery <christopher.montgomery@dowjones.com>", + "J. Ryan Stinnett <jryans@gmail.com>", + "Jack Herrington <jherrington@walmartlabs.com>", + "Chris Truter <jeffpalentine@gmail.com>", + "Daniel Espeset <daniel@danielespeset.com>", + "Jamie Wong <jamie.lf.wong@gmail.com>", + "Eddy Bruël <ejpbruel@mozilla.com>", + "Hawken Rives <hawkrives@gmail.com>", + "Gilad Peleg <giladp007@gmail.com>", + "djchie <djchie.dev@gmail.com>", + "Gary Ye <garysye@gmail.com>", + "Nicolas Lalevée <nicolas.lalevee@hibnet.org>" + ], + "repository": "7rulnik/source-map-js", + "main": "./source-map.js", + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "clean-publish": "^3.1.0", + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "clean-publish": { + "cleanDocs": true + }, + "typings": "source-map.d.ts" +} diff --git a/seller_1/node_modules/source-map-js/source-map.d.ts b/seller_1/node_modules/source-map-js/source-map.d.ts new file mode 100644 index 0000000..ec8892f --- /dev/null +++ b/seller_1/node_modules/source-map-js/source-map.d.ts @@ -0,0 +1,104 @@ +export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; +} + +export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; +} + +export interface Position { + line: number; + column: number; +} + +export interface LineRange extends Position { + lastColumn: number; +} + +export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; +} + +export interface SourceFindPosition extends FindPosition { + source: string; +} + +export interface MappedPosition extends Position { + source: string; + name?: string; +} + +export interface MappingItem { + source: string | null; + generatedLine: number; + generatedColumn: number; + originalLine: number | null; + originalColumn: number | null; + name: string | null; +} + +export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + readonly file: string | undefined | null; + readonly sourceRoot: string | undefined | null; + readonly sourcesContent: readonly string[] | null | undefined; + readonly sources: readonly string[] + + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; +} + +export interface Mapping { + generated: Position; + original?: Position | null; + source?: string | null; + name?: string | null; +} + +export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer, startOfSourceMap?: StartOfSourceMap): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string | null | undefined): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; + toJSON(): RawSourceMap; +} + +export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; +} + +export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; +} diff --git a/seller_1/node_modules/source-map-js/source-map.js b/seller_1/node_modules/source-map-js/source-map.js new file mode 100644 index 0000000..bc88fe8 --- /dev/null +++ b/seller_1/node_modules/source-map-js/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/seller_1/node_modules/vite/LICENSE.md b/seller_1/node_modules/vite/LICENSE.md new file mode 100644 index 0000000..d9c9262 --- /dev/null +++ b/seller_1/node_modules/vite/LICENSE.md @@ -0,0 +1,2479 @@ +# Vite core license +Vite is released under the MIT license: + +MIT License + +Copyright (c) 2019-present, VoidZero Inc. and Vite contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +# Licenses of bundled dependencies +The published Vite artifact additionally contains code with the following licenses: +Apache-2.0, BSD-2-Clause, CC0-1.0, ISC, MIT + +# Bundled dependencies: +## @ampproject/remapping +License: Apache-2.0 +By: Justin Ridgewell +Repository: git+https://github.com/ampproject/remapping.git + +> Apache License +> Version 2.0, January 2004 +> http://www.apache.org/licenses/ +> +> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +> +> 1. Definitions. +> +> "License" shall mean the terms and conditions for use, reproduction, +> and distribution as defined by Sections 1 through 9 of this document. +> +> "Licensor" shall mean the copyright owner or entity authorized by +> the copyright owner that is granting the License. +> +> "Legal Entity" shall mean the union of the acting entity and all +> other entities that control, are controlled by, or are under common +> control with that entity. For the purposes of this definition, +> "control" means (i) the power, direct or indirect, to cause the +> direction or management of such entity, whether by contract or +> otherwise, or (ii) ownership of fifty percent (50%) or more of the +> outstanding shares, or (iii) beneficial ownership of such entity. +> +> "You" (or "Your") shall mean an individual or Legal Entity +> exercising permissions granted by this License. +> +> "Source" form shall mean the preferred form for making modifications, +> including but not limited to software source code, documentation +> source, and configuration files. +> +> "Object" form shall mean any form resulting from mechanical +> transformation or translation of a Source form, including but +> not limited to compiled object code, generated documentation, +> and conversions to other media types. +> +> "Work" shall mean the work of authorship, whether in Source or +> Object form, made available under the License, as indicated by a +> copyright notice that is included in or attached to the work +> (an example is provided in the Appendix below). +> +> "Derivative Works" shall mean any work, whether in Source or Object +> form, that is based on (or derived from) the Work and for which the +> editorial revisions, annotations, elaborations, or other modifications +> represent, as a whole, an original work of authorship. For the purposes +> of this License, Derivative Works shall not include works that remain +> separable from, or merely link (or bind by name) to the interfaces of, +> the Work and Derivative Works thereof. +> +> "Contribution" shall mean any work of authorship, including +> the original version of the Work and any modifications or additions +> to that Work or Derivative Works thereof, that is intentionally +> submitted to Licensor for inclusion in the Work by the copyright owner +> or by an individual or Legal Entity authorized to submit on behalf of +> the copyright owner. For the purposes of this definition, "submitted" +> means any form of electronic, verbal, or written communication sent +> to the Licensor or its representatives, including but not limited to +> communication on electronic mailing lists, source code control systems, +> and issue tracking systems that are managed by, or on behalf of, the +> Licensor for the purpose of discussing and improving the Work, but +> excluding communication that is conspicuously marked or otherwise +> designated in writing by the copyright owner as "Not a Contribution." +> +> "Contributor" shall mean Licensor and any individual or Legal Entity +> on behalf of whom a Contribution has been received by Licensor and +> subsequently incorporated within the Work. +> +> 2. Grant of Copyright License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> copyright license to reproduce, prepare Derivative Works of, +> publicly display, publicly perform, sublicense, and distribute the +> Work and such Derivative Works in Source or Object form. +> +> 3. Grant of Patent License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> (except as stated in this section) patent license to make, have made, +> use, offer to sell, sell, import, and otherwise transfer the Work, +> where such license applies only to those patent claims licensable +> by such Contributor that are necessarily infringed by their +> Contribution(s) alone or by combination of their Contribution(s) +> with the Work to which such Contribution(s) was submitted. If You +> institute patent litigation against any entity (including a +> cross-claim or counterclaim in a lawsuit) alleging that the Work +> or a Contribution incorporated within the Work constitutes direct +> or contributory patent infringement, then any patent licenses +> granted to You under this License for that Work shall terminate +> as of the date such litigation is filed. +> +> 4. Redistribution. You may reproduce and distribute copies of the +> Work or Derivative Works thereof in any medium, with or without +> modifications, and in Source or Object form, provided that You +> meet the following conditions: +> +> (a) You must give any other recipients of the Work or +> Derivative Works a copy of this License; and +> +> (b) You must cause any modified files to carry prominent notices +> stating that You changed the files; and +> +> (c) You must retain, in the Source form of any Derivative Works +> that You distribute, all copyright, patent, trademark, and +> attribution notices from the Source form of the Work, +> excluding those notices that do not pertain to any part of +> the Derivative Works; and +> +> (d) If the Work includes a "NOTICE" text file as part of its +> distribution, then any Derivative Works that You distribute must +> include a readable copy of the attribution notices contained +> within such NOTICE file, excluding those notices that do not +> pertain to any part of the Derivative Works, in at least one +> of the following places: within a NOTICE text file distributed +> as part of the Derivative Works; within the Source form or +> documentation, if provided along with the Derivative Works; or, +> within a display generated by the Derivative Works, if and +> wherever such third-party notices normally appear. The contents +> of the NOTICE file are for informational purposes only and +> do not modify the License. You may add Your own attribution +> notices within Derivative Works that You distribute, alongside +> or as an addendum to the NOTICE text from the Work, provided +> that such additional attribution notices cannot be construed +> as modifying the License. +> +> You may add Your own copyright statement to Your modifications and +> may provide additional or different license terms and conditions +> for use, reproduction, or distribution of Your modifications, or +> for any such Derivative Works as a whole, provided Your use, +> reproduction, and distribution of the Work otherwise complies with +> the conditions stated in this License. +> +> 5. Submission of Contributions. Unless You explicitly state otherwise, +> any Contribution intentionally submitted for inclusion in the Work +> by You to the Licensor shall be under the terms and conditions of +> this License, without any additional terms or conditions. +> Notwithstanding the above, nothing herein shall supersede or modify +> the terms of any separate license agreement you may have executed +> with Licensor regarding such Contributions. +> +> 6. Trademarks. This License does not grant permission to use the trade +> names, trademarks, service marks, or product names of the Licensor, +> except as required for reasonable and customary use in describing the +> origin of the Work and reproducing the content of the NOTICE file. +> +> 7. Disclaimer of Warranty. Unless required by applicable law or +> agreed to in writing, Licensor provides the Work (and each +> Contributor provides its Contributions) on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +> implied, including, without limitation, any warranties or conditions +> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any +> risks associated with Your exercise of permissions under this License. +> +> 8. Limitation of Liability. In no event and under no legal theory, +> whether in tort (including negligence), contract, or otherwise, +> unless required by applicable law (such as deliberate and grossly +> negligent acts) or agreed to in writing, shall any Contributor be +> liable to You for damages, including any direct, indirect, special, +> incidental, or consequential damages of any character arising as a +> result of this License or out of the use or inability to use the +> Work (including but not limited to damages for loss of goodwill, +> work stoppage, computer failure or malfunction, or any and all +> other commercial damages or losses), even if such Contributor +> has been advised of the possibility of such damages. +> +> 9. Accepting Warranty or Additional Liability. While redistributing +> the Work or Derivative Works thereof, You may choose to offer, +> and charge a fee for, acceptance of support, warranty, indemnity, +> or other liability obligations and/or rights consistent with this +> License. However, in accepting such obligations, You may act only +> on Your own behalf and on Your sole responsibility, not on behalf +> of any other Contributor, and only if You agree to indemnify, +> defend, and hold each Contributor harmless for any liability +> incurred by, or claims asserted against, such Contributor by reason +> of your accepting any such warranty or additional liability. +> +> END OF TERMS AND CONDITIONS +> +> APPENDIX: How to apply the Apache License to your work. +> +> To apply the Apache License to your work, attach the following +> boilerplate notice, with the fields enclosed by brackets "[]" +> replaced with your own identifying information. (Don't include +> the brackets!) The text should be enclosed in the appropriate +> comment syntax for the file format. We also recommend that a +> file or class name and description of purpose be included on the +> same "printed page" as the copyright notice for easier +> identification within third-party archives. +> +> Copyright [yyyy] [name of copyright owner] +> +> Licensed under the Apache License, Version 2.0 (the "License"); +> you may not use this file except in compliance with the License. +> You may obtain a copy of the License at +> +> http://www.apache.org/licenses/LICENSE-2.0 +> +> Unless required by applicable law or agreed to in writing, software +> distributed under the License is distributed on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +> See the License for the specific language governing permissions and +> limitations under the License. + +--------------------------------------- + +## @jridgewell/gen-mapping, @jridgewell/set-array +License: MIT +By: Justin Ridgewell +Repositories: https://github.com/jridgewell/gen-mapping, https://github.com/jridgewell/set-array + +> Copyright 2022 Justin Ridgewell <jridgewell@google.com> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## @jridgewell/resolve-uri +License: MIT +By: Justin Ridgewell +Repository: https://github.com/jridgewell/resolve-uri + +> Copyright 2019 Justin Ridgewell <jridgewell@google.com> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## @jridgewell/sourcemap-codec +License: MIT +By: Rich Harris +Repository: git+https://github.com/jridgewell/sourcemap-codec.git + +> The MIT License +> +> Copyright (c) 2015 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## @jridgewell/trace-mapping +License: MIT +By: Justin Ridgewell +Repository: git+https://github.com/jridgewell/trace-mapping.git + +> Copyright 2022 Justin Ridgewell <justin@ridgewell.name> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## @polka/compression +License: MIT +Repository: lukeed/polka + +--------------------------------------- + +## @polka/url +License: MIT +By: Luke Edwards +Repository: lukeed/polka + +--------------------------------------- + +## @rollup/plugin-alias, @rollup/plugin-commonjs, @rollup/plugin-dynamic-import-vars, @rollup/pluginutils +License: MIT +By: Johannes Stein +Repository: rollup/plugins + +License: MIT +By: Rich Harris +Repository: rollup/plugins + +License: MIT +By: LarsDenBakker +Repository: rollup/plugins + +License: MIT +By: Rich Harris +Repository: rollup/plugins + +> The MIT License (MIT) +> +> Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## anymatch +License: ISC +By: Elan Shanker +Repository: https://github.com/micromatch/anymatch + +> The ISC License +> +> Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## artichokie +License: MIT +By: sapphi-red, Evan You +Repository: git+https://github.com/sapphi-red/artichokie.git + +> MIT License +> +> Copyright (c) 2020-present, Yuxi (Evan) You +> Copyright (c) 2023-present, sapphi-red +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## binary-extensions +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/binary-extensions + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> Copyright (c) Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## braces, fill-range, is-number +License: MIT +By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm +Repository: micromatch/braces + +License: MIT +By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling +Repository: jonschlinkert/fill-range + +License: MIT +By: Jon Schlinkert, Olsten Larck, Rouven Weßling +Repository: jonschlinkert/is-number + +> The MIT License (MIT) +> +> Copyright (c) 2014-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## bundle-name, default-browser, default-browser-id, define-lazy-prop, is-docker, is-inside-container, is-wsl, open, run-applescript +License: MIT +By: Sindre Sorhus +Repositories: sindresorhus/bundle-name, sindresorhus/default-browser, sindresorhus/default-browser-id, sindresorhus/define-lazy-prop, sindresorhus/is-docker, sindresorhus/is-inside-container, sindresorhus/is-wsl, sindresorhus/open, sindresorhus/run-applescript + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## cac +License: MIT +By: egoist +Repository: egoist/cac + +> The MIT License (MIT) +> +> Copyright (c) EGOIST <0x142857@gmail.com> (https://github.com/egoist) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## chokidar +License: MIT +By: Paul Miller, Elan Shanker +Repository: git+https://github.com/paulmillr/chokidar.git + +> The MIT License (MIT) +> +> Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the “Software”), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## commondir, shell-quote +License: MIT +By: James Halliday +Repositories: http://github.com/substack/node-commondir.git, http://github.com/ljharb/shell-quote.git + +> The MIT License +> +> Copyright (c) 2013 James Halliday (mail@substack.net) +> +> Permission is hereby granted, free of charge, +> to any person obtaining a copy of this software and +> associated documentation files (the "Software"), to +> deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, +> merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom +> the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice +> shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## connect +License: MIT +By: TJ Holowaychuk, Douglas Christopher Wilson, Jonathan Ong, Tim Caswell +Repository: senchalabs/connect + +> (The MIT License) +> +> Copyright (c) 2010 Sencha Inc. +> Copyright (c) 2011 LearnBoost +> Copyright (c) 2011-2014 TJ Holowaychuk +> Copyright (c) 2015 Douglas Christopher Wilson +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## convert-source-map +License: MIT +By: Thorsten Lorenz +Repository: git://github.com/thlorenz/convert-source-map.git + +> Copyright 2013 Thorsten Lorenz. +> All rights reserved. +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## cors +License: MIT +By: Troy Goode +Repository: expressjs/cors + +> (The MIT License) +> +> Copyright (c) 2013 Troy Goode <troygoode@gmail.com> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## cross-spawn +License: MIT +By: André Cruz +Repository: git@github.com:moxystudio/node-cross-spawn.git + +> The MIT License (MIT) +> +> Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## cssesc +License: MIT +By: Mathias Bynens +Repository: https://github.com/mathiasbynens/cssesc.git + +> Copyright Mathias Bynens <https://mathiasbynens.be/> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## debug +License: MIT +By: Josh Junon, TJ Holowaychuk, Nathan Rajlich, Andrew Rhyne +Repository: git://github.com/debug-js/debug.git + +> (The MIT License) +> +> Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +> Copyright (c) 2018-2021 Josh Junon +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software +> and associated documentation files (the 'Software'), to deal in the Software without restriction, +> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +> and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial +> portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +> LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## dotenv +License: BSD-2-Clause +Repository: git://github.com/motdotla/dotenv.git + +> Copyright (c) 2015, Scott Motte +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> * Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> +> * Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the documentation +> and/or other materials provided with the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------- + +## dotenv-expand +License: BSD-2-Clause +By: motdotla +Repository: https://github.com/motdotla/dotenv-expand + +> Copyright (c) 2016, Scott Motte +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions are met: +> +> * Redistributions of source code must retain the above copyright notice, this +> list of conditions and the following disclaimer. +> +> * Redistributions in binary form must reproduce the above copyright notice, +> this list of conditions and the following disclaimer in the documentation +> and/or other materials provided with the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +> FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +> DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +> OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------- + +## ee-first +License: MIT +By: Jonathan Ong, Douglas Christopher Wilson +Repository: jonathanong/ee-first + +> The MIT License (MIT) +> +> Copyright (c) 2014 Jonathan Ong me@jongleberry.com +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## encodeurl +License: MIT +By: Douglas Christopher Wilson +Repository: pillarjs/encodeurl + +> (The MIT License) +> +> Copyright (c) 2016 Douglas Christopher Wilson +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## entities +License: BSD-2-Clause +By: Felix Boehm +Repository: git://github.com/fb55/entities.git + +> Copyright (c) Felix Böhm +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +> +> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +> +> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +> +> THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +> EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------- + +## es-module-lexer +License: MIT +By: Guy Bedford +Repository: git+https://github.com/guybedford/es-module-lexer.git + +> MIT License +> ----------- +> +> Copyright (C) 2018-2022 Guy Bedford +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## escape-html +License: MIT +Repository: component/escape-html + +> (The MIT License) +> +> Copyright (c) 2012-2013 TJ Holowaychuk +> Copyright (c) 2015 Andreas Lubbe +> Copyright (c) 2015 Tiancheng "Timothy" Gu +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## estree-walker +License: MIT +By: Rich Harris +Repository: https://github.com/Rich-Harris/estree-walker + +> Copyright (c) 2015-20 [these people](https://github.com/Rich-Harris/estree-walker/graphs/contributors) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## etag +License: MIT +By: Douglas Christopher Wilson, David Björklund +Repository: jshttp/etag + +> (The MIT License) +> +> Copyright (c) 2014-2016 Douglas Christopher Wilson +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## eventemitter3 +License: MIT +By: Arnout Kazemier +Repository: git://github.com/primus/eventemitter3.git + +> The MIT License (MIT) +> +> Copyright (c) 2014 Arnout Kazemier +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## fdir +License: MIT +By: thecodrr +Repository: git+https://github.com/thecodrr/fdir.git + +> Copyright 2023 Abdullah Atta +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## finalhandler +License: MIT +By: Douglas Christopher Wilson +Repository: pillarjs/finalhandler + +> (The MIT License) +> +> Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## follow-redirects +License: MIT +By: Ruben Verborgh, Olivier Lalonde, James Talmage +Repository: git+ssh://git@github.com/follow-redirects/follow-redirects.git + +> Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +> of the Software, and to permit persons to whom the Software is furnished to do +> so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +> IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## generic-names +License: MIT +By: Alexey Litvinov +Repository: git+https://github.com/css-modules/generic-names.git + +> The MIT License (MIT) +> +> Copyright (c) 2015 Alexey Litvinov +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## glob-parent +License: ISC +By: Gulp Team, Elan Shanker, Blaine Bublitz +Repository: gulpjs/glob-parent + +> The ISC License +> +> Copyright (c) 2015, 2019 Elan Shanker +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## http-proxy +License: MIT +By: Charlie Robbins, jcrugzz <jcrugzz@gmail.com> +Repository: https://github.com/http-party/node-http-proxy.git + +> node-http-proxy +> +> Copyright (c) 2010-2016 Charlie Robbins, Jarrett Cruger & the Contributors. +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## icss-utils +License: ISC +By: Glen Maddern +Repository: git+https://github.com/css-modules/icss-utils.git + +> ISC License (ISC) +> Copyright 2018 Glen Maddern +> +> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## is-binary-path +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/is-binary-path + +> MIT License +> +> Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## is-extglob +License: MIT +By: Jon Schlinkert +Repository: jonschlinkert/is-extglob + +> The MIT License (MIT) +> +> Copyright (c) 2014-2016, Jon Schlinkert +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## is-glob +License: MIT +By: Jon Schlinkert, Brian Woodward, Daniel Perez +Repository: micromatch/is-glob + +> The MIT License (MIT) +> +> Copyright (c) 2014-2017, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## is-reference +License: MIT +By: Rich Harris +Repository: git+https://github.com/Rich-Harris/is-reference.git + +--------------------------------------- + +## isexe, which +License: ISC +By: Isaac Z. Schlueter +Repositories: git+https://github.com/isaacs/isexe.git, git://github.com/isaacs/node-which.git + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter and Contributors +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## js-tokens +License: MIT +By: Simon Lydell +Repository: lydell/js-tokens + +> The MIT License (MIT) +> +> Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Simon Lydell +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## launch-editor, launch-editor-middleware +License: MIT +By: Evan You +Repositories: git+https://github.com/yyx990803/launch-editor.git, git+https://github.com/yyx990803/launch-editor.git + +> The MIT License (MIT) +> +> Copyright (c) 2017-present, Yuxi (Evan) You +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## lilconfig +License: MIT +By: antonk52 +Repository: https://github.com/antonk52/lilconfig + +> MIT License +> +> Copyright (c) 2022 Anton Kastritskiy +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## loader-utils +License: MIT +By: Tobias Koppers @sokra +Repository: https://github.com/webpack/loader-utils.git + +> Copyright JS Foundation and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## lodash.camelcase +License: MIT +By: John-David Dalton, Blaine Bublitz, Mathias Bynens +Repository: lodash/lodash + +> Copyright jQuery Foundation and other contributors <https://jquery.org/> +> +> Based on Underscore.js, copyright Jeremy Ashkenas, +> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> +> +> This software consists of voluntary contributions made by many +> individuals. For exact contribution history, see the revision history +> available at https://github.com/lodash/lodash +> +> The following license applies to all parts of this software except as +> documented below: +> +> ==== +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +> +> ==== +> +> Copyright and related rights for sample code are waived via CC0. Sample +> code is defined as all source code displayed within the prose of the +> documentation. +> +> CC0: http://creativecommons.org/publicdomain/zero/1.0/ +> +> ==== +> +> Files located in the node_modules and vendor directories are externally +> maintained libraries used by this software which have their own +> licenses; we recommend you read them, as their terms may differ from the +> terms above. + +--------------------------------------- + +## magic-string +License: MIT +By: Rich Harris +Repository: https://github.com/rich-harris/magic-string + +> Copyright 2018 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## mlly, ufo +License: MIT +Repositories: unjs/mlly, unjs/ufo + +> MIT License +> +> Copyright (c) Pooya Parsa <pooya@pi0.io> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## mrmime +License: MIT +By: Luke Edwards +Repository: lukeed/mrmime + +> The MIT License (MIT) +> +> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## ms +License: MIT +Repository: vercel/ms + +> The MIT License (MIT) +> +> Copyright (c) 2020 Vercel, Inc. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## normalize-path +License: MIT +By: Jon Schlinkert, Blaine Bublitz +Repository: jonschlinkert/normalize-path + +> The MIT License (MIT) +> +> Copyright (c) 2014-2018, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## object-assign +License: MIT +By: Sindre Sorhus +Repository: sindresorhus/object-assign + +> The MIT License (MIT) +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## on-finished +License: MIT +By: Douglas Christopher Wilson, Jonathan Ong +Repository: jshttp/on-finished + +> (The MIT License) +> +> Copyright (c) 2013 Jonathan Ong <me@jongleberry.com> +> Copyright (c) 2014 Douglas Christopher Wilson <doug@somethingdoug.com> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## parse5 +License: MIT +By: Ivan Nikulin, https://github.com/inikulin/parse5/graphs/contributors +Repository: git://github.com/inikulin/parse5.git + +> Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## parseurl +License: MIT +By: Douglas Christopher Wilson, Jonathan Ong +Repository: pillarjs/parseurl + +> (The MIT License) +> +> Copyright (c) 2014 Jonathan Ong <me@jongleberry.com> +> Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## path-key, shebang-regex +License: MIT +By: Sindre Sorhus +Repositories: sindresorhus/path-key, sindresorhus/shebang-regex + +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## periscopic +License: MIT +Repository: Rich-Harris/periscopic + +> Copyright (c) 2019 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## picocolors +License: ISC +By: Alexey Raspopov +Repository: alexeyraspopov/picocolors + +> ISC License +> +> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## picomatch +License: MIT +By: Jon Schlinkert +Repository: micromatch/picomatch + +> The MIT License (MIT) +> +> Copyright (c) 2017-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## postcss-import +License: MIT +By: Maxime Thirouin +Repository: https://github.com/postcss/postcss-import.git + +> The MIT License (MIT) +> +> Copyright (c) 2014 Maxime Thirouin, Jason Campbell & Kevin Mårtensson +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## postcss-load-config +License: MIT +By: Michael Ciniawky, Ryan Dunckel, Mateusz Derks, Dalton Santos, Patrick Gilday, François Wouts +Repository: postcss/postcss-load-config + +> The MIT License (MIT) +> +> Copyright Michael Ciniawsky <michael.ciniawsky@gmail.com> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## postcss-modules +License: MIT +By: Alexander Madyankin +Repository: https://github.com/css-modules/postcss-modules.git + +> The MIT License (MIT) +> +> Copyright 2015-present Alexander Madyankin <alexander@madyankin.name> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## postcss-modules-extract-imports +License: ISC +By: Glen Maddern +Repository: https://github.com/css-modules/postcss-modules-extract-imports.git + +> Copyright 2015 Glen Maddern +> +> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## postcss-modules-local-by-default +License: MIT +By: Mark Dalgleish +Repository: https://github.com/css-modules/postcss-modules-local-by-default.git + +> The MIT License (MIT) +> +> Copyright 2015 Mark Dalgleish <mark.john.dalgleish@gmail.com> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## postcss-modules-scope +License: ISC +By: Glen Maddern +Repository: https://github.com/css-modules/postcss-modules-scope.git + +> ISC License (ISC) +> +> Copyright (c) 2015, Glen Maddern +> +> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## postcss-modules-values +License: ISC +By: Glen Maddern +Repository: git+https://github.com/css-modules/postcss-modules-values.git + +> ISC License (ISC) +> +> Copyright (c) 2015, Glen Maddern +> +> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## postcss-selector-parser +License: MIT +By: Ben Briggs, Chris Eppstein +Repository: postcss/postcss-selector-parser + +> Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info) +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## postcss-value-parser +License: MIT +By: Bogdan Chadkin +Repository: https://github.com/TrySound/postcss-value-parser.git + +> Copyright (c) Bogdan Chadkin <trysound@yandex.ru> +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## readdirp +License: MIT +By: Thorsten Lorenz, Paul Miller +Repository: git://github.com/paulmillr/readdirp.git + +> MIT License +> +> Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## requires-port +License: MIT +By: Arnout Kazemier +Repository: https://github.com/unshiftio/requires-port + +> The MIT License (MIT) +> +> Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## resolve.exports, totalist +License: MIT +By: Luke Edwards +Repositories: lukeed/resolve.exports, lukeed/totalist + +> The MIT License (MIT) +> +> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## shebang-command +License: MIT +By: Kevin Mårtensson +Repository: kevva/shebang-command + +> MIT License +> +> Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## sirv +License: MIT +By: Luke Edwards +Repository: lukeed/sirv + +--------------------------------------- + +## statuses +License: MIT +By: Douglas Christopher Wilson, Jonathan Ong +Repository: jshttp/statuses + +> The MIT License (MIT) +> +> Copyright (c) 2014 Jonathan Ong <me@jongleberry.com> +> Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## string-hash +License: CC0-1.0 +By: The Dark Sky Company +Repository: git://github.com/darkskyapp/string-hash.git + +--------------------------------------- + +## strip-literal +License: MIT +By: Anthony Fu +Repository: git+https://github.com/antfu/strip-literal.git + +> MIT License +> +> Copyright (c) 2022 Anthony Fu <https://github.com/antfu> +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## tinyglobby +License: MIT +By: Superchupu +Repository: git+https://github.com/SuperchupuDev/tinyglobby.git + +> MIT License +> +> Copyright (c) 2024 Madeline Gurriarán +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## to-regex-range +License: MIT +By: Jon Schlinkert, Rouven Weßling +Repository: micromatch/to-regex-range + +> The MIT License (MIT) +> +> Copyright (c) 2015-present, Jon Schlinkert. +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## tsconfck +License: MIT +By: dominikg +Repository: git+https://github.com/dominikg/tsconfck.git + +> MIT License +> +> Copyright (c) 2021-present dominikg and [contributors](https://github.com/dominikg/tsconfck/graphs/contributors) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. +> +> -- Licenses for 3rd-party code included in tsconfck -- +> +> # strip-bom and strip-json-comments +> MIT License +> +> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + +## unpipe +License: MIT +By: Douglas Christopher Wilson +Repository: stream-utils/unpipe + +> (The MIT License) +> +> Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com> +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## util-deprecate +License: MIT +By: Nathan Rajlich +Repository: git://github.com/TooTallNate/util-deprecate.git + +> (The MIT License) +> +> Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net> +> +> Permission is hereby granted, free of charge, to any person +> obtaining a copy of this software and associated documentation +> files (the "Software"), to deal in the Software without +> restriction, including without limitation the rights to use, +> copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the +> Software is furnished to do so, subject to the following +> conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +> OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## utils-merge +License: MIT +By: Jared Hanson +Repository: git://github.com/jaredhanson/utils-merge.git + +> The MIT License (MIT) +> +> Copyright (c) 2013-2017 Jared Hanson +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## vary +License: MIT +By: Douglas Christopher Wilson +Repository: jshttp/vary + +> (The MIT License) +> +> Copyright (c) 2014-2017 Douglas Christopher Wilson +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> 'Software'), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## ws +License: MIT +By: Einar Otto Stangvik +Repository: git+https://github.com/websockets/ws.git + +> Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com> +> Copyright (c) 2013 Arnout Kazemier and contributors +> Copyright (c) 2016 Luigi Pinca and contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of +> this software and associated documentation files (the "Software"), to deal in +> the Software without restriction, including without limitation the rights to +> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +> the Software, and to permit persons to whom the Software is furnished to do so, +> subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/seller_1/node_modules/vite/README.md b/seller_1/node_modules/vite/README.md new file mode 100644 index 0000000..28fb80b --- /dev/null +++ b/seller_1/node_modules/vite/README.md @@ -0,0 +1,20 @@ +# vite ⚡ + +> Next Generation Frontend Tooling + +- 💡 Instant Server Start +- ⚡️ Lightning Fast HMR +- 🛠️ Rich Features +- 📦 Optimized Build +- 🔩 Universal Plugin Interface +- 🔑 Fully Typed APIs + +Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts: + +- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement). + +- A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production. + +In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support. + +[Read the Docs to Learn More](https://vite.dev). diff --git a/seller_1/node_modules/vite/bin/openChrome.applescript b/seller_1/node_modules/vite/bin/openChrome.applescript new file mode 100644 index 0000000..9ce2293 --- /dev/null +++ b/seller_1/node_modules/vite/bin/openChrome.applescript @@ -0,0 +1,95 @@ +(* +Copyright (c) 2015-present, Facebook, Inc. + +This source code is licensed under the MIT license found in the +LICENSE file at +https://github.com/facebookincubator/create-react-app/blob/master/LICENSE +*) + +property targetTab: null +property targetTabIndex: -1 +property targetWindow: null +property theProgram: "Google Chrome" + +on run argv + set theURL to item 1 of argv + + -- Allow requested program to be optional, + -- default to Google Chrome + if (count of argv) > 1 then + set theProgram to item 2 of argv + end if + + using terms from application "Google Chrome" + tell application theProgram + + if (count every window) = 0 then + make new window + end if + + -- 1: Looking for tab running debugger + -- then, Reload debugging tab if found + -- then return + set found to my lookupTabWithUrl(theURL) + if found then + set targetWindow's active tab index to targetTabIndex + tell targetTab to reload + tell targetWindow to activate + set index of targetWindow to 1 + return + end if + + -- 2: Looking for Empty tab + -- In case debugging tab was not found + -- We try to find an empty tab instead + set found to my lookupTabWithUrl("chrome://newtab/") + if found then + set targetWindow's active tab index to targetTabIndex + set URL of targetTab to theURL + tell targetWindow to activate + return + end if + + -- 3: Create new tab + -- both debugging and empty tab were not found + -- make a new tab with url + tell window 1 + activate + make new tab with properties {URL:theURL} + end tell + end tell + end using terms from +end run + +-- Function: +-- Lookup tab with given url +-- if found, store tab, index, and window in properties +-- (properties were declared on top of file) +on lookupTabWithUrl(lookupUrl) + using terms from application "Google Chrome" + tell application theProgram + -- Find a tab with the given url + set found to false + set theTabIndex to -1 + repeat with theWindow in every window + set theTabIndex to 0 + repeat with theTab in every tab of theWindow + set theTabIndex to theTabIndex + 1 + if (theTab's URL as string) contains lookupUrl then + -- assign tab, tab index, and window to properties + set targetTab to theTab + set targetTabIndex to theTabIndex + set targetWindow to theWindow + set found to true + exit repeat + end if + end repeat + + if found then + exit repeat + end if + end repeat + end tell + end using terms from + return found +end lookupTabWithUrl diff --git a/seller_1/node_modules/vite/bin/vite.js b/seller_1/node_modules/vite/bin/vite.js new file mode 100644 index 0000000..e4d128a --- /dev/null +++ b/seller_1/node_modules/vite/bin/vite.js @@ -0,0 +1,70 @@ +#!/usr/bin/env node +import { performance } from 'node:perf_hooks' +import module from 'node:module' + +if (!import.meta.url.includes('node_modules')) { + try { + // only available as dev dependency + await import('source-map-support').then((r) => r.default.install()) + } catch {} + + process.on('unhandledRejection', (err) => { + throw new Error('UNHANDLED PROMISE REJECTION', { cause: err }) + }) +} + +global.__vite_start_time = performance.now() + +// check debug mode first before requiring the CLI. +const debugIndex = process.argv.findIndex((arg) => /^(?:-d|--debug)$/.test(arg)) +const filterIndex = process.argv.findIndex((arg) => + /^(?:-f|--filter)$/.test(arg), +) +const profileIndex = process.argv.indexOf('--profile') + +if (debugIndex > 0) { + let value = process.argv[debugIndex + 1] + if (!value || value.startsWith('-')) { + value = 'vite:*' + } else { + // support debugging multiple flags with comma-separated list + value = value + .split(',') + .map((v) => `vite:${v}`) + .join(',') + } + process.env.DEBUG = `${ + process.env.DEBUG ? process.env.DEBUG + ',' : '' + }${value}` + + if (filterIndex > 0) { + const filter = process.argv[filterIndex + 1] + if (filter && !filter.startsWith('-')) { + process.env.VITE_DEBUG_FILTER = filter + } + } +} + +function start() { + try { + // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists + module.enableCompileCache?.() + } catch {} + return import('../dist/node/cli.js') +} + +if (profileIndex > 0) { + process.argv.splice(profileIndex, 1) + const next = process.argv[profileIndex] + if (next && !next.startsWith('-')) { + process.argv.splice(profileIndex, 1) + } + const inspector = await import('node:inspector').then((r) => r.default) + const session = (global.__vite_profile_session = new inspector.Session()) + session.connect() + session.post('Profiler.enable', () => { + session.post('Profiler.start', start) + }) +} else { + start() +} diff --git a/seller_1/node_modules/vite/client.d.ts b/seller_1/node_modules/vite/client.d.ts new file mode 100644 index 0000000..16e2b16 --- /dev/null +++ b/seller_1/node_modules/vite/client.d.ts @@ -0,0 +1,270 @@ +/// <reference path="./types/importMeta.d.ts" /> + +// CSS modules +type CSSModuleClasses = { readonly [key: string]: string } + +declare module '*.module.css' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.scss' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.sass' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.less' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.styl' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.stylus' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.pcss' { + const classes: CSSModuleClasses + export default classes +} +declare module '*.module.sss' { + const classes: CSSModuleClasses + export default classes +} + +// CSS +declare module '*.css' {} +declare module '*.scss' {} +declare module '*.sass' {} +declare module '*.less' {} +declare module '*.styl' {} +declare module '*.stylus' {} +declare module '*.pcss' {} +declare module '*.sss' {} + +// Built-in asset types +// see `src/node/constants.ts` + +// images +declare module '*.apng' { + const src: string + export default src +} +declare module '*.bmp' { + const src: string + export default src +} +declare module '*.png' { + const src: string + export default src +} +declare module '*.jpg' { + const src: string + export default src +} +declare module '*.jpeg' { + const src: string + export default src +} +declare module '*.jfif' { + const src: string + export default src +} +declare module '*.pjpeg' { + const src: string + export default src +} +declare module '*.pjp' { + const src: string + export default src +} +declare module '*.gif' { + const src: string + export default src +} +declare module '*.svg' { + const src: string + export default src +} +declare module '*.ico' { + const src: string + export default src +} +declare module '*.webp' { + const src: string + export default src +} +declare module '*.avif' { + const src: string + export default src +} +declare module '*.cur' { + const src: string + export default src +} + +// media +declare module '*.mp4' { + const src: string + export default src +} +declare module '*.webm' { + const src: string + export default src +} +declare module '*.ogg' { + const src: string + export default src +} +declare module '*.mp3' { + const src: string + export default src +} +declare module '*.wav' { + const src: string + export default src +} +declare module '*.flac' { + const src: string + export default src +} +declare module '*.aac' { + const src: string + export default src +} +declare module '*.opus' { + const src: string + export default src +} +declare module '*.mov' { + const src: string + export default src +} +declare module '*.m4a' { + const src: string + export default src +} +declare module '*.vtt' { + const src: string + export default src +} + +// fonts +declare module '*.woff' { + const src: string + export default src +} +declare module '*.woff2' { + const src: string + export default src +} +declare module '*.eot' { + const src: string + export default src +} +declare module '*.ttf' { + const src: string + export default src +} +declare module '*.otf' { + const src: string + export default src +} + +// other +declare module '*.webmanifest' { + const src: string + export default src +} +declare module '*.pdf' { + const src: string + export default src +} +declare module '*.txt' { + const src: string + export default src +} + +// wasm?init +declare module '*.wasm?init' { + const initWasm: ( + options?: WebAssembly.Imports, + ) => Promise<WebAssembly.Instance> + export default initWasm +} + +// web worker +declare module '*?worker' { + const workerConstructor: { + new (options?: { name?: string }): Worker + } + export default workerConstructor +} + +declare module '*?worker&inline' { + const workerConstructor: { + new (options?: { name?: string }): Worker + } + export default workerConstructor +} + +declare module '*?worker&url' { + const src: string + export default src +} + +declare module '*?sharedworker' { + const sharedWorkerConstructor: { + new (options?: { name?: string }): SharedWorker + } + export default sharedWorkerConstructor +} + +declare module '*?sharedworker&inline' { + const sharedWorkerConstructor: { + new (options?: { name?: string }): SharedWorker + } + export default sharedWorkerConstructor +} + +declare module '*?sharedworker&url' { + const src: string + export default src +} + +declare module '*?raw' { + const src: string + export default src +} + +declare module '*?url' { + const src: string + export default src +} + +declare module '*?inline' { + const src: string + export default src +} + +declare module '*?no-inline' { + const src: string + export default src +} + +declare module '*?url&inline' { + const src: string + export default src +} + +declare interface VitePreloadErrorEvent extends Event { + payload: Error +} + +declare interface WindowEventMap { + 'vite:preloadError': VitePreloadErrorEvent +} diff --git a/seller_1/node_modules/vite/dist/client/client.mjs b/seller_1/node_modules/vite/dist/client/client.mjs new file mode 100644 index 0000000..031cf21 --- /dev/null +++ b/seller_1/node_modules/vite/dist/client/client.mjs @@ -0,0 +1,1084 @@ +import '@vite/env'; + +class HMRContext { + constructor(hmrClient, ownerPath) { + this.hmrClient = hmrClient; + this.ownerPath = ownerPath; + if (!hmrClient.dataMap.has(ownerPath)) { + hmrClient.dataMap.set(ownerPath, {}); + } + const mod = hmrClient.hotModulesMap.get(ownerPath); + if (mod) { + mod.callbacks = []; + } + const staleListeners = hmrClient.ctxToListenersMap.get(ownerPath); + if (staleListeners) { + for (const [event, staleFns] of staleListeners) { + const listeners = hmrClient.customListenersMap.get(event); + if (listeners) { + hmrClient.customListenersMap.set( + event, + listeners.filter((l) => !staleFns.includes(l)) + ); + } + } + } + this.newListeners = /* @__PURE__ */ new Map(); + hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners); + } + get data() { + return this.hmrClient.dataMap.get(this.ownerPath); + } + accept(deps, callback) { + if (typeof deps === "function" || !deps) { + this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod)); + } else if (typeof deps === "string") { + this.acceptDeps([deps], ([mod]) => callback?.(mod)); + } else if (Array.isArray(deps)) { + this.acceptDeps(deps, callback); + } else { + throw new Error(`invalid hot.accept() usage.`); + } + } + // export names (first arg) are irrelevant on the client side, they're + // extracted in the server for propagation + acceptExports(_, callback) { + this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod)); + } + dispose(cb) { + this.hmrClient.disposeMap.set(this.ownerPath, cb); + } + prune(cb) { + this.hmrClient.pruneMap.set(this.ownerPath, cb); + } + // Kept for backward compatibility (#11036) + // eslint-disable-next-line @typescript-eslint/no-empty-function + decline() { + } + invalidate(message) { + this.hmrClient.notifyListeners("vite:invalidate", { + path: this.ownerPath, + message + }); + this.send("vite:invalidate", { + path: this.ownerPath, + message + }); + this.hmrClient.logger.debug( + `invalidate ${this.ownerPath}${message ? `: ${message}` : ""}` + ); + } + on(event, cb) { + const addToMap = (map) => { + const existing = map.get(event) || []; + existing.push(cb); + map.set(event, existing); + }; + addToMap(this.hmrClient.customListenersMap); + addToMap(this.newListeners); + } + off(event, cb) { + const removeFromMap = (map) => { + const existing = map.get(event); + if (existing === void 0) { + return; + } + const pruned = existing.filter((l) => l !== cb); + if (pruned.length === 0) { + map.delete(event); + return; + } + map.set(event, pruned); + }; + removeFromMap(this.hmrClient.customListenersMap); + removeFromMap(this.newListeners); + } + send(event, data) { + this.hmrClient.send({ type: "custom", event, data }); + } + acceptDeps(deps, callback = () => { + }) { + const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || { + id: this.ownerPath, + callbacks: [] + }; + mod.callbacks.push({ + deps, + fn: callback + }); + this.hmrClient.hotModulesMap.set(this.ownerPath, mod); + } +} +class HMRClient { + constructor(logger, transport, importUpdatedModule) { + this.logger = logger; + this.transport = transport; + this.importUpdatedModule = importUpdatedModule; + this.hotModulesMap = /* @__PURE__ */ new Map(); + this.disposeMap = /* @__PURE__ */ new Map(); + this.pruneMap = /* @__PURE__ */ new Map(); + this.dataMap = /* @__PURE__ */ new Map(); + this.customListenersMap = /* @__PURE__ */ new Map(); + this.ctxToListenersMap = /* @__PURE__ */ new Map(); + this.updateQueue = []; + this.pendingUpdateQueue = false; + } + async notifyListeners(event, data) { + const cbs = this.customListenersMap.get(event); + if (cbs) { + await Promise.allSettled(cbs.map((cb) => cb(data))); + } + } + send(payload) { + this.transport.send(payload).catch((err) => { + this.logger.error(err); + }); + } + clear() { + this.hotModulesMap.clear(); + this.disposeMap.clear(); + this.pruneMap.clear(); + this.dataMap.clear(); + this.customListenersMap.clear(); + this.ctxToListenersMap.clear(); + } + // After an HMR update, some modules are no longer imported on the page + // but they may have left behind side effects that need to be cleaned up + // (e.g. style injections) + async prunePaths(paths) { + await Promise.all( + paths.map((path) => { + const disposer = this.disposeMap.get(path); + if (disposer) return disposer(this.dataMap.get(path)); + }) + ); + paths.forEach((path) => { + const fn = this.pruneMap.get(path); + if (fn) { + fn(this.dataMap.get(path)); + } + }); + } + warnFailedUpdate(err, path) { + if (!err.message.includes("fetch")) { + this.logger.error(err); + } + this.logger.error( + `Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)` + ); + } + /** + * buffer multiple hot updates triggered by the same src change + * so that they are invoked in the same order they were sent. + * (otherwise the order may be inconsistent because of the http request round trip) + */ + async queueUpdate(payload) { + this.updateQueue.push(this.fetchUpdate(payload)); + if (!this.pendingUpdateQueue) { + this.pendingUpdateQueue = true; + await Promise.resolve(); + this.pendingUpdateQueue = false; + const loading = [...this.updateQueue]; + this.updateQueue = []; + (await Promise.all(loading)).forEach((fn) => fn && fn()); + } + } + async fetchUpdate(update) { + const { path, acceptedPath } = update; + const mod = this.hotModulesMap.get(path); + if (!mod) { + return; + } + let fetchedModule; + const isSelfUpdate = path === acceptedPath; + const qualifiedCallbacks = mod.callbacks.filter( + ({ deps }) => deps.includes(acceptedPath) + ); + if (isSelfUpdate || qualifiedCallbacks.length > 0) { + const disposer = this.disposeMap.get(acceptedPath); + if (disposer) await disposer(this.dataMap.get(acceptedPath)); + try { + fetchedModule = await this.importUpdatedModule(update); + } catch (e) { + this.warnFailedUpdate(e, acceptedPath); + } + } + return () => { + for (const { deps, fn } of qualifiedCallbacks) { + fn( + deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0) + ); + } + const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`; + this.logger.debug(`hot updated: ${loggedPath}`); + }; + } +} + +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; +let nanoid = (size = 21) => { + let id = ''; + let i = size | 0; + while (i--) { + id += urlAlphabet[(Math.random() * 64) | 0]; + } + return id +}; + +typeof process !== "undefined" && process.platform === "win32"; +function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + return { promise, resolve, reject }; +} + +function reviveInvokeError(e) { + const error = new Error(e.message || "Unknown invoke error"); + Object.assign(error, e, { + // pass the whole error instead of just the stacktrace + // so that it gets formatted nicely with console.log + runnerError: new Error("RunnerError") + }); + return error; +} +const createInvokeableTransport = (transport) => { + if (transport.invoke) { + return { + ...transport, + async invoke(name, data) { + const result = await transport.invoke({ + type: "custom", + event: "vite:invoke", + data: { + id: "send", + name, + data + } + }); + if ("error" in result) { + throw reviveInvokeError(result.error); + } + return result.result; + } + }; + } + if (!transport.send || !transport.connect) { + throw new Error( + "transport must implement send and connect when invoke is not implemented" + ); + } + const rpcPromises = /* @__PURE__ */ new Map(); + return { + ...transport, + connect({ onMessage, onDisconnection }) { + return transport.connect({ + onMessage(payload) { + if (payload.type === "custom" && payload.event === "vite:invoke") { + const data = payload.data; + if (data.id.startsWith("response:")) { + const invokeId = data.id.slice("response:".length); + const promise = rpcPromises.get(invokeId); + if (!promise) return; + if (promise.timeoutId) clearTimeout(promise.timeoutId); + rpcPromises.delete(invokeId); + const { e, r } = data.data; + if (e) { + promise.reject(e); + } else { + promise.resolve(r); + } + return; + } + } + onMessage(payload); + }, + onDisconnection + }); + }, + disconnect() { + rpcPromises.forEach((promise) => { + promise.reject( + new Error( + `transport was disconnected, cannot call ${JSON.stringify(promise.name)}` + ) + ); + }); + rpcPromises.clear(); + return transport.disconnect?.(); + }, + send(data) { + return transport.send(data); + }, + async invoke(name, data) { + const promiseId = nanoid(); + const wrappedData = { + type: "custom", + event: "vite:invoke", + data: { + name, + id: `send:${promiseId}`, + data + } + }; + const sendPromise = transport.send(wrappedData); + const { promise, resolve, reject } = promiseWithResolvers(); + const timeout = transport.timeout ?? 6e4; + let timeoutId; + if (timeout > 0) { + timeoutId = setTimeout(() => { + rpcPromises.delete(promiseId); + reject( + new Error( + `transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})` + ) + ); + }, timeout); + timeoutId?.unref?.(); + } + rpcPromises.set(promiseId, { resolve, reject, name, timeoutId }); + if (sendPromise) { + sendPromise.catch((err) => { + clearTimeout(timeoutId); + rpcPromises.delete(promiseId); + reject(err); + }); + } + try { + return await promise; + } catch (err) { + throw reviveInvokeError(err); + } + } + }; +}; +const normalizeModuleRunnerTransport = (transport) => { + const invokeableTransport = createInvokeableTransport(transport); + let isConnected = !invokeableTransport.connect; + let connectingPromise; + return { + ...transport, + ...invokeableTransport.connect ? { + async connect(onMessage) { + if (isConnected) return; + if (connectingPromise) { + await connectingPromise; + return; + } + const maybePromise = invokeableTransport.connect({ + onMessage: onMessage ?? (() => { + }), + onDisconnection() { + isConnected = false; + } + }); + if (maybePromise) { + connectingPromise = maybePromise; + await connectingPromise; + connectingPromise = void 0; + } + isConnected = true; + } + } : {}, + ...invokeableTransport.disconnect ? { + async disconnect() { + if (!isConnected) return; + if (connectingPromise) { + await connectingPromise; + } + isConnected = false; + await invokeableTransport.disconnect(); + } + } : {}, + async send(data) { + if (!invokeableTransport.send) return; + if (!isConnected) { + if (connectingPromise) { + await connectingPromise; + } else { + throw new Error("send was called before connect"); + } + } + await invokeableTransport.send(data); + }, + async invoke(name, data) { + if (!isConnected) { + if (connectingPromise) { + await connectingPromise; + } else { + throw new Error("invoke was called before connect"); + } + } + return invokeableTransport.invoke(name, data); + } + }; +}; +const createWebSocketModuleRunnerTransport = (options) => { + const pingInterval = options.pingInterval ?? 3e4; + let ws; + let pingIntervalId; + return { + async connect({ onMessage, onDisconnection }) { + const socket = options.createConnection(); + socket.addEventListener("message", async ({ data }) => { + onMessage(JSON.parse(data)); + }); + let isOpened = socket.readyState === socket.OPEN; + if (!isOpened) { + await new Promise((resolve, reject) => { + socket.addEventListener( + "open", + () => { + isOpened = true; + resolve(); + }, + { once: true } + ); + socket.addEventListener("close", async () => { + if (!isOpened) { + reject(new Error("WebSocket closed without opened.")); + return; + } + onMessage({ + type: "custom", + event: "vite:ws:disconnect", + data: { webSocket: socket } + }); + onDisconnection(); + }); + }); + } + onMessage({ + type: "custom", + event: "vite:ws:connect", + data: { webSocket: socket } + }); + ws = socket; + pingIntervalId = setInterval(() => { + if (socket.readyState === socket.OPEN) { + socket.send(JSON.stringify({ type: "ping" })); + } + }, pingInterval); + }, + disconnect() { + clearInterval(pingIntervalId); + ws?.close(); + }, + send(data) { + ws.send(JSON.stringify(data)); + } + }; +}; + +const hmrConfigName = __HMR_CONFIG_NAME__; +const base$1 = __BASE__ || "/"; +function h(e, attrs = {}, ...children) { + const elem = document.createElement(e); + for (const [k, v] of Object.entries(attrs)) { + elem.setAttribute(k, v); + } + elem.append(...children); + return elem; +} +const templateStyle = ( + /*css*/ + ` +:host { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 99999; + --monospace: 'SFMono-Regular', Consolas, + 'Liberation Mono', Menlo, Courier, monospace; + --red: #ff5555; + --yellow: #e2aa53; + --purple: #cfa4ff; + --cyan: #2dd9da; + --dim: #c9c9c9; + + --window-background: #181818; + --window-color: #d8d8d8; +} + +.backdrop { + position: fixed; + z-index: 99999; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow-y: scroll; + margin: 0; + background: rgba(0, 0, 0, 0.66); +} + +.window { + font-family: var(--monospace); + line-height: 1.5; + max-width: 80vw; + color: var(--window-color); + box-sizing: border-box; + margin: 30px auto; + padding: 2.5vh 4vw; + position: relative; + background: var(--window-background); + border-radius: 6px 6px 8px 8px; + box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); + overflow: hidden; + border-top: 8px solid var(--red); + direction: ltr; + text-align: left; +} + +pre { + font-family: var(--monospace); + font-size: 16px; + margin-top: 0; + margin-bottom: 1em; + overflow-x: scroll; + scrollbar-width: none; +} + +pre::-webkit-scrollbar { + display: none; +} + +pre.frame::-webkit-scrollbar { + display: block; + height: 5px; +} + +pre.frame::-webkit-scrollbar-thumb { + background: #999; + border-radius: 5px; +} + +pre.frame { + scrollbar-width: thin; +} + +.message { + line-height: 1.3; + font-weight: 600; + white-space: pre-wrap; +} + +.message-body { + color: var(--red); +} + +.plugin { + color: var(--purple); +} + +.file { + color: var(--cyan); + margin-bottom: 0; + white-space: pre-wrap; + word-break: break-all; +} + +.frame { + color: var(--yellow); +} + +.stack { + font-size: 13px; + color: var(--dim); +} + +.tip { + font-size: 13px; + color: #999; + border-top: 1px dotted #999; + padding-top: 13px; + line-height: 1.8; +} + +code { + font-size: 13px; + font-family: var(--monospace); + color: var(--yellow); +} + +.file-link { + text-decoration: underline; + cursor: pointer; +} + +kbd { + line-height: 1.5; + font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-size: 0.75rem; + font-weight: 700; + background-color: rgb(38, 40, 44); + color: rgb(166, 167, 171); + padding: 0.15rem 0.3rem; + border-radius: 0.25rem; + border-width: 0.0625rem 0.0625rem 0.1875rem; + border-style: solid; + border-color: rgb(54, 57, 64); + border-image: initial; +} +` +); +const createTemplate = () => h( + "div", + { class: "backdrop", part: "backdrop" }, + h( + "div", + { class: "window", part: "window" }, + h( + "pre", + { class: "message", part: "message" }, + h("span", { class: "plugin", part: "plugin" }), + h("span", { class: "message-body", part: "message-body" }) + ), + h("pre", { class: "file", part: "file" }), + h("pre", { class: "frame", part: "frame" }), + h("pre", { class: "stack", part: "stack" }), + h( + "div", + { class: "tip", part: "tip" }, + "Click outside, press ", + h("kbd", {}, "Esc"), + " key, or fix the code to dismiss.", + h("br"), + "You can also disable this overlay by setting ", + h("code", { part: "config-option-name" }, "server.hmr.overlay"), + " to ", + h("code", { part: "config-option-value" }, "false"), + " in ", + h("code", { part: "config-file-name" }, hmrConfigName), + "." + ) + ), + h("style", {}, templateStyle) +); +const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g; +const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm; +const { HTMLElement = class { +} } = globalThis; +class ErrorOverlay extends HTMLElement { + constructor(err, links = true) { + super(); + this.root = this.attachShadow({ mode: "open" }); + this.root.appendChild(createTemplate()); + codeframeRE.lastIndex = 0; + const hasFrame = err.frame && codeframeRE.test(err.frame); + const message = hasFrame ? err.message.replace(codeframeRE, "") : err.message; + if (err.plugin) { + this.text(".plugin", `[plugin:${err.plugin}] `); + } + this.text(".message-body", message.trim()); + const [file] = (err.loc?.file || err.id || "unknown file").split(`?`); + if (err.loc) { + this.text(".file", `${file}:${err.loc.line}:${err.loc.column}`, links); + } else if (err.id) { + this.text(".file", file); + } + if (hasFrame) { + this.text(".frame", err.frame.trim()); + } + this.text(".stack", err.stack, links); + this.root.querySelector(".window").addEventListener("click", (e) => { + e.stopPropagation(); + }); + this.addEventListener("click", () => { + this.close(); + }); + this.closeOnEsc = (e) => { + if (e.key === "Escape" || e.code === "Escape") { + this.close(); + } + }; + document.addEventListener("keydown", this.closeOnEsc); + } + text(selector, text, linkFiles = false) { + const el = this.root.querySelector(selector); + if (!linkFiles) { + el.textContent = text; + } else { + let curIndex = 0; + let match; + fileRE.lastIndex = 0; + while (match = fileRE.exec(text)) { + const { 0: file, index } = match; + const frag = text.slice(curIndex, index); + el.appendChild(document.createTextNode(frag)); + const link = document.createElement("a"); + link.textContent = file; + link.className = "file-link"; + link.onclick = () => { + fetch( + new URL( + `${base$1}__open-in-editor?file=${encodeURIComponent(file)}`, + import.meta.url + ) + ); + }; + el.appendChild(link); + curIndex += frag.length + file.length; + } + } + } + close() { + this.parentNode?.removeChild(this); + document.removeEventListener("keydown", this.closeOnEsc); + } +} +const overlayId = "vite-error-overlay"; +const { customElements } = globalThis; +if (customElements && !customElements.get(overlayId)) { + customElements.define(overlayId, ErrorOverlay); +} + +console.debug("[vite] connecting..."); +const importMetaUrl = new URL(import.meta.url); +const serverHost = __SERVER_HOST__; +const socketProtocol = __HMR_PROTOCOL__ || (importMetaUrl.protocol === "https:" ? "wss" : "ws"); +const hmrPort = __HMR_PORT__; +const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${hmrPort || importMetaUrl.port}${__HMR_BASE__}`; +const directSocketHost = __HMR_DIRECT_TARGET__; +const base = __BASE__ || "/"; +const hmrTimeout = __HMR_TIMEOUT__; +const transport = normalizeModuleRunnerTransport( + (() => { + let wsTransport = createWebSocketModuleRunnerTransport({ + createConnection: () => new WebSocket(`${socketProtocol}://${socketHost}`, "vite-hmr"), + pingInterval: hmrTimeout + }); + return { + async connect(handlers) { + try { + await wsTransport.connect(handlers); + } catch (e) { + if (!hmrPort) { + wsTransport = createWebSocketModuleRunnerTransport({ + createConnection: () => new WebSocket( + `${socketProtocol}://${directSocketHost}`, + "vite-hmr" + ), + pingInterval: hmrTimeout + }); + try { + await wsTransport.connect(handlers); + console.info( + "[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error." + ); + } catch (e2) { + if (e2 instanceof Error && e2.message.includes("WebSocket closed without opened.")) { + const currentScriptHostURL = new URL(import.meta.url); + const currentScriptHost = currentScriptHostURL.host + currentScriptHostURL.pathname.replace(/@vite\/client$/, ""); + console.error( + `[vite] failed to connect to websocket. +your current setup: + (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server) + (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server) +Check out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .` + ); + } + } + return; + } + console.error(`[vite] failed to connect to websocket (${e}). `); + throw e; + } + }, + async disconnect() { + await wsTransport.disconnect(); + }, + send(data) { + wsTransport.send(data); + } + }; + })() +); +let willUnload = false; +if (typeof window !== "undefined") { + window.addEventListener("beforeunload", () => { + willUnload = true; + }); +} +function cleanUrl(pathname) { + const url = new URL(pathname, "http://vite.dev"); + url.searchParams.delete("direct"); + return url.pathname + url.search; +} +let isFirstUpdate = true; +const outdatedLinkTags = /* @__PURE__ */ new WeakSet(); +const debounceReload = (time) => { + let timer; + return () => { + if (timer) { + clearTimeout(timer); + timer = null; + } + timer = setTimeout(() => { + location.reload(); + }, time); + }; +}; +const pageReload = debounceReload(50); +const hmrClient = new HMRClient( + { + error: (err) => console.error("[vite]", err), + debug: (...msg) => console.debug("[vite]", ...msg) + }, + transport, + async function importUpdatedModule({ + acceptedPath, + timestamp, + explicitImportRequired, + isWithinCircularImport + }) { + const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`); + const importPromise = import( + /* @vite-ignore */ + base + acceptedPathWithoutQuery.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}` + ); + if (isWithinCircularImport) { + importPromise.catch(() => { + console.info( + `[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.` + ); + pageReload(); + }); + } + return await importPromise; + } +); +transport.connect(handleMessage); +async function handleMessage(payload) { + switch (payload.type) { + case "connected": + console.debug(`[vite] connected.`); + break; + case "update": + notifyListeners("vite:beforeUpdate", payload); + if (hasDocument) { + if (isFirstUpdate && hasErrorOverlay()) { + location.reload(); + return; + } else { + if (enableOverlay) { + clearErrorOverlay(); + } + isFirstUpdate = false; + } + } + await Promise.all( + payload.updates.map(async (update) => { + if (update.type === "js-update") { + return hmrClient.queueUpdate(update); + } + const { path, timestamp } = update; + const searchUrl = cleanUrl(path); + const el = Array.from( + document.querySelectorAll("link") + ).find( + (e) => !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl) + ); + if (!el) { + return; + } + const newPath = `${base}${searchUrl.slice(1)}${searchUrl.includes("?") ? "&" : "?"}t=${timestamp}`; + return new Promise((resolve) => { + const newLinkTag = el.cloneNode(); + newLinkTag.href = new URL(newPath, el.href).href; + const removeOldEl = () => { + el.remove(); + console.debug(`[vite] css hot updated: ${searchUrl}`); + resolve(); + }; + newLinkTag.addEventListener("load", removeOldEl); + newLinkTag.addEventListener("error", removeOldEl); + outdatedLinkTags.add(el); + el.after(newLinkTag); + }); + }) + ); + notifyListeners("vite:afterUpdate", payload); + break; + case "custom": { + notifyListeners(payload.event, payload.data); + if (payload.event === "vite:ws:disconnect") { + if (hasDocument && !willUnload) { + console.log(`[vite] server connection lost. Polling for restart...`); + const socket = payload.data.webSocket; + await waitForSuccessfulPing(socket.url); + location.reload(); + } + } + break; + } + case "full-reload": + notifyListeners("vite:beforeFullReload", payload); + if (hasDocument) { + if (payload.path && payload.path.endsWith(".html")) { + const pagePath = decodeURI(location.pathname); + const payloadPath = base + payload.path.slice(1); + if (pagePath === payloadPath || payload.path === "/index.html" || pagePath.endsWith("/") && pagePath + "index.html" === payloadPath) { + pageReload(); + } + return; + } else { + pageReload(); + } + } + break; + case "prune": + notifyListeners("vite:beforePrune", payload); + await hmrClient.prunePaths(payload.paths); + break; + case "error": { + notifyListeners("vite:error", payload); + if (hasDocument) { + const err = payload.err; + if (enableOverlay) { + createErrorOverlay(err); + } else { + console.error( + `[vite] Internal Server Error +${err.message} +${err.stack}` + ); + } + } + break; + } + case "ping": + break; + default: { + const check = payload; + return check; + } + } +} +function notifyListeners(event, data) { + hmrClient.notifyListeners(event, data); +} +const enableOverlay = __HMR_ENABLE_OVERLAY__; +const hasDocument = "document" in globalThis; +function createErrorOverlay(err) { + clearErrorOverlay(); + const { customElements } = globalThis; + if (customElements) { + const ErrorOverlayConstructor = customElements.get(overlayId); + document.body.appendChild(new ErrorOverlayConstructor(err)); + } +} +function clearErrorOverlay() { + document.querySelectorAll(overlayId).forEach((n) => n.close()); +} +function hasErrorOverlay() { + return document.querySelectorAll(overlayId).length; +} +async function waitForSuccessfulPing(socketUrl, ms = 1e3) { + async function ping() { + const socket = new WebSocket(socketUrl, "vite-ping"); + return new Promise((resolve) => { + function onOpen() { + resolve(true); + close(); + } + function onError() { + resolve(false); + close(); + } + function close() { + socket.removeEventListener("open", onOpen); + socket.removeEventListener("error", onError); + socket.close(); + } + socket.addEventListener("open", onOpen); + socket.addEventListener("error", onError); + }); + } + if (await ping()) { + return; + } + await wait(ms); + while (true) { + if (document.visibilityState === "visible") { + if (await ping()) { + break; + } + await wait(ms); + } else { + await waitForWindowShow(); + } + } +} +function wait(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} +function waitForWindowShow() { + return new Promise((resolve) => { + const onChange = async () => { + if (document.visibilityState === "visible") { + resolve(); + document.removeEventListener("visibilitychange", onChange); + } + }; + document.addEventListener("visibilitychange", onChange); + }); +} +const sheetsMap = /* @__PURE__ */ new Map(); +if ("document" in globalThis) { + document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => { + sheetsMap.set(el.getAttribute("data-vite-dev-id"), el); + }); +} +const cspNonce = "document" in globalThis ? document.querySelector("meta[property=csp-nonce]")?.nonce : void 0; +let lastInsertedStyle; +function updateStyle(id, content) { + let style = sheetsMap.get(id); + if (!style) { + style = document.createElement("style"); + style.setAttribute("type", "text/css"); + style.setAttribute("data-vite-dev-id", id); + style.textContent = content; + if (cspNonce) { + style.setAttribute("nonce", cspNonce); + } + if (!lastInsertedStyle) { + document.head.appendChild(style); + setTimeout(() => { + lastInsertedStyle = void 0; + }, 0); + } else { + lastInsertedStyle.insertAdjacentElement("afterend", style); + } + lastInsertedStyle = style; + } else { + style.textContent = content; + } + sheetsMap.set(id, style); +} +function removeStyle(id) { + const style = sheetsMap.get(id); + if (style) { + document.head.removeChild(style); + sheetsMap.delete(id); + } +} +function createHotContext(ownerPath) { + return new HMRContext(hmrClient, ownerPath); +} +function injectQuery(url, queryToInject) { + if (url[0] !== "." && url[0] !== "/") { + return url; + } + const pathname = url.replace(/[?#].*$/, ""); + const { search, hash } = new URL(url, "http://vite.dev"); + return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`; +} + +export { ErrorOverlay, createHotContext, injectQuery, removeStyle, updateStyle }; diff --git a/seller_1/node_modules/vite/dist/client/env.mjs b/seller_1/node_modules/vite/dist/client/env.mjs new file mode 100644 index 0000000..b58bfc1 --- /dev/null +++ b/seller_1/node_modules/vite/dist/client/env.mjs @@ -0,0 +1,24 @@ +const context = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } else if (typeof self !== "undefined") { + return self; + } else if (typeof window !== "undefined") { + return window; + } else { + return Function("return this")(); + } +})(); +const defines = __DEFINES__; +Object.keys(defines).forEach((key) => { + const segments = key.split("."); + let target = context; + for (let i = 0; i < segments.length; i++) { + const segment = segments[i]; + if (i === segments.length - 1) { + target[segment] = defines[key]; + } else { + target = target[segment] || (target[segment] = {}); + } + } +}); diff --git a/seller_1/node_modules/vite/dist/node-cjs/publicUtils.cjs b/seller_1/node_modules/vite/dist/node-cjs/publicUtils.cjs new file mode 100644 index 0000000..e60c913 --- /dev/null +++ b/seller_1/node_modules/vite/dist/node-cjs/publicUtils.cjs @@ -0,0 +1,6386 @@ +'use strict'; + +var path$1 = require('node:path'); +var node_url = require('node:url'); +var fs$1 = require('node:fs'); +var esbuild = require('esbuild'); +var node_child_process = require('node:child_process'); +var node_module = require('node:module'); +var require$$0 = require('tty'); +var require$$1 = require('util'); +var require$$1$1 = require('path'); +var require$$0$1 = require('crypto'); +var require$$1$2 = require('fs'); +var readline = require('node:readline'); +var require$$2 = require('os'); + +var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; +const { version: version$2 } = JSON.parse( + fs$1.readFileSync(new URL("../../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString() +); +const VERSION = version$2; +const DEFAULT_MAIN_FIELDS = [ + "browser", + "module", + "jsnext:main", + // moment still uses this... + "jsnext" +]; +const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS); +const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze( + DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser") +); +const DEV_PROD_CONDITION = `development|production`; +const DEFAULT_CONDITIONS = ["module", "browser", "node", DEV_PROD_CONDITION]; +const DEFAULT_CLIENT_CONDITIONS = Object.freeze( + DEFAULT_CONDITIONS.filter((c) => c !== "node") +); +const DEFAULT_SERVER_CONDITIONS = Object.freeze( + DEFAULT_CONDITIONS.filter((c) => c !== "browser") +); +const FS_PREFIX = `/@fs/`; +const VITE_PACKAGE_DIR = path$1.resolve( + // import.meta.url is `dist/node/constants.js` after bundle + node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))), + "../../.." +); +const CLIENT_ENTRY = path$1.resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs"); +path$1.resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs"); +path$1.dirname(CLIENT_ENTRY); + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} + +const bufLength = 1024 * 16; +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var picocolors = {exports: {}}; + +let p = process || {}, argv = p.argv || [], env = p.env || {}; +let isColorSupported = + !(!!env.NO_COLOR || argv.includes("--no-color")) && + (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI); + +let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length); + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + }; + +let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0; + do { + result += string.substring(cursor, index) + replace; + cursor = index + close.length; + index = string.indexOf(close, cursor); + } while (~index) + return result + string.substring(cursor) +}; + +let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } +}; + +picocolors.exports = createColors(); +picocolors.exports.createColors = createColors; + +var picocolorsExports = picocolors.exports; +var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports); + +var src = {exports: {}}; + +var browser$1 = {exports: {}}; + +/** + * Helpers. + */ + +var ms; +var hasRequiredMs; + +function requireMs () { + if (hasRequiredMs) return ms; + hasRequiredMs = 1; + var s = 1000; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + ms = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); + } + return ms; +} + +var common; +var hasRequiredCommon; + +function requireCommon () { + if (hasRequiredCommon) return common; + hasRequiredCommon = 1; + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = requireMs(); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; + } + + common = setup; + return common; +} + +/* eslint-env browser */ + +var hasRequiredBrowser; + +function requireBrowser () { + if (hasRequiredBrowser) return browser$1.exports; + hasRequiredBrowser = 1; + (function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + */ + + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = localstorage(); + exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; + })(); + + /** + * Colors. + */ + + exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + // eslint-disable-next-line complexity + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + let m; + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ + exports.log = console.debug || console.log || (() => {}); + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } + }; + } (browser$1, browser$1.exports)); + return browser$1.exports; +} + +var node = {exports: {}}; + +/** + * Module dependencies. + */ + +var hasRequiredNode; + +function requireNode () { + if (hasRequiredNode) return node.exports; + hasRequiredNode = 1; + (function (module, exports) { + const tty = require$$0; + const util = require$$1; + + /** + * This is the Node.js implementation of `debug()`. + */ + + exports.init = init; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' + ); + + /** + * Colors. + */ + + exports.colors = [6, 2, 3, 4, 5, 1]; + + try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. + } + + /** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; + }, {}); + + /** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + + function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); + } + + /** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } + } + + function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; + } + + /** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ + + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + return process.env.DEBUG; + } + + /** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %o to `util.inspect()`, all on a single line. + */ + + formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); + }; + + /** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } (node, node.exports)); + return node.exports; +} + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + src.exports = requireBrowser(); +} else { + src.exports = requireNode(); +} + +var srcExports = src.exports; +var debug$2 = /*@__PURE__*/getDefaultExportFromCjs(srcExports); + +var utils$4 = {}; + +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; +const SEP = '/'; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +/*global navigator*/ + +(function (exports) { + + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$2; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; + }; + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + + exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; + }; +} (utils$4)); + +const utils$3 = utils$4; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = constants$2; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$1 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$3.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$3.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1 = scan$1; + +const constants$1 = constants$2; +const utils$2 = utils$4; + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$1; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$2 = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$1.globChars(opts.windows); + const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$2.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$2(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$2.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$2.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$2.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$2.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$2.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$2.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$2.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$2.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$1.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$2.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1$1 = parse$2; + +const scan = scan_1; +const parse$1 = parse_1$1; +const utils$1 = utils$4; +const constants = constants$2; +const isObject$2 = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$1 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$1(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject$2(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch$1.compileRe(glob, options) + : picomatch$1.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$1.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils$1.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$1.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$1.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options); + return regex.test(utils$1.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$1.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options)); + return parse$1(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$1.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$1.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$1.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse$1(input, options); + } + + return picomatch$1.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$1.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$1.constants = constants; + +/** + * Expose "picomatch" + */ + +var picomatch_1$1 = picomatch$1; + +const pico = picomatch_1$1; +const utils = utils$4; + +function picomatch(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils.isWindows() }; + } + + return pico(glob, options, returnState); +} + +Object.assign(picomatch, pico); +var picomatch_1 = picomatch; + +var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch_1); + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePathRegExp = new RegExp(`\\${require$$1$1.win32.sep}`, 'g'); +const normalizePath$1 = function normalizePath(filename) { + return filename.replace(normalizePathRegExp, require$$1$1.posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || require$$1$1.isAbsolute(id) || id.startsWith('**')) { + return normalizePath$1(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath$1(require$$1$1.resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return require$$1$1.posix.join(basePath, normalizePath$1(id)); +} +const createFilter$1 = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + if (!includeMatchers.length && !excludeMatchers.length) + return (id) => typeof id === 'string' && !id.includes('\0'); + return function result(id) { + if (typeof id !== 'string') + return false; + if (id.includes('\0')) + return false; + const pathId = normalizePath$1(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); + +const isWindows = typeof process !== "undefined" && process.platform === "win32"; +const windowsSlashRE = /\\/g; +function slash(p) { + return p.replace(windowsSlashRE, "/"); +} +const postfixRE = /[?#].*$/; +function cleanUrl(url) { + return url.replace(postfixRE, ""); +} +function withTrailingSlash(path) { + if (path[path.length - 1] !== "/") { + return `${path}/`; + } + return path; +} + +let pnp; +if (process.versions.pnp) { + try { + pnp = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))("pnpapi"); + } catch { + } +} +function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) { + if (pnp) { + try { + const pkg = pnp.resolveToUnqualified(pkgName, basedir, { + considerBuiltins: false + }); + if (!pkg) return null; + const pkgData = loadPackageData(path$1.join(pkg, "package.json")); + return pkgData; + } catch { + return null; + } + } + while (basedir) { + const pkg = path$1.join(basedir, "node_modules", pkgName, "package.json"); + try { + if (fs$1.existsSync(pkg)) { + const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg); + const pkgData = loadPackageData(pkgPath); + return pkgData; + } + } catch { + } + const nextBasedir = path$1.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function loadPackageData(pkgPath) { + const data = JSON.parse(fs$1.readFileSync(pkgPath, "utf-8")); + const pkgDir = normalizePath(path$1.dirname(pkgPath)); + const { sideEffects } = data; + let hasSideEffects; + if (typeof sideEffects === "boolean") { + hasSideEffects = () => sideEffects; + } else if (Array.isArray(sideEffects)) { + if (sideEffects.length <= 0) { + hasSideEffects = () => false; + } else { + const finalPackageSideEffects = sideEffects.map((sideEffect) => { + if (sideEffect.includes("/")) { + return sideEffect; + } + return `**/${sideEffect}`; + }); + hasSideEffects = createFilter(finalPackageSideEffects, null, { + resolve: pkgDir + }); + } + } else { + hasSideEffects = () => null; + } + const resolvedCache = {}; + const pkg = { + dir: pkgDir, + data, + hasSideEffects, + setResolvedCache(key, entry, options) { + resolvedCache[getResolveCacheKey(key, options)] = entry; + }, + getResolvedCache(key, options) { + return resolvedCache[getResolveCacheKey(key, options)]; + } + }; + return pkg; +} +function getResolveCacheKey(key, options) { + return [ + key, + options.isRequire ? "1" : "0", + options.conditions.join("_"), + options.extensions.join("_"), + options.mainFields.join("_") + ].join("|"); +} + +const createFilter = createFilter$1; +node_module.builtinModules.filter((id) => !id.includes(":")); +function isInNodeModules(id) { + return id.includes("node_modules"); +} +node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))); +const _dirname = path$1.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))); +const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version ?? ""; +const filter = process.env.VITE_DEBUG_FILTER; +const DEBUG = process.env.DEBUG; +function createDebugger(namespace, options = {}) { + const log = debug$2(namespace); + const { onlyWhenFocused, depth } = options; + if (depth && log.inspectOpts && log.inspectOpts.depth == null) { + log.inspectOpts.depth = options.depth; + } + let enabled = log.enabled; + if (enabled && onlyWhenFocused) { + const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace; + enabled = !!DEBUG?.includes(ns); + } + if (enabled) { + return (...args) => { + if (!filter || args.some((a) => a?.includes?.(filter))) { + log(...args); + } + }; + } +} +function testCaseInsensitiveFS() { + if (!CLIENT_ENTRY.endsWith("client.mjs")) { + throw new Error( + `cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs` + ); + } + if (!fs$1.existsSync(CLIENT_ENTRY)) { + throw new Error( + "cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: " + CLIENT_ENTRY + ); + } + return fs$1.existsSync(CLIENT_ENTRY.replace("client.mjs", "cLiEnT.mjs")); +} +const isCaseInsensitiveFS = testCaseInsensitiveFS(); +const VOLUME_RE = /^[A-Z]:/i; +function normalizePath(id) { + return path$1.posix.normalize(isWindows ? slash(id) : id); +} +function fsPathFromId(id) { + const fsPath = normalizePath( + id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id + ); + return fsPath[0] === "/" || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} +function fsPathFromUrl(url) { + return fsPathFromId(cleanUrl(url)); +} +function isParentDirectory(dir, file) { + dir = withTrailingSlash(dir); + return file.startsWith(dir) || isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()); +} +function isSameFileUri(file1, file2) { + return file1 === file2 || isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase(); +} +const trailingSeparatorRE = /[?&]$/; +const timestampRE = /\bt=\d{13}&?\b/; +function removeTimestampQuery(url) { + return url.replace(timestampRE, "").replace(trailingSeparatorRE, ""); +} +function isObject$1(value) { + return Object.prototype.toString.call(value) === "[object Object]"; +} +function tryStatSync(file) { + try { + return fs$1.statSync(file, { throwIfNoEntry: false }); + } catch { + } +} +function isFileReadable(filename) { + if (!tryStatSync(filename)) { + return false; + } + try { + fs$1.accessSync(filename, fs$1.constants.R_OK); + return true; + } catch { + return false; + } +} +let safeRealpathSync = isWindows ? windowsSafeRealPathSync : fs$1.realpathSync.native; +const windowsNetworkMap = /* @__PURE__ */ new Map(); +function windowsMappedRealpathSync(path2) { + const realPath = fs$1.realpathSync.native(path2); + if (realPath.startsWith("\\\\")) { + for (const [network, volume] of windowsNetworkMap) { + if (realPath.startsWith(network)) return realPath.replace(network, volume); + } + } + return realPath; +} +const parseNetUseRE = /^\w* +(\w:) +([^ ]+)\s/; +let firstSafeRealPathSyncRun = false; +function windowsSafeRealPathSync(path2) { + if (!firstSafeRealPathSyncRun) { + optimizeSafeRealPathSync(); + firstSafeRealPathSyncRun = true; + } + return fs$1.realpathSync(path2); +} +function optimizeSafeRealPathSync() { + const nodeVersion = process.versions.node.split(".").map(Number); + if (nodeVersion[0] < 18 || nodeVersion[0] === 18 && nodeVersion[1] < 10) { + safeRealpathSync = fs$1.realpathSync; + return; + } + try { + fs$1.realpathSync.native(path$1.resolve("./")); + } catch (error) { + if (error.message.includes("EISDIR: illegal operation on a directory")) { + safeRealpathSync = fs$1.realpathSync; + return; + } + } + node_child_process.exec("net use", (error, stdout) => { + if (error) return; + const lines = stdout.split("\n"); + for (const line of lines) { + const m = parseNetUseRE.exec(line); + if (m) windowsNetworkMap.set(m[2], m[1]); + } + if (windowsNetworkMap.size === 0) { + safeRealpathSync = fs$1.realpathSync.native; + } else { + safeRealpathSync = windowsMappedRealpathSync; + } + }); +} +function arraify(target) { + return Array.isArray(target) ? target : [target]; +} +function backwardCompatibleWorkerPlugins(plugins) { + if (Array.isArray(plugins)) { + return plugins; + } + if (typeof plugins === "function") { + return plugins(); + } + return []; +} +function mergeConfigRecursively(defaults, overrides, rootPath) { + const merged = { ...defaults }; + for (const key in overrides) { + const value = overrides[key]; + if (value == null) { + continue; + } + const existing = merged[key]; + if (existing == null) { + merged[key] = value; + continue; + } + if (key === "alias" && (rootPath === "resolve" || rootPath === "")) { + merged[key] = mergeAlias(existing, value); + continue; + } else if (key === "assetsInclude" && rootPath === "") { + merged[key] = [].concat(existing, value); + continue; + } else if (key === "noExternal" && (rootPath === "ssr" || rootPath === "resolve") && (existing === true || value === true)) { + merged[key] = true; + continue; + } else if (key === "plugins" && rootPath === "worker") { + merged[key] = () => [ + ...backwardCompatibleWorkerPlugins(existing), + ...backwardCompatibleWorkerPlugins(value) + ]; + continue; + } else if (key === "server" && rootPath === "server.hmr") { + merged[key] = value; + continue; + } + if (Array.isArray(existing) || Array.isArray(value)) { + merged[key] = [...arraify(existing), ...arraify(value)]; + continue; + } + if (isObject$1(existing) && isObject$1(value)) { + merged[key] = mergeConfigRecursively( + existing, + value, + rootPath ? `${rootPath}.${key}` : key + ); + continue; + } + merged[key] = value; + } + return merged; +} +function mergeConfig(defaults, overrides, isRoot = true) { + if (typeof defaults === "function" || typeof overrides === "function") { + throw new Error(`Cannot merge config in form of callback`); + } + return mergeConfigRecursively(defaults, overrides, isRoot ? "" : "."); +} +function mergeAlias(a, b) { + if (!a) return b; + if (!b) return a; + if (isObject$1(a) && isObject$1(b)) { + return { ...a, ...b }; + } + return [...normalizeAlias(b), ...normalizeAlias(a)]; +} +function normalizeAlias(o = []) { + return Array.isArray(o) ? o.map(normalizeSingleAlias) : Object.keys(o).map( + (find) => normalizeSingleAlias({ + find, + replacement: o[find] + }) + ); +} +function normalizeSingleAlias({ + find, + replacement, + customResolver +}) { + if (typeof find === "string" && find[find.length - 1] === "/" && replacement[replacement.length - 1] === "/") { + find = find.slice(0, find.length - 1); + replacement = replacement.slice(0, replacement.length - 1); + } + const alias = { + find, + replacement + }; + if (customResolver) { + alias.customResolver = customResolver; + } + return alias; +} + +const CSS_LANGS_RE = ( + // eslint-disable-next-line regexp/no-unused-capturing-group + /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/ +); +const isCSSRequest = (request) => CSS_LANGS_RE.test(request); +class SplitVendorChunkCache { + cache; + constructor() { + this.cache = /* @__PURE__ */ new Map(); + } + reset() { + this.cache = /* @__PURE__ */ new Map(); + } +} +function splitVendorChunk(options = {}) { + const cache = options.cache ?? new SplitVendorChunkCache(); + return (id, { getModuleInfo }) => { + if (isInNodeModules(id) && !isCSSRequest(id) && staticImportedByEntry(id, getModuleInfo, cache.cache)) { + return "vendor"; + } + }; +} +function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) { + if (cache.has(id)) { + return cache.get(id); + } + if (importStack.includes(id)) { + cache.set(id, false); + return false; + } + const mod = getModuleInfo(id); + if (!mod) { + cache.set(id, false); + return false; + } + if (mod.isEntry) { + cache.set(id, true); + return true; + } + const someImporterIs = mod.importers.some( + (importer) => staticImportedByEntry( + importer, + getModuleInfo, + cache, + importStack.concat(id) + ) + ); + cache.set(id, someImporterIs); + return someImporterIs; +} +function splitVendorChunkPlugin() { + const caches = []; + function createSplitVendorChunk(output, config) { + const cache = new SplitVendorChunkCache(); + caches.push(cache); + const build = config.build ?? {}; + const format = output.format; + if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") { + return splitVendorChunk({ cache }); + } + } + return { + name: "vite:split-vendor-chunk", + config(config) { + let outputs = config.build?.rollupOptions?.output; + if (outputs) { + outputs = arraify(outputs); + for (const output of outputs) { + const viteManualChunks = createSplitVendorChunk(output, config); + if (viteManualChunks) { + if (output.manualChunks) { + if (typeof output.manualChunks === "function") { + const userManualChunks = output.manualChunks; + output.manualChunks = (id, api) => { + return userManualChunks(id, api) ?? viteManualChunks(id, api); + }; + } else { + console.warn( + "(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead." + ); + } + } else { + output.manualChunks = viteManualChunks; + } + } + } + } else { + return { + build: { + rollupOptions: { + output: { + manualChunks: createSplitVendorChunk({}, config) + } + } + } + }; + } + }, + buildStart() { + caches.forEach((cache) => cache.reset()); + } + }; +} + +function perEnvironmentPlugin(name, applyToEnvironment) { + return { + name, + applyToEnvironment + }; +} + +function perEnvironmentState(initial) { + const stateMap = /* @__PURE__ */ new WeakMap(); + return function(context) { + const { environment } = context; + let state = stateMap.get(environment); + if (!state) { + state = initial(environment); + stateMap.set(environment, state); + } + return state; + }; +} + +var convertSourceMap$1 = {}; + +(function (exports) { + + Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; + } + }); + + + Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; + } + }); + + var decodeBase64; + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + decodeBase64 = decodeBase64WithBufferFrom; + } else { + decodeBase64 = decodeBase64WithNewBuffer; + } + } else { + decodeBase64 = decodeBase64WithAtob; + } + + function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, 'base64').toString(); + } + + function decodeBase64WithNewBuffer(base64) { + if (typeof value === 'number') { + throw new TypeError('The value to decode must not be of type number.'); + } + return new Buffer(base64, 'base64').toString(); + } + + function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); + } + + function stripComment(sm) { + return sm.split(',').pop(); + } + + function readFromFileMap(sm, read) { + var r = exports.mapFileCommentRegex.exec(sm); + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === 'function') { + return sm.catch(throwError); + } else { + return sm; + } + } catch (e) { + throwError(e); + } + + function throwError(e) { + throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); + } + } + + function Converter (sm, opts) { + opts = opts || {}; + + if (opts.hasComment) { + sm = stripComment(sm); + } + + if (opts.encoding === 'base64') { + sm = decodeBase64(sm); + } else if (opts.encoding === 'uri') { + sm = decodeURIComponent(sm); + } + + if (opts.isJSON || opts.encoding) { + sm = JSON.parse(sm); + } + + this.sourcemap = sm; + } + + Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); + }; + + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + } else { + Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + } + } else { + Converter.prototype.toBase64 = encodeBase64WithBtoa; + } + + function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, 'utf8').toString('base64'); + } + + function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === 'number') { + throw new TypeError('The json to encode must not be of type number.'); + } + return new Buffer(json, 'utf8').toString('base64'); + } + + function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); + } + + Converter.prototype.toURI = function () { + var json = this.toJSON(); + return encodeURIComponent(json); + }; + + Converter.prototype.toComment = function (options) { + var encoding, content, data; + if (options != null && options.encoding === 'uri') { + encoding = ''; + content = this.toURI(); + } else { + encoding = ';base64'; + content = this.toBase64(); + } + data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; + return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; + + // returns copy instead of original + Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); + }; + + Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); + }; + + Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; + }; + + Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; + }; + + exports.fromObject = function (obj) { + return new Converter(obj); + }; + + exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); + }; + + exports.fromURI = function (uri) { + return new Converter(uri, { encoding: 'uri' }); + }; + + exports.fromBase64 = function (base64) { + return new Converter(base64, { encoding: 'base64' }); + }; + + exports.fromComment = function (comment) { + var m, encoding; + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || 'uri'; + return new Converter(comment, { encoding: encoding, hasComment: true }); + }; + + function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); + } + + exports.fromMapFileComment = function (comment, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileComment`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === 'function') { + return sm.then(makeConverter); + } else { + return makeConverter(sm); + } + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromMapFileSource = function (content, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileSource`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; + }; + + exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); + }; + + exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); + }; + + exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; +} (convertSourceMap$1)); + +var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1); + +/*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + * @public + */ + +var etag_1 = etag; + +/** + * Module dependencies. + * @private + */ + +var crypto$1 = require$$0$1; +var Stats = require$$1$2.Stats; + +/** + * Module variables. + * @private + */ + +var toString$1 = Object.prototype.toString; + +/** + * Generate an entity tag. + * + * @param {Buffer|string} entity + * @return {string} + * @private + */ + +function entitytag (entity) { + if (entity.length === 0) { + // fast-path empty + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' + } + + // compute hash of entity + var hash = crypto$1 + .createHash('sha1') + .update(entity, 'utf8') + .digest('base64') + .substring(0, 27); + + // compute length of entity + var len = typeof entity === 'string' + ? Buffer.byteLength(entity, 'utf8') + : entity.length; + + return '"' + len.toString(16) + '-' + hash + '"' +} + +/** + * Create a simple ETag. + * + * @param {string|Buffer|Stats} entity + * @param {object} [options] + * @param {boolean} [options.weak] + * @return {String} + * @public + */ + +function etag (entity, options) { + if (entity == null) { + throw new TypeError('argument entity is required') + } + + // support fs.Stats object + var isStats = isstats(entity); + var weak = options && typeof options.weak === 'boolean' + ? options.weak + : isStats; + + // validate argument + if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { + throw new TypeError('argument entity must be string, Buffer, or fs.Stats') + } + + // generate entity tag + var tag = isStats + ? stattag(entity) + : entitytag(entity); + + return weak + ? 'W/' + tag + : tag +} + +/** + * Determine if object is a Stats object. + * + * @param {object} obj + * @return {boolean} + * @api private + */ + +function isstats (obj) { + // genuine fs.Stats + if (typeof Stats === 'function' && obj instanceof Stats) { + return true + } + + // quack quack + return obj && typeof obj === 'object' && + 'ctime' in obj && toString$1.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString$1.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' +} + +/** + * Generate a tag for a stat. + * + * @param {object} stat + * @return {string} + * @private + */ + +function stattag (stat) { + var mtime = stat.mtime.getTime().toString(16); + var size = stat.size.toString(16); + + return '"' + size + '-' + mtime + '"' +} + +var getEtag = /*@__PURE__*/getDefaultExportFromCjs(etag_1); + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa$1 = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const debug$1 = createDebugger("vite:sourcemap", { + onlyWhenFocused: true +}); +function genSourceMapUrl(map) { + if (typeof map !== "string") { + map = JSON.stringify(map); + } + return `data:application/json;base64,${Buffer.from(map).toString("base64")}`; +} +function getCodeWithSourcemap(type, code, map) { + if (debug$1) { + code += ` +/*${JSON.stringify(map, null, 2).replace(/\*\//g, "*\\/")}*/ +`; + } + if (type === "js") { + code += ` +//# sourceMappingURL=${genSourceMapUrl(map)}`; + } else if (type === "css") { + code += ` +/*# sourceMappingURL=${genSourceMapUrl(map)} */`; + } + return code; +} + +const debug = createDebugger("vite:send", { + onlyWhenFocused: true +}); +const alias = { + js: "text/javascript", + css: "text/css", + html: "text/html", + json: "application/json" +}; +function send(req, res, content, type, options) { + const { + etag = getEtag(content, { weak: true }), + cacheControl = "no-cache", + headers, + map + } = options; + if (res.writableEnded) { + return; + } + if (req.headers["if-none-match"] === etag) { + res.statusCode = 304; + res.end(); + return; + } + res.setHeader("Content-Type", alias[type] || type); + res.setHeader("Cache-Control", cacheControl); + res.setHeader("Etag", etag); + if (headers) { + for (const name in headers) { + res.setHeader(name, headers[name]); + } + } + if (map && "version" in map && map.mappings) { + if (type === "js" || type === "css") { + content = getCodeWithSourcemap(type, content.toString(), map); + } + } else if (type === "js" && (!map || map.mappings !== "")) { + const code = content.toString(); + if (convertSourceMap.mapFileCommentRegex.test(code)) { + debug?.(`Skipped injecting fallback sourcemap for ${req.url}`); + } else { + const urlWithoutTimestamp = removeTimestampQuery(req.url); + const ms = new MagicString(code); + content = getCodeWithSourcemap( + type, + code, + ms.generateMap({ + source: path$1.basename(urlWithoutTimestamp), + hires: "boundary", + includeContent: true + }) + ); + } + } + res.statusCode = 200; + res.end(content); + return; +} + +const LogLevels = { + silent: 0, + error: 1, + warn: 2, + info: 3 +}; +let lastType; +let lastMsg; +let sameCount = 0; +function clearScreen() { + const repeatCount = process.stdout.rows - 2; + const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : ""; + console.log(blank); + readline.cursorTo(process.stdout, 0, 0); + readline.clearScreenDown(process.stdout); +} +let timeFormatter; +function getTimeFormatter() { + timeFormatter ??= new Intl.DateTimeFormat(void 0, { + hour: "numeric", + minute: "numeric", + second: "numeric" + }); + return timeFormatter; +} +function createLogger(level = "info", options = {}) { + if (options.customLogger) { + return options.customLogger; + } + const loggedErrors = /* @__PURE__ */ new WeakSet(); + const { + prefix = "[vite]", + allowClearScreen = true, + console: console2 = globalThis.console + } = options; + const thresh = LogLevels[level]; + const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI; + const clear = canClearScreen ? clearScreen : () => { + }; + function format(type, msg, options2 = {}) { + if (options2.timestamp) { + let tag = ""; + if (type === "info") { + tag = colors.cyan(colors.bold(prefix)); + } else if (type === "warn") { + tag = colors.yellow(colors.bold(prefix)); + } else { + tag = colors.red(colors.bold(prefix)); + } + const environment = options2.environment ? options2.environment + " " : ""; + return `${colors.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${environment}${msg}`; + } else { + return msg; + } + } + function output(type, msg, options2 = {}) { + if (thresh >= LogLevels[type]) { + const method = type === "info" ? "log" : type; + if (options2.error) { + loggedErrors.add(options2.error); + } + if (canClearScreen) { + if (type === lastType && msg === lastMsg) { + sameCount++; + clear(); + console2[method]( + format(type, msg, options2), + colors.yellow(`(x${sameCount + 1})`) + ); + } else { + sameCount = 0; + lastMsg = msg; + lastType = type; + if (options2.clear) { + clear(); + } + console2[method](format(type, msg, options2)); + } + } else { + console2[method](format(type, msg, options2)); + } + } + } + const warnedMessages = /* @__PURE__ */ new Set(); + const logger = { + hasWarned: false, + info(msg, opts) { + output("info", msg, opts); + }, + warn(msg, opts) { + logger.hasWarned = true; + output("warn", msg, opts); + }, + warnOnce(msg, opts) { + if (warnedMessages.has(msg)) return; + logger.hasWarned = true; + output("warn", msg, opts); + warnedMessages.add(msg); + }, + error(msg, opts) { + logger.hasWarned = true; + output("error", msg, opts); + }, + clearScreen(type) { + if (thresh >= LogLevels[type]) { + clear(); + } + }, + hasErrorLogged(error) { + return loggedErrors.has(error); + } + }; + return logger; +} + +const ROOT_FILES = [ + // '.git', + // https://pnpm.io/workspaces/ + "pnpm-workspace.yaml", + // https://rushjs.io/pages/advanced/config_files/ + // 'rush.json', + // https://nx.dev/latest/react/getting-started/nx-setup + // 'workspace.json', + // 'nx.json', + // https://github.com/lerna/lerna#lernajson + "lerna.json" +]; +function hasWorkspacePackageJSON(root) { + const path = path$1.join(root, "package.json"); + if (!isFileReadable(path)) { + return false; + } + try { + const content = JSON.parse(fs$1.readFileSync(path, "utf-8")) || {}; + return !!content.workspaces; + } catch { + return false; + } +} +function hasRootFile(root) { + return ROOT_FILES.some((file) => fs$1.existsSync(path$1.join(root, file))); +} +function hasPackageJSON(root) { + const path = path$1.join(root, "package.json"); + return fs$1.existsSync(path); +} +function searchForPackageRoot(current, root = current) { + if (hasPackageJSON(current)) return current; + const dir = path$1.dirname(current); + if (!dir || dir === current) return root; + return searchForPackageRoot(dir, root); +} +function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) { + if (hasRootFile(current)) return current; + if (hasWorkspacePackageJSON(current)) return current; + const dir = path$1.dirname(current); + if (!dir || dir === current) return root; + return searchForWorkspaceRoot(dir, root); +} + +function isFileServingAllowed(configOrUrl, urlOrServer) { + const config = typeof urlOrServer === "string" ? configOrUrl : urlOrServer.config; + const url = typeof urlOrServer === "string" ? urlOrServer : configOrUrl; + if (!config.server.fs.strict) return true; + const filePath = fsPathFromUrl(url); + return isFileLoadingAllowed(config, filePath); +} +function isUriInFilePath(uri, filePath) { + return isSameFileUri(uri, filePath) || isParentDirectory(uri, filePath); +} +function isFileLoadingAllowed(config, filePath) { + const { fs } = config.server; + if (!fs.strict) return true; + if (config.fsDenyGlob(filePath)) return false; + if (config.safeModulePaths.has(filePath)) return true; + if (fs.allow.some((uri) => isUriInFilePath(uri, filePath))) return true; + return false; +} + +var main$1 = {exports: {}}; + +var name = "dotenv"; +var version$1 = "16.4.5"; +var description = "Loads environment variables from .env file"; +var main = "lib/main.js"; +var types = "lib/main.d.ts"; +var exports$1 = { + ".": { + types: "./lib/main.d.ts", + require: "./lib/main.js", + "default": "./lib/main.js" + }, + "./config": "./config.js", + "./config.js": "./config.js", + "./lib/env-options": "./lib/env-options.js", + "./lib/env-options.js": "./lib/env-options.js", + "./lib/cli-options": "./lib/cli-options.js", + "./lib/cli-options.js": "./lib/cli-options.js", + "./package.json": "./package.json" +}; +var scripts = { + "dts-check": "tsc --project tests/types/tsconfig.json", + lint: "standard", + "lint-readme": "standard-markdown", + pretest: "npm run lint && npm run dts-check", + test: "tap tests/*.js --100 -Rspec", + "test:coverage": "tap --coverage-report=lcov", + prerelease: "npm test", + release: "standard-version" +}; +var repository = { + type: "git", + url: "git://github.com/motdotla/dotenv.git" +}; +var funding = "https://dotenvx.com"; +var keywords = [ + "dotenv", + "env", + ".env", + "environment", + "variables", + "config", + "settings" +]; +var readmeFilename = "README.md"; +var license = "BSD-2-Clause"; +var devDependencies = { + "@definitelytyped/dtslint": "^0.0.133", + "@types/node": "^18.11.3", + decache: "^4.6.1", + sinon: "^14.0.1", + standard: "^17.0.0", + "standard-markdown": "^7.1.0", + "standard-version": "^9.5.0", + tap: "^16.3.0", + tar: "^6.1.11", + typescript: "^4.8.4" +}; +var engines = { + node: ">=12" +}; +var browser = { + fs: false +}; +var require$$4 = { + name: name, + version: version$1, + description: description, + main: main, + types: types, + exports: exports$1, + scripts: scripts, + repository: repository, + funding: funding, + keywords: keywords, + readmeFilename: readmeFilename, + license: license, + devDependencies: devDependencies, + engines: engines, + browser: browser +}; + +const fs = require$$1$2; +const path = require$$1$1; +const os = require$$2; +const crypto = require$$0$1; +const packageJson = require$$4; + +const version = packageJson.version; + +const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + +// Parse src into an Object +function parse (src) { + const obj = {}; + + // Convert buffer to string + let lines = src.toString(); + + // Convert line breaks to same format + lines = lines.replace(/\r\n?/mg, '\n'); + + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + + // Default undefined or null to empty string + let value = (match[2] || ''); + + // Remove whitespace + value = value.trim(); + + // Check if double quoted + const maybeQuote = value[0]; + + // Remove surrounding quotes + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2'); + + // Expand newlines if double quoted + if (maybeQuote === '"') { + value = value.replace(/\\n/g, '\n'); + value = value.replace(/\\r/g, '\r'); + } + + // Add to object + obj[key] = value; + } + + return obj +} + +function _parseVault (options) { + const vaultPath = _vaultPath(options); + + // Parse .env.vault + const result = DotenvModule.configDotenv({ path: vaultPath }); + if (!result.parsed) { + const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err.code = 'MISSING_DATA'; + throw err + } + + // handle scenario for comma separated keys - for use with key rotation + // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod" + const keys = _dotenvKey(options).split(','); + const length = keys.length; + + let decrypted; + for (let i = 0; i < length; i++) { + try { + // Get full key + const key = keys[i].trim(); + + // Get instructions for decrypt + const attrs = _instructions(result, key); + + // Decrypt + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + + break + } catch (error) { + // last key + if (i + 1 >= length) { + throw error + } + // try next key + } + } + + // Parse decrypted .env string + return DotenvModule.parse(decrypted) +} + +function _log (message) { + console.log(`[dotenv@${version}][INFO] ${message}`); +} + +function _warn (message) { + console.log(`[dotenv@${version}][WARN] ${message}`); +} + +function _debug (message) { + console.log(`[dotenv@${version}][DEBUG] ${message}`); +} + +function _dotenvKey (options) { + // prioritize developer directly setting options.DOTENV_KEY + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY + } + + // secondary infra already contains a DOTENV_KEY environment variable + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { + return process.env.DOTENV_KEY + } + + // fallback to empty string + return '' +} + +function _instructions (result, dotenvKey) { + // Parse DOTENV_KEY. Format is a URI + let uri; + try { + uri = new URL(dotenvKey); + } catch (error) { + if (error.code === 'ERR_INVALID_URL') { + const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + throw error + } + + // Get decrypt key + const key = uri.password; + if (!key) { + const err = new Error('INVALID_DOTENV_KEY: Missing key part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get environment + const environment = uri.searchParams.get('environment'); + if (!environment) { + const err = new Error('INVALID_DOTENV_KEY: Missing environment part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get ciphertext payload + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION + if (!ciphertext) { + const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'; + throw err + } + + return { ciphertext, key } +} + +function _vaultPath (options) { + let possibleVaultPath = null; + + if (options && options.path && options.path.length > 0) { + if (Array.isArray(options.path)) { + for (const filepath of options.path) { + if (fs.existsSync(filepath)) { + possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`; + } + } + } else { + possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`; + } + } else { + possibleVaultPath = path.resolve(process.cwd(), '.env.vault'); + } + + if (fs.existsSync(possibleVaultPath)) { + return possibleVaultPath + } + + return null +} + +function _resolveHome (envPath) { + return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath +} + +function _configVault (options) { + _log('Loading env from encrypted .env.vault'); + + const parsed = DotenvModule._parseVault(options); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } +} + +function configDotenv (options) { + const dotenvPath = path.resolve(process.cwd(), '.env'); + let encoding = 'utf8'; + const debug = Boolean(options && options.debug); + + if (options && options.encoding) { + encoding = options.encoding; + } else { + if (debug) { + _debug('No encoding is specified. UTF-8 is used by default'); + } + } + + let optionPaths = [dotenvPath]; // default, look for .env + if (options && options.path) { + if (!Array.isArray(options.path)) { + optionPaths = [_resolveHome(options.path)]; + } else { + optionPaths = []; // reset default + for (const filepath of options.path) { + optionPaths.push(_resolveHome(filepath)); + } + } + } + + // Build the parsed data in a temporary object (because we need to return it). Once we have the final + // parsed data, we will combine it with process.env (or options.processEnv if provided). + let lastError; + const parsedAll = {}; + for (const path of optionPaths) { + try { + // Specifying an encoding returns a string instead of a buffer + const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding })); + + DotenvModule.populate(parsedAll, parsed, options); + } catch (e) { + if (debug) { + _debug(`Failed to load ${path} ${e.message}`); + } + lastError = e; + } + } + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsedAll, options); + + if (lastError) { + return { parsed: parsedAll, error: lastError } + } else { + return { parsed: parsedAll } + } +} + +// Populates process.env from .env file +function config (options) { + // fallback to original dotenv if DOTENV_KEY is not set + if (_dotenvKey(options).length === 0) { + return DotenvModule.configDotenv(options) + } + + const vaultPath = _vaultPath(options); + + // dotenvKey exists but .env.vault file does not exist + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + + return DotenvModule.configDotenv(options) + } + + return DotenvModule._configVault(options) +} + +function decrypt (encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), 'hex'); + let ciphertext = Buffer.from(encrypted, 'base64'); + + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + + try { + const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}` + } catch (error) { + const isRange = error instanceof RangeError; + const invalidKeyLength = error.message === 'Invalid key length'; + const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'; + + if (isRange || invalidKeyLength) { + const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } else if (decryptionFailed) { + const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY'); + err.code = 'DECRYPTION_FAILED'; + throw err + } else { + throw error + } + } +} + +// Populate process.env with parsed values +function populate (processEnv, parsed, options = {}) { + const debug = Boolean(options && options.debug); + const override = Boolean(options && options.override); + + if (typeof parsed !== 'object') { + const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate'); + err.code = 'OBJECT_REQUIRED'; + throw err + } + + // Set process.env + for (const key of Object.keys(parsed)) { + if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + } + + if (debug) { + if (override === true) { + _debug(`"${key}" is already defined and WAS overwritten`); + } else { + _debug(`"${key}" is already defined and was NOT overwritten`); + } + } + } else { + processEnv[key] = parsed[key]; + } + } +} + +const DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse, + populate +}; + +main$1.exports.configDotenv = DotenvModule.configDotenv; +main$1.exports._configVault = DotenvModule._configVault; +main$1.exports._parseVault = DotenvModule._parseVault; +main$1.exports.config = DotenvModule.config; +main$1.exports.decrypt = DotenvModule.decrypt; +var parse_1 = main$1.exports.parse = DotenvModule.parse; +main$1.exports.populate = DotenvModule.populate; + +main$1.exports = DotenvModule; + +function _resolveEscapeSequences (value) { + return value.replace(/\\\$/g, '$') +} + +function expandValue (value, processEnv, runningParsed) { + const env = { ...runningParsed, ...processEnv }; // process.env wins + + const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g; + + let result = value; + let match; + const seen = new Set(); // self-referential checker + + while ((match = regex.exec(result)) !== null) { + seen.add(result); + + const [template, bracedExpression, unbracedExpression] = match; + const expression = bracedExpression || unbracedExpression; + + // match the operators `:+`, `+`, `:-`, and `-` + const opRegex = /(:\+|\+|:-|-)/; + // find first match + const opMatch = expression.match(opRegex); + const splitter = opMatch ? opMatch[0] : null; + + const r = expression.split(splitter); + + let defaultValue; + let value; + + const key = r.shift(); + + if ([':+', '+'].includes(splitter)) { + defaultValue = env[key] ? r.join(splitter) : ''; + value = null; + } else { + defaultValue = r.join(splitter); + value = env[key]; + } + + if (value) { + // self-referential check + if (seen.has(value)) { + result = result.replace(template, defaultValue); + } else { + result = result.replace(template, value); + } + } else { + result = result.replace(template, defaultValue); + } + + // if the result equaled what was in process.env and runningParsed then stop expanding + if (result === runningParsed[key]) { + break + } + + regex.lastIndex = 0; // reset regex search position to re-evaluate after each replacement + } + + return result +} + +function expand (options) { + // for use with progressive expansion + const runningParsed = {}; + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + // dotenv.config() ran before this so the assumption is process.env has already been set + for (const key in options.parsed) { + let value = options.parsed[key]; + + // short-circuit scenario: process.env was already set prior to the file value + if (processEnv[key] && processEnv[key] !== value) { + value = processEnv[key]; + } else { + value = expandValue(value, processEnv, runningParsed); + } + + options.parsed[key] = _resolveEscapeSequences(value); + + // for use with progressive expansion + runningParsed[key] = _resolveEscapeSequences(value); + } + + for (const processKey in options.parsed) { + processEnv[processKey] = options.parsed[processKey]; + } + + return options +} + +var expand_1 = expand; + +function getEnvFilesForMode(mode, envDir) { + return [ + /** default file */ + `.env`, + /** local file */ + `.env.local`, + /** mode file */ + `.env.${mode}`, + /** mode local file */ + `.env.${mode}.local` + ].map((file) => normalizePath(path$1.join(envDir, file))); +} +function loadEnv(mode, envDir, prefixes = "VITE_") { + if (mode === "local") { + throw new Error( + `"local" cannot be used as a mode name because it conflicts with the .local postfix for .env files.` + ); + } + prefixes = arraify(prefixes); + const env = {}; + const envFiles = getEnvFilesForMode(mode, envDir); + const parsed = Object.fromEntries( + envFiles.flatMap((filePath) => { + if (!tryStatSync(filePath)?.isFile()) return []; + return Object.entries(parse_1(fs$1.readFileSync(filePath))); + }) + ); + if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) { + process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV; + } + if (parsed.BROWSER && process.env.BROWSER === void 0) { + process.env.BROWSER = parsed.BROWSER; + } + if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) { + process.env.BROWSER_ARGS = parsed.BROWSER_ARGS; + } + const processEnv = { ...process.env }; + expand_1({ parsed, processEnv }); + for (const [key, value] of Object.entries(parsed)) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = value; + } + } + for (const key in process.env) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = process.env[key]; + } + } + return env; +} +function resolveEnvPrefix({ + envPrefix = "VITE_" +}) { + envPrefix = arraify(envPrefix); + if (envPrefix.includes("")) { + throw new Error( + `envPrefix option contains value '', which could lead unexpected exposure of sensitive information.` + ); + } + return envPrefix; +} + +exports.esbuildVersion = esbuild.version; +exports.createFilter = createFilter; +exports.createLogger = createLogger; +exports.defaultClientConditions = DEFAULT_CLIENT_CONDITIONS; +exports.defaultClientMainFields = DEFAULT_CLIENT_MAIN_FIELDS; +exports.defaultServerConditions = DEFAULT_SERVER_CONDITIONS; +exports.defaultServerMainFields = DEFAULT_SERVER_MAIN_FIELDS; +exports.isCSSRequest = isCSSRequest; +exports.isFileLoadingAllowed = isFileLoadingAllowed; +exports.isFileServingAllowed = isFileServingAllowed; +exports.loadEnv = loadEnv; +exports.mergeAlias = mergeAlias; +exports.mergeConfig = mergeConfig; +exports.normalizePath = normalizePath; +exports.perEnvironmentPlugin = perEnvironmentPlugin; +exports.perEnvironmentState = perEnvironmentState; +exports.resolveEnvPrefix = resolveEnvPrefix; +exports.rollupVersion = rollupVersion; +exports.searchForWorkspaceRoot = searchForWorkspaceRoot; +exports.send = send; +exports.splitVendorChunk = splitVendorChunk; +exports.splitVendorChunkPlugin = splitVendorChunkPlugin; +exports.version = VERSION; diff --git a/seller_1/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js b/seller_1/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js new file mode 100644 index 0000000..b9185fa --- /dev/null +++ b/seller_1/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js @@ -0,0 +1,553 @@ +var openParentheses = "(".charCodeAt(0); +var closeParentheses = ")".charCodeAt(0); +var singleQuote = "'".charCodeAt(0); +var doubleQuote = '"'.charCodeAt(0); +var backslash = "\\".charCodeAt(0); +var slash = "/".charCodeAt(0); +var comma = ",".charCodeAt(0); +var colon = ":".charCodeAt(0); +var star = "*".charCodeAt(0); +var uLower = "u".charCodeAt(0); +var uUpper = "U".charCodeAt(0); +var plus = "+".charCodeAt(0); +var isUnicodeRange = /^[a-f0-9?-]+$/i; + +var parse$1 = function(input) { + var tokens = []; + var value = input; + + var next, + quote, + prev, + token, + escape, + escapePos, + whitespacePos, + parenthesesOpenPos; + var pos = 0; + var code = value.charCodeAt(pos); + var max = value.length; + var stack = [{ nodes: tokens }]; + var balanced = 0; + var parent; + + var name = ""; + var before = ""; + var after = ""; + + while (pos < max) { + // Whitespaces + if (code <= 32) { + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + token = value.slice(pos, next); + + prev = tokens[tokens.length - 1]; + if (code === closeParentheses && balanced) { + after = token; + } else if (prev && prev.type === "div") { + prev.after = token; + prev.sourceEndIndex += token.length; + } else if ( + code === comma || + code === colon || + (code === slash && + value.charCodeAt(next + 1) !== star && + (!parent || + (parent && parent.type === "function" && parent.value !== "calc"))) + ) { + before = token; + } else { + tokens.push({ + type: "space", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + + // Quotes + } else if (code === singleQuote || code === doubleQuote) { + next = pos; + quote = code === singleQuote ? "'" : '"'; + token = { + type: "string", + sourceIndex: pos, + quote: quote + }; + do { + escape = false; + next = value.indexOf(quote, next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += quote; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + token.value = value.slice(pos + 1, next); + token.sourceEndIndex = token.unclosed ? next : next + 1; + tokens.push(token); + pos = next + 1; + code = value.charCodeAt(pos); + + // Comments + } else if (code === slash && value.charCodeAt(pos + 1) === star) { + next = value.indexOf("*/", pos); + + token = { + type: "comment", + sourceIndex: pos, + sourceEndIndex: next + 2 + }; + + if (next === -1) { + token.unclosed = true; + next = value.length; + token.sourceEndIndex = next; + } + + token.value = value.slice(pos + 2, next); + tokens.push(token); + + pos = next + 2; + code = value.charCodeAt(pos); + + // Operation within calc + } else if ( + (code === slash || code === star) && + parent && + parent.type === "function" && + parent.value === "calc" + ) { + token = value[pos]; + tokens.push({ + type: "word", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token + }); + pos += 1; + code = value.charCodeAt(pos); + + // Dividers + } else if (code === slash || code === comma || code === colon) { + token = value[pos]; + + tokens.push({ + type: "div", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token, + before: before, + after: "" + }); + before = ""; + + pos += 1; + code = value.charCodeAt(pos); + + // Open parentheses + } else if (openParentheses === code) { + // Whitespaces after open parentheses + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + parenthesesOpenPos = pos; + token = { + type: "function", + sourceIndex: pos - name.length, + value: name, + before: value.slice(parenthesesOpenPos + 1, next) + }; + pos = next; + + if (name === "url" && code !== singleQuote && code !== doubleQuote) { + next -= 1; + do { + escape = false; + next = value.indexOf(")", next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += ")"; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + // Whitespaces before closed + whitespacePos = next; + do { + whitespacePos -= 1; + code = value.charCodeAt(whitespacePos); + } while (code <= 32); + if (parenthesesOpenPos < whitespacePos) { + if (pos !== whitespacePos + 1) { + token.nodes = [ + { + type: "word", + sourceIndex: pos, + sourceEndIndex: whitespacePos + 1, + value: value.slice(pos, whitespacePos + 1) + } + ]; + } else { + token.nodes = []; + } + if (token.unclosed && whitespacePos + 1 !== next) { + token.after = ""; + token.nodes.push({ + type: "space", + sourceIndex: whitespacePos + 1, + sourceEndIndex: next, + value: value.slice(whitespacePos + 1, next) + }); + } else { + token.after = value.slice(whitespacePos + 1, next); + token.sourceEndIndex = next; + } + } else { + token.after = ""; + token.nodes = []; + } + pos = next + 1; + token.sourceEndIndex = token.unclosed ? next : pos; + code = value.charCodeAt(pos); + tokens.push(token); + } else { + balanced += 1; + token.after = ""; + token.sourceEndIndex = pos + 1; + tokens.push(token); + stack.push(token); + tokens = token.nodes = []; + parent = token; + } + name = ""; + + // Close parentheses + } else if (closeParentheses === code && balanced) { + pos += 1; + code = value.charCodeAt(pos); + + parent.after = after; + parent.sourceEndIndex += after.length; + after = ""; + balanced -= 1; + stack[stack.length - 1].sourceEndIndex = pos; + stack.pop(); + parent = stack[balanced]; + tokens = parent.nodes; + + // Words + } else { + next = pos; + do { + if (code === backslash) { + next += 1; + } + next += 1; + code = value.charCodeAt(next); + } while ( + next < max && + !( + code <= 32 || + code === singleQuote || + code === doubleQuote || + code === comma || + code === colon || + code === slash || + code === openParentheses || + (code === star && + parent && + parent.type === "function" && + parent.value === "calc") || + (code === slash && + parent.type === "function" && + parent.value === "calc") || + (code === closeParentheses && balanced) + ) + ); + token = value.slice(pos, next); + + if (openParentheses === code) { + name = token; + } else if ( + (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && + plus === token.charCodeAt(1) && + isUnicodeRange.test(token.slice(2)) + ) { + tokens.push({ + type: "unicode-range", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } else { + tokens.push({ + type: "word", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + } + } + + for (pos = stack.length - 1; pos; pos -= 1) { + stack[pos].unclosed = true; + stack[pos].sourceEndIndex = value.length; + } + + return stack[0].nodes; +}; + +var walk$1 = function walk(nodes, cb, bubble) { + var i, max, node, result; + + for (i = 0, max = nodes.length; i < max; i += 1) { + node = nodes[i]; + if (!bubble) { + result = cb(node, i, nodes); + } + + if ( + result !== false && + node.type === "function" && + Array.isArray(node.nodes) + ) { + walk(node.nodes, cb, bubble); + } + + if (bubble) { + cb(node, i, nodes); + } + } +}; + +function stringifyNode(node, custom) { + var type = node.type; + var value = node.value; + var buf; + var customResult; + + if (custom && (customResult = custom(node)) !== undefined) { + return customResult; + } else if (type === "word" || type === "space") { + return value; + } else if (type === "string") { + buf = node.quote || ""; + return buf + value + (node.unclosed ? "" : buf); + } else if (type === "comment") { + return "/*" + value + (node.unclosed ? "" : "*/"); + } else if (type === "div") { + return (node.before || "") + value + (node.after || ""); + } else if (Array.isArray(node.nodes)) { + buf = stringify$1(node.nodes, custom); + if (type !== "function") { + return buf; + } + return ( + value + + "(" + + (node.before || "") + + buf + + (node.after || "") + + (node.unclosed ? "" : ")") + ); + } + return value; +} + +function stringify$1(nodes, custom) { + var result, i; + + if (Array.isArray(nodes)) { + result = ""; + for (i = nodes.length - 1; ~i; i -= 1) { + result = stringifyNode(nodes[i], custom) + result; + } + return result; + } + return stringifyNode(nodes, custom); +} + +var stringify_1 = stringify$1; + +var unit; +var hasRequiredUnit; + +function requireUnit () { + if (hasRequiredUnit) return unit; + hasRequiredUnit = 1; + var minus = "-".charCodeAt(0); + var plus = "+".charCodeAt(0); + var dot = ".".charCodeAt(0); + var exp = "e".charCodeAt(0); + var EXP = "E".charCodeAt(0); + + // Check if three code points would start a number + // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number + function likeNumber(value) { + var code = value.charCodeAt(0); + var nextCode; + + if (code === plus || code === minus) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + var nextNextCode = value.charCodeAt(2); + + if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { + return true; + } + + return false; + } + + if (code === dot) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + return false; + } + + if (code >= 48 && code <= 57) { + return true; + } + + return false; + } + + // Consume a number + // https://www.w3.org/TR/css-syntax-3/#consume-number + unit = function(value) { + var pos = 0; + var length = value.length; + var code; + var nextCode; + var nextNextCode; + + if (length === 0 || !likeNumber(value)) { + return false; + } + + code = value.charCodeAt(pos); + + if (code === plus || code === minus) { + pos++; + } + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + + if (code === dot && nextCode >= 48 && nextCode <= 57) { + pos += 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + nextNextCode = value.charCodeAt(pos + 2); + + if ( + (code === exp || code === EXP) && + ((nextCode >= 48 && nextCode <= 57) || + ((nextCode === plus || nextCode === minus) && + nextNextCode >= 48 && + nextNextCode <= 57)) + ) { + pos += nextCode === plus || nextCode === minus ? 3 : 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + return { + number: value.slice(0, pos), + unit: value.slice(pos) + }; + }; + return unit; +} + +var parse = parse$1; +var walk = walk$1; +var stringify = stringify_1; + +function ValueParser(value) { + if (this instanceof ValueParser) { + this.nodes = parse(value); + return this; + } + return new ValueParser(value); +} + +ValueParser.prototype.toString = function() { + return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; +}; + +ValueParser.prototype.walk = function(cb, bubble) { + walk(this.nodes, cb, bubble); + return this; +}; + +ValueParser.unit = requireUnit(); + +ValueParser.walk = walk; + +ValueParser.stringify = stringify; + +var lib = ValueParser; + +export { lib as l }; diff --git a/seller_1/node_modules/vite/dist/node/chunks/dep-BiVmWRQp.js b/seller_1/node_modules/vite/dist/node/chunks/dep-BiVmWRQp.js new file mode 100644 index 0000000..02b04c7 --- /dev/null +++ b/seller_1/node_modules/vite/dist/node/chunks/dep-BiVmWRQp.js @@ -0,0 +1,7002 @@ +import { O as commonjsGlobal, N as getDefaultExportFromCjs } from './dep-yUJfKD1i.js'; +import require$$0$2 from 'fs'; +import require$$0 from 'postcss'; +import require$$0$1 from 'path'; +import require$$3 from 'crypto'; +import require$$1 from 'util'; +import { l as lib } from './dep-3RmXg9uo.js'; + +function _mergeNamespaces(n, m) { + for (var i = 0; i < m.length; i++) { + var e = m[i]; + if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) { + if (k !== 'default' && !(k in n)) { + n[k] = e[k]; + } + } } + } + return n; +} + +var build = {exports: {}}; + +var fs = {}; + +Object.defineProperty(fs, "__esModule", { + value: true +}); +fs.getFileSystem = getFileSystem; +fs.setFileSystem = setFileSystem; +let fileSystem = { + readFile: () => { + throw Error("readFile not implemented"); + }, + writeFile: () => { + throw Error("writeFile not implemented"); + } +}; + +function setFileSystem(fs) { + fileSystem.readFile = fs.readFile; + fileSystem.writeFile = fs.writeFile; +} + +function getFileSystem() { + return fileSystem; +} + +var pluginFactory = {}; + +var unquote$1 = {}; + +Object.defineProperty(unquote$1, "__esModule", { + value: true +}); +unquote$1.default = unquote; +// copied from https://github.com/lakenen/node-unquote +const reg = /['"]/; + +function unquote(str) { + if (!str) { + return ""; + } + + if (reg.test(str.charAt(0))) { + str = str.substr(1); + } + + if (reg.test(str.charAt(str.length - 1))) { + str = str.substr(0, str.length - 1); + } + + return str; +} + +var Parser$1 = {}; + +const matchValueName = /[$]?[\w-]+/g; + +const replaceValueSymbols$2 = (value, replacements) => { + let matches; + + while ((matches = matchValueName.exec(value))) { + const replacement = replacements[matches[0]]; + + if (replacement) { + value = + value.slice(0, matches.index) + + replacement + + value.slice(matchValueName.lastIndex); + + matchValueName.lastIndex -= matches[0].length - replacement.length; + } + } + + return value; +}; + +var replaceValueSymbols_1 = replaceValueSymbols$2; + +const replaceValueSymbols$1 = replaceValueSymbols_1; + +const replaceSymbols$1 = (css, replacements) => { + css.walk((node) => { + if (node.type === "decl" && node.value) { + node.value = replaceValueSymbols$1(node.value.toString(), replacements); + } else if (node.type === "rule" && node.selector) { + node.selector = replaceValueSymbols$1( + node.selector.toString(), + replacements + ); + } else if (node.type === "atrule" && node.params) { + node.params = replaceValueSymbols$1(node.params.toString(), replacements); + } + }); +}; + +var replaceSymbols_1 = replaceSymbols$1; + +const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/; +const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/; + +const getDeclsObject = (rule) => { + const object = {}; + + rule.walkDecls((decl) => { + const before = decl.raws.before ? decl.raws.before.trim() : ""; + + object[before + decl.prop] = decl.value; + }); + + return object; +}; +/** + * + * @param {string} css + * @param {boolean} removeRules + * @param {'auto' | 'rule' | 'at-rule'} mode + */ +const extractICSS$2 = (css, removeRules = true, mode = "auto") => { + const icssImports = {}; + const icssExports = {}; + + function addImports(node, path) { + const unquoted = path.replace(/'|"/g, ""); + icssImports[unquoted] = Object.assign( + icssImports[unquoted] || {}, + getDeclsObject(node) + ); + + if (removeRules) { + node.remove(); + } + } + + function addExports(node) { + Object.assign(icssExports, getDeclsObject(node)); + if (removeRules) { + node.remove(); + } + } + + css.each((node) => { + if (node.type === "rule" && mode !== "at-rule") { + if (node.selector.slice(0, 7) === ":import") { + const matches = importPattern.exec(node.selector); + + if (matches) { + addImports(node, matches[1]); + } + } + + if (node.selector === ":export") { + addExports(node); + } + } + + if (node.type === "atrule" && mode !== "rule") { + if (node.name === "icss-import") { + const matches = balancedQuotes.exec(node.params); + + if (matches) { + addImports(node, matches[1]); + } + } + if (node.name === "icss-export") { + addExports(node); + } + } + }); + + return { icssImports, icssExports }; +}; + +var extractICSS_1 = extractICSS$2; + +const createImports = (imports, postcss, mode = "rule") => { + return Object.keys(imports).map((path) => { + const aliases = imports[path]; + const declarations = Object.keys(aliases).map((key) => + postcss.decl({ + prop: key, + value: aliases[key], + raws: { before: "\n " }, + }) + ); + + const hasDeclarations = declarations.length > 0; + + const rule = + mode === "rule" + ? postcss.rule({ + selector: `:import('${path}')`, + raws: { after: hasDeclarations ? "\n" : "" }, + }) + : postcss.atRule({ + name: "icss-import", + params: `'${path}'`, + raws: { after: hasDeclarations ? "\n" : "" }, + }); + + if (hasDeclarations) { + rule.append(declarations); + } + + return rule; + }); +}; + +const createExports = (exports, postcss, mode = "rule") => { + const declarations = Object.keys(exports).map((key) => + postcss.decl({ + prop: key, + value: exports[key], + raws: { before: "\n " }, + }) + ); + + if (declarations.length === 0) { + return []; + } + const rule = + mode === "rule" + ? postcss.rule({ + selector: `:export`, + raws: { after: "\n" }, + }) + : postcss.atRule({ + name: "icss-export", + raws: { after: "\n" }, + }); + + rule.append(declarations); + + return [rule]; +}; + +const createICSSRules$1 = (imports, exports, postcss, mode) => [ + ...createImports(imports, postcss, mode), + ...createExports(exports, postcss, mode), +]; + +var createICSSRules_1 = createICSSRules$1; + +const replaceValueSymbols = replaceValueSymbols_1; +const replaceSymbols = replaceSymbols_1; +const extractICSS$1 = extractICSS_1; +const createICSSRules = createICSSRules_1; + +var src$4 = { + replaceValueSymbols, + replaceSymbols, + extractICSS: extractICSS$1, + createICSSRules, +}; + +Object.defineProperty(Parser$1, "__esModule", { + value: true +}); +Parser$1.default = void 0; + +var _icssUtils = src$4; + +// Initially copied from https://github.com/css-modules/css-modules-loader-core +const importRegexp = /^:import\((.+)\)$/; + +class Parser { + constructor(pathFetcher, trace) { + this.pathFetcher = pathFetcher; + this.plugin = this.plugin.bind(this); + this.exportTokens = {}; + this.translations = {}; + this.trace = trace; + } + + plugin() { + const parser = this; + return { + postcssPlugin: "css-modules-parser", + + async OnceExit(css) { + await Promise.all(parser.fetchAllImports(css)); + parser.linkImportedSymbols(css); + return parser.extractExports(css); + } + + }; + } + + fetchAllImports(css) { + let imports = []; + css.each(node => { + if (node.type == "rule" && node.selector.match(importRegexp)) { + imports.push(this.fetchImport(node, css.source.input.from, imports.length)); + } + }); + return imports; + } + + linkImportedSymbols(css) { + (0, _icssUtils.replaceSymbols)(css, this.translations); + } + + extractExports(css) { + css.each(node => { + if (node.type == "rule" && node.selector == ":export") this.handleExport(node); + }); + } + + handleExport(exportNode) { + exportNode.each(decl => { + if (decl.type == "decl") { + Object.keys(this.translations).forEach(translation => { + decl.value = decl.value.replace(translation, this.translations[translation]); + }); + this.exportTokens[decl.prop] = decl.value; + } + }); + exportNode.remove(); + } + + async fetchImport(importNode, relativeTo, depNr) { + const file = importNode.selector.match(importRegexp)[1]; + const depTrace = this.trace + String.fromCharCode(depNr); + const exports = await this.pathFetcher(file, relativeTo, depTrace); + + try { + importNode.each(decl => { + if (decl.type == "decl") { + this.translations[decl.prop] = exports[decl.value]; + } + }); + importNode.remove(); + } catch (err) { + console.log(err); + } + } + +} + +Parser$1.default = Parser; + +var saveJSON$1 = {}; + +Object.defineProperty(saveJSON$1, "__esModule", { + value: true +}); +saveJSON$1.default = saveJSON; + +var _fs$2 = fs; + +function saveJSON(cssFile, json) { + return new Promise((resolve, reject) => { + const { + writeFile + } = (0, _fs$2.getFileSystem)(); + writeFile(`${cssFile}.json`, JSON.stringify(json), e => e ? reject(e) : resolve(json)); + }); +} + +var localsConvention = {}; + +/** + * lodash (Custom Build) <https://lodash.com/> + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors <https://jquery.org/> + * Released under MIT license <https://lodash.com/license> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, + rsUpper + '+' + rsOptUpperContr, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 'ss' +}; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root$2 = freeGlobal || freeSelf || Function('return this')(); + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol$1 = root$2.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +/** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ +var upperFirst = createCaseFirst('toUpperCase'); + +/** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ +function words(string, pattern, guard) { + string = toString(string); + pattern = pattern; + + if (pattern === undefined) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; +} + +var lodash_camelcase = camelCase; + +Object.defineProperty(localsConvention, "__esModule", { + value: true +}); +localsConvention.makeLocalsConventionReducer = makeLocalsConventionReducer; + +var _lodash = _interopRequireDefault$5(lodash_camelcase); + +function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function dashesCamelCase(string) { + return string.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase()); +} + +function makeLocalsConventionReducer(localsConvention, inputFile) { + const isFunc = typeof localsConvention === "function"; + return (tokens, [className, value]) => { + if (isFunc) { + const convention = localsConvention(className, value, inputFile); + tokens[convention] = value; + return tokens; + } + + switch (localsConvention) { + case "camelCase": + tokens[className] = value; + tokens[(0, _lodash.default)(className)] = value; + break; + + case "camelCaseOnly": + tokens[(0, _lodash.default)(className)] = value; + break; + + case "dashes": + tokens[className] = value; + tokens[dashesCamelCase(className)] = value; + break; + + case "dashesOnly": + tokens[dashesCamelCase(className)] = value; + break; + } + + return tokens; + }; +} + +var FileSystemLoader$1 = {}; + +Object.defineProperty(FileSystemLoader$1, "__esModule", { + value: true +}); +FileSystemLoader$1.default = void 0; + +var _postcss$1 = _interopRequireDefault$4(require$$0); + +var _path = _interopRequireDefault$4(require$$0$1); + +var _Parser$1 = _interopRequireDefault$4(Parser$1); + +var _fs$1 = fs; + +function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Initially copied from https://github.com/css-modules/css-modules-loader-core +class Core { + constructor(plugins) { + this.plugins = plugins || Core.defaultPlugins; + } + + async load(sourceString, sourcePath, trace, pathFetcher) { + const parser = new _Parser$1.default(pathFetcher, trace); + const plugins = this.plugins.concat([parser.plugin()]); + const result = await (0, _postcss$1.default)(plugins).process(sourceString, { + from: sourcePath + }); + return { + injectableSource: result.css, + exportTokens: parser.exportTokens + }; + } + +} // Sorts dependencies in the following way: +// AAA comes before AA and A +// AB comes after AA and before A +// All Bs come after all As +// This ensures that the files are always returned in the following order: +// - In the order they were required, except +// - After all their dependencies + + +const traceKeySorter = (a, b) => { + if (a.length < b.length) { + return a < b.substring(0, a.length) ? -1 : 1; + } + + if (a.length > b.length) { + return a.substring(0, b.length) <= b ? -1 : 1; + } + + return a < b ? -1 : 1; +}; + +class FileSystemLoader { + constructor(root, plugins, fileResolve) { + if (root === "/" && process.platform === "win32") { + const cwdDrive = process.cwd().slice(0, 3); + + if (!/^[A-Za-z]:\\$/.test(cwdDrive)) { + throw new Error(`Failed to obtain root from "${process.cwd()}".`); + } + + root = cwdDrive; + } + + this.root = root; + this.fileResolve = fileResolve; + this.sources = {}; + this.traces = {}; + this.importNr = 0; + this.core = new Core(plugins); + this.tokensByFile = {}; + this.fs = (0, _fs$1.getFileSystem)(); + } + + async fetch(_newPath, relativeTo, _trace) { + const newPath = _newPath.replace(/^["']|["']$/g, ""); + + const trace = _trace || String.fromCharCode(this.importNr++); + + const useFileResolve = typeof this.fileResolve === "function"; + const fileResolvedPath = useFileResolve ? await this.fileResolve(newPath, relativeTo) : await Promise.resolve(); + + if (fileResolvedPath && !_path.default.isAbsolute(fileResolvedPath)) { + throw new Error('The returned path from the "fileResolve" option must be absolute.'); + } + + const relativeDir = _path.default.dirname(relativeTo); + + const rootRelativePath = fileResolvedPath || _path.default.resolve(relativeDir, newPath); + + let fileRelativePath = fileResolvedPath || _path.default.resolve(_path.default.resolve(this.root, relativeDir), newPath); // if the path is not relative or absolute, try to resolve it in node_modules + + + if (!useFileResolve && newPath[0] !== "." && !_path.default.isAbsolute(newPath)) { + try { + fileRelativePath = require.resolve(newPath); + } catch (e) {// noop + } + } + + const tokens = this.tokensByFile[fileRelativePath]; + if (tokens) return tokens; + return new Promise((resolve, reject) => { + this.fs.readFile(fileRelativePath, "utf-8", async (err, source) => { + if (err) reject(err); + const { + injectableSource, + exportTokens + } = await this.core.load(source, rootRelativePath, trace, this.fetch.bind(this)); + this.sources[fileRelativePath] = injectableSource; + this.traces[trace] = fileRelativePath; + this.tokensByFile[fileRelativePath] = exportTokens; + resolve(exportTokens); + }); + }); + } + + get finalSource() { + const traces = this.traces; + const sources = this.sources; + let written = new Set(); + return Object.keys(traces).sort(traceKeySorter).map(key => { + const filename = traces[key]; + + if (written.has(filename)) { + return null; + } + + written.add(filename); + return sources[filename]; + }).join(""); + } + +} + +FileSystemLoader$1.default = FileSystemLoader; + +var scoping = {}; + +var src$3 = {exports: {}}; + +const PERMANENT_MARKER = 2; +const TEMPORARY_MARKER = 1; + +function createError(node, graph) { + const er = new Error("Nondeterministic import's order"); + + const related = graph[node]; + const relatedNode = related.find( + (relatedNode) => graph[relatedNode].indexOf(node) > -1 + ); + + er.nodes = [node, relatedNode]; + + return er; +} + +function walkGraph(node, graph, state, result, strict) { + if (state[node] === PERMANENT_MARKER) { + return; + } + + if (state[node] === TEMPORARY_MARKER) { + if (strict) { + return createError(node, graph); + } + + return; + } + + state[node] = TEMPORARY_MARKER; + + const children = graph[node]; + const length = children.length; + + for (let i = 0; i < length; ++i) { + const error = walkGraph(children[i], graph, state, result, strict); + + if (error instanceof Error) { + return error; + } + } + + state[node] = PERMANENT_MARKER; + + result.push(node); +} + +function topologicalSort$1(graph, strict) { + const result = []; + const state = {}; + + const nodes = Object.keys(graph); + const length = nodes.length; + + for (let i = 0; i < length; ++i) { + const er = walkGraph(nodes[i], graph, state, result, strict); + + if (er instanceof Error) { + return er; + } + } + + return result; +} + +var topologicalSort_1 = topologicalSort$1; + +const topologicalSort = topologicalSort_1; + +const matchImports$1 = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/; +const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/; + +const VISITED_MARKER = 1; + +/** + * :import('G') {} + * + * Rule + * composes: ... from 'A' + * composes: ... from 'B' + + * Rule + * composes: ... from 'A' + * composes: ... from 'A' + * composes: ... from 'C' + * + * Results in: + * + * graph: { + * G: [], + * A: [], + * B: ['A'], + * C: ['A'], + * } + */ +function addImportToGraph(importId, parentId, graph, visited) { + const siblingsId = parentId + "_" + "siblings"; + const visitedId = parentId + "_" + importId; + + if (visited[visitedId] !== VISITED_MARKER) { + if (!Array.isArray(visited[siblingsId])) { + visited[siblingsId] = []; + } + + const siblings = visited[siblingsId]; + + if (Array.isArray(graph[importId])) { + graph[importId] = graph[importId].concat(siblings); + } else { + graph[importId] = siblings.slice(); + } + + visited[visitedId] = VISITED_MARKER; + + siblings.push(importId); + } +} + +src$3.exports = (options = {}) => { + let importIndex = 0; + const createImportedName = + typeof options.createImportedName !== "function" + ? (importName /*, path*/) => + `i__imported_${importName.replace(/\W/g, "_")}_${importIndex++}` + : options.createImportedName; + const failOnWrongOrder = options.failOnWrongOrder; + + return { + postcssPlugin: "postcss-modules-extract-imports", + prepare() { + const graph = {}; + const visited = {}; + const existingImports = {}; + const importDecls = {}; + const imports = {}; + + return { + Once(root, postcss) { + // Check the existing imports order and save refs + root.walkRules((rule) => { + const matches = icssImport.exec(rule.selector); + + if (matches) { + const [, /*match*/ doubleQuotePath, singleQuotePath] = matches; + const importPath = doubleQuotePath || singleQuotePath; + + addImportToGraph(importPath, "root", graph, visited); + + existingImports[importPath] = rule; + } + }); + + root.walkDecls(/^composes$/, (declaration) => { + const multiple = declaration.value.split(","); + const values = []; + + multiple.forEach((value) => { + const matches = value.trim().match(matchImports$1); + + if (!matches) { + values.push(value); + + return; + } + + let tmpSymbols; + let [ + , + /*match*/ symbols, + doubleQuotePath, + singleQuotePath, + global, + ] = matches; + + if (global) { + // Composing globals simply means changing these classes to wrap them in global(name) + tmpSymbols = symbols.split(/\s+/).map((s) => `global(${s})`); + } else { + const importPath = doubleQuotePath || singleQuotePath; + + let parent = declaration.parent; + let parentIndexes = ""; + + while (parent.type !== "root") { + parentIndexes = + parent.parent.index(parent) + "_" + parentIndexes; + parent = parent.parent; + } + + const { selector } = declaration.parent; + const parentRule = `_${parentIndexes}${selector}`; + + addImportToGraph(importPath, parentRule, graph, visited); + + importDecls[importPath] = declaration; + imports[importPath] = imports[importPath] || {}; + + tmpSymbols = symbols.split(/\s+/).map((s) => { + if (!imports[importPath][s]) { + imports[importPath][s] = createImportedName(s, importPath); + } + + return imports[importPath][s]; + }); + } + + values.push(tmpSymbols.join(" ")); + }); + + declaration.value = values.join(", "); + }); + + const importsOrder = topologicalSort(graph, failOnWrongOrder); + + if (importsOrder instanceof Error) { + const importPath = importsOrder.nodes.find((importPath) => + // eslint-disable-next-line no-prototype-builtins + importDecls.hasOwnProperty(importPath) + ); + const decl = importDecls[importPath]; + + throw decl.error( + "Failed to resolve order of composed modules " + + importsOrder.nodes + .map((importPath) => "`" + importPath + "`") + .join(", ") + + ".", + { + plugin: "postcss-modules-extract-imports", + word: "composes", + } + ); + } + + let lastImportRule; + + importsOrder.forEach((path) => { + const importedSymbols = imports[path]; + let rule = existingImports[path]; + + if (!rule && importedSymbols) { + rule = postcss.rule({ + selector: `:import("${path}")`, + raws: { after: "\n" }, + }); + + if (lastImportRule) { + root.insertAfter(lastImportRule, rule); + } else { + root.prepend(rule); + } + } + + lastImportRule = rule; + + if (!importedSymbols) { + return; + } + + Object.keys(importedSymbols).forEach((importedSymbol) => { + rule.append( + postcss.decl({ + value: importedSymbol, + prop: importedSymbols[importedSymbol], + raws: { before: "\n " }, + }) + ); + }); + }); + }, + }; + }, + }; +}; + +src$3.exports.postcss = true; + +var srcExports$2 = src$3.exports; + +var wasmHash = {exports: {}}; + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var hasRequiredWasmHash; + +function requireWasmHash () { + if (hasRequiredWasmHash) return wasmHash.exports; + hasRequiredWasmHash = 1; + + // 65536 is the size of a wasm memory page + // 64 is the maximum chunk size for every possible wasm hash implementation + // 4 is the maximum number of bytes per char for string encoding (max is utf-8) + // ~3 makes sure that it's always a block of 4 chars, so avoid partially encoded bytes for base64 + const MAX_SHORT_STRING = Math.floor((65536 - 64) / 4) & ~3; + + class WasmHash { + /** + * @param {WebAssembly.Instance} instance wasm instance + * @param {WebAssembly.Instance[]} instancesPool pool of instances + * @param {number} chunkSize size of data chunks passed to wasm + * @param {number} digestSize size of digest returned by wasm + */ + constructor(instance, instancesPool, chunkSize, digestSize) { + const exports = /** @type {any} */ (instance.exports); + + exports.init(); + + this.exports = exports; + this.mem = Buffer.from(exports.memory.buffer, 0, 65536); + this.buffered = 0; + this.instancesPool = instancesPool; + this.chunkSize = chunkSize; + this.digestSize = digestSize; + } + + reset() { + this.buffered = 0; + this.exports.init(); + } + + /** + * @param {Buffer | string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {this} itself + */ + update(data, encoding) { + if (typeof data === "string") { + while (data.length > MAX_SHORT_STRING) { + this._updateWithShortString(data.slice(0, MAX_SHORT_STRING), encoding); + data = data.slice(MAX_SHORT_STRING); + } + + this._updateWithShortString(data, encoding); + + return this; + } + + this._updateWithBuffer(data); + + return this; + } + + /** + * @param {string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {void} + */ + _updateWithShortString(data, encoding) { + const { exports, buffered, mem, chunkSize } = this; + + let endPos; + + if (data.length < 70) { + if (!encoding || encoding === "utf-8" || encoding === "utf8") { + endPos = buffered; + for (let i = 0; i < data.length; i++) { + const cc = data.charCodeAt(i); + + if (cc < 0x80) { + mem[endPos++] = cc; + } else if (cc < 0x800) { + mem[endPos] = (cc >> 6) | 0xc0; + mem[endPos + 1] = (cc & 0x3f) | 0x80; + endPos += 2; + } else { + // bail-out for weird chars + endPos += mem.write(data.slice(i), endPos, encoding); + break; + } + } + } else if (encoding === "latin1") { + endPos = buffered; + + for (let i = 0; i < data.length; i++) { + const cc = data.charCodeAt(i); + + mem[endPos++] = cc; + } + } else { + endPos = buffered + mem.write(data, buffered, encoding); + } + } else { + endPos = buffered + mem.write(data, buffered, encoding); + } + + if (endPos < chunkSize) { + this.buffered = endPos; + } else { + const l = endPos & ~(this.chunkSize - 1); + + exports.update(l); + + const newBuffered = endPos - l; + + this.buffered = newBuffered; + + if (newBuffered > 0) { + mem.copyWithin(0, l, endPos); + } + } + } + + /** + * @param {Buffer} data data + * @returns {void} + */ + _updateWithBuffer(data) { + const { exports, buffered, mem } = this; + const length = data.length; + + if (buffered + length < this.chunkSize) { + data.copy(mem, buffered, 0, length); + + this.buffered += length; + } else { + const l = (buffered + length) & ~(this.chunkSize - 1); + + if (l > 65536) { + let i = 65536 - buffered; + + data.copy(mem, buffered, 0, i); + exports.update(65536); + + const stop = l - buffered - 65536; + + while (i < stop) { + data.copy(mem, 0, i, i + 65536); + exports.update(65536); + i += 65536; + } + + data.copy(mem, 0, i, l - buffered); + + exports.update(l - buffered - i); + } else { + data.copy(mem, buffered, 0, l - buffered); + + exports.update(l); + } + + const newBuffered = length + buffered - l; + + this.buffered = newBuffered; + + if (newBuffered > 0) { + data.copy(mem, 0, length - newBuffered, length); + } + } + } + + digest(type) { + const { exports, buffered, mem, digestSize } = this; + + exports.final(buffered); + + this.instancesPool.push(this); + + const hex = mem.toString("latin1", 0, digestSize); + + if (type === "hex") { + return hex; + } + + if (type === "binary" || !type) { + return Buffer.from(hex, "hex"); + } + + return Buffer.from(hex, "hex").toString(type); + } + } + + const create = (wasmModule, instancesPool, chunkSize, digestSize) => { + if (instancesPool.length > 0) { + const old = instancesPool.pop(); + + old.reset(); + + return old; + } else { + return new WasmHash( + new WebAssembly.Instance(wasmModule), + instancesPool, + chunkSize, + digestSize + ); + } + }; + + wasmHash.exports = create; + wasmHash.exports.MAX_SHORT_STRING = MAX_SHORT_STRING; + return wasmHash.exports; +} + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var xxhash64_1; +var hasRequiredXxhash64; + +function requireXxhash64 () { + if (hasRequiredXxhash64) return xxhash64_1; + hasRequiredXxhash64 = 1; + + const create = requireWasmHash(); + + //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1 + const xxhash64 = new WebAssembly.Module( + Buffer.from( + // 1173 bytes + "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmL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AJCsODAgYOGjJgwhHw3AwAL", + "base64" + ) + ); + //#endregion + + xxhash64_1 = create.bind(null, xxhash64, [], 32, 16); + return xxhash64_1; +} + +var BatchedHash_1; +var hasRequiredBatchedHash; + +function requireBatchedHash () { + if (hasRequiredBatchedHash) return BatchedHash_1; + hasRequiredBatchedHash = 1; + const MAX_SHORT_STRING = requireWasmHash().MAX_SHORT_STRING; + + class BatchedHash { + constructor(hash) { + this.string = undefined; + this.encoding = undefined; + this.hash = hash; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if (this.string !== undefined) { + if ( + typeof data === "string" && + inputEncoding === this.encoding && + this.string.length + data.length < MAX_SHORT_STRING + ) { + this.string += data; + + return this; + } + + this.hash.update(this.string, this.encoding); + this.string = undefined; + } + + if (typeof data === "string") { + if ( + data.length < MAX_SHORT_STRING && + // base64 encoding is not valid since it may contain padding chars + (!inputEncoding || !inputEncoding.startsWith("ba")) + ) { + this.string = data; + this.encoding = inputEncoding; + } else { + this.hash.update(data, inputEncoding); + } + } else { + this.hash.update(data); + } + + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + if (this.string !== undefined) { + this.hash.update(this.string, this.encoding); + } + + return this.hash.digest(encoding); + } + } + + BatchedHash_1 = BatchedHash; + return BatchedHash_1; +} + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var md4_1; +var hasRequiredMd4; + +function requireMd4 () { + if (hasRequiredMd4) return md4_1; + hasRequiredMd4 = 1; + + const create = requireWasmHash(); + + //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1 + const md4 = new WebAssembly.Module( + Buffer.from( + // 2150 bytes + "AGFzbQEAAAABCAJgAX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DWpBmfOJ1AVqQQN3IgIgASADcnEgASADcXJqakGZ84nUBWpBBXciBCABIAJycSABIAJxcmpqQZnzidQFakEJdyIDIBEgBCAOIAIgFiABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmpqQZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", + "base64" + ) + ); + //#endregion + + md4_1 = create.bind(null, md4, [], 64, 32); + return md4_1; +} + +var BulkUpdateDecorator_1; +var hasRequiredBulkUpdateDecorator; + +function requireBulkUpdateDecorator () { + if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1; + hasRequiredBulkUpdateDecorator = 1; + const BULK_SIZE = 2000; + + // We are using an object instead of a Map as this will stay static during the runtime + // so access to it can be optimized by v8 + const digestCaches = {}; + + class BulkUpdateDecorator { + /** + * @param {Hash | function(): Hash} hashOrFactory function to create a hash + * @param {string=} hashKey key for caching + */ + constructor(hashOrFactory, hashKey) { + this.hashKey = hashKey; + + if (typeof hashOrFactory === "function") { + this.hashFactory = hashOrFactory; + this.hash = undefined; + } else { + this.hashFactory = undefined; + this.hash = hashOrFactory; + } + + this.buffer = ""; + } + + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if ( + inputEncoding !== undefined || + typeof data !== "string" || + data.length > BULK_SIZE + ) { + if (this.hash === undefined) { + this.hash = this.hashFactory(); + } + + if (this.buffer.length > 0) { + this.hash.update(this.buffer); + this.buffer = ""; + } + + this.hash.update(data, inputEncoding); + } else { + this.buffer += data; + + if (this.buffer.length > BULK_SIZE) { + if (this.hash === undefined) { + this.hash = this.hashFactory(); + } + + this.hash.update(this.buffer); + this.buffer = ""; + } + } + + return this; + } + + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + let digestCache; + + const buffer = this.buffer; + + if (this.hash === undefined) { + // short data for hash, we can use caching + const cacheKey = `${this.hashKey}-${encoding}`; + + digestCache = digestCaches[cacheKey]; + + if (digestCache === undefined) { + digestCache = digestCaches[cacheKey] = new Map(); + } + + const cacheEntry = digestCache.get(buffer); + + if (cacheEntry !== undefined) { + return cacheEntry; + } + + this.hash = this.hashFactory(); + } + + if (buffer.length > 0) { + this.hash.update(buffer); + } + + const digestResult = this.hash.digest(encoding); + + if (digestCache !== undefined) { + digestCache.set(buffer, digestResult); + } + + return digestResult; + } + } + + BulkUpdateDecorator_1 = BulkUpdateDecorator; + return BulkUpdateDecorator_1; +} + +const baseEncodeTables = { + 26: "abcdefghijklmnopqrstuvwxyz", + 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio + 36: "0123456789abcdefghijklmnopqrstuvwxyz", + 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO + 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO + 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_", +}; + +/** + * @param {Uint32Array} uint32Array Treated as a long base-0x100000000 number, little endian + * @param {number} divisor The divisor + * @return {number} Modulo (remainder) of the division + */ +function divmod32(uint32Array, divisor) { + let carry = 0; + for (let i = uint32Array.length - 1; i >= 0; i--) { + const value = carry * 0x100000000 + uint32Array[i]; + carry = value % divisor; + uint32Array[i] = Math.floor(value / divisor); + } + return carry; +} + +function encodeBufferToBase(buffer, base, length) { + const encodeTable = baseEncodeTables[base]; + + if (!encodeTable) { + throw new Error("Unknown encoding base" + base); + } + + // Input bits are only enough to generate this many characters + const limit = Math.ceil((buffer.length * 8) / Math.log2(base)); + length = Math.min(length, limit); + + // Most of the crypto digests (if not all) has length a multiple of 4 bytes. + // Fewer numbers in the array means faster math. + const uint32Array = new Uint32Array(Math.ceil(buffer.length / 4)); + + // Make sure the input buffer data is copied and is not mutated by reference. + // divmod32() would corrupt the BulkUpdateDecorator cache otherwise. + buffer.copy(Buffer.from(uint32Array.buffer)); + + let output = ""; + + for (let i = 0; i < length; i++) { + output = encodeTable[divmod32(uint32Array, base)] + output; + } + + return output; +} + +let crypto = undefined; +let createXXHash64 = undefined; +let createMd4 = undefined; +let BatchedHash = undefined; +let BulkUpdateDecorator = undefined; + +function getHashDigest$1(buffer, algorithm, digestType, maxLength) { + algorithm = algorithm || "xxhash64"; + maxLength = maxLength || 9999; + + let hash; + + if (algorithm === "xxhash64") { + if (createXXHash64 === undefined) { + createXXHash64 = requireXxhash64(); + + if (BatchedHash === undefined) { + BatchedHash = requireBatchedHash(); + } + } + + hash = new BatchedHash(createXXHash64()); + } else if (algorithm === "md4") { + if (createMd4 === undefined) { + createMd4 = requireMd4(); + + if (BatchedHash === undefined) { + BatchedHash = requireBatchedHash(); + } + } + + hash = new BatchedHash(createMd4()); + } else if (algorithm === "native-md4") { + if (typeof crypto === "undefined") { + crypto = require$$3; + + if (BulkUpdateDecorator === undefined) { + BulkUpdateDecorator = requireBulkUpdateDecorator(); + } + } + + hash = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4"); + } else { + if (typeof crypto === "undefined") { + crypto = require$$3; + + if (BulkUpdateDecorator === undefined) { + BulkUpdateDecorator = requireBulkUpdateDecorator(); + } + } + + hash = new BulkUpdateDecorator( + () => crypto.createHash(algorithm), + algorithm + ); + } + + hash.update(buffer); + + if ( + digestType === "base26" || + digestType === "base32" || + digestType === "base36" || + digestType === "base49" || + digestType === "base52" || + digestType === "base58" || + digestType === "base62" || + digestType === "base64safe" + ) { + return encodeBufferToBase( + hash.digest(), + digestType === "base64safe" ? 64 : digestType.substr(4), + maxLength + ); + } + + return hash.digest(digestType || "hex").substr(0, maxLength); +} + +var getHashDigest_1 = getHashDigest$1; + +const path$1 = require$$0$1; +const getHashDigest = getHashDigest_1; + +function interpolateName$1(loaderContext, name, options = {}) { + let filename; + + const hasQuery = + loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1; + + if (typeof name === "function") { + filename = name( + loaderContext.resourcePath, + hasQuery ? loaderContext.resourceQuery : undefined + ); + } else { + filename = name || "[hash].[ext]"; + } + + const context = options.context; + const content = options.content; + const regExp = options.regExp; + + let ext = "bin"; + let basename = "file"; + let directory = ""; + let folder = ""; + let query = ""; + + if (loaderContext.resourcePath) { + const parsed = path$1.parse(loaderContext.resourcePath); + let resourcePath = loaderContext.resourcePath; + + if (parsed.ext) { + ext = parsed.ext.substr(1); + } + + if (parsed.dir) { + basename = parsed.name; + resourcePath = parsed.dir + path$1.sep; + } + + if (typeof context !== "undefined") { + directory = path$1 + .relative(context, resourcePath + "_") + .replace(/\\/g, "/") + .replace(/\.\.(\/)?/g, "_$1"); + directory = directory.substr(0, directory.length - 1); + } else { + directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + } + + if (directory.length <= 1) { + directory = ""; + } else { + // directory.length > 1 + folder = path$1.basename(directory); + } + } + + if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) { + query = loaderContext.resourceQuery; + + const hashIdx = query.indexOf("#"); + + if (hashIdx >= 0) { + query = query.substr(0, hashIdx); + } + } + + let url = filename; + + if (content) { + // Match hash template + url = url + // `hash` and `contenthash` are same in `loader-utils` context + // let's keep `hash` for backward compatibility + .replace( + /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*(?:safe)?))?(?::(\d+))?\]/gi, + (all, hashType, digestType, maxLength) => + getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)) + ); + } + + url = url + .replace(/\[ext\]/gi, () => ext) + .replace(/\[name\]/gi, () => basename) + .replace(/\[path\]/gi, () => directory) + .replace(/\[folder\]/gi, () => folder) + .replace(/\[query\]/gi, () => query); + + if (regExp && loaderContext.resourcePath) { + const match = loaderContext.resourcePath.match(new RegExp(regExp)); + + match && + match.forEach((matched, i) => { + url = url.replace(new RegExp("\\[" + i + "\\]", "ig"), matched); + }); + } + + if ( + typeof loaderContext.options === "object" && + typeof loaderContext.options.customInterpolateName === "function" + ) { + url = loaderContext.options.customInterpolateName.call( + loaderContext, + url, + name, + options + ); + } + + return url; +} + +var interpolateName_1 = interpolateName$1; + +var interpolateName = interpolateName_1; +var path = require$$0$1; + +/** + * @param {string} pattern + * @param {object} options + * @param {string} options.context + * @param {string} options.hashPrefix + * @return {function} + */ +var genericNames = function createGenerator(pattern, options) { + options = options || {}; + var context = + options && typeof options.context === "string" + ? options.context + : process.cwd(); + var hashPrefix = + options && typeof options.hashPrefix === "string" ? options.hashPrefix : ""; + + /** + * @param {string} localName Usually a class name + * @param {string} filepath Absolute path + * @return {string} + */ + return function generate(localName, filepath) { + var name = pattern.replace(/\[local\]/gi, localName); + var loaderContext = { + resourcePath: filepath, + }; + + var loaderOptions = { + content: + hashPrefix + + path.relative(context, filepath).replace(/\\/g, "/") + + "\x00" + + localName, + context: context, + }; + + var genericName = interpolateName(loaderContext, name, loaderOptions); + return genericName + .replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-") + .replace(/^((-?[0-9])|--)/, "_$1"); + }; +}; + +var src$2 = {exports: {}}; + +var dist = {exports: {}}; + +var processor = {exports: {}}; + +var parser = {exports: {}}; + +var root$1 = {exports: {}}; + +var container = {exports: {}}; + +var node$1 = {exports: {}}; + +var util = {}; + +var unesc = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = unesc; + // Many thanks for this post which made this migration much easier. + // https://mathiasbynens.be/notes/css-escapes + + /** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ + function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); + // check to see if we are dealing with a valid hex char [a-f|0-9] + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + spaceTerminated = code === 32; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return undefined; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; + // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + + // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + + // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; + } + module.exports = exports.default; +} (unesc, unesc.exports)); + +var unescExports = unesc.exports; + +var getProp = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = getProp; + function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return undefined; + } + obj = obj[prop]; + } + return obj; + } + module.exports = exports.default; +} (getProp, getProp.exports)); + +var getPropExports = getProp.exports; + +var ensureObject = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = ensureObject; + function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } + } + module.exports = exports.default; +} (ensureObject, ensureObject.exports)); + +var ensureObjectExports = ensureObject.exports; + +var stripComments = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = stripComments; + function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; + } + module.exports = exports.default; +} (stripComments, stripComments.exports)); + +var stripCommentsExports = stripComments.exports; + +util.__esModule = true; +util.unesc = util.stripComments = util.getProp = util.ensureObject = void 0; +var _unesc = _interopRequireDefault$3(unescExports); +util.unesc = _unesc["default"]; +var _getProp = _interopRequireDefault$3(getPropExports); +util.getProp = _getProp["default"]; +var _ensureObject = _interopRequireDefault$3(ensureObjectExports); +util.ensureObject = _ensureObject["default"]; +var _stripComments = _interopRequireDefault$3(stripCommentsExports); +util.stripComments = _stripComments["default"]; +function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _util = util; + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + return cloned; + }; + var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + var _proto = Node.prototype; + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + this.raws[name] = valueEscaped; + } + + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + if (this.raws) { + delete this.raws[name]; + } + } + + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return undefined; + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node; + }(); + exports["default"] = Node; + module.exports = exports.default; +} (node$1, node$1.exports)); + +var nodeExports = node$1.exports; + +var types = {}; + +types.__esModule = true; +types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = void 0; +var TAG = 'tag'; +types.TAG = TAG; +var STRING = 'string'; +types.STRING = STRING; +var SELECTOR = 'selector'; +types.SELECTOR = SELECTOR; +var ROOT = 'root'; +types.ROOT = ROOT; +var PSEUDO = 'pseudo'; +types.PSEUDO = PSEUDO; +var NESTING = 'nesting'; +types.NESTING = NESTING; +var ID = 'id'; +types.ID = ID; +var COMMENT = 'comment'; +types.COMMENT = COMMENT; +var COMBINATOR = 'combinator'; +types.COMBINATOR = COMBINATOR; +var CLASS = 'class'; +types.CLASS = CLASS; +var ATTRIBUTE = 'attribute'; +types.ATTRIBUTE = ATTRIBUTE; +var UNIVERSAL = 'universal'; +types.UNIVERSAL = UNIVERSAL; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var types$1 = _interopRequireWildcard(types); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + function Container(opts) { + var _this; + _this = _Node.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + var _proto = Container.prototype; + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + return this; + }; + _proto.at = function at(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex <= index) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index <= oldIndex) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return undefined; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + if (result !== false && node.length) { + result = node.walk(callback); + } + if (result === false) { + return false; + } + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function (selector) { + if (selector.type === types$1.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function (selector) { + if (selector.type === types$1.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function (selector) { + if (selector.type === types$1.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function (selector) { + if (selector.type === types$1.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function (selector) { + if (selector.type === types$1.ID) { + return callback.call(_this6, selector); + } + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function (selector) { + if (selector.type === types$1.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function (selector) { + if (selector.type === types$1.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function (selector) { + if (selector.type === types$1.TAG) { + return callback.call(_this9, selector); + } + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function (selector) { + if (selector.type === types$1.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString() { + return this.map(String).join(''); + }; + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + return Container; + }(_node["default"]); + exports["default"] = Container; + module.exports = exports.default; +} (container, container.exports)); + +var containerExports = container.exports; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(containerExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + function Root(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + var _proto = Root.prototype; + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root; + }(_container["default"]); + exports["default"] = Root; + module.exports = exports.default; +} (root$1, root$1.exports)); + +var rootExports = root$1.exports; + +var selector$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(containerExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + function Selector(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + return Selector; + }(_container["default"]); + exports["default"] = Selector; + module.exports = exports.default; +} (selector$1, selector$1.exports)); + +var selectorExports = selector$1.exports; + +var className$1 = {exports: {}}; + +/*! https://mths.be/cssesc v3.0.0 by @mathias */ + +var object = {}; +var hasOwnProperty$1 = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty$1.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +var cssesc_1 = cssesc; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(cssesc_1); + var _util = util; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + function ClassName(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName.prototype; + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v; + } + }]); + return ClassName; + }(_node["default"]); + exports["default"] = ClassName; + module.exports = exports.default; +} (className$1, className$1.exports)); + +var classNameExports = className$1.exports; + +var comment$2 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + function Comment(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + return Comment; + }(_node["default"]); + exports["default"] = Comment; + module.exports = exports.default; +} (comment$2, comment$2.exports)); + +var commentExports = comment$2.exports; + +var id$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + function ID(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + var _proto = ID.prototype; + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + return ID; + }(_node["default"]); + exports["default"] = ID; + module.exports = exports.default; +} (id$1, id$1.exports)); + +var idExports = id$1.exports; + +var tag$1 = {exports: {}}; + +var namespace = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc = _interopRequireDefault(cssesc_1); + var _util = util; + var _node = _interopRequireDefault(nodeExports); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + function Namespace() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + return Namespace; + }(_node["default"]); + exports["default"] = Namespace; + module.exports = exports.default; +} (namespace, namespace.exports)); + +var namespaceExports = namespace.exports; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(namespaceExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + function Tag(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + return Tag; + }(_namespace["default"]); + exports["default"] = Tag; + module.exports = exports.default; +} (tag$1, tag$1.exports)); + +var tagExports = tag$1.exports; + +var string$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + function String(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + return String; + }(_node["default"]); + exports["default"] = String; + module.exports = exports.default; +} (string$1, string$1.exports)); + +var stringExports = string$1.exports; + +var pseudo$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault(containerExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + function Pseudo(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + var _proto = Pseudo.prototype; + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + return Pseudo; + }(_container["default"]); + exports["default"] = Pseudo; + module.exports = exports.default; +} (pseudo$1, pseudo$1.exports)); + +var pseudoExports = pseudo$1.exports; + +var attribute$1 = {}; + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +var node = require$$1.deprecate; + +(function (exports) { + + exports.__esModule = true; + exports["default"] = void 0; + exports.unescapeValue = unescapeValue; + var _cssesc = _interopRequireDefault(cssesc_1); + var _unesc = _interopRequireDefault(unescExports); + var _namespace = _interopRequireDefault(namespaceExports); + var _types = types; + var _CSSESC_QUOTE_OPTIONS; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var deprecate = node; + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + if (opts.value === undefined) { + return opts; + } + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + function Attribute(opts) { + var _this; + if (opts === void 0) { + opts = {}; + } + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */; + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + } + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + } + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + if (name === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + _proto.toString = function toString() { + var _this2 = this; + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "insensitive", + get: function get() { + return this._insensitive; + } + + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + + // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. + // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. + if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { + this.raws.insensitiveFlag = undefined; + } + } + this._insensitive = insensitive; + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + }]); + return Attribute; + }(_namespace["default"]); + exports["default"] = Attribute; + Attribute.NO_QUOTE = null; + Attribute.SINGLE_QUOTE = "'"; + Attribute.DOUBLE_QUOTE = '"'; + var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } + }, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true + }, _CSSESC_QUOTE_OPTIONS); + function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; + } +} (attribute$1)); + +var universal$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault(namespaceExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + function Universal(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + return Universal; + }(_namespace["default"]); + exports["default"] = Universal; + module.exports = exports.default; +} (universal$1, universal$1.exports)); + +var universalExports = universal$1.exports; + +var combinator$2 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + function Combinator(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + return Combinator; + }(_node["default"]); + exports["default"] = Combinator; + module.exports = exports.default; +} (combinator$2, combinator$2.exports)); + +var combinatorExports = combinator$2.exports; + +var nesting$1 = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault(nodeExports); + var _types = types; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + function Nesting(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + return Nesting; + }(_node["default"]); + exports["default"] = Nesting; + module.exports = exports.default; +} (nesting$1, nesting$1.exports)); + +var nestingExports = nesting$1.exports; + +var sortAscending = {exports: {}}; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = sortAscending; + function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); + } + module.exports = exports.default; +} (sortAscending, sortAscending.exports)); + +var sortAscendingExports = sortAscending.exports; + +var tokenize = {}; + +var tokenTypes = {}; + +tokenTypes.__esModule = true; +tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0; +var ampersand = 38; // `&`.charCodeAt(0); +tokenTypes.ampersand = ampersand; +var asterisk = 42; // `*`.charCodeAt(0); +tokenTypes.asterisk = asterisk; +var at = 64; // `@`.charCodeAt(0); +tokenTypes.at = at; +var comma = 44; // `,`.charCodeAt(0); +tokenTypes.comma = comma; +var colon = 58; // `:`.charCodeAt(0); +tokenTypes.colon = colon; +var semicolon = 59; // `;`.charCodeAt(0); +tokenTypes.semicolon = semicolon; +var openParenthesis = 40; // `(`.charCodeAt(0); +tokenTypes.openParenthesis = openParenthesis; +var closeParenthesis = 41; // `)`.charCodeAt(0); +tokenTypes.closeParenthesis = closeParenthesis; +var openSquare = 91; // `[`.charCodeAt(0); +tokenTypes.openSquare = openSquare; +var closeSquare = 93; // `]`.charCodeAt(0); +tokenTypes.closeSquare = closeSquare; +var dollar = 36; // `$`.charCodeAt(0); +tokenTypes.dollar = dollar; +var tilde = 126; // `~`.charCodeAt(0); +tokenTypes.tilde = tilde; +var caret = 94; // `^`.charCodeAt(0); +tokenTypes.caret = caret; +var plus = 43; // `+`.charCodeAt(0); +tokenTypes.plus = plus; +var equals = 61; // `=`.charCodeAt(0); +tokenTypes.equals = equals; +var pipe = 124; // `|`.charCodeAt(0); +tokenTypes.pipe = pipe; +var greaterThan = 62; // `>`.charCodeAt(0); +tokenTypes.greaterThan = greaterThan; +var space = 32; // ` `.charCodeAt(0); +tokenTypes.space = space; +var singleQuote = 39; // `'`.charCodeAt(0); +tokenTypes.singleQuote = singleQuote; +var doubleQuote = 34; // `"`.charCodeAt(0); +tokenTypes.doubleQuote = doubleQuote; +var slash = 47; // `/`.charCodeAt(0); +tokenTypes.slash = slash; +var bang = 33; // `!`.charCodeAt(0); +tokenTypes.bang = bang; +var backslash = 92; // '\\'.charCodeAt(0); +tokenTypes.backslash = backslash; +var cr = 13; // '\r'.charCodeAt(0); +tokenTypes.cr = cr; +var feed = 12; // '\f'.charCodeAt(0); +tokenTypes.feed = feed; +var newline = 10; // '\n'.charCodeAt(0); +tokenTypes.newline = newline; +var tab = 9; // '\t'.charCodeAt(0); + +// Expose aliases primarily for readability. +tokenTypes.tab = tab; +var str = singleQuote; + +// No good single character representation! +tokenTypes.str = str; +var comment$1 = -1; +tokenTypes.comment = comment$1; +var word = -2; +tokenTypes.word = word; +var combinator$1 = -3; +tokenTypes.combinator = combinator$1; + +(function (exports) { + + exports.__esModule = true; + exports.FIELDS = void 0; + exports["default"] = tokenize; + var t = _interopRequireWildcard(tokenTypes); + var _unescapable, _wordDelimiters; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); + var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; + } + + /** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + return next - 1; + } + + /** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) ; else if (hex[code]) { + var hexDigits = 0; + // consume up to 6 hex chars + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + // if fewer than 6 hex chars, a trailing space ends the escape + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + return next; + } + var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + exports.FIELDS = FIELDS; + function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed('quote', quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + if (next === 0) { + unclosed('comment', '*/'); + } + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + + // Ensure that the token structure remains consistent + tokens.push([tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end // [6] End position + ]); + + // Reset offset for the next token + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; + } +} (tokenize)); + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _root = _interopRequireDefault(rootExports); + var _selector = _interopRequireDefault(selectorExports); + var _className = _interopRequireDefault(classNameExports); + var _comment = _interopRequireDefault(commentExports); + var _id = _interopRequireDefault(idExports); + var _tag = _interopRequireDefault(tagExports); + var _string = _interopRequireDefault(stringExports); + var _pseudo = _interopRequireDefault(pseudoExports); + var _attribute = _interopRequireWildcard(attribute$1); + var _universal = _interopRequireDefault(universalExports); + var _combinator = _interopRequireDefault(combinatorExports); + var _nesting = _interopRequireDefault(nestingExports); + var _sortAscending = _interopRequireDefault(sortAscendingExports); + var _tokenize = _interopRequireWildcard(tokenize); + var tokens = _interopRequireWildcard(tokenTypes); + var types$1 = _interopRequireWildcard(types); + var _util = util; + var _WHITESPACE_TOKENS, _Object$assign; + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); + var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; + } + function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); + } + function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + return node; + } + function indexesOf(array, item) { + var i = -1; + var indexes = []; + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; + } + function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); + } + var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + }, + sourceIndex: 0 + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + var _proto = Parser.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + if (rawValue) { + node.raws.namespace += content; + } + lastAdded = 'namespace'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && + // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + node.attribute = (node.attribute || "") + content; + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + if (_rawValue) { + node.raws.attribute += content; + } + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + lastAdded = 'insensitive'; + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + if (node.raws.value) { + node.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + return nodes; + } + + /** + * + * @param {*} nodes + */; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = undefined; + } + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + _proto.combinator = function combinator() { + var _this3 = this; + if (this.content() === '|') { + return this.namespace(); + } + // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node; + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + var spaces = {}; + var raws = { + spaces: {} + }; + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types$1.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position]) + }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector); + this.current = selector; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.pseudo = function pseudo() { + var _this4 = this; + var pseudoStr = ''; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.space = function space() { + var content = this.content(); + // Handle space before and after the selector + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; + // Allow decimal numbers percent in @keyframes + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); + // Eliminate Sass interpolations from the list of id indexes + var interpolations = indexesOf(word, '#{'); + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + _this5.newNode(node, namespace); + // Ensure that the namespace is used only once + namespace = null; + }); + this.position++; + }; + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + } + + /** + * Helpers + */; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + return Parser; + }(); + exports["default"] = Parser; + module.exports = exports.default; +} (parser, parser.exports)); + +var parserExports = parser.exports; + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _parser = _interopRequireDefault(parserExports); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + var root = this._root(rule, options); + var transform = this.func(root); + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string = undefined; + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + } + + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<parser.Root>} The AST of the selector after processing it. + */; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise<any>} The value returned by the processor. + */; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor; + }(); + exports["default"] = Processor; + module.exports = exports.default; +} (processor, processor.exports)); + +var processorExports = processor.exports; + +var selectors = {}; + +var constructors = {}; + +constructors.__esModule = true; +constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0; +var _attribute = _interopRequireDefault$2(attribute$1); +var _className = _interopRequireDefault$2(classNameExports); +var _combinator = _interopRequireDefault$2(combinatorExports); +var _comment = _interopRequireDefault$2(commentExports); +var _id = _interopRequireDefault$2(idExports); +var _nesting = _interopRequireDefault$2(nestingExports); +var _pseudo = _interopRequireDefault$2(pseudoExports); +var _root = _interopRequireDefault$2(rootExports); +var _selector = _interopRequireDefault$2(selectorExports); +var _string = _interopRequireDefault$2(stringExports); +var _tag = _interopRequireDefault$2(tagExports); +var _universal = _interopRequireDefault$2(universalExports); +function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +var attribute = function attribute(opts) { + return new _attribute["default"](opts); +}; +constructors.attribute = attribute; +var className = function className(opts) { + return new _className["default"](opts); +}; +constructors.className = className; +var combinator = function combinator(opts) { + return new _combinator["default"](opts); +}; +constructors.combinator = combinator; +var comment = function comment(opts) { + return new _comment["default"](opts); +}; +constructors.comment = comment; +var id = function id(opts) { + return new _id["default"](opts); +}; +constructors.id = id; +var nesting = function nesting(opts) { + return new _nesting["default"](opts); +}; +constructors.nesting = nesting; +var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); +}; +constructors.pseudo = pseudo; +var root = function root(opts) { + return new _root["default"](opts); +}; +constructors.root = root; +var selector = function selector(opts) { + return new _selector["default"](opts); +}; +constructors.selector = selector; +var string = function string(opts) { + return new _string["default"](opts); +}; +constructors.string = string; +var tag = function tag(opts) { + return new _tag["default"](opts); +}; +constructors.tag = tag; +var universal = function universal(opts) { + return new _universal["default"](opts); +}; +constructors.universal = universal; + +var guards = {}; + +guards.__esModule = true; +guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0; +guards.isContainer = isContainer; +guards.isIdentifier = void 0; +guards.isNamespace = isNamespace; +guards.isNesting = void 0; +guards.isNode = isNode; +guards.isPseudo = void 0; +guards.isPseudoClass = isPseudoClass; +guards.isPseudoElement = isPseudoElement; +guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0; +var _types = types; +var _IS_TYPE; +var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); +function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; +} +function isNodeType(type, node) { + return isNode(node) && node.type === type; +} +var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); +guards.isAttribute = isAttribute; +var isClassName = isNodeType.bind(null, _types.CLASS); +guards.isClassName = isClassName; +var isCombinator = isNodeType.bind(null, _types.COMBINATOR); +guards.isCombinator = isCombinator; +var isComment = isNodeType.bind(null, _types.COMMENT); +guards.isComment = isComment; +var isIdentifier = isNodeType.bind(null, _types.ID); +guards.isIdentifier = isIdentifier; +var isNesting = isNodeType.bind(null, _types.NESTING); +guards.isNesting = isNesting; +var isPseudo = isNodeType.bind(null, _types.PSEUDO); +guards.isPseudo = isPseudo; +var isRoot = isNodeType.bind(null, _types.ROOT); +guards.isRoot = isRoot; +var isSelector = isNodeType.bind(null, _types.SELECTOR); +guards.isSelector = isSelector; +var isString = isNodeType.bind(null, _types.STRING); +guards.isString = isString; +var isTag = isNodeType.bind(null, _types.TAG); +guards.isTag = isTag; +var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); +guards.isUniversal = isUniversal; +function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); +} +function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); +} +function isContainer(node) { + return !!(isNode(node) && node.walk); +} +function isNamespace(node) { + return isAttribute(node) || isTag(node); +} + +(function (exports) { + + exports.__esModule = true; + var _types = types; + Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; + }); + var _constructors = constructors; + Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; + }); + var _guards = guards; + Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; + }); +} (selectors)); + +(function (module, exports) { + + exports.__esModule = true; + exports["default"] = void 0; + var _processor = _interopRequireDefault(processorExports); + var selectors$1 = _interopRequireWildcard(selectors); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + var parser = function parser(processor) { + return new _processor["default"](processor); + }; + Object.assign(parser, selectors$1); + delete parser.__esModule; + var _default = parser; + exports["default"] = _default; + module.exports = exports.default; +} (dist, dist.exports)); + +var distExports = dist.exports; + +const selectorParser$1 = distExports; +const valueParser = lib; +const { extractICSS } = src$4; + +const isSpacing = (node) => node.type === "combinator" && node.value === " "; + +function normalizeNodeArray(nodes) { + const array = []; + + nodes.forEach((x) => { + if (Array.isArray(x)) { + normalizeNodeArray(x).forEach((item) => { + array.push(item); + }); + } else if (x) { + array.push(x); + } + }); + + if (array.length > 0 && isSpacing(array[array.length - 1])) { + array.pop(); + } + return array; +} + +function localizeNode(rule, mode, localAliasMap) { + const transform = (node, context) => { + if (context.ignoreNextSpacing && !isSpacing(node)) { + throw new Error("Missing whitespace after " + context.ignoreNextSpacing); + } + + if (context.enforceNoSpacing && isSpacing(node)) { + throw new Error("Missing whitespace before " + context.enforceNoSpacing); + } + + let newNodes; + + switch (node.type) { + case "root": { + let resultingGlobal; + + context.hasPureGlobals = false; + + newNodes = node.nodes.map((n) => { + const nContext = { + global: context.global, + lastWasSpacing: true, + hasLocals: false, + explicit: false, + }; + + n = transform(n, nContext); + + if (typeof resultingGlobal === "undefined") { + resultingGlobal = nContext.global; + } else if (resultingGlobal !== nContext.global) { + throw new Error( + 'Inconsistent rule global/local result in rule "' + + node + + '" (multiple selectors must result in the same mode for the rule)' + ); + } + + if (!nContext.hasLocals) { + context.hasPureGlobals = true; + } + + return n; + }); + + context.global = resultingGlobal; + + node.nodes = normalizeNodeArray(newNodes); + break; + } + case "selector": { + newNodes = node.map((childNode) => transform(childNode, context)); + + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + break; + } + case "combinator": { + if (isSpacing(node)) { + if (context.ignoreNextSpacing) { + context.ignoreNextSpacing = false; + context.lastWasSpacing = false; + context.enforceNoSpacing = false; + return null; + } + context.lastWasSpacing = true; + return node; + } + break; + } + case "pseudo": { + let childContext; + const isNested = !!node.length; + const isScoped = node.value === ":local" || node.value === ":global"; + const isImportExport = + node.value === ":import" || node.value === ":export"; + + if (isImportExport) { + context.hasLocals = true; + // :local(.foo) + } else if (isNested) { + if (isScoped) { + if (node.nodes.length === 0) { + throw new Error(`${node.value}() can't be empty`); + } + + if (context.inside) { + throw new Error( + `A ${node.value} is not allowed inside of a ${context.inside}(...)` + ); + } + + childContext = { + global: node.value === ":global", + inside: node.value, + hasLocals: false, + explicit: true, + }; + + newNodes = node + .map((childNode) => transform(childNode, childContext)) + .reduce((acc, next) => acc.concat(next.nodes), []); + + if (newNodes.length) { + const { before, after } = node.spaces; + + const first = newNodes[0]; + const last = newNodes[newNodes.length - 1]; + + first.spaces = { before, after: first.spaces.after }; + last.spaces = { before: last.spaces.before, after }; + } + + node = newNodes; + + break; + } else { + childContext = { + global: context.global, + inside: context.inside, + lastWasSpacing: true, + hasLocals: false, + explicit: context.explicit, + }; + newNodes = node.map((childNode) => { + const newContext = { + ...childContext, + enforceNoSpacing: false, + }; + + const result = transform(childNode, newContext); + + childContext.global = newContext.global; + childContext.hasLocals = newContext.hasLocals; + + return result; + }); + + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + + if (childContext.hasLocals) { + context.hasLocals = true; + } + } + break; + + //:local .foo .bar + } else if (isScoped) { + if (context.inside) { + throw new Error( + `A ${node.value} is not allowed inside of a ${context.inside}(...)` + ); + } + + const addBackSpacing = !!node.spaces.before; + + context.ignoreNextSpacing = context.lastWasSpacing + ? node.value + : false; + + context.enforceNoSpacing = context.lastWasSpacing + ? false + : node.value; + + context.global = node.value === ":global"; + context.explicit = true; + + // because this node has spacing that is lost when we remove it + // we make up for it by adding an extra combinator in since adding + // spacing on the parent selector doesn't work + return addBackSpacing + ? selectorParser$1.combinator({ value: " " }) + : null; + } + break; + } + case "id": + case "class": { + if (!node.value) { + throw new Error("Invalid class or id selector syntax"); + } + + if (context.global) { + break; + } + + const isImportedValue = localAliasMap.has(node.value); + const isImportedWithExplicitScope = isImportedValue && context.explicit; + + if (!isImportedValue || isImportedWithExplicitScope) { + const innerNode = node.clone(); + innerNode.spaces = { before: "", after: "" }; + + node = selectorParser$1.pseudo({ + value: ":local", + nodes: [innerNode], + spaces: node.spaces, + }); + + context.hasLocals = true; + } + + break; + } + case "nesting": { + if (node.value === "&") { + context.hasLocals = true; + } + } + } + + context.lastWasSpacing = false; + context.ignoreNextSpacing = false; + context.enforceNoSpacing = false; + + return node; + }; + + const rootContext = { + global: mode === "global", + hasPureGlobals: false, + }; + + rootContext.selector = selectorParser$1((root) => { + transform(root, rootContext); + }).processSync(rule, { updateSelector: false, lossless: true }); + + return rootContext; +} + +function localizeDeclNode(node, context) { + switch (node.type) { + case "word": + if (context.localizeNextItem) { + if (!context.localAliasMap.has(node.value)) { + node.value = ":local(" + node.value + ")"; + context.localizeNextItem = false; + } + } + break; + + case "function": + if ( + context.options && + context.options.rewriteUrl && + node.value.toLowerCase() === "url" + ) { + node.nodes.map((nestedNode) => { + if (nestedNode.type !== "string" && nestedNode.type !== "word") { + return; + } + + let newUrl = context.options.rewriteUrl( + context.global, + nestedNode.value + ); + + switch (nestedNode.type) { + case "string": + if (nestedNode.quote === "'") { + newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'"); + } + + if (nestedNode.quote === '"') { + newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, '\\"'); + } + + break; + case "word": + newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1"); + break; + } + + nestedNode.value = newUrl; + }); + } + break; + } + return node; +} + +// `none` is special value, other is global values +const specialKeywords = [ + "none", + "inherit", + "initial", + "revert", + "revert-layer", + "unset", +]; + +function localizeDeclarationValues(localize, declaration, context) { + const valueNodes = valueParser(declaration.value); + + valueNodes.walk((node, index, nodes) => { + if ( + node.type === "function" && + (node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env") + ) { + return false; + } + + if ( + node.type === "word" && + specialKeywords.includes(node.value.toLowerCase()) + ) { + return; + } + + const subContext = { + options: context.options, + global: context.global, + localizeNextItem: localize && !context.global, + localAliasMap: context.localAliasMap, + }; + nodes[index] = localizeDeclNode(node, subContext); + }); + + declaration.value = valueNodes.toString(); +} + +function localizeDeclaration(declaration, context) { + const isAnimation = /animation$/i.test(declaration.prop); + + if (isAnimation) { + // letter + // An uppercase letter or a lowercase letter. + // + // ident-start code point + // A letter, a non-ASCII code point, or U+005F LOW LINE (_). + // + // ident code point + // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-). + + // We don't validate `hex digits`, because we don't need it, it is work of linters. + const validIdent = + /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i; + + /* + The spec defines some keywords that you can use to describe properties such as the timing + function. These are still valid animation names, so as long as there is a property that accepts + a keyword, it is given priority. Only when all the properties that can take a keyword are + exhausted can the animation name be set to the keyword. I.e. + + animation: infinite infinite; + + The animation will repeat an infinite number of times from the first argument, and will have an + animation name of infinite from the second. + */ + const animationKeywords = { + // animation-direction + $normal: 1, + $reverse: 1, + $alternate: 1, + "$alternate-reverse": 1, + // animation-fill-mode + $forwards: 1, + $backwards: 1, + $both: 1, + // animation-iteration-count + $infinite: 1, + // animation-play-state + $paused: 1, + $running: 1, + // animation-timing-function + $ease: 1, + "$ease-in": 1, + "$ease-out": 1, + "$ease-in-out": 1, + $linear: 1, + "$step-end": 1, + "$step-start": 1, + // Special + $none: Infinity, // No matter how many times you write none, it will never be an animation name + // Global values + $initial: Infinity, + $inherit: Infinity, + $unset: Infinity, + $revert: Infinity, + "$revert-layer": Infinity, + }; + let parsedAnimationKeywords = {}; + const valueNodes = valueParser(declaration.value).walk((node) => { + // If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. + if (node.type === "div") { + parsedAnimationKeywords = {}; + + return; + } + // Do not handle nested functions + else if (node.type === "function") { + return false; + } + // Ignore all except word + else if (node.type !== "word") { + return; + } + + const value = node.type === "word" ? node.value.toLowerCase() : null; + + let shouldParseAnimationName = false; + + if (value && validIdent.test(value)) { + if ("$" + value in animationKeywords) { + parsedAnimationKeywords["$" + value] = + "$" + value in parsedAnimationKeywords + ? parsedAnimationKeywords["$" + value] + 1 + : 0; + + shouldParseAnimationName = + parsedAnimationKeywords["$" + value] >= + animationKeywords["$" + value]; + } else { + shouldParseAnimationName = true; + } + } + + const subContext = { + options: context.options, + global: context.global, + localizeNextItem: shouldParseAnimationName && !context.global, + localAliasMap: context.localAliasMap, + }; + + return localizeDeclNode(node, subContext); + }); + + declaration.value = valueNodes.toString(); + + return; + } + + const isAnimationName = /animation(-name)?$/i.test(declaration.prop); + + if (isAnimationName) { + return localizeDeclarationValues(true, declaration, context); + } + + const hasUrl = /url\(/i.test(declaration.value); + + if (hasUrl) { + return localizeDeclarationValues(false, declaration, context); + } +} + +src$2.exports = (options = {}) => { + if ( + options && + options.mode && + options.mode !== "global" && + options.mode !== "local" && + options.mode !== "pure" + ) { + throw new Error( + 'options.mode must be either "global", "local" or "pure" (default "local")' + ); + } + + const pureMode = options && options.mode === "pure"; + const globalMode = options && options.mode === "global"; + + return { + postcssPlugin: "postcss-modules-local-by-default", + prepare() { + const localAliasMap = new Map(); + + return { + Once(root) { + const { icssImports } = extractICSS(root, false); + + Object.keys(icssImports).forEach((key) => { + Object.keys(icssImports[key]).forEach((prop) => { + localAliasMap.set(prop, icssImports[key][prop]); + }); + }); + + root.walkAtRules((atRule) => { + if (/keyframes$/i.test(atRule.name)) { + const globalMatch = /^\s*:global\s*\((.+)\)\s*$/.exec( + atRule.params + ); + const localMatch = /^\s*:local\s*\((.+)\)\s*$/.exec( + atRule.params + ); + + let globalKeyframes = globalMode; + + if (globalMatch) { + if (pureMode) { + throw atRule.error( + "@keyframes :global(...) is not allowed in pure mode" + ); + } + atRule.params = globalMatch[1]; + globalKeyframes = true; + } else if (localMatch) { + atRule.params = localMatch[0]; + globalKeyframes = false; + } else if ( + atRule.params && + !globalMode && + !localAliasMap.has(atRule.params) + ) { + atRule.params = ":local(" + atRule.params + ")"; + } + + atRule.walkDecls((declaration) => { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalKeyframes, + }); + }); + } else if (/scope$/i.test(atRule.name)) { + if (atRule.params) { + atRule.params = atRule.params + .split("to") + .map((item) => { + const selector = item.trim().slice(1, -1).trim(); + const context = localizeNode( + selector, + options.mode, + localAliasMap + ); + + context.options = options; + context.localAliasMap = localAliasMap; + + if (pureMode && context.hasPureGlobals) { + throw atRule.error( + 'Selector in at-rule"' + + selector + + '" is not pure ' + + "(pure selectors must contain at least one local class or id)" + ); + } + + return `(${context.selector})`; + }) + .join(" to "); + } + + atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalMode, + }); + } + }); + } else if (atRule.nodes) { + atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") { + localizeDeclaration(declaration, { + localAliasMap, + options: options, + global: globalMode, + }); + } + }); + } + }); + + root.walkRules((rule) => { + if ( + rule.parent && + rule.parent.type === "atrule" && + /keyframes$/i.test(rule.parent.name) + ) { + // ignore keyframe rules + return; + } + + const context = localizeNode(rule, options.mode, localAliasMap); + + context.options = options; + context.localAliasMap = localAliasMap; + + if (pureMode && context.hasPureGlobals) { + throw rule.error( + 'Selector "' + + rule.selector + + '" is not pure ' + + "(pure selectors must contain at least one local class or id)" + ); + } + + rule.selector = context.selector; + + // Less-syntax mixins parse as rules with no nodes + if (rule.nodes) { + rule.nodes.forEach((declaration) => + localizeDeclaration(declaration, context) + ); + } + }); + }, + }; + }, + }; +}; +src$2.exports.postcss = true; + +var srcExports$1 = src$2.exports; + +const selectorParser = distExports; + +const hasOwnProperty = Object.prototype.hasOwnProperty; + +function isNestedRule(rule) { + if (!rule.parent || rule.parent.type === "root") { + return false; + } + + if (rule.parent.type === "rule") { + return true; + } + + return isNestedRule(rule.parent); +} + +function getSingleLocalNamesForComposes(root, rule) { + if (isNestedRule(rule)) { + throw new Error(`composition is not allowed in nested rule \n\n${rule}`); + } + + return root.nodes.map((node) => { + if (node.type !== "selector" || node.nodes.length !== 1) { + throw new Error( + `composition is only allowed when selector is single :local class name not in "${root}"` + ); + } + + node = node.nodes[0]; + + if ( + node.type !== "pseudo" || + node.value !== ":local" || + node.nodes.length !== 1 + ) { + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + node = node.first; + + if (node.type !== "selector" || node.length !== 1) { + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + node = node.first; + + if (node.type !== "class") { + // 'id' is not possible, because you can't compose ids + throw new Error( + 'composition is only allowed when selector is single :local class name not in "' + + root + + '", "' + + node + + '" is weird' + ); + } + + return node.value; + }); +} + +const whitespace = "[\\x20\\t\\r\\n\\f]"; +const unescapeRegExp = new RegExp( + "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", + "ig" +); + +function unescape(str) { + return str.replace(unescapeRegExp, (_, escaped, escapedWhitespace) => { + const high = "0x" + escaped - 0x10000; + + // NaN means non-codepoint + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace + ? escaped + : high < 0 + ? // BMP codepoint + String.fromCharCode(high + 0x10000) + : // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00); + }); +} + +const plugin = (options = {}) => { + const generateScopedName = + (options && options.generateScopedName) || plugin.generateScopedName; + const generateExportEntry = + (options && options.generateExportEntry) || plugin.generateExportEntry; + const exportGlobals = options && options.exportGlobals; + + return { + postcssPlugin: "postcss-modules-scope", + Once(root, { rule }) { + const exports = Object.create(null); + + function exportScopedName(name, rawName, node) { + const scopedName = generateScopedName( + rawName ? rawName : name, + root.source.input.from, + root.source.input.css, + node + ); + const exportEntry = generateExportEntry( + rawName ? rawName : name, + scopedName, + root.source.input.from, + root.source.input.css, + node + ); + const { key, value } = exportEntry; + + exports[key] = exports[key] || []; + + if (exports[key].indexOf(value) < 0) { + exports[key].push(value); + } + + return scopedName; + } + + function localizeNode(node) { + switch (node.type) { + case "selector": + node.nodes = node.map((item) => localizeNode(item)); + return node; + case "class": + return selectorParser.className({ + value: exportScopedName( + node.value, + node.raws && node.raws.value ? node.raws.value : null, + node + ), + }); + case "id": { + return selectorParser.id({ + value: exportScopedName( + node.value, + node.raws && node.raws.value ? node.raws.value : null, + node + ), + }); + } + case "attribute": { + if (node.attribute === "class" && node.operator === "=") { + return selectorParser.attribute({ + attribute: node.attribute, + operator: node.operator, + quoteMark: "'", + value: exportScopedName(node.value, null, null), + }); + } + } + } + + throw new Error( + `${node.type} ("${node}") is not allowed in a :local block` + ); + } + + function traverseNode(node) { + switch (node.type) { + case "pseudo": + if (node.value === ":local") { + if (node.nodes.length !== 1) { + throw new Error('Unexpected comma (",") in :local block'); + } + + const selector = localizeNode(node.first); + // move the spaces that were around the pseudo selector to the first + // non-container node + selector.first.spaces = node.spaces; + + const nextNode = node.next(); + + if ( + nextNode && + nextNode.type === "combinator" && + nextNode.value === " " && + /\\[A-F0-9]{1,6}$/.test(selector.last.value) + ) { + selector.last.spaces.after = " "; + } + + node.replaceWith(selector); + + return; + } + /* falls through */ + case "root": + case "selector": { + node.each((item) => traverseNode(item)); + break; + } + case "id": + case "class": + if (exportGlobals) { + exports[node.value] = [node.value]; + } + break; + } + return node; + } + + // Find any :import and remember imported names + const importedNames = {}; + + root.walkRules(/^:import\(.+\)$/, (rule) => { + rule.walkDecls((decl) => { + importedNames[decl.prop] = true; + }); + }); + + // Find any :local selectors + root.walkRules((rule) => { + let parsedSelector = selectorParser().astSync(rule); + + rule.selector = traverseNode(parsedSelector.clone()).toString(); + + rule.walkDecls(/^(composes|compose-with)$/i, (decl) => { + const localNames = getSingleLocalNamesForComposes( + parsedSelector, + decl.parent + ); + const multiple = decl.value.split(","); + + multiple.forEach((value) => { + const classes = value.trim().split(/\s+/); + + classes.forEach((className) => { + const global = /^global\(([^)]+)\)$/.exec(className); + + if (global) { + localNames.forEach((exportedName) => { + exports[exportedName].push(global[1]); + }); + } else if (hasOwnProperty.call(importedNames, className)) { + localNames.forEach((exportedName) => { + exports[exportedName].push(className); + }); + } else if (hasOwnProperty.call(exports, className)) { + localNames.forEach((exportedName) => { + exports[className].forEach((item) => { + exports[exportedName].push(item); + }); + }); + } else { + throw decl.error( + `referenced class name "${className}" in ${decl.prop} not found` + ); + } + }); + }); + + decl.remove(); + }); + + // Find any :local values + rule.walkDecls((decl) => { + if (!/:local\s*\((.+?)\)/.test(decl.value)) { + return; + } + + let tokens = decl.value.split(/(,|'[^']*'|"[^"]*")/); + + tokens = tokens.map((token, idx) => { + if (idx === 0 || tokens[idx - 1] === ",") { + let result = token; + + const localMatch = /:local\s*\((.+?)\)/.exec(token); + + if (localMatch) { + const input = localMatch.input; + const matchPattern = localMatch[0]; + const matchVal = localMatch[1]; + const newVal = exportScopedName(matchVal); + + result = input.replace(matchPattern, newVal); + } else { + return token; + } + + return result; + } else { + return token; + } + }); + + decl.value = tokens.join(""); + }); + }); + + // Find any :local keyframes + root.walkAtRules(/keyframes$/i, (atRule) => { + const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(atRule.params); + + if (!localMatch) { + return; + } + + atRule.params = exportScopedName(localMatch[1]); + }); + + root.walkAtRules(/scope$/i, (atRule) => { + if (atRule.params) { + atRule.params = atRule.params + .split("to") + .map((item) => { + const selector = item.trim().slice(1, -1).trim(); + + const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(selector); + + if (!localMatch) { + return `(${selector})`; + } + + let parsedSelector = selectorParser().astSync(selector); + + return `(${traverseNode(parsedSelector).toString()})`; + }) + .join(" to "); + } + }); + + // If we found any :locals, insert an :export rule + const exportedNames = Object.keys(exports); + + if (exportedNames.length > 0) { + const exportRule = rule({ selector: ":export" }); + + exportedNames.forEach((exportedName) => + exportRule.append({ + prop: exportedName, + value: exports[exportedName].join(" "), + raws: { before: "\n " }, + }) + ); + + root.append(exportRule); + } + }, + }; +}; + +plugin.postcss = true; + +plugin.generateScopedName = function (name, path) { + const sanitisedPath = path + .replace(/\.[^./\\]+$/, "") + .replace(/[\W_]+/g, "_") + .replace(/^_|_$/g, ""); + + return `_${sanitisedPath}__${name}`.trim(); +}; + +plugin.generateExportEntry = function (name, scopedName) { + return { + key: unescape(name), + value: unescape(scopedName), + }; +}; + +var src$1 = plugin; + +function hash(str) { + var hash = 5381, + i = str.length; + + while(i) { + hash = (hash * 33) ^ str.charCodeAt(--i); + } + + /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed + * integers. Since we want the results to be always positive, convert the + * signed int to an unsigned by doing an unsigned bitshift. */ + return hash >>> 0; +} + +var stringHash = hash; + +var src = {exports: {}}; + +const ICSSUtils = src$4; + +const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/; +const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/; +const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/; + +src.exports = (options) => { + let importIndex = 0; + const createImportedName = + (options && options.createImportedName) || + ((importName /*, path*/) => + `i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`); + + return { + postcssPlugin: "postcss-modules-values", + prepare(result) { + const importAliases = []; + const definitions = {}; + + return { + Once(root, postcss) { + root.walkAtRules(/value/i, (atRule) => { + const matches = atRule.params.match(matchImports); + + if (matches) { + let [, /*match*/ aliases, path] = matches; + + // We can use constants for path names + if (definitions[path]) { + path = definitions[path]; + } + + const imports = aliases + .replace(/^\(\s*([\s\S]+)\s*\)$/, "$1") + .split(/\s*,\s*/) + .map((alias) => { + const tokens = matchImport.exec(alias); + + if (tokens) { + const [, /*match*/ theirName, myName = theirName] = tokens; + const importedName = createImportedName(myName); + definitions[myName] = importedName; + return { theirName, importedName }; + } else { + throw new Error(`@import statement "${alias}" is invalid!`); + } + }); + + importAliases.push({ path, imports }); + + atRule.remove(); + + return; + } + + if (atRule.params.indexOf("@value") !== -1) { + result.warn("Invalid value definition: " + atRule.params); + } + + let [, key, value] = `${atRule.params}${atRule.raws.between}`.match( + matchValueDefinition + ); + + const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, ""); + + if (normalizedValue.length === 0) { + result.warn("Invalid value definition: " + atRule.params); + atRule.remove(); + + return; + } + + let isOnlySpace = /^\s+$/.test(normalizedValue); + + if (!isOnlySpace) { + value = value.trim(); + } + + // Add to the definitions, knowing that values can refer to each other + definitions[key] = ICSSUtils.replaceValueSymbols( + value, + definitions + ); + + atRule.remove(); + }); + + /* If we have no definitions, don't continue */ + if (!Object.keys(definitions).length) { + return; + } + + /* Perform replacements */ + ICSSUtils.replaceSymbols(root, definitions); + + /* We want to export anything defined by now, but don't add it to the CSS yet or it well get picked up by the replacement stuff */ + const exportDeclarations = Object.keys(definitions).map((key) => + postcss.decl({ + value: definitions[key], + prop: key, + raws: { before: "\n " }, + }) + ); + + /* Add export rules if any */ + if (exportDeclarations.length > 0) { + const exportRule = postcss.rule({ + selector: ":export", + raws: { after: "\n" }, + }); + + exportRule.append(exportDeclarations); + + root.prepend(exportRule); + } + + /* Add import rules */ + importAliases.reverse().forEach(({ path, imports }) => { + const importRule = postcss.rule({ + selector: `:import(${path})`, + raws: { after: "\n" }, + }); + + imports.forEach(({ theirName, importedName }) => { + importRule.append({ + value: theirName, + prop: importedName, + raws: { before: "\n " }, + }); + }); + + root.prepend(importRule); + }); + }, + }; + }, + }; +}; + +src.exports.postcss = true; + +var srcExports = src.exports; + +Object.defineProperty(scoping, "__esModule", { + value: true +}); +scoping.behaviours = void 0; +scoping.getDefaultPlugins = getDefaultPlugins; +scoping.getDefaultScopeBehaviour = getDefaultScopeBehaviour; +scoping.getScopedNameGenerator = getScopedNameGenerator; + +var _postcssModulesExtractImports = _interopRequireDefault$1(srcExports$2); + +var _genericNames = _interopRequireDefault$1(genericNames); + +var _postcssModulesLocalByDefault = _interopRequireDefault$1(srcExports$1); + +var _postcssModulesScope = _interopRequireDefault$1(src$1); + +var _stringHash = _interopRequireDefault$1(stringHash); + +var _postcssModulesValues = _interopRequireDefault$1(srcExports); + +function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const behaviours = { + LOCAL: "local", + GLOBAL: "global" +}; +scoping.behaviours = behaviours; + +function getDefaultPlugins({ + behaviour, + generateScopedName, + exportGlobals +}) { + const scope = (0, _postcssModulesScope.default)({ + generateScopedName, + exportGlobals + }); + const plugins = { + [behaviours.LOCAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({ + mode: "local" + }), _postcssModulesExtractImports.default, scope], + [behaviours.GLOBAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({ + mode: "global" + }), _postcssModulesExtractImports.default, scope] + }; + return plugins[behaviour]; +} + +function isValidBehaviour(behaviour) { + return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1; +} + +function getDefaultScopeBehaviour(scopeBehaviour) { + return scopeBehaviour && isValidBehaviour(scopeBehaviour) ? scopeBehaviour : behaviours.LOCAL; +} + +function generateScopedNameDefault(name, filename, css) { + const i = css.indexOf(`.${name}`); + const lineNumber = css.substr(0, i).split(/[\r\n]/).length; + const hash = (0, _stringHash.default)(css).toString(36).substr(0, 5); + return `_${name}_${hash}_${lineNumber}`; +} + +function getScopedNameGenerator(generateScopedName, hashPrefix) { + const scopedNameGenerator = generateScopedName || generateScopedNameDefault; + + if (typeof scopedNameGenerator === "function") { + return scopedNameGenerator; + } + + return (0, _genericNames.default)(scopedNameGenerator, { + context: process.cwd(), + hashPrefix: hashPrefix + }); +} + +Object.defineProperty(pluginFactory, "__esModule", { + value: true +}); +pluginFactory.makePlugin = makePlugin; + +var _postcss = _interopRequireDefault(require$$0); + +var _unquote = _interopRequireDefault(unquote$1); + +var _Parser = _interopRequireDefault(Parser$1); + +var _saveJSON = _interopRequireDefault(saveJSON$1); + +var _localsConvention = localsConvention; + +var _FileSystemLoader = _interopRequireDefault(FileSystemLoader$1); + +var _scoping = scoping; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const PLUGIN_NAME = "postcss-modules"; + +function isGlobalModule(globalModules, inputFile) { + return globalModules.some(regex => inputFile.match(regex)); +} + +function getDefaultPluginsList(opts, inputFile) { + const globalModulesList = opts.globalModulePaths || null; + const exportGlobals = opts.exportGlobals || false; + const defaultBehaviour = (0, _scoping.getDefaultScopeBehaviour)(opts.scopeBehaviour); + const generateScopedName = (0, _scoping.getScopedNameGenerator)(opts.generateScopedName, opts.hashPrefix); + + if (globalModulesList && isGlobalModule(globalModulesList, inputFile)) { + return (0, _scoping.getDefaultPlugins)({ + behaviour: _scoping.behaviours.GLOBAL, + generateScopedName, + exportGlobals + }); + } + + return (0, _scoping.getDefaultPlugins)({ + behaviour: defaultBehaviour, + generateScopedName, + exportGlobals + }); +} + +function getLoader(opts, plugins) { + const root = typeof opts.root === "undefined" ? "/" : opts.root; + return typeof opts.Loader === "function" ? new opts.Loader(root, plugins, opts.resolve) : new _FileSystemLoader.default(root, plugins, opts.resolve); +} + +function isOurPlugin(plugin) { + return plugin.postcssPlugin === PLUGIN_NAME; +} + +function makePlugin(opts) { + return { + postcssPlugin: PLUGIN_NAME, + + async OnceExit(css, { + result + }) { + const getJSON = opts.getJSON || _saveJSON.default; + const inputFile = css.source.input.file; + const pluginList = getDefaultPluginsList(opts, inputFile); + const resultPluginIndex = result.processor.plugins.findIndex(plugin => isOurPlugin(plugin)); + + if (resultPluginIndex === -1) { + throw new Error("Plugin missing from options."); + } + + const earlierPlugins = result.processor.plugins.slice(0, resultPluginIndex); + const loaderPlugins = [...earlierPlugins, ...pluginList]; + const loader = getLoader(opts, loaderPlugins); + + const fetcher = async (file, relativeTo, depTrace) => { + const unquoteFile = (0, _unquote.default)(file); + return loader.fetch.call(loader, unquoteFile, relativeTo, depTrace); + }; + + const parser = new _Parser.default(fetcher); + await (0, _postcss.default)([...pluginList, parser.plugin()]).process(css, { + from: inputFile + }); + const out = loader.finalSource; + if (out) css.prepend(out); + + if (opts.localsConvention) { + const reducer = (0, _localsConvention.makeLocalsConventionReducer)(opts.localsConvention, inputFile); + parser.exportTokens = Object.entries(parser.exportTokens).reduce(reducer, {}); + } + + result.messages.push({ + type: "export", + plugin: "postcss-modules", + exportTokens: parser.exportTokens + }); // getJSON may return a promise + + return getJSON(css.source.input.file, parser.exportTokens, result.opts.to); + } + + }; +} + +var _fs = require$$0$2; + +var _fs2 = fs; + +var _pluginFactory = pluginFactory; + +(0, _fs2.setFileSystem)({ + readFile: _fs.readFile, + writeFile: _fs.writeFile +}); + +build.exports = (opts = {}) => (0, _pluginFactory.makePlugin)(opts); + +var postcss = build.exports.postcss = true; + +var buildExports = build.exports; +var index = /*@__PURE__*/getDefaultExportFromCjs(buildExports); + +var index$1 = /*#__PURE__*/_mergeNamespaces({ + __proto__: null, + default: index, + postcss: postcss +}, [buildExports]); + +export { index$1 as i }; diff --git a/seller_1/node_modules/vite/dist/node/chunks/dep-CjE1AkI6.js b/seller_1/node_modules/vite/dist/node/chunks/dep-CjE1AkI6.js new file mode 100644 index 0000000..3e3dcd4 --- /dev/null +++ b/seller_1/node_modules/vite/dist/node/chunks/dep-CjE1AkI6.js @@ -0,0 +1,822 @@ +import { N as getDefaultExportFromCjs } from './dep-yUJfKD1i.js'; +import require$$0 from 'path'; +import { l as lib } from './dep-3RmXg9uo.js'; + +import { createRequire as __cjs_createRequire } from 'node:module'; + +const __require = __cjs_createRequire(import.meta.url); +function _mergeNamespaces(n, m) { + for (var i = 0; i < m.length; i++) { + var e = m[i]; + if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) { + if (k !== 'default' && !(k in n)) { + n[k] = e[k]; + } + } } + } + return n; +} + +var formatImportPrelude$2 = function formatImportPrelude(layer, media, supports) { + const parts = []; + + if (typeof layer !== "undefined") { + let layerParams = "layer"; + if (layer) { + layerParams = `layer(${layer})`; + } + + parts.push(layerParams); + } + + if (typeof supports !== "undefined") { + parts.push(`supports(${supports})`); + } + + if (typeof media !== "undefined") { + parts.push(media); + } + + return parts.join(" ") +}; + +const formatImportPrelude$1 = formatImportPrelude$2; + +// Base64 encode an import with conditions +// The order of conditions is important and is interleaved with cascade layer declarations +// Each group of conditions and cascade layers needs to be interpreted in order +// To achieve this we create a list of base64 encoded imports, where each import contains a stylesheet with another import. +// Each import can define a single group of conditions and a single cascade layer. +var base64EncodedImport = function base64EncodedConditionalImport(prelude, conditions) { + conditions.reverse(); + const first = conditions.pop(); + let params = `${prelude} ${formatImportPrelude$1( + first.layer, + first.media, + first.supports, + )}`; + + for (const condition of conditions) { + params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString( + "base64", + )}' ${formatImportPrelude$1( + condition.layer, + condition.media, + condition.supports, + )}`; + } + + return params +}; + +const base64EncodedConditionalImport = base64EncodedImport; + +var applyConditions$1 = function applyConditions(bundle, atRule) { + bundle.forEach(stmt => { + if ( + stmt.type === "charset" || + stmt.type === "warning" || + !stmt.conditions?.length + ) { + return + } + + if (stmt.type === "import") { + stmt.node.params = base64EncodedConditionalImport( + stmt.fullUri, + stmt.conditions, + ); + return + } + + const { nodes } = stmt; + const { parent } = nodes[0]; + + const atRules = []; + + // Convert conditions to at-rules + for (const condition of stmt.conditions) { + if (typeof condition.media !== "undefined") { + const mediaNode = atRule({ + name: "media", + params: condition.media, + source: parent.source, + }); + + atRules.push(mediaNode); + } + + if (typeof condition.supports !== "undefined") { + const supportsNode = atRule({ + name: "supports", + params: `(${condition.supports})`, + source: parent.source, + }); + + atRules.push(supportsNode); + } + + if (typeof condition.layer !== "undefined") { + const layerNode = atRule({ + name: "layer", + params: condition.layer, + source: parent.source, + }); + + atRules.push(layerNode); + } + } + + // Add nodes to AST + const outerAtRule = atRules.shift(); + const innerAtRule = atRules.reduce((previous, next) => { + previous.append(next); + return next + }, outerAtRule); + + parent.insertBefore(nodes[0], outerAtRule); + + // remove nodes + nodes.forEach(node => { + node.parent = undefined; + }); + + // better output + nodes[0].raws.before = nodes[0].raws.before || "\n"; + + // wrap new rules with media query and/or layer at rule + innerAtRule.append(nodes); + + stmt.type = "nodes"; + stmt.nodes = [outerAtRule]; + delete stmt.node; + }); +}; + +var applyRaws$1 = function applyRaws(bundle) { + bundle.forEach((stmt, index) => { + if (index === 0) return + + if (stmt.parent) { + const { before } = stmt.parent.node.raws; + if (stmt.type === "nodes") stmt.nodes[0].raws.before = before; + else stmt.node.raws.before = before; + } else if (stmt.type === "nodes") { + stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n"; + } + }); +}; + +var applyStyles$1 = function applyStyles(bundle, styles) { + styles.nodes = []; + + // Strip additional statements. + bundle.forEach(stmt => { + if (["charset", "import"].includes(stmt.type)) { + stmt.node.parent = undefined; + styles.append(stmt.node); + } else if (stmt.type === "nodes") { + stmt.nodes.forEach(node => { + node.parent = undefined; + styles.append(node); + }); + } + }); +}; + +const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i; +const base64DataURLRegexp = /^data:text\/css;base64,/i; +const plainDataURLRegexp = /^data:text\/css;plain,/i; + +function isValid(url) { + return anyDataURLRegexp.test(url) +} + +function contents(url) { + if (base64DataURLRegexp.test(url)) { + // "data:text/css;base64,".length === 21 + return Buffer.from(url.slice(21), "base64").toString() + } + + if (plainDataURLRegexp.test(url)) { + // "data:text/css;plain,".length === 20 + return decodeURIComponent(url.slice(20)) + } + + // "data:text/css,".length === 14 + return decodeURIComponent(url.slice(14)) +} + +var dataUrl = { + isValid, + contents, +}; + +// external tooling +const valueParser = lib; + +// extended tooling +const { stringify } = valueParser; + +var parseStatements$1 = function parseStatements(result, styles, conditions, from) { + const statements = []; + let nodes = []; + + styles.each(node => { + let stmt; + if (node.type === "atrule") { + if (node.name === "import") + stmt = parseImport(result, node, conditions, from); + else if (node.name === "charset") + stmt = parseCharset(result, node, conditions, from); + } + + if (stmt) { + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + conditions: [...conditions], + from, + }); + nodes = []; + } + statements.push(stmt); + } else nodes.push(node); + }); + + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + conditions: [...conditions], + from, + }); + } + + return statements +}; + +function parseCharset(result, atRule, conditions, from) { + if (atRule.prev()) { + return result.warn("@charset must precede all other statements", { + node: atRule, + }) + } + return { + type: "charset", + node: atRule, + conditions: [...conditions], + from, + } +} + +function parseImport(result, atRule, conditions, from) { + let prev = atRule.prev(); + + // `@import` statements may follow other `@import` statements. + if (prev) { + do { + if ( + prev.type === "comment" || + (prev.type === "atrule" && prev.name === "import") + ) { + prev = prev.prev(); + continue + } + + break + } while (prev) + } + + // All `@import` statements may be preceded by `@charset` or `@layer` statements. + // But the `@import` statements must be consecutive. + if (prev) { + do { + if ( + prev.type === "comment" || + (prev.type === "atrule" && + (prev.name === "charset" || (prev.name === "layer" && !prev.nodes))) + ) { + prev = prev.prev(); + continue + } + + return result.warn( + "@import must precede all other statements (besides @charset or empty @layer)", + { node: atRule }, + ) + } while (prev) + } + + if (atRule.nodes) { + return result.warn( + "It looks like you didn't end your @import statement correctly. " + + "Child nodes are attached to it.", + { node: atRule }, + ) + } + + const params = valueParser(atRule.params).nodes; + const stmt = { + type: "import", + uri: "", + fullUri: "", + node: atRule, + conditions: [...conditions], + from, + }; + + let layer; + let media; + let supports; + + for (let i = 0; i < params.length; i++) { + const node = params[i]; + + if (node.type === "space" || node.type === "comment") continue + + if (node.type === "string") { + if (stmt.uri) { + return result.warn(`Multiple url's in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (!node.value) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + stmt.uri = node.value; + stmt.fullUri = stringify(node); + continue + } + + if (node.type === "function" && /^url$/i.test(node.value)) { + if (stmt.uri) { + return result.warn(`Multiple url's in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (!node.nodes?.[0]?.value) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + stmt.uri = node.nodes[0].value; + stmt.fullUri = stringify(node); + continue + } + + if (!stmt.uri) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if ( + (node.type === "word" || node.type === "function") && + /^layer$/i.test(node.value) + ) { + if (typeof layer !== "undefined") { + return result.warn(`Multiple layers in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (typeof supports !== "undefined") { + return result.warn( + `layers must be defined before support conditions in '${atRule.toString()}'`, + { + node: atRule, + }, + ) + } + + if (node.nodes) { + layer = stringify(node.nodes); + } else { + layer = ""; + } + + continue + } + + if (node.type === "function" && /^supports$/i.test(node.value)) { + if (typeof supports !== "undefined") { + return result.warn( + `Multiple support conditions in '${atRule.toString()}'`, + { + node: atRule, + }, + ) + } + + supports = stringify(node.nodes); + + continue + } + + media = stringify(params.slice(i)); + break + } + + if (!stmt.uri) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if ( + typeof media !== "undefined" || + typeof layer !== "undefined" || + typeof supports !== "undefined" + ) { + stmt.conditions.push({ + layer, + media, + supports, + }); + } + + return stmt +} + +// builtin tooling +const path$2 = require$$0; + +// placeholder tooling +let sugarss; + +var processContent$1 = function processContent( + result, + content, + filename, + options, + postcss, +) { + const { plugins } = options; + const ext = path$2.extname(filename); + + const parserList = []; + + // SugarSS support: + if (ext === ".sss") { + if (!sugarss) { + /* c8 ignore next 3 */ + try { + sugarss = __require('sugarss'); + } catch {} // Ignore + } + if (sugarss) + return runPostcss(postcss, content, filename, plugins, [sugarss]) + } + + // Syntax support: + if (result.opts.syntax?.parse) { + parserList.push(result.opts.syntax.parse); + } + + // Parser support: + if (result.opts.parser) parserList.push(result.opts.parser); + // Try the default as a last resort: + parserList.push(null); + + return runPostcss(postcss, content, filename, plugins, parserList) +}; + +function runPostcss(postcss, content, filename, plugins, parsers, index) { + if (!index) index = 0; + return postcss(plugins) + .process(content, { + from: filename, + parser: parsers[index], + }) + .catch(err => { + // If there's an error, try the next parser + index++; + // If there are no parsers left, throw it + if (index === parsers.length) throw err + return runPostcss(postcss, content, filename, plugins, parsers, index) + }) +} + +const path$1 = require$$0; + +const dataURL = dataUrl; +const parseStatements = parseStatements$1; +const processContent = processContent$1; +const resolveId$1 = (id) => id; +const formatImportPrelude = formatImportPrelude$2; + +async function parseStyles$1( + result, + styles, + options, + state, + conditions, + from, + postcss, +) { + const statements = parseStatements(result, styles, conditions, from); + + for (const stmt of statements) { + if (stmt.type !== "import" || !isProcessableURL(stmt.uri)) { + continue + } + + if (options.filter && !options.filter(stmt.uri)) { + // rejected by filter + continue + } + + await resolveImportId(result, stmt, options, state, postcss); + } + + let charset; + const imports = []; + const bundle = []; + + function handleCharset(stmt) { + if (!charset) charset = stmt; + // charsets aren't case-sensitive, so convert to lower case to compare + else if ( + stmt.node.params.toLowerCase() !== charset.node.params.toLowerCase() + ) { + throw stmt.node.error( + `Incompatible @charset statements: + ${stmt.node.params} specified in ${stmt.node.source.input.file} + ${charset.node.params} specified in ${charset.node.source.input.file}`, + ) + } + } + + // squash statements and their children + statements.forEach(stmt => { + if (stmt.type === "charset") handleCharset(stmt); + else if (stmt.type === "import") { + if (stmt.children) { + stmt.children.forEach((child, index) => { + if (child.type === "import") imports.push(child); + else if (child.type === "charset") handleCharset(child); + else bundle.push(child); + // For better output + if (index === 0) child.parent = stmt; + }); + } else imports.push(stmt); + } else if (stmt.type === "nodes") { + bundle.push(stmt); + } + }); + + return charset ? [charset, ...imports.concat(bundle)] : imports.concat(bundle) +} + +async function resolveImportId(result, stmt, options, state, postcss) { + if (dataURL.isValid(stmt.uri)) { + // eslint-disable-next-line require-atomic-updates + stmt.children = await loadImportContent( + result, + stmt, + stmt.uri, + options, + state, + postcss, + ); + + return + } else if (dataURL.isValid(stmt.from.slice(-1))) { + // Data urls can't be used as a base url to resolve imports. + throw stmt.node.error( + `Unable to import '${stmt.uri}' from a stylesheet that is embedded in a data url`, + ) + } + + const atRule = stmt.node; + let sourceFile; + if (atRule.source?.input?.file) { + sourceFile = atRule.source.input.file; + } + const base = sourceFile + ? path$1.dirname(atRule.source.input.file) + : options.root; + + const paths = [await options.resolve(stmt.uri, base, options, atRule)].flat(); + + // Ensure that each path is absolute: + const resolved = await Promise.all( + paths.map(file => { + return !path$1.isAbsolute(file) + ? resolveId$1(file) + : file + }), + ); + + // Add dependency messages: + resolved.forEach(file => { + result.messages.push({ + type: "dependency", + plugin: "postcss-import", + file, + parent: sourceFile, + }); + }); + + const importedContent = await Promise.all( + resolved.map(file => { + return loadImportContent(result, stmt, file, options, state, postcss) + }), + ); + + // Merge loaded statements + // eslint-disable-next-line require-atomic-updates + stmt.children = importedContent.flat().filter(x => !!x); +} + +async function loadImportContent( + result, + stmt, + filename, + options, + state, + postcss, +) { + const atRule = stmt.node; + const { conditions, from } = stmt; + const stmtDuplicateCheckKey = conditions + .map(condition => + formatImportPrelude(condition.layer, condition.media, condition.supports), + ) + .join(":"); + + if (options.skipDuplicates) { + // skip files already imported at the same scope + if (state.importedFiles[filename]?.[stmtDuplicateCheckKey]) { + return + } + + // save imported files to skip them next time + if (!state.importedFiles[filename]) { + state.importedFiles[filename] = {}; + } + state.importedFiles[filename][stmtDuplicateCheckKey] = true; + } + + if (from.includes(filename)) { + return + } + + const content = await options.load(filename, options); + + if (content.trim() === "" && options.warnOnEmpty) { + result.warn(`${filename} is empty`, { node: atRule }); + return + } + + // skip previous imported files not containing @import rules + if ( + options.skipDuplicates && + state.hashFiles[content]?.[stmtDuplicateCheckKey] + ) { + return + } + + const importedResult = await processContent( + result, + content, + filename, + options, + postcss, + ); + + const styles = importedResult.root; + result.messages = result.messages.concat(importedResult.messages); + + if (options.skipDuplicates) { + const hasImport = styles.some(child => { + return child.type === "atrule" && child.name === "import" + }); + if (!hasImport) { + // save hash files to skip them next time + if (!state.hashFiles[content]) { + state.hashFiles[content] = {}; + } + + state.hashFiles[content][stmtDuplicateCheckKey] = true; + } + } + + // recursion: import @import from imported file + return parseStyles$1( + result, + styles, + options, + state, + conditions, + [...from, filename], + postcss, + ) +} + +function isProcessableURL(uri) { + // skip protocol base uri (protocol://url) or protocol-relative + if (/^(?:[a-z]+:)?\/\//i.test(uri)) { + return false + } + + // check for fragment or query + try { + // needs a base to parse properly + const url = new URL(uri, "https://example.com"); + if (url.search) { + return false + } + } catch {} // Ignore + + return true +} + +var parseStyles_1 = parseStyles$1; + +// builtin tooling +const path = require$$0; + +// internal tooling +const applyConditions = applyConditions$1; +const applyRaws = applyRaws$1; +const applyStyles = applyStyles$1; +const loadContent = () => ""; +const parseStyles = parseStyles_1; +const resolveId = (id) => id; + +function AtImport(options) { + options = { + root: process.cwd(), + path: [], + skipDuplicates: true, + resolve: resolveId, + load: loadContent, + plugins: [], + addModulesDirectories: [], + warnOnEmpty: true, + ...options, + }; + + options.root = path.resolve(options.root); + + // convert string to an array of a single element + if (typeof options.path === "string") options.path = [options.path]; + + if (!Array.isArray(options.path)) options.path = []; + + options.path = options.path.map(p => path.resolve(options.root, p)); + + return { + postcssPlugin: "postcss-import", + async Once(styles, { result, atRule, postcss }) { + const state = { + importedFiles: {}, + hashFiles: {}, + }; + + if (styles.source?.input?.file) { + state.importedFiles[styles.source.input.file] = {}; + } + + if (options.plugins && !Array.isArray(options.plugins)) { + throw new Error("plugins option must be an array") + } + + const bundle = await parseStyles( + result, + styles, + options, + state, + [], + [], + postcss, + ); + + applyRaws(bundle); + applyConditions(bundle, atRule); + applyStyles(bundle, styles); + }, + } +} + +AtImport.postcss = true; + +var postcssImport = AtImport; + +var index = /*@__PURE__*/getDefaultExportFromCjs(postcssImport); + +var index$1 = /*#__PURE__*/_mergeNamespaces({ + __proto__: null, + default: index +}, [postcssImport]); + +export { index$1 as i }; diff --git a/seller_1/node_modules/vite/dist/node/chunks/dep-DnSxfB-q.js b/seller_1/node_modules/vite/dist/node/chunks/dep-DnSxfB-q.js new file mode 100644 index 0000000..f04ffb4 --- /dev/null +++ b/seller_1/node_modules/vite/dist/node/chunks/dep-DnSxfB-q.js @@ -0,0 +1,8221 @@ +const UNDEFINED_CODE_POINTS = new Set([ + 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, + 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, + 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, + 1048575, 1114110, 1114111, +]); +const REPLACEMENT_CHARACTER = '\uFFFD'; +var CODE_POINTS; +(function (CODE_POINTS) { + CODE_POINTS[CODE_POINTS["EOF"] = -1] = "EOF"; + CODE_POINTS[CODE_POINTS["NULL"] = 0] = "NULL"; + CODE_POINTS[CODE_POINTS["TABULATION"] = 9] = "TABULATION"; + CODE_POINTS[CODE_POINTS["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN"; + CODE_POINTS[CODE_POINTS["LINE_FEED"] = 10] = "LINE_FEED"; + CODE_POINTS[CODE_POINTS["FORM_FEED"] = 12] = "FORM_FEED"; + CODE_POINTS[CODE_POINTS["SPACE"] = 32] = "SPACE"; + CODE_POINTS[CODE_POINTS["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK"; + CODE_POINTS[CODE_POINTS["QUOTATION_MARK"] = 34] = "QUOTATION_MARK"; + CODE_POINTS[CODE_POINTS["AMPERSAND"] = 38] = "AMPERSAND"; + CODE_POINTS[CODE_POINTS["APOSTROPHE"] = 39] = "APOSTROPHE"; + CODE_POINTS[CODE_POINTS["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS"; + CODE_POINTS[CODE_POINTS["SOLIDUS"] = 47] = "SOLIDUS"; + CODE_POINTS[CODE_POINTS["DIGIT_0"] = 48] = "DIGIT_0"; + CODE_POINTS[CODE_POINTS["DIGIT_9"] = 57] = "DIGIT_9"; + CODE_POINTS[CODE_POINTS["SEMICOLON"] = 59] = "SEMICOLON"; + CODE_POINTS[CODE_POINTS["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN"; + CODE_POINTS[CODE_POINTS["EQUALS_SIGN"] = 61] = "EQUALS_SIGN"; + CODE_POINTS[CODE_POINTS["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN"; + CODE_POINTS[CODE_POINTS["QUESTION_MARK"] = 63] = "QUESTION_MARK"; + CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_A"] = 65] = "LATIN_CAPITAL_A"; + CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_Z"] = 90] = "LATIN_CAPITAL_Z"; + CODE_POINTS[CODE_POINTS["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET"; + CODE_POINTS[CODE_POINTS["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT"; + CODE_POINTS[CODE_POINTS["LATIN_SMALL_A"] = 97] = "LATIN_SMALL_A"; + CODE_POINTS[CODE_POINTS["LATIN_SMALL_Z"] = 122] = "LATIN_SMALL_Z"; +})(CODE_POINTS || (CODE_POINTS = {})); +const SEQUENCES = { + DASH_DASH: '--', + CDATA_START: '[CDATA[', + DOCTYPE: 'doctype', + SCRIPT: 'script', + PUBLIC: 'public', + SYSTEM: 'system', +}; +//Surrogates +function isSurrogate(cp) { + return cp >= 55296 && cp <= 57343; +} +function isSurrogatePair(cp) { + return cp >= 56320 && cp <= 57343; +} +function getSurrogatePairCodePoint(cp1, cp2) { + return (cp1 - 55296) * 1024 + 9216 + cp2; +} +//NOTE: excluding NULL and ASCII whitespace +function isControlCodePoint(cp) { + return ((cp !== 0x20 && cp !== 0x0a && cp !== 0x0d && cp !== 0x09 && cp !== 0x0c && cp >= 0x01 && cp <= 0x1f) || + (cp >= 0x7f && cp <= 0x9f)); +} +function isUndefinedCodePoint(cp) { + return (cp >= 64976 && cp <= 65007) || UNDEFINED_CODE_POINTS.has(cp); +} + +var ERR; +(function (ERR) { + ERR["controlCharacterInInputStream"] = "control-character-in-input-stream"; + ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream"; + ERR["surrogateInInputStream"] = "surrogate-in-input-stream"; + ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus"; + ERR["endTagWithAttributes"] = "end-tag-with-attributes"; + ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus"; + ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag"; + ERR["unexpectedNullCharacter"] = "unexpected-null-character"; + ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name"; + ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name"; + ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name"; + ERR["missingEndTagName"] = "missing-end-tag-name"; + ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name"; + ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference"; + ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference"; + ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier"; + ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value"; + ERR["eofBeforeTagName"] = "eof-before-tag-name"; + ERR["eofInTag"] = "eof-in-tag"; + ERR["missingAttributeValue"] = "missing-attribute-value"; + ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes"; + ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword"; + ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers"; + ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword"; + ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier"; + ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier"; + ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier"; + ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier"; + ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier"; + ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier"; + ERR["cdataInHtmlContent"] = "cdata-in-html-content"; + ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment"; + ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text"; + ERR["eofInDoctype"] = "eof-in-doctype"; + ERR["nestedComment"] = "nested-comment"; + ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment"; + ERR["eofInComment"] = "eof-in-comment"; + ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment"; + ERR["eofInCdata"] = "eof-in-cdata"; + ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference"; + ERR["nullCharacterReference"] = "null-character-reference"; + ERR["surrogateCharacterReference"] = "surrogate-character-reference"; + ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range"; + ERR["controlCharacterReference"] = "control-character-reference"; + ERR["noncharacterCharacterReference"] = "noncharacter-character-reference"; + ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name"; + ERR["missingDoctypeName"] = "missing-doctype-name"; + ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name"; + ERR["duplicateAttribute"] = "duplicate-attribute"; + ERR["nonConformingDoctype"] = "non-conforming-doctype"; + ERR["missingDoctype"] = "missing-doctype"; + ERR["misplacedDoctype"] = "misplaced-doctype"; + ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element"; + ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements"; + ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head"; + ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof"; + ERR["abandonedHeadElementChild"] = "abandoned-head-element-child"; + ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element"; + ERR["nestedNoscriptInHead"] = "nested-noscript-in-head"; + ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text"; +})(ERR || (ERR = {})); + +//Const +const DEFAULT_BUFFER_WATERLINE = 1 << 16; +//Preprocessor +//NOTE: HTML input preprocessing +//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream) +class Preprocessor { + constructor(handler) { + this.handler = handler; + this.html = ''; + this.pos = -1; + // NOTE: Initial `lastGapPos` is -2, to ensure `col` on initialisation is 0 + this.lastGapPos = -2; + this.gapStack = []; + this.skipNextNewLine = false; + this.lastChunkWritten = false; + this.endOfChunkHit = false; + this.bufferWaterline = DEFAULT_BUFFER_WATERLINE; + this.isEol = false; + this.lineStartPos = 0; + this.droppedBufferSize = 0; + this.line = 1; + //NOTE: avoid reporting errors twice on advance/retreat + this.lastErrOffset = -1; + } + /** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */ + get col() { + return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos); + } + get offset() { + return this.droppedBufferSize + this.pos; + } + getError(code, cpOffset) { + const { line, col, offset } = this; + const startCol = col + cpOffset; + const startOffset = offset + cpOffset; + return { + code, + startLine: line, + endLine: line, + startCol, + endCol: startCol, + startOffset, + endOffset: startOffset, + }; + } + _err(code) { + if (this.handler.onParseError && this.lastErrOffset !== this.offset) { + this.lastErrOffset = this.offset; + this.handler.onParseError(this.getError(code, 0)); + } + } + _addGap() { + this.gapStack.push(this.lastGapPos); + this.lastGapPos = this.pos; + } + _processSurrogate(cp) { + //NOTE: try to peek a surrogate pair + if (this.pos !== this.html.length - 1) { + const nextCp = this.html.charCodeAt(this.pos + 1); + if (isSurrogatePair(nextCp)) { + //NOTE: we have a surrogate pair. Peek pair character and recalculate code point. + this.pos++; + //NOTE: add a gap that should be avoided during retreat + this._addGap(); + return getSurrogatePairCodePoint(cp, nextCp); + } + } + //NOTE: we are at the end of a chunk, therefore we can't infer the surrogate pair yet. + else if (!this.lastChunkWritten) { + this.endOfChunkHit = true; + return CODE_POINTS.EOF; + } + //NOTE: isolated surrogate + this._err(ERR.surrogateInInputStream); + return cp; + } + willDropParsedChunk() { + return this.pos > this.bufferWaterline; + } + dropParsedChunk() { + if (this.willDropParsedChunk()) { + this.html = this.html.substring(this.pos); + this.lineStartPos -= this.pos; + this.droppedBufferSize += this.pos; + this.pos = 0; + this.lastGapPos = -2; + this.gapStack.length = 0; + } + } + write(chunk, isLastChunk) { + if (this.html.length > 0) { + this.html += chunk; + } + else { + this.html = chunk; + } + this.endOfChunkHit = false; + this.lastChunkWritten = isLastChunk; + } + insertHtmlAtCurrentPos(chunk) { + this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1); + this.endOfChunkHit = false; + } + startsWith(pattern, caseSensitive) { + // Check if our buffer has enough characters + if (this.pos + pattern.length > this.html.length) { + this.endOfChunkHit = !this.lastChunkWritten; + return false; + } + if (caseSensitive) { + return this.html.startsWith(pattern, this.pos); + } + for (let i = 0; i < pattern.length; i++) { + const cp = this.html.charCodeAt(this.pos + i) | 0x20; + if (cp !== pattern.charCodeAt(i)) { + return false; + } + } + return true; + } + peek(offset) { + const pos = this.pos + offset; + if (pos >= this.html.length) { + this.endOfChunkHit = !this.lastChunkWritten; + return CODE_POINTS.EOF; + } + const code = this.html.charCodeAt(pos); + return code === CODE_POINTS.CARRIAGE_RETURN ? CODE_POINTS.LINE_FEED : code; + } + advance() { + this.pos++; + //NOTE: LF should be in the last column of the line + if (this.isEol) { + this.isEol = false; + this.line++; + this.lineStartPos = this.pos; + } + if (this.pos >= this.html.length) { + this.endOfChunkHit = !this.lastChunkWritten; + return CODE_POINTS.EOF; + } + let cp = this.html.charCodeAt(this.pos); + //NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters + if (cp === CODE_POINTS.CARRIAGE_RETURN) { + this.isEol = true; + this.skipNextNewLine = true; + return CODE_POINTS.LINE_FEED; + } + //NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character + //must be ignored. + if (cp === CODE_POINTS.LINE_FEED) { + this.isEol = true; + if (this.skipNextNewLine) { + // `line` will be bumped again in the recursive call. + this.line--; + this.skipNextNewLine = false; + this._addGap(); + return this.advance(); + } + } + this.skipNextNewLine = false; + if (isSurrogate(cp)) { + cp = this._processSurrogate(cp); + } + //OPTIMIZATION: first check if code point is in the common allowed + //range (ASCII alphanumeric, whitespaces, big chunk of BMP) + //before going into detailed performance cost validation. + const isCommonValidRange = this.handler.onParseError === null || + (cp > 0x1f && cp < 0x7f) || + cp === CODE_POINTS.LINE_FEED || + cp === CODE_POINTS.CARRIAGE_RETURN || + (cp > 0x9f && cp < 64976); + if (!isCommonValidRange) { + this._checkForProblematicCharacters(cp); + } + return cp; + } + _checkForProblematicCharacters(cp) { + if (isControlCodePoint(cp)) { + this._err(ERR.controlCharacterInInputStream); + } + else if (isUndefinedCodePoint(cp)) { + this._err(ERR.noncharacterInInputStream); + } + } + retreat(count) { + this.pos -= count; + while (this.pos < this.lastGapPos) { + this.lastGapPos = this.gapStack.pop(); + this.pos--; + } + this.isEol = false; + } +} + +var TokenType; +(function (TokenType) { + TokenType[TokenType["CHARACTER"] = 0] = "CHARACTER"; + TokenType[TokenType["NULL_CHARACTER"] = 1] = "NULL_CHARACTER"; + TokenType[TokenType["WHITESPACE_CHARACTER"] = 2] = "WHITESPACE_CHARACTER"; + TokenType[TokenType["START_TAG"] = 3] = "START_TAG"; + TokenType[TokenType["END_TAG"] = 4] = "END_TAG"; + TokenType[TokenType["COMMENT"] = 5] = "COMMENT"; + TokenType[TokenType["DOCTYPE"] = 6] = "DOCTYPE"; + TokenType[TokenType["EOF"] = 7] = "EOF"; + TokenType[TokenType["HIBERNATION"] = 8] = "HIBERNATION"; +})(TokenType || (TokenType = {})); +function getTokenAttr(token, attrName) { + for (let i = token.attrs.length - 1; i >= 0; i--) { + if (token.attrs[i].name === attrName) { + return token.attrs[i].value; + } + } + return null; +} + +// Generated using scripts/write-decode-map.ts +var htmlDecodeTree = new Uint16Array( +// prettier-ignore +"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c" + .split("") + .map((c) => c.charCodeAt(0))); + +// Generated using scripts/write-decode-map.ts +new Uint16Array( +// prettier-ignore +"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" + .split("") + .map((c) => c.charCodeAt(0))); + +// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 +const decodeMap = new Map([ + [0, 65533], + // C1 Unicode control character reference replacements + [128, 8364], + [130, 8218], + [131, 402], + [132, 8222], + [133, 8230], + [134, 8224], + [135, 8225], + [136, 710], + [137, 8240], + [138, 352], + [139, 8249], + [140, 338], + [142, 381], + [145, 8216], + [146, 8217], + [147, 8220], + [148, 8221], + [149, 8226], + [150, 8211], + [151, 8212], + [152, 732], + [153, 8482], + [154, 353], + [155, 8250], + [156, 339], + [158, 382], + [159, 376], +]); +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +function replaceCodePoint(codePoint) { + var _a; + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return 0xfffd; + } + return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; +} + +var CharCodes; +(function (CharCodes) { + CharCodes[CharCodes["NUM"] = 35] = "NUM"; + CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; + CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; + CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; + CharCodes[CharCodes["NINE"] = 57] = "NINE"; + CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; + CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; + CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; + CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; + CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; + CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; + CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; +})(CharCodes || (CharCodes = {})); +/** Bit that needs to be set to convert an upper case ASCII character to lower case */ +const TO_LOWER_BIT = 0b100000; +var BinTrieFlags; +(function (BinTrieFlags) { + BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; + BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; + BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; +})(BinTrieFlags || (BinTrieFlags = {})); +function isNumber(code) { + return code >= CharCodes.ZERO && code <= CharCodes.NINE; +} +function isHexadecimalCharacter(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); +} +function isAsciiAlphaNumeric$1(code) { + return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || + (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || + isNumber(code)); +} +/** + * Checks if the given character is a valid end character for an entity in an attribute. + * + * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. + * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state + */ +function isEntityInAttributeInvalidEnd(code) { + return code === CharCodes.EQUALS || isAsciiAlphaNumeric$1(code); +} +var EntityDecoderState; +(function (EntityDecoderState) { + EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; + EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; + EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; + EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; + EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; +})(EntityDecoderState || (EntityDecoderState = {})); +var DecodingMode; +(function (DecodingMode) { + /** Entities in text nodes that can end with any character. */ + DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; + /** Only allow entities terminated with a semicolon. */ + DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; + /** Entities in attributes have limitations on ending characters. */ + DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; +})(DecodingMode || (DecodingMode = {})); +/** + * Token decoder with support of writing partial entities. + */ +class EntityDecoder { + constructor( + /** The tree used to decode entities. */ + decodeTree, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint, + /** An object that is used to produce errors. */ + errors) { + this.decodeTree = decodeTree; + this.emitCodePoint = emitCodePoint; + this.errors = errors; + /** The current state of the decoder. */ + this.state = EntityDecoderState.EntityStart; + /** Characters that were consumed while parsing an entity. */ + this.consumed = 1; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + this.result = 0; + /** The current index in the decode tree. */ + this.treeIndex = 0; + /** The number of characters that were consumed in excess. */ + this.excess = 1; + /** The mode in which the decoder is operating. */ + this.decodeMode = DecodingMode.Strict; + } + /** Resets the instance to make it reusable. */ + startEntity(decodeMode) { + this.decodeMode = decodeMode; + this.state = EntityDecoderState.EntityStart; + this.result = 0; + this.treeIndex = 0; + this.excess = 1; + this.consumed = 1; + } + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + write(str, offset) { + switch (this.state) { + case EntityDecoderState.EntityStart: { + if (str.charCodeAt(offset) === CharCodes.NUM) { + this.state = EntityDecoderState.NumericStart; + this.consumed += 1; + return this.stateNumericStart(str, offset + 1); + } + this.state = EntityDecoderState.NamedEntity; + return this.stateNamedEntity(str, offset); + } + case EntityDecoderState.NumericStart: { + return this.stateNumericStart(str, offset); + } + case EntityDecoderState.NumericDecimal: { + return this.stateNumericDecimal(str, offset); + } + case EntityDecoderState.NumericHex: { + return this.stateNumericHex(str, offset); + } + case EntityDecoderState.NamedEntity: { + return this.stateNamedEntity(str, offset); + } + } + } + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericStart(str, offset) { + if (offset >= str.length) { + return -1; + } + if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { + this.state = EntityDecoderState.NumericHex; + this.consumed += 1; + return this.stateNumericHex(str, offset + 1); + } + this.state = EntityDecoderState.NumericDecimal; + return this.stateNumericDecimal(str, offset); + } + addToNumericResult(str, start, end, base) { + if (start !== end) { + const digitCount = end - start; + this.result = + this.result * Math.pow(base, digitCount) + + parseInt(str.substr(start, digitCount), base); + this.consumed += digitCount; + } + } + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericHex(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber(char) || isHexadecimalCharacter(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 16); + return this.emitNumericEntity(char, 3); + } + } + this.addToNumericResult(str, startIdx, offset, 16); + return -1; + } + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNumericDecimal(str, offset) { + const startIdx = offset; + while (offset < str.length) { + const char = str.charCodeAt(offset); + if (isNumber(char)) { + offset += 1; + } + else { + this.addToNumericResult(str, startIdx, offset, 10); + return this.emitNumericEntity(char, 2); + } + } + this.addToNumericResult(str, startIdx, offset, 10); + return -1; + } + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + emitNumericEntity(lastCp, expectedLength) { + var _a; + // Ensure we consumed at least one digit. + if (this.consumed <= expectedLength) { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + // Figure out if this is a legit end of the entity + if (lastCp === CharCodes.SEMI) { + this.consumed += 1; + } + else if (this.decodeMode === DecodingMode.Strict) { + return 0; + } + this.emitCodePoint(replaceCodePoint(this.result), this.consumed); + if (this.errors) { + if (lastCp !== CharCodes.SEMI) { + this.errors.missingSemicolonAfterCharacterReference(); + } + this.errors.validateNumericCharacterReference(this.result); + } + return this.consumed; + } + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + stateNamedEntity(str, offset) { + const { decodeTree } = this; + let current = decodeTree[this.treeIndex]; + // The mask is the number of bytes of the value, including the current byte. + let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + for (; offset < str.length; offset++, this.excess++) { + const char = str.charCodeAt(offset); + this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); + if (this.treeIndex < 0) { + return this.result === 0 || + // If we are parsing an attribute + (this.decodeMode === DecodingMode.Attribute && + // We shouldn't have consumed any characters after the entity, + (valueLength === 0 || + // And there should be no invalid characters. + isEntityInAttributeInvalidEnd(char))) + ? 0 + : this.emitNotTerminatedNamedEntity(); + } + current = decodeTree[this.treeIndex]; + valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + // If the branch is a value, store it and continue + if (valueLength !== 0) { + // If the entity is terminated by a semicolon, we are done. + if (char === CharCodes.SEMI) { + return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); + } + // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. + if (this.decodeMode !== DecodingMode.Strict) { + this.result = this.treeIndex; + this.consumed += this.excess; + this.excess = 0; + } + } + } + return -1; + } + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + emitNotTerminatedNamedEntity() { + var _a; + const { result, decodeTree } = this; + const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; + this.emitNamedEntityData(result, valueLength, this.consumed); + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); + return this.consumed; + } + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + emitNamedEntityData(result, valueLength, consumed) { + const { decodeTree } = this; + this.emitCodePoint(valueLength === 1 + ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH + : decodeTree[result + 1], consumed); + if (valueLength === 3) { + // For multi-byte values, we need to emit the second byte. + this.emitCodePoint(decodeTree[result + 2], consumed); + } + return consumed; + } + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + end() { + var _a; + switch (this.state) { + case EntityDecoderState.NamedEntity: { + // Emit a named entity if we have one. + return this.result !== 0 && + (this.decodeMode !== DecodingMode.Attribute || + this.result === this.treeIndex) + ? this.emitNotTerminatedNamedEntity() + : 0; + } + // Otherwise, emit a numeric entity if we have one. + case EntityDecoderState.NumericDecimal: { + return this.emitNumericEntity(0, 2); + } + case EntityDecoderState.NumericHex: { + return this.emitNumericEntity(0, 3); + } + case EntityDecoderState.NumericStart: { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + case EntityDecoderState.EntityStart: { + // Return 0 if we have no entity. + return 0; + } + } + } +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +function determineBranch(decodeTree, current, nodeIdx, char) { + const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; + const jumpOffset = current & BinTrieFlags.JUMP_TABLE; + // Case 1: Single branch encoded in jump offset + if (branchCount === 0) { + return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + } + // Case 2: Multiple branches encoded in jump table + if (jumpOffset) { + const value = char - jumpOffset; + return value < 0 || value >= branchCount + ? -1 + : decodeTree[nodeIdx + value] - 1; + } + // Case 3: Multiple branches encoded in dictionary + // Binary search for the character. + let lo = nodeIdx; + let hi = lo + branchCount - 1; + while (lo <= hi) { + const mid = (lo + hi) >>> 1; + const midVal = decodeTree[mid]; + if (midVal < char) { + lo = mid + 1; + } + else if (midVal > char) { + hi = mid - 1; + } + else { + return decodeTree[mid + branchCount]; + } + } + return -1; +} + +/** All valid namespaces in HTML. */ +var NS; +(function (NS) { + NS["HTML"] = "http://www.w3.org/1999/xhtml"; + NS["MATHML"] = "http://www.w3.org/1998/Math/MathML"; + NS["SVG"] = "http://www.w3.org/2000/svg"; + NS["XLINK"] = "http://www.w3.org/1999/xlink"; + NS["XML"] = "http://www.w3.org/XML/1998/namespace"; + NS["XMLNS"] = "http://www.w3.org/2000/xmlns/"; +})(NS || (NS = {})); +var ATTRS; +(function (ATTRS) { + ATTRS["TYPE"] = "type"; + ATTRS["ACTION"] = "action"; + ATTRS["ENCODING"] = "encoding"; + ATTRS["PROMPT"] = "prompt"; + ATTRS["NAME"] = "name"; + ATTRS["COLOR"] = "color"; + ATTRS["FACE"] = "face"; + ATTRS["SIZE"] = "size"; +})(ATTRS || (ATTRS = {})); +/** + * The mode of the document. + * + * @see {@link https://dom.spec.whatwg.org/#concept-document-limited-quirks} + */ +var DOCUMENT_MODE; +(function (DOCUMENT_MODE) { + DOCUMENT_MODE["NO_QUIRKS"] = "no-quirks"; + DOCUMENT_MODE["QUIRKS"] = "quirks"; + DOCUMENT_MODE["LIMITED_QUIRKS"] = "limited-quirks"; +})(DOCUMENT_MODE || (DOCUMENT_MODE = {})); +var TAG_NAMES; +(function (TAG_NAMES) { + TAG_NAMES["A"] = "a"; + TAG_NAMES["ADDRESS"] = "address"; + TAG_NAMES["ANNOTATION_XML"] = "annotation-xml"; + TAG_NAMES["APPLET"] = "applet"; + TAG_NAMES["AREA"] = "area"; + TAG_NAMES["ARTICLE"] = "article"; + TAG_NAMES["ASIDE"] = "aside"; + TAG_NAMES["B"] = "b"; + TAG_NAMES["BASE"] = "base"; + TAG_NAMES["BASEFONT"] = "basefont"; + TAG_NAMES["BGSOUND"] = "bgsound"; + TAG_NAMES["BIG"] = "big"; + TAG_NAMES["BLOCKQUOTE"] = "blockquote"; + TAG_NAMES["BODY"] = "body"; + TAG_NAMES["BR"] = "br"; + TAG_NAMES["BUTTON"] = "button"; + TAG_NAMES["CAPTION"] = "caption"; + TAG_NAMES["CENTER"] = "center"; + TAG_NAMES["CODE"] = "code"; + TAG_NAMES["COL"] = "col"; + TAG_NAMES["COLGROUP"] = "colgroup"; + TAG_NAMES["DD"] = "dd"; + TAG_NAMES["DESC"] = "desc"; + TAG_NAMES["DETAILS"] = "details"; + TAG_NAMES["DIALOG"] = "dialog"; + TAG_NAMES["DIR"] = "dir"; + TAG_NAMES["DIV"] = "div"; + TAG_NAMES["DL"] = "dl"; + TAG_NAMES["DT"] = "dt"; + TAG_NAMES["EM"] = "em"; + TAG_NAMES["EMBED"] = "embed"; + TAG_NAMES["FIELDSET"] = "fieldset"; + TAG_NAMES["FIGCAPTION"] = "figcaption"; + TAG_NAMES["FIGURE"] = "figure"; + TAG_NAMES["FONT"] = "font"; + TAG_NAMES["FOOTER"] = "footer"; + TAG_NAMES["FOREIGN_OBJECT"] = "foreignObject"; + TAG_NAMES["FORM"] = "form"; + TAG_NAMES["FRAME"] = "frame"; + TAG_NAMES["FRAMESET"] = "frameset"; + TAG_NAMES["H1"] = "h1"; + TAG_NAMES["H2"] = "h2"; + TAG_NAMES["H3"] = "h3"; + TAG_NAMES["H4"] = "h4"; + TAG_NAMES["H5"] = "h5"; + TAG_NAMES["H6"] = "h6"; + TAG_NAMES["HEAD"] = "head"; + TAG_NAMES["HEADER"] = "header"; + TAG_NAMES["HGROUP"] = "hgroup"; + TAG_NAMES["HR"] = "hr"; + TAG_NAMES["HTML"] = "html"; + TAG_NAMES["I"] = "i"; + TAG_NAMES["IMG"] = "img"; + TAG_NAMES["IMAGE"] = "image"; + TAG_NAMES["INPUT"] = "input"; + TAG_NAMES["IFRAME"] = "iframe"; + TAG_NAMES["KEYGEN"] = "keygen"; + TAG_NAMES["LABEL"] = "label"; + TAG_NAMES["LI"] = "li"; + TAG_NAMES["LINK"] = "link"; + TAG_NAMES["LISTING"] = "listing"; + TAG_NAMES["MAIN"] = "main"; + TAG_NAMES["MALIGNMARK"] = "malignmark"; + TAG_NAMES["MARQUEE"] = "marquee"; + TAG_NAMES["MATH"] = "math"; + TAG_NAMES["MENU"] = "menu"; + TAG_NAMES["META"] = "meta"; + TAG_NAMES["MGLYPH"] = "mglyph"; + TAG_NAMES["MI"] = "mi"; + TAG_NAMES["MO"] = "mo"; + TAG_NAMES["MN"] = "mn"; + TAG_NAMES["MS"] = "ms"; + TAG_NAMES["MTEXT"] = "mtext"; + TAG_NAMES["NAV"] = "nav"; + TAG_NAMES["NOBR"] = "nobr"; + TAG_NAMES["NOFRAMES"] = "noframes"; + TAG_NAMES["NOEMBED"] = "noembed"; + TAG_NAMES["NOSCRIPT"] = "noscript"; + TAG_NAMES["OBJECT"] = "object"; + TAG_NAMES["OL"] = "ol"; + TAG_NAMES["OPTGROUP"] = "optgroup"; + TAG_NAMES["OPTION"] = "option"; + TAG_NAMES["P"] = "p"; + TAG_NAMES["PARAM"] = "param"; + TAG_NAMES["PLAINTEXT"] = "plaintext"; + TAG_NAMES["PRE"] = "pre"; + TAG_NAMES["RB"] = "rb"; + TAG_NAMES["RP"] = "rp"; + TAG_NAMES["RT"] = "rt"; + TAG_NAMES["RTC"] = "rtc"; + TAG_NAMES["RUBY"] = "ruby"; + TAG_NAMES["S"] = "s"; + TAG_NAMES["SCRIPT"] = "script"; + TAG_NAMES["SEARCH"] = "search"; + TAG_NAMES["SECTION"] = "section"; + TAG_NAMES["SELECT"] = "select"; + TAG_NAMES["SOURCE"] = "source"; + TAG_NAMES["SMALL"] = "small"; + TAG_NAMES["SPAN"] = "span"; + TAG_NAMES["STRIKE"] = "strike"; + TAG_NAMES["STRONG"] = "strong"; + TAG_NAMES["STYLE"] = "style"; + TAG_NAMES["SUB"] = "sub"; + TAG_NAMES["SUMMARY"] = "summary"; + TAG_NAMES["SUP"] = "sup"; + TAG_NAMES["TABLE"] = "table"; + TAG_NAMES["TBODY"] = "tbody"; + TAG_NAMES["TEMPLATE"] = "template"; + TAG_NAMES["TEXTAREA"] = "textarea"; + TAG_NAMES["TFOOT"] = "tfoot"; + TAG_NAMES["TD"] = "td"; + TAG_NAMES["TH"] = "th"; + TAG_NAMES["THEAD"] = "thead"; + TAG_NAMES["TITLE"] = "title"; + TAG_NAMES["TR"] = "tr"; + TAG_NAMES["TRACK"] = "track"; + TAG_NAMES["TT"] = "tt"; + TAG_NAMES["U"] = "u"; + TAG_NAMES["UL"] = "ul"; + TAG_NAMES["SVG"] = "svg"; + TAG_NAMES["VAR"] = "var"; + TAG_NAMES["WBR"] = "wbr"; + TAG_NAMES["XMP"] = "xmp"; +})(TAG_NAMES || (TAG_NAMES = {})); +/** + * Tag IDs are numeric IDs for known tag names. + * + * We use tag IDs to improve the performance of tag name comparisons. + */ +var TAG_ID; +(function (TAG_ID) { + TAG_ID[TAG_ID["UNKNOWN"] = 0] = "UNKNOWN"; + TAG_ID[TAG_ID["A"] = 1] = "A"; + TAG_ID[TAG_ID["ADDRESS"] = 2] = "ADDRESS"; + TAG_ID[TAG_ID["ANNOTATION_XML"] = 3] = "ANNOTATION_XML"; + TAG_ID[TAG_ID["APPLET"] = 4] = "APPLET"; + TAG_ID[TAG_ID["AREA"] = 5] = "AREA"; + TAG_ID[TAG_ID["ARTICLE"] = 6] = "ARTICLE"; + TAG_ID[TAG_ID["ASIDE"] = 7] = "ASIDE"; + TAG_ID[TAG_ID["B"] = 8] = "B"; + TAG_ID[TAG_ID["BASE"] = 9] = "BASE"; + TAG_ID[TAG_ID["BASEFONT"] = 10] = "BASEFONT"; + TAG_ID[TAG_ID["BGSOUND"] = 11] = "BGSOUND"; + TAG_ID[TAG_ID["BIG"] = 12] = "BIG"; + TAG_ID[TAG_ID["BLOCKQUOTE"] = 13] = "BLOCKQUOTE"; + TAG_ID[TAG_ID["BODY"] = 14] = "BODY"; + TAG_ID[TAG_ID["BR"] = 15] = "BR"; + TAG_ID[TAG_ID["BUTTON"] = 16] = "BUTTON"; + TAG_ID[TAG_ID["CAPTION"] = 17] = "CAPTION"; + TAG_ID[TAG_ID["CENTER"] = 18] = "CENTER"; + TAG_ID[TAG_ID["CODE"] = 19] = "CODE"; + TAG_ID[TAG_ID["COL"] = 20] = "COL"; + TAG_ID[TAG_ID["COLGROUP"] = 21] = "COLGROUP"; + TAG_ID[TAG_ID["DD"] = 22] = "DD"; + TAG_ID[TAG_ID["DESC"] = 23] = "DESC"; + TAG_ID[TAG_ID["DETAILS"] = 24] = "DETAILS"; + TAG_ID[TAG_ID["DIALOG"] = 25] = "DIALOG"; + TAG_ID[TAG_ID["DIR"] = 26] = "DIR"; + TAG_ID[TAG_ID["DIV"] = 27] = "DIV"; + TAG_ID[TAG_ID["DL"] = 28] = "DL"; + TAG_ID[TAG_ID["DT"] = 29] = "DT"; + TAG_ID[TAG_ID["EM"] = 30] = "EM"; + TAG_ID[TAG_ID["EMBED"] = 31] = "EMBED"; + TAG_ID[TAG_ID["FIELDSET"] = 32] = "FIELDSET"; + TAG_ID[TAG_ID["FIGCAPTION"] = 33] = "FIGCAPTION"; + TAG_ID[TAG_ID["FIGURE"] = 34] = "FIGURE"; + TAG_ID[TAG_ID["FONT"] = 35] = "FONT"; + TAG_ID[TAG_ID["FOOTER"] = 36] = "FOOTER"; + TAG_ID[TAG_ID["FOREIGN_OBJECT"] = 37] = "FOREIGN_OBJECT"; + TAG_ID[TAG_ID["FORM"] = 38] = "FORM"; + TAG_ID[TAG_ID["FRAME"] = 39] = "FRAME"; + TAG_ID[TAG_ID["FRAMESET"] = 40] = "FRAMESET"; + TAG_ID[TAG_ID["H1"] = 41] = "H1"; + TAG_ID[TAG_ID["H2"] = 42] = "H2"; + TAG_ID[TAG_ID["H3"] = 43] = "H3"; + TAG_ID[TAG_ID["H4"] = 44] = "H4"; + TAG_ID[TAG_ID["H5"] = 45] = "H5"; + TAG_ID[TAG_ID["H6"] = 46] = "H6"; + TAG_ID[TAG_ID["HEAD"] = 47] = "HEAD"; + TAG_ID[TAG_ID["HEADER"] = 48] = "HEADER"; + TAG_ID[TAG_ID["HGROUP"] = 49] = "HGROUP"; + TAG_ID[TAG_ID["HR"] = 50] = "HR"; + TAG_ID[TAG_ID["HTML"] = 51] = "HTML"; + TAG_ID[TAG_ID["I"] = 52] = "I"; + TAG_ID[TAG_ID["IMG"] = 53] = "IMG"; + TAG_ID[TAG_ID["IMAGE"] = 54] = "IMAGE"; + TAG_ID[TAG_ID["INPUT"] = 55] = "INPUT"; + TAG_ID[TAG_ID["IFRAME"] = 56] = "IFRAME"; + TAG_ID[TAG_ID["KEYGEN"] = 57] = "KEYGEN"; + TAG_ID[TAG_ID["LABEL"] = 58] = "LABEL"; + TAG_ID[TAG_ID["LI"] = 59] = "LI"; + TAG_ID[TAG_ID["LINK"] = 60] = "LINK"; + TAG_ID[TAG_ID["LISTING"] = 61] = "LISTING"; + TAG_ID[TAG_ID["MAIN"] = 62] = "MAIN"; + TAG_ID[TAG_ID["MALIGNMARK"] = 63] = "MALIGNMARK"; + TAG_ID[TAG_ID["MARQUEE"] = 64] = "MARQUEE"; + TAG_ID[TAG_ID["MATH"] = 65] = "MATH"; + TAG_ID[TAG_ID["MENU"] = 66] = "MENU"; + TAG_ID[TAG_ID["META"] = 67] = "META"; + TAG_ID[TAG_ID["MGLYPH"] = 68] = "MGLYPH"; + TAG_ID[TAG_ID["MI"] = 69] = "MI"; + TAG_ID[TAG_ID["MO"] = 70] = "MO"; + TAG_ID[TAG_ID["MN"] = 71] = "MN"; + TAG_ID[TAG_ID["MS"] = 72] = "MS"; + TAG_ID[TAG_ID["MTEXT"] = 73] = "MTEXT"; + TAG_ID[TAG_ID["NAV"] = 74] = "NAV"; + TAG_ID[TAG_ID["NOBR"] = 75] = "NOBR"; + TAG_ID[TAG_ID["NOFRAMES"] = 76] = "NOFRAMES"; + TAG_ID[TAG_ID["NOEMBED"] = 77] = "NOEMBED"; + TAG_ID[TAG_ID["NOSCRIPT"] = 78] = "NOSCRIPT"; + TAG_ID[TAG_ID["OBJECT"] = 79] = "OBJECT"; + TAG_ID[TAG_ID["OL"] = 80] = "OL"; + TAG_ID[TAG_ID["OPTGROUP"] = 81] = "OPTGROUP"; + TAG_ID[TAG_ID["OPTION"] = 82] = "OPTION"; + TAG_ID[TAG_ID["P"] = 83] = "P"; + TAG_ID[TAG_ID["PARAM"] = 84] = "PARAM"; + TAG_ID[TAG_ID["PLAINTEXT"] = 85] = "PLAINTEXT"; + TAG_ID[TAG_ID["PRE"] = 86] = "PRE"; + TAG_ID[TAG_ID["RB"] = 87] = "RB"; + TAG_ID[TAG_ID["RP"] = 88] = "RP"; + TAG_ID[TAG_ID["RT"] = 89] = "RT"; + TAG_ID[TAG_ID["RTC"] = 90] = "RTC"; + TAG_ID[TAG_ID["RUBY"] = 91] = "RUBY"; + TAG_ID[TAG_ID["S"] = 92] = "S"; + TAG_ID[TAG_ID["SCRIPT"] = 93] = "SCRIPT"; + TAG_ID[TAG_ID["SEARCH"] = 94] = "SEARCH"; + TAG_ID[TAG_ID["SECTION"] = 95] = "SECTION"; + TAG_ID[TAG_ID["SELECT"] = 96] = "SELECT"; + TAG_ID[TAG_ID["SOURCE"] = 97] = "SOURCE"; + TAG_ID[TAG_ID["SMALL"] = 98] = "SMALL"; + TAG_ID[TAG_ID["SPAN"] = 99] = "SPAN"; + TAG_ID[TAG_ID["STRIKE"] = 100] = "STRIKE"; + TAG_ID[TAG_ID["STRONG"] = 101] = "STRONG"; + TAG_ID[TAG_ID["STYLE"] = 102] = "STYLE"; + TAG_ID[TAG_ID["SUB"] = 103] = "SUB"; + TAG_ID[TAG_ID["SUMMARY"] = 104] = "SUMMARY"; + TAG_ID[TAG_ID["SUP"] = 105] = "SUP"; + TAG_ID[TAG_ID["TABLE"] = 106] = "TABLE"; + TAG_ID[TAG_ID["TBODY"] = 107] = "TBODY"; + TAG_ID[TAG_ID["TEMPLATE"] = 108] = "TEMPLATE"; + TAG_ID[TAG_ID["TEXTAREA"] = 109] = "TEXTAREA"; + TAG_ID[TAG_ID["TFOOT"] = 110] = "TFOOT"; + TAG_ID[TAG_ID["TD"] = 111] = "TD"; + TAG_ID[TAG_ID["TH"] = 112] = "TH"; + TAG_ID[TAG_ID["THEAD"] = 113] = "THEAD"; + TAG_ID[TAG_ID["TITLE"] = 114] = "TITLE"; + TAG_ID[TAG_ID["TR"] = 115] = "TR"; + TAG_ID[TAG_ID["TRACK"] = 116] = "TRACK"; + TAG_ID[TAG_ID["TT"] = 117] = "TT"; + TAG_ID[TAG_ID["U"] = 118] = "U"; + TAG_ID[TAG_ID["UL"] = 119] = "UL"; + TAG_ID[TAG_ID["SVG"] = 120] = "SVG"; + TAG_ID[TAG_ID["VAR"] = 121] = "VAR"; + TAG_ID[TAG_ID["WBR"] = 122] = "WBR"; + TAG_ID[TAG_ID["XMP"] = 123] = "XMP"; +})(TAG_ID || (TAG_ID = {})); +const TAG_NAME_TO_ID = new Map([ + [TAG_NAMES.A, TAG_ID.A], + [TAG_NAMES.ADDRESS, TAG_ID.ADDRESS], + [TAG_NAMES.ANNOTATION_XML, TAG_ID.ANNOTATION_XML], + [TAG_NAMES.APPLET, TAG_ID.APPLET], + [TAG_NAMES.AREA, TAG_ID.AREA], + [TAG_NAMES.ARTICLE, TAG_ID.ARTICLE], + [TAG_NAMES.ASIDE, TAG_ID.ASIDE], + [TAG_NAMES.B, TAG_ID.B], + [TAG_NAMES.BASE, TAG_ID.BASE], + [TAG_NAMES.BASEFONT, TAG_ID.BASEFONT], + [TAG_NAMES.BGSOUND, TAG_ID.BGSOUND], + [TAG_NAMES.BIG, TAG_ID.BIG], + [TAG_NAMES.BLOCKQUOTE, TAG_ID.BLOCKQUOTE], + [TAG_NAMES.BODY, TAG_ID.BODY], + [TAG_NAMES.BR, TAG_ID.BR], + [TAG_NAMES.BUTTON, TAG_ID.BUTTON], + [TAG_NAMES.CAPTION, TAG_ID.CAPTION], + [TAG_NAMES.CENTER, TAG_ID.CENTER], + [TAG_NAMES.CODE, TAG_ID.CODE], + [TAG_NAMES.COL, TAG_ID.COL], + [TAG_NAMES.COLGROUP, TAG_ID.COLGROUP], + [TAG_NAMES.DD, TAG_ID.DD], + [TAG_NAMES.DESC, TAG_ID.DESC], + [TAG_NAMES.DETAILS, TAG_ID.DETAILS], + [TAG_NAMES.DIALOG, TAG_ID.DIALOG], + [TAG_NAMES.DIR, TAG_ID.DIR], + [TAG_NAMES.DIV, TAG_ID.DIV], + [TAG_NAMES.DL, TAG_ID.DL], + [TAG_NAMES.DT, TAG_ID.DT], + [TAG_NAMES.EM, TAG_ID.EM], + [TAG_NAMES.EMBED, TAG_ID.EMBED], + [TAG_NAMES.FIELDSET, TAG_ID.FIELDSET], + [TAG_NAMES.FIGCAPTION, TAG_ID.FIGCAPTION], + [TAG_NAMES.FIGURE, TAG_ID.FIGURE], + [TAG_NAMES.FONT, TAG_ID.FONT], + [TAG_NAMES.FOOTER, TAG_ID.FOOTER], + [TAG_NAMES.FOREIGN_OBJECT, TAG_ID.FOREIGN_OBJECT], + [TAG_NAMES.FORM, TAG_ID.FORM], + [TAG_NAMES.FRAME, TAG_ID.FRAME], + [TAG_NAMES.FRAMESET, TAG_ID.FRAMESET], + [TAG_NAMES.H1, TAG_ID.H1], + [TAG_NAMES.H2, TAG_ID.H2], + [TAG_NAMES.H3, TAG_ID.H3], + [TAG_NAMES.H4, TAG_ID.H4], + [TAG_NAMES.H5, TAG_ID.H5], + [TAG_NAMES.H6, TAG_ID.H6], + [TAG_NAMES.HEAD, TAG_ID.HEAD], + [TAG_NAMES.HEADER, TAG_ID.HEADER], + [TAG_NAMES.HGROUP, TAG_ID.HGROUP], + [TAG_NAMES.HR, TAG_ID.HR], + [TAG_NAMES.HTML, TAG_ID.HTML], + [TAG_NAMES.I, TAG_ID.I], + [TAG_NAMES.IMG, TAG_ID.IMG], + [TAG_NAMES.IMAGE, TAG_ID.IMAGE], + [TAG_NAMES.INPUT, TAG_ID.INPUT], + [TAG_NAMES.IFRAME, TAG_ID.IFRAME], + [TAG_NAMES.KEYGEN, TAG_ID.KEYGEN], + [TAG_NAMES.LABEL, TAG_ID.LABEL], + [TAG_NAMES.LI, TAG_ID.LI], + [TAG_NAMES.LINK, TAG_ID.LINK], + [TAG_NAMES.LISTING, TAG_ID.LISTING], + [TAG_NAMES.MAIN, TAG_ID.MAIN], + [TAG_NAMES.MALIGNMARK, TAG_ID.MALIGNMARK], + [TAG_NAMES.MARQUEE, TAG_ID.MARQUEE], + [TAG_NAMES.MATH, TAG_ID.MATH], + [TAG_NAMES.MENU, TAG_ID.MENU], + [TAG_NAMES.META, TAG_ID.META], + [TAG_NAMES.MGLYPH, TAG_ID.MGLYPH], + [TAG_NAMES.MI, TAG_ID.MI], + [TAG_NAMES.MO, TAG_ID.MO], + [TAG_NAMES.MN, TAG_ID.MN], + [TAG_NAMES.MS, TAG_ID.MS], + [TAG_NAMES.MTEXT, TAG_ID.MTEXT], + [TAG_NAMES.NAV, TAG_ID.NAV], + [TAG_NAMES.NOBR, TAG_ID.NOBR], + [TAG_NAMES.NOFRAMES, TAG_ID.NOFRAMES], + [TAG_NAMES.NOEMBED, TAG_ID.NOEMBED], + [TAG_NAMES.NOSCRIPT, TAG_ID.NOSCRIPT], + [TAG_NAMES.OBJECT, TAG_ID.OBJECT], + [TAG_NAMES.OL, TAG_ID.OL], + [TAG_NAMES.OPTGROUP, TAG_ID.OPTGROUP], + [TAG_NAMES.OPTION, TAG_ID.OPTION], + [TAG_NAMES.P, TAG_ID.P], + [TAG_NAMES.PARAM, TAG_ID.PARAM], + [TAG_NAMES.PLAINTEXT, TAG_ID.PLAINTEXT], + [TAG_NAMES.PRE, TAG_ID.PRE], + [TAG_NAMES.RB, TAG_ID.RB], + [TAG_NAMES.RP, TAG_ID.RP], + [TAG_NAMES.RT, TAG_ID.RT], + [TAG_NAMES.RTC, TAG_ID.RTC], + [TAG_NAMES.RUBY, TAG_ID.RUBY], + [TAG_NAMES.S, TAG_ID.S], + [TAG_NAMES.SCRIPT, TAG_ID.SCRIPT], + [TAG_NAMES.SEARCH, TAG_ID.SEARCH], + [TAG_NAMES.SECTION, TAG_ID.SECTION], + [TAG_NAMES.SELECT, TAG_ID.SELECT], + [TAG_NAMES.SOURCE, TAG_ID.SOURCE], + [TAG_NAMES.SMALL, TAG_ID.SMALL], + [TAG_NAMES.SPAN, TAG_ID.SPAN], + [TAG_NAMES.STRIKE, TAG_ID.STRIKE], + [TAG_NAMES.STRONG, TAG_ID.STRONG], + [TAG_NAMES.STYLE, TAG_ID.STYLE], + [TAG_NAMES.SUB, TAG_ID.SUB], + [TAG_NAMES.SUMMARY, TAG_ID.SUMMARY], + [TAG_NAMES.SUP, TAG_ID.SUP], + [TAG_NAMES.TABLE, TAG_ID.TABLE], + [TAG_NAMES.TBODY, TAG_ID.TBODY], + [TAG_NAMES.TEMPLATE, TAG_ID.TEMPLATE], + [TAG_NAMES.TEXTAREA, TAG_ID.TEXTAREA], + [TAG_NAMES.TFOOT, TAG_ID.TFOOT], + [TAG_NAMES.TD, TAG_ID.TD], + [TAG_NAMES.TH, TAG_ID.TH], + [TAG_NAMES.THEAD, TAG_ID.THEAD], + [TAG_NAMES.TITLE, TAG_ID.TITLE], + [TAG_NAMES.TR, TAG_ID.TR], + [TAG_NAMES.TRACK, TAG_ID.TRACK], + [TAG_NAMES.TT, TAG_ID.TT], + [TAG_NAMES.U, TAG_ID.U], + [TAG_NAMES.UL, TAG_ID.UL], + [TAG_NAMES.SVG, TAG_ID.SVG], + [TAG_NAMES.VAR, TAG_ID.VAR], + [TAG_NAMES.WBR, TAG_ID.WBR], + [TAG_NAMES.XMP, TAG_ID.XMP], +]); +function getTagID(tagName) { + var _a; + return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN; +} +const $ = TAG_ID; +const SPECIAL_ELEMENTS = { + [NS.HTML]: new Set([ + $.ADDRESS, + $.APPLET, + $.AREA, + $.ARTICLE, + $.ASIDE, + $.BASE, + $.BASEFONT, + $.BGSOUND, + $.BLOCKQUOTE, + $.BODY, + $.BR, + $.BUTTON, + $.CAPTION, + $.CENTER, + $.COL, + $.COLGROUP, + $.DD, + $.DETAILS, + $.DIR, + $.DIV, + $.DL, + $.DT, + $.EMBED, + $.FIELDSET, + $.FIGCAPTION, + $.FIGURE, + $.FOOTER, + $.FORM, + $.FRAME, + $.FRAMESET, + $.H1, + $.H2, + $.H3, + $.H4, + $.H5, + $.H6, + $.HEAD, + $.HEADER, + $.HGROUP, + $.HR, + $.HTML, + $.IFRAME, + $.IMG, + $.INPUT, + $.LI, + $.LINK, + $.LISTING, + $.MAIN, + $.MARQUEE, + $.MENU, + $.META, + $.NAV, + $.NOEMBED, + $.NOFRAMES, + $.NOSCRIPT, + $.OBJECT, + $.OL, + $.P, + $.PARAM, + $.PLAINTEXT, + $.PRE, + $.SCRIPT, + $.SECTION, + $.SELECT, + $.SOURCE, + $.STYLE, + $.SUMMARY, + $.TABLE, + $.TBODY, + $.TD, + $.TEMPLATE, + $.TEXTAREA, + $.TFOOT, + $.TH, + $.THEAD, + $.TITLE, + $.TR, + $.TRACK, + $.UL, + $.WBR, + $.XMP, + ]), + [NS.MATHML]: new Set([$.MI, $.MO, $.MN, $.MS, $.MTEXT, $.ANNOTATION_XML]), + [NS.SVG]: new Set([$.TITLE, $.FOREIGN_OBJECT, $.DESC]), + [NS.XLINK]: new Set(), + [NS.XML]: new Set(), + [NS.XMLNS]: new Set(), +}; +const NUMBERED_HEADERS = new Set([$.H1, $.H2, $.H3, $.H4, $.H5, $.H6]); + +//States +var State; +(function (State) { + State[State["DATA"] = 0] = "DATA"; + State[State["RCDATA"] = 1] = "RCDATA"; + State[State["RAWTEXT"] = 2] = "RAWTEXT"; + State[State["SCRIPT_DATA"] = 3] = "SCRIPT_DATA"; + State[State["PLAINTEXT"] = 4] = "PLAINTEXT"; + State[State["TAG_OPEN"] = 5] = "TAG_OPEN"; + State[State["END_TAG_OPEN"] = 6] = "END_TAG_OPEN"; + State[State["TAG_NAME"] = 7] = "TAG_NAME"; + State[State["RCDATA_LESS_THAN_SIGN"] = 8] = "RCDATA_LESS_THAN_SIGN"; + State[State["RCDATA_END_TAG_OPEN"] = 9] = "RCDATA_END_TAG_OPEN"; + State[State["RCDATA_END_TAG_NAME"] = 10] = "RCDATA_END_TAG_NAME"; + State[State["RAWTEXT_LESS_THAN_SIGN"] = 11] = "RAWTEXT_LESS_THAN_SIGN"; + State[State["RAWTEXT_END_TAG_OPEN"] = 12] = "RAWTEXT_END_TAG_OPEN"; + State[State["RAWTEXT_END_TAG_NAME"] = 13] = "RAWTEXT_END_TAG_NAME"; + State[State["SCRIPT_DATA_LESS_THAN_SIGN"] = 14] = "SCRIPT_DATA_LESS_THAN_SIGN"; + State[State["SCRIPT_DATA_END_TAG_OPEN"] = 15] = "SCRIPT_DATA_END_TAG_OPEN"; + State[State["SCRIPT_DATA_END_TAG_NAME"] = 16] = "SCRIPT_DATA_END_TAG_NAME"; + State[State["SCRIPT_DATA_ESCAPE_START"] = 17] = "SCRIPT_DATA_ESCAPE_START"; + State[State["SCRIPT_DATA_ESCAPE_START_DASH"] = 18] = "SCRIPT_DATA_ESCAPE_START_DASH"; + State[State["SCRIPT_DATA_ESCAPED"] = 19] = "SCRIPT_DATA_ESCAPED"; + State[State["SCRIPT_DATA_ESCAPED_DASH"] = 20] = "SCRIPT_DATA_ESCAPED_DASH"; + State[State["SCRIPT_DATA_ESCAPED_DASH_DASH"] = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH"; + State[State["SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN"] = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN"; + State[State["SCRIPT_DATA_ESCAPED_END_TAG_OPEN"] = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN"; + State[State["SCRIPT_DATA_ESCAPED_END_TAG_NAME"] = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPE_START"] = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPED"] = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH"] = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH"] = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN"] = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN"; + State[State["SCRIPT_DATA_DOUBLE_ESCAPE_END"] = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END"; + State[State["BEFORE_ATTRIBUTE_NAME"] = 31] = "BEFORE_ATTRIBUTE_NAME"; + State[State["ATTRIBUTE_NAME"] = 32] = "ATTRIBUTE_NAME"; + State[State["AFTER_ATTRIBUTE_NAME"] = 33] = "AFTER_ATTRIBUTE_NAME"; + State[State["BEFORE_ATTRIBUTE_VALUE"] = 34] = "BEFORE_ATTRIBUTE_VALUE"; + State[State["ATTRIBUTE_VALUE_DOUBLE_QUOTED"] = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED"; + State[State["ATTRIBUTE_VALUE_SINGLE_QUOTED"] = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED"; + State[State["ATTRIBUTE_VALUE_UNQUOTED"] = 37] = "ATTRIBUTE_VALUE_UNQUOTED"; + State[State["AFTER_ATTRIBUTE_VALUE_QUOTED"] = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED"; + State[State["SELF_CLOSING_START_TAG"] = 39] = "SELF_CLOSING_START_TAG"; + State[State["BOGUS_COMMENT"] = 40] = "BOGUS_COMMENT"; + State[State["MARKUP_DECLARATION_OPEN"] = 41] = "MARKUP_DECLARATION_OPEN"; + State[State["COMMENT_START"] = 42] = "COMMENT_START"; + State[State["COMMENT_START_DASH"] = 43] = "COMMENT_START_DASH"; + State[State["COMMENT"] = 44] = "COMMENT"; + State[State["COMMENT_LESS_THAN_SIGN"] = 45] = "COMMENT_LESS_THAN_SIGN"; + State[State["COMMENT_LESS_THAN_SIGN_BANG"] = 46] = "COMMENT_LESS_THAN_SIGN_BANG"; + State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH"] = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH"; + State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH"] = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH"; + State[State["COMMENT_END_DASH"] = 49] = "COMMENT_END_DASH"; + State[State["COMMENT_END"] = 50] = "COMMENT_END"; + State[State["COMMENT_END_BANG"] = 51] = "COMMENT_END_BANG"; + State[State["DOCTYPE"] = 52] = "DOCTYPE"; + State[State["BEFORE_DOCTYPE_NAME"] = 53] = "BEFORE_DOCTYPE_NAME"; + State[State["DOCTYPE_NAME"] = 54] = "DOCTYPE_NAME"; + State[State["AFTER_DOCTYPE_NAME"] = 55] = "AFTER_DOCTYPE_NAME"; + State[State["AFTER_DOCTYPE_PUBLIC_KEYWORD"] = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD"; + State[State["BEFORE_DOCTYPE_PUBLIC_IDENTIFIER"] = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER"; + State[State["DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED"] = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED"; + State[State["DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED"] = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED"; + State[State["AFTER_DOCTYPE_PUBLIC_IDENTIFIER"] = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER"; + State[State["BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS"] = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS"; + State[State["AFTER_DOCTYPE_SYSTEM_KEYWORD"] = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD"; + State[State["BEFORE_DOCTYPE_SYSTEM_IDENTIFIER"] = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER"; + State[State["DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED"] = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED"; + State[State["DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED"] = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED"; + State[State["AFTER_DOCTYPE_SYSTEM_IDENTIFIER"] = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER"; + State[State["BOGUS_DOCTYPE"] = 67] = "BOGUS_DOCTYPE"; + State[State["CDATA_SECTION"] = 68] = "CDATA_SECTION"; + State[State["CDATA_SECTION_BRACKET"] = 69] = "CDATA_SECTION_BRACKET"; + State[State["CDATA_SECTION_END"] = 70] = "CDATA_SECTION_END"; + State[State["CHARACTER_REFERENCE"] = 71] = "CHARACTER_REFERENCE"; + State[State["AMBIGUOUS_AMPERSAND"] = 72] = "AMBIGUOUS_AMPERSAND"; +})(State || (State = {})); +//Tokenizer initial states for different modes +const TokenizerMode = { + DATA: State.DATA, + RCDATA: State.RCDATA, + RAWTEXT: State.RAWTEXT, + SCRIPT_DATA: State.SCRIPT_DATA, + PLAINTEXT: State.PLAINTEXT, + CDATA_SECTION: State.CDATA_SECTION, +}; +//Utils +//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline +//this functions if they will be situated in another module due to context switch. +//Always perform inlining check before modifying this functions ('node --trace-inlining'). +function isAsciiDigit(cp) { + return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9; +} +function isAsciiUpper(cp) { + return cp >= CODE_POINTS.LATIN_CAPITAL_A && cp <= CODE_POINTS.LATIN_CAPITAL_Z; +} +function isAsciiLower(cp) { + return cp >= CODE_POINTS.LATIN_SMALL_A && cp <= CODE_POINTS.LATIN_SMALL_Z; +} +function isAsciiLetter(cp) { + return isAsciiLower(cp) || isAsciiUpper(cp); +} +function isAsciiAlphaNumeric(cp) { + return isAsciiLetter(cp) || isAsciiDigit(cp); +} +function toAsciiLower(cp) { + return cp + 32; +} +function isWhitespace(cp) { + return cp === CODE_POINTS.SPACE || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.TABULATION || cp === CODE_POINTS.FORM_FEED; +} +function isScriptDataDoubleEscapeSequenceEnd(cp) { + return isWhitespace(cp) || cp === CODE_POINTS.SOLIDUS || cp === CODE_POINTS.GREATER_THAN_SIGN; +} +function getErrorForNumericCharacterReference(code) { + if (code === CODE_POINTS.NULL) { + return ERR.nullCharacterReference; + } + else if (code > 1114111) { + return ERR.characterReferenceOutsideUnicodeRange; + } + else if (isSurrogate(code)) { + return ERR.surrogateCharacterReference; + } + else if (isUndefinedCodePoint(code)) { + return ERR.noncharacterCharacterReference; + } + else if (isControlCodePoint(code) || code === CODE_POINTS.CARRIAGE_RETURN) { + return ERR.controlCharacterReference; + } + return null; +} +//Tokenizer +class Tokenizer { + constructor(options, handler) { + this.options = options; + this.handler = handler; + this.paused = false; + /** Ensures that the parsing loop isn't run multiple times at once. */ + this.inLoop = false; + /** + * Indicates that the current adjusted node exists, is not an element in the HTML namespace, + * and that it is not an integration point for either MathML or HTML. + * + * @see {@link https://html.spec.whatwg.org/multipage/parsing.html#tree-construction} + */ + this.inForeignNode = false; + this.lastStartTagName = ''; + this.active = false; + this.state = State.DATA; + this.returnState = State.DATA; + this.entityStartPos = 0; + this.consumedAfterSnapshot = -1; + this.currentCharacterToken = null; + this.currentToken = null; + this.currentAttr = { name: '', value: '' }; + this.preprocessor = new Preprocessor(handler); + this.currentLocation = this.getCurrentLocation(-1); + this.entityDecoder = new EntityDecoder(htmlDecodeTree, (cp, consumed) => { + // Note: Set `pos` _before_ flushing, as flushing might drop + // the current chunk and invalidate `entityStartPos`. + this.preprocessor.pos = this.entityStartPos + consumed - 1; + this._flushCodePointConsumedAsCharacterReference(cp); + }, handler.onParseError + ? { + missingSemicolonAfterCharacterReference: () => { + this._err(ERR.missingSemicolonAfterCharacterReference, 1); + }, + absenceOfDigitsInNumericCharacterReference: (consumed) => { + this._err(ERR.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + consumed); + }, + validateNumericCharacterReference: (code) => { + const error = getErrorForNumericCharacterReference(code); + if (error) + this._err(error, 1); + }, + } + : undefined); + } + //Errors + _err(code, cpOffset = 0) { + var _a, _b; + (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code, cpOffset)); + } + // NOTE: `offset` may never run across line boundaries. + getCurrentLocation(offset) { + if (!this.options.sourceCodeLocationInfo) { + return null; + } + return { + startLine: this.preprocessor.line, + startCol: this.preprocessor.col - offset, + startOffset: this.preprocessor.offset - offset, + endLine: -1, + endCol: -1, + endOffset: -1, + }; + } + _runParsingLoop() { + if (this.inLoop) + return; + this.inLoop = true; + while (this.active && !this.paused) { + this.consumedAfterSnapshot = 0; + const cp = this._consume(); + if (!this._ensureHibernation()) { + this._callState(cp); + } + } + this.inLoop = false; + } + //API + pause() { + this.paused = true; + } + resume(writeCallback) { + if (!this.paused) { + throw new Error('Parser was already resumed'); + } + this.paused = false; + // Necessary for synchronous resume. + if (this.inLoop) + return; + this._runParsingLoop(); + if (!this.paused) { + writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback(); + } + } + write(chunk, isLastChunk, writeCallback) { + this.active = true; + this.preprocessor.write(chunk, isLastChunk); + this._runParsingLoop(); + if (!this.paused) { + writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback(); + } + } + insertHtmlAtCurrentPos(chunk) { + this.active = true; + this.preprocessor.insertHtmlAtCurrentPos(chunk); + this._runParsingLoop(); + } + //Hibernation + _ensureHibernation() { + if (this.preprocessor.endOfChunkHit) { + this.preprocessor.retreat(this.consumedAfterSnapshot); + this.consumedAfterSnapshot = 0; + this.active = false; + return true; + } + return false; + } + //Consumption + _consume() { + this.consumedAfterSnapshot++; + return this.preprocessor.advance(); + } + _advanceBy(count) { + this.consumedAfterSnapshot += count; + for (let i = 0; i < count; i++) { + this.preprocessor.advance(); + } + } + _consumeSequenceIfMatch(pattern, caseSensitive) { + if (this.preprocessor.startsWith(pattern, caseSensitive)) { + // We will already have consumed one character before calling this method. + this._advanceBy(pattern.length - 1); + return true; + } + return false; + } + //Token creation + _createStartTagToken() { + this.currentToken = { + type: TokenType.START_TAG, + tagName: '', + tagID: TAG_ID.UNKNOWN, + selfClosing: false, + ackSelfClosing: false, + attrs: [], + location: this.getCurrentLocation(1), + }; + } + _createEndTagToken() { + this.currentToken = { + type: TokenType.END_TAG, + tagName: '', + tagID: TAG_ID.UNKNOWN, + selfClosing: false, + ackSelfClosing: false, + attrs: [], + location: this.getCurrentLocation(2), + }; + } + _createCommentToken(offset) { + this.currentToken = { + type: TokenType.COMMENT, + data: '', + location: this.getCurrentLocation(offset), + }; + } + _createDoctypeToken(initialName) { + this.currentToken = { + type: TokenType.DOCTYPE, + name: initialName, + forceQuirks: false, + publicId: null, + systemId: null, + location: this.currentLocation, + }; + } + _createCharacterToken(type, chars) { + this.currentCharacterToken = { + type, + chars, + location: this.currentLocation, + }; + } + //Tag attributes + _createAttr(attrNameFirstCh) { + this.currentAttr = { + name: attrNameFirstCh, + value: '', + }; + this.currentLocation = this.getCurrentLocation(0); + } + _leaveAttrName() { + var _a; + var _b; + const token = this.currentToken; + if (getTokenAttr(token, this.currentAttr.name) === null) { + token.attrs.push(this.currentAttr); + if (token.location && this.currentLocation) { + const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null))); + attrLocations[this.currentAttr.name] = this.currentLocation; + // Set end location + this._leaveAttrValue(); + } + } + else { + this._err(ERR.duplicateAttribute); + } + } + _leaveAttrValue() { + if (this.currentLocation) { + this.currentLocation.endLine = this.preprocessor.line; + this.currentLocation.endCol = this.preprocessor.col; + this.currentLocation.endOffset = this.preprocessor.offset; + } + } + //Token emission + prepareToken(ct) { + this._emitCurrentCharacterToken(ct.location); + this.currentToken = null; + if (ct.location) { + ct.location.endLine = this.preprocessor.line; + ct.location.endCol = this.preprocessor.col + 1; + ct.location.endOffset = this.preprocessor.offset + 1; + } + this.currentLocation = this.getCurrentLocation(-1); + } + emitCurrentTagToken() { + const ct = this.currentToken; + this.prepareToken(ct); + ct.tagID = getTagID(ct.tagName); + if (ct.type === TokenType.START_TAG) { + this.lastStartTagName = ct.tagName; + this.handler.onStartTag(ct); + } + else { + if (ct.attrs.length > 0) { + this._err(ERR.endTagWithAttributes); + } + if (ct.selfClosing) { + this._err(ERR.endTagWithTrailingSolidus); + } + this.handler.onEndTag(ct); + } + this.preprocessor.dropParsedChunk(); + } + emitCurrentComment(ct) { + this.prepareToken(ct); + this.handler.onComment(ct); + this.preprocessor.dropParsedChunk(); + } + emitCurrentDoctype(ct) { + this.prepareToken(ct); + this.handler.onDoctype(ct); + this.preprocessor.dropParsedChunk(); + } + _emitCurrentCharacterToken(nextLocation) { + if (this.currentCharacterToken) { + //NOTE: if we have a pending character token, make it's end location equal to the + //current token's start location. + if (nextLocation && this.currentCharacterToken.location) { + this.currentCharacterToken.location.endLine = nextLocation.startLine; + this.currentCharacterToken.location.endCol = nextLocation.startCol; + this.currentCharacterToken.location.endOffset = nextLocation.startOffset; + } + switch (this.currentCharacterToken.type) { + case TokenType.CHARACTER: { + this.handler.onCharacter(this.currentCharacterToken); + break; + } + case TokenType.NULL_CHARACTER: { + this.handler.onNullCharacter(this.currentCharacterToken); + break; + } + case TokenType.WHITESPACE_CHARACTER: { + this.handler.onWhitespaceCharacter(this.currentCharacterToken); + break; + } + } + this.currentCharacterToken = null; + } + } + _emitEOFToken() { + const location = this.getCurrentLocation(0); + if (location) { + location.endLine = location.startLine; + location.endCol = location.startCol; + location.endOffset = location.startOffset; + } + this._emitCurrentCharacterToken(location); + this.handler.onEof({ type: TokenType.EOF, location }); + this.active = false; + } + //Characters emission + //OPTIMIZATION: The specification uses only one type of character token (one token per character). + //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters. + //If we have a sequence of characters that belong to the same group, the parser can process it + //as a single solid character token. + //So, there are 3 types of character tokens in parse5: + //1)TokenType.NULL_CHARACTER - \u0000-character sequences (e.g. '\u0000\u0000\u0000') + //2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\n \r\t \f') + //3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^') + _appendCharToCurrentCharacterToken(type, ch) { + if (this.currentCharacterToken) { + if (this.currentCharacterToken.type === type) { + this.currentCharacterToken.chars += ch; + return; + } + else { + this.currentLocation = this.getCurrentLocation(0); + this._emitCurrentCharacterToken(this.currentLocation); + this.preprocessor.dropParsedChunk(); + } + } + this._createCharacterToken(type, ch); + } + _emitCodePoint(cp) { + const type = isWhitespace(cp) + ? TokenType.WHITESPACE_CHARACTER + : cp === CODE_POINTS.NULL + ? TokenType.NULL_CHARACTER + : TokenType.CHARACTER; + this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp)); + } + //NOTE: used when we emit characters explicitly. + //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks. + _emitChars(ch) { + this._appendCharToCurrentCharacterToken(TokenType.CHARACTER, ch); + } + // Character reference helpers + _startCharacterReference() { + this.returnState = this.state; + this.state = State.CHARACTER_REFERENCE; + this.entityStartPos = this.preprocessor.pos; + this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? DecodingMode.Attribute : DecodingMode.Legacy); + } + _isCharacterReferenceInAttribute() { + return (this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED || + this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED || + this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED); + } + _flushCodePointConsumedAsCharacterReference(cp) { + if (this._isCharacterReferenceInAttribute()) { + this.currentAttr.value += String.fromCodePoint(cp); + } + else { + this._emitCodePoint(cp); + } + } + // Calling states this way turns out to be much faster than any other approach. + _callState(cp) { + switch (this.state) { + case State.DATA: { + this._stateData(cp); + break; + } + case State.RCDATA: { + this._stateRcdata(cp); + break; + } + case State.RAWTEXT: { + this._stateRawtext(cp); + break; + } + case State.SCRIPT_DATA: { + this._stateScriptData(cp); + break; + } + case State.PLAINTEXT: { + this._statePlaintext(cp); + break; + } + case State.TAG_OPEN: { + this._stateTagOpen(cp); + break; + } + case State.END_TAG_OPEN: { + this._stateEndTagOpen(cp); + break; + } + case State.TAG_NAME: { + this._stateTagName(cp); + break; + } + case State.RCDATA_LESS_THAN_SIGN: { + this._stateRcdataLessThanSign(cp); + break; + } + case State.RCDATA_END_TAG_OPEN: { + this._stateRcdataEndTagOpen(cp); + break; + } + case State.RCDATA_END_TAG_NAME: { + this._stateRcdataEndTagName(cp); + break; + } + case State.RAWTEXT_LESS_THAN_SIGN: { + this._stateRawtextLessThanSign(cp); + break; + } + case State.RAWTEXT_END_TAG_OPEN: { + this._stateRawtextEndTagOpen(cp); + break; + } + case State.RAWTEXT_END_TAG_NAME: { + this._stateRawtextEndTagName(cp); + break; + } + case State.SCRIPT_DATA_LESS_THAN_SIGN: { + this._stateScriptDataLessThanSign(cp); + break; + } + case State.SCRIPT_DATA_END_TAG_OPEN: { + this._stateScriptDataEndTagOpen(cp); + break; + } + case State.SCRIPT_DATA_END_TAG_NAME: { + this._stateScriptDataEndTagName(cp); + break; + } + case State.SCRIPT_DATA_ESCAPE_START: { + this._stateScriptDataEscapeStart(cp); + break; + } + case State.SCRIPT_DATA_ESCAPE_START_DASH: { + this._stateScriptDataEscapeStartDash(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED: { + this._stateScriptDataEscaped(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED_DASH: { + this._stateScriptDataEscapedDash(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED_DASH_DASH: { + this._stateScriptDataEscapedDashDash(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: { + this._stateScriptDataEscapedLessThanSign(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: { + this._stateScriptDataEscapedEndTagOpen(cp); + break; + } + case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME: { + this._stateScriptDataEscapedEndTagName(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPE_START: { + this._stateScriptDataDoubleEscapeStart(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPED: { + this._stateScriptDataDoubleEscaped(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: { + this._stateScriptDataDoubleEscapedDash(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: { + this._stateScriptDataDoubleEscapedDashDash(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: { + this._stateScriptDataDoubleEscapedLessThanSign(cp); + break; + } + case State.SCRIPT_DATA_DOUBLE_ESCAPE_END: { + this._stateScriptDataDoubleEscapeEnd(cp); + break; + } + case State.BEFORE_ATTRIBUTE_NAME: { + this._stateBeforeAttributeName(cp); + break; + } + case State.ATTRIBUTE_NAME: { + this._stateAttributeName(cp); + break; + } + case State.AFTER_ATTRIBUTE_NAME: { + this._stateAfterAttributeName(cp); + break; + } + case State.BEFORE_ATTRIBUTE_VALUE: { + this._stateBeforeAttributeValue(cp); + break; + } + case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED: { + this._stateAttributeValueDoubleQuoted(cp); + break; + } + case State.ATTRIBUTE_VALUE_SINGLE_QUOTED: { + this._stateAttributeValueSingleQuoted(cp); + break; + } + case State.ATTRIBUTE_VALUE_UNQUOTED: { + this._stateAttributeValueUnquoted(cp); + break; + } + case State.AFTER_ATTRIBUTE_VALUE_QUOTED: { + this._stateAfterAttributeValueQuoted(cp); + break; + } + case State.SELF_CLOSING_START_TAG: { + this._stateSelfClosingStartTag(cp); + break; + } + case State.BOGUS_COMMENT: { + this._stateBogusComment(cp); + break; + } + case State.MARKUP_DECLARATION_OPEN: { + this._stateMarkupDeclarationOpen(cp); + break; + } + case State.COMMENT_START: { + this._stateCommentStart(cp); + break; + } + case State.COMMENT_START_DASH: { + this._stateCommentStartDash(cp); + break; + } + case State.COMMENT: { + this._stateComment(cp); + break; + } + case State.COMMENT_LESS_THAN_SIGN: { + this._stateCommentLessThanSign(cp); + break; + } + case State.COMMENT_LESS_THAN_SIGN_BANG: { + this._stateCommentLessThanSignBang(cp); + break; + } + case State.COMMENT_LESS_THAN_SIGN_BANG_DASH: { + this._stateCommentLessThanSignBangDash(cp); + break; + } + case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: { + this._stateCommentLessThanSignBangDashDash(cp); + break; + } + case State.COMMENT_END_DASH: { + this._stateCommentEndDash(cp); + break; + } + case State.COMMENT_END: { + this._stateCommentEnd(cp); + break; + } + case State.COMMENT_END_BANG: { + this._stateCommentEndBang(cp); + break; + } + case State.DOCTYPE: { + this._stateDoctype(cp); + break; + } + case State.BEFORE_DOCTYPE_NAME: { + this._stateBeforeDoctypeName(cp); + break; + } + case State.DOCTYPE_NAME: { + this._stateDoctypeName(cp); + break; + } + case State.AFTER_DOCTYPE_NAME: { + this._stateAfterDoctypeName(cp); + break; + } + case State.AFTER_DOCTYPE_PUBLIC_KEYWORD: { + this._stateAfterDoctypePublicKeyword(cp); + break; + } + case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: { + this._stateBeforeDoctypePublicIdentifier(cp); + break; + } + case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: { + this._stateDoctypePublicIdentifierDoubleQuoted(cp); + break; + } + case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: { + this._stateDoctypePublicIdentifierSingleQuoted(cp); + break; + } + case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: { + this._stateAfterDoctypePublicIdentifier(cp); + break; + } + case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: { + this._stateBetweenDoctypePublicAndSystemIdentifiers(cp); + break; + } + case State.AFTER_DOCTYPE_SYSTEM_KEYWORD: { + this._stateAfterDoctypeSystemKeyword(cp); + break; + } + case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: { + this._stateBeforeDoctypeSystemIdentifier(cp); + break; + } + case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: { + this._stateDoctypeSystemIdentifierDoubleQuoted(cp); + break; + } + case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: { + this._stateDoctypeSystemIdentifierSingleQuoted(cp); + break; + } + case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: { + this._stateAfterDoctypeSystemIdentifier(cp); + break; + } + case State.BOGUS_DOCTYPE: { + this._stateBogusDoctype(cp); + break; + } + case State.CDATA_SECTION: { + this._stateCdataSection(cp); + break; + } + case State.CDATA_SECTION_BRACKET: { + this._stateCdataSectionBracket(cp); + break; + } + case State.CDATA_SECTION_END: { + this._stateCdataSectionEnd(cp); + break; + } + case State.CHARACTER_REFERENCE: { + this._stateCharacterReference(); + break; + } + case State.AMBIGUOUS_AMPERSAND: { + this._stateAmbiguousAmpersand(cp); + break; + } + default: { + throw new Error('Unknown state'); + } + } + } + // State machine + // Data state + //------------------------------------------------------------------ + _stateData(cp) { + switch (cp) { + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.TAG_OPEN; + break; + } + case CODE_POINTS.AMPERSAND: { + this._startCharacterReference(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitCodePoint(cp); + break; + } + case CODE_POINTS.EOF: { + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // RCDATA state + //------------------------------------------------------------------ + _stateRcdata(cp) { + switch (cp) { + case CODE_POINTS.AMPERSAND: { + this._startCharacterReference(); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.RCDATA_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // RAWTEXT state + //------------------------------------------------------------------ + _stateRawtext(cp) { + switch (cp) { + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.RAWTEXT_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // Script data state + //------------------------------------------------------------------ + _stateScriptData(cp) { + switch (cp) { + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // PLAINTEXT state + //------------------------------------------------------------------ + _statePlaintext(cp) { + switch (cp) { + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // Tag open state + //------------------------------------------------------------------ + _stateTagOpen(cp) { + if (isAsciiLetter(cp)) { + this._createStartTagToken(); + this.state = State.TAG_NAME; + this._stateTagName(cp); + } + else + switch (cp) { + case CODE_POINTS.EXCLAMATION_MARK: { + this.state = State.MARKUP_DECLARATION_OPEN; + break; + } + case CODE_POINTS.SOLIDUS: { + this.state = State.END_TAG_OPEN; + break; + } + case CODE_POINTS.QUESTION_MARK: { + this._err(ERR.unexpectedQuestionMarkInsteadOfTagName); + this._createCommentToken(1); + this.state = State.BOGUS_COMMENT; + this._stateBogusComment(cp); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofBeforeTagName); + this._emitChars('<'); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.invalidFirstCharacterOfTagName); + this._emitChars('<'); + this.state = State.DATA; + this._stateData(cp); + } + } + } + // End tag open state + //------------------------------------------------------------------ + _stateEndTagOpen(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this.state = State.TAG_NAME; + this._stateTagName(cp); + } + else + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingEndTagName); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofBeforeTagName); + this._emitChars('</'); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.invalidFirstCharacterOfTagName); + this._createCommentToken(2); + this.state = State.BOGUS_COMMENT; + this._stateBogusComment(cp); + } + } + } + // Tag name state + //------------------------------------------------------------------ + _stateTagName(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.BEFORE_ATTRIBUTE_NAME; + break; + } + case CODE_POINTS.SOLIDUS: { + this.state = State.SELF_CLOSING_START_TAG; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.tagName += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + token.tagName += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp); + } + } + } + // RCDATA less-than sign state + //------------------------------------------------------------------ + _stateRcdataLessThanSign(cp) { + if (cp === CODE_POINTS.SOLIDUS) { + this.state = State.RCDATA_END_TAG_OPEN; + } + else { + this._emitChars('<'); + this.state = State.RCDATA; + this._stateRcdata(cp); + } + } + // RCDATA end tag open state + //------------------------------------------------------------------ + _stateRcdataEndTagOpen(cp) { + if (isAsciiLetter(cp)) { + this.state = State.RCDATA_END_TAG_NAME; + this._stateRcdataEndTagName(cp); + } + else { + this._emitChars('</'); + this.state = State.RCDATA; + this._stateRcdata(cp); + } + } + handleSpecialEndTag(_cp) { + if (!this.preprocessor.startsWith(this.lastStartTagName, false)) { + return !this._ensureHibernation(); + } + this._createEndTagToken(); + const token = this.currentToken; + token.tagName = this.lastStartTagName; + const cp = this.preprocessor.peek(this.lastStartTagName.length); + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this._advanceBy(this.lastStartTagName.length); + this.state = State.BEFORE_ATTRIBUTE_NAME; + return false; + } + case CODE_POINTS.SOLIDUS: { + this._advanceBy(this.lastStartTagName.length); + this.state = State.SELF_CLOSING_START_TAG; + return false; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._advanceBy(this.lastStartTagName.length); + this.emitCurrentTagToken(); + this.state = State.DATA; + return false; + } + default: { + return !this._ensureHibernation(); + } + } + } + // RCDATA end tag name state + //------------------------------------------------------------------ + _stateRcdataEndTagName(cp) { + if (this.handleSpecialEndTag(cp)) { + this._emitChars('</'); + this.state = State.RCDATA; + this._stateRcdata(cp); + } + } + // RAWTEXT less-than sign state + //------------------------------------------------------------------ + _stateRawtextLessThanSign(cp) { + if (cp === CODE_POINTS.SOLIDUS) { + this.state = State.RAWTEXT_END_TAG_OPEN; + } + else { + this._emitChars('<'); + this.state = State.RAWTEXT; + this._stateRawtext(cp); + } + } + // RAWTEXT end tag open state + //------------------------------------------------------------------ + _stateRawtextEndTagOpen(cp) { + if (isAsciiLetter(cp)) { + this.state = State.RAWTEXT_END_TAG_NAME; + this._stateRawtextEndTagName(cp); + } + else { + this._emitChars('</'); + this.state = State.RAWTEXT; + this._stateRawtext(cp); + } + } + // RAWTEXT end tag name state + //------------------------------------------------------------------ + _stateRawtextEndTagName(cp) { + if (this.handleSpecialEndTag(cp)) { + this._emitChars('</'); + this.state = State.RAWTEXT; + this._stateRawtext(cp); + } + } + // Script data less-than sign state + //------------------------------------------------------------------ + _stateScriptDataLessThanSign(cp) { + switch (cp) { + case CODE_POINTS.SOLIDUS: { + this.state = State.SCRIPT_DATA_END_TAG_OPEN; + break; + } + case CODE_POINTS.EXCLAMATION_MARK: { + this.state = State.SCRIPT_DATA_ESCAPE_START; + this._emitChars('<!'); + break; + } + default: { + this._emitChars('<'); + this.state = State.SCRIPT_DATA; + this._stateScriptData(cp); + } + } + } + // Script data end tag open state + //------------------------------------------------------------------ + _stateScriptDataEndTagOpen(cp) { + if (isAsciiLetter(cp)) { + this.state = State.SCRIPT_DATA_END_TAG_NAME; + this._stateScriptDataEndTagName(cp); + } + else { + this._emitChars('</'); + this.state = State.SCRIPT_DATA; + this._stateScriptData(cp); + } + } + // Script data end tag name state + //------------------------------------------------------------------ + _stateScriptDataEndTagName(cp) { + if (this.handleSpecialEndTag(cp)) { + this._emitChars('</'); + this.state = State.SCRIPT_DATA; + this._stateScriptData(cp); + } + } + // Script data escape start state + //------------------------------------------------------------------ + _stateScriptDataEscapeStart(cp) { + if (cp === CODE_POINTS.HYPHEN_MINUS) { + this.state = State.SCRIPT_DATA_ESCAPE_START_DASH; + this._emitChars('-'); + } + else { + this.state = State.SCRIPT_DATA; + this._stateScriptData(cp); + } + } + // Script data escape start dash state + //------------------------------------------------------------------ + _stateScriptDataEscapeStartDash(cp) { + if (cp === CODE_POINTS.HYPHEN_MINUS) { + this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH; + this._emitChars('-'); + } + else { + this.state = State.SCRIPT_DATA; + this._stateScriptData(cp); + } + } + // Script data escaped state + //------------------------------------------------------------------ + _stateScriptDataEscaped(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.SCRIPT_DATA_ESCAPED_DASH; + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // Script data escaped dash state + //------------------------------------------------------------------ + _stateScriptDataEscapedDash(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH; + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.state = State.SCRIPT_DATA_ESCAPED; + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this.state = State.SCRIPT_DATA_ESCAPED; + this._emitCodePoint(cp); + } + } + } + // Script data escaped dash dash state + //------------------------------------------------------------------ + _stateScriptDataEscapedDashDash(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.SCRIPT_DATA; + this._emitChars('>'); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.state = State.SCRIPT_DATA_ESCAPED; + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this.state = State.SCRIPT_DATA_ESCAPED; + this._emitCodePoint(cp); + } + } + } + // Script data escaped less-than sign state + //------------------------------------------------------------------ + _stateScriptDataEscapedLessThanSign(cp) { + if (cp === CODE_POINTS.SOLIDUS) { + this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN; + } + else if (isAsciiLetter(cp)) { + this._emitChars('<'); + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START; + this._stateScriptDataDoubleEscapeStart(cp); + } + else { + this._emitChars('<'); + this.state = State.SCRIPT_DATA_ESCAPED; + this._stateScriptDataEscaped(cp); + } + } + // Script data escaped end tag open state + //------------------------------------------------------------------ + _stateScriptDataEscapedEndTagOpen(cp) { + if (isAsciiLetter(cp)) { + this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME; + this._stateScriptDataEscapedEndTagName(cp); + } + else { + this._emitChars('</'); + this.state = State.SCRIPT_DATA_ESCAPED; + this._stateScriptDataEscaped(cp); + } + } + // Script data escaped end tag name state + //------------------------------------------------------------------ + _stateScriptDataEscapedEndTagName(cp) { + if (this.handleSpecialEndTag(cp)) { + this._emitChars('</'); + this.state = State.SCRIPT_DATA_ESCAPED; + this._stateScriptDataEscaped(cp); + } + } + // Script data double escape start state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscapeStart(cp) { + if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && + isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) { + this._emitCodePoint(cp); + for (let i = 0; i < SEQUENCES.SCRIPT.length; i++) { + this._emitCodePoint(this._consume()); + } + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + } + else if (!this._ensureHibernation()) { + this.state = State.SCRIPT_DATA_ESCAPED; + this._stateScriptDataEscaped(cp); + } + } + // Script data double escaped state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscaped(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH; + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN; + this._emitChars('<'); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // Script data double escaped dash state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscapedDash(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH; + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN; + this._emitChars('<'); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._emitCodePoint(cp); + } + } + } + // Script data double escaped dash dash state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscapedDashDash(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this._emitChars('-'); + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN; + this._emitChars('<'); + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.SCRIPT_DATA; + this._emitChars('>'); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._emitChars(REPLACEMENT_CHARACTER); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + break; + } + default: { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._emitCodePoint(cp); + } + } + } + // Script data double escaped less-than sign state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscapedLessThanSign(cp) { + if (cp === CODE_POINTS.SOLIDUS) { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_END; + this._emitChars('/'); + } + else { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._stateScriptDataDoubleEscaped(cp); + } + } + // Script data double escape end state + //------------------------------------------------------------------ + _stateScriptDataDoubleEscapeEnd(cp) { + if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && + isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) { + this._emitCodePoint(cp); + for (let i = 0; i < SEQUENCES.SCRIPT.length; i++) { + this._emitCodePoint(this._consume()); + } + this.state = State.SCRIPT_DATA_ESCAPED; + } + else if (!this._ensureHibernation()) { + this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED; + this._stateScriptDataDoubleEscaped(cp); + } + } + // Before attribute name state + //------------------------------------------------------------------ + _stateBeforeAttributeName(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.SOLIDUS: + case CODE_POINTS.GREATER_THAN_SIGN: + case CODE_POINTS.EOF: { + this.state = State.AFTER_ATTRIBUTE_NAME; + this._stateAfterAttributeName(cp); + break; + } + case CODE_POINTS.EQUALS_SIGN: { + this._err(ERR.unexpectedEqualsSignBeforeAttributeName); + this._createAttr('='); + this.state = State.ATTRIBUTE_NAME; + break; + } + default: { + this._createAttr(''); + this.state = State.ATTRIBUTE_NAME; + this._stateAttributeName(cp); + } + } + } + // Attribute name state + //------------------------------------------------------------------ + _stateAttributeName(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: + case CODE_POINTS.SOLIDUS: + case CODE_POINTS.GREATER_THAN_SIGN: + case CODE_POINTS.EOF: { + this._leaveAttrName(); + this.state = State.AFTER_ATTRIBUTE_NAME; + this._stateAfterAttributeName(cp); + break; + } + case CODE_POINTS.EQUALS_SIGN: { + this._leaveAttrName(); + this.state = State.BEFORE_ATTRIBUTE_VALUE; + break; + } + case CODE_POINTS.QUOTATION_MARK: + case CODE_POINTS.APOSTROPHE: + case CODE_POINTS.LESS_THAN_SIGN: { + this._err(ERR.unexpectedCharacterInAttributeName); + this.currentAttr.name += String.fromCodePoint(cp); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.name += REPLACEMENT_CHARACTER; + break; + } + default: { + this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp); + } + } + } + // After attribute name state + //------------------------------------------------------------------ + _stateAfterAttributeName(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.SOLIDUS: { + this.state = State.SELF_CLOSING_START_TAG; + break; + } + case CODE_POINTS.EQUALS_SIGN: { + this.state = State.BEFORE_ATTRIBUTE_VALUE; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this._createAttr(''); + this.state = State.ATTRIBUTE_NAME; + this._stateAttributeName(cp); + } + } + } + // Before attribute value state + //------------------------------------------------------------------ + _stateBeforeAttributeValue(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.QUOTATION_MARK: { + this.state = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + this.state = State.ATTRIBUTE_VALUE_SINGLE_QUOTED; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingAttributeValue); + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + default: { + this.state = State.ATTRIBUTE_VALUE_UNQUOTED; + this._stateAttributeValueUnquoted(cp); + } + } + } + // Attribute value (double-quoted) state + //------------------------------------------------------------------ + _stateAttributeValueDoubleQuoted(cp) { + switch (cp) { + case CODE_POINTS.QUOTATION_MARK: { + this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED; + break; + } + case CODE_POINTS.AMPERSAND: { + this._startCharacterReference(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this.currentAttr.value += String.fromCodePoint(cp); + } + } + } + // Attribute value (single-quoted) state + //------------------------------------------------------------------ + _stateAttributeValueSingleQuoted(cp) { + switch (cp) { + case CODE_POINTS.APOSTROPHE: { + this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED; + break; + } + case CODE_POINTS.AMPERSAND: { + this._startCharacterReference(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this.currentAttr.value += String.fromCodePoint(cp); + } + } + } + // Attribute value (unquoted) state + //------------------------------------------------------------------ + _stateAttributeValueUnquoted(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this._leaveAttrValue(); + this.state = State.BEFORE_ATTRIBUTE_NAME; + break; + } + case CODE_POINTS.AMPERSAND: { + this._startCharacterReference(); + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._leaveAttrValue(); + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.QUOTATION_MARK: + case CODE_POINTS.APOSTROPHE: + case CODE_POINTS.LESS_THAN_SIGN: + case CODE_POINTS.EQUALS_SIGN: + case CODE_POINTS.GRAVE_ACCENT: { + this._err(ERR.unexpectedCharacterInUnquotedAttributeValue); + this.currentAttr.value += String.fromCodePoint(cp); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this.currentAttr.value += String.fromCodePoint(cp); + } + } + } + // After attribute value (quoted) state + //------------------------------------------------------------------ + _stateAfterAttributeValueQuoted(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this._leaveAttrValue(); + this.state = State.BEFORE_ATTRIBUTE_NAME; + break; + } + case CODE_POINTS.SOLIDUS: { + this._leaveAttrValue(); + this.state = State.SELF_CLOSING_START_TAG; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._leaveAttrValue(); + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingWhitespaceBetweenAttributes); + this.state = State.BEFORE_ATTRIBUTE_NAME; + this._stateBeforeAttributeName(cp); + } + } + } + // Self-closing start tag state + //------------------------------------------------------------------ + _stateSelfClosingStartTag(cp) { + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + const token = this.currentToken; + token.selfClosing = true; + this.state = State.DATA; + this.emitCurrentTagToken(); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInTag); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.unexpectedSolidusInTag); + this.state = State.BEFORE_ATTRIBUTE_NAME; + this._stateBeforeAttributeName(cp); + } + } + } + // Bogus comment state + //------------------------------------------------------------------ + _stateBogusComment(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentComment(token); + break; + } + case CODE_POINTS.EOF: { + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.data += REPLACEMENT_CHARACTER; + break; + } + default: { + token.data += String.fromCodePoint(cp); + } + } + } + // Markup declaration open state + //------------------------------------------------------------------ + _stateMarkupDeclarationOpen(cp) { + if (this._consumeSequenceIfMatch(SEQUENCES.DASH_DASH, true)) { + this._createCommentToken(SEQUENCES.DASH_DASH.length + 1); + this.state = State.COMMENT_START; + } + else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) { + // NOTE: Doctypes tokens are created without fixed offsets. We keep track of the moment a doctype *might* start here. + this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1); + this.state = State.DOCTYPE; + } + else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) { + if (this.inForeignNode) { + this.state = State.CDATA_SECTION; + } + else { + this._err(ERR.cdataInHtmlContent); + this._createCommentToken(SEQUENCES.CDATA_START.length + 1); + this.currentToken.data = '[CDATA['; + this.state = State.BOGUS_COMMENT; + } + } + //NOTE: Sequence lookups can be abrupted by hibernation. In that case, lookup + //results are no longer valid and we will need to start over. + else if (!this._ensureHibernation()) { + this._err(ERR.incorrectlyOpenedComment); + this._createCommentToken(2); + this.state = State.BOGUS_COMMENT; + this._stateBogusComment(cp); + } + } + // Comment start state + //------------------------------------------------------------------ + _stateCommentStart(cp) { + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.COMMENT_START_DASH; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptClosingOfEmptyComment); + this.state = State.DATA; + const token = this.currentToken; + this.emitCurrentComment(token); + break; + } + default: { + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // Comment start dash state + //------------------------------------------------------------------ + _stateCommentStartDash(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.COMMENT_END; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptClosingOfEmptyComment); + this.state = State.DATA; + this.emitCurrentComment(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInComment); + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + default: { + token.data += '-'; + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // Comment state + //------------------------------------------------------------------ + _stateComment(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.COMMENT_END_DASH; + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + token.data += '<'; + this.state = State.COMMENT_LESS_THAN_SIGN; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.data += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInComment); + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + default: { + token.data += String.fromCodePoint(cp); + } + } + } + // Comment less-than sign state + //------------------------------------------------------------------ + _stateCommentLessThanSign(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.EXCLAMATION_MARK: { + token.data += '!'; + this.state = State.COMMENT_LESS_THAN_SIGN_BANG; + break; + } + case CODE_POINTS.LESS_THAN_SIGN: { + token.data += '<'; + break; + } + default: { + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // Comment less-than sign bang state + //------------------------------------------------------------------ + _stateCommentLessThanSignBang(cp) { + if (cp === CODE_POINTS.HYPHEN_MINUS) { + this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH; + } + else { + this.state = State.COMMENT; + this._stateComment(cp); + } + } + // Comment less-than sign bang dash state + //------------------------------------------------------------------ + _stateCommentLessThanSignBangDash(cp) { + if (cp === CODE_POINTS.HYPHEN_MINUS) { + this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH; + } + else { + this.state = State.COMMENT_END_DASH; + this._stateCommentEndDash(cp); + } + } + // Comment less-than sign bang dash dash state + //------------------------------------------------------------------ + _stateCommentLessThanSignBangDashDash(cp) { + if (cp !== CODE_POINTS.GREATER_THAN_SIGN && cp !== CODE_POINTS.EOF) { + this._err(ERR.nestedComment); + } + this.state = State.COMMENT_END; + this._stateCommentEnd(cp); + } + // Comment end dash state + //------------------------------------------------------------------ + _stateCommentEndDash(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + this.state = State.COMMENT_END; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInComment); + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + default: { + token.data += '-'; + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // Comment end state + //------------------------------------------------------------------ + _stateCommentEnd(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentComment(token); + break; + } + case CODE_POINTS.EXCLAMATION_MARK: { + this.state = State.COMMENT_END_BANG; + break; + } + case CODE_POINTS.HYPHEN_MINUS: { + token.data += '-'; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInComment); + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + default: { + token.data += '--'; + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // Comment end bang state + //------------------------------------------------------------------ + _stateCommentEndBang(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.HYPHEN_MINUS: { + token.data += '--!'; + this.state = State.COMMENT_END_DASH; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.incorrectlyClosedComment); + this.state = State.DATA; + this.emitCurrentComment(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInComment); + this.emitCurrentComment(token); + this._emitEOFToken(); + break; + } + default: { + token.data += '--!'; + this.state = State.COMMENT; + this._stateComment(cp); + } + } + } + // DOCTYPE state + //------------------------------------------------------------------ + _stateDoctype(cp) { + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.BEFORE_DOCTYPE_NAME; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.BEFORE_DOCTYPE_NAME; + this._stateBeforeDoctypeName(cp); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + this._createDoctypeToken(null); + const token = this.currentToken; + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingWhitespaceBeforeDoctypeName); + this.state = State.BEFORE_DOCTYPE_NAME; + this._stateBeforeDoctypeName(cp); + } + } + } + // Before DOCTYPE name state + //------------------------------------------------------------------ + _stateBeforeDoctypeName(cp) { + if (isAsciiUpper(cp)) { + this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp))); + this.state = State.DOCTYPE_NAME; + } + else + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + this._createDoctypeToken(REPLACEMENT_CHARACTER); + this.state = State.DOCTYPE_NAME; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingDoctypeName); + this._createDoctypeToken(null); + const token = this.currentToken; + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + this._createDoctypeToken(null); + const token = this.currentToken; + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._createDoctypeToken(String.fromCodePoint(cp)); + this.state = State.DOCTYPE_NAME; + } + } + } + // DOCTYPE name state + //------------------------------------------------------------------ + _stateDoctypeName(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.AFTER_DOCTYPE_NAME; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.name += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + token.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp); + } + } + } + // After DOCTYPE name state + //------------------------------------------------------------------ + _stateAfterDoctypeName(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + if (this._consumeSequenceIfMatch(SEQUENCES.PUBLIC, false)) { + this.state = State.AFTER_DOCTYPE_PUBLIC_KEYWORD; + } + else if (this._consumeSequenceIfMatch(SEQUENCES.SYSTEM, false)) { + this.state = State.AFTER_DOCTYPE_SYSTEM_KEYWORD; + } + //NOTE: sequence lookup can be abrupted by hibernation. In that case lookup + //results are no longer valid and we will need to start over. + else if (!this._ensureHibernation()) { + this._err(ERR.invalidCharacterSequenceAfterDoctypeName); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + } + // After DOCTYPE public keyword state + //------------------------------------------------------------------ + _stateAfterDoctypePublicKeyword(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER; + break; + } + case CODE_POINTS.QUOTATION_MARK: { + this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword); + token.publicId = ''; + this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword); + token.publicId = ''; + this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingDoctypePublicIdentifier); + token.forceQuirks = true; + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // Before DOCTYPE public identifier state + //------------------------------------------------------------------ + _stateBeforeDoctypePublicIdentifier(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.QUOTATION_MARK: { + token.publicId = ''; + this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + token.publicId = ''; + this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingDoctypePublicIdentifier); + token.forceQuirks = true; + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // DOCTYPE public identifier (double-quoted) state + //------------------------------------------------------------------ + _stateDoctypePublicIdentifierDoubleQuoted(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.QUOTATION_MARK: { + this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.publicId += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptDoctypePublicIdentifier); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + token.publicId += String.fromCodePoint(cp); + } + } + } + // DOCTYPE public identifier (single-quoted) state + //------------------------------------------------------------------ + _stateDoctypePublicIdentifierSingleQuoted(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.APOSTROPHE: { + this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.publicId += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptDoctypePublicIdentifier); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + token.publicId += String.fromCodePoint(cp); + } + } + } + // After DOCTYPE public identifier state + //------------------------------------------------------------------ + _stateAfterDoctypePublicIdentifier(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.QUOTATION_MARK: { + this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers); + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers); + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // Between DOCTYPE public and system identifiers state + //------------------------------------------------------------------ + _stateBetweenDoctypePublicAndSystemIdentifiers(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.QUOTATION_MARK: { + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // After DOCTYPE system keyword state + //------------------------------------------------------------------ + _stateAfterDoctypeSystemKeyword(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + this.state = State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER; + break; + } + case CODE_POINTS.QUOTATION_MARK: { + this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword); + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword); + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // Before DOCTYPE system identifier state + //------------------------------------------------------------------ + _stateBeforeDoctypeSystemIdentifier(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.QUOTATION_MARK: { + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; + break; + } + case CODE_POINTS.APOSTROPHE: { + token.systemId = ''; + this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.missingDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.DATA; + this.emitCurrentDoctype(token); + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + token.forceQuirks = true; + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // DOCTYPE system identifier (double-quoted) state + //------------------------------------------------------------------ + _stateDoctypeSystemIdentifierDoubleQuoted(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.QUOTATION_MARK: { + this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.systemId += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptDoctypeSystemIdentifier); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + token.systemId += String.fromCodePoint(cp); + } + } + } + // DOCTYPE system identifier (single-quoted) state + //------------------------------------------------------------------ + _stateDoctypeSystemIdentifierSingleQuoted(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.APOSTROPHE: { + this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + token.systemId += REPLACEMENT_CHARACTER; + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this._err(ERR.abruptDoctypeSystemIdentifier); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + token.systemId += String.fromCodePoint(cp); + } + } + } + // After DOCTYPE system identifier state + //------------------------------------------------------------------ + _stateAfterDoctypeSystemIdentifier(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.SPACE: + case CODE_POINTS.LINE_FEED: + case CODE_POINTS.TABULATION: + case CODE_POINTS.FORM_FEED: { + // Ignore whitespace + break; + } + case CODE_POINTS.GREATER_THAN_SIGN: { + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInDoctype); + token.forceQuirks = true; + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + default: { + this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier); + this.state = State.BOGUS_DOCTYPE; + this._stateBogusDoctype(cp); + } + } + } + // Bogus DOCTYPE state + //------------------------------------------------------------------ + _stateBogusDoctype(cp) { + const token = this.currentToken; + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + this.emitCurrentDoctype(token); + this.state = State.DATA; + break; + } + case CODE_POINTS.NULL: { + this._err(ERR.unexpectedNullCharacter); + break; + } + case CODE_POINTS.EOF: { + this.emitCurrentDoctype(token); + this._emitEOFToken(); + break; + } + // Do nothing + } + } + // CDATA section state + //------------------------------------------------------------------ + _stateCdataSection(cp) { + switch (cp) { + case CODE_POINTS.RIGHT_SQUARE_BRACKET: { + this.state = State.CDATA_SECTION_BRACKET; + break; + } + case CODE_POINTS.EOF: { + this._err(ERR.eofInCdata); + this._emitEOFToken(); + break; + } + default: { + this._emitCodePoint(cp); + } + } + } + // CDATA section bracket state + //------------------------------------------------------------------ + _stateCdataSectionBracket(cp) { + if (cp === CODE_POINTS.RIGHT_SQUARE_BRACKET) { + this.state = State.CDATA_SECTION_END; + } + else { + this._emitChars(']'); + this.state = State.CDATA_SECTION; + this._stateCdataSection(cp); + } + } + // CDATA section end state + //------------------------------------------------------------------ + _stateCdataSectionEnd(cp) { + switch (cp) { + case CODE_POINTS.GREATER_THAN_SIGN: { + this.state = State.DATA; + break; + } + case CODE_POINTS.RIGHT_SQUARE_BRACKET: { + this._emitChars(']'); + break; + } + default: { + this._emitChars(']]'); + this.state = State.CDATA_SECTION; + this._stateCdataSection(cp); + } + } + } + // Character reference state + //------------------------------------------------------------------ + _stateCharacterReference() { + let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos); + if (length < 0) { + if (this.preprocessor.lastChunkWritten) { + length = this.entityDecoder.end(); + } + else { + // Wait for the rest of the entity. + this.active = false; + // Mark the entire buffer as read. + this.preprocessor.pos = this.preprocessor.html.length - 1; + this.consumedAfterSnapshot = 0; + this.preprocessor.endOfChunkHit = true; + return; + } + } + if (length === 0) { + // This was not a valid entity. Go back to the beginning, and + // figure out what to do. + this.preprocessor.pos = this.entityStartPos; + this._flushCodePointConsumedAsCharacterReference(CODE_POINTS.AMPERSAND); + this.state = + !this._isCharacterReferenceInAttribute() && isAsciiAlphaNumeric(this.preprocessor.peek(1)) + ? State.AMBIGUOUS_AMPERSAND + : this.returnState; + } + else { + // We successfully parsed an entity. Switch to the return state. + this.state = this.returnState; + } + } + // Ambiguos ampersand state + //------------------------------------------------------------------ + _stateAmbiguousAmpersand(cp) { + if (isAsciiAlphaNumeric(cp)) { + this._flushCodePointConsumedAsCharacterReference(cp); + } + else { + if (cp === CODE_POINTS.SEMICOLON) { + this._err(ERR.unknownNamedCharacterReference); + } + this.state = this.returnState; + this._callState(cp); + } + } +} + +//Element utils +const IMPLICIT_END_TAG_REQUIRED = new Set([TAG_ID.DD, TAG_ID.DT, TAG_ID.LI, TAG_ID.OPTGROUP, TAG_ID.OPTION, TAG_ID.P, TAG_ID.RB, TAG_ID.RP, TAG_ID.RT, TAG_ID.RTC]); +const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([ + ...IMPLICIT_END_TAG_REQUIRED, + TAG_ID.CAPTION, + TAG_ID.COLGROUP, + TAG_ID.TBODY, + TAG_ID.TD, + TAG_ID.TFOOT, + TAG_ID.TH, + TAG_ID.THEAD, + TAG_ID.TR, +]); +const SCOPING_ELEMENTS_HTML = new Set([ + TAG_ID.APPLET, + TAG_ID.CAPTION, + TAG_ID.HTML, + TAG_ID.MARQUEE, + TAG_ID.OBJECT, + TAG_ID.TABLE, + TAG_ID.TD, + TAG_ID.TEMPLATE, + TAG_ID.TH, +]); +const SCOPING_ELEMENTS_HTML_LIST = new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.OL, TAG_ID.UL]); +const SCOPING_ELEMENTS_HTML_BUTTON = new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.BUTTON]); +const SCOPING_ELEMENTS_MATHML = new Set([TAG_ID.ANNOTATION_XML, TAG_ID.MI, TAG_ID.MN, TAG_ID.MO, TAG_ID.MS, TAG_ID.MTEXT]); +const SCOPING_ELEMENTS_SVG = new Set([TAG_ID.DESC, TAG_ID.FOREIGN_OBJECT, TAG_ID.TITLE]); +const TABLE_ROW_CONTEXT = new Set([TAG_ID.TR, TAG_ID.TEMPLATE, TAG_ID.HTML]); +const TABLE_BODY_CONTEXT = new Set([TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TEMPLATE, TAG_ID.HTML]); +const TABLE_CONTEXT = new Set([TAG_ID.TABLE, TAG_ID.TEMPLATE, TAG_ID.HTML]); +const TABLE_CELLS = new Set([TAG_ID.TD, TAG_ID.TH]); +//Stack of open elements +class OpenElementStack { + get currentTmplContentOrNode() { + return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current; + } + constructor(document, treeAdapter, handler) { + this.treeAdapter = treeAdapter; + this.handler = handler; + this.items = []; + this.tagIDs = []; + this.stackTop = -1; + this.tmplCount = 0; + this.currentTagId = TAG_ID.UNKNOWN; + this.current = document; + } + //Index of element + _indexOf(element) { + return this.items.lastIndexOf(element, this.stackTop); + } + //Update current element + _isInTemplate() { + return this.currentTagId === TAG_ID.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML; + } + _updateCurrentElement() { + this.current = this.items[this.stackTop]; + this.currentTagId = this.tagIDs[this.stackTop]; + } + //Mutations + push(element, tagID) { + this.stackTop++; + this.items[this.stackTop] = element; + this.current = element; + this.tagIDs[this.stackTop] = tagID; + this.currentTagId = tagID; + if (this._isInTemplate()) { + this.tmplCount++; + } + this.handler.onItemPush(element, tagID, true); + } + pop() { + const popped = this.current; + if (this.tmplCount > 0 && this._isInTemplate()) { + this.tmplCount--; + } + this.stackTop--; + this._updateCurrentElement(); + this.handler.onItemPop(popped, true); + } + replace(oldElement, newElement) { + const idx = this._indexOf(oldElement); + this.items[idx] = newElement; + if (idx === this.stackTop) { + this.current = newElement; + } + } + insertAfter(referenceElement, newElement, newElementID) { + const insertionIdx = this._indexOf(referenceElement) + 1; + this.items.splice(insertionIdx, 0, newElement); + this.tagIDs.splice(insertionIdx, 0, newElementID); + this.stackTop++; + if (insertionIdx === this.stackTop) { + this._updateCurrentElement(); + } + this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop); + } + popUntilTagNamePopped(tagName) { + let targetIdx = this.stackTop + 1; + do { + targetIdx = this.tagIDs.lastIndexOf(tagName, targetIdx - 1); + } while (targetIdx > 0 && this.treeAdapter.getNamespaceURI(this.items[targetIdx]) !== NS.HTML); + this.shortenToLength(targetIdx < 0 ? 0 : targetIdx); + } + shortenToLength(idx) { + while (this.stackTop >= idx) { + const popped = this.current; + if (this.tmplCount > 0 && this._isInTemplate()) { + this.tmplCount -= 1; + } + this.stackTop--; + this._updateCurrentElement(); + this.handler.onItemPop(popped, this.stackTop < idx); + } + } + popUntilElementPopped(element) { + const idx = this._indexOf(element); + this.shortenToLength(idx < 0 ? 0 : idx); + } + popUntilPopped(tagNames, targetNS) { + const idx = this._indexOfTagNames(tagNames, targetNS); + this.shortenToLength(idx < 0 ? 0 : idx); + } + popUntilNumberedHeaderPopped() { + this.popUntilPopped(NUMBERED_HEADERS, NS.HTML); + } + popUntilTableCellPopped() { + this.popUntilPopped(TABLE_CELLS, NS.HTML); + } + popAllUpToHtmlElement() { + //NOTE: here we assume that the root <html> element is always first in the open element stack, so + //we perform this fast stack clean up. + this.tmplCount = 0; + this.shortenToLength(1); + } + _indexOfTagNames(tagNames, namespace) { + for (let i = this.stackTop; i >= 0; i--) { + if (tagNames.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) { + return i; + } + } + return -1; + } + clearBackTo(tagNames, targetNS) { + const idx = this._indexOfTagNames(tagNames, targetNS); + this.shortenToLength(idx + 1); + } + clearBackToTableContext() { + this.clearBackTo(TABLE_CONTEXT, NS.HTML); + } + clearBackToTableBodyContext() { + this.clearBackTo(TABLE_BODY_CONTEXT, NS.HTML); + } + clearBackToTableRowContext() { + this.clearBackTo(TABLE_ROW_CONTEXT, NS.HTML); + } + remove(element) { + const idx = this._indexOf(element); + if (idx >= 0) { + if (idx === this.stackTop) { + this.pop(); + } + else { + this.items.splice(idx, 1); + this.tagIDs.splice(idx, 1); + this.stackTop--; + this._updateCurrentElement(); + this.handler.onItemPop(element, false); + } + } + } + //Search + tryPeekProperlyNestedBodyElement() { + //Properly nested <body> element (should be second element in stack). + return this.stackTop >= 1 && this.tagIDs[1] === TAG_ID.BODY ? this.items[1] : null; + } + contains(element) { + return this._indexOf(element) > -1; + } + getCommonAncestor(element) { + const elementIdx = this._indexOf(element) - 1; + return elementIdx >= 0 ? this.items[elementIdx] : null; + } + isRootHtmlElementCurrent() { + return this.stackTop === 0 && this.tagIDs[0] === TAG_ID.HTML; + } + //Element in scope + hasInDynamicScope(tagName, htmlScope) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.tagIDs[i]; + switch (this.treeAdapter.getNamespaceURI(this.items[i])) { + case NS.HTML: { + if (tn === tagName) + return true; + if (htmlScope.has(tn)) + return false; + break; + } + case NS.SVG: { + if (SCOPING_ELEMENTS_SVG.has(tn)) + return false; + break; + } + case NS.MATHML: { + if (SCOPING_ELEMENTS_MATHML.has(tn)) + return false; + break; + } + } + } + return true; + } + hasInScope(tagName) { + return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML); + } + hasInListItemScope(tagName) { + return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_LIST); + } + hasInButtonScope(tagName) { + return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_BUTTON); + } + hasNumberedHeaderInScope() { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.tagIDs[i]; + switch (this.treeAdapter.getNamespaceURI(this.items[i])) { + case NS.HTML: { + if (NUMBERED_HEADERS.has(tn)) + return true; + if (SCOPING_ELEMENTS_HTML.has(tn)) + return false; + break; + } + case NS.SVG: { + if (SCOPING_ELEMENTS_SVG.has(tn)) + return false; + break; + } + case NS.MATHML: { + if (SCOPING_ELEMENTS_MATHML.has(tn)) + return false; + break; + } + } + } + return true; + } + hasInTableScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) { + continue; + } + switch (this.tagIDs[i]) { + case tagName: { + return true; + } + case TAG_ID.TABLE: + case TAG_ID.HTML: { + return false; + } + } + } + return true; + } + hasTableBodyContextInTableScope() { + for (let i = this.stackTop; i >= 0; i--) { + if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) { + continue; + } + switch (this.tagIDs[i]) { + case TAG_ID.TBODY: + case TAG_ID.THEAD: + case TAG_ID.TFOOT: { + return true; + } + case TAG_ID.TABLE: + case TAG_ID.HTML: { + return false; + } + } + } + return true; + } + hasInSelectScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) { + continue; + } + switch (this.tagIDs[i]) { + case tagName: { + return true; + } + case TAG_ID.OPTION: + case TAG_ID.OPTGROUP: { + break; + } + default: { + return false; + } + } + } + return true; + } + //Implied end tags + generateImpliedEndTags() { + while (IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) { + this.pop(); + } + } + generateImpliedEndTagsThoroughly() { + while (IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) { + this.pop(); + } + } + generateImpliedEndTagsWithExclusion(exclusionId) { + while (this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) { + this.pop(); + } + } +} + +//Const +const NOAH_ARK_CAPACITY = 3; +var EntryType; +(function (EntryType) { + EntryType[EntryType["Marker"] = 0] = "Marker"; + EntryType[EntryType["Element"] = 1] = "Element"; +})(EntryType || (EntryType = {})); +const MARKER = { type: EntryType.Marker }; +//List of formatting elements +class FormattingElementList { + constructor(treeAdapter) { + this.treeAdapter = treeAdapter; + this.entries = []; + this.bookmark = null; + } + //Noah Ark's condition + //OPTIMIZATION: at first we try to find possible candidates for exclusion using + //lightweight heuristics without thorough attributes check. + _getNoahArkConditionCandidates(newElement, neAttrs) { + const candidates = []; + const neAttrsLength = neAttrs.length; + const neTagName = this.treeAdapter.getTagName(newElement); + const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); + for (let i = 0; i < this.entries.length; i++) { + const entry = this.entries[i]; + if (entry.type === EntryType.Marker) { + break; + } + const { element } = entry; + if (this.treeAdapter.getTagName(element) === neTagName && + this.treeAdapter.getNamespaceURI(element) === neNamespaceURI) { + const elementAttrs = this.treeAdapter.getAttrList(element); + if (elementAttrs.length === neAttrsLength) { + candidates.push({ idx: i, attrs: elementAttrs }); + } + } + } + return candidates; + } + _ensureNoahArkCondition(newElement) { + if (this.entries.length < NOAH_ARK_CAPACITY) + return; + const neAttrs = this.treeAdapter.getAttrList(newElement); + const candidates = this._getNoahArkConditionCandidates(newElement, neAttrs); + if (candidates.length < NOAH_ARK_CAPACITY) + return; + //NOTE: build attrs map for the new element, so we can perform fast lookups + const neAttrsMap = new Map(neAttrs.map((neAttr) => [neAttr.name, neAttr.value])); + let validCandidates = 0; + //NOTE: remove bottommost candidates, until Noah's Ark condition will not be met + for (let i = 0; i < candidates.length; i++) { + const candidate = candidates[i]; + // We know that `candidate.attrs.length === neAttrs.length` + if (candidate.attrs.every((cAttr) => neAttrsMap.get(cAttr.name) === cAttr.value)) { + validCandidates += 1; + if (validCandidates >= NOAH_ARK_CAPACITY) { + this.entries.splice(candidate.idx, 1); + } + } + } + } + //Mutations + insertMarker() { + this.entries.unshift(MARKER); + } + pushElement(element, token) { + this._ensureNoahArkCondition(element); + this.entries.unshift({ + type: EntryType.Element, + element, + token, + }); + } + insertElementAfterBookmark(element, token) { + const bookmarkIdx = this.entries.indexOf(this.bookmark); + this.entries.splice(bookmarkIdx, 0, { + type: EntryType.Element, + element, + token, + }); + } + removeEntry(entry) { + const entryIndex = this.entries.indexOf(entry); + if (entryIndex >= 0) { + this.entries.splice(entryIndex, 1); + } + } + /** + * Clears the list of formatting elements up to the last marker. + * + * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker + */ + clearToLastMarker() { + const markerIdx = this.entries.indexOf(MARKER); + if (markerIdx >= 0) { + this.entries.splice(0, markerIdx + 1); + } + else { + this.entries.length = 0; + } + } + //Search + getElementEntryInScopeWithTagName(tagName) { + const entry = this.entries.find((entry) => entry.type === EntryType.Marker || this.treeAdapter.getTagName(entry.element) === tagName); + return entry && entry.type === EntryType.Element ? entry : null; + } + getElementEntry(element) { + return this.entries.find((entry) => entry.type === EntryType.Element && entry.element === element); + } +} + +const defaultTreeAdapter = { + //Node construction + createDocument() { + return { + nodeName: '#document', + mode: DOCUMENT_MODE.NO_QUIRKS, + childNodes: [], + }; + }, + createDocumentFragment() { + return { + nodeName: '#document-fragment', + childNodes: [], + }; + }, + createElement(tagName, namespaceURI, attrs) { + return { + nodeName: tagName, + tagName, + attrs, + namespaceURI, + childNodes: [], + parentNode: null, + }; + }, + createCommentNode(data) { + return { + nodeName: '#comment', + data, + parentNode: null, + }; + }, + createTextNode(value) { + return { + nodeName: '#text', + value, + parentNode: null, + }; + }, + //Tree mutation + appendChild(parentNode, newNode) { + parentNode.childNodes.push(newNode); + newNode.parentNode = parentNode; + }, + insertBefore(parentNode, newNode, referenceNode) { + const insertionIdx = parentNode.childNodes.indexOf(referenceNode); + parentNode.childNodes.splice(insertionIdx, 0, newNode); + newNode.parentNode = parentNode; + }, + setTemplateContent(templateElement, contentElement) { + templateElement.content = contentElement; + }, + getTemplateContent(templateElement) { + return templateElement.content; + }, + setDocumentType(document, name, publicId, systemId) { + const doctypeNode = document.childNodes.find((node) => node.nodeName === '#documentType'); + if (doctypeNode) { + doctypeNode.name = name; + doctypeNode.publicId = publicId; + doctypeNode.systemId = systemId; + } + else { + const node = { + nodeName: '#documentType', + name, + publicId, + systemId, + parentNode: null, + }; + defaultTreeAdapter.appendChild(document, node); + } + }, + setDocumentMode(document, mode) { + document.mode = mode; + }, + getDocumentMode(document) { + return document.mode; + }, + detachNode(node) { + if (node.parentNode) { + const idx = node.parentNode.childNodes.indexOf(node); + node.parentNode.childNodes.splice(idx, 1); + node.parentNode = null; + } + }, + insertText(parentNode, text) { + if (parentNode.childNodes.length > 0) { + const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; + if (defaultTreeAdapter.isTextNode(prevNode)) { + prevNode.value += text; + return; + } + } + defaultTreeAdapter.appendChild(parentNode, defaultTreeAdapter.createTextNode(text)); + }, + insertTextBefore(parentNode, text, referenceNode) { + const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; + if (prevNode && defaultTreeAdapter.isTextNode(prevNode)) { + prevNode.value += text; + } + else { + defaultTreeAdapter.insertBefore(parentNode, defaultTreeAdapter.createTextNode(text), referenceNode); + } + }, + adoptAttributes(recipient, attrs) { + const recipientAttrsMap = new Set(recipient.attrs.map((attr) => attr.name)); + for (let j = 0; j < attrs.length; j++) { + if (!recipientAttrsMap.has(attrs[j].name)) { + recipient.attrs.push(attrs[j]); + } + } + }, + //Tree traversing + getFirstChild(node) { + return node.childNodes[0]; + }, + getChildNodes(node) { + return node.childNodes; + }, + getParentNode(node) { + return node.parentNode; + }, + getAttrList(element) { + return element.attrs; + }, + //Node data + getTagName(element) { + return element.tagName; + }, + getNamespaceURI(element) { + return element.namespaceURI; + }, + getTextNodeContent(textNode) { + return textNode.value; + }, + getCommentNodeContent(commentNode) { + return commentNode.data; + }, + getDocumentTypeNodeName(doctypeNode) { + return doctypeNode.name; + }, + getDocumentTypeNodePublicId(doctypeNode) { + return doctypeNode.publicId; + }, + getDocumentTypeNodeSystemId(doctypeNode) { + return doctypeNode.systemId; + }, + //Node types + isTextNode(node) { + return node.nodeName === '#text'; + }, + isCommentNode(node) { + return node.nodeName === '#comment'; + }, + isDocumentTypeNode(node) { + return node.nodeName === '#documentType'; + }, + isElementNode(node) { + return Object.prototype.hasOwnProperty.call(node, 'tagName'); + }, + // Source code location + setNodeSourceCodeLocation(node, location) { + node.sourceCodeLocation = location; + }, + getNodeSourceCodeLocation(node) { + return node.sourceCodeLocation; + }, + updateNodeSourceCodeLocation(node, endLocation) { + node.sourceCodeLocation = { ...node.sourceCodeLocation, ...endLocation }; + }, +}; + +//Const +const VALID_DOCTYPE_NAME = 'html'; +const VALID_SYSTEM_ID = 'about:legacy-compat'; +const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd'; +const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ + '+//silmaril//dtd html pro v0r11 19970101//', + '-//as//dtd html 3.0 aswedit + extensions//', + '-//advasoft ltd//dtd html 3.0 aswedit + extensions//', + '-//ietf//dtd html 2.0 level 1//', + '-//ietf//dtd html 2.0 level 2//', + '-//ietf//dtd html 2.0 strict level 1//', + '-//ietf//dtd html 2.0 strict level 2//', + '-//ietf//dtd html 2.0 strict//', + '-//ietf//dtd html 2.0//', + '-//ietf//dtd html 2.1e//', + '-//ietf//dtd html 3.0//', + '-//ietf//dtd html 3.2 final//', + '-//ietf//dtd html 3.2//', + '-//ietf//dtd html 3//', + '-//ietf//dtd html level 0//', + '-//ietf//dtd html level 1//', + '-//ietf//dtd html level 2//', + '-//ietf//dtd html level 3//', + '-//ietf//dtd html strict level 0//', + '-//ietf//dtd html strict level 1//', + '-//ietf//dtd html strict level 2//', + '-//ietf//dtd html strict level 3//', + '-//ietf//dtd html strict//', + '-//ietf//dtd html//', + '-//metrius//dtd metrius presentational//', + '-//microsoft//dtd internet explorer 2.0 html strict//', + '-//microsoft//dtd internet explorer 2.0 html//', + '-//microsoft//dtd internet explorer 2.0 tables//', + '-//microsoft//dtd internet explorer 3.0 html strict//', + '-//microsoft//dtd internet explorer 3.0 html//', + '-//microsoft//dtd internet explorer 3.0 tables//', + '-//netscape comm. corp.//dtd html//', + '-//netscape comm. corp.//dtd strict html//', + "-//o'reilly and associates//dtd html 2.0//", + "-//o'reilly and associates//dtd html extended 1.0//", + "-//o'reilly and associates//dtd html extended relaxed 1.0//", + '-//sq//dtd html 2.0 hotmetal + extensions//', + '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//', + '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//', + '-//spyglass//dtd html 2.0 extended//', + '-//sun microsystems corp.//dtd hotjava html//', + '-//sun microsystems corp.//dtd hotjava strict html//', + '-//w3c//dtd html 3 1995-03-24//', + '-//w3c//dtd html 3.2 draft//', + '-//w3c//dtd html 3.2 final//', + '-//w3c//dtd html 3.2//', + '-//w3c//dtd html 3.2s draft//', + '-//w3c//dtd html 4.0 frameset//', + '-//w3c//dtd html 4.0 transitional//', + '-//w3c//dtd html experimental 19960712//', + '-//w3c//dtd html experimental 970421//', + '-//w3c//dtd w3 html//', + '-//w3o//dtd w3 html 3.0//', + '-//webtechs//dtd mozilla html 2.0//', + '-//webtechs//dtd mozilla html//', +]; +const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [ + ...QUIRKS_MODE_PUBLIC_ID_PREFIXES, + '-//w3c//dtd html 4.01 frameset//', + '-//w3c//dtd html 4.01 transitional//', +]; +const QUIRKS_MODE_PUBLIC_IDS = new Set([ + '-//w3o//dtd w3 html strict 3.0//en//', + '-/w3c/dtd html 4.0 transitional/en', + 'html', +]); +const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//']; +const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [ + ...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES, + '-//w3c//dtd html 4.01 frameset//', + '-//w3c//dtd html 4.01 transitional//', +]; +//Utils +function hasPrefix(publicId, prefixes) { + return prefixes.some((prefix) => publicId.startsWith(prefix)); +} +//API +function isConforming(token) { + return (token.name === VALID_DOCTYPE_NAME && + token.publicId === null && + (token.systemId === null || token.systemId === VALID_SYSTEM_ID)); +} +function getDocumentMode(token) { + if (token.name !== VALID_DOCTYPE_NAME) { + return DOCUMENT_MODE.QUIRKS; + } + const { systemId } = token; + if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) { + return DOCUMENT_MODE.QUIRKS; + } + let { publicId } = token; + if (publicId !== null) { + publicId = publicId.toLowerCase(); + if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) { + return DOCUMENT_MODE.QUIRKS; + } + let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; + if (hasPrefix(publicId, prefixes)) { + return DOCUMENT_MODE.QUIRKS; + } + prefixes = + systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; + if (hasPrefix(publicId, prefixes)) { + return DOCUMENT_MODE.LIMITED_QUIRKS; + } + } + return DOCUMENT_MODE.NO_QUIRKS; +} + +//MIME types +const MIME_TYPES = { + TEXT_HTML: 'text/html', + APPLICATION_XML: 'application/xhtml+xml', +}; +//Attributes +const DEFINITION_URL_ATTR = 'definitionurl'; +const ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL'; +const SVG_ATTRS_ADJUSTMENT_MAP = new Map([ + 'attributeName', + 'attributeType', + 'baseFrequency', + 'baseProfile', + 'calcMode', + 'clipPathUnits', + 'diffuseConstant', + 'edgeMode', + 'filterUnits', + 'glyphRef', + 'gradientTransform', + 'gradientUnits', + 'kernelMatrix', + 'kernelUnitLength', + 'keyPoints', + 'keySplines', + 'keyTimes', + 'lengthAdjust', + 'limitingConeAngle', + 'markerHeight', + 'markerUnits', + 'markerWidth', + 'maskContentUnits', + 'maskUnits', + 'numOctaves', + 'pathLength', + 'patternContentUnits', + 'patternTransform', + 'patternUnits', + 'pointsAtX', + 'pointsAtY', + 'pointsAtZ', + 'preserveAlpha', + 'preserveAspectRatio', + 'primitiveUnits', + 'refX', + 'refY', + 'repeatCount', + 'repeatDur', + 'requiredExtensions', + 'requiredFeatures', + 'specularConstant', + 'specularExponent', + 'spreadMethod', + 'startOffset', + 'stdDeviation', + 'stitchTiles', + 'surfaceScale', + 'systemLanguage', + 'tableValues', + 'targetX', + 'targetY', + 'textLength', + 'viewBox', + 'viewTarget', + 'xChannelSelector', + 'yChannelSelector', + 'zoomAndPan', +].map((attr) => [attr.toLowerCase(), attr])); +const XML_ATTRS_ADJUSTMENT_MAP = new Map([ + ['xlink:actuate', { prefix: 'xlink', name: 'actuate', namespace: NS.XLINK }], + ['xlink:arcrole', { prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK }], + ['xlink:href', { prefix: 'xlink', name: 'href', namespace: NS.XLINK }], + ['xlink:role', { prefix: 'xlink', name: 'role', namespace: NS.XLINK }], + ['xlink:show', { prefix: 'xlink', name: 'show', namespace: NS.XLINK }], + ['xlink:title', { prefix: 'xlink', name: 'title', namespace: NS.XLINK }], + ['xlink:type', { prefix: 'xlink', name: 'type', namespace: NS.XLINK }], + ['xml:lang', { prefix: 'xml', name: 'lang', namespace: NS.XML }], + ['xml:space', { prefix: 'xml', name: 'space', namespace: NS.XML }], + ['xmlns', { prefix: '', name: 'xmlns', namespace: NS.XMLNS }], + ['xmlns:xlink', { prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS }], +]); +//SVG tag names adjustment map +const SVG_TAG_NAMES_ADJUSTMENT_MAP = new Map([ + 'altGlyph', + 'altGlyphDef', + 'altGlyphItem', + 'animateColor', + 'animateMotion', + 'animateTransform', + 'clipPath', + 'feBlend', + 'feColorMatrix', + 'feComponentTransfer', + 'feComposite', + 'feConvolveMatrix', + 'feDiffuseLighting', + 'feDisplacementMap', + 'feDistantLight', + 'feFlood', + 'feFuncA', + 'feFuncB', + 'feFuncG', + 'feFuncR', + 'feGaussianBlur', + 'feImage', + 'feMerge', + 'feMergeNode', + 'feMorphology', + 'feOffset', + 'fePointLight', + 'feSpecularLighting', + 'feSpotLight', + 'feTile', + 'feTurbulence', + 'foreignObject', + 'glyphRef', + 'linearGradient', + 'radialGradient', + 'textPath', +].map((tn) => [tn.toLowerCase(), tn])); +//Tags that causes exit from foreign content +const EXITS_FOREIGN_CONTENT = new Set([ + TAG_ID.B, + TAG_ID.BIG, + TAG_ID.BLOCKQUOTE, + TAG_ID.BODY, + TAG_ID.BR, + TAG_ID.CENTER, + TAG_ID.CODE, + TAG_ID.DD, + TAG_ID.DIV, + TAG_ID.DL, + TAG_ID.DT, + TAG_ID.EM, + TAG_ID.EMBED, + TAG_ID.H1, + TAG_ID.H2, + TAG_ID.H3, + TAG_ID.H4, + TAG_ID.H5, + TAG_ID.H6, + TAG_ID.HEAD, + TAG_ID.HR, + TAG_ID.I, + TAG_ID.IMG, + TAG_ID.LI, + TAG_ID.LISTING, + TAG_ID.MENU, + TAG_ID.META, + TAG_ID.NOBR, + TAG_ID.OL, + TAG_ID.P, + TAG_ID.PRE, + TAG_ID.RUBY, + TAG_ID.S, + TAG_ID.SMALL, + TAG_ID.SPAN, + TAG_ID.STRONG, + TAG_ID.STRIKE, + TAG_ID.SUB, + TAG_ID.SUP, + TAG_ID.TABLE, + TAG_ID.TT, + TAG_ID.U, + TAG_ID.UL, + TAG_ID.VAR, +]); +//Check exit from foreign content +function causesExit(startTagToken) { + const tn = startTagToken.tagID; + const isFontWithAttrs = tn === TAG_ID.FONT && + startTagToken.attrs.some(({ name }) => name === ATTRS.COLOR || name === ATTRS.SIZE || name === ATTRS.FACE); + return isFontWithAttrs || EXITS_FOREIGN_CONTENT.has(tn); +} +//Token adjustments +function adjustTokenMathMLAttrs(token) { + for (let i = 0; i < token.attrs.length; i++) { + if (token.attrs[i].name === DEFINITION_URL_ATTR) { + token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; + break; + } + } +} +function adjustTokenSVGAttrs(token) { + for (let i = 0; i < token.attrs.length; i++) { + const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name); + if (adjustedAttrName != null) { + token.attrs[i].name = adjustedAttrName; + } + } +} +function adjustTokenXMLAttrs(token) { + for (let i = 0; i < token.attrs.length; i++) { + const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name); + if (adjustedAttrEntry) { + token.attrs[i].prefix = adjustedAttrEntry.prefix; + token.attrs[i].name = adjustedAttrEntry.name; + token.attrs[i].namespace = adjustedAttrEntry.namespace; + } + } +} +function adjustTokenSVGTagName(token) { + const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP.get(token.tagName); + if (adjustedTagName != null) { + token.tagName = adjustedTagName; + token.tagID = getTagID(token.tagName); + } +} +//Integration points +function isMathMLTextIntegrationPoint(tn, ns) { + return ns === NS.MATHML && (tn === TAG_ID.MI || tn === TAG_ID.MO || tn === TAG_ID.MN || tn === TAG_ID.MS || tn === TAG_ID.MTEXT); +} +function isHtmlIntegrationPoint(tn, ns, attrs) { + if (ns === NS.MATHML && tn === TAG_ID.ANNOTATION_XML) { + for (let i = 0; i < attrs.length; i++) { + if (attrs[i].name === ATTRS.ENCODING) { + const value = attrs[i].value.toLowerCase(); + return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; + } + } + } + return ns === NS.SVG && (tn === TAG_ID.FOREIGN_OBJECT || tn === TAG_ID.DESC || tn === TAG_ID.TITLE); +} +function isIntegrationPoint(tn, ns, attrs, foreignNS) { + return (((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) || + ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns))); +} + +//Misc constants +const HIDDEN_INPUT_TYPE = 'hidden'; +//Adoption agency loops iteration count +const AA_OUTER_LOOP_ITER = 8; +const AA_INNER_LOOP_ITER = 3; +//Insertion modes +var InsertionMode; +(function (InsertionMode) { + InsertionMode[InsertionMode["INITIAL"] = 0] = "INITIAL"; + InsertionMode[InsertionMode["BEFORE_HTML"] = 1] = "BEFORE_HTML"; + InsertionMode[InsertionMode["BEFORE_HEAD"] = 2] = "BEFORE_HEAD"; + InsertionMode[InsertionMode["IN_HEAD"] = 3] = "IN_HEAD"; + InsertionMode[InsertionMode["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT"; + InsertionMode[InsertionMode["AFTER_HEAD"] = 5] = "AFTER_HEAD"; + InsertionMode[InsertionMode["IN_BODY"] = 6] = "IN_BODY"; + InsertionMode[InsertionMode["TEXT"] = 7] = "TEXT"; + InsertionMode[InsertionMode["IN_TABLE"] = 8] = "IN_TABLE"; + InsertionMode[InsertionMode["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT"; + InsertionMode[InsertionMode["IN_CAPTION"] = 10] = "IN_CAPTION"; + InsertionMode[InsertionMode["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP"; + InsertionMode[InsertionMode["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY"; + InsertionMode[InsertionMode["IN_ROW"] = 13] = "IN_ROW"; + InsertionMode[InsertionMode["IN_CELL"] = 14] = "IN_CELL"; + InsertionMode[InsertionMode["IN_SELECT"] = 15] = "IN_SELECT"; + InsertionMode[InsertionMode["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE"; + InsertionMode[InsertionMode["IN_TEMPLATE"] = 17] = "IN_TEMPLATE"; + InsertionMode[InsertionMode["AFTER_BODY"] = 18] = "AFTER_BODY"; + InsertionMode[InsertionMode["IN_FRAMESET"] = 19] = "IN_FRAMESET"; + InsertionMode[InsertionMode["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET"; + InsertionMode[InsertionMode["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY"; + InsertionMode[InsertionMode["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET"; +})(InsertionMode || (InsertionMode = {})); +const BASE_LOC = { + startLine: -1, + startCol: -1, + startOffset: -1, + endLine: -1, + endCol: -1, + endOffset: -1, +}; +const TABLE_STRUCTURE_TAGS = new Set([TAG_ID.TABLE, TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TR]); +const defaultParserOptions = { + scriptingEnabled: true, + sourceCodeLocationInfo: false, + treeAdapter: defaultTreeAdapter, + onParseError: null, +}; +//Parser +class Parser { + constructor(options, document, + /** @internal */ + fragmentContext = null, + /** @internal */ + scriptHandler = null) { + this.fragmentContext = fragmentContext; + this.scriptHandler = scriptHandler; + this.currentToken = null; + this.stopped = false; + /** @internal */ + this.insertionMode = InsertionMode.INITIAL; + /** @internal */ + this.originalInsertionMode = InsertionMode.INITIAL; + /** @internal */ + this.headElement = null; + /** @internal */ + this.formElement = null; + /** Indicates that the current node is not an element in the HTML namespace */ + this.currentNotInHTML = false; + /** + * The template insertion mode stack is maintained from the left. + * Ie. the topmost element will always have index 0. + * + * @internal + */ + this.tmplInsertionModeStack = []; + /** @internal */ + this.pendingCharacterTokens = []; + /** @internal */ + this.hasNonWhitespacePendingCharacterToken = false; + /** @internal */ + this.framesetOk = true; + /** @internal */ + this.skipNextNewLine = false; + /** @internal */ + this.fosterParentingEnabled = false; + this.options = { + ...defaultParserOptions, + ...options, + }; + this.treeAdapter = this.options.treeAdapter; + this.onParseError = this.options.onParseError; + // Always enable location info if we report parse errors. + if (this.onParseError) { + this.options.sourceCodeLocationInfo = true; + } + this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument(); + this.tokenizer = new Tokenizer(this.options, this); + this.activeFormattingElements = new FormattingElementList(this.treeAdapter); + this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN; + this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID); + this.openElements = new OpenElementStack(this.document, this.treeAdapter, this); + } + // API + static parse(html, options) { + const parser = new this(options); + parser.tokenizer.write(html, true); + return parser.document; + } + static getFragmentParser(fragmentContext, options) { + const opts = { + ...defaultParserOptions, + ...options, + }; + //NOTE: use a <template> element as the fragment context if no context element was provided, + //so we will parse in a "forgiving" manner + fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, [])); + //NOTE: create a fake element which will be used as the `document` for fragment parsing. + //This is important for jsdom, where a new `document` cannot be created. This led to + //fragment parsing messing with the main `document`. + const documentMock = opts.treeAdapter.createElement('documentmock', NS.HTML, []); + const parser = new this(opts, documentMock, fragmentContext); + if (parser.fragmentContextID === TAG_ID.TEMPLATE) { + parser.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE); + } + parser._initTokenizerForFragmentParsing(); + parser._insertFakeRootElement(); + parser._resetInsertionMode(); + parser._findFormInFragmentContext(); + return parser; + } + getFragment() { + const rootElement = this.treeAdapter.getFirstChild(this.document); + const fragment = this.treeAdapter.createDocumentFragment(); + this._adoptNodes(rootElement, fragment); + return fragment; + } + //Errors + /** @internal */ + _err(token, code, beforeToken) { + var _a; + if (!this.onParseError) + return; + const loc = (_a = token.location) !== null && _a !== void 0 ? _a : BASE_LOC; + const err = { + code, + startLine: loc.startLine, + startCol: loc.startCol, + startOffset: loc.startOffset, + endLine: beforeToken ? loc.startLine : loc.endLine, + endCol: beforeToken ? loc.startCol : loc.endCol, + endOffset: beforeToken ? loc.startOffset : loc.endOffset, + }; + this.onParseError(err); + } + //Stack events + /** @internal */ + onItemPush(node, tid, isTop) { + var _a, _b; + (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a, node); + if (isTop && this.openElements.stackTop > 0) + this._setContextModes(node, tid); + } + /** @internal */ + onItemPop(node, isTop) { + var _a, _b; + if (this.options.sourceCodeLocationInfo) { + this._setEndLocation(node, this.currentToken); + } + (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a, node, this.openElements.current); + if (isTop) { + let current; + let currentTagId; + if (this.openElements.stackTop === 0 && this.fragmentContext) { + current = this.fragmentContext; + currentTagId = this.fragmentContextID; + } + else { + ({ current, currentTagId } = this.openElements); + } + this._setContextModes(current, currentTagId); + } + } + _setContextModes(current, tid) { + const isHTML = current === this.document || this.treeAdapter.getNamespaceURI(current) === NS.HTML; + this.currentNotInHTML = !isHTML; + this.tokenizer.inForeignNode = !isHTML && !this._isIntegrationPoint(tid, current); + } + /** @protected */ + _switchToTextParsing(currentToken, nextTokenizerState) { + this._insertElement(currentToken, NS.HTML); + this.tokenizer.state = nextTokenizerState; + this.originalInsertionMode = this.insertionMode; + this.insertionMode = InsertionMode.TEXT; + } + switchToPlaintextParsing() { + this.insertionMode = InsertionMode.TEXT; + this.originalInsertionMode = InsertionMode.IN_BODY; + this.tokenizer.state = TokenizerMode.PLAINTEXT; + } + //Fragment parsing + /** @protected */ + _getAdjustedCurrentElement() { + return this.openElements.stackTop === 0 && this.fragmentContext + ? this.fragmentContext + : this.openElements.current; + } + /** @protected */ + _findFormInFragmentContext() { + let node = this.fragmentContext; + while (node) { + if (this.treeAdapter.getTagName(node) === TAG_NAMES.FORM) { + this.formElement = node; + break; + } + node = this.treeAdapter.getParentNode(node); + } + } + _initTokenizerForFragmentParsing() { + if (!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== NS.HTML) { + return; + } + switch (this.fragmentContextID) { + case TAG_ID.TITLE: + case TAG_ID.TEXTAREA: { + this.tokenizer.state = TokenizerMode.RCDATA; + break; + } + case TAG_ID.STYLE: + case TAG_ID.XMP: + case TAG_ID.IFRAME: + case TAG_ID.NOEMBED: + case TAG_ID.NOFRAMES: + case TAG_ID.NOSCRIPT: { + this.tokenizer.state = TokenizerMode.RAWTEXT; + break; + } + case TAG_ID.SCRIPT: { + this.tokenizer.state = TokenizerMode.SCRIPT_DATA; + break; + } + case TAG_ID.PLAINTEXT: { + this.tokenizer.state = TokenizerMode.PLAINTEXT; + break; + } + // Do nothing + } + } + //Tree mutation + /** @protected */ + _setDocumentType(token) { + const name = token.name || ''; + const publicId = token.publicId || ''; + const systemId = token.systemId || ''; + this.treeAdapter.setDocumentType(this.document, name, publicId, systemId); + if (token.location) { + const documentChildren = this.treeAdapter.getChildNodes(this.document); + const docTypeNode = documentChildren.find((node) => this.treeAdapter.isDocumentTypeNode(node)); + if (docTypeNode) { + this.treeAdapter.setNodeSourceCodeLocation(docTypeNode, token.location); + } + } + } + /** @protected */ + _attachElementToTree(element, location) { + if (this.options.sourceCodeLocationInfo) { + const loc = location && { + ...location, + startTag: location, + }; + this.treeAdapter.setNodeSourceCodeLocation(element, loc); + } + if (this._shouldFosterParentOnInsertion()) { + this._fosterParentElement(element); + } + else { + const parent = this.openElements.currentTmplContentOrNode; + this.treeAdapter.appendChild(parent, element); + } + } + /** + * For self-closing tags. Add an element to the tree, but skip adding it + * to the stack. + */ + /** @protected */ + _appendElement(token, namespaceURI) { + const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element, token.location); + } + /** @protected */ + _insertElement(token, namespaceURI) { + const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element, token.location); + this.openElements.push(element, token.tagID); + } + /** @protected */ + _insertFakeElement(tagName, tagID) { + const element = this.treeAdapter.createElement(tagName, NS.HTML, []); + this._attachElementToTree(element, null); + this.openElements.push(element, tagID); + } + /** @protected */ + _insertTemplate(token) { + const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs); + const content = this.treeAdapter.createDocumentFragment(); + this.treeAdapter.setTemplateContent(tmpl, content); + this._attachElementToTree(tmpl, token.location); + this.openElements.push(tmpl, token.tagID); + if (this.options.sourceCodeLocationInfo) + this.treeAdapter.setNodeSourceCodeLocation(content, null); + } + /** @protected */ + _insertFakeRootElement() { + const element = this.treeAdapter.createElement(TAG_NAMES.HTML, NS.HTML, []); + if (this.options.sourceCodeLocationInfo) + this.treeAdapter.setNodeSourceCodeLocation(element, null); + this.treeAdapter.appendChild(this.openElements.current, element); + this.openElements.push(element, TAG_ID.HTML); + } + /** @protected */ + _appendCommentNode(token, parent) { + const commentNode = this.treeAdapter.createCommentNode(token.data); + this.treeAdapter.appendChild(parent, commentNode); + if (this.options.sourceCodeLocationInfo) { + this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location); + } + } + /** @protected */ + _insertCharacters(token) { + let parent; + let beforeElement; + if (this._shouldFosterParentOnInsertion()) { + ({ parent, beforeElement } = this._findFosterParentingLocation()); + if (beforeElement) { + this.treeAdapter.insertTextBefore(parent, token.chars, beforeElement); + } + else { + this.treeAdapter.insertText(parent, token.chars); + } + } + else { + parent = this.openElements.currentTmplContentOrNode; + this.treeAdapter.insertText(parent, token.chars); + } + if (!token.location) + return; + const siblings = this.treeAdapter.getChildNodes(parent); + const textNodeIdx = beforeElement ? siblings.lastIndexOf(beforeElement) : siblings.length; + const textNode = siblings[textNodeIdx - 1]; + //NOTE: if we have a location assigned by another token, then just update the end position + const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode); + if (tnLoc) { + const { endLine, endCol, endOffset } = token.location; + this.treeAdapter.updateNodeSourceCodeLocation(textNode, { endLine, endCol, endOffset }); + } + else if (this.options.sourceCodeLocationInfo) { + this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location); + } + } + /** @protected */ + _adoptNodes(donor, recipient) { + for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) { + this.treeAdapter.detachNode(child); + this.treeAdapter.appendChild(recipient, child); + } + } + /** @protected */ + _setEndLocation(element, closingToken) { + if (this.treeAdapter.getNodeSourceCodeLocation(element) && closingToken.location) { + const ctLoc = closingToken.location; + const tn = this.treeAdapter.getTagName(element); + const endLoc = + // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing + // tag and for cases like <td> <p> </td> - 'p' closes without a closing tag. + closingToken.type === TokenType.END_TAG && tn === closingToken.tagName + ? { + endTag: { ...ctLoc }, + endLine: ctLoc.endLine, + endCol: ctLoc.endCol, + endOffset: ctLoc.endOffset, + } + : { + endLine: ctLoc.startLine, + endCol: ctLoc.startCol, + endOffset: ctLoc.startOffset, + }; + this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc); + } + } + //Token processing + shouldProcessStartTagTokenInForeignContent(token) { + // Check that neither current === document, or ns === NS.HTML + if (!this.currentNotInHTML) + return false; + let current; + let currentTagId; + if (this.openElements.stackTop === 0 && this.fragmentContext) { + current = this.fragmentContext; + currentTagId = this.fragmentContextID; + } + else { + ({ current, currentTagId } = this.openElements); + } + if (token.tagID === TAG_ID.SVG && + this.treeAdapter.getTagName(current) === TAG_NAMES.ANNOTATION_XML && + this.treeAdapter.getNamespaceURI(current) === NS.MATHML) { + return false; + } + return ( + // Check that `current` is not an integration point for HTML or MathML elements. + this.tokenizer.inForeignNode || + // If it _is_ an integration point, then we might have to check that it is not an HTML + // integration point. + ((token.tagID === TAG_ID.MGLYPH || token.tagID === TAG_ID.MALIGNMARK) && + !this._isIntegrationPoint(currentTagId, current, NS.HTML))); + } + /** @protected */ + _processToken(token) { + switch (token.type) { + case TokenType.CHARACTER: { + this.onCharacter(token); + break; + } + case TokenType.NULL_CHARACTER: { + this.onNullCharacter(token); + break; + } + case TokenType.COMMENT: { + this.onComment(token); + break; + } + case TokenType.DOCTYPE: { + this.onDoctype(token); + break; + } + case TokenType.START_TAG: { + this._processStartTag(token); + break; + } + case TokenType.END_TAG: { + this.onEndTag(token); + break; + } + case TokenType.EOF: { + this.onEof(token); + break; + } + case TokenType.WHITESPACE_CHARACTER: { + this.onWhitespaceCharacter(token); + break; + } + } + } + //Integration points + /** @protected */ + _isIntegrationPoint(tid, element, foreignNS) { + const ns = this.treeAdapter.getNamespaceURI(element); + const attrs = this.treeAdapter.getAttrList(element); + return isIntegrationPoint(tid, ns, attrs, foreignNS); + } + //Active formatting elements reconstruction + /** @protected */ + _reconstructActiveFormattingElements() { + const listLength = this.activeFormattingElements.entries.length; + if (listLength) { + const endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element)); + const unopenIdx = endIndex < 0 ? listLength - 1 : endIndex - 1; + for (let i = unopenIdx; i >= 0; i--) { + const entry = this.activeFormattingElements.entries[i]; + this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); + entry.element = this.openElements.current; + } + } + } + //Close elements + /** @protected */ + _closeTableCell() { + this.openElements.generateImpliedEndTags(); + this.openElements.popUntilTableCellPopped(); + this.activeFormattingElements.clearToLastMarker(); + this.insertionMode = InsertionMode.IN_ROW; + } + /** @protected */ + _closePElement() { + this.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.P); + this.openElements.popUntilTagNamePopped(TAG_ID.P); + } + //Insertion modes + /** @protected */ + _resetInsertionMode() { + for (let i = this.openElements.stackTop; i >= 0; i--) { + //Insertion mode reset map + switch (i === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[i]) { + case TAG_ID.TR: { + this.insertionMode = InsertionMode.IN_ROW; + return; + } + case TAG_ID.TBODY: + case TAG_ID.THEAD: + case TAG_ID.TFOOT: { + this.insertionMode = InsertionMode.IN_TABLE_BODY; + return; + } + case TAG_ID.CAPTION: { + this.insertionMode = InsertionMode.IN_CAPTION; + return; + } + case TAG_ID.COLGROUP: { + this.insertionMode = InsertionMode.IN_COLUMN_GROUP; + return; + } + case TAG_ID.TABLE: { + this.insertionMode = InsertionMode.IN_TABLE; + return; + } + case TAG_ID.BODY: { + this.insertionMode = InsertionMode.IN_BODY; + return; + } + case TAG_ID.FRAMESET: { + this.insertionMode = InsertionMode.IN_FRAMESET; + return; + } + case TAG_ID.SELECT: { + this._resetInsertionModeForSelect(i); + return; + } + case TAG_ID.TEMPLATE: { + this.insertionMode = this.tmplInsertionModeStack[0]; + return; + } + case TAG_ID.HTML: { + this.insertionMode = this.headElement ? InsertionMode.AFTER_HEAD : InsertionMode.BEFORE_HEAD; + return; + } + case TAG_ID.TD: + case TAG_ID.TH: { + if (i > 0) { + this.insertionMode = InsertionMode.IN_CELL; + return; + } + break; + } + case TAG_ID.HEAD: { + if (i > 0) { + this.insertionMode = InsertionMode.IN_HEAD; + return; + } + break; + } + } + } + this.insertionMode = InsertionMode.IN_BODY; + } + /** @protected */ + _resetInsertionModeForSelect(selectIdx) { + if (selectIdx > 0) { + for (let i = selectIdx - 1; i > 0; i--) { + const tn = this.openElements.tagIDs[i]; + if (tn === TAG_ID.TEMPLATE) { + break; + } + else if (tn === TAG_ID.TABLE) { + this.insertionMode = InsertionMode.IN_SELECT_IN_TABLE; + return; + } + } + } + this.insertionMode = InsertionMode.IN_SELECT; + } + //Foster parenting + /** @protected */ + _isElementCausesFosterParenting(tn) { + return TABLE_STRUCTURE_TAGS.has(tn); + } + /** @protected */ + _shouldFosterParentOnInsertion() { + return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId); + } + /** @protected */ + _findFosterParentingLocation() { + for (let i = this.openElements.stackTop; i >= 0; i--) { + const openElement = this.openElements.items[i]; + switch (this.openElements.tagIDs[i]) { + case TAG_ID.TEMPLATE: { + if (this.treeAdapter.getNamespaceURI(openElement) === NS.HTML) { + return { parent: this.treeAdapter.getTemplateContent(openElement), beforeElement: null }; + } + break; + } + case TAG_ID.TABLE: { + const parent = this.treeAdapter.getParentNode(openElement); + if (parent) { + return { parent, beforeElement: openElement }; + } + return { parent: this.openElements.items[i - 1], beforeElement: null }; + } + // Do nothing + } + } + return { parent: this.openElements.items[0], beforeElement: null }; + } + /** @protected */ + _fosterParentElement(element) { + const location = this._findFosterParentingLocation(); + if (location.beforeElement) { + this.treeAdapter.insertBefore(location.parent, element, location.beforeElement); + } + else { + this.treeAdapter.appendChild(location.parent, element); + } + } + //Special elements + /** @protected */ + _isSpecialElement(element, id) { + const ns = this.treeAdapter.getNamespaceURI(element); + return SPECIAL_ELEMENTS[ns].has(id); + } + /** @internal */ + onCharacter(token) { + this.skipNextNewLine = false; + if (this.tokenizer.inForeignNode) { + characterInForeignContent(this, token); + return; + } + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + tokenInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HTML: { + tokenBeforeHtml(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: { + tokenBeforeHead(this, token); + break; + } + case InsertionMode.IN_HEAD: { + tokenInHead(this, token); + break; + } + case InsertionMode.IN_HEAD_NO_SCRIPT: { + tokenInHeadNoScript(this, token); + break; + } + case InsertionMode.AFTER_HEAD: { + tokenAfterHead(this, token); + break; + } + case InsertionMode.IN_BODY: + case InsertionMode.IN_CAPTION: + case InsertionMode.IN_CELL: + case InsertionMode.IN_TEMPLATE: { + characterInBody(this, token); + break; + } + case InsertionMode.TEXT: + case InsertionMode.IN_SELECT: + case InsertionMode.IN_SELECT_IN_TABLE: { + this._insertCharacters(token); + break; + } + case InsertionMode.IN_TABLE: + case InsertionMode.IN_TABLE_BODY: + case InsertionMode.IN_ROW: { + characterInTable(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + characterInTableText(this, token); + break; + } + case InsertionMode.IN_COLUMN_GROUP: { + tokenInColumnGroup(this, token); + break; + } + case InsertionMode.AFTER_BODY: { + tokenAfterBody(this, token); + break; + } + case InsertionMode.AFTER_AFTER_BODY: { + tokenAfterAfterBody(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onNullCharacter(token) { + this.skipNextNewLine = false; + if (this.tokenizer.inForeignNode) { + nullCharacterInForeignContent(this, token); + return; + } + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + tokenInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HTML: { + tokenBeforeHtml(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: { + tokenBeforeHead(this, token); + break; + } + case InsertionMode.IN_HEAD: { + tokenInHead(this, token); + break; + } + case InsertionMode.IN_HEAD_NO_SCRIPT: { + tokenInHeadNoScript(this, token); + break; + } + case InsertionMode.AFTER_HEAD: { + tokenAfterHead(this, token); + break; + } + case InsertionMode.TEXT: { + this._insertCharacters(token); + break; + } + case InsertionMode.IN_TABLE: + case InsertionMode.IN_TABLE_BODY: + case InsertionMode.IN_ROW: { + characterInTable(this, token); + break; + } + case InsertionMode.IN_COLUMN_GROUP: { + tokenInColumnGroup(this, token); + break; + } + case InsertionMode.AFTER_BODY: { + tokenAfterBody(this, token); + break; + } + case InsertionMode.AFTER_AFTER_BODY: { + tokenAfterAfterBody(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onComment(token) { + this.skipNextNewLine = false; + if (this.currentNotInHTML) { + appendComment(this, token); + return; + } + switch (this.insertionMode) { + case InsertionMode.INITIAL: + case InsertionMode.BEFORE_HTML: + case InsertionMode.BEFORE_HEAD: + case InsertionMode.IN_HEAD: + case InsertionMode.IN_HEAD_NO_SCRIPT: + case InsertionMode.AFTER_HEAD: + case InsertionMode.IN_BODY: + case InsertionMode.IN_TABLE: + case InsertionMode.IN_CAPTION: + case InsertionMode.IN_COLUMN_GROUP: + case InsertionMode.IN_TABLE_BODY: + case InsertionMode.IN_ROW: + case InsertionMode.IN_CELL: + case InsertionMode.IN_SELECT: + case InsertionMode.IN_SELECT_IN_TABLE: + case InsertionMode.IN_TEMPLATE: + case InsertionMode.IN_FRAMESET: + case InsertionMode.AFTER_FRAMESET: { + appendComment(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + tokenInTableText(this, token); + break; + } + case InsertionMode.AFTER_BODY: { + appendCommentToRootHtmlElement(this, token); + break; + } + case InsertionMode.AFTER_AFTER_BODY: + case InsertionMode.AFTER_AFTER_FRAMESET: { + appendCommentToDocument(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onDoctype(token) { + this.skipNextNewLine = false; + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + doctypeInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: + case InsertionMode.IN_HEAD: + case InsertionMode.IN_HEAD_NO_SCRIPT: + case InsertionMode.AFTER_HEAD: { + this._err(token, ERR.misplacedDoctype); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + tokenInTableText(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onStartTag(token) { + this.skipNextNewLine = false; + this.currentToken = token; + this._processStartTag(token); + if (token.selfClosing && !token.ackSelfClosing) { + this._err(token, ERR.nonVoidHtmlElementStartTagWithTrailingSolidus); + } + } + /** + * Processes a given start tag. + * + * `onStartTag` checks if a self-closing tag was recognized. When a token + * is moved inbetween multiple insertion modes, this check for self-closing + * could lead to false positives. To avoid this, `_processStartTag` is used + * for nested calls. + * + * @param token The token to process. + * @protected + */ + _processStartTag(token) { + if (this.shouldProcessStartTagTokenInForeignContent(token)) { + startTagInForeignContent(this, token); + } + else { + this._startTagOutsideForeignContent(token); + } + } + /** @protected */ + _startTagOutsideForeignContent(token) { + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + tokenInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HTML: { + startTagBeforeHtml(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: { + startTagBeforeHead(this, token); + break; + } + case InsertionMode.IN_HEAD: { + startTagInHead(this, token); + break; + } + case InsertionMode.IN_HEAD_NO_SCRIPT: { + startTagInHeadNoScript(this, token); + break; + } + case InsertionMode.AFTER_HEAD: { + startTagAfterHead(this, token); + break; + } + case InsertionMode.IN_BODY: { + startTagInBody(this, token); + break; + } + case InsertionMode.IN_TABLE: { + startTagInTable(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + tokenInTableText(this, token); + break; + } + case InsertionMode.IN_CAPTION: { + startTagInCaption(this, token); + break; + } + case InsertionMode.IN_COLUMN_GROUP: { + startTagInColumnGroup(this, token); + break; + } + case InsertionMode.IN_TABLE_BODY: { + startTagInTableBody(this, token); + break; + } + case InsertionMode.IN_ROW: { + startTagInRow(this, token); + break; + } + case InsertionMode.IN_CELL: { + startTagInCell(this, token); + break; + } + case InsertionMode.IN_SELECT: { + startTagInSelect(this, token); + break; + } + case InsertionMode.IN_SELECT_IN_TABLE: { + startTagInSelectInTable(this, token); + break; + } + case InsertionMode.IN_TEMPLATE: { + startTagInTemplate(this, token); + break; + } + case InsertionMode.AFTER_BODY: { + startTagAfterBody(this, token); + break; + } + case InsertionMode.IN_FRAMESET: { + startTagInFrameset(this, token); + break; + } + case InsertionMode.AFTER_FRAMESET: { + startTagAfterFrameset(this, token); + break; + } + case InsertionMode.AFTER_AFTER_BODY: { + startTagAfterAfterBody(this, token); + break; + } + case InsertionMode.AFTER_AFTER_FRAMESET: { + startTagAfterAfterFrameset(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onEndTag(token) { + this.skipNextNewLine = false; + this.currentToken = token; + if (this.currentNotInHTML) { + endTagInForeignContent(this, token); + } + else { + this._endTagOutsideForeignContent(token); + } + } + /** @protected */ + _endTagOutsideForeignContent(token) { + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + tokenInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HTML: { + endTagBeforeHtml(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: { + endTagBeforeHead(this, token); + break; + } + case InsertionMode.IN_HEAD: { + endTagInHead(this, token); + break; + } + case InsertionMode.IN_HEAD_NO_SCRIPT: { + endTagInHeadNoScript(this, token); + break; + } + case InsertionMode.AFTER_HEAD: { + endTagAfterHead(this, token); + break; + } + case InsertionMode.IN_BODY: { + endTagInBody(this, token); + break; + } + case InsertionMode.TEXT: { + endTagInText(this, token); + break; + } + case InsertionMode.IN_TABLE: { + endTagInTable(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + tokenInTableText(this, token); + break; + } + case InsertionMode.IN_CAPTION: { + endTagInCaption(this, token); + break; + } + case InsertionMode.IN_COLUMN_GROUP: { + endTagInColumnGroup(this, token); + break; + } + case InsertionMode.IN_TABLE_BODY: { + endTagInTableBody(this, token); + break; + } + case InsertionMode.IN_ROW: { + endTagInRow(this, token); + break; + } + case InsertionMode.IN_CELL: { + endTagInCell(this, token); + break; + } + case InsertionMode.IN_SELECT: { + endTagInSelect(this, token); + break; + } + case InsertionMode.IN_SELECT_IN_TABLE: { + endTagInSelectInTable(this, token); + break; + } + case InsertionMode.IN_TEMPLATE: { + endTagInTemplate(this, token); + break; + } + case InsertionMode.AFTER_BODY: { + endTagAfterBody(this, token); + break; + } + case InsertionMode.IN_FRAMESET: { + endTagInFrameset(this, token); + break; + } + case InsertionMode.AFTER_FRAMESET: { + endTagAfterFrameset(this, token); + break; + } + case InsertionMode.AFTER_AFTER_BODY: { + tokenAfterAfterBody(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onEof(token) { + switch (this.insertionMode) { + case InsertionMode.INITIAL: { + tokenInInitialMode(this, token); + break; + } + case InsertionMode.BEFORE_HTML: { + tokenBeforeHtml(this, token); + break; + } + case InsertionMode.BEFORE_HEAD: { + tokenBeforeHead(this, token); + break; + } + case InsertionMode.IN_HEAD: { + tokenInHead(this, token); + break; + } + case InsertionMode.IN_HEAD_NO_SCRIPT: { + tokenInHeadNoScript(this, token); + break; + } + case InsertionMode.AFTER_HEAD: { + tokenAfterHead(this, token); + break; + } + case InsertionMode.IN_BODY: + case InsertionMode.IN_TABLE: + case InsertionMode.IN_CAPTION: + case InsertionMode.IN_COLUMN_GROUP: + case InsertionMode.IN_TABLE_BODY: + case InsertionMode.IN_ROW: + case InsertionMode.IN_CELL: + case InsertionMode.IN_SELECT: + case InsertionMode.IN_SELECT_IN_TABLE: { + eofInBody(this, token); + break; + } + case InsertionMode.TEXT: { + eofInText(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + tokenInTableText(this, token); + break; + } + case InsertionMode.IN_TEMPLATE: { + eofInTemplate(this, token); + break; + } + case InsertionMode.AFTER_BODY: + case InsertionMode.IN_FRAMESET: + case InsertionMode.AFTER_FRAMESET: + case InsertionMode.AFTER_AFTER_BODY: + case InsertionMode.AFTER_AFTER_FRAMESET: { + stopParsing(this, token); + break; + } + // Do nothing + } + } + /** @internal */ + onWhitespaceCharacter(token) { + if (this.skipNextNewLine) { + this.skipNextNewLine = false; + if (token.chars.charCodeAt(0) === CODE_POINTS.LINE_FEED) { + if (token.chars.length === 1) { + return; + } + token.chars = token.chars.substr(1); + } + } + if (this.tokenizer.inForeignNode) { + this._insertCharacters(token); + return; + } + switch (this.insertionMode) { + case InsertionMode.IN_HEAD: + case InsertionMode.IN_HEAD_NO_SCRIPT: + case InsertionMode.AFTER_HEAD: + case InsertionMode.TEXT: + case InsertionMode.IN_COLUMN_GROUP: + case InsertionMode.IN_SELECT: + case InsertionMode.IN_SELECT_IN_TABLE: + case InsertionMode.IN_FRAMESET: + case InsertionMode.AFTER_FRAMESET: { + this._insertCharacters(token); + break; + } + case InsertionMode.IN_BODY: + case InsertionMode.IN_CAPTION: + case InsertionMode.IN_CELL: + case InsertionMode.IN_TEMPLATE: + case InsertionMode.AFTER_BODY: + case InsertionMode.AFTER_AFTER_BODY: + case InsertionMode.AFTER_AFTER_FRAMESET: { + whitespaceCharacterInBody(this, token); + break; + } + case InsertionMode.IN_TABLE: + case InsertionMode.IN_TABLE_BODY: + case InsertionMode.IN_ROW: { + characterInTable(this, token); + break; + } + case InsertionMode.IN_TABLE_TEXT: { + whitespaceCharacterInTableText(this, token); + break; + } + // Do nothing + } + } +} +//Adoption agency algorithm +//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoptionAgency) +//------------------------------------------------------------------ +//Steps 5-8 of the algorithm +function aaObtainFormattingElementEntry(p, token) { + let formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName); + if (formattingElementEntry) { + if (!p.openElements.contains(formattingElementEntry.element)) { + p.activeFormattingElements.removeEntry(formattingElementEntry); + formattingElementEntry = null; + } + else if (!p.openElements.hasInScope(token.tagID)) { + formattingElementEntry = null; + } + } + else { + genericEndTagInBody(p, token); + } + return formattingElementEntry; +} +//Steps 9 and 10 of the algorithm +function aaObtainFurthestBlock(p, formattingElementEntry) { + let furthestBlock = null; + let idx = p.openElements.stackTop; + for (; idx >= 0; idx--) { + const element = p.openElements.items[idx]; + if (element === formattingElementEntry.element) { + break; + } + if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) { + furthestBlock = element; + } + } + if (!furthestBlock) { + p.openElements.shortenToLength(idx < 0 ? 0 : idx); + p.activeFormattingElements.removeEntry(formattingElementEntry); + } + return furthestBlock; +} +//Step 13 of the algorithm +function aaInnerLoop(p, furthestBlock, formattingElement) { + let lastElement = furthestBlock; + let nextElement = p.openElements.getCommonAncestor(furthestBlock); + for (let i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) { + //NOTE: store the next element for the next loop iteration (it may be deleted from the stack by step 9.5) + nextElement = p.openElements.getCommonAncestor(element); + const elementEntry = p.activeFormattingElements.getElementEntry(element); + const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER; + const shouldRemoveFromOpenElements = !elementEntry || counterOverflow; + if (shouldRemoveFromOpenElements) { + if (counterOverflow) { + p.activeFormattingElements.removeEntry(elementEntry); + } + p.openElements.remove(element); + } + else { + element = aaRecreateElementFromEntry(p, elementEntry); + if (lastElement === furthestBlock) { + p.activeFormattingElements.bookmark = elementEntry; + } + p.treeAdapter.detachNode(lastElement); + p.treeAdapter.appendChild(element, lastElement); + lastElement = element; + } + } + return lastElement; +} +//Step 13.7 of the algorithm +function aaRecreateElementFromEntry(p, elementEntry) { + const ns = p.treeAdapter.getNamespaceURI(elementEntry.element); + const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs); + p.openElements.replace(elementEntry.element, newElement); + elementEntry.element = newElement; + return newElement; +} +//Step 14 of the algorithm +function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) { + const tn = p.treeAdapter.getTagName(commonAncestor); + const tid = getTagID(tn); + if (p._isElementCausesFosterParenting(tid)) { + p._fosterParentElement(lastElement); + } + else { + const ns = p.treeAdapter.getNamespaceURI(commonAncestor); + if (tid === TAG_ID.TEMPLATE && ns === NS.HTML) { + commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor); + } + p.treeAdapter.appendChild(commonAncestor, lastElement); + } +} +//Steps 15-19 of the algorithm +function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) { + const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element); + const { token } = formattingElementEntry; + const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs); + p._adoptNodes(furthestBlock, newElement); + p.treeAdapter.appendChild(furthestBlock, newElement); + p.activeFormattingElements.insertElementAfterBookmark(newElement, token); + p.activeFormattingElements.removeEntry(formattingElementEntry); + p.openElements.remove(formattingElementEntry.element); + p.openElements.insertAfter(furthestBlock, newElement, token.tagID); +} +//Algorithm entry point +function callAdoptionAgency(p, token) { + for (let i = 0; i < AA_OUTER_LOOP_ITER; i++) { + const formattingElementEntry = aaObtainFormattingElementEntry(p, token); + if (!formattingElementEntry) { + break; + } + const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry); + if (!furthestBlock) { + break; + } + p.activeFormattingElements.bookmark = formattingElementEntry; + const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element); + const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element); + p.treeAdapter.detachNode(lastElement); + if (commonAncestor) + aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement); + aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry); + } +} +//Generic token handlers +//------------------------------------------------------------------ +function appendComment(p, token) { + p._appendCommentNode(token, p.openElements.currentTmplContentOrNode); +} +function appendCommentToRootHtmlElement(p, token) { + p._appendCommentNode(token, p.openElements.items[0]); +} +function appendCommentToDocument(p, token) { + p._appendCommentNode(token, p.document); +} +function stopParsing(p, token) { + p.stopped = true; + // NOTE: Set end locations for elements that remain on the open element stack. + if (token.location) { + // NOTE: If we are not in a fragment, `html` and `body` will stay on the stack. + // This is a problem, as we might overwrite their end position here. + const target = p.fragmentContext ? 0 : 2; + for (let i = p.openElements.stackTop; i >= target; i--) { + p._setEndLocation(p.openElements.items[i], token); + } + // Handle `html` and `body` + if (!p.fragmentContext && p.openElements.stackTop >= 0) { + const htmlElement = p.openElements.items[0]; + const htmlLocation = p.treeAdapter.getNodeSourceCodeLocation(htmlElement); + if (htmlLocation && !htmlLocation.endTag) { + p._setEndLocation(htmlElement, token); + if (p.openElements.stackTop >= 1) { + const bodyElement = p.openElements.items[1]; + const bodyLocation = p.treeAdapter.getNodeSourceCodeLocation(bodyElement); + if (bodyLocation && !bodyLocation.endTag) { + p._setEndLocation(bodyElement, token); + } + } + } + } + } +} +// The "initial" insertion mode +//------------------------------------------------------------------ +function doctypeInInitialMode(p, token) { + p._setDocumentType(token); + const mode = token.forceQuirks ? DOCUMENT_MODE.QUIRKS : getDocumentMode(token); + if (!isConforming(token)) { + p._err(token, ERR.nonConformingDoctype); + } + p.treeAdapter.setDocumentMode(p.document, mode); + p.insertionMode = InsertionMode.BEFORE_HTML; +} +function tokenInInitialMode(p, token) { + p._err(token, ERR.missingDoctype, true); + p.treeAdapter.setDocumentMode(p.document, DOCUMENT_MODE.QUIRKS); + p.insertionMode = InsertionMode.BEFORE_HTML; + p._processToken(token); +} +// The "before html" insertion mode +//------------------------------------------------------------------ +function startTagBeforeHtml(p, token) { + if (token.tagID === TAG_ID.HTML) { + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.BEFORE_HEAD; + } + else { + tokenBeforeHtml(p, token); + } +} +function endTagBeforeHtml(p, token) { + const tn = token.tagID; + if (tn === TAG_ID.HTML || tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.BR) { + tokenBeforeHtml(p, token); + } +} +function tokenBeforeHtml(p, token) { + p._insertFakeRootElement(); + p.insertionMode = InsertionMode.BEFORE_HEAD; + p._processToken(token); +} +// The "before head" insertion mode +//------------------------------------------------------------------ +function startTagBeforeHead(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.HEAD: { + p._insertElement(token, NS.HTML); + p.headElement = p.openElements.current; + p.insertionMode = InsertionMode.IN_HEAD; + break; + } + default: { + tokenBeforeHead(p, token); + } + } +} +function endTagBeforeHead(p, token) { + const tn = token.tagID; + if (tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.HTML || tn === TAG_ID.BR) { + tokenBeforeHead(p, token); + } + else { + p._err(token, ERR.endTagWithoutMatchingOpenElement); + } +} +function tokenBeforeHead(p, token) { + p._insertFakeElement(TAG_NAMES.HEAD, TAG_ID.HEAD); + p.headElement = p.openElements.current; + p.insertionMode = InsertionMode.IN_HEAD; + p._processToken(token); +} +// The "in head" insertion mode +//------------------------------------------------------------------ +function startTagInHead(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.BASE: + case TAG_ID.BASEFONT: + case TAG_ID.BGSOUND: + case TAG_ID.LINK: + case TAG_ID.META: { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + break; + } + case TAG_ID.TITLE: { + p._switchToTextParsing(token, TokenizerMode.RCDATA); + break; + } + case TAG_ID.NOSCRIPT: { + if (p.options.scriptingEnabled) { + p._switchToTextParsing(token, TokenizerMode.RAWTEXT); + } + else { + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_HEAD_NO_SCRIPT; + } + break; + } + case TAG_ID.NOFRAMES: + case TAG_ID.STYLE: { + p._switchToTextParsing(token, TokenizerMode.RAWTEXT); + break; + } + case TAG_ID.SCRIPT: { + p._switchToTextParsing(token, TokenizerMode.SCRIPT_DATA); + break; + } + case TAG_ID.TEMPLATE: { + p._insertTemplate(token); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; + p.insertionMode = InsertionMode.IN_TEMPLATE; + p.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE); + break; + } + case TAG_ID.HEAD: { + p._err(token, ERR.misplacedStartTagForHeadElement); + break; + } + default: { + tokenInHead(p, token); + } + } +} +function endTagInHead(p, token) { + switch (token.tagID) { + case TAG_ID.HEAD: { + p.openElements.pop(); + p.insertionMode = InsertionMode.AFTER_HEAD; + break; + } + case TAG_ID.BODY: + case TAG_ID.BR: + case TAG_ID.HTML: { + tokenInHead(p, token); + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + default: { + p._err(token, ERR.endTagWithoutMatchingOpenElement); + } + } +} +function templateEndTagInHead(p, token) { + if (p.openElements.tmplCount > 0) { + p.openElements.generateImpliedEndTagsThoroughly(); + if (p.openElements.currentTagId !== TAG_ID.TEMPLATE) { + p._err(token, ERR.closingOfElementWithOpenChildElements); + } + p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE); + p.activeFormattingElements.clearToLastMarker(); + p.tmplInsertionModeStack.shift(); + p._resetInsertionMode(); + } + else { + p._err(token, ERR.endTagWithoutMatchingOpenElement); + } +} +function tokenInHead(p, token) { + p.openElements.pop(); + p.insertionMode = InsertionMode.AFTER_HEAD; + p._processToken(token); +} +// The "in head no script" insertion mode +//------------------------------------------------------------------ +function startTagInHeadNoScript(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.BASEFONT: + case TAG_ID.BGSOUND: + case TAG_ID.HEAD: + case TAG_ID.LINK: + case TAG_ID.META: + case TAG_ID.NOFRAMES: + case TAG_ID.STYLE: { + startTagInHead(p, token); + break; + } + case TAG_ID.NOSCRIPT: { + p._err(token, ERR.nestedNoscriptInHead); + break; + } + default: { + tokenInHeadNoScript(p, token); + } + } +} +function endTagInHeadNoScript(p, token) { + switch (token.tagID) { + case TAG_ID.NOSCRIPT: { + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_HEAD; + break; + } + case TAG_ID.BR: { + tokenInHeadNoScript(p, token); + break; + } + default: { + p._err(token, ERR.endTagWithoutMatchingOpenElement); + } + } +} +function tokenInHeadNoScript(p, token) { + const errCode = token.type === TokenType.EOF ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead; + p._err(token, errCode); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_HEAD; + p._processToken(token); +} +// The "after head" insertion mode +//------------------------------------------------------------------ +function startTagAfterHead(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.BODY: { + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = InsertionMode.IN_BODY; + break; + } + case TAG_ID.FRAMESET: { + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_FRAMESET; + break; + } + case TAG_ID.BASE: + case TAG_ID.BASEFONT: + case TAG_ID.BGSOUND: + case TAG_ID.LINK: + case TAG_ID.META: + case TAG_ID.NOFRAMES: + case TAG_ID.SCRIPT: + case TAG_ID.STYLE: + case TAG_ID.TEMPLATE: + case TAG_ID.TITLE: { + p._err(token, ERR.abandonedHeadElementChild); + p.openElements.push(p.headElement, TAG_ID.HEAD); + startTagInHead(p, token); + p.openElements.remove(p.headElement); + break; + } + case TAG_ID.HEAD: { + p._err(token, ERR.misplacedStartTagForHeadElement); + break; + } + default: { + tokenAfterHead(p, token); + } + } +} +function endTagAfterHead(p, token) { + switch (token.tagID) { + case TAG_ID.BODY: + case TAG_ID.HTML: + case TAG_ID.BR: { + tokenAfterHead(p, token); + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + default: { + p._err(token, ERR.endTagWithoutMatchingOpenElement); + } + } +} +function tokenAfterHead(p, token) { + p._insertFakeElement(TAG_NAMES.BODY, TAG_ID.BODY); + p.insertionMode = InsertionMode.IN_BODY; + modeInBody(p, token); +} +// The "in body" insertion mode +//------------------------------------------------------------------ +function modeInBody(p, token) { + switch (token.type) { + case TokenType.CHARACTER: { + characterInBody(p, token); + break; + } + case TokenType.WHITESPACE_CHARACTER: { + whitespaceCharacterInBody(p, token); + break; + } + case TokenType.COMMENT: { + appendComment(p, token); + break; + } + case TokenType.START_TAG: { + startTagInBody(p, token); + break; + } + case TokenType.END_TAG: { + endTagInBody(p, token); + break; + } + case TokenType.EOF: { + eofInBody(p, token); + break; + } + // Do nothing + } +} +function whitespaceCharacterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); +} +function characterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); + p.framesetOk = false; +} +function htmlStartTagInBody(p, token) { + if (p.openElements.tmplCount === 0) { + p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs); + } +} +function bodyStartTagInBody(p, token) { + const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (bodyElement && p.openElements.tmplCount === 0) { + p.framesetOk = false; + p.treeAdapter.adoptAttributes(bodyElement, token.attrs); + } +} +function framesetStartTagInBody(p, token) { + const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (p.framesetOk && bodyElement) { + p.treeAdapter.detachNode(bodyElement); + p.openElements.popAllUpToHtmlElement(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_FRAMESET; + } +} +function addressStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); +} +function numberedHeaderStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + if (NUMBERED_HEADERS.has(p.openElements.currentTagId)) { + p.openElements.pop(); + } + p._insertElement(token, NS.HTML); +} +function preStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move + //on to the next one. (Newlines at the start of pre blocks are ignored as an authoring convenience.) + p.skipNextNewLine = true; + p.framesetOk = false; +} +function formStartTagInBody(p, token) { + const inTemplate = p.openElements.tmplCount > 0; + if (!p.formElement || inTemplate) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + if (!inTemplate) { + p.formElement = p.openElements.current; + } + } +} +function listItemStartTagInBody(p, token) { + p.framesetOk = false; + const tn = token.tagID; + for (let i = p.openElements.stackTop; i >= 0; i--) { + const elementId = p.openElements.tagIDs[i]; + if ((tn === TAG_ID.LI && elementId === TAG_ID.LI) || + ((tn === TAG_ID.DD || tn === TAG_ID.DT) && (elementId === TAG_ID.DD || elementId === TAG_ID.DT))) { + p.openElements.generateImpliedEndTagsWithExclusion(elementId); + p.openElements.popUntilTagNamePopped(elementId); + break; + } + if (elementId !== TAG_ID.ADDRESS && + elementId !== TAG_ID.DIV && + elementId !== TAG_ID.P && + p._isSpecialElement(p.openElements.items[i], elementId)) { + break; + } + } + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); +} +function plaintextStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + p.tokenizer.state = TokenizerMode.PLAINTEXT; +} +function buttonStartTagInBody(p, token) { + if (p.openElements.hasInScope(TAG_ID.BUTTON)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(TAG_ID.BUTTON); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; +} +function aStartTagInBody(p, token) { + const activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(TAG_NAMES.A); + if (activeElementEntry) { + callAdoptionAgency(p, token); + p.openElements.remove(activeElementEntry.element); + p.activeFormattingElements.removeEntry(activeElementEntry); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); +} +function bStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); +} +function nobrStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + if (p.openElements.hasInScope(TAG_ID.NOBR)) { + callAdoptionAgency(p, token); + p._reconstructActiveFormattingElements(); + } + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); +} +function appletStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; +} +function tableStartTagInBody(p, token) { + if (p.treeAdapter.getDocumentMode(p.document) !== DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = InsertionMode.IN_TABLE; +} +function areaStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + p.framesetOk = false; + token.ackSelfClosing = true; +} +function isHiddenInput(token) { + const inputType = getTokenAttr(token, ATTRS.TYPE); + return inputType != null && inputType.toLowerCase() === HIDDEN_INPUT_TYPE; +} +function inputStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + if (!isHiddenInput(token)) { + p.framesetOk = false; + } + token.ackSelfClosing = true; +} +function paramStartTagInBody(p, token) { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; +} +function hrStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._appendElement(token, NS.HTML); + p.framesetOk = false; + token.ackSelfClosing = true; +} +function imageStartTagInBody(p, token) { + token.tagName = TAG_NAMES.IMG; + token.tagID = TAG_ID.IMG; + areaStartTagInBody(p, token); +} +function textareaStartTagInBody(p, token) { + p._insertElement(token, NS.HTML); + //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move + //on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.) + p.skipNextNewLine = true; + p.tokenizer.state = TokenizerMode.RCDATA; + p.originalInsertionMode = p.insertionMode; + p.framesetOk = false; + p.insertionMode = InsertionMode.TEXT; +} +function xmpStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope(TAG_ID.P)) { + p._closePElement(); + } + p._reconstructActiveFormattingElements(); + p.framesetOk = false; + p._switchToTextParsing(token, TokenizerMode.RAWTEXT); +} +function iframeStartTagInBody(p, token) { + p.framesetOk = false; + p._switchToTextParsing(token, TokenizerMode.RAWTEXT); +} +//NOTE: here we assume that we always act as a user agent with enabled plugins/frames, so we parse +//<noembed>/<noframes> as rawtext. +function rawTextStartTagInBody(p, token) { + p._switchToTextParsing(token, TokenizerMode.RAWTEXT); +} +function selectStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = + p.insertionMode === InsertionMode.IN_TABLE || + p.insertionMode === InsertionMode.IN_CAPTION || + p.insertionMode === InsertionMode.IN_TABLE_BODY || + p.insertionMode === InsertionMode.IN_ROW || + p.insertionMode === InsertionMode.IN_CELL + ? InsertionMode.IN_SELECT_IN_TABLE + : InsertionMode.IN_SELECT; +} +function optgroupStartTagInBody(p, token) { + if (p.openElements.currentTagId === TAG_ID.OPTION) { + p.openElements.pop(); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); +} +function rbStartTagInBody(p, token) { + if (p.openElements.hasInScope(TAG_ID.RUBY)) { + p.openElements.generateImpliedEndTags(); + } + p._insertElement(token, NS.HTML); +} +function rtStartTagInBody(p, token) { + if (p.openElements.hasInScope(TAG_ID.RUBY)) { + p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.RTC); + } + p._insertElement(token, NS.HTML); +} +function mathStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + adjustTokenMathMLAttrs(token); + adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, NS.MATHML); + } + else { + p._insertElement(token, NS.MATHML); + } + token.ackSelfClosing = true; +} +function svgStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + adjustTokenSVGAttrs(token); + adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, NS.SVG); + } + else { + p._insertElement(token, NS.SVG); + } + token.ackSelfClosing = true; +} +function genericStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); +} +function startTagInBody(p, token) { + switch (token.tagID) { + case TAG_ID.I: + case TAG_ID.S: + case TAG_ID.B: + case TAG_ID.U: + case TAG_ID.EM: + case TAG_ID.TT: + case TAG_ID.BIG: + case TAG_ID.CODE: + case TAG_ID.FONT: + case TAG_ID.SMALL: + case TAG_ID.STRIKE: + case TAG_ID.STRONG: { + bStartTagInBody(p, token); + break; + } + case TAG_ID.A: { + aStartTagInBody(p, token); + break; + } + case TAG_ID.H1: + case TAG_ID.H2: + case TAG_ID.H3: + case TAG_ID.H4: + case TAG_ID.H5: + case TAG_ID.H6: { + numberedHeaderStartTagInBody(p, token); + break; + } + case TAG_ID.P: + case TAG_ID.DL: + case TAG_ID.OL: + case TAG_ID.UL: + case TAG_ID.DIV: + case TAG_ID.DIR: + case TAG_ID.NAV: + case TAG_ID.MAIN: + case TAG_ID.MENU: + case TAG_ID.ASIDE: + case TAG_ID.CENTER: + case TAG_ID.FIGURE: + case TAG_ID.FOOTER: + case TAG_ID.HEADER: + case TAG_ID.HGROUP: + case TAG_ID.DIALOG: + case TAG_ID.DETAILS: + case TAG_ID.ADDRESS: + case TAG_ID.ARTICLE: + case TAG_ID.SEARCH: + case TAG_ID.SECTION: + case TAG_ID.SUMMARY: + case TAG_ID.FIELDSET: + case TAG_ID.BLOCKQUOTE: + case TAG_ID.FIGCAPTION: { + addressStartTagInBody(p, token); + break; + } + case TAG_ID.LI: + case TAG_ID.DD: + case TAG_ID.DT: { + listItemStartTagInBody(p, token); + break; + } + case TAG_ID.BR: + case TAG_ID.IMG: + case TAG_ID.WBR: + case TAG_ID.AREA: + case TAG_ID.EMBED: + case TAG_ID.KEYGEN: { + areaStartTagInBody(p, token); + break; + } + case TAG_ID.HR: { + hrStartTagInBody(p, token); + break; + } + case TAG_ID.RB: + case TAG_ID.RTC: { + rbStartTagInBody(p, token); + break; + } + case TAG_ID.RT: + case TAG_ID.RP: { + rtStartTagInBody(p, token); + break; + } + case TAG_ID.PRE: + case TAG_ID.LISTING: { + preStartTagInBody(p, token); + break; + } + case TAG_ID.XMP: { + xmpStartTagInBody(p, token); + break; + } + case TAG_ID.SVG: { + svgStartTagInBody(p, token); + break; + } + case TAG_ID.HTML: { + htmlStartTagInBody(p, token); + break; + } + case TAG_ID.BASE: + case TAG_ID.LINK: + case TAG_ID.META: + case TAG_ID.STYLE: + case TAG_ID.TITLE: + case TAG_ID.SCRIPT: + case TAG_ID.BGSOUND: + case TAG_ID.BASEFONT: + case TAG_ID.TEMPLATE: { + startTagInHead(p, token); + break; + } + case TAG_ID.BODY: { + bodyStartTagInBody(p, token); + break; + } + case TAG_ID.FORM: { + formStartTagInBody(p, token); + break; + } + case TAG_ID.NOBR: { + nobrStartTagInBody(p, token); + break; + } + case TAG_ID.MATH: { + mathStartTagInBody(p, token); + break; + } + case TAG_ID.TABLE: { + tableStartTagInBody(p, token); + break; + } + case TAG_ID.INPUT: { + inputStartTagInBody(p, token); + break; + } + case TAG_ID.PARAM: + case TAG_ID.TRACK: + case TAG_ID.SOURCE: { + paramStartTagInBody(p, token); + break; + } + case TAG_ID.IMAGE: { + imageStartTagInBody(p, token); + break; + } + case TAG_ID.BUTTON: { + buttonStartTagInBody(p, token); + break; + } + case TAG_ID.APPLET: + case TAG_ID.OBJECT: + case TAG_ID.MARQUEE: { + appletStartTagInBody(p, token); + break; + } + case TAG_ID.IFRAME: { + iframeStartTagInBody(p, token); + break; + } + case TAG_ID.SELECT: { + selectStartTagInBody(p, token); + break; + } + case TAG_ID.OPTION: + case TAG_ID.OPTGROUP: { + optgroupStartTagInBody(p, token); + break; + } + case TAG_ID.NOEMBED: + case TAG_ID.NOFRAMES: { + rawTextStartTagInBody(p, token); + break; + } + case TAG_ID.FRAMESET: { + framesetStartTagInBody(p, token); + break; + } + case TAG_ID.TEXTAREA: { + textareaStartTagInBody(p, token); + break; + } + case TAG_ID.NOSCRIPT: { + if (p.options.scriptingEnabled) { + rawTextStartTagInBody(p, token); + } + else { + genericStartTagInBody(p, token); + } + break; + } + case TAG_ID.PLAINTEXT: { + plaintextStartTagInBody(p, token); + break; + } + case TAG_ID.COL: + case TAG_ID.TH: + case TAG_ID.TD: + case TAG_ID.TR: + case TAG_ID.HEAD: + case TAG_ID.FRAME: + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: + case TAG_ID.CAPTION: + case TAG_ID.COLGROUP: { + // Ignore token + break; + } + default: { + genericStartTagInBody(p, token); + } + } +} +function bodyEndTagInBody(p, token) { + if (p.openElements.hasInScope(TAG_ID.BODY)) { + p.insertionMode = InsertionMode.AFTER_BODY; + //NOTE: <body> is never popped from the stack, so we need to updated + //the end location explicitly. + if (p.options.sourceCodeLocationInfo) { + const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (bodyElement) { + p._setEndLocation(bodyElement, token); + } + } + } +} +function htmlEndTagInBody(p, token) { + if (p.openElements.hasInScope(TAG_ID.BODY)) { + p.insertionMode = InsertionMode.AFTER_BODY; + endTagAfterBody(p, token); + } +} +function addressEndTagInBody(p, token) { + const tn = token.tagID; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + } +} +function formEndTagInBody(p) { + const inTemplate = p.openElements.tmplCount > 0; + const { formElement } = p; + if (!inTemplate) { + p.formElement = null; + } + if ((formElement || inTemplate) && p.openElements.hasInScope(TAG_ID.FORM)) { + p.openElements.generateImpliedEndTags(); + if (inTemplate) { + p.openElements.popUntilTagNamePopped(TAG_ID.FORM); + } + else if (formElement) { + p.openElements.remove(formElement); + } + } +} +function pEndTagInBody(p) { + if (!p.openElements.hasInButtonScope(TAG_ID.P)) { + p._insertFakeElement(TAG_NAMES.P, TAG_ID.P); + } + p._closePElement(); +} +function liEndTagInBody(p) { + if (p.openElements.hasInListItemScope(TAG_ID.LI)) { + p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.LI); + p.openElements.popUntilTagNamePopped(TAG_ID.LI); + } +} +function ddEndTagInBody(p, token) { + const tn = token.tagID; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTagsWithExclusion(tn); + p.openElements.popUntilTagNamePopped(tn); + } +} +function numberedHeaderEndTagInBody(p) { + if (p.openElements.hasNumberedHeaderInScope()) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilNumberedHeaderPopped(); + } +} +function appletEndTagInBody(p, token) { + const tn = token.tagID; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); + } +} +function brEndTagInBody(p) { + p._reconstructActiveFormattingElements(); + p._insertFakeElement(TAG_NAMES.BR, TAG_ID.BR); + p.openElements.pop(); + p.framesetOk = false; +} +function genericEndTagInBody(p, token) { + const tn = token.tagName; + const tid = token.tagID; + for (let i = p.openElements.stackTop; i > 0; i--) { + const element = p.openElements.items[i]; + const elementId = p.openElements.tagIDs[i]; + // Compare the tag name here, as the tag might not be a known tag with an ID. + if (tid === elementId && (tid !== TAG_ID.UNKNOWN || p.treeAdapter.getTagName(element) === tn)) { + p.openElements.generateImpliedEndTagsWithExclusion(tid); + if (p.openElements.stackTop >= i) + p.openElements.shortenToLength(i); + break; + } + if (p._isSpecialElement(element, elementId)) { + break; + } + } +} +function endTagInBody(p, token) { + switch (token.tagID) { + case TAG_ID.A: + case TAG_ID.B: + case TAG_ID.I: + case TAG_ID.S: + case TAG_ID.U: + case TAG_ID.EM: + case TAG_ID.TT: + case TAG_ID.BIG: + case TAG_ID.CODE: + case TAG_ID.FONT: + case TAG_ID.NOBR: + case TAG_ID.SMALL: + case TAG_ID.STRIKE: + case TAG_ID.STRONG: { + callAdoptionAgency(p, token); + break; + } + case TAG_ID.P: { + pEndTagInBody(p); + break; + } + case TAG_ID.DL: + case TAG_ID.UL: + case TAG_ID.OL: + case TAG_ID.DIR: + case TAG_ID.DIV: + case TAG_ID.NAV: + case TAG_ID.PRE: + case TAG_ID.MAIN: + case TAG_ID.MENU: + case TAG_ID.ASIDE: + case TAG_ID.BUTTON: + case TAG_ID.CENTER: + case TAG_ID.FIGURE: + case TAG_ID.FOOTER: + case TAG_ID.HEADER: + case TAG_ID.HGROUP: + case TAG_ID.DIALOG: + case TAG_ID.ADDRESS: + case TAG_ID.ARTICLE: + case TAG_ID.DETAILS: + case TAG_ID.SEARCH: + case TAG_ID.SECTION: + case TAG_ID.SUMMARY: + case TAG_ID.LISTING: + case TAG_ID.FIELDSET: + case TAG_ID.BLOCKQUOTE: + case TAG_ID.FIGCAPTION: { + addressEndTagInBody(p, token); + break; + } + case TAG_ID.LI: { + liEndTagInBody(p); + break; + } + case TAG_ID.DD: + case TAG_ID.DT: { + ddEndTagInBody(p, token); + break; + } + case TAG_ID.H1: + case TAG_ID.H2: + case TAG_ID.H3: + case TAG_ID.H4: + case TAG_ID.H5: + case TAG_ID.H6: { + numberedHeaderEndTagInBody(p); + break; + } + case TAG_ID.BR: { + brEndTagInBody(p); + break; + } + case TAG_ID.BODY: { + bodyEndTagInBody(p, token); + break; + } + case TAG_ID.HTML: { + htmlEndTagInBody(p, token); + break; + } + case TAG_ID.FORM: { + formEndTagInBody(p); + break; + } + case TAG_ID.APPLET: + case TAG_ID.OBJECT: + case TAG_ID.MARQUEE: { + appletEndTagInBody(p, token); + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + default: { + genericEndTagInBody(p, token); + } + } +} +function eofInBody(p, token) { + if (p.tmplInsertionModeStack.length > 0) { + eofInTemplate(p, token); + } + else { + stopParsing(p, token); + } +} +// The "text" insertion mode +//------------------------------------------------------------------ +function endTagInText(p, token) { + var _a; + if (token.tagID === TAG_ID.SCRIPT) { + (_a = p.scriptHandler) === null || _a === void 0 ? void 0 : _a.call(p, p.openElements.current); + } + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; +} +function eofInText(p, token) { + p._err(token, ERR.eofInElementThatCanContainOnlyText); + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; + p.onEof(token); +} +// The "in table" insertion mode +//------------------------------------------------------------------ +function characterInTable(p, token) { + if (TABLE_STRUCTURE_TAGS.has(p.openElements.currentTagId)) { + p.pendingCharacterTokens.length = 0; + p.hasNonWhitespacePendingCharacterToken = false; + p.originalInsertionMode = p.insertionMode; + p.insertionMode = InsertionMode.IN_TABLE_TEXT; + switch (token.type) { + case TokenType.CHARACTER: { + characterInTableText(p, token); + break; + } + case TokenType.WHITESPACE_CHARACTER: { + whitespaceCharacterInTableText(p, token); + break; + } + // Ignore null + } + } + else { + tokenInTable(p, token); + } +} +function captionStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p.activeFormattingElements.insertMarker(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_CAPTION; +} +function colgroupStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_COLUMN_GROUP; +} +function colStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertFakeElement(TAG_NAMES.COLGROUP, TAG_ID.COLGROUP); + p.insertionMode = InsertionMode.IN_COLUMN_GROUP; + startTagInColumnGroup(p, token); +} +function tbodyStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_TABLE_BODY; +} +function tdStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertFakeElement(TAG_NAMES.TBODY, TAG_ID.TBODY); + p.insertionMode = InsertionMode.IN_TABLE_BODY; + startTagInTableBody(p, token); +} +function tableStartTagInTable(p, token) { + if (p.openElements.hasInTableScope(TAG_ID.TABLE)) { + p.openElements.popUntilTagNamePopped(TAG_ID.TABLE); + p._resetInsertionMode(); + p._processStartTag(token); + } +} +function inputStartTagInTable(p, token) { + if (isHiddenInput(token)) { + p._appendElement(token, NS.HTML); + } + else { + tokenInTable(p, token); + } + token.ackSelfClosing = true; +} +function formStartTagInTable(p, token) { + if (!p.formElement && p.openElements.tmplCount === 0) { + p._insertElement(token, NS.HTML); + p.formElement = p.openElements.current; + p.openElements.pop(); + } +} +function startTagInTable(p, token) { + switch (token.tagID) { + case TAG_ID.TD: + case TAG_ID.TH: + case TAG_ID.TR: { + tdStartTagInTable(p, token); + break; + } + case TAG_ID.STYLE: + case TAG_ID.SCRIPT: + case TAG_ID.TEMPLATE: { + startTagInHead(p, token); + break; + } + case TAG_ID.COL: { + colStartTagInTable(p, token); + break; + } + case TAG_ID.FORM: { + formStartTagInTable(p, token); + break; + } + case TAG_ID.TABLE: { + tableStartTagInTable(p, token); + break; + } + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: { + tbodyStartTagInTable(p, token); + break; + } + case TAG_ID.INPUT: { + inputStartTagInTable(p, token); + break; + } + case TAG_ID.CAPTION: { + captionStartTagInTable(p, token); + break; + } + case TAG_ID.COLGROUP: { + colgroupStartTagInTable(p, token); + break; + } + default: { + tokenInTable(p, token); + } + } +} +function endTagInTable(p, token) { + switch (token.tagID) { + case TAG_ID.TABLE: { + if (p.openElements.hasInTableScope(TAG_ID.TABLE)) { + p.openElements.popUntilTagNamePopped(TAG_ID.TABLE); + p._resetInsertionMode(); + } + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + case TAG_ID.BODY: + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.HTML: + case TAG_ID.TBODY: + case TAG_ID.TD: + case TAG_ID.TFOOT: + case TAG_ID.TH: + case TAG_ID.THEAD: + case TAG_ID.TR: { + // Ignore token + break; + } + default: { + tokenInTable(p, token); + } + } +} +function tokenInTable(p, token) { + const savedFosterParentingState = p.fosterParentingEnabled; + p.fosterParentingEnabled = true; + // Process token in `In Body` mode + modeInBody(p, token); + p.fosterParentingEnabled = savedFosterParentingState; +} +// The "in table text" insertion mode +//------------------------------------------------------------------ +function whitespaceCharacterInTableText(p, token) { + p.pendingCharacterTokens.push(token); +} +function characterInTableText(p, token) { + p.pendingCharacterTokens.push(token); + p.hasNonWhitespacePendingCharacterToken = true; +} +function tokenInTableText(p, token) { + let i = 0; + if (p.hasNonWhitespacePendingCharacterToken) { + for (; i < p.pendingCharacterTokens.length; i++) { + tokenInTable(p, p.pendingCharacterTokens[i]); + } + } + else { + for (; i < p.pendingCharacterTokens.length; i++) { + p._insertCharacters(p.pendingCharacterTokens[i]); + } + } + p.insertionMode = p.originalInsertionMode; + p._processToken(token); +} +// The "in caption" insertion mode +//------------------------------------------------------------------ +const TABLE_VOID_ELEMENTS = new Set([TAG_ID.CAPTION, TAG_ID.COL, TAG_ID.COLGROUP, TAG_ID.TBODY, TAG_ID.TD, TAG_ID.TFOOT, TAG_ID.TH, TAG_ID.THEAD, TAG_ID.TR]); +function startTagInCaption(p, token) { + const tn = token.tagID; + if (TABLE_VOID_ELEMENTS.has(tn)) { + if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = InsertionMode.IN_TABLE; + startTagInTable(p, token); + } + } + else { + startTagInBody(p, token); + } +} +function endTagInCaption(p, token) { + const tn = token.tagID; + switch (tn) { + case TAG_ID.CAPTION: + case TAG_ID.TABLE: { + if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = InsertionMode.IN_TABLE; + if (tn === TAG_ID.TABLE) { + endTagInTable(p, token); + } + } + break; + } + case TAG_ID.BODY: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.HTML: + case TAG_ID.TBODY: + case TAG_ID.TD: + case TAG_ID.TFOOT: + case TAG_ID.TH: + case TAG_ID.THEAD: + case TAG_ID.TR: { + // Ignore token + break; + } + default: { + endTagInBody(p, token); + } + } +} +// The "in column group" insertion mode +//------------------------------------------------------------------ +function startTagInColumnGroup(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.COL: { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + break; + } + case TAG_ID.TEMPLATE: { + startTagInHead(p, token); + break; + } + default: { + tokenInColumnGroup(p, token); + } + } +} +function endTagInColumnGroup(p, token) { + switch (token.tagID) { + case TAG_ID.COLGROUP: { + if (p.openElements.currentTagId === TAG_ID.COLGROUP) { + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE; + } + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + case TAG_ID.COL: { + // Ignore token + break; + } + default: { + tokenInColumnGroup(p, token); + } + } +} +function tokenInColumnGroup(p, token) { + if (p.openElements.currentTagId === TAG_ID.COLGROUP) { + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE; + p._processToken(token); + } +} +// The "in table body" insertion mode +//------------------------------------------------------------------ +function startTagInTableBody(p, token) { + switch (token.tagID) { + case TAG_ID.TR: { + p.openElements.clearBackToTableBodyContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_ROW; + break; + } + case TAG_ID.TH: + case TAG_ID.TD: { + p.openElements.clearBackToTableBodyContext(); + p._insertFakeElement(TAG_NAMES.TR, TAG_ID.TR); + p.insertionMode = InsertionMode.IN_ROW; + startTagInRow(p, token); + break; + } + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE; + startTagInTable(p, token); + } + break; + } + default: { + startTagInTable(p, token); + } + } +} +function endTagInTableBody(p, token) { + const tn = token.tagID; + switch (token.tagID) { + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE; + } + break; + } + case TAG_ID.TABLE: { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE; + endTagInTable(p, token); + } + break; + } + case TAG_ID.BODY: + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.HTML: + case TAG_ID.TD: + case TAG_ID.TH: + case TAG_ID.TR: { + // Ignore token + break; + } + default: { + endTagInTable(p, token); + } + } +} +// The "in row" insertion mode +//------------------------------------------------------------------ +function startTagInRow(p, token) { + switch (token.tagID) { + case TAG_ID.TH: + case TAG_ID.TD: { + p.openElements.clearBackToTableRowContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = InsertionMode.IN_CELL; + p.activeFormattingElements.insertMarker(); + break; + } + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: + case TAG_ID.TR: { + if (p.openElements.hasInTableScope(TAG_ID.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE_BODY; + startTagInTableBody(p, token); + } + break; + } + default: { + startTagInTable(p, token); + } + } +} +function endTagInRow(p, token) { + switch (token.tagID) { + case TAG_ID.TR: { + if (p.openElements.hasInTableScope(TAG_ID.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE_BODY; + } + break; + } + case TAG_ID.TABLE: { + if (p.openElements.hasInTableScope(TAG_ID.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE_BODY; + endTagInTableBody(p, token); + } + break; + } + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: { + if (p.openElements.hasInTableScope(token.tagID) || p.openElements.hasInTableScope(TAG_ID.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = InsertionMode.IN_TABLE_BODY; + endTagInTableBody(p, token); + } + break; + } + case TAG_ID.BODY: + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.HTML: + case TAG_ID.TD: + case TAG_ID.TH: { + // Ignore end tag + break; + } + default: { + endTagInTable(p, token); + } + } +} +// The "in cell" insertion mode +//------------------------------------------------------------------ +function startTagInCell(p, token) { + const tn = token.tagID; + if (TABLE_VOID_ELEMENTS.has(tn)) { + if (p.openElements.hasInTableScope(TAG_ID.TD) || p.openElements.hasInTableScope(TAG_ID.TH)) { + p._closeTableCell(); + startTagInRow(p, token); + } + } + else { + startTagInBody(p, token); + } +} +function endTagInCell(p, token) { + const tn = token.tagID; + switch (tn) { + case TAG_ID.TD: + case TAG_ID.TH: { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = InsertionMode.IN_ROW; + } + break; + } + case TAG_ID.TABLE: + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: + case TAG_ID.TR: { + if (p.openElements.hasInTableScope(tn)) { + p._closeTableCell(); + endTagInRow(p, token); + } + break; + } + case TAG_ID.BODY: + case TAG_ID.CAPTION: + case TAG_ID.COL: + case TAG_ID.COLGROUP: + case TAG_ID.HTML: { + // Ignore token + break; + } + default: { + endTagInBody(p, token); + } + } +} +// The "in select" insertion mode +//------------------------------------------------------------------ +function startTagInSelect(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.OPTION: { + if (p.openElements.currentTagId === TAG_ID.OPTION) { + p.openElements.pop(); + } + p._insertElement(token, NS.HTML); + break; + } + case TAG_ID.OPTGROUP: { + if (p.openElements.currentTagId === TAG_ID.OPTION) { + p.openElements.pop(); + } + if (p.openElements.currentTagId === TAG_ID.OPTGROUP) { + p.openElements.pop(); + } + p._insertElement(token, NS.HTML); + break; + } + case TAG_ID.HR: { + if (p.openElements.currentTagId === TAG_ID.OPTION) { + p.openElements.pop(); + } + if (p.openElements.currentTagId === TAG_ID.OPTGROUP) { + p.openElements.pop(); + } + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + break; + } + case TAG_ID.INPUT: + case TAG_ID.KEYGEN: + case TAG_ID.TEXTAREA: + case TAG_ID.SELECT: { + if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) { + p.openElements.popUntilTagNamePopped(TAG_ID.SELECT); + p._resetInsertionMode(); + if (token.tagID !== TAG_ID.SELECT) { + p._processStartTag(token); + } + } + break; + } + case TAG_ID.SCRIPT: + case TAG_ID.TEMPLATE: { + startTagInHead(p, token); + break; + } + // Do nothing + } +} +function endTagInSelect(p, token) { + switch (token.tagID) { + case TAG_ID.OPTGROUP: { + if (p.openElements.stackTop > 0 && + p.openElements.currentTagId === TAG_ID.OPTION && + p.openElements.tagIDs[p.openElements.stackTop - 1] === TAG_ID.OPTGROUP) { + p.openElements.pop(); + } + if (p.openElements.currentTagId === TAG_ID.OPTGROUP) { + p.openElements.pop(); + } + break; + } + case TAG_ID.OPTION: { + if (p.openElements.currentTagId === TAG_ID.OPTION) { + p.openElements.pop(); + } + break; + } + case TAG_ID.SELECT: { + if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) { + p.openElements.popUntilTagNamePopped(TAG_ID.SELECT); + p._resetInsertionMode(); + } + break; + } + case TAG_ID.TEMPLATE: { + templateEndTagInHead(p, token); + break; + } + // Do nothing + } +} +// The "in select in table" insertion mode +//------------------------------------------------------------------ +function startTagInSelectInTable(p, token) { + const tn = token.tagID; + if (tn === TAG_ID.CAPTION || + tn === TAG_ID.TABLE || + tn === TAG_ID.TBODY || + tn === TAG_ID.TFOOT || + tn === TAG_ID.THEAD || + tn === TAG_ID.TR || + tn === TAG_ID.TD || + tn === TAG_ID.TH) { + p.openElements.popUntilTagNamePopped(TAG_ID.SELECT); + p._resetInsertionMode(); + p._processStartTag(token); + } + else { + startTagInSelect(p, token); + } +} +function endTagInSelectInTable(p, token) { + const tn = token.tagID; + if (tn === TAG_ID.CAPTION || + tn === TAG_ID.TABLE || + tn === TAG_ID.TBODY || + tn === TAG_ID.TFOOT || + tn === TAG_ID.THEAD || + tn === TAG_ID.TR || + tn === TAG_ID.TD || + tn === TAG_ID.TH) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.popUntilTagNamePopped(TAG_ID.SELECT); + p._resetInsertionMode(); + p.onEndTag(token); + } + } + else { + endTagInSelect(p, token); + } +} +// The "in template" insertion mode +//------------------------------------------------------------------ +function startTagInTemplate(p, token) { + switch (token.tagID) { + // First, handle tags that can start without a mode change + case TAG_ID.BASE: + case TAG_ID.BASEFONT: + case TAG_ID.BGSOUND: + case TAG_ID.LINK: + case TAG_ID.META: + case TAG_ID.NOFRAMES: + case TAG_ID.SCRIPT: + case TAG_ID.STYLE: + case TAG_ID.TEMPLATE: + case TAG_ID.TITLE: { + startTagInHead(p, token); + break; + } + // Re-process the token in the appropriate mode + case TAG_ID.CAPTION: + case TAG_ID.COLGROUP: + case TAG_ID.TBODY: + case TAG_ID.TFOOT: + case TAG_ID.THEAD: { + p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE; + p.insertionMode = InsertionMode.IN_TABLE; + startTagInTable(p, token); + break; + } + case TAG_ID.COL: { + p.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP; + p.insertionMode = InsertionMode.IN_COLUMN_GROUP; + startTagInColumnGroup(p, token); + break; + } + case TAG_ID.TR: { + p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY; + p.insertionMode = InsertionMode.IN_TABLE_BODY; + startTagInTableBody(p, token); + break; + } + case TAG_ID.TD: + case TAG_ID.TH: { + p.tmplInsertionModeStack[0] = InsertionMode.IN_ROW; + p.insertionMode = InsertionMode.IN_ROW; + startTagInRow(p, token); + break; + } + default: { + p.tmplInsertionModeStack[0] = InsertionMode.IN_BODY; + p.insertionMode = InsertionMode.IN_BODY; + startTagInBody(p, token); + } + } +} +function endTagInTemplate(p, token) { + if (token.tagID === TAG_ID.TEMPLATE) { + templateEndTagInHead(p, token); + } +} +function eofInTemplate(p, token) { + if (p.openElements.tmplCount > 0) { + p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE); + p.activeFormattingElements.clearToLastMarker(); + p.tmplInsertionModeStack.shift(); + p._resetInsertionMode(); + p.onEof(token); + } + else { + stopParsing(p, token); + } +} +// The "after body" insertion mode +//------------------------------------------------------------------ +function startTagAfterBody(p, token) { + if (token.tagID === TAG_ID.HTML) { + startTagInBody(p, token); + } + else { + tokenAfterBody(p, token); + } +} +function endTagAfterBody(p, token) { + var _a; + if (token.tagID === TAG_ID.HTML) { + if (!p.fragmentContext) { + p.insertionMode = InsertionMode.AFTER_AFTER_BODY; + } + //NOTE: <html> is never popped from the stack, so we need to updated + //the end location explicitly. + if (p.options.sourceCodeLocationInfo && p.openElements.tagIDs[0] === TAG_ID.HTML) { + p._setEndLocation(p.openElements.items[0], token); + // Update the body element, if it doesn't have an end tag + const bodyElement = p.openElements.items[1]; + if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === void 0 ? void 0 : _a.endTag)) { + p._setEndLocation(bodyElement, token); + } + } + } + else { + tokenAfterBody(p, token); + } +} +function tokenAfterBody(p, token) { + p.insertionMode = InsertionMode.IN_BODY; + modeInBody(p, token); +} +// The "in frameset" insertion mode +//------------------------------------------------------------------ +function startTagInFrameset(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.FRAMESET: { + p._insertElement(token, NS.HTML); + break; + } + case TAG_ID.FRAME: { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + break; + } + case TAG_ID.NOFRAMES: { + startTagInHead(p, token); + break; + } + // Do nothing + } +} +function endTagInFrameset(p, token) { + if (token.tagID === TAG_ID.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) { + p.openElements.pop(); + if (!p.fragmentContext && p.openElements.currentTagId !== TAG_ID.FRAMESET) { + p.insertionMode = InsertionMode.AFTER_FRAMESET; + } + } +} +// The "after frameset" insertion mode +//------------------------------------------------------------------ +function startTagAfterFrameset(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.NOFRAMES: { + startTagInHead(p, token); + break; + } + // Do nothing + } +} +function endTagAfterFrameset(p, token) { + if (token.tagID === TAG_ID.HTML) { + p.insertionMode = InsertionMode.AFTER_AFTER_FRAMESET; + } +} +// The "after after body" insertion mode +//------------------------------------------------------------------ +function startTagAfterAfterBody(p, token) { + if (token.tagID === TAG_ID.HTML) { + startTagInBody(p, token); + } + else { + tokenAfterAfterBody(p, token); + } +} +function tokenAfterAfterBody(p, token) { + p.insertionMode = InsertionMode.IN_BODY; + modeInBody(p, token); +} +// The "after after frameset" insertion mode +//------------------------------------------------------------------ +function startTagAfterAfterFrameset(p, token) { + switch (token.tagID) { + case TAG_ID.HTML: { + startTagInBody(p, token); + break; + } + case TAG_ID.NOFRAMES: { + startTagInHead(p, token); + break; + } + // Do nothing + } +} +// The rules for parsing tokens in foreign content +//------------------------------------------------------------------ +function nullCharacterInForeignContent(p, token) { + token.chars = REPLACEMENT_CHARACTER; + p._insertCharacters(token); +} +function characterInForeignContent(p, token) { + p._insertCharacters(token); + p.framesetOk = false; +} +function popUntilHtmlOrIntegrationPoint(p) { + while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && + !p._isIntegrationPoint(p.openElements.currentTagId, p.openElements.current)) { + p.openElements.pop(); + } +} +function startTagInForeignContent(p, token) { + if (causesExit(token)) { + popUntilHtmlOrIntegrationPoint(p); + p._startTagOutsideForeignContent(token); + } + else { + const current = p._getAdjustedCurrentElement(); + const currentNs = p.treeAdapter.getNamespaceURI(current); + if (currentNs === NS.MATHML) { + adjustTokenMathMLAttrs(token); + } + else if (currentNs === NS.SVG) { + adjustTokenSVGTagName(token); + adjustTokenSVGAttrs(token); + } + adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, currentNs); + } + else { + p._insertElement(token, currentNs); + } + token.ackSelfClosing = true; + } +} +function endTagInForeignContent(p, token) { + if (token.tagID === TAG_ID.P || token.tagID === TAG_ID.BR) { + popUntilHtmlOrIntegrationPoint(p); + p._endTagOutsideForeignContent(token); + return; + } + for (let i = p.openElements.stackTop; i > 0; i--) { + const element = p.openElements.items[i]; + if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { + p._endTagOutsideForeignContent(token); + break; + } + const tagName = p.treeAdapter.getTagName(element); + if (tagName.toLowerCase() === token.tagName) { + //NOTE: update the token tag name for `_setEndLocation`. + token.tagName = tagName; + p.openElements.shortenToLength(i); + break; + } + } +} + +// Shorthands +/** + * Parses an HTML string. + * + * @param html Input HTML string. + * @param options Parsing options. + * @returns Document + * + * @example + * + * ```js + * const parse5 = require('parse5'); + * + * const document = parse5.parse('<!DOCTYPE html><html><head></head><body>Hi there!</body></html>'); + * + * console.log(document.childNodes[1].tagName); //> 'html' + *``` + */ +function parse(html, options) { + return Parser.parse(html, options); +} + +export { ERR as ErrorCodes, Parser, Tokenizer, TokenizerMode, defaultTreeAdapter, parse }; diff --git a/seller_1/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js b/seller_1/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js new file mode 100644 index 0000000..57759ca --- /dev/null +++ b/seller_1/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js @@ -0,0 +1,53684 @@ +import * as fs$8 from 'node:fs'; +import fs__default, { promises as promises$1, existsSync as existsSync$1, readFileSync as readFileSync$1 } from 'node:fs'; +import fsp, { constants as constants$9 } from 'node:fs/promises'; +import path$d, { posix as posix$1, isAbsolute as isAbsolute$1, join as join$1, resolve as resolve$4, normalize, dirname as dirname$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path'; +import require$$1$1, { fileURLToPath as fileURLToPath$1, URL as URL$3, pathToFileURL as pathToFileURL$1 } from 'node:url'; +import { promisify as promisify$4, format as format$2, inspect, stripVTControlCharacters } from 'node:util'; +import { performance } from 'node:perf_hooks'; +import require$$0$5, { createRequire as createRequire$1, builtinModules } from 'node:module'; +import esbuild, { transform as transform$1, formatMessages, build as build$b } from 'esbuild'; +import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, wildcardHosts, loopbackHosts, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_ASSETS_INLINE_LIMIT, ENV_ENTRY, SPECIAL_QUERY_RE, DEP_VERSION_RE, DEV_PROD_CONDITION, JS_TYPES_RE, KNOWN_ASSET_TYPES, CSS_LANGS_RE, METADATA_FILENAME, ESBUILD_MODULES_TARGET, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, VITE_PACKAGE_DIR, DEFAULT_DEV_PORT, CLIENT_DIR, VERSION, ROLLUP_HOOKS, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_MAIN_FIELDS, DEFAULT_CLIENT_CONDITIONS, DEFAULT_SERVER_CONDITIONS } from '../constants.js'; +import require$$0$2, { posix, win32, isAbsolute, resolve as resolve$3, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join, sep } from 'path'; +import require$$0$3, { existsSync, readFileSync, statSync, readdirSync } from 'fs'; +import childProcess$2, { exec, execFile, execSync } from 'node:child_process'; +import { createServer as createServer$3, STATUS_CODES, get as get$2 } from 'node:http'; +import { createServer as createServer$2, get as get$1 } from 'node:https'; +import require$$0$4 from 'tty'; +import require$$1 from 'util'; +import require$$4$1 from 'net'; +import require$$0$7 from 'events'; +import require$$0$6 from 'url'; +import require$$1$2 from 'http'; +import require$$0$8 from 'stream'; +import require$$2 from 'os'; +import require$$2$1 from 'child_process'; +import os$3 from 'node:os'; +import crypto$2 from 'node:crypto'; +import { promises } from 'node:dns'; +import { ModuleRunner, ESModulesEvaluator } from 'vite/module-runner'; +import { parseAstAsync, parseAst } from 'rollup/parseAst'; +import { createRequire as createRequire$2 } from 'module'; +import readline from 'node:readline'; +import process$1 from 'node:process'; +import { Buffer as Buffer$1 } from 'node:buffer'; +import { EventEmitter as EventEmitter$4 } from 'node:events'; +import require$$3 from 'crypto'; +import assert$1 from 'node:assert'; +import v8 from 'node:v8'; +import { Worker as Worker$1 } from 'node:worker_threads'; +import zlib$1 from 'zlib'; +import require$$0$9 from 'buffer'; +import require$$1$3 from 'https'; +import require$$4$2 from 'tls'; +import require$$4$3 from 'assert'; +import * as qs from 'node:querystring'; +import { gzip } from 'node:zlib'; + +import { createRequire as __cjs_createRequire } from 'node:module'; + +const __require = __cjs_createRequire(import.meta.url); +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var picocolors = {exports: {}}; + +let p = process || {}, argv = p.argv || [], env$1 = p.env || {}; +let isColorSupported = + !(!!env$1.NO_COLOR || argv.includes("--no-color")) && + (!!env$1.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env$1.TERM !== "dumb") || !!env$1.CI); + +let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length); + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + }; + +let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0; + do { + result += string.substring(cursor, index) + replace; + cursor = index + close.length; + index = string.indexOf(close, cursor); + } while (~index) + return result + string.substring(cursor) +}; + +let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } +}; + +picocolors.exports = createColors(); +picocolors.exports.createColors = createColors; + +var picocolorsExports = picocolors.exports; +var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports); + +var utils$d = {}; + +const WIN_SLASH$1 = '\\\\/'; +const WIN_NO_SLASH$1 = `[^${WIN_SLASH$1}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL$1 = '\\.'; +const PLUS_LITERAL$1 = '\\+'; +const QMARK_LITERAL$1 = '\\?'; +const SLASH_LITERAL$1 = '\\/'; +const ONE_CHAR$1 = '(?=.)'; +const QMARK$1 = '[^/]'; +const END_ANCHOR$1 = `(?:${SLASH_LITERAL$1}|$)`; +const START_ANCHOR$1 = `(?:^|${SLASH_LITERAL$1})`; +const DOTS_SLASH$1 = `${DOT_LITERAL$1}{1,2}${END_ANCHOR$1}`; +const NO_DOT$1 = `(?!${DOT_LITERAL$1})`; +const NO_DOTS$1 = `(?!${START_ANCHOR$1}${DOTS_SLASH$1})`; +const NO_DOT_SLASH$1 = `(?!${DOT_LITERAL$1}{0,1}${END_ANCHOR$1})`; +const NO_DOTS_SLASH$1 = `(?!${DOTS_SLASH$1})`; +const QMARK_NO_DOT$1 = `[^.${SLASH_LITERAL$1}]`; +const STAR$2 = `${QMARK$1}*?`; +const SEP = '/'; + +const POSIX_CHARS$1 = { + DOT_LITERAL: DOT_LITERAL$1, + PLUS_LITERAL: PLUS_LITERAL$1, + QMARK_LITERAL: QMARK_LITERAL$1, + SLASH_LITERAL: SLASH_LITERAL$1, + ONE_CHAR: ONE_CHAR$1, + QMARK: QMARK$1, + END_ANCHOR: END_ANCHOR$1, + DOTS_SLASH: DOTS_SLASH$1, + NO_DOT: NO_DOT$1, + NO_DOTS: NO_DOTS$1, + NO_DOT_SLASH: NO_DOT_SLASH$1, + NO_DOTS_SLASH: NO_DOTS_SLASH$1, + QMARK_NO_DOT: QMARK_NO_DOT$1, + STAR: STAR$2, + START_ANCHOR: START_ANCHOR$1, + SEP +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS$1 = { + ...POSIX_CHARS$1, + + SLASH_LITERAL: `[${WIN_SLASH$1}]`, + QMARK: WIN_NO_SLASH$1, + STAR: `${WIN_NO_SLASH$1}*?`, + DOTS_SLASH: `${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$)`, + NO_DOT: `(?!${DOT_LITERAL$1})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH$1}])${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL$1}{0,1}(?:[${WIN_SLASH$1}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL$1}{1,2}(?:[${WIN_SLASH$1}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH$1}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH$1}])`, + END_ANCHOR: `(?:[${WIN_SLASH$1}]|$)`, + SEP: '\\' +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$3 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$8 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$3, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS$1 : POSIX_CHARS$1; + } +}; + +/*global navigator*/ + +(function (exports) { + + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$8; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; + }; + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; + + exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; + }; +} (utils$d)); + +const utils$c = utils$d; +const { + CHAR_ASTERISK: CHAR_ASTERISK$1, /* * */ + CHAR_AT: CHAR_AT$1, /* @ */ + CHAR_BACKWARD_SLASH: CHAR_BACKWARD_SLASH$1, /* \ */ + CHAR_COMMA: CHAR_COMMA$2, /* , */ + CHAR_DOT: CHAR_DOT$2, /* . */ + CHAR_EXCLAMATION_MARK: CHAR_EXCLAMATION_MARK$1, /* ! */ + CHAR_FORWARD_SLASH: CHAR_FORWARD_SLASH$1, /* / */ + CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$2, /* { */ + CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$2, /* ( */ + CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$2, /* [ */ + CHAR_PLUS: CHAR_PLUS$1, /* + */ + CHAR_QUESTION_MARK: CHAR_QUESTION_MARK$1, /* ? */ + CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$2, /* } */ + CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$2, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$2 /* ] */ +} = constants$8; + +const isPathSeparator$1 = code => { + return code === CHAR_FORWARD_SLASH$1 || code === CHAR_BACKWARD_SLASH$1; +}; + +const depth$1 = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$3 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH$1) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE$2) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$2) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH$1) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE$2) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT$2 && (code = advance()) === CHAR_DOT$2) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA$2) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE$2) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH$1) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT$2 && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS$1 + || code === CHAR_AT$1 + || code === CHAR_ASTERISK$1 + || code === CHAR_QUESTION_MARK$1 + || code === CHAR_EXCLAMATION_MARK$1; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$2) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK$1 && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH$1) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$2) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK$1) { + if (prev === CHAR_ASTERISK$1) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK$1) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET$2) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH$1) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET$2) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK$1 && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$2) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES$2) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$2) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator$1(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$c.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$c.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator$1(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth$1(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth$1(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1$1 = scan$3; + +const constants$7 = constants$8; +const utils$b = utils$d; + +/** + * Constants + */ + +const { + MAX_LENGTH: MAX_LENGTH$2, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$2, + REGEX_NON_SPECIAL_CHARS: REGEX_NON_SPECIAL_CHARS$1, + REGEX_SPECIAL_CHARS_BACKREF: REGEX_SPECIAL_CHARS_BACKREF$1, + REPLACEMENTS: REPLACEMENTS$1 +} = constants$7; + +/** + * Helpers + */ + +const expandRange$1 = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError$1 = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$h = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS$1[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$2, opts.maxLength) : MAX_LENGTH$2; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$7.globChars(opts.windows); + const EXTGLOB_CHARS = constants$7.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$b.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$h(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF$1, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$b.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE$2[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$b.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError$1('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError$1('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError$1('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$b.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$b.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange$1(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS$1.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', ']')); + state.output = utils$b.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', ')')); + state.output = utils$b.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError$1('closing', '}')); + state.output = utils$b.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$h.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$2, opts.maxLength) : MAX_LENGTH$2; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS$1[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$7.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$b.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1$4 = parse$h; + +const scan$2 = scan_1$1; +const parse$g = parse_1$4; +const utils$a = utils$d; +const constants$6 = constants$8; +const isObject$4 = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$6 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$6(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject$4(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch$6.compileRe(glob, options) + : picomatch$6.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$6(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$6.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$6.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils$a.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$6.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$6.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch$6.makeRe(glob, options); + return regex.test(utils$a.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$6.isMatch = (str, patterns, options) => picomatch$6(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$6.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$6.parse(p, options)); + return parse$g(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$6.scan = (input, options) => scan$2(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$6.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$6.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$6.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$g.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse$g(input, options); + } + + return picomatch$6.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$6.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$6.constants = constants$6; + +/** + * Expose "picomatch" + */ + +var picomatch_1$2 = picomatch$6; + +const pico = picomatch_1$2; +const utils$9 = utils$d; + +function picomatch$4(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils$9.isWindows() }; + } + + return pico(glob, options, returnState); +} + +Object.assign(picomatch$4, pico); +var picomatch_1$1 = picomatch$4; + +var picomatch$5 = /*@__PURE__*/getDefaultExportFromCjs(picomatch_1$1); + +const VALID_ID_PREFIX = `/@id/`; +const NULL_BYTE_PLACEHOLDER = `__x00__`; +let SOURCEMAPPING_URL = "sourceMa"; +SOURCEMAPPING_URL += "ppingURL"; +const MODULE_RUNNER_SOURCEMAPPING_SOURCE = "//# sourceMappingSource=vite-generated"; +const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP"; + +const isWindows$3 = typeof process !== "undefined" && process.platform === "win32"; +function wrapId$1(id) { + return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER); +} +function unwrapId$1(id) { + return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id; +} +const windowsSlashRE = /\\/g; +function slash$1(p) { + return p.replace(windowsSlashRE, "/"); +} +const postfixRE = /[?#].*$/; +function cleanUrl(url) { + return url.replace(postfixRE, ""); +} +function splitFileAndPostfix(path) { + const file = cleanUrl(path); + return { file, postfix: path.slice(file.length) }; +} +function withTrailingSlash(path) { + if (path[path.length - 1] !== "/") { + return `${path}/`; + } + return path; +} +function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + return { promise, resolve, reject }; +} + +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +let WalkerBase$1 = class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +let SyncWalker$1 = class SyncWalker extends WalkerBase$1 { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +function walk$2(ast, { enter, leave }) { + const instance = new SyncWalker$1(enter, leave); + return instance.visit(ast, null); +} + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +const blockDeclarations = { + const: true, + let: true +}; +class Scope { + constructor(options = {}) { + this.parent = options.parent; + this.isBlockScope = !!options.block; + this.declarations = Object.create(null); + if (options.params) { + options.params.forEach((param) => { + extractAssignedNames(param).forEach((name) => { + this.declarations[name] = true; + }); + }); + } + } + addDeclaration(node, isBlockDeclaration, isVar) { + if (!isBlockDeclaration && this.isBlockScope) { + // it's a `var` or function node, and this + // is a block scope, so we need to go up + this.parent.addDeclaration(node, isBlockDeclaration, isVar); + } + else if (node.id) { + extractAssignedNames(node.id).forEach((name) => { + this.declarations[name] = true; + }); + } + } + contains(name) { + return this.declarations[name] || (this.parent ? this.parent.contains(name) : false); + } +} +const attachScopes = function attachScopes(ast, propertyName = 'scope') { + let scope = new Scope(); + walk$2(ast, { + enter(n, parent) { + const node = n; + // function foo () {...} + // class Foo {...} + if (/(?:Function|Class)Declaration/.test(node.type)) { + scope.addDeclaration(node, false, false); + } + // var foo = 1 + if (node.type === 'VariableDeclaration') { + const { kind } = node; + const isBlockDeclaration = blockDeclarations[kind]; + node.declarations.forEach((declaration) => { + scope.addDeclaration(declaration, isBlockDeclaration, true); + }); + } + let newScope; + // create new function scope + if (/Function/.test(node.type)) { + const func = node; + newScope = new Scope({ + parent: scope, + block: false, + params: func.params + }); + // named function expressions - the name is considered + // part of the function's scope + if (func.type === 'FunctionExpression' && func.id) { + newScope.addDeclaration(func, false, false); + } + } + // create new for scope + if (/For(?:In|Of)?Statement/.test(node.type)) { + newScope = new Scope({ + parent: scope, + block: true + }); + } + // create new block scope + if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) { + newScope = new Scope({ + parent: scope, + block: true + }); + } + // catch clause has its own block scope + if (node.type === 'CatchClause') { + newScope = new Scope({ + parent: scope, + params: node.param ? [node.param] : [], + block: true + }); + } + if (newScope) { + Object.defineProperty(node, propertyName, { + value: newScope, + configurable: true + }); + scope = newScope; + } + }, + leave(n) { + const node = n; + if (node[propertyName]) + scope = scope.parent; + } + }); + return scope; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePathRegExp = new RegExp(`\\${win32.sep}`, 'g'); +const normalizePath$6 = function normalizePath(filename) { + return filename.replace(normalizePathRegExp, posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) { + return normalizePath$6(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath$6(resolve$3(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath$6(id)); +} +const createFilter$1 = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = picomatch$5(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + if (!includeMatchers.length && !excludeMatchers.length) + return (id) => typeof id === 'string' && !id.includes('\0'); + return function result(id) { + if (typeof id !== 'string') + return false; + if (id.includes('\0')) + return false; + const pathId = normalizePath$6(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); +const makeLegalIdentifier = function makeLegalIdentifier(str) { + let identifier = str + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(/[^$_a-zA-Z0-9]/g, '_'); + if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) { + identifier = `_${identifier}`; + } + return identifier || '_'; +}; + +function stringify$5(obj) { + return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`); +} +function serializeArray(arr, indent, baseIndent) { + let output = '['; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + for (let i = 0; i < arr.length; i++) { + const key = arr[i]; + output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}]`; +} +function serializeObject(obj, indent, baseIndent) { + let output = '{'; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + const entries = Object.entries(obj); + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i]; + const stringKey = makeLegalIdentifier(key) === key ? key : stringify$5(key); + output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}}`; +} +function serialize(obj, indent, baseIndent) { + if (typeof obj === 'object' && obj !== null) { + if (Array.isArray(obj)) + return serializeArray(obj, indent, baseIndent); + if (obj instanceof Date) + return `new Date(${obj.getTime()})`; + if (obj instanceof RegExp) + return obj.toString(); + return serializeObject(obj, indent, baseIndent); + } + if (typeof obj === 'number') { + if (obj === Infinity) + return 'Infinity'; + if (obj === -Infinity) + return '-Infinity'; + if (obj === 0) + return 1 / obj === Infinity ? '0' : '-0'; + if (obj !== obj) + return 'NaN'; // eslint-disable-line no-self-compare + } + if (typeof obj === 'symbol') { + const key = Symbol.keyFor(obj); + // eslint-disable-next-line no-undefined + if (key !== undefined) + return `Symbol.for(${stringify$5(key)})`; + } + if (typeof obj === 'bigint') + return `${obj}n`; + return stringify$5(obj); +} +// isWellFormed exists from Node.js 20 +const hasStringIsWellFormed = 'isWellFormed' in String.prototype; +function isWellFormedString(input) { + // @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6 + if (hasStringIsWellFormed) + return input.isWellFormed(); + // https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm + return !/\p{Surrogate}/u.test(input); +} +const dataToEsm = function dataToEsm(data, options = {}) { + var _a, _b; + const t = options.compact ? '' : 'indent' in options ? options.indent : '\t'; + const _ = options.compact ? '' : ' '; + const n = options.compact ? '' : '\n'; + const declarationType = options.preferConst ? 'const' : 'var'; + if (options.namedExports === false || + typeof data !== 'object' || + Array.isArray(data) || + data instanceof Date || + data instanceof RegExp || + data === null) { + const code = serialize(data, options.compact ? null : t, ''); + const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape + return `export default${magic}${code};`; + } + let maxUnderbarPrefixLength = 0; + for (const key of Object.keys(data)) { + const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0; + if (underbarPrefixLength > maxUnderbarPrefixLength) { + maxUnderbarPrefixLength = underbarPrefixLength; + } + } + const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`; + let namedExportCode = ''; + const defaultExportRows = []; + const arbitraryNameExportRows = []; + for (const [key, value] of Object.entries(data)) { + if (key === makeLegalIdentifier(key)) { + if (options.objectShorthand) + defaultExportRows.push(key); + else + defaultExportRows.push(`${key}:${_}${key}`); + namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + } + else { + defaultExportRows.push(`${stringify$5(key)}:${_}${serialize(value, options.compact ? null : t, '')}`); + if (options.includeArbitraryNames && isWellFormedString(key)) { + const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`; + namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`); + } + } + } + const arbitraryExportCode = arbitraryNameExportRows.length > 0 + ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` + : ''; + const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`; + return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`; +}; + +var path$c = require$$0$2; + +var commondir = function (basedir, relfiles) { + if (relfiles) { + var files = relfiles.map(function (r) { + return path$c.resolve(basedir, r); + }); + } + else { + var files = basedir; + } + + var res = files.slice(1).reduce(function (ps, file) { + if (!file.match(/^([A-Za-z]:)?\/|\\/)) { + throw new Error('relative path without a basedir'); + } + + var xs = file.split(/\/+|\\+/); + for ( + var i = 0; + ps[i] === xs[i] && i < Math.min(ps.length, xs.length); + i++ + ); + return ps.slice(0, i); + }, files[0].split(/\/+|\\+/)); + + // Windows correctly handles paths with forward-slashes + return res.length > 1 ? res.join('/') : '/' +}; + +var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir); + +var dist = {}; + +var builder = {}; + +var apiBuilder = {}; + +var async = {}; + +var walker = {}; + +var utils$8 = {}; + +Object.defineProperty(utils$8, "__esModule", { value: true }); +utils$8.normalizePath = utils$8.convertSlashes = utils$8.cleanPath = void 0; +const path_1$4 = require$$0$2; +function cleanPath(path) { + let normalized = (0, path_1$4.normalize)(path); + // we have to remove the last path separator + // to account for / root path + if (normalized.length > 1 && normalized[normalized.length - 1] === path_1$4.sep) + normalized = normalized.substring(0, normalized.length - 1); + return normalized; +} +utils$8.cleanPath = cleanPath; +const SLASHES_REGEX = /[\\/]/g; +function convertSlashes(path, separator) { + return path.replace(SLASHES_REGEX, separator); +} +utils$8.convertSlashes = convertSlashes; +function normalizePath$5(path, options) { + const { resolvePaths, normalizePath, pathSeparator } = options; + const pathNeedsCleaning = (process.platform === "win32" && path.includes("/")) || + path.startsWith("."); + if (resolvePaths) + path = (0, path_1$4.resolve)(path); + if (normalizePath || pathNeedsCleaning) + path = cleanPath(path); + if (path === ".") + return ""; + const needsSeperator = path[path.length - 1] !== pathSeparator; + return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator); +} +utils$8.normalizePath = normalizePath$5; + +var joinPath$2 = {}; + +Object.defineProperty(joinPath$2, "__esModule", { value: true }); +joinPath$2.build = joinPath$2.joinDirectoryPath = joinPath$2.joinPathWithBasePath = void 0; +const path_1$3 = require$$0$2; +const utils_1$1 = utils$8; +function joinPathWithBasePath(filename, directoryPath) { + return directoryPath + filename; +} +joinPath$2.joinPathWithBasePath = joinPathWithBasePath; +function joinPathWithRelativePath(root, options) { + return function (filename, directoryPath) { + const sameRoot = directoryPath.startsWith(root); + if (sameRoot) + return directoryPath.replace(root, "") + filename; + else + return ((0, utils_1$1.convertSlashes)((0, path_1$3.relative)(root, directoryPath), options.pathSeparator) + + options.pathSeparator + + filename); + }; +} +function joinPath$1(filename) { + return filename; +} +function joinDirectoryPath(filename, directoryPath, separator) { + return directoryPath + filename + separator; +} +joinPath$2.joinDirectoryPath = joinDirectoryPath; +function build$a(root, options) { + const { relativePaths, includeBasePath } = options; + return relativePaths && root + ? joinPathWithRelativePath(root, options) + : includeBasePath + ? joinPathWithBasePath + : joinPath$1; +} +joinPath$2.build = build$a; + +var pushDirectory$2 = {}; + +Object.defineProperty(pushDirectory$2, "__esModule", { value: true }); +pushDirectory$2.build = void 0; +function pushDirectoryWithRelativePath(root) { + return function (directoryPath, paths) { + paths.push(directoryPath.substring(root.length) || "."); + }; +} +function pushDirectoryFilterWithRelativePath(root) { + return function (directoryPath, paths, filters) { + const relativePath = directoryPath.substring(root.length) || "."; + if (filters.every((filter) => filter(relativePath, true))) { + paths.push(relativePath); + } + }; +} +const pushDirectory$1 = (directoryPath, paths) => { + paths.push(directoryPath || "."); +}; +const pushDirectoryFilter = (directoryPath, paths, filters) => { + const path = directoryPath || "."; + if (filters.every((filter) => filter(path, true))) { + paths.push(path); + } +}; +const empty$2 = () => { }; +function build$9(root, options) { + const { includeDirs, filters, relativePaths } = options; + if (!includeDirs) + return empty$2; + if (relativePaths) + return filters && filters.length + ? pushDirectoryFilterWithRelativePath(root) + : pushDirectoryWithRelativePath(root); + return filters && filters.length ? pushDirectoryFilter : pushDirectory$1; +} +pushDirectory$2.build = build$9; + +var pushFile$2 = {}; + +Object.defineProperty(pushFile$2, "__esModule", { value: true }); +pushFile$2.build = void 0; +const pushFileFilterAndCount = (filename, _paths, counts, filters) => { + if (filters.every((filter) => filter(filename, false))) + counts.files++; +}; +const pushFileFilter = (filename, paths, _counts, filters) => { + if (filters.every((filter) => filter(filename, false))) + paths.push(filename); +}; +const pushFileCount = (_filename, _paths, counts, _filters) => { + counts.files++; +}; +const pushFile$1 = (filename, paths) => { + paths.push(filename); +}; +const empty$1 = () => { }; +function build$8(options) { + const { excludeFiles, filters, onlyCounts } = options; + if (excludeFiles) + return empty$1; + if (filters && filters.length) { + return onlyCounts ? pushFileFilterAndCount : pushFileFilter; + } + else if (onlyCounts) { + return pushFileCount; + } + else { + return pushFile$1; + } +} +pushFile$2.build = build$8; + +var getArray$2 = {}; + +Object.defineProperty(getArray$2, "__esModule", { value: true }); +getArray$2.build = void 0; +const getArray$1 = (paths) => { + return paths; +}; +const getArrayGroup = () => { + return [""].slice(0, 0); +}; +function build$7(options) { + return options.group ? getArrayGroup : getArray$1; +} +getArray$2.build = build$7; + +var groupFiles$2 = {}; + +Object.defineProperty(groupFiles$2, "__esModule", { value: true }); +groupFiles$2.build = void 0; +const groupFiles$1 = (groups, directory, files) => { + groups.push({ directory, files, dir: directory }); +}; +const empty = () => { }; +function build$6(options) { + return options.group ? groupFiles$1 : empty; +} +groupFiles$2.build = build$6; + +var resolveSymlink$1 = {}; + +var __importDefault$1 = (resolveSymlink$1 && resolveSymlink$1.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(resolveSymlink$1, "__esModule", { value: true }); +resolveSymlink$1.build = void 0; +const fs_1$1 = __importDefault$1(require$$0$3); +const path_1$2 = require$$0$2; +const resolveSymlinksAsync = function (path, state, callback) { + const { queue, options: { suppressErrors }, } = state; + queue.enqueue(); + fs_1$1.default.realpath(path, (error, resolvedPath) => { + if (error) + return queue.dequeue(suppressErrors ? null : error, state); + fs_1$1.default.stat(resolvedPath, (error, stat) => { + if (error) + return queue.dequeue(suppressErrors ? null : error, state); + if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) + return queue.dequeue(null, state); + callback(stat, resolvedPath); + queue.dequeue(null, state); + }); + }); +}; +const resolveSymlinks = function (path, state, callback) { + const { queue, options: { suppressErrors }, } = state; + queue.enqueue(); + try { + const resolvedPath = fs_1$1.default.realpathSync(path); + const stat = fs_1$1.default.statSync(resolvedPath); + if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) + return; + callback(stat, resolvedPath); + } + catch (e) { + if (!suppressErrors) + throw e; + } +}; +function build$5(options, isSynchronous) { + if (!options.resolveSymlinks || options.excludeSymlinks) + return null; + return isSynchronous ? resolveSymlinks : resolveSymlinksAsync; +} +resolveSymlink$1.build = build$5; +function isRecursive(path, resolved, state) { + if (state.options.useRealPaths) + return isRecursiveUsingRealPaths(resolved, state); + let parent = (0, path_1$2.dirname)(path); + let depth = 1; + while (parent !== state.root && depth < 2) { + const resolvedPath = state.symlinks.get(parent); + const isSameRoot = !!resolvedPath && + (resolvedPath === resolved || + resolvedPath.startsWith(resolved) || + resolved.startsWith(resolvedPath)); + if (isSameRoot) + depth++; + else + parent = (0, path_1$2.dirname)(parent); + } + state.symlinks.set(path, resolved); + return depth > 1; +} +function isRecursiveUsingRealPaths(resolved, state) { + return state.visited.includes(resolved + state.options.pathSeparator); +} + +var invokeCallback$1 = {}; + +Object.defineProperty(invokeCallback$1, "__esModule", { value: true }); +invokeCallback$1.build = void 0; +const onlyCountsSync = (state) => { + return state.counts; +}; +const groupsSync = (state) => { + return state.groups; +}; +const defaultSync = (state) => { + return state.paths; +}; +const limitFilesSync = (state) => { + return state.paths.slice(0, state.options.maxFiles); +}; +const onlyCountsAsync = (state, error, callback) => { + report(error, callback, state.counts, state.options.suppressErrors); + return null; +}; +const defaultAsync = (state, error, callback) => { + report(error, callback, state.paths, state.options.suppressErrors); + return null; +}; +const limitFilesAsync = (state, error, callback) => { + report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors); + return null; +}; +const groupsAsync = (state, error, callback) => { + report(error, callback, state.groups, state.options.suppressErrors); + return null; +}; +function report(error, callback, output, suppressErrors) { + if (error && !suppressErrors) + callback(error, output); + else + callback(null, output); +} +function build$4(options, isSynchronous) { + const { onlyCounts, group, maxFiles } = options; + if (onlyCounts) + return isSynchronous + ? onlyCountsSync + : onlyCountsAsync; + else if (group) + return isSynchronous + ? groupsSync + : groupsAsync; + else if (maxFiles) + return isSynchronous + ? limitFilesSync + : limitFilesAsync; + else + return isSynchronous + ? defaultSync + : defaultAsync; +} +invokeCallback$1.build = build$4; + +var walkDirectory$1 = {}; + +var __importDefault = (walkDirectory$1 && walkDirectory$1.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(walkDirectory$1, "__esModule", { value: true }); +walkDirectory$1.build = void 0; +const fs_1 = __importDefault(require$$0$3); +const readdirOpts = { withFileTypes: true }; +const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback) => { + if (currentDepth < 0) + return state.queue.dequeue(null, state); + state.visited.push(crawlPath); + state.counts.directories++; + state.queue.enqueue(); + // Perf: Node >= 10 introduced withFileTypes that helps us + // skip an extra fs.stat call. + fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => { + callback(entries, directoryPath, currentDepth); + state.queue.dequeue(state.options.suppressErrors ? null : error, state); + }); +}; +const walkSync = (state, crawlPath, directoryPath, currentDepth, callback) => { + if (currentDepth < 0) + return; + state.visited.push(crawlPath); + state.counts.directories++; + let entries = []; + try { + entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts); + } + catch (e) { + if (!state.options.suppressErrors) + throw e; + } + callback(entries, directoryPath, currentDepth); +}; +function build$3(isSynchronous) { + return isSynchronous ? walkSync : walkAsync; +} +walkDirectory$1.build = build$3; + +var queue = {}; + +Object.defineProperty(queue, "__esModule", { value: true }); +queue.Queue = void 0; +/** + * This is a custom stateless queue to track concurrent async fs calls. + * It increments a counter whenever a call is queued and decrements it + * as soon as it completes. When the counter hits 0, it calls onQueueEmpty. + */ +class Queue { + onQueueEmpty; + count = 0; + constructor(onQueueEmpty) { + this.onQueueEmpty = onQueueEmpty; + } + enqueue() { + this.count++; + } + dequeue(error, output) { + if (--this.count <= 0 || error) + this.onQueueEmpty(error, output); + } +} +queue.Queue = Queue; + +var counter = {}; + +Object.defineProperty(counter, "__esModule", { value: true }); +counter.Counter = void 0; +class Counter { + _files = 0; + _directories = 0; + set files(num) { + this._files = num; + } + get files() { + return this._files; + } + set directories(num) { + this._directories = num; + } + get directories() { + return this._directories; + } + /** + * @deprecated use `directories` instead + */ + /* c8 ignore next 3 */ + get dirs() { + return this._directories; + } +} +counter.Counter = Counter; + +var __createBinding = (walker && walker.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (walker && walker.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (walker && walker.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(walker, "__esModule", { value: true }); +walker.Walker = void 0; +const path_1$1 = require$$0$2; +const utils_1 = utils$8; +const joinPath = __importStar(joinPath$2); +const pushDirectory = __importStar(pushDirectory$2); +const pushFile = __importStar(pushFile$2); +const getArray = __importStar(getArray$2); +const groupFiles = __importStar(groupFiles$2); +const resolveSymlink = __importStar(resolveSymlink$1); +const invokeCallback = __importStar(invokeCallback$1); +const walkDirectory = __importStar(walkDirectory$1); +const queue_1 = queue; +const counter_1 = counter; +class Walker { + root; + isSynchronous; + state; + joinPath; + pushDirectory; + pushFile; + getArray; + groupFiles; + resolveSymlink; + walkDirectory; + callbackInvoker; + constructor(root, options, callback) { + this.isSynchronous = !callback; + this.callbackInvoker = invokeCallback.build(options, this.isSynchronous); + this.root = (0, utils_1.normalizePath)(root, options); + this.state = { + root: this.root.slice(0, -1), + // Perf: we explicitly tell the compiler to optimize for String arrays + paths: [""].slice(0, 0), + groups: [], + counts: new counter_1.Counter(), + options, + queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)), + symlinks: new Map(), + visited: [""].slice(0, 0), + }; + /* + * Perf: We conditionally change functions according to options. This gives a slight + * performance boost. Since these functions are so small, they are automatically inlined + * by the javascript engine so there's no function call overhead (in most cases). + */ + this.joinPath = joinPath.build(this.root, options); + this.pushDirectory = pushDirectory.build(this.root, options); + this.pushFile = pushFile.build(options); + this.getArray = getArray.build(options); + this.groupFiles = groupFiles.build(options); + this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous); + this.walkDirectory = walkDirectory.build(this.isSynchronous); + } + start() { + this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk); + return this.isSynchronous ? this.callbackInvoker(this.state, null) : null; + } + walk = (entries, directoryPath, depth) => { + const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator, }, } = this.state; + if ((signal && signal.aborted) || (maxFiles && paths.length > maxFiles)) + return; + this.pushDirectory(directoryPath, paths, filters); + const files = this.getArray(this.state.paths); + for (let i = 0; i < entries.length; ++i) { + const entry = entries[i]; + if (entry.isFile() || + (entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks)) { + const filename = this.joinPath(entry.name, directoryPath); + this.pushFile(filename, files, this.state.counts, filters); + } + else if (entry.isDirectory()) { + let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator); + if (exclude && exclude(entry.name, path)) + continue; + this.walkDirectory(this.state, path, path, depth - 1, this.walk); + } + else if (entry.isSymbolicLink() && this.resolveSymlink) { + let path = joinPath.joinPathWithBasePath(entry.name, directoryPath); + this.resolveSymlink(path, this.state, (stat, resolvedPath) => { + if (stat.isDirectory()) { + resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options); + if (exclude && exclude(entry.name, resolvedPath)) + return; + this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk); + } + else { + resolvedPath = useRealPaths ? resolvedPath : path; + const filename = (0, path_1$1.basename)(resolvedPath); + const directoryPath = (0, utils_1.normalizePath)((0, path_1$1.dirname)(resolvedPath), this.state.options); + resolvedPath = this.joinPath(filename, directoryPath); + this.pushFile(resolvedPath, files, this.state.counts, filters); + } + }); + } + } + this.groupFiles(this.state.groups, directoryPath, files); + }; +} +walker.Walker = Walker; + +Object.defineProperty(async, "__esModule", { value: true }); +async.callback = async.promise = void 0; +const walker_1$1 = walker; +function promise(root, options) { + return new Promise((resolve, reject) => { + callback(root, options, (err, output) => { + if (err) + return reject(err); + resolve(output); + }); + }); +} +async.promise = promise; +function callback(root, options, callback) { + let walker = new walker_1$1.Walker(root, options, callback); + walker.start(); +} +async.callback = callback; + +var sync$2 = {}; + +Object.defineProperty(sync$2, "__esModule", { value: true }); +sync$2.sync = void 0; +const walker_1 = walker; +function sync$1(root, options) { + const walker = new walker_1.Walker(root, options); + return walker.start(); +} +sync$2.sync = sync$1; + +Object.defineProperty(apiBuilder, "__esModule", { value: true }); +apiBuilder.APIBuilder = void 0; +const async_1 = async; +const sync_1 = sync$2; +class APIBuilder { + root; + options; + constructor(root, options) { + this.root = root; + this.options = options; + } + withPromise() { + return (0, async_1.promise)(this.root, this.options); + } + withCallback(cb) { + (0, async_1.callback)(this.root, this.options, cb); + } + sync() { + return (0, sync_1.sync)(this.root, this.options); + } +} +apiBuilder.APIBuilder = APIBuilder; + +Object.defineProperty(builder, "__esModule", { value: true }); +builder.Builder = void 0; +const path_1 = require$$0$2; +const api_builder_1 = apiBuilder; +var pm = null; +/* c8 ignore next 6 */ +try { + require.resolve("picomatch"); + pm = picomatch_1$1; +} +catch (_e) { + // do nothing +} +class Builder { + globCache = {}; + options = { + maxDepth: Infinity, + suppressErrors: true, + pathSeparator: path_1.sep, + filters: [], + }; + globFunction; + constructor(options) { + this.options = { ...this.options, ...options }; + this.globFunction = this.options.globFunction; + } + group() { + this.options.group = true; + return this; + } + withPathSeparator(separator) { + this.options.pathSeparator = separator; + return this; + } + withBasePath() { + this.options.includeBasePath = true; + return this; + } + withRelativePaths() { + this.options.relativePaths = true; + return this; + } + withDirs() { + this.options.includeDirs = true; + return this; + } + withMaxDepth(depth) { + this.options.maxDepth = depth; + return this; + } + withMaxFiles(limit) { + this.options.maxFiles = limit; + return this; + } + withFullPaths() { + this.options.resolvePaths = true; + this.options.includeBasePath = true; + return this; + } + withErrors() { + this.options.suppressErrors = false; + return this; + } + withSymlinks({ resolvePaths = true } = {}) { + this.options.resolveSymlinks = true; + this.options.useRealPaths = resolvePaths; + return this.withFullPaths(); + } + withAbortSignal(signal) { + this.options.signal = signal; + return this; + } + normalize() { + this.options.normalizePath = true; + return this; + } + filter(predicate) { + this.options.filters.push(predicate); + return this; + } + onlyDirs() { + this.options.excludeFiles = true; + this.options.includeDirs = true; + return this; + } + exclude(predicate) { + this.options.exclude = predicate; + return this; + } + onlyCounts() { + this.options.onlyCounts = true; + return this; + } + crawl(root) { + return new api_builder_1.APIBuilder(root || ".", this.options); + } + withGlobFunction(fn) { + // cast this since we don't have the new type params yet + this.globFunction = fn; + return this; + } + /** + * @deprecated Pass options using the constructor instead: + * ```ts + * new fdir(options).crawl("/path/to/root"); + * ``` + * This method will be removed in v7.0 + */ + /* c8 ignore next 4 */ + crawlWithOptions(root, options) { + this.options = { ...this.options, ...options }; + return new api_builder_1.APIBuilder(root || ".", this.options); + } + glob(...patterns) { + if (this.globFunction) { + return this.globWithOptions(patterns); + } + return this.globWithOptions(patterns, ...[{ dot: true }]); + } + globWithOptions(patterns, ...options) { + const globFn = (this.globFunction || pm); + /* c8 ignore next 5 */ + if (!globFn) { + throw new Error('Please specify a glob function to use glob matching.'); + } + var isMatch = this.globCache[patterns.join("\0")]; + if (!isMatch) { + isMatch = globFn(patterns, ...options); + this.globCache[patterns.join("\0")] = isMatch; + } + this.options.filters.push((path) => isMatch(path)); + return this; + } +} +builder.Builder = Builder; + +var types$1 = {}; + +Object.defineProperty(types$1, "__esModule", { value: true }); + +(function (exports) { + var __createBinding = (dist && dist.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = (dist && dist.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.fdir = void 0; + const builder_1 = builder; + Object.defineProperty(exports, "fdir", { enumerable: true, get: function () { return builder_1.Builder; } }); + __exportStar(types$1, exports); +} (dist)); + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars$1.length; i++) { + const c = chars$1.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) + clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) + return false; + return reader.peek() !== comma; +} + +const bufLength = 1024 * 16; +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +class StringWriter { + constructor() { + this.pos = 0; + this.out = ''; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} +class StringReader { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +} + +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(';'); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) + sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } + else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } + else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) + sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator$1); +} +function sortComparator$1(a, b) { + return a[0] - b[0]; +} +function encode$1(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) + writer.write(semicolon); + if (line.length === 0) + continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) + writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) + continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) + continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa$1 = /*#__PURE__*/ getBtoa(); + +let SourceMap$1 = class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode$1(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString()); + } +}; + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath$1(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString$1 = Object.prototype.toString; + +function isObject$3(thing) { + return toString$1.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n$1 = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath$1(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap$1(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject$3(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite( + match.index, + match.index + match[0].length, + replacement + ); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +function isReference(node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && isReference(node.object, node); + } + if (node.type === 'Identifier') { + if (!parent) + return true; + switch (parent.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': return parent.computed || node === parent.object; + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': return parent.computed; + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'FieldDefinition': return parent.computed || node === parent.value; + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': return parent.computed || node === parent.value; + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': return node === parent.local; + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': return false; + default: return true; + } + } + return false; +} + +var version$2 = "28.0.1"; +var peerDependencies = { + rollup: "^2.68.0||^3.0.0||^4.0.0" +}; + +function tryParse(parse, code, id) { + try { + return parse(code, { allowReturnOutsideFunction: true }); + } catch (err) { + err.message += ` in ${id}`; + throw err; + } +} + +const firstpassGlobal = /\b(?:require|module|exports|global)\b/; + +const firstpassNoGlobal = /\b(?:require|module|exports)\b/; + +function hasCjsKeywords(code, ignoreGlobal) { + const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal; + return firstpass.test(code); +} + +/* eslint-disable no-underscore-dangle */ + + +function analyzeTopLevelStatements(parse, code, id) { + const ast = tryParse(parse, code, id); + + let isEsModule = false; + let hasDefaultExport = false; + let hasNamedExports = false; + + for (const node of ast.body) { + switch (node.type) { + case 'ExportDefaultDeclaration': + isEsModule = true; + hasDefaultExport = true; + break; + case 'ExportNamedDeclaration': + isEsModule = true; + if (node.declaration) { + hasNamedExports = true; + } else { + for (const specifier of node.specifiers) { + if (specifier.exported.name === 'default') { + hasDefaultExport = true; + } else { + hasNamedExports = true; + } + } + } + break; + case 'ExportAllDeclaration': + isEsModule = true; + if (node.exported && node.exported.name === 'default') { + hasDefaultExport = true; + } else { + hasNamedExports = true; + } + break; + case 'ImportDeclaration': + isEsModule = true; + break; + } + } + + return { isEsModule, hasDefaultExport, hasNamedExports, ast }; +} + +/* eslint-disable import/prefer-default-export */ + + +function deconflict(scopes, globals, identifier) { + let i = 1; + let deconflicted = makeLegalIdentifier(identifier); + const hasConflicts = () => + scopes.some((scope) => scope.contains(deconflicted)) || globals.has(deconflicted); + + while (hasConflicts()) { + deconflicted = makeLegalIdentifier(`${identifier}_${i}`); + i += 1; + } + + for (const scope of scopes) { + scope.declarations[deconflicted] = true; + } + + return deconflicted; +} + +function getName(id) { + const name = makeLegalIdentifier(basename$1(id, extname(id))); + if (name !== 'index') { + return name; + } + return makeLegalIdentifier(basename$1(dirname$1(id))); +} + +function normalizePathSlashes(path) { + return path.replace(/\\/g, '/'); +} + +const getVirtualPathForDynamicRequirePath = (path, commonDir) => + `/${normalizePathSlashes(relative$1(commonDir, path))}`; + +function capitalize(name) { + return name[0].toUpperCase() + name.slice(1); +} + +function getStrictRequiresFilter({ strictRequires }) { + switch (strictRequires) { + // eslint-disable-next-line no-undefined + case undefined: + case true: + return { strictRequiresFilter: () => true, detectCyclesAndConditional: false }; + case 'auto': + case 'debug': + case null: + return { strictRequiresFilter: () => false, detectCyclesAndConditional: true }; + case false: + return { strictRequiresFilter: () => false, detectCyclesAndConditional: false }; + default: + if (typeof strictRequires === 'string' || Array.isArray(strictRequires)) { + return { + strictRequiresFilter: createFilter$1(strictRequires), + detectCyclesAndConditional: false + }; + } + throw new Error('Unexpected value for "strictRequires" option.'); + } +} + +function getPackageEntryPoint(dirPath) { + let entryPoint = 'index.js'; + + try { + if (existsSync(join(dirPath, 'package.json'))) { + entryPoint = + JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main || + entryPoint; + } + } catch (ignored) { + // ignored + } + + return entryPoint; +} + +function isDirectory$1(path) { + try { + if (statSync(path).isDirectory()) return true; + } catch (ignored) { + // Nothing to do here + } + return false; +} + +function getDynamicRequireModules(patterns, dynamicRequireRoot) { + const dynamicRequireModules = new Map(); + const dirNames = new Set(); + for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) { + const isNegated = pattern.startsWith('!'); + const modifyMap = (targetPath, resolvedPath) => + isNegated + ? dynamicRequireModules.delete(targetPath) + : dynamicRequireModules.set(targetPath, resolvedPath); + // eslint-disable-next-line new-cap + for (const path of new dist.fdir() + .withBasePath() + .withDirs() + .glob(isNegated ? pattern.substr(1) : pattern) + .crawl() + .sync() + .sort((a, b) => a.localeCompare(b, 'en'))) { + const resolvedPath = resolve$3(path); + const requirePath = normalizePathSlashes(resolvedPath); + if (isDirectory$1(resolvedPath)) { + dirNames.add(resolvedPath); + const modulePath = resolve$3(join(resolvedPath, getPackageEntryPoint(path))); + modifyMap(requirePath, modulePath); + modifyMap(normalizePathSlashes(modulePath), modulePath); + } else { + dirNames.add(dirname$1(resolvedPath)); + modifyMap(requirePath, resolvedPath); + } + } + } + return { + commonDir: dirNames.size ? getCommonDir([...dirNames, dynamicRequireRoot]) : null, + dynamicRequireModules + }; +} + +const FAILED_REQUIRE_ERROR = `throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');`; + +const COMMONJS_REQUIRE_EXPORT = 'commonjsRequire'; +const CREATE_COMMONJS_REQUIRE_EXPORT = 'createCommonjsRequire'; + +function getDynamicModuleRegistry( + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ignoreDynamicRequires +) { + if (!isDynamicRequireModulesEnabled) { + return `export function ${COMMONJS_REQUIRE_EXPORT}(path) { + ${FAILED_REQUIRE_ERROR} +}`; + } + const dynamicModuleImports = [...dynamicRequireModules.values()] + .map( + (id, index) => + `import ${ + id.endsWith('.json') ? `json${index}` : `{ __require as require${index} }` + } from ${JSON.stringify(id)};` + ) + .join('\n'); + const dynamicModuleProps = [...dynamicRequireModules.keys()] + .map( + (id, index) => + `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${ + id.endsWith('.json') ? `function () { return json${index}; }` : `require${index}` + }` + ) + .join(',\n'); + return `${dynamicModuleImports} + +var dynamicModules; + +function getDynamicModules() { + return dynamicModules || (dynamicModules = { +${dynamicModuleProps} + }); +} + +export function ${CREATE_COMMONJS_REQUIRE_EXPORT}(originalModuleDir) { + function handleRequire(path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return getDynamicModules()[resolvedPath](); + } + ${ignoreDynamicRequires ? 'return require(path);' : FAILED_REQUIRE_ERROR} + } + handleRequire.resolve = function (path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return resolvedPath; + } + return require.resolve(path); + } + return handleRequire; +} + +function commonjsResolve (path, originalModuleDir) { + var shouldTryNodeModules = isPossibleNodeModulesPath(path); + path = normalize(path); + var relPath; + if (path[0] === '/') { + originalModuleDir = ''; + } + var modules = getDynamicModules(); + var checkedExtensions = ['', '.js', '.json']; + while (true) { + if (!shouldTryNodeModules) { + relPath = normalize(originalModuleDir + '/' + path); + } else { + relPath = normalize(originalModuleDir + '/node_modules/' + path); + } + + if (relPath.endsWith('/..')) { + break; // Travelled too far up, avoid infinite loop + } + + for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) { + var resolvedPath = relPath + checkedExtensions[extensionIndex]; + if (modules[resolvedPath]) { + return resolvedPath; + } + } + if (!shouldTryNodeModules) break; + var nextDir = normalize(originalModuleDir + '/..'); + if (nextDir === originalModuleDir) break; + originalModuleDir = nextDir; + } + return null; +} + +function isPossibleNodeModulesPath (modulePath) { + var c0 = modulePath[0]; + if (c0 === '/' || c0 === '\\\\') return false; + var c1 = modulePath[1], c2 = modulePath[2]; + if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) || + (c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false; + if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false; + return true; +} + +function normalize (path) { + path = path.replace(/\\\\/g, '/'); + var parts = path.split('/'); + var slashed = parts[0] === ''; + for (var i = 1; i < parts.length; i++) { + if (parts[i] === '.' || parts[i] === '') { + parts.splice(i--, 1); + } + } + for (var i = 1; i < parts.length; i++) { + if (parts[i] !== '..') continue; + if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') { + parts.splice(--i, 2); + i--; + } + } + path = parts.join('/'); + if (slashed && path[0] !== '/') path = '/' + path; + else if (path.length === 0) path = '.'; + return path; +}`; +} + +const isWrappedId = (id, suffix) => id.endsWith(suffix); +const wrapId = (id, suffix) => `\0${id}${suffix}`; +const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length); + +// A proxy module when a module is required from non-wrapped CommonJS. Is different for ESM and CommonJS requires. +const PROXY_SUFFIX = '?commonjs-proxy'; +// Indicates that a required module is wrapped commonjs and needs special handling. +const WRAPPED_SUFFIX = '?commonjs-wrapped'; +// Indicates that a required module is external +const EXTERNAL_SUFFIX = '?commonjs-external'; +// A helper module that contains the exports object of a module +const EXPORTS_SUFFIX = '?commonjs-exports'; +// A helper module that contains the module object of a module, e.g. when module.exports is reassigned +const MODULE_SUFFIX = '?commonjs-module'; +// A special proxy for CommonJS entry points +const ENTRY_SUFFIX = '?commonjs-entry'; +// A proxy when wrapped ESM is required from CommonJS +const ES_IMPORT_SUFFIX = '?commonjs-es-import'; + +const DYNAMIC_MODULES_ID = '\0commonjs-dynamic-modules'; +const HELPERS_ID = '\0commonjsHelpers.js'; + +const IS_WRAPPED_COMMONJS = 'withRequireFunction'; + +// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers. +// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled. +// This could be improved by inspecting Rollup's "generatedCode" option + +const HELPERS = ` +export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +export function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +export function getDefaultExportFromNamespaceIfPresent (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n; +} + +export function getDefaultExportFromNamespaceIfNotNamed (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n; +} + +export function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} +`; + +function getHelpersModule() { + return HELPERS; +} + +function getUnknownRequireProxy(id, requireReturnsDefault) { + if (requireReturnsDefault === true || id.endsWith('.json')) { + return `export { default } from ${JSON.stringify(id)};`; + } + const name = getName(id); + const exported = + requireReturnsDefault === 'auto' + ? `import { getDefaultExportFromNamespaceIfNotNamed } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});` + : requireReturnsDefault === 'preferred' + ? `import { getDefaultExportFromNamespaceIfPresent } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});` + : !requireReturnsDefault + ? `import { getAugmentedNamespace } from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});` + : `export default ${name};`; + return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`; +} + +async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) { + const name = getName(id); + const { + meta: { commonjs: commonjsMeta } + } = await loadModule({ id }); + if (!commonjsMeta) { + return getUnknownRequireProxy(id, requireReturnsDefault); + } + if (commonjsMeta.isCommonJS) { + return `export { __moduleExports as default } from ${JSON.stringify(id)};`; + } + if (!requireReturnsDefault) { + return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify( + id + )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`; + } + if ( + requireReturnsDefault !== true && + (requireReturnsDefault === 'namespace' || + !commonjsMeta.hasDefaultExport || + (requireReturnsDefault === 'auto' && commonjsMeta.hasNamedExports)) + ) { + return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`; + } + return `export { default } from ${JSON.stringify(id)};`; +} + +function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang) { + const { + meta: { commonjs: commonjsMeta }, + hasDefaultExport + } = getModuleInfo(id); + if (!commonjsMeta || commonjsMeta.isCommonJS !== IS_WRAPPED_COMMONJS) { + const stringifiedId = JSON.stringify(id); + let code = `export * from ${stringifiedId};`; + if (hasDefaultExport) { + code += `export { default } from ${stringifiedId};`; + } + return shebang + code; + } + const result = getEsImportProxy(id, defaultIsModuleExports, true); + return { + ...result, + code: shebang + result.code + }; +} + +function getEsImportProxy(id, defaultIsModuleExports, moduleSideEffects) { + const name = getName(id); + const exportsName = `${name}Exports`; + const requireModule = `require${capitalize(name)}`; + let code = + `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\n` + + `import { __require as ${requireModule} } from ${JSON.stringify(id)};\n` + + `var ${exportsName} = ${moduleSideEffects ? '' : '/*@__PURE__*/ '}${requireModule}();\n` + + `export { ${exportsName} as __moduleExports };`; + if (defaultIsModuleExports === true) { + code += `\nexport { ${exportsName} as default };`; + } else if (defaultIsModuleExports === false) { + code += `\nexport default ${exportsName}.default;`; + } else { + code += `\nexport default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`; + } + return { + code, + syntheticNamedExports: '__moduleExports' + }; +} + +/* eslint-disable no-param-reassign, no-undefined */ + + +function getCandidatesForExtension(resolved, extension) { + return [resolved + extension, `${resolved}${sep}index${extension}`]; +} + +function getCandidates(resolved, extensions) { + return extensions.reduce( + (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)), + [resolved] + ); +} + +function resolveExtensions(importee, importer, extensions) { + // not our problem + if (importee[0] !== '.' || !importer) return undefined; + + const resolved = resolve$3(dirname$1(importer), importee); + const candidates = getCandidates(resolved, extensions); + + for (let i = 0; i < candidates.length; i += 1) { + try { + const stats = statSync(candidates[i]); + if (stats.isFile()) return { id: candidates[i] }; + } catch (err) { + /* noop */ + } + } + + return undefined; +} + +function getResolveId(extensions, isPossibleCjsId) { + const currentlyResolving = new Map(); + + return { + /** + * This is a Maps of importers to Sets of require sources being resolved at + * the moment by resolveRequireSourcesAndUpdateMeta + */ + currentlyResolving, + async resolveId(importee, importer, resolveOptions) { + const customOptions = resolveOptions.custom; + // All logic below is specific to ES imports. + // Also, if we do not skip this logic for requires that are resolved while + // transforming a commonjs file, it can easily lead to deadlocks. + if (customOptions?.['node-resolve']?.isRequire) { + return null; + } + const currentlyResolvingForParent = currentlyResolving.get(importer); + if (currentlyResolvingForParent && currentlyResolvingForParent.has(importee)) { + this.warn({ + code: 'THIS_RESOLVE_WITHOUT_OPTIONS', + message: + 'It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.\nIn rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.', + url: 'https://rollupjs.org/guide/en/#resolveid' + }); + return null; + } + + if (isWrappedId(importee, WRAPPED_SUFFIX)) { + return unwrapId(importee, WRAPPED_SUFFIX); + } + + if ( + importee.endsWith(ENTRY_SUFFIX) || + isWrappedId(importee, MODULE_SUFFIX) || + isWrappedId(importee, EXPORTS_SUFFIX) || + isWrappedId(importee, PROXY_SUFFIX) || + isWrappedId(importee, ES_IMPORT_SUFFIX) || + isWrappedId(importee, EXTERNAL_SUFFIX) || + importee.startsWith(HELPERS_ID) || + importee === DYNAMIC_MODULES_ID + ) { + return importee; + } + + if (importer) { + if ( + importer === DYNAMIC_MODULES_ID || + // Proxies are only importing resolved ids, no need to resolve again + isWrappedId(importer, PROXY_SUFFIX) || + isWrappedId(importer, ES_IMPORT_SUFFIX) || + importer.endsWith(ENTRY_SUFFIX) + ) { + return importee; + } + if (isWrappedId(importer, EXTERNAL_SUFFIX)) { + // We need to return null for unresolved imports so that the proper warning is shown + if ( + !(await this.resolve( + importee, + importer, + Object.assign({ skipSelf: true }, resolveOptions) + )) + ) { + return null; + } + // For other external imports, we need to make sure they are handled as external + return { id: importee, external: true }; + } + } + + if (importee.startsWith('\0')) { + return null; + } + + // If this is an entry point or ESM import, we need to figure out if the importee is wrapped and + // if that is the case, we need to add a proxy. + const resolved = + (await this.resolve( + importee, + importer, + Object.assign({ skipSelf: true }, resolveOptions) + )) || resolveExtensions(importee, importer, extensions); + // Make sure that even if other plugins resolve again, we ignore our own proxies + if ( + !resolved || + resolved.external || + resolved.id.endsWith(ENTRY_SUFFIX) || + isWrappedId(resolved.id, ES_IMPORT_SUFFIX) || + !isPossibleCjsId(resolved.id) + ) { + return resolved; + } + const moduleInfo = await this.load(resolved); + const { + meta: { commonjs: commonjsMeta } + } = moduleInfo; + if (commonjsMeta) { + const { isCommonJS } = commonjsMeta; + if (isCommonJS) { + if (resolveOptions.isEntry) { + moduleInfo.moduleSideEffects = true; + // We must not precede entry proxies with a `\0` as that will mess up relative external resolution + return resolved.id + ENTRY_SUFFIX; + } + if (isCommonJS === IS_WRAPPED_COMMONJS) { + return { id: wrapId(resolved.id, ES_IMPORT_SUFFIX), meta: { commonjs: { resolved } } }; + } + } + } + return resolved; + } + }; +} + +function getRequireResolver(extensions, detectCyclesAndConditional, currentlyResolving) { + const knownCjsModuleTypes = Object.create(null); + const requiredIds = Object.create(null); + const unconditionallyRequiredIds = Object.create(null); + const dependencies = Object.create(null); + const getDependencies = (id) => dependencies[id] || (dependencies[id] = new Set()); + + const isCyclic = (id) => { + const dependenciesToCheck = new Set(getDependencies(id)); + for (const dependency of dependenciesToCheck) { + if (dependency === id) { + return true; + } + for (const childDependency of getDependencies(dependency)) { + dependenciesToCheck.add(childDependency); + } + } + return false; + }; + + // Once a module is listed here, its type (wrapped or not) is fixed and may + // not change for the rest of the current build, to not break already + // transformed modules. + const fullyAnalyzedModules = Object.create(null); + + const getTypeForFullyAnalyzedModule = (id) => { + const knownType = knownCjsModuleTypes[id]; + if (knownType !== true || !detectCyclesAndConditional || fullyAnalyzedModules[id]) { + return knownType; + } + if (isCyclic(id)) { + return (knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS); + } + return knownType; + }; + + const setInitialParentType = (id, initialCommonJSType) => { + // Fully analyzed modules may never change type + if (fullyAnalyzedModules[id]) { + return; + } + knownCjsModuleTypes[id] = initialCommonJSType; + if ( + detectCyclesAndConditional && + knownCjsModuleTypes[id] === true && + requiredIds[id] && + !unconditionallyRequiredIds[id] + ) { + knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS; + } + }; + + const analyzeRequiredModule = async (parentId, resolved, isConditional, loadModule) => { + const childId = resolved.id; + requiredIds[childId] = true; + if (!(isConditional || knownCjsModuleTypes[parentId] === IS_WRAPPED_COMMONJS)) { + unconditionallyRequiredIds[childId] = true; + } + + getDependencies(parentId).add(childId); + if (!isCyclic(childId)) { + // This makes sure the current transform handler waits for all direct + // dependencies to be loaded and transformed and therefore for all + // transitive CommonJS dependencies to be loaded as well so that all + // cycles have been found and knownCjsModuleTypes is reliable. + await loadModule(resolved); + } + }; + + const getTypeForImportedModule = async (resolved, loadModule) => { + if (resolved.id in knownCjsModuleTypes) { + // This handles cyclic ES dependencies + return knownCjsModuleTypes[resolved.id]; + } + const { + meta: { commonjs } + } = await loadModule(resolved); + return (commonjs && commonjs.isCommonJS) || false; + }; + + return { + getWrappedIds: () => + Object.keys(knownCjsModuleTypes).filter( + (id) => knownCjsModuleTypes[id] === IS_WRAPPED_COMMONJS + ), + isRequiredId: (id) => requiredIds[id], + async shouldTransformCachedModule({ + id: parentId, + resolvedSources, + meta: { commonjs: parentMeta } + }) { + // We explicitly track ES modules to handle circular imports + if (!(parentMeta && parentMeta.isCommonJS)) knownCjsModuleTypes[parentId] = false; + if (isWrappedId(parentId, ES_IMPORT_SUFFIX)) return false; + const parentRequires = parentMeta && parentMeta.requires; + if (parentRequires) { + setInitialParentType(parentId, parentMeta.initialCommonJSType); + await Promise.all( + parentRequires.map(({ resolved, isConditional }) => + analyzeRequiredModule(parentId, resolved, isConditional, this.load) + ) + ); + if (getTypeForFullyAnalyzedModule(parentId) !== parentMeta.isCommonJS) { + return true; + } + for (const { + resolved: { id } + } of parentRequires) { + if (getTypeForFullyAnalyzedModule(id) !== parentMeta.isRequiredCommonJS[id]) { + return true; + } + } + // Now that we decided to go with the cached copy, neither the parent + // module nor any of its children may change types anymore + fullyAnalyzedModules[parentId] = true; + for (const { + resolved: { id } + } of parentRequires) { + fullyAnalyzedModules[id] = true; + } + } + const parentRequireSet = new Set((parentRequires || []).map(({ resolved: { id } }) => id)); + return ( + await Promise.all( + Object.keys(resolvedSources) + .map((source) => resolvedSources[source]) + .filter(({ id, external }) => !(external || parentRequireSet.has(id))) + .map(async (resolved) => { + if (isWrappedId(resolved.id, ES_IMPORT_SUFFIX)) { + return ( + (await getTypeForImportedModule( + ( + await this.load({ id: resolved.id }) + ).meta.commonjs.resolved, + this.load + )) !== IS_WRAPPED_COMMONJS + ); + } + return (await getTypeForImportedModule(resolved, this.load)) === IS_WRAPPED_COMMONJS; + }) + ) + ).some((shouldTransform) => shouldTransform); + }, + /* eslint-disable no-param-reassign */ + resolveRequireSourcesAndUpdateMeta: + (rollupContext) => async (parentId, isParentCommonJS, parentMeta, sources) => { + parentMeta.initialCommonJSType = isParentCommonJS; + parentMeta.requires = []; + parentMeta.isRequiredCommonJS = Object.create(null); + setInitialParentType(parentId, isParentCommonJS); + const currentlyResolvingForParent = currentlyResolving.get(parentId) || new Set(); + currentlyResolving.set(parentId, currentlyResolvingForParent); + const requireTargets = await Promise.all( + sources.map(async ({ source, isConditional }) => { + // Never analyze or proxy internal modules + if (source.startsWith('\0')) { + return { id: source, allowProxy: false }; + } + currentlyResolvingForParent.add(source); + const resolved = + (await rollupContext.resolve(source, parentId, { + skipSelf: false, + custom: { 'node-resolve': { isRequire: true } } + })) || resolveExtensions(source, parentId, extensions); + currentlyResolvingForParent.delete(source); + if (!resolved) { + return { id: wrapId(source, EXTERNAL_SUFFIX), allowProxy: false }; + } + const childId = resolved.id; + if (resolved.external) { + return { id: wrapId(childId, EXTERNAL_SUFFIX), allowProxy: false }; + } + parentMeta.requires.push({ resolved, isConditional }); + await analyzeRequiredModule(parentId, resolved, isConditional, rollupContext.load); + return { id: childId, allowProxy: true }; + }) + ); + parentMeta.isCommonJS = getTypeForFullyAnalyzedModule(parentId); + fullyAnalyzedModules[parentId] = true; + return requireTargets.map(({ id: dependencyId, allowProxy }, index) => { + // eslint-disable-next-line no-multi-assign + const isCommonJS = (parentMeta.isRequiredCommonJS[dependencyId] = + getTypeForFullyAnalyzedModule(dependencyId)); + const isWrappedCommonJS = isCommonJS === IS_WRAPPED_COMMONJS; + fullyAnalyzedModules[dependencyId] = true; + return { + wrappedModuleSideEffects: + isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects, + source: sources[index].source, + id: allowProxy + ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) + : dependencyId, + isCommonJS + }; + }); + }, + isCurrentlyResolving(source, parentId) { + const currentlyResolvingForParent = currentlyResolving.get(parentId); + return currentlyResolvingForParent && currentlyResolvingForParent.has(source); + } + }; +} + +function validateVersion(actualVersion, peerDependencyVersion, name) { + const versionRegexp = /\^(\d+\.\d+\.\d+)/g; + let minMajor = Infinity; + let minMinor = Infinity; + let minPatch = Infinity; + let foundVersion; + // eslint-disable-next-line no-cond-assign + while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) { + const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split('.').map(Number); + if (foundMajor < minMajor) { + minMajor = foundMajor; + minMinor = foundMinor; + minPatch = foundPatch; + } + } + if (!actualVersion) { + throw new Error( + `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch}.` + ); + } + const [major, minor, patch] = actualVersion.split('.').map(Number); + if ( + major < minMajor || + (major === minMajor && (minor < minMinor || (minor === minMinor && patch < minPatch))) + ) { + throw new Error( + `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch} but found ${name}@${actualVersion}.` + ); + } +} + +const operators = { + '==': (x) => equals(x.left, x.right, false), + + '!=': (x) => not(operators['=='](x)), + + '===': (x) => equals(x.left, x.right, true), + + '!==': (x) => not(operators['==='](x)), + + '!': (x) => isFalsy(x.argument), + + '&&': (x) => isTruthy(x.left) && isTruthy(x.right), + + '||': (x) => isTruthy(x.left) || isTruthy(x.right) +}; + +function not(value) { + return value === null ? value : !value; +} + +function equals(a, b, strict) { + if (a.type !== b.type) return null; + // eslint-disable-next-line eqeqeq + if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value; + return null; +} + +function isTruthy(node) { + if (!node) return false; + if (node.type === 'Literal') return !!node.value; + if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression); + if (node.operator in operators) return operators[node.operator](node); + return null; +} + +function isFalsy(node) { + return not(isTruthy(node)); +} + +function getKeypath(node) { + const parts = []; + + while (node.type === 'MemberExpression') { + if (node.computed) return null; + + parts.unshift(node.property.name); + // eslint-disable-next-line no-param-reassign + node = node.object; + } + + if (node.type !== 'Identifier') return null; + + const { name } = node; + parts.unshift(name); + + return { name, keypath: parts.join('.') }; +} + +const KEY_COMPILED_ESM = '__esModule'; + +function getDefineCompiledEsmType(node) { + const definedPropertyWithExports = getDefinePropertyCallName(node, 'exports'); + const definedProperty = + definedPropertyWithExports || getDefinePropertyCallName(node, 'module.exports'); + if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) { + return isTruthy(definedProperty.value) + ? definedPropertyWithExports + ? 'exports' + : 'module' + : false; + } + return false; +} + +function getDefinePropertyCallName(node, targetName) { + const { + callee: { object, property } + } = node; + if (!object || object.type !== 'Identifier' || object.name !== 'Object') return; + if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return; + if (node.arguments.length !== 3) return; + + const targetNames = targetName.split('.'); + const [target, key, value] = node.arguments; + if (targetNames.length === 1) { + if (target.type !== 'Identifier' || target.name !== targetNames[0]) { + return; + } + } + + if (targetNames.length === 2) { + if ( + target.type !== 'MemberExpression' || + target.object.name !== targetNames[0] || + target.property.name !== targetNames[1] + ) { + return; + } + } + + if (value.type !== 'ObjectExpression' || !value.properties) return; + + const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value'); + if (!valueProperty || !valueProperty.value) return; + + // eslint-disable-next-line consistent-return + return { key: key.value, value: valueProperty.value }; +} + +function isShorthandProperty(parent) { + return parent && parent.type === 'Property' && parent.shorthand; +} + +function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) { + const args = []; + const passedArgs = []; + if (uses.module) { + args.push('module'); + passedArgs.push(moduleName); + } + if (uses.exports) { + args.push('exports'); + passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName); + } + magicString + .trim() + .indent('\t', { exclude: indentExclusionRanges }) + .prepend(`(function (${args.join(', ')}) {\n`) + // For some reason, this line is only indented correctly when using a + // require-wrapper if we have this leading space + .append(` \n} (${passedArgs.join(', ')}));`); +} + +function rewriteExportsAndGetExportsBlock( + magicString, + moduleName, + exportsName, + exportedExportsName, + wrapped, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsAssignmentsByName, + topLevelAssignments, + defineCompiledEsmExpressions, + deconflictedExportNames, + code, + HELPERS_NAME, + exportMode, + defaultIsModuleExports, + usesRequireWrapper, + requireName +) { + const exports = []; + const exportDeclarations = []; + + if (usesRequireWrapper) { + getExportsWhenUsingRequireWrapper( + magicString, + wrapped, + exportMode, + exports, + moduleExportsAssignments, + exportsAssignmentsByName, + moduleName, + exportsName, + requireName, + defineCompiledEsmExpressions + ); + } else if (exportMode === 'replace') { + getExportsForReplacedModuleExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsName, + defaultIsModuleExports, + HELPERS_NAME + ); + } else { + if (exportMode === 'module') { + exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`); + exports.push(`${exportedExportsName} as __moduleExports`); + } else { + exports.push(`${exportsName} as __moduleExports`); + } + if (wrapped) { + exportDeclarations.push( + getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) + ); + } else { + getExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + exportsAssignmentsByName, + deconflictedExportNames, + topLevelAssignments, + moduleName, + exportsName, + exportedExportsName, + defineCompiledEsmExpressions, + HELPERS_NAME, + defaultIsModuleExports, + exportMode + ); + } + } + if (exports.length) { + exportDeclarations.push(`export { ${exports.join(', ')} }`); + } + + return `\n\n${exportDeclarations.join(';\n')};`; +} + +function getExportsWhenUsingRequireWrapper( + magicString, + wrapped, + exportMode, + exports, + moduleExportsAssignments, + exportsAssignmentsByName, + moduleName, + exportsName, + requireName, + defineCompiledEsmExpressions +) { + exports.push(`${requireName} as __require`); + if (wrapped) return; + if (exportMode === 'replace') { + rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName); + } else { + rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`); + // Collect and rewrite named exports + for (const [exportName, { nodes }] of exportsAssignmentsByName) { + for (const { node, type } of nodes) { + magicString.overwrite( + node.start, + node.left.end, + `${ + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + }.${exportName}` + ); + } + } + replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName + ); + } +} + +function getExportsForReplacedModuleExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsName, + defaultIsModuleExports, + HELPERS_NAME +) { + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, exportsName); + } + magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, 'var '); + exports.push(`${exportsName} as __moduleExports`); + exportDeclarations.push( + getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME) + ); +} + +function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) { + return `export default ${ + defaultIsModuleExports === true + ? exportedExportsName + : defaultIsModuleExports === false + ? `${exportedExportsName}.default` + : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})` + }`; +} + +function getExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + exportsAssignmentsByName, + deconflictedExportNames, + topLevelAssignments, + moduleName, + exportsName, + exportedExportsName, + defineCompiledEsmExpressions, + HELPERS_NAME, + defaultIsModuleExports, + exportMode +) { + let deconflictedDefaultExportName; + // Collect and rewrite module.exports assignments + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, `${moduleName}.exports`); + } + + // Collect and rewrite named exports + for (const [exportName, { nodes }] of exportsAssignmentsByName) { + const deconflicted = deconflictedExportNames[exportName]; + let needsDeclaration = true; + for (const { node, type } of nodes) { + let replacement = `${deconflicted} = ${ + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + }.${exportName}`; + if (needsDeclaration && topLevelAssignments.has(node)) { + replacement = `var ${replacement}`; + needsDeclaration = false; + } + magicString.overwrite(node.start, node.left.end, replacement); + } + if (needsDeclaration) { + magicString.prepend(`var ${deconflicted};\n`); + } + + if (exportName === 'default') { + deconflictedDefaultExportName = deconflicted; + } else { + exports.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`); + } + } + + const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName + ); + + if ( + defaultIsModuleExports === false || + (defaultIsModuleExports === 'auto' && + isRestorableCompiledEsm && + moduleExportsAssignments.length === 0) + ) { + // If there is no deconflictedDefaultExportName, then we use the namespace as + // fallback because there can be no "default" property on the namespace + exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`); + } else if ( + defaultIsModuleExports === true || + (!isRestorableCompiledEsm && moduleExportsAssignments.length === 0) + ) { + exports.push(`${exportedExportsName} as default`); + } else { + exportDeclarations.push( + getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) + ); + } +} + +function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) { + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, exportsName); + } +} + +function replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName +) { + let isRestorableCompiledEsm = false; + for (const { node, type } of defineCompiledEsmExpressions) { + isRestorableCompiledEsm = true; + const moduleExportsExpression = + node.type === 'CallExpression' ? node.arguments[0] : node.left.object; + magicString.overwrite( + moduleExportsExpression.start, + moduleExportsExpression.end, + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + ); + } + return isRestorableCompiledEsm; +} + +function isRequireExpression(node, scope) { + if (!node) return false; + if (node.type !== 'CallExpression') return false; + + // Weird case of `require()` or `module.require()` without arguments + if (node.arguments.length === 0) return false; + + return isRequire(node.callee, scope); +} + +function isRequire(node, scope) { + return ( + (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) || + (node.type === 'MemberExpression' && isModuleRequire(node, scope)) + ); +} + +function isModuleRequire({ object, property }, scope) { + return ( + object.type === 'Identifier' && + object.name === 'module' && + property.type === 'Identifier' && + property.name === 'require' && + !scope.contains('module') + ); +} + +function hasDynamicArguments(node) { + return ( + node.arguments.length > 1 || + (node.arguments[0].type !== 'Literal' && + (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0)) + ); +} + +const reservedMethod = { resolve: true, cache: true, main: true }; + +function isNodeRequirePropertyAccess(parent) { + return parent && parent.property && reservedMethod[parent.property.name]; +} + +function getRequireStringArg(node) { + return node.arguments[0].type === 'Literal' + ? node.arguments[0].value + : node.arguments[0].quasis[0].value.cooked; +} + +function getRequireHandlers() { + const requireExpressions = []; + + function addRequireExpression( + sourceId, + node, + scope, + usesReturnValue, + isInsideTryBlock, + isInsideConditional, + toBeRemoved + ) { + requireExpressions.push({ + sourceId, + node, + scope, + usesReturnValue, + isInsideTryBlock, + isInsideConditional, + toBeRemoved + }); + } + + async function rewriteRequireExpressionsAndGetImportBlock( + magicString, + topLevelDeclarations, + reassignedNames, + helpersName, + dynamicRequireName, + moduleName, + exportsName, + id, + exportMode, + resolveRequireSourcesAndUpdateMeta, + needsRequireWrapper, + isEsModule, + isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + commonjsMeta + ) { + const imports = []; + imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`); + if (dynamicRequireName) { + imports.push( + `import { ${ + isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT + } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"` + ); + } + if (exportMode === 'module') { + imports.push( + `import { __module as ${moduleName} } from ${JSON.stringify(wrapId(id, MODULE_SUFFIX))}`, + `var ${exportsName} = ${moduleName}.exports` + ); + } else if (exportMode === 'exports') { + imports.push( + `import { __exports as ${exportsName} } from ${JSON.stringify(wrapId(id, EXPORTS_SUFFIX))}` + ); + } + const requiresBySource = collectSources(requireExpressions); + const requireTargets = await resolveRequireSourcesAndUpdateMeta( + id, + needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, + commonjsMeta, + Object.keys(requiresBySource).map((source) => { + return { + source, + isConditional: requiresBySource[source].every((require) => require.isInsideConditional) + }; + }) + ); + processRequireExpressions( + imports, + requireTargets, + requiresBySource, + getIgnoreTryCatchRequireStatementMode, + magicString + ); + return imports.length ? `${imports.join(';\n')};\n\n` : ''; + } + + return { + addRequireExpression, + rewriteRequireExpressionsAndGetImportBlock + }; +} + +function collectSources(requireExpressions) { + const requiresBySource = Object.create(null); + for (const requireExpression of requireExpressions) { + const { sourceId } = requireExpression; + if (!requiresBySource[sourceId]) { + requiresBySource[sourceId] = []; + } + const requires = requiresBySource[sourceId]; + requires.push(requireExpression); + } + return requiresBySource; +} + +function processRequireExpressions( + imports, + requireTargets, + requiresBySource, + getIgnoreTryCatchRequireStatementMode, + magicString +) { + const generateRequireName = getGenerateRequireName(); + for (const { source, id: resolvedId, isCommonJS, wrappedModuleSideEffects } of requireTargets) { + const requires = requiresBySource[source]; + const name = generateRequireName(requires); + let usesRequired = false; + let needsImport = false; + for (const { node, usesReturnValue, toBeRemoved, isInsideTryBlock } of requires) { + const { canConvertRequire, shouldRemoveRequire } = + isInsideTryBlock && isWrappedId(resolvedId, EXTERNAL_SUFFIX) + ? getIgnoreTryCatchRequireStatementMode(source) + : { canConvertRequire: true, shouldRemoveRequire: false }; + if (shouldRemoveRequire) { + if (usesReturnValue) { + magicString.overwrite(node.start, node.end, 'undefined'); + } else { + magicString.remove(toBeRemoved.start, toBeRemoved.end); + } + } else if (canConvertRequire) { + needsImport = true; + if (isCommonJS === IS_WRAPPED_COMMONJS) { + magicString.overwrite( + node.start, + node.end, + `${wrappedModuleSideEffects ? '' : '/*@__PURE__*/ '}${name}()` + ); + } else if (usesReturnValue) { + usesRequired = true; + magicString.overwrite(node.start, node.end, name); + } else { + magicString.remove(toBeRemoved.start, toBeRemoved.end); + } + } + } + if (needsImport) { + if (isCommonJS === IS_WRAPPED_COMMONJS) { + imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`); + } else { + imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)}`); + } + } + } +} + +function getGenerateRequireName() { + let uid = 0; + return (requires) => { + let name; + const hasNameConflict = ({ scope }) => scope.contains(name); + do { + name = `require$$${uid}`; + uid += 1; + } while (requires.some(hasNameConflict)); + return name; + }; +} + +/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */ + + +const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/; + +const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/; + +// There are three different types of CommonJS modules, described by their +// "exportMode": +// - exports: Only assignments to (module.)exports properties +// - replace: A single assignment to module.exports itself +// - module: Anything else +// Special cases: +// - usesRequireWrapper +// - isWrapped +async function transformCommonjs( + parse, + code, + id, + isEsModule, + ignoreGlobal, + ignoreRequire, + ignoreDynamicRequires, + getIgnoreTryCatchRequireStatementMode, + sourceMap, + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + astCache, + defaultIsModuleExports, + needsRequireWrapper, + resolveRequireSourcesAndUpdateMeta, + isRequired, + checkDynamicRequire, + commonjsMeta +) { + const ast = astCache || tryParse(parse, code, id); + const magicString = new MagicString(code); + const uses = { + module: false, + exports: false, + global: false, + require: false + }; + const virtualDynamicRequirePath = + isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname$1(id), commonDir); + let scope = attachScopes(ast, 'scope'); + let lexicalDepth = 0; + let programDepth = 0; + let classBodyDepth = 0; + let currentTryBlockEnd = null; + let shouldWrap = false; + + const globals = new Set(); + // A conditionalNode is a node for which execution is not guaranteed. If such a node is a require + // or contains nested requires, those should be handled as function calls unless there is an + // unconditional require elsewhere. + let currentConditionalNodeEnd = null; + const conditionalNodes = new Set(); + const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers(); + + // See which names are assigned to. This is necessary to prevent + // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`, + // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh) + const reassignedNames = new Set(); + const topLevelDeclarations = []; + const skippedNodes = new Set(); + const moduleAccessScopes = new Set([scope]); + const exportsAccessScopes = new Set([scope]); + const moduleExportsAssignments = []; + let firstTopLevelModuleExportsAssignment = null; + const exportsAssignmentsByName = new Map(); + const topLevelAssignments = new Set(); + const topLevelDefineCompiledEsmExpressions = []; + const replacedGlobal = []; + const replacedThis = []; + const replacedDynamicRequires = []; + const importedVariables = new Set(); + const indentExclusionRanges = []; + + walk$2(ast, { + enter(node, parent) { + if (skippedNodes.has(node)) { + this.skip(); + return; + } + + if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) { + currentTryBlockEnd = null; + } + if (currentConditionalNodeEnd !== null && node.start > currentConditionalNodeEnd) { + currentConditionalNodeEnd = null; + } + if (currentConditionalNodeEnd === null && conditionalNodes.has(node)) { + currentConditionalNodeEnd = node.end; + } + + programDepth += 1; + if (node.scope) ({ scope } = node); + if (functionType.test(node.type)) lexicalDepth += 1; + if (sourceMap) { + magicString.addSourcemapLocation(node.start); + magicString.addSourcemapLocation(node.end); + } + + // eslint-disable-next-line default-case + switch (node.type) { + case 'AssignmentExpression': + if (node.left.type === 'MemberExpression') { + const flattened = getKeypath(node.left); + if (!flattened || scope.contains(flattened.name)) return; + + const exportsPatternMatch = exportsPattern.exec(flattened.keypath); + if (!exportsPatternMatch || flattened.keypath === 'exports') return; + + const [, exportName] = exportsPatternMatch; + uses[flattened.name] = true; + + // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` – + if (flattened.keypath === 'module.exports') { + moduleExportsAssignments.push(node); + if (programDepth > 3) { + moduleAccessScopes.add(scope); + } else if (!firstTopLevelModuleExportsAssignment) { + firstTopLevelModuleExportsAssignment = node; + } + } else if (exportName === KEY_COMPILED_ESM) { + if (programDepth > 3) { + shouldWrap = true; + } else { + // The "type" is either "module" or "exports" to discern + // assignments to module.exports vs exports if needed + topLevelDefineCompiledEsmExpressions.push({ node, type: flattened.name }); + } + } else { + const exportsAssignments = exportsAssignmentsByName.get(exportName) || { + nodes: [], + scopes: new Set() + }; + exportsAssignments.nodes.push({ node, type: flattened.name }); + exportsAssignments.scopes.add(scope); + exportsAccessScopes.add(scope); + exportsAssignmentsByName.set(exportName, exportsAssignments); + if (programDepth <= 3) { + topLevelAssignments.add(node); + } + } + + skippedNodes.add(node.left); + } else { + for (const name of extractAssignedNames(node.left)) { + reassignedNames.add(name); + } + } + return; + case 'CallExpression': { + const defineCompiledEsmType = getDefineCompiledEsmType(node); + if (defineCompiledEsmType) { + if (programDepth === 3 && parent.type === 'ExpressionStatement') { + // skip special handling for [module.]exports until we know we render this + skippedNodes.add(node.arguments[0]); + topLevelDefineCompiledEsmExpressions.push({ node, type: defineCompiledEsmType }); + } else { + shouldWrap = true; + } + return; + } + + // Transform require.resolve + if ( + isDynamicRequireModulesEnabled && + node.callee.object && + isRequire(node.callee.object, scope) && + node.callee.property.name === 'resolve' + ) { + checkDynamicRequire(node.start); + uses.require = true; + const requireNode = node.callee.object; + replacedDynamicRequires.push(requireNode); + skippedNodes.add(node.callee); + return; + } + + if (!isRequireExpression(node, scope)) { + const keypath = getKeypath(node.callee); + if (keypath && importedVariables.has(keypath.name)) { + // Heuristic to deoptimize requires after a required function has been called + currentConditionalNodeEnd = Infinity; + } + return; + } + + skippedNodes.add(node.callee); + uses.require = true; + + if (hasDynamicArguments(node)) { + if (isDynamicRequireModulesEnabled) { + checkDynamicRequire(node.start); + } + if (!ignoreDynamicRequires) { + replacedDynamicRequires.push(node.callee); + } + return; + } + + const requireStringArg = getRequireStringArg(node); + if (!ignoreRequire(requireStringArg)) { + const usesReturnValue = parent.type !== 'ExpressionStatement'; + const toBeRemoved = + parent.type === 'ExpressionStatement' && + (!currentConditionalNodeEnd || + // We should completely remove requires directly in a try-catch + // so that Rollup can remove up the try-catch + (currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd)) + ? parent + : node; + addRequireExpression( + requireStringArg, + node, + scope, + usesReturnValue, + currentTryBlockEnd !== null, + currentConditionalNodeEnd !== null, + toBeRemoved + ); + if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') { + for (const name of extractAssignedNames(parent.id)) { + importedVariables.add(name); + } + } + } + return; + } + case 'ClassBody': + classBodyDepth += 1; + return; + case 'ConditionalExpression': + case 'IfStatement': + // skip dead branches + if (isFalsy(node.test)) { + skippedNodes.add(node.consequent); + } else if (isTruthy(node.test)) { + if (node.alternate) { + skippedNodes.add(node.alternate); + } + } else { + conditionalNodes.add(node.consequent); + if (node.alternate) { + conditionalNodes.add(node.alternate); + } + } + return; + case 'ArrowFunctionExpression': + case 'FunctionDeclaration': + case 'FunctionExpression': + // requires in functions should be conditional unless it is an IIFE + if ( + currentConditionalNodeEnd === null && + !(parent.type === 'CallExpression' && parent.callee === node) + ) { + currentConditionalNodeEnd = node.end; + } + return; + case 'Identifier': { + const { name } = node; + if ( + !isReference(node, parent) || + scope.contains(name) || + (parent.type === 'PropertyDefinition' && parent.key === node) + ) + return; + switch (name) { + case 'require': + uses.require = true; + if (isNodeRequirePropertyAccess(parent)) { + return; + } + if (!ignoreDynamicRequires) { + if (isShorthandProperty(parent)) { + // as key and value are the same object, isReference regards + // both as references, so we need to skip now + skippedNodes.add(parent.value); + magicString.prependRight(node.start, 'require: '); + } + replacedDynamicRequires.push(node); + } + return; + case 'module': + case 'exports': + shouldWrap = true; + uses[name] = true; + return; + case 'global': + uses.global = true; + if (!ignoreGlobal) { + replacedGlobal.push(node); + } + return; + case 'define': + magicString.overwrite(node.start, node.end, 'undefined', { + storeName: true + }); + return; + default: + globals.add(name); + return; + } + } + case 'LogicalExpression': + // skip dead branches + if (node.operator === '&&') { + if (isFalsy(node.left)) { + skippedNodes.add(node.right); + } else if (!isTruthy(node.left)) { + conditionalNodes.add(node.right); + } + } else if (node.operator === '||') { + if (isTruthy(node.left)) { + skippedNodes.add(node.right); + } else if (!isFalsy(node.left)) { + conditionalNodes.add(node.right); + } + } + return; + case 'MemberExpression': + if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) { + uses.require = true; + replacedDynamicRequires.push(node); + skippedNodes.add(node.object); + skippedNodes.add(node.property); + } + return; + case 'ReturnStatement': + // if top-level return, we need to wrap it + if (lexicalDepth === 0) { + shouldWrap = true; + } + return; + case 'ThisExpression': + // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal` + if (lexicalDepth === 0 && !classBodyDepth) { + uses.global = true; + if (!ignoreGlobal) { + replacedThis.push(node); + } + } + return; + case 'TryStatement': + if (currentTryBlockEnd === null) { + currentTryBlockEnd = node.block.end; + } + if (currentConditionalNodeEnd === null) { + currentConditionalNodeEnd = node.end; + } + return; + case 'UnaryExpression': + // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151) + if (node.operator === 'typeof') { + const flattened = getKeypath(node.argument); + if (!flattened) return; + + if (scope.contains(flattened.name)) return; + + if ( + !isEsModule && + (flattened.keypath === 'module.exports' || + flattened.keypath === 'module' || + flattened.keypath === 'exports') + ) { + magicString.overwrite(node.start, node.end, `'object'`, { + storeName: false + }); + } + } + return; + case 'VariableDeclaration': + if (!scope.parent) { + topLevelDeclarations.push(node); + } + return; + case 'TemplateElement': + if (node.value.raw.includes('\n')) { + indentExclusionRanges.push([node.start, node.end]); + } + } + }, + + leave(node) { + programDepth -= 1; + if (node.scope) scope = scope.parent; + if (functionType.test(node.type)) lexicalDepth -= 1; + if (node.type === 'ClassBody') classBodyDepth -= 1; + } + }); + + const nameBase = getName(id); + const exportsName = deconflict([...exportsAccessScopes], globals, nameBase); + const moduleName = deconflict([...moduleAccessScopes], globals, `${nameBase}Module`); + const requireName = deconflict([scope], globals, `require${capitalize(nameBase)}`); + const isRequiredName = deconflict([scope], globals, `hasRequired${capitalize(nameBase)}`); + const helpersName = deconflict([scope], globals, 'commonjsHelpers'); + const dynamicRequireName = + replacedDynamicRequires.length > 0 && + deconflict( + [scope], + globals, + isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT + ); + const deconflictedExportNames = Object.create(null); + for (const [exportName, { scopes }] of exportsAssignmentsByName) { + deconflictedExportNames[exportName] = deconflict([...scopes], globals, exportName); + } + + for (const node of replacedGlobal) { + magicString.overwrite(node.start, node.end, `${helpersName}.commonjsGlobal`, { + storeName: true + }); + } + for (const node of replacedThis) { + magicString.overwrite(node.start, node.end, exportsName, { + storeName: true + }); + } + for (const node of replacedDynamicRequires) { + magicString.overwrite( + node.start, + node.end, + isDynamicRequireModulesEnabled + ? `${dynamicRequireName}(${JSON.stringify(virtualDynamicRequirePath)})` + : dynamicRequireName, + { + contentOnly: true, + storeName: true + } + ); + } + + // We cannot wrap ES/mixed modules + shouldWrap = !isEsModule && (shouldWrap || (uses.exports && moduleExportsAssignments.length > 0)); + + if ( + !( + shouldWrap || + isRequired || + needsRequireWrapper || + uses.module || + uses.exports || + uses.require || + topLevelDefineCompiledEsmExpressions.length > 0 + ) && + (ignoreGlobal || !uses.global) + ) { + return { meta: { commonjs: { isCommonJS: false } } }; + } + + let leadingComment = ''; + if (code.startsWith('/*')) { + const commentEnd = code.indexOf('*/', 2) + 2; + leadingComment = `${code.slice(0, commentEnd)}\n`; + magicString.remove(0, commentEnd).trim(); + } + + let shebang = ''; + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n') + 1; + shebang = code.slice(0, shebangEndPosition); + magicString.remove(0, shebangEndPosition).trim(); + } + + const exportMode = isEsModule + ? 'none' + : shouldWrap + ? uses.module + ? 'module' + : 'exports' + : firstTopLevelModuleExportsAssignment + ? exportsAssignmentsByName.size === 0 && topLevelDefineCompiledEsmExpressions.length === 0 + ? 'replace' + : 'module' + : moduleExportsAssignments.length === 0 + ? 'exports' + : 'module'; + + const exportedExportsName = + exportMode === 'module' ? deconflict([], globals, `${nameBase}Exports`) : exportsName; + + const importBlock = await rewriteRequireExpressionsAndGetImportBlock( + magicString, + topLevelDeclarations, + reassignedNames, + helpersName, + dynamicRequireName, + moduleName, + exportsName, + id, + exportMode, + resolveRequireSourcesAndUpdateMeta, + needsRequireWrapper, + isEsModule, + isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + commonjsMeta + ); + const usesRequireWrapper = commonjsMeta.isCommonJS === IS_WRAPPED_COMMONJS; + const exportBlock = isEsModule + ? '' + : rewriteExportsAndGetExportsBlock( + magicString, + moduleName, + exportsName, + exportedExportsName, + shouldWrap, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsAssignmentsByName, + topLevelAssignments, + topLevelDefineCompiledEsmExpressions, + deconflictedExportNames, + code, + helpersName, + exportMode, + defaultIsModuleExports, + usesRequireWrapper, + requireName + ); + + if (shouldWrap) { + wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges); + } + + if (usesRequireWrapper) { + magicString.trim().indent('\t', { + exclude: indentExclusionRanges + }); + const exported = exportMode === 'module' ? `${moduleName}.exports` : exportsName; + magicString.prepend( + `var ${isRequiredName}; + +function ${requireName} () { +\tif (${isRequiredName}) return ${exported}; +\t${isRequiredName} = 1; +` + ).append(` +\treturn ${exported}; +}`); + if (exportMode === 'replace') { + magicString.prepend(`var ${exportsName};\n`); + } + } + + magicString + .trim() + .prepend(shebang + leadingComment + importBlock) + .append(exportBlock); + + return { + code: magicString.toString(), + map: sourceMap ? magicString.generateMap() : null, + syntheticNamedExports: isEsModule || usesRequireWrapper ? false : '__moduleExports', + meta: { commonjs: { ...commonjsMeta, shebang } } + }; +} + +const PLUGIN_NAME = 'commonjs'; + +function commonjs(options = {}) { + const { + ignoreGlobal, + ignoreDynamicRequires, + requireReturnsDefault: requireReturnsDefaultOption, + defaultIsModuleExports: defaultIsModuleExportsOption, + esmExternals + } = options; + const extensions = options.extensions || ['.js']; + const filter = createFilter$1(options.include, options.exclude); + const isPossibleCjsId = (id) => { + const extName = extname(id); + return extName === '.cjs' || (extensions.includes(extName) && filter(id)); + }; + + const { strictRequiresFilter, detectCyclesAndConditional } = getStrictRequiresFilter(options); + + const getRequireReturnsDefault = + typeof requireReturnsDefaultOption === 'function' + ? requireReturnsDefaultOption + : () => requireReturnsDefaultOption; + + let esmExternalIds; + const isEsmExternal = + typeof esmExternals === 'function' + ? esmExternals + : Array.isArray(esmExternals) + ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id)) + : () => esmExternals; + + const getDefaultIsModuleExports = + typeof defaultIsModuleExportsOption === 'function' + ? defaultIsModuleExportsOption + : () => + typeof defaultIsModuleExportsOption === 'boolean' ? defaultIsModuleExportsOption : 'auto'; + + const dynamicRequireRoot = + typeof options.dynamicRequireRoot === 'string' + ? resolve$3(options.dynamicRequireRoot) + : process.cwd(); + const { commonDir, dynamicRequireModules } = getDynamicRequireModules( + options.dynamicRequireTargets, + dynamicRequireRoot + ); + const isDynamicRequireModulesEnabled = dynamicRequireModules.size > 0; + + const ignoreRequire = + typeof options.ignore === 'function' + ? options.ignore + : Array.isArray(options.ignore) + ? (id) => options.ignore.includes(id) + : () => false; + + const getIgnoreTryCatchRequireStatementMode = (id) => { + const mode = + typeof options.ignoreTryCatch === 'function' + ? options.ignoreTryCatch(id) + : Array.isArray(options.ignoreTryCatch) + ? options.ignoreTryCatch.includes(id) + : typeof options.ignoreTryCatch !== 'undefined' + ? options.ignoreTryCatch + : true; + + return { + canConvertRequire: mode !== 'remove' && mode !== true, + shouldRemoveRequire: mode === 'remove' + }; + }; + + const { currentlyResolving, resolveId } = getResolveId(extensions, isPossibleCjsId); + + const sourceMap = options.sourceMap !== false; + + // Initialized in buildStart + let requireResolver; + + function transformAndCheckExports(code, id) { + const normalizedId = normalizePathSlashes(id); + const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements( + this.parse, + code, + id + ); + + const commonjsMeta = this.getModuleInfo(id).meta.commonjs || {}; + if (hasDefaultExport) { + commonjsMeta.hasDefaultExport = true; + } + if (hasNamedExports) { + commonjsMeta.hasNamedExports = true; + } + + if ( + !dynamicRequireModules.has(normalizedId) && + (!(hasCjsKeywords(code, ignoreGlobal) || requireResolver.isRequiredId(id)) || + (isEsModule && !options.transformMixedEsModules)) + ) { + commonjsMeta.isCommonJS = false; + return { meta: { commonjs: commonjsMeta } }; + } + + const needsRequireWrapper = + !isEsModule && (dynamicRequireModules.has(normalizedId) || strictRequiresFilter(id)); + + const checkDynamicRequire = (position) => { + const normalizedDynamicRequireRoot = normalizePathSlashes(dynamicRequireRoot); + + if (normalizedId.indexOf(normalizedDynamicRequireRoot) !== 0) { + this.error( + { + code: 'DYNAMIC_REQUIRE_OUTSIDE_ROOT', + normalizedId, + normalizedDynamicRequireRoot, + message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedDynamicRequireRoot}". You should set dynamicRequireRoot to "${dirname$1( + normalizedId + )}" or one of its parent directories.` + }, + position + ); + } + }; + + return transformCommonjs( + this.parse, + code, + id, + isEsModule, + ignoreGlobal || isEsModule, + ignoreRequire, + ignoreDynamicRequires && !isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + sourceMap, + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ast, + getDefaultIsModuleExports(id), + needsRequireWrapper, + requireResolver.resolveRequireSourcesAndUpdateMeta(this), + requireResolver.isRequiredId(id), + checkDynamicRequire, + commonjsMeta + ); + } + + return { + name: PLUGIN_NAME, + + version: version$2, + + options(rawOptions) { + // We inject the resolver in the beginning so that "catch-all-resolver" like node-resolver + // do not prevent our plugin from resolving entry points ot proxies. + const plugins = Array.isArray(rawOptions.plugins) + ? [...rawOptions.plugins] + : rawOptions.plugins + ? [rawOptions.plugins] + : []; + plugins.unshift({ + name: 'commonjs--resolver', + resolveId + }); + return { ...rawOptions, plugins }; + }, + + buildStart({ plugins }) { + validateVersion(this.meta.rollupVersion, peerDependencies.rollup, 'rollup'); + const nodeResolve = plugins.find(({ name }) => name === 'node-resolve'); + if (nodeResolve) { + validateVersion(nodeResolve.version, '^13.0.6', '@rollup/plugin-node-resolve'); + } + if (options.namedExports != null) { + this.warn( + 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.' + ); + } + requireResolver = getRequireResolver( + extensions, + detectCyclesAndConditional, + currentlyResolving + ); + }, + + buildEnd() { + if (options.strictRequires === 'debug') { + const wrappedIds = requireResolver.getWrappedIds(); + if (wrappedIds.length) { + this.warn({ + code: 'WRAPPED_IDS', + ids: wrappedIds, + message: `The commonjs plugin automatically wrapped the following files:\n[\n${wrappedIds + .map((id) => `\t${JSON.stringify(relative$1(process.cwd(), id))}`) + .join(',\n')}\n]` + }); + } else { + this.warn({ + code: 'WRAPPED_IDS', + ids: wrappedIds, + message: 'The commonjs plugin did not wrap any files.' + }); + } + } + }, + + async load(id) { + if (id === HELPERS_ID) { + return getHelpersModule(); + } + + if (isWrappedId(id, MODULE_SUFFIX)) { + const name = getName(unwrapId(id, MODULE_SUFFIX)); + return { + code: `var ${name} = {exports: {}}; export {${name} as __module}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + + if (isWrappedId(id, EXPORTS_SUFFIX)) { + const name = getName(unwrapId(id, EXPORTS_SUFFIX)); + return { + code: `var ${name} = {}; export {${name} as __exports}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + + if (isWrappedId(id, EXTERNAL_SUFFIX)) { + const actualId = unwrapId(id, EXTERNAL_SUFFIX); + return getUnknownRequireProxy( + actualId, + isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true + ); + } + + // entry suffix is just appended to not mess up relative external resolution + if (id.endsWith(ENTRY_SUFFIX)) { + const acutalId = id.slice(0, -ENTRY_SUFFIX.length); + const { + meta: { commonjs: commonjsMeta } + } = this.getModuleInfo(acutalId); + const shebang = commonjsMeta?.shebang ?? ''; + return getEntryProxy( + acutalId, + getDefaultIsModuleExports(acutalId), + this.getModuleInfo, + shebang + ); + } + + if (isWrappedId(id, ES_IMPORT_SUFFIX)) { + const actualId = unwrapId(id, ES_IMPORT_SUFFIX); + return getEsImportProxy( + actualId, + getDefaultIsModuleExports(actualId), + (await this.load({ id: actualId })).moduleSideEffects + ); + } + + if (id === DYNAMIC_MODULES_ID) { + return getDynamicModuleRegistry( + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ignoreDynamicRequires + ); + } + + if (isWrappedId(id, PROXY_SUFFIX)) { + const actualId = unwrapId(id, PROXY_SUFFIX); + return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load); + } + + return null; + }, + + shouldTransformCachedModule(...args) { + return requireResolver.shouldTransformCachedModule.call(this, ...args); + }, + + transform(code, id) { + if (!isPossibleCjsId(id)) return null; + + try { + return transformAndCheckExports.call(this, code, id); + } catch (err) { + return this.error(err, err.pos); + } + } + }; +} + +function perEnvironmentState(initial) { + const stateMap = /* @__PURE__ */ new WeakMap(); + return function(context) { + const { environment } = context; + let state = stateMap.get(environment); + if (!state) { + state = initial(environment); + stateMap.set(environment, state); + } + return state; + }; +} + +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: 7 /* Absolute */, + }; +} +function parseUrl$3(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = 6 /* SchemeRelative */; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = 5 /* AbsolutePath */; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? 3 /* Query */ + : input.startsWith('#') + ? 2 /* Hash */ + : 4 /* RelativePath */ + : 1 /* Empty */; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath$4(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath$4(url, type) { + const rel = type <= 4 /* RelativePath */; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve$2(input, base) { + if (!input && !base) + return ''; + const url = parseUrl$3(input); + let inputType = url.type; + if (base && inputType !== 7 /* Absolute */) { + const baseUrl = parseUrl$3(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1 /* Empty */: + url.hash = baseUrl.hash; + // fall through + case 2 /* Hash */: + url.query = baseUrl.query; + // fall through + case 3 /* Query */: + case 4 /* RelativePath */: + mergePaths(url, baseUrl); + // fall through + case 5 /* AbsolutePath */: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case 6 /* SchemeRelative */: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath$4(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case 2 /* Hash */: + case 3 /* Query */: + return queryHash; + case 4 /* RelativePath */: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case 5 /* AbsolutePath */: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +function resolve$1(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolve$2(input, base); +} + +/** + * Removes everything after the last "/", but leaves the slash. + */ +function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} + +const COLUMN$1 = 0; +const SOURCES_INDEX$1 = 1; +const SOURCE_LINE$1 = 2; +const SOURCE_COLUMN$1 = 3; +const NAMES_INDEX$1 = 4; + +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN$1] - b[COLUMN$1]; +} + +let found = false; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN$1] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; +const LEAST_UPPER_BOUND = -1; +const GREATEST_LOWER_BOUND = 1; +class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined; + const from = resolve$1(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve$1(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast$2(map) { + return map; +} +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +function encodedMappings(map) { + var _a; + var _b; + return ((_a = (_b = cast$2(map))._encoded) !== null && _a !== void 0 ? _a : (_b._encoded = encode$1(cast$2(map)._decoded))); +} +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +function decodedMappings(map) { + var _a; + return ((_a = cast$2(map))._decoded || (_a._decoded = decode(cast$2(map)._encoded))); +} +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +function traceSegment(map, line, column) { + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, cast$2(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; +} +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +function originalPositionFor$1(map, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, cast$2(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null); +} +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +function decodedMap(map) { + return clone(map, decodedMappings(map)); +} +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +function encodedMap(map) { + return clone(map, encodedMappings(map)); +} +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || map.x_google_ignoreList, + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; +} + +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +} +/** + * Typescript doesn't allow friend access to private fields, so this just casts the set into a type + * with public access modifiers. + */ +function cast$1(set) { + return set; +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +function get(setarr, key) { + return cast$1(setarr)._indexes[key]; +} +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +function put(setarr, key) { + // The key may or may not be present. If it is present, it's a number. + const index = get(setarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = cast$1(setarr); + const length = array.push(key); + return (indexes[key] = length - 1); +} +/** + * Removes the key, if it exists in the set. + */ +function remove(setarr, key) { + const index = get(setarr, key); + if (index === undefined) + return; + const { array, _indexes: indexes } = cast$1(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]--; + } + indexes[key] = undefined; + array.pop(); +} + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; + +const NO_NAME = -1; +/** + * Provides the state to generate a sourcemap. + */ +class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +} +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast(map) { + return map; +} +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +const maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name); +}; +/** + * Adds/removes the content of the source file to the source map. + */ +function setSourceContent(map, source, content) { + const { _sources: sources, _sourcesContent: sourcesContent } = cast(map); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map, source, ignore = true) { + const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast(map); + const index = put(sources, source); + if (index === sourcesContent.length) + sourcesContent[index] = null; + if (ignore) + put(ignoreList, index); + else + remove(ignoreList, index); +} +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +function toDecodedMap(map) { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList, } = cast(map); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map.file || undefined, + names: names.array, + sourceRoot: map.sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + ignoreList: ignoreList.array, + }; +} +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +function toEncodedMap(map) { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) }); +} +// This split declaration is only so that terser can elminiate the static initialization block. +function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = cast(map); + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = null; + if (skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); +} +function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; +} +function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); +} + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); +const EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore, + }; +} +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +function MapSource(map, sources) { + return Source(map, sources, '', null, false); +} +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source, ignore } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + setSourceContent(gen, source, content); + if (ignore) + setIgnore(gen, source, true); + } + } + return gen; +} +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); +} + +function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; +} +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?'); + } + } + let tree = build$2(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build$2(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + ignore: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build$2(new TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +} + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +function remapping(input, loader, options) { + const opts = { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} + +var src$3 = {exports: {}}; + +var browser$2 = {exports: {}}; + +/** + * Helpers. + */ + +var ms$1; +var hasRequiredMs$1; + +function requireMs$1 () { + if (hasRequiredMs$1) return ms$1; + hasRequiredMs$1 = 1; + var s = 1000; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + ms$1 = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); + } + return ms$1; +} + +var common$4; +var hasRequiredCommon; + +function requireCommon () { + if (hasRequiredCommon) return common$4; + hasRequiredCommon = 1; + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = requireMs$1(); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; + } + + common$4 = setup; + return common$4; +} + +/* eslint-env browser */ + +var hasRequiredBrowser$1; + +function requireBrowser$1 () { + if (hasRequiredBrowser$1) return browser$2.exports; + hasRequiredBrowser$1 = 1; + (function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + */ + + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = localstorage(); + exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; + })(); + + /** + * Colors. + */ + + exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + // eslint-disable-next-line complexity + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + let m; + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ + exports.log = console.debug || console.log || (() => {}); + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } + }; + } (browser$2, browser$2.exports)); + return browser$2.exports; +} + +var node$1 = {exports: {}}; + +/** + * Module dependencies. + */ + +var hasRequiredNode$1; + +function requireNode$1 () { + if (hasRequiredNode$1) return node$1.exports; + hasRequiredNode$1 = 1; + (function (module, exports) { + const tty = require$$0$4; + const util = require$$1; + + /** + * This is the Node.js implementation of `debug()`. + */ + + exports.init = init; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' + ); + + /** + * Colors. + */ + + exports.colors = [6, 2, 3, 4, 5, 1]; + + try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. + } + + /** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; + }, {}); + + /** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + + function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); + } + + /** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } + } + + function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; + } + + /** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ + + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + return process.env.DEBUG; + } + + /** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %o to `util.inspect()`, all on a single line. + */ + + formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); + }; + + /** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } (node$1, node$1.exports)); + return node$1.exports; +} + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + src$3.exports = requireBrowser$1(); +} else { + src$3.exports = requireNode$1(); +} + +var srcExports$1 = src$3.exports; +var debug$i = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1); + +let pnp; +if (process.versions.pnp) { + try { + pnp = createRequire$1(import.meta.url)("pnpapi"); + } catch { + } +} +function invalidatePackageData(packageCache, pkgPath) { + const pkgDir = normalizePath$3(path$d.dirname(pkgPath)); + packageCache.forEach((pkg, cacheKey) => { + if (pkg.dir === pkgDir) { + packageCache.delete(cacheKey); + } + }); +} +function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) { + if (pnp) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + if (packageCache?.has(cacheKey)) return packageCache.get(cacheKey); + try { + const pkg = pnp.resolveToUnqualified(pkgName, basedir, { + considerBuiltins: false + }); + if (!pkg) return null; + const pkgData = loadPackageData(path$d.join(pkg, "package.json")); + packageCache?.set(cacheKey, pkgData); + return pkgData; + } catch { + return null; + } + } + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getRpdCache( + packageCache, + pkgName, + basedir, + originalBasedir, + preserveSymlinks + ); + if (cached) return cached; + } + const pkg = path$d.join(basedir, "node_modules", pkgName, "package.json"); + try { + if (fs__default.existsSync(pkg)) { + const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg); + const pkgData = loadPackageData(pkgPath); + if (packageCache) { + setRpdCache( + packageCache, + pkgData, + pkgName, + basedir, + originalBasedir, + preserveSymlinks + ); + } + return pkgData; + } + } catch { + } + const nextBasedir = path$d.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function findNearestPackageData(basedir, packageCache) { + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getFnpdCache(packageCache, basedir, originalBasedir); + if (cached) return cached; + } + const pkgPath = path$d.join(basedir, "package.json"); + if (tryStatSync(pkgPath)?.isFile()) { + try { + const pkgData = loadPackageData(pkgPath); + if (packageCache) { + setFnpdCache(packageCache, pkgData, basedir, originalBasedir); + } + return pkgData; + } catch { + } + } + const nextBasedir = path$d.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function findNearestMainPackageData(basedir, packageCache) { + const nearestPackage = findNearestPackageData(basedir, packageCache); + return nearestPackage && (nearestPackage.data.name ? nearestPackage : findNearestMainPackageData( + path$d.dirname(nearestPackage.dir), + packageCache + )); +} +function loadPackageData(pkgPath) { + const data = JSON.parse(fs__default.readFileSync(pkgPath, "utf-8")); + const pkgDir = normalizePath$3(path$d.dirname(pkgPath)); + const { sideEffects } = data; + let hasSideEffects; + if (typeof sideEffects === "boolean") { + hasSideEffects = () => sideEffects; + } else if (Array.isArray(sideEffects)) { + if (sideEffects.length <= 0) { + hasSideEffects = () => false; + } else { + const finalPackageSideEffects = sideEffects.map((sideEffect) => { + if (sideEffect.includes("/")) { + return sideEffect; + } + return `**/${sideEffect}`; + }); + hasSideEffects = createFilter(finalPackageSideEffects, null, { + resolve: pkgDir + }); + } + } else { + hasSideEffects = () => null; + } + const resolvedCache = {}; + const pkg = { + dir: pkgDir, + data, + hasSideEffects, + setResolvedCache(key, entry, options) { + resolvedCache[getResolveCacheKey(key, options)] = entry; + }, + getResolvedCache(key, options) { + return resolvedCache[getResolveCacheKey(key, options)]; + } + }; + return pkg; +} +function getResolveCacheKey(key, options) { + return [ + key, + options.isRequire ? "1" : "0", + options.conditions.join("_"), + options.extensions.join("_"), + options.mainFields.join("_") + ].join("|"); +} +function findNearestNodeModules(basedir) { + while (basedir) { + const pkgPath = path$d.join(basedir, "node_modules"); + if (tryStatSync(pkgPath)?.isDirectory()) { + return pkgPath; + } + const nextBasedir = path$d.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function watchPackageDataPlugin(packageCache) { + const watchQueue = /* @__PURE__ */ new Set(); + const watchedDirs = /* @__PURE__ */ new Set(); + const watchFileStub = (id) => { + watchQueue.add(id); + }; + let watchFile = watchFileStub; + const setPackageData = packageCache.set.bind(packageCache); + packageCache.set = (id, pkg) => { + if (!isInNodeModules$1(pkg.dir) && !watchedDirs.has(pkg.dir)) { + watchedDirs.add(pkg.dir); + watchFile(path$d.join(pkg.dir, "package.json")); + } + return setPackageData(id, pkg); + }; + return { + name: "vite:watch-package-data", + buildStart() { + watchFile = this.addWatchFile.bind(this); + watchQueue.forEach(watchFile); + watchQueue.clear(); + }, + buildEnd() { + watchFile = watchFileStub; + }, + watchChange(id) { + if (id.endsWith("/package.json")) { + invalidatePackageData(packageCache, path$d.normalize(id)); + } + } + }; +} +function getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); + return pkgData; + } +} +function setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks) { + packageCache.set(getRpdCacheKey(pkgName, basedir, preserveSymlinks), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); +} +function getRpdCacheKey(pkgName, basedir, preserveSymlinks) { + return `rpd_${pkgName}_${basedir}_${preserveSymlinks}`; +} +function getFnpdCache(packageCache, basedir, originalBasedir) { + const cacheKey = getFnpdCacheKey(basedir); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); + return pkgData; + } +} +function setFnpdCache(packageCache, pkgData, basedir, originalBasedir) { + packageCache.set(getFnpdCacheKey(basedir), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); +} +function getFnpdCacheKey(basedir) { + return `fnpd_${basedir}`; +} +function traverseBetweenDirs(longerDir, shorterDir, cb) { + while (longerDir !== shorterDir) { + cb(longerDir); + longerDir = path$d.dirname(longerDir); + } +} + +const createFilter = createFilter$1; +const replaceSlashOrColonRE = /[/:]/g; +const replaceDotRE = /\./g; +const replaceNestedIdRE = /\s*>\s*/g; +const replaceHashRE = /#/g; +const flattenId = (id) => { + const flatId = limitFlattenIdLength( + id.replace(replaceSlashOrColonRE, "_").replace(replaceDotRE, "__").replace(replaceNestedIdRE, "___").replace(replaceHashRE, "____") + ); + return flatId; +}; +const FLATTEN_ID_HASH_LENGTH = 8; +const FLATTEN_ID_MAX_FILE_LENGTH = 170; +const limitFlattenIdLength = (id, limit = FLATTEN_ID_MAX_FILE_LENGTH) => { + if (id.length <= limit) { + return id; + } + return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + "_" + getHash(id); +}; +const normalizeId = (id) => id.replace(replaceNestedIdRE, " > "); +const NODE_BUILTIN_NAMESPACE = "node:"; +const NPM_BUILTIN_NAMESPACE = "npm:"; +const BUN_BUILTIN_NAMESPACE = "bun:"; +const nodeBuiltins = builtinModules.filter((id) => !id.includes(":")); +function isBuiltin(id) { + if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE)) return true; + if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE)) return true; + return isNodeBuiltin(id); +} +function isNodeBuiltin(id) { + if (id.startsWith(NODE_BUILTIN_NAMESPACE)) return true; + return nodeBuiltins.includes(id); +} +function isInNodeModules$1(id) { + return id.includes("node_modules"); +} +function moduleListContains(moduleList, id) { + return moduleList?.some( + (m) => m === id || id.startsWith(withTrailingSlash(m)) + ); +} +function isOptimizable(id, optimizeDeps) { + const { extensions } = optimizeDeps; + return OPTIMIZABLE_ENTRY_RE.test(id) || (extensions?.some((ext) => id.endsWith(ext)) ?? false); +} +const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/; +const deepImportRE = /^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//; +const _require$1 = createRequire$1(import.meta.url); +const _dirname = path$d.dirname(fileURLToPath$1(import.meta.url)); +const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version ?? ""; +const filter = process.env.VITE_DEBUG_FILTER; +const DEBUG = process.env.DEBUG; +function createDebugger(namespace, options = {}) { + const log = debug$i(namespace); + const { onlyWhenFocused, depth } = options; + if (depth && log.inspectOpts && log.inspectOpts.depth == null) { + log.inspectOpts.depth = options.depth; + } + let enabled = log.enabled; + if (enabled && onlyWhenFocused) { + const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace; + enabled = !!DEBUG?.includes(ns); + } + if (enabled) { + return (...args) => { + if (!filter || args.some((a) => a?.includes?.(filter))) { + log(...args); + } + }; + } +} +function testCaseInsensitiveFS() { + if (!CLIENT_ENTRY.endsWith("client.mjs")) { + throw new Error( + `cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs` + ); + } + if (!fs__default.existsSync(CLIENT_ENTRY)) { + throw new Error( + "cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: " + CLIENT_ENTRY + ); + } + return fs__default.existsSync(CLIENT_ENTRY.replace("client.mjs", "cLiEnT.mjs")); +} +const urlCanParse = ( + // eslint-disable-next-line n/no-unsupported-features/node-builtins + URL$3.canParse ?? // URL.canParse is supported from Node.js 18.17.0+, 20.0.0+ + ((path2, base) => { + try { + new URL$3(path2, base); + return true; + } catch { + return false; + } + }) +); +const isCaseInsensitiveFS = testCaseInsensitiveFS(); +const VOLUME_RE = /^[A-Z]:/i; +function normalizePath$3(id) { + return path$d.posix.normalize(isWindows$3 ? slash$1(id) : id); +} +function fsPathFromId(id) { + const fsPath = normalizePath$3( + id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id + ); + return fsPath[0] === "/" || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} +function fsPathFromUrl(url) { + return fsPathFromId(cleanUrl(url)); +} +function isParentDirectory(dir, file) { + dir = withTrailingSlash(dir); + return file.startsWith(dir) || isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()); +} +function isSameFileUri(file1, file2) { + return file1 === file2 || isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase(); +} +const externalRE = /^([a-z]+:)?\/\//; +const isExternalUrl = (url) => externalRE.test(url); +const dataUrlRE = /^\s*data:/i; +const isDataUrl = (url) => dataUrlRE.test(url); +const virtualModuleRE = /^virtual-module:.*/; +const virtualModulePrefix = "virtual-module:"; +const knownJsSrcRE = /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba|mdx)(?:$|\?)/; +const isJSRequest = (url) => { + url = cleanUrl(url); + if (knownJsSrcRE.test(url)) { + return true; + } + if (!path$d.extname(url) && url[url.length - 1] !== "/") { + return true; + } + return false; +}; +const knownTsRE = /\.(?:ts|mts|cts|tsx)(?:$|\?)/; +const isTsRequest = (url) => knownTsRE.test(url); +const importQueryRE = /(\?|&)import=?(?:&|$)/; +const directRequestRE$1 = /(\?|&)direct=?(?:&|$)/; +const internalPrefixes = [ + FS_PREFIX, + VALID_ID_PREFIX, + CLIENT_PUBLIC_PATH, + ENV_PUBLIC_PATH +]; +const InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join("|")})`); +const trailingSeparatorRE = /[?&]$/; +const isImportRequest = (url) => importQueryRE.test(url); +const isInternalRequest = (url) => InternalPrefixRE.test(url); +function removeImportQuery(url) { + return url.replace(importQueryRE, "$1").replace(trailingSeparatorRE, ""); +} +function removeDirectQuery(url) { + return url.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, ""); +} +const urlRE = /(\?|&)url(?:&|$)/; +const rawRE = /(\?|&)raw(?:&|$)/; +function removeUrlQuery(url) { + return url.replace(urlRE, "$1").replace(trailingSeparatorRE, ""); +} +function injectQuery(url, queryToInject) { + const { file, postfix } = splitFileAndPostfix(url); + const normalizedFile = isWindows$3 ? slash$1(file) : file; + return `${normalizedFile}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : ( + /* hash only */ + postfix + )}`; +} +const timestampRE = /\bt=\d{13}&?\b/; +function removeTimestampQuery(url) { + return url.replace(timestampRE, "").replace(trailingSeparatorRE, ""); +} +async function asyncReplace(input, re, replacer) { + let match; + let remaining = input; + let rewritten = ""; + while (match = re.exec(remaining)) { + rewritten += remaining.slice(0, match.index); + rewritten += await replacer(match); + remaining = remaining.slice(match.index + match[0].length); + } + rewritten += remaining; + return rewritten; +} +function timeFrom(start, subtract = 0) { + const time = performance.now() - start - subtract; + const timeString = (time.toFixed(2) + `ms`).padEnd(5, " "); + if (time < 10) { + return colors$1.green(timeString); + } else if (time < 50) { + return colors$1.yellow(timeString); + } else { + return colors$1.red(timeString); + } +} +function prettifyUrl(url, root) { + url = removeTimestampQuery(url); + const isAbsoluteFile = url.startsWith(root); + if (isAbsoluteFile || url.startsWith(FS_PREFIX)) { + const file = path$d.posix.relative( + root, + isAbsoluteFile ? url : fsPathFromId(url) + ); + return colors$1.dim(file); + } else { + return colors$1.dim(url); + } +} +function isObject$2(value) { + return Object.prototype.toString.call(value) === "[object Object]"; +} +function isDefined(value) { + return value != null; +} +function tryStatSync(file) { + try { + return fs__default.statSync(file, { throwIfNoEntry: false }); + } catch { + } +} +function lookupFile(dir, fileNames) { + while (dir) { + for (const fileName of fileNames) { + const fullPath = path$d.join(dir, fileName); + if (tryStatSync(fullPath)?.isFile()) return fullPath; + } + const parentDir = path$d.dirname(dir); + if (parentDir === dir) return; + dir = parentDir; + } +} +function isFilePathESM(filePath, packageCache) { + if (/\.m[jt]s$/.test(filePath)) { + return true; + } else if (/\.c[jt]s$/.test(filePath)) { + return false; + } else { + try { + const pkg = findNearestPackageData(path$d.dirname(filePath), packageCache); + return pkg?.data.type === "module"; + } catch { + return false; + } + } +} +const splitRE = /\r?\n/g; +const range = 2; +function pad$1(source, n = 2) { + const lines = source.split(splitRE); + return lines.map((l) => ` `.repeat(n) + l).join(` +`); +} +function posToNumber(source, pos) { + if (typeof pos === "number") return pos; + const lines = source.split(splitRE); + const { line, column } = pos; + let start = 0; + for (let i = 0; i < line - 1 && i < lines.length; i++) { + start += lines[i].length + 1; + } + return start + column; +} +function numberToPos(source, offset) { + if (typeof offset !== "number") return offset; + if (offset > source.length) { + throw new Error( + `offset is longer than source length! offset ${offset} > length ${source.length}` + ); + } + const lines = source.split(splitRE); + let counted = 0; + let line = 0; + let column = 0; + for (; line < lines.length; line++) { + const lineLength = lines[line].length + 1; + if (counted + lineLength >= offset) { + column = offset - counted + 1; + break; + } + counted += lineLength; + } + return { line: line + 1, column }; +} +function generateCodeFrame(source, start = 0, end) { + start = Math.max(posToNumber(source, start), 0); + end = Math.min( + end !== void 0 ? posToNumber(source, end) : start, + source.length + ); + const lines = source.split(splitRE); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length; + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + if (j === i) { + const pad2 = Math.max(start - (count - lineLength), 0); + const length = Math.max( + 1, + end > count ? lineLength - pad2 : end - start + ); + res.push(` | ` + " ".repeat(pad2) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + 1; + } + } + break; + } + count++; + } + return res.join("\n"); +} +function isFileReadable(filename) { + if (!tryStatSync(filename)) { + return false; + } + try { + fs__default.accessSync(filename, fs__default.constants.R_OK); + return true; + } catch { + return false; + } +} +const splitFirstDirRE = /(.+?)[\\/](.+)/; +function emptyDir(dir, skip) { + const skipInDir = []; + let nested = null; + if (skip?.length) { + for (const file of skip) { + if (path$d.dirname(file) !== ".") { + const matched = splitFirstDirRE.exec(file); + if (matched) { + nested ??= /* @__PURE__ */ new Map(); + const [, nestedDir, skipPath] = matched; + let nestedSkip = nested.get(nestedDir); + if (!nestedSkip) { + nestedSkip = []; + nested.set(nestedDir, nestedSkip); + } + if (!nestedSkip.includes(skipPath)) { + nestedSkip.push(skipPath); + } + } + } else { + skipInDir.push(file); + } + } + } + for (const file of fs__default.readdirSync(dir)) { + if (skipInDir.includes(file)) { + continue; + } + if (nested?.has(file)) { + emptyDir(path$d.resolve(dir, file), nested.get(file)); + } else { + fs__default.rmSync(path$d.resolve(dir, file), { recursive: true, force: true }); + } + } +} +function copyDir(srcDir, destDir) { + fs__default.mkdirSync(destDir, { recursive: true }); + for (const file of fs__default.readdirSync(srcDir)) { + const srcFile = path$d.resolve(srcDir, file); + if (srcFile === destDir) { + continue; + } + const destFile = path$d.resolve(destDir, file); + const stat = fs__default.statSync(srcFile); + if (stat.isDirectory()) { + copyDir(srcFile, destFile); + } else { + fs__default.copyFileSync(srcFile, destFile); + } + } +} +const ERR_SYMLINK_IN_RECURSIVE_READDIR = "ERR_SYMLINK_IN_RECURSIVE_READDIR"; +async function recursiveReaddir(dir) { + if (!fs__default.existsSync(dir)) { + return []; + } + let dirents; + try { + dirents = await fsp.readdir(dir, { withFileTypes: true }); + } catch (e) { + if (e.code === "EACCES") { + return []; + } + throw e; + } + if (dirents.some((dirent) => dirent.isSymbolicLink())) { + const err = new Error( + "Symbolic links are not supported in recursiveReaddir" + ); + err.code = ERR_SYMLINK_IN_RECURSIVE_READDIR; + throw err; + } + const files = await Promise.all( + dirents.map((dirent) => { + const res = path$d.resolve(dir, dirent.name); + return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath$3(res); + }) + ); + return files.flat(1); +} +let safeRealpathSync = isWindows$3 ? windowsSafeRealPathSync : fs__default.realpathSync.native; +const windowsNetworkMap = /* @__PURE__ */ new Map(); +function windowsMappedRealpathSync(path2) { + const realPath = fs__default.realpathSync.native(path2); + if (realPath.startsWith("\\\\")) { + for (const [network, volume] of windowsNetworkMap) { + if (realPath.startsWith(network)) return realPath.replace(network, volume); + } + } + return realPath; +} +const parseNetUseRE = /^\w* +(\w:) +([^ ]+)\s/; +let firstSafeRealPathSyncRun = false; +function windowsSafeRealPathSync(path2) { + if (!firstSafeRealPathSyncRun) { + optimizeSafeRealPathSync(); + firstSafeRealPathSyncRun = true; + } + return fs__default.realpathSync(path2); +} +function optimizeSafeRealPathSync() { + const nodeVersion = process.versions.node.split(".").map(Number); + if (nodeVersion[0] < 18 || nodeVersion[0] === 18 && nodeVersion[1] < 10) { + safeRealpathSync = fs__default.realpathSync; + return; + } + try { + fs__default.realpathSync.native(path$d.resolve("./")); + } catch (error) { + if (error.message.includes("EISDIR: illegal operation on a directory")) { + safeRealpathSync = fs__default.realpathSync; + return; + } + } + exec("net use", (error, stdout) => { + if (error) return; + const lines = stdout.split("\n"); + for (const line of lines) { + const m = parseNetUseRE.exec(line); + if (m) windowsNetworkMap.set(m[2], m[1]); + } + if (windowsNetworkMap.size === 0) { + safeRealpathSync = fs__default.realpathSync.native; + } else { + safeRealpathSync = windowsMappedRealpathSync; + } + }); +} +function ensureWatchedFile(watcher, file, root) { + if (file && // only need to watch if out of root + !file.startsWith(withTrailingSlash(root)) && // some rollup plugins use null bytes for private resolved Ids + !file.includes("\0") && fs__default.existsSync(file)) { + watcher.add(path$d.resolve(file)); + } +} +function joinSrcset(ret) { + return ret.map(({ url, descriptor }) => url + (descriptor ? ` ${descriptor}` : "")).join(", "); +} +const imageCandidateRegex = /(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g; +const escapedSpaceCharacters = /(?: |\\t|\\n|\\f|\\r)+/g; +function parseSrcset(string) { + const matches = string.trim().replace(escapedSpaceCharacters, " ").replace(/\r?\n/, "").replace(/,\s+/, ", ").replaceAll(/\s+/g, " ").matchAll(imageCandidateRegex); + return Array.from(matches, ({ groups }) => ({ + url: groups?.url?.trim() ?? "", + descriptor: groups?.descriptor?.trim() ?? "" + })).filter(({ url }) => !!url); +} +function processSrcSet(srcs, replacer) { + return Promise.all( + parseSrcset(srcs).map(async ({ url, descriptor }) => ({ + url: await replacer({ url, descriptor }), + descriptor + })) + ).then(joinSrcset); +} +function processSrcSetSync(srcs, replacer) { + return joinSrcset( + parseSrcset(srcs).map(({ url, descriptor }) => ({ + url: replacer({ url, descriptor }), + descriptor + })) + ); +} +const windowsDriveRE = /^[A-Z]:/; +const replaceWindowsDriveRE = /^([A-Z]):\//; +const linuxAbsolutePathRE = /^\/[^/]/; +function escapeToLinuxLikePath(path2) { + if (windowsDriveRE.test(path2)) { + return path2.replace(replaceWindowsDriveRE, "/windows/$1/"); + } + if (linuxAbsolutePathRE.test(path2)) { + return `/linux${path2}`; + } + return path2; +} +const revertWindowsDriveRE = /^\/windows\/([A-Z])\//; +function unescapeToLinuxLikePath(path2) { + if (path2.startsWith("/linux/")) { + return path2.slice("/linux".length); + } + if (path2.startsWith("/windows/")) { + return path2.replace(revertWindowsDriveRE, "$1:/"); + } + return path2; +} +const nullSourceMap = { + names: [], + sources: [], + mappings: "", + version: 3 +}; +function combineSourcemaps(filename, sourcemapList) { + if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) { + return { ...nullSourceMap }; + } + sourcemapList = sourcemapList.map((sourcemap) => { + const newSourcemaps = { ...sourcemap }; + newSourcemaps.sources = sourcemap.sources.map( + (source) => source ? escapeToLinuxLikePath(source) : null + ); + if (sourcemap.sourceRoot) { + newSourcemaps.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot); + } + return newSourcemaps; + }); + let map; + let mapIndex = 1; + const useArrayInterface = sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0; + if (useArrayInterface) { + map = remapping(sourcemapList, () => null); + } else { + map = remapping(sourcemapList[0], function loader(sourcefile) { + const mapForSources = sourcemapList.slice(mapIndex).find((s) => s.sources.includes(sourcefile)); + if (mapForSources) { + mapIndex++; + return mapForSources; + } + return null; + }); + } + if (!map.file) { + delete map.file; + } + map.sources = map.sources.map( + (source) => source ? unescapeToLinuxLikePath(source) : source + ); + map.file = filename; + return map; +} +function unique(arr) { + return Array.from(new Set(arr)); +} +async function getLocalhostAddressIfDiffersFromDNS() { + const [nodeResult, dnsResult] = await Promise.all([ + promises.lookup("localhost"), + promises.lookup("localhost", { verbatim: true }) + ]); + const isSame = nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address; + return isSame ? void 0 : nodeResult.address; +} +function diffDnsOrderChange(oldUrls, newUrls) { + return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network)); +} +async function resolveHostname(optionsHost) { + let host; + if (optionsHost === void 0 || optionsHost === false) { + host = "localhost"; + } else if (optionsHost === true) { + host = void 0; + } else { + host = optionsHost; + } + let name = host === void 0 || wildcardHosts.has(host) ? "localhost" : host; + if (host === "localhost") { + const localhostAddr = await getLocalhostAddressIfDiffersFromDNS(); + if (localhostAddr) { + name = localhostAddr; + } + } + return { host, name }; +} +async function resolveServerUrls(server, options, config) { + const address = server.address(); + const isAddressInfo = (x) => x?.address; + if (!isAddressInfo(address)) { + return { local: [], network: [] }; + } + const local = []; + const network = []; + const hostname = await resolveHostname(options.host); + const protocol = options.https ? "https" : "http"; + const port = address.port; + const base = config.rawBase === "./" || config.rawBase === "" ? "/" : config.rawBase; + if (hostname.host !== void 0 && !wildcardHosts.has(hostname.host)) { + let hostnameName = hostname.name; + if (hostnameName.includes(":")) { + hostnameName = `[${hostnameName}]`; + } + const address2 = `${protocol}://${hostnameName}:${port}${base}`; + if (loopbackHosts.has(hostname.host)) { + local.push(address2); + } else { + network.push(address2); + } + } else { + Object.values(os$3.networkInterfaces()).flatMap((nInterface) => nInterface ?? []).filter( + (detail) => detail.address && (detail.family === "IPv4" || // @ts-expect-error Node 18.0 - 18.3 returns number + detail.family === 4) + ).forEach((detail) => { + let host = detail.address.replace("127.0.0.1", hostname.name); + if (host.includes(":")) { + host = `[${host}]`; + } + const url = `${protocol}://${host}:${port}${base}`; + if (detail.address.includes("127.0.0.1")) { + local.push(url); + } else { + network.push(url); + } + }); + } + return { local, network }; +} +function arraify(target) { + return Array.isArray(target) ? target : [target]; +} +const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g; +const singlelineCommentsRE = /\/\/.*/g; +const requestQuerySplitRE = /\?(?!.*[/|}])/; +const requestQueryMaybeEscapedSplitRE = /\\?\?(?!.*[/|}])/; +const blankReplacer = (match) => " ".repeat(match.length); +const hash$1 = ( + // eslint-disable-next-line n/no-unsupported-features/node-builtins -- crypto.hash is supported in Node 21.7.0+, 20.12.0+ + crypto$2.hash ?? ((algorithm, data, outputEncoding) => crypto$2.createHash(algorithm).update(data).digest(outputEncoding)) +); +function getHash(text, length = 8) { + const h = hash$1("sha256", text, "hex").substring(0, length); + if (length <= 64) return h; + return h.padEnd(length, "_"); +} +const requireResolveFromRootWithFallback = (root, id) => { + const found = resolvePackageData(id, root) || resolvePackageData(id, _dirname); + if (!found) { + const error = new Error(`${JSON.stringify(id)} not found.`); + error.code = "MODULE_NOT_FOUND"; + throw error; + } + return _require$1.resolve(id, { paths: [root, _dirname] }); +}; +function emptyCssComments(raw) { + return raw.replace(multilineCommentsRE, blankReplacer); +} +function backwardCompatibleWorkerPlugins(plugins) { + if (Array.isArray(plugins)) { + return plugins; + } + if (typeof plugins === "function") { + return plugins(); + } + return []; +} +function deepClone(value) { + if (Array.isArray(value)) { + return value.map((v) => deepClone(v)); + } + if (isObject$2(value)) { + const cloned = {}; + for (const key in value) { + cloned[key] = deepClone(value[key]); + } + return cloned; + } + if (typeof value === "function") { + return value; + } + if (value instanceof RegExp) { + return structuredClone(value); + } + if (typeof value === "object" && value != null) { + throw new Error("Cannot deep clone non-plain object"); + } + return value; +} +function mergeWithDefaultsRecursively(defaults, values) { + const merged = defaults; + for (const key in values) { + const value = values[key]; + if (value === void 0) continue; + const existing = merged[key]; + if (existing === void 0) { + merged[key] = value; + continue; + } + if (isObject$2(existing) && isObject$2(value)) { + merged[key] = mergeWithDefaultsRecursively(existing, value); + continue; + } + merged[key] = value; + } + return merged; +} +function mergeWithDefaults(defaults, values) { + const clonedDefaults = deepClone(defaults); + return mergeWithDefaultsRecursively(clonedDefaults, values); +} +function mergeConfigRecursively(defaults, overrides, rootPath) { + const merged = { ...defaults }; + for (const key in overrides) { + const value = overrides[key]; + if (value == null) { + continue; + } + const existing = merged[key]; + if (existing == null) { + merged[key] = value; + continue; + } + if (key === "alias" && (rootPath === "resolve" || rootPath === "")) { + merged[key] = mergeAlias(existing, value); + continue; + } else if (key === "assetsInclude" && rootPath === "") { + merged[key] = [].concat(existing, value); + continue; + } else if (key === "noExternal" && (rootPath === "ssr" || rootPath === "resolve") && (existing === true || value === true)) { + merged[key] = true; + continue; + } else if (key === "plugins" && rootPath === "worker") { + merged[key] = () => [ + ...backwardCompatibleWorkerPlugins(existing), + ...backwardCompatibleWorkerPlugins(value) + ]; + continue; + } else if (key === "server" && rootPath === "server.hmr") { + merged[key] = value; + continue; + } + if (Array.isArray(existing) || Array.isArray(value)) { + merged[key] = [...arraify(existing), ...arraify(value)]; + continue; + } + if (isObject$2(existing) && isObject$2(value)) { + merged[key] = mergeConfigRecursively( + existing, + value, + rootPath ? `${rootPath}.${key}` : key + ); + continue; + } + merged[key] = value; + } + return merged; +} +function mergeConfig(defaults, overrides, isRoot = true) { + if (typeof defaults === "function" || typeof overrides === "function") { + throw new Error(`Cannot merge config in form of callback`); + } + return mergeConfigRecursively(defaults, overrides, isRoot ? "" : "."); +} +function mergeAlias(a, b) { + if (!a) return b; + if (!b) return a; + if (isObject$2(a) && isObject$2(b)) { + return { ...a, ...b }; + } + return [...normalizeAlias(b), ...normalizeAlias(a)]; +} +function normalizeAlias(o = []) { + return Array.isArray(o) ? o.map(normalizeSingleAlias) : Object.keys(o).map( + (find) => normalizeSingleAlias({ + find, + replacement: o[find] + }) + ); +} +function normalizeSingleAlias({ + find, + replacement, + customResolver +}) { + if (typeof find === "string" && find[find.length - 1] === "/" && replacement[replacement.length - 1] === "/") { + find = find.slice(0, find.length - 1); + replacement = replacement.slice(0, replacement.length - 1); + } + const alias = { + find, + replacement + }; + if (customResolver) { + alias.customResolver = customResolver; + } + return alias; +} +function transformStableResult(s, id, config) { + return { + code: s.toString(), + map: config.command === "build" && config.build.sourcemap ? s.generateMap({ hires: "boundary", source: id }) : null + }; +} +async function asyncFlatten(arr) { + do { + arr = (await Promise.all(arr)).flat(Infinity); + } while (arr.some((v) => v?.then)); + return arr; +} +function stripBomTag(content) { + if (content.charCodeAt(0) === 65279) { + return content.slice(1); + } + return content; +} +const windowsDrivePathPrefixRE = /^[A-Za-z]:[/\\]/; +const isNonDriveRelativeAbsolutePath = (p) => { + if (!isWindows$3) return p[0] === "/"; + return windowsDrivePathPrefixRE.test(p); +}; +function shouldServeFile(filePath, root) { + if (!isCaseInsensitiveFS) return true; + return hasCorrectCase(filePath, root); +} +function hasCorrectCase(file, assets) { + if (file === assets) return true; + const parent = path$d.dirname(file); + if (fs__default.readdirSync(parent).includes(path$d.basename(file))) { + return hasCorrectCase(parent, assets); + } + return false; +} +function joinUrlSegments(a, b) { + if (!a || !b) { + return a || b || ""; + } + if (a[a.length - 1] === "/") { + a = a.substring(0, a.length - 1); + } + if (b[0] !== "/") { + b = "/" + b; + } + return a + b; +} +function removeLeadingSlash(str) { + return str[0] === "/" ? str.slice(1) : str; +} +function stripBase(path2, base) { + if (path2 === base) { + return "/"; + } + const devBase = withTrailingSlash(base); + return path2.startsWith(devBase) ? path2.slice(devBase.length - 1) : path2; +} +function arrayEqual(a, b) { + if (a === b) return true; + if (a.length !== b.length) return false; + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; +} +function evalValue(rawValue) { + const fn = new Function(` + var console, exports, global, module, process, require + return ( +${rawValue} +) + `); + return fn(); +} +function getNpmPackageName(importPath) { + const parts = importPath.split("/"); + if (parts[0][0] === "@") { + if (!parts[1]) return null; + return `${parts[0]}/${parts[1]}`; + } else { + return parts[0]; + } +} +function getPkgName(name) { + return name[0] === "@" ? name.split("/")[1] : name; +} +const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegex(str) { + return str.replace(escapeRegexRE, "\\$&"); +} +function getPackageManagerCommand(type = "install") { + const packageManager = process.env.npm_config_user_agent?.split(" ")[0].split("/")[0] || "npm"; + switch (type) { + case "install": + return packageManager === "npm" ? "npm install" : `${packageManager} add`; + case "uninstall": + return packageManager === "npm" ? "npm uninstall" : `${packageManager} remove`; + case "update": + return packageManager === "yarn" ? "yarn upgrade" : `${packageManager} update`; + default: + throw new TypeError(`Unknown command type: ${type}`); + } +} +function isDevServer(server) { + return "pluginContainer" in server; +} +function createSerialPromiseQueue() { + let previousTask; + return { + async run(f) { + const thisTask = f(); + const depTasks = Promise.all([previousTask, thisTask]); + previousTask = depTasks; + const [, result] = await depTasks; + if (previousTask === depTasks) { + previousTask = void 0; + } + return result; + } + }; +} +function sortObjectKeys(obj) { + const sorted = {}; + for (const key of Object.keys(obj).sort()) { + sorted[key] = obj[key]; + } + return sorted; +} +function displayTime(time) { + if (time < 1e3) { + return `${time}ms`; + } + time = time / 1e3; + if (time < 60) { + return `${time.toFixed(2)}s`; + } + const mins = parseInt((time / 60).toString()); + const seconds = time % 60; + return `${mins}m${seconds < 1 ? "" : ` ${seconds.toFixed(0)}s`}`; +} +function encodeURIPath(uri) { + if (uri.startsWith("data:")) return uri; + const filePath = cleanUrl(uri); + const postfix = filePath !== uri ? uri.slice(filePath.length) : ""; + return encodeURI(filePath) + postfix; +} +function partialEncodeURIPath(uri) { + if (uri.startsWith("data:")) return uri; + const filePath = cleanUrl(uri); + const postfix = filePath !== uri ? uri.slice(filePath.length) : ""; + return filePath.replaceAll("%", "%25") + postfix; +} +const setupSIGTERMListener = (callback) => { + process.once("SIGTERM", callback); + if (process.env.CI !== "true") { + process.stdin.on("end", callback); + } +}; +const teardownSIGTERMListener = (callback) => { + process.off("SIGTERM", callback); + if (process.env.CI !== "true") { + process.stdin.off("end", callback); + } +}; + +const LogLevels = { + silent: 0, + error: 1, + warn: 2, + info: 3 +}; +let lastType; +let lastMsg; +let sameCount = 0; +function clearScreen() { + const repeatCount = process.stdout.rows - 2; + const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : ""; + console.log(blank); + readline.cursorTo(process.stdout, 0, 0); + readline.clearScreenDown(process.stdout); +} +let timeFormatter; +function getTimeFormatter() { + timeFormatter ??= new Intl.DateTimeFormat(void 0, { + hour: "numeric", + minute: "numeric", + second: "numeric" + }); + return timeFormatter; +} +function createLogger(level = "info", options = {}) { + if (options.customLogger) { + return options.customLogger; + } + const loggedErrors = /* @__PURE__ */ new WeakSet(); + const { + prefix = "[vite]", + allowClearScreen = true, + console: console2 = globalThis.console + } = options; + const thresh = LogLevels[level]; + const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI; + const clear = canClearScreen ? clearScreen : () => { + }; + function format(type, msg, options2 = {}) { + if (options2.timestamp) { + let tag = ""; + if (type === "info") { + tag = colors$1.cyan(colors$1.bold(prefix)); + } else if (type === "warn") { + tag = colors$1.yellow(colors$1.bold(prefix)); + } else { + tag = colors$1.red(colors$1.bold(prefix)); + } + const environment = options2.environment ? options2.environment + " " : ""; + return `${colors$1.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${environment}${msg}`; + } else { + return msg; + } + } + function output(type, msg, options2 = {}) { + if (thresh >= LogLevels[type]) { + const method = type === "info" ? "log" : type; + if (options2.error) { + loggedErrors.add(options2.error); + } + if (canClearScreen) { + if (type === lastType && msg === lastMsg) { + sameCount++; + clear(); + console2[method]( + format(type, msg, options2), + colors$1.yellow(`(x${sameCount + 1})`) + ); + } else { + sameCount = 0; + lastMsg = msg; + lastType = type; + if (options2.clear) { + clear(); + } + console2[method](format(type, msg, options2)); + } + } else { + console2[method](format(type, msg, options2)); + } + } + } + const warnedMessages = /* @__PURE__ */ new Set(); + const logger = { + hasWarned: false, + info(msg, opts) { + output("info", msg, opts); + }, + warn(msg, opts) { + logger.hasWarned = true; + output("warn", msg, opts); + }, + warnOnce(msg, opts) { + if (warnedMessages.has(msg)) return; + logger.hasWarned = true; + output("warn", msg, opts); + warnedMessages.add(msg); + }, + error(msg, opts) { + logger.hasWarned = true; + output("error", msg, opts); + }, + clearScreen(type) { + if (thresh >= LogLevels[type]) { + clear(); + } + }, + hasErrorLogged(error) { + return loggedErrors.has(error); + } + }; + return logger; +} +function printServerUrls(urls, optionsHost, info) { + const colorUrl = (url) => colors$1.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors$1.bold(port)}/`)); + for (const url of urls.local) { + info(` ${colors$1.green("\u279C")} ${colors$1.bold("Local")}: ${colorUrl(url)}`); + } + for (const url of urls.network) { + info(` ${colors$1.green("\u279C")} ${colors$1.bold("Network")}: ${colorUrl(url)}`); + } + if (urls.network.length === 0 && optionsHost === void 0) { + info( + colors$1.dim(` ${colors$1.green("\u279C")} ${colors$1.bold("Network")}: use `) + colors$1.bold("--host") + colors$1.dim(" to expose") + ); + } +} + +const groups = [ + { name: "Assets", color: colors$1.green }, + { name: "CSS", color: colors$1.magenta }, + { name: "JS", color: colors$1.cyan } +]; +const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/; +function buildReporterPlugin(config) { + const compress = promisify$4(gzip); + const numberFormatter = new Intl.NumberFormat("en", { + maximumFractionDigits: 2, + minimumFractionDigits: 2 + }); + const displaySize = (bytes) => { + return `${numberFormatter.format(bytes / 1e3)} kB`; + }; + const tty = process.stdout.isTTY && !process.env.CI; + const shouldLogInfo = LogLevels[config.logLevel || "info"] >= LogLevels.info; + const modulesReporter = perEnvironmentState((environment) => { + let hasTransformed = false; + let transformedCount = 0; + const logTransform = throttle((id) => { + writeLine( + `transforming (${transformedCount}) ${colors$1.dim( + path$d.relative(config.root, id) + )}` + ); + }); + return { + reset() { + transformedCount = 0; + }, + register(id) { + transformedCount++; + if (shouldLogInfo) { + if (!tty) { + if (!hasTransformed) { + config.logger.info(`transforming...`); + } + } else { + if (id.includes(`?`)) return; + logTransform(id); + } + hasTransformed = true; + } + }, + log() { + if (shouldLogInfo) { + if (tty) { + clearLine$1(); + } + environment.logger.info( + `${colors$1.green(`\u2713`)} ${transformedCount} modules transformed.` + ); + } + } + }; + }); + const chunksReporter = perEnvironmentState((environment) => { + let hasRenderedChunk = false; + let hasCompressChunk = false; + let chunkCount = 0; + let compressedCount = 0; + async function getCompressedSize(code) { + if (environment.config.consumer !== "client" || !environment.config.build.reportCompressedSize) { + return null; + } + if (shouldLogInfo && !hasCompressChunk) { + if (!tty) { + config.logger.info("computing gzip size..."); + } else { + writeLine("computing gzip size (0)..."); + } + hasCompressChunk = true; + } + const compressed = await compress( + typeof code === "string" ? code : Buffer.from(code) + ); + compressedCount++; + if (shouldLogInfo && tty) { + writeLine(`computing gzip size (${compressedCount})...`); + } + return compressed.length; + } + return { + reset() { + chunkCount = 0; + compressedCount = 0; + }, + register() { + chunkCount++; + if (shouldLogInfo) { + if (!tty) { + if (!hasRenderedChunk) { + environment.logger.info("rendering chunks..."); + } + } else { + writeLine(`rendering chunks (${chunkCount})...`); + } + hasRenderedChunk = true; + } + }, + async log(output, outDir) { + const chunkLimit = environment.config.build.chunkSizeWarningLimit; + let hasLargeChunks = false; + if (shouldLogInfo) { + const entries = (await Promise.all( + Object.values(output).map( + async (chunk) => { + if (chunk.type === "chunk") { + return { + name: chunk.fileName, + group: "JS", + size: chunk.code.length, + compressedSize: await getCompressedSize(chunk.code), + mapSize: chunk.map ? chunk.map.toString().length : null + }; + } else { + if (chunk.fileName.endsWith(".map")) return null; + const isCSS = chunk.fileName.endsWith(".css"); + const isCompressible = isCSS || COMPRESSIBLE_ASSETS_RE.test(chunk.fileName); + return { + name: chunk.fileName, + group: isCSS ? "CSS" : "Assets", + size: chunk.source.length, + mapSize: null, + // Rollup doesn't support CSS maps? + compressedSize: isCompressible ? await getCompressedSize(chunk.source) : null + }; + } + } + ) + )).filter(isDefined); + if (tty) clearLine$1(); + let longest = 0; + let biggestSize = 0; + let biggestMap = 0; + let biggestCompressSize = 0; + for (const entry of entries) { + if (entry.name.length > longest) longest = entry.name.length; + if (entry.size > biggestSize) biggestSize = entry.size; + if (entry.mapSize && entry.mapSize > biggestMap) { + biggestMap = entry.mapSize; + } + if (entry.compressedSize && entry.compressedSize > biggestCompressSize) { + biggestCompressSize = entry.compressedSize; + } + } + const sizePad = displaySize(biggestSize).length; + const mapPad = displaySize(biggestMap).length; + const compressPad = displaySize(biggestCompressSize).length; + const relativeOutDir = normalizePath$3( + path$d.relative( + config.root, + path$d.resolve( + config.root, + outDir ?? environment.config.build.outDir + ) + ) + ); + const assetsDir = path$d.join(environment.config.build.assetsDir, "/"); + for (const group of groups) { + const filtered = entries.filter((e) => e.group === group.name); + if (!filtered.length) continue; + for (const entry of filtered.sort((a, z) => a.size - z.size)) { + const isLarge = group.name === "JS" && entry.size / 1e3 > chunkLimit; + if (isLarge) hasLargeChunks = true; + const sizeColor = isLarge ? colors$1.yellow : colors$1.dim; + let log = colors$1.dim(withTrailingSlash(relativeOutDir)); + log += !config.build.lib && entry.name.startsWith(withTrailingSlash(assetsDir)) ? colors$1.dim(assetsDir) + group.color( + entry.name.slice(assetsDir.length).padEnd(longest + 2 - assetsDir.length) + ) : group.color(entry.name.padEnd(longest + 2)); + log += colors$1.bold( + sizeColor(displaySize(entry.size).padStart(sizePad)) + ); + if (entry.compressedSize) { + log += colors$1.dim( + ` \u2502 gzip: ${displaySize(entry.compressedSize).padStart( + compressPad + )}` + ); + } + if (entry.mapSize) { + log += colors$1.dim( + ` \u2502 map: ${displaySize(entry.mapSize).padStart(mapPad)}` + ); + } + config.logger.info(log); + } + } + } else { + hasLargeChunks = Object.values(output).some((chunk) => { + return chunk.type === "chunk" && chunk.code.length / 1e3 > chunkLimit; + }); + } + if (hasLargeChunks && environment.config.build.minify && !config.build.lib && environment.config.consumer === "client") { + environment.logger.warn( + colors$1.yellow( + ` +(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider: +- Using dynamic import() to code-split the application +- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks +- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.` + ) + ); + } + } + }; + }); + return { + name: "vite:reporter", + sharedDuringBuild: true, + perEnvironmentStartEndDuringDev: true, + transform(_, id) { + modulesReporter(this).register(id); + }, + buildStart() { + modulesReporter(this).reset(); + }, + buildEnd() { + modulesReporter(this).log(); + }, + renderStart() { + chunksReporter(this).reset(); + }, + renderChunk(_, chunk, options) { + if (!options.inlineDynamicImports) { + for (const id of chunk.moduleIds) { + const module = this.getModuleInfo(id); + if (!module) continue; + if (module.importers.length && module.dynamicImporters.length) { + const detectedIneffectiveDynamicImport = module.dynamicImporters.some( + (id2) => !isInNodeModules$1(id2) && chunk.moduleIds.includes(id2) + ); + if (detectedIneffectiveDynamicImport) { + this.warn( + ` +(!) ${module.id} is dynamically imported by ${module.dynamicImporters.join( + ", " + )} but also statically imported by ${module.importers.join( + ", " + )}, dynamic import will not move module into another chunk. +` + ); + } + } + } + } + chunksReporter(this).register(); + }, + generateBundle() { + if (shouldLogInfo && tty) clearLine$1(); + }, + async writeBundle({ dir }, output) { + await chunksReporter(this).log(output, dir); + } + }; +} +function writeLine(output) { + clearLine$1(); + if (output.length < process.stdout.columns) { + process.stdout.write(output); + } else { + process.stdout.write(output.substring(0, process.stdout.columns - 1)); + } +} +function clearLine$1() { + process.stdout.clearLine(0); + process.stdout.cursorTo(0); +} +function throttle(fn) { + let timerHandle = null; + return (...args) => { + if (timerHandle) return; + fn(...args); + timerHandle = setTimeout(() => { + timerHandle = null; + }, 100); + }; +} + +const POSIX_SEP_RE = new RegExp('\\' + path$d.posix.sep, 'g'); +const NATIVE_SEP_RE = new RegExp('\\' + path$d.sep, 'g'); +/** @type {Map<string,RegExp>}*/ +const PATTERN_REGEX_CACHE = new Map(); +const GLOB_ALL_PATTERN = `**/*`; +const TS_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts']; +const JS_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs']; +const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS); +const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join('|')})`; +const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join( + '|' +)})`; +const IS_POSIX = path$d.posix.sep === path$d.sep; + +/** + * @template T + * @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise<T>}} + */ +function makePromise() { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} + +/** + * @param {string} filename + * @param {import('./cache.js').TSConfckCache} [cache] + * @returns {Promise<string|void>} + */ +async function resolveTSConfigJson(filename, cache) { + if (path$d.extname(filename) !== '.json') { + return; // ignore files that are not json + } + const tsconfig = path$d.resolve(filename); + if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) { + return tsconfig; + } + return promises$1.stat(tsconfig).then((stat) => { + if (stat.isFile() || stat.isFIFO()) { + return tsconfig; + } else { + throw new Error(`${filename} exists but is not a regular file.`); + } + }); +} + +/** + * + * @param {string} dir an absolute directory path + * @returns {boolean} if dir path includes a node_modules segment + */ +const isInNodeModules = IS_POSIX + ? (dir) => dir.includes('/node_modules/') + : (dir) => dir.match(/[/\\]node_modules[/\\]/); + +/** + * convert posix separator to native separator + * + * eg. + * windows: C:/foo/bar -> c:\foo\bar + * linux: /foo/bar -> /foo/bar + * + * @param {string} filename with posix separators + * @returns {string} filename with native separators + */ +const posix2native = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(POSIX_SEP_RE, path$d.sep); + +/** + * convert native separator to posix separator + * + * eg. + * windows: C:\foo\bar -> c:/foo/bar + * linux: /foo/bar -> /foo/bar + * + * @param {string} filename - filename with native separators + * @returns {string} filename with posix separators + */ +const native2posix = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(NATIVE_SEP_RE, path$d.posix.sep); + +/** + * converts params to native separator, resolves path and converts native back to posix + * + * needed on windows to handle posix paths in tsconfig + * + * @param dir {string|null} directory to resolve from + * @param filename {string} filename or pattern to resolve + * @returns string + */ +const resolve2posix = IS_POSIX + ? (dir, filename) => (dir ? path$d.resolve(dir, filename) : path$d.resolve(filename)) + : (dir, filename) => + native2posix( + dir + ? path$d.resolve(posix2native(dir), posix2native(filename)) + : path$d.resolve(posix2native(filename)) + ); + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {string[]} + */ +function resolveReferencedTSConfigFiles(result, options) { + const dir = path$d.dirname(result.tsconfigFile); + return result.tsconfig.references.map((ref) => { + const refPath = ref.path.endsWith('.json') + ? ref.path + : path$d.join(ref.path, options?.configName ?? 'tsconfig.json'); + return resolve2posix(dir, refPath); + }); +} + +/** + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {import('./public.d.ts').TSConfckParseResult} + */ +function resolveSolutionTSConfig(filename, result) { + const allowJs = result.tsconfig.compilerOptions?.allowJs; + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; + if ( + result.referenced && + extensions.some((ext) => filename.endsWith(ext)) && + !isIncluded(filename, result) + ) { + const solutionTSConfig = result.referenced.find((referenced) => + isIncluded(filename, referenced) + ); + if (solutionTSConfig) { + return solutionTSConfig; + } + } + return result; +} + +/** + * + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {boolean} + */ +function isIncluded(filename, result) { + const dir = native2posix(path$d.dirname(result.tsconfigFile)); + const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file)); + const absoluteFilename = resolve2posix(null, filename); + if (files.includes(filename)) { + return true; + } + const allowJs = result.tsconfig.compilerOptions?.allowJs; + const isIncluded = isGlobMatch( + absoluteFilename, + dir, + result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), + allowJs + ); + if (isIncluded) { + const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs); + return !isExcluded; + } + return false; +} + +/** + * test filenames agains glob patterns in tsconfig + * + * @param filename {string} posix style abolute path to filename to test + * @param dir {string} posix style absolute path to directory of tsconfig containing patterns + * @param patterns {string[]} glob patterns to match against + * @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks + * @returns {boolean} true when at least one pattern matches filename + */ +function isGlobMatch(filename, dir, patterns, allowJs) { + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; + return patterns.some((pattern) => { + // filename must end with part of pattern that comes after last wildcard + let lastWildcardIndex = pattern.length; + let hasWildcard = false; + let hasExtension = false; + let hasSlash = false; + let lastSlashIndex = -1; + for (let i = pattern.length - 1; i > -1; i--) { + const c = pattern[i]; + if (!hasWildcard) { + if (c === '*' || c === '?') { + lastWildcardIndex = i; + hasWildcard = true; + } + } + if (!hasSlash) { + if (c === '.') { + hasExtension = true; + } else if (c === '/') { + lastSlashIndex = i; + hasSlash = true; + } + } + if (hasWildcard && hasSlash) { + break; + } + } + if (!hasExtension && (!hasWildcard || lastWildcardIndex < lastSlashIndex)) { + // add implicit glob + pattern += `${pattern.endsWith('/') ? '' : '/'}${GLOB_ALL_PATTERN}`; + lastWildcardIndex = pattern.length - 1; + hasWildcard = true; + } + + // if pattern does not end with wildcard, filename must end with pattern after last wildcard + if ( + lastWildcardIndex < pattern.length - 1 && + !filename.endsWith(pattern.slice(lastWildcardIndex + 1)) + ) { + return false; + } + + // if pattern ends with *, filename must end with a default extension + if (pattern.endsWith('*') && !extensions.some((ext) => filename.endsWith(ext))) { + return false; + } + + // for **/* , filename must start with the dir + if (pattern === GLOB_ALL_PATTERN) { + return filename.startsWith(`${dir}/`); + } + + const resolvedPattern = resolve2posix(dir, pattern); + + // filename must start with part of pattern that comes before first wildcard + let firstWildcardIndex = -1; + for (let i = 0; i < resolvedPattern.length; i++) { + if (resolvedPattern[i] === '*' || resolvedPattern[i] === '?') { + firstWildcardIndex = i; + hasWildcard = true; + break; + } + } + if ( + firstWildcardIndex > 1 && + !filename.startsWith(resolvedPattern.slice(0, firstWildcardIndex - 1)) + ) { + return false; + } + + if (!hasWildcard) { + // no wildcard in pattern, filename must be equal to resolved pattern + return filename === resolvedPattern; + } else if ( + firstWildcardIndex + GLOB_ALL_PATTERN.length === + resolvedPattern.length - (pattern.length - 1 - lastWildcardIndex) && + resolvedPattern.slice(firstWildcardIndex, firstWildcardIndex + GLOB_ALL_PATTERN.length) === + GLOB_ALL_PATTERN + ) { + // singular glob-all pattern and we already validated prefix and suffix matches + return true; + } + // complex pattern, use regex to check it + if (PATTERN_REGEX_CACHE.has(resolvedPattern)) { + return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename); + } + const regex = pattern2regex(resolvedPattern, allowJs); + PATTERN_REGEX_CACHE.set(resolvedPattern, regex); + return regex.test(filename); + }); +} + +/** + * @param {string} resolvedPattern + * @param {boolean} allowJs + * @returns {RegExp} + */ +function pattern2regex(resolvedPattern, allowJs) { + let regexStr = '^'; + for (let i = 0; i < resolvedPattern.length; i++) { + const char = resolvedPattern[i]; + if (char === '?') { + regexStr += '[^\\/]'; + continue; + } + if (char === '*') { + if (resolvedPattern[i + 1] === '*' && resolvedPattern[i + 2] === '/') { + i += 2; + regexStr += '(?:[^\\/]*\\/)*'; // zero or more path segments + continue; + } + regexStr += '[^\\/]*'; + continue; + } + if ('/.+^${}()|[]\\'.includes(char)) { + regexStr += `\\`; + } + regexStr += char; + } + + // add known file endings if pattern ends on * + if (resolvedPattern.endsWith('*')) { + regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP; + } + regexStr += '$'; + + return new RegExp(regexStr); +} + +/** + * replace tokens like ${configDir} + * @param {any} tsconfig + * @param {string} configDir + * @returns {any} + */ +function replaceTokens(tsconfig, configDir) { + return JSON.parse( + JSON.stringify(tsconfig) + // replace ${configDir} + .replaceAll(/"\${configDir}/g, `"${native2posix(configDir)}`) + ); +} + +/** + * find the closest tsconfig.json file + * + * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + * @returns {Promise<string|null>} absolute path to closest tsconfig.json or null if not found + */ +async function find(filename, options) { + let dir = path$d.dirname(path$d.resolve(filename)); + if (options?.ignoreNodeModules && isInNodeModules(dir)) { + return null; + } + const cache = options?.cache; + const configName = options?.configName ?? 'tsconfig.json'; + if (cache?.hasConfigPath(dir, configName)) { + return cache.getConfigPath(dir, configName); + } + const { /** @type {Promise<string|null>} */ promise, resolve, reject } = makePromise(); + if (options?.root && !path$d.isAbsolute(options.root)) { + options.root = path$d.resolve(options.root); + } + findUp(dir, { promise, resolve, reject }, options); + return promise; +} + +/** + * + * @param {string} dir + * @param {{promise:Promise<string|null>,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + */ +function findUp(dir, { resolve, reject, promise }, options) { + const { cache, root, configName } = options ?? {}; + if (cache) { + if (cache.hasConfigPath(dir, configName)) { + let cached; + try { + cached = cache.getConfigPath(dir, configName); + } catch (e) { + reject(e); + return; + } + if (cached?.then) { + cached.then(resolve).catch(reject); + } else { + resolve(cached); + } + } else { + cache.setConfigPath(dir, promise, configName); + } + } + const tsconfig = path$d.join(dir, options?.configName ?? 'tsconfig.json'); + fs__default.stat(tsconfig, (err, stats) => { + if (stats && (stats.isFile() || stats.isFIFO())) { + resolve(tsconfig); + } else if (err?.code !== 'ENOENT') { + reject(err); + } else { + let parent; + if (root === dir || (parent = path$d.dirname(dir)) === dir) { + resolve(null); + } else { + findUp(parent, { promise, resolve, reject }, options); + } + } + }); +} + +/* + this file contains code from strip-bom and strip-json-comments by Sindre Sorhus + https://github.com/sindresorhus/strip-json-comments/blob/v4.0.0/index.js + https://github.com/sindresorhus/strip-bom/blob/v5.0.0/index.js + licensed under MIT, see ../LICENSE +*/ + +/** + * convert content of tsconfig.json to regular json + * + * @param {string} tsconfigJson - content of tsconfig.json + * @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace + */ +function toJson(tsconfigJson) { + const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson))); + if (stripped.trim() === '') { + // only whitespace left after stripping, return empty object so that JSON.parse still works + return '{}'; + } else { + return stripped; + } +} + +/** + * replace dangling commas from pseudo-json string with single space + * implementation heavily inspired by strip-json-comments + * + * @param {string} pseudoJson + * @returns {string} + */ +function stripDanglingComma(pseudoJson) { + let insideString = false; + let offset = 0; + let result = ''; + let danglingCommaPos = null; + for (let i = 0; i < pseudoJson.length; i++) { + const currentCharacter = pseudoJson[i]; + if (currentCharacter === '"') { + const escaped = isEscaped(pseudoJson, i); + if (!escaped) { + insideString = !insideString; + } + } + if (insideString) { + danglingCommaPos = null; + continue; + } + if (currentCharacter === ',') { + danglingCommaPos = i; + continue; + } + if (danglingCommaPos) { + if (currentCharacter === '}' || currentCharacter === ']') { + result += pseudoJson.slice(offset, danglingCommaPos) + ' '; + offset = danglingCommaPos + 1; + danglingCommaPos = null; + } else if (!currentCharacter.match(/\s/)) { + danglingCommaPos = null; + } + } + } + return result + pseudoJson.substring(offset); +} + +// start strip-json-comments +/** + * + * @param {string} jsonString + * @param {number} quotePosition + * @returns {boolean} + */ +function isEscaped(jsonString, quotePosition) { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +} + +/** + * + * @param {string} string + * @param {number?} start + * @param {number?} end + */ +function strip(string, start, end) { + return string.slice(start, end).replace(/\S/g, ' '); +} + +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); + +/** + * @param {string} jsonString + * @returns {string} + */ +function stripJsonComments(jsonString) { + let isInsideString = false; + /** @type {false | symbol} */ + let isInsideComment = false; + let offset = 0; + let result = ''; + + for (let index = 0; index < jsonString.length; index++) { + const currentCharacter = jsonString[index]; + const nextCharacter = jsonString[index + 1]; + + if (!isInsideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, index); + if (!escaped) { + isInsideString = !isInsideString; + } + } + + if (isInsideString) { + continue; + } + + if (!isInsideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, index); + offset = index; + isInsideComment = singleComment; + index++; + } else if (isInsideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + index++; + isInsideComment = false; + result += strip(jsonString, offset, index); + offset = index; + } else if (isInsideComment === singleComment && currentCharacter === '\n') { + isInsideComment = false; + result += strip(jsonString, offset, index); + offset = index; + } else if (!isInsideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, index); + offset = index; + isInsideComment = multiComment; + index++; + } else if (isInsideComment === multiComment && currentCharacter + nextCharacter === '*/') { + index++; + isInsideComment = false; + result += strip(jsonString, offset, index + 1); + offset = index + 1; + } + } + + return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +} +// end strip-json-comments + +// start strip-bom +/** + * @param {string} string + * @returns {string} + */ +function stripBom(string) { + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM). + if (string.charCodeAt(0) === 0xfeff) { + return string.slice(1); + } + return string; +} +// end strip-bom + +const not_found_result = { + tsconfigFile: null, + tsconfig: {} +}; + +/** + * parse the closest tsconfig.json file + * + * @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckParseOptions} [options] - options + * @returns {Promise<import('./public.d.ts').TSConfckParseResult>} + * @throws {TSConfckParseError} + */ +async function parse$f(filename, options) { + /** @type {import('./cache.js').TSConfckCache} */ + const cache = options?.cache; + if (cache?.hasParseResult(filename)) { + return getParsedDeep(filename, cache, options); + } + const { + resolve, + reject, + /** @type {Promise<import('./public.d.ts').TSConfckParseResult>}*/ + promise + } = makePromise(); + cache?.setParseResult(filename, promise, true); + try { + let tsconfigFile = + (await resolveTSConfigJson(filename, cache)) || (await find(filename, options)); + if (!tsconfigFile) { + resolve(not_found_result); + return promise; + } + let result; + if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) { + result = await getParsedDeep(tsconfigFile, cache, options); + } else { + result = await parseFile$1(tsconfigFile, cache, filename === tsconfigFile); + await Promise.all([parseExtends(result, cache), parseReferences(result, options)]); + } + result.tsconfig = replaceTokens(result.tsconfig, path$d.dirname(tsconfigFile)); + resolve(resolveSolutionTSConfig(filename, result)); + } catch (e) { + reject(e); + } + return promise; +} + +/** + * ensure extends and references are parsed + * + * @param {string} filename - cached file + * @param {import('./cache.js').TSConfckCache} cache - cache + * @param {import('./public.d.ts').TSConfckParseOptions} options - options + */ +async function getParsedDeep(filename, cache, options) { + const result = await cache.getParseResult(filename); + if ( + (result.tsconfig.extends && !result.extended) || + (result.tsconfig.references && !result.referenced) + ) { + const promise = Promise.all([ + parseExtends(result, cache), + parseReferences(result, options) + ]).then(() => result); + cache.setParseResult(filename, promise, true); + return promise; + } + return result; +} + +/** + * + * @param {string} tsconfigFile - path to tsconfig file + * @param {import('./cache.js').TSConfckCache} [cache] - cache + * @param {boolean} [skipCache] - skip cache + * @returns {Promise<import('./public.d.ts').TSConfckParseResult>} + */ +async function parseFile$1(tsconfigFile, cache, skipCache) { + if ( + !skipCache && + cache?.hasParseResult(tsconfigFile) && + !cache.getParseResult(tsconfigFile)._isRootFile_ + ) { + return cache.getParseResult(tsconfigFile); + } + const promise = promises$1 + .readFile(tsconfigFile, 'utf-8') + .then(toJson) + .then((json) => { + const parsed = JSON.parse(json); + applyDefaults(parsed, tsconfigFile); + return { + tsconfigFile, + tsconfig: normalizeTSConfig(parsed, path$d.dirname(tsconfigFile)) + }; + }) + .catch((e) => { + throw new TSConfckParseError( + `parsing ${tsconfigFile} failed: ${e}`, + 'PARSE_FILE', + tsconfigFile, + e + ); + }); + if ( + !skipCache && + (!cache?.hasParseResult(tsconfigFile) || !cache.getParseResult(tsconfigFile)._isRootFile_) + ) { + cache?.setParseResult(tsconfigFile, promise); + } + return promise; +} + +/** + * normalize to match the output of ts.parseJsonConfigFileContent + * + * @param {any} tsconfig - typescript tsconfig output + * @param {string} dir - directory + */ +function normalizeTSConfig(tsconfig, dir) { + // set baseUrl to absolute path + const baseUrl = tsconfig.compilerOptions?.baseUrl; + if (baseUrl && !baseUrl.startsWith('${') && !path$d.isAbsolute(baseUrl)) { + tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl); + } + return tsconfig; +} + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {Promise<void>} + */ +async function parseReferences(result, options) { + if (!result.tsconfig.references) { + return; + } + const referencedFiles = resolveReferencedTSConfigFiles(result, options); + const referenced = await Promise.all( + referencedFiles.map((file) => parseFile$1(file, options?.cache)) + ); + await Promise.all(referenced.map((ref) => parseExtends(ref, options?.cache))); + referenced.forEach((ref) => { + ref.solution = result; + }); + result.referenced = referenced; +} + +/** + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./cache.js').TSConfckCache}[cache] + * @returns {Promise<void>} + */ +async function parseExtends(result, cache) { + if (!result.tsconfig.extends) { + return; + } + // use result as first element in extended + // but dereference tsconfig so that mergeExtended can modify the original without affecting extended[0] + /** @type {import('./public.d.ts').TSConfckParseResult[]} */ + const extended = [ + { tsconfigFile: result.tsconfigFile, tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) } + ]; + + // flatten extends graph into extended + let pos = 0; + /** @type {string[]} */ + const extendsPath = []; + let currentBranchDepth = 0; + while (pos < extended.length) { + const extending = extended[pos]; + extendsPath.push(extending.tsconfigFile); + if (extending.tsconfig.extends) { + // keep following this branch + currentBranchDepth += 1; + /** @type {string[]} */ + let resolvedExtends; + if (!Array.isArray(extending.tsconfig.extends)) { + resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)]; + } else { + // reverse because typescript 5.0 treats ['a','b','c'] as c extends b extends a + resolvedExtends = extending.tsconfig.extends + .reverse() + .map((ex) => resolveExtends(ex, extending.tsconfigFile)); + } + + const circularExtends = resolvedExtends.find((tsconfigFile) => + extendsPath.includes(tsconfigFile) + ); + if (circularExtends) { + const circle = extendsPath.concat([circularExtends]).join(' -> '); + throw new TSConfckParseError( + `Circular dependency in "extends": ${circle}`, + 'EXTENDS_CIRCULAR', + result.tsconfigFile + ); + } + // add new extends to the list directly after current + extended.splice( + pos + 1, + 0, + ...(await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache)))) + ); + } else { + // reached a leaf, backtrack to the last branching point and continue + extendsPath.splice(-currentBranchDepth); + currentBranchDepth = 0; + } + pos = pos + 1; + } + result.extended = extended; + // skip first as it is the original config + for (const ext of result.extended.slice(1)) { + extendTSConfig(result, ext); + } +} + +/** + * + * @param {string} extended + * @param {string} from + * @returns {string} + */ +function resolveExtends(extended, from) { + if (extended === '..') { + // see #149 + extended = '../tsconfig.json'; + } + const req = createRequire$2(from); + let error; + try { + return req.resolve(extended); + } catch (e) { + error = e; + } + if (extended[0] !== '.' && !path$d.isAbsolute(extended)) { + try { + return req.resolve(`${extended}/tsconfig.json`); + } catch (e) { + error = e; + } + } + + throw new TSConfckParseError( + `failed to resolve "extends":"${extended}" in ${from}`, + 'EXTENDS_RESOLVE', + from, + error + ); +} + +// references, extends and custom keys are not carried over +const EXTENDABLE_KEYS = [ + 'compilerOptions', + 'files', + 'include', + 'exclude', + 'watchOptions', + 'compileOnSave', + 'typeAcquisition', + 'buildOptions' +]; + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} extending + * @param {import('./public.d.ts').TSConfckParseResult} extended + * @returns void + */ +function extendTSConfig(extending, extended) { + const extendingConfig = extending.tsconfig; + const extendedConfig = extended.tsconfig; + const relativePath = native2posix( + path$d.relative(path$d.dirname(extending.tsconfigFile), path$d.dirname(extended.tsconfigFile)) + ); + for (const key of Object.keys(extendedConfig).filter((key) => EXTENDABLE_KEYS.includes(key))) { + if (key === 'compilerOptions') { + if (!extendingConfig.compilerOptions) { + extendingConfig.compilerOptions = {}; + } + for (const option of Object.keys(extendedConfig.compilerOptions)) { + if (Object.prototype.hasOwnProperty.call(extendingConfig.compilerOptions, option)) { + continue; // already set + } + extendingConfig.compilerOptions[option] = rebaseRelative( + option, + extendedConfig.compilerOptions[option], + relativePath + ); + } + } else if (extendingConfig[key] === undefined) { + if (key === 'watchOptions') { + extendingConfig.watchOptions = {}; + for (const option of Object.keys(extendedConfig.watchOptions)) { + extendingConfig.watchOptions[option] = rebaseRelative( + option, + extendedConfig.watchOptions[option], + relativePath + ); + } + } else { + extendingConfig[key] = rebaseRelative(key, extendedConfig[key], relativePath); + } + } + } +} + +const REBASE_KEYS = [ + // root + 'files', + 'include', + 'exclude', + // compilerOptions + 'baseUrl', + 'rootDir', + 'rootDirs', + 'typeRoots', + 'outDir', + 'outFile', + 'declarationDir', + // watchOptions + 'excludeDirectories', + 'excludeFiles' +]; + +/** @typedef {string | string[]} PathValue */ + +/** + * + * @param {string} key + * @param {PathValue} value + * @param {string} prependPath + * @returns {PathValue} + */ +function rebaseRelative(key, value, prependPath) { + if (!REBASE_KEYS.includes(key)) { + return value; + } + if (Array.isArray(value)) { + return value.map((x) => rebasePath(x, prependPath)); + } else { + return rebasePath(value, prependPath); + } +} + +/** + * + * @param {string} value + * @param {string} prependPath + * @returns {string} + */ +function rebasePath(value, prependPath) { + if (path$d.isAbsolute(value) || value.startsWith('${configDir}')) { + return value; + } else { + // relative paths use posix syntax in tsconfig + return path$d.posix.normalize(path$d.posix.join(prependPath, value)); + } +} + +class TSConfckParseError extends Error { + /** + * error code + * @type {string} + */ + code; + /** + * error cause + * @type { Error | undefined} + */ + cause; + + /** + * absolute path of tsconfig file where the error happened + * @type {string} + */ + tsconfigFile; + /** + * + * @param {string} message - error message + * @param {string} code - error code + * @param {string} tsconfigFile - path to tsconfig file + * @param {Error?} cause - cause of this error + */ + constructor(message, code, tsconfigFile, cause) { + super(message); + // Set the prototype explicitly. + Object.setPrototypeOf(this, TSConfckParseError.prototype); + this.name = TSConfckParseError.name; + this.code = code; + this.cause = cause; + this.tsconfigFile = tsconfigFile; + } +} + +/** + * + * @param {any} tsconfig + * @param {string} tsconfigFile + */ +function applyDefaults(tsconfig, tsconfigFile) { + if (isJSConfig(tsconfigFile)) { + tsconfig.compilerOptions = { + ...DEFAULT_JSCONFIG_COMPILER_OPTIONS, + ...tsconfig.compilerOptions + }; + } +} + +const DEFAULT_JSCONFIG_COMPILER_OPTIONS = { + allowJs: true, + maxNodeModuleJsDepth: 2, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + noEmit: true +}; + +/** + * @param {string} configFileName + */ +function isJSConfig(configFileName) { + return path$d.basename(configFileName) === 'jsconfig.json'; +} + +/** @template T */ +class TSConfckCache { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear() { + this.#configPaths.clear(); + this.#parsed.clear(); + } + + /** + * has cached closest config for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {boolean} + */ + hasConfigPath(dir, configName = 'tsconfig.json') { + return this.#configPaths.has(`${dir}/${configName}`); + } + + /** + * get cached closest tsconfig for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {Promise<string|null>|string|null} + * @throws {unknown} if cached value is an error + */ + getConfigPath(dir, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + const value = this.#configPaths.get(key); + if (value == null || value.length || value.then) { + return value; + } else { + throw value; + } + } + + /** + * has parsed tsconfig for file + * @param {string} file + * @returns {boolean} + */ + hasParseResult(file) { + return this.#parsed.has(file); + } + + /** + * get parsed tsconfig for file + * @param {string} file + * @returns {Promise<T>|T} + * @throws {unknown} if cached value is an error + */ + getParseResult(file) { + const value = this.#parsed.get(file); + if (value.then || value.tsconfig) { + return value; + } else { + throw value; // cached error, rethrow + } + } + + /** + * @internal + * @private + * @param file + * @param {boolean} isRootFile a flag to check if current file which involking the parse() api, used to distinguish the normal cache which only parsed by parseFile() + * @param {Promise<T>} result + */ + setParseResult(file, result, isRootFile = false) { + // _isRootFile_ is a temporary property for Promise result, used to prevent deadlock with cache + Object.defineProperty(result, '_isRootFile_', { + value: isRootFile, + writable: false, + enumerable: false, + configurable: false + }); + this.#parsed.set(file, result); + result + .then((parsed) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, parsed); + } + }) + .catch((e) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, e); + } + }); + } + + /** + * @internal + * @private + * @param {string} dir + * @param {Promise<string|null>} configPath + * @param {string} [configName=tsconfig.json] + */ + setConfigPath(dir, configPath, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + this.#configPaths.set(key, configPath); + configPath + .then((path) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, path); + } + }) + .catch((e) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, e); + } + }); + } + + /** + * map directories to their closest tsconfig.json + * @internal + * @private + * @type{Map<string,(Promise<string|null>|string|null)>} + */ + #configPaths = new Map(); + + /** + * map files to their parsed tsconfig result + * @internal + * @private + * @type {Map<string,(Promise<T>|T)> } + */ + #parsed = new Map(); +} + +const debug$h = createDebugger("vite:esbuild"); +const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/; +const validExtensionRE = /\.\w+$/; +const jsxExtensionsRE = /\.(?:j|t)sx\b/; +const defaultEsbuildSupported = { + "dynamic-import": true, + "import-meta": true +}; +async function transformWithEsbuild(code, filename, options, inMap, config, watcher) { + let loader = options?.loader; + if (!loader) { + const ext = path$d.extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)).slice(1); + if (ext === "cjs" || ext === "mjs") { + loader = "js"; + } else if (ext === "cts" || ext === "mts") { + loader = "ts"; + } else { + loader = ext; + } + } + let tsconfigRaw = options?.tsconfigRaw; + if (typeof tsconfigRaw !== "string") { + const meaningfulFields = [ + "alwaysStrict", + "experimentalDecorators", + "importsNotUsedAsValues", + "jsx", + "jsxFactory", + "jsxFragmentFactory", + "jsxImportSource", + "preserveValueImports", + "target", + "useDefineForClassFields", + "verbatimModuleSyntax" + ]; + const compilerOptionsForFile = {}; + if (loader === "ts" || loader === "tsx") { + try { + const { tsconfig: loadedTsconfig, tsconfigFile } = await loadTsconfigJsonForFile(filename, config); + if (watcher && tsconfigFile && config) { + ensureWatchedFile(watcher, tsconfigFile, config.root); + } + const loadedCompilerOptions = loadedTsconfig.compilerOptions ?? {}; + for (const field of meaningfulFields) { + if (field in loadedCompilerOptions) { + compilerOptionsForFile[field] = loadedCompilerOptions[field]; + } + } + } catch (e) { + if (e instanceof TSConfckParseError) { + if (watcher && e.tsconfigFile && config) { + ensureWatchedFile(watcher, e.tsconfigFile, config.root); + } + } + throw e; + } + } + const compilerOptions = { + ...compilerOptionsForFile, + ...tsconfigRaw?.compilerOptions + }; + if (compilerOptions.useDefineForClassFields === void 0 && compilerOptions.target === void 0) { + compilerOptions.useDefineForClassFields = false; + } + if (options) { + if (options.jsx) compilerOptions.jsx = void 0; + if (options.jsxFactory) compilerOptions.jsxFactory = void 0; + if (options.jsxFragment) compilerOptions.jsxFragmentFactory = void 0; + if (options.jsxImportSource) compilerOptions.jsxImportSource = void 0; + } + tsconfigRaw = { + ...tsconfigRaw, + compilerOptions + }; + } + const resolvedOptions = { + sourcemap: true, + // ensure source file name contains full query + sourcefile: filename, + ...options, + loader, + tsconfigRaw + }; + delete resolvedOptions.include; + delete resolvedOptions.exclude; + delete resolvedOptions.jsxInject; + try { + const result = await transform$1(code, resolvedOptions); + let map; + if (inMap && resolvedOptions.sourcemap) { + const nextMap = JSON.parse(result.map); + nextMap.sourcesContent = []; + map = combineSourcemaps(filename, [ + nextMap, + inMap + ]); + } else { + map = resolvedOptions.sourcemap && resolvedOptions.sourcemap !== "inline" ? JSON.parse(result.map) : { mappings: "" }; + } + return { + ...result, + map + }; + } catch (e) { + debug$h?.(`esbuild error with options used: `, resolvedOptions); + if (e.errors) { + e.frame = ""; + e.errors.forEach((m) => { + if (m.text === "Experimental decorators are not currently enabled" || m.text === "Parameter decorators only work when experimental decorators are enabled") { + m.text += '. Vite 5 now uses esbuild 0.18 and you need to enable them by adding "experimentalDecorators": true in your "tsconfig.json" file.'; + } + e.frame += ` +` + prettifyMessage(m, code); + }); + e.loc = e.errors[0].location; + } + throw e; + } +} +function esbuildPlugin(config) { + const options = config.esbuild; + const { jsxInject, include, exclude, ...esbuildTransformOptions } = options; + const filter = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/); + const transformOptions = { + target: "esnext", + charset: "utf8", + ...esbuildTransformOptions, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false, + // keepNames is not needed when minify is disabled. + // Also transforming multiple times with keepNames enabled breaks + // tree-shaking. (#9164) + keepNames: false, + supported: { + ...defaultEsbuildSupported, + ...esbuildTransformOptions.supported + } + }; + let server; + return { + name: "vite:esbuild", + configureServer(_server) { + server = _server; + }, + async transform(code, id) { + if (filter(id) || filter(cleanUrl(id))) { + const result = await transformWithEsbuild( + code, + id, + transformOptions, + void 0, + config, + server?.watcher + ); + if (result.warnings.length) { + result.warnings.forEach((m) => { + this.warn(prettifyMessage(m, code)); + }); + } + if (jsxInject && jsxExtensionsRE.test(id)) { + result.code = jsxInject + ";" + result.code; + } + return { + code: result.code, + map: result.map + }; + } + } + }; +} +const rollupToEsbuildFormatMap = { + es: "esm", + cjs: "cjs", + // passing `var Lib = (() => {})()` to esbuild with format = "iife" + // will turn it to `(() => { var Lib = (() => {})() })()`, + // so we remove the format config to tell esbuild not doing this + // + // although esbuild doesn't change format, there is still possibility + // that `{ treeShaking: true }` removes a top-level no-side-effect variable + // like: `var Lib = 1`, which becomes `` after esbuild transforming, + // but thankfully rollup does not do this optimization now + iife: void 0 +}; +const buildEsbuildPlugin = (config) => { + return { + name: "vite:esbuild-transpile", + async renderChunk(code, chunk, opts) { + if (opts.__vite_skip_esbuild__) { + return null; + } + const options = resolveEsbuildTranspileOptions(config, opts.format); + if (!options) { + return null; + } + const res = await transformWithEsbuild( + code, + chunk.fileName, + options, + void 0, + config + ); + if (config.build.lib) { + const esbuildCode = res.code; + const contentIndex = opts.format === "iife" ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) : opts.format === "umd" ? esbuildCode.indexOf(`(function(`) : 0; + if (contentIndex > 0) { + const esbuildHelpers = esbuildCode.slice(0, contentIndex); + res.code = esbuildCode.slice(contentIndex).replace(`"use strict";`, `"use strict";` + esbuildHelpers); + } + } + return res; + } + }; +}; +function resolveEsbuildTranspileOptions(config, format) { + const target = config.build.target; + const minify = config.build.minify === "esbuild"; + if ((!target || target === "esnext") && !minify) { + return null; + } + const isEsLibBuild = config.build.lib && format === "es"; + const esbuildOptions = config.esbuild || {}; + const options = { + charset: "utf8", + ...esbuildOptions, + loader: "js", + target: target || void 0, + format: rollupToEsbuildFormatMap[format], + supported: { + ...defaultEsbuildSupported, + ...esbuildOptions.supported + } + }; + if (!minify) { + return { + ...options, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false + }; + } + if (options.minifyIdentifiers != null || options.minifySyntax != null || options.minifyWhitespace != null) { + if (isEsLibBuild) { + return { + ...options, + minify: false, + minifyIdentifiers: options.minifyIdentifiers ?? true, + minifySyntax: options.minifySyntax ?? true, + minifyWhitespace: false, + treeShaking: true + }; + } else { + return { + ...options, + minify: false, + minifyIdentifiers: options.minifyIdentifiers ?? true, + minifySyntax: options.minifySyntax ?? true, + minifyWhitespace: options.minifyWhitespace ?? true, + treeShaking: true + }; + } + } + if (isEsLibBuild) { + return { + ...options, + minify: false, + minifyIdentifiers: true, + minifySyntax: true, + minifyWhitespace: false, + treeShaking: true + }; + } else { + return { + ...options, + minify: true, + treeShaking: true + }; + } +} +function prettifyMessage(m, code) { + let res = colors$1.yellow(m.text); + if (m.location) { + res += ` +` + generateCodeFrame(code, m.location); + } + return res + ` +`; +} +let globalTSConfckCache; +const tsconfckCacheMap = /* @__PURE__ */ new WeakMap(); +function getTSConfckCache(config) { + if (!config) { + return globalTSConfckCache ??= new TSConfckCache(); + } + let cache = tsconfckCacheMap.get(config); + if (!cache) { + cache = new TSConfckCache(); + tsconfckCacheMap.set(config, cache); + } + return cache; +} +async function loadTsconfigJsonForFile(filename, config) { + const { tsconfig, tsconfigFile } = await parse$f(filename, { + cache: getTSConfckCache(config), + ignoreNodeModules: true + }); + return { tsconfigFile, tsconfig }; +} +async function reloadOnTsconfigChange(server, changedFile) { + if (changedFile.endsWith(".json")) { + const cache = getTSConfckCache(server.config); + if (changedFile.endsWith("/tsconfig.json") || cache.hasParseResult(changedFile)) { + server.config.logger.info( + `changed tsconfig file detected: ${changedFile} - Clearing cache and forcing full-reload to ensure TypeScript is compiled with updated config values.`, + { clear: server.config.clearScreen, timestamp: true } + ); + for (const environment of Object.values(server.environments)) { + environment.moduleGraph.invalidateAll(); + } + cache.clear(); + for (const environment of Object.values(server.environments)) { + environment.hot.send({ + type: "full-reload", + path: "*" + }); + } + } + } +} + +// src/realWorker.ts +var Worker = class { + /** @internal */ + _code; + /** @internal */ + _parentFunctions; + /** @internal */ + _max; + /** @internal */ + _pool; + /** @internal */ + _idlePool; + /** @internal */ + _queue; + constructor(fn, options = {}) { + this._code = genWorkerCode(fn, options.parentFunctions ?? {}); + this._parentFunctions = options.parentFunctions ?? {}; + const defaultMax = Math.max( + 1, + // os.availableParallelism is available from Node.js 18.14.0 + (os$3.availableParallelism?.() ?? os$3.cpus().length) - 1 + ); + this._max = options.max || defaultMax; + this._pool = []; + this._idlePool = []; + this._queue = []; + } + async run(...args) { + const worker = await this._getAvailableWorker(); + return new Promise((resolve, reject) => { + worker.currentResolve = resolve; + worker.currentReject = reject; + worker.postMessage({ type: "run", args }); + }); + } + stop() { + this._pool.forEach((w) => w.unref()); + this._queue.forEach( + ([, reject]) => reject( + new Error("Main worker pool stopped before a worker was available.") + ) + ); + this._pool = []; + this._idlePool = []; + this._queue = []; + } + /** @internal */ + async _getAvailableWorker() { + if (this._idlePool.length) { + return this._idlePool.shift(); + } + if (this._pool.length < this._max) { + const worker = new Worker$1(this._code, { eval: true }); + worker.on("message", async (args) => { + if (args.type === "run") { + if ("result" in args) { + worker.currentResolve && worker.currentResolve(args.result); + worker.currentResolve = null; + } else { + if (args.error instanceof ReferenceError) { + args.error.message += ". Maybe you forgot to pass the function to parentFunction?"; + } + worker.currentReject && worker.currentReject(args.error); + worker.currentReject = null; + } + this._assignDoneWorker(worker); + } else if (args.type === "parentFunction") { + try { + const result = await this._parentFunctions[args.name](...args.args); + worker.postMessage({ type: "parentFunction", id: args.id, result }); + } catch (e) { + worker.postMessage({ + type: "parentFunction", + id: args.id, + error: e + }); + } + } + }); + worker.on("error", (err) => { + worker.currentReject && worker.currentReject(err); + worker.currentReject = null; + }); + worker.on("exit", (code) => { + const i = this._pool.indexOf(worker); + if (i > -1) + this._pool.splice(i, 1); + if (code !== 0 && worker.currentReject) { + worker.currentReject( + new Error(`Worker stopped with non-0 exit code ${code}`) + ); + worker.currentReject = null; + } + }); + this._pool.push(worker); + return worker; + } + let resolve; + let reject; + const onWorkerAvailablePromise = new Promise((r, rj) => { + resolve = r; + reject = rj; + }); + this._queue.push([resolve, reject]); + return onWorkerAvailablePromise; + } + /** @internal */ + _assignDoneWorker(worker) { + if (this._queue.length) { + const [resolve] = this._queue.shift(); + resolve(worker); + return; + } + this._idlePool.push(worker); + } +}; +function genWorkerCode(fn, parentFunctions) { + const createParentFunctionCaller = (parentPort) => { + let id = 0; + const resolvers = /* @__PURE__ */ new Map(); + const call = (key) => async (...args) => { + id++; + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + resolvers.set(id, { resolve, reject }); + parentPort.postMessage({ type: "parentFunction", id, name: key, args }); + return await promise; + }; + const receive = (id2, args) => { + if (resolvers.has(id2)) { + const { resolve, reject } = resolvers.get(id2); + resolvers.delete(id2); + if ("result" in args) { + resolve(args.result); + } else { + reject(args.error); + } + } + }; + return { call, receive }; + }; + return ` +const { parentPort } = require('worker_threads') +const parentFunctionCaller = (${createParentFunctionCaller.toString()})(parentPort) + +const doWork = (() => { + ${Object.keys(parentFunctions).map( + (key) => `const ${key} = parentFunctionCaller.call(${JSON.stringify(key)});` + ).join("\n")} + return (${fn.toString()})() +})() + +parentPort.on('message', async (args) => { + if (args.type === 'run') { + try { + const res = await doWork(...args.args) + parentPort.postMessage({ type: 'run', result: res }) + } catch (e) { + parentPort.postMessage({ type: 'run', error: e }) + } + } else if (args.type === 'parentFunction') { + parentFunctionCaller.receive(args.id, args) + } +}) + `; +} +var FakeWorker = class { + /** @internal */ + _fn; + constructor(fn, options = {}) { + const argsAndCode = genFakeWorkerArgsAndCode( + fn, + options.parentFunctions ?? {} + ); + const require2 = createRequire$1(import.meta.url); + this._fn = new Function(...argsAndCode)(require2, options.parentFunctions); + } + async run(...args) { + try { + return await this._fn(...args); + } catch (err) { + if (err instanceof ReferenceError) { + err.message += ". Maybe you forgot to pass the function to parentFunction?"; + } + throw err; + } + } + stop() { + } +}; +function genFakeWorkerArgsAndCode(fn, parentFunctions) { + return [ + "require", + "parentFunctions", + ` +${Object.keys(parentFunctions).map((key) => `const ${key} = parentFunctions[${JSON.stringify(key)}];`).join("\n")} +return (${fn.toString()})() + ` + ]; +} + +// src/workerWithFallback.ts +var WorkerWithFallback = class { + /** @internal */ + _disableReal; + /** @internal */ + _realWorker; + /** @internal */ + _fakeWorker; + /** @internal */ + _shouldUseFake; + constructor(fn, options) { + this._disableReal = options.max !== void 0 && options.max <= 0; + this._realWorker = new Worker(fn, options); + this._fakeWorker = new FakeWorker(fn, options); + this._shouldUseFake = options.shouldUseFake; + } + async run(...args) { + const useFake = this._disableReal || this._shouldUseFake(...args); + return this[useFake ? "_fakeWorker" : "_realWorker"].run(...args); + } + stop() { + this._realWorker.stop(); + this._fakeWorker.stop(); + } +}; + +let terserPath; +const loadTerserPath = (root) => { + if (terserPath) return terserPath; + try { + terserPath = requireResolveFromRootWithFallback(root, "terser"); + } catch (e) { + if (e.code === "MODULE_NOT_FOUND") { + throw new Error( + "terser not found. Since Vite v3, terser has become an optional dependency. You need to install it." + ); + } else { + const message = new Error(`terser failed to load: +${e.message}`); + message.stack = e.stack + "\n" + message.stack; + throw message; + } + } + return terserPath; +}; +function terserPlugin(config) { + const { maxWorkers, ...terserOptions } = config.build.terserOptions; + const makeWorker = () => new Worker( + () => async (terserPath2, code, options) => { + const terser = require(terserPath2); + return terser.minify(code, options); + }, + { + max: maxWorkers + } + ); + let worker; + return { + name: "vite:terser", + applyToEnvironment(environment) { + return !!environment.config.build.minify; + }, + async renderChunk(code, _chunk, outputOptions) { + if (config.build.minify !== "terser" && // @ts-expect-error injected by @vitejs/plugin-legacy + !outputOptions.__vite_force_terser__) { + return null; + } + if (config.build.lib && outputOptions.format === "es") { + return null; + } + worker ||= makeWorker(); + const terserPath2 = loadTerserPath(config.root); + const res = await worker.run(terserPath2, code, { + safari10: true, + ...terserOptions, + sourceMap: !!outputOptions.sourcemap, + module: outputOptions.format.startsWith("es"), + toplevel: outputOptions.format === "cjs" + }); + return { + code: res.code, + map: res.map + }; + }, + closeBundle() { + worker?.stop(); + } + }; +} + +async function resolveEnvironmentPlugins(environment) { + const environmentPlugins = []; + for (const plugin of environment.getTopLevelConfig().plugins) { + if (plugin.applyToEnvironment) { + const applied = await plugin.applyToEnvironment(environment); + if (!applied) { + continue; + } + if (applied !== true) { + environmentPlugins.push( + ...(await asyncFlatten(arraify(applied))).filter( + Boolean + ) + ); + continue; + } + } + environmentPlugins.push(plugin); + } + return environmentPlugins; +} +function perEnvironmentPlugin(name, applyToEnvironment) { + return { + name, + applyToEnvironment + }; +} + +const mimes = { + "3g2": "video/3gpp2", + "3gp": "video/3gpp", + "3gpp": "video/3gpp", + "3mf": "model/3mf", + "aac": "audio/aac", + "ac": "application/pkix-attr-cert", + "adp": "audio/adpcm", + "adts": "audio/aac", + "ai": "application/postscript", + "aml": "application/automationml-aml+xml", + "amlx": "application/automationml-amlx+zip", + "amr": "audio/amr", + "apng": "image/apng", + "appcache": "text/cache-manifest", + "appinstaller": "application/appinstaller", + "appx": "application/appx", + "appxbundle": "application/appxbundle", + "asc": "application/pgp-keys", + "atom": "application/atom+xml", + "atomcat": "application/atomcat+xml", + "atomdeleted": "application/atomdeleted+xml", + "atomsvc": "application/atomsvc+xml", + "au": "audio/basic", + "avci": "image/avci", + "avcs": "image/avcs", + "avif": "image/avif", + "aw": "application/applixware", + "bdoc": "application/bdoc", + "bin": "application/octet-stream", + "bmp": "image/bmp", + "bpk": "application/octet-stream", + "btf": "image/prs.btif", + "btif": "image/prs.btif", + "buffer": "application/octet-stream", + "ccxml": "application/ccxml+xml", + "cdfx": "application/cdfx+xml", + "cdmia": "application/cdmi-capability", + "cdmic": "application/cdmi-container", + "cdmid": "application/cdmi-domain", + "cdmio": "application/cdmi-object", + "cdmiq": "application/cdmi-queue", + "cer": "application/pkix-cert", + "cgm": "image/cgm", + "cjs": "application/node", + "class": "application/java-vm", + "coffee": "text/coffeescript", + "conf": "text/plain", + "cpl": "application/cpl+xml", + "cpt": "application/mac-compactpro", + "crl": "application/pkix-crl", + "css": "text/css", + "csv": "text/csv", + "cu": "application/cu-seeme", + "cwl": "application/cwl", + "cww": "application/prs.cww", + "davmount": "application/davmount+xml", + "dbk": "application/docbook+xml", + "deb": "application/octet-stream", + "def": "text/plain", + "deploy": "application/octet-stream", + "dib": "image/bmp", + "disposition-notification": "message/disposition-notification", + "dist": "application/octet-stream", + "distz": "application/octet-stream", + "dll": "application/octet-stream", + "dmg": "application/octet-stream", + "dms": "application/octet-stream", + "doc": "application/msword", + "dot": "application/msword", + "dpx": "image/dpx", + "drle": "image/dicom-rle", + "dsc": "text/prs.lines.tag", + "dssc": "application/dssc+der", + "dtd": "application/xml-dtd", + "dump": "application/octet-stream", + "dwd": "application/atsc-dwd+xml", + "ear": "application/java-archive", + "ecma": "application/ecmascript", + "elc": "application/octet-stream", + "emf": "image/emf", + "eml": "message/rfc822", + "emma": "application/emma+xml", + "emotionml": "application/emotionml+xml", + "eps": "application/postscript", + "epub": "application/epub+zip", + "exe": "application/octet-stream", + "exi": "application/exi", + "exp": "application/express", + "exr": "image/aces", + "ez": "application/andrew-inset", + "fdf": "application/fdf", + "fdt": "application/fdt+xml", + "fits": "image/fits", + "g3": "image/g3fax", + "gbr": "application/rpki-ghostbusters", + "geojson": "application/geo+json", + "gif": "image/gif", + "glb": "model/gltf-binary", + "gltf": "model/gltf+json", + "gml": "application/gml+xml", + "gpx": "application/gpx+xml", + "gram": "application/srgs", + "grxml": "application/srgs+xml", + "gxf": "application/gxf", + "gz": "application/gzip", + "h261": "video/h261", + "h263": "video/h263", + "h264": "video/h264", + "heic": "image/heic", + "heics": "image/heic-sequence", + "heif": "image/heif", + "heifs": "image/heif-sequence", + "hej2": "image/hej2k", + "held": "application/atsc-held+xml", + "hjson": "application/hjson", + "hlp": "application/winhlp", + "hqx": "application/mac-binhex40", + "hsj2": "image/hsj2", + "htm": "text/html", + "html": "text/html", + "ics": "text/calendar", + "ief": "image/ief", + "ifb": "text/calendar", + "iges": "model/iges", + "igs": "model/iges", + "img": "application/octet-stream", + "in": "text/plain", + "ini": "text/plain", + "ink": "application/inkml+xml", + "inkml": "application/inkml+xml", + "ipfix": "application/ipfix", + "iso": "application/octet-stream", + "its": "application/its+xml", + "jade": "text/jade", + "jar": "application/java-archive", + "jhc": "image/jphc", + "jls": "image/jls", + "jp2": "image/jp2", + "jpe": "image/jpeg", + "jpeg": "image/jpeg", + "jpf": "image/jpx", + "jpg": "image/jpeg", + "jpg2": "image/jp2", + "jpgm": "image/jpm", + "jpgv": "video/jpeg", + "jph": "image/jph", + "jpm": "image/jpm", + "jpx": "image/jpx", + "js": "text/javascript", + "json": "application/json", + "json5": "application/json5", + "jsonld": "application/ld+json", + "jsonml": "application/jsonml+json", + "jsx": "text/jsx", + "jt": "model/jt", + "jxr": "image/jxr", + "jxra": "image/jxra", + "jxrs": "image/jxrs", + "jxs": "image/jxs", + "jxsc": "image/jxsc", + "jxsi": "image/jxsi", + "jxss": "image/jxss", + "kar": "audio/midi", + "ktx": "image/ktx", + "ktx2": "image/ktx2", + "less": "text/less", + "lgr": "application/lgr+xml", + "list": "text/plain", + "litcoffee": "text/coffeescript", + "log": "text/plain", + "lostxml": "application/lost+xml", + "lrf": "application/octet-stream", + "m1v": "video/mpeg", + "m21": "application/mp21", + "m2a": "audio/mpeg", + "m2v": "video/mpeg", + "m3a": "audio/mpeg", + "m4a": "audio/mp4", + "m4p": "application/mp4", + "m4s": "video/iso.segment", + "ma": "application/mathematica", + "mads": "application/mads+xml", + "maei": "application/mmt-aei+xml", + "man": "text/troff", + "manifest": "text/cache-manifest", + "map": "application/json", + "mar": "application/octet-stream", + "markdown": "text/markdown", + "mathml": "application/mathml+xml", + "mb": "application/mathematica", + "mbox": "application/mbox", + "md": "text/markdown", + "mdx": "text/mdx", + "me": "text/troff", + "mesh": "model/mesh", + "meta4": "application/metalink4+xml", + "metalink": "application/metalink+xml", + "mets": "application/mets+xml", + "mft": "application/rpki-manifest", + "mid": "audio/midi", + "midi": "audio/midi", + "mime": "message/rfc822", + "mj2": "video/mj2", + "mjp2": "video/mj2", + "mjs": "text/javascript", + "mml": "text/mathml", + "mods": "application/mods+xml", + "mov": "video/quicktime", + "mp2": "audio/mpeg", + "mp21": "application/mp21", + "mp2a": "audio/mpeg", + "mp3": "audio/mpeg", + "mp4": "video/mp4", + "mp4a": "audio/mp4", + "mp4s": "application/mp4", + "mp4v": "video/mp4", + "mpd": "application/dash+xml", + "mpe": "video/mpeg", + "mpeg": "video/mpeg", + "mpf": "application/media-policy-dataset+xml", + "mpg": "video/mpeg", + "mpg4": "video/mp4", + "mpga": "audio/mpeg", + "mpp": "application/dash-patch+xml", + "mrc": "application/marc", + "mrcx": "application/marcxml+xml", + "ms": "text/troff", + "mscml": "application/mediaservercontrol+xml", + "msh": "model/mesh", + "msi": "application/octet-stream", + "msix": "application/msix", + "msixbundle": "application/msixbundle", + "msm": "application/octet-stream", + "msp": "application/octet-stream", + "mtl": "model/mtl", + "musd": "application/mmt-usd+xml", + "mxf": "application/mxf", + "mxmf": "audio/mobile-xmf", + "mxml": "application/xv+xml", + "n3": "text/n3", + "nb": "application/mathematica", + "nq": "application/n-quads", + "nt": "application/n-triples", + "obj": "model/obj", + "oda": "application/oda", + "oga": "audio/ogg", + "ogg": "audio/ogg", + "ogv": "video/ogg", + "ogx": "application/ogg", + "omdoc": "application/omdoc+xml", + "onepkg": "application/onenote", + "onetmp": "application/onenote", + "onetoc": "application/onenote", + "onetoc2": "application/onenote", + "opf": "application/oebps-package+xml", + "opus": "audio/ogg", + "otf": "font/otf", + "owl": "application/rdf+xml", + "oxps": "application/oxps", + "p10": "application/pkcs10", + "p7c": "application/pkcs7-mime", + "p7m": "application/pkcs7-mime", + "p7s": "application/pkcs7-signature", + "p8": "application/pkcs8", + "pdf": "application/pdf", + "pfr": "application/font-tdpfr", + "pgp": "application/pgp-encrypted", + "pkg": "application/octet-stream", + "pki": "application/pkixcmp", + "pkipath": "application/pkix-pkipath", + "pls": "application/pls+xml", + "png": "image/png", + "prc": "model/prc", + "prf": "application/pics-rules", + "provx": "application/provenance+xml", + "ps": "application/postscript", + "pskcxml": "application/pskc+xml", + "pti": "image/prs.pti", + "qt": "video/quicktime", + "raml": "application/raml+yaml", + "rapd": "application/route-apd+xml", + "rdf": "application/rdf+xml", + "relo": "application/p2p-overlay+xml", + "rif": "application/reginfo+xml", + "rl": "application/resource-lists+xml", + "rld": "application/resource-lists-diff+xml", + "rmi": "audio/midi", + "rnc": "application/relax-ng-compact-syntax", + "rng": "application/xml", + "roa": "application/rpki-roa", + "roff": "text/troff", + "rq": "application/sparql-query", + "rs": "application/rls-services+xml", + "rsat": "application/atsc-rsat+xml", + "rsd": "application/rsd+xml", + "rsheet": "application/urc-ressheet+xml", + "rss": "application/rss+xml", + "rtf": "text/rtf", + "rtx": "text/richtext", + "rusd": "application/route-usd+xml", + "s3m": "audio/s3m", + "sbml": "application/sbml+xml", + "scq": "application/scvp-cv-request", + "scs": "application/scvp-cv-response", + "sdp": "application/sdp", + "senmlx": "application/senml+xml", + "sensmlx": "application/sensml+xml", + "ser": "application/java-serialized-object", + "setpay": "application/set-payment-initiation", + "setreg": "application/set-registration-initiation", + "sgi": "image/sgi", + "sgm": "text/sgml", + "sgml": "text/sgml", + "shex": "text/shex", + "shf": "application/shf+xml", + "shtml": "text/html", + "sieve": "application/sieve", + "sig": "application/pgp-signature", + "sil": "audio/silk", + "silo": "model/mesh", + "siv": "application/sieve", + "slim": "text/slim", + "slm": "text/slim", + "sls": "application/route-s-tsid+xml", + "smi": "application/smil+xml", + "smil": "application/smil+xml", + "snd": "audio/basic", + "so": "application/octet-stream", + "spdx": "text/spdx", + "spp": "application/scvp-vp-response", + "spq": "application/scvp-vp-request", + "spx": "audio/ogg", + "sql": "application/sql", + "sru": "application/sru+xml", + "srx": "application/sparql-results+xml", + "ssdl": "application/ssdl+xml", + "ssml": "application/ssml+xml", + "stk": "application/hyperstudio", + "stl": "model/stl", + "stpx": "model/step+xml", + "stpxz": "model/step-xml+zip", + "stpz": "model/step+zip", + "styl": "text/stylus", + "stylus": "text/stylus", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "swidtag": "application/swid+xml", + "t": "text/troff", + "t38": "image/t38", + "td": "application/urc-targetdesc+xml", + "tei": "application/tei+xml", + "teicorpus": "application/tei+xml", + "text": "text/plain", + "tfi": "application/thraud+xml", + "tfx": "image/tiff-fx", + "tif": "image/tiff", + "tiff": "image/tiff", + "toml": "application/toml", + "tr": "text/troff", + "trig": "application/trig", + "ts": "video/mp2t", + "tsd": "application/timestamped-data", + "tsv": "text/tab-separated-values", + "ttc": "font/collection", + "ttf": "font/ttf", + "ttl": "text/turtle", + "ttml": "application/ttml+xml", + "txt": "text/plain", + "u3d": "model/u3d", + "u8dsn": "message/global-delivery-status", + "u8hdr": "message/global-headers", + "u8mdn": "message/global-disposition-notification", + "u8msg": "message/global", + "ubj": "application/ubjson", + "uri": "text/uri-list", + "uris": "text/uri-list", + "urls": "text/uri-list", + "vcard": "text/vcard", + "vrml": "model/vrml", + "vtt": "text/vtt", + "vxml": "application/voicexml+xml", + "war": "application/java-archive", + "wasm": "application/wasm", + "wav": "audio/wav", + "weba": "audio/webm", + "webm": "video/webm", + "webmanifest": "application/manifest+json", + "webp": "image/webp", + "wgsl": "text/wgsl", + "wgt": "application/widget", + "wif": "application/watcherinfo+xml", + "wmf": "image/wmf", + "woff": "font/woff", + "woff2": "font/woff2", + "wrl": "model/vrml", + "wsdl": "application/wsdl+xml", + "wspolicy": "application/wspolicy+xml", + "x3d": "model/x3d+xml", + "x3db": "model/x3d+fastinfoset", + "x3dbz": "model/x3d+binary", + "x3dv": "model/x3d-vrml", + "x3dvz": "model/x3d+vrml", + "x3dz": "model/x3d+xml", + "xaml": "application/xaml+xml", + "xav": "application/xcap-att+xml", + "xca": "application/xcap-caps+xml", + "xcs": "application/calendar+xml", + "xdf": "application/xcap-diff+xml", + "xdssc": "application/dssc+xml", + "xel": "application/xcap-el+xml", + "xenc": "application/xenc+xml", + "xer": "application/patch-ops-error+xml", + "xfdf": "application/xfdf", + "xht": "application/xhtml+xml", + "xhtml": "application/xhtml+xml", + "xhvml": "application/xv+xml", + "xlf": "application/xliff+xml", + "xm": "audio/xm", + "xml": "text/xml", + "xns": "application/xcap-ns+xml", + "xop": "application/xop+xml", + "xpl": "application/xproc+xml", + "xsd": "application/xml", + "xsf": "application/prs.xsf+xml", + "xsl": "application/xml", + "xslt": "application/xml", + "xspf": "application/xspf+xml", + "xvm": "application/xv+xml", + "xvml": "application/xv+xml", + "yaml": "text/yaml", + "yang": "application/yang", + "yin": "application/yin+xml", + "yml": "text/yaml", + "zip": "application/zip" +}; + +function lookup(extn) { + let tmp = ('' + extn).trim().toLowerCase(); + let idx = tmp.lastIndexOf('.'); + return mimes[!~idx ? tmp : tmp.substring(++idx)]; +} + +const publicFilesMap = /* @__PURE__ */ new WeakMap(); +async function initPublicFiles(config) { + let fileNames; + try { + fileNames = await recursiveReaddir(config.publicDir); + } catch (e) { + if (e.code === ERR_SYMLINK_IN_RECURSIVE_READDIR) { + return; + } + throw e; + } + const publicFiles = new Set( + fileNames.map((fileName) => fileName.slice(config.publicDir.length)) + ); + publicFilesMap.set(config, publicFiles); + return publicFiles; +} +function getPublicFiles(config) { + return publicFilesMap.get(config); +} +function checkPublicFile(url, config) { + const { publicDir } = config; + if (!publicDir || url[0] !== "/") { + return; + } + const fileName = cleanUrl(url); + const publicFiles = getPublicFiles(config); + if (publicFiles) { + return publicFiles.has(fileName) ? normalizePath$3(path$d.join(publicDir, fileName)) : void 0; + } + const publicFile = normalizePath$3(path$d.join(publicDir, fileName)); + if (!publicFile.startsWith(withTrailingSlash(publicDir))) { + return; + } + return fs__default.existsSync(publicFile) ? publicFile : void 0; +} + +const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g; +const jsSourceMapRE = /\.[cm]?js\.map$/; +const noInlineRE = /[?&]no-inline\b/; +const inlineRE$2 = /[?&]inline\b/; +const svgExtRE = /\.svg(?:$|\?)/; +const assetCache = /* @__PURE__ */ new WeakMap(); +const cssEntriesMap = /* @__PURE__ */ new WeakMap(); +function registerCustomMime() { + mimes["ico"] = "image/x-icon"; + mimes["cur"] = "image/x-icon"; + mimes["flac"] = "audio/flac"; + mimes["eot"] = "application/vnd.ms-fontobject"; +} +function renderAssetUrlInJS(pluginContext, chunk, opts, code) { + const { environment } = pluginContext; + const toRelativeRuntime = createToImportMetaURLBasedRelativeRuntime( + opts.format, + environment.config.isWorker + ); + let match; + let s; + assetUrlRE.lastIndex = 0; + while (match = assetUrlRE.exec(code)) { + s ||= new MagicString(code); + const [full, referenceId, postfix = ""] = match; + const file = pluginContext.getFileName(referenceId); + chunk.viteMetadata.importedAssets.add(cleanUrl(file)); + const filename = file + postfix; + const replacement = toOutputFilePathInJS( + environment, + filename, + "asset", + chunk.fileName, + "js", + toRelativeRuntime + ); + const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + const publicAssetUrlMap = publicAssetUrlCache.get( + environment.getTopLevelConfig() + ); + publicAssetUrlRE.lastIndex = 0; + while (match = publicAssetUrlRE.exec(code)) { + s ||= new MagicString(code); + const [full, hash] = match; + const publicUrl = publicAssetUrlMap.get(hash).slice(1); + const replacement = toOutputFilePathInJS( + environment, + publicUrl, + "public", + chunk.fileName, + "js", + toRelativeRuntime + ); + const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + return s; +} +function assetPlugin(config) { + registerCustomMime(); + return { + name: "vite:asset", + perEnvironmentStartEndDuringDev: true, + buildStart() { + assetCache.set(this.environment, /* @__PURE__ */ new Map()); + cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set()); + }, + resolveId(id) { + if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) { + return; + } + const publicFile = checkPublicFile(id, config); + if (publicFile) { + return id; + } + }, + async load(id) { + if (id[0] === "\0") { + return; + } + if (rawRE.test(id)) { + const file = checkPublicFile(id, config) || cleanUrl(id); + this.addWatchFile(file); + return `export default ${JSON.stringify( + await fsp.readFile(file, "utf-8") + )}`; + } + if (!urlRE.test(id) && !config.assetsInclude(cleanUrl(id))) { + return; + } + id = removeUrlQuery(id); + let url = await fileToUrl$1(this, id); + if (!url.startsWith("data:") && this.environment.mode === "dev") { + const mod = this.environment.moduleGraph.getModuleById(id); + if (mod && mod.lastHMRTimestamp > 0) { + url = injectQuery(url, `t=${mod.lastHMRTimestamp}`); + } + } + return { + code: `export default ${JSON.stringify(encodeURIPath(url))}`, + // Force rollup to keep this module from being shared between other entry points if it's an entrypoint. + // If the resulting chunk is empty, it will be removed in generateBundle. + moduleSideEffects: config.command === "build" && this.getModuleInfo(id)?.isEntry ? "no-treeshake" : false, + meta: config.command === "build" ? { "vite:asset": true } : void 0 + }; + }, + renderChunk(code, chunk, opts) { + const s = renderAssetUrlInJS(this, chunk, opts, code); + if (s) { + return { + code: s.toString(), + map: this.environment.config.build.sourcemap ? s.generateMap({ hires: "boundary" }) : null + }; + } else { + return null; + } + }, + generateBundle(_, bundle) { + for (const file in bundle) { + const chunk = bundle[file]; + if (chunk.type === "chunk" && chunk.isEntry && chunk.moduleIds.length === 1 && config.assetsInclude(chunk.moduleIds[0]) && this.getModuleInfo(chunk.moduleIds[0])?.meta["vite:asset"]) { + delete bundle[file]; + } + } + if (config.command === "build" && !this.environment.config.build.emitAssets) { + for (const file in bundle) { + if (bundle[file].type === "asset" && !file.endsWith("ssr-manifest.json") && !jsSourceMapRE.test(file)) { + delete bundle[file]; + } + } + } + } + }; +} +async function fileToUrl$1(pluginContext, id) { + const { environment } = pluginContext; + if (environment.config.command === "serve") { + return fileToDevUrl(environment, id); + } else { + return fileToBuiltUrl(pluginContext, id); + } +} +async function fileToDevUrl(environment, id, skipBase = false) { + const config = environment.getTopLevelConfig(); + const publicFile = checkPublicFile(id, config); + if (inlineRE$2.test(id)) { + const file = publicFile || cleanUrl(id); + const content = await fsp.readFile(file); + return assetToDataURL(environment, file, content); + } + if (svgExtRE.test(id)) { + const file = publicFile || cleanUrl(id); + const content = await fsp.readFile(file); + if (shouldInline(environment, file, id, content, void 0, void 0)) { + return assetToDataURL(environment, file, content); + } + } + let rtn; + if (publicFile) { + rtn = id; + } else if (id.startsWith(withTrailingSlash(config.root))) { + rtn = "/" + path$d.posix.relative(config.root, id); + } else { + rtn = path$d.posix.join(FS_PREFIX, id); + } + if (skipBase) { + return rtn; + } + const base = joinUrlSegments(config.server.origin ?? "", config.decodedBase); + return joinUrlSegments(base, removeLeadingSlash(rtn)); +} +function getPublicAssetFilename(hash, config) { + return publicAssetUrlCache.get(config)?.get(hash); +} +const publicAssetUrlCache = /* @__PURE__ */ new WeakMap(); +const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g; +function publicFileToBuiltUrl(url, config) { + if (config.command !== "build") { + return joinUrlSegments(config.decodedBase, url); + } + const hash = getHash(url); + let cache = publicAssetUrlCache.get(config); + if (!cache) { + cache = /* @__PURE__ */ new Map(); + publicAssetUrlCache.set(config, cache); + } + if (!cache.get(hash)) { + cache.set(hash, url); + } + return `__VITE_PUBLIC_ASSET__${hash}__`; +} +const GIT_LFS_PREFIX = Buffer$1.from("version https://git-lfs.github.com"); +function isGitLfsPlaceholder(content) { + if (content.length < GIT_LFS_PREFIX.length) return false; + return GIT_LFS_PREFIX.compare(content, 0, GIT_LFS_PREFIX.length) === 0; +} +async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceInline) { + const environment = pluginContext.environment; + const topLevelConfig = environment.getTopLevelConfig(); + if (!skipPublicCheck) { + const publicFile = checkPublicFile(id, topLevelConfig); + if (publicFile) { + if (inlineRE$2.test(id)) { + id = publicFile; + } else { + return publicFileToBuiltUrl(id, topLevelConfig); + } + } + } + const cache = assetCache.get(environment); + const cached = cache.get(id); + if (cached) { + return cached; + } + const { file, postfix } = splitFileAndPostfix(id); + const content = await fsp.readFile(file); + let url; + if (shouldInline(environment, file, id, content, pluginContext, forceInline)) { + url = assetToDataURL(environment, file, content); + } else { + const originalFileName = normalizePath$3( + path$d.relative(environment.config.root, file) + ); + const referenceId = pluginContext.emitFile({ + type: "asset", + // Ignore directory structure for asset file names + name: path$d.basename(file), + originalFileName, + source: content + }); + url = `__VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}`; + } + cache.set(id, url); + return url; +} +async function urlToBuiltUrl(pluginContext, url, importer, forceInline) { + const topLevelConfig = pluginContext.environment.getTopLevelConfig(); + if (checkPublicFile(url, topLevelConfig)) { + return publicFileToBuiltUrl(url, topLevelConfig); + } + const file = url[0] === "/" ? path$d.join(topLevelConfig.root, url) : path$d.join(path$d.dirname(importer), url); + return fileToBuiltUrl( + pluginContext, + file, + // skip public check since we just did it above + true, + forceInline + ); +} +function shouldInline(environment, file, id, content, buildPluginContext, forceInline) { + if (noInlineRE.test(id)) return false; + if (inlineRE$2.test(id)) return true; + if (buildPluginContext) { + if (environment.config.build.lib) return true; + if (buildPluginContext.getModuleInfo(id)?.isEntry) return false; + } + if (forceInline !== void 0) return forceInline; + if (file.endsWith(".html")) return false; + if (file.endsWith(".svg") && id.includes("#")) return false; + let limit; + const { assetsInlineLimit } = environment.config.build; + if (typeof assetsInlineLimit === "function") { + const userShouldInline = assetsInlineLimit(file, content); + if (userShouldInline != null) return userShouldInline; + limit = DEFAULT_ASSETS_INLINE_LIMIT; + } else { + limit = Number(assetsInlineLimit); + } + return content.length < limit && !isGitLfsPlaceholder(content); +} +function assetToDataURL(environment, file, content) { + if (environment.config.build.lib && isGitLfsPlaceholder(content)) { + environment.logger.warn( + colors$1.yellow(`Inlined file ${file} was not downloaded via Git LFS`) + ); + } + if (file.endsWith(".svg")) { + return svgToDataURL(content); + } else { + const mimeType = lookup(file) ?? "application/octet-stream"; + return `data:${mimeType};base64,${content.toString("base64")}`; + } +} +const nestedQuotesRE = /"[^"']*'[^"]*"|'[^'"]*"[^']*'/; +function svgToDataURL(content) { + const stringContent = content.toString(); + if (stringContent.includes("<text") || stringContent.includes("<foreignObject") || nestedQuotesRE.test(stringContent)) { + return `data:image/svg+xml;base64,${content.toString("base64")}`; + } else { + return "data:image/svg+xml," + stringContent.trim().replaceAll(/>\s+</g, "><").replaceAll('"', "'").replaceAll("%", "%25").replaceAll("#", "%23").replaceAll("<", "%3c").replaceAll(">", "%3e").replaceAll(/\s+/g, "%20"); + } +} + +const endsWithJSRE = /\.[cm]?js$/; +function manifestPlugin() { + const getState = perEnvironmentState(() => { + return { + manifest: {}, + outputCount: 0, + reset() { + this.outputCount = 0; + } + }; + }); + return { + name: "vite:manifest", + perEnvironmentStartEndDuringDev: true, + applyToEnvironment(environment) { + return !!environment.config.build.manifest; + }, + buildStart() { + getState(this).reset(); + }, + generateBundle({ format }, bundle) { + const state = getState(this); + const { manifest } = state; + const { root } = this.environment.config; + const buildOptions = this.environment.config.build; + function getChunkName(chunk) { + return getChunkOriginalFileName(chunk, root, format) ?? `_` + path$d.basename(chunk.fileName); + } + function getInternalImports(imports) { + const filteredImports = []; + for (const file of imports) { + if (bundle[file] === void 0) { + continue; + } + filteredImports.push(getChunkName(bundle[file])); + } + return filteredImports; + } + function createChunk(chunk) { + const manifestChunk = { + file: chunk.fileName, + name: chunk.name + }; + if (chunk.facadeModuleId) { + manifestChunk.src = getChunkName(chunk); + } + if (chunk.isEntry) { + manifestChunk.isEntry = true; + } + if (chunk.isDynamicEntry) { + manifestChunk.isDynamicEntry = true; + } + if (chunk.imports.length) { + const internalImports = getInternalImports(chunk.imports); + if (internalImports.length > 0) { + manifestChunk.imports = internalImports; + } + } + if (chunk.dynamicImports.length) { + const internalImports = getInternalImports(chunk.dynamicImports); + if (internalImports.length > 0) { + manifestChunk.dynamicImports = internalImports; + } + } + if (chunk.viteMetadata?.importedCss.size) { + manifestChunk.css = [...chunk.viteMetadata.importedCss]; + } + if (chunk.viteMetadata?.importedAssets.size) { + manifestChunk.assets = [...chunk.viteMetadata.importedAssets]; + } + return manifestChunk; + } + function createAsset(asset, src, isEntry) { + const manifestChunk = { + file: asset.fileName, + src + }; + if (isEntry) manifestChunk.isEntry = true; + return manifestChunk; + } + const entryCssReferenceIds = cssEntriesMap.get(this.environment); + const entryCssAssetFileNames = new Set(entryCssReferenceIds); + for (const id of entryCssReferenceIds) { + try { + const fileName = this.getFileName(id); + entryCssAssetFileNames.add(fileName); + } catch { + } + } + const fileNameToAsset = /* @__PURE__ */ new Map(); + for (const file in bundle) { + const chunk = bundle[file]; + if (chunk.type === "chunk") { + manifest[getChunkName(chunk)] = createChunk(chunk); + } else if (chunk.type === "asset" && chunk.names.length > 0) { + const src = chunk.originalFileNames.length > 0 ? chunk.originalFileNames[0] : "_" + path$d.basename(chunk.fileName); + const isEntry = entryCssAssetFileNames.has(chunk.fileName); + const asset = createAsset(chunk, src, isEntry); + const file2 = manifest[src]?.file; + if (!(file2 && endsWithJSRE.test(file2))) { + manifest[src] = asset; + fileNameToAsset.set(chunk.fileName, asset); + } + for (const originalFileName of chunk.originalFileNames.slice(1)) { + const file3 = manifest[originalFileName]?.file; + if (!(file3 && endsWithJSRE.test(file3))) { + manifest[originalFileName] = asset; + } + } + } + } + state.outputCount++; + const output = buildOptions.rollupOptions.output; + const outputLength = Array.isArray(output) ? output.length : 1; + if (state.outputCount >= outputLength) { + this.emitFile({ + fileName: typeof buildOptions.manifest === "string" ? buildOptions.manifest : ".vite/manifest.json", + type: "asset", + source: JSON.stringify(sortObjectKeys(manifest), void 0, 2) + }); + } + } + }; +} +function getChunkOriginalFileName(chunk, root, format) { + if (chunk.facadeModuleId) { + let name = normalizePath$3(path$d.relative(root, chunk.facadeModuleId)); + if (format === "system" && !chunk.name.includes("-legacy")) { + const ext = path$d.extname(name); + const endPos = ext.length !== 0 ? -ext.length : void 0; + name = name.slice(0, endPos) + `-legacy` + ext; + } + return name.replace(/\0/g, ""); + } +} + +const dataUriRE = /^([^/]+\/[^;,]+)(;base64)?,([\s\S]*)$/; +const base64RE = /base64/i; +const dataUriPrefix = `\0/@data-uri/`; +function dataURIPlugin() { + let resolved; + return { + name: "vite:data-uri", + buildStart() { + resolved = /* @__PURE__ */ new Map(); + }, + resolveId(id) { + if (!id.trimStart().startsWith("data:")) { + return; + } + const uri = new URL$3(id); + if (uri.protocol !== "data:") { + return; + } + const match = dataUriRE.exec(uri.pathname); + if (!match) { + return; + } + const [, mime, format, data] = match; + if (mime !== "text/javascript") { + throw new Error( + `data URI with non-JavaScript mime type is not supported. If you're using legacy JavaScript MIME types (such as 'application/javascript'), please use 'text/javascript' instead.` + ); + } + const base64 = format && base64RE.test(format.substring(1)); + const content = base64 ? Buffer.from(data, "base64").toString("utf-8") : data; + resolved.set(id, content); + return dataUriPrefix + id; + }, + load(id) { + if (id.startsWith(dataUriPrefix)) { + return resolved.get(id.slice(dataUriPrefix.length)); + } + } + }; +} + +/* es-module-lexer 1.5.4 */ +var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase";}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const D=[],o=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let o;C.ip()&&(o=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),D.push({n:o,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),D=K?K[0]:"";o.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===D||"'"===D?k(K):K});}function k(A){try{return (0, eval)(A)}catch(A){}}return [D,o,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKm0EwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wEBA39BACgC8AkhBEEAQQAoAogKIgU2AvAJQQAgBDYC9AlBACAFQSRqNgKICiAEQSBqQeAJIAQbIAU2AgBBACgC1AkhBEEAKALQCSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUEANgIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALQCSADRiICOgAYAkACQCACDQBBACgC1AkgA0cNAQtBAEEBOgCMCgsLXgEBf0EAKAL4CSIEQRBqQeQJIAQbQQAoAogKIgQ2AgBBACAENgL4CUEAIARBFGo2AogKQQBBAToAjAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKQCgsVAEEAKALoCSgCAEEAKALcCWtBAXULHgEBf0EAKALoCSgCBCIAQQAoAtwJa0EBdUF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0AQQEgAnRBn4CABHENAgsgAUGgAUYNASAAIQIgARAoDQJBACECQQBBACgCsAoiAEECajYCsAogAC8BAiIADQAMAgsLIAAhAgsgAkH//wNxC6sBAQR/AkACQEEAKAKwCiICLwEAIgNB4QBGDQAgASEEIAAhBQwBC0EAIAJBBGo2ArAKQQEQKSECQQAoArAKIQUCQAJAIAJBIkYNACACQSdGDQAgAhAsGkEAKAKwCiEEDAELIAIQGkEAQQAoArAKQQJqIgQ2ArAKC0EBECkhA0EAKAKwCiECCwJAIAIgBUYNACAFIARBACAAIAAgAUYiAhtBACABIAIbEAILIAMLcgEEf0EAKAKwCiEAQQAoArQKIQECQAJAA0AgAEECaiECIAAgAU8NAQJAAkAgAi8BACIDQaR/ag4CAQQACyACIQAgA0F2ag4EAgEBAgELIABBBGohAAwACwtBACACNgKwChAlQQAPC0EAIAI2ArAKQd0AC0kBA39BACEDAkAgAkUNAAJAA0AgAC0AACIEIAEtAAAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+wBAgBBgAgLzgEAAHgAcABvAHIAdABtAHAAbwByAHQAZgBvAHIAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABB0AkLEAEAAAACAAAAAAQAAEA5AAA=","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E; + +var convertSourceMap$1 = {}; + +(function (exports) { + + Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; + } + }); + + + Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; + } + }); + + var decodeBase64; + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + decodeBase64 = decodeBase64WithBufferFrom; + } else { + decodeBase64 = decodeBase64WithNewBuffer; + } + } else { + decodeBase64 = decodeBase64WithAtob; + } + + function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, 'base64').toString(); + } + + function decodeBase64WithNewBuffer(base64) { + if (typeof value === 'number') { + throw new TypeError('The value to decode must not be of type number.'); + } + return new Buffer(base64, 'base64').toString(); + } + + function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); + } + + function stripComment(sm) { + return sm.split(',').pop(); + } + + function readFromFileMap(sm, read) { + var r = exports.mapFileCommentRegex.exec(sm); + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === 'function') { + return sm.catch(throwError); + } else { + return sm; + } + } catch (e) { + throwError(e); + } + + function throwError(e) { + throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); + } + } + + function Converter (sm, opts) { + opts = opts || {}; + + if (opts.hasComment) { + sm = stripComment(sm); + } + + if (opts.encoding === 'base64') { + sm = decodeBase64(sm); + } else if (opts.encoding === 'uri') { + sm = decodeURIComponent(sm); + } + + if (opts.isJSON || opts.encoding) { + sm = JSON.parse(sm); + } + + this.sourcemap = sm; + } + + Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); + }; + + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + } else { + Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + } + } else { + Converter.prototype.toBase64 = encodeBase64WithBtoa; + } + + function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, 'utf8').toString('base64'); + } + + function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === 'number') { + throw new TypeError('The json to encode must not be of type number.'); + } + return new Buffer(json, 'utf8').toString('base64'); + } + + function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); + } + + Converter.prototype.toURI = function () { + var json = this.toJSON(); + return encodeURIComponent(json); + }; + + Converter.prototype.toComment = function (options) { + var encoding, content, data; + if (options != null && options.encoding === 'uri') { + encoding = ''; + content = this.toURI(); + } else { + encoding = ';base64'; + content = this.toBase64(); + } + data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; + return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; + + // returns copy instead of original + Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); + }; + + Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); + }; + + Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; + }; + + Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; + }; + + exports.fromObject = function (obj) { + return new Converter(obj); + }; + + exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); + }; + + exports.fromURI = function (uri) { + return new Converter(uri, { encoding: 'uri' }); + }; + + exports.fromBase64 = function (base64) { + return new Converter(base64, { encoding: 'base64' }); + }; + + exports.fromComment = function (comment) { + var m, encoding; + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || 'uri'; + return new Converter(comment, { encoding: encoding, hasComment: true }); + }; + + function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); + } + + exports.fromMapFileComment = function (comment, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileComment`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === 'function') { + return sm.then(makeConverter); + } else { + return makeConverter(sm); + } + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromMapFileSource = function (content, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileSource`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; + }; + + exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); + }; + + exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); + }; + + exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; +} (convertSourceMap$1)); + +var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1); + +const debug$g = createDebugger("vite:sourcemap", { + onlyWhenFocused: true +}); +const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/; +async function computeSourceRoute(map, file) { + let sourceRoot; + try { + sourceRoot = await fsp.realpath( + path$d.resolve(path$d.dirname(file), map.sourceRoot || "") + ); + } catch { + } + return sourceRoot; +} +async function injectSourcesContent(map, file, logger) { + let sourceRootPromise; + const missingSources = []; + const sourcesContent = map.sourcesContent || []; + const sourcesContentPromises = []; + for (let index = 0; index < map.sources.length; index++) { + const sourcePath = map.sources[index]; + if (sourcesContent[index] == null && sourcePath && !virtualSourceRE.test(sourcePath)) { + sourcesContentPromises.push( + (async () => { + sourceRootPromise ??= computeSourceRoute(map, file); + const sourceRoot = await sourceRootPromise; + let resolvedSourcePath = cleanUrl(decodeURI(sourcePath)); + if (sourceRoot) { + resolvedSourcePath = path$d.resolve(sourceRoot, resolvedSourcePath); + } + sourcesContent[index] = await fsp.readFile(resolvedSourcePath, "utf-8").catch(() => { + missingSources.push(resolvedSourcePath); + return null; + }); + })() + ); + } + } + await Promise.all(sourcesContentPromises); + map.sourcesContent = sourcesContent; + if (missingSources.length) { + logger.warnOnce(`Sourcemap for "${file}" points to missing source files`); + debug$g?.(`Missing sources: + ` + missingSources.join(` + `)); + } +} +function genSourceMapUrl(map) { + if (typeof map !== "string") { + map = JSON.stringify(map); + } + return `data:application/json;base64,${Buffer.from(map).toString("base64")}`; +} +function getCodeWithSourcemap(type, code, map) { + if (debug$g) { + code += ` +/*${JSON.stringify(map, null, 2).replace(/\*\//g, "*\\/")}*/ +`; + } + if (type === "js") { + code += ` +//# sourceMappingURL=${genSourceMapUrl(map)}`; + } else if (type === "css") { + code += ` +/*# sourceMappingURL=${genSourceMapUrl(map)} */`; + } + return code; +} +function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logger) { + let { x_google_ignoreList } = map; + if (x_google_ignoreList === void 0) { + x_google_ignoreList = []; + } + for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { + const sourcePath = map.sources[sourcesIndex]; + if (!sourcePath) continue; + const ignoreList = sourcemapIgnoreList( + path$d.isAbsolute(sourcePath) ? sourcePath : path$d.resolve(path$d.dirname(sourcemapPath), sourcePath), + sourcemapPath + ); + if (logger && typeof ignoreList !== "boolean") { + logger.warn("sourcemapIgnoreList function must return a boolean."); + } + if (ignoreList && !x_google_ignoreList.includes(sourcesIndex)) { + x_google_ignoreList.push(sourcesIndex); + } + } + if (x_google_ignoreList.length > 0) { + if (!map.x_google_ignoreList) map.x_google_ignoreList = x_google_ignoreList; + } +} +async function extractSourcemapFromFile(code, filePath) { + const map = (convertSourceMap.fromSource(code) || await convertSourceMap.fromMapFileSource( + code, + createConvertSourceMapReadMap(filePath) + ))?.toObject(); + if (map) { + return { + code: code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer), + map + }; + } +} +function createConvertSourceMapReadMap(originalFileName) { + return (filename) => { + return fsp.readFile( + path$d.resolve(path$d.dirname(originalFileName), filename), + "utf-8" + ); + }; +} + +var src$2 = {}; + +// @ts-check +const path$b = require$$0$2; +const fs$7 = require$$0$3; +const os$2 = require$$2; + +const fsReadFileAsync = fs$7.promises.readFile; + +/** @type {(name: string, sync: boolean) => string[]} */ +function getDefaultSearchPlaces(name, sync) { + return [ + 'package.json', + `.${name}rc.json`, + `.${name}rc.js`, + `.${name}rc.cjs`, + ...(sync ? [] : [`.${name}rc.mjs`]), + `.config/${name}rc`, + `.config/${name}rc.json`, + `.config/${name}rc.js`, + `.config/${name}rc.cjs`, + ...(sync ? [] : [`.config/${name}rc.mjs`]), + `${name}.config.js`, + `${name}.config.cjs`, + ...(sync ? [] : [`${name}.config.mjs`]), + ]; +} + +/** + * @type {(p: string) => string} + * + * see #17 + * On *nix, if cwd is not under homedir, + * the last path will be '', ('/build' -> '') + * but it should be '/' actually. + * And on Windows, this will never happen. ('C:\build' -> 'C:') + */ +function parentDir(p) { + return path$b.dirname(p) || path$b.sep; +} + +/** @type {import('./index').LoaderSync} */ +const jsonLoader = (_, content) => JSON.parse(content); +// Use plain require in webpack context for dynamic import +const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require; +/** @type {import('./index').LoadersSync} */ +const defaultLoadersSync = Object.freeze({ + '.js': requireFunc, + '.json': requireFunc, + '.cjs': requireFunc, + noExt: jsonLoader, +}); +src$2.defaultLoadersSync = defaultLoadersSync; + +/** @type {import('./index').Loader} */ +const dynamicImport = async id => { + try { + const mod = await import(/* webpackIgnore: true */ id); + + return mod.default; + } catch (e) { + try { + return requireFunc(id); + } catch (/** @type {any} */ requireE) { + if ( + requireE.code === 'ERR_REQUIRE_ESM' || + (requireE instanceof SyntaxError && + requireE + .toString() + .includes('Cannot use import statement outside a module')) + ) { + throw e; + } + throw requireE; + } + } +}; + +/** @type {import('./index').Loaders} */ +const defaultLoaders = Object.freeze({ + '.js': dynamicImport, + '.mjs': dynamicImport, + '.cjs': dynamicImport, + '.json': jsonLoader, + noExt: jsonLoader, +}); +src$2.defaultLoaders = defaultLoaders; + +/** + * @param {string} name + * @param {import('./index').Options | import('./index').OptionsSync} options + * @param {boolean} sync + * @returns {Required<import('./index').Options | import('./index').OptionsSync>} + */ +function getOptions(name, options, sync) { + /** @type {Required<import('./index').Options>} */ + const conf = { + stopDir: os$2.homedir(), + searchPlaces: getDefaultSearchPlaces(name, sync), + ignoreEmptySearchPlaces: true, + cache: true, + transform: x => x, + packageProp: [name], + ...options, + loaders: { + ...(sync ? defaultLoadersSync : defaultLoaders), + ...options.loaders, + }, + }; + conf.searchPlaces.forEach(place => { + const key = path$b.extname(place) || 'noExt'; + const loader = conf.loaders[key]; + if (!loader) { + throw new Error(`Missing loader for extension "${place}"`); + } + + if (typeof loader !== 'function') { + throw new Error( + `Loader for extension "${place}" is not a function: Received ${typeof loader}.`, + ); + } + }); + + return conf; +} + +/** @type {(props: string | string[], obj: Record<string, any>) => unknown} */ +function getPackageProp(props, obj) { + if (typeof props === 'string' && props in obj) return obj[props]; + return ( + (Array.isArray(props) ? props : props.split('.')).reduce( + (acc, prop) => (acc === undefined ? acc : acc[prop]), + obj, + ) || null + ); +} + +/** @param {string} filepath */ +function validateFilePath(filepath) { + if (!filepath) throw new Error('load must pass a non-empty string'); +} + +/** @type {(loader: import('./index').Loader, ext: string) => void} */ +function validateLoader(loader, ext) { + if (!loader) throw new Error(`No loader specified for extension "${ext}"`); + if (typeof loader !== 'function') throw new Error('loader is not a function'); +} + +/** @type {(enableCache: boolean) => <T>(c: Map<string, T>, filepath: string, res: T) => T} */ +const makeEmplace = enableCache => (c, filepath, res) => { + if (enableCache) c.set(filepath, res); + return res; +}; + +/** @type {import('./index').lilconfig} */ +src$2.lilconfig = function lilconfig(name, options) { + const { + ignoreEmptySearchPlaces, + loaders, + packageProp, + searchPlaces, + stopDir, + transform, + cache, + } = getOptions(name, options ?? {}, false); + const searchCache = new Map(); + const loadCache = new Map(); + const emplace = makeEmplace(cache); + + return { + async search(searchFrom = process.cwd()) { + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: '', + }; + + /** @type {Set<string>} */ + const visited = new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache) { + const r = searchCache.get(dir); + if (r !== undefined) { + for (const p of visited) searchCache.set(p, r); + return r; + } + visited.add(dir); + } + + for (const searchPlace of searchPlaces) { + const filepath = path$b.join(dir, searchPlace); + try { + await fs$7.promises.access(filepath); + } catch { + continue; + } + const content = String(await fsReadFileAsync(filepath)); + const loaderKey = path$b.extname(searchPlace) || 'noExt'; + const loader = loaders[loaderKey]; + + // handle package.json + if (searchPlace === 'package.json') { + const pkg = await loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + + continue; + } + + // handle other type of configs + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) continue; + + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } else { + validateLoader(loader, loaderKey); + result.config = await loader(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) break dirLoop; + dir = parentDir(dir); + } + + const transformed = + // not found + result.filepath === '' && result.config === null + ? transform(null) + : transform(result); + + if (cache) { + for (const p of visited) searchCache.set(p, transformed); + } + + return transformed; + }, + async load(filepath) { + validateFilePath(filepath); + const absPath = path$b.resolve(process.cwd(), filepath); + if (cache && loadCache.has(absPath)) { + return loadCache.get(absPath); + } + const {base, ext} = path$b.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + const content = String(await fsReadFileAsync(absPath)); + + if (base === 'package.json') { + const pkg = await loader(absPath, content); + return emplace( + loadCache, + absPath, + transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + }), + ); + } + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: absPath, + }; + // handle other type of configs + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return emplace( + loadCache, + absPath, + transform({ + config: undefined, + filepath: absPath, + isEmpty: true, + }), + ); + + // cosmiconfig returns undefined for empty files + result.config = isEmpty ? undefined : await loader(absPath, content); + + return emplace( + loadCache, + absPath, + transform(isEmpty ? {...result, isEmpty, config: undefined} : result), + ); + }, + clearLoadCache() { + if (cache) loadCache.clear(); + }, + clearSearchCache() { + if (cache) searchCache.clear(); + }, + clearCaches() { + if (cache) { + loadCache.clear(); + searchCache.clear(); + } + }, + }; +}; + +/** @type {import('./index').lilconfigSync} */ +src$2.lilconfigSync = function lilconfigSync(name, options) { + const { + ignoreEmptySearchPlaces, + loaders, + packageProp, + searchPlaces, + stopDir, + transform, + cache, + } = getOptions(name, options ?? {}, true); + const searchCache = new Map(); + const loadCache = new Map(); + const emplace = makeEmplace(cache); + + return { + search(searchFrom = process.cwd()) { + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: '', + }; + + /** @type {Set<string>} */ + const visited = new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache) { + const r = searchCache.get(dir); + if (r !== undefined) { + for (const p of visited) searchCache.set(p, r); + return r; + } + visited.add(dir); + } + + for (const searchPlace of searchPlaces) { + const filepath = path$b.join(dir, searchPlace); + try { + fs$7.accessSync(filepath); + } catch { + continue; + } + const loaderKey = path$b.extname(searchPlace) || 'noExt'; + const loader = loaders[loaderKey]; + const content = String(fs$7.readFileSync(filepath)); + + // handle package.json + if (searchPlace === 'package.json') { + const pkg = loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + + continue; + } + + // handle other type of configs + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) continue; + + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } else { + validateLoader(loader, loaderKey); + result.config = loader(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) break dirLoop; + dir = parentDir(dir); + } + + const transformed = + // not found + result.filepath === '' && result.config === null + ? transform(null) + : transform(result); + + if (cache) { + for (const p of visited) searchCache.set(p, transformed); + } + + return transformed; + }, + load(filepath) { + validateFilePath(filepath); + const absPath = path$b.resolve(process.cwd(), filepath); + if (cache && loadCache.has(absPath)) { + return loadCache.get(absPath); + } + const {base, ext} = path$b.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + + const content = String(fs$7.readFileSync(absPath)); + + if (base === 'package.json') { + const pkg = loader(absPath, content); + return transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + }); + } + const result = { + config: null, + filepath: absPath, + }; + // handle other type of configs + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return emplace( + loadCache, + absPath, + transform({ + filepath: absPath, + config: undefined, + isEmpty: true, + }), + ); + + // cosmiconfig returns undefined for empty files + result.config = isEmpty ? undefined : loader(absPath, content); + + return emplace( + loadCache, + absPath, + transform(isEmpty ? {...result, isEmpty, config: undefined} : result), + ); + }, + clearLoadCache() { + if (cache) loadCache.clear(); + }, + clearSearchCache() { + if (cache) searchCache.clear(); + }, + clearCaches() { + if (cache) { + loadCache.clear(); + searchCache.clear(); + } + }, + }; +}; + +// @ts-check +const { createRequire } = require$$0$5; +const { fileURLToPath, pathToFileURL } = require$$1$1; + +const TS_EXT_RE = /\.[mc]?ts$/; + +let tsx; + +let jiti; + +let importError = []; + +/** + * @param {string} name + * @param {string} rootFile + * @returns {Promise<any>} + */ +async function req$3(name, rootFile = fileURLToPath(import.meta.url)) { + let url = createRequire(rootFile).resolve(name); + + try { + return (await import(`${pathToFileURL(url)}?t=${Date.now()}`)).default + } catch (err) { + if (!TS_EXT_RE.test(url)) { + /* c8 ignore start */ + throw err + } + } + + if (tsx === undefined) { + try { + tsx = await import('tsx/cjs/api'); + } catch (error) { + importError.push(error); + } + } + + if (tsx) { + let loaded = tsx.require(name, rootFile); + return loaded && '__esModule' in loaded ? loaded.default : loaded + } + + if (jiti === undefined) { + try { + jiti = (await import('jiti')).default; + } catch (error) { + importError.push(error); + } + } + + if (jiti) { + return jiti(rootFile, { interopDefault: true })(name) + } + + throw new Error( + `'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError + .map(error => error.message) + .join('\n')}` + ) +} + +var req_1 = req$3; + +// @ts-check +const req$2 = req_1; + +/** + * Load Options + * + * @private + * @method options + * + * @param {Object} config PostCSS Config + * + * @return {Promise<Object>} options PostCSS Options + */ +async function options(config, file) { + if (config.parser && typeof config.parser === 'string') { + try { + config.parser = await req$2(config.parser, file); + } catch (err) { + throw new Error( + `Loading PostCSS Parser failed: ${err.message}\n\n(@${file})` + ) + } + } + + if (config.syntax && typeof config.syntax === 'string') { + try { + config.syntax = await req$2(config.syntax, file); + } catch (err) { + throw new Error( + `Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})` + ) + } + } + + if (config.stringifier && typeof config.stringifier === 'string') { + try { + config.stringifier = await req$2(config.stringifier, file); + } catch (err) { + throw new Error( + `Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})` + ) + } + } + + return config +} + +var options_1 = options; + +// @ts-check +const req$1 = req_1; + +/** + * Plugin Loader + * + * @private + * @method load + * + * @param {String} plugin PostCSS Plugin Name + * @param {Object} options PostCSS Plugin Options + * + * @return {Promise<Function>} PostCSS Plugin + */ +async function load(plugin, options, file) { + try { + if ( + options === null || + options === undefined || + Object.keys(options).length === 0 + ) { + return await req$1(plugin, file) + } else { + return (await req$1(plugin, file))(options) + /* c8 ignore next */ + } + } catch (err) { + throw new Error( + `Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})` + ) + } +} + +/** + * Load Plugins + * + * @private + * @method plugins + * + * @param {Object} config PostCSS Config Plugins + * + * @return {Promise<Array>} plugins PostCSS Plugins + */ +async function plugins(config, file) { + let list = []; + + if (Array.isArray(config.plugins)) { + list = config.plugins.filter(Boolean); + } else { + list = Object.entries(config.plugins) + .filter(([, options]) => { + return options !== false + }) + .map(([plugin, options]) => { + return load(plugin, options, file) + }); + list = await Promise.all(list); + } + + if (list.length && list.length > 0) { + list.forEach((plugin, i) => { + if (plugin.default) { + plugin = plugin.default; + } + + if (plugin.postcss === true) { + plugin = plugin(); + } else if (plugin.postcss) { + plugin = plugin.postcss; + } + + if ( + !( + (typeof plugin === 'object' && Array.isArray(plugin.plugins)) || + (typeof plugin === 'object' && plugin.postcssPlugin) || + typeof plugin === 'function' + ) + ) { + throw new TypeError( + `Invalid PostCSS Plugin found at: plugins[${i}]\n\n(@${file})` + ) + } + }); + } + + return list +} + +var plugins_1 = plugins; + +// @ts-check +const { resolve } = path$d; + +const config$1 = src$2; + +const loadOptions = options_1; +const loadPlugins = plugins_1; +const req = req_1; + +const interopRequireDefault = obj => + obj && obj.__esModule ? obj : { default: obj }; + +/** + * Process the result from cosmiconfig + * + * @param {Object} ctx Config Context + * @param {Object} result Cosmiconfig result + * + * @return {Promise<Object>} PostCSS Config + */ +async function processResult(ctx, result) { + let file = result.filepath || ''; + let projectConfig = interopRequireDefault(result.config).default || {}; + + if (typeof projectConfig === 'function') { + projectConfig = projectConfig(ctx); + } else { + projectConfig = Object.assign({}, projectConfig, ctx); + } + + if (!projectConfig.plugins) { + projectConfig.plugins = []; + } + + let res = { + file, + options: await loadOptions(projectConfig, file), + plugins: await loadPlugins(projectConfig, file) + }; + delete projectConfig.plugins; + return res +} + +/** + * Builds the Config Context + * + * @param {Object} ctx Config Context + * + * @return {Object} Config Context + */ +function createContext(ctx) { + /** + * @type {Object} + * + * @prop {String} cwd=process.cwd() Config search start location + * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined` + */ + ctx = Object.assign( + { + cwd: process.cwd(), + env: process.env.NODE_ENV + }, + ctx + ); + + if (!ctx.env) { + process.env.NODE_ENV = 'development'; + } + + return ctx +} + +async function loader(filepath) { + return req(filepath) +} + +let yaml; +async function yamlLoader(_, content) { + if (!yaml) { + try { + yaml = await import('yaml'); + } catch (e) { + /* c8 ignore start */ + throw new Error( + `'yaml' is required for the YAML configuration files. Make sure it is installed\nError: ${e.message}` + ) + } + } + return yaml.parse(content); +} + +/** @return {import('lilconfig').Options} */ +const withLoaders = (options = {}) => { + let moduleName = 'postcss'; + + return { + ...options, + loaders: { + ...options.loaders, + '.cjs': loader, + '.cts': loader, + '.js': loader, + '.mjs': loader, + '.mts': loader, + '.ts': loader, + '.yaml': yamlLoader, + '.yml': yamlLoader + }, + searchPlaces: [ + ...(options.searchPlaces || []), + 'package.json', + `.${moduleName}rc`, + `.${moduleName}rc.json`, + `.${moduleName}rc.yaml`, + `.${moduleName}rc.yml`, + `.${moduleName}rc.ts`, + `.${moduleName}rc.cts`, + `.${moduleName}rc.mts`, + `.${moduleName}rc.js`, + `.${moduleName}rc.cjs`, + `.${moduleName}rc.mjs`, + `${moduleName}.config.ts`, + `${moduleName}.config.cts`, + `${moduleName}.config.mts`, + `${moduleName}.config.js`, + `${moduleName}.config.cjs`, + `${moduleName}.config.mjs` + ] + } +}; + +/** + * Load Config + * + * @method rc + * + * @param {Object} ctx Config Context + * @param {String} path Config Path + * @param {Object} options Config Options + * + * @return {Promise} config PostCSS Config + */ +function rc(ctx, path, options) { + /** + * @type {Object} The full Config Context + */ + ctx = createContext(ctx); + + /** + * @type {String} `process.cwd()` + */ + path = path ? resolve(path) : process.cwd(); + + return config$1 + .lilconfig('postcss', withLoaders(options)) + .search(path) + .then(result => { + if (!result) { + throw new Error(`No PostCSS Config found in: ${path}`) + } + return processResult(ctx, result) + }) +} + +/** + * Autoload Config for PostCSS + * + * @author Michael Ciniawsky @michael-ciniawsky <michael.ciniawsky@gmail.com> + * @license MIT + * + * @module postcss-load-config + * @version 2.1.0 + * + * @requires comsiconfig + * @requires ./options + * @requires ./plugins + */ +var src$1 = rc; + +var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1); + +// src/index.ts +var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g; +function convertPosixPathToPattern(path2) { + return escapePosixPath(path2); +} +function convertWin32PathToPattern(path2) { + return escapeWin32Path(path2).replace(ESCAPED_WIN32_BACKSLASHES, "/"); +} +process.platform === "win32" ? convertWin32PathToPattern : convertPosixPathToPattern; +var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g; +var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g; +var escapePosixPath = (path2) => path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"); +var escapeWin32Path = (path2) => path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"); +var escapePath = process.platform === "win32" ? escapeWin32Path : escapePosixPath; +function isDynamicPattern(pattern, options) { + const scan = picomatch$5.scan(pattern); + return scan.isGlob || scan.negated; +} + +// src/index.ts +function normalizePattern(pattern, expandDirectories, cwd, properties, isIgnore) { + var _a; + let result = pattern; + if (pattern.endsWith("/")) { + result = pattern.slice(0, -1); + } + if (!result.endsWith("*") && expandDirectories) { + result += "/**"; + } + if (require$$0$2.isAbsolute(result.replace(/\\(?=[()[\]{}!*+?@|])/g, ""))) { + result = posix.relative(cwd, result); + } else { + result = posix.normalize(result); + } + const parentDirectoryMatch = /^(\/?\.\.)+/.exec(result); + if (parentDirectoryMatch == null ? void 0 : parentDirectoryMatch[0]) { + const potentialRoot = posix.join(cwd, parentDirectoryMatch[0]); + if (properties.root.length > potentialRoot.length) { + properties.root = potentialRoot; + properties.depthOffset = -(parentDirectoryMatch[0].length + 1) / 3; + } + } else if (!isIgnore && properties.depthOffset >= 0) { + const current = result.split("/"); + (_a = properties.commonPath) != null ? _a : properties.commonPath = current; + const newCommonPath = []; + for (let i = 0; i < Math.min(properties.commonPath.length, current.length); i++) { + const part = current[i]; + if (part === "**" && !current[i + 1]) { + newCommonPath.pop(); + break; + } + if (part !== properties.commonPath[i] || isDynamicPattern(part) || i === current.length - 1) { + break; + } + newCommonPath.push(part); + } + properties.depthOffset = newCommonPath.length; + properties.commonPath = newCommonPath; + properties.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd; + } + return result; +} +function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, properties) { + if (typeof patterns === "string") { + patterns = [patterns]; + } else if (!patterns) { + patterns = ["**/*"]; + } + if (typeof ignore === "string") { + ignore = [ignore]; + } + const matchPatterns = []; + const ignorePatterns = []; + for (const pattern of ignore) { + if (!pattern.startsWith("!") || pattern[1] === "(") { + const newPattern = normalizePattern(pattern, expandDirectories, cwd, properties, true); + ignorePatterns.push(newPattern); + } + } + for (const pattern of patterns) { + if (!pattern.startsWith("!") || pattern[1] === "(") { + const newPattern = normalizePattern(pattern, expandDirectories, cwd, properties, false); + matchPatterns.push(newPattern); + } else if (pattern[1] !== "!" || pattern[2] === "(") { + const newPattern = normalizePattern(pattern.slice(1), expandDirectories, cwd, properties, true); + ignorePatterns.push(newPattern); + } + } + return { match: matchPatterns, ignore: ignorePatterns }; +} +function getRelativePath(path2, cwd, root) { + return posix.relative(cwd, `${root}/${path2}`); +} +function processPath(path2, cwd, root, isDirectory, absolute) { + const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2; + if (root === cwd) { + return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath; + } + return getRelativePath(relativePath, cwd, root); +} +function crawl(options, cwd, sync) { + const properties = { + root: cwd, + commonPath: null, + depthOffset: 0 + }; + const processed = processPatterns(options, cwd, properties); + const matcher = picomatch$5(processed.match, { + dot: options.dot, + nocase: options.caseSensitiveMatch === false, + ignore: processed.ignore + }); + const exclude = picomatch$5(processed.ignore, { + dot: options.dot, + nocase: options.caseSensitiveMatch === false + }); + const fdirOptions = { + // use relative paths in the matcher + filters: [(p, isDirectory) => matcher(processPath(p, cwd, properties.root, isDirectory, options.absolute))], + exclude: (_, p) => exclude(processPath(p, cwd, properties.root, true, true)), + pathSeparator: "/", + relativePaths: true, + resolveSymlinks: true + }; + if (options.deep) { + fdirOptions.maxDepth = Math.round(options.deep - properties.depthOffset); + } + if (options.absolute) { + fdirOptions.relativePaths = false; + fdirOptions.resolvePaths = true; + fdirOptions.includeBasePath = true; + } + if (options.followSymbolicLinks === false) { + fdirOptions.resolveSymlinks = false; + fdirOptions.excludeSymlinks = true; + } + if (options.onlyDirectories) { + fdirOptions.excludeFiles = true; + fdirOptions.includeDirs = true; + } else if (options.onlyFiles === false) { + fdirOptions.includeDirs = true; + } + properties.root = properties.root.replace(/\\/g, ""); + const api = new dist.fdir(fdirOptions).crawl(properties.root); + if (cwd === properties.root || options.absolute) { + return sync ? api.sync() : api.withPromise(); + } + return sync ? api.sync().map((p) => getRelativePath(p, cwd, properties.root) + (!p || p.endsWith("/") ? "/" : "")) : api.withPromise().then((paths) => paths.map((p) => getRelativePath(p, cwd, properties.root) + (!p || p.endsWith("/") ? "/" : ""))); +} +async function glob(patternsOrOptions, options) { + if (patternsOrOptions && (options == null ? void 0 : options.patterns)) { + throw new Error("Cannot pass patterns as both an argument and an option"); + } + const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions; + const cwd = opts.cwd ? require$$0$2.resolve(opts.cwd).replace(/\\/g, "/") : process.cwd().replace(/\\/g, "/"); + return crawl(opts, cwd, false); +} +function globSync(patternsOrOptions, options) { + if (patternsOrOptions && (options == null ? void 0 : options.patterns)) { + throw new Error("Cannot pass patterns as both an argument and an option"); + } + const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? { ...options, patterns: patternsOrOptions } : patternsOrOptions; + const cwd = opts.cwd ? require$$0$2.resolve(opts.cwd).replace(/\\/g, "/") : process.cwd().replace(/\\/g, "/"); + return crawl(opts, cwd, true); +} + +function matches$1(pattern, importee) { + if (pattern instanceof RegExp) { + return pattern.test(importee); + } + if (importee.length < pattern.length) { + return false; + } + if (importee === pattern) { + return true; + } + // eslint-disable-next-line prefer-template + return importee.startsWith(pattern + '/'); +} +function getEntries({ entries, customResolver }) { + if (!entries) { + return []; + } + const resolverFunctionFromOptions = resolveCustomResolver(customResolver); + if (Array.isArray(entries)) { + return entries.map((entry) => { + return { + find: entry.find, + replacement: entry.replacement, + resolverFunction: resolveCustomResolver(entry.customResolver) || resolverFunctionFromOptions + }; + }); + } + return Object.entries(entries).map(([key, value]) => { + return { find: key, replacement: value, resolverFunction: resolverFunctionFromOptions }; + }); +} +function getHookFunction(hook) { + if (typeof hook === 'function') { + return hook; + } + if (hook && 'handler' in hook && typeof hook.handler === 'function') { + return hook.handler; + } + return null; +} +function resolveCustomResolver(customResolver) { + if (typeof customResolver === 'function') { + return customResolver; + } + if (customResolver) { + return getHookFunction(customResolver.resolveId); + } + return null; +} +function alias$1(options = {}) { + const entries = getEntries(options); + if (entries.length === 0) { + return { + name: 'alias', + resolveId: () => null + }; + } + return { + name: 'alias', + async buildStart(inputOptions) { + await Promise.all([...(Array.isArray(options.entries) ? options.entries : []), options].map(({ customResolver }) => { var _a; return customResolver && ((_a = getHookFunction(customResolver.buildStart)) === null || _a === void 0 ? void 0 : _a.call(this, inputOptions)); })); + }, + resolveId(importee, importer, resolveOptions) { + // First match is supposed to be the correct one + const matchedEntry = entries.find((entry) => matches$1(entry.find, importee)); + if (!matchedEntry) { + return null; + } + const updatedId = importee.replace(matchedEntry.find, matchedEntry.replacement); + if (matchedEntry.resolverFunction) { + return matchedEntry.resolverFunction.call(this, updatedId, importer, resolveOptions); + } + return this.resolve(updatedId, importer, Object.assign({ skipSelf: true }, resolveOptions)).then((resolved) => { + if (resolved) + return resolved; + if (!require$$0$2.isAbsolute(updatedId)) { + this.warn(`rewrote ${importee} to ${updatedId} but was not an abolute path and was not handled by other plugins. ` + + `This will lead to duplicated modules for the same path. ` + + `To avoid duplicating modules, you should resolve to an absolute path.`); + } + return { id: updatedId }; + }); + } + }; +} + +function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",1),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)} + +const HASH_RE = /#/g; +const AMPERSAND_RE = /&/g; +const SLASH_RE = /\//g; +const EQUAL_RE = /=/g; +const PLUS_RE = /\+/g; +const ENC_CARET_RE = /%5e/gi; +const ENC_BACKTICK_RE = /%60/gi; +const ENC_PIPE_RE = /%7c/gi; +const ENC_SPACE_RE = /%20/gi; +function encode(text) { + return encodeURI("" + text).replace(ENC_PIPE_RE, "|"); +} +function encodeQueryValue(input) { + return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F"); +} +function encodeQueryKey(text) { + return encodeQueryValue(text).replace(EQUAL_RE, "%3D"); +} +function encodeQueryItem(key, value) { + if (typeof value === "number" || typeof value === "boolean") { + value = String(value); + } + if (!value) { + return encodeQueryKey(key); + } + if (Array.isArray(value)) { + return value.map((_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&"); + } + return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`; +} +function stringifyQuery(query) { + return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&"); +} + +new Set(builtinModules); +function clearImports(imports) { + return (imports || "").replace(/(\/\/[^\n]*\n|\/\*.*\*\/)/g, "").replace(/\s+/g, " "); +} +function getImportNames(cleanedImports) { + const topLevelImports = cleanedImports.replace(/{([^}]*)}/, ""); + const namespacedImport = topLevelImports.match(/\* as \s*(\S*)/)?.[1]; + const defaultImport = topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0; + return { + namespacedImport, + defaultImport + }; +} + +/** + * @typedef ErrnoExceptionFields + * @property {number | undefined} [errnode] + * @property {string | undefined} [code] + * @property {string | undefined} [path] + * @property {string | undefined} [syscall] + * @property {string | undefined} [url] + * + * @typedef {Error & ErrnoExceptionFields} ErrnoException + */ + + +const own$1 = {}.hasOwnProperty; + +const classRegExp = /^([A-Z][a-z\d]*)+$/; +// Sorted by a rough estimate on most frequently used entries. +const kTypes = new Set([ + 'string', + 'function', + 'number', + 'object', + // Accept 'Function' and 'Object' as alternative to the lower cased version. + 'Function', + 'Object', + 'boolean', + 'bigint', + 'symbol' +]); + +/** + * Create a list string in the form like 'A and B' or 'A, B, ..., and Z'. + * We cannot use Intl.ListFormat because it's not available in + * --without-intl builds. + * + * @param {Array<string>} array + * An array of strings. + * @param {string} [type] + * The list type to be inserted before the last element. + * @returns {string} + */ +function formatList(array, type = 'and') { + return array.length < 3 + ? array.join(` ${type} `) + : `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}` +} + +/** @type {Map<string, MessageFunction | string>} */ +const messages = new Map(); +const nodeInternalPrefix = '__node_internal_'; +/** @type {number} */ +let userStackTraceLimit; + +createError( + 'ERR_INVALID_ARG_TYPE', + /** + * @param {string} name + * @param {Array<string> | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + assert$1(typeof name === 'string', "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + + let message = 'The '; + if (name.endsWith(' argument')) { + // For cases like 'first argument' + message += `${name} `; + } else { + const type = name.includes('.') ? 'property' : 'argument'; + message += `"${name}" ${type} `; + } + + message += 'must be '; + + /** @type {Array<string>} */ + const types = []; + /** @type {Array<string>} */ + const instances = []; + /** @type {Array<string>} */ + const other = []; + + for (const value of expected) { + assert$1( + typeof value === 'string', + 'All expected entries have to be of type string' + ); + + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + assert$1( + value !== 'object', + 'The value "object" should be written as "Object"' + ); + other.push(value); + } else { + instances.push(value); + } + } + + // Special handle `object` in case other instances are allowed to outline + // the differences between each other. + if (instances.length > 0) { + const pos = types.indexOf('object'); + if (pos !== -1) { + types.slice(pos, 1); + instances.push('Object'); + } + } + + if (types.length > 0) { + message += `${types.length > 1 ? 'one of type' : 'of type'} ${formatList( + types, + 'or' + )}`; + if (instances.length > 0 || other.length > 0) message += ' or '; + } + + if (instances.length > 0) { + message += `an instance of ${formatList(instances, 'or')}`; + if (other.length > 0) message += ' or '; + } + + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, 'or')}`; + } else { + if (other[0].toLowerCase() !== other[0]) message += 'an '; + message += `${other[0]}`; + } + } + + message += `. Received ${determineSpecificType(actual)}`; + + return message + }, + TypeError +); + +createError( + 'ERR_INVALID_MODULE_SPECIFIER', + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = undefined) => { + return `Invalid module "${request}" ${reason}${ + base ? ` imported from ${base}` : '' + }` + }, + TypeError +); + +createError( + 'ERR_INVALID_PACKAGE_CONFIG', + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path, base, message) => { + return `Invalid package config ${path}${ + base ? ` while importing ${base}` : '' + }${message ? `. ${message}` : ''}` + }, + Error +); + +createError( + 'ERR_INVALID_PACKAGE_TARGET', + /** + * @param {string} packagePath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (packagePath, key, target, isImport = false, base = undefined) => { + const relatedError = + typeof target === 'string' && + !isImport && + target.length > 0 && + !target.startsWith('./'); + if (key === '.') { + assert$1(isImport === false); + return ( + `Invalid "exports" main target ${JSON.stringify(target)} defined ` + + `in the package config ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }${relatedError ? '; targets must start with "./"' : ''}` + ) + } + + return `Invalid "${ + isImport ? 'imports' : 'exports' + }" target ${JSON.stringify( + target + )} defined for '${key}' in the package config ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }${relatedError ? '; targets must start with "./"' : ''}` + }, + Error +); + +createError( + 'ERR_MODULE_NOT_FOUND', + /** + * @param {string} path + * @param {string} base + * @param {boolean} [exactUrl] + */ + (path, base, exactUrl = false) => { + return `Cannot find ${ + exactUrl ? 'module' : 'package' + } '${path}' imported from ${base}` + }, + Error +); + +createError( + 'ERR_NETWORK_IMPORT_DISALLOWED', + "import of '%s' by %s is not supported: %s", + Error +); + +createError( + 'ERR_PACKAGE_IMPORT_NOT_DEFINED', + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${ + packagePath ? ` in package ${packagePath}package.json` : '' + } imported from ${base}` + }, + TypeError +); + +createError( + 'ERR_PACKAGE_PATH_NOT_EXPORTED', + /** + * @param {string} packagePath + * @param {string} subpath + * @param {string} [base] + */ + (packagePath, subpath, base = undefined) => { + if (subpath === '.') + return `No "exports" main defined in ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }` + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${ + base ? ` imported from ${base}` : '' + }` + }, + Error +); + +createError( + 'ERR_UNSUPPORTED_DIR_IMPORT', + "Directory import '%s' is not supported " + + 'resolving ES modules imported from %s', + Error +); + +createError( + 'ERR_UNSUPPORTED_RESOLVE_REQUEST', + 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', + TypeError +); + +createError( + 'ERR_UNKNOWN_FILE_EXTENSION', + /** + * @param {string} extension + * @param {string} path + */ + (extension, path) => { + return `Unknown file extension "${extension}" for ${path}` + }, + TypeError +); + +createError( + 'ERR_INVALID_ARG_VALUE', + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = 'is invalid') => { + let inspected = inspect(value); + + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; + } + + const type = name.includes('.') ? 'property' : 'argument'; + + return `The ${type} '${name}' ${reason}. Received ${inspected}` + }, + TypeError + // Note: extra classes have been shaken out. + // , RangeError +); + +/** + * Utility function for registering the error codes. Only used here. Exported + * *only* to allow for testing. + * @param {string} sym + * @param {MessageFunction | string} value + * @param {ErrorConstructor} constructor + * @returns {new (...parameters: Array<any>) => Error} + */ +function createError(sym, value, constructor) { + // Special case for SystemError that formats the error message differently + // The SystemErrors only have SystemError as their base classes. + messages.set(sym, value); + + return makeNodeErrorWithCode(constructor, sym) +} + +/** + * @param {ErrorConstructor} Base + * @param {string} key + * @returns {ErrorConstructor} + */ +function makeNodeErrorWithCode(Base, key) { + // @ts-expect-error It’s a Node error. + return NodeError + /** + * @param {Array<unknown>} parameters + */ + function NodeError(...parameters) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; + const error = new Base(); + // Reset the limit and setting the name property. + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; + const message = getMessage(key, parameters, error); + Object.defineProperties(error, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key}]: ${this.message}` + }, + enumerable: false, + writable: true, + configurable: true + } + }); + + captureLargerStackTrace(error); + // @ts-expect-error It’s a Node error. + error.code = key; + return error + } +} + +/** + * @returns {boolean} + */ +function isErrorStackTraceLimitWritable() { + // Do no touch Error.stackTraceLimit as V8 would attempt to install + // it again during deserialization. + try { + if (v8.startupSnapshot.isBuildingSnapshot()) { + return false + } + } catch {} + + const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit'); + if (desc === undefined) { + return Object.isExtensible(Error) + } + + return own$1.call(desc, 'writable') && desc.writable !== undefined + ? desc.writable + : desc.set !== undefined +} + +/** + * This function removes unnecessary frames from Node.js core errors. + * @template {(...parameters: unknown[]) => unknown} T + * @param {T} wrappedFunction + * @returns {T} + */ +function hideStackFrames(wrappedFunction) { + // We rename the functions that will be hidden to cut off the stacktrace + // at the outermost one + const hidden = nodeInternalPrefix + wrappedFunction.name; + Object.defineProperty(wrappedFunction, 'name', {value: hidden}); + return wrappedFunction +} + +const captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function (error) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + + Error.captureStackTrace(error); + + // Reset the limit + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; + + return error + } +); + +/** + * @param {string} key + * @param {Array<unknown>} parameters + * @param {Error} self + * @returns {string} + */ +function getMessage(key, parameters, self) { + const message = messages.get(key); + assert$1(message !== undefined, 'expected `message` to be found'); + + if (typeof message === 'function') { + assert$1( + message.length <= parameters.length, // Default options do not count. + `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + + `match the required ones (${message.length}).` + ); + return Reflect.apply(message, self, parameters) + } + + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) expectedLength++; + assert$1( + expectedLength === parameters.length, + `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + + `match the required ones (${expectedLength}).` + ); + if (parameters.length === 0) return message + + parameters.unshift(message); + return Reflect.apply(format$2, null, parameters) +} + +/** + * Determine the specific type of a value for type-mismatch errors. + * @param {unknown} value + * @returns {string} + */ +function determineSpecificType(value) { + if (value === null || value === undefined) { + return String(value) + } + + if (typeof value === 'function' && value.name) { + return `function ${value.name}` + } + + if (typeof value === 'object') { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}` + } + + return `${inspect(value, {depth: -1})}` + } + + let inspected = inspect(value, {colors: false}); + + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; + } + + return `type ${typeof value} (${inspected})` +} + +const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;|\})import\s*([\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu; +const TYPE_RE = /^\s*?type\s/; +function parseStaticImport(matched) { + const cleanedImports = clearImports(matched.imports); + const namedImports = {}; + const _matches = cleanedImports.match(/{([^}]*)}/)?.[1]?.split(",") || []; + for (const namedImport of _matches) { + const _match = namedImport.match(/^\s*(\S*) as (\S*)\s*$/); + const source = _match?.[1] || namedImport.trim(); + const importName = _match?.[2] || source; + if (source && !TYPE_RE.test(source)) { + namedImports[source] = importName; + } + } + const { namespacedImport, defaultImport } = getImportNames(cleanedImports); + return { + ...matched, + defaultImport, + namespacedImport, + namedImports + }; +} + +const ESM_RE = /([\s;]|^)(import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m; +const COMMENT_RE = /\/\*.+?\*\/|\/\/.*(?=[nr])/g; +function hasESMSyntax(code, opts = {}) { + if (opts.stripComments) { + code = code.replace(COMMENT_RE, ""); + } + return ESM_RE.test(code); +} + +const debug$f = createDebugger("vite:external"); +const isExternalCache = /* @__PURE__ */ new WeakMap(); +function shouldExternalize(environment, id, importer) { + let isExternal = isExternalCache.get(environment); + if (!isExternal) { + isExternal = createIsExternal(environment); + isExternalCache.set(environment, isExternal); + } + return isExternal(id, importer); +} +const isConfiguredAsExternalCache = /* @__PURE__ */ new WeakMap(); +function isConfiguredAsExternal(environment, id, importer) { + let isExternal = isConfiguredAsExternalCache.get(environment); + if (!isExternal) { + isExternal = createIsConfiguredAsExternal(environment); + isConfiguredAsExternalCache.set(environment, isExternal); + } + return isExternal(id, importer); +} +function createIsConfiguredAsExternal(environment) { + const { config } = environment; + const { root, resolve } = config; + const { external, noExternal } = resolve; + const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter(void 0, noExternal, { resolve: false }); + const targetConditions = resolve.externalConditions; + const resolveOptions = { + ...resolve, + root, + isProduction: false, + isBuild: true, + conditions: targetConditions + }; + const isExternalizable = (id, importer, configuredAsExternal) => { + if (!bareImportRE.test(id) || id.includes("\0")) { + return false; + } + try { + const resolved = tryNodeResolve( + id, + // Skip passing importer in build to avoid externalizing non-hoisted dependencies + // unresolvable from root (which would be unresolvable from output bundles also) + config.command === "build" ? void 0 : importer, + resolveOptions, + void 0, + false + ); + if (!resolved) { + return false; + } + if (!configuredAsExternal && !isInNodeModules$1(resolved.id)) { + return false; + } + return canExternalizeFile(resolved.id); + } catch { + debug$f?.( + `Failed to node resolve "${id}". Skipping externalizing it by default.` + ); + return false; + } + }; + return (id, importer) => { + if ( + // If this id is defined as external, force it as external + // Note that individual package entries are allowed in `external` + external !== true && external.includes(id) + ) { + return true; + } + const pkgName = getNpmPackageName(id); + if (!pkgName) { + return isExternalizable(id, importer, false); + } + if ( + // A package name in ssr.external externalizes every + // externalizable package entry + external !== true && external.includes(pkgName) + ) { + return isExternalizable(id, importer, true); + } + if (typeof noExternal === "boolean") { + return !noExternal; + } + if (noExternalFilter && !noExternalFilter(pkgName)) { + return false; + } + return isExternalizable(id, importer, external === true); + }; +} +function createIsExternal(environment) { + const processedIds = /* @__PURE__ */ new Map(); + const isConfiguredAsExternal2 = createIsConfiguredAsExternal(environment); + return (id, importer) => { + if (processedIds.has(id)) { + return processedIds.get(id); + } + let isExternal = false; + if (id[0] !== "." && !path$d.isAbsolute(id)) { + isExternal = isBuiltin(id) || isConfiguredAsExternal2(id, importer); + } + processedIds.set(id, isExternal); + return isExternal; + }; +} +function canExternalizeFile(filePath) { + const ext = path$d.extname(filePath); + return !ext || ext === ".js" || ext === ".mjs" || ext === ".cjs"; +} + +const normalizedClientEntry$1 = normalizePath$3(CLIENT_ENTRY); +const normalizedEnvEntry$1 = normalizePath$3(ENV_ENTRY); +const ERR_RESOLVE_PACKAGE_ENTRY_FAIL = "ERR_RESOLVE_PACKAGE_ENTRY_FAIL"; +const browserExternalId = "__vite-browser-external"; +const optionalPeerDepId = "__vite-optional-peer-dep"; +const subpathImportsPrefix = "#"; +const startsWithWordCharRE = /^\w/; +const debug$e = createDebugger("vite:resolve-details", { + onlyWhenFocused: true +}); +function resolvePlugin(resolveOptions) { + const { root, isProduction, asSrc, preferRelative = false } = resolveOptions; + const rootInRoot = tryStatSync(path$d.join(root, root))?.isDirectory() ?? false; + return { + name: "vite:resolve", + async resolveId(id, importer, resolveOpts) { + if (id[0] === "\0" || id.startsWith("virtual:") || // When injected directly in html/client code + id.startsWith("/virtual:")) { + return; + } + const depsOptimizer = resolveOptions.optimizeDeps && this.environment.mode === "dev" ? this.environment.depsOptimizer : void 0; + if (id.startsWith(browserExternalId)) { + return id; + } + const isRequire = resolveOpts.custom?.["node-resolve"]?.isRequire ?? false; + const currentEnvironmentOptions = this.environment.config; + const options = { + isRequire, + ...currentEnvironmentOptions.resolve, + ...resolveOptions, + // plugin options + resolve options overrides + scan: resolveOpts.scan ?? resolveOptions.scan + }; + const resolvedImports = resolveSubpathImports(id, importer, options); + if (resolvedImports) { + id = resolvedImports; + if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) { + return normalizePath$3(path$d.join(root, id)); + } + } + if (importer) { + if (isTsRequest(importer) || resolveOpts.custom?.depScan?.loader?.startsWith("ts")) { + options.isFromTsImporter = true; + } else { + const moduleLang = this.getModuleInfo(importer)?.meta.vite?.lang; + options.isFromTsImporter = moduleLang && isTsRequest(`.${moduleLang}`); + } + } + let res; + if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) { + const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath$3(path$d.resolve(root, id.slice(1))); + return optimizedPath; + } + if (asSrc && id.startsWith(FS_PREFIX)) { + res = fsPathFromId(id); + debug$e?.(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + return ensureVersionQuery(res, id, options, depsOptimizer); + } + if (asSrc && id[0] === "/" && (rootInRoot || !id.startsWith(withTrailingSlash(root)))) { + const fsPath = path$d.resolve(root, id.slice(1)); + if (res = tryFsResolve(fsPath, options)) { + debug$e?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + return ensureVersionQuery(res, id, options, depsOptimizer); + } + } + if (id[0] === "." || (preferRelative || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) { + const basedir = importer ? path$d.dirname(importer) : process.cwd(); + const fsPath = path$d.resolve(basedir, id); + const normalizedFsPath = normalizePath$3(fsPath); + if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) { + if (!options.isBuild && !DEP_VERSION_RE.test(normalizedFsPath)) { + const browserHash = optimizedDepInfoFromFile( + depsOptimizer.metadata, + normalizedFsPath + )?.browserHash; + if (browserHash) { + return injectQuery(normalizedFsPath, `v=${browserHash}`); + } + } + return normalizedFsPath; + } + if (options.mainFields.includes("browser") && (res = tryResolveBrowserMapping(fsPath, importer, options, true))) { + return res; + } + if (res = tryFsResolve(fsPath, options)) { + res = ensureVersionQuery(res, id, options, depsOptimizer); + debug$e?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + if (!options.idOnly && !options.scan && options.isBuild) { + const resPkg = findNearestPackageData( + path$d.dirname(res), + options.packageCache + ); + if (resPkg) { + return { + id: res, + moduleSideEffects: resPkg.hasSideEffects(res) + }; + } + } + return res; + } + } + if (id.startsWith("file://")) { + id = fileURLToPath$1(id); + } + if (isWindows$3 && id[0] === "/") { + const basedir = importer ? path$d.dirname(importer) : process.cwd(); + const fsPath = path$d.resolve(basedir, id); + if (res = tryFsResolve(fsPath, options)) { + debug$e?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + return ensureVersionQuery(res, id, options, depsOptimizer); + } + } + if (isNonDriveRelativeAbsolutePath(id) && (res = tryFsResolve(id, options))) { + debug$e?.(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + return ensureVersionQuery(res, id, options, depsOptimizer); + } + if (isExternalUrl(id)) { + return options.idOnly ? id : { id, external: true }; + } + if (isDataUrl(id)) { + return null; + } + if (bareImportRE.test(id)) { + const external = options.externalize && options.isBuild && currentEnvironmentOptions.consumer === "server" && shouldExternalize(this.environment, id, importer); + if (!external && asSrc && depsOptimizer && !options.scan && (res = await tryOptimizedResolve( + depsOptimizer, + id, + importer, + options.preserveSymlinks, + options.packageCache + ))) { + return res; + } + if (options.mainFields.includes("browser") && (res = tryResolveBrowserMapping( + id, + importer, + options, + false, + external + ))) { + return res; + } + if (res = tryNodeResolve(id, importer, options, depsOptimizer, external)) { + return res; + } + if (isBuiltin(id)) { + if (currentEnvironmentOptions.consumer === "server") { + if (options.enableBuiltinNoExternalCheck && options.noExternal === true && // if both noExternal and external are true, noExternal will take the higher priority and bundle it. + // only if the id is explicitly listed in external, we will externalize it and skip this error. + (options.external === true || !options.external.includes(id))) { + let message = `Cannot bundle Node.js built-in "${id}"`; + if (importer) { + message += ` imported from "${path$d.relative( + process.cwd(), + importer + )}"`; + } + message += `. Consider disabling environments.${this.environment.name}.noExternal or remove the built-in dependency.`; + this.error(message); + } + return options.idOnly ? id : { id, external: true, moduleSideEffects: false }; + } else { + if (!asSrc) { + debug$e?.( + `externalized node built-in "${id}" to empty module. (imported by: ${colors$1.white(colors$1.dim(importer))})` + ); + } else if (isProduction) { + this.warn( + `Module "${id}" has been externalized for browser compatibility, imported by "${importer}". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.` + ); + } + return isProduction ? browserExternalId : `${browserExternalId}:${id}`; + } + } + } + debug$e?.(`[fallthrough] ${colors$1.dim(id)}`); + }, + load(id) { + if (id.startsWith(browserExternalId)) { + if (isProduction) { + return `export default {}`; + } else { + id = id.slice(browserExternalId.length + 1); + return `export default new Proxy({}, { + get(_, key) { + throw new Error(\`Module "${id}" has been externalized for browser compatibility. Cannot access "${id}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) + } +})`; + } + } + if (id.startsWith(optionalPeerDepId)) { + if (isProduction) { + return `export default {}`; + } else { + const [, peerDep, parentDep] = id.split(":"); + return `throw new Error(\`Could not resolve "${peerDep}" imported by "${parentDep}". Is it installed?\`)`; + } + } + } + }; +} +function resolveSubpathImports(id, importer, options) { + if (!importer || !id.startsWith(subpathImportsPrefix)) return; + const basedir = path$d.dirname(importer); + const pkgData = findNearestPackageData(basedir, options.packageCache); + if (!pkgData) return; + let { file: idWithoutPostfix, postfix } = splitFileAndPostfix(id.slice(1)); + idWithoutPostfix = "#" + idWithoutPostfix; + let importsPath = resolveExportsOrImports( + pkgData.data, + idWithoutPostfix, + options, + "imports" + ); + if (importsPath?.[0] === ".") { + importsPath = path$d.relative(basedir, path$d.join(pkgData.dir, importsPath)); + if (importsPath[0] !== ".") { + importsPath = `./${importsPath}`; + } + } + return importsPath + postfix; +} +function ensureVersionQuery(resolved, id, options, depsOptimizer) { + if (!options.isBuild && !options.scan && depsOptimizer && !(resolved === normalizedClientEntry$1 || resolved === normalizedEnvEntry$1)) { + const isNodeModule = isInNodeModules$1(id) || isInNodeModules$1(resolved); + if (isNodeModule && !DEP_VERSION_RE.test(resolved)) { + const versionHash = depsOptimizer.metadata.browserHash; + if (versionHash && isOptimizable(resolved, depsOptimizer.options)) { + resolved = injectQuery(resolved, `v=${versionHash}`); + } + } + } + return resolved; +} +function tryFsResolve(fsPath, options, tryIndex = true, skipPackageJson = false) { + const hashIndex = fsPath.indexOf("#"); + if (hashIndex >= 0 && isInNodeModules$1(fsPath)) { + const queryIndex = fsPath.indexOf("?"); + if (queryIndex < 0 || queryIndex > hashIndex) { + const file2 = queryIndex > hashIndex ? fsPath.slice(0, queryIndex) : fsPath; + const res2 = tryCleanFsResolve(file2, options, tryIndex, skipPackageJson); + if (res2) return res2 + fsPath.slice(file2.length); + } + } + const { file, postfix } = splitFileAndPostfix(fsPath); + const res = tryCleanFsResolve(file, options, tryIndex, skipPackageJson); + if (res) return res + postfix; +} +const knownTsOutputRE = /\.(?:js|mjs|cjs|jsx)$/; +const isPossibleTsOutput = (url) => knownTsOutputRE.test(url); +function tryCleanFsResolve(file, options, tryIndex = true, skipPackageJson = false) { + const { tryPrefix, extensions, preserveSymlinks } = options; + const fileResult = tryResolveRealFileOrType(file, options.preserveSymlinks); + if (fileResult?.path) return fileResult.path; + let res; + const possibleJsToTs = options.isFromTsImporter && isPossibleTsOutput(file); + if (possibleJsToTs || options.extensions.length || tryPrefix) { + const dirPath = path$d.dirname(file); + if (isDirectory(dirPath)) { + if (possibleJsToTs) { + const fileExt = path$d.extname(file); + const fileName = file.slice(0, -fileExt.length); + if (res = tryResolveRealFile( + fileName + fileExt.replace("js", "ts"), + preserveSymlinks + )) + return res; + if (fileExt === ".js" && (res = tryResolveRealFile(fileName + ".tsx", preserveSymlinks))) + return res; + } + if (res = tryResolveRealFileWithExtensions( + file, + extensions, + preserveSymlinks + )) + return res; + if (tryPrefix) { + const prefixed = `${dirPath}/${options.tryPrefix}${path$d.basename(file)}`; + if (res = tryResolveRealFile(prefixed, preserveSymlinks)) return res; + if (res = tryResolveRealFileWithExtensions( + prefixed, + extensions, + preserveSymlinks + )) + return res; + } + } + } + if (tryIndex && fileResult?.type === "directory") { + const dirPath = file; + if (!skipPackageJson) { + let pkgPath = `${dirPath}/package.json`; + try { + if (fs__default.existsSync(pkgPath)) { + if (!options.preserveSymlinks) { + pkgPath = safeRealpathSync(pkgPath); + } + const pkg = loadPackageData(pkgPath); + return resolvePackageEntry(dirPath, pkg, options); + } + } catch (e) { + if (e.code !== ERR_RESOLVE_PACKAGE_ENTRY_FAIL && e.code !== "ENOENT") + throw e; + } + } + if (res = tryResolveRealFileWithExtensions( + `${dirPath}/index`, + extensions, + preserveSymlinks + )) + return res; + if (tryPrefix) { + if (res = tryResolveRealFileWithExtensions( + `${dirPath}/${options.tryPrefix}index`, + extensions, + preserveSymlinks + )) + return res; + } + } +} +function tryNodeResolve(id, importer, options, depsOptimizer, externalize) { + const { root, dedupe, isBuild, preserveSymlinks, packageCache } = options; + const deepMatch = deepImportRE.exec(id); + const pkgId = deepMatch ? deepMatch[1] || deepMatch[2] : cleanUrl(id); + let basedir; + if (dedupe.includes(pkgId)) { + basedir = root; + } else if (importer && path$d.isAbsolute(importer) && // css processing appends `*` for importer + (importer[importer.length - 1] === "*" || fs__default.existsSync(cleanUrl(importer)))) { + basedir = path$d.dirname(importer); + } else { + basedir = root; + } + let selfPkg = null; + if (!isBuiltin(id) && !id.includes("\0") && bareImportRE.test(id)) { + const selfPackageData = findNearestPackageData(basedir, packageCache); + selfPkg = selfPackageData?.data.exports && selfPackageData.data.name === pkgId ? selfPackageData : null; + } + const pkg = selfPkg || resolvePackageData(pkgId, basedir, preserveSymlinks, packageCache); + if (!pkg) { + if (basedir !== root && // root has no peer dep + !isBuiltin(id) && !id.includes("\0") && bareImportRE.test(id)) { + const mainPkg = findNearestMainPackageData(basedir, packageCache)?.data; + if (mainPkg) { + const pkgName = getNpmPackageName(id); + if (pkgName != null && mainPkg.peerDependencies?.[pkgName] && mainPkg.peerDependenciesMeta?.[pkgName]?.optional) { + return { + id: `${optionalPeerDepId}:${id}:${mainPkg.name}` + }; + } + } + } + return; + } + const resolveId = deepMatch ? resolveDeepImport : resolvePackageEntry; + const unresolvedId = deepMatch ? "." + id.slice(pkgId.length) : id; + let resolved = resolveId(unresolvedId, pkg, options); + if (!resolved) { + return; + } + const processResult = (resolved2) => { + if (!externalize) { + return resolved2; + } + if (!canExternalizeFile(resolved2.id)) { + return resolved2; + } + let resolvedId = id; + if (deepMatch && !pkg.data.exports && path$d.extname(id) !== path$d.extname(resolved2.id)) { + const index = resolved2.id.indexOf(id); + if (index > -1) { + resolvedId = resolved2.id.slice(index); + debug$e?.( + `[processResult] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedId)}` + ); + } + } + return { ...resolved2, id: resolvedId, external: true }; + }; + if (!options.idOnly && (!options.scan && isBuild || externalize)) { + return processResult({ + id: resolved, + moduleSideEffects: pkg.hasSideEffects(resolved) + }); + } + if (!isInNodeModules$1(resolved) || // linked + !depsOptimizer || // resolving before listening to the server + options.scan) { + return { id: resolved }; + } + const isJsType = isOptimizable(resolved, depsOptimizer.options); + const exclude = depsOptimizer.options.exclude; + const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules$1(importer) || exclude?.includes(pkgId) || exclude?.includes(id) || SPECIAL_QUERY_RE.test(resolved); + if (skipOptimization) { + const versionHash = depsOptimizer.metadata.browserHash; + if (versionHash && isJsType) { + resolved = injectQuery(resolved, `v=${versionHash}`); + } + } else { + const optimizedInfo = depsOptimizer.registerMissingImport(id, resolved); + resolved = depsOptimizer.getOptimizedDepId(optimizedInfo); + } + return { id: resolved }; +} +async function tryOptimizedResolve(depsOptimizer, id, importer, preserveSymlinks, packageCache) { + await depsOptimizer.scanProcessing; + const metadata = depsOptimizer.metadata; + const depInfo = optimizedDepInfoFromId(metadata, id); + if (depInfo) { + return depsOptimizer.getOptimizedDepId(depInfo); + } + if (!importer) return; + let idPkgDir; + const nestedIdMatch = `> ${id}`; + for (const optimizedData of metadata.depInfoList) { + if (!optimizedData.src) continue; + if (!optimizedData.id.endsWith(nestedIdMatch)) continue; + if (idPkgDir == null) { + const pkgName = getNpmPackageName(id); + if (!pkgName) break; + idPkgDir = resolvePackageData( + pkgName, + importer, + preserveSymlinks, + packageCache + )?.dir; + if (idPkgDir == null) break; + idPkgDir = normalizePath$3(idPkgDir); + } + if (optimizedData.src.startsWith(withTrailingSlash(idPkgDir))) { + return depsOptimizer.getOptimizedDepId(optimizedData); + } + } +} +function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache }, options) { + const { file: idWithoutPostfix, postfix } = splitFileAndPostfix(id); + const cached = getResolvedCache(".", options); + if (cached) { + return cached + postfix; + } + try { + let entryPoint; + if (data.exports) { + entryPoint = resolveExportsOrImports(data, ".", options, "exports"); + } + if (!entryPoint) { + for (const field of options.mainFields) { + if (field === "browser") { + entryPoint = tryResolveBrowserEntry(dir, data, options); + if (entryPoint) { + break; + } + } else if (typeof data[field] === "string") { + entryPoint = data[field]; + break; + } + } + } + entryPoint ||= data.main; + const entryPoints = entryPoint ? [entryPoint] : ["index.js", "index.json", "index.node"]; + for (let entry of entryPoints) { + let skipPackageJson = false; + if (options.mainFields[0] === "sass" && !options.extensions.includes(path$d.extname(entry))) { + entry = ""; + skipPackageJson = true; + } else { + const { browser: browserField } = data; + if (options.mainFields.includes("browser") && isObject$2(browserField)) { + entry = mapWithBrowserField(entry, browserField) || entry; + } + } + const entryPointPath = path$d.join(dir, entry); + const resolvedEntryPoint = tryFsResolve( + entryPointPath, + options, + true, + skipPackageJson + ); + if (resolvedEntryPoint) { + debug$e?.( + `[package entry] ${colors$1.cyan(idWithoutPostfix)} -> ${colors$1.dim( + resolvedEntryPoint + )}${postfix !== "" ? ` (postfix: ${postfix})` : ""}` + ); + setResolvedCache(".", resolvedEntryPoint, options); + return resolvedEntryPoint + postfix; + } + } + } catch (e) { + packageEntryFailure(id, e.message); + } + packageEntryFailure(id); +} +function packageEntryFailure(id, details) { + const err = new Error( + `Failed to resolve entry for package "${id}". The package may have incorrect main/module/exports specified in its package.json` + (details ? ": " + details : ".") + ); + err.code = ERR_RESOLVE_PACKAGE_ENTRY_FAIL; + throw err; +} +function resolveExportsOrImports(pkg, key, options, type) { + const conditions = options.conditions.map((condition) => { + if (condition === DEV_PROD_CONDITION) { + return options.isProduction ? "production" : "development"; + } + return condition; + }); + if (options.isRequire) { + conditions.push("require"); + } else { + conditions.push("import"); + } + const fn = type === "imports" ? f : o; + const result = fn(pkg, key, { conditions, unsafe: true }); + return result ? result[0] : void 0; +} +function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }, options) { + const cache = getResolvedCache(id, options); + if (cache) { + return cache; + } + let relativeId = id; + const { exports: exportsField, browser: browserField } = data; + if (exportsField) { + if (isObject$2(exportsField) && !Array.isArray(exportsField)) { + const { file, postfix } = splitFileAndPostfix(relativeId); + const exportsId = resolveExportsOrImports(data, file, options, "exports"); + if (exportsId !== void 0) { + relativeId = exportsId + postfix; + } else { + relativeId = void 0; + } + } else { + relativeId = void 0; + } + if (!relativeId) { + throw new Error( + `Package subpath '${relativeId}' is not defined by "exports" in ${path$d.join(dir, "package.json")}.` + ); + } + } else if (options.mainFields.includes("browser") && isObject$2(browserField)) { + const { file, postfix } = splitFileAndPostfix(relativeId); + const mapped = mapWithBrowserField(file, browserField); + if (mapped) { + relativeId = mapped + postfix; + } else if (mapped === false) { + setResolvedCache(id, browserExternalId, options); + return browserExternalId; + } + } + if (relativeId) { + const resolved = tryFsResolve( + path$d.join(dir, relativeId), + options, + !exportsField + // try index only if no exports field + ); + if (resolved) { + debug$e?.( + `[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}` + ); + setResolvedCache(id, resolved, options); + return resolved; + } + } +} +function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize) { + let res; + const pkg = importer && findNearestPackageData(path$d.dirname(importer), options.packageCache); + if (pkg && isObject$2(pkg.data.browser)) { + const mapId = isFilePath ? "./" + slash$1(path$d.relative(pkg.dir, id)) : id; + const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser); + if (browserMappedPath) { + if (res = bareImportRE.test(browserMappedPath) ? tryNodeResolve( + browserMappedPath, + importer, + options, + void 0, + void 0 + )?.id : tryFsResolve(path$d.join(pkg.dir, browserMappedPath), options)) { + debug$e?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`); + let result = { id: res }; + if (options.idOnly) { + return result; + } + if (!options.scan && options.isBuild) { + const resPkg = findNearestPackageData( + path$d.dirname(res), + options.packageCache + ); + if (resPkg) { + result = { + id: res, + moduleSideEffects: resPkg.hasSideEffects(res) + }; + } + } + return externalize ? { ...result, external: true } : result; + } + } else if (browserMappedPath === false) { + return browserExternalId; + } + } +} +function tryResolveBrowserEntry(dir, data, options) { + const browserEntry = typeof data.browser === "string" ? data.browser : isObject$2(data.browser) && data.browser["."]; + if (browserEntry) { + if (!options.isRequire && options.mainFields.includes("module") && typeof data.module === "string" && data.module !== browserEntry) { + const resolvedBrowserEntry = tryFsResolve( + path$d.join(dir, browserEntry), + options + ); + if (resolvedBrowserEntry) { + const content = fs__default.readFileSync(resolvedBrowserEntry, "utf-8"); + if (hasESMSyntax(content)) { + return browserEntry; + } else { + return data.module; + } + } + } else { + return browserEntry; + } + } +} +function mapWithBrowserField(relativePathInPkgDir, map) { + const normalizedPath = path$d.posix.normalize(relativePathInPkgDir); + for (const key in map) { + const normalizedKey = path$d.posix.normalize(key); + if (normalizedPath === normalizedKey || equalWithoutSuffix(normalizedPath, normalizedKey, ".js") || equalWithoutSuffix(normalizedPath, normalizedKey, "/index.js")) { + return map[key]; + } + } +} +function equalWithoutSuffix(path2, key, suffix) { + return key.endsWith(suffix) && key.slice(0, -suffix.length) === path2; +} +function tryResolveRealFile(file, preserveSymlinks) { + const stat = tryStatSync(file); + if (stat?.isFile()) return getRealPath(file, preserveSymlinks); +} +function tryResolveRealFileWithExtensions(filePath, extensions, preserveSymlinks) { + for (const ext of extensions) { + const res = tryResolveRealFile(filePath + ext, preserveSymlinks); + if (res) return res; + } +} +function tryResolveRealFileOrType(file, preserveSymlinks) { + const fileStat = tryStatSync(file); + if (fileStat?.isFile()) { + return { path: getRealPath(file, preserveSymlinks), type: "file" }; + } + if (fileStat?.isDirectory()) { + return { type: "directory" }; + } + return; +} +function getRealPath(resolved, preserveSymlinks) { + if (!preserveSymlinks) { + resolved = safeRealpathSync(resolved); + } + return normalizePath$3(resolved); +} +function isDirectory(path2) { + const stat = tryStatSync(path2); + return stat?.isDirectory() ?? false; +} + +const externalWithConversionNamespace = "vite:dep-pre-bundle:external-conversion"; +const convertedExternalPrefix = "vite-dep-pre-bundle-external:"; +const cjsExternalFacadeNamespace = "vite:cjs-external-facade"; +const nonFacadePrefix = "vite-cjs-external-facade:"; +const externalTypes = [ + "css", + // supported pre-processor types + "less", + "sass", + "scss", + "styl", + "stylus", + "pcss", + "postcss", + // wasm + "wasm", + // known SFC types + "vue", + "svelte", + "marko", + "astro", + "imba", + // JSX/TSX may be configured to be compiled differently from how esbuild + // handles it by default, so exclude them as well + "jsx", + "tsx", + ...KNOWN_ASSET_TYPES +]; +function esbuildDepPlugin(environment, qualified, external) { + const { isProduction } = environment.config; + const { extensions } = environment.config.optimizeDeps; + const allExternalTypes = extensions ? externalTypes.filter((type) => !extensions.includes("." + type)) : externalTypes; + const esmPackageCache = /* @__PURE__ */ new Map(); + const cjsPackageCache = /* @__PURE__ */ new Map(); + const _resolve = createBackCompatIdResolver(environment.getTopLevelConfig(), { + asSrc: false, + scan: true, + packageCache: esmPackageCache + }); + const _resolveRequire = createBackCompatIdResolver( + environment.getTopLevelConfig(), + { + asSrc: false, + isRequire: true, + scan: true, + packageCache: cjsPackageCache + } + ); + const resolve = (id, importer, kind, resolveDir) => { + let _importer; + { + _importer = importer in qualified ? qualified[importer] : importer; + } + const resolver = kind.startsWith("require") ? _resolveRequire : _resolve; + return resolver(environment, id, _importer); + }; + const resolveResult = (id, resolved) => { + if (resolved.startsWith(browserExternalId)) { + return { + path: id, + namespace: "browser-external" + }; + } + if (resolved.startsWith(optionalPeerDepId)) { + return { + path: resolved, + namespace: "optional-peer-dep" + }; + } + if (environment.config.consumer === "server" && isBuiltin(resolved)) { + return; + } + if (isExternalUrl(resolved)) { + return { + path: resolved, + external: true + }; + } + return { + path: path$d.resolve(resolved) + }; + }; + return { + name: "vite:dep-pre-bundle", + setup(build) { + build.onEnd(() => { + esmPackageCache.clear(); + cjsPackageCache.clear(); + }); + build.onResolve( + { + filter: new RegExp( + `\\.(` + allExternalTypes.join("|") + `)(\\?.*)?$` + ) + }, + async ({ path: id, importer, kind }) => { + if (id.startsWith(convertedExternalPrefix)) { + return { + path: id.slice(convertedExternalPrefix.length), + external: true + }; + } + const resolved = await resolve(id, importer, kind); + if (resolved) { + if (JS_TYPES_RE.test(resolved)) { + return { + path: resolved, + external: false + }; + } + if (kind === "require-call") { + return { + path: resolved, + namespace: externalWithConversionNamespace + }; + } + return { + path: resolved, + external: true + }; + } + } + ); + build.onLoad( + { filter: /./, namespace: externalWithConversionNamespace }, + (args) => { + const modulePath = `"${convertedExternalPrefix}${args.path}"`; + return { + contents: isCSSRequest(args.path) && !isModuleCSSRequest(args.path) ? `import ${modulePath};` : `export { default } from ${modulePath};export * from ${modulePath};`, + loader: "js" + }; + } + ); + function resolveEntry(id) { + const flatId = flattenId(id); + if (flatId in qualified) { + return { + path: qualified[flatId] + }; + } + } + build.onResolve( + { filter: /^[\w@][^:]/ }, + async ({ path: id, importer, kind }) => { + if (moduleListContains(external, id)) { + return { + path: id, + external: true + }; + } + let entry; + if (!importer) { + if (entry = resolveEntry(id)) return entry; + const aliased = await _resolve(environment, id, void 0, true); + if (aliased && (entry = resolveEntry(aliased))) { + return entry; + } + } + const resolved = await resolve(id, importer, kind); + if (resolved) { + return resolveResult(id, resolved); + } + } + ); + build.onLoad( + { filter: /.*/, namespace: "browser-external" }, + ({ path: path2 }) => { + if (isProduction) { + return { + contents: "module.exports = {}" + }; + } else { + return { + // Return in CJS to intercept named imports. Use `Object.create` to + // create the Proxy in the prototype to workaround esbuild issue. Why? + // + // In short, esbuild cjs->esm flow: + // 1. Create empty object using `Object.create(Object.getPrototypeOf(module.exports))`. + // 2. Assign props of `module.exports` to the object. + // 3. Return object for ESM use. + // + // If we do `module.exports = new Proxy({}, {})`, step 1 returns empty object, + // step 2 does nothing as there's no props for `module.exports`. The final object + // is just an empty object. + // + // Creating the Proxy in the prototype satisfies step 1 immediately, which means + // the returned object is a Proxy that we can intercept. + // + // Note: Skip keys that are accessed by esbuild and browser devtools. + contents: `module.exports = Object.create(new Proxy({}, { + get(_, key) { + if ( + key !== '__esModule' && + key !== '__proto__' && + key !== 'constructor' && + key !== 'splice' + ) { + console.warn(\`Module "${path2}" has been externalized for browser compatibility. Cannot access "${path2}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) + } + } +}))` + }; + } + } + ); + build.onLoad( + { filter: /.*/, namespace: "optional-peer-dep" }, + ({ path: path2 }) => { + if (isProduction) { + return { + contents: "module.exports = {}" + }; + } else { + const [, peerDep, parentDep] = path2.split(":"); + return { + contents: `throw new Error(\`Could not resolve "${peerDep}" imported by "${parentDep}". Is it installed?\`)` + }; + } + } + ); + } + }; +} +const matchesEntireLine = (text) => `^${escapeRegex(text)}$`; +function esbuildCjsExternalPlugin(externals, platform) { + return { + name: "cjs-external", + setup(build) { + const filter = new RegExp(externals.map(matchesEntireLine).join("|")); + build.onResolve({ filter: new RegExp(`^${nonFacadePrefix}`) }, (args) => { + return { + path: args.path.slice(nonFacadePrefix.length), + external: true + }; + }); + build.onResolve({ filter }, (args) => { + if (args.kind === "require-call" && platform !== "node") { + return { + path: args.path, + namespace: cjsExternalFacadeNamespace + }; + } + return { + path: args.path, + external: true + }; + }); + build.onLoad( + { filter: /.*/, namespace: cjsExternalFacadeNamespace }, + (args) => ({ + contents: `import * as m from ${JSON.stringify( + nonFacadePrefix + args.path + )};module.exports = m;` + }) + ); + } + }; +} + +const environmentColors = [ + colors$1.blue, + colors$1.magenta, + colors$1.green, + colors$1.gray +]; +function getDefaultResolvedEnvironmentOptions(config) { + return { + define: config.define, + resolve: config.resolve, + consumer: "server", + optimizeDeps: config.optimizeDeps, + dev: config.dev, + build: config.build + }; +} +class PartialEnvironment { + name; + getTopLevelConfig() { + return this._topLevelConfig; + } + config; + /** + * @deprecated use environment.config instead + **/ + get options() { + return this._options; + } + logger; + /** + * @internal + */ + _options; + /** + * @internal + */ + _topLevelConfig; + constructor(name, topLevelConfig, options = topLevelConfig.environments[name]) { + if (!/^[\w$]+$/.test(name)) { + throw new Error( + `Invalid environment name "${name}". Environment names must only contain alphanumeric characters and "$", "_".` + ); + } + this.name = name; + this._topLevelConfig = topLevelConfig; + this._options = options; + this.config = new Proxy( + options, + { + get: (target, prop) => { + if (prop === "logger") { + return this.logger; + } + if (prop in target) { + return this._options[prop]; + } + return this._topLevelConfig[prop]; + } + } + ); + const environment = colors$1.dim(`(${this.name})`); + const colorIndex = [...this.name].reduce((acc, c) => acc + c.charCodeAt(0), 0) % environmentColors.length; + const infoColor = environmentColors[colorIndex || 0]; + this.logger = { + get hasWarned() { + return topLevelConfig.logger.hasWarned; + }, + info(msg, opts) { + return topLevelConfig.logger.info(msg, { + ...opts, + environment: infoColor(environment) + }); + }, + warn(msg, opts) { + return topLevelConfig.logger.warn(msg, { + ...opts, + environment: colors$1.yellow(environment) + }); + }, + warnOnce(msg, opts) { + return topLevelConfig.logger.warnOnce(msg, { + ...opts, + environment: colors$1.yellow(environment) + }); + }, + error(msg, opts) { + return topLevelConfig.logger.error(msg, { + ...opts, + environment: colors$1.red(environment) + }); + }, + clearScreen(type) { + return topLevelConfig.logger.clearScreen(type); + }, + hasErrorLogged(error) { + return topLevelConfig.logger.hasErrorLogged(error); + } + }; + } +} +class BaseEnvironment extends PartialEnvironment { + get plugins() { + if (!this._plugins) + throw new Error( + `${this.name} environment.plugins called before initialized` + ); + return this._plugins; + } + /** + * @internal + */ + _plugins; + /** + * @internal + */ + _initiated = false; + constructor(name, config, options = config.environments[name]) { + super(name, config, options); + } +} + +// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace; +RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu; +Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y; +Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu; +StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y; +NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y; +Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y; +WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu; +LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y; +MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y; +SingleLineComment = /\/\/.*/y; +HashbangComment = /^#!.*/; +JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y; +JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu; +JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y; +JSXText = /[^<>{}]+/y; +TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/; +TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/; +KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/; +KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/; +Newline = RegExp(LineTerminatorSequence.source); +var jsTokens_1 = function*(input, {jsx = false} = {}) { + var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack; + ({length} = input); + lastIndex = 0; + lastSignificantToken = ""; + stack = [ + {tag: "JS"} + ]; + braces = []; + parenNesting = 0; + postfixIncDec = false; + if (match = HashbangComment.exec(input)) { + yield ({ + type: "HashbangComment", + value: match[0] + }); + lastIndex = match[0].length; + } + while (lastIndex < length) { + mode = stack[stack.length - 1]; + switch (mode.tag) { + case "JS": + case "JSNonExpressionParen": + case "InterpolationInTemplate": + case "InterpolationInJSX": + if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { + RegularExpressionLiteral.lastIndex = lastIndex; + if (match = RegularExpressionLiteral.exec(input)) { + lastIndex = RegularExpressionLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "RegularExpressionLiteral", + value: match[0], + closed: match[1] !== void 0 && match[1] !== "\\" + }); + continue; + } + } + Punctuator.lastIndex = lastIndex; + if (match = Punctuator.exec(input)) { + punctuator = match[0]; + nextLastIndex = Punctuator.lastIndex; + nextLastSignificantToken = punctuator; + switch (punctuator) { + case "(": + if (lastSignificantToken === "?NonExpressionParenKeyword") { + stack.push({ + tag: "JSNonExpressionParen", + nesting: parenNesting + }); + } + parenNesting++; + postfixIncDec = false; + break; + case ")": + parenNesting--; + postfixIncDec = true; + if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) { + stack.pop(); + nextLastSignificantToken = "?NonExpressionParenEnd"; + postfixIncDec = false; + } + break; + case "{": + Punctuator.lastIndex = 0; + isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken)); + braces.push(isExpression); + postfixIncDec = false; + break; + case "}": + switch (mode.tag) { + case "InterpolationInTemplate": + if (braces.length === mode.nesting) { + Template.lastIndex = lastIndex; + match = Template.exec(input); + lastIndex = Template.lastIndex; + lastSignificantToken = match[0]; + if (match[1] === "${") { + lastSignificantToken = "?InterpolationInTemplate"; + postfixIncDec = false; + yield ({ + type: "TemplateMiddle", + value: match[0] + }); + } else { + stack.pop(); + postfixIncDec = true; + yield ({ + type: "TemplateTail", + value: match[0], + closed: match[1] === "`" + }); + } + continue; + } + break; + case "InterpolationInJSX": + if (braces.length === mode.nesting) { + stack.pop(); + lastIndex += 1; + lastSignificantToken = "}"; + yield ({ + type: "JSXPunctuator", + value: "}" + }); + continue; + } + } + postfixIncDec = braces.pop(); + nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}"; + break; + case "]": + postfixIncDec = true; + break; + case "++": + case "--": + nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec"; + break; + case "<": + if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { + stack.push({tag: "JSXTag"}); + lastIndex += 1; + lastSignificantToken = "<"; + yield ({ + type: "JSXPunctuator", + value: punctuator + }); + continue; + } + postfixIncDec = false; + break; + default: + postfixIncDec = false; + } + lastIndex = nextLastIndex; + lastSignificantToken = nextLastSignificantToken; + yield ({ + type: "Punctuator", + value: punctuator + }); + continue; + } + Identifier.lastIndex = lastIndex; + if (match = Identifier.exec(input)) { + lastIndex = Identifier.lastIndex; + nextLastSignificantToken = match[0]; + switch (match[0]) { + case "for": + case "if": + case "while": + case "with": + if (lastSignificantToken !== "." && lastSignificantToken !== "?.") { + nextLastSignificantToken = "?NonExpressionParenKeyword"; + } + } + lastSignificantToken = nextLastSignificantToken; + postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]); + yield ({ + type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName", + value: match[0] + }); + continue; + } + StringLiteral.lastIndex = lastIndex; + if (match = StringLiteral.exec(input)) { + lastIndex = StringLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "StringLiteral", + value: match[0], + closed: match[2] !== void 0 + }); + continue; + } + NumericLiteral.lastIndex = lastIndex; + if (match = NumericLiteral.exec(input)) { + lastIndex = NumericLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "NumericLiteral", + value: match[0] + }); + continue; + } + Template.lastIndex = lastIndex; + if (match = Template.exec(input)) { + lastIndex = Template.lastIndex; + lastSignificantToken = match[0]; + if (match[1] === "${") { + lastSignificantToken = "?InterpolationInTemplate"; + stack.push({ + tag: "InterpolationInTemplate", + nesting: braces.length + }); + postfixIncDec = false; + yield ({ + type: "TemplateHead", + value: match[0] + }); + } else { + postfixIncDec = true; + yield ({ + type: "NoSubstitutionTemplate", + value: match[0], + closed: match[1] === "`" + }); + } + continue; + } + break; + case "JSXTag": + case "JSXTagEnd": + JSXPunctuator.lastIndex = lastIndex; + if (match = JSXPunctuator.exec(input)) { + lastIndex = JSXPunctuator.lastIndex; + nextLastSignificantToken = match[0]; + switch (match[0]) { + case "<": + stack.push({tag: "JSXTag"}); + break; + case ">": + stack.pop(); + if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") { + nextLastSignificantToken = "?JSX"; + postfixIncDec = true; + } else { + stack.push({tag: "JSXChildren"}); + } + break; + case "{": + stack.push({ + tag: "InterpolationInJSX", + nesting: braces.length + }); + nextLastSignificantToken = "?InterpolationInJSX"; + postfixIncDec = false; + break; + case "/": + if (lastSignificantToken === "<") { + stack.pop(); + if (stack[stack.length - 1].tag === "JSXChildren") { + stack.pop(); + } + stack.push({tag: "JSXTagEnd"}); + } + } + lastSignificantToken = nextLastSignificantToken; + yield ({ + type: "JSXPunctuator", + value: match[0] + }); + continue; + } + JSXIdentifier.lastIndex = lastIndex; + if (match = JSXIdentifier.exec(input)) { + lastIndex = JSXIdentifier.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXIdentifier", + value: match[0] + }); + continue; + } + JSXString.lastIndex = lastIndex; + if (match = JSXString.exec(input)) { + lastIndex = JSXString.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXString", + value: match[0], + closed: match[2] !== void 0 + }); + continue; + } + break; + case "JSXChildren": + JSXText.lastIndex = lastIndex; + if (match = JSXText.exec(input)) { + lastIndex = JSXText.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXText", + value: match[0] + }); + continue; + } + switch (input[lastIndex]) { + case "<": + stack.push({tag: "JSXTag"}); + lastIndex++; + lastSignificantToken = "<"; + yield ({ + type: "JSXPunctuator", + value: "<" + }); + continue; + case "{": + stack.push({ + tag: "InterpolationInJSX", + nesting: braces.length + }); + lastIndex++; + lastSignificantToken = "?InterpolationInJSX"; + postfixIncDec = false; + yield ({ + type: "JSXPunctuator", + value: "{" + }); + continue; + } + } + WhiteSpace.lastIndex = lastIndex; + if (match = WhiteSpace.exec(input)) { + lastIndex = WhiteSpace.lastIndex; + yield ({ + type: "WhiteSpace", + value: match[0] + }); + continue; + } + LineTerminatorSequence.lastIndex = lastIndex; + if (match = LineTerminatorSequence.exec(input)) { + lastIndex = LineTerminatorSequence.lastIndex; + postfixIncDec = false; + if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { + lastSignificantToken = "?NoLineTerminatorHere"; + } + yield ({ + type: "LineTerminatorSequence", + value: match[0] + }); + continue; + } + MultiLineComment.lastIndex = lastIndex; + if (match = MultiLineComment.exec(input)) { + lastIndex = MultiLineComment.lastIndex; + if (Newline.test(match[0])) { + postfixIncDec = false; + if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { + lastSignificantToken = "?NoLineTerminatorHere"; + } + } + yield ({ + type: "MultiLineComment", + value: match[0], + closed: match[1] !== void 0 + }); + continue; + } + SingleLineComment.lastIndex = lastIndex; + if (match = SingleLineComment.exec(input)) { + lastIndex = SingleLineComment.lastIndex; + postfixIncDec = false; + yield ({ + type: "SingleLineComment", + value: match[0] + }); + continue; + } + firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex)); + lastIndex += firstCodePoint.length; + lastSignificantToken = firstCodePoint; + postfixIncDec = false; + yield ({ + type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid", + value: firstCodePoint + }); + } + return void 0; +}; + +var jsTokens = /*@__PURE__*/getDefaultExportFromCjs(jsTokens_1); + +function stripLiteralJsTokens(code, options) { + const FILL = " "; + const FILL_COMMENT = " "; + let result = ""; + const tokens = []; + for (const token of jsTokens(code, { jsx: false })) { + tokens.push(token); + if (token.type === "SingleLineComment") { + result += FILL_COMMENT.repeat(token.value.length); + continue; + } + if (token.type === "MultiLineComment") { + result += token.value.replace(/[^\n]/g, FILL_COMMENT); + continue; + } + if (token.type === "StringLiteral") { + if (!token.closed) { + result += token.value; + continue; + } + const body = token.value.slice(1, -1); + { + result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1]; + continue; + } + } + if (token.type === "NoSubstitutionTemplate") { + const body = token.value.slice(1, -1); + { + result += `\`${body.replace(/[^\n]/g, FILL)}\``; + continue; + } + } + if (token.type === "RegularExpressionLiteral") { + const body = token.value; + { + result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`); + continue; + } + } + if (token.type === "TemplateHead") { + const body = token.value.slice(1, -2); + { + result += `\`${body.replace(/[^\n]/g, FILL)}\${`; + continue; + } + } + if (token.type === "TemplateTail") { + const body = token.value.slice(0, -2); + { + result += `}${body.replace(/[^\n]/g, FILL)}\``; + continue; + } + } + if (token.type === "TemplateMiddle") { + const body = token.value.slice(1, -2); + { + result += `}${body.replace(/[^\n]/g, FILL)}\${`; + continue; + } + } + result += token.value; + } + return { + result, + tokens + }; +} + +function stripLiteral(code, options) { + return stripLiteralDetailed(code).result; +} +function stripLiteralDetailed(code, options) { + return stripLiteralJsTokens(code); +} + +function importGlobPlugin(config) { + const importGlobMaps = /* @__PURE__ */ new Map(); + return { + name: "vite:import-glob", + buildStart() { + importGlobMaps.clear(); + }, + async transform(code, id) { + if (!code.includes("import.meta.glob")) return; + const result = await transformGlobImport( + code, + id, + config.root, + (im, _, options) => this.resolve(im, id, options).then((i) => i?.id || im), + config.experimental.importGlobRestoreExtension, + config.logger + ); + if (result) { + const allGlobs = result.matches.map((i) => i.globsResolved); + if (!importGlobMaps.has(this.environment)) { + importGlobMaps.set(this.environment, /* @__PURE__ */ new Map()); + } + const globMatchers = allGlobs.map((globs) => { + const affirmed = []; + const negated = []; + for (const glob2 of globs) { + (glob2[0] === "!" ? negated : affirmed).push(glob2); + } + const affirmedMatcher = picomatch$5(affirmed); + const negatedMatcher = picomatch$5(negated); + return (file) => { + return (affirmed.length === 0 || affirmedMatcher(file)) && !(negated.length > 0 && negatedMatcher(file)); + }; + }); + importGlobMaps.get(this.environment).set(id, globMatchers); + return transformStableResult(result.s, id, config); + } + }, + hotUpdate({ type, file, modules: oldModules }) { + if (type === "update") return; + const importGlobMap = importGlobMaps.get(this.environment); + if (!importGlobMap) return; + const modules = []; + for (const [id, globMatchers] of importGlobMap) { + if (globMatchers.some((matcher) => matcher(file))) { + const mod = this.environment.moduleGraph.getModuleById(id); + if (mod) modules.push(mod); + } + } + return modules.length > 0 ? [...oldModules, ...modules] : void 0; + } + }; +} +const importGlobRE = /\bimport\.meta\.glob(?:<\w+>)?\s*\(/g; +const objectKeysRE = /\bObject\.keys\(\s*$/; +const objectValuesRE = /\bObject\.values\(\s*$/; +const knownOptions = { + as: ["string"], + eager: ["boolean"], + import: ["string"], + exhaustive: ["boolean"], + query: ["object", "string"] +}; +const forceDefaultAs = ["raw", "url"]; +function err$1(e, pos) { + const error = new Error(e); + error.pos = pos; + return error; +} +function parseGlobOptions(rawOpts, optsStartIndex, logger) { + let opts = {}; + try { + opts = evalValue(rawOpts); + } catch { + throw err$1( + "Vite is unable to parse the glob options as the value is not static", + optsStartIndex + ); + } + if (opts == null) { + return {}; + } + for (const key in opts) { + if (!(key in knownOptions)) { + throw err$1(`Unknown glob option "${key}"`, optsStartIndex); + } + const allowedTypes = knownOptions[key]; + const valueType = typeof opts[key]; + if (!allowedTypes.includes(valueType)) { + throw err$1( + `Expected glob option "${key}" to be of type ${allowedTypes.join( + " or " + )}, but got ${valueType}`, + optsStartIndex + ); + } + } + if (typeof opts.query === "object") { + for (const key in opts.query) { + const value = opts.query[key]; + if (!["string", "number", "boolean"].includes(typeof value)) { + throw err$1( + `Expected glob option "query.${key}" to be of type string, number, or boolean, but got ${typeof value}`, + optsStartIndex + ); + } + } + opts.query = stringifyQuery(opts.query); + } + if (opts.as && logger) { + const importSuggestion = forceDefaultAs.includes(opts.as) ? `, import: 'default'` : ""; + logger.warn( + colors$1.yellow( + `The glob option "as" has been deprecated in favour of "query". Please update \`as: '${opts.as}'\` to \`query: '?${opts.as}'${importSuggestion}\`.` + ) + ); + } + if (opts.as && forceDefaultAs.includes(opts.as)) { + if (opts.import && opts.import !== "default" && opts.import !== "*") + throw err$1( + `Option "import" can only be "default" or "*" when "as" is "${opts.as}", but got "${opts.import}"`, + optsStartIndex + ); + opts.import = opts.import || "default"; + } + if (opts.as && opts.query) + throw err$1( + 'Options "as" and "query" cannot be used together', + optsStartIndex + ); + if (opts.as) opts.query = opts.as; + if (opts.query && opts.query[0] !== "?") opts.query = `?${opts.query}`; + return opts; +} +async function parseImportGlob(code, importer, root, resolveId, logger) { + let cleanCode; + try { + cleanCode = stripLiteral(code); + } catch { + return []; + } + const matches = Array.from(cleanCode.matchAll(importGlobRE)); + const tasks = matches.map(async (match, index) => { + const start = match.index; + const err2 = (msg) => { + const e = new Error(`Invalid glob import syntax: ${msg}`); + e.pos = start; + return e; + }; + const end = findCorrespondingCloseParenthesisPosition( + cleanCode, + start + match[0].length + ) + 1; + if (end <= 0) { + throw err2("Close parenthesis not found"); + } + const statementCode = code.slice(start, end); + const rootAst = (await parseAstAsync(statementCode)).body[0]; + if (rootAst.type !== "ExpressionStatement") { + throw err2(`Expect CallExpression, got ${rootAst.type}`); + } + const ast = rootAst.expression; + if (ast.type !== "CallExpression") { + throw err2(`Expect CallExpression, got ${ast.type}`); + } + if (ast.arguments.length < 1 || ast.arguments.length > 2) + throw err2(`Expected 1-2 arguments, but got ${ast.arguments.length}`); + const arg1 = ast.arguments[0]; + const arg2 = ast.arguments[1]; + const globs = []; + const validateLiteral = (element) => { + if (!element) return; + if (element.type === "Literal") { + if (typeof element.value !== "string") + throw err2( + `Expected glob to be a string, but got "${typeof element.value}"` + ); + globs.push(element.value); + } else if (element.type === "TemplateLiteral") { + if (element.expressions.length !== 0) { + throw err2( + `Expected glob to be a string, but got dynamic template literal` + ); + } + globs.push(element.quasis[0].value.raw); + } else { + throw err2("Could only use literals"); + } + }; + if (arg1.type === "ArrayExpression") { + for (const element of arg1.elements) { + validateLiteral(element); + } + } else { + validateLiteral(arg1); + } + let options = {}; + if (arg2) { + if (arg2.type !== "ObjectExpression") + throw err2( + `Expected the second argument to be an object literal, but got "${arg2.type}"` + ); + options = parseGlobOptions( + code.slice(start + arg2.start, start + arg2.end), + start + arg2.start, + logger + ); + } + const globsResolved = await Promise.all( + globs.map((glob2) => toAbsoluteGlob(glob2, root, importer, resolveId)) + ); + const isRelative = globs.every((i) => ".!".includes(i[0])); + const sliceCode = cleanCode.slice(0, start); + const onlyKeys = objectKeysRE.test(sliceCode); + let onlyValues = false; + if (!onlyKeys) { + onlyValues = objectValuesRE.test(sliceCode); + } + return { + index, + globs, + globsResolved, + isRelative, + options, + start, + end, + onlyKeys, + onlyValues + }; + }); + return (await Promise.all(tasks)).filter(Boolean); +} +function findCorrespondingCloseParenthesisPosition(cleanCode, openPos) { + const closePos = cleanCode.indexOf(")", openPos); + if (closePos < 0) return -1; + if (!cleanCode.slice(openPos, closePos).includes("(")) return closePos; + let remainingParenthesisCount = 0; + const cleanCodeLen = cleanCode.length; + for (let pos = openPos; pos < cleanCodeLen; pos++) { + switch (cleanCode[pos]) { + case "(": { + remainingParenthesisCount++; + break; + } + case ")": { + remainingParenthesisCount--; + if (remainingParenthesisCount <= 0) { + return pos; + } + } + } + } + return -1; +} +const importPrefix = "__vite_glob_"; +const { basename, dirname, relative } = posix$1; +async function transformGlobImport(code, id, root, resolveId, restoreQueryExtension = false, logger) { + id = slash$1(id); + root = slash$1(root); + const isVirtual = isVirtualModule(id); + const dir = isVirtual ? void 0 : dirname(id); + const matches = await parseImportGlob( + code, + isVirtual ? void 0 : id, + root, + resolveId, + logger + ); + const matchedFiles = /* @__PURE__ */ new Set(); + if (!matches.length) return null; + const s = new MagicString(code); + const staticImports = (await Promise.all( + matches.map( + async ({ + globsResolved, + isRelative, + options, + index, + start, + end, + onlyKeys, + onlyValues + }) => { + const cwd = getCommonBase(globsResolved) ?? root; + const files = (await glob(globsResolved, { + absolute: true, + cwd, + dot: !!options.exhaustive, + expandDirectories: false, + ignore: options.exhaustive ? [] : ["**/node_modules/**"] + })).filter((file) => file !== id).sort(); + const objectProps = []; + const staticImports2 = []; + const resolvePaths = (file) => { + if (!dir) { + if (isRelative) + throw new Error( + "In virtual modules, all globs must start with '/'" + ); + const filePath2 = `/${relative(root, file)}`; + return { filePath: filePath2, importPath: filePath2 }; + } + let importPath = relative(dir, file); + if (importPath[0] !== ".") importPath = `./${importPath}`; + let filePath; + if (isRelative) { + filePath = importPath; + } else { + filePath = relative(root, file); + if (filePath[0] !== ".") filePath = `/${filePath}`; + } + return { filePath, importPath }; + }; + files.forEach((file, i) => { + const paths = resolvePaths(file); + const filePath = paths.filePath; + let importPath = paths.importPath; + let importQuery = options.query ?? ""; + if (onlyKeys) { + objectProps.push(`${JSON.stringify(filePath)}: 0`); + return; + } + if (importQuery && importQuery !== "?raw") { + const fileExtension = basename(file).split(".").slice(-1)[0]; + if (fileExtension && restoreQueryExtension) + importQuery = `${importQuery}&lang.${fileExtension}`; + } + importPath = `${importPath}${importQuery}`; + const importKey = options.import && options.import !== "*" ? options.import : void 0; + if (options.eager) { + const variableName = `${importPrefix}${index}_${i}`; + const expression = importKey ? `{ ${importKey} as ${variableName} }` : `* as ${variableName}`; + staticImports2.push( + `import ${expression} from ${JSON.stringify(importPath)}` + ); + objectProps.push( + onlyValues ? `${variableName}` : `${JSON.stringify(filePath)}: ${variableName}` + ); + } else { + let importStatement = `import(${JSON.stringify(importPath)})`; + if (importKey) + importStatement += `.then(m => m[${JSON.stringify(importKey)}])`; + objectProps.push( + onlyValues ? `() => ${importStatement}` : `${JSON.stringify(filePath)}: () => ${importStatement}` + ); + } + }); + files.forEach((i) => matchedFiles.add(i)); + const originalLineBreakCount = code.slice(start, end).match(/\n/g)?.length ?? 0; + const lineBreaks = originalLineBreakCount > 0 ? "\n".repeat(originalLineBreakCount) : ""; + let replacement = ""; + if (onlyKeys) { + replacement = `{${objectProps.join(",")}${lineBreaks}}`; + } else if (onlyValues) { + replacement = `[${objectProps.join(",")}${lineBreaks}]`; + } else { + replacement = `/* #__PURE__ */ Object.assign({${objectProps.join( + "," + )}${lineBreaks}})`; + } + s.overwrite(start, end, replacement); + return staticImports2; + } + ) + )).flat(); + if (staticImports.length) s.prepend(`${staticImports.join(";")};`); + return { + s, + matches, + files: matchedFiles + }; +} +function globSafePath(path) { + return escapePath(normalizePath$3(path)); +} +function lastNthChar(str, n) { + return str.charAt(str.length - 1 - n); +} +function globSafeResolvedPath(resolved, glob2) { + let numEqual = 0; + const maxEqual = Math.min(resolved.length, glob2.length); + while (numEqual < maxEqual && lastNthChar(resolved, numEqual) === lastNthChar(glob2, numEqual)) { + numEqual += 1; + } + const staticPartEnd = resolved.length - numEqual; + const staticPart = resolved.slice(0, staticPartEnd); + const dynamicPart = resolved.slice(staticPartEnd); + return globSafePath(staticPart) + dynamicPart; +} +async function toAbsoluteGlob(glob2, root, importer, resolveId) { + let pre = ""; + if (glob2[0] === "!") { + pre = "!"; + glob2 = glob2.slice(1); + } + root = globSafePath(root); + const dir = importer ? globSafePath(dirname(importer)) : root; + if (glob2[0] === "/") return pre + posix$1.join(root, glob2.slice(1)); + if (glob2.startsWith("./")) return pre + posix$1.join(dir, glob2.slice(2)); + if (glob2.startsWith("../")) return pre + posix$1.join(dir, glob2); + if (glob2.startsWith("**")) return pre + glob2; + const isSubImportsPattern = glob2[0] === "#" && glob2.includes("*"); + const resolved = normalizePath$3( + await resolveId(glob2, importer, { + custom: { "vite:import-glob": { isSubImportsPattern } } + }) || glob2 + ); + if (isAbsolute$1(resolved)) { + return pre + globSafeResolvedPath(resolved, glob2); + } + throw new Error( + `Invalid glob: "${glob2}" (resolved: "${resolved}"). It must start with '/' or './'` + ); +} +function getCommonBase(globsResolved) { + const bases = globsResolved.filter((g) => g[0] !== "!").map((glob2) => { + let { base } = picomatch$5.scan(glob2); + if (posix$1.basename(base).includes(".")) base = posix$1.dirname(base); + return base; + }); + if (!bases.length) return null; + let commonAncestor = ""; + const dirS = bases[0].split("/"); + for (let i = 0; i < dirS.length; i++) { + const candidate = dirS.slice(0, i + 1).join("/"); + if (bases.every((base) => base.startsWith(candidate))) + commonAncestor = candidate; + else break; + } + if (!commonAncestor) commonAncestor = "/"; + return commonAncestor; +} +function isVirtualModule(id) { + return id.startsWith("virtual:") || id[0] === "\0" || !id.includes("/"); +} + +class ScanEnvironment extends BaseEnvironment { + mode = "scan"; + get pluginContainer() { + if (!this._pluginContainer) + throw new Error( + `${this.name} environment.pluginContainer called before initialized` + ); + return this._pluginContainer; + } + /** + * @internal + */ + _pluginContainer; + async init() { + if (this._initiated) { + return; + } + this._initiated = true; + this._plugins = await resolveEnvironmentPlugins(this); + this._pluginContainer = await createEnvironmentPluginContainer( + this, + this.plugins + ); + await this._pluginContainer.buildStart(); + } +} +function devToScanEnvironment(environment) { + return { + mode: "scan", + get name() { + return environment.name; + }, + getTopLevelConfig() { + return environment.getTopLevelConfig(); + }, + /** + * @deprecated use environment.config instead + **/ + get options() { + return environment.options; + }, + get config() { + return environment.config; + }, + get logger() { + return environment.logger; + }, + get pluginContainer() { + return environment.pluginContainer; + }, + get plugins() { + return environment.plugins; + } + }; +} +const debug$d = createDebugger("vite:deps"); +const htmlTypesRE = /\.(html|vue|svelte|astro|imba)$/; +const importsRE = /(?<!\/\/.*)(?<=^|;|\*\/)\s*import(?!\s+type)(?:[\w*{}\n\r\t, ]+from)?\s*("[^"]+"|'[^']+')\s*(?=$|;|\/\/|\/\*)/gm; +function scanImports(environment) { + const start = performance.now(); + const deps = {}; + const missing = {}; + let entries; + const { config } = environment; + const scanContext = { cancelled: false }; + const esbuildContext = computeEntries( + environment + ).then((computedEntries) => { + entries = computedEntries; + if (!entries.length) { + if (!config.optimizeDeps.entries && !config.optimizeDeps.include) { + environment.logger.warn( + colors$1.yellow( + "(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling." + ) + ); + } + return; + } + if (scanContext.cancelled) return; + debug$d?.( + `Crawling dependencies using entries: ${entries.map((entry) => ` + ${colors$1.dim(entry)}`).join("")}` + ); + return prepareEsbuildScanner( + environment, + entries, + deps, + missing, + scanContext + ); + }); + const result = esbuildContext.then((context) => { + function disposeContext() { + return context?.dispose().catch((e) => { + environment.logger.error("Failed to dispose esbuild context", { + error: e + }); + }); + } + if (!context || scanContext.cancelled) { + disposeContext(); + return { deps: {}, missing: {} }; + } + return context.rebuild().then(() => { + return { + // Ensure a fixed order so hashes are stable and improve logs + deps: orderedDependencies(deps), + missing + }; + }).finally(() => { + return disposeContext(); + }); + }).catch(async (e) => { + if (e.errors && e.message.includes("The build was canceled")) { + return { deps: {}, missing: {} }; + } + const prependMessage = colors$1.red(` Failed to scan for dependencies from entries: + ${entries.join("\n")} + + `); + if (e.errors) { + const msgs = await formatMessages(e.errors, { + kind: "error", + color: true + }); + e.message = prependMessage + msgs.join("\n"); + } else { + e.message = prependMessage + e.message; + } + throw e; + }).finally(() => { + if (debug$d) { + const duration = (performance.now() - start).toFixed(2); + const depsStr = Object.keys(orderedDependencies(deps)).sort().map((id) => ` + ${colors$1.cyan(id)} -> ${colors$1.dim(deps[id])}`).join("") || colors$1.dim("no dependencies found"); + debug$d(`Scan completed in ${duration}ms: ${depsStr}`); + } + }); + return { + cancel: async () => { + scanContext.cancelled = true; + return esbuildContext.then((context) => context?.cancel()); + }, + result + }; +} +async function computeEntries(environment) { + let entries = []; + const explicitEntryPatterns = environment.config.optimizeDeps.entries; + const buildInput = environment.config.build.rollupOptions.input; + if (explicitEntryPatterns) { + entries = await globEntries(explicitEntryPatterns, environment); + } else if (buildInput) { + const resolvePath = async (p) => { + const id = (await environment.pluginContainer.resolveId(p, void 0, { + scan: true + }))?.id; + if (id === void 0) { + throw new Error( + `failed to resolve rollupOptions.input value: ${JSON.stringify(p)}.` + ); + } + return id; + }; + if (typeof buildInput === "string") { + entries = [await resolvePath(buildInput)]; + } else if (Array.isArray(buildInput)) { + entries = await Promise.all(buildInput.map(resolvePath)); + } else if (isObject$2(buildInput)) { + entries = await Promise.all(Object.values(buildInput).map(resolvePath)); + } else { + throw new Error("invalid rollupOptions.input value."); + } + } else { + entries = await globEntries("**/*.html", environment); + } + entries = entries.filter( + (entry) => isScannable(entry, environment.config.optimizeDeps.extensions) && fs__default.existsSync(entry) + ); + return entries; +} +async function prepareEsbuildScanner(environment, entries, deps, missing, scanContext) { + if (scanContext.cancelled) return; + const plugin = esbuildScanPlugin(environment, deps, missing, entries); + const { plugins = [], ...esbuildOptions } = environment.config.optimizeDeps.esbuildOptions ?? {}; + let tsconfigRaw = esbuildOptions.tsconfigRaw; + if (!tsconfigRaw && !esbuildOptions.tsconfig) { + const { tsconfig } = await loadTsconfigJsonForFile( + path$d.join(environment.config.root, "_dummy.js") + ); + if (tsconfig.compilerOptions?.experimentalDecorators) { + tsconfigRaw = { compilerOptions: { experimentalDecorators: true } }; + } + } + return await esbuild.context({ + absWorkingDir: process.cwd(), + write: false, + stdin: { + contents: entries.map((e) => `import ${JSON.stringify(e)}`).join("\n"), + loader: "js" + }, + bundle: true, + format: "esm", + logLevel: "silent", + plugins: [...plugins, plugin], + ...esbuildOptions, + tsconfigRaw + }); +} +function orderedDependencies(deps) { + const depsList = Object.entries(deps); + depsList.sort((a, b) => a[0].localeCompare(b[0])); + return Object.fromEntries(depsList); +} +function globEntries(pattern, environment) { + const resolvedPatterns = arraify(pattern); + if (resolvedPatterns.every((str) => !isDynamicPattern(str))) { + return resolvedPatterns.map( + (p) => normalizePath$3(path$d.resolve(environment.config.root, p)) + ); + } + return glob(pattern, { + absolute: true, + cwd: environment.config.root, + ignore: [ + "**/node_modules/**", + `**/${environment.config.build.outDir}/**`, + // if there aren't explicit entries, also ignore other common folders + ...environment.config.optimizeDeps.entries ? [] : [`**/__tests__/**`, `**/coverage/**`] + ] + }); +} +const scriptRE = /(<script(?:\s+[a-z_:][-\w:]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^"'<>=\s]+))?)*\s*>)(.*?)<\/script>/gis; +const commentRE$1 = /<!--.*?-->/gs; +const srcRE = /\bsrc\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i; +const typeRE = /\btype\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i; +const langRE = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i; +const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i; +const svelteModuleRE = /\smodule\b/i; +function esbuildScanPlugin(environment, depImports, missing, entries) { + const seen = /* @__PURE__ */ new Map(); + async function resolveId(id, importer, options) { + return environment.pluginContainer.resolveId( + id, + importer && normalizePath$3(importer), + { + ...options, + scan: true + } + ); + } + const resolve = async (id, importer, options) => { + const key = id + (importer && path$d.dirname(importer)); + if (seen.has(key)) { + return seen.get(key); + } + const resolved = await resolveId(id, importer, options); + const res = resolved?.id; + seen.set(key, res); + return res; + }; + const optimizeDepsOptions = environment.config.optimizeDeps; + const include = optimizeDepsOptions.include; + const exclude = [ + ...optimizeDepsOptions.exclude ?? [], + "@vite/client", + "@vite/env" + ]; + const isUnlessEntry = (path2) => !entries.includes(path2); + const externalUnlessEntry = ({ path: path2 }) => ({ + path: path2, + external: isUnlessEntry(path2) + }); + const doTransformGlobImport = async (contents, id, loader) => { + let transpiledContents; + if (loader !== "js") { + transpiledContents = (await transform$1(contents, { loader })).code; + } else { + transpiledContents = contents; + } + const result = await transformGlobImport( + transpiledContents, + id, + environment.config.root, + resolve + ); + return result?.s.toString() || transpiledContents; + }; + return { + name: "vite:dep-scan", + setup(build) { + const scripts = {}; + build.onResolve({ filter: externalRE }, ({ path: path2 }) => ({ + path: path2, + external: true + })); + build.onResolve({ filter: dataUrlRE }, ({ path: path2 }) => ({ + path: path2, + external: true + })); + build.onResolve({ filter: virtualModuleRE }, ({ path: path2 }) => { + return { + // strip prefix to get valid filesystem path so esbuild can resolve imports in the file + path: path2.replace(virtualModulePrefix, ""), + namespace: "script" + }; + }); + build.onLoad({ filter: /.*/, namespace: "script" }, ({ path: path2 }) => { + return scripts[path2]; + }); + build.onResolve({ filter: htmlTypesRE }, async ({ path: path2, importer }) => { + const resolved = await resolve(path2, importer); + if (!resolved) return; + if (isInNodeModules$1(resolved) && isOptimizable(resolved, optimizeDepsOptions)) + return; + return { + path: resolved, + namespace: "html" + }; + }); + const htmlTypeOnLoadCallback = async ({ path: p }) => { + let raw = await fsp.readFile(p, "utf-8"); + raw = raw.replace(commentRE$1, "<!---->"); + const isHtml = p.endsWith(".html"); + let js = ""; + let scriptId = 0; + const matches = raw.matchAll(scriptRE); + for (const [, openTag, content] of matches) { + const typeMatch = typeRE.exec(openTag); + const type = typeMatch && (typeMatch[1] || typeMatch[2] || typeMatch[3]); + const langMatch = langRE.exec(openTag); + const lang = langMatch && (langMatch[1] || langMatch[2] || langMatch[3]); + if (isHtml && type !== "module") { + continue; + } + if (type && !(type.includes("javascript") || type.includes("ecmascript") || type === "module")) { + continue; + } + let loader = "js"; + if (lang === "ts" || lang === "tsx" || lang === "jsx") { + loader = lang; + } else if (p.endsWith(".astro")) { + loader = "ts"; + } + const srcMatch = srcRE.exec(openTag); + if (srcMatch) { + const src = srcMatch[1] || srcMatch[2] || srcMatch[3]; + js += `import ${JSON.stringify(src)} +`; + } else if (content.trim()) { + const contents = content + (loader.startsWith("ts") ? extractImportPaths(content) : ""); + const key = `${p}?id=${scriptId++}`; + if (contents.includes("import.meta.glob")) { + scripts[key] = { + loader: "js", + // since it is transpiled + contents: await doTransformGlobImport(contents, p, loader), + resolveDir: normalizePath$3(path$d.dirname(p)), + pluginData: { + htmlType: { loader } + } + }; + } else { + scripts[key] = { + loader, + contents, + resolveDir: normalizePath$3(path$d.dirname(p)), + pluginData: { + htmlType: { loader } + } + }; + } + const virtualModulePath = JSON.stringify(virtualModulePrefix + key); + let addedImport = false; + if (p.endsWith(".svelte")) { + let isModule = svelteModuleRE.test(openTag); + if (!isModule) { + const contextMatch = svelteScriptModuleRE.exec(openTag); + const context = contextMatch && (contextMatch[1] || contextMatch[2] || contextMatch[3]); + isModule = context === "module"; + } + if (!isModule) { + addedImport = true; + js += `import ${virtualModulePath} +`; + } + } + if (!addedImport) { + js += `export * from ${virtualModulePath} +`; + } + } + } + if (!p.endsWith(".vue") || !js.includes("export default")) { + js += "\nexport default {}"; + } + return { + loader: "js", + contents: js + }; + }; + build.onLoad( + { filter: htmlTypesRE, namespace: "html" }, + htmlTypeOnLoadCallback + ); + build.onLoad( + { filter: htmlTypesRE, namespace: "file" }, + htmlTypeOnLoadCallback + ); + build.onResolve( + { + // avoid matching windows volume + filter: /^[\w@][^:]/ + }, + async ({ path: id, importer, pluginData }) => { + if (moduleListContains(exclude, id)) { + return externalUnlessEntry({ path: id }); + } + if (depImports[id]) { + return externalUnlessEntry({ path: id }); + } + const resolved = await resolve(id, importer, { + custom: { + depScan: { loader: pluginData?.htmlType?.loader } + } + }); + if (resolved) { + if (shouldExternalizeDep(resolved, id)) { + return externalUnlessEntry({ path: id }); + } + if (isInNodeModules$1(resolved) || include?.includes(id)) { + if (isOptimizable(resolved, optimizeDepsOptions)) { + depImports[id] = resolved; + } + return externalUnlessEntry({ path: id }); + } else if (isScannable(resolved, optimizeDepsOptions.extensions)) { + const namespace = htmlTypesRE.test(resolved) ? "html" : void 0; + return { + path: path$d.resolve(resolved), + namespace + }; + } else { + return externalUnlessEntry({ path: id }); + } + } else { + missing[id] = normalizePath$3(importer); + } + } + ); + const setupExternalize = (filter, doExternalize) => { + build.onResolve({ filter }, ({ path: path2 }) => { + return { + path: path2, + external: doExternalize(path2) + }; + }); + }; + setupExternalize(CSS_LANGS_RE, isUnlessEntry); + setupExternalize(/\.(json|json5|wasm)$/, isUnlessEntry); + setupExternalize( + new RegExp(`\\.(${KNOWN_ASSET_TYPES.join("|")})$`), + isUnlessEntry + ); + setupExternalize(SPECIAL_QUERY_RE, () => true); + build.onResolve( + { + filter: /.*/ + }, + async ({ path: id, importer, pluginData }) => { + const resolved = await resolve(id, importer, { + custom: { + depScan: { loader: pluginData?.htmlType?.loader } + } + }); + if (resolved) { + if (shouldExternalizeDep(resolved, id) || !isScannable(resolved, optimizeDepsOptions.extensions)) { + return externalUnlessEntry({ path: id }); + } + const namespace = htmlTypesRE.test(resolved) ? "html" : void 0; + return { + path: path$d.resolve(cleanUrl(resolved)), + namespace + }; + } else { + return externalUnlessEntry({ path: id }); + } + } + ); + build.onLoad({ filter: JS_TYPES_RE }, async ({ path: id }) => { + let ext = path$d.extname(id).slice(1); + if (ext === "mjs") ext = "js"; + const esbuildConfig = environment.config.esbuild; + let contents = await fsp.readFile(id, "utf-8"); + if (ext.endsWith("x") && esbuildConfig && esbuildConfig.jsxInject) { + contents = esbuildConfig.jsxInject + ` +` + contents; + } + const loader = optimizeDepsOptions.esbuildOptions?.loader?.[`.${ext}`] ?? ext; + if (contents.includes("import.meta.glob")) { + return { + loader: "js", + // since it is transpiled, + contents: await doTransformGlobImport(contents, id, loader) + }; + } + return { + loader, + contents + }; + }); + build.onLoad({ filter: /.*/, namespace: "file" }, () => { + return { + loader: "js", + contents: "export default {}" + }; + }); + } + }; +} +function extractImportPaths(code) { + code = code.replace(multilineCommentsRE, "/* */").replace(singlelineCommentsRE, ""); + let js = ""; + let m; + importsRE.lastIndex = 0; + while ((m = importsRE.exec(code)) != null) { + js += ` +import ${m[1]}`; + } + return js; +} +function shouldExternalizeDep(resolvedId, rawId) { + if (!path$d.isAbsolute(resolvedId)) { + return true; + } + if (resolvedId === rawId || resolvedId.includes("\0")) { + return true; + } + return false; +} +function isScannable(id, extensions) { + return JS_TYPES_RE.test(id) || htmlTypesRE.test(id) || extensions?.includes(path$d.extname(id)) || false; +} + +function createOptimizeDepsIncludeResolver(environment) { + const topLevelConfig = environment.getTopLevelConfig(); + const resolve = createBackCompatIdResolver(topLevelConfig, { + asSrc: false, + scan: true, + packageCache: /* @__PURE__ */ new Map() + }); + return async (id) => { + const lastArrowIndex = id.lastIndexOf(">"); + if (lastArrowIndex === -1) { + return await resolve(environment, id, void 0); + } + const nestedRoot = id.substring(0, lastArrowIndex).trim(); + const nestedPath = id.substring(lastArrowIndex + 1).trim(); + const basedir = nestedResolveBasedir( + nestedRoot, + topLevelConfig.root, + topLevelConfig.resolve.preserveSymlinks + ); + return await resolve( + environment, + nestedPath, + path$d.resolve(basedir, "package.json") + ); + }; +} +function expandGlobIds(id, config) { + const pkgName = getNpmPackageName(id); + if (!pkgName) return []; + const pkgData = resolvePackageData( + pkgName, + config.root, + config.resolve.preserveSymlinks, + config.packageCache + ); + if (!pkgData) return []; + const pattern = "." + id.slice(pkgName.length); + const exports = pkgData.data.exports; + if (exports) { + if (typeof exports === "string" || Array.isArray(exports)) { + return [pkgName]; + } + const possibleExportPaths = []; + for (const key in exports) { + if (key[0] === ".") { + if (key.includes("*")) { + const exportsValue = getFirstExportStringValue(exports[key]); + if (!exportsValue) continue; + const exportValuePattern = exportsValue.replace(/\*/g, "**/*"); + const exportsValueGlobRe = new RegExp( + exportsValue.split("*").map(escapeRegex).join("(.*)") + ); + possibleExportPaths.push( + ...globSync(exportValuePattern, { + cwd: pkgData.dir, + expandDirectories: false, + ignore: ["node_modules"] + }).map((filePath) => { + if (exportsValue.startsWith("./")) { + filePath = "./" + filePath; + } + const matched2 = exportsValueGlobRe.exec(slash$1(filePath)); + if (matched2) { + let allGlobSame = matched2.length === 2; + if (!allGlobSame) { + allGlobSame = true; + for (let i = 2; i < matched2.length; i++) { + if (matched2[i] !== matched2[i - 1]) { + allGlobSame = false; + break; + } + } + } + if (allGlobSame) { + return key.replace("*", matched2[1]).slice(2); + } + } + return ""; + }).filter(Boolean) + ); + } else { + possibleExportPaths.push(key.slice(2)); + } + } + } + const matched = possibleExportPaths.filter(picomatch$5(pattern)).map((match) => path$d.posix.join(pkgName, match)); + matched.unshift(pkgName); + return matched; + } else { + const matched = globSync(pattern, { + cwd: pkgData.dir, + expandDirectories: false, + ignore: ["node_modules"] + }).map((match) => path$d.posix.join(pkgName, slash$1(match))); + matched.unshift(pkgName); + return matched; + } +} +function getFirstExportStringValue(obj) { + if (typeof obj === "string") { + return obj; + } else if (Array.isArray(obj)) { + return obj[0]; + } else { + for (const key in obj) { + return getFirstExportStringValue(obj[key]); + } + } +} +function nestedResolveBasedir(id, basedir, preserveSymlinks = false) { + const pkgs = id.split(">").map((pkg) => pkg.trim()); + for (const pkg of pkgs) { + basedir = resolvePackageData(pkg, basedir, preserveSymlinks)?.dir || basedir; + } + return basedir; +} + +const debug$c = createDebugger("vite:deps"); +const jsExtensionRE = /\.js$/i; +const jsMapExtensionRE = /\.js\.map$/i; +function isDepOptimizationDisabled(optimizeDeps2) { + return optimizeDeps2.disabled === true || optimizeDeps2.disabled === "dev" || !!optimizeDeps2.noDiscovery && !optimizeDeps2.include?.length; +} +async function optimizeDeps(config, force = config.optimizeDeps.force, asCommand = false) { + const log = asCommand ? config.logger.info : debug$c; + const environment = new ScanEnvironment("client", config); + await environment.init(); + const cachedMetadata = await loadCachedDepOptimizationMetadata( + environment, + force, + asCommand + ); + if (cachedMetadata) { + return cachedMetadata; + } + const deps = await discoverProjectDependencies(environment).result; + await addManuallyIncludedOptimizeDeps(environment, deps); + const depsString = depsLogString(Object.keys(deps)); + log?.(colors$1.green(`Optimizing dependencies: + ${depsString}`)); + const depsInfo = toDiscoveredDependencies(environment, deps); + const result = await runOptimizeDeps(environment, depsInfo).result; + await result.commit(); + return result.metadata; +} +async function optimizeExplicitEnvironmentDeps(environment) { + const cachedMetadata = await loadCachedDepOptimizationMetadata( + environment, + environment.config.optimizeDeps.force ?? false, + false + ); + if (cachedMetadata) { + return cachedMetadata; + } + const deps = {}; + await addManuallyIncludedOptimizeDeps(environment, deps); + const depsInfo = toDiscoveredDependencies(environment, deps); + const result = await runOptimizeDeps(environment, depsInfo).result; + await result.commit(); + return result.metadata; +} +function initDepsOptimizerMetadata(environment, timestamp) { + const { lockfileHash, configHash, hash } = getDepHash(environment); + return { + hash, + lockfileHash, + configHash, + browserHash: getOptimizedBrowserHash(hash, {}, timestamp), + optimized: {}, + chunks: {}, + discovered: {}, + depInfoList: [] + }; +} +function addOptimizedDepInfo(metadata, type, depInfo) { + metadata[type][depInfo.id] = depInfo; + metadata.depInfoList.push(depInfo); + return depInfo; +} +let firstLoadCachedDepOptimizationMetadata = true; +async function loadCachedDepOptimizationMetadata(environment, force = environment.config.optimizeDeps.force ?? false, asCommand = false) { + const log = asCommand ? environment.logger.info : debug$c; + if (firstLoadCachedDepOptimizationMetadata) { + firstLoadCachedDepOptimizationMetadata = false; + setTimeout( + () => cleanupDepsCacheStaleDirs(environment.getTopLevelConfig()), + 0 + ); + } + const depsCacheDir = getDepsCacheDir(environment); + if (!force) { + let cachedMetadata; + try { + const cachedMetadataPath = path$d.join(depsCacheDir, METADATA_FILENAME); + cachedMetadata = parseDepsOptimizerMetadata( + await fsp.readFile(cachedMetadataPath, "utf-8"), + depsCacheDir + ); + } catch { + } + if (cachedMetadata) { + if (cachedMetadata.lockfileHash !== getLockfileHash(environment)) { + environment.logger.info( + "Re-optimizing dependencies because lockfile has changed" + ); + } else if (cachedMetadata.configHash !== getConfigHash(environment)) { + environment.logger.info( + "Re-optimizing dependencies because vite config has changed" + ); + } else { + log?.("Hash is consistent. Skipping. Use --force to override."); + return cachedMetadata; + } + } + } else { + environment.logger.info("Forced re-optimization of dependencies"); + } + debug$c?.(colors$1.green(`removing old cache dir ${depsCacheDir}`)); + await fsp.rm(depsCacheDir, { recursive: true, force: true }); +} +function discoverProjectDependencies(environment) { + const { cancel, result } = scanImports(environment); + return { + cancel, + result: result.then(({ deps, missing }) => { + const missingIds = Object.keys(missing); + if (missingIds.length) { + throw new Error( + `The following dependencies are imported but could not be resolved: + + ${missingIds.map( + (id) => `${colors$1.cyan(id)} ${colors$1.white( + colors$1.dim(`(imported by ${missing[id]})`) + )}` + ).join(` + `)} + +Are they installed?` + ); + } + return deps; + }) + }; +} +function toDiscoveredDependencies(environment, deps, timestamp) { + const browserHash = getOptimizedBrowserHash( + getDepHash(environment).hash, + deps, + timestamp + ); + const discovered = {}; + for (const id in deps) { + const src = deps[id]; + discovered[id] = { + id, + file: getOptimizedDepPath(environment, id), + src, + browserHash, + exportsData: extractExportsData(environment, src) + }; + } + return discovered; +} +function depsLogString(qualifiedIds) { + return colors$1.yellow(qualifiedIds.join(`, `)); +} +function runOptimizeDeps(environment, depsInfo) { + const optimizerContext = { cancelled: false }; + const depsCacheDir = getDepsCacheDir(environment); + const processingCacheDir = getProcessingDepsCacheDir(environment); + fs__default.mkdirSync(processingCacheDir, { recursive: true }); + debug$c?.(colors$1.green(`creating package.json in ${processingCacheDir}`)); + fs__default.writeFileSync( + path$d.resolve(processingCacheDir, "package.json"), + `{ + "type": "module" +} +` + ); + const metadata = initDepsOptimizerMetadata(environment); + metadata.browserHash = getOptimizedBrowserHash( + metadata.hash, + depsFromOptimizedDepInfo(depsInfo) + ); + const qualifiedIds = Object.keys(depsInfo); + let cleaned = false; + let committed = false; + const cleanUp = () => { + if (!cleaned && !committed) { + cleaned = true; + debug$c?.(colors$1.green(`removing cache dir ${processingCacheDir}`)); + try { + fs__default.rmSync(processingCacheDir, { recursive: true, force: true }); + } catch { + } + } + }; + const successfulResult = { + metadata, + cancel: cleanUp, + commit: async () => { + if (cleaned) { + throw new Error( + "Can not commit a Deps Optimization run as it was cancelled" + ); + } + committed = true; + const dataPath = path$d.join(processingCacheDir, METADATA_FILENAME); + debug$c?.( + colors$1.green(`creating ${METADATA_FILENAME} in ${processingCacheDir}`) + ); + fs__default.writeFileSync( + dataPath, + stringifyDepsOptimizerMetadata(metadata, depsCacheDir) + ); + const temporaryPath = depsCacheDir + getTempSuffix(); + const depsCacheDirPresent = fs__default.existsSync(depsCacheDir); + if (isWindows$3) { + if (depsCacheDirPresent) { + debug$c?.(colors$1.green(`renaming ${depsCacheDir} to ${temporaryPath}`)); + await safeRename(depsCacheDir, temporaryPath); + } + debug$c?.( + colors$1.green(`renaming ${processingCacheDir} to ${depsCacheDir}`) + ); + await safeRename(processingCacheDir, depsCacheDir); + } else { + if (depsCacheDirPresent) { + debug$c?.(colors$1.green(`renaming ${depsCacheDir} to ${temporaryPath}`)); + fs__default.renameSync(depsCacheDir, temporaryPath); + } + debug$c?.( + colors$1.green(`renaming ${processingCacheDir} to ${depsCacheDir}`) + ); + fs__default.renameSync(processingCacheDir, depsCacheDir); + } + if (depsCacheDirPresent) { + debug$c?.(colors$1.green(`removing cache temp dir ${temporaryPath}`)); + fsp.rm(temporaryPath, { recursive: true, force: true }); + } + } + }; + if (!qualifiedIds.length) { + return { + cancel: async () => cleanUp(), + result: Promise.resolve(successfulResult) + }; + } + const cancelledResult = { + metadata, + commit: async () => cleanUp(), + cancel: cleanUp + }; + const start = performance.now(); + const preparedRun = prepareEsbuildOptimizerRun( + environment, + depsInfo, + processingCacheDir, + optimizerContext + ); + const runResult = preparedRun.then(({ context, idToExports }) => { + function disposeContext() { + return context?.dispose().catch((e) => { + environment.logger.error("Failed to dispose esbuild context", { + error: e + }); + }); + } + if (!context || optimizerContext.cancelled) { + disposeContext(); + return cancelledResult; + } + return context.rebuild().then((result) => { + const meta = result.metafile; + const processingCacheDirOutputPath = path$d.relative( + process.cwd(), + processingCacheDir + ); + for (const id in depsInfo) { + const output = esbuildOutputFromId( + meta.outputs, + id, + processingCacheDir + ); + const { exportsData, ...info } = depsInfo[id]; + addOptimizedDepInfo(metadata, "optimized", { + ...info, + // We only need to hash the output.imports in to check for stability, but adding the hash + // and file path gives us a unique hash that may be useful for other things in the future + fileHash: getHash( + metadata.hash + depsInfo[id].file + JSON.stringify(output.imports) + ), + browserHash: metadata.browserHash, + // After bundling we have more information and can warn the user about legacy packages + // that require manual configuration + needsInterop: needsInterop( + environment, + id, + idToExports[id], + output + ) + }); + } + for (const o of Object.keys(meta.outputs)) { + if (!jsMapExtensionRE.test(o)) { + const id = path$d.relative(processingCacheDirOutputPath, o).replace(jsExtensionRE, ""); + const file = getOptimizedDepPath(environment, id); + if (!findOptimizedDepInfoInRecord( + metadata.optimized, + (depInfo) => depInfo.file === file + )) { + addOptimizedDepInfo(metadata, "chunks", { + id, + file, + needsInterop: false, + browserHash: metadata.browserHash + }); + } + } else { + const output = meta.outputs[o]; + if (output.bytes === 93) { + const jsMapPath = path$d.resolve(o); + const jsPath = jsMapPath.slice(0, -4); + if (fs__default.existsSync(jsPath) && fs__default.existsSync(jsMapPath)) { + const map = JSON.parse(fs__default.readFileSync(jsMapPath, "utf-8")); + if (map.sources.length === 0) { + const js = fs__default.readFileSync(jsPath, "utf-8"); + fs__default.writeFileSync( + jsPath, + js.slice(0, js.lastIndexOf("//# sourceMappingURL=")) + ); + } + } + } + } + } + debug$c?.( + `Dependencies bundled in ${(performance.now() - start).toFixed(2)}ms` + ); + return successfulResult; + }).catch((e) => { + if (e.errors && e.message.includes("The build was canceled")) { + return cancelledResult; + } + throw e; + }).finally(() => { + return disposeContext(); + }); + }); + runResult.catch(() => { + cleanUp(); + }); + return { + async cancel() { + optimizerContext.cancelled = true; + const { context } = await preparedRun; + await context?.cancel(); + cleanUp(); + }, + result: runResult + }; +} +async function prepareEsbuildOptimizerRun(environment, depsInfo, processingCacheDir, optimizerContext) { + const flatIdDeps = {}; + const idToExports = {}; + const { optimizeDeps: optimizeDeps2 } = environment.config; + const { plugins: pluginsFromConfig = [], ...esbuildOptions } = optimizeDeps2.esbuildOptions ?? {}; + await Promise.all( + Object.keys(depsInfo).map(async (id) => { + const src = depsInfo[id].src; + const exportsData = await (depsInfo[id].exportsData ?? extractExportsData(environment, src)); + if (exportsData.jsxLoader && !esbuildOptions.loader?.[".js"]) { + esbuildOptions.loader = { + ".js": "jsx", + ...esbuildOptions.loader + }; + } + const flatId = flattenId(id); + flatIdDeps[flatId] = src; + idToExports[id] = exportsData; + }) + ); + if (optimizerContext.cancelled) return { context: void 0, idToExports }; + const define = { + "process.env.NODE_ENV": JSON.stringify( + process.env.NODE_ENV || environment.config.mode + ) + }; + const platform = optimizeDeps2.esbuildOptions?.platform ?? // We generally don't want to use platform 'neutral', as esbuild has custom handling + // when the platform is 'node' or 'browser' that can't be emulated by using mainFields + // and conditions + (environment.config.consumer === "client" || environment.config.ssr.target === "webworker" ? "browser" : "node"); + const external = [...optimizeDeps2.exclude ?? []]; + const plugins = [...pluginsFromConfig]; + if (external.length) { + plugins.push(esbuildCjsExternalPlugin(external, platform)); + } + plugins.push(esbuildDepPlugin(environment, flatIdDeps, external)); + const context = await esbuild.context({ + absWorkingDir: process.cwd(), + entryPoints: Object.keys(flatIdDeps), + bundle: true, + platform, + define, + format: "esm", + // See https://github.com/evanw/esbuild/issues/1921#issuecomment-1152991694 + banner: platform === "node" ? { + js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);` + } : void 0, + target: ESBUILD_MODULES_TARGET, + external, + logLevel: "error", + splitting: true, + sourcemap: true, + outdir: processingCacheDir, + ignoreAnnotations: true, + metafile: true, + plugins, + charset: "utf8", + ...esbuildOptions, + supported: { + ...defaultEsbuildSupported, + ...esbuildOptions.supported + } + }); + return { context, idToExports }; +} +async function addManuallyIncludedOptimizeDeps(environment, deps) { + const { logger } = environment; + const { optimizeDeps: optimizeDeps2 } = environment.config; + const optimizeDepsInclude = optimizeDeps2.include ?? []; + if (optimizeDepsInclude.length) { + const unableToOptimize = (id, msg) => { + if (optimizeDepsInclude.includes(id)) { + logger.warn( + `${msg}: ${colors$1.cyan(id)}, present in ${environment.name} 'optimizeDeps.include'` + ); + } + }; + const includes = [...optimizeDepsInclude]; + for (let i = 0; i < includes.length; i++) { + const id = includes[i]; + if (isDynamicPattern(id)) { + const globIds = expandGlobIds(id, environment.getTopLevelConfig()); + includes.splice(i, 1, ...globIds); + i += globIds.length - 1; + } + } + const resolve = createOptimizeDepsIncludeResolver(environment); + for (const id of includes) { + const normalizedId = normalizeId(id); + if (!deps[normalizedId]) { + const entry = await resolve(id); + if (entry) { + if (isOptimizable(entry, optimizeDeps2)) { + deps[normalizedId] = entry; + } else { + unableToOptimize(id, "Cannot optimize dependency"); + } + } else { + unableToOptimize(id, "Failed to resolve dependency"); + } + } + } + } +} +function depsFromOptimizedDepInfo(depsInfo) { + const obj = {}; + for (const key in depsInfo) { + obj[key] = depsInfo[key].src; + } + return obj; +} +function getOptimizedDepPath(environment, id) { + return normalizePath$3( + path$d.resolve(getDepsCacheDir(environment), flattenId(id) + ".js") + ); +} +function getDepsCacheSuffix(environment) { + return environment.name === "client" ? "" : `_${environment.name}`; +} +function getDepsCacheDir(environment) { + return getDepsCacheDirPrefix(environment) + getDepsCacheSuffix(environment); +} +function getProcessingDepsCacheDir(environment) { + return getDepsCacheDirPrefix(environment) + getDepsCacheSuffix(environment) + getTempSuffix(); +} +function getTempSuffix() { + return "_temp_" + getHash( + `${process.pid}:${Date.now().toString()}:${Math.random().toString(16).slice(2)}` + ); +} +function getDepsCacheDirPrefix(environment) { + return normalizePath$3(path$d.resolve(environment.config.cacheDir, "deps")); +} +function createIsOptimizedDepFile(environment) { + const depsCacheDirPrefix = getDepsCacheDirPrefix(environment); + return (id) => id.startsWith(depsCacheDirPrefix); +} +function createIsOptimizedDepUrl(environment) { + const { root } = environment.config; + const depsCacheDir = getDepsCacheDirPrefix(environment); + const depsCacheDirRelative = normalizePath$3(path$d.relative(root, depsCacheDir)); + const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? ( + // if the cache directory is outside root, the url prefix would be something + // like '/@fs/absolute/path/to/node_modules/.vite' + `/@fs/${removeLeadingSlash(normalizePath$3(depsCacheDir))}` + ) : ( + // if the cache directory is inside root, the url prefix would be something + // like '/node_modules/.vite' + `/${depsCacheDirRelative}` + ); + return function isOptimizedDepUrl(url) { + return url.startsWith(depsCacheDirPrefix); + }; +} +function parseDepsOptimizerMetadata(jsonMetadata, depsCacheDir) { + const { hash, lockfileHash, configHash, browserHash, optimized, chunks } = JSON.parse(jsonMetadata, (key, value) => { + if (key === "file" || key === "src") { + return normalizePath$3(path$d.resolve(depsCacheDir, value)); + } + return value; + }); + if (!chunks || Object.values(optimized).some((depInfo) => !depInfo.fileHash)) { + return; + } + const metadata = { + hash, + lockfileHash, + configHash, + browserHash, + optimized: {}, + discovered: {}, + chunks: {}, + depInfoList: [] + }; + for (const id of Object.keys(optimized)) { + addOptimizedDepInfo(metadata, "optimized", { + ...optimized[id], + id, + browserHash + }); + } + for (const id of Object.keys(chunks)) { + addOptimizedDepInfo(metadata, "chunks", { + ...chunks[id], + id, + browserHash, + needsInterop: false + }); + } + return metadata; +} +function stringifyDepsOptimizerMetadata(metadata, depsCacheDir) { + const { hash, configHash, lockfileHash, browserHash, optimized, chunks } = metadata; + return JSON.stringify( + { + hash, + configHash, + lockfileHash, + browserHash, + optimized: Object.fromEntries( + Object.values(optimized).map( + ({ id, src, file, fileHash, needsInterop: needsInterop2 }) => [ + id, + { + src, + file, + fileHash, + needsInterop: needsInterop2 + } + ] + ) + ), + chunks: Object.fromEntries( + Object.values(chunks).map(({ id, file }) => [id, { file }]) + ) + }, + (key, value) => { + if (key === "file" || key === "src") { + return normalizePath$3(path$d.relative(depsCacheDir, value)); + } + return value; + }, + 2 + ); +} +function esbuildOutputFromId(outputs, id, cacheDirOutputPath) { + const cwd = process.cwd(); + const flatId = flattenId(id) + ".js"; + const normalizedOutputPath = normalizePath$3( + path$d.relative(cwd, path$d.join(cacheDirOutputPath, flatId)) + ); + const output = outputs[normalizedOutputPath]; + if (output) { + return output; + } + for (const [key, value] of Object.entries(outputs)) { + if (normalizePath$3(path$d.relative(cwd, key)) === normalizedOutputPath) { + return value; + } + } +} +async function extractExportsData(environment, filePath) { + await init; + const { optimizeDeps: optimizeDeps2 } = environment.config; + const esbuildOptions = optimizeDeps2.esbuildOptions ?? {}; + if (optimizeDeps2.extensions?.some((ext) => filePath.endsWith(ext))) { + const result = await build$b({ + ...esbuildOptions, + entryPoints: [filePath], + write: false, + format: "esm" + }); + const [, exports2, , hasModuleSyntax2] = parse$e(result.outputFiles[0].text); + return { + hasModuleSyntax: hasModuleSyntax2, + exports: exports2.map((e) => e.n) + }; + } + let parseResult; + let usedJsxLoader = false; + const entryContent = await fsp.readFile(filePath, "utf-8"); + try { + parseResult = parse$e(entryContent); + } catch { + const loader = esbuildOptions.loader?.[path$d.extname(filePath)] || "jsx"; + debug$c?.( + `Unable to parse: ${filePath}. + Trying again with a ${loader} transform.` + ); + const transformed = await transformWithEsbuild( + entryContent, + filePath, + { loader }, + void 0, + environment.config + ); + parseResult = parse$e(transformed.code); + usedJsxLoader = true; + } + const [, exports, , hasModuleSyntax] = parseResult; + const exportsData = { + hasModuleSyntax, + exports: exports.map((e) => e.n), + jsxLoader: usedJsxLoader + }; + return exportsData; +} +function needsInterop(environment, id, exportsData, output) { + if (environment.config.optimizeDeps.needsInterop?.includes(id)) { + return true; + } + const { hasModuleSyntax, exports } = exportsData; + if (!hasModuleSyntax) { + return true; + } + if (output) { + const generatedExports = output.exports; + if (isSingleDefaultExport(generatedExports) && !isSingleDefaultExport(exports)) { + return true; + } + } + return false; +} +function isSingleDefaultExport(exports) { + return exports.length === 1 && exports[0] === "default"; +} +const lockfileFormats = [ + { + path: "node_modules/.package-lock.json", + checkPatches: true, + manager: "npm" + }, + { + // Yarn non-PnP + path: "node_modules/.yarn-state.yml", + checkPatches: false, + manager: "yarn" + }, + { + // Yarn PnP + path: ".yarn/install-state", + checkPatches: false, + manager: "yarn" + }, + { + // yarn 1 + path: "node_modules/.yarn-integrity", + checkPatches: true, + manager: "yarn" + }, + { + path: "node_modules/.pnpm/lock.yaml", + // Included in lockfile + checkPatches: false, + manager: "pnpm" + }, + { name: "bun.lockb", path: "bun.lockb", checkPatches: true, manager: "bun" } +].sort((_, { manager }) => { + return process.env.npm_config_user_agent?.startsWith(manager) ? 1 : -1; +}); +const lockfilePaths = lockfileFormats.map((l) => l.path); +function getConfigHash(environment) { + const { config } = environment; + const { optimizeDeps: optimizeDeps2 } = config; + const content = JSON.stringify( + { + mode: process.env.NODE_ENV || config.mode, + root: config.root, + resolve: config.resolve, + assetsInclude: config.assetsInclude, + plugins: config.plugins.map((p) => p.name), + optimizeDeps: { + include: optimizeDeps2.include ? unique(optimizeDeps2.include).sort() : void 0, + exclude: optimizeDeps2.exclude ? unique(optimizeDeps2.exclude).sort() : void 0, + esbuildOptions: { + ...optimizeDeps2.esbuildOptions, + plugins: optimizeDeps2.esbuildOptions?.plugins?.map((p) => p.name) + } + } + }, + (_, value) => { + if (typeof value === "function" || value instanceof RegExp) { + return value.toString(); + } + return value; + } + ); + return getHash(content); +} +function getLockfileHash(environment) { + const lockfilePath = lookupFile(environment.config.root, lockfilePaths); + let content = lockfilePath ? fs__default.readFileSync(lockfilePath, "utf-8") : ""; + if (lockfilePath) { + const normalizedLockfilePath = lockfilePath.replaceAll("\\", "/"); + const lockfileFormat = lockfileFormats.find( + (f) => normalizedLockfilePath.endsWith(f.path) + ); + if (lockfileFormat.checkPatches) { + const baseDir = lockfilePath.slice(0, -lockfileFormat.path.length); + const fullPath = path$d.join(baseDir, "patches"); + const stat = tryStatSync(fullPath); + if (stat?.isDirectory()) { + content += stat.mtimeMs.toString(); + } + } + } + return getHash(content); +} +function getDepHash(environment) { + const lockfileHash = getLockfileHash(environment); + const configHash = getConfigHash(environment); + const hash = getHash(lockfileHash + configHash); + return { + hash, + lockfileHash, + configHash + }; +} +function getOptimizedBrowserHash(hash, deps, timestamp = "") { + return getHash(hash + JSON.stringify(deps) + timestamp); +} +function optimizedDepInfoFromId(metadata, id) { + return metadata.optimized[id] || metadata.discovered[id] || metadata.chunks[id]; +} +function optimizedDepInfoFromFile(metadata, file) { + return metadata.depInfoList.find((depInfo) => depInfo.file === file); +} +function findOptimizedDepInfoInRecord(dependenciesInfo, callbackFn) { + for (const o of Object.keys(dependenciesInfo)) { + const info = dependenciesInfo[o]; + if (callbackFn(info, o)) { + return info; + } + } +} +async function optimizedDepNeedsInterop(environment, metadata, file) { + const depInfo = optimizedDepInfoFromFile(metadata, file); + if (depInfo?.src && depInfo.needsInterop === void 0) { + depInfo.exportsData ??= extractExportsData(environment, depInfo.src); + depInfo.needsInterop = needsInterop( + environment, + depInfo.id, + await depInfo.exportsData + ); + } + return depInfo?.needsInterop; +} +const MAX_TEMP_DIR_AGE_MS = 24 * 60 * 60 * 1e3; +async function cleanupDepsCacheStaleDirs(config) { + try { + const cacheDir = path$d.resolve(config.cacheDir); + if (fs__default.existsSync(cacheDir)) { + const dirents = await fsp.readdir(cacheDir, { withFileTypes: true }); + for (const dirent of dirents) { + if (dirent.isDirectory() && dirent.name.includes("_temp_")) { + const tempDirPath = path$d.resolve(config.cacheDir, dirent.name); + const stats = await fsp.stat(tempDirPath).catch(() => null); + if (stats?.mtime && Date.now() - stats.mtime.getTime() > MAX_TEMP_DIR_AGE_MS) { + debug$c?.(`removing stale cache temp dir ${tempDirPath}`); + await fsp.rm(tempDirPath, { recursive: true, force: true }); + } + } + } + } + } catch (err) { + config.logger.error(err); + } +} +const GRACEFUL_RENAME_TIMEOUT = 5e3; +const safeRename = promisify$4(function gracefulRename(from, to, cb) { + const start = Date.now(); + let backoff = 0; + fs__default.rename(from, to, function CB(er) { + if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < GRACEFUL_RENAME_TIMEOUT) { + setTimeout(function() { + fs__default.stat(to, function(stater, _st) { + if (stater && stater.code === "ENOENT") fs__default.rename(from, to, CB); + else CB(er); + }); + }, backoff); + if (backoff < 100) backoff += 10; + return; + } + cb(er); + }); +}); + +var index$1 = { + __proto__: null, + addManuallyIncludedOptimizeDeps: addManuallyIncludedOptimizeDeps, + addOptimizedDepInfo: addOptimizedDepInfo, + cleanupDepsCacheStaleDirs: cleanupDepsCacheStaleDirs, + createIsOptimizedDepFile: createIsOptimizedDepFile, + createIsOptimizedDepUrl: createIsOptimizedDepUrl, + depsFromOptimizedDepInfo: depsFromOptimizedDepInfo, + depsLogString: depsLogString, + discoverProjectDependencies: discoverProjectDependencies, + extractExportsData: extractExportsData, + getDepsCacheDir: getDepsCacheDir, + getOptimizedDepPath: getOptimizedDepPath, + initDepsOptimizerMetadata: initDepsOptimizerMetadata, + isDepOptimizationDisabled: isDepOptimizationDisabled, + loadCachedDepOptimizationMetadata: loadCachedDepOptimizationMetadata, + optimizeDeps: optimizeDeps, + optimizeExplicitEnvironmentDeps: optimizeExplicitEnvironmentDeps, + optimizedDepInfoFromFile: optimizedDepInfoFromFile, + optimizedDepInfoFromId: optimizedDepInfoFromId, + optimizedDepNeedsInterop: optimizedDepNeedsInterop, + runOptimizeDeps: runOptimizeDeps, + toDiscoveredDependencies: toDiscoveredDependencies +}; + +const jsonExtRE = /\.json(?:$|\?)(?!commonjs-(?:proxy|external))/; +const jsonObjRE = /^\s*\{/; +const jsonLangs = `\\.(?:json|json5)(?:$|\\?)`; +const jsonLangRE = new RegExp(jsonLangs); +const isJSONRequest = (request) => jsonLangRE.test(request); +function jsonPlugin(options, isBuild) { + return { + name: "vite:json", + transform(json, id) { + if (!jsonExtRE.test(id)) return null; + if (SPECIAL_QUERY_RE.test(id)) return null; + json = stripBomTag(json); + try { + if (options.stringify !== false) { + if (options.namedExports && jsonObjRE.test(json)) { + const parsed = JSON.parse(json); + const keys = Object.keys(parsed); + let code = ""; + let defaultObjectCode = "{\n"; + for (const key of keys) { + if (key === makeLegalIdentifier(key)) { + code += `export const ${key} = ${serializeValue(parsed[key])}; +`; + defaultObjectCode += ` ${key}, +`; + } else { + defaultObjectCode += ` ${JSON.stringify(key)}: ${serializeValue(parsed[key])}, +`; + } + } + defaultObjectCode += "}"; + code += `export default ${defaultObjectCode}; +`; + return { + code, + map: { mappings: "" } + }; + } + if (options.stringify === true || // use 10kB as a threshold for 'auto' + // https://v8.dev/blog/cost-of-javascript-2019#:~:text=A%20good%20rule%20of%20thumb%20is%20to%20apply%20this%20technique%20for%20objects%20of%2010%20kB%20or%20larger + json.length > 10 * 1e3) { + if (isBuild) { + json = JSON.stringify(JSON.parse(json)); + } + return { + code: `export default JSON.parse(${JSON.stringify(json)})`, + map: { mappings: "" } + }; + } + } + return { + code: dataToEsm(JSON.parse(json), { + preferConst: true, + namedExports: options.namedExports + }), + map: { mappings: "" } + }; + } catch (e) { + const position = extractJsonErrorPosition(e.message, json.length); + const msg = position ? `, invalid JSON syntax found at position ${position}` : `.`; + this.error(`Failed to parse JSON file` + msg, position); + } + } + }; +} +function serializeValue(value) { + const valueAsString = JSON.stringify(value); + if (typeof value === "object" && value != null && valueAsString.length > 10 * 1e3) { + return `JSON.parse(${JSON.stringify(valueAsString)})`; + } + return valueAsString; +} +function extractJsonErrorPosition(errorMessage, inputLength) { + if (errorMessage.startsWith("Unexpected end of JSON input")) { + return inputLength - 1; + } + const errorMessageList = /at position (\d+)/.exec(errorMessage); + return errorMessageList ? Math.max(parseInt(errorMessageList[1], 10) - 1, 0) : void 0; +} + +const debug$b = createDebugger("vite:optimize-deps"); +function optimizedDepsPlugin() { + return { + name: "vite:optimized-deps", + resolveId(id) { + const environment = this.environment; + if (environment.depsOptimizer?.isOptimizedDepFile(id)) { + return id; + } + }, + // this.load({ id }) isn't implemented in PluginContainer + // The logic to register an id to wait until it is processed + // is in importAnalysis, see call to delayDepsOptimizerUntil + async load(id) { + const environment = this.environment; + const depsOptimizer = environment.depsOptimizer; + if (depsOptimizer?.isOptimizedDepFile(id)) { + const metadata = depsOptimizer.metadata; + const file = cleanUrl(id); + const versionMatch = DEP_VERSION_RE.exec(file); + const browserHash = versionMatch ? versionMatch[1].split("=")[1] : void 0; + const info = optimizedDepInfoFromFile(metadata, file); + if (info) { + if (browserHash && info.browserHash !== browserHash) { + throwOutdatedRequest(id); + } + try { + await info.processing; + } catch { + throwProcessingError(id); + } + const newMetadata = depsOptimizer.metadata; + if (metadata !== newMetadata) { + const currentInfo = optimizedDepInfoFromFile(newMetadata, file); + if (info.browserHash !== currentInfo?.browserHash) { + throwOutdatedRequest(id); + } + } + } + debug$b?.(`load ${colors$1.cyan(file)}`); + try { + return await fsp.readFile(file, "utf-8"); + } catch { + const newMetadata = depsOptimizer.metadata; + if (optimizedDepInfoFromFile(newMetadata, file)) { + throwOutdatedRequest(id); + } + throwFileNotFoundInOptimizedDep(id); + } + } + } + }; +} +function throwProcessingError(id) { + const err = new Error( + `Something unexpected happened while optimizing "${id}". The current page should have reloaded by now` + ); + err.code = ERR_OPTIMIZE_DEPS_PROCESSING_ERROR; + throw err; +} +function throwOutdatedRequest(id) { + const err = new Error( + `There is a new version of the pre-bundle for "${id}", a page reload is going to ask for it.` + ); + err.code = ERR_OUTDATED_OPTIMIZED_DEP; + throw err; +} +function throwFileNotFoundInOptimizedDep(id) { + const err = new Error( + `The file does not exist at "${id}" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to \`optimizeDeps.exclude\`.` + ); + err.code = ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR; + throw err; +} + +var main$1 = {exports: {}}; + +var name = "dotenv"; +var version$1 = "16.4.5"; +var description = "Loads environment variables from .env file"; +var main = "lib/main.js"; +var types = "lib/main.d.ts"; +var exports = { + ".": { + types: "./lib/main.d.ts", + require: "./lib/main.js", + "default": "./lib/main.js" + }, + "./config": "./config.js", + "./config.js": "./config.js", + "./lib/env-options": "./lib/env-options.js", + "./lib/env-options.js": "./lib/env-options.js", + "./lib/cli-options": "./lib/cli-options.js", + "./lib/cli-options.js": "./lib/cli-options.js", + "./package.json": "./package.json" +}; +var scripts = { + "dts-check": "tsc --project tests/types/tsconfig.json", + lint: "standard", + "lint-readme": "standard-markdown", + pretest: "npm run lint && npm run dts-check", + test: "tap tests/*.js --100 -Rspec", + "test:coverage": "tap --coverage-report=lcov", + prerelease: "npm test", + release: "standard-version" +}; +var repository = { + type: "git", + url: "git://github.com/motdotla/dotenv.git" +}; +var funding = "https://dotenvx.com"; +var keywords = [ + "dotenv", + "env", + ".env", + "environment", + "variables", + "config", + "settings" +]; +var readmeFilename = "README.md"; +var license = "BSD-2-Clause"; +var devDependencies = { + "@definitelytyped/dtslint": "^0.0.133", + "@types/node": "^18.11.3", + decache: "^4.6.1", + sinon: "^14.0.1", + standard: "^17.0.0", + "standard-markdown": "^7.1.0", + "standard-version": "^9.5.0", + tap: "^16.3.0", + tar: "^6.1.11", + typescript: "^4.8.4" +}; +var engines = { + node: ">=12" +}; +var browser$1 = { + fs: false +}; +var require$$4 = { + name: name, + version: version$1, + description: description, + main: main, + types: types, + exports: exports, + scripts: scripts, + repository: repository, + funding: funding, + keywords: keywords, + readmeFilename: readmeFilename, + license: license, + devDependencies: devDependencies, + engines: engines, + browser: browser$1 +}; + +const fs$6 = require$$0$3; +const path$a = require$$0$2; +const os$1 = require$$2; +const crypto$1 = require$$3; +const packageJson = require$$4; + +const version = packageJson.version; + +const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + +// Parse src into an Object +function parse$d (src) { + const obj = {}; + + // Convert buffer to string + let lines = src.toString(); + + // Convert line breaks to same format + lines = lines.replace(/\r\n?/mg, '\n'); + + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + + // Default undefined or null to empty string + let value = (match[2] || ''); + + // Remove whitespace + value = value.trim(); + + // Check if double quoted + const maybeQuote = value[0]; + + // Remove surrounding quotes + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2'); + + // Expand newlines if double quoted + if (maybeQuote === '"') { + value = value.replace(/\\n/g, '\n'); + value = value.replace(/\\r/g, '\r'); + } + + // Add to object + obj[key] = value; + } + + return obj +} + +function _parseVault (options) { + const vaultPath = _vaultPath(options); + + // Parse .env.vault + const result = DotenvModule.configDotenv({ path: vaultPath }); + if (!result.parsed) { + const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err.code = 'MISSING_DATA'; + throw err + } + + // handle scenario for comma separated keys - for use with key rotation + // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod" + const keys = _dotenvKey(options).split(','); + const length = keys.length; + + let decrypted; + for (let i = 0; i < length; i++) { + try { + // Get full key + const key = keys[i].trim(); + + // Get instructions for decrypt + const attrs = _instructions(result, key); + + // Decrypt + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + + break + } catch (error) { + // last key + if (i + 1 >= length) { + throw error + } + // try next key + } + } + + // Parse decrypted .env string + return DotenvModule.parse(decrypted) +} + +function _log (message) { + console.log(`[dotenv@${version}][INFO] ${message}`); +} + +function _warn (message) { + console.log(`[dotenv@${version}][WARN] ${message}`); +} + +function _debug (message) { + console.log(`[dotenv@${version}][DEBUG] ${message}`); +} + +function _dotenvKey (options) { + // prioritize developer directly setting options.DOTENV_KEY + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY + } + + // secondary infra already contains a DOTENV_KEY environment variable + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { + return process.env.DOTENV_KEY + } + + // fallback to empty string + return '' +} + +function _instructions (result, dotenvKey) { + // Parse DOTENV_KEY. Format is a URI + let uri; + try { + uri = new URL(dotenvKey); + } catch (error) { + if (error.code === 'ERR_INVALID_URL') { + const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + throw error + } + + // Get decrypt key + const key = uri.password; + if (!key) { + const err = new Error('INVALID_DOTENV_KEY: Missing key part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get environment + const environment = uri.searchParams.get('environment'); + if (!environment) { + const err = new Error('INVALID_DOTENV_KEY: Missing environment part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get ciphertext payload + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION + if (!ciphertext) { + const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'; + throw err + } + + return { ciphertext, key } +} + +function _vaultPath (options) { + let possibleVaultPath = null; + + if (options && options.path && options.path.length > 0) { + if (Array.isArray(options.path)) { + for (const filepath of options.path) { + if (fs$6.existsSync(filepath)) { + possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`; + } + } + } else { + possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`; + } + } else { + possibleVaultPath = path$a.resolve(process.cwd(), '.env.vault'); + } + + if (fs$6.existsSync(possibleVaultPath)) { + return possibleVaultPath + } + + return null +} + +function _resolveHome (envPath) { + return envPath[0] === '~' ? path$a.join(os$1.homedir(), envPath.slice(1)) : envPath +} + +function _configVault (options) { + _log('Loading env from encrypted .env.vault'); + + const parsed = DotenvModule._parseVault(options); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } +} + +function configDotenv (options) { + const dotenvPath = path$a.resolve(process.cwd(), '.env'); + let encoding = 'utf8'; + const debug = Boolean(options && options.debug); + + if (options && options.encoding) { + encoding = options.encoding; + } else { + if (debug) { + _debug('No encoding is specified. UTF-8 is used by default'); + } + } + + let optionPaths = [dotenvPath]; // default, look for .env + if (options && options.path) { + if (!Array.isArray(options.path)) { + optionPaths = [_resolveHome(options.path)]; + } else { + optionPaths = []; // reset default + for (const filepath of options.path) { + optionPaths.push(_resolveHome(filepath)); + } + } + } + + // Build the parsed data in a temporary object (because we need to return it). Once we have the final + // parsed data, we will combine it with process.env (or options.processEnv if provided). + let lastError; + const parsedAll = {}; + for (const path of optionPaths) { + try { + // Specifying an encoding returns a string instead of a buffer + const parsed = DotenvModule.parse(fs$6.readFileSync(path, { encoding })); + + DotenvModule.populate(parsedAll, parsed, options); + } catch (e) { + if (debug) { + _debug(`Failed to load ${path} ${e.message}`); + } + lastError = e; + } + } + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsedAll, options); + + if (lastError) { + return { parsed: parsedAll, error: lastError } + } else { + return { parsed: parsedAll } + } +} + +// Populates process.env from .env file +function config (options) { + // fallback to original dotenv if DOTENV_KEY is not set + if (_dotenvKey(options).length === 0) { + return DotenvModule.configDotenv(options) + } + + const vaultPath = _vaultPath(options); + + // dotenvKey exists but .env.vault file does not exist + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + + return DotenvModule.configDotenv(options) + } + + return DotenvModule._configVault(options) +} + +function decrypt (encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), 'hex'); + let ciphertext = Buffer.from(encrypted, 'base64'); + + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + + try { + const aesgcm = crypto$1.createDecipheriv('aes-256-gcm', key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}` + } catch (error) { + const isRange = error instanceof RangeError; + const invalidKeyLength = error.message === 'Invalid key length'; + const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'; + + if (isRange || invalidKeyLength) { + const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } else if (decryptionFailed) { + const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY'); + err.code = 'DECRYPTION_FAILED'; + throw err + } else { + throw error + } + } +} + +// Populate process.env with parsed values +function populate (processEnv, parsed, options = {}) { + const debug = Boolean(options && options.debug); + const override = Boolean(options && options.override); + + if (typeof parsed !== 'object') { + const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate'); + err.code = 'OBJECT_REQUIRED'; + throw err + } + + // Set process.env + for (const key of Object.keys(parsed)) { + if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + } + + if (debug) { + if (override === true) { + _debug(`"${key}" is already defined and WAS overwritten`); + } else { + _debug(`"${key}" is already defined and was NOT overwritten`); + } + } + } else { + processEnv[key] = parsed[key]; + } + } +} + +const DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse: parse$d, + populate +}; + +main$1.exports.configDotenv = DotenvModule.configDotenv; +main$1.exports._configVault = DotenvModule._configVault; +main$1.exports._parseVault = DotenvModule._parseVault; +main$1.exports.config = DotenvModule.config; +main$1.exports.decrypt = DotenvModule.decrypt; +var parse_1$3 = main$1.exports.parse = DotenvModule.parse; +main$1.exports.populate = DotenvModule.populate; + +main$1.exports = DotenvModule; + +function _resolveEscapeSequences (value) { + return value.replace(/\\\$/g, '$') +} + +function expandValue (value, processEnv, runningParsed) { + const env = { ...runningParsed, ...processEnv }; // process.env wins + + const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g; + + let result = value; + let match; + const seen = new Set(); // self-referential checker + + while ((match = regex.exec(result)) !== null) { + seen.add(result); + + const [template, bracedExpression, unbracedExpression] = match; + const expression = bracedExpression || unbracedExpression; + + // match the operators `:+`, `+`, `:-`, and `-` + const opRegex = /(:\+|\+|:-|-)/; + // find first match + const opMatch = expression.match(opRegex); + const splitter = opMatch ? opMatch[0] : null; + + const r = expression.split(splitter); + + let defaultValue; + let value; + + const key = r.shift(); + + if ([':+', '+'].includes(splitter)) { + defaultValue = env[key] ? r.join(splitter) : ''; + value = null; + } else { + defaultValue = r.join(splitter); + value = env[key]; + } + + if (value) { + // self-referential check + if (seen.has(value)) { + result = result.replace(template, defaultValue); + } else { + result = result.replace(template, value); + } + } else { + result = result.replace(template, defaultValue); + } + + // if the result equaled what was in process.env and runningParsed then stop expanding + if (result === runningParsed[key]) { + break + } + + regex.lastIndex = 0; // reset regex search position to re-evaluate after each replacement + } + + return result +} + +function expand$2 (options) { + // for use with progressive expansion + const runningParsed = {}; + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + // dotenv.config() ran before this so the assumption is process.env has already been set + for (const key in options.parsed) { + let value = options.parsed[key]; + + // short-circuit scenario: process.env was already set prior to the file value + if (processEnv[key] && processEnv[key] !== value) { + value = processEnv[key]; + } else { + value = expandValue(value, processEnv, runningParsed); + } + + options.parsed[key] = _resolveEscapeSequences(value); + + // for use with progressive expansion + runningParsed[key] = _resolveEscapeSequences(value); + } + + for (const processKey in options.parsed) { + processEnv[processKey] = options.parsed[processKey]; + } + + return options +} + +var expand_1$1 = expand$2; + +function getEnvFilesForMode(mode, envDir) { + return [ + /** default file */ + `.env`, + /** local file */ + `.env.local`, + /** mode file */ + `.env.${mode}`, + /** mode local file */ + `.env.${mode}.local` + ].map((file) => normalizePath$3(path$d.join(envDir, file))); +} +function loadEnv(mode, envDir, prefixes = "VITE_") { + if (mode === "local") { + throw new Error( + `"local" cannot be used as a mode name because it conflicts with the .local postfix for .env files.` + ); + } + prefixes = arraify(prefixes); + const env = {}; + const envFiles = getEnvFilesForMode(mode, envDir); + const parsed = Object.fromEntries( + envFiles.flatMap((filePath) => { + if (!tryStatSync(filePath)?.isFile()) return []; + return Object.entries(parse_1$3(fs__default.readFileSync(filePath))); + }) + ); + if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) { + process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV; + } + if (parsed.BROWSER && process.env.BROWSER === void 0) { + process.env.BROWSER = parsed.BROWSER; + } + if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) { + process.env.BROWSER_ARGS = parsed.BROWSER_ARGS; + } + const processEnv = { ...process.env }; + expand_1$1({ parsed, processEnv }); + for (const [key, value] of Object.entries(parsed)) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = value; + } + } + for (const key in process.env) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = process.env[key]; + } + } + return env; +} +function resolveEnvPrefix({ + envPrefix = "VITE_" +}) { + envPrefix = arraify(envPrefix); + if (envPrefix.includes("")) { + throw new Error( + `envPrefix option contains value '', which could lead unexpected exposure of sensitive information.` + ); + } + return envPrefix; +} + +const docsURL = "https://main.vite.dev"; +const deprecationCode = { + removePluginHookSsrArgument: "changes/this-environment-in-hooks", + removePluginHookHandleHotUpdate: "changes/hotupdate-hook", + removeServerModuleGraph: "changes/per-environment-apis", + removeServerHot: "changes/per-environment-apis", + removeServerTransformRequest: "changes/per-environment-apis", + removeSsrLoadModule: "changes/ssr-using-modulerunner" +}; +const deprecationMessages = { + removePluginHookSsrArgument: "Plugin hook `options.ssr` is replaced with `this.environment.config.consumer === 'server'`.", + removePluginHookHandleHotUpdate: "Plugin hook `handleHotUpdate()` is replaced with `hotUpdate()`.", + removeServerModuleGraph: "The `server.moduleGraph` is replaced with `this.environment.moduleGraph`.", + removeServerHot: "The `server.hot` is replaced with `this.environment.hot`.", + removeServerTransformRequest: "The `server.transformRequest` is replaced with `this.environment.transformRequest`.", + removeSsrLoadModule: "The `server.ssrLoadModule` is replaced with Environment Runner." +}; +let _ignoreDeprecationWarnings = false; +function warnFutureDeprecation(config, type, extraMessage, stacktrace = true) { + if (_ignoreDeprecationWarnings || !config.future || config.future[type] !== "warn") + return; + let msg = `[vite future] ${deprecationMessages[type]}`; + if (extraMessage) { + msg += ` ${extraMessage}`; + } + msg = colors$1.yellow(msg); + const docs = `${docsURL}/changes/${deprecationCode[type].toLowerCase()}`; + msg += colors$1.gray(` + ${stacktrace ? "\u251C" : "\u2514"}\u2500\u2500\u2500 `) + colors$1.underline(docs) + "\n"; + if (stacktrace) { + const stack = new Error().stack; + if (stack) { + let stacks = stack.split("\n").slice(3).filter((i) => !i.includes("/node_modules/vite/dist/")); + if (stacks.length === 0) { + stacks.push("No stack trace found."); + } + stacks = stacks.map( + (i, idx) => ` ${idx === stacks.length - 1 ? "\u2514" : "\u2502"} ${i.trim()}` + ); + msg += colors$1.dim(stacks.join("\n")) + "\n"; + } + } + config.logger.warnOnce(msg); +} +function ignoreDeprecationWarnings(fn) { + const before = _ignoreDeprecationWarnings; + _ignoreDeprecationWarnings = true; + const ret = fn(); + _ignoreDeprecationWarnings = before; + return ret; +} + +function prepareError(err) { + return { + message: stripVTControlCharacters(err.message), + stack: stripVTControlCharacters(cleanStack(err.stack || "")), + id: err.id, + frame: stripVTControlCharacters(err.frame || ""), + plugin: err.plugin, + pluginCode: err.pluginCode?.toString(), + loc: err.loc + }; +} +function buildErrorMessage(err, args = [], includeStack = true) { + if (err.plugin) args.push(` Plugin: ${colors$1.magenta(err.plugin)}`); + const loc = err.loc ? `:${err.loc.line}:${err.loc.column}` : ""; + if (err.id) args.push(` File: ${colors$1.cyan(err.id)}${loc}`); + if (err.frame) args.push(colors$1.yellow(pad$1(err.frame))); + if (includeStack && err.stack) args.push(pad$1(cleanStack(err.stack))); + return args.join("\n"); +} +function cleanStack(stack) { + return stack.split(/\n/).filter((l) => /^\s*at/.test(l)).join("\n"); +} +function logError(server, err) { + const msg = buildErrorMessage(err, [ + colors$1.red(`Internal server error: ${err.message}`) + ]); + server.config.logger.error(msg, { + clear: true, + timestamp: true, + error: err + }); + server.environments.client.hot.send({ + type: "error", + err: prepareError(err) + }); +} +function errorMiddleware(server, allowNext = false) { + return function viteErrorMiddleware(err, _req, res, next) { + logError(server, err); + if (allowNext) { + next(); + } else { + res.statusCode = 500; + res.end(` + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="UTF-8" /> + <title>Error + + + diff --git a/seller_1/src/assets/vue.svg b/seller_1/src/assets/vue.svg new file mode 100644 index 0000000..770e9d3 --- /dev/null +++ b/seller_1/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/seller_1/src/components/Footer.vue b/seller_1/src/components/Footer.vue new file mode 100644 index 0000000..ac07ccb --- /dev/null +++ b/seller_1/src/components/Footer.vue @@ -0,0 +1,21 @@ + + + + + + diff --git a/seller_1/src/components/Header.vue b/seller_1/src/components/Header.vue new file mode 100644 index 0000000..ba8553a --- /dev/null +++ b/seller_1/src/components/Header.vue @@ -0,0 +1,59 @@ + + + + + + diff --git a/seller_1/src/main.js b/seller_1/src/main.js new file mode 100644 index 0000000..8698b01 --- /dev/null +++ b/seller_1/src/main.js @@ -0,0 +1,10 @@ +import { createPinia } from 'pinia' +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' +import store from './store' + +const app = createApp(App) +app.use(router) +app.use(createPinia()) +app.mount('#app') diff --git a/seller_1/src/router/index.js b/seller_1/src/router/index.js new file mode 100644 index 0000000..717fb40 --- /dev/null +++ b/seller_1/src/router/index.js @@ -0,0 +1,47 @@ +import { createRouter, createWebHistory } from 'vue-router'; +import Index from '@/views/index.vue' + +const routes = [ + { + path: '/', + name: 'Home', + component: Index, + }, + { + path: '/book-management', + name: 'BookManagement', + component:()=>import ('@/views/BookManagement.vue') + }, + { + path: '/order-management', + name: 'OrderManagement', + component:()=>import ('@/views/OrderManagement.vue') + }, + { + path: '/customer-feedback', + name: 'CustomerFeedback', + component:()=>import ('@/views/CustomerFeedback.vue') + }, + { + path: '/promotion-management', + name: 'PromotionManagement', + component:()=>import ('@/views/PromotionManagement.vue') + }, + { + path: '/data-analytics', + name: 'DataAnalytics', + component:()=>import ('@/views/DataAnalytics.vue') + }, + { + path: '/merchant-info', + name: 'MerchantInfo', + component:()=>import ('@/views/MerchantInfo.vue') + } +]; + +const router = createRouter({ + history: createWebHistory(), + routes, +}); + +export default router; \ No newline at end of file diff --git a/seller_1/src/store/index.js b/seller_1/src/store/index.js new file mode 100644 index 0000000..b005ff5 --- /dev/null +++ b/seller_1/src/store/index.js @@ -0,0 +1,5 @@ +/* import { createPinia } from 'pinia'; + +const store = createPinia(); +export default store; + */ \ No newline at end of file diff --git a/seller_1/src/store/merchantStore.js b/seller_1/src/store/merchantStore.js new file mode 100644 index 0000000..ce60ba3 --- /dev/null +++ b/seller_1/src/store/merchantStore.js @@ -0,0 +1,65 @@ +// src/store/merchantStore.js +/* import { defineStore } from 'pinia' + +export const useMerchantStore = defineStore('merchant', { + state: () => ({ + merchantInfo: { + name: '商家名称', + address: '商家地址', + phone: '商家电话', + email: '商家邮箱', + }, + orders: [], + promotions: [], + customers: [], + analyticsData: { + totalSales: 0, + totalOrders: 0, + customerCount: 0, + }, + }), + + getters: { + // 获取商家信息 + getMerchantInfo: (state) => state.merchantInfo, + + // 订单数量 + orderCount: (state) => state.orders.length, + + // 获取促销活动数量 + promotionCount: (state) => state.promotions.length, + + // 获取客户数量 + customerCount: (state) => state.customers.length, + }, + + actions: { + // 设置商家信息 + setMerchantInfo(info) { + this.merchantInfo = { ...this.merchantInfo, ...info } + }, + + // 添加订单 + addOrder(order) { + this.orders.push(order) + this.analyticsData.totalOrders++ + }, + + // 添加促销活动 + addPromotion(promotion) { + this.promotions.push(promotion) + }, + + // 添加客户 + addCustomer(customer) { + this.customers.push(customer) + this.analyticsData.customerCount++ + }, + + // 更新销售数据 + updateSales(sales) { + this.analyticsData.totalSales += sales + }, + }, +}) + */ \ No newline at end of file diff --git a/seller_1/src/views/BookManagement.vue b/seller_1/src/views/BookManagement.vue new file mode 100644 index 0000000..99a2724 --- /dev/null +++ b/seller_1/src/views/BookManagement.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/seller_1/src/views/CustomerFeedback.vue b/seller_1/src/views/CustomerFeedback.vue new file mode 100644 index 0000000..5c4a53e --- /dev/null +++ b/seller_1/src/views/CustomerFeedback.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/seller_1/src/views/DataAnalytics.vue b/seller_1/src/views/DataAnalytics.vue new file mode 100644 index 0000000..15a12d9 --- /dev/null +++ b/seller_1/src/views/DataAnalytics.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/seller_1/src/views/MerchantInfo.vue b/seller_1/src/views/MerchantInfo.vue new file mode 100644 index 0000000..fcaca91 --- /dev/null +++ b/seller_1/src/views/MerchantInfo.vue @@ -0,0 +1,213 @@ + + + + + diff --git a/seller_1/src/views/OrderManagement.vue b/seller_1/src/views/OrderManagement.vue new file mode 100644 index 0000000..c3ec586 --- /dev/null +++ b/seller_1/src/views/OrderManagement.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/seller_1/src/views/PromotionManagement.vue b/seller_1/src/views/PromotionManagement.vue new file mode 100644 index 0000000..48c72d0 --- /dev/null +++ b/seller_1/src/views/PromotionManagement.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/seller_1/src/views/index.vue b/seller_1/src/views/index.vue new file mode 100644 index 0000000..94cfc66 --- /dev/null +++ b/seller_1/src/views/index.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/seller_1/vite.config.js b/seller_1/vite.config.js new file mode 100644 index 0000000..a5b52dd --- /dev/null +++ b/seller_1/vite.config.js @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; + +export default defineConfig({ + plugins: [vue()], + server: { + port: 3000, // 开发服务器端口 + }, + resolve: { + alias: { + '@': '/src', // 配置路径别名 + }, + }, +}); + diff --git a/seller_1/yarn.lock b/seller_1/yarn.lock new file mode 100644 index 0000000..e87f425 --- /dev/null +++ b/seller_1/yarn.lock @@ -0,0 +1,296 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + +"@babel/parser@^7.25.3": + version "7.26.3" + resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.3.tgz" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== + dependencies: + "@babel/types" "^7.26.3" + +"@babel/types@^7.26.3": + version "7.26.3" + resolved "https://registry.npmmirror.com/@babel/types/-/types-7.26.3.tgz" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@esbuild/win32-x64@0.24.0": + version "0.24.0" + resolved "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz" + integrity sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA== + +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.0" + resolved "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@kurkle/color@^0.3.0": + version "0.3.4" + resolved "https://registry.npmmirror.com/@kurkle/color/-/color-0.3.4.tgz" + integrity sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w== + +"@rollup/rollup-win32-x64-msvc@4.28.1": + version "4.28.1" + resolved "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz" + integrity sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA== + +"@types/estree@1.0.6": + version "1.0.6" + resolved "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + +"@vitejs/plugin-vue@^5.2.1": + version "5.2.1" + resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz" + integrity sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ== + +"@vue/compiler-core@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz" + integrity sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q== + dependencies: + "@babel/parser" "^7.25.3" + "@vue/shared" "3.5.13" + entities "^4.5.0" + estree-walker "^2.0.2" + source-map-js "^1.2.0" + +"@vue/compiler-dom@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz" + integrity sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA== + dependencies: + "@vue/compiler-core" "3.5.13" + "@vue/shared" "3.5.13" + +"@vue/compiler-sfc@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz" + integrity sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ== + dependencies: + "@babel/parser" "^7.25.3" + "@vue/compiler-core" "3.5.13" + "@vue/compiler-dom" "3.5.13" + "@vue/compiler-ssr" "3.5.13" + "@vue/shared" "3.5.13" + estree-walker "^2.0.2" + magic-string "^0.30.11" + postcss "^8.4.48" + source-map-js "^1.2.0" + +"@vue/compiler-ssr@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz" + integrity sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA== + dependencies: + "@vue/compiler-dom" "3.5.13" + "@vue/shared" "3.5.13" + +"@vue/devtools-api@^6.6.3", "@vue/devtools-api@^6.6.4": + version "6.6.4" + resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz" + integrity sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g== + +"@vue/reactivity@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz" + integrity sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg== + dependencies: + "@vue/shared" "3.5.13" + +"@vue/runtime-core@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz" + integrity sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw== + dependencies: + "@vue/reactivity" "3.5.13" + "@vue/shared" "3.5.13" + +"@vue/runtime-dom@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz" + integrity sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog== + dependencies: + "@vue/reactivity" "3.5.13" + "@vue/runtime-core" "3.5.13" + "@vue/shared" "3.5.13" + csstype "^3.1.3" + +"@vue/server-renderer@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz" + integrity sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA== + dependencies: + "@vue/compiler-ssr" "3.5.13" + "@vue/shared" "3.5.13" + +"@vue/shared@3.5.13": + version "3.5.13" + resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz" + integrity sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ== + +chart.js@^4.4.7: + version "4.4.7" + resolved "https://registry.npmmirror.com/chart.js/-/chart.js-4.4.7.tgz" + integrity sha512-pwkcKfdzTMAU/+jNosKhNL2bHtJc/sSmYgVbuGTEDhzkrhmyihmP7vUc/5ZK9WopidMDHNe3Wm7jOd/WhuHWuw== + dependencies: + "@kurkle/color" "^0.3.0" + +csstype@^3.1.3: + version "3.1.3" + resolved "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz" + integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== + +entities@^4.5.0: + version "4.5.0" + resolved "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +esbuild@^0.24.0: + version "0.24.0" + resolved "https://registry.npmmirror.com/esbuild/-/esbuild-0.24.0.tgz" + integrity sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.24.0" + "@esbuild/android-arm" "0.24.0" + "@esbuild/android-arm64" "0.24.0" + "@esbuild/android-x64" "0.24.0" + "@esbuild/darwin-arm64" "0.24.0" + "@esbuild/darwin-x64" "0.24.0" + "@esbuild/freebsd-arm64" "0.24.0" + "@esbuild/freebsd-x64" "0.24.0" + "@esbuild/linux-arm" "0.24.0" + "@esbuild/linux-arm64" "0.24.0" + "@esbuild/linux-ia32" "0.24.0" + "@esbuild/linux-loong64" "0.24.0" + "@esbuild/linux-mips64el" "0.24.0" + "@esbuild/linux-ppc64" "0.24.0" + "@esbuild/linux-riscv64" "0.24.0" + "@esbuild/linux-s390x" "0.24.0" + "@esbuild/linux-x64" "0.24.0" + "@esbuild/netbsd-x64" "0.24.0" + "@esbuild/openbsd-arm64" "0.24.0" + "@esbuild/openbsd-x64" "0.24.0" + "@esbuild/sunos-x64" "0.24.0" + "@esbuild/win32-arm64" "0.24.0" + "@esbuild/win32-ia32" "0.24.0" + "@esbuild/win32-x64" "0.24.0" + +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + +magic-string@^0.30.11: + version "0.30.15" + resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.15.tgz" + integrity sha512-zXeaYRgZ6ldS1RJJUrMrYgNJ4fdwnyI6tVqoiIhyCyv5IVTK9BU8Ic2l253GGETQHxI4HNUwhJ3fjDhKqEoaAw== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + +nanoid@^3.3.7: + version "3.3.8" + resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== + +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +pinia@^2.3.0: + version "2.3.0" + resolved "https://registry.npmmirror.com/pinia/-/pinia-2.3.0.tgz" + integrity sha512-ohZj3jla0LL0OH5PlLTDMzqKiVw2XARmC1XYLdLWIPBMdhDW/123ZWr4zVAhtJm+aoSkFa13pYXskAvAscIkhQ== + dependencies: + "@vue/devtools-api" "^6.6.3" + vue-demi "^0.14.10" + +postcss@^8.4.48, postcss@^8.4.49: + version "8.4.49" + resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.49.tgz" + integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== + dependencies: + nanoid "^3.3.7" + picocolors "^1.1.1" + source-map-js "^1.2.1" + +rollup@^4.23.0: + version "4.28.1" + resolved "https://registry.npmmirror.com/rollup/-/rollup-4.28.1.tgz" + integrity sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg== + dependencies: + "@types/estree" "1.0.6" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.28.1" + "@rollup/rollup-android-arm64" "4.28.1" + "@rollup/rollup-darwin-arm64" "4.28.1" + "@rollup/rollup-darwin-x64" "4.28.1" + "@rollup/rollup-freebsd-arm64" "4.28.1" + "@rollup/rollup-freebsd-x64" "4.28.1" + "@rollup/rollup-linux-arm-gnueabihf" "4.28.1" + "@rollup/rollup-linux-arm-musleabihf" "4.28.1" + "@rollup/rollup-linux-arm64-gnu" "4.28.1" + "@rollup/rollup-linux-arm64-musl" "4.28.1" + "@rollup/rollup-linux-loongarch64-gnu" "4.28.1" + "@rollup/rollup-linux-powerpc64le-gnu" "4.28.1" + "@rollup/rollup-linux-riscv64-gnu" "4.28.1" + "@rollup/rollup-linux-s390x-gnu" "4.28.1" + "@rollup/rollup-linux-x64-gnu" "4.28.1" + "@rollup/rollup-linux-x64-musl" "4.28.1" + "@rollup/rollup-win32-arm64-msvc" "4.28.1" + "@rollup/rollup-win32-ia32-msvc" "4.28.1" + "@rollup/rollup-win32-x64-msvc" "4.28.1" + fsevents "~2.3.2" + +source-map-js@^1.2.0, source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + +"vite@^5.0.0 || ^6.0.0", vite@^6.0.3: + version "6.0.3" + resolved "https://registry.npmmirror.com/vite/-/vite-6.0.3.tgz" + integrity sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw== + dependencies: + esbuild "^0.24.0" + postcss "^8.4.49" + rollup "^4.23.0" + optionalDependencies: + fsevents "~2.3.3" + +vue-demi@^0.14.10: + version "0.14.10" + resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz" + integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg== + +vue-router@^4.5.0: + version "4.5.0" + resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.0.tgz" + integrity sha512-HDuk+PuH5monfNuY+ct49mNmkCRK4xJAV9Ts4z9UFc4rzdDnxQLyCMGGc8pKhZhHTVzfanpNwB/lwqevcBwI4w== + dependencies: + "@vue/devtools-api" "^6.6.4" + +"vue@^2.7.0 || ^3.5.11", "vue@^3.0.0-0 || ^2.6.0", vue@^3.2.0, vue@^3.2.25, vue@3.5.13: + version "3.5.13" + resolved "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz" + integrity sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ== + dependencies: + "@vue/compiler-dom" "3.5.13" + "@vue/compiler-sfc" "3.5.13" + "@vue/runtime-dom" "3.5.13" + "@vue/server-renderer" "3.5.13" + "@vue/shared" "3.5.13"